public final class Exprs
extends java.lang.Object
Constructor and Description |
---|
Exprs() |
Modifier and Type | Method and Description |
---|---|
static Expr |
buildBinary(int from,
Location loc,
Expr e1,
Expr op,
Expr e2)
Build a binary operator call
where a function is used as an infix binary operator.
|
static Expr |
buildBinary(int from,
Location loc,
Expr e1,
Operator op,
Expr e2)
Build a binary operator call.
|
static Expr |
buildBool(int from,
Location loc,
boolean b)
Build an expression of a bool literal.
|
static Expr |
buildBound(int from,
Location loc,
Binding b)
Create an expression for a compiled variable.
|
static Expr |
buildCall(int from,
Location loc,
Expr n,
Expr[] args)
Build a function call expression.
|
static Expr |
buildChar(int from,
Location loc,
java.lang.Character c)
Build an expression of a char literal.
|
static Expr |
buildExpr(int from,
Location loc,
Expr e,
FunBinding[] where)
Build an expression with a list of compiled function definitions
defined by "where".
|
static Expr |
buildExpr(int from,
Location loc,
Expr e,
FunDef[] where)
Build an expression with a list of function definitions
defined by "where".
|
static Expr |
buildFieldUpdate(int from,
Location loc,
Expr e,
Binding self,
FunBinding[] flds)
Build an expression for a compiled tuple field update.
|
static Expr |
buildFieldUpdate(int from,
Location loc,
Expr e,
FunDef[] flds)
Build an expression for tuple field update.
|
static Expr |
buildIf(int from,
Location loc,
Expr cond,
Expr consequence)
Build a if expression.
|
static Expr |
buildIfElse(int from,
Location loc,
Expr cond,
Expr yes,
Expr no)
Build a if-else expression.
|
static Expr |
buildInteger(int from,
Location loc,
java.lang.Integer n)
Build an expression of an integer literal.
|
static Expr |
buildInterpolatedString(int from,
Location loc,
InterpolatedString str)
Build an expression of an interpolated string literal.
|
static Expr |
buildLamda(int from,
Location loc,
Alternative alt)
Build an expression for lamda abstraction.
|
static Expr |
buildLamda(int from,
Location loc,
Param[] params,
Expr body)
Build an expression for lamda abstraction.
|
static Expr |
buildLet(int from,
Location loc,
FunBinding[] bindings)
Build an expression with a list of compiled function definitions
defined by "let"
|
static Expr |
buildLet(int from,
Location loc,
FunDef[] defs)
Build an expression with a list of function definitions defined by "let".
|
static Expr |
buildList(int from,
Location loc,
Expr[] elems)
Build an expression for a list.
|
static Expr |
buildMethodCall(int from,
Location loc,
Expr e,
java.lang.String fname,
Expr[] args)
Build an expression for a tuple method call.
|
static Expr |
buildNumber(int from,
Location loc,
java.lang.Double n)
Build an expression of a decimal number literal.
|
static Expr |
buildOpExpr(int from,
Location loc,
Operator f)
Build an expression for an operator that is used as a function.
|
static Expr |
buildString(int from,
Location loc,
java.lang.String s)
Build an expression of a string literal.
|
static Expr |
buildSubtuple(int from,
Location loc,
Expr e,
java.lang.String[] flds)
Build an expression for subtuple expression.
|
static Expr |
buildTuple(int from,
Location loc,
Binding self,
FunBinding[] flds)
Build an expression for tuple definition.
|
static Expr |
buildTuple(int from,
Location loc,
FunDef[] flds)
Build an expression for tuple definition.
|
static Expr |
buildUnary(int from,
Location loc,
Operator op,
Expr e)
Build a unary operator call.
|
static Expr |
buildVar(int from,
Location loc,
java.lang.String n)
Build an expression of a variable.
|
public static Expr buildChar(int from, Location loc, java.lang.Character c)
from
- the starting index of this expression in the original source.loc
- the location of this expression in the original source.c
- the character.public static Expr buildBool(int from, Location loc, boolean b)
from
- the starting index of this expression in the original source.loc
- the location of this expression in the original source.b
- the boolean valuepublic static Expr buildNumber(int from, Location loc, java.lang.Double n)
from
- the starting index of this expression in the original source.loc
- the location of this expression in the original source.n
- the number.public static Expr buildInteger(int from, Location loc, java.lang.Integer n)
from
- the starting index of this expression in the original source.loc
- the location of this expression in the original source.n
- the integer.public static Expr buildString(int from, Location loc, java.lang.String s)
from
- the starting index of this expression in the original source.loc
- the location of this expression in the original source.s
- the string.public static Expr buildInterpolatedString(int from, Location loc, InterpolatedString str)
from
- the starting index of this expression in the original source.loc
- the location of this expression in the original source.str
- the string literal.public static Expr buildVar(int from, Location loc, java.lang.String n)
from
- the starting index of this expression in the original source.loc
- the location of this expression in the original source.n
- the variable name.public static Expr buildOpExpr(int from, Location loc, Operator f)
from
- the starting index of this expression in the original source.loc
- the location of this expression in the original source.f
- the operator.public static Expr buildCall(int from, Location loc, Expr n, Expr[] args)
from
- the starting index of this expression in the original source.loc
- the location of this expression in the original source.n
- the function.args
- the arguments.public static Expr buildIfElse(int from, Location loc, Expr cond, Expr yes, Expr no)
from
- the starting index of this expression in the original source.loc
- the location of this expression in the original source.cond
- the condition.yes
- the expression when cond is true.no
- the expression when cond is false.public static Expr buildIf(int from, Location loc, Expr cond, Expr consequence)
from
- the starting index of this expression in the original source.loc
- the location of this expression in the original source.cond
- the condition.consequence
- the expression when cond is true.public static Expr buildUnary(int from, Location loc, Operator op, Expr e)
from
- the starting index of this expression in the original source.loc
- the location of this expression in the original source.op
- the operator.e
- the operand.public static Expr buildBinary(int from, Location loc, Expr e1, Operator op, Expr e2)
from
- the starting index of this expression in the original source.loc
- the location of this expression in the original source.e1
- the left operand.op
- the operator.e2
- the right operand.public static Expr buildBinary(int from, Location loc, Expr e1, Expr op, Expr e2)
from
- the starting index of this expression in the original source.loc
- the location of this expression in the original source.e1
- the left operand.op
- the function used as operator.e2
- the right operand.public static Expr buildExpr(int from, Location loc, Expr e, FunDef[] where)
from
- the starting index of this expression in the original source.loc
- the location of this expression in the original source.e
- the expression.where
- the function definitions defined after "where".public static Expr buildExpr(int from, Location loc, Expr e, FunBinding[] where)
from
- the starting index of this expression in the original source.loc
- the location of this expression in the original source.e
- the expression.where
- the compiled function definitions.public static Expr buildLet(int from, Location loc, FunDef[] defs)
from
- the starting index of this expression in the original source.loc
- the location of this expression in the original source.public static Expr buildLet(int from, Location loc, FunBinding[] bindings)
from
- the starting index of this expression in the original source.loc
- the location of this expression in the original source.bindings
- the compiled function definitions.public static Expr buildBound(int from, Location loc, Binding b)
from
- the starting index of this expression in the original source.loc
- the location of this expression in the original source.b
- the binding that it binds to.public static Expr buildTuple(int from, Location loc, FunDef[] flds)
from
- the starting index of this expression in the original source.loc
- the location of this expression in the original source.flds
- the tuple field definitions.public static Expr buildTuple(int from, Location loc, Binding self, FunBinding[] flds)
from
- the starting index of this expression in the original source.loc
- the location of this expression in the original source.flds
- the compiled tuple field definitions.public static Expr buildList(int from, Location loc, Expr[] elems)
from
- the starting index of this expression in the original source.loc
- the location of this expression in the original source.elems
- the expressions for each list item.public static Expr buildMethodCall(int from, Location loc, Expr e, java.lang.String fname, Expr[] args)
from
- the starting index of this expression in the original source.loc
- the location of this expression in the original source.e
- the tuple expression.fname
- the field/method name.args
- the arguments.public static Expr buildFieldUpdate(int from, Location loc, Expr e, Binding self, FunBinding[] flds)
from
- the starting index of this expression in the original source.loc
- the location of this expression in the original source.e
- the tuple expression.self
- the binding for the special "this" variable
that may be used inside the tuple definition.flds
- the new compiled tuple field definitions.public static Expr buildFieldUpdate(int from, Location loc, Expr e, FunDef[] flds)
from
- the starting index of this expression in the original source.loc
- the location of this expression in the original source.e
- the tuple expression.flds
- the new field definitions.public static Expr buildLamda(int from, Location loc, Alternative alt)
from
- the starting index of this expression in the original source.loc
- the location of this expression in the original source.alt
- the Alternative object that represents this lamda definition.public static Expr buildLamda(int from, Location loc, Param[] params, Expr body)
from
- the starting index of this expression in the original source.loc
- the location of this expression in the original source.params
- the parameters of the lamda abstraction.body
- the body of the lamda abstraction.public static Expr buildSubtuple(int from, Location loc, Expr e, java.lang.String[] flds)
from
- the starting index of this expression in the original source.loc
- the location of this expression in the original source.e
- the expression for the tuple.flds
- the tuple members selected.