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()));
     }
 }
 internal Value CreateValue(CodeElementsParser.Value1Context context)
 {
     if (context.numericValue() != null)
         return new Value(CreateNumericValue(context.numericValue()));
     if (context.alphanumericValue2() != null)
         return new Value(CreateAlphanumericValue(context.alphanumericValue2()));
     if (context.repeatedCharacterValue2() != null)
         return new Value(CreateRepeatedCharacterValue(context.repeatedCharacterValue2()));
     throw new InvalidOperationException();
 }
 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();
     }
 }
        internal Variable CreateVariableOrIndex(CodeElementsParser.VariableOrIndexContext context)
        {
            Variable variable = null;
            if(context.identifierOrIndexName() != null)
            {
                variable = new Variable(
                    CreateIdentifierOrIndexName(context.identifierOrIndexName()));
            }
            else if (context.numericValue() != null)
            {
                variable = new Variable(
                    CobolWordsBuilder.CreateNumericValue(context.numericValue()));
            }
            else if (context.alphanumericValue2() != null)
            {
                variable = new Variable(
                    CobolWordsBuilder.CreateAlphanumericValue(context.alphanumericValue2()));
            }
            else
            {
                variable = new Variable(
                    CobolWordsBuilder.CreateRepeatedCharacterValue(context.repeatedCharacterValue2()));
            }

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

            return variable;
        }