| Class | OOParser::Item::Terminal |
| In: |
lib/ooparser/items/terminal.rb
(CVS)
|
| Parent: | OOParser::Item |
The literal item class. Instances of this class are created when the grammar contains literal text, or when the body of a production is a Regexp.
| SVNRev | = | %q$Rev: 4 $ | SVN Revision | |
| SVNId | = | %q$Id: terminal.rb 4 2005-09-08 07:36:41Z ged $ | SVN Id |
| literal | [R] | The literal pattern used when matching against target text |
Create a new terminal item for the given literal, which can be either a String or a Regexp. The skip pattern is used to specify what characters can be skipped in between word boundaries.
# File lib/ooparser/items/terminal.rb, line 44 def initialize( literal ) if literal.is_a?( Regexp ) @literal = literal else @literal = Regexp::new( Regexp::quote(literal) ) end end