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

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

skMethodDefNodeparseMethod ()
 this method instructs the parser to begin parsing the string passed into the constructor The string is assumed to contain a method definition

skExprNode * parseExpression ()
 this method instructs the parser to begin parsing the string passed into the constructor The string is assumed to contain an expression, beginning with "="

void setTopNode (skParseNode *pNode)
 sets the current top-level parse node

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

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.

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


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)

skExprNode * skParser::parseExpression  
 

this method instructs the parser to begin parsing the string passed into the constructor The string is assumed to contain an expression, beginning with "="

Returns:
If the parse is valid, then this will return the top of the parse tree, which the caller should delete

skMethodDefNode * skParser::parseMethod  
 

this method instructs the parser to begin parsing the string passed into the constructor The string is assumed to contain a method definition

Returns:
If the parse is valid, then this will return the top of the parse tree, which the caller should delete

void skParser::setTopNode skParseNode   pNode
 

sets the current top-level parse node

Parameters:
pNode the method definition or expression node


The documentation for this class was generated from the following files:
Generated on Thu Jan 23 15:25:40 2003 for Simkin by doxygen1.3-rc1