org.millscript.millscript.expr
Class AppendExpr
java.lang.Object
org.millscript.millscript.expr.Expr<A>
org.millscript.millscript.expr.BinaryOpExpr<AppendAction>
org.millscript.millscript.expr.AppendExpr
- All Implemented Interfaces:
- OneResult
public final class AppendExpr
- extends BinaryOpExpr<AppendAction>
This class implements an append expression. The left and right hand side
expressions must produce single results that are compatible for appending.
- See Also:
AppendSyntax,
AppendAction
|
Constructor Summary |
AppendExpr(Expr<?> a,
Expr<?> b)
Creates a new append expression with the specified left and right hand
side expressions. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AppendExpr
public AppendExpr(Expr<?> a,
Expr<?> b)
- Creates a new append expression with the specified left and right hand
side expressions.
- Parameters:
a - the left hand expressionb - the right hand expression, to append to the left
make
public static Expr make(Expr a,
Expr b)
- Returns an expression which appends the specified left and right hand
side expressions. This method provides some compile-time optimisation, as
it avoids creating additional unnecessary objects in the expression tree.
If the left and right hand side expression are constant Strings, we
create a new constant expression by appending the right to the left.
Otherwise we create a normal apply expression.
- Parameters:
a - the left hand side expressionb - the right hand side expression
- Returns:
- a
ConstantExpr if the left and right hand side
expressions are both constant Strings, otherwise an
AppendExpr
newAction
public AppendAction newAction(Action a,
Action b)
- Description copied from class:
BinaryOpExpr
- Compiles this expression into an action. This is method performs the
expression specific compilation, but does not need to handle the left
and right hand side expression compilation.
- Specified by:
newAction in class BinaryOpExpr<AppendAction>
- Parameters:
a - the compiled left hand side expressionb - the compiled right hand side expression
- Returns:
- the
Action for this expression - See Also:
BinaryOpExpr.newAction(org.millscript.millscript.action.Action, org.millscript.millscript.action.Action)
Copyright © 2001-2007 Open World Ltd. All Rights Reserved.