Example #1
0
        public override void EnterTypeStmt(VBAParser.TypeStmtContext context)
        {
            var accessibility = GetMemberAccessibility(context.visibility());
            var name          = context.ambiguousIdentifier().GetText();

            _declarations.Add(CreateDeclaration(name, null, accessibility, DeclarationType.UserDefinedType, context, context.ambiguousIdentifier().GetSelection()));
            //SetCurrentScope(name);
        }
Example #2
0
        public override void EnterTypeStmt(VBAParser.TypeStmtContext context)
        {
            var accessibility = GetMemberAccessibility(context.visibility());
            var identifier    = context.identifier();

            if (identifier == null)
            {
                return;
            }
            var name = identifier.GetText();

            var declaration = CreateDeclaration(name, null, accessibility, DeclarationType.UserDefinedType, context, context.identifier().GetSelection());

            OnNewDeclaration(declaration);
            _parentDeclaration = declaration; // treat members as child declarations, but keep them scoped to module
        }
        // transform a Type in a Structure
        public override void EnterTypeStmt(VBAParser.TypeStmtContext context)
        {
            var typeName = context.ambiguousIdentifier().GetText();

            Types.Push(typeName);
            InitStructures.Add(typeName, new StructureInitializer(typeName));

            Rewriter.Replace(context.TYPE().Symbol, "Structure");
            Rewriter.Replace(context.END_TYPE().Symbol, "End Structure");

            string visibility = context.visibility().GetText();

            foreach (var st in context.typeStmt_Element())
            {
                Rewriter.InsertBefore(st.Start, $"{visibility} ");
            }
        }