public FunctionDeclarationHeader(SymbolDefinition name, AccessModifier visibility, FunctionType type)
     : base(CodeElementType.FunctionDeclarationHeader)
 {
     this.FunctionName = name;
     this.Visibility = visibility;
     this.UserDefinedType = type != null ? type : FunctionType.Undefined;
     this.Profile = new ParametersProfile();
 }
Exemplo n.º 2
0
        public SpecialRegisterDescriptionEntry(Token specialRegisterName, string storageAreaNameOrFileName)
            : base()
        {
            // Generate a unique symbol name for this special register
            var generatedSymbolName = new GeneratedSymbolName(specialRegisterName, specialRegisterName.Text + "-" + storageAreaNameOrFileName);
            DataName = new SymbolDefinition(generatedSymbolName, SymbolType.DataName);

            SpecialRegisterName = specialRegisterName;
        }
Exemplo n.º 3
0
        public FunctionCallResultDescriptionEntry(FunctionCall functionCall, int callSiteId)
            : base()
        {
            // Generate a unique symbol name for the function call at this specific call site
            var generatedSymbolName = new GeneratedSymbolName(functionCall.FunctionNameToken, functionCall.FunctionName + "-" + callSiteId);
            DataName = new SymbolDefinition(generatedSymbolName, SymbolType.DataName);

            FunctionCall = functionCall;
        }
Exemplo n.º 4
0
 public static StorageArea CreateReceivingStorageArea(SymbolDefinition symbol)
 {
     if (symbol == null) return null;
     var storage = new DataOrConditionStorageArea(new SymbolReference(symbol));
     return storage;
 }
Exemplo n.º 5
0
 public GeneratedParameter(SymbolDefinition symbol)
 {
     this.StorageArea = CreateReceivingStorageArea(symbol);
     var mode = TypeCobol.Compiler.CodeElements.ParameterSharingMode.ByReference;
     this.SharingMode = new SyntaxProperty<ParameterSharingMode>(mode, null);
 }
Exemplo n.º 6
0
 internal SymbolDefinition CreateSymbolDefinition(CodeElementsParser.SymbolDefinition11Context context, SymbolType symbolType)
 {
     AlphanumericValue nameLiteral = CreateAlphanumericValue(context.alphanumericValue11());
     var symbolDefinition = new SymbolDefinition(nameLiteral, symbolType);
     symbolInformationForTokens[nameLiteral.Token] = symbolDefinition;
     return symbolDefinition;
 }
Exemplo n.º 7
0
 internal SymbolDefinition CreateSymbolDefinition([CanBeNull] CodeElementsParser.SymbolDefinition4Context context, SymbolType symbolType)
 {
     if (context == null) return null;
     AlphanumericValue nameLiteral = CreateAlphanumericValue(context.alphanumericValue4());
     var symbolDefinition = new SymbolDefinition(nameLiteral, symbolType);
     symbolInformationForTokens[nameLiteral.Token] = symbolDefinition;
     return symbolDefinition;
 }
Exemplo n.º 8
0
 public SymbolReference(SymbolDefinition symbol)
     : this(symbol.NameLiteral, symbol.Type)
 {
 }
Exemplo n.º 9
0
 public virtual bool Visit(SymbolDefinition symbolDefinition)
 {
     return(true);
 }
Exemplo n.º 10
0
 public SymbolReference(SymbolDefinition symbol)
     : this(symbol.NameLiteral, symbol.Type)
 {
 }