Ejemplo n.º 1
0
            public override void EnterIdentifier(VBAParser.IdentifierContext context)
            {
                DeclarationType type;

                if (!ScopingContextTypes.TryGetValue(context.Parent.GetType(), out type))
                {
                    return;
                }

                _currentScope = Tuple.Create(context.GetText(), type);
            }
Ejemplo n.º 2
0
        private ProcedureNode(ParserRuleContext context, string scope, string localScope,
                              VBProcedureKind kind,
                              VBAParser.VisibilityContext visibility,
                              VBAParser.IdentifierContext name,
                              Func <VBAParser.AsTypeClauseContext> asType)
            : base(context, scope, localScope)
        {
            _kind              = kind;
            _name              = name.GetText();
            _accessibility     = visibility.GetAccessibility();
            _visibilityContext = visibility;

            if (asType != null)
            {
                var returnTypeClause = asType();
                _isImplicitReturnType = returnTypeClause == null;

                _returnType = returnTypeClause == null
                                ? Tokens.Variant
                                : returnTypeClause.type().GetText();
            }
        }