A minimal compiler for the miniJava language, built as part of a compiler design course. It features a full pipeline: lexical analysis, parsing, AST generation, semantic analysis, IR generation, control flow graph generation, and bytecode interpretation.
- Lexical Analysis using Flex
- Parsing using Bison
- AST construction
- Semantic analysis with custom Symbol Table
- Intermediate Representation (IR) generation
- Control Flow Graph (CFG) output
- Bytecode generation and interpretation
lexer.flex: Lexical analyzer (tokens)parser.yy: Parser (grammar rules)Node.h: AST structure and DOT generatorsymbolT.cc: Symbol table & semantic analysisIR.cc: IR generation and CFG creationinterpreter.cc: Stack-based bytecode interpretermain.cc: Compiler driver
makemake interpreter./compiler <miniJavaFileName>./interpreter <output.class>