Class: KPeg::Rule

Inherits:
Object
  • Object
show all
Defined in:
lib/kpeg/grammar.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, op, args = nil) ⇒ Rule

Returns a new instance of Rule.



7
8
9
10
11
# File 'lib/kpeg/grammar.rb', line 7

def initialize(name, op, args=nil)
  @name = name
  @op = op
  @arguments = args
end

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments.



13
14
15
# File 'lib/kpeg/grammar.rb', line 13

def arguments
  @arguments
end

#nameObject (readonly)

Returns the value of attribute name.



13
14
15
# File 'lib/kpeg/grammar.rb', line 13

def name
  @name
end

#opObject (readonly)

Returns the value of attribute op.



13
14
15
# File 'lib/kpeg/grammar.rb', line 13

def op
  @op
end