Package mindustry.logic
Class LAssembler
java.lang.Object
mindustry.logic.LAssembler
"Compiles" a sequence of statements into instructions.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic ObjectMap<String,
Func<String[], LStatement>> All instructions to be executed.static final int
Maps names to variable IDs. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic LAssembler
Adds a constant value by name.Registers a variable name mapping.static Seq<LStatement>
Parses a sequence of statements from a string.int
static String
write
(Seq<LStatement> statements)
-
Field Details
-
customParsers
-
maxTokenLength
public static final int maxTokenLength- See Also:
-
vars
Maps names to variable IDs. -
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 ID 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
-