CD 1
CD 1
CD 1
1) Preprocessor
It converts the HLL (high level language) into pure high level language. It includes all
the header files and also evaluates if any macro is included. It is the optional
because if any language which does not support #include and macro, preprocessor
is not required.
2) Compiler
It takes pure high-level language as a input and convert into assembly code.
3) Assembler
1. Allocation:
It means get the memory portions from operating system and storing the
object data.
2. Relocation:
It maps the relative address to the physical address and relocating the object
code.
3. Linker:
It combines all the executable object module to pre single executable file.
4. Loader:
It loads the executable file into permanent storage.
Phases of compiler
It is define as the converting the source code from one form of representation to
another is called phase.
1. Lexical analysis:
It scans the source code and converts the source code into tokens. Here,
input is source code and output is stream of tokens.
2. Syntax Analysis:
After converting the source code into tokens, the next phase comes i.e.
syntax analysis. It checks the grammaratical mistake of the source code. To
verify the syntax of the source code the language must be defined by CFG. It
takes streams of input as a input and generates parse tree.
3. Symantic Analysis:
It verifies the meaning of each and every sentence by performing type check.
Syntax analyzer just verifies whether the operator is operating on required
number of operands or not.
4. Intermediate Code Generator:
The source code is converted into intermediate representation to make code
generation process simple and easy.
5. Code Optimization:
This process includes in reducing the number of instruction without affecting
the outcome of source program.
6. Target Code Generator:
The optimization source code should convert into assembly code.
ADVERTISEMENT
ADVERTISEMENT
Preparation
Aptitude Questions MCQ