My Project
printlanguage.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 __PRINT_LANGUAGE__
20 #define __PRINT_LANGUAGE__
21 
22 #include "capability.hh"
23 #include "cast.hh"
24 #include "prettyprint.hh"
25 
26 class PrintLanguage;
27 
40  static vector<PrintLanguageCapability *> thelist;
41 protected:
42  string name;
43  bool isdefault;
44 public:
45  const string &getName(void) const { return name; }
46  virtual void initialize(void);
47 
53  virtual PrintLanguage *buildLanguage(Architecture *glb)=0;
54 
55  static PrintLanguageCapability *getDefault(void);
56  static PrintLanguageCapability *findCapability(const string &name);
57 };
58 
59 class BlockGraph;
60 class BlockBasic;
61 class BlockList;
62 class BlockCopy;
63 class BlockGoto;
64 class BlockIf;
65 class BlockCondition;
66 class BlockWhileDo;
67 class BlockDoWhile;
68 class BlockInfLoop;
69 class BlockSwitch;
70 class Scope;
71 class Symbol;
72 class EquateSymbol;
73 class Comment;
74 
81 class OpToken {
82 public:
84  enum tokentype {
90  hiddenfunction
91  };
92  const char *print;
93  int4 stage;
94  int4 precedence;
95  bool associative;
97  int4 spacing;
98  int4 bump;
100 };
101 
135 public:
137  enum modifiers {
138  force_hex = 1,
139  force_dec = 2,
140  bestfit = 4,
141  force_scinote = 8,
142  force_pointer = 0x10,
143  print_load_value = 0x20,
144  print_store_value = 0x40,
145  no_branch = 0x80,
146  only_branch = 0x100,
147  comma_separate = 0x200,
148  flat = 0x400,
149  falsebranch = 0x800,
150  nofallthru = 0x1000,
151  negatetoken = 0x2000,
152  hide_thisparam = 0x4000
153  };
155  enum tagtype {
162  blanktoken
163  };
164 
166  struct ReversePolish {
167  const OpToken *tok;
168  int4 visited;
169  bool paren;
170  const PcodeOp *op;
171  int4 id;
172  mutable int4 id2;
173  };
174 
179  struct NodePending {
180  const Varnode *vn;
181  const PcodeOp *op;
182  uint4 vnmod;
183 
185  NodePending(const Varnode *v,const PcodeOp *o,uint4 m) {
186  vn = v; op = o; vnmod = m; }
187  };
188 
194  struct Atom {
195  const string &name;
198  const PcodeOp *op;
199  union {
200  const Varnode *vn;
201  const Funcdata *fd;
202  const Datatype *ct;
203  } ptr_second;
204  int4 offset;
205 
207  Atom(const string &nm,tagtype t,EmitXml::syntax_highlight hl)
208  : name(nm) { type = t; highlight = hl; }
209 
211  Atom(const string &nm,tagtype t,EmitXml::syntax_highlight hl,const Datatype *c)
212  : name(nm) { type = t; highlight = hl; ptr_second.ct = c; }
213 
215  Atom(const string &nm,tagtype t,EmitXml::syntax_highlight hl,const Datatype *c,int4 off)
216  : name(nm) { type = t; highlight = hl; ptr_second.ct = c; offset = off; }
217 
219  Atom(const string &nm,tagtype t,EmitXml::syntax_highlight hl,const PcodeOp *o)
220  : name(nm) { type = t; highlight = hl; op = o; }
221 
223  Atom(const string &nm,tagtype t,EmitXml::syntax_highlight hl,const PcodeOp *o,const Varnode *v)
224  : name(nm) { type=t; highlight = hl; ptr_second.vn = v; op = o; }
225 
227  Atom(const string &nm,tagtype t,EmitXml::syntax_highlight hl,const PcodeOp *o,const Funcdata *f)
228  : name(nm) { type=t; highlight = hl; op = o; ptr_second.fd = f; }
229  };
230 private:
231  string name;
232  vector<uint4> modstack;
233  vector<Scope *> scopestack;
234  Scope *curscope;
235  vector<ReversePolish> revpol;
236  vector<NodePending> nodepend;
237  int4 pending;
238  int4 line_commentindent;
239  string commentstart;
240  string commentend;
241 protected:
245  uint4 mods;
248 #ifdef CPUI_DEBUG
249  bool isStackEmpty(void) const { return (nodepend.empty()&&revpol.empty()); }
250  bool isModStackEmpty(void) const { return modstack.empty(); }
251 #endif
252  // Routines that are probably consistent across languages
253  bool isSet(uint4 m) const { return ((mods & m)!=0); }
254  void pushScope(Scope *sc) { scopestack.push_back(sc); curscope = sc; }
255  void popScope(void) { scopestack.pop_back(); curscope = scopestack.back(); }
256  void pushMod(void) { modstack.push_back(mods); }
257  void popMod(void) { mods = modstack.back(); modstack.pop_back(); }
258  void setMod(uint4 m) { mods |= m; }
259  void unsetMod(uint4 m) { mods &= ~m; }
260  void pushOp(const OpToken *tok,const PcodeOp *op);
261  void pushAtom(const Atom &atom);
262  void pushVnImplied(const Varnode *vn,const PcodeOp *op,uint4 m);
263  void pushVnExplicit(const Varnode *vn,const PcodeOp *op);
264  void pushVnLHS(const Varnode *vn,const PcodeOp *op);
265 
266  bool parentheses(const OpToken *op2);
267  void emitOp(const ReversePolish &entry);
268  void emitAtom(const Atom &atom);
269  static bool unicodeNeedsEscape(int4 codepoint);
270  static void writeUtf8(ostream &s,int4 codepoint);
271  static int4 readUtf16(const uint1 *buf,bool bigend);
272  static int4 getCodepoint(const uint1 *buf,int4 charsize,bool bigend,int4 &skip);
273  bool escapeCharacterData(ostream &s,const uint1 *buf,int4 count,int4 charsize,bool bigend) const;
274  void recurse(void);
275  void opBinary(const OpToken *tok,const PcodeOp *op);
276  void opUnary(const OpToken *tok,const PcodeOp *op);
277  int4 getPending(void) const { return pending; }
278 
284  virtual void printUnicode(ostream &s,int4 onechar) const=0;
285 
290  virtual void pushType(const Datatype *ct)=0;
291 
299  virtual void pushConstant(uintb val,const Datatype *ct,
300  const Varnode *vn,const PcodeOp *op)=0;
301 
310  virtual bool pushEquate(uintb val,int4 sz,const EquateSymbol *sym,const Varnode *vn,const PcodeOp *op)=0;
311 
317  virtual void pushAnnotation(const Varnode *vn,const PcodeOp *op)=0;
318 
324  virtual void pushSymbol(const Symbol *sym,const Varnode *vn,
325  const PcodeOp *op)=0;
326 
334  virtual void pushUnnamedLocation(const Address &addr,
335  const Varnode *vn,const PcodeOp *op)=0;
336 
346  virtual void pushPartialSymbol(const Symbol *sym,int4 off,int4 sz,
347  const Varnode *vn,const PcodeOp *op,Datatype *outtype)=0;
348 
358  virtual void pushMismatchSymbol(const Symbol *sym,int4 off,int4 sz,
359  const Varnode *vn,const PcodeOp *op)=0;
360 
361  virtual void emitLineComment(int4 indent,const Comment *comm);
362 
367  virtual void emitVarDecl(const Symbol *sym)=0;
368 
372  virtual void emitVarDeclStatement(const Symbol *sym)=0;
373 
380  virtual bool emitScopeVarDecls(const Scope *scope,int4 cat)=0;
381 
387  virtual void emitExpression(const PcodeOp *op)=0;
388 
393  virtual void emitFunctionDeclaration(const Funcdata *fd)=0;
394 
401  virtual bool checkPrintNegation(const Varnode *vn)=0;
402 public:
403  PrintLanguage(Architecture *g,const string &nm);
404  virtual ~PrintLanguage(void);
405  const string &getName(void) const { return name; }
406  CastStrategy *getCastStrategy(void) const { return castStrategy; }
407  ostream *getOutputStream(void) const { return emit->getOutputStream(); }
408  void setOutputStream(ostream *t) { emit->setOutputStream(t); }
409  void setScope(Scope *sc) { curscope = sc; }
410  void setMaxLineSize(int4 mls) { emit->setMaxLineSize(mls); }
411  void setIndentIncrement(int4 inc) { emit->setIndentIncrement(inc); }
412  void setLineCommentIndent(int4 val);
413  void setCommentDelimeter(const string &start,const string &stop,
414  bool usecommentfill);
415  uint4 getInstructionComment(void) const { return instr_comment_type; }
416  void setInstructionComment(uint4 val) { instr_comment_type = val; }
417  uint4 getHeaderComment(void) const { return head_comment_type; }
418  void setHeaderComment(uint4 val) { head_comment_type = val; }
419  bool emitsXml(void) const { return emit->emitsXml(); }
420  void setXML(bool val);
421  void setFlat(bool val);
422 
423  virtual void adjustTypeOperators(void)=0;
424  virtual void clear(void);
425  virtual void setIntegerFormat(const string &nm);
426 
432  virtual void setCommentStyle(const string &nm)=0;
433 
440  virtual bool isCharacterConstant(const uint1 *buf,int4 size,int4 charsize) const=0;
441 
445  virtual void docTypeDefinitions(const TypeFactory *typegrp)=0;
446 
448  virtual void docAllGlobals(void)=0;
449 
453  virtual void docSingleGlobal(const Symbol *sym)=0;
454 
458  virtual void docFunction(const Funcdata *fd)=0;
459 
460  virtual void emitBlockBasic(const BlockBasic *bb)=0;
461  virtual void emitBlockGraph(const BlockGraph *bl)=0;
462  virtual void emitBlockCopy(const BlockCopy *bl)=0;
463  virtual void emitBlockGoto(const BlockGoto *bl)=0;
464  virtual void emitBlockLs(const BlockList *bl)=0;
465  virtual void emitBlockCondition(const BlockCondition *bl)=0;
466  virtual void emitBlockIf(const BlockIf *bl)=0;
467  virtual void emitBlockWhileDo(const BlockWhileDo *bl)=0;
468  virtual void emitBlockDoWhile(const BlockDoWhile *bl)=0;
469  virtual void emitBlockInfLoop(const BlockInfLoop *bl)=0;
470  virtual void emitBlockSwitch(const BlockSwitch *bl)=0;
471 
472  virtual void opCopy(const PcodeOp *op)=0;
473  virtual void opLoad(const PcodeOp *op)=0;
474  virtual void opStore(const PcodeOp *op)=0;
475  virtual void opBranch(const PcodeOp *op)=0;
476  virtual void opCbranch(const PcodeOp *op)=0;
477  virtual void opBranchind(const PcodeOp *op)=0;
478  virtual void opCall(const PcodeOp *op)=0;
479  virtual void opCallind(const PcodeOp *op)=0;
480  virtual void opCallother(const PcodeOp *op)=0;
481  virtual void opConstructor(const PcodeOp *op,bool withNew)=0;
482  virtual void opReturn(const PcodeOp *op)=0;
483  virtual void opIntEqual(const PcodeOp *op)=0;
484  virtual void opIntNotEqual(const PcodeOp *op)=0;
485  virtual void opIntSless(const PcodeOp *op)=0;
486  virtual void opIntSlessEqual(const PcodeOp *op)=0;
487  virtual void opIntLess(const PcodeOp *op)=0;
488  virtual void opIntLessEqual(const PcodeOp *op)=0;
489  virtual void opIntZext(const PcodeOp *op,const PcodeOp *readOp)=0;
490  virtual void opIntSext(const PcodeOp *op,const PcodeOp *readOp)=0;
491  virtual void opIntAdd(const PcodeOp *op)=0;
492  virtual void opIntSub(const PcodeOp *op)=0;
493  virtual void opIntCarry(const PcodeOp *op)=0;
494  virtual void opIntScarry(const PcodeOp *op)=0;
495  virtual void opIntSborrow(const PcodeOp *op)=0;
496  virtual void opInt2Comp(const PcodeOp *op)=0;
497  virtual void opIntNegate(const PcodeOp *op)=0;
498  virtual void opIntXor(const PcodeOp *op)=0;
499  virtual void opIntAnd(const PcodeOp *op)=0;
500  virtual void opIntOr(const PcodeOp *op)=0;
501  virtual void opIntLeft(const PcodeOp *op)=0;
502  virtual void opIntRight(const PcodeOp *op)=0;
503  virtual void opIntSright(const PcodeOp *op)=0;
504  virtual void opIntMult(const PcodeOp *op)=0;
505  virtual void opIntDiv(const PcodeOp *op)=0;
506  virtual void opIntSdiv(const PcodeOp *op)=0;
507  virtual void opIntRem(const PcodeOp *op)=0;
508  virtual void opIntSrem(const PcodeOp *op)=0;
509  virtual void opBoolNegate(const PcodeOp *op)=0;
510  virtual void opBoolXor(const PcodeOp *op)=0;
511  virtual void opBoolAnd(const PcodeOp *op)=0;
512  virtual void opBoolOr(const PcodeOp *op)=0;
513  virtual void opFloatEqual(const PcodeOp *op)=0;
514  virtual void opFloatNotEqual(const PcodeOp *op)=0;
515  virtual void opFloatLess(const PcodeOp *op)=0;
516  virtual void opFloatLessEqual(const PcodeOp *op)=0;
517  virtual void opFloatNan(const PcodeOp *op)=0;
518  virtual void opFloatAdd(const PcodeOp *op)=0;
519  virtual void opFloatDiv(const PcodeOp *op)=0;
520  virtual void opFloatMult(const PcodeOp *op)=0;
521  virtual void opFloatSub(const PcodeOp *op)=0;
522  virtual void opFloatNeg(const PcodeOp *op)=0;
523  virtual void opFloatAbs(const PcodeOp *op)=0;
524  virtual void opFloatSqrt(const PcodeOp *op)=0;
525  virtual void opFloatInt2Float(const PcodeOp *op)=0;
526  virtual void opFloatFloat2Float(const PcodeOp *op)=0;
527  virtual void opFloatTrunc(const PcodeOp *op)=0;
528  virtual void opFloatCeil(const PcodeOp *op)=0;
529  virtual void opFloatFloor(const PcodeOp *op)=0;
530  virtual void opFloatRound(const PcodeOp *op)=0;
531  virtual void opMultiequal(const PcodeOp *op)=0;
532  virtual void opIndirect(const PcodeOp *op)=0;
533  virtual void opPiece(const PcodeOp *op)=0;
534  virtual void opSubpiece(const PcodeOp *op)=0;
535  virtual void opCast(const PcodeOp *op)=0;
536  virtual void opPtradd(const PcodeOp *op)=0;
537  virtual void opPtrsub(const PcodeOp *op)=0;
538  virtual void opSegmentOp(const PcodeOp *op)=0;
539  virtual void opCpoolRefOp(const PcodeOp *op)=0;
540  virtual void opNewOp(const PcodeOp *op)=0;
541  virtual void opInsertOp(const PcodeOp *op)=0;
542  virtual void opExtractOp(const PcodeOp *op)=0;
543  virtual void opPopcountOp(const PcodeOp *op)=0;
544 
545  static int4 mostNaturalBase(uintb val);
546  static void formatBinary(ostream &s,uintb val);
547 };
548 
549 #endif
NodePending(const Varnode *v, const PcodeOp *o, uint4 m)
Construct a pending data-flow node.
Definition: printlanguage.hh:185
Atom(const string &nm, tagtype t, EmitXml::syntax_highlight hl, const Datatype *c)
Construct a token for a data-type name.
Definition: printlanguage.hh:211
const string & getName(void) const
Get the language name.
Definition: printlanguage.hh:405
void unsetMod(uint4 m)
Deactivate the given printing modification.
Definition: printlanguage.hh:259
CastStrategy * castStrategy
The strategy for emitting explicit case operations.
Definition: printlanguage.hh:243
uint4 mods
Currently active printing modifications.
Definition: printlanguage.hh:245
void pushScope(Scope *sc)
Push a new symbol scope.
Definition: printlanguage.hh:254
virtual void setOutputStream(ostream *t)
Set the output stream for the emitter.
Definition: prettyprint.hh:139
void popMod(void)
Pop to the previous printing modifications.
Definition: printlanguage.hh:257
The base datatype class for the decompiler.
Definition: type.hh:62
Modifier form (like a cast operation)
Definition: printlanguage.hh:88
A loop structure where the condition is checked at the bottom.
Definition: block.hh:599
API and specific strategies for applying type casts.
void setScope(Scope *sc)
Set the current Symbol scope.
Definition: printlanguage.hh:409
ostream * getOutputStream(void) const
Get the output stream being emitted to.
Definition: printlanguage.hh:407
int4 id2
The id of the token group this surrounds (for surround operator tokens)
Definition: printlanguage.hh:172
string name
Unique identifier for language capability.
Definition: printlanguage.hh:42
Container for data structures associated with a single function.
Definition: funcdata.hh:45
virtual ostream * getOutputStream(void) const
Get the current output stream.
Definition: prettyprint.hh:140
bool emitsXml(void) const
Does the low-level emitter, emit XML markup.
Definition: printlanguage.hh:419
Base class (and interface) for pretty printing and XML markup of tokens.
Definition: prettyprint.hh:76
Atom(const string &nm, tagtype t, EmitXml::syntax_highlight hl, const Datatype *c, int4 off)
Construct a token for a field name.
Definition: printlanguage.hh:215
Emit atom as structure field.
Definition: printlanguage.hh:161
const Datatype * ct
A type associated with the token.
Definition: printlanguage.hh:202
Atom(const string &nm, tagtype t, EmitXml::syntax_highlight hl)
Construct a token with no associated data-flow annotations.
Definition: printlanguage.hh:207
bool isdefault
Set to true to treat this as the default language.
Definition: printlanguage.hh:43
Atom(const string &nm, tagtype t, EmitXml::syntax_highlight hl, const PcodeOp *o, const Funcdata *f)
Construct a token for a function name.
Definition: printlanguage.hh:227
A loop structure where the condition is checked at the top.
Definition: block.hh:583
static PrintLanguageCapability * getDefault(void)
Retrieve the default language capability.
Definition: printlanguage.cc:25
const Varnode * vn
The implied Varnode.
Definition: printlanguage.hh:180
No explicitly printed token.
Definition: printlanguage.hh:89
uint4 instr_comment_type
Type of instruction comments to display.
Definition: printlanguage.hh:246
Emit atom as syntax.
Definition: printlanguage.hh:156
void setMod(uint4 m)
Activate the given printing modification.
Definition: printlanguage.hh:258
Infrastructure for discovering code extensions to the decompiler.
virtual bool emitsXml(void) const
Determine if this is an XML markup emitter.
Definition: prettyprint.hh:197
const Funcdata * fd
A function associated with the token.
Definition: printlanguage.hh:201
void pushMod(void)
Push current printing modifications to the stack.
Definition: printlanguage.hh:256
const string & getName(void) const
Get the high-level language name.
Definition: printlanguage.hh:45
A comment attached to a specific function and code address.
Definition: comment.hh:37
void popScope(void)
Pop to the previous symbol scope.
Definition: printlanguage.hh:255
bool paren
True if parentheses are required.
Definition: printlanguage.hh:169
tokentype
The possible types of operator token.
Definition: printlanguage.hh:84
virtual void setMaxLineSize(int4 mls)
Provide a maximum line size to the pretty printer.
Definition: prettyprint.hh:179
An infinite loop structure.
Definition: block.hh:613
Atom(const string &nm, tagtype t, EmitXml::syntax_highlight hl, const PcodeOp *o, const Varnode *v)
Construct a token with an associated PcodeOp and Varnode.
Definition: printlanguage.hh:223
void setMaxLineSize(int4 mls)
Set the maximum number of characters per line.
Definition: printlanguage.hh:410
const string & name
The actual printed characters of the token.
Definition: printlanguage.hh:195
An entry on the reverse polish notation (RPN) stack.
Definition: printlanguage.hh:166
A strategy for applying type casts.
Definition: cast.hh:40
A token representing an operator in the high-level language.
Definition: printlanguage.hh:81
A pending data-flow node; waiting to be placed on the reverse polish notation stack.
Definition: printlanguage.hh:179
Lowest level operation of the p-code language.
Definition: op.hh:58
A low-level machine address for labelling bytes and data.
Definition: address.hh:46
Binary operator form (printed between its inputs)
Definition: printlanguage.hh:85
void setOutputStream(ostream *t)
Set the output stream to emit to.
Definition: printlanguage.hh:408
A basic "if" block.
Definition: block.hh:553
A single non-operator token emitted by the decompiler.
Definition: printlanguage.hh:194
bool associative
True if the operator is associative.
Definition: printlanguage.hh:95
int4 precedence
Precedence level of this token (higher binds more tightly)
Definition: printlanguage.hh:94
Atom(const string &nm, tagtype t, EmitXml::syntax_highlight hl, const PcodeOp *o)
Construct a token with an associated PcodeOp.
Definition: printlanguage.hh:219
syntax_highlight
Possible types of syntax highlighting.
Definition: prettyprint.hh:87
const PcodeOp * op
The PcodeOp associated with the operator token.
Definition: printlanguage.hh:170
const PcodeOp * op
A p-code operation associated with the token.
Definition: printlanguage.hh:198
Manager for all the major decompiler subsystems.
Definition: architecture.hh:117
A control-flow block built out of sub-components.
Definition: block.hh:270
modifiers
Possible context sensitive modifiers to how tokens get emitted.
Definition: printlanguage.hh:137
A low-level variable or contiguous set of bytes described by an Address and a size.
Definition: varnode.hh:65
A basic block for p-code operations.
Definition: block.hh:363
uint4 getInstructionComment(void) const
Get the type of comments suitable within the body of a function.
Definition: printlanguage.hh:415
void setIndentIncrement(int4 val)
Set the number of characters indented per level of nesting.
Definition: prettyprint.hh:212
CastStrategy * getCastStrategy(void) const
Get the casting strategy for the language.
Definition: printlanguage.hh:406
int4 visited
The current stage of printing for the operator.
Definition: printlanguage.hh:168
int4 getPending(void) const
Get the number of pending nodes yet to be put on the RPN stack.
Definition: printlanguage.hh:277
A series of blocks that execute in sequence.
Definition: block.hh:495
EmitXml::syntax_highlight highlight
The type of highlighting to use when emitting the token.
Definition: printlanguage.hh:197
Routines for emitting high-level (C) language syntax in a well formatted way.
void setInstructionComment(uint4 val)
Set the type of comments suitable within the body of a function.
Definition: printlanguage.hh:416
static PrintLanguageCapability * findCapability(const string &name)
Find a language capability by name.
Definition: printlanguage.cc:44
A Symbol that holds equate information for a constant.
Definition: database.hh:270
void setIndentIncrement(int4 inc)
Set the number of characters to indent per level of code nesting.
Definition: printlanguage.hh:411
A block that terminates with an unstructured (goto) branch to another block.
Definition: block.hh:442
int4 bump
Spaces to indent if we break here.
Definition: printlanguage.hh:98
virtual void initialize(void)
Complete initialization of an extension point.
Definition: printlanguage.cc:33
int4 stage
Additional elements consumed from the RPN stack when emitting this token.
Definition: printlanguage.hh:93
A structured switch construction.
Definition: block.hh:630
const OpToken * tok
The operator token.
Definition: printlanguage.hh:167
Container class for all Datatype objects in an Architecture.
Definition: type.hh:380
const Varnode * vn
A Varnode associated with the token.
Definition: printlanguage.hh:200
tokentype type
The basic token type.
Definition: printlanguage.hh:96
uint4 getHeaderComment(void) const
Get the type of comments suitable for a function header.
Definition: printlanguage.hh:417
Emit atom as function name.
Definition: printlanguage.hh:158
The base class for a symbol in a symbol table or scope.
Definition: database.hh:153
Unary operator form (printed before its input)
Definition: printlanguage.hh:86
Class for automatically registering extension points to the decompiler.
Definition: capability.hh:36
Emit atom as operator.
Definition: printlanguage.hh:160
int4 offset
The offset (within the parent structure) for a field token.
Definition: printlanguage.hh:204
EmitXml * emit
The low-level token emitter.
Definition: printlanguage.hh:244
Architecture * glb
The Architecture owning the language emitter.
Definition: printlanguage.hh:242
Emit atom as operator.
Definition: printlanguage.hh:159
Function or array operator form.
Definition: printlanguage.hh:87
tagtype type
The type of Atom.
Definition: printlanguage.hh:196
void setHeaderComment(uint4 val)
Set the type of comments suitable for a function header.
Definition: printlanguage.hh:418
virtual PrintLanguage * buildLanguage(Architecture *glb)=0
Build the main PrintLanguage object corresponding to this capability.
Two conditional blocks combined into one conditional using BOOL_AND or BOOL_OR.
Definition: block.hh:516
Emit atom as variable.
Definition: printlanguage.hh:157
int4 id
The id of the token group which this belongs to.
Definition: printlanguage.hh:171
The base class API for emitting a high-level language.
Definition: printlanguage.hh:134
uint4 head_comment_type
Type of header comments to display.
Definition: printlanguage.hh:247
int4 spacing
Spaces to print around operator.
Definition: printlanguage.hh:97
OpToken * negate
The token representing the negation of this token.
Definition: printlanguage.hh:99
uint4 vnmod
Printing modifications to enforce on the expression.
Definition: printlanguage.hh:182
const PcodeOp * op
The single operator consuming value from the implied Varnode.
Definition: printlanguage.hh:181
bool isSet(uint4 m) const
Is the given printing modification active.
Definition: printlanguage.hh:253
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
const char * print
Printing characters for the token.
Definition: printlanguage.hh:92
A collection of Symbol objects within a single (namespace or functional) scope.
Definition: database.hh:413
tagtype
Possible types of Atom.
Definition: printlanguage.hh:155