uk.ac.man.cs.rainbow.compiler.expressions
Class IntConst

java.lang.Object
  |
  +--uk.ac.man.cs.rainbow.compiler.CompilerThing
        |
        +--uk.ac.man.cs.rainbow.compiler.CompilerNode
              |
              +--uk.ac.man.cs.rainbow.compiler.expressions.Expression
                    |
                    +--uk.ac.man.cs.rainbow.compiler.expressions.Constant
                          |
                          +--uk.ac.man.cs.rainbow.compiler.expressions.IntConst
All Implemented Interfaces:
Cloneable, Serializable

public class IntConst
extends Constant

Integer constant. An integer constant k has type k..k, since we want to be able to assign it to a variable of an appropriate subrange.

See Also:
Serialized Form

Fields inherited from class uk.ac.man.cs.rainbow.compiler.CompilerNode
next, sourcepos
 
Constructor Summary
IntConst(SourcePosition sourcepos, CompilerType spec, int value)
           
IntConst(SourcePosition sourcepos, int value)
           
 
Method Summary
 boolean equals(Expression e)
          Integer constants equal iff their valuation is equal.
 int getValue()
           
 RASMList rasm(CGEnv env)
           
 String toString()
           
 Expression typecheckExpr(TCEnv env, Errors errors, CompilerType expected, String context)
           
 
Methods inherited from class uk.ac.man.cs.rainbow.compiler.expressions.Constant
reduce_to_constant
 
Methods inherited from class uk.ac.man.cs.rainbow.compiler.expressions.Expression
check_nominal, cloneExpression, cloneExpressionNoParent, getSpec, map_accumulate_reduce_to_constant, reduce_to_integer_constant, setSpec, size_allowing_for_repeats, specList, typecheckExprList
 
Methods inherited from class uk.ac.man.cs.rainbow.compiler.CompilerNode
append, appendNotParent, dumpNode, dumpTree, getParent, indent, iterator, list_typecheck, list_typecheck, listLength, listToString, noParent, rasm_list, rasm, setParent, typecheck, typecheck, typecheckGreen, typecheckGreen
 
Methods inherited from class uk.ac.man.cs.rainbow.compiler.CompilerThing
className, crashHere, getSerial
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IntConst

public IntConst(SourcePosition sourcepos,
                CompilerType spec,
                int value)

IntConst

public IntConst(SourcePosition sourcepos,
                int value)
Method Detail

toString

public String toString()
Overrides:
toString in class Expression

typecheckExpr

public Expression typecheckExpr(TCEnv env,
                                Errors errors,
                                CompilerType expected,
                                String context)
Overrides:
typecheckExpr in class Expression

rasm

public RASMList rasm(CGEnv env)
Overrides:
rasm in class CompilerNode

equals

public boolean equals(Expression e)
Integer constants equal iff their valuation is equal.

getValue

public int getValue()