Class: L43Peg::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/l43_peg/parser.rb,
lib/l43_peg/combinators.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#fnObject (readonly)

Returns the value of attribute fn.



6
7
8
# File 'lib/l43_peg/parser.rb', line 6

def fn
  @fn
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/l43_peg/parser.rb', line 6

def name
  @name
end

Instance Method Details

#boxed(box, name: nil, &mapper) ⇒ Object



47
48
# File 'lib/l43_peg/combinators.rb', line 47

def boxed(box, name: nil, &mapper) =
Combinators::Boxed.boxed(self, box, name:, &mapper)

#call(input) ⇒ Object



8
9
10
# File 'lib/l43_peg/parser.rb', line 8

def call(input) 
  fn.(input)
end

#debug(name: nil, level: 10) ⇒ Object



50
51
# File 'lib/l43_peg/combinators.rb', line 50

def debug(name: nil,  level: 10) =
Combinators::DebugParser.debug_parser(parser: self, name:,  level:)

#ignore(name: nil) ⇒ Object



53
54
# File 'lib/l43_peg/combinators.rb', line 53

def ignore(name: nil) = 
Combinators::Ignore.ignore(self, name:)

#lazy(name: nil) ⇒ Object



56
# File 'lib/l43_peg/combinators.rb', line 56

def lazy(name: nil) = Lazy.lazy(self, name:)

#many(name: nil, min: 0, max: nil) ⇒ Object



58
59
# File 'lib/l43_peg/combinators.rb', line 58

def many(name: nil, min: 0, max: nil) =
Combinators::Many.many(self, name:, min:, max:)

#map(name: nil, fn: nil, box: nil, &mapper) ⇒ Object



61
62
# File 'lib/l43_peg/combinators.rb', line 61

def map(name: nil, fn: nil, box: nil, &mapper) =
Combinators::Map.map(self, name:, fn:, box:, &mapper)

#map_error(name: nil, reason: nil) ⇒ Object



64
65
# File 'lib/l43_peg/combinators.rb', line 64

def map_error(name: nil, reason: nil) =
Combinators::MapError.map_error(self, name:, reason:)

#satisfy(name: nil, fn: nil, &satisfier) ⇒ Object



67
68
# File 'lib/l43_peg/combinators.rb', line 67

def satisfy(name: nil, fn: nil, &satisfier) =
Combinators::Satisfy.satisfy(self, name:, fn:, &satisfier)