Class: Packcr::Parser::LrAnswer

Inherits:
Object
  • Object
show all
Defined in:
lib/packcr/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, pos, pos_loc) ⇒ LrAnswer

Returns a new instance of LrAnswer.



4255
4256
4257
4258
4259
# File 'lib/packcr/parser.rb', line 4255

def initialize(type, pos, pos_loc)
  @type = type
  @pos = pos
  @pos_loc = pos_loc
end

Instance Attribute Details

#chunkObject

Returns the value of attribute chunk.



4252
4253
4254
# File 'lib/packcr/parser.rb', line 4252

def chunk
  @chunk
end

#holdObject

Returns the value of attribute hold.



4252
4253
4254
# File 'lib/packcr/parser.rb', line 4252

def hold
  @hold
end

#lrObject

Returns the value of attribute lr.



4252
4253
4254
# File 'lib/packcr/parser.rb', line 4252

def lr
  @lr
end

#posObject

Returns the value of attribute pos.



4252
4253
4254
# File 'lib/packcr/parser.rb', line 4252

def pos
  @pos
end

#pos_locObject

Returns the value of attribute pos_loc.



4253
4254
4255
# File 'lib/packcr/parser.rb', line 4253

def pos_loc
  @pos_loc
end

#typeObject

Returns the value of attribute type.



4252
4253
4254
# File 'lib/packcr/parser.rb', line 4252

def type
  @type
end

Instance Method Details

#set_chunk(chunk) ⇒ Object



4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
# File 'lib/packcr/parser.rb', line 4261

def set_chunk(chunk)
  a = LrAnswer.new(@type, @pos, @pos_loc)
  if @type == :lr
    a.lr = @lr
  elsif @type == :chunk
    a.chunk = @chunk
  end
  a.hold = @hold
  @hold = a
  @type = :chunk
  @chunk = chunk
end