<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>tests/integration/positive/real numbers.output-desired</filename>
    </added>
    <added>
      <filename>tests/integration/positive/real numbers.xpl</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -3,21 +3,21 @@
     Builds the Xpl compiler and runs the associated unit and integration tests.
   &lt;/description&gt;
 
-  &lt;property name=&quot;doc&quot;                      location=&quot;doc&quot; /&gt;
-  &lt;property name=&quot;src&quot;                      location=&quot;src&quot; /&gt;
-  &lt;property name=&quot;src-xpl&quot;                  location=&quot;${src}/xpl&quot; /&gt;
-  &lt;property name=&quot;src-semantic&quot;             location=&quot;${src}/xpl/semantic&quot; /&gt;
-  &lt;property name=&quot;src-codegen&quot;              location=&quot;${src}/xpl/codegen&quot; /&gt;
-  &lt;property name=&quot;bin&quot;                      location=&quot;bin&quot; /&gt;
-  &lt;property name=&quot;classes&quot;                  location=&quot;${bin}/classes&quot; /&gt;
-  &lt;property name=&quot;classes-xpl&quot;              location=&quot;${bin}/classes/xpl&quot; /&gt;
-  &lt;property name=&quot;classes-runtime&quot;          location=&quot;${bin}/classes/xpl/runtime&quot; /&gt;
-  &lt;property name=&quot;classes-tests&quot;            location=&quot;${bin}/classes/tests&quot; /&gt;
-  &lt;property name=&quot;tests&quot;                    location=&quot;tests/&quot; /&gt;
-  &lt;property name=&quot;tests-unit&quot;               location=&quot;tests/unit&quot; /&gt;
-  &lt;property name=&quot;tests-integration&quot;        location=&quot;tests/integration&quot; /&gt;
-  &lt;property name=&quot;tests-integration-pos&quot;    location=&quot;tests/integration/positive&quot; /&gt;
-  &lt;property name=&quot;tests-integration-neg&quot;    location=&quot;tests/integration/negative&quot; /&gt;
+  &lt;property name=&quot;doc&quot;                   location=&quot;doc&quot; /&gt;
+  &lt;property name=&quot;src&quot;                   location=&quot;src&quot; /&gt;
+  &lt;property name=&quot;src-xpl&quot;               location=&quot;${src}/xpl&quot; /&gt;
+  &lt;property name=&quot;src-semantic&quot;          location=&quot;${src}/xpl/semantic&quot; /&gt;
+  &lt;property name=&quot;src-codegen&quot;           location=&quot;${src}/xpl/codegen&quot; /&gt;
+  &lt;property name=&quot;bin&quot;                   location=&quot;bin&quot; /&gt;
+  &lt;property name=&quot;classes&quot;               location=&quot;${bin}/classes&quot; /&gt;
+  &lt;property name=&quot;classes-xpl&quot;           location=&quot;${bin}/classes/xpl&quot; /&gt;
+  &lt;property name=&quot;classes-runtime&quot;       location=&quot;${bin}/classes/xpl/runtime&quot; /&gt;
+  &lt;property name=&quot;classes-tests&quot;         location=&quot;${bin}/classes/tests&quot; /&gt;
+  &lt;property name=&quot;tests&quot;                 location=&quot;tests/&quot; /&gt;
+  &lt;property name=&quot;tests-unit&quot;            location=&quot;tests/unit&quot; /&gt;
+  &lt;property name=&quot;tests-integration&quot;     location=&quot;tests/integration&quot; /&gt;
+  &lt;property name=&quot;tests-integration-pos&quot; location=&quot;tests/integration/positive&quot; /&gt;
+  &lt;property name=&quot;tests-integration-neg&quot; location=&quot;tests/integration/negative&quot; /&gt;
 
   &lt;macrodef name=&quot;antlr3&quot;&gt;
     &lt;attribute name=&quot;libdirectory&quot;/&gt;
@@ -109,12 +109,50 @@
       &lt;sequential&gt;
         &lt;basename property=&quot;@{file}-test-name&quot; file=&quot;@{file}&quot; suffix=&quot;.xpl&quot; /&gt;
 
-        &lt;java jar=&quot;${bin}/xpl.jar&quot; fork=&quot;true&quot; output=&quot;${tests-integration-pos}/${@{file}-test-name}.compilation&quot; failonerror=&quot;true&quot;&gt;
+        &lt;java jar=&quot;${bin}/xpl.jar&quot; fork=&quot;true&quot; output=&quot;${tests-integration-pos}/${@{file}-test-name}.compilation&quot; resultproperty=&quot;compilation-succeeded&quot;&gt;
           &lt;arg value=&quot;@{file}&quot; /&gt;
           &lt;arg value=&quot;${tests-integration-pos}/${@{file}-test-name}.class&quot; /&gt;
         &lt;/java&gt;
 
-        &lt;java classpath=&quot;${tests-integration-pos}:${bin}/runtime.jar&quot; classname=&quot;${@{file}-test-name}&quot; fork=&quot;true&quot; output=&quot;${tests-integration-pos}/${@{file}-test-name}.output-current&quot; outputproperty=&quot;run-failure&quot; /&gt;
+        &lt;if&gt;
+          &lt;equals arg1=&quot;${compilation-succeeded}&quot; arg2=&quot;1&quot; /&gt;
+          &lt;then&gt;
+            &lt;echo message=&quot;Compilation failure: &quot; /&gt;
+
+            &lt;exec executable=&quot;cat&quot;&gt;
+              &lt;arg value=&quot;${tests-integration-pos}/${@{file}-test-name}.compilation&quot; /&gt;
+            &lt;/exec&gt;
+            &lt;fail /&gt;
+          &lt;/then&gt;
+        &lt;/if&gt;
+
+        &lt;java classpath=&quot;${tests-integration-pos}:${bin}/runtime.jar&quot; classname=&quot;${@{file}-test-name}&quot; fork=&quot;true&quot; output=&quot;${tests-integration-pos}/${@{file}-test-name}.output-current&quot; resultproperty=&quot;run-succeeded&quot; /&gt;
+
+        &lt;if&gt;
+          &lt;equals arg1=&quot;${run-succeeded}&quot; arg2=&quot;1&quot; /&gt;
+          &lt;then&gt;
+            &lt;echo message=&quot;Program run failure: &quot; /&gt;
+            &lt;echo /&gt;
+            &lt;echo /&gt;
+
+            &lt;echo message=&quot;Compilation message: &quot; /&gt;
+            &lt;echo /&gt;
+
+            &lt;exec executable=&quot;cat&quot;&gt;
+              &lt;arg value=&quot;${tests-integration-pos}/${@{file}-test-name}.compilation&quot; /&gt;
+            &lt;/exec&gt;
+
+            &lt;echo /&gt;
+            &lt;echo message=&quot;Run output: &quot; /&gt;
+            &lt;echo /&gt;
+
+            &lt;exec executable=&quot;cat&quot;&gt;
+              &lt;arg value=&quot;${tests-integration-pos}/${@{file}-test-name}.output-current&quot; /&gt;
+            &lt;/exec&gt;
+
+            &lt;fail /&gt;
+          &lt;/then&gt;
+        &lt;/if&gt;
 
         &lt;exec executable=&quot;cat&quot; output=&quot;${tests-integration-pos}/${@{file}-test-name}.output-diff&quot;&gt;
           &lt;arg value=&quot;${tests-integration-pos}/${@{file}-test-name}.xpl&quot; /&gt;
@@ -147,7 +185,6 @@
       &lt;/sequential&gt;
     &lt;/for&gt;
 
-
     &lt;junit haltonfailure=&quot;yes&quot; haltonerror=&quot;yes&quot; showoutput=&quot;yes&quot;&gt;
       &lt;classpath&gt;
         &lt;pathelement path=&quot;${classes-tests}&quot;/&gt;</diff>
      <filename>build.xml</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@ grammar Xpl;
 
 options { output=AST; ASTLabelType=ASTNode; }
 
-tokens  { CALL; CALL_ARGUMENTS; WHILE; IF; METHOD; PROGN; RETURN; STRING_PLUS; TOSTRING; }
+tokens  { CALL; CALL_ARGUMENTS; WHILE; IF; METHOD; PROGN; RETURN; STRING_PLUS; TOREAL; TOSTRING; }
 
 @header {
     package xpl;
@@ -66,13 +66,15 @@ term:		             factor (('*' | '/')^ factor)*;
 
 factor:                  atom ('%'^ atom)*;
 
-atom:                    NUMBER | STRING | (IDENTIFIER '(') =&gt; call | '('! expression ')'! | IDENTIFIER&lt;IdentifierNode&gt;;
+atom:                    REAL | INTEGER | STRING | (IDENTIFIER '(') =&gt; call | '('! expression ')'! | IDENTIFIER&lt;IdentifierNode&gt;;
 
 STRING:                  '\&quot;' (options {greedy=false;}: ('A'..'z') | ' ' | '(' | ')' | ':' | '-')* '\&quot;';
 
-NUMBER:    	             ('0'..'9')+;
+REAL:                    ('0'..'9')+ '.' ('0'..'9')+;
 
-TYPE:                    'int' | 'string' | 'void';
+INTEGER:    	         ('0'..'9')+;
+
+TYPE:                    'int' | 'real' | 'string' | 'void';
 
 IDENTIFIER:              ('a'..'z' | '_')+;
 </diff>
      <filename>src/xpl/Xpl.g</filename>
    </modified>
    <modified>
      <diff>@@ -39,7 +39,7 @@ public class XplCompiler {
 
       parse(); semanticAnalysis(); codeGeneration();
 
-      System.out.println(&quot;Compilations was successfull.&quot;);
+      System.out.println(&quot;Compilation was successfull.&quot;);
     }
     catch(SyntacticAnalysisError e) {
       System.out.println(&quot;Syntax errors: &quot;);</diff>
      <filename>src/xpl/XplCompiler.java</filename>
    </modified>
    <modified>
      <diff>@@ -55,7 +55,7 @@ conditional
         };
 
 conditional_test[boolean hasElse]
-@after { generate.conditional().ifAfterCondition(hasElse); }
+@after { System.out.println(&quot;hasElse: &quot; + hasElse); generate.conditional().ifAfterCondition(hasElse); }
     :  expression;
 
 conditional_true_branch[boolean hasElse]
@@ -107,11 +107,11 @@ comparision_expression
     |  binary_expression;
 
 binary_expression
-    :  ^('+' a=binary_expression b=binary_expression) { generate.arithmetic().add(); }
-    |  ^('-' a=binary_expression b=binary_expression) { generate.arithmetic().subtract(); }
-    |  ^('*' a=binary_expression b=binary_expression) { generate.arithmetic().multiply(); }
-    |  ^('/' a=binary_expression b=binary_expression) { generate.arithmetic().divide(); }
-    |  ^('%' a=binary_expression b=binary_expression) { generate.arithmetic().mod(); }
+    :  ^('+' a=binary_expression b=binary_expression) { generate.arithmetic().add($start); }
+    |  ^('-' a=binary_expression b=binary_expression) { generate.arithmetic().subtract($start); }
+    |  ^('*' a=binary_expression b=binary_expression) { generate.arithmetic().multiply($start); }
+    |  ^('/' a=binary_expression b=binary_expression) { generate.arithmetic().divide($start); }
+    |  ^('%' a=binary_expression b=binary_expression) { generate.arithmetic().mod($start); }
     |  string_concatenation
     |  atom
     ;
@@ -130,7 +130,8 @@ string_concatenation_arg
         };
 
 atom
-    :  NUMBER     { generate.misc().load(Integer.parseInt($NUMBER.text)); }
+    :  REAL       { generate.misc().load($REAL); }
+    |  INTEGER    { generate.misc().load($INTEGER); }
     |  IDENTIFIER { generate.misc().loadVariable((IdentifierNode)$IDENTIFIER); }
     |  STRING     { generate.string().load(strip($STRING.text)); }
     | '(' expression ')'
@@ -138,7 +139,7 @@ atom
     ;
 
 call
-@init { generate.method().prepareCall(); }
+@init { generate.method().prepareCall((MethodNode)$start); }
     :  ^(CALL IDENTIFIER call_arguments?) { generate.method().call(((MethodNode)$start)); };
 
 call_arguments</diff>
      <filename>src/xpl/codegen/CodeGeneration.g</filename>
    </modified>
    <modified>
      <diff>@@ -2,12 +2,49 @@ package xpl.codegen;
 
 import org.objectweb.asm.MethodVisitor;
 
+import xpl.semantic.Types;
+import xpl.semantic.ast.ASTNode;
+
 public class CodeGeneratorArithmetic extends CodeGeneratorModule {
   public CodeGeneratorArithmetic(Context context) { super(context); }
 
-  public void add()      { currentMethod.visitInsn(IADD); }
-  public void subtract() { currentMethod.visitInsn(ISUB); }
-  public void multiply() { currentMethod.visitInsn(IMUL); }
-  public void divide()   { currentMethod.visitInsn(IDIV); }
-  public void mod()      { currentMethod.visitInsn(IREM); }
+  public void add(ASTNode additionNode) {
+    if(additionNode.getNodeType() == Types.Integer)
+      currentMethod.visitInsn(IADD);
+    else
+      currentMethod.visitInsn(DADD);
+  }
+
+  public void subtract(ASTNode substractionNode) {
+    if(substractionNode.getNodeType() == Types.Integer)
+      currentMethod.visitInsn(ISUB);
+    else
+      currentMethod.visitInsn(DSUB);
+  }
+
+  public void multiply(ASTNode multiplicationNode) {
+    if(multiplicationNode.getNodeType() == Types.Integer)
+      currentMethod.visitInsn(IMUL);
+    else
+      currentMethod.visitInsn(DMUL);
+  }
+
+  public void divide(ASTNode divisionNode)   {
+    if(divisionNode.getNodeType() == Types.Integer)
+      currentMethod.visitInsn(IDIV);
+    else
+      currentMethod.visitInsn(DDIV);
+  }
+
+  public void mod(ASTNode moduloDivisionNode) {
+    if(moduloDivisionNode.getNodeType() == Types.Integer)
+      currentMethod.visitInsn(IREM);
+    else
+      currentMethod.visitInsn(DREM);
+  }
+
+  private void promoteType(ASTNode operationNode) {
+    if(operationNode.getTypeToPromoteTo() != null)
+      currentMethod.visitInsn(I2D);
+  }
 }</diff>
      <filename>src/xpl/codegen/CodeGeneratorArithmetic.java</filename>
    </modified>
    <modified>
      <diff>@@ -31,30 +31,32 @@ public class CodeGeneratorMethod extends CodeGeneratorModule {
 
   public void finish(MethodNode definition) {
     Method method = definition.getMethod();
-    if(method.getReturnType().equals(Types.Integer))
+    if(method.getReturnType().equals(Types.Real))
+      currentMethod.visitInsn(DRETURN);
+    else if(method.getReturnType().equals(Types.Integer))
       currentMethod.visitInsn(IRETURN);
     else if(method.getReturnType().equals(Types.String))
       currentMethod.visitInsn(ARETURN);
     else
       currentMethod.visitInsn(RETURN);
-    currentMethod.visitMaxs(10, method.getArity() + 1);
+    currentMethod.visitMaxs(10, method.getLocalsSize());
     context.switchMethodVisitor(methods.pop());
   }
 
-  public void prepareCall() {
-    currentMethod.visitVarInsn(ALOAD, 0);
+  public void prepareCall(MethodNode call) {
+    Method method = call.getMethod();
+ 
+    if(!method.isBuiltin())
+      currentMethod.visitVarInsn(ALOAD, 0);
   }
 
   public void call(MethodNode call) {
     Method method    = call.getMethod();
     String name      = method.getName();
 
-    if(method.isBuiltin()) {
+    if(method.isBuiltin())
       currentMethod.visitMethodInsn(INVOKESTATIC, &quot;xpl/runtime/Runtime&quot;, name, method.getSignature());
-      currentMethod.visitInsn(POP);
-    }
-    else {
+    else
       currentMethod.visitMethodInsn(INVOKEVIRTUAL, className, name, method.getSignature());
-    }
   }
 }</diff>
      <filename>src/xpl/codegen/CodeGeneratorMethod.java</filename>
    </modified>
    <modified>
      <diff>@@ -13,7 +13,14 @@ public class CodeGeneratorMisc extends CodeGeneratorModule {
   private int stackDepth = 0;
   public int getStackDepth() { return stackDepth; }
 
-  public void load(int number) { stackDepth += 1; currentMethod.visitLdcInsn(number); }
+  public void load(ASTNode numberNode) {
+    stackDepth += 1;
+    if(numberNode.getNodeType() == Types.Integer)
+      currentMethod.visitLdcInsn(Integer.parseInt(numberNode.getText()));
+    else
+      currentMethod.visitLdcInsn(Double.parseDouble(numberNode.getText()));
+    promoteType(numberNode);
+  }
 
   public void pushThis() {
     currentMethod.visitVarInsn(ALOAD, 0);
@@ -37,6 +44,8 @@ public class CodeGeneratorMisc extends CodeGeneratorModule {
       Argument arg = (Argument) identifier;
       if(arg.getType().equals(Types.Integer))
 	currentMethod.visitVarInsn(ILOAD, arg.getId());
+      else if(arg.getType().equals(Types.Real))
+	currentMethod.visitVarInsn(DLOAD, arg.getId());
       else
 	currentMethod.visitVarInsn(ALOAD, arg.getId());
     }
@@ -45,6 +54,8 @@ public class CodeGeneratorMisc extends CodeGeneratorModule {
       currentMethod.visitVarInsn(ALOAD, 0);
       currentMethod.visitFieldInsn(GETFIELD, className, var.getVariableId(), var.typeSignature());
     }
+
+    promoteType(node);
   }
 
   public void finish() {
@@ -52,4 +63,9 @@ public class CodeGeneratorMisc extends CodeGeneratorModule {
     currentMethod.visitMaxs(10, 1);
     currentMethod.visitEnd();
   }
+
+  private void promoteType(ASTNode operationNode) {
+    if(operationNode.getTypeToPromoteTo() != null)
+      currentMethod.visitInsn(I2D);
+  }
 }</diff>
      <filename>src/xpl/codegen/CodeGeneratorMisc.java</filename>
    </modified>
    <modified>
      <diff>@@ -9,6 +9,14 @@ public class Runtime {
     System.out.println(i);
   }
 
+  public static void print(double d) {
+    System.out.println(d);
+  }
+
+  public static double sqrt(double x) {
+    return Math.sqrt(x);
+  }
+
   public static int power(int n, int pow) {
     if(pow == 0)
       return 1;</diff>
      <filename>src/xpl/runtime/Runtime.java</filename>
    </modified>
    <modified>
      <diff>@@ -28,7 +28,6 @@ options {
 
     private void error(TreeNodeStream input, int line, String message) throws RecognitionException {
         errors.add(&quot;Line &quot; + line + &quot;: &quot; + message);
-        throw new RecognitionException(input);
     }
 }
 
@@ -54,13 +53,17 @@ method_header returns [Method method]
             Type[]         argumentTypes  = new Type[$args.size()];
             TypeNode       returnTypeNode = (TypeNode) $return_type;
 
+            int argId = 1;
+
             for(int i = 0; i &lt; $args.size(); i++) {
                 ASTNode  idNode   = (ASTNode)  $args.get(i);
                 TypeNode typeNode = (TypeNode) $types.get(i);
+                Type     type     = typeNode.getRepresentedType();
 
-                Type type = typeNode.getRepresentedType();
-                arguments.add(new Argument(symbolTable.getNextScopeId(), type, idNode.getText(), i+1));
+                arguments.add(new Argument(symbolTable.getNextScopeId(), type, idNode.getText(), argId));
                 argumentTypes[i] = type;
+
+                argId += (type == Types.Real ? 2 : 1);
             }
 
             Method method = new Method(symbolTable.getCurrentScopeId(), returnTypeNode.getRepresentedType(), $name.text, argumentTypes);
@@ -73,8 +76,11 @@ method_header returns [Method method]
 
 conditional
     :  ^(IF expression ^(PROGN atomic_operation+) (^(PROGN atomic_operation+) {
-                $conditional.start.hasElse = true;
-            })?);
+                System.out.println(&quot;Setting hasElse on true&quot;);
+                $start.hasElse = true;
+            })?) {
+            System.out.println(&quot;Processing conditional&quot;);
+        };
 
 loop
     :  ^(WHILE expression ^(PROGN atomic_operation+));
@@ -131,6 +137,10 @@ comparision_expression
 binary_expression
     :  ^(('-' | '*' | '/' | '%') a=binary_expression b=binary_expression) {
             TypeChecker.infer($start, $a.start, $b.start);
+            if($start.isOf(Types.Real) &amp;&amp; !$a.start.isOf(Types.Real))
+                $a.start.setTypeToPromoteTo(Types.Real);
+            if($start.isOf(Types.Real) &amp;&amp; !$b.start.isOf(Types.Real))
+                $b.start.setTypeToPromoteTo(Types.Real);
         }
     |  addition {
             $start.setNodeType($addition.start.getNodeType());
@@ -146,6 +156,10 @@ binary_expression
 addition
     : ^('+' a=addition_flatten b=addition_flatten) {
             TypeChecker.infer($start, $a.start, $b.start);
+            if($start.isOf(Types.Real) &amp;&amp; !$a.start.isOf(Types.Real))
+                $a.start.setTypeToPromoteTo(Types.Real);
+            if($start.isOf(Types.Real) &amp;&amp; !$b.start.isOf(Types.Real))
+                $b.start.setTypeToPromoteTo(Types.Real);
         }
         -&gt; {$start.isOf(Types.String)}? ^(STRING_PLUS&lt;ASTNode&gt;[Types.String] addition_flatten+)
         -&gt; ^('+' addition_flatten+)
@@ -161,8 +175,11 @@ addition_flatten
     ;
 
 atom
-    :  NUMBER {
-            $NUMBER.setNodeType(Types.Integer);
+    :  REAL {
+            $REAL.setNodeType(Types.Real);
+       }
+    |  INTEGER {
+            $INTEGER.setNodeType(Types.Integer);
         }
     |  STRING {
             $STRING.setNodeType(Types.String);</diff>
      <filename>src/xpl/semantic/SemanticAnalysis.g</filename>
    </modified>
    <modified>
      <diff>@@ -22,13 +22,16 @@ public class SymbolTable {
   public SymbolTable() {
     enterScope();
 
+    put(new Method(0, Types.Void,    &quot;print&quot;, new Type[] { Types.Real }, true));
     put(new Method(0, Types.Void,    &quot;print&quot;, new Type[] { Types.String  }, true));
     put(new Method(0, Types.Void,    &quot;print&quot;, new Type[] { Types.Integer }, true));
     put(new Method(0, Types.Integer, &quot;power&quot;, new Type[] { Types.Integer, Types.Integer }, true));
+    put(new Method(0, Types.Real,    &quot;sqrt&quot;,  new Type[] { Types.Real }, true));
   }
 
   /**
    * Creates a new scope and enters it
+   *
    * @param scopeId The id to give to the newly created scope
    */
   public void enterScope() {</diff>
      <filename>src/xpl/semantic/SymbolTable.java</filename>
    </modified>
    <modified>
      <diff>@@ -13,6 +13,9 @@ public class Type {
   public  String getName() { return name; }
 
   public String getSignature() {
+    if(name.equals(&quot;real&quot;))
+      return &quot;D&quot;;
+    
     if(name.equals(&quot;integer&quot;))
       return &quot;I&quot;;
 </diff>
      <filename>src/xpl/semantic/Type.java</filename>
    </modified>
    <modified>
      <diff>@@ -5,24 +5,28 @@ import xpl.semantic.ast.*;
 import java.util.*;
 
 public class TypeChecker {
-    public static void infer(ASTNode deduced, final ASTNode a, final ASTNode b) {
-        if(a.isOf(Types.String) || b.isOf(Types.String))
-            deduced.setNodeType(Types.String);
-        else
-            deduced.setNodeType(Types.Integer);
-    }
+  public static void infer(ASTNode deduced, final ASTNode a, final ASTNode b) {
+    if(a.isOf(Types.String) || b.isOf(Types.String))
+      deduced.setNodeType(Types.String);
+    else if(a.isOf(Types.Real) || b.isOf(Types.Real))
+      deduced.setNodeType(Types.Real);
+    else
+      deduced.setNodeType(Types.Integer);
+  }
 
-    public static void infer(ASTNode deduced, final List&lt;ASTNode&gt; list) {
-        if(containsString(list))
-            deduced.setNodeType(Types.String);
-        else
-            deduced.setNodeType(Types.Integer);
-    }
+  public static void infer(ASTNode deduced, final List&lt;ASTNode&gt; list) {
+    if(containsType(list, Types.String))
+      deduced.setNodeType(Types.String);
+    else if(containsType(list, Types.Real))
+      deduced.setNodeType(Types.Real);
+    else
+      deduced.setNodeType(Types.Integer);
+  }
 
-    private static boolean containsString(final List&lt;ASTNode&gt; astNodes) {
-        for(ASTNode node : astNodes)
-            if(node.isOf(Types.String))
-                return true;
-        return false;
-    }
+  private static boolean containsType(final List&lt;ASTNode&gt; astNodes, Type type) {
+    for(ASTNode node : astNodes)
+      if(node.isOf(type))
+	return true;
+    return false;
+  }
 }</diff>
      <filename>src/xpl/semantic/TypeChecker.java</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,7 @@
 package xpl.semantic;
 
 public class Types {
+  public static Type Real    = new Type(&quot;real&quot;);
   public static Type Integer = new Type(&quot;integer&quot;);
   public static Type String  = new Type(&quot;string&quot;);
   public static Type Void    = new Type(&quot;void&quot;);</diff>
      <filename>src/xpl/semantic/Types.java</filename>
    </modified>
    <modified>
      <diff>@@ -27,5 +27,9 @@ public class ASTNode extends CommonTree {
   public  void setNodeType(Type nodeType) { this.nodeType = nodeType; }
   public  boolean isOf(Type nodeType)     { return this.nodeType != null &amp;&amp; this.nodeType.equals(nodeType); }
 
+  private Type typeToPromoteTo;
+  public  void setTypeToPromoteTo(Type type) { this.typeToPromoteTo = type; }
+  public  Type getTypeToPromoteTo()          { return typeToPromoteTo; }
+
   public boolean hasElse = false;
 }</diff>
      <filename>src/xpl/semantic/ast/ASTNode.java</filename>
    </modified>
    <modified>
      <diff>@@ -10,7 +10,9 @@ public class TypeNode extends ASTNode {
   public TypeNode(Token tok) {
     super(tok);
 
-    if(tok.getText().equals(&quot;int&quot;))
+    if(tok.getText().equals(&quot;real&quot;))
+      representedType = Types.Real;
+    else if(tok.getText().equals(&quot;int&quot;))
       representedType = Types.Integer;
     else if(tok.getText().equals(&quot;string&quot;))
       representedType = Types.String;</diff>
      <filename>src/xpl/semantic/ast/TypeNode.java</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,7 @@
 package xpl.semantic.symbols;
 
 import xpl.semantic.Type;
+import xpl.semantic.Types;
 
 public class Method extends Symbol {
   public Method(int scopeId, Type returnType, String name, Type[] argumentTypes) {
@@ -24,6 +25,17 @@ public class Method extends Symbol {
   public  Type[] getArgumentTypes() { return argumentTypes; }
   public  int    getArity() { return argumentTypes.length; }
 
+  public int getLocalsSize() {
+    int localsSize = 1;
+    for(Type type : argumentTypes) {
+      if(type == Types.Real)
+	localsSize += 2;
+      else
+	localsSize += 1;
+    }
+    return localsSize;
+  }
+
   public String getArgumentsSignature() {
     String result = &quot;&quot;;
     for(Type type : argumentTypes)</diff>
      <filename>src/xpl/semantic/symbols/Method.java</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5adff71b11c76e9bc1a4f9e7ab177912007548ce</id>
    </parent>
  </parents>
  <author>
    <name>sztywny</name>
    <email>sztywny@gmail.com</email>
  </author>
  <url>http://github.com/sztywny/xpl/commit/3ee88c05ff11e2eafbd7941c760b5f46d375f8ff</url>
  <id>3ee88c05ff11e2eafbd7941c760b5f46d375f8ff</id>
  <committed-date>2008-12-21T13:01:15-08:00</committed-date>
  <authored-date>2008-12-21T13:01:15-08:00</authored-date>
  <message>Basic real numbers support added.</message>
  <tree>67493eb4c5e6520be4b1ef5ccf9c188049a05657</tree>
  <committer>
    <name>sztywny</name>
    <email>sztywny@gmail.com</email>
  </committer>
</commit>
