1/16
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Compilation
involves translating high-level code into machine code using a compiler.
Pure interpretation
executes the original source code directly using an interpreter.
• Hybrid implementation
combines both methods. It translates high-level code into an intermediate representation, which is then interpreted.
Lexical analysis
also known as scanning, is the first phase of processing source code. It converts the raw source code into tokens
syntax analyzer
takes the generated tokens and verifies whether they follow the grammatical rules of the programming language.
lexical analyzer
is a pattern matcher that identifies tokens.
Simplicity
Efficiency
Portability
separate lexical analysis from syntax analysis to improve:
state diagram
represents a finite automaton used for token recognition.
Terminal Symbols
These are keywords, operators, or punctuation marks that cannot be broken down further.
Non Terminal Symbols
are like the branches of a tree—abstract structures built by combining terminals or other nonterminals.
Bottom-up parsing
is a technique used in syntax analysis of programming languages, where the parser starts with the input and works backward to reconstruct the parse tree
reconstruct a rightmost derivation in reverse.
LR parser
The most well-known bottom-up parsing algorithm
Rightmost Derivation
means we always expand (replace) the rightmost non-terminal first at each step.
Recursive-descent parsing
is a top-down parsing method used in syntax analysis for programming languages
It consists of a set of recursive rules, each corresponding to a nonterminal symbol in a grammar and produces a parse tree in top-down order.
Top-down parsers
Construct leftmost derivations and a parse tree in top-down order.
Syntax analysis
is a common part of language implementation, regardless of the implementation approach used. It is normally based on a formal syntax description of the language being implemented.
BNF (Backus-Naur Form)
The most common approach for describing syntax is a context-free grammar, also known as