~ubuntu-branches/ubuntu/quantal/ruby1.9.1/quantal

« back to all changes in this revision

Viewing changes to lib/racc/parser.rb

  • Committer: Bazaar Package Importer
  • Author(s): Lucas Nussbaum
  • Date: 2011-09-24 19:16:17 UTC
  • mfrom: (1.1.8 upstream) (13.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20110924191617-o1qz4rcmqjot8zuy
Tags: 1.9.3~rc1-1
* New upstream release: 1.9.3 RC1.
  + Includes load.c fixes. Closes: #639959.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
  class Parser
32
32
 
33
 
    Racc_Runtime_Version = '1.4.5'
 
33
    Racc_Runtime_Version = '1.4.6'
34
34
    Racc_Runtime_Revision = %w$originalRevision: 1.8 $[1]
35
35
 
36
 
    Racc_Runtime_Core_Version_R = '1.4.5'
 
36
    Racc_Runtime_Core_Version_R = '1.4.6'
37
37
    Racc_Runtime_Core_Revision_R = %w$originalRevision: 1.8 $[1]
38
38
    begin
39
39
      require 'racc/cparse'
95
95
    ### do_parse
96
96
    ###
97
97
 
 
98
    class_eval %{
98
99
    def do_parse
99
 
      __send__(Racc_Main_Parsing_Routine, _racc_setup(), false)
 
100
      #{Racc_Main_Parsing_Routine}(_racc_setup(), false)
100
101
    end
 
102
    }
101
103
 
102
104
    def next_token
103
105
      raise NotImplementedError, "#{self.class}\#next_token is not defined"
105
107
 
106
108
    def _racc_do_parse_rb(arg, in_debug)
107
109
      action_table, action_check, action_default, action_pointer,
108
 
      goto_table,   goto_check,   goto_default,   goto_pointer,
109
 
      nt_base,      reduce_table, token_table,    shift_n,
110
 
      reduce_n,     use_result,   * = arg
 
110
      _,            _,            _,              _,
 
111
      _,            _,            token_table,    _,
 
112
      _,            _,            * = arg
111
113
 
112
114
      _racc_init_sysvars
113
115
      tok = act = i = nil
114
 
      nerr = 0
115
116
 
116
117
      catch(:racc_end_parse) {
117
118
        while true
148
149
    ### yyparse
149
150
    ###
150
151
 
 
152
    class_eval %{
151
153
    def yyparse(recv, mid)
152
 
      __send__(Racc_YY_Parse_Method, recv, mid, _racc_setup(), true)
 
154
      #{Racc_YY_Parse_Method}(recv, mid, _racc_setup(), true)
153
155
    end
 
156
    }
154
157
 
155
158
    def _racc_yyparse_rb(recv, mid, arg, c_debug)
156
159
      action_table, action_check, action_default, action_pointer,
157
 
      goto_table,   goto_check,   goto_default,   goto_pointer,
158
 
      nt_base,      reduce_table, token_table,    shift_n,
159
 
      reduce_n,     use_result,   * = arg
 
160
      _,             _,            _,              _,
 
161
      _,            _,            token_table,    _,
 
162
      _,            _,            * = arg
160
163
 
161
164
      _racc_init_sysvars
162
165
      act = nil
163
166
      i = nil
164
 
      nerr = 0
165
167
 
166
168
      catch(:racc_end_parse) {
167
169
        until i = action_pointer[@racc_state[-1]]
210
212
    ###
211
213
 
212
214
    def _racc_evalact(act, arg)
213
 
      action_table, action_check, action_default, action_pointer,
214
 
      goto_table,   goto_check,   goto_default,   goto_pointer,
215
 
      nt_base,      reduce_table, token_table,    shift_n,
216
 
      reduce_n,     use_result,   * = arg
 
215
      action_table, action_check, _, action_pointer,
 
216
      _,   _, _, _,
 
217
      _,   _, _, shift_n,  reduce_n,
 
218
      _,   _, * = arg
217
219
      nerr = 0   # tmp
218
220
 
219
221
      if act > 0 and act < shift_n
305
307
    end
306
308
 
307
309
    def _racc_do_reduce(arg, act)
308
 
      action_table, action_check, action_default, action_pointer,
 
310
      _, _, _, _,
309
311
      goto_table,   goto_check,   goto_default,   goto_pointer,
310
 
      nt_base,      reduce_table, token_table,    shift_n,
311
 
      reduce_n,     use_result,   * = arg
 
312
      nt_base,      reduce_table, _,    _,
 
313
      _,     use_result,   * = arg
312
314
      state = @racc_state
313
315
      vstack = @racc_vstack
314
316
      tstack = @racc_tstack