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); }
// 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} "); } }