Class: Yaparc::Nat

Inherits:
Object
  • Object
show all
Includes:
Parsable
Defined in:
lib/yaparc.rb

Constant Summary

Constants included from Parsable

Parsable::IS_ALPHANUM, Parsable::IS_CR, Parsable::IS_DIGIT, Parsable::IS_LOWER, Parsable::IS_SPACE, Parsable::IS_WHITESPACE

Instance Attribute Summary

Attributes included from Parsable

#tree

Instance Method Summary collapse

Methods included from Parsable

#parse

Constructor Details

#initializeNat

Returns a new instance of Nat.



560
561
562
563
564
565
566
567
568
569
570
# File 'lib/yaparc.rb', line 560

def initialize
  @parser = lambda do |input|
    Seq.new(ManyOne.new(Digit.new,'')) do |vs|
      if vs == ""
        0 #            vs
      else
        vs.to_i
      end
    end
  end
end