diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2021-08-06 19:58:35 -0400 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2021-08-06 19:58:35 -0400 |
commit | 171e1986bb92c0e41f5f8e3672d5de1fc069c27c (patch) | |
tree | 3b23fbefa0009b4c6145b388798734afa7cc799f /tnslc/src/tnslc.tnsl | |
parent | dd35976e57081987bee8278d006b2ae48e604f1d (diff) |
Initial empty/bare-bones files for implementation
Diffstat (limited to 'tnslc/src/tnslc.tnsl')
-rw-r--r-- | tnslc/src/tnslc.tnsl | 48 |
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 |