private ConditionOperand CreateConditionOperand(CodeElementsParser.ConditionOperandContext context) { ConditionOperand conditionOperand = null; if (context.arithmeticExpression() != null) { conditionOperand = new ConditionOperand( CreateArithmeticExpression(context.arithmeticExpression())); } else if (context.variableOrIndex() != null) { conditionOperand = new ConditionOperand( CreateVariableOrIndex(context.variableOrIndex())); } else if (context.nullPointerValue() != null) { conditionOperand = new ConditionOperand( CobolWordsBuilder.CreateNullPointerValue(context.nullPointerValue())); } else if (context.selfObjectIdentifier() != null) { conditionOperand = new ConditionOperand( ParseTreeUtils.GetFirstToken(context.selfObjectIdentifier())); } return conditionOperand; }
internal Value CreateValue(CodeElementsParser.Value2Context context) { if (context.numericValue() != null) { NumericValue numericValue = CreateNumericValue(context.numericValue()); return new Value(numericValue); } else if (context.alphanumericValue2() != null) { AlphanumericValue alphanumericValue = CreateAlphanumericValue(context.alphanumericValue2()); return new Value(alphanumericValue); } else if (context.repeatedCharacterValue2() != null) { RepeatedCharacterValue repeatedCharacterValue = CreateRepeatedCharacterValue(context.repeatedCharacterValue2()); return new Value(repeatedCharacterValue); } else if (context.nullPointerValue() != null) { NullPointerValue nullPointerValue = CreateNullPointerValue(context.nullPointerValue()); return new Value(nullPointerValue); } else { throw new InvalidOperationException(); } }