Question | Answer |
What is the first stage in a compiler? | Lexical analysis. |
What is the input to the lexical analyser? | The source code. |
What is the output from the lexical analyser? | A token stream. |
What is the second stage in the compiler? | Syntax analysis. |
What is the final stage of compilation? | Code generation and optimisation. |
What is remove during lexical analysis? | Whitespace and code comments. |
Where are identifiers placed? | In the symbol table. |
What are tokens? | Tokens are a symbolic representation of the input characters. |
What is the group of characters called which represent a token? | The lexeme. |
Which is the slowest stage of compilation and why? | Lexical analysis, because it deals with the code in its most abstract form. |
What is the purpose of the syntax analysis stage? | To check that the source code is syntactically correct based on the rules of the language (often defined by BNF or syntax diagrams). |
Which stage is the machine code generated? | Code generation and optimisation. |
Want to create your own Flashcards for free with GoConqr? Learn more.