private DataConditionEntry CreateFunctionConditionParameter(CodeElementsParser.FunctionConditionParameterContext context)
 {
     var parameter = new DataConditionEntry();
     parameter.LevelNumber = CobolWordsBuilder.CreateIntegerValue(context.levelNumber().integerValue());
     parameter.DataName = CobolWordsBuilder.CreateConditionNameDefinition(context.conditionNameDefinition());
     SetConditionValues(parameter, context.valueClauseForCondition());
     return parameter;
 }
Ejemplo n.º 2
0
        public override void EnterDataConditionEntry(CodeElementsParser.DataConditionEntryContext context)
        {
            var entry = new DataConditionEntry();
            entry.LevelNumber = CobolWordsBuilder.CreateIntegerValue(context.levelNumber().integerValue());
            entry.DataName = CobolWordsBuilder.CreateConditionNameDefinition(context.conditionNameDefinition());
            SetConditionValues(entry, context.valueClauseForCondition());

            Context = context;
            CodeElement = entry;
        }
Ejemplo n.º 3
0
 private void SetConditionValues(DataConditionEntry entry,CodeElementsParser.ValueClauseForConditionContext context)
 {
     if (context == null) return;
     if (context.value1() != null && context.value1().Length > 0) {
         entry.ConditionValues = new Value[context.value1().Length];
         for (int i = 0; i < context.value1().Length; i++)
             entry.ConditionValues[i] = CobolWordsBuilder.CreateValue(context.value1()[i]);
     }
     if (context.valuesRange() != null && context.valuesRange().Length > 0) {
         entry.ConditionValuesRanges = new ValuesRange[context.valuesRange().Length];
         for (int i = 0; i < context.valuesRange().Length; i++) {
             var valuesRangeContext = context.valuesRange()[i];
             entry.ConditionValuesRanges[i] = new ValuesRange(
                 CobolWordsBuilder.CreateValue(valuesRangeContext.startValue),
                 CobolWordsBuilder.CreateValue(valuesRangeContext.endValue));
         }
     }
 }
 private ParameterDescriptionEntry CreateFunctionDataParameter(DataConditionEntry condition)
 {
     var data = new ParameterDescriptionEntry();
     data.LevelNumber = condition.LevelNumber;
     data.DataName    = condition.DataName;
     data.DataType    = DataType.Unknown;
     return data;
 }
Ejemplo n.º 5
0
 private void EnterDataConditionEntry(DataConditionEntry data)
 {
     SetCurrentNodeToTopLevelItem(data.LevelNumber.Value);
     var node = new DataCondition(data);
     Enter(node);
     if (!node.IsPartOfATypeDef) node.SymbolTable.AddVariable(node);
 }