private function makeEnum(Clazz $type, $value)
 {
     $toReturn = new EnumValueCommand($type);
     $toReturn->setValue($value);
     return $toReturn;
 }
 public function endVisitEnum(EnumValueCommand $x, Context $ctx)
 {
     $constantName = $x->getClass()->getConstantNameByValue($x->getValue());
     $fieldName = $this->clientOracle->getFieldId($x->getClass(), $constantName);
     if ($fieldName == null) {
         throw new IncompatibleRemoteServiceException('The client cannot accept ' . $constantName);
     }
     $clinitName = $this->clientOracle->getMethodId($x->getClass(), '$clinit', array());
     assert(!is_null($clinitName));
     // (clinit(), A)
     $this->lparen();
     $this->push($clinitName);
     $this->lparen();
     $this->rparen();
     $this->comma();
     $this->push($fieldName);
     $this->rparen();
 }