public abstract class BaseParser
extends java_cup.runtime.lr_parser
Modifier and Type | Field and Description |
---|---|
ErrorQueue |
eq |
Lexer |
lexer |
NodeFactory |
nf |
protected Position |
position |
protected Position |
prev_pos |
TypeSystem |
ts |
Constructor and Description |
---|
BaseParser(Lexer l,
TypeSystem t,
NodeFactory n,
ErrorQueue q) |
Modifier and Type | Method and Description |
---|---|
TypeNode |
array(TypeNode n,
int dims)
Return a TypeNode representing a
dims -dimensional
array of n . |
void |
die()
Report a fatal error then abort parsing.
|
void |
die(Position pos)
Report a fatal error then abort parsing.
|
void |
die(java.lang.String msg,
Position pos)
Report a fatal error then abort parsing.
|
protected QualifierNode |
exprToQualifier(Expr e)
Helper for exprToType.
|
TypeNode |
exprToType(Expr e)
Convert
e into a type, yielding a TypeNode . |
java_cup.runtime.Symbol |
nextSymbol()
The standard scanning routine for use in the CUP "scan with"
declaration.
|
Position |
pos(java.util.List<?> l)
Return the source position of the first element in the list to the
last element in the list.
|
Position |
pos(Node n)
Return the source position of the Node.
|
Position |
pos(java.lang.Object first,
java.lang.Object last) |
Position |
pos(java.lang.Object first,
java.lang.Object last,
java.lang.Object noEndDefault) |
Position |
pos(Token t)
Return the position of the Token.
|
Position |
pos(Type n)
Return the source position of the Type.
|
Position |
pos(VarDeclarator n)
Return the source position of the declaration.
|
protected Position |
posForObject(java.lang.Object o) |
Position |
position() |
protected QualifierNode |
prefixToQualifier(Prefix p)
Helper for exprToType.
|
void |
report_fatal_error(java.lang.String message,
java.lang.Object info)
Override the default CUP routine.
|
protected QualifierNode |
typeToQualifier(TypeNode t)
Helper for exprToType.
|
action_table, advance_lookahead, cur_err_token, debug_message, debug_parse, debug_reduce, debug_shift, debug_stack, do_action, done_parsing, dump_stack, EOF_sym, error_recovery, error_sym, error_sync_size, find_recovery_config, get_action, get_reduce, getScanner, getSymbolFactory, init_actions, parse_lookahead, parse, production_table, read_lookahead, reduce_table, report_error, restart_lookahead, scan, setScanner, shift_under_error, start_production, start_state, syntax_error, try_parse_ahead, unpackFromStrings, unrecovered_syntax_error, user_init
public final Lexer lexer
public final ErrorQueue eq
public final TypeSystem ts
public final NodeFactory nf
protected Position prev_pos
protected Position position
public BaseParser(Lexer l, TypeSystem t, NodeFactory n, ErrorQueue q)
public java_cup.runtime.Symbol nextSymbol() throws java.io.IOException
java.io.IOException
public Position position()
public void report_fatal_error(java.lang.String message, java.lang.Object info) throws java.lang.Exception
report_fatal_error
in class java_cup.runtime.lr_parser
java.lang.Exception
public void die(java.lang.String msg, Position pos) throws java.lang.Exception
java.lang.Exception
public void die(Position pos) throws java.lang.Exception
java.lang.Exception
public void die() throws java.lang.Exception
java.lang.Exception
protected Position posForObject(java.lang.Object o)
public Position pos(java.lang.Object first, java.lang.Object last)
public Position pos(java.lang.Object first, java.lang.Object last, java.lang.Object noEndDefault)
public Position pos(java.util.List<?> l)
public Position pos(VarDeclarator n)
public TypeNode array(TypeNode n, int dims) throws java.lang.Exception
dims
-dimensional
array of n
.java.lang.Exception
protected QualifierNode prefixToQualifier(Prefix p) throws java.lang.Exception
java.lang.Exception
protected QualifierNode typeToQualifier(TypeNode t) throws java.lang.Exception
java.lang.Exception
protected QualifierNode exprToQualifier(Expr e) throws java.lang.Exception
java.lang.Exception