Class: RLTK::Parser::ProdProc

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

Overview

A subclass of Proc that indicates how it should be passed arguments by the parser.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arg_type = :splat, selections = []) ⇒ ProdProc

Returns a new instance of ProdProc.



1576
1577
1578
1579
1580
# File 'lib/rltk/parser.rb', line 1576

def initialize(arg_type = :splat, selections = [])
	super()
	@arg_type   = arg_type
	@selections = selections
end

Instance Attribute Details

#arg_type:array, :splat (readonly)

Returns Method that should be used to pass arguments to this proc.

Returns:

  • (:array, :splat)

    Method that should be used to pass arguments to this proc.



1571
1572
1573
# File 'lib/rltk/parser.rb', line 1571

def arg_type
  @arg_type
end

#selectionsArray<Integer> (readonly)

Returns Mask for selection of tokens to pass to action. Empty mask means pass all.

Returns:

  • (Array<Integer>)

    Mask for selection of tokens to pass to action. Empty mask means pass all.



1574
1575
1576
# File 'lib/rltk/parser.rb', line 1574

def selections
  @selections
end