How dj4n0/interprete_pyhtonlike works
This is a standalone C++20 interpreter for a Python-like language subset. The evidenced workflow starts with a source-file argument, tokenizes the file, parses tokens into an AST, then executes the AST and prints results. The graph separates these stages from shared language representations and the command-line entry point. The sampled parser and interpreter show arithmetic, assignments, print, if/elif/else, and while behavior; broader capabilities suggested by the test names are not inferred from unsampled code.
Main entry points: main.cpp Program entry · parser.cpp Syntax parsing · interpreter.cpp Statement execution · lexer.cpp Lexical analysis
Components 10
Command-line entry
- Program entry
main.cpp
Language front end
- Lexical analysis
lexer.cpp - Syntax parsing
parser.cpp
Language representations
- Token model
token.h - AST nodes
ast.h - Token formatting
token.cpp
Execution
- Statement execution
interpreter.cpp
Other components
- User
- Source file
- Standard output
Connections 12
- User → Program entry: provides argument
main.cpp - Source file → Lexical analysis: reads source
lexer.cpp - Program entry → Lexical analysis: tokenizes file
main.cpp - Lexical analysis → Token model: emits tokens
lexer.cpp - Program entry → Syntax parsing: parses tokens
main.cpp - Syntax parsing → Token model: consumes tokens
parser.cpp - Syntax parsing → AST nodes: builds nodes
parser.cpp - Program entry → Statement execution: executes program
main.cpp - Statement execution → AST nodes: evaluates nodes
interpreter.cpp - Program entry → Token formatting: formats token types
main.cpp - Token formatting → Token model: formats types
token.cpp - Statement execution → Standard output: prints results
interpreter.cpp