diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2021-11-01 02:22:29 -0400 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2021-11-01 02:22:29 -0400 |
commit | 705d62fdf1752e94df2071fdea16b41a124a15e6 (patch) | |
tree | 62b0920cc4b70d2f3d2f9504a796abdb89a41e58 /src/texec/world.go | |
parent | 25e716cd730992baae64d7906b1d7eb5119f9d19 (diff) |
[EXEC] Initialize
+ Some initial files for use in the interpreter
Diffstat (limited to 'src/texec/world.go')
-rw-r--r-- | src/texec/world.go | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/texec/world.go b/src/texec/world.go new file mode 100644 index 0000000..7f51c13 --- /dev/null +++ b/src/texec/world.go @@ -0,0 +1,50 @@ +/* + Copyright 2020 Kyle Gunger + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.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. +*/ + +package texec + +// TVaraiable represents a single variable in the program +type TVariable struct { + Type string + Data interface{} +} + +// TPath represents a pointer to the current module and file +// that the thread is working in. +type TPath struct { + module []string, + file string +} + +// TContext represents a single thread. +type TContext struct { + CallStack []Node, + VarMap []map[string]TVariable +} + +// TModule represents a collection of files and sub-modules in a program +type Module struct { + Files []Node, + Globals []map[string]TVariable + Sub []TModule +} + +// TWorld represents the full program +type TWorld struct { + Modules []TModule, + MainPath TPath, + MainFunc Node +}
\ No newline at end of file |