bump product version to 4.2.0.1
[LibreOffice.git] / rsc / inc / rsclex.hxx
blob31069240468b729a00af8da1f37c33fbf39b6697
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <boost/unordered_set.hpp>
21 #include <rtl/strbuf.hxx>
22 #include <rtl/string.hxx>
24 // a buffer for unique strings
25 class StringContainer
27 boost::unordered_set< OString, OStringHash > m_aStrings;
28 public:
29 StringContainer() {}
30 ~StringContainer() {}
32 const char* putString( const char* pString );
36 enum MODE_ENUM { MODE_MODELESS, MODE_APPLICATIONMODAL, MODE_SYSTEMMODAL };
38 enum JUSTIFY_ENUM { JUST_CENTER, JUST_RIGHT, JUST_LEFT };
40 enum SHOW_ENUM { SHOW_NORMAL, SHOW_MINIMIZED, SHOW_MAXIMIZED };
42 enum ENUMHEADER { HEADER_NAME, HEADER_NUMBER };
44 enum REF_ENUM { TYPE_NOTHING, TYPE_REF, TYPE_COPY };
46 struct RSCHEADER {
47 RscTop * pClass;
48 RscExpType nName1;
49 REF_ENUM nTyp;
50 RscTop * pRefClass;
51 RscExpType nName2;
54 /************** O b j e c t s t a c k ************************************/
55 struct Node
57 Node* pPrev;
58 RSCINST aInst;
59 sal_uInt32 nTupelRec; // Rekursionstiefe fuer Tupel
60 Node() { pPrev = NULL; nTupelRec = 0; }
63 class ObjectStack
65 private :
66 Node* pRoot;
67 public :
69 ObjectStack () { pRoot = NULL; }
71 const RSCINST & Top () { return pRoot->aInst; }
72 bool IsEmpty() { return( pRoot == NULL ); }
73 void IncTupelRec() { pRoot->nTupelRec++; }
74 void DecTupelRec() { pRoot->nTupelRec--; }
75 sal_uInt32 TupelRecCount() const { return pRoot->nTupelRec; }
76 void Push( RSCINST aInst )
78 Node* pTmp;
80 pTmp = pRoot;
81 pRoot = new Node;
82 pRoot->aInst = aInst;
83 pRoot->pPrev = pTmp;
85 void Pop()
87 Node* pTmp;
89 pTmp = pRoot;
90 pRoot = pTmp->pPrev;
91 delete pTmp;
95 /****************** F o r w a r d s **************************************/
96 #if defined( RS6000 )
97 extern "C" int yyparse(); // forward Deklaration fuer erzeugte Funktion
98 extern "C" void yyerror( char * );
99 extern "C" int yylex( void );
100 #elif defined ( SOLARIS )
101 extern "C" int yyparse(); // forward Deklaration fuer erzeugte Funktion
102 extern "C" void yyerror( const char * );
103 extern "C" int yylex( void );
104 #else
105 int yyparse(); // forward Deklaration fuer erzeugte Funktion
106 void yyerror( char * );
107 int yylex( void );
108 #endif
110 class RscTypCont;
111 class RscFileInst;
113 extern RscTypCont* pTC;
114 extern RscFileInst * pFI;
115 extern RscExpression * pExp;
116 extern ObjectStack S;
117 extern StringContainer* pStringContainer;
119 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */