Example #1
0
 public override object VisitStringExp([NotNull] CoolParser.StringExpContext context)
 {
     VisitExpr(context);
     //var s = context.s.Text;
     dotcode += "\"" + context.GetType().Name.Substring(0, context.GetType().Name.Length - 7) + "\"[label=" + context.GetText() + "]" + "\n";
     return(VisitChildren(context));
 }
Example #2
0
        public override Node VisitStringExp([NotNull] CoolParser.StringExpContext context)
        {
            //Data.Add("string" + stringcount++ + ":" + "\t.asciiz\t" + context.STRING().GetText());
            SymbolTable.StringVariables[context.STRING().GetText()] = stringcount;
            var s = VisitChildren(context);

            return(new StringNode(context, s));
        }
Example #3
0
 public StringNode(CoolParser.StringExpContext context, Node s) : base(s.Childs)
 {
     this.context = context;
     this.s       = s;
     this.V       = context.STRING().GetText();
     I            = MIPS.stringCount++;
     Type         = "String";
 }
Example #4
0
 /// <summary>
 /// Exit a parse tree produced by the <c>stringExp</c>
 /// labeled alternative in <see cref="CoolParser.expresion"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitStringExp([NotNull] CoolParser.StringExpContext context)
 {
 }
 /// <summary>
 /// Visit a parse tree produced by the <c>stringExp</c>
 /// labeled alternative in <see cref="CoolParser.expresion"/>.
 /// <para>
 /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/>
 /// on <paramref name="context"/>.
 /// </para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 /// <return>The visitor result.</return>
 public virtual Result VisitStringExp([NotNull] CoolParser.StringExpContext context)
 {
     return(VisitChildren(context));
 }
Example #6
0
 public static string getCoolType(this CoolParser.StringExpContext s)
 {
     return("STRING");
 }
Example #7
0
 public override bool VisitStringExp([NotNull] CoolParser.StringExpContext context)
 {
     return(VisitChildren(context));
 }