Precedence class

Opaque representation of Dart expression precedence.

Expression classes return an instance of this class to represent a particular row in the Dart expression precedence table. This allows clients to determine when parentheses are needed (by comparing precedence values), but ensures that the client does not become dependent on the particular integers used by the analyzer to represent table rows, since we may need to change these integers from time to time to accommodate new language features.

Constructors

Precedence.forTokenType(TokenType type)
Constructs the precedence for a unary or binary expression constructed from an operator of the given type.

Properties

hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Operators

operator <(Precedence other) bool
Returns true if this precedence represents a looser binding than other; that is, parsing ambiguities will be resolved in favor of nesting the expression having precedence other within the expression having precedence this.
operator <=(Precedence other) bool
Returns true if this precedence represents a looser, or equal, binding than other; that is, parsing ambiguities will be resolved in favor of nesting the expression having precedence other within the expression having precedence this, or, if the precedences are equal, parsing ambiguities will be resolved according to the associativity of the expression precedence.
operator ==(Object other) bool
The equality operator.
override
operator >(Precedence other) bool
Returns true if this precedence represents a tighter binding than other; that is, parsing ambiguities will be resolved in favor of nesting the expression having precedence this within the expression having precedence other.
operator >=(Precedence other) bool
Returns true if this precedence represents a tighter, or equal, binding than other; that is, parsing ambiguities will be resolved in favor of nesting the expression having precedence this within the expression having precedence other, or, if the precedences are equal, parsing ambiguities will be resolved according to the associativity of the expression precedence.

Constants

additive → const Precedence
assignment → const Precedence
bitwiseAnd → const Precedence
bitwiseOr → const Precedence
bitwiseXor → const Precedence
cascade → const Precedence
conditional → const Precedence
equality → const Precedence
ifNull → const Precedence
logicalAnd → const Precedence
logicalOr → const Precedence
multiplicative → const Precedence
none → const Precedence
postfix → const Precedence
prefix → const Precedence
primary → const Precedence
relational → const Precedence
shift → const Precedence