How koutarou4096/g-tracer works
This browser-based pseudo-language tracer helps exam learners inspect program execution and convert programs to code. The main workflow is to enter a program and initial values, parse the program into an AST, execute it with tracing, and view the resulting state table. A separate code-generation branch produces Python; the README also documents Java generation as implemented in JavaScript, though its page button is not yet present. The excerpts show the main calls; the page markup and unsampled generator details were not inspected.
Main entry points: app.js Run and convert controls · interpreter.js Trace interpreter · index.html Tracer page · codegen.js Python generator
Components 11
User interface
- Tracer page
index.html - Run and convert controls
app.js - Trace table
app.js
Language processing
- Program parser
parser.js - Initial values
interpreter.js
Execution and generation
- Trace interpreter
interpreter.js - Python generator
codegen.js - Java generator
codegen.js - Python output
- Java output
Other components
- Learner
Connections 11
- Learner → Tracer page: uses
README.md - Tracer page → Run and convert controls: hosts controls
app.js - Run and convert controls → Program parser: parses program
app.js - Run and convert controls → Initial values: parses values
app.js - Run and convert controls → Trace interpreter: runs AST
app.js - Run and convert controls → Trace table: renders trace
app.js - Trace interpreter → Trace table: returns trace
app.js - Run and convert controls → Python generator: generates Python
app.js - Python generator → Python output: produces code
README.md - Java generator → Java output: produces code
README.md - Trace interpreter → Program parser: parses constants
interpreter.js