xref: /trunk/main/basic/source/inc/disas.hxx (revision 914d351e5f5b84e4342a86d6ab8d4aca7308b9bd)
1*234bd5c5SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*234bd5c5SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*234bd5c5SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*234bd5c5SAndrew Rist  * distributed with this work for additional information
6*234bd5c5SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*234bd5c5SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*234bd5c5SAndrew Rist  * "License"); you may not use this file except in compliance
9*234bd5c5SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*234bd5c5SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*234bd5c5SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*234bd5c5SAndrew Rist  * software distributed under the License is distributed on an
15*234bd5c5SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*234bd5c5SAndrew Rist  * KIND, either express or implied.  See the License for the
17*234bd5c5SAndrew Rist  * specific language governing permissions and limitations
18*234bd5c5SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*234bd5c5SAndrew Rist  *************************************************************/
21*234bd5c5SAndrew Rist 
22*234bd5c5SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _DISAS_HXX
25cdf0e10cSrcweir #define _DISAS_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "image.hxx"
28cdf0e10cSrcweir #include "opcodes.hxx"
29cdf0e10cSrcweir // find a place for this limit ( also used in
30cdf0e10cSrcweir class SvStream;
31cdf0e10cSrcweir #define MAX_LABELS 0x2000L
32cdf0e10cSrcweir class SbiDisas {
33cdf0e10cSrcweir     const SbiImage& rImg;
34cdf0e10cSrcweir     SbModule* pMod;
35cdf0e10cSrcweir     char     cLabels[ MAX_LABELS ];     // Bitvektor fuer Labels
36cdf0e10cSrcweir     sal_uInt32   nOff;                  // aktuelle Position
37cdf0e10cSrcweir     sal_uInt32   nPC;                   // Position des Opcodes
38cdf0e10cSrcweir     SbiOpcode eOp;                  // Opcode
39cdf0e10cSrcweir     sal_uInt32   nOp1, nOp2;            // Operanden
40cdf0e10cSrcweir     sal_uInt32   nParts;                // 1, 2 oder 3
41cdf0e10cSrcweir     sal_uInt32   nLine;                 // aktuelle Zeile
42cdf0e10cSrcweir     sal_Bool     DisasLine( String& );
43cdf0e10cSrcweir     sal_Bool     Fetch();               // naechster Opcode
44cdf0e10cSrcweir public:
45cdf0e10cSrcweir     SbiDisas( SbModule*, const SbiImage* );
46cdf0e10cSrcweir     void Disas( SvStream& );
47cdf0e10cSrcweir     void Disas( String& );
48cdf0e10cSrcweir                                     // NICHT AUFRUFEN
49cdf0e10cSrcweir     void     StrOp( String& );
50cdf0e10cSrcweir     void     Str2Op( String& );
51cdf0e10cSrcweir     void     ImmOp( String& );
52cdf0e10cSrcweir     void     OnOp( String& );
53cdf0e10cSrcweir     void     LblOp( String& );
54cdf0e10cSrcweir     void     ReturnOp( String& );
55cdf0e10cSrcweir     void     ResumeOp( String& );
56cdf0e10cSrcweir     void     PromptOp( String& );
57cdf0e10cSrcweir     void     CloseOp( String& );
58cdf0e10cSrcweir     void     CharOp( String& );
59cdf0e10cSrcweir     void     VarOp( String& );
60cdf0e10cSrcweir     void     VarDefOp( String& );
61cdf0e10cSrcweir     void     OffOp( String& );
62cdf0e10cSrcweir     void     TypeOp( String& );
63cdf0e10cSrcweir     void     CaseOp( String& );
64cdf0e10cSrcweir     void     StmntOp( String& );
65cdf0e10cSrcweir     void     StrmOp( String& );
66cdf0e10cSrcweir };
67cdf0e10cSrcweir 
68cdf0e10cSrcweir #endif
69