do_parse

do_parse() Instance Public methods The entry point of the parser. This method is used with next_token. If Racc wants to get token (and its value), calls next_token. Example: def parse @q = [[1,1], [2,2], [3,3], [false, '$']] do_parse end def next_token @q.shift end

next_token

next_token() Instance Public methods The method to fetch next token. If you use do_parse method, you must implement next_token. The format of return value is [TOKEN_SYMBOL, VALUE]. token-symbol is represented by Ruby's symbol by default, e.g. :IDENT for 'IDENT'. â;â (String) for ';'. The final symbol (End of file) must be false.

on_error

on_error(t, val, vstack) Instance Public methods This method is called when a parse error is found. ERROR_TOKEN_ID is an internal ID of token which caused error. You can get string representation of this ID by calling token_to_str. ERROR_VALUE is a value of error token. value_stack is a stack of symbol values. DO NOT MODIFY this object. This method raises ParseError by default. If this method returns, parsers enter âerror recovering modeâ.

racc_accept

racc_accept() Instance Public methods

racc_e_pop

racc_e_pop(state, tstack, vstack) Instance Public methods

racc_next_state

racc_next_state(curstate, state) Instance Public methods

racc_print_stacks

racc_print_stacks(t, v) Instance Public methods

racc_print_states

racc_print_states(s) Instance Public methods

racc_read_token

racc_read_token(t, tok, val) Instance Public methods For debugging output

racc_reduce

racc_reduce(toks, sim, tstack, vstack) Instance Public methods