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

skParser Class Reference

This class is used to parse a string of Simkin code. More...

#include <skParser.h>

List of all members.

Public Methods

 skParser (const skString& code,const skString& location)
 constructor. More...

 ~skParser ()
 Destructor - *clears* the temporary node list.

void parse ()
 this method instructs the parser to begin parsing the string passed into the constructor

If the parse is valid, then getTopNode() will return the top of the parse tree.

void setTopNode (skMethodDefNode* pNode)
 sets the current top-level parse node. More...

skMethodDefNodegetTopNode ()
 returns the current top-level parse node.

void addParseNode (skParseNode* pNode)
 Saves a parse node to the list of temporary nodes. More...

void appendError (const skString& msg)
 this adds a compile error message to the list of messages.

const skCompileErrorListgetErrList ()
 This returns the current compile error list.

int lex (void * lvalp,void * lloc)
 This message returns the next token in the stream. More...

int nextChar ()
 returns the next character to be lexed (might be a put-back character).

void putbackchar (int i)
 puts the given character back.

bool eof ()
 returns true if the eof the stream has been reached.

void cleanupTempNodes ()
 deletes the parse tree if an error occurs during parsing.

void clearTempNodes ()
 clears the list of nodes, but does *not* delete them (this is done if no error occurs.


Detailed Description

This class is used to parse a string of Simkin code.


Constructor & Destructor Documentation

skParser::skParser ( const skString & code,
const skString & location )
 

constructor.

Parameters:
code   a string containing the Simkin code
location   the location of the script (used for compile/parse errors)


Member Function Documentation

void skParser::addParseNode ( skParseNode * pNode )
 

Saves a parse node to the list of temporary nodes.

If an error occurs these will be cleared up

int skParser::lex ( void * lvalp,
void * lloc )
 

This message returns the next token in the stream.

Parameters:
lvalp   pointer to the YYSTYPE (token structure)
lloc   pointer to the YYLTYPE (token position structure)

void skParser::setTopNode ( skMethodDefNode * pNode )
 

sets the current top-level parse node.

Parameters:
pNode   the method definition node


The documentation for this class was generated from the following files:
Generated at Mon Nov 5 19:22:26 2001 for Simkin by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000