Create an OperatorNode for the given token type.
@param int|string $token_type
@param bool $static_only
@return Operator
763566
public static function createOperator($token_type, $static_only = FALSE) {
    if (array_key_exists($token_type, self::$operators)) {
      list($assoc, $precedence, $static, $binary_class_name, $unary_class_name) = self::$operators[$token_type];
      if ($static_only && !$static) {
        return NULL;
      }
      $operator = new Operator();
      $operator->type = $token_type;
      $operator->associativity = $assoc;
      $operator->precedence = $precedence;
      $operator->hasBinaryMode = $binary_class_name !== NULL;
      $operator->hasUnaryMode = $unary_class_name !== NULL;
      $operator->binaryClassName = $binary_class_name;
      $operator->unaryClassName = $unary_class_name;
      return $operator;
    }
    return NULL;
  }
195654
private function staticScalar() {
    if ($this->currentType === T_ARRAY) {
      $node = new ArrayNode();
      $this->mustMatch(T_ARRAY, $node);
      $this->mustMatch('(', $node, 'openParen');
      $this->staticArrayPairList($node, ')');
      $this->mustMatch(')', $node, 'closeParen', TRUE);
      return $node;
    }
    elseif ($this->currentType === '[') {
      $node = new ArrayNode();
      $this->mustMatch('[', $node);
      $this->staticArrayPairList($node, ']');
      $this->mustMatch(']', $node, NULL, TRUE);
      return $node;
    }
    else {
      return $this->expr(TRUE);
    }
  }
85686
protected function createNodes(
        Token $token,
        BoolOperator $boolOperator,
        ?ComparisonOperator $comparisonOperator = null
    ): array {
        switch ($token->getType()) {
            case Token::T_WORD:
                $nodes = $this->createWord($token->getValue(), $boolOperator);
                break;

            case Token::T_DATE:
                $nodes = $this->createDate($token->getValue(), $boolOperator, $comparisonOperator);
                break;

            case Token::T_EMOJI:
                $nodes = $this->createEmoji($token->getValue(), $boolOperator);
                break;

            case Token::T_EMOTICON:
                $nodes = $this->createEmoticon($token->getValue(), $boolOperator);
                break;

            case Token::T_FIELD_START:
                $nodes = $this->handleField($token->getValue(), $boolOperator);
                break;

            case Token::T_HASHTAG:
                $nodes = $this->createHashtag($token->getValue(), $boolOperator);
                break;

            case Token::T_MENTION:
                $nodes = $this->createMention($token->getValue(), $boolOperator);
                break;

            case Token::T_NUMBER:
                $nodes = $this->createNumber($token->getValue(), $comparisonOperator);
                break;

            case Token::T_PHRASE:
                $nodes = $this->createPhrase($token->getValue(), $boolOperator);
                break;

            case Token::T_SUBQUERY_START:
                $nodes = $this->handleSubquery($boolOperator);
                break;

            case Token::T_URL:
                $nodes = $this->createUrl($token->getValue(), $boolOperator);
                break;

            default:
                $nodes = [];
                break;
        }

        return $nodes instanceof Node ? [$nodes] : $nodes;
    }
317787
public static function factory($type = null, $text = null, $length = null, $value = null)
    {
        $token = new static();
        if (null !== $type) {
            $token->setType($type);
        }
        if (null !== $text) {
            $token->setText($text);
        }
        if (null !== $length) {
            $token->setLength($length);
        }
        if (null !== $value) {
            $token->setValue($value);
        }
        return $token;
    }
85290
private function createTokenNode($tokenName, $defaultClass, $tokenInterface, $defaultTtl)
    {
        $builder = new TreeBuilder();
        $node = $builder->root($tokenName);
        $node
            ->addDefaultsIfNotSet()
            ->children()
                ->integerNode('ttl')
                    ->defaultValue($defaultTtl)
                ->end()
                ->scalarNode('class')
                    ->cannotBeEmpty()
                    ->defaultValue($defaultClass)
                    ->validate()
                        ->ifTrue(function ($accessTokenClass) use ($tokenInterface) {
                            return !(
                                class_exists($accessTokenClass, true)
                                && (new \ReflectionClass($accessTokenClass))
                                    ->implementsInterface($tokenInterface)
                            );
                        })
                        ->thenInvalid(sprintf(
                            'Provided access_token configuration has to be a valid class which implements %s.',
                            $tokenInterface
                        ))
                    ->end()
                ->end()
                ->append($this->createDriverStrategyNode('loader'))
                ->append($this->createDriverStrategyNode('repository'))
            ->end()
        ;

        return $node;
    }
1054715
private Node parseTypeofType(JsDocToken token) {
    Node typeofType = newNode(Token.TYPEOF);
    Node name = parseNameExpression(token);
    skipEOLs();
    typeofType.addChildToFront(name);
    return typeofType;
  }
543788
public static function get_by_oauth_token($oauth_token) {
	$mysql = bootstrap::get_library('mysql');
	
	$sql   = "SELECT * FROM `login_github` WHERE `oauth_token` = '%s';";
	$login = $mysql::select('row', $sql, $oauth_token);
	if (empty($login)) {
		return false;
	}
	
	return new static($login['id']);
}
392415
static Parser parser(Node node) {
        Document doc = node.ownerDocument();
        return doc != null && doc.parser() != null ? doc.parser() : new Parser(new HtmlTreeBuilder());
    }
934964
static JCTree.Tag unoptag(TokenKind token) {
        switch (token) {
        case PLUS:
            return POS;
        case SUB:
            return NEG;
        case BANG:
            return NOT;
        case TILDE:
            return COMPL;
        case PLUSPLUS:
            return PREINC;
        case SUBSUB:
            return PREDEC;
        default:
            return NO_TAG;
        }
    }
407531
public static function __static()
	{
		InstanceFactsIterator::$itemSubstitutionGroup = array( \XBRL_Constants::$xbrliItem );
		InstanceFactsIterator::$tupleSubstitutionGroup = array( \XBRL_Constants::$xbrliTuple );
		InstanceFactsIterator::$nodeTest = XmlQualifiedNameTest::create( "substitutionGroup" );
	}
802442
private boolean methodIsStaticBuilder(DetailAST methodToken) {
        DetailAST modifierToken = methodToken.findFirstToken(TokenTypes.MODIFIERS);
        if (modifierToken == null) {
            return false;
        }

        if (modifierToken.findFirstToken(TokenTypes.LITERAL_STATIC) == null
            || modifierToken.findFirstToken(TokenTypes.LITERAL_PUBLIC) == null) {
            return false;
        }

        return methodToken.findFirstToken(TokenTypes.IDENT).getText().equals(BUILDER_METHOD_NAME);
    }
221017
public static function __static()
	{
		SchemaTypes::$nameStartChar = "[:_\.\p{Ll}\p{Lu}\p{Lt}\p{Lo}]";
		SchemaTypes::$nameChar = "[:_\-.\p{L}\p{Ll}\p{M}\p{Nd}\p{Nl}]";
		SchemaTypes::$name = SchemaTypes::$nameStartChar .  SchemaTypes::$nameChar . "*";
		SchemaTypes::$ncName = "(?:(?!:)" . SchemaTypes::$nameStartChar. ")(?:(?!:)" . SchemaTypes::$nameChar . ")*";

		// SchemaTypes are organized hierarchically
		// BMS 2018-04-09 Fixing the kluge
		SchemaTypes::$xsTypes = array(
			'xs:anyType'				=> null,
			'xs:anySimpleType'			=> 'xs:anyType',
			'xs:string'					=> 'xs:anySimpleType',
			'xs:boolean'				=> 'xs:anySimpleType',
			'xs:decimal'				=> 'xs:anySimpleType',
			'xs:double'					=> 'xs:anySimpleType',
			'xs:float'					=> 'xs:anySimpleType',
			'xs:duration'				=> 'xs:anySimpleType',
			'xs:dateTime'				=> 'xs:anySimpleType',
			'xs:time'					=> 'xs:anySimpleType',
			'xs:date'					=> 'xs:anySimpleType',
			'xs:gYearMonth'				=> 'xs:anySimpleType',
			'xs:gYear'					=> 'xs:anySimpleType',
			'xs:gMonthDay'				=> 'xs:anySimpleType',
			'xs:gDay'					=> 'xs:anySimpleType',
			'xs:gMonth'					=> 'xs:anySimpleType',
			'xs:hexBinary'				=> 'xs:anySimpleType',
			'xs:base64Binary'			=> 'xs:anySimpleType',
			'xs:anyURI'					=> 'xs:anySimpleType',
			'xs:QName'					=> 'xs:anySimpleType',
			'xs:NOTATION'				=> 'xs:anySimpleType',
			'xs:NOTATION'				=> 'xs:anySimpleType',
			'xs:normalizedString'		=> 'xs:string',
			'xs:token'					=> 'xs:normalizedString',
			'xs:Name'					=> 'xs:token',
			'xs:NCName'					=> 'xs:Name',
			'xs:NMTOKEN'				=> 'xs:token',
			'xs:NMTOKENS'				=> 'xs:NMTOKEN',
			'xs:language'				=> 'xs:token',
			'xs:ID'						=> 'xs:NCName',
			'xs:IDREF'					=> 'xs:NCName',
			'xs:ENTITY'					=> 'xs:NCName',
			'xs:IDREFS'					=> 'xs:IDREF',
			'xs:ENTITIES'				=> 'xs:ENTITY',
			'xs:integer'				=> 'xs:decimal',
			'xs:nonPositiveInteger'		=> 'xs:integer',
			'xs:long'					=> 'xs:integer',
			'xs:nonNegativeInteger'		=> 'xs:integer',
			'xs:negativeInteger' 		=> 'xs:nonPositiveInteger',
			'xs:int'					=> 'xs:long',
			'xs:short'					=> 'xs:int',
			'xs:byte'					=> 'xs:short',
			'xs:positiveInteger' 		=> 'xs:nonNegativeInteger',
			'xs:unsignedLong' 			=> 'xs:nonNegativeInteger',
			'xs:unsignedInt' 			=> 'xs:unsignedLong',
			'xs:unsignedShort'			=> 'xs:unsignedInt',
			'xs:unsignedByte'			=> 'xs:unsignedShort',
			'xs:anyComplexType'			=> 'xs:anyType',
			'xs:untypedAtomic'			=> 'xs:anySimpleType',
			// Not really a type but trying to find an easy way to accommodate
			// unions of simple types such as xbrli:dateTimeItemType
			'xs:UNION'					=> 'xs:anySimpleType',
			'xs:yearMonthDuration'		=> 'xs:duration',
			'xs:dayTimeDuration'		=> 'xs:duration',
		);
	}
275379
public static <T extends Enum<T>> EnumOperation<T> enumOperation(Class<? extends T> type, Operator operator,
                                                                     Expression<?>... args) {
        return new EnumOperation<T>(type, operator, args);
    }
1102875
private function expr($static = FALSE) {
    static $end_expression_types = [':', ';', ',', ')', ']', '}', T_AS, T_DOUBLE_ARROW, T_CLOSE_TAG];
    // Group tokens into operands & operators to pass to the expression parser
    $expression_nodes = [];
    while ($this->currentType !== NULL && !in_array($this->currentType, $end_expression_types)) {
      if ($op = $this->exprOperator($static)) {
        $expression_nodes[] = $op;
        if ($op->type === T_INSTANCEOF) {
          $expression_nodes[] = $this->classNameReference();
        }
      }
      elseif ($operand = ($static ? $this->staticOperand() : $this->exprOperand())) {
        $expression_nodes[] = $operand;
      }
      else {
        throw new ParserException(
          $this->filename,
          $this->iterator->getLineNumber(),
          $this->iterator->getColumnNumber(),
          "invalid expression");
      }
    }
    return $this->expressionParser->parse($expression_nodes, $this->filename);
  }
20226
public static function __static()
	{
		// NameValue::$nameStartChar = "[:_\p{Ll}\p{Lu}\p{Lt}\p{Lo}\p{Nl}]";
		NameValue::$nameStartChar = SchemaTypes::$nameStartChar;
		NameValue::$nameChar = SchemaTypes::$nameChar;
		NameValue::$name = SchemaTypes::$name;
		NameValue::$ncName = SchemaTypes::$ncName;
	}
423931
@Nonnull
  public JSInvocation staticInvoke (@Nullable final AbstractJSClass aType, @Nonnull final String sMethod)
  {
    final JSInvocation aInvocation = new JSInvocation (aType, sMethod);
    return addStatement (aInvocation);
  }
886447
static function parse_string( $src, $unicode = true, $parser = __CLASS__, $lexer = 'JTokenizer' ){
		$Tokenizer = new $lexer( false, $unicode);
		$tokens = $Tokenizer->get_all_tokens( $src );
		unset( $src );
		$Parser = new $parser;
		return $Parser->parse( $tokens );
	}