How misakana/cse340_project03 works
This repository implements a small compiler/interpreter for a structured language: it tokenizes source from standard input, parses statements into an instruction representation, then executes that representation. The main product flow is documented in compiler.h and visible in compiler.cc; demo.cc contains the parser and lexer.cc handles tokenization. The README is empty, so capabilities are inferred from the sampled source. The parser excerpt is partial, limiting detail about some grammar branches.
Main entry points: compiler.cc Instruction Executor · demo.cc Parser and IR Builder · inputbuf.cc Character Buffer · lexer.cc Lexer
Components 7
Front End
- Parser and IR Builder
demo.cc - Lexer
lexer.cc - Instruction Representation
compiler.h
Interpreter Runtime
- Instruction Executor
compiler.cc - Runtime Memory
compiler.cc
Input Handling
- Character Buffer
inputbuf.cc
Other components
- Program Source
Connections 7
- Program Source → Character Buffer: provides characters
inputbuf.cc - Character Buffer → Lexer: supplies characters
lexer.cc - Parser and IR Builder → Lexer: requests tokens
demo.cc - Parser and IR Builder → Instruction Representation: builds instructions
demo.cc - Instruction Executor → Parser and IR Builder: invokes parser
compiler.cc - Instruction Executor → Instruction Representation: executes instructions
compiler.cc - Instruction Executor → Runtime Memory: reads and writes
compiler.cc