summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tasm/README.md3
-rw-r--r--tasm/generation/x86/math.tnsl2
-rw-r--r--tasm/generation/x86/x86.tnsl4
-rw-r--r--tnslc/parse/ast.tnsl34
-rwxr-xr-xtnslc/run.sh5
5 files changed, 48 insertions, 0 deletions
diff --git a/tasm/README.md b/tasm/README.md
new file mode 100644
index 0000000..21f7fad
--- /dev/null
+++ b/tasm/README.md
@@ -0,0 +1,3 @@
+# Toat - Tnsl optimizing assembly translator
+
+A program to take in IR and produce optimized assembly for any system as an output
diff --git a/tasm/generation/x86/math.tnsl b/tasm/generation/x86/math.tnsl
new file mode 100644
index 0000000..c042aeb
--- /dev/null
+++ b/tasm/generation/x86/math.tnsl
@@ -0,0 +1,2 @@
+/; addition ()
+;/
diff --git a/tasm/generation/x86/x86.tnsl b/tasm/generation/x86/x86.tnsl
new file mode 100644
index 0000000..45e456e
--- /dev/null
+++ b/tasm/generation/x86/x86.tnsl
@@ -0,0 +1,4 @@
+/; module x86
+ include "math.tnsl"
+ include "call.tnsl"
+;/
diff --git a/tnslc/parse/ast.tnsl b/tnslc/parse/ast.tnsl
index 3cdf269..60676d4 100644
--- a/tnslc/parse/ast.tnsl
+++ b/tnslc/parse/ast.tnsl
@@ -135,10 +135,39 @@ struct Node {
;/
/; _type_helper_func (~utils.File fin, ~Node mod, ~Token first)
+ /; if (first`.eq("(\0") == true)
+ _ast_list_type(fin, mod, first)
+ ;/
+ /; if (first.eq("[\0") == true)
+ _ast_list_type(fin, mod, first)
+ ;/
;/
/; _type_helper_usertype (~utils.File fin, ~Node mod, ~Token first)
+
+ /; loop (bool run = true; run == true && first`._type !== TTYPE_ERR)
+ /; if (first`._type == TTYPE_USRWD)
+ Node utp
+ utp.init(NTYPE_ID, first`.data)
+ first` = produce_next_token(fin, first`)
+
+ /; if (first`._type !== TTYPE_AUG || first`.eq(".\0") == false)
+ run = false
+ ;; else
+ Token tmp = produce_next_token(fin, first`)
+ first`.end()
+ first` = tmp
+ ;/
+ ;; else
+ _ast_print_err(first, "Expected identifier in fully qualified type chain\0")
+ run = false
+ ;/
+ ;/
+
+ /; if (first`._type == TTYPE_DELIM && first`.eq("(\0") == true)
+ _ast_list_type(fin, mod, first)
+ ;/
;/
/; _ast_type (~utils.File fin, ~Node mod, ~Token first)
@@ -151,6 +180,11 @@ struct Node {
# Check to see if this is a function pointer type
/; if (first`.eq("void\0") && typ.sub.count == 0)
+ Node ktp
+ ktp.init(NTYPE_ID, first`.data)
+ typ.sub.push(~ktp)
+ first` = produce_next_token(fin, first`)
+
_type_helper_func(fin, ~typ, first)
mod`.sub.push(~typ)
return
diff --git a/tnslc/run.sh b/tnslc/run.sh
new file mode 100755
index 0000000..8010ab6
--- /dev/null
+++ b/tnslc/run.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+DIR_L=$(pwd)
+
+$DIR_L/out/tnslc $1