Class: Peggy::Element

Inherits:
Object
  • Object
show all
Defined in:
lib/builder.rb,
lib/Copy of builder.rb

Overview

Base syntax element class.

Direct Known Subclasses

Literal, Multiple, Positive, Reference, Sequence

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build(*args) ⇒ Object

Create an element.



10
11
12
# File 'lib/builder.rb', line 10

def self::build *args
  new *args
end

Instance Method Details

#match(parser, index) ⇒ Object

Test to see if there is a match of this element at the current index. Return’s the index following if match is found, or NO_MATCH if not



16
17
18
# File 'lib/builder.rb', line 16

def match parser, index
  raise "Must override match"
end

#report(index) ⇒ Object



20
21
22
23
# File 'lib/builder.rb', line 20

def report index
  # puts "#{to_s} #{index}"
  index
end