| summaryrefslogtreecommitdiff |
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2020-08-14 00:56:26 +0200 |
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2020-08-14 00:56:26 +0200 |
| commit | 0620617b2cee1f76efc57c9ef464fb8a1bc60e41 (patch) | |
| tree | 3622167b3d8df48ba1c39af6cf941493be8000b0 | |
| parent | b35105f81f862100c274cd5899cb53244168560f (diff) | |
It compiles again...
5 files changed, 19 insertions, 43 deletions
diff --git a/src/core/src/tonkadur/wyrd/v1/compiler/fate/v1/Compiler.java b/src/core/src/tonkadur/wyrd/v1/compiler/fate/v1/Compiler.java index 5c64cd5..4fbe4fe 100644 --- a/src/core/src/tonkadur/wyrd/v1/compiler/fate/v1/Compiler.java +++ b/src/core/src/tonkadur/wyrd/v1/compiler/fate/v1/Compiler.java @@ -28,7 +28,7 @@ public class Compiler compiler.compile_extensions(fate_world); compiler.compile_types(fate_world); - compiler.compile_registers(fate_world); + compiler.compile_variables(fate_world); compiler.compile_main_sequence(fate_world); @@ -74,7 +74,7 @@ public class Compiler } } - protected void compile_registers + protected void compile_variables ( final tonkadur.fate.v1.lang.World fate_world ) @@ -82,11 +82,20 @@ public class Compiler { for ( - final tonkadur.fate.v1.lang.Register register: - fate_world.registers().get_all() + final tonkadur.fate.v1.lang.Variable variable: + fate_world.variables().get_all() ) { - RegisterCompiler.compile(this, register); + final Register r; + + r = + registers.register + ( + TypeCompiler.compile(this, variable.get_type()), + variable.get_name() + ); + + r.set_is_in_use(true); } } @@ -122,7 +131,7 @@ public class Compiler protected void add_registers () throws Throwable { - for (final DictType type: registers.get_context_structures_types()) + for (final DictType type: registers.get_context_structure_types()) { wyrd_world.add_dict_type(type); } diff --git a/src/core/src/tonkadur/wyrd/v1/compiler/fate/v1/InstructionCompiler.java b/src/core/src/tonkadur/wyrd/v1/compiler/fate/v1/InstructionCompiler.java index a138417..6b9e6b9 100644 --- a/src/core/src/tonkadur/wyrd/v1/compiler/fate/v1/InstructionCompiler.java +++ b/src/core/src/tonkadur/wyrd/v1/compiler/fate/v1/InstructionCompiler.java @@ -1412,6 +1412,7 @@ implements tonkadur.fate.v1.lang.meta.InstructionVisitor } collection = collection_cc.get_address(); + elem = elem_cc.get_address(); result.add ( diff --git a/src/core/src/tonkadur/wyrd/v1/compiler/fate/v1/VariableCompiler.java b/src/core/src/tonkadur/wyrd/v1/compiler/fate/v1/VariableCompiler.java deleted file mode 100644 index b24c78b..0000000 --- a/src/core/src/tonkadur/wyrd/v1/compiler/fate/v1/VariableCompiler.java +++ /dev/null @@ -1,31 +0,0 @@ -package tonkadur.wyrd.v1.compiler.fate.v1; - -import tonkadur.error.Error; - -import tonkadur.wyrd.v1.lang.Variable; - -import tonkadur.wyrd.v1.lang.World; - -public class VariableCompiler -{ - /* Utility Class */ - private VariableCompiler () { } - - public static void compile - ( - final Compiler compiler, - final tonkadur.fate.v1.lang.Variable fate_variable - ) - throws Error - { - compiler.world().add_variable - ( - new Variable - ( - fate_variable.get_name(), - fate_variable.get_scope().toString(), - TypeCompiler.compile(compiler, fate_variable.get_type()) - ) - ); - } -} diff --git a/src/core/src/tonkadur/wyrd/v1/lang/Register.java b/src/core/src/tonkadur/wyrd/v1/lang/Register.java index 4dfbf23..cefe711 100644 --- a/src/core/src/tonkadur/wyrd/v1/lang/Register.java +++ b/src/core/src/tonkadur/wyrd/v1/lang/Register.java @@ -4,6 +4,7 @@ import tonkadur.wyrd.v1.lang.type.Type; import tonkadur.wyrd.v1.lang.computation.Constant; import tonkadur.wyrd.v1.lang.computation.Address; +import tonkadur.wyrd.v1.lang.computation.ValueOf; import tonkadur.wyrd.v1.lang.meta.Computation; @@ -50,11 +51,6 @@ public class Register return name; } - public String get_scope () - { - return scope; - } - public Address get_address () { return address; diff --git a/src/core/src/tonkadur/wyrd/v1/lang/World.java b/src/core/src/tonkadur/wyrd/v1/lang/World.java index dd7e07a..cd4bf70 100644 --- a/src/core/src/tonkadur/wyrd/v1/lang/World.java +++ b/src/core/src/tonkadur/wyrd/v1/lang/World.java @@ -2,6 +2,7 @@ package tonkadur.wyrd.v1.lang; import java.util.ArrayList; import java.util.HashMap; +import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -30,7 +31,7 @@ public class World { required_extensions = new HashSet<String>(); - registers = new HashMap<String, Register>(); + registers = new ArrayList<Register>(); sequence_labels = new HashMap<String, Integer>(); dict_types = new HashMap<String, DictType>(); dict_types_in_order = new ArrayList<DictType>(); |


