org.objectweb.medor.expression.type
Class ExpressionTypeHelper

java.lang.Object
  extended byorg.objectweb.medor.expression.type.ExpressionTypeHelper

public class ExpressionTypeHelper
extends java.lang.Object

Author:
A. Lefebvre

Constructor Summary
ExpressionTypeHelper()
           
 
Method Summary
static org.objectweb.jorm.type.api.PType getResultType(org.objectweb.jorm.type.api.PType type1, org.objectweb.jorm.type.api.PType type2)
          This method returns the type which would result from applying a binary operator to 2 objects of given PType.
static boolean isArithmeticType(org.objectweb.jorm.type.api.PType t)
          This method tells if a given Type is an arithmetic type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionTypeHelper

public ExpressionTypeHelper()
Method Detail

isArithmeticType

public static final boolean isArithmeticType(org.objectweb.jorm.type.api.PType t)
This method tells if a given Type is an arithmetic type

Parameters:
t - The PType to be checked.
Returns:
true if the tested PType is an arithmetic type.

getResultType

public static org.objectweb.jorm.type.api.PType getResultType(org.objectweb.jorm.type.api.PType type1,
                                                              org.objectweb.jorm.type.api.PType type2)
                                                       throws TypingException
This method returns the type which would result from applying a binary operator to 2 objects of given PType. If the two PTypes are incompatible, a TypingException is thrown.

Parameters:
type1 - The PType of the first object.
type2 - The PType of the second object.
Returns:
The PType of the result.
Throws:
TypingException