From 171e1986bb92c0e41f5f8e3672d5de1fc069c27c Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Fri, 6 Aug 2021 19:58:35 -0400 Subject: Initial empty/bare-bones files for implementation --- tnslc/src/tnslc.tnsl | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 tnslc/src/tnslc.tnsl (limited to 'tnslc/src/tnslc.tnsl') 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 -- cgit v1.2.3