コード例 #1
0
        public override object VisitFrag(MFSHParser.FragContext context)
        {
            const String fcn = "VisitFrag";

            this.TraceMsg(context, fcn);
            String fragName = context.NAME().GetText();

            String fragmentDefinition = String.Empty;

            MIFragment frag       = new MIFragment(this.SourceName, context.Start.Line, fragName);
            MacroBlock macroBlock = new MacroBlock("frag", frag);

            frag.OnceFlag = context.ONCE() != null;

            this.PushState(macroBlock);

            return(null);
        }
コード例 #2
0
        public override object VisitMacro(MFSHParser.MacroContext context)
        {
            const String fcn = "VisitMacro";

            this.TraceMsg(context, fcn);
            String[] names = context
                             .NAME()
                             .Select((a) => a.GetText())
                             .ToArray();
            MIMacro    macro      = new MIMacro(this.SourceName, context.Start.Line, names[0], names.Skip(1));
            MacroBlock macroBlock = new MacroBlock("macro", macro);

            this.PushState(macroBlock);

            var redirectContext = context.redirect();

            if (redirectContext != null)
            {
                macro.Redirect = (String)(this.Visit(redirectContext.singleString()));
            }
            macro.OnceFlag = context.ONCE() != null;

            return(null);
        }