My Project
printc.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 __PRINTC__
20 #define __PRINTC__
21 
22 #include "printlanguage.hh"
23 #include "comment.hh"
24 
25 class FuncProto;
26 class JumpTable;
27 
33  static PrintCCapability printCCapability;
34  PrintCCapability(void);
36  PrintCCapability &operator=(const PrintCCapability &op);
37 public:
39 };
40 
46  const OpToken *token;
47  const TypeField *field;
48  const Datatype *parent;
49  string fieldname;
51 };
52 
63 class PrintC : public PrintLanguage {
64 protected:
65  static OpToken hidden;
66  static OpToken scope;
69  static OpToken subscript;
75  static OpToken addressof;
77  static OpToken typecast;
78  static OpToken multiply;
79  static OpToken divide;
80  static OpToken modulo;
85  static OpToken less_than;
89  static OpToken equal;
90  static OpToken not_equal;
98  static OpToken comma;
99  static OpToken new_op;
101  static OpToken divequal;
102  static OpToken remequal;
107  static OpToken andequal;
108  static OpToken orequal;
109  static OpToken xorequal;
112  static OpToken ptr_expr;
114  static OpToken enum_cat;
115  bool option_NULL;
121  string nullToken;
123 
124  // Routines that are specific to C/C++
125  void buildTypeStack(const Datatype *ct,vector<const Datatype *> &typestack);
126  void pushPrototypeInputs(const FuncProto *proto);
127  virtual void pushTypeStart(const Datatype *ct,bool noident);
128  virtual void pushTypeEnd(const Datatype *ct);
129  void pushBoolConstant(uintb val,const TypeBase *ct,const Varnode *vn,
130  const PcodeOp *op);
131  void pushCharConstant(uintb val,const TypeChar *ct,const Varnode *vn,
132  const PcodeOp *op);
133  void pushEnumConstant(uintb val,const TypeEnum *ct,const Varnode *vn,
134  const PcodeOp *op);
135  virtual bool pushPtrCharConstant(uintb val,const TypePointer *ct,const Varnode *vn,
136  const PcodeOp *op);
137  bool pushPtrCodeConstant(uintb val,const TypePointer *ct,const Varnode *vn,
138  const PcodeOp *op);
139  virtual bool doEmitWideCharPrefix(void) const;
140 
141  bool checkArrayDeref(const Varnode *vn) const;
142  void emitStructDefinition(const TypeStruct *ct);
143  void emitEnumDefinition(const TypeEnum *ct);
144  void emitPrototypeOutput(const FuncProto *proto,const Funcdata *fd);
145  void emitPrototypeInputs(const FuncProto *proto);
146  void emitGlobalVarDeclsRecursive(Scope *scope);
147  void emitLocalVarDecls(const Funcdata *fd);
148  void emitStatement(const PcodeOp *inst);
149  bool emitInplaceOp(const PcodeOp *op);
150  void emitGotoStatement(const FlowBlock *bl,const FlowBlock *exp_bl,uint4 type);
151  void emitSwitchCase(int4 casenum,const BlockSwitch *switchbl);
152  void emitLabel(const FlowBlock *bl);
153  void emitLabelStatement(const FlowBlock *bl);
154  void emitAnyLabelStatement(const FlowBlock *bl);
155  void emitCommentGroup(const PcodeOp *inst);
156  void emitCommentFuncHeader(const Funcdata *fd);
157  void opFunc(const PcodeOp *op);
158  void opTypeCast(const PcodeOp *op);
159  void opHiddenFunc(const PcodeOp *op);
160  static bool hasCharTerminator(uint1 *buffer,int4 size,int4 charsize);
161  bool printCharacterConstant(ostream &s,const Address &addr,int4 charsize) const;
162  virtual void pushConstant(uintb val,const Datatype *ct,
163  const Varnode *vn,const PcodeOp *op);
164  virtual bool pushEquate(uintb val,int4 sz,const EquateSymbol *sym,
165  const Varnode *vn,const PcodeOp *op);
166  virtual void pushAnnotation(const Varnode *vn,const PcodeOp *op);
167  virtual void pushSymbol(const Symbol *sym,const Varnode *vn,
168  const PcodeOp *op);
169  virtual void pushUnnamedLocation(const Address &addr,
170  const Varnode *vn,const PcodeOp *op);
171  virtual void pushPartialSymbol(const Symbol *sym,int4 off,int4 sz,
172  const Varnode *vn,const PcodeOp *op,Datatype *outtype);
173  virtual void pushMismatchSymbol(const Symbol *sym,int4 off,int4 sz,
174  const Varnode *vn,const PcodeOp *op);
175  virtual void push_integer(uintb val,int4 sz,bool sign,
176  const Varnode *vn,
177  const PcodeOp *op);
178  virtual void push_float(uintb val,int4 sz,const Varnode *vn,
179  const PcodeOp *op);
180  virtual void printUnicode(ostream &s,int4 onechar) const;
181  virtual void pushType(const Datatype *ct);
182  virtual string genericFunctionName(const Address &addr);
183  virtual string genericTypeName(const Datatype *ct);
184 
185  virtual void emitExpression(const PcodeOp *op);
186  virtual void emitVarDecl(const Symbol *sym);
187  virtual void emitVarDeclStatement(const Symbol *sym);
188  virtual bool emitScopeVarDecls(const Scope *scope,int4 cat);
189  virtual void emitFunctionDeclaration(const Funcdata *fd);
190  virtual void emitTypeDefinition(const Datatype *ct);
191  virtual bool checkPrintNegation(const Varnode *vn);
192 public:
193  PrintC(Architecture *g,const string &nm="c-language");
194  void setNULLPrinting(bool val) { option_NULL = val; }
195  void setInplaceOps(bool val) { option_inplace_ops = val; }
196  void setConvention(bool val) { option_convention = val; }
197  void setNoCastPrinting(bool val) { option_nocasts = val; }
198  void setCStyleComments(void) { setCommentDelimeter("/* "," */",false); }
199  void setCPlusPlusStyleComments(void) { setCommentDelimeter("// ","",true); }
200  void setDisplayUnplaced(bool val) { option_unplaced = val; }
201  void setHideImpliedExts(bool val) { option_hide_exts = val; }
202  virtual ~PrintC(void) {}
203  virtual void adjustTypeOperators(void);
204  virtual void setCommentStyle(const string &nm);
205  virtual bool isCharacterConstant(const uint1 *buf,int4 size,int4 charsize) const;
206  virtual void docTypeDefinitions(const TypeFactory *typegrp);
207  virtual void docAllGlobals(void);
208  virtual void docSingleGlobal(const Symbol *sym);
209  virtual void docFunction(const Funcdata *fd);
210 
211  virtual void emitBlockBasic(const BlockBasic *bb);
212  virtual void emitBlockGraph(const BlockGraph *bl);
213  virtual void emitBlockCopy(const BlockCopy *bl);
214  virtual void emitBlockGoto(const BlockGoto *bl);
215  virtual void emitBlockLs(const BlockList *bl);
216  virtual void emitBlockCondition(const BlockCondition *bl);
217  virtual void emitBlockIf(const BlockIf *bl);
218  virtual void emitBlockWhileDo(const BlockWhileDo *bl);
219  virtual void emitBlockDoWhile(const BlockDoWhile *bl);
220  virtual void emitBlockInfLoop(const BlockInfLoop *bl);
221  virtual void emitBlockSwitch(const BlockSwitch *bl);
222 
223  virtual void opCopy(const PcodeOp *op);
224  virtual void opLoad(const PcodeOp *op);
225  virtual void opStore(const PcodeOp *op);
226  virtual void opBranch(const PcodeOp *op);
227  virtual void opCbranch(const PcodeOp *op);
228  virtual void opBranchind(const PcodeOp *op);
229  virtual void opCall(const PcodeOp *op);
230  virtual void opCallind(const PcodeOp *op);
231  virtual void opCallother(const PcodeOp *op);
232  virtual void opConstructor(const PcodeOp *op,bool withNew);
233  virtual void opReturn(const PcodeOp *op);
234  virtual void opIntEqual(const PcodeOp *op) { opBinary(&equal,op); }
235  virtual void opIntNotEqual(const PcodeOp *op) { opBinary(&not_equal,op); }
236  virtual void opIntSless(const PcodeOp *op) { opBinary(&less_than,op); }
237  virtual void opIntSlessEqual(const PcodeOp *op) { opBinary(&less_equal,op); }
238  virtual void opIntLess(const PcodeOp *op) { opBinary(&less_than,op); }
239  virtual void opIntLessEqual(const PcodeOp *op) { opBinary(&less_equal,op); }
240  virtual void opIntZext(const PcodeOp *op,const PcodeOp *readOp);
241  virtual void opIntSext(const PcodeOp *op,const PcodeOp *readOp);
242  virtual void opIntAdd(const PcodeOp *op) { opBinary(&binary_plus,op); }
243  virtual void opIntSub(const PcodeOp *op) { opBinary(&binary_minus,op); }
244  virtual void opIntCarry(const PcodeOp *op) { opFunc(op); }
245  virtual void opIntScarry(const PcodeOp *op) { opFunc(op); }
246  virtual void opIntSborrow(const PcodeOp *op) { opFunc(op); }
247  virtual void opInt2Comp(const PcodeOp *op) { opUnary(&unary_minus,op); }
248  virtual void opIntNegate(const PcodeOp *op) { opUnary(&bitwise_not,op); }
249  virtual void opIntXor(const PcodeOp *op) { opBinary(&bitwise_xor,op); }
250  virtual void opIntAnd(const PcodeOp *op) { opBinary(&bitwise_and,op); }
251  virtual void opIntOr(const PcodeOp *op) { opBinary(&bitwise_or,op); }
252  virtual void opIntLeft(const PcodeOp *op) { opBinary(&shift_left,op); }
253  virtual void opIntRight(const PcodeOp *op) { opBinary(&shift_right,op); }
254  virtual void opIntSright(const PcodeOp *op) { opBinary(&shift_right,op); }
255  virtual void opIntMult(const PcodeOp *op) { opBinary(&multiply,op); }
256  virtual void opIntDiv(const PcodeOp *op) { opBinary(&divide,op); }
257  virtual void opIntSdiv(const PcodeOp *op) { opBinary(&divide,op); }
258  virtual void opIntRem(const PcodeOp *op) { opBinary(&modulo,op); }
259  virtual void opIntSrem(const PcodeOp *op) { opBinary(&modulo,op); }
260  virtual void opBoolNegate(const PcodeOp *op);
261  virtual void opBoolXor(const PcodeOp *op) { opBinary(&boolean_xor,op); }
262  virtual void opBoolAnd(const PcodeOp *op) { opBinary(&boolean_and,op); }
263  virtual void opBoolOr(const PcodeOp *op) { opBinary(&boolean_or,op); }
264  virtual void opFloatEqual(const PcodeOp *op) { opBinary(&equal,op); }
265  virtual void opFloatNotEqual(const PcodeOp *op) { opBinary(&not_equal,op); }
266  virtual void opFloatLess(const PcodeOp *op) { opBinary(&less_than,op); }
267  virtual void opFloatLessEqual(const PcodeOp *op) { opBinary(&less_equal,op); }
268  virtual void opFloatNan(const PcodeOp *op) { opFunc(op); }
269  virtual void opFloatAdd(const PcodeOp *op) { opBinary(&binary_plus,op); }
270  virtual void opFloatDiv(const PcodeOp *op) { opBinary(&divide,op); }
271  virtual void opFloatMult(const PcodeOp *op) { opBinary(&multiply,op); }
272  virtual void opFloatSub(const PcodeOp *op) { opBinary(&binary_minus,op); }
273  virtual void opFloatNeg(const PcodeOp *op) { opUnary(&unary_minus,op); }
274  virtual void opFloatAbs(const PcodeOp *op) { opFunc(op); }
275  virtual void opFloatSqrt(const PcodeOp *op) { opFunc(op); }
276  virtual void opFloatInt2Float(const PcodeOp *op) { opTypeCast(op); }
277  virtual void opFloatFloat2Float(const PcodeOp *op) { opTypeCast(op); }
278  virtual void opFloatTrunc(const PcodeOp *op) { opTypeCast(op); }
279  virtual void opFloatCeil(const PcodeOp *op) { opFunc(op); }
280  virtual void opFloatFloor(const PcodeOp *op) { opFunc(op); }
281  virtual void opFloatRound(const PcodeOp *op) { opFunc(op); }
282  virtual void opMultiequal(const PcodeOp *op) {}
283  virtual void opIndirect(const PcodeOp *op) {}
284  virtual void opPiece(const PcodeOp *op) { opFunc(op); }
285  virtual void opSubpiece(const PcodeOp *op);
286  virtual void opCast(const PcodeOp *op) { opTypeCast(op); }
287  virtual void opPtradd(const PcodeOp *op);
288  virtual void opPtrsub(const PcodeOp *op);
289  virtual void opSegmentOp(const PcodeOp *op);
290  virtual void opCpoolRefOp(const PcodeOp *op);
291  virtual void opNewOp(const PcodeOp *op);
292  virtual void opInsertOp(const PcodeOp *op);
293  virtual void opExtractOp(const PcodeOp *op);
294  virtual void opPopcountOp(const PcodeOp *op) { opFunc(op); }
295 };
296 
297 #endif
virtual void opIntMult(const PcodeOp *op)
Emit a INT_MULT operator.
Definition: printc.hh:255
static OpToken pointer_member
The points to member operator.
Definition: printc.hh:68
static OpToken leftequal
The in-place left shift operator.
Definition: printc.hh:105
Description of a control-flow block containing PcodeOps.
Definition: block.hh:60
virtual void opFloatTrunc(const PcodeOp *op)
Emit a FLOAT_TRUNC operator.
Definition: printc.hh:278
static OpToken bitwise_xor
The logical xor operator.
Definition: printc.hh:92
virtual void opFloatAdd(const PcodeOp *op)
Emit a FLOAT_ADD operator.
Definition: printc.hh:269
The base datatype class for the decompiler.
Definition: type.hh:62
A loop structure where the condition is checked at the bottom.
Definition: block.hh:599
virtual void opFloatMult(const PcodeOp *op)
Emit a FLOAT_MULT operator.
Definition: printc.hh:271
virtual void opIntLessEqual(const PcodeOp *op)
Emit a INT_LESSEQUAL operator.
Definition: printc.hh:239
A class for sorting comments into and within basic blocks.
Definition: comment.hh:188
static OpToken divequal
The in-place division operator.
Definition: printc.hh:101
Classes for printing tokens in a high-level language.
A composite Datatype object: A "structure" with component "fields".
Definition: type.hh:301
virtual void opPopcountOp(const PcodeOp *op)
Emit a POPCOUNT operator.
Definition: printc.hh:294
string fieldname
The name of the field.
Definition: printc.hh:49
virtual void opFloatEqual(const PcodeOp *op)
Emit a FLOAT_EQUAL operator.
Definition: printc.hh:264
Base class for the fundamental atomic types.
Definition: type.hh:158
static OpToken bitwise_and
The logical and operator.
Definition: printc.hh:91
Container for data structures associated with a single function.
Definition: funcdata.hh:45
static OpToken greater_equal
The greater than or equal operator.
Definition: printc.hh:88
static OpToken andequal
The in-place logical and operator.
Definition: printc.hh:107
virtual void opBoolAnd(const PcodeOp *op)
Emit a BOOL_AND operator.
Definition: printc.hh:262
virtual void opFloatSqrt(const PcodeOp *op)
Emit a FLOAT_SQRT operator.
Definition: printc.hh:275
static OpToken function_call
The function call operator.
Definition: printc.hh:70
static OpToken boolean_not
The boolean not operator.
Definition: printc.hh:72
static OpToken boolean_or
The boolean or operator.
Definition: printc.hh:95
static OpToken new_op
The new operator.
Definition: printc.hh:99
virtual void opIntEqual(const PcodeOp *op)
Emit a INT_EQUAL operator.
Definition: printc.hh:234
Datatype object representing a pointer.
Definition: type.hh:219
A structure for pushing nested fields to the RPN stack.
Definition: printc.hh:45
virtual void opIntSrem(const PcodeOp *op)
Emit a INT_SREM operator.
Definition: printc.hh:259
virtual void opIntAdd(const PcodeOp *op)
Emit a INT_ADD operator.
Definition: printc.hh:242
A loop structure where the condition is checked at the top.
Definition: block.hh:583
static OpToken plusequal
The in-place addition operator.
Definition: printc.hh:103
virtual void opFloatLess(const PcodeOp *op)
Emit a FLOAT_LESS operator.
Definition: printc.hh:266
static OpToken unary_minus
The unary minus operator.
Definition: printc.hh:73
Specifies subfields of a structure or what a pointer points to.
Definition: type.hh:124
static OpToken minusequal
The in-place subtraction operator.
Definition: printc.hh:104
bool option_hide_exts
Set to true if we should hide implied extension operations.
Definition: printc.hh:120
static OpToken ptr_expr
Pointer adornment for a type declaration.
Definition: printc.hh:112
static OpToken assignment
The assignment operator.
Definition: printc.hh:97
static OpToken multequal
The in-place multiplication operator.
Definition: printc.hh:100
EmitXml::syntax_highlight hilite
Highlight information for the field token.
Definition: printc.hh:50
virtual void opIntSright(const PcodeOp *op)
Emit a INT_SRIGHT operator.
Definition: printc.hh:254
virtual void opFloatAbs(const PcodeOp *op)
Emit a FLOAT_ABS operator.
Definition: printc.hh:274
virtual void opIntOr(const PcodeOp *op)
Emit a INT_OR operator.
Definition: printc.hh:251
static OpToken divide
The division operator.
Definition: printc.hh:79
void setNULLPrinting(bool val)
Toggle the printing of a &#39;NULL&#39; token.
Definition: printc.hh:194
virtual PrintLanguage * buildLanguage(Architecture *glb)
Build the main PrintLanguage object corresponding to this capability.
Definition: printc.cc:86
virtual void opBoolXor(const PcodeOp *op)
Emit a BOOL_XOR operator.
Definition: printc.hh:261
static OpToken bitwise_or
The logical or operator.
Definition: printc.hh:93
An infinite loop structure.
Definition: block.hh:613
void setInplaceOps(bool val)
Toggle the printing of in-place operators.
Definition: printc.hh:195
static OpToken type_expr_space
Type declaration involving a space (identifier or adornment)
Definition: printc.hh:110
void setHideImpliedExts(bool val)
Toggle whether implied extensions are hidden.
Definition: printc.hh:201
static OpToken not_equal
The not equal operator.
Definition: printc.hh:90
CommentSorter commsorter
Container/organizer for comments in the current function.
Definition: printc.hh:122
static OpToken binary_plus
The binary addition operator.
Definition: printc.hh:81
static OpToken boolean_and
The boolean and operator.
Definition: printc.hh:94
static OpToken shift_left
The left shift operator.
Definition: printc.hh:83
A token representing an operator in the high-level language.
Definition: printlanguage.hh:81
static OpToken subscript
The array subscript operator.
Definition: printc.hh:69
void setDisplayUnplaced(bool val)
Toggle whether unplaced comments are displayed in the header.
Definition: printc.hh:200
virtual void opIntSub(const PcodeOp *op)
Emit a INT_SUB operator.
Definition: printc.hh:243
virtual void opFloatFloat2Float(const PcodeOp *op)
Emit a FLOAT_FLOAT2FLOAT operator.
Definition: printc.hh:277
Lowest level operation of the p-code language.
Definition: op.hh:58
static OpToken remequal
The in-place modulo operator.
Definition: printc.hh:102
A low-level machine address for labelling bytes and data.
Definition: address.hh:46
static OpToken bitwise_not
The bitwise negate operator.
Definition: printc.hh:71
virtual void opFloatFloor(const PcodeOp *op)
Emit a FLOAT_FLOOR operator.
Definition: printc.hh:280
A basic "if" block.
Definition: block.hh:553
virtual void opFloatDiv(const PcodeOp *op)
Emit a FLOAT_DIV operator.
Definition: printc.hh:270
bool option_unplaced
Set to true if we should display unplaced comments.
Definition: printc.hh:119
virtual void opIntRem(const PcodeOp *op)
Emit a INT_REM operator.
Definition: printc.hh:258
virtual void opFloatNeg(const PcodeOp *op)
Emit a FLOAT_NEG operator.
Definition: printc.hh:273
syntax_highlight
Possible types of syntax highlighting.
Definition: prettyprint.hh:87
bool option_inplace_ops
Set to true if we should use &#39;+=&#39; &#39;&=&#39; etc.
Definition: printc.hh:116
virtual void opPiece(const PcodeOp *op)
Emit a PIECE operator.
Definition: printc.hh:284
Manager for all the major decompiler subsystems.
Definition: architecture.hh:117
static OpToken shift_right
The right shift operator.
Definition: printc.hh:84
const Datatype * parent
The parent data-type owning the field.
Definition: printc.hh:48
The c-language token emitter.
Definition: printc.hh:63
A control-flow block built out of sub-components.
Definition: block.hh:270
void setCPlusPlusStyleComments(void)
Set c++-style "//" comment delimiters.
Definition: printc.hh:199
virtual void opIntNotEqual(const PcodeOp *op)
Emit a INT_NOTEQUAL operator.
Definition: printc.hh:235
virtual void opFloatSub(const PcodeOp *op)
Emit a FLOAT_SUB operator.
Definition: printc.hh:272
virtual void opIntSdiv(const PcodeOp *op)
Emit a INT_SDIV operator.
Definition: printc.hh:257
A low-level variable or contiguous set of bytes described by an Address and a size.
Definition: varnode.hh:65
void setConvention(bool val)
Toggle whether calling conventions are printed.
Definition: printc.hh:196
A basic block for p-code operations.
Definition: block.hh:363
static OpToken type_expr_nospace
Type declaration with no space.
Definition: printc.hh:111
static OpToken less_than
The less than operator.
Definition: printc.hh:85
Factory and static initializer for the "c-language" back-end to the decompiler.
Definition: printc.hh:32
virtual void opIntCarry(const PcodeOp *op)
Emit a INT_CARRY operator.
Definition: printc.hh:244
virtual void opFloatRound(const PcodeOp *op)
Emit a FLOAT_ROUND operator.
Definition: printc.hh:281
A map from values to control-flow targets within a function.
Definition: jumptable.hh:499
static OpToken equal
The equal operator.
Definition: printc.hh:89
static OpToken modulo
The modulo operator.
Definition: printc.hh:80
virtual void opFloatNan(const PcodeOp *op)
Emit a FLOAT_NAN operator.
Definition: printc.hh:268
virtual void opIntSlessEqual(const PcodeOp *op)
Emit a INT_SLESSEQUAL operator.
Definition: printc.hh:237
static OpToken rightequal
The in-place right shift operator.
Definition: printc.hh:106
bool option_nocasts
Don&#39;t print a cast if true.
Definition: printc.hh:118
A series of blocks that execute in sequence.
Definition: block.hh:495
virtual void opIntSborrow(const PcodeOp *op)
Emit a INT_SBORROW operator.
Definition: printc.hh:246
static OpToken object_member
The member operator.
Definition: printc.hh:67
static OpToken array_expr
Array adornment for a type declaration.
Definition: printc.hh:113
virtual void opCast(const PcodeOp *op)
Emit a CAST operator.
Definition: printc.hh:286
static OpToken typecast
The type cast operator.
Definition: printc.hh:77
virtual void opIntXor(const PcodeOp *op)
Emit a INT_XOR operator.
Definition: printc.hh:249
virtual void opIntNegate(const PcodeOp *op)
Emit a INT_NEGATE operator.
Definition: printc.hh:248
virtual void opIntLess(const PcodeOp *op)
Emit a INT_LESS operator.
Definition: printc.hh:238
const OpToken * token
Operator used to drill-down to the field.
Definition: printc.hh:46
A Symbol that holds equate information for a constant.
Definition: database.hh:270
A block that terminates with an unstructured (goto) branch to another block.
Definition: block.hh:442
static OpToken greater_than
The greater than operator.
Definition: printc.hh:87
virtual void opIntDiv(const PcodeOp *op)
Emit a INT_DIV operator.
Definition: printc.hh:256
virtual void opIndirect(const PcodeOp *op)
Emit a INDIRECT operator.
Definition: printc.hh:283
void setCStyleComments(void)
Set c-style "/* */" comment delimiters.
Definition: printc.hh:198
virtual void opIntLeft(const PcodeOp *op)
Emit a INT_LEFT operator.
Definition: printc.hh:252
virtual void opIntRight(const PcodeOp *op)
Emit a INT_RIGHT operator.
Definition: printc.hh:253
A structured switch construction.
Definition: block.hh:630
bool option_NULL
Set to true if we should emit NULL keyword.
Definition: printc.hh:115
A function prototype.
Definition: fspec.hh:1147
Container class for all Datatype objects in an Architecture.
Definition: type.hh:380
static OpToken hidden
Hidden functional (that may force parentheses)
Definition: printc.hh:65
static OpToken orequal
The in-place logical or operator.
Definition: printc.hh:108
The base class for a symbol in a symbol table or scope.
Definition: database.hh:153
static OpToken boolean_xor
The boolean xor operator.
Definition: printc.hh:96
static OpToken multiply
The multiplication operator.
Definition: printc.hh:78
virtual void opMultiequal(const PcodeOp *op)
Emit a MULTIEQUAL operator.
Definition: printc.hh:282
virtual void opIntSless(const PcodeOp *op)
Emit a INT_SLESS operator.
Definition: printc.hh:236
static OpToken less_equal
The less than or equal operator.
Definition: printc.hh:86
Base type for character data-types: i.e. char.
Definition: type.hh:174
static OpToken enum_cat
The concatenation operator for enumerated values.
Definition: printc.hh:114
virtual void opFloatInt2Float(const PcodeOp *op)
Emit a FLOAT_INT2FLOAT operator.
Definition: printc.hh:276
static OpToken scope
The sub-scope/namespace operator.
Definition: printc.hh:66
const TypeField * field
The component object describing the field.
Definition: printc.hh:47
string nullToken
Token to use for &#39;null&#39;.
Definition: printc.hh:121
static OpToken dereference
The pointer dereference operator.
Definition: printc.hh:76
virtual void opIntScarry(const PcodeOp *op)
Emit a INT_SCARRY operator.
Definition: printc.hh:245
virtual void opIntAnd(const PcodeOp *op)
Emit a INT_AND operator.
Definition: printc.hh:250
virtual void opFloatNotEqual(const PcodeOp *op)
Emit a FLOAT_NOTEQUAL operator.
Definition: printc.hh:265
virtual void opFloatCeil(const PcodeOp *op)
Emit a FLOAT_CEIL operator.
Definition: printc.hh:279
bool option_convention
Set to true if we should print calling convention.
Definition: printc.hh:117
An enumerated Datatype object: an integer with named values.
Definition: type.hh:277
A database interface for high-level language comments.
virtual void opFloatLessEqual(const PcodeOp *op)
Emit a FLOAT_LESSEQUAL operator.
Definition: printc.hh:267
Two conditional blocks combined into one conditional using BOOL_AND or BOOL_OR.
Definition: block.hh:516
virtual void opBoolOr(const PcodeOp *op)
Emit a BOOL_OR operator.
Definition: printc.hh:263
static OpToken unary_plus
The unary plus operator.
Definition: printc.hh:74
static OpToken addressof
The address of operator.
Definition: printc.hh:75
The base class API for emitting a high-level language.
Definition: printlanguage.hh:134
static OpToken comma
The comma operator (for parameter lists)
Definition: printc.hh:98
static OpToken binary_minus
The binary subtraction operator.
Definition: printc.hh:82
Base class for high-level language capabilities.
Definition: printlanguage.hh:39
This class is used to mirror the BlockBasic objects in the fixed control-flow graph for a function...
Definition: block.hh:417
void setNoCastPrinting(bool val)
Toggle whether casts should not be printed.
Definition: printc.hh:197
static OpToken xorequal
The in-place logical xor operator.
Definition: printc.hh:109
virtual void opInt2Comp(const PcodeOp *op)
Emit a INT_2COMP operator.
Definition: printc.hh:247
A collection of Symbol objects within a single (namespace or functional) scope.
Definition: database.hh:413