summaryrefslogtreecommitdiff
path: root/tnslc/ast/ast.tnsl
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2022-05-02 02:57:49 -0400
committerKyle Gunger <kgunger12@gmail.com>2022-05-02 02:57:49 -0400
commit46aa6b65376ea62deb1d5ea1611b59dc222a5141 (patch)
treee92b26bc2d2653b9009a230ee1d6b7ed1185e3a0 /tnslc/ast/ast.tnsl
parent9478e157ec2cfe4de704b3bd78b07aee8824774f (diff)
[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
Diffstat (limited to 'tnslc/ast/ast.tnsl')
-rw-r--r--tnslc/ast/ast.tnsl30
1 files changed, 29 insertions, 1 deletions
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