Esempio n. 1
0
 /**
  * Checks this type is compatible with another type
  * Note: implementation of IType::isCompatibleWith
  * 
  * @param IType $type Type to check compatibility
  * 
  * @return boolean 
  */
 public function isCompatibleWith(IType $type)
 {
     switch ($type->getTypeCode()) {
         case TypeCode::BYTE:
         case TypeCode::CHAR:
             return true;
     }
     return false;
 }
Esempio n. 2
0
 /**
  * Checks expression is a specific type
  * 
  * @param IType $type The type to check
  * 
  * @return boolean
  */
 public function typeIs(IType $type)
 {
     return $this->type->getTypeCode() == $type->getTypeCode();
 }
Esempio n. 3
0
 /**
  * Checks this type (Void) is compatible with another type
  * Note: implementation of IType::isCompatibleWith
  * 
  * @param IType $type Type to check compatibility
  * 
  * @return boolean 
  */
 public function isCompatibleWith(IType $type)
 {
     return $type->getTypeCode() == TypeCode::VOID;
 }