C# Класс Pchp.CodeAnalysis.FlowAnalysis.AnalysisVisitor

Наследование: Pchp.CodeAnalysis.Semantics.Graph.GraphVisitor
Показать файл Открыть проект

Private Properties

Свойство Тип Описание
AnalysisVisitor Pchp.CodeAnalysis.Semantics.Graph
AssertState void
TraverseToBlock void
VisitCondition void

Открытые методы

Метод Описание
VisitBinaryExpression ( BoundBinaryEx x ) : void
VisitCFG ( ControlFlowGraph x ) : void
VisitCFGBlock ( BoundBlock x ) : void
VisitCFGCaseBlock ( CaseBlock x ) : void
VisitCFGCatchBlock ( CatchBlock x ) : void
VisitCFGConditionalEdge ( ConditionalEdge x ) : void
VisitCFGExitBlock ( ExitBlock x ) : void
VisitCFGForeachEnumereeEdge ( ForeachEnumereeEdge x ) : void
VisitCFGForeachMoveNextEdge ( ForeachMoveNextEdge x ) : void
VisitCFGSimpleEdge ( SimpleEdge x ) : void
VisitCFGSwitchEdge ( SwitchEdge x ) : void
VisitCFGTryCatchEdge ( TryCatchEdge x ) : void
VisitInstanceOf ( BoundInstanceOfEx x ) : void
VisitUnaryExpression ( BoundUnaryEx x ) : void

Защищенные методы

Метод Описание
HandleTraversableUse ( BoundExpression varuse ) : TypeRefMask

Handles use of variable as foreach iterator value.

SetVar ( string name, TypeRefMask typemask ) : TypeRefMask

Sets type of local variable in current state.

Visit ( BoundBinaryEx x, ConditionBranch branch ) : void
Visit ( BoundInstanceOfEx x, ConditionBranch branch ) : void
Visit ( BoundUnaryEx x, ConditionBranch branch ) : void
VisitCFGBlockInit ( BoundBlock x ) : void

Called to initialize VisitCFGBlock call. Sets _state to known initial block state.

Приватные методы

Метод Описание
AnalysisVisitor ( Worklist worklist ) : Pchp.CodeAnalysis.Semantics.Graph

Creates an instance of AnalysisVisitor that can analyse a block.

AssertState ( ) : void

Debug assert the state is initialized therefore we are in the middle on a block analysis.

TraverseToBlock ( FlowState state, BoundBlock target ) : void

Helper method that merges state with the target block and determines whether to continue by visiting the target block.

Only for traversing into blocks within the same routine (same type context).

VisitCondition ( BoundExpression condition, ConditionBranch branch ) : void

Visits condition used to branch execution to true or false branch.

Because of minimal evaluation there is different FlowState for true and false branches, AND and OR operators have to take this into account. Also some other constructs may have side-effect for known branch, eg. ($x instanceof X) implies ($x is X) in True branch.

Описание методов

HandleTraversableUse() защищенный Метод

Handles use of variable as foreach iterator value.
protected HandleTraversableUse ( BoundExpression varuse ) : TypeRefMask
varuse Pchp.CodeAnalysis.Semantics.BoundExpression
Результат TypeRefMask

SetVar() защищенный Метод

Sets type of local variable in current state.
protected SetVar ( string name, TypeRefMask typemask ) : TypeRefMask
name string
typemask TypeRefMask
Результат TypeRefMask

Visit() защищенный Метод

protected Visit ( BoundBinaryEx x, ConditionBranch branch ) : void
x Pchp.CodeAnalysis.Semantics.BoundBinaryEx
branch ConditionBranch
Результат void

Visit() защищенный Метод

protected Visit ( BoundInstanceOfEx x, ConditionBranch branch ) : void
x Pchp.CodeAnalysis.Semantics.BoundInstanceOfEx
branch ConditionBranch
Результат void

Visit() защищенный Метод

protected Visit ( BoundUnaryEx x, ConditionBranch branch ) : void
x Pchp.CodeAnalysis.Semantics.BoundUnaryEx
branch ConditionBranch
Результат void

VisitBinaryExpression() публичный закрытый Метод

public final VisitBinaryExpression ( BoundBinaryEx x ) : void
x Pchp.CodeAnalysis.Semantics.BoundBinaryEx
Результат void

VisitCFG() публичный Метод

public VisitCFG ( ControlFlowGraph x ) : void
x Pchp.CodeAnalysis.Semantics.Graph.ControlFlowGraph
Результат void

VisitCFGBlock() публичный Метод

public VisitCFGBlock ( BoundBlock x ) : void
x Pchp.CodeAnalysis.Semantics.Graph.BoundBlock
Результат void

VisitCFGBlockInit() защищенный Метод

Called to initialize VisitCFGBlock call. Sets _state to known initial block state.
protected VisitCFGBlockInit ( BoundBlock x ) : void
x Pchp.CodeAnalysis.Semantics.Graph.BoundBlock
Результат void

VisitCFGCaseBlock() публичный Метод

public VisitCFGCaseBlock ( CaseBlock x ) : void
x CaseBlock
Результат void

VisitCFGCatchBlock() публичный Метод

public VisitCFGCatchBlock ( CatchBlock x ) : void
x CatchBlock
Результат void

VisitCFGConditionalEdge() публичный Метод

public VisitCFGConditionalEdge ( ConditionalEdge x ) : void
x Pchp.CodeAnalysis.Semantics.Graph.ConditionalEdge
Результат void

VisitCFGExitBlock() публичный Метод

public VisitCFGExitBlock ( ExitBlock x ) : void
x Pchp.CodeAnalysis.Semantics.Graph.ExitBlock
Результат void

VisitCFGForeachEnumereeEdge() публичный Метод

public VisitCFGForeachEnumereeEdge ( ForeachEnumereeEdge x ) : void
x Pchp.CodeAnalysis.Semantics.Graph.ForeachEnumereeEdge
Результат void

VisitCFGForeachMoveNextEdge() публичный Метод

public VisitCFGForeachMoveNextEdge ( ForeachMoveNextEdge x ) : void
x Pchp.CodeAnalysis.Semantics.Graph.ForeachMoveNextEdge
Результат void

VisitCFGSimpleEdge() публичный Метод

public VisitCFGSimpleEdge ( SimpleEdge x ) : void
x Pchp.CodeAnalysis.Semantics.Graph.SimpleEdge
Результат void

VisitCFGSwitchEdge() публичный Метод

public VisitCFGSwitchEdge ( SwitchEdge x ) : void
x Pchp.CodeAnalysis.Semantics.Graph.SwitchEdge
Результат void

VisitCFGTryCatchEdge() публичный Метод

public VisitCFGTryCatchEdge ( TryCatchEdge x ) : void
x Pchp.CodeAnalysis.Semantics.Graph.TryCatchEdge
Результат void

VisitInstanceOf() публичный закрытый Метод

public final VisitInstanceOf ( BoundInstanceOfEx x ) : void
x Pchp.CodeAnalysis.Semantics.BoundInstanceOfEx
Результат void

VisitUnaryExpression() публичный закрытый Метод

public final VisitUnaryExpression ( BoundUnaryEx x ) : void
x Pchp.CodeAnalysis.Semantics.BoundUnaryEx
Результат void