public class RedCodeLineParser
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
protected |
RedCodeLineParser(java.lang.String line)
Parses a raw string line of RedCode.
|
| Modifier and Type | Method and Description |
|---|---|
protected Field |
getField(int fieldAorB)
Gets the field a or b ([Field.a] = 0, [Field.b] = 1)
|
protected InstructionCode |
getInstr()
Gets InstructionCode ENUM of parsed line.
|
protected java.lang.String |
getLable()
Gets line describing label if it exists and false if not.
|
protected Modifiers |
getModifier()
Gets modifier.
|
protected boolean |
hasError()
Is true in case this parse line has an error.
|
protected boolean |
hasLabel()
Is true in case this parse line has a line describing label.
|
protected boolean |
isEmpty()
Is true in case this parse line is empty.
|
protected java.lang.String |
listError()
Lists all errors as a debugging recommendation.
|
java.lang.String |
toString()
String output of the parsed line with numeral value Fields or Field
labels if possible.
|
protected RedCodeLineParser(java.lang.String line)
throws java.io.IOException
line - empty lines are not parsed but the emptyLine value is set to
true.java.io.IOException - In case fieldNumFromString() fails.InstructionCode,
Modifiers,
AddressingModeprotected boolean isEmpty()
protected boolean hasLabel()
protected java.lang.String getLable()
protected InstructionCode getInstr()
protected Field getField(int fieldAorB)
fieldAorB - must be 0 or 1 (recommended Field.a / Field.b)Fieldpublic java.lang.String toString()
toString in class java.lang.Objectprotected boolean hasError()
protected java.lang.String listError()