internal NumericVariable CreateNumericVariableOrIndex(CodeElementsParser.NumericVariableOrIndexContext context)
 {
     if (context.identifierOrIndexName() != null)
     {
         return new NumericVariable(
             CreateIdentifierOrIndexName(context.identifierOrIndexName()));
     }
     else
     {
         return new NumericVariable(
             CobolWordsBuilder.CreateNumericValue(context.numericValue()));
     }
 }
 internal IntegerVariable CreateIntegerVariableOrIndex(CodeElementsParser.IntegerVariableOrIndex1Context context)
 {
     if (context.identifierOrIndexName() != null)
     {
         return new IntegerVariable(
             CreateIdentifierOrIndexName(context.identifierOrIndexName()));
     }
     else
     {
         return new IntegerVariable(
             CobolWordsBuilder.CreateIntegerValue(context.integerValue()));
     }
 }
 internal ReceivingStorageArea CreateDataOrIndexStorageArea(CodeElementsParser.DataOrIndexStorageAreaContext context)
 {
     return new ReceivingStorageArea(StorageDataType.Numeric,
         CreateIdentifierOrIndexName(context.identifierOrIndexName()));
 }
 internal Variable CreateVariableOrIndex(CodeElementsParser.VariableOrIndexContext context)
 {
     if(context.identifierOrIndexName() != null)
     {
         return new Variable(
             CreateIdentifierOrIndexName(context.identifierOrIndexName()));
     }
     else if (context.numericValue() != null)
     {
         return new Variable(
             CobolWordsBuilder.CreateNumericValue(context.numericValue()));
     }
     else if (context.alphanumericValue2() != null)
     {
         return new Variable(
             CobolWordsBuilder.CreateAlphanumericValue(context.alphanumericValue2()));
     }
     else
     {
         return new Variable(
             CobolWordsBuilder.CreateRepeatedCharacterValue(context.repeatedCharacterValue2()));
     }
 }
Пример #5
0
        internal NumericVariable CreateNumericVariableOrIndex(CodeElementsParser.NumericVariableOrIndexContext context)
        {
            NumericVariable variable = null;
            if (context.identifierOrIndexName() != null)
            {
                variable = new NumericVariable(
                    CreateIdentifierOrIndexName(context.identifierOrIndexName()));
            }
            else
            {
                variable = new NumericVariable(
                    CobolWordsBuilder.CreateNumericValue(context.numericValue()));
            }

            // Collect storage area read/writes at the code element level
            if (variable.StorageArea != null)
            {
                this.storageAreaReads.Add(variable.StorageArea);
            }

            return variable;
        }
Пример #6
0
        internal ReceivingStorageArea CreateDataOrIndexStorageArea(CodeElementsParser.DataOrIndexStorageAreaContext context)
        {
            var storageArea = new ReceivingStorageArea(StorageDataType.Numeric,
                CreateIdentifierOrIndexName(context.identifierOrIndexName()));

            // Collect storage area read/writes at the code element level
            this.storageAreaWrites.Add(storageArea);

            return storageArea;
        }