public class Reader
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
Reader.IntBool |
Modifier and Type | Field and Description |
---|---|
static boolean |
debug
Stores whether or not currently giving a verbose diagnostic.
|
Constructor and Description |
---|
Reader(Gulper gulper)
Constructs a lexer object given an input gulper which can be a
file or a string.
|
Modifier and Type | Method and Description |
---|---|
boolean |
currentlyAndEq()
Returns whether or not current token is
Tokes.AND_EQ . |
boolean |
currentlyArrow()
Returns whether or not current token is
Tokes.ARROW . |
boolean |
currentlyBoolean()
Returns whether or not currently looking at a boolean literal.
|
boolean |
currentlyChar()
Returns whether or not currently looking at a char literal.
|
boolean |
currentlyDouble()
Returns whether or not currently looking at a double literal.
|
boolean |
currentlyEOF()
Returns whether or not EOF (End of File) has been reached.
|
boolean |
currentlyEq()
Returns whether or not current token is
Tokes.EQ . |
boolean |
currentlyGTEq()
Returns whether or not current token is
Tokes.GT_EQ . |
boolean |
currentlyIdentifier()
Returns whether or not currently looking a an identifer literal.
|
boolean |
currentlyInt()
Returns whether or not currently looking at an int literal.
|
boolean |
currentlyLL()
Returns whether or not current token is
Tokes.LL . |
boolean |
currentlyLLEq()
Returns whether or not current token is
Tokes.LL_EQ . |
boolean |
currentlyLogicalAnd()
Returns whether or not current token is
Tokes.LOGICAL_AND . |
boolean |
currentlyLogicalOr()
Returns whether or not current token is
Tokes.LOGICAL_OR . |
boolean |
currentlyLTEq()
Returns whether or not current token is
Tokes.LT_EQ . |
boolean |
currentlyMinusEq()
Returns whether or not current token is
Tokes.MINUS_EQ . |
boolean |
currentlyMM()
Returns whether or not current token is
Tokes.MM . |
boolean |
currentlyNotEq()
Returns whether or not current token is
Tokes.NOT_EQ . |
boolean |
currentlyOrEq()
Returns whether or not current token is
Tokes.OR_EQ . |
boolean |
currentlyPercentEq()
Returns whether or not current token is
Tokes.PERCENT_EQ |
boolean |
currentlyPlusEq()
Returns whether or not current token is
Tokes.PLUS_EQ . |
boolean |
currentlyPP()
Returns whether or not current token is
Tokes.PP . |
boolean |
currentlyRR()
Returns whether or not current token is
Tokes.RR . |
boolean |
currentlyRREq()
Returns whether or not current token is
Tokes.RR_EQ . |
boolean |
currentlySlashEq()
Returns whether or not current token is
Tokes.SLASH_EQ . |
boolean |
currentlyStarEq()
Returns whether or not current token is
Tokes.STAR_EQ . |
boolean |
currentlyString()
Returns whether or not currently looking at a string literal.
|
boolean |
currentlyXorEq()
Returns whether or not current token is
Tokes.XOR_EQ . |
int |
currentToken()
Returns the current token code.
|
int |
currentType()
Returns the current token type.
|
java.lang.String |
debugInfo()
Returns a string containing the internal state of the lexer.
|
boolean |
getBoolean()
Returns the current boolean literal.
|
char |
getChar()
Returns the current char literal.
|
double |
getDouble()
Returns the current double literal.
|
java.lang.String |
getFileAndFileLineAndColumn()
Returns the current file file, line and column.
|
int |
getFileLine()
Returns the current file line.
|
java.lang.String |
getFileName()
Returns the current file name.
|
java.lang.String |
getIdentifier()
Returns the current identifier literal.
|
int |
getInt()
Returns the current integer literal.
|
java.lang.String |
getString()
Returns the current string literal.
|
void |
nextToken()
Advances the lexer by one token.
|
void |
prevToken()
Retreats the lexer by one token.
|
void |
seek(int offset)
Sets the current index into the file or string.
|
int |
tell()
Returns the current index into the file or string.
|
public static boolean debug
public Reader(Gulper gulper)
public boolean currentlyEOF()
public boolean currentlyBoolean()
public boolean currentlyChar()
public boolean currentlyInt()
public boolean currentlyDouble()
public boolean currentlyString()
public boolean currentlyIdentifier()
public boolean currentlyMM()
Tokes.MM
.public boolean currentlyPP()
Tokes.PP
.public boolean currentlyLL()
Tokes.LL
.public boolean currentlyRR()
Tokes.RR
.public boolean currentlyArrow()
Tokes.ARROW
.public boolean currentlyStarEq()
Tokes.STAR_EQ
.public boolean currentlySlashEq()
Tokes.SLASH_EQ
.public boolean currentlyPercentEq()
Tokes.PERCENT_EQ
public boolean currentlyPlusEq()
Tokes.PLUS_EQ
.public boolean currentlyMinusEq()
Tokes.MINUS_EQ
.public boolean currentlyLLEq()
Tokes.LL_EQ
.public boolean currentlyRREq()
Tokes.RR_EQ
.public boolean currentlyAndEq()
Tokes.AND_EQ
.public boolean currentlyOrEq()
Tokes.OR_EQ
.public boolean currentlyXorEq()
Tokes.XOR_EQ
.public boolean currentlyLogicalAnd()
Tokes.LOGICAL_AND
.public boolean currentlyLogicalOr()
Tokes.LOGICAL_OR
.public boolean currentlyEq()
Tokes.EQ
.public boolean currentlyNotEq()
Tokes.NOT_EQ
.public boolean currentlyLTEq()
Tokes.LT_EQ
.public boolean currentlyGTEq()
Tokes.GT_EQ
.public int currentType()
public int currentToken()
public boolean getBoolean()
RuntimeException
if not currently looking at a
boolean literal.public char getChar()
RuntimeException
if not currently looking at a
char literal.public int getInt()
RuntimeException
if not currently looking at an
integer literal.public double getDouble()
RuntimeException
if not currently looking at an
double literal.public java.lang.String getIdentifier()
RuntimeException
if not currently looking at an
identifier literal.public java.lang.String getString()
RuntimeException
if not currently looking at a
string literal.public int getFileLine()
public java.lang.String getFileName()
public java.lang.String getFileAndFileLineAndColumn()
public java.lang.String debugInfo()
public int tell()
public void seek(int offset)
public void prevToken()
public void nextToken()