Class: Peggy::Element
- Inherits:
-
Object
- Object
- Peggy::Element
- Defined in:
- lib/parse/builder.rb
Overview
Base syntax element class.
Class Method Summary collapse
-
.build(*args) ⇒ Object
Create an element.
Instance Method Summary collapse
-
#match(parser, index) ⇒ Object
Test to see if there is a match of this element at the current index.
-
#report(index) ⇒ Object
Used for debugging.
Class Method Details
.build(*args) ⇒ Object
Create an element.
17 18 19 |
# File 'lib/parse/builder.rb', line 17 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
23 24 25 |
# File 'lib/parse/builder.rb', line 23 def match parser, index raise "Must override match" end |
#report(index) ⇒ Object
Used for debugging.
28 29 30 31 |
# File 'lib/parse/builder.rb', line 28 def report index # puts "#{to_s} #{index}" index end |