Implementation in Java of a micro compiler including:
- Constant and variable declaration.
- Simple expressions.
- Assignment instruction.
- If-then-else condition.
The micro_compiler consists of 2 phases:
- Analysis phase, which includes:
- Lexical analysis, using a pre-defined regular grammar.
- Syntax analysis, using a context-free grammar.
- Semantic analysis, using syntax directed translation.
- Code generation phase: which was integrated in the parser and generates a set of assembly code instructions.