merged tag ooo/DEV300_m102
[LibreOffice.git] / rsc / inc / rscpar.hxx
blob952c4670616c874881c28beb0469de072794480a
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef _RSCPAR_HXX
28 #define _RSCPAR_HXX
30 #include <rsctools.hxx>
31 #include <rscerror.h>
33 /****************** C L A S S E S ****************************************/
34 class RscTypCont;
35 class RscExpression;
36 /*********** R s c F i l e I n s t ***************************************/
38 #define READBUFFER_MAX 256
39 class RscFileInst
41 ERRTYPE aFirstError;// Erster Fehler
42 sal_uInt32 nErrorLine; // Zeile des ersten Fehlers
43 sal_uInt32 nErrorPos; // Position des ersten Fehlers
44 sal_Bool bIncLine; // Muss Zeilennummer incrementiert werden
45 sal_uInt32 nLineNo; // Zeile in der Eingabedatei
46 sal_uLong lFileIndex; // Index auf Eingabedatei
47 sal_uLong lSrcIndex; // Index auf Basisdatei
48 FILE * fInputFile; // Eingabedatei
49 char * pInput; // Lesepuffer
50 sal_uInt32 nInputBufLen; // Laenge des Lesepuffers
51 sal_uInt32 nInputPos; // Position im Lesepuffer
52 sal_uInt32 nInputEndPos;// Ende im Lesepuffer
53 char * pLine; // Zeile
54 sal_uInt32 nLineBufLen;//Lange des Zeilenpuffres
55 sal_uInt32 nScanPos; // Position in der Zeile
56 int cLastChar;
57 sal_Bool bEof;
59 public:
60 RscTypCont * pTypCont;
61 void Init(); // ctor initialisieren
62 RscFileInst( RscTypCont * pTC, sal_uLong lIndexSrc,
63 sal_uLong lFileIndex, FILE * fFile );
64 RscFileInst( RscTypCont * pTC, sal_uLong lIndexSrc,
65 sal_uLong lFileIndex, const ByteString & );
66 ~RscFileInst();
67 sal_Bool IsEof() const { return bEof; }
68 void SetFileIndex( sal_uLong lFIndex ) { lFileIndex = lFIndex; }
69 sal_uLong GetFileIndex() { return( lFileIndex ); }
70 sal_uLong GetSrcIndex() { return( lSrcIndex ); }
71 void SetLineNo( sal_uInt32 nLine ) { nLineNo = nLine; }
72 sal_uInt32 GetLineNo() { return( nLineNo ); }
73 sal_uInt32 GetScanPos() { return( nScanPos ); }
74 char * GetLine() { return( pLine ); }
75 int GetChar();
76 int GetFastChar() { return pLine[ nScanPos ] ?
77 pLine[ nScanPos++ ] : GetChar();
79 void GetNewLine();
80 // Fehlerbehandlung
81 void SetError( ERRTYPE aError );
82 ERRTYPE GetError() { return aFirstError; }
83 sal_uInt32 GetErrorLine() { return nErrorLine; }
84 sal_uInt32 GetErrorPos() { return nErrorPos; }
87 /******************* F u n c t i o n *************************************/
88 void IncludeParser( RscFileInst * pFileInst );
89 ERRTYPE parser( RscFileInst * pFileInst );
90 RscExpression * MacroParser( RscFileInst & rFileInst );
92 #endif // _RSCPAR_HXX