Running & Building
Klar currently processes one file at a time.
Run
kc run src/main.kl
The Execution Pipeline:
- Lex: Tokenization of source.
- Parse: Abstract Syntax Tree (AST) generation.
- Type-check: Semantic validation.
- Transpile: Conversion to Java source code.
- Compile: Invocation of
javacon the generated source. - Run: Invocation of
javaon the resulting bytecode.
Build only
kc build src/main.kl
This generates output into out/:
*.java*.class
Debugging Commands
Parse only
Used to verify the grammar and AST structure.
kc parse src/main.kl
Lex only
Used to verify tokenization.
kc lex src/main.kl
kc lex src/main.kl -st # or '--show-tokens', both show a token table.