summaryrefslogtreecommitdiff
path: root/tnslc/src/tnslc.tnsl
diff options
context:
space:
mode:
Diffstat (limited to 'tnslc/src/tnslc.tnsl')
-rw-r--r--tnslc/src/tnslc.tnsl48
1 files changed, 48 insertions, 0 deletions
diff --git a/tnslc/src/tnslc.tnsl b/tnslc/src/tnslc.tnsl
new file mode 100644
index 0000000..9f3d53a
--- /dev/null
+++ b/tnslc/src/tnslc.tnsl
@@ -0,0 +1,48 @@
+/##
+ Copyright 2020-2021 Kyle Gunger
+
+ Licensed under the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE
+ (CDDL) Version 1.0 (the "License"). You may not use this file
+ except in compliance with the License. You may obtain a copy of
+ the License at
+
+ https://opensource.org/licenses/CDDL-1.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied.
+
+ See the License for the specific language governing permissions
+ and limitations under the License.
+#/
+
+/; export module tnslc
+ :import "flags"
+ :import "parse"
+ :import "ast"
+ :import "compile"
+;/
+
+:using 'tnsl'
+:using 'tnslc'
+
+/; main (~{}{}char args) [int]
+ ;var arg_list = flags.parse(args)
+
+ ;var token_list = parse.tokenize(arg_list)
+
+ ;var ast = ast.generate(token_list)
+
+ /; try
+ ;var out_file = file.open(arg_list.output_file_path)
+ ;var data = compile.generate(arg_list, ast)
+
+ ;out_file.write(data)
+ ;out_file.close()
+
+ ;; catch (error e)
+ ;io.stdout.write(e.msg)
+ ;return e.code
+ ;/
+;/ \ No newline at end of file