Example #1
0
 public function __construct($node, $symType)
 {
     if (!$node->symType->isConvertableTo($symType)) {
         SemanticException::invalidTypeCast($node->symType, $symType);
     }
     $this->node = $node;
     $this->symType = $symType;
 }
Example #2
0
 public function __construct($operand, $operator, $_symTable)
 {
     if (!SymSimpleType::equal($operand->symType, Globals::getSimpleType('integer')) && !SymSimpleType::equal($operand->symType, Globals::getSimpleType('real'))) {
         SemanticException::invalidTypeCast($operand->symType, Globals::getSimpleType('real'));
     }
     $this->symType = $operand->symType;
     $this->operand = $operand;
     $this->operator = $operator;
 }