Module: Yaparc::Parsable
- Included in:
- AbstractParser, Alt, Apply, CR, Char, Digit, Fail, Ident, Identifier, Item, Literal, Many, ManyOne, Nat, Natural, NoFail, Regex, Satisfy, Seq, Space, String, Succeed, Symbol, Tokenize, WhiteSpace, ZeroOne
- Defined in:
- lib/yaparc.rb
Overview
of module Result
Constant Summary collapse
- IS_LOWER =
lambda {|c| c >= 'a' and c <= 'z'}
- IS_ALPHANUM =
lambda {|c| (c >= 'a' and c <= 'z') or (c >= '0' and c <= '9')}
- IS_DIGIT =
lambda {|i| i >= '0' and i <= '9'}
- IS_SPACE =
lambda {|i| i == ' '}
- IS_WHITESPACE =
lambda {|i| i == ' ' or i == "\n" or i == "\t"}
- IS_CR =
lambda {|i| i == "\n"}
Instance Attribute Summary collapse
-
#tree ⇒ Object
Returns the value of attribute tree.
Instance Method Summary collapse
-
#parse(input) ⇒ Object
, &block).
Instance Attribute Details
#tree ⇒ Object
Returns the value of attribute tree.
23 24 25 |
# File 'lib/yaparc.rb', line 23 def tree @tree end |
Instance Method Details
#parse(input) ⇒ Object
, &block)
32 33 34 35 36 37 38 39 40 |
# File 'lib/yaparc.rb', line 32 def parse(input) #, &block) result = @parser.call(input) if result.respond_to?(:parse) result.parse(input) else result end end |