Package | Description |
---|---|
slogo.expression | |
slogo.instruction | |
slogo.parser |
This package is responsible for parsing the language SLogo.
|
Modifier and Type | Class and Description |
---|---|
class |
ArithmeticBase
The "base" or factor of arithmetic instructions (a number or a variable)
|
class |
Number
Represents a number
|
class |
Variable
A variable stores a value and can be used in an expression.
|
Modifier and Type | Class and Description |
---|---|
class |
Addition
Represents a + b, the addition of two expressions
|
class |
ArithmeticInstruction
|
class |
Assignment
An assignment instruction assigns an expression to a variable, updating the
global state to reflect the assignment.
|
class |
BinaryExpression
The base class of any binary expression, e.g., a + b, a - b, or, in future
use, a < b and so on.
|
class |
Division
Represents a / b, the division of two expressions
|
class |
Instruction
Represents an instruction in the SLogo language
|
class |
Multiplication
Represents a x b, the multiplication of two expressions
|
class |
Negation
Represents unary minus, e.g., MINUS num OR -expression
|
class |
Print
The Print instruction prints an expression.
|
class |
Repeat
An AST (abstract syntax tree) for a SLogo REPEAT instruction.
|
class |
StrictInstructionList
A list of instructions that doesn't include a function definition.
|
class |
Subtraction
Represents a subtraction (e.g., lhs - rhs)
|
class |
UnaryExpression
Represents a unary expression
|
Constructor and Description |
---|
Assignment(Variable v,
GrammarElement e)
Construct an Assignment instruction from a variable and an expression,
e.g., X = expression.
|
Print(GrammarElement e)
Represents a Print expression
|
Modifier and Type | Method and Description |
---|---|
GrammarElement |
StrictInstructionListParser.parse(SLogoInterpreter interpreter)
Parses the instructions list
|
GrammarElement |
RepeatParser.parse(SLogoInterpreter interpreter)
Parses a REPEAT instruction
|
GrammarElement |
PrintParser.parse(SLogoInterpreter interpreter)
parses a print instruction
|
GrammarElement |
Parser.parse(SLogoInterpreter parser) |
GrammarElement |
InstructionParser.parse(SLogoInterpreter slogoInterpreter)
gets the appropriate parser to parse the token
|
GrammarElement |
IdentifierParser.parse(SLogoInterpreter interpreter)
parses an assignment statement, which looks like
id = expression
|
GrammarElement |
AssignmentParser.parse(SLogoInterpreter interpreter)
parses an assignment statement, which looks like
id = expression
|