Package mindustry.logic
Class LAssembler
java.lang.Object
mindustry.logic.LAssembler
"Compiles" a sequence of statements into instructions.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic arc.struct.ObjectMap<String,
arc.func.Func<String[], LStatement>> All instructions to be executed.Maps names to variable. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LAssembler
Adds a constant value by name.Registers a variable name mapping.static arc.struct.Seq<LStatement>
Parses a sequence of statements from a string.static String
write
(arc.struct.Seq<LStatement> statements)
-
Field Details
-
customParsers
-
vars
Maps names to variable. -
instructions
All instructions to be executed.
-
-
Constructor Details
-
LAssembler
public LAssembler()
-
-
Method Details
-
assemble
-
write
-
read
Parses a sequence of statements from a string. -
var
- Returns:
- a variable by name. This may be a constant variable referring to a number or object.
-
putConst
Adds a constant value by name. -
putVar
Registers a variable name mapping. -
getVar
-