Pages

Friday, August 2, 2024

What are the phases of a compiler

 1. Lexical analysis (Scanning)

Breaking out the source code into token(keywords, identifiers, operators and literals

The stream of tokens acts as an input to the next phase 

2. Syntax analysis(parsing )

Checks the sequence of the tokens for syntactic errors as per the Grammer rules of the programming language

Constructs a parse tree (syntax) tree that represents the syntactic structure of the program 

3. Semantic analysis

Checks the meaning of each statement as per the language rules 

Ensures the the declaration, types and usage is variables and functions are semantically correct 

Generates an annoyed syntax tree ( AST) with type informs and references 

No comments:

Post a Comment

What is anti- Debugging

  Anti- debugging is how we can stop somebody from debugging our system and getting all the information out of your subsystem.