Basic class that represents an expression in an algorithm
상속: Algo.Runtime.Build.AlgorithmDOM.DOM.AlgorithmObject
 /// <summary>
 /// Initialize a new instance of <see cref="AlgorithmIterationStatement"/>
 /// </summary>
 /// <param name="initializationStatement">The statement that initialize the iteration</param>
 /// <param name="incrementStatement">The statement that define the incrementation</param>
 /// <param name="condition">The test expression of the iteration</param>
 /// <param name="conditionAfterBody">This value defines whether the test expression will be run before of after the execution of the iteration's body</param>
 /// <param name="statements">The statements in the iteration's body</param>
 public AlgorithmIterationStatement(AlgorithmStatement initializationStatement, AlgorithmStatement incrementStatement, AlgorithmExpression condition, bool conditionAfterBody = false, AlgorithmStatementCollection statements = null)
 {
     InitializationStatement = initializationStatement;
     IncrementStatement      = incrementStatement;
     Condition          = condition;
     ConditionAfterBody = conditionAfterBody;
     Statements         = statements ?? new AlgorithmStatementCollection();
 }
 /// <summary>
 /// Initialize a new instance of <see cref="AlgorithmBinaryOperatorExpression"/>
 /// </summary>
 /// <param name="leftExpression">The left expression</param>
 /// <param name="conditionalOperator">The binary operator</param>
 /// <param name="rightExpression">The right expression</param>
 public AlgorithmBinaryOperatorExpression(AlgorithmExpression leftExpression, AlgorithmBinaryOperatorType conditionalOperator, AlgorithmExpression rightExpression)
 {
     LeftExpression  = leftExpression;
     Operator        = conditionalOperator;
     RightExpression = rightExpression;
 }
 /// <summary>
 /// Initialize a new instance of <see cref="AlgorithmAssignStatement"/>
 /// </summary>
 /// <param name="leftExpression">The expression on the left of the assign symbol in the algorithm</param>
 /// <param name="rightExpression">The expression on the right of the assign symbol in the algorithm</param>
 public AlgorithmAssignStatement(AlgorithmExpression leftExpression, AlgorithmExpression rightExpression)
 {
     LeftExpression  = leftExpression;
     RightExpression = rightExpression;
 }
예제 #4
0
 /// <summary>
 /// Initialize a new instance of <see cref="AlgorithmExpressionStatement"/>
 /// </summary>
 /// <param name="expression">The single expression of the statement</param>
 public AlgorithmExpressionStatement(AlgorithmExpression expression)
 {
     Expression = expression;
 }
 /// <summary>
 /// Initialize a new instance of <see cref="AlgorithmConditionStatement"/>
 /// </summary>
 /// <param name="condition">The expression to evaluate true or false</param>
 /// <param name="trueStatement">The collection of statements to run when the condition is true</param>
 /// <param name="falseStatement">The collection of statements to run when the condition is false</param>
 public AlgorithmConditionStatement(AlgorithmExpression condition, AlgorithmStatementCollection trueStatement, AlgorithmStatementCollection falseStatement)
 {
     Condition       = condition;
     TrueStatements  = trueStatement ?? new AlgorithmStatementCollection();
     FalseStatements = falseStatement ?? new AlgorithmStatementCollection();
 }
예제 #6
0
 /// <summary>
 /// Initialize a new instance of <see cref="AlgorithmArrayIndexerExpression"/>
 /// </summary>
 /// <param name="targetObject">the reference to the array</param>
 /// <param name="indice">the index of the array.</param>
 public AlgorithmArrayIndexerExpression(AlgorithmReferenceExpression targetObject, AlgorithmExpression indice)
 {
     TargetObject = targetObject;
     Indice       = indice;
 }