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