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.

Methods

Included Modules

PluginFactory

Classes and Modules

Class OOParser::Item::Subrule
Class OOParser::Item::Terminal

Constants

SVNRev = %q$Rev: 4 $   SVN Revision
SVNId = %q$Id: item.rb 4 2005-09-08 07:36:41Z ged $   SVN Id

Public Class methods

PluginFactory interface: specify which directories (relative to $LOAD_PATH) to check for this class’s derivatives.

[Source]

# File lib/ooparser/item.rb, line 51
    def self::derivativeDirs
        ["ooparser/items"]
    end

Public Instance methods

Match method: attempt to match the item against the target given the context specified by the parseState.

[Source]

# 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.

[Source]

# File lib/ooparser/item.rb, line 77
    def varnames
        return []
    end

Protected Instance methods

Do the actual match against the item given the specified parseState. This method will raise an error if not overridden by subclasses.

[Source]

# 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

[Validate]