Archon::Utilities::LexerBase Struct Reference

An abstract base class for lexers. More...

#include <archon/util/lexer.H>

Inheritance diagram for Archon::Utilities::LexerBase:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual ~LexerBase ()
virtual void getNext (Lexeme &l)=0
 Extract the next lexeme from the input.
virtual ustring getText () const =0
virtual int getType () const =0

Classes

struct  InputException
struct  Lexeme

Detailed Description

An abstract base class for lexers.

An abstract base class for lexers defining a lexeme object and a virtual method to fetch the next lexeme.

A lexer derived from LexerBase is required by LrParserBase for example.

See also:
LrParserBase::parse(LexerBase &, Logger *)

Definition at line 50 of file lexer.H.


Member Function Documentation

virtual void Archon::Utilities::LexerBase::getNext Lexeme l  )  [pure virtual]
 

Extract the next lexeme from the input.

Parameters:
l The extracted lexeme is stored herein. If l.type is -1 upon return this idicates EOI (end of input).

Implemented in Archon::Utilities::Regex::Lexer.

virtual ustring Archon::Utilities::LexerBase::getText  )  const [pure virtual]
 

Returns:
The text corresponding the the last lexeme extracted by getNext(). This method may also be used within Context::lexerError to fetch the faulty character.

Implemented in Archon::Utilities::Lexer, and Archon::Utilities::Regex::Lexer.

virtual int Archon::Utilities::LexerBase::getType  )  const [pure virtual]
 

Returns:
The type of the last lexeme extracted by getNext(). -1 indicates EOI.

Implemented in Archon::Utilities::Lexer, and Archon::Utilities::Regex::Lexer.


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