es.uned.compiler.intermediate
Class IntermediateCodeBuilder

java.lang.Object
  extended by es.uned.compiler.intermediate.IntermediateCodeBuilder
All Implemented Interfaces:
IntermediateCodeBuilderIF

public class IntermediateCodeBuilder
extends java.lang.Object
implements IntermediateCodeBuilderIF

Clase de ayuda para la construción de cuartetos (Cuadruple)


Constructor Summary
IntermediateCodeBuilder(ScopeIF scope)
          Constructor for IntermediateCodeBuilder.
 
Method Summary
 void addCuadruple(Cuadruple cuadruple)
          Adds a cuadruple to the intermediate code list.
 void addCuadruple(java.lang.String operation, java.lang.Object result)
          Adds a cuadruple to the intermediate code list.
 void addCuadruple(java.lang.String operation, java.lang.Object result, int first)
          Adds a cuadruple to the intermediate code list.
 void addCuadruple(java.lang.String operation, java.lang.Object result, int first, int second)
          Adds a cuadruple to the intermediate code list.
 void addCuadruple(java.lang.String operation, java.lang.Object result, int first, java.lang.Object second)
          Adds a cuadruple to the intermediate code list.
 void addCuadruple(java.lang.String operation, java.lang.Object result, java.lang.Object first)
          Adds a cuadruple to the intermediate code list.
 void addCuadruple(java.lang.String operation, java.lang.Object result, java.lang.Object first, int second)
          Adds a cuadruple to the intermediate code list.
 void addCuadruple(java.lang.String operation, java.lang.Object result, java.lang.Object first, java.lang.Object second)
          Adds a cuadruple to the intermediate code list.
 void addCuadruples(java.util.List cuadruples)
          Adds a list of cuadruple to the intermediate code list.
 java.util.List create()
          Creates the intermediate code list from added cuadruples.
 ScopeIF getScope()
          Returns the scope.
 void setScope(ScopeIF scope)
          Sets The scope.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntermediateCodeBuilder

public IntermediateCodeBuilder(ScopeIF scope)
Constructor for IntermediateCodeBuilder.

Method Detail

addCuadruple

public void addCuadruple(Cuadruple cuadruple)
Adds a cuadruple to the intermediate code list.

Parameters:
cuadruple - The cuadruple to add.

addCuadruple

public void addCuadruple(java.lang.String operation,
                         java.lang.Object result)
Adds a cuadruple to the intermediate code list.

Specified by:
addCuadruple in interface IntermediateCodeBuilderIF
Parameters:
operation - The operation.
result - The result.

addCuadruple

public void addCuadruple(java.lang.String operation,
                         java.lang.Object result,
                         int first)
Adds a cuadruple to the intermediate code list.

Specified by:
addCuadruple in interface IntermediateCodeBuilderIF
Parameters:
operation - The operation.
first - The first operannd.
result - The result.

addCuadruple

public void addCuadruple(java.lang.String operation,
                         java.lang.Object result,
                         int first,
                         int second)
Adds a cuadruple to the intermediate code list.

Specified by:
addCuadruple in interface IntermediateCodeBuilderIF
Parameters:
operation - The operation.
first - The first operannd.
second - The second operand.
result - The result.

addCuadruple

public void addCuadruple(java.lang.String operation,
                         java.lang.Object result,
                         int first,
                         java.lang.Object second)
Adds a cuadruple to the intermediate code list.

Specified by:
addCuadruple in interface IntermediateCodeBuilderIF
Parameters:
operation - The operation.
first - The first operannd.
second - The second operand.
result - The result.

addCuadruple

public void addCuadruple(java.lang.String operation,
                         java.lang.Object result,
                         java.lang.Object first)
Adds a cuadruple to the intermediate code list.

Specified by:
addCuadruple in interface IntermediateCodeBuilderIF
Parameters:
operation - The operation.
first - The first operannd.
result - The result.

addCuadruple

public void addCuadruple(java.lang.String operation,
                         java.lang.Object result,
                         java.lang.Object first,
                         int second)
Adds a cuadruple to the intermediate code list.

Specified by:
addCuadruple in interface IntermediateCodeBuilderIF
Parameters:
operation - The operation.
first - The first operannd.
second - The second operand.
result - The result.

addCuadruple

public void addCuadruple(java.lang.String operation,
                         java.lang.Object result,
                         java.lang.Object first,
                         java.lang.Object second)
Adds a cuadruple to the intermediate code list.

Specified by:
addCuadruple in interface IntermediateCodeBuilderIF
Parameters:
operation - The operation.
first - The first operannd.
second - The second operand.
result - The result.

addCuadruples

public void addCuadruples(java.util.List cuadruples)
Adds a list of cuadruple to the intermediate code list.

Specified by:
addCuadruples in interface IntermediateCodeBuilderIF
Parameters:
cuadruples - The list of cuadruples to add.

create

public java.util.List create()
Creates the intermediate code list from added cuadruples.

Specified by:
create in interface IntermediateCodeBuilderIF
Returns:
a list of cuadruples.

getScope

public ScopeIF getScope()
Returns the scope.

Returns:
Returns the scope.

setScope

public void setScope(ScopeIF scope)
Sets The scope.

Parameters:
scope - The scope to set.