Skip to main content

PhpTokenType

Enum PhpTokenType 

Source
pub enum PhpTokenType {
Show 176 variants Whitespace, Newline, Comment, StringLiteral, NumberLiteral, BooleanLiteral, NullLiteral, Identifier, Variable, Abstract, And, Array, As, Break, Callable, Case, Catch, Class, Clone, Const, Continue, Declare, Default, Do, Echo, Else, Elseif, Empty, Enddeclare, Endfor, Endforeach, Endif, Endswitch, Endwhile, Eval, Exit, Extends, Final, Finally, For, Foreach, Function, Global, Goto, If, Implements, Include, IncludeOnce, Instanceof, Insteadof, Interface, Isset, List, Namespace, New, Or, Print, Private, Protected, Public, Require, RequireOnce, Return, Static, Switch, Throw, Trait, Try, Unset, Use, Var, While, Xor, Yield, YieldFrom, Plus, Minus, Multiply, Divide, Modulo, Power, Concat, Equal, Identical, NotEqual, NotIdentical, Less, Greater, LessEqual, GreaterEqual, Spaceship, LogicalAnd, LogicalOr, LogicalXor, LogicalNot, BitwiseAnd, BitwiseOr, BitwiseXor, BitwiseNot, LeftShift, RightShift, Assign, PlusAssign, MinusAssign, MultiplyAssign, DivideAssign, ModuloAssign, PowerAssign, ConcatAssign, BitwiseAndAssign, BitwiseOrAssign, BitwiseXorAssign, LeftShiftAssign, RightShiftAssign, Increment, Decrement, Arrow, DoubleArrow, NullCoalesce, NullCoalesceAssign, Ellipsis, LeftParen, RightParen, LeftBracket, RightBracket, LeftBrace, RightBrace, Semicolon, Comma, Dot, Question, Colon, DoubleColon, Backslash, At, Dollar, OpenTag, CloseTag, EchoTag, Eof, Error, Root, ClassDef, FunctionDef, MethodDef, PropertyDef, ConstDef, TraitDef, InterfaceDef, NamespaceDef, UseStatement, IfStatement, WhileStatement, DoWhileStatement, ForStatement, ForeachStatement, SwitchStatement, TryStatement, CatchBlock, FinallyBlock, ExpressionStatement, ReturnStatement, ThrowStatement, BreakStatement, ContinueStatement, EchoStatement, GlobalStatement, StaticStatement, UnsetStatement, CompoundStatement, Literal, ParenthesizedExpression, CallExpression, ArrayAccessExpression, MemberAccessExpression, BinaryExpression,
}
Expand description

Enum representing all possible token types in PHP

Variants§

§

Whitespace

Whitespace characters

§

Newline

Newline characters

§

Comment

Comment

§

StringLiteral

String literal

§

NumberLiteral

Number literal

§

BooleanLiteral

Boolean literal (true, false)

§

NullLiteral

Null literal

§

Identifier

Identifier

§

Variable

Variable identifier (starting with $)

§

Abstract

‘abstract’ keyword

§

And

‘and’ operator

§

Array

‘array’ keyword/type

§

As

‘as’ keyword

§

Break

‘break’ keyword

§

Callable

‘callable’ type

§

Case

‘case’ keyword

§

Catch

‘catch’ keyword

§

Class

‘class’ keyword

§

Clone

‘clone’ keyword

§

Const

‘const’ keyword

§

Continue

‘continue’ keyword

§

Declare

‘declare’ keyword

§

Default

‘default’ keyword

§

Do

‘do’ keyword

§

Echo

‘echo’ keyword

§

Else

‘else’ keyword

§

Elseif

‘elseif’ keyword

§

Empty

‘empty’ keyword

§

Enddeclare

‘enddeclare’ keyword

§

Endfor

‘endfor’ keyword

§

Endforeach

‘endforeach’ keyword

§

Endif

‘endif’ keyword

§

Endswitch

‘endswitch’ keyword

§

Endwhile

‘endwhile’ keyword

§

Eval

‘eval’ keyword

§

Exit

‘exit’ keyword

§

Extends

‘extends’ keyword

§

Final

‘final’ keyword

§

Finally

‘finally’ keyword

§

For

‘for’ keyword

§

Foreach

‘foreach’ keyword

§

Function

‘function’ keyword

§

Global

‘global’ keyword

§

Goto

‘goto’ keyword

§

If

‘if’ keyword

§

Implements

‘implements’ keyword

§

Include

‘include’ keyword

§

IncludeOnce

‘include_once’ keyword

§

Instanceof

‘instanceof’ operator

§

Insteadof

‘insteadof’ keyword

§

Interface

‘interface’ keyword

§

Isset

‘isset’ keyword

§

List

‘list’ keyword

§

Namespace

‘namespace’ keyword

§

New

‘new’ keyword

§

Or

‘or’ operator

§

Print

‘print’ keyword

§

Private

‘private’ keyword

§

Protected

‘protected’ keyword

§

Public

‘public’ keyword

§

Require

‘require’ keyword

§

RequireOnce

‘require_once’ keyword

§

Return

‘return’ keyword

§

Static

‘static’ keyword

§

Switch

‘switch’ keyword

§

Throw

‘throw’ keyword

§

Trait

‘trait’ keyword

§

Try

‘try’ keyword

§

Unset

‘unset’ keyword

§

Use

‘use’ keyword

§

Var

‘var’ keyword

§

While

‘while’ keyword

§

Xor

‘xor’ operator

§

Yield

‘yield’ keyword

§

YieldFrom

‘yield from’ keyword

§

Plus

Plus operator (+)

§

Minus

Minus operator (-)

§

Multiply

Multiply operator (*)

§

Divide

Divide operator (/)

§

Modulo

Modulo operator (%)

§

Power

Power operator (**)

§

Concat

Concatenation operator (.)

§

Equal

Equality operator (==)

§

Identical

Identity operator (===)

§

NotEqual

Inequality operator (!= or <>)

§

NotIdentical

Non-identity operator (!==)

§

Less

Less than operator (<)

§

Greater

Greater than operator (>)

§

LessEqual

Less than or equal operator (<=)

§

GreaterEqual

Greater than or equal operator (>=)

§

Spaceship

Spaceship operator (<=>)

§

LogicalAnd

Logical AND operator (&&)

§

LogicalOr

Logical OR operator (||)

§

LogicalXor

Logical XOR operator

§

LogicalNot

Logical NOT operator (!)

§

BitwiseAnd

Bitwise AND operator (&)

§

BitwiseOr

Bitwise OR operator (|)

§

BitwiseXor

Bitwise XOR operator (^)

§

BitwiseNot

Bitwise NOT operator (~)

§

LeftShift

Left shift operator (<<)

§

RightShift

Right shift operator (>>)

§

Assign

Assignment operator (=)

§

PlusAssign

Plus assignment operator (+=)

§

MinusAssign

Minus assignment operator (-=)

§

MultiplyAssign

Multiply assignment operator (*=)

§

DivideAssign

Divide assignment operator (/=)

§

ModuloAssign

Modulo assignment operator (%=)

§

PowerAssign

Power assignment operator (**=)

§

ConcatAssign

Concatenation assignment operator (.=)

§

BitwiseAndAssign

Bitwise AND assignment operator (&=)

§

BitwiseOrAssign

Bitwise OR assignment operator (|=)

§

BitwiseXorAssign

Bitwise XOR assignment operator (^=)

§

LeftShiftAssign

Left shift assignment operator (<<=)

§

RightShiftAssign

Right shift assignment operator (>>=)

§

Increment

Increment operator (++)

§

Decrement

Decrement operator (–)

§

Arrow

Object member access operator (->)

§

DoubleArrow

Array element arrow (=>)

§

NullCoalesce

Null coalescing operator (??)

§

NullCoalesceAssign

Null coalescing assignment operator (??=)

§

Ellipsis

Ellipsis operator (…)

§

LeftParen

Left parenthesis (()

§

RightParen

Right parenthesis ())

§

LeftBracket

Left bracket ([)

§

RightBracket

Right bracket (])

§

LeftBrace

Left brace ({)

§

RightBrace

Right brace (})

§

Semicolon

Semicolon (;)

§

Comma

Comma (,)

§

Dot

Dot operator (.)

§

Question

Question mark (?)

§

Colon

Colon operator (:)

§

DoubleColon

Scope resolution operator (::)

§

Backslash

Backslash ()

§

At

Error suppression operator (@)

§

Dollar

Dollar sign ($)

§

OpenTag

PHP opening tag (<?php)

§

CloseTag

PHP closing tag (?>)

§

EchoTag

PHP echo tag (<?=)

§

Eof

End of file

§

Error

Error token

§

Root

Root node of the document

§

ClassDef

Class definition

§

FunctionDef

Function definition

§

MethodDef

Method definition

§

PropertyDef

Property definition

§

ConstDef

Constant definition

§

TraitDef

Trait definition

§

InterfaceDef

Interface definition

§

NamespaceDef

Namespace definition

§

UseStatement

Use statement

§

IfStatement

If statement

§

WhileStatement

While statement

§

DoWhileStatement

Do-while statement

§

ForStatement

For statement

§

ForeachStatement

Foreach statement

§

SwitchStatement

Switch statement

§

TryStatement

Try statement

§

CatchBlock

Catch block

§

FinallyBlock

Finally block

§

ExpressionStatement

Expression statement

§

ReturnStatement

Return statement

§

ThrowStatement

Throw statement

§

BreakStatement

Break statement

§

ContinueStatement

Continue statement

§

EchoStatement

Echo statement

§

GlobalStatement

Global statement

§

StaticStatement

Static statement

§

UnsetStatement

Unset statement

§

CompoundStatement

Compound statement (block)

§

Literal

Literal expression

§

ParenthesizedExpression

Parenthesized expression

§

CallExpression

Function or method call

§

ArrayAccessExpression

Array access expression

§

MemberAccessExpression

Member access expression

§

BinaryExpression

Binary expression

Implementations§

Source§

impl PhpTokenType

Source

pub fn is_token(&self) -> bool

Checks if this syntax kind represents a token (leaf node).

Source§

impl PhpTokenType

Source

pub fn is_element(&self) -> bool

Checks if this syntax kind represents a composite element (non-leaf node).

Trait Implementations§

Source§

impl Clone for PhpTokenType

Source§

fn clone(&self) -> PhpTokenType

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PhpTokenType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for PhpTokenType

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<PhpTokenType> for PhpElementType

Source§

fn from(token: PhpTokenType) -> Self

Converts to this type from the input type.
Source§

impl Hash for PhpTokenType

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for PhpTokenType

Source§

fn eq(&self, other: &PhpTokenType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for PhpTokenType

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TokenType for PhpTokenType

Source§

const END_OF_STREAM: Self = Self::Eof

A constant representing the end of the input stream.
Source§

type Role = UniversalTokenRole

The associated role type for this token kind.
Source§

fn is_ignored(&self) -> bool

Returns true if this token represents trivia (whitespace, comments, etc.).
Source§

fn role(&self) -> Self::Role

Returns the general syntactic role of this token. Read more
Source§

fn is_role(&self, role: Self::Role) -> bool

Returns true if this token matches the specified language-specific role.
Source§

fn is_universal(&self, role: UniversalTokenRole) -> bool

Returns true if this token matches the specified universal role.
Source§

fn is_comment(&self) -> bool

Returns true if this token represents a comment.
Source§

fn is_whitespace(&self) -> bool

Returns true if this token represents whitespace.
Source§

fn is_error(&self) -> bool

Returns true if this token represents an error condition.
Source§

fn is_end_of_stream(&self) -> bool

Returns true if this token represents the end of the input stream.
Source§

impl Copy for PhpTokenType

Source§

impl Eq for PhpTokenType

Source§

impl StructuralPartialEq for PhpTokenType

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,