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. [...]
read-only, override
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns 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
const Precedence._(ADDITIVE_PRECEDENCE)
assignment → const Precedence
const Precedence._(ASSIGNMENT_PRECEDENCE)
bitwiseAnd → const Precedence
const Precedence._(BITWISE_AND_PRECEDENCE)
bitwiseOr → const Precedence
const Precedence._(BITWISE_OR_PRECEDENCE)
bitwiseXor → const Precedence
const Precedence._(BITWISE_XOR_PRECEDENCE)
cascade → const Precedence
const Precedence._(CASCADE_PRECEDENCE)
conditional → const Precedence
const Precedence._(CONDITIONAL_PRECEDENCE)
equality → const Precedence
const Precedence._(EQUALITY_PRECEDENCE)
ifNull → const Precedence
const Precedence._(IF_NULL_PRECEDENCE)
logicalAnd → const Precedence
const Precedence._(LOGICAL_AND_PRECEDENCE)
logicalOr → const Precedence
const Precedence._(LOGICAL_OR_PRECEDENCE)
multiplicative → const Precedence
const Precedence._(MULTIPLICATIVE_PRECEDENCE)
none → const Precedence
const Precedence._(NO_PRECEDENCE)
postfix → const Precedence
const Precedence._(POSTFIX_PRECEDENCE)
prefix → const Precedence
const Precedence._(PREFIX_PRECEDENCE)
primary → const Precedence
const Precedence._(SELECTOR_PRECEDENCE)
relational → const Precedence
const Precedence._(RELATIONAL_PRECEDENCE)
shift → const Precedence
const Precedence._(SHIFT_PRECEDENCE)