예제 #1
0
        // Add initialization of Sub for the current Structure
        public override void ExitTypeStmt([NotNull] BosParser.TypeStmtContext context)
        {
            var currentType = TypesStack.Pop();

            if (InitStructures.ContainsKey(currentType) && InitStructures[currentType].Text.Length > 0)
            {
                StreamRewriter.InsertBefore(context.Stop, InitStructures[currentType].Text);
                StructuresWithInit.Add(currentType);
            }
            else
            {
                InitStructures.Remove(currentType);
            }
            //base.ExitTypeStmt(context);
        }
        // we add initialization Sub for the current Structure
        public override void ExitTypeStmt([NotNull] VBAParser.TypeStmtContext context)
        {
            var currentType = Types.Pop();

            if (InitStructures.ContainsKey(currentType) && InitStructures[currentType].Text.Length > 0)
            {
                Rewriter.InsertBefore(context.Stop, InitStructures[currentType].Text);

                StructuresWithInitializer.Add(currentType);
            }
            else
            {
                InitStructures.Remove(currentType);
            }
        }