Class: Pegex::Tree

Inherits:
Receiver show all
Defined in:
lib/pegex/tree.rb

Direct Known Subclasses

Pegex::AST, Wrap

Defined Under Namespace

Classes: Wrap

Instance Attribute Summary

Attributes inherited from Receiver

#parser

Instance Method Summary collapse

Methods inherited from Receiver

#flatten

Instance Method Details

#final(got = nil) ⇒ Object



14
15
16
# File 'lib/pegex/tree.rb', line 14

def final got=nil
  return got || []
end

#gotrule(got = nil) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/pegex/tree.rb', line 4

def gotrule got=nil
  return Pegex::Constant::Null if got.nil?

  if self.parser.parent['-wrap']
    return {self.parser.rule => (got || [])}
  else
    return got
  end
end