Ejemplo n.º 1
0
 public override void Visit(SystemOutPrintLnStatementNode node)
 {
     node.expression.Accept(this);
     Gen("push", "ecx");
     Gen("push", "eax");
     Gen("call", "put", "", "Calling System.Out.Println()");
     Gen("add", "sp","4");
     Gen("pop", "ecx");
 }
Ejemplo n.º 2
0
        public override void Visit(SystemOutPrintLnStatementNode node)
        {
            try
            {
                node.expression.Accept(this);

                if (!AreTypeCompatible(node.expression.ExpressionType.GetType(), typeof(IntType)))
                    throw new Exception("Expression for System.out.println is not of type Int!");
            }
            catch (Exception e)
            {
                Analysis.LogSemanticError(e.Message, node.lineNumber);
            }
        }
Ejemplo n.º 3
0
 public virtual void Visit(SystemOutPrintLnStatementNode node)
 {
     node.expression.Accept(this);
 }
Ejemplo n.º 4
0
 public override void Visit(SystemOutPrintLnStatementNode node)
 {
     Console.WriteLine(this.indentation + "System.Out.Println           ---- Statement ----");
     indentation = indentation + "   ";
     node.expression.Accept(this);
     indentation = indentation.Substring(0, indentation.Length - 3);
 }