Package java_cup
Class parser
- java.lang.Object
-
- java_cup.runtime.lr_parser
-
- java_cup.parser
-
public class parser extends lr_parser
-
-
Field Summary
Fields Modifier and Type Field Description protected static short[][]
_action_table
parse action tableprotected static short[][]
_production_table
production tableprotected static short[][]
_reduce_table
reduce_goto tableprotected java_cup.CUP$actions
action_obj
instance of action encapsulation class-
Fields inherited from class java_cup.runtime.lr_parser
_done_parsing, _error_sync_size, action_tab, cur_token, lookahead, lookahead_pos, production_tab, reduce_tab, stack, tos
-
-
Constructor Summary
Constructors Constructor Description parser()
constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description short[][]
action_table()
access to parse action tablesymbol
do_action(int act_num, lr_parser parser, java.util.Stack stack, int top)
invoke a user supplied parse actionint
EOF_sym()
EOF symbol indexint
error_sym()
error symbol indexprotected void
init_actions()
action encapsulation object initializershort[][]
production_table()
access to production tableshort[][]
reduce_table()
access to reduce_goto tablevoid
report_error(java.lang.String message, java.lang.Object info)
Report a non fatal error (or warning).void
report_fatal_error(java.lang.String message, java.lang.Object info)
Report a fatal error.token
scan()
scan to get the next tokenint
start_production()
start productionint
start_state()
start statevoid
user_init()
user initialization-
Methods inherited from class java_cup.runtime.lr_parser
advance_lookahead, cur_err_token, debug_message, debug_parse, debug_reduce, debug_shift, done_parsing, dump_stack, error_recovery, error_sync_size, find_recovery_config, get_action, get_reduce, parse, parse_lookahead, read_lookahead, restart_lookahead, shift_under_error, syntax_error, try_parse_ahead, unrecovered_syntax_error
-
-
-
-
Field Detail
-
_production_table
protected static final short[][] _production_table
production table
-
_action_table
protected static final short[][] _action_table
parse action table
-
_reduce_table
protected static final short[][] _reduce_table
reduce_goto table
-
action_obj
protected java_cup.CUP$actions action_obj
instance of action encapsulation class
-
-
Method Detail
-
production_table
public short[][] production_table()
access to production table- Specified by:
production_table
in classlr_parser
-
action_table
public short[][] action_table()
access to parse action table- Specified by:
action_table
in classlr_parser
- See Also:
lr_parser.get_action(int, int)
-
reduce_table
public short[][] reduce_table()
access to reduce_goto table- Specified by:
reduce_table
in classlr_parser
- See Also:
lr_parser.get_reduce(int, int)
-
init_actions
protected void init_actions()
action encapsulation object initializer- Specified by:
init_actions
in classlr_parser
-
do_action
public symbol do_action(int act_num, lr_parser parser, java.util.Stack stack, int top) throws java.lang.Exception
invoke a user supplied parse action
-
start_state
public int start_state()
start state- Specified by:
start_state
in classlr_parser
-
start_production
public int start_production()
start production- Specified by:
start_production
in classlr_parser
-
user_init
public void user_init() throws java.lang.Exception
user initialization
-
scan
public token scan() throws java.lang.Exception
scan to get the next token
-
report_fatal_error
public void report_fatal_error(java.lang.String message, java.lang.Object info)
Description copied from class:lr_parser
Report a fatal error. This method takes a message string and an additional object (to be used by specializations implemented in subclasses). Here in the base class a very simple implementation is provided which reports the error then throws an exception.- Overrides:
report_fatal_error
in classlr_parser
- Parameters:
message
- an error message.info
- an extra object reserved for use by specialized subclasses.
-
report_error
public void report_error(java.lang.String message, java.lang.Object info)
Description copied from class:lr_parser
Report a non fatal error (or warning). This method takes a message string and an additional object (to be used by specializations implemented in subclasses). Here in the base class a very simple implementation is provided which simply prints the message to System.err.- Overrides:
report_error
in classlr_parser
- Parameters:
message
- an error message.info
- an extra object reserved for use by specialized subclasses.
-
-