Example #1
0
 /**
  * Checks this type is compactible with another type
  * Note: implementation of IType::isCompatibleWith
  * 
  * @param IType $type Type to check compactibility
  * 
  * @return boolean 
  */
 public function isCompatibleWith(IType $type)
 {
     switch ($type->getTypeCode()) {
         case TypeCode::BYTE:
         case TypeCode::CHAR:
             return true;
     }
     return false;
 }
Example #2
0
 /**
  * Checks this type (Void) is compactible with another type
  * Note: implementation of IType::isCompatibleWith
  * 
  * @param IType $type Type to check compactibility
  * 
  * @return boolean 
  */
 public function isCompatibleWith(IType $type)
 {
     return $type->getTypeCode() == TypeCode::VOID;
 }
 /**
  * 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();
 }