Last active
March 7, 2024 10:23
-
-
Save lantos1618/09eebea2a7d08e1bfc9429138a97137d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Literal: | |
// IntLiteral(int), | |
// FloatLiteral(float), | |
// BoolLiteral(bool), | |
// StringLiteral(string) | |
// Variable: | |
// name: string | |
// type: TypeDesc | |
// Assign: | |
// name: string, | |
// value: Expr | |
// BinaryOp: | |
// Add, | |
// Sub, | |
// ... | |
// Binary: | |
// op: BinaryOp, | |
// lhs: Expr, | |
// rhs: Expr | |
// Block: [Expr] | |
// If: | |
// cond: Expr, | |
// then: Block, | |
// else: Option<Block> | |
// Loop: | |
// cond: Expr, | |
// body: Block | |
// TypeDesc: | |
// IntKind, | |
// FloatKind, | |
// BoolKind, | |
// StringKind, | |
// VoidKind, | |
// ArrayKind(TypeDesc), | |
// FuncKind([TypeDesc], TypeDesc) | |
// StructKind(string, [FieldDesc]) | |
// Param, FieldDesc: | |
// name: string, | |
// type: TypeDesc | |
// Return: | |
// value: Expr | |
// FuncDecl: | |
// name: string, | |
// params: [Param] | |
// return_type: TypeDesc | |
// FuncDef: FuncDecl, | |
// body: Block | |
// FuncCall: | |
// name: string, | |
// args: Block | |
// Scope: | |
// parent: Option<Scope>, | |
// vars: Map<string, TypeDesc> | |
// Expr: | |
// value: | |
// Literal(Literal), | |
// Assign(Assign), | |
// Binary(Binary), | |
// Block(Block), | |
// If(If), | |
// Loop(Loop) | |
// TypeDesc(TypeDesc), | |
// Param(Param), | |
// FuncReturn(Expr), | |
// FuncDecl(FuncDecl), | |
// FuncDef(FuncDef), | |
// FuncCall(FuncCall), | |
// scope: Scope | |
// Literal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment