Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_RSC_INC_RSCLEX_HXX
21 : #define INCLUDED_RSC_INC_RSCLEX_HXX
22 :
23 : #include <rtl/strbuf.hxx>
24 : #include <rtl/string.hxx>
25 : #include <unordered_set>
26 :
27 : // a buffer for unique strings
28 : class StringContainer
29 : {
30 : std::unordered_set< OString, OStringHash > m_aStrings;
31 : public:
32 473 : StringContainer() {}
33 473 : ~StringContainer() {}
34 :
35 : const char* putString( const char* pString );
36 : };
37 :
38 :
39 : enum MODE_ENUM { MODE_MODELESS, MODE_APPLICATIONMODAL, MODE_SYSTEMMODAL };
40 :
41 : enum JUSTIFY_ENUM { JUST_CENTER, JUST_RIGHT, JUST_LEFT };
42 :
43 : enum SHOW_ENUM { SHOW_NORMAL, SHOW_MINIMIZED, SHOW_MAXIMIZED };
44 :
45 : enum ENUMHEADER { HEADER_NAME, HEADER_NUMBER };
46 :
47 : enum REF_ENUM { TYPE_NOTHING, TYPE_REF, TYPE_COPY };
48 :
49 : struct RSCHEADER {
50 : RscTop * pClass;
51 : RscExpType nName1;
52 : REF_ENUM nTyp;
53 : RscTop * pRefClass;
54 : RscExpType nName2;
55 : };
56 :
57 : /************** O b j e c t s t a c k ************************************/
58 : struct Node
59 : {
60 : Node* pPrev;
61 : RSCINST aInst;
62 : sal_uInt32 nTupelRec; // Rekursionstiefe fuer Tupel
63 122918 : Node() { pPrev = NULL; nTupelRec = 0; }
64 : };
65 :
66 : class ObjectStack
67 : {
68 : private :
69 : Node* pRoot;
70 : public :
71 :
72 417 : ObjectStack () { pRoot = NULL; }
73 :
74 415798 : const RSCINST & Top () { return pRoot->aInst; }
75 40825 : bool IsEmpty() { return( pRoot == NULL ); }
76 : void IncTupelRec() { pRoot->nTupelRec++; }
77 : void DecTupelRec() { pRoot->nTupelRec--; }
78 : sal_uInt32 TupelRecCount() const { return pRoot->nTupelRec; }
79 122918 : void Push( RSCINST aInst )
80 : {
81 : Node* pTmp;
82 :
83 122918 : pTmp = pRoot;
84 122918 : pRoot = new Node;
85 122918 : pRoot->aInst = aInst;
86 122918 : pRoot->pPrev = pTmp;
87 122918 : }
88 122918 : void Pop()
89 : {
90 : Node* pTmp;
91 :
92 122918 : pTmp = pRoot;
93 122918 : pRoot = pTmp->pPrev;
94 122918 : delete pTmp;
95 122918 : }
96 : };
97 :
98 : /****************** F o r w a r d s **************************************/
99 : #if defined ( SOLARIS )
100 : extern "C" int yyparse(); // forward Deklaration fuer erzeugte Funktion
101 : extern "C" void yyerror( const char * );
102 : extern "C" int yylex();
103 : #else
104 : int yyparse(); // forward Deklaration fuer erzeugte Funktion
105 : void yyerror( char * );
106 : int yylex();
107 : #endif
108 :
109 : class RscTypCont;
110 : class RscFileInst;
111 :
112 : extern RscTypCont* pTC;
113 : extern RscFileInst * pFI;
114 : extern RscExpression * pExp;
115 : extern ObjectStack S;
116 : extern StringContainer* pStringContainer;
117 :
118 : #endif // INCLUDED_RSC_INC_RSCLEX_HXX
119 :
120 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|