Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

BasicDfaGenerator Class Reference

#include <basic_dfa_generator.hh>

Collaboration diagram for BasicDfaGenerator:

Collaboration graph
[legend]
List of all members.

Public Methods

 BasicDfaGenerator (ITokenSpec &tokens_, PropRegistry &registry_)
BasicDfaSpeccreateBasicDfa (const LexicalStateSpec &state)

Private Attributes

ITokenSpectokens
PropRegistryregistry

Detailed Description

This is the core of DFA generating process. This class takes as its input a regular expression parse tree and produces a DFA that accepts strings from the language described by the regular expression.

Definition at line 64 of file basic_dfa_generator.hh.


Constructor & Destructor Documentation

BasicDfaGenerator::BasicDfaGenerator ( ITokenSpec & tokens_,
PropRegistry & registry_ )
 

Creates a new BasicDfaGenerator object.

Definition at line 67 of file basic_dfa_generator.cc.


Member Function Documentation

BasicDfaSpec & BasicDfaGenerator::createBasicDfa ( const LexicalStateSpec & state )
 

Creates a new BasicDfaSpec object for the given scanner lexical state. The steps performed are:

  • number all the regexp tree leafs, in left-to-right order (this is consistent with the textual order in which tokens appeared inside the source file.
  • compute the nullable, firstpos and lastpos attributes for each node
  • compute the followpos attribute for each leaf node
  • compute the states and transitions and add them into the BasicDfaSpec result object

Definition at line 232 of file basic_dfa_generator.cc.


Member Data Documentation

ITokenSpec & BasicDfaGenerator::tokens [private]
 

The list of tokens of the scanner for which this DFA is generated.

Definition at line 96 of file basic_dfa_generator.hh.

PropRegistry & BasicDfaGenerator::registry [private]
 

The registry object from where options are read. If CppCC was compiled with debug support, internal data is dumped if the "debug" option is enabled.

Definition at line 103 of file basic_dfa_generator.hh.


The documentation for this class was generated from the following files:
Generated at Tue Jul 9 21:05:53 2002 for CppCC by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001