예제 #1
0
 public override object VisitIntExp([NotNull] CoolParser.IntExpContext context)
 {
     VisitExpr(context);
     dotcode += "\"" + context.GetType().Name.Substring(0, context.GetType().Name.Length - 7) + "\"[label=" + context.GetText() + "]" + "\n";
     return(VisitChildren(context));
 }
예제 #2
0
파일: TypeVisitor.cs 프로젝트: maxblu/coolc
        public override Node VisitIntExp([NotNull] CoolParser.IntExpContext context)
        {
            var s = VisitChildren(context);

            return(new IntNode(context, s));
        }
예제 #3
0
 /// <summary>
 /// Exit a parse tree produced by the <c>intExp</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 ExitIntExp([NotNull] CoolParser.IntExpContext context)
 {
 }
 /// <summary>
 /// Visit a parse tree produced by the <c>intExp</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 VisitIntExp([NotNull] CoolParser.IntExpContext context)
 {
     return(VisitChildren(context));
 }
예제 #5
0
 public IntNode(CoolParser.IntExpContext context, Node s) : base(s.Childs)
 {
     this.context = context;
     this.V       = int.Parse(context.INT().GetText());
     Type         = "Int";
 }
예제 #6
0
 public static string getCoolType(this CoolParser.IntExpContext s)
 {
     return("INT");
 }
예제 #7
0
 public override bool VisitIntExp([NotNull] CoolParser.IntExpContext context)
 {
     return(VisitChildren(context));
 }