Home

expressionlike

Expressionlike is a term used in programming language theory and formal linguistics to describe objects that have the structural and operational characteristics of expressions, as opposed to statements or values. An expressionlike object can typically be constructed from variables, constants, and operators, and it participates in substitution and evaluation rules in a way that resembles ordinary expressions.

In compiler design and formal grammars, expressionlike nodes appear in abstract syntax trees to denote computations

Typical properties include: the ability to be composed from other expressionlike objects, to be reduced or

Example: in a toy language, an AST node Add(x, y) is expressionlike, because it represents a computation

See also: expression, term, value, abstract syntax tree, syntax category. Notes: the term is informal and not

that
yield
a
value.
They
are
distinguished
from
statementlike
nodes,
which
perform
actions
without
producing
a
direct
result.
In
symbolic
computation
systems,
expressionlike
objects
can
be
manipulated
symbolically,
rewritten,
simplified,
or
postponed
for
evaluation.
rewritten
under
defined
rules,
and
to
have
a
representation
that
can
be
printed
or
serialized.
The
term
is
usually
used
descriptively
rather
than
as
a
formal
category,
and
its
precise
meaning
can
vary
by
language
or
framework.
that
could
yield
the
value
of
x
plus
y.
A
node
representing
a
print
statement
or
an
assignment
is
not
expressionlike,
since
it
is
intended
to
affect
state
rather
than
produce
a
value.
universally
standardized,
and
its
interpretation
depends
on
context.