Ghidra Decompiler Analysis Engine
|
Go to the documentation of this file.
19 #ifndef __PRETTYPRINT__
20 #define __PRETTYPRINT__
77 static const char *highlight[];
107 virtual void tagLine(int4 indent);
125 virtual int4
openParen(
char o,int4
id=0);
140 virtual void setOutputStream(ostream *t) {
s = t; }
141 virtual ostream *getOutputStream(
void)
const {
return s; }
142 virtual void spaces(int4 num,int4 bump=0);
234 *
s << endl;
for(int4 i=indent;i>0;--i) *
s <<
' '; }
266 virtual bool emitsXml(
void)
const {
return false; }
349 static int4 countbase;
357 tagtype=
docu_b; delimtype=
begin; size=0; count=countbase++;
return count; }
363 tagtype=
docu_e; delimtype=
end; size=0; count=id; }
369 tagtype=
func_b; delimtype=
begin; size=0; ptr_second.fd=f; count=countbase++;
return count; }
375 tagtype=
func_e; delimtype=
end; size=0; count=id; }
382 tagtype=
bloc_b; delimtype=
ignore; ptr_second.bl=b; count=countbase++;
return count; }
395 tagtype=
rtyp_b; delimtype=
begin; ptr_second.vn=v; count=countbase++;
return count; }
401 tagtype=
rtyp_e; delimtype=
end; count=id; }
408 tagtype=
vard_b; delimtype=
begin; ptr_second.symbol=sym; count = countbase++;
return count; }
414 tagtype=
vard_e; delimtype=
end; count=id; }
421 tagtype=
stat_b; delimtype=
begin; op=o; count=countbase++;
return count; }
427 tagtype=
stat_e; delimtype=
end; count=id; }
433 tagtype=
prot_b; delimtype=
begin; count=countbase++;
return count; }
439 tagtype=
prot_e; delimtype=
end; count=id; }
449 tok = ptr; size = tok.size();
458 tok = ptr; size = tok.size();
468 tok = ptr; size = tok.size();
477 tok = ptr; size = tok.size();
487 tok = ptr; size = tok.size();
498 tok = ptr; size = tok.size(); ptr_second.spc=s; off=o;
509 tok = ptr; size = tok.size(); ptr_second.spc=s; off=o;
517 tok = str; size=tok.size();
540 tagtype=
oinv_t; delimtype=
begin; count=countbase++;
return count; }
546 tagtype=
cinv_t; delimtype=
end; count=id; }
554 count=countbase++;
return count; }
587 tagtype=
line_t; delimtype=
tokenbreak; numspaces=999999; indentbump=indent; }
590 int4 getIndentBump(
void)
const {
return indentbump; }
591 int4 getNumSpaces(
void)
const {
return numspaces; }
592 int4 getSize(
void)
const {
return size; }
593 void setSize(int4 sz) { size = sz; }
594 printclass getClass(
void)
const {
return delimtype; }
595 tag_type getTag(
void)
const {
return tagtype; }
597 int4 getCount(
void)
const {
return count; }
598 void printDebug(ostream &s)
const;
608 template<
typename _type>
618 int4 getMax(
void)
const {
return max; }
620 void clear(
void) { left=1; right=0; }
621 bool empty(
void)
const {
return (left == (right+1)%max); }
622 int4 topref(
void)
const {
return right; }
623 int4 bottomref(
void)
const {
return left; }
624 _type &ref(int4 r) {
return cache[r]; }
625 _type &top(
void) {
return cache[right]; }
626 _type &bottom(
void) {
return cache[left]; }
627 _type &push(
void) { right=(right+1)%max;
return cache[right]; }
628 _type &pop(
void) { int4 tmp=right; right=(right+max-1)%max;
return cache[tmp]; }
629 _type &popbottom(
void) { int4 tmp=left; left=(left+1)%max;
return cache[tmp]; }
633 template<
typename _type>
640 cache =
new _type [ sz ];
643 template<
typename _type>
652 template<
typename _type>
659 cache =
new _type [ sz ];
670 template<
typename _type>
674 _type *newcache =
new _type [ max + amount ];
681 newcache[j++] = cache[i];
684 newcache[j] = cache[i];
708 vector<int4> checkid;
711 vector<int4> indentstack;
722 void checkstart(
void);
724 void checkstring(
void);
725 void checkbreak(
void);
728 void advanceleft(
void);
741 virtual void tagLine(int4 indent);
761 virtual int4
openParen(
char o,int4
id=0);
765 virtual void clear(
void);
766 virtual void setOutputStream(ostream *t) { lowlevel->setOutputStream(t); }
767 virtual ostream *getOutputStream(
void)
const {
return lowlevel->getOutputStream(); }
768 virtual void spaces(int4 num,int4 bump=0);
773 virtual void flush(
void);
@ bloc_e
End of a control-flow section.
Definition: prettyprint.hh:304
virtual void endDocument(int4 id)
End a whole document of output.
Definition: prettyprint.cc:872
virtual void endVarDecl(int4 id)
End a variable declaration.
Definition: prettyprint.hh:238
A circular buffer template.
Definition: prettyprint.hh:609
@ tokenstring
A token representing actual content.
Definition: prettyprint.hh:288
virtual void stopComment(int4 id)
End a comment block.
Definition: prettyprint.cc:1137
virtual int4 beginStatement(const PcodeOp *op)
Begin a source code statement.
Definition: prettyprint.cc:122
virtual void tagType(const char *ptr, syntax_highlight hl, const Datatype *ct)
Emit a data-type identifier.
Definition: prettyprint.cc:1042
@ cinv_t
End of an arbitrary (invisible) grouping.
Definition: prettyprint.hh:324
virtual void spaces(int4 num, int4 bump=0)
Emit a sequence of space characters as part of source code.
Definition: prettyprint.cc:1161
virtual void tagOp(const char *ptr, syntax_highlight hl, const PcodeOp *op)
Emit an operation token.
Definition: prettyprint.cc:1024
@ field_t
A field name for a structured data-type.
Definition: prettyprint.hh:317
void tagField(const char *ptr, EmitXml::syntax_highlight h, const Datatype *ct, int4 o)
Create an identifier for a field within a structured data-type.
Definition: prettyprint.hh:486
virtual void endVarDecl(int4 id)
End a variable declaration.
Definition: prettyprint.cc:115
virtual void tagLabel(const char *ptr, syntax_highlight hl, const AddrSpace *spc, uintb off)
Emit a code label identifier.
Definition: prettyprint.cc:1069
A region where processor data is stored.
Definition: space.hh:73
virtual int4 getMaxLineSize(void) const
Get the current maximum line size.
Definition: prettyprint.hh:186
Description of a control-flow block containing PcodeOps.
Definition: block.hh:60
@ docu_b
Start of a document.
Definition: prettyprint.hh:299
@ synt_t
Other unspecified syntax.
Definition: prettyprint.hh:320
@ opar_t
Open parenthesis.
Definition: prettyprint.hh:321
virtual void endReturnType(int4 id)
End a return type declaration.
Definition: prettyprint.hh:236
virtual int4 startIndent(void)
Start a new indent level.
Definition: prettyprint.cc:1170
virtual int4 getMaxLineSize(void) const
Get the current maximum line size.
Definition: prettyprint.hh:775
virtual void tagComment(const char *ptr, syntax_highlight hl, const AddrSpace *spc, uintb off)
Emit a comment string as part of the generated source code.
Definition: prettyprint.cc:259
void tagLine(int4 indent)
Create a line break token with special indentation.
Definition: prettyprint.hh:586
virtual void closeParen(char c, int4 id)
Emit a close parenthesis.
Definition: prettyprint.hh:264
@ ignore
Mark-up that doesn't affect pretty printing.
Definition: prettyprint.hh:294
virtual void resetDefaults(void)
(Re)set the default emitting options
Definition: prettyprint.cc:347
virtual bool emitsXml(void) const
Determine if this is an XML markup emitter.
Definition: prettyprint.hh:266
virtual int4 beginFuncProto(void)
Begin a function prototype declaration.
Definition: prettyprint.cc:996
virtual void tagVariable(const char *ptr, syntax_highlight hl, const Varnode *vn, const PcodeOp *op)
Emit a variable token.
Definition: prettyprint.cc:1015
@ param_color
Function parameters.
Definition: prettyprint.hh:95
void endDocument(int4 id)
Create an "end document" command.
Definition: prettyprint.hh:362
virtual void closeGroup(int4 id)
End a group of things that are printed together.
Definition: prettyprint.cc:1118
virtual void stopIndent(int4 id)
End an indent level.
Definition: prettyprint.hh:155
virtual void tagComment(const char *ptr, syntax_highlight hl, const AddrSpace *spc, uintb off)
Emit a comment string as part of the generated source code.
Definition: prettyprint.cc:1060
syntax_highlight
Possible types of syntax highlighting.
Definition: prettyprint.hh:88
int4 beginDocument(void)
Create a "begin document" command.
Definition: prettyprint.hh:356
@ end_comment
End of a comment block.
Definition: prettyprint.hh:293
virtual int4 beginBlock(const FlowBlock *bl)
Begin a control-flow element.
Definition: prettyprint.cc:904
int4 startIndent(int4 bump)
Create a "start a new indent level" command.
Definition: prettyprint.hh:552
@ stat_e
End of a statement.
Definition: prettyprint.hh:310
void tagType(const char *ptr, EmitXml::syntax_highlight h, const Datatype *ct)
Create a data-type identifier token.
Definition: prettyprint.hh:476
virtual void tagField(const char *ptr, syntax_highlight hl, const Datatype *ct, int4 off)
Emit an identifier for a field within a structured data-type.
Definition: prettyprint.cc:234
virtual int4 openParen(char o, int4 id=0)
Emit an open parenthesis.
Definition: prettyprint.cc:1087
@ bloc_b
Start of a control-flow section.
Definition: prettyprint.hh:303
virtual int4 beginVarDecl(const Symbol *sym)
Begin a variable declaration.
Definition: prettyprint.cc:958
void endVarDecl(int4 id)
Create an "end variable declaration" command.
Definition: prettyprint.hh:413
@ vari_t
A variable identifier.
Definition: prettyprint.hh:313
void openParen(char o, int4 id)
Create an open parenthesis.
Definition: prettyprint.hh:524
A trivial emitter that outputs syntax straight to the stream.
Definition: prettyprint.hh:224
virtual void setCommentFill(const string &fill)
Set the comment fill characters for when line breaks are forced.
Definition: prettyprint.hh:776
@ stat_b
Start of a statement.
Definition: prettyprint.hh:309
virtual int4 beginVarDecl(const Symbol *sym)
Begin a variable declaration.
Definition: prettyprint.hh:237
virtual void endBlock(int4 id)
End a control-flow element.
Definition: prettyprint.cc:913
virtual void stopComment(int4 id)
End a comment block.
Definition: prettyprint.hh:167
void endFunction(int4 id)
Create an "end function body" command.
Definition: prettyprint.hh:374
virtual int4 openParen(char o, int4 id=0)
Emit an open parenthesis.
Definition: prettyprint.cc:304
virtual void tagVariable(const char *ptr, syntax_highlight hl, const Varnode *vn, const PcodeOp *op)
Emit a variable token.
Definition: prettyprint.hh:243
virtual void resetDefaults(void)
(Re)set the default emitting options
Definition: prettyprint.cc:1233
virtual void endBlock(int4 id)
End a control-flow element.
Definition: prettyprint.hh:232
virtual void setCommentFill(const string &fill)
Set the comment fill characters for when line breaks are forced.
Definition: prettyprint.hh:193
virtual int4 beginReturnType(const Varnode *vn)
Begin a return type declaration.
Definition: prettyprint.hh:235
virtual void tagLabel(const char *ptr, syntax_highlight hl, const AddrSpace *spc, uintb off)
Emit a code label identifier.
Definition: prettyprint.cc:276
void tagComment(const char *ptr, EmitXml::syntax_highlight h, const AddrSpace *s, uintb o)
Create a comment string in the generated source code.
Definition: prettyprint.hh:496
void setXML(bool val)
Toggle whether the low-level emitter emits XML markup or not.
Definition: prettyprint.cc:1209
virtual void endReturnType(int4 id)
End a return type declaration.
Definition: prettyprint.cc:949
virtual void print(const char *str, syntax_highlight hl=no_color)
Emit other (more unusual) syntax as part of source code generation.
Definition: prettyprint.hh:260
void expand(int4 amount)
Expand the (maximum) size of the queue.
Definition: prettyprint.hh:671
void stopIndent(int4 id)
Create an "end an indent level" command.
Definition: prettyprint.hh:559
virtual void tagField(const char *ptr, syntax_highlight hl, const Datatype *ct, int4 off)
Emit an identifier for a field within a structured data-type.
Definition: prettyprint.hh:252
@ end
A token that ends a printing group.
Definition: prettyprint.hh:287
void endReturnType(int4 id)
Create an "end return type declaration" command.
Definition: prettyprint.hh:400
Lowest level operation of the p-code language.
Definition: op.hh:58
virtual void tagType(const char *ptr, syntax_highlight hl, const Datatype *ct)
Emit a data-type identifier.
Definition: prettyprint.hh:250
virtual void setMaxLineSize(int4 mls)
Provide a maximum line size to the pretty printer.
Definition: prettyprint.hh:180
@ comm_t
Part of a comment block.
Definition: prettyprint.hh:318
@ global_color
Global variable identifiers.
Definition: prettyprint.hh:96
int4 openGroup(void)
Create a "start a printing group" command.
Definition: prettyprint.hh:539
int4 parenlevel
Current depth of parentheses.
Definition: prettyprint.hh:81
@ const_color
Constant values.
Definition: prettyprint.hh:94
virtual int4 beginDocument(void)
Begin a whole document of output.
Definition: prettyprint.cc:862
int4 beginVarDecl(const Symbol *sym)
Create a "begin variable declaration" command.
Definition: prettyprint.hh:407
@ begin_comment
Start of a comment block.
Definition: prettyprint.hh:292
virtual void tagFuncName(const char *ptr, syntax_highlight hl, const Funcdata *fd, const PcodeOp *op)
Emit a function identifier.
Definition: prettyprint.hh:248
virtual void endFuncProto(int4 id)
End a function prototype declaration.
Definition: prettyprint.cc:1006
@ end_indent
End of a nesting level.
Definition: prettyprint.hh:291
virtual void tagLabel(const char *ptr, syntax_highlight hl, const AddrSpace *spc, uintb off)
Emit a code label identifier.
Definition: prettyprint.hh:257
@ funcname_color
Function identifiers.
Definition: prettyprint.hh:92
virtual void tagType(const char *ptr, syntax_highlight hl, const Datatype *ct)
Emit a data-type identifier.
Definition: prettyprint.cc:216
void setIndentIncrement(int4 val)
Set the number of characters indented per level of nesting.
Definition: prettyprint.hh:216
virtual int4 startIndent(void)
Start a new indent level.
Definition: prettyprint.hh:148
virtual void tagField(const char *ptr, syntax_highlight hl, const Datatype *ct, int4 off)
Emit an identifier for a field within a structured data-type.
Definition: prettyprint.cc:1051
virtual void tagComment(const char *ptr, syntax_highlight hl, const AddrSpace *spc, uintb off)
Emit a comment string as part of the generated source code.
Definition: prettyprint.hh:254
void tagVariable(const char *ptr, EmitXml::syntax_highlight h, const Varnode *v, const PcodeOp *o)
Create a variable identifier token.
Definition: prettyprint.hh:447
virtual void endFunction(int4 id)
End a whole declaration and body of a function.
Definition: prettyprint.hh:230
void tagLine(void)
Create a line break token.
Definition: prettyprint.hh:582
A low-level variable or contiguous set of bytes described by an Address and a size.
Definition: varnode.hh:65
virtual void endFunction(int4 id)
End a whole declaration and body of a function.
Definition: prettyprint.cc:52
@ bump_t
Required line break.
Definition: prettyprint.hh:326
int4 indentlevel
Current indent level (in fixed width characters)
Definition: prettyprint.hh:80
void closeParen(char c, int4 id)
Create a close parenthesis.
Definition: prettyprint.hh:532
@ label_t
A code label.
Definition: prettyprint.hh:319
@ begin
A token that starts a printing group.
Definition: prettyprint.hh:286
virtual void endVarDecl(int4 id)
End a variable declaration.
Definition: prettyprint.cc:968
virtual int4 beginStatement(const PcodeOp *op)
Begin a source code statement.
Definition: prettyprint.hh:239
void spaces(int4 num, int4 bump)
Create a whitespace token.
Definition: prettyprint.hh:578
const FlowBlock * bl
Associated Control-flow.
Definition: prettyprint.hh:338
virtual bool emitsXml(void) const
Determine if this is an XML markup emitter.
Definition: prettyprint.hh:198
virtual bool emitsXml(void) const
Determine if this is an XML markup emitter.
Definition: prettyprint.hh:777
virtual void setMaxLineSize(int4 val)
Provide a maximum line size to the pretty printer.
Definition: prettyprint.cc:1221
@ docu_e
End of a document.
Definition: prettyprint.hh:300
circularqueue(int4 sz)
Construct queue of a given size.
Definition: prettyprint.hh:634
virtual void endFuncProto(int4 id)
End a function prototype declaration.
Definition: prettyprint.cc:146
virtual void closeGroup(int4 id)
End a group of things that are printed together.
Definition: prettyprint.hh:138
int4 startComment(void)
Create a "start a comment block" command.
Definition: prettyprint.hh:565
tag_type
The exhaustive list of possible token types.
Definition: prettyprint.hh:298
virtual void endFuncProto(int4 id)
End a function prototype declaration.
Definition: prettyprint.hh:242
void setMax(int4 sz)
Establish a new maximum queue size.
Definition: prettyprint.hh:653
virtual void stopIndent(int4 id)
End an indent level.
Definition: prettyprint.cc:1179
virtual void endStatement(int4 id)
End a source code statement.
Definition: prettyprint.cc:133
virtual int4 startComment(void)
Start a comment block within the emitted source code.
Definition: prettyprint.cc:1127
void endStatement(int4 id)
Create an "end source code statement" command.
Definition: prettyprint.hh:426
virtual int4 openParen(char o, int4 id=0)
Emit an open parenthesis.
Definition: prettyprint.hh:262
Container for data structures associated with a single function.
Definition: funcdata.hh:45
The base datatype class for the decompiler.
Definition: type.hh:62
virtual void tagFuncName(const char *ptr, syntax_highlight hl, const Funcdata *fd, const PcodeOp *op)
Emit a function identifier.
Definition: prettyprint.cc:197
int4 indentincrement
Change in indentlevel per level of nesting.
Definition: prettyprint.hh:82
int4 getParenLevel(void) const
Get the current parentheses depth.
Definition: prettyprint.hh:206
void endFuncProto(int4 id)
Create an "end function prototype declaration" command.
Definition: prettyprint.hh:438
@ line_t
Required line break with one-time indent level.
Definition: prettyprint.hh:327
const Funcdata * fd
Associated Function.
Definition: prettyprint.hh:339
int4 beginBlock(const FlowBlock *b)
Create a "begin control-flow element" command.
Definition: prettyprint.hh:381
@ rtyp_b
Start of a return type declaration.
Definition: prettyprint.hh:305
@ keyword_color
Keyword in the high-level language.
Definition: prettyprint.hh:89
virtual int4 beginFunction(const Funcdata *fd)
Begin a whole declaration and body of a function.
Definition: prettyprint.cc:44
@ type_t
A data-type identifier.
Definition: prettyprint.hh:316
virtual int4 beginFuncProto(void)
Begin a function prototype declaration.
Definition: prettyprint.hh:241
@ spac_t
White space.
Definition: prettyprint.hh:325
void tagLabel(const char *ptr, EmitXml::syntax_highlight h, const AddrSpace *s, uintb o)
Create a code label identifier token.
Definition: prettyprint.hh:507
@ rtyp_e
End of a return type declaration.
Definition: prettyprint.hh:306
printclass
An enumeration denoting the general class of a token.
Definition: prettyprint.hh:285
@ fnam_t
A function identifier.
Definition: prettyprint.hh:315
ostream * s
Stream being emitted to.
Definition: prettyprint.hh:79
virtual void tagVariable(const char *ptr, syntax_highlight hl, const Varnode *vn, const PcodeOp *op)
Emit a variable token.
Definition: prettyprint.cc:157
virtual void closeParen(char c, int4 id)
Emit a close parenthesis.
Definition: prettyprint.cc:1098
virtual void tagOp(const char *ptr, syntax_highlight hl, const PcodeOp *op)
Emit an operation token.
Definition: prettyprint.hh:246
void tagFuncName(const char *ptr, EmitXml::syntax_highlight h, const Funcdata *f, const PcodeOp *o)
Create a function identifier token.
Definition: prettyprint.hh:467
virtual int4 beginStatement(const PcodeOp *op)
Begin a source code statement.
Definition: prettyprint.cc:977
virtual int4 beginDocument(void)
Begin a whole document of output.
Definition: prettyprint.cc:31
virtual void tagFuncName(const char *ptr, syntax_highlight hl, const Funcdata *fd, const PcodeOp *op)
Emit a function identifier.
Definition: prettyprint.cc:1033
virtual int4 beginFunction(const Funcdata *fd)
Begin a whole declaration and body of a function.
Definition: prettyprint.cc:881
Base class (and interface) for pretty printing and XML markup of tokens.
Definition: prettyprint.hh:76
virtual void spaces(int4 num, int4 bump=0)
Emit a sequence of space characters as part of source code.
Definition: prettyprint.cc:333
virtual void endReturnType(int4 id)
End a return type declaration.
Definition: prettyprint.cc:100
A token/command object in the pretty printing stream.
Definition: prettyprint.hh:282
virtual void endBlock(int4 id)
End a control-flow element.
Definition: prettyprint.cc:68
Classes for describing and printing data-types.
@ prot_e
End of a function prototype.
Definition: prettyprint.hh:312
@ no_color
Un-highlighted.
Definition: prettyprint.hh:97
virtual int4 beginVarDecl(const Symbol *sym)
Begin a variable declaration.
Definition: prettyprint.cc:107
virtual void tagLine(void)
Force a line break.
Definition: prettyprint.cc:921
void tagOp(const char *ptr, EmitXml::syntax_highlight h, const PcodeOp *o)
Create an operator token.
Definition: prettyprint.hh:457
@ begin_indent
Start of a new nesting level.
Definition: prettyprint.hh:290
virtual void endDocument(int4 id)
End a whole document of output.
Definition: prettyprint.cc:38
virtual void print(const char *str, syntax_highlight hl=no_color)
Emit other (more unusual) syntax as part of source code generation.
Definition: prettyprint.cc:291
~circularqueue(void)
Destructor.
Definition: prettyprint.hh:644
@ type_color
Data-type identifiers.
Definition: prettyprint.hh:91
void print(const char *str, EmitXml::syntax_highlight h)
Create a token for other (more unusual) syntax in source code.
Definition: prettyprint.hh:516
virtual void flush(void)
Flush any remaining character data.
Definition: prettyprint.cc:1187
virtual int4 beginReturnType(const Varnode *vn)
Begin a return type declaration.
Definition: prettyprint.cc:89
virtual void closeParen(char c, int4 id)
Emit a close parenthesis.
Definition: prettyprint.cc:319
@ func_b
Start of a function body.
Definition: prettyprint.hh:301
virtual void flush(void)
Flush any remaining character data.
Definition: prettyprint.hh:174
@ oinv_t
Start of an arbitrary (invisible) grouping.
Definition: prettyprint.hh:323
A generic source code pretty printer.
Definition: prettyprint.hh:706
@ vard_e
End of a variable declaration.
Definition: prettyprint.hh:308
const Symbol * symbol
Associated Symbol being displayed.
Definition: prettyprint.hh:342
virtual int4 beginFuncProto(void)
Begin a function prototype declaration.
Definition: prettyprint.cc:139
virtual int4 beginBlock(const FlowBlock *bl)
Begin a control-flow element.
Definition: prettyprint.hh:231
const AddrSpace * spc
Associated Address.
Definition: prettyprint.hh:341
virtual void tagLine(void)
Force a line break.
Definition: prettyprint.cc:73
int4 beginFuncProto(void)
Create a "begin function prototype declaration" command.
Definition: prettyprint.hh:432
@ comment_color
Comments.
Definition: prettyprint.hh:90
void stopComment(int4 id)
Create an "end a comment block" command.
Definition: prettyprint.hh:571
virtual void tagLine(int4 indent)
Force a line break and indent level.
Definition: prettyprint.hh:233
virtual void tagOp(const char *ptr, syntax_highlight hl, const PcodeOp *op)
Emit an operation token.
Definition: prettyprint.cc:177
void endBlock(int4 id)
Create an "end control-flow element" command.
Definition: prettyprint.hh:387
int4 beginStatement(const PcodeOp *o)
Create a "begin source code statement" command.
Definition: prettyprint.hh:420
const Varnode * vn
Associated Varnode.
Definition: prettyprint.hh:337
void closeGroup(int4 id)
Create an "end a printing group" command.
Definition: prettyprint.hh:545
virtual int4 openGroup(void)
Start a group of things that are printed together.
Definition: prettyprint.cc:1108
virtual void endDocument(int4 id)
End a whole document of output.
Definition: prettyprint.hh:228
int4 getIndentIncrement(void) const
Get the number of characters indented per level of nesting.
Definition: prettyprint.hh:211
virtual void endStatement(int4 id)
End a source code statement.
Definition: prettyprint.hh:240
virtual void endFunction(int4 id)
End a whole declaration and body of a function.
Definition: prettyprint.cc:895
The base class for a symbol in a symbol table or scope.
Definition: database.hh:152
@ vard_b
Start of a variable declaration.
Definition: prettyprint.hh:307
@ var_color
Local variable identifiers.
Definition: prettyprint.hh:93
@ func_e
End of a function body.
Definition: prettyprint.hh:302
virtual void endStatement(int4 id)
End a source code statement.
Definition: prettyprint.cc:987
virtual int4 openGroup(void)
Start a group of things that are printed together.
Definition: prettyprint.hh:132
@ op_t
An operator.
Definition: prettyprint.hh:314
virtual int4 beginFunction(const Funcdata *fd)
Begin a whole declaration and body of a function.
Definition: prettyprint.hh:229
const Datatype * ct
Associated Data-type.
Definition: prettyprint.hh:340
@ cpar_t
Close parenthesis.
Definition: prettyprint.hh:322
int4 beginReturnType(const Varnode *v)
Create a "begin return type declaration" command.
Definition: prettyprint.hh:394
int4 beginFunction(const Funcdata *f)
Create a "begin function body" command.
Definition: prettyprint.hh:368
@ tokenbreak
White space (where line breaks can be inserted)
Definition: prettyprint.hh:289
@ prot_b
Start of a function prototype.
Definition: prettyprint.hh:311
virtual int4 beginReturnType(const Varnode *vn)
Begin a return type declaration.
Definition: prettyprint.cc:939
EmitPrettyPrint(void)
Construct with an initial maximum line size.
Definition: prettyprint.cc:545
virtual int4 beginBlock(const FlowBlock *bl)
Begin a control-flow element.
Definition: prettyprint.cc:60
virtual int4 startComment(void)
Start a comment block within the emitted source code.
Definition: prettyprint.hh:161
virtual int4 beginDocument(void)
Begin a whole document of output.
Definition: prettyprint.hh:227