Keyword class

The keywords in the Dart programming language.

Clients may not extend, implement or mix-in this class.

Inheritance

Constructors

Keyword(int index, String lexeme, String name, KeywordStyle keywordStyle, {bool isModifier = false, bool isTopLevelKeyword = false, int precedence = NO_PRECEDENCE})
Initialize a newly created keyword.
const

Properties

binaryOperatorOfCompoundAssignment TokenType?
The binary operator that is invoked by this compound assignment operator, or null otherwise.
finalinherited
hashCode int
The hash code for this object.
read-onlyinherited
index int
A unique index identifying this TokenType.
finalinherited
isAdditiveOperator bool
Return true if this type of token represents an additive operator.
read-onlyinherited
isAssignmentOperator bool
Return true if this type of token represents an assignment operator.
read-onlyinherited
isAssociativeOperator bool
Return true if this type of token represents an associative operator. An associative operator is an operator for which the following equality is true: (a * b) * c == a * (b * c). In other words, if the result of applying the operator to multiple operands does not depend on the order in which those applications occur.
read-onlyinherited
isBinaryOperator bool
true if this token type represents a binary operator.
finalinherited
isBuiltIn bool
A flag indicating whether the keyword is a "built-in" identifier.
read-onlyoverride
isBuiltInOrPseudo bool
read-only
isEqualityOperator bool
Return true if this type of token represents an equality operator.
read-onlyinherited
isIncrementOperator bool
Return true if this type of token represents an increment operator.
read-onlyinherited
isKeyword bool
Return true if this type of token is a keyword.
read-onlyinherited
isModifier bool
true if this token type represents a modifier such as abstract or const.
finalinherited
isMultiplicativeOperator bool
Return true if this type of token represents a multiplicative operator.
read-onlyinherited
isOperator bool
true if this token type represents an operator.
finalinherited
isPseudo bool
A flag indicating whether the keyword can be used as an identifier in some situations.
read-onlyoverride
isRelationalOperator bool
Return true if this type of token represents a relational operator.
read-onlyinherited
isReservedWord bool
A flag indicating whether the keyword is a "reserved word".
read-onlyoverride
isSelectorOperator bool
Return true if this type of token represents a selector operator (starting token of a selector).
read-onlyinherited
isShiftOperator bool
Return true if this type of token represents a shift operator.
read-onlyinherited
isTopLevelKeyword bool
true if this token type represents a keyword starting a top level declaration such as class, enum, import, etc.
finalinherited
isUnaryPostfixOperator bool
Return true if this type of token represents a unary postfix operator.
read-onlyinherited
isUnaryPrefixOperator bool
Return true if this type of token represents a unary prefix operator.
read-onlyinherited
isUserDefinableOperator bool
true if this token type represents an operator that can be defined by users.
finalinherited
keywordStyle → KeywordStyle
final
kind int
finalinherited
lexeme String
The lexeme that defines this type of token, or null if there is more than one possible lexeme for this type of token.
finalinherited
name String
The name of the keyword type.
read-onlyoverride
precedence int
The precedence of this type of token, or 0 if the token does not represent an operator.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
stringValue String?
See Token.stringValue for an explanation.
finalinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

keywords Map<String, Keyword>
A table mapping the lexemes of keywords to the corresponding keyword.
final

Constants

ABSTRACT → const Keyword
const Keyword(79, "abstract", "ABSTRACT", KeywordStyle.builtIn, isModifier: true)
AS → const Keyword
const Keyword(80, "as", "AS", KeywordStyle.builtIn, precedence: RELATIONAL_PRECEDENCE)
ASSERT → const Keyword
const Keyword(81, "assert", "ASSERT", KeywordStyle.reserved)
ASYNC → const Keyword
const Keyword(82, "async", "ASYNC", KeywordStyle.pseudo)
AUGMENT → const Keyword
const Keyword(83, "augment", "AUGMENT", KeywordStyle.builtIn, isModifier: true)
AWAIT → const Keyword
const Keyword(84, "await", "AWAIT", KeywordStyle.pseudo)
BASE → const Keyword
const Keyword(85, "base", "BASE", KeywordStyle.pseudo)
BREAK → const Keyword
const Keyword(86, "break", "BREAK", KeywordStyle.reserved)
CASE → const Keyword
const Keyword(87, "case", "CASE", KeywordStyle.reserved)
CATCH → const Keyword
const Keyword(88, "catch", "CATCH", KeywordStyle.reserved)
CLASS → const Keyword
const Keyword(89, "class", "CLASS", KeywordStyle.reserved, isTopLevelKeyword: true)
CONST → const Keyword
const Keyword(90, "const", "CONST", KeywordStyle.reserved, isModifier: true)
CONTINUE → const Keyword
const Keyword(91, "continue", "CONTINUE", KeywordStyle.reserved)
COVARIANT → const Keyword
const Keyword(92, "covariant", "COVARIANT", KeywordStyle.builtIn, isModifier: true)
DEFAULT → const Keyword
const Keyword(93, "default", "DEFAULT", KeywordStyle.reserved)
DEFERRED → const Keyword
const Keyword(94, "deferred", "DEFERRED", KeywordStyle.builtIn)
DO → const Keyword
const Keyword(95, "do", "DO", KeywordStyle.reserved)
DYNAMIC → const Keyword
const Keyword(96, "dynamic", "DYNAMIC", KeywordStyle.builtIn)
ELSE → const Keyword
const Keyword(97, "else", "ELSE", KeywordStyle.reserved)
ENUM → const Keyword
const Keyword(98, "enum", "ENUM", KeywordStyle.reserved, isTopLevelKeyword: true)
EXPORT → const Keyword
const Keyword(99, "export", "EXPORT", KeywordStyle.builtIn, isTopLevelKeyword: true)
EXTENDS → const Keyword
const Keyword(100, "extends", "EXTENDS", KeywordStyle.reserved)
EXTENSION → const Keyword
const Keyword(101, "extension", "EXTENSION", KeywordStyle.builtIn, isTopLevelKeyword: true)
EXTERNAL → const Keyword
const Keyword(102, "external", "EXTERNAL", KeywordStyle.builtIn, isModifier: true)
FACTORY → const Keyword
const Keyword(103, "factory", "FACTORY", KeywordStyle.builtIn)
FALSE → const Keyword
const Keyword(104, "false", "FALSE", KeywordStyle.reserved)
FINAL → const Keyword
const Keyword(105, "final", "FINAL", KeywordStyle.reserved, isModifier: true)
FINALLY → const Keyword
const Keyword(106, "finally", "FINALLY", KeywordStyle.reserved)
FOR → const Keyword
const Keyword(107, "for", "FOR", KeywordStyle.reserved)
FUNCTION → const Keyword
const Keyword(108, "Function", "FUNCTION", KeywordStyle.builtIn)
GET → const Keyword
const Keyword(109, "get", "GET", KeywordStyle.builtIn)
HIDE → const Keyword
const Keyword(110, "hide", "HIDE", KeywordStyle.pseudo)
IF → const Keyword
const Keyword(111, "if", "IF", KeywordStyle.reserved)
IMPLEMENTS → const Keyword
const Keyword(112, "implements", "IMPLEMENTS", KeywordStyle.builtIn)
IMPORT → const Keyword
const Keyword(113, "import", "IMPORT", KeywordStyle.builtIn, isTopLevelKeyword: true)
IN → const Keyword
const Keyword(114, "in", "IN", KeywordStyle.reserved)
INOUT → const Keyword
const Keyword(115, "inout", "INOUT", KeywordStyle.pseudo)
INTERFACE → const Keyword
const Keyword(116, "interface", "INTERFACE", KeywordStyle.builtIn)
IS → const Keyword
const Keyword(117, "is", "IS", KeywordStyle.reserved, precedence: RELATIONAL_PRECEDENCE)
LATE → const Keyword
const Keyword(118, "late", "LATE", KeywordStyle.builtIn, isModifier: true)
LIBRARY → const Keyword
const Keyword(119, "library", "LIBRARY", KeywordStyle.builtIn, isTopLevelKeyword: true)
MIXIN → const Keyword
const Keyword(120, "mixin", "MIXIN", KeywordStyle.builtIn, isTopLevelKeyword: true)
NATIVE → const Keyword
const Keyword(121, "native", "NATIVE", KeywordStyle.pseudo)
NEW → const Keyword
const Keyword(122, "new", "NEW", KeywordStyle.reserved)
NULL → const Keyword
const Keyword(123, "null", "NULL", KeywordStyle.reserved)
OF → const Keyword
const Keyword(124, "of", "OF", KeywordStyle.pseudo)
ON → const Keyword
const Keyword(125, "on", "ON", KeywordStyle.pseudo)
OPERATOR → const Keyword
const Keyword(126, "operator", "OPERATOR", KeywordStyle.builtIn)
OUT → const Keyword
const Keyword(127, "out", "OUT", KeywordStyle.pseudo)
PART → const Keyword
const Keyword(128, "part", "PART", KeywordStyle.builtIn, isTopLevelKeyword: true)
PATCH → const Keyword
const Keyword(129, "patch", "PATCH", KeywordStyle.pseudo)
REQUIRED → const Keyword
const Keyword(130, "required", "REQUIRED", KeywordStyle.builtIn, isModifier: true)
RETHROW → const Keyword
const Keyword(131, "rethrow", "RETHROW", KeywordStyle.reserved)
RETURN → const Keyword
const Keyword(132, "return", "RETURN", KeywordStyle.reserved)
SEALED → const Keyword
const Keyword(133, "sealed", "SEALED", KeywordStyle.pseudo)
SET → const Keyword
const Keyword(134, "set", "SET", KeywordStyle.builtIn)
SHOW → const Keyword
const Keyword(135, "show", "SHOW", KeywordStyle.pseudo)
SOURCE → const Keyword
const Keyword(136, "source", "SOURCE", KeywordStyle.pseudo)
STATIC → const Keyword
const Keyword(137, "static", "STATIC", KeywordStyle.builtIn, isModifier: true)
SUPER → const Keyword
const Keyword(138, "super", "SUPER", KeywordStyle.reserved)
SWITCH → const Keyword
const Keyword(139, "switch", "SWITCH", KeywordStyle.reserved)
SYNC → const Keyword
const Keyword(140, "sync", "SYNC", KeywordStyle.pseudo)
THIS → const Keyword
const Keyword(141, "this", "THIS", KeywordStyle.reserved)
THROW → const Keyword
const Keyword(142, "throw", "THROW", KeywordStyle.reserved)
TRUE → const Keyword
const Keyword(143, "true", "TRUE", KeywordStyle.reserved)
TRY → const Keyword
const Keyword(144, "try", "TRY", KeywordStyle.reserved)
TYPEDEF → const Keyword
const Keyword(145, "typedef", "TYPEDEF", KeywordStyle.builtIn, isTopLevelKeyword: true)
values → const List<Keyword>
const <Keyword>[ABSTRACT, AS, ASSERT, ASYNC, AUGMENT, AWAIT, BASE, BREAK, CASE, CATCH, CLASS, CONST, CONTINUE, COVARIANT, DEFAULT, DEFERRED, DO, DYNAMIC, ELSE, ENUM, EXPORT, EXTENDS, EXTENSION, …
VAR → const Keyword
const Keyword(146, "var", "VAR", KeywordStyle.reserved, isModifier: true)
VOID → const Keyword
const Keyword(147, "void", "VOID", KeywordStyle.reserved)
WHEN → const Keyword
const Keyword(148, "when", 'WHEN', KeywordStyle.pseudo)
WHILE → const Keyword
const Keyword(149, "while", "WHILE", KeywordStyle.reserved)
WITH → const Keyword
const Keyword(150, "with", "WITH", KeywordStyle.reserved)
YIELD → const Keyword
const Keyword(151, "yield", "YIELD", KeywordStyle.pseudo)