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

skTreeNodp.h

00001 /*
00002   Copyright 1996-2003
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: skTreeNodp_8h-source.html,v 1.5 2003/01/23 15:31:03 simkin_cvs Exp $
00020 */
00021 #include "skAlist.h"
00022 
00023 const int       MAXBUFFER=20000;
00024 
00025 
00026 EXTERN_TEMPLATE template class CLASSEXPORT skTAList<skTreeNode>;
00027 
00031 class  CLASSEXPORT skTreeNodeList :  public skTAList<skTreeNode>
00032 {           
00033  public:
00035   skTreeNodeList();
00039   skTreeNodeList(const skTreeNodeList& list);
00041   virtual ~skTreeNodeList();
00046   skTreeNode *      findItem(const skString& label) const;
00052   skTreeNode *      findItem(const skString& label,const skString& data) const;
00057   skTreeNode *      nthElt(USize  i) const;
00061   skTreeNodeList&   operator=(const skTreeNodeList& list);
00062 };
00063 // switches on the optimization where a shared class buffer is used
00064 #define USECLASSBUFFER
00065 
00066 class P_TreeNodeReader 
00067 {
00068  public:
00070   P_TreeNodeReader(skInputSource& in);
00071   enum Lexeme           { L_IDENT, L_TEXT, L_LBRACE, L_RBRACE, L_EOF, L_ERROR };
00073   void grabBuffer();
00075   void error(const skString& msg);
00084   Lexeme lex();
00086   void  unLex();
00091   skTreeNode *  parseTreeNode(skTreeNode * pparent);
00095   void parseTreeNodeList(skTreeNode * list);
00097   void addToLexText(Char c);
00099   skString m_FileName;
00101   bool m_UnLex;
00103   Lexeme m_LastLexeme;
00105   Char  * m_LexText;
00107   unsigned short m_LineNum;
00109   unsigned short m_Pos;
00111   skInputSource& m_In;
00113   bool  m_Error;
00114 #ifdef USECLASSBUFFER
00115 
00116   bool  m_UsingClassLexText;
00118   static Char g_ClassLexText[MAXBUFFER];
00120   static bool g_LexTextUsed;
00121 #endif
00122 };
00123 
00124 
00125 
00126 
00127 
00128 
00129 
00130 

Generated on Thu Jan 23 15:25:39 2003 for Simkin by doxygen1.3-rc1