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); }
/// <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) { }