public class BasicLexicalElement extends AbstractLexicalElement
TYPE_BOOLEAN, TYPE_DOUBLE, TYPE_IDENTIFIER, TYPE_LONG, TYPE_STRING, TYPE_SYMBOL| Constructor and Description |
|---|
BasicLexicalElement() |
| Modifier and Type | Method and Description |
|---|---|
Boolean |
booleanValue() |
Double |
doubleValue() |
String |
getFileName()
Get the name of the file to which the object is bound to.
|
String |
getLexeme()
Get the original representation of the lexical element the way it was
specified in the source code.
|
int |
getLineNumber()
Get the line number to which the object is bound to.
|
int |
getPosition()
Get the position on the line to which the object is bound to.
|
int |
getType()
Get the type of the lexical element.
|
Boolean |
isBoolean() |
Boolean |
isDouble() |
Boolean |
isIdentifier() |
Boolean |
isLineTerminator() |
Boolean |
isLong() |
Boolean |
isString() |
Boolean |
isSymbol() |
Boolean |
isSymbol(String lexeme)
Return true if the lexical element is a symbol and the lexeme matches the
the actual symbol.
|
Long |
longValue()
Get the long value of the element.
|
void |
setBooleanValue(Boolean booleanValue) |
void |
setDoubleValue(Double doubleValue) |
void |
setFileName(String fileName) |
void |
setLexeme(String lexeme) |
void |
setLineNumber(int lineNumber) |
void |
setLongValue(long longValue) |
void |
setPosition(int position) |
void |
setStringValue(String stringValue) |
void |
setType(int type) |
String |
stringValue()
Get the string value of the lexical element.
|
String |
toString() |
isLiteralConstant, isNumericpublic void setLexeme(String lexeme)
public void setType(int type)
public void setLineNumber(int lineNumber)
public void setFileName(String fileName)
public int getPosition()
SourceLocationBoundpublic void setPosition(int position)
public String getLexeme()
LexicalElementpublic String getFileName()
SourceLocationBoundpublic int getLineNumber()
SourceLocationBoundpublic int getType()
LexicalElementpublic void setStringValue(String stringValue)
public void setLongValue(long longValue)
public void setDoubleValue(Double doubleValue)
public void setBooleanValue(Boolean booleanValue)
public String stringValue()
LexicalElementpublic Long longValue()
LexicalElementpublic Double doubleValue()
public Boolean booleanValue()
public Boolean isBoolean()
public Boolean isString()
public Boolean isDouble()
public Boolean isLong()
public Boolean isIdentifier()
public Boolean isSymbol()
public Boolean isSymbol(String lexeme)
LexicalElementlexeme - to match by the lexical element. The parameter must not ne
null.lexeme.public Boolean isLineTerminator()
Copyright © 2013 Verhas and Verhas Software Craftsmen. All Rights Reserved.