/** * Copyright 2017 Matt Acosta * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * A list of possible token types. */ export declare enum TokenKind { Unknown = 0, Error = 1, Abstract = 2, Array = 3, As = 4, Break = 5, Callable = 6, Case = 7, Catch = 8, Class = 9, Clone = 10, Const = 11, Continue = 12, Declare = 13, Default = 14, Die = 15, Do = 16, Echo = 17, Else = 18, ElseIf = 19, Empty = 20, EndDeclare = 21, EndFor = 22, EndForEach = 23, EndIf = 24, EndSwitch = 25, EndWhile = 26, Eval = 27, Exit = 28, Extends = 29, Final = 30, Finally = 31, Fn = 32, For = 33, ForEach = 34, Function = 35, Global = 36, GoTo = 37, HaltCompiler = 38, If = 39, Implements = 40, Include = 41, IncludeOnce = 42, InstanceOf = 43, InsteadOf = 44, Interface = 45, IsSet = 46, List = 47, LogicalAnd = 48, LogicalOr = 49, LogicalXor = 50, MagicClass = 51, MagicDirectory = 52, MagicFile = 53, MagicFunction = 54, MagicLine = 55, MagicMethod = 56, MagicNamespace = 57, MagicTrait = 58, Namespace = 59, New = 60, Print = 61, Private = 62, Protected = 63, Public = 64, Require = 65, RequireOnce = 66, Return = 67, Static = 68, Switch = 69, Throw = 70, Trait = 71, Try = 72, While = 73, Unset = 74, Use = 75, Var = 76, Yield = 77, Ampersand = 78, Asterisk = 79, At = 80, BackQuote = 81, Backslash = 82, Caret = 83, CloseBrace = 84, CloseBracket = 85, CloseParen = 86, Colon = 87, Comma = 88, Dollar = 89, DoubleQuote = 90, Equal = 91, Exclamation = 92, GreaterThan = 93, LessThan = 94, Minus = 95, OpenBrace = 96, OpenBracket = 97, OpenParen = 98, Percent = 99, Period = 100, Plus = 101, Question = 102, Semicolon = 103, SingleQuote = 104, Slash = 105, Tilde = 106, VerticalBar = 107, AndEqual = 108, BooleanAnd = 109, BooleanOr = 110, Coalesce = 111, CoalesceEqual = 112, ConcatEqual = 113, Decrement = 114, DivideEqual = 115, DollarOpenBrace = 116, DoubleArrow = 117, DoubleColon = 118, Ellipsis = 119, Increment = 120, Inequality = 121, IsEqual = 122, IsGreaterThanOrEqual = 123, IsIdentical = 124, IsLessThanOrEqual = 125, IsNotEqual = 126, IsNotIdentical = 127, MinusEqual = 128, ModEqual = 129, MultiplyEqual = 130, ObjectOperator = 131, OpenBraceDollar = 132, OrEqual = 133, PlusEqual = 134, Pow = 135, PowEqual = 136, ShiftLeft = 137, ShiftLeftEqual = 138, ShiftRight = 139, ShiftRightEqual = 140, Spaceship = 141, XorEqual = 142, CloseTag = 143, OpenTagWithEcho = 144, EOF = 145, ArrayCast = 146, BinaryCast = 147, BoolCast = 148, BooleanCast = 149, DoubleCast = 150, FloatCast = 151, IntCast = 152, IntegerCast = 153, ObjectCast = 154, RealCast = 155, StringCast = 156, UnsetCast = 157, YieldFrom = 158, DNumber = 159, FlexdocTemplate = 160, HeredocEnd = 161, HeredocStart = 162, HeredocTemplate = 163, Identifier = 164, InlineText = 165, LNumber = 166, ShellCommandTemplate = 167, StringIdentifier = 168, StringIndent = 169, StringLineBreak = 170, StringLiteral = 171, StringNumber = 172, StringTemplate = 173, StringTemplateLiteral = 174, Variable = 175, ConflictMarkerEnd = 176, ConflictMarkerStart = 177, DocumentationComment = 178, ElasticSpace = 179, ElasticTab = 180, LineBreak = 181, MultipleLineComment = 182, OpenTag = 183, RegionEnd = 184, RegionStart = 185, ShortOpenTag = 186, SingleLineComment = 187, Whitespace = 188 } /** * Useful methods that return information about the various types of tokens. */ export declare class TokenKindInfo { /** * Gets the text representation of a language-defined token kind, or the * machine name of a user-defined token kind. */ static getText(kind: TokenKind): string; /** * Determines if the token kind represents punctuation. */ static isPunctuation(kind: TokenKind): boolean; /** * Determines if the token kind represents a semi-reserved keyword. */ static isSemiReservedKeyword(kind: TokenKind): boolean; /** * Determines if the token kind is non-essential. */ static isTrivia(kind: TokenKind): boolean; }