public class Parser extends lr_parser
Modifier and Type | Field and Description |
---|---|
protected static short[][] |
_action_table
Parse-action table.
|
protected static short[][] |
_production_table
Production table.
|
protected static short[][] |
_reduce_table
reduce_goto table. |
protected net.sourceforge.czt.parser.z.CUP$Parser$actions |
action_obj
Instance of action encapsulation class.
|
protected DefaultSectionParents |
defaultSP_ |
protected Dialect |
dialect_ |
protected List<CztError> |
errorList_
The list of parse errors.
|
protected ParseException |
parseException_ |
protected SectionInfo |
sectInfo_
Section information (parser code).
|
protected Source |
source_
The file being parsed.
|
_done_parsing, _error_sync_size, action_tab, cur_token, lookahead, lookahead_pos, production_tab, reduce_tab, stack, symbolFactory, tos
Constructor and Description |
---|
Parser()
Default constructor.
|
Parser(CztScanner scanner,
Source source,
SectionInfo sectInfo,
Properties properties,
Collection<? extends Key<?>> explicitDeps)
Creates a new parser with the given scanner, source information,
and section information.
|
Parser(Scanner s)
Constructor which sets the default scanner.
|
Parser(Scanner s,
SymbolFactory sf)
Constructor which sets the default scanner.
|
Modifier and Type | Method and Description |
---|---|
short[][] |
action_table()
Access to parse-action table.
|
protected Factory |
createParserFactory() |
protected ParserState |
createParserState(Source src) |
protected CztError |
createSyntaxError(Symbol token) |
Symbol |
do_action(int act_num,
lr_parser parser,
Stack<Symbol> stack,
int top)
Invoke a user supplied parse action.
|
int |
EOF_sym()
EOF Symbol index. |
int |
error_sym()
error Symbol index. |
CztScanner |
getCztScanner() |
Dialect |
getDialect() |
protected String |
getLoc() |
protected LocInfo |
getLocation(LocAnn locAnn) |
protected LocInfo |
getLocation(Symbol symbol) |
protected LocInfo |
getLocation(net.sourceforge.czt.base.ast.Term term) |
protected boolean |
hasErrors() |
protected void |
init_actions()
Action encapsulation object initializer.
|
protected Symbol |
local_next_token()
Returns the next token.
|
Symbol |
parse() |
short[][] |
production_table()
Access to production table.
|
protected void |
raiseErrors() |
short[][] |
reduce_table()
Access to
reduce_goto table. |
void |
report_error(String message,
Object object) |
void |
report_error(ZParseMessage msg,
Object[] params,
LocInfo locInfo) |
void |
report_syntax_error() |
void |
report_syntax_error(ZParseMessage msg) |
Symbol |
scan()
Scan to get the next Symbol.
|
int |
start_production()
Indicates start production.
|
int |
start_state()
Indicates start state.
|
void |
syntax_error(Symbol token) |
protected Object |
toObject(Symbol symbol) |
void |
unrecovered_syntax_error(Symbol token) |
void |
user_init()
User initialization code.
|
advance_lookahead, cur_err_token, debug_message, debug_parse, debug_reduce, debug_shift, debug_stack, done_parsing, dump_stack, error_recovery, error_sync_size, find_recovery_config, get_action, get_reduce, getScanner, getSymbolFactory, parse_lookahead, read_lookahead, report_fatal_error, restart_lookahead, setScanner, shift_under_error, try_parse_ahead, unpackFromStrings
protected static final short[][] _production_table
protected static final short[][] _action_table
protected static final short[][] _reduce_table
reduce_goto
table.protected net.sourceforge.czt.parser.z.CUP$Parser$actions action_obj
protected Source source_
protected SectionInfo sectInfo_
protected final Dialect dialect_
protected DefaultSectionParents defaultSP_
protected ParseException parseException_
public Parser()
public Parser(Scanner s)
public Parser(Scanner s, SymbolFactory sf)
public Parser(CztScanner scanner, Source source, SectionInfo sectInfo, Properties properties, Collection<? extends Key<?>> explicitDeps)
net.sourceforge.czt.parser.util.OpTable.class
.public short[][] production_table()
production_table
in class lr_parser
public short[][] action_table()
action_table
in class lr_parser
public short[][] reduce_table()
reduce_goto
table.reduce_table
in class lr_parser
protected void init_actions()
init_actions
in class lr_parser
public Symbol do_action(int act_num, lr_parser parser, Stack<Symbol> stack, int top) throws Exception
public int start_state()
start_state
in class lr_parser
public int start_production()
start_production
in class lr_parser
public void user_init() throws Exception
public Dialect getDialect()
protected boolean hasErrors()
protected void raiseErrors() throws ParseException
ParseException
public CztScanner getCztScanner()
protected Symbol local_next_token() throws Exception
Exception
public void report_error(String message, Object object)
report_error
in class lr_parser
ClassCastException
- if the object is not a CztErrorpublic void report_error(ZParseMessage msg, Object[] params, LocInfo locInfo)
public void syntax_error(Symbol token)
syntax_error
in class lr_parser
public void unrecovered_syntax_error(Symbol token)
unrecovered_syntax_error
in class lr_parser
public void report_syntax_error()
public void report_syntax_error(ZParseMessage msg)
protected String getLoc()
protected LocInfo getLocation(net.sourceforge.czt.base.ast.Term term)
protected ParserState createParserState(Source src)
protected Factory createParserFactory()
Copyright © 2003–2016 Community Z Tools Project. All rights reserved.