From 46aa6b65376ea62deb1d5ea1611b59dc222a5141 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Mon, 2 May 2022 02:57:49 -0400 Subject: [TNSLC] AST Updates - Change how string_equate works - Call AST Node generator from main - Flush out ast.tnsl - Add a few initial methods to AST - Move some code from token.tnsl to parse.tnsl --- tnslc/ast/ast.tnsl | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'tnslc/ast/ast.tnsl') diff --git a/tnslc/ast/ast.tnsl b/tnslc/ast/ast.tnsl index 466fe08..bece84e 100644 --- a/tnslc/ast/ast.tnsl +++ b/tnslc/ast/ast.tnsl @@ -15,5 +15,33 @@ #/ /; export module ast - :include "ast/node.tnsl" + :include "ast/block.tnsl" + :include "ast/list.tnsl" + :include "ast/statement.tnsl" + :include "ast/tree.tnsl" + :include "ast/value.tnsl" ;/ + +;{}charp CNULL = "" + +# AST node (non-block) +;struct Node { + tnslc.Token + # associated token to the node + tok, + + ~{}Node + # sub-nodes + sub +} + +;enum NODE_TYPE [int] { + FILE = 9, + TYPE = 10, + VALUE = 11, + DEFN = 12, + + #... + + PREP = 1000 +} \ No newline at end of file -- cgit v1.2.3