| Class | OOParser::Item |
| In: |
lib/ooparser/item.rb
(CVS)
|
| Parent: | Object |
The OOParser::Item class, an abstract factory class for items in a production of a parser.
| SVNRev | = | %q$Rev: 4 $ | SVN Revision | |
| SVNId | = | %q$Id: item.rb 4 2005-09-08 07:36:41Z ged $ | SVN Id |
PluginFactory interface: specify which directories (relative to $LOAD_PATH) to check for this class’s derivatives.
# File lib/ooparser/item.rb, line 51 def self::derivativeDirs ["ooparser/items"] end
Match method: attempt to match the item against the target given the context specified by the parseState.
# File lib/ooparser/item.rb, line 67 def match( parseState ) parseState.item_match( self, &method(:inner_match) ) end
VarSet interface: return an Array of symbolic names (if any) that should be used to represent the results of matching this item in a production’s VarSet. This should be overridden by subclasses; the default returns an empty Array, which tells the VarSet not to include a symbolic name for matches on this item.
# File lib/ooparser/item.rb, line 77 def varnames return [] end
Do the actual match against the item given the specified parseState. This method will raise an error if not overridden by subclasses.
# File lib/ooparser/item.rb, line 89 def inner_match( parseState ) raise NotImplementedError, "required method 'inner_match' not implemented by %s" % [ self.class.name ] end