The Vee programming language
<input_file>-tPrint tokens-aPrint AST-eEvaluate AST-c <output_runtime_script_file>Compile to Runtime Script
Example:
python3 main.py sample.vee -e -c out.runtime
Node = Object{
type: NodeType
token: Object{
value: string
type: TokenType
line: integer
column: integer
}
children: Node[]
}
| Node Name | Meaning |
|---|---|
| IMPORT | import statement |
| EXPR_LIST | expression list |
| STMT_LIST | statement list |
| OPERATOR | operator |
| IDENT | identifier |
| VALUE | value |
| FUNC_CALL | function call |
| FUNC_DEF | function definition |
| ARG_LIST | argument list |
| FOR | for loop |
| WHILE | while loop |
| IF | if expression |
| RETURN | return statement |
| CLASS | class definition |
TypeType = Enum{
KEY: keyword
IDN: identifier
NUM: number
STR: string
NEL: newline
SYM: symbol
EOF: end of file
}
Node{
type: OPERATOR
token: Token{
value: '+'
type: SYM
}
children: [
Node{<operand>},
Node{<operand>}
]
}
Node{
type: IDENT
token: Token{
value: 'my_var'
type: IDN
}
children: []
}
Node{
type: VALUE
token: Token{
value: 24
type: NUM
}
children: []
}