Archon::Utilities::Lexer::RuleSet Class Reference

A set of lexer rules. More...

#include <archon/util/lexer.H>

Collaboration diagram for Archon::Utilities::Lexer::RuleSet:

Collaboration graph
[legend]
List of all members.

Public Member Functions

template<typename L>
void add (const Regex &r, int method, int terminal, L lexemeValue)
 Add a rule.
template<typename L>
void add (const Regex &r, int method, int terminal, Ref< L > lexemeValue)
void add (const Regex &r, int method, int terminal, RefAny lexemeValue)
void add (const Regex &r, int method=-1, int terminal=-1)

Classes

struct  Rule

Detailed Description

A set of lexer rules.

A set of lexer rules must be created before the actual lexer can be created. In fact you must furst create a RuleSet object and add rules to it. Then you must create an Engine object from the rule set, and the finally you can create a lexer by associating an input streem with the engine.

Definition at line 258 of file lexer.H.


Member Function Documentation

template<typename L>
void Archon::Utilities::Lexer::RuleSet::add const Regex r,
int  method,
int  terminal,
lexemeValue
[inline]
 

Add a rule.

Parameters:
method A method index retrieved by calling Actor<C>::registerMethod().
The order of addition defines the relative priority of each rule (regular expression). That is if a prefix of the input matches more than one rule then the one added first is chosen.

Definition at line 286 of file lexer.H.

Referenced by Archon::X3D::VRML::Parser::Parser().


The documentation for this class was generated from the following file:
Generated on Sun Jul 30 22:57:33 2006 for Archon by  doxygen 1.4.4