Пример #1
0
 public IncludeDirective(IZ80AsmVisitorContext visitorContext, Z80AsmParser.DirectiveContext context) :
     base(context)
 {
     if (context.STRING() != null)
     {
         visitorContext.AddString(context.STRING());
     }
     Filename = context.GetChild(1).NormalizeString();
 }
Пример #2
0
        public LineDirective(IZ80AsmVisitorContext visitorContext, Z80AsmParser.DirectiveContext context) :
            base(context)
        {
            if (context.expr() != null)
            {
                Expr = visitorContext.GetExpression(context.expr());
            }

            if (context.STRING() != null)
            {
                visitorContext.AddString(context.STRING());
            }
            Filename = context.STRING().NormalizeString();
        }
Пример #3
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));
        }