Beispiel #1
0
 public ClassCondition(StorageArea dataItem, SymbolReference characterClassNameReference, SyntaxProperty <bool> invertResult) :
     base(ExpressionNodeType.ClassCondition)
 {
     DataItem = dataItem;
     CharacterClassNameReference = characterClassNameReference;
     InvertResult = invertResult;
 }
        private void ReplaceIfTypeCobol(ref string source, StorageArea variable, IList<Compiler.Scanner.Token> tokens, ref int index)
        {
            string head = variable.SymbolReference.ToString();
            string tail = null;
            if (variable.SymbolReference.IsQualifiedReference) {
            var qualified = (QualifiedSymbolReference)variable.SymbolReference;
            head = qualified.First.ToString();
            tail = qualified.Tail.ToString();
            }
            Token first, last = null;
            int ifirst = IndexOf(tokens, out first, head, index);
            int ilast  = ifirst+1;
            if (tail != null) ilast = IndexOf(tokens, out last, tail, index);
            int begin, end;
            GetSpan(first, last, out begin, out end);
            index = System.Math.Max(ifirst, ilast);

            var typecobol = variable.SymbolReference as TypeCobolQualifiedSymbolReference;
            if (typecobol == null) return; // nothing to do
            var str = new System.Text.StringBuilder();
            begin -= 7; // indexes are decaled because of the 7 first columns of a COBOL file
            end   -= 7; // (6 characters for sequence number + indicator character)
            str.Append(source.Substring(0,begin));
            string delimiter = " OF ";
            foreach(var reference in typecobol) str.Append(reference).Append(delimiter);
            if (typecobol.Count > 0) str.Length -= delimiter.Length;
            str.Append(source.Substring(end,source.Length-end));
            source = str.ToString();
        }
Beispiel #3
0
 public ClassCondition(StorageArea dataItem, SyntaxProperty <DataItemContentType> dataItemContentType, SyntaxProperty <bool> invertResult) :
     base(ExpressionNodeType.ClassCondition)
 {
     DataItem            = dataItem;
     DataItemContentType = dataItemContentType;
     InvertResult        = invertResult;
 }
Beispiel #4
0
 public override string ToString()
 {
     if (StorageArea != null)
     {
         return(StorageArea.ToString());
     }
     return(base.ToString());
 }
Beispiel #5
0
        public StorageAreaPropertySpecialRegister(Token specialRegisterName, StorageArea storageAreaReference)
            : base(StorageAreaKind.StorageAreaPropertySpecialRegister)
        {
            SpecialRegisterName       = specialRegisterName;
            OtherStorageAreaReference = storageAreaReference;

            // This is both a storage area definition and a reference to the same storage area
            var storageAreaName = storageAreaReference != null?storageAreaReference.ToString() : "null";

            DataDescriptionEntry = new SpecialRegisterDescriptionEntry(specialRegisterName, storageAreaName);
            SymbolReference      = new SymbolReference(DataDescriptionEntry.DataName);
        }
Beispiel #6
0
 public ReceivingStorageArea(StorageDataType dataType, [NotNull] StorageArea storageArea) : base(dataType, storageArea)
 {
     storageArea.IsReadFrom  = false;
     storageArea.IsWrittenTo = true;
 }
Beispiel #7
0
 public VariableOrExpression(StorageArea storageArea) :
     base(storageArea)
 {
 }
Beispiel #8
0
 public Variable(StorageArea reference) : base(StorageDataType.Any, reference)
 {
 }
Beispiel #9
0
 protected VariableBase(StorageDataType dataType, [CanBeNull] StorageArea storageArea)
 {
     DataType    = dataType;
     StorageArea = storageArea;
 }
Beispiel #10
0
 public ClassCondition(StorageArea dataItem, SymbolReference characterClassNameReference, SyntaxProperty<bool> invertResult)
     : base(ExpressionNodeType.ClassCondition)
 {
     DataItem = dataItem;
     CharacterClassNameReference = characterClassNameReference;
     InvertResult = invertResult;
 }
Beispiel #11
0
 public CharacterVariable(StorageArea storageArea) : base(StorageDataType.Character, storageArea)
 {
 }
Beispiel #12
0
 public NumericVariable(StorageArea storageArea) : base(StorageDataType.Numeric, storageArea)
 {
 }
Beispiel #13
0
 public StorageAreaPropertySpecialRegister(Token specialRegisterName, StorageArea storageAreaReference)
     : base(StorageAreaKind.StorageAreaPropertySpecialRegister)
 {
     SpecialRegisterName = specialRegisterName;
     StorageAreaReference = storageAreaReference;
 }
Beispiel #14
0
 public IntegerVariable([NotNull] StorageArea storageArea) : base(StorageDataType.Integer, storageArea)
 {
 }
Beispiel #15
0
 public AlphanumericVariable(StorageArea storageArea) : base(StorageDataType.Alphanumeric, storageArea)
 {
 }
Beispiel #16
0
        public StorageAreaPropertySpecialRegister(Token specialRegisterName, StorageArea storageAreaReference)
            : base(StorageAreaKind.StorageAreaPropertySpecialRegister)
        {
            SpecialRegisterName = specialRegisterName;
            OtherStorageAreaReference = storageAreaReference;

            // This is both a storage area definition and a reference to the same storage area
            var storageAreaName = storageAreaReference != null ? storageAreaReference.ToString() : "null";
            DataDescriptionEntry = new SpecialRegisterDescriptionEntry(specialRegisterName, storageAreaName);
            SymbolReference = new SymbolReference(DataDescriptionEntry.DataName);
        }
Beispiel #17
0
 public SymbolReferenceVariable(StorageDataType symbolType, StorageArea storageArea) : base(symbolType, storageArea)
 {
 }
Beispiel #18
0
 public ClassCondition(StorageArea dataItem, SyntaxProperty<DataItemContentType> dataItemContentType, SyntaxProperty<bool> invertResult)
     : base(ExpressionNodeType.ClassCondition)
 {
     DataItem = dataItem;
     DataItemContentType = dataItemContentType;
     InvertResult = invertResult;
 }
Beispiel #19
0
 public virtual bool Visit(StorageArea storageArea)
 {
     return(true);
 }