public override void EnterFunctionDeclarationHeader(CodeElementsParser.FunctionDeclarationHeaderContext context)
 {
     var visibility = context.PUBLIC() != null ? AccessModifier.Public : AccessModifier.Private;
     QualifiedName name = null;
     if (context.UserDefinedWord() != null) {
     var token = ParseTreeUtils.GetTokenFromTerminalNode(context.UserDefinedWord());
     name = new URI(token.Text);
     }
     Context = context;
     CodeElement = new FunctionDeclarationHeader(name, visibility);
 }
        public override void EnterFunctionDeclarationHeader(CodeElementsParser.FunctionDeclarationHeaderContext context)
        {
            var type = FunctionType.Undefined;
            if (context.PROCEDURE() != null) type = FunctionType.Procedure;
            if (context.FUNCTION()  != null) type = FunctionType.Function;

            // TCRFUN_NO_DEFAULT_ACCESS_MODIFIER
            // As the grammar enforces that there must be one least one of the PUBLIC or PRIVATE keywords,
            // there will be a syntax error if there is neither of these two keywords.
            // So, the fact of considering a function PRIVATE by default does not break this rule.
            var visibility = context.PUBLIC() != null ? AccessModifier.Public : AccessModifier.Private;

            SymbolDefinition name = null;
            if (context.functionNameDefinition() != null) {
            name = CobolWordsBuilder.CreateFunctionNameDefinition(context.functionNameDefinition());
            }
            Context = context;
            CodeElement = new FunctionDeclarationHeader(name, visibility, type);
        }