How daeisbae/aparser works
Main Components
a) Input Processing Layer:
• File Reader (file/)
• String Utilities (stringutil/)
b) Lexical Analysis Layer:
• Lexer (lexer/)
• Token Management (token/)
c) Syntax Analysis Layer:
• Parser (parser/)
• Abstract Syntax Tree (ast/)
• Operator Handling (operator/)
d) Execution Layer:
• Runtime Environment (runtime/)
Component Relationships
a) Primary Flow:
Source Code → File Reader → Lexer → Parser → Runtime
b) Secondary Relationships:
• Token to Lexer (bidirectional as Lexer creates Tokens)
• AST to Parser (Parser creates AST nodes)
• Operator to both Parser and Runtime
[Input Layer]
• ↓
[Lexical Analysis]
• ↓
[Syntax Analysis]
• ↓
[Execution Layer]
Specific Design Elements
• Rectangles: Main components (Lexer, Parser, Runtime)
• Rounded rectangles: Support components (StringUtil, Token, Operator)
• Diamonds: Decision points or major transformations
• Blue: Input processing components
• Green: Lexical analysis components
• Yellow: Syntax analysis components
• Red: Runtime/execution components
• Gray: Utility components
Additional Details
Important elements:
• Version control integration (GitHub Actions)
• Testing framework connections
• Documentation generation (Doxygen)
Component Interactions
Detail the following flows:
Source Code → File Reader
• → StringUtil (for preprocessing)
• → Lexer (produces tokens)
• → Token (defines token types)
• → Parser (processes token stream)
• → AST (builds syntax tree)
• → Operator (handles operations)
• → Runtime (executes AST)