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

skParser.h

00001 /*
00002   Copyright 1996-2002
00003   Simon Whiteside
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Lesser General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Lesser General Public License for more details.
00014 
00015     You should have received a copy of the GNU Lesser General Public
00016     License along with this library; if not, write to the Free Software
00017     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 
00019   $Id: skParser_8h-source.html,v 1.17 2004/12/17 21:31:14 sdw Exp $
00020 */
00021 
00022 #ifndef skPARSER_H
00023 #define skPARSER_H
00024 
00025 #include "skParseException.h"
00026 #include "skParseNode.h"
00027 
00028 #ifdef __SYMBIAN32__
00029 const int MAXYYTEXT=256;
00030 #else
00031 const int MAXYYTEXT=4096;
00032 #endif
00033 
00037 class  skParser 
00038 #ifdef __SYMBIAN32__
00039 : public CBase
00040 #endif
00041 {
00042  public:
00048   skParser(const skString& code,const skString& location);
00052   ~skParser();
00059   skMethodDefNode * parseMethod();
00066 #ifdef EXECUTE_PARSENODES
00067   skExprNode * parseExpression();
00068 #else
00069   skCompiledExprNode * parseExpression();
00070 #endif
00071 #ifdef __SYMBIAN32__
00072 
00077   operator TCleanupItem();
00082   static void Cleanup(TAny * s);
00083 #endif
00084 
00089   void setTopNode(skParseNode* pNode);
00094   void removeTempString(skString* str);
00099   void addParseNode(skParseNode* pNode);
00104   void appendError(const skString& msg);
00109   void appendError(const Char * msg);
00113   skCompileErrorList& getErrList();
00120   int lex(void * lvalp,void * lloc); // returns a token
00121  private:
00125   int nextChar(); 
00129   void putbackchar(int i); 
00133   bool eof(); 
00137 #ifdef EXECUTE_PARSENODES
00138 
00142   skString * lookupIdentifier(const Char * id);
00143 #else
00144 
00148   int lookupIdentifier(const Char * id);
00149 #endif
00150 
00153   void cleanupTempNodes(); 
00157   void clearTempNodes();
00158   
00159    skParseNode*         m_TopNode;
00161    skParseNodeList      m_TempNodes;
00163    skTAList<skString>   m_TempStringLiterals;
00165 #ifdef EXECUTE_PARSENODES
00166    skTAList<skString>   m_Identifiers;
00167 #else
00168    skStringList m_Identifiers;
00169 #endif
00170    skCompileErrorList   m_ErrList;
00171    
00172    Char * m_LexBuffer; //  used by lexical analyser to hold the current token
00173    skString m_InputBuffer; // the buffer read by the lexer
00174    int m_PutBack; // character to be put back
00175    int m_LineNum; // linenumber being lexed
00176    unsigned int m_Pos; //  position in the line
00177    skString m_Location;
00178 };
00179 
00180 #endif

Generated on Fri Dec 17 20:27:34 2004 for Simkin by doxygen1.3