C# Class DataDictionary.Interpreter.BinaryExpression

Inheritance: Expression
Exibir arquivo Open project: ERTMSSolutions/ERTMSFormalSpecs Class Usage Examples

Public Properties

Property Type Description
Operators Operator[]
OperatorsByLevel Operator[][]
OperatorsImages string[]
OperatorsLevel0 Operator[]
OperatorsLevel1 Operator[]
OperatorsLevel2 Operator[]
OperatorsLevel3 Operator[]
OperatorsLevel4 Operator[]
OperatorsLevel5 Operator[]

Public Methods

Method Description
BinaryExpression ( ModelElement root, ModelElement log, Expression left, Operator op, Expression right, DataDictionary.Interpreter.ParsingData parsingData ) : System

Constructor

CheckExpression ( ) : void

Checks the expression and appends errors to the root tree node when inconsistencies are found

CreateGraph ( DataDictionary.Interpreter.InterpretationContext context, Parameter parameter, ExplanationPart explain ) : Graph

Creates the graph associated to this expression, when the given parameter ranges over the X axis

CreateSurface ( DataDictionary.Interpreter.InterpretationContext context, Parameter xParam, Parameter yParam, ExplanationPart explain ) : Surface

Provides the surface of this function if it has been statically defined

Fill ( List retVal, DataDictionary.Interpreter.Filter.BaseFilter filter ) : void

Fills the list provided with the element matching the filter provided

FindOperatorByName ( string op ) : Operator

Provides the operator, based on its image

GetCalled ( DataDictionary.Interpreter.InterpretationContext context, ExplanationPart explain ) : ICallable

Provides the callable that is called by this expression

GetExplain ( TextualExplanation explanation, bool explainSubElements = true ) : void

Builds the explanation of the element

GetExpressionType ( ) : Type

Provides the type of this expression

GetStaticCallable ( ) : ICallable

Provides the ICallable which corresponds to this expression

Image ( Operator op ) : string

Provides the image of a given operator

Images ( Operator ops ) : string[]

Provides the image of a given operator

Inverse ( Operator Operator ) : Operator

Inverses the operator provided

IsSimpleEquality ( ) : bool

Indicates that the expression is an equality of the form variable == literal

SemanticAnalysis ( INamable instance, DataDictionary.Interpreter.Filter.BaseFilter expectation ) : bool

Performs the semantic analysis of the expression

Protected Methods

Method Description
GetValue ( DataDictionary.Interpreter.InterpretationContext context, ExplanationPart explain ) : IValue

Provides the value associated to this Expression

Private Methods

Method Description
CombineGraph ( IGraph leftGraph, IGraph rightGraph ) : IGraph

Combines two graphs using the operator of this binary expression

CombineSurface ( Surface leftSurface, Surface rightSurface ) : Surface

Combines two surfaces using the operator of this binary expression

CreateGraphResult ( DataDictionary.Interpreter.InterpretationContext context, DataDictionary.Functions.Function leftFunction, List unboundLeft, DataDictionary.Functions.Function rightFunction, List unboundRight, ExplanationPart explain ) : ICallable

Creates the result as a surface

CreateSurfaceForUnbound ( DataDictionary.Interpreter.InterpretationContext context, Expression expression, DataDictionary.Functions.Function function, List unbound, ExplanationPart explain ) : Surface

Creates the graph for the unbount parameters provided

CreateSurfaceResult ( DataDictionary.Interpreter.InterpretationContext context, DataDictionary.Functions.Function leftFunction, List unboundLeft, DataDictionary.Functions.Function rightFunction, List unboundRight, ExplanationPart explain ) : ICallable

Creates the result as a surface

createGraphForUnbound ( DataDictionary.Interpreter.InterpretationContext context, Expression expression, DataDictionary.Functions.Function function, List unbound, ExplanationPart explain ) : Graph

Creates the graph for the unbound parameters provided

getUnboundParameter ( DataDictionary.Interpreter.InterpretationContext context, DataDictionary.Functions.Function function ) : List

Gets the unbound parameters from the function definition and place holders

getUnboundParametersFromValue ( DataDictionary.Functions.Function leftFunction ) : List

Gets the unbound parameters from either the surface or the graph of the function

Method Details

BinaryExpression() public method

Constructor
public BinaryExpression ( ModelElement root, ModelElement log, Expression left, Operator op, Expression right, DataDictionary.Interpreter.ParsingData parsingData ) : System
root ModelElement
log ModelElement
left Expression
op Operator
right Expression
parsingData DataDictionary.Interpreter.ParsingData Additional information about the parsing process
return System

CheckExpression() public method

Checks the expression and appends errors to the root tree node when inconsistencies are found
public CheckExpression ( ) : void
return void

CreateGraph() public method

Creates the graph associated to this expression, when the given parameter ranges over the X axis
public CreateGraph ( DataDictionary.Interpreter.InterpretationContext context, Parameter parameter, ExplanationPart explain ) : Graph
context DataDictionary.Interpreter.InterpretationContext The interpretation context
parameter Parameter The parameters of *the enclosing function* for which the graph should be created
explain ExplanationPart
return Graph

CreateSurface() public method

Provides the surface of this function if it has been statically defined
public CreateSurface ( DataDictionary.Interpreter.InterpretationContext context, Parameter xParam, Parameter yParam, ExplanationPart explain ) : Surface
context DataDictionary.Interpreter.InterpretationContext the context used to create the surface
xParam Parameter The X axis of this surface
yParam Parameter The Y axis of this surface
explain ExplanationPart
return Surface

Fill() public method

Fills the list provided with the element matching the filter provided
public Fill ( List retVal, DataDictionary.Interpreter.Filter.BaseFilter filter ) : void
retVal List The list to be filled with the element matching the condition expressed in the filter
filter DataDictionary.Interpreter.Filter.BaseFilter The filter to apply
return void

FindOperatorByName() public static method

Provides the operator, based on its image
public static FindOperatorByName ( string op ) : Operator
op string
return Operator

GetCalled() public method

Provides the callable that is called by this expression
public GetCalled ( DataDictionary.Interpreter.InterpretationContext context, ExplanationPart explain ) : ICallable
context DataDictionary.Interpreter.InterpretationContext
explain ExplanationPart
return ICallable

GetExplain() public method

Builds the explanation of the element
public GetExplain ( TextualExplanation explanation, bool explainSubElements = true ) : void
explanation TextualExplanation
explainSubElements bool Precises if we need to explain the sub elements (if any)
return void

GetExpressionType() public method

Provides the type of this expression
public GetExpressionType ( ) : Type
return DataDictionary.Types.Type

GetStaticCallable() public method

Provides the ICallable which corresponds to this expression
public GetStaticCallable ( ) : ICallable
return ICallable

GetValue() protected method

Provides the value associated to this Expression
protected GetValue ( DataDictionary.Interpreter.InterpretationContext context, ExplanationPart explain ) : IValue
context DataDictionary.Interpreter.InterpretationContext The context on which the value must be found
explain ExplanationPart The explanation to fill, if any
return IValue

Image() public static method

Provides the image of a given operator
public static Image ( Operator op ) : string
op Operator
return string

Images() public static method

Provides the image of a given operator
public static Images ( Operator ops ) : string[]
ops Operator
return string[]

Inverse() public static method

Inverses the operator provided
public static Inverse ( Operator Operator ) : Operator
Operator Operator
return Operator

IsSimpleEquality() public method

Indicates that the expression is an equality of the form variable == literal
public IsSimpleEquality ( ) : bool
return bool

SemanticAnalysis() public method

Performs the semantic analysis of the expression
public SemanticAnalysis ( INamable instance, DataDictionary.Interpreter.Filter.BaseFilter expectation ) : bool
instance INamable the reference instance on which this element should analysed
expectation DataDictionary.Interpreter.Filter.BaseFilter Indicates the kind of element we are looking for
return bool

Property Details

Operators public_oe static_oe property

The available operators
public static Operator[] Operators
return Operator[]

OperatorsByLevel public_oe static_oe property

public static Operator[][] OperatorsByLevel
return Operator[][]

OperatorsImages public_oe static_oe property

The corresponding operator images
public static string[] OperatorsImages
return string[]

OperatorsLevel0 public_oe static_oe property

public static Operator[] OperatorsLevel0
return Operator[]

OperatorsLevel1 public_oe static_oe property

public static Operator[] OperatorsLevel1
return Operator[]

OperatorsLevel2 public_oe static_oe property

public static Operator[] OperatorsLevel2
return Operator[]

OperatorsLevel3 public_oe static_oe property

public static Operator[] OperatorsLevel3
return Operator[]

OperatorsLevel4 public_oe static_oe property

public static Operator[] OperatorsLevel4
return Operator[]

OperatorsLevel5 public_oe static_oe property

public static Operator[] OperatorsLevel5
return Operator[]