C# Class Reko.Core.Output.CodeFormatter

Formats intermediate-level instructions or abstract syntax statements.
Inheritance: InstructionVisitor, IAbsynVisitor, IExpressionVisitor
显示文件 Open project: uxmal/reko Class Usage Examples

Public Methods

Method Description
CodeFormatter ( Reko.Core.Output.Formatter writer ) : Reko.Core.Absyn
VisitAddress ( Address addr ) : void
VisitApplication ( Application appl ) : void
VisitArrayAccess ( ArrayAccess acc ) : void
VisitAssignment ( AbsynAssignment a ) : void
VisitAssignment ( Assignment a ) : void
VisitBinaryExpression ( BinaryExpression binExp ) : void
VisitBranch ( Branch b ) : void
VisitBreak ( AbsynBreak brk ) : void
VisitCallInstruction ( CallInstruction ci ) : void
VisitCase ( AbsynCase c ) : void
VisitCast ( Cast cast ) : void
VisitConditionOf ( ConditionOf cond ) : void
VisitConstant ( Constant c ) : void
VisitContinue ( AbsynContinue cont ) : void
VisitDeclaration ( AbsynDeclaration decl ) : void
VisitDeclaration ( Declaration decl ) : void
VisitDefInstruction ( DefInstruction def ) : void
VisitDefault ( AbsynDefault d ) : void
VisitDepositBits ( DepositBits d ) : void
VisitDereference ( Dereference deref ) : void
VisitDoWhile ( AbsynDoWhile loop ) : void
VisitFieldAccess ( FieldAccess acc ) : void
VisitGoto ( AbsynGoto g ) : void
VisitGotoInstruction ( GotoInstruction g ) : void
VisitIdentifier ( Identifier id ) : void
VisitIf ( AbsynIf ifs ) : void
VisitLabel ( AbsynLabel lbl ) : void
VisitLineComment ( AbsynLineComment comment ) : void
VisitMemberPointerSelector ( MemberPointerSelector mps ) : void
VisitMemoryAccess ( MemoryAccess access ) : void
VisitMkSequence ( MkSequence seq ) : void
VisitOutArgument ( OutArgument outArg ) : void
VisitPhiAssignment ( PhiAssignment phi ) : void
VisitPhiFunction ( PhiFunction phi ) : void
VisitPointerAddition ( PointerAddition pa ) : void
VisitProcedureConstant ( ProcedureConstant pc ) : void
VisitReturn ( AbsynReturn ret ) : void
VisitReturnInstruction ( ReturnInstruction ret ) : void
VisitScopeResolution ( ScopeResolution scope ) : void
VisitSegmentedAccess ( SegmentedAccess access ) : void
VisitSideEffect ( AbsynSideEffect side ) : void
VisitSideEffect ( SideEffect side ) : void
VisitSlice ( Slice slice ) : void
VisitStore ( Store store ) : void
VisitSwitch ( AbsynSwitch s ) : void
VisitSwitchInstruction ( SwitchInstruction si ) : void
VisitTestCondition ( TestCondition tc ) : void
VisitUnaryExpression ( UnaryExpression unary ) : void
VisitUseInstruction ( UseInstruction u ) : void
VisitWhile ( AbsynWhile loop ) : void
Write ( Procedure proc ) : void
WriteExpression ( Expression expr ) : void

Writes an expression in a context where it needs no parentheses.

WriteFormalArgument ( Identifier arg, bool writeStorage, TypeFormatter t ) : void
WriteFormalArgumentType ( Identifier arg, bool writeStorage ) : void
WriteIndentedStatement ( AbsynStatement stm ) : void
WriteIndentedStatements ( List stms, bool suppressNewline ) : void
WriteNull ( ) : void
WriteStatementList ( List list ) : void

Protected Methods

Method Description
UnsignedFormatString ( PrimitiveType type, ulong value ) : string

Private Methods

Method Description
CodeFormatter ( ) : Reko.Core.Absyn
FormatString ( PrimitiveType type, object value ) : string
HasSmallBody ( List stms ) : bool
IsIrregularStatement ( AbsynStatement stm ) : bool
IsSingleIfStatement ( List stms, Reko.Core.Absyn.AbsynIf &elseIf ) : bool
ResetPresedence ( int precedenceOld ) : void
SetPrecedence ( int precedence ) : int
WriteActuals ( Expression arguments ) : void
WriteIf ( AbsynIf ifs ) : void

Method Details

CodeFormatter() public method

public CodeFormatter ( Reko.Core.Output.Formatter writer ) : Reko.Core.Absyn
writer Reko.Core.Output.Formatter
return Reko.Core.Absyn

UnsignedFormatString() protected method

protected UnsignedFormatString ( PrimitiveType type, ulong value ) : string
type PrimitiveType
value ulong
return string

VisitAddress() public method

public VisitAddress ( Address addr ) : void
addr Address
return void

VisitApplication() public method

public VisitApplication ( Application appl ) : void
appl Application
return void

VisitArrayAccess() public method

public VisitArrayAccess ( ArrayAccess acc ) : void
acc ArrayAccess
return void

VisitAssignment() public method

public VisitAssignment ( AbsynAssignment a ) : void
a AbsynAssignment
return void

VisitAssignment() public method

public VisitAssignment ( Assignment a ) : void
a Assignment
return void

VisitBinaryExpression() public method

public VisitBinaryExpression ( BinaryExpression binExp ) : void
binExp BinaryExpression
return void

VisitBranch() public method

public VisitBranch ( Branch b ) : void
b Branch
return void

VisitBreak() public method

public VisitBreak ( AbsynBreak brk ) : void
brk AbsynBreak
return void

VisitCallInstruction() public method

public VisitCallInstruction ( CallInstruction ci ) : void
ci CallInstruction
return void

VisitCase() public method

public VisitCase ( AbsynCase c ) : void
c AbsynCase
return void

VisitCast() public method

public VisitCast ( Cast cast ) : void
cast Cast
return void

VisitConditionOf() public method

public VisitConditionOf ( ConditionOf cond ) : void
cond ConditionOf
return void

VisitConstant() public method

public VisitConstant ( Constant c ) : void
c Constant
return void

VisitContinue() public method

public VisitContinue ( AbsynContinue cont ) : void
cont AbsynContinue
return void

VisitDeclaration() public method

public VisitDeclaration ( AbsynDeclaration decl ) : void
decl AbsynDeclaration
return void

VisitDeclaration() public method

public VisitDeclaration ( Declaration decl ) : void
decl Declaration
return void

VisitDefInstruction() public method

public VisitDefInstruction ( DefInstruction def ) : void
def DefInstruction
return void

VisitDefault() public method

public VisitDefault ( AbsynDefault d ) : void
d AbsynDefault
return void

VisitDepositBits() public method

public VisitDepositBits ( DepositBits d ) : void
d DepositBits
return void

VisitDereference() public method

public VisitDereference ( Dereference deref ) : void
deref Dereference
return void

VisitDoWhile() public method

public VisitDoWhile ( AbsynDoWhile loop ) : void
loop AbsynDoWhile
return void

VisitFieldAccess() public method

public VisitFieldAccess ( FieldAccess acc ) : void
acc FieldAccess
return void

VisitGoto() public method

public VisitGoto ( AbsynGoto g ) : void
g AbsynGoto
return void

VisitGotoInstruction() public method

public VisitGotoInstruction ( GotoInstruction g ) : void
g GotoInstruction
return void

VisitIdentifier() public method

public VisitIdentifier ( Identifier id ) : void
id Identifier
return void

VisitIf() public method

public VisitIf ( AbsynIf ifs ) : void
ifs AbsynIf
return void

VisitLabel() public method

public VisitLabel ( AbsynLabel lbl ) : void
lbl AbsynLabel
return void

VisitLineComment() public method

public VisitLineComment ( AbsynLineComment comment ) : void
comment AbsynLineComment
return void

VisitMemberPointerSelector() public method

public VisitMemberPointerSelector ( MemberPointerSelector mps ) : void
mps MemberPointerSelector
return void

VisitMemoryAccess() public method

public VisitMemoryAccess ( MemoryAccess access ) : void
access MemoryAccess
return void

VisitMkSequence() public method

public VisitMkSequence ( MkSequence seq ) : void
seq MkSequence
return void

VisitOutArgument() public method

public VisitOutArgument ( OutArgument outArg ) : void
outArg OutArgument
return void

VisitPhiAssignment() public method

public VisitPhiAssignment ( PhiAssignment phi ) : void
phi PhiAssignment
return void

VisitPhiFunction() public method

public VisitPhiFunction ( PhiFunction phi ) : void
phi PhiFunction
return void

VisitPointerAddition() public method

public VisitPointerAddition ( PointerAddition pa ) : void
pa PointerAddition
return void

VisitProcedureConstant() public method

public VisitProcedureConstant ( ProcedureConstant pc ) : void
pc ProcedureConstant
return void

VisitReturn() public method

public VisitReturn ( AbsynReturn ret ) : void
ret AbsynReturn
return void

VisitReturnInstruction() public method

public VisitReturnInstruction ( ReturnInstruction ret ) : void
ret ReturnInstruction
return void

VisitScopeResolution() public method

public VisitScopeResolution ( ScopeResolution scope ) : void
scope ScopeResolution
return void

VisitSegmentedAccess() public method

public VisitSegmentedAccess ( SegmentedAccess access ) : void
access SegmentedAccess
return void

VisitSideEffect() public method

public VisitSideEffect ( AbsynSideEffect side ) : void
side AbsynSideEffect
return void

VisitSideEffect() public method

public VisitSideEffect ( SideEffect side ) : void
side SideEffect
return void

VisitSlice() public method

public VisitSlice ( Slice slice ) : void
slice Slice
return void

VisitStore() public method

public VisitStore ( Store store ) : void
store Store
return void

VisitSwitch() public method

public VisitSwitch ( AbsynSwitch s ) : void
s AbsynSwitch
return void

VisitSwitchInstruction() public method

public VisitSwitchInstruction ( SwitchInstruction si ) : void
si SwitchInstruction
return void

VisitTestCondition() public method

public VisitTestCondition ( TestCondition tc ) : void
tc TestCondition
return void

VisitUnaryExpression() public method

public VisitUnaryExpression ( UnaryExpression unary ) : void
unary UnaryExpression
return void

VisitUseInstruction() public method

public VisitUseInstruction ( UseInstruction u ) : void
u UseInstruction
return void

VisitWhile() public method

public VisitWhile ( AbsynWhile loop ) : void
loop AbsynWhile
return void

Write() public method

public Write ( Procedure proc ) : void
proc Procedure
return void

WriteExpression() public method

Writes an expression in a context where it needs no parentheses.
public WriteExpression ( Expression expr ) : void
expr Expression
return void

WriteFormalArgument() public method

public WriteFormalArgument ( Identifier arg, bool writeStorage, TypeFormatter t ) : void
arg Identifier
writeStorage bool
t TypeFormatter
return void

WriteFormalArgumentType() public method

public WriteFormalArgumentType ( Identifier arg, bool writeStorage ) : void
arg Identifier
writeStorage bool
return void

WriteIndentedStatement() public method

public WriteIndentedStatement ( AbsynStatement stm ) : void
stm AbsynStatement
return void

WriteIndentedStatements() public method

public WriteIndentedStatements ( List stms, bool suppressNewline ) : void
stms List
suppressNewline bool
return void

WriteNull() public method

public WriteNull ( ) : void
return void

WriteStatementList() public method

public WriteStatementList ( List list ) : void
list List
return void