|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cs132.vapor.parser.VaporParser
public class VaporParser
The JavaCC-generated parser. Use the static run
method.
Field Summary | |
---|---|
static int |
Anything
RegularExpression Id. |
static int |
BlockComment
RegularExpression Id. |
static int |
BraceComment
RegularExpression Id. |
static int |
CodeLabelIdent
RegularExpression Id. |
static int |
DEFAULT
Lexical state. |
static int |
Digit
RegularExpression Id. |
static int |
Digits
RegularExpression Id. |
static int |
EOF
End of File. |
static int |
Eol
RegularExpression Id. |
static int |
EscapeBackslash
RegularExpression Id. |
static int |
EscapeQuote
RegularExpression Id. |
static int |
Ident
RegularExpression Id. |
static int |
IdentHead
RegularExpression Id. |
static int |
IdentRest
RegularExpression Id. |
cs132.vapor.parser.Token |
jj_nt
Next token. |
static int |
LabelRefIdent
RegularExpression Id. |
static int |
LineComment
RegularExpression Id. |
static int |
LitStr
RegularExpression Id. |
static int |
LitStrStart
RegularExpression Id. |
static int |
NegDigits
RegularExpression Id. |
static int |
NormalStringContent
RegularExpression Id. |
static int |
PlainIdent
RegularExpression Id. |
static int |
RegIdent
RegularExpression Id. |
cs132.vapor.parser.Token |
token
Current token. |
cs132.vapor.parser.VaporParserTokenManager |
token_source
Generated Token Manager. |
static String[] |
tokenImage
Literal token values. |
static int |
WITHIN_STRING
Lexical state. |
Constructor Summary | |
---|---|
VaporParser(InputStream stream)
Constructor with InputStream. |
|
VaporParser(InputStream stream,
String encoding)
Constructor with InputStream and supplied encoding |
|
VaporParser(Reader stream)
Constructor. |
|
VaporParser(cs132.vapor.parser.VaporParserTokenManager tm)
Constructor with generated Token Manager. |
Method Summary | |
---|---|
void |
disable_tracing()
Disable tracing. |
void |
enable_tracing()
Enable tracing. |
ParseException |
generateParseException()
Generate ParseException. |
cs132.vapor.parser.Token |
getNextToken()
Get the next Token. |
cs132.vapor.parser.Token |
getToken(int index)
Get the specific Token. |
void |
ReInit(InputStream stream)
Reinitialise. |
void |
ReInit(InputStream stream,
String encoding)
Reinitialise. |
void |
ReInit(Reader stream)
Reinitialise. |
void |
ReInit(cs132.vapor.parser.VaporParserTokenManager tm)
Reinitialise. |
static VaporProgram |
run(Reader input,
int line,
int col,
Iterable<VBuiltIn.Op> ops,
boolean allowLocals,
String[] registers,
boolean allowStack)
Run the parser on the given input. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public cs132.vapor.parser.VaporParserTokenManager token_source
public cs132.vapor.parser.Token token
public cs132.vapor.parser.Token jj_nt
public static final int EOF
public static final int LineComment
public static final int BlockComment
public static final int BraceComment
public static final int Digit
public static final int Digits
public static final int NegDigits
public static final int IdentHead
public static final int IdentRest
public static final int Eol
public static final int LitStrStart
public static final int LitStr
public static final int EscapeQuote
public static final int EscapeBackslash
public static final int NormalStringContent
public static final int Ident
public static final int RegIdent
public static final int CodeLabelIdent
public static final int LabelRefIdent
public static final int PlainIdent
public static final int Anything
public static final int DEFAULT
public static final int WITHIN_STRING
public static final String[] tokenImage
Constructor Detail |
---|
public VaporParser(InputStream stream)
public VaporParser(InputStream stream, String encoding)
public VaporParser(Reader stream)
public VaporParser(cs132.vapor.parser.VaporParserTokenManager tm)
Method Detail |
---|
public static VaporProgram run(Reader input, int line, int col, Iterable<VBuiltIn.Op> ops, boolean allowLocals, String[] registers, boolean allowStack) throws IOException, ProblemException
input
- The input source.line
- The line number the input starts at (typically 1)col
- The column number the input starts at (typically 1)ops
- The list of built-in operations the program is allowed to use.
For example: VBuiltIn.Op.Add
.allowLocals
- Whether the program is allowed to use local variables.registers
- The set of global registers the program is allowed to use.
Setting this to 'null' means registers are not allowed.allowStack
- Whether the program is allowed to use the stack explicitly.
IOException
- If there's an I/O error when reading from the input source.
ProblemException
- If there's a syntax error in the input.public void ReInit(InputStream stream)
public void ReInit(InputStream stream, String encoding)
public void ReInit(Reader stream)
public void ReInit(cs132.vapor.parser.VaporParserTokenManager tm)
public final cs132.vapor.parser.Token getNextToken()
public final cs132.vapor.parser.Token getToken(int index)
public ParseException generateParseException()
public final void enable_tracing()
public final void disable_tracing()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |