@root classes

class Parser

^ 
The main class used to parse an input string when given a language.

Specifically, this class contains a ParseData object and is responsible for parsing an input string. This it does via its Language class and the Language included ParseTypes. In particular, while data remains to be parsed in the input string, the Parser uses Language to find the proper ParseType. It then calls this ParseType on the ParseData to parse one object. After parsing is complete, the Parser does some upkeep on the Operators and returns the resulting Node at the top of the Node stack.

Source:
parser.h:34
Author:
Jonathan Kitchens
Version:
v0.9
See Also:
ParseType, Language, ParseData

Contents

^ 
EntityTypeScopeShort Description
~Parserdestructor publicautomatically generated
Parserconstructor public The only constructor for this class; accepts a Language pointer.
Parserconstructor publicautomatically generated
GetDatamethod public Returns a pointer to the ParseData structure in the Parser.
GetLastmethod public Returns the top of the Node stack, which corresponds to the last value returned by the parser.
operator =operator publicautomatically generated
Parsemethod public The main parsing function.

destructor ~Parser

? ^  > 
automatically generated
Source:
parser.h
Code:
public ~ Parser ( )

constructor Parser

? ^  < > 
The only constructor for this class; accepts a Language pointer.

The language pointer is essential to the Parser because it defines the ParseTypes which need to be used to transform the data from string to Node stack.

Source:
parser.h:47
Author:
Jonathan Kitchens
Version:
v0.9
Code:
public Parser ( Language * myLang )

constructor Parser

? ^  < > 
automatically generated
Source:
parser.h
Code:
public Parser ( const Parser & )

method GetData

? ^  < > 
Returns a pointer to the ParseData structure in the Parser.

This function allows extension of the Parser by allowing more open access to the data included during parsing.

Source:
parser.h:81
Author:
Jonathan Kitchens
Version:
v0.9
Code:
public ParseData * GetData ( )

method GetLast

? ^  < > 
Returns the top of the Node stack, which corresponds to the last value returned by the parser.

Source:
parser.h:69
Author:
Jonathan Kitchens
Version:
v0.9
Code:
public Node * GetLast ( ) const

operator =

? ^  < > 
automatically generated
Source:
parser.h
Code:
public Parser & operator = ( const Parser & )

method Parse

? ^  < > 
The main parsing function.

Performs a complete parsing of the string (according to the current Language. It then performs slight upkeep and returns the Node left at the top of the Node stack. If the stack is left empty, returns NULL.

Source:
parser.h:60
Author:
Jonathan Kitchens
Version:
v0.9
Code:
public Node * Parse ( const string & s )

Created Sun Oct 6 21:22:16 2002.
This documentation was generated automatically by
ccdoc v0.8 r26 2001/11/28 bin_opt_suncc_solaris-2.8.
Click here to submit a bug report or feature request.
Click here to return to the top of the page.