Class: Depager::LALR::AdvancedParser

Inherits:
Parser
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/depager/parser.rb

Direct Known Subclasses

Action, ShiftReducePrinter

Constant Summary

Constants inherited from Parser

Parser::ACC

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Parser

#action_table, #defred_after_shift_table, #defred_table, #goto_table, #int_to_nonterm, #int_to_term, #lex, #nonterm_to_int, #parse, #reduce_table, #term_to_int

Constructor Details

#initialize(inside) ⇒ AdvancedParser

Returns a new instance of AdvancedParser.



202
203
204
205
206
207
# File 'lib/depager/parser.rb', line 202

def initialize(inside)
  @inside          = inside
  @basis           = inside.basis
  @decorator_index = @basis.next_decorator_index
  super()
end

Instance Attribute Details

#basisObject (readonly)

Returns the value of attribute basis.



200
201
202
# File 'lib/depager/parser.rb', line 200

def basis
  @basis
end

#decorator_indexObject (readonly)

Returns the value of attribute decorator_index.



200
201
202
# File 'lib/depager/parser.rb', line 200

def decorator_index
  @decorator_index
end

Instance Method Details

#acceptObject



209
210
211
212
213
# File 'lib/depager/parser.rb', line 209

def accept
  before_accept
  @inside.accept
  after_accept
end

#errorObject



215
216
217
218
219
# File 'lib/depager/parser.rb', line 215

def error
  before_error
  @inside.error
  after_error
end

#reduceObject



227
228
229
230
231
# File 'lib/depager/parser.rb', line 227

def reduce
  before_reduce
  @inside.reduce
  after_reduce
end

#shiftObject



221
222
223
224
225
# File 'lib/depager/parser.rb', line 221

def shift
  before_shift
  @inside.shift
  after_shift
end