Class Token
java.lang.Object
simula.compiler.utilities.Token
Utility class Token.
Link to GitHub: Source File.
- Author:
- Øystein Myhre Andersen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
The style codes used by Simula Editor. -
Field Summary
FieldsModifier and TypeFieldDescriptionint
The Token's keyWord attributeint
The Token's line numberstatic int
The line number before scan basic.private String
The Token's text attributeThe Token's value attribute -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Get this Token's value string.int
Get this Token's keyword attribute.int
Get this Token's keyword code.Returns the style code for this Token's keyword.getText()
Get this Token's text attribute.getValue()
Get this Token's value attribute.void
Set this Token's text attribute.toString()
-
Field Details
-
text
The Token's text attribute -
keyWord
public int keyWordThe Token's keyWord attribute -
value
The Token's value attribute -
lineNumber
public int lineNumberThe Token's line number -
lineNumberBeforeScanBasic
public static int lineNumberBeforeScanBasicThe line number before scan basic.
-
-
Constructor Details
-
Token
-
Token
Create a new Token.- Parameters:
text
- the Token's text attributekeyWord
- the Token's keyword attribute
-
Token
Create a new Token.- Parameters:
keyWord
- the Token's keyword attributevalue
- the Token's value attribute
-
Token
public Token(int keyWord) Create a new Token.- Parameters:
keyWord
- the Token's keyword attribute
-
Token
public Token()The default constructor.
-
-
Method Details
-
setText
Set this Token's text attribute.- Parameters:
text
- new text attribute
-
getText
-
getStyleCode
Returns the style code for this Token's keyword.- Returns:
- the style code for this Token's keyword
-
getKeyWord
public int getKeyWord()Get this Token's keyword attribute.- Returns:
- this Token's keyword attribute
-
getKeyWordCode
public int getKeyWordCode()Get this Token's keyword code.- Returns:
- this Token's keyword code
-
getValue
-
getIdentifier
-
equals
-
toString
-