C# Class Pchp.CodeAnalysis.FlowAnalysis.ExpressionAnalysis

Visits single expressions and project transformations to flow state.
Inheritance: AnalysisVisitor
Datei anzeigen Open project: iolevel/peachpie

Public Methods

Method Description
ExpressionAnalysis ( Worklist worklist, ISemanticModel model ) : Devsense.PHP.Syntax
VisitArgument ( BoundArgument x ) : void
VisitArray ( BoundArrayEx x ) : void
VisitArrayItem ( BoundArrayItemEx x ) : void
VisitAssign ( BoundAssignEx x ) : void
VisitCompoundAssign ( BoundCompoundAssignEx x ) : void
VisitConcat ( BoundConcatEx x ) : void
VisitConditional ( BoundConditionalEx x ) : void
VisitEcho ( BoundEcho x ) : void
VisitExit ( BoundExitEx x ) : void
VisitExpressionStatement ( BoundExpressionStatement x ) : void
VisitFieldRef ( BoundFieldRef x ) : void
VisitGlobalConstUse ( BoundGlobalConst x ) : void
VisitGlobalFunctionCall ( BoundGlobalFunctionCall x ) : void
VisitGlobalStatement ( BoundGlobalVariableStatement x ) : void
VisitIncDec ( BoundIncDecEx x ) : void
VisitInclude ( BoundIncludeEx x ) : void
VisitInstanceFunctionCall ( BoundInstanceFunctionCall x ) : void
VisitIsEmpty ( BoundIsEmptyEx x ) : void
VisitIsSet ( BoundIsSetEx x ) : void
VisitList ( BoundListEx x ) : void
VisitLiteral ( BoundLiteral x ) : void
VisitNew ( BoundNewEx x ) : void
VisitPseudoConstUse ( BoundPseudoConst x ) : void
VisitReturn ( BoundReturnStatement x ) : void
VisitStaticFunctionCall ( BoundStaticFunctionCall x ) : void
VisitStaticStatement ( BoundStaticVariableStatement x ) : void
VisitThrow ( BoundThrowStatement x ) : void
VisitTypeRef ( BoundTypeRef tref ) : void
VisitUnset ( BoundUnset x ) : void
VisitVariableRef ( BoundVariableRef x ) : void

Protected Methods

Method Description
Visit ( BoundBinaryEx x, ConditionBranch branch ) : void
Visit ( BoundInstanceOfEx x, ConditionBranch branch ) : void
Visit ( BoundUnaryEx x, ConditionBranch branch ) : void
VisitRoutineCall ( BoundRoutineCall x ) : void

Private Methods

Method Description
AsVariableName ( BoundReferenceExpression r ) : string

In case of a local variable or parameter, gets its name.

BindConstantValue ( BoundExpression target, FieldSymbol symbol ) : bool
CompoundOpToBinaryOp ( Operations op ) : Operations
GetBitOperationType ( TypeRefMask lValType, TypeRefMask rValType ) : TypeRefMask

Gets resulting type of bit operation (bit or, and, xor).

GetPlusOperationType ( BoundExpression left, BoundExpression right ) : TypeRefMask

Gets resulting type of + operation.

IsArrayOnly ( TypeRefMask tmask ) : bool

Gets value indicating the given type represents only array types.

IsClassOnly ( TypeRefMask tmask ) : bool

Gets value indicating the given type represents only class types.

IsDoubleOnly ( BoundExpression x ) : bool

Gets value indicating the given type represents a double and nothing else.

IsDoubleOnly ( TypeRefMask tmask ) : bool

Gets value indicating the given type represents a double and nothing else.

IsLTInt64Max ( BoundReferenceExpression r ) : bool

Determines if given expression represents a variable which value is less than Int64.Max in current state.

IsLongConstant ( BoundExpression expr, long value ) : bool
IsLongOnly ( BoundExpression x ) : bool

Gets value indicating the given type represents a long and nothing else.

IsLongOnly ( TypeRefMask tmask ) : bool

Gets value indicating the given type represents a long and nothing else.

IsNumberOnly ( BoundExpression x ) : bool

Gets value indicating the given type is long or double or both but nothing else.

IsNumberOnly ( TypeRefMask tmask ) : bool

Gets value indicating the given type is long or double or both but nothing else.

LTInt64Max ( BoundReferenceExpression r, bool lt ) : void

In case of a local variable or parameter, sets associated flag determining its value is less than Int64.Max.

ResolveBinaryEx ( BoundBinaryEx x, ConditionBranch branch ) : TypeRefMask
ResolveBitOperation ( object xobj, object yobj, Operations op ) : object

Resolves value of bit operation.

TODO: move to **evaluation**.

ResolveType ( INamedTypeRef dtype ) : TypeSymbol
ResolveUnaryOperatorExpression ( BoundUnaryEx x, ConditionBranch branch ) : TypeRefMask
Visit ( BoundExpression x, BoundAccess access ) : void

Updates the expression access and visits it.

VisitRoutineCallEpilogue ( BoundRoutineCall x ) : void
VisitShortCircuitOp ( BoundExpression lExpr, BoundExpression rExpr, bool isAndOp, ConditionBranch branch ) : void

Method Details

ExpressionAnalysis() public method

public ExpressionAnalysis ( Worklist worklist, ISemanticModel model ) : Devsense.PHP.Syntax
worklist Worklist
model ISemanticModel
return Devsense.PHP.Syntax

Visit() protected method

protected Visit ( BoundBinaryEx x, ConditionBranch branch ) : void
x Pchp.CodeAnalysis.Semantics.BoundBinaryEx
branch ConditionBranch
return void

Visit() protected method

protected Visit ( BoundInstanceOfEx x, ConditionBranch branch ) : void
x Pchp.CodeAnalysis.Semantics.BoundInstanceOfEx
branch ConditionBranch
return void

Visit() protected method

protected Visit ( BoundUnaryEx x, ConditionBranch branch ) : void
x Pchp.CodeAnalysis.Semantics.BoundUnaryEx
branch ConditionBranch
return void

VisitArgument() public method

public VisitArgument ( BoundArgument x ) : void
x BoundArgument
return void

VisitArray() public method

public VisitArray ( BoundArrayEx x ) : void
x Pchp.CodeAnalysis.Semantics.BoundArrayEx
return void

VisitArrayItem() public method

public VisitArrayItem ( BoundArrayItemEx x ) : void
x Pchp.CodeAnalysis.Semantics.BoundArrayItemEx
return void

VisitAssign() public method

public VisitAssign ( BoundAssignEx x ) : void
x Pchp.CodeAnalysis.Semantics.BoundAssignEx
return void

VisitCompoundAssign() public method

public VisitCompoundAssign ( BoundCompoundAssignEx x ) : void
x Pchp.CodeAnalysis.Semantics.BoundCompoundAssignEx
return void

VisitConcat() public method

public VisitConcat ( BoundConcatEx x ) : void
x Pchp.CodeAnalysis.Semantics.BoundConcatEx
return void

VisitConditional() public method

public VisitConditional ( BoundConditionalEx x ) : void
x Pchp.CodeAnalysis.Semantics.BoundConditionalEx
return void

VisitEcho() public method

public VisitEcho ( BoundEcho x ) : void
x Pchp.CodeAnalysis.Semantics.BoundEcho
return void

VisitExit() public method

public VisitExit ( BoundExitEx x ) : void
x Pchp.CodeAnalysis.Semantics.BoundExitEx
return void

VisitExpressionStatement() public method

public VisitExpressionStatement ( BoundExpressionStatement x ) : void
x Pchp.CodeAnalysis.Semantics.BoundExpressionStatement
return void

VisitFieldRef() public method

public VisitFieldRef ( BoundFieldRef x ) : void
x Pchp.CodeAnalysis.Semantics.BoundFieldRef
return void

VisitGlobalConstUse() public method

public VisitGlobalConstUse ( BoundGlobalConst x ) : void
x Pchp.CodeAnalysis.Semantics.BoundGlobalConst
return void

VisitGlobalFunctionCall() public method

public VisitGlobalFunctionCall ( BoundGlobalFunctionCall x ) : void
x Pchp.CodeAnalysis.Semantics.BoundGlobalFunctionCall
return void

VisitGlobalStatement() public method

public VisitGlobalStatement ( BoundGlobalVariableStatement x ) : void
x Pchp.CodeAnalysis.Semantics.BoundGlobalVariableStatement
return void

VisitIncDec() public method

public VisitIncDec ( BoundIncDecEx x ) : void
x Pchp.CodeAnalysis.Semantics.BoundIncDecEx
return void

VisitInclude() public method

public VisitInclude ( BoundIncludeEx x ) : void
x Pchp.CodeAnalysis.Semantics.BoundIncludeEx
return void

VisitInstanceFunctionCall() public method

public VisitInstanceFunctionCall ( BoundInstanceFunctionCall x ) : void
x Pchp.CodeAnalysis.Semantics.BoundInstanceFunctionCall
return void

VisitIsEmpty() public method

public VisitIsEmpty ( BoundIsEmptyEx x ) : void
x Pchp.CodeAnalysis.Semantics.BoundIsEmptyEx
return void

VisitIsSet() public method

public VisitIsSet ( BoundIsSetEx x ) : void
x Pchp.CodeAnalysis.Semantics.BoundIsSetEx
return void

VisitList() public method

public VisitList ( BoundListEx x ) : void
x Pchp.CodeAnalysis.Semantics.BoundListEx
return void

VisitLiteral() public method

public VisitLiteral ( BoundLiteral x ) : void
x Pchp.CodeAnalysis.Semantics.BoundLiteral
return void

VisitNew() public method

public VisitNew ( BoundNewEx x ) : void
x Pchp.CodeAnalysis.Semantics.BoundNewEx
return void

VisitPseudoConstUse() public method

public VisitPseudoConstUse ( BoundPseudoConst x ) : void
x Pchp.CodeAnalysis.Semantics.BoundPseudoConst
return void

VisitReturn() public method

public VisitReturn ( BoundReturnStatement x ) : void
x Pchp.CodeAnalysis.Semantics.BoundReturnStatement
return void

VisitRoutineCall() protected method

protected VisitRoutineCall ( BoundRoutineCall x ) : void
x Pchp.CodeAnalysis.Semantics.BoundRoutineCall
return void

VisitStaticFunctionCall() public method

public VisitStaticFunctionCall ( BoundStaticFunctionCall x ) : void
x Pchp.CodeAnalysis.Semantics.BoundStaticFunctionCall
return void

VisitStaticStatement() public method

public VisitStaticStatement ( BoundStaticVariableStatement x ) : void
x Pchp.CodeAnalysis.Semantics.BoundStaticVariableStatement
return void

VisitThrow() public method

public VisitThrow ( BoundThrowStatement x ) : void
x Pchp.CodeAnalysis.Semantics.BoundThrowStatement
return void

VisitTypeRef() public method

public VisitTypeRef ( BoundTypeRef tref ) : void
tref Pchp.CodeAnalysis.Semantics.BoundTypeRef
return void

VisitUnset() public method

public VisitUnset ( BoundUnset x ) : void
x Pchp.CodeAnalysis.Semantics.BoundUnset
return void

VisitVariableRef() public method

public VisitVariableRef ( BoundVariableRef x ) : void
x Pchp.CodeAnalysis.Semantics.BoundVariableRef
return void