How dipeshkant0/flex-bison-c-parser works
This repository is a small C-like language compiler: source input is tokenized and parsed into an AST, whose operations can be evaluated and whose tree is printed. The README describes semantic analysis, but the parser and lexer implementations were not sampled, so their detailed behavior and call relationships are not verified; documented relationships are cited to the README.
Main entry points: ast.c AST construction and evaluation · main.c Compiler entry · parser.y Syntax parsing · ast.h AST definitions
Components 8
Front end
- Lexical analysis
src/lexer.l - Syntax parsing
src/parser.y
AST and semantics
- AST definitions
src/ast.h - AST construction and evaluation
src/ast.c - Semantic analysis
src
Compiler runtime
- Compiler entry
src/main.c - AST tree output
src/ast.c
Other components
- Source input
Connections 8
- Source input → Compiler entry: provides input
README.md - Compiler entry → Syntax parsing: starts parsing
src/main.c - Lexical analysis → Syntax parsing: supplies tokens
README.md - Syntax parsing → AST construction and evaluation: builds AST
README.md - AST construction and evaluation → AST definitions: uses definitions
src/ast.c - AST construction and evaluation → Semantic analysis: supports analysis
README.md - Compiler entry → AST tree output: prints tree
src/main.c - AST tree output → AST definitions: traverses nodes
src/ast.c