Ghidra Decompiler Analysis Engine
printjava.hh
Go to the documentation of this file.
1 /* ###
2  * IP: GHIDRA
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
18 
19 #ifndef __PRINTJAVA__
20 #define __PRINTJAVA__
21 
22 #include "printc.hh"
23 
29  static PrintJavaCapability printJavaCapability;
30  PrintJavaCapability(void);
32  PrintJavaCapability &operator=(const PrintJavaCapability &op);
33 public:
35 };
36 
55 class PrintJava : public PrintC {
56  static OpToken instanceof;
57  static bool isArrayType(const Datatype *ct);
58  static bool needZeroArray(const Varnode *vn);
59  void resetDefaultsPrintJava(void);
60  virtual void printUnicode(ostream &s,int4 onechar) const;
61 public:
62  PrintJava(Architecture *g,const string &nm="java-language");
63  virtual void resetDefaults(void);
64  virtual void docFunction(const Funcdata *fd);
65  virtual void pushTypeStart(const Datatype *ct,bool noident);
66  virtual void pushTypeEnd(const Datatype *ct);
67  virtual bool doEmitWideCharPrefix(void) const { return false; }
68  virtual void adjustTypeOperators(void);
69  virtual void opLoad(const PcodeOp *op);
70  virtual void opStore(const PcodeOp *op);
71  virtual void opCallind(const PcodeOp *op);
72  virtual void opCpoolRefOp(const PcodeOp *op);
73 };
74 #endif
PrintLanguage
The base class API for emitting a high-level language.
Definition: printlanguage.hh:134
PrintJavaCapability::buildLanguage
virtual PrintLanguage * buildLanguage(Architecture *glb)
Build the main PrintLanguage object corresponding to this capability.
Definition: printjava.cc:31
PrintJava::doEmitWideCharPrefix
virtual bool doEmitWideCharPrefix(void) const
Return true if this language requires a prefix when expressing wide characters.
Definition: printjava.hh:67
PrintJava
The java-language token emitter.
Definition: printjava.hh:55
PrintJavaCapability
Factory and static initializer for the "java-language" back-end to the decompiler.
Definition: printjava.hh:28
PrintJava::resetDefaults
virtual void resetDefaults(void)
Set printing options to their default value.
Definition: printjava.cc:48
PcodeOp
Lowest level operation of the p-code language.
Definition: op.hh:58
Architecture
Manager for all the major decompiler subsystems.
Definition: architecture.hh:119
PrintJava::pushTypeEnd
virtual void pushTypeEnd(const Datatype *ct)
Push the tail ends of a data-type declaration onto the RPN stack.
Definition: printjava.cc:114
PrintJava::adjustTypeOperators
virtual void adjustTypeOperators(void)
Set basic data-type information for p-code operators.
Definition: printjava.cc:119
Varnode
A low-level variable or contiguous set of bytes described by an Address and a size.
Definition: varnode.hh:65
PrintJava::opCpoolRefOp
virtual void opCpoolRefOp(const PcodeOp *op)
Emit a CPOOLREF operator.
Definition: printjava.cc:292
Funcdata
Container for data structures associated with a single function.
Definition: funcdata.hh:45
Datatype
The base datatype class for the decompiler.
Definition: type.hh:62
PrintJava::opLoad
virtual void opLoad(const PcodeOp *op)
Emit a LOAD operator.
Definition: printjava.cc:226
PrintJava::opStore
virtual void opStore(const PcodeOp *op)
Emit a STORE operator.
Definition: printjava.cc:238
PrintJava::pushTypeStart
virtual void pushTypeStart(const Datatype *ct, bool noident)
Definition: printjava.cc:74
PrintLanguageCapability
Base class for high-level language capabilities.
Definition: printlanguage.hh:39
PrintC
The c-language token emitter.
Definition: printc.hh:63
printc.hh
Classes to support the c-language back-end of the decompiler.
PrintJava::docFunction
virtual void docFunction(const Funcdata *fd)
Emit the declaration (and body) of a function.
Definition: printjava.cc:55
PrintJava::opCallind
virtual void opCallind(const PcodeOp *op)
Emit a CALLIND operator.
Definition: printjava.cc:257
PrintJava::PrintJava
PrintJava(Architecture *g, const string &nm="java-language")
Constructor.
Definition: printjava.cc:37
OpToken
A token representing an operator in the high-level language.
Definition: printlanguage.hh:81