Abstract base class that represent expressions in a configuration script.
abstract class
|
ConfigExpression
|
extends
|
ConfigNode
|
Returns the type of this expression.
public
abstract
property
|
ExpressionType
{
get
}
|
||
type
|
ConfigType
|
||
value
|
|
The config type or Invalid if there are semantic errors (e.g. unresolved identifiers). |
public
virtual
property
|
IsCall
{
get
}
|
||
type
|
bool
|
||
value
|
Is
this
expression
a
null
literal?
public
virtual
property
|
IsNull
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
this
expression
is
a
null
literal,
false
if
not.
|
public
property
|
QualifiedIdentifier
{
get
}
|
||
type
|
string
|
||
value
|
Returns source code range of this object.
public
property
|
Range
{
get
}
|
||
type
|
RangeI
|
||
value
|
The source code character range or Inv if none. | ||
inherited
|
ConfigNode.Range
|
Parses a configuration value expression.
public
static
method
|
Parse
(string source,
IConfigScope scope = null,
ConfigType expectedType = null,
Path current = null)
|
||
type
|
ConfigExpression
|
||
params
|
source
|
[not-null]
|
The expression source code. |
scope
|
Optional
type
bag
for
resolving
variable
types.
Defaults
to
null .
|
||
expectedType
|
Optional
expected
type.
Defaults
to
null . |
||
current
|
Optional
directory
to
use
for
resolving
relative
path
values
that
start
with
a
'.'
(e.g.
<./a/b.txt> ).
All
other
relative
paths
(e.g.
<a/b.txt> )
will
remain
unchanged.
If
null ,
the
current
filesystem
directory
will
be
used.
Defaults
to
null .
|
||
returns
|
|
The parsed expression. |
Creates a configuration value expression.
public
static
method
|
ParseAst
(ICodeInput input,
AstNode ast,
IConfigScope scope = null,
ConfigType expectedType = null,
Path current = null)
|
||
type
|
ConfigExpression
|
||
params
|
input
|
[not-null]
|
The character input. |
ast
|
[not-null]
|
The AST root node. | |
scope
|
Optional
type
bag
for
resolving
variable
types.
Defaults
to
null .
|
||
expectedType
|
Optional
expected
type.
Defaults
to
null . |
||
current
|
Optional
directory
to
use
for
resolving
relative
path
values
that
start
with
a
'.'
(e.g.
<./a/b.txt> ).
All
other
relative
paths
(e.g.
<a/b.txt> )
will
remain
unchanged.
If
null ,
the
current
filesystem
directory
will
be
used.
Defaults
to
null .
|
||
returns
|
|
The parsed expression. |
Can
this
expression
be
interpreted
as
a
qualified
identifier
(e.g.
Some.Name.With.Parts
)?
public
virtual
method
|
CheckQualifiedIdentifier
(ICollector<string> parts = null)
|
||
type
|
bool
|
||
params
|
parts
|
The
collector
of
name
parts
or
null . |
|
returns
|
true
if
this
expression
builds
a
qualified
identifier,
false
if
not.
|
Clears the source code range.
public
method
|
ClearRange
()
|
||
inherited
|
ConfigNode.ClearRange
|
See also:
ConfigNode.RangeEvaluates this expression as if it is the right side of an assignment.
public
method
|
Evaluate
(IConfigValueBag scope = null,
ConfigValue value = null)
|
||
type
|
ConfigValue
|
||
params
|
scope
|
The
evaluation
scope
or
null . |
|
value
|
The
ConfigValue
to
store
the
resulting
value
in.
If
null ,
a
new
config
value
is
created.
|
||
returns
|
|
The ConfigValue that holds the evaluation result. |
Evaluates this expression as if it is the left side of an assignment.
public
method
|
EvaluateAssignable
(IConfigValueBag scope = null)
|
||
type
|
ConfigValue
|
||
params
|
scope
|
The
evaluation
scope
or
null . |
|
returns
|
|
The ConfigValue that holds the evaluation result or Invalid if this expression cannot be an assignment target. |
Collects all config members that are referenced by this expression.
public
method
|
EvaluateReferences
(IConfigValueBag scope,
IVector<ConfigMember> members = null)
|
||
type
|
IVectorConst<ConfigMember>
|
||
params
|
scope
|
[not-null]
|
The evaluation scope. |
members
|
Output
for
collected
references
or
null . |
||
returns
|
|
The collected config members. |
Returns the type of this expression.
public
method
|
ExpressionTypeLazy
(ConfigTypeDelegate func = null)
|
||
type
|
ConfigType
|
||
params
|
func
|
Optional delegate to call on the resolved expression type. | |
returns
|
|
The config type. |
Remarks:
The actual config type is determined lazily by querying ExpressionType at a later point in time.
Finds all config nodes which code range (see Range) intersects with the given range (see Intersects).
public
virtual
method
|
FindAt
(RangeI range,
ICollector<ConfigNode> nodes)
|
||
params
|
range
|
The code range to intersect with. | |
nodes
|
[not-null]
|
The output nodes. | |
inherited
|
ConfigNode.FindAt
|
Checks if this config expression if assignable to the given type.
public
method
|
IsAssignableTo
(ConfigType other)
|
||
type
|
bool
|
||
params
|
other
|
[not-null]
|
The other type. |
returns
|
true
if
this
type
is
assignable
to
the
given
one,
false
if
not.
|
Checks if this config expression if convertible to the given type.
public
method
|
IsConvertibleTo
(ConfigType other,
bool always = false)
|
||
type
|
bool
|
||
params
|
other
|
[not-null]
|
The other type. |
always
|
When
set
to
true ,
the
method
will
return
true
iff
this
type
is
always
convertible
to
other.
When
set
to
false ,
this
method
will
return
true
even
if
a
conversion
might
fail
at
runtime,
causing
a
ConfigException
to
be
thrown
(e.g.
invalid
string
to
number).
|
||
returns
|
true
if
this
type
is
convertible
to
the
given
one,
false
if
not.
|
Resolves all references in this PSI node.
public
abstract
method
|
Resolve
()
|
||
type
|
ResolveResult
|
||
returns
|
The result of the resolver cycle. | ||
inherited
|
ConfigNode.Resolve
|
Provides additional information about the parsing process.
public
method
|
SetParseInfo
(RangeI range)
|
||
params
|
range
|
The source code range. | |
inherited
|
ConfigNode.SetParseInfo
|
[Pure]
|
||||
public
override
method
|
ToString
()
|
|||
type
|
string
|
|||
inherited
|
ConfigNode.ToString
|
Validates the state of this object.
public
abstract
method
|
Validate
(Validator validator)
|
||
params
|
validator
|
[not-null]
|
The validator object. |
inherited
|
ConfigNode.Validate
|
Produces source code by feeding the given source code writer.
public
override
method
|
WriteSourceCode
(SourceCodeWriter writer,
Context context)
|
||
params
|
writer
|
[not-null]
|
The source code writer to use. |
context
|
[not-null]
|
Context information. | |
implements
|
ConfigNode.WriteSourceCode
|
The operator precedence.
protected
abstract
property
|
Precedence
{
get
}
|
||
type
|
int32
|
||
value
|
The operator precedence. |
Remarks:
0 -> For each expression 1 -> Conditional expression 2 -> Binary expression: conditional or 3 -> Binary expression: conditional and 4 -> Binary expression: logical or 5 -> Binary expression: logical xor 6 -> Binary expression: logical and 7 -> Binary expression: equality 8 -> Binary expression: comparision 9 -> Binary expression: shift 10 -> Binary expression: additive 11 -> Binary expression: multiplicative 12 -> Binary expression: power, root 13 -> Unary expression 14 -> Primary and terminal expressions
The source code range of this PSI node.
protected
field
|
range
|
||
type
|
RangeI
|
||
inherited
|
ConfigNode.range
|
Evaluates this expression.
protected
abstract
method
|
DoEvaluate
(IConfigValueBag scope,
ConfigValue value)
|
||
type
|
ConfigValue
|
||
params
|
scope
|
The scope to use. | |
value
|
The
output
config
value
or
null
if
the
expression
shall
be
evaluated
to
an
assignment
target.
|
||
returns
|
The resulting config value. |
protected
abstract
method
|
DoEvaluateReferences
(IConfigValueBag scope,
IVector<ConfigMember> members)
|
||
params
|
scope
|
||
members
|
protected
abstract
method
|
DoWriteSourceCode
(SourceCodeWriter writer,
Context context)
|
||
params
|
writer
|
||
context
|