internal override void CollectInputExpressions(List <StatementSyntax> expressions) { // Base will traverse to input nodes base.CollectInputExpressions(expressions); string firstVariableName = null, secondVariableName = null; // Save names of variables firstVariableName = m_inputANode.VariableSyntaxName(ObjectBuilder.InputAID.VariableName); secondVariableName = m_inputBNode != null?m_inputBNode.VariableSyntaxName(ObjectBuilder.InputBID.VariableName) : "null"; if (m_inputBNode == null && ObjectBuilder.Operation != "==" && ObjectBuilder.Operation != "!=") { throw new Exception("Null check with Operation " + ObjectBuilder.Operation + " is prohibited."); } // Create expression for arithmetic operation Debug.Assert(!string.IsNullOrEmpty(firstVariableName) && !string.IsNullOrEmpty(secondVariableName)); expressions.Add( MySyntaxFactory.ArithmeticStatement( VariableSyntaxName(), firstVariableName, secondVariableName, ObjectBuilder.Operation) ); }
internal override void CollectInputExpressions(List <StatementSyntax> expressions) { // Base will traverse to input nodes base.CollectInputExpressions(expressions); string firstVariableName = null, secondVariableName = null; // Save names of variables firstVariableName = m_inputANode.VariableSyntaxName(ObjectBuilder.InputAID.VariableName); secondVariableName = m_inputBNode.VariableSyntaxName(ObjectBuilder.InputBID.VariableName); // Create expression for arithmetic operation Debug.Assert(!string.IsNullOrEmpty(firstVariableName) && !string.IsNullOrEmpty(secondVariableName)); expressions.Add( MySyntaxFactory.ArithmeticStatement( VariableSyntaxName(), firstVariableName, secondVariableName, ObjectBuilder.Operation) ); }