LiteralExpression class
A literal string, number, boolean or null.
Note that "undefined", "NaN", and "Infinity" are NameExpressions, and not literals and one might expect.
- Inheritance
-
- Object
- Node
- Expression
- LiteralExpression
Constructors
- LiteralExpression(dynamic value, [String? raw])
Properties
- boolValue → bool
-
no setter
- enclosingFunction → FunctionNode?
-
Returns the FunctionNode enclosing this node, possibly the node itself, or null if not enclosed in any function.
no setterinherited
- enclosingProgram → Program?
-
Returns the Program node enclosing this node, possibly the node itself, or null if not enclosed in any program.
no setterinherited
- end ↔ int
-
Source-code offset.
getter/setter pairinherited
- endLine ↔ int
-
getter/setter pairinherited
- filename → String?
-
Retrieves the filename from the enclosing Program. Returns null if the node is orphaned.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isBool → bool
-
no setter
- isNull → bool
-
no setter
- isNumber → bool
-
no setter
- isString → bool
-
no setter
- line ↔ int
-
1-based line number.
getter/setter pairinherited
- location → String
-
A string with filename and line number.
no setterinherited
- numberValue → num
-
no setter
- parent ↔ Node?
-
The parent of this node, or null if this is the Program node.
getter/setter pairinherited
- raw ↔ String?
-
The verbatim source-code representation of the literal.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- start ↔ int
-
Source-code offset.
getter/setter pairinherited
- stringValue → String
-
no setter
- toName → String
-
Converts the value to a string
no setter
- value ↔ dynamic
-
A string, number, boolean, or null value, indicating the value of the literal.
getter/setter pair
Methods
-
forEach(
void callback(Node node)) → void -
Visits the immediate children of this node.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
-
visitBy<
T> (Visitor< T> v) → T? -
Calls the relevant
visit
method on the visitor.override -
visitBy1<
T, A> (Visitor1< T, A> v, A arg) → T? -
Calls the relevant
visit
method on the visitor.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited