예제 #1
0
        public override void ExitFactor6(ssuplParser.Factor6Context context)
        {
            //factor -> STRINGCONST
            var s = context.STRINGCONST().GetText();

            //...strip leading and trailing quotation marks...
            //...handle backslash escapes...
            if (!stringPool.ContainsKey(s))
            {
                stringPool[s] = new StringInfo(label());
            }
            code.Put(context,
                     $"mov rax, {stringPool[s].address}",
                     "push rax"
                     );
            typeAttr.Put(context, VarType.STRING);
        }
예제 #2
0
 /// <summary>
 /// Exit a parse tree produced by the <c>factor6</c>
 /// labeled alternative in <see cref="ssuplParser.factor"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitFactor6([NotNull] ssuplParser.Factor6Context context)
 {
 }