Keyword class Null safety

The keywords in the Dart programming language.

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



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


binaryOperatorOfCompoundAssignment TokenType?
The binary operator that is invoked by this compound assignment operator, or null otherwise.
final, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
isAdditiveOperator bool
Return true if this type of token represents an additive operator.
read-only, inherited
isAssignmentOperator bool
Return true if this type of token represents an assignment operator.
read-only, inherited
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-only, inherited
isBinaryOperator bool
true if this token type represents a binary operator.
final, inherited
isBuiltIn bool
A flag indicating whether the keyword is a "built-in" identifier.
read-only, override
isBuiltInOrPseudo bool
isEqualityOperator bool
Return true if this type of token represents an equality operator.
read-only, inherited
isIncrementOperator bool
Return true if this type of token represents an increment operator.
read-only, inherited
isKeyword bool
Return true if this type of token is a keyword.
read-only, inherited
isModifier bool
true if this token type represents a modifier such as abstract or const.
final, inherited
isMultiplicativeOperator bool
Return true if this type of token represents a multiplicative operator.
read-only, inherited
isOperator bool
true if this token type represents an operator.
final, inherited
isPseudo bool
A flag indicating whether the keyword can be used as an identifier in some situations.
read-only, override
isRelationalOperator bool
Return true if this type of token represents a relational operator.
read-only, inherited
isReservedWord bool
A flag indicating whether the keyword is a "reserved word".
read-only, override
isSelectorOperator bool
Return true if this type of token represents a selector operator (starting token of a selector).
read-only, inherited
isShiftOperator bool
Return true if this type of token represents a shift operator.
read-only, inherited
isTopLevelKeyword bool
true if this token type represents a keyword starting a top level declaration such as class, enum, import, etc.
final, inherited
isUnaryPostfixOperator bool
Return true if this type of token represents a unary postfix operator.
read-only, inherited
isUnaryPrefixOperator bool
Return true if this type of token represents a unary prefix operator.
read-only, inherited
isUserDefinableOperator bool
true if this token type represents an operator that can be defined by users.
final, inherited
keywordStyle → KeywordStyle
kind int
final, inherited
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.
final, inherited
name String
The name of the keyword type.
read-only, override
precedence int
The precedence of this type of token, or 0 if the token does not represent an operator.
final, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
stringValue String?
See Token.stringValue for an explanation.
final, inherited


noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
toString() String
A string representation of this object. [...]


operator ==(Object other) bool
The equality operator. [...]

Static Properties

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


ABSTRACT → const Keyword
const Keyword("abstract", "ABSTRACT", KeywordStyle.builtIn, isModifier: true)
AS → const Keyword
const Keyword("as", "AS", KeywordStyle.builtIn, precedence: RELATIONAL_PRECEDENCE)
ASSERT → const Keyword
const Keyword("assert", "ASSERT", KeywordStyle.reserved)
ASYNC → const Keyword
const Keyword("async", "ASYNC", KeywordStyle.pseudo)
AWAIT → const Keyword
const Keyword("await", "AWAIT", KeywordStyle.pseudo)
BREAK → const Keyword
const Keyword("break", "BREAK", KeywordStyle.reserved)
CASE → const Keyword
const Keyword("case", "CASE", KeywordStyle.reserved)
CATCH → const Keyword
const Keyword("catch", "CATCH", KeywordStyle.reserved)
CLASS → const Keyword
const Keyword("class", "CLASS", KeywordStyle.reserved, isTopLevelKeyword: true)
CONST → const Keyword
const Keyword("const", "CONST", KeywordStyle.reserved, isModifier: true)
CONTINUE → const Keyword
const Keyword("continue", "CONTINUE", KeywordStyle.reserved)
COVARIANT → const Keyword
const Keyword("covariant", "COVARIANT", KeywordStyle.builtIn, isModifier: true)
DEFAULT → const Keyword
const Keyword("default", "DEFAULT", KeywordStyle.reserved)
DEFERRED → const Keyword
const Keyword("deferred", "DEFERRED", KeywordStyle.builtIn)
DO → const Keyword
const Keyword("do", "DO", KeywordStyle.reserved)
DYNAMIC → const Keyword
const Keyword("dynamic", "DYNAMIC", KeywordStyle.builtIn)
ELSE → const Keyword
const Keyword("else", "ELSE", KeywordStyle.reserved)
ENUM → const Keyword
const Keyword("enum", "ENUM", KeywordStyle.reserved, isTopLevelKeyword: true)
EXPORT → const Keyword
const Keyword("export", "EXPORT", KeywordStyle.builtIn, isTopLevelKeyword: true)
EXTENDS → const Keyword
const Keyword("extends", "EXTENDS", KeywordStyle.reserved)
EXTENSION → const Keyword
const Keyword("extension", "EXTENSION", KeywordStyle.builtIn, isTopLevelKeyword: true)
EXTERNAL → const Keyword
const Keyword("external", "EXTERNAL", KeywordStyle.builtIn, isModifier: true)
FACTORY → const Keyword
const Keyword("factory", "FACTORY", KeywordStyle.builtIn)
FALSE → const Keyword
const Keyword("false", "FALSE", KeywordStyle.reserved)
FINAL → const Keyword
const Keyword("final", "FINAL", KeywordStyle.reserved, isModifier: true)
FINALLY → const Keyword
const Keyword("finally", "FINALLY", KeywordStyle.reserved)
FOR → const Keyword
const Keyword("for", "FOR", KeywordStyle.reserved)
FUNCTION → const Keyword
const Keyword("Function", "FUNCTION", KeywordStyle.pseudo)
GET → const Keyword
const Keyword("get", "GET", KeywordStyle.builtIn)
HIDE → const Keyword
const Keyword("hide", "HIDE", KeywordStyle.pseudo)
IF → const Keyword
const Keyword("if", "IF", KeywordStyle.reserved)
IMPLEMENTS → const Keyword
const Keyword("implements", "IMPLEMENTS", KeywordStyle.builtIn)
IMPORT → const Keyword
const Keyword("import", "IMPORT", KeywordStyle.builtIn, isTopLevelKeyword: true)
IN → const Keyword
const Keyword("in", "IN", KeywordStyle.reserved)
INOUT → const Keyword
const Keyword("inout", "INOUT", KeywordStyle.pseudo)
INTERFACE → const Keyword
const Keyword("interface", "INTERFACE", KeywordStyle.builtIn)
IS → const Keyword
const Keyword("is", "IS", KeywordStyle.reserved, precedence: RELATIONAL_PRECEDENCE)
LATE → const Keyword
const Keyword("late", "LATE", KeywordStyle.builtIn, isModifier: true)
LIBRARY → const Keyword
const Keyword("library", "LIBRARY", KeywordStyle.builtIn, isTopLevelKeyword: true)
MIXIN → const Keyword
const Keyword("mixin", "MIXIN", KeywordStyle.builtIn, isTopLevelKeyword: true)
NATIVE → const Keyword
const Keyword("native", "NATIVE", KeywordStyle.pseudo)
NEW → const Keyword
const Keyword("new", "NEW", KeywordStyle.reserved)
NULL → const Keyword
const Keyword("null", "NULL", KeywordStyle.reserved)
OF → const Keyword
const Keyword("of", "OF", KeywordStyle.pseudo)
ON → const Keyword
const Keyword("on", "ON", KeywordStyle.pseudo)
OPERATOR → const Keyword
const Keyword("operator", "OPERATOR", KeywordStyle.builtIn)
OUT → const Keyword
const Keyword("out", "OUT", KeywordStyle.pseudo)
PART → const Keyword
const Keyword("part", "PART", KeywordStyle.builtIn, isTopLevelKeyword: true)
PATCH → const Keyword
const Keyword("patch", "PATCH", KeywordStyle.pseudo)
REQUIRED → const Keyword
const Keyword("required", "REQUIRED", KeywordStyle.builtIn, isModifier: true)
RETHROW → const Keyword
const Keyword("rethrow", "RETHROW", KeywordStyle.reserved)
RETURN → const Keyword
const Keyword("return", "RETURN", KeywordStyle.reserved)
SET → const Keyword
const Keyword("set", "SET", KeywordStyle.builtIn)
SHOW → const Keyword
const Keyword("show", "SHOW", KeywordStyle.pseudo)
SOURCE → const Keyword
const Keyword("source", "SOURCE", KeywordStyle.pseudo)
STATIC → const Keyword
const Keyword("static", "STATIC", KeywordStyle.builtIn, isModifier: true)
SUPER → const Keyword
const Keyword("super", "SUPER", KeywordStyle.reserved)
SWITCH → const Keyword
const Keyword("switch", "SWITCH", KeywordStyle.reserved)
SYNC → const Keyword
const Keyword("sync", "SYNC", KeywordStyle.pseudo)
THIS → const Keyword
const Keyword("this", "THIS", KeywordStyle.reserved)
THROW → const Keyword
const Keyword("throw", "THROW", KeywordStyle.reserved)
TRUE → const Keyword
const Keyword("true", "TRUE", KeywordStyle.reserved)
TRY → const Keyword
const Keyword("try", "TRY", KeywordStyle.reserved)
TYPEDEF → const Keyword
const Keyword("typedef", "TYPEDEF", KeywordStyle.builtIn, isTopLevelKeyword: true)
values → const List<Keyword>
VAR → const Keyword
const Keyword("var", "VAR", KeywordStyle.reserved, isModifier: true)
VOID → const Keyword
const Keyword("void", "VOID", KeywordStyle.reserved)
WHILE → const Keyword
const Keyword("while", "WHILE", KeywordStyle.reserved)
WITH → const Keyword
const Keyword("with", "WITH", KeywordStyle.reserved)
YIELD → const Keyword
const Keyword("yield", "YIELD", KeywordStyle.pseudo)