本文整理汇总了PHP中Method::set_abstract方法的典型用法代码示例。如果您正苦于以下问题:PHP Method::set_abstract方法的具体用法?PHP Method::set_abstract怎么用?PHP Method::set_abstract使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Method
的用法示例。
在下文中一共展示了Method::set_abstract方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parse_class
public function parse_class()
{
$class_annotation = $this->last_annotation;
$this->last_annotation = null;
// abstract class
$abstract = false;
$final = false;
while ($this->at(array(T_ABSTRACT, T_FINAL))) {
if ($this->at(T_ABSTRACT)) {
$abstract = true;
} else {
$final = true;
}
$this->accept();
$this->s();
}
// class
$this->accept(T_CLASS);
$this->s();
$class = new ClassDef($this->parse_ident());
$class->set_abstract($abstract);
$class->set_namespace($this->namespace);
if ($class_annotation) {
$class->set_annotation($class_annotation);
}
$this->s();
// superclass
if ($this->at(T_EXTENDS)) {
$this->accept();
$this->s();
$class->extend($this->parse_ident());
$this->s();
}
// interfaces
$req = T_IMPLEMENTS;
while ($this->at($req)) {
$this->accept();
$this->s();
$class->implement($this->parse_ident());
$this->s();
$req = ',';
}
$this->s();
$this->accept('{');
// forward declarations: before
Forward::apply('before', $class);
// const, var, methods, eval, mixin
$this->s();
while ($this->at_class_part()) {
if ($this->at(T_CONST)) {
$this->accept();
$this->s();
$ident = $this->parse_ident();
$this->s();
$this->accept('=');
$this->s();
$class->define_constant($ident, $this->parse_value());
$this->s();
$this->accept(';');
} elseif ($this->at_qualifier()) {
$member_annotation = $this->last_annotation;
$this->last_annotation = null;
$access = 'public';
$static = false;
$abstract = false;
$final = false;
while ($this->at_qualifier()) {
switch ($this->current_token()) {
case T_PUBLIC:
$access = 'public';
break;
case T_PRIVATE:
$access = 'private';
break;
case T_PROTECTED:
$access = 'protected';
break;
case T_STATIC:
$static = true;
break;
case T_FINAL:
$final = true;
break;
case T_ABSTRACT:
$abstract = true;
break;
}
$this->accept();
$this->s();
}
if ($this->at(T_VARIABLE)) {
$variable = $this->parse_variable($access, $static);
if ($member_annotation) {
$variable->set_annotation($member_annotation);
}
$class->add_variable($variable);
$this->s();
if ($this->at(T_IMPLEMENTS)) {
$this->accept();
$this->s();
//.........这里部分代码省略.........