How gikaellero/mario-compiler works
This is a small ANTLR-based translator for a Mario-themed programming language. The principal workflow reads source from standard input, parses it, selects a Java or C++ listener from the command-line argument, and emits translated code. The listeners also validate declarations, assignments, types, and scope while translating constructs such as conditionals, loops, input, and output. The grammar is present in the tree, but generated lexer/parser sources are not. Edges reflect the shown compiler calls, listener behavior, and README usage; unsampled grammar details are not inferred.
Main entry points: Compilador.java Compiler entry · Tradutor.java Java translator · TradutorC.java C++ translator · atribuicao.g4 Language grammar
Components 9
Parsing and dispatch
- Compiler entry
Compilador.java - Language grammar
atribuicao.g4 - ANTLR runtime
Target translation
- Java translator
Tradutor.java - C++ translator
TradutorC.java
Semantic checks
- Java semantic checks
Tradutor.java - C++ semantic checks
TradutorC.java
Other components
- Source author
- Generated code
Connections 9
- Source author → Compiler entry: provides source
readme.txt - Compiler entry → ANTLR runtime: creates lexer parser
Compilador.java - Compiler entry → Language grammar: parses language
- Compiler entry → Java translator: selects Java
Compilador.java - Compiler entry → C++ translator: selects C++
Compilador.java - Java translator → Java semantic checks: checks types
Tradutor.java - C++ translator → C++ semantic checks: checks types
TradutorC.java - Java translator → Generated code: prints Java code
Tradutor.java - C++ translator → Generated code: prints C++ code
TradutorC.java