From 3add402da9fc5b574f34e37e951779212ce28ed1 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Sun, 22 Aug 2021 15:25:54 -0400 Subject: Begin port of tnsl-parse code to native TNSL --- libtnsl/src/reflect/lib.tnsl | 26 ++++++++++++++++++++++++++ libtnsl/src/reflect/type.tnsl | 39 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 libtnsl/src/reflect/lib.tnsl (limited to 'libtnsl') diff --git a/libtnsl/src/reflect/lib.tnsl b/libtnsl/src/reflect/lib.tnsl new file mode 100644 index 0000000..0688e6f --- /dev/null +++ b/libtnsl/src/reflect/lib.tnsl @@ -0,0 +1,26 @@ +/## + Copyright 2021 Kyle Gunger + + Dual licensed under the CDDL 1.0 and BSD 3-Clause licenses. + + This file may only be used in accordance with one of the two + licenses. You should have received a copy of each license with + the source code. In the event that you did not recieve a copy + of the licenses, they may be found at the following URLs: + + CDDL 1.0: + https://opensource.org/licenses/CDDL-1.0 + + BSD 3-Clause: + https://opensource.org/licenses/BSD-3-Clause + + THIS SOFTWARE/SOURCE CODE IS PROVIDED "AS IS" WITH NO + WARRANTY, GUARANTEE, OR CLAIM OF FITNESS FOR ANY PURPOSE + EXPRESS OR IMPLIED +#/ + +: extern const {}_library _LIB_TABLE + +; raw struct _library { + +} \ No newline at end of file diff --git a/libtnsl/src/reflect/type.tnsl b/libtnsl/src/reflect/type.tnsl index d346464..2ed0016 100644 --- a/libtnsl/src/reflect/type.tnsl +++ b/libtnsl/src/reflect/type.tnsl @@ -17,4 +17,41 @@ THIS SOFTWARE/SOURCE CODE IS PROVIDED "AS IS" WITH NO WARRANTY, GUARANTEE, OR CLAIM OF FITNESS FOR ANY PURPOSE EXPRESS OR IMPLIED -#/ \ No newline at end of file +#/ + +; raw struct _type_header { + uint + _lib_index, + _type_index, + + ~{}_type_header + _generic_list +} + +; raw struct _method { + ~void + address +} + +; raw struct _type { + ~{}int + _offsets, + + ~{}uint + _super_offsets, + + ~{}_type + _supers, + + ~{}_method + _methods +} + +/; method _type_header + + /; _is (_type_header base) + ;/ + + /; _get_method () + ;/ +;/ \ No newline at end of file -- cgit v1.2.3