Esempio n. 1
0
        public override object VisitDirective(Z80AsmParser.DirectiveContext context)
        {
            KeywordSpan = new TextSpan(context.Start.StartIndex, context.Start.StopIndex + 1);
            var mnemonic = context.GetChild(0).NormalizeToken();

            if (context.STRING() != null)
            {
                AddString(context.STRING());
            }
            else if (context.FSTRING() != null)
            {
                AddString(context.FSTRING());
            }
            if (mnemonic == "#INCLUDE")
            {
                return(new IncludeDirective(this, context));
            }
            else if (mnemonic == "#LINE")
            {
                return(new LineDirective(this, context));
            }
            return(new Directive(this, context));
        }