Package net.hydromatic.morel.ast
Enum AstBuilder
- All Implemented Interfaces:
Serializable,Comparable<AstBuilder>,java.lang.constant.Constable
Builds parse tree nodes.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionannotatedExp(Pos pos, Ast.Exp expression, Ast.Type type) annotatedPat(Pos pos, Ast.Pat pat, Ast.Type type) boolLiteral(Pos p, boolean b) Creates abooleanliteral.charLiteral(Pos p, char c) Creates acharliteral.compositeType(Pos pos, Iterable<Ast.Type> types) compute(Pos pos, List<Ast.Aggregate> aggregates) datatypeDecl(Pos pos, Iterable<Ast.DatatypeBind> binds) foldFunctionType(List<Ast.Type> types) private <E> EfoldRight(List<E> list, BiFunction<E, E, E> fold) from(Pos pos, List<Ast.FromStep> steps) from(Pos pos, List<Ast.FromStep> steps, Ast.Exp implicitYieldExp) Wraps an expression to distinguish "from x = e" from "from x in e".fromSuchThat(Ast.Exp exp) Wraps an expression to distinguish "from x suchthat e" from "from x in e".funBind(Pos pos, Iterable<? extends Ast.FunMatch> matchList) functionType(Pos pos, Ast.Type fromType, Ast.Type toType) funDecl(Pos pos, Iterable<? extends Ast.FunBind> valBinds) funMatch(Pos pos, String name, Iterable<? extends Ast.Pat> patList, Ast.Type returnType, Ast.Exp exp) greaterThan(Ast.Exp a0, Ast.Exp a1) greaterThanOrEqual(Ast.Exp a0, Ast.Exp a1) ifThenElse(Pos pos, Ast.Exp condition, Ast.Exp ifTrue, Ast.Exp ifFalse) implicitLabel(Ast.Exp exp) private Ast.InfixCallCreates a call to an infix operator.intLiteral(Pos pos, BigDecimal value) Creates anintliteral.lessThanOrEqual(Ast.Exp a0, Ast.Exp a1) literalPat(Pos pos, Op op, Comparable value) order(Pos pos, Iterable<Ast.OrderItem> orderItems) orderItem(Pos pos, Ast.Exp exp, Ast.Direction direction) prefixCall(Pos p, Op op, Ast.Exp a) Creates a call to a prefix operator.realLiteral(Pos pos, Float value) Creates afloatliteral for a special IEEE floating point value: NaN, negative zero, positive and negative infinity.realLiteral(Pos pos, BigDecimal value) Creates afloatliteral.recordSelector(Pos pos, String name) recordType(Pos pos, Map<String, Ast.Type> fieldTypes) private Ast.ExpReturns a reference to a built-in: either a name (e.g.stringLiteral(Pos pos, String value) Creates a string literal.typeConstructor(Pos pos, Ast.Id id, Ast.Type type) unitLiteral(Pos p) Creates a unit literal.valDecl(Pos pos, boolean rec, Iterable<? extends Ast.ValBind> valBinds) valDecl(Pos pos, boolean rec, Ast.ValBind... valBinds) static AstBuilderReturns the enum constant of this type with the specified name.static AstBuilder[]values()Returns an array containing the constants of this enum type, in the order they are declared.wildcardPat(Pos pos)
-
Enum Constant Details
-
ast
The singleton instance of the AST builder. The short name is convenient for use via 'import static', but checkstyle does not approve.
-
-
Constructor Details
-
AstBuilder
private AstBuilder()
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
implicitLabel
-
infix
Creates a call to an infix operator. -
prefixCall
Creates a call to a prefix operator. -
boolLiteral
Creates abooleanliteral. -
charLiteral
Creates acharliteral. -
intLiteral
Creates anintliteral. -
realLiteral
Creates afloatliteral. -
realLiteral
Creates afloatliteral for a special IEEE floating point value: NaN, negative zero, positive and negative infinity. -
stringLiteral
Creates a string literal. -
unitLiteral
Creates a unit literal. -
id
-
tyVar
-
recordType
-
recordSelector
-
namedType
-
idPat
-
literalPat
-
wildcardPat
-
asPat
-
conPat
-
con0Pat
-
tuplePat
-
tuplePat
-
listPat
-
listPat
-
recordPat
-
annotatedPat
-
consPat
-
tuple
-
list
-
record
-
equal
-
notEqual
-
lessThan
-
greaterThan
-
lessThanOrEqual
-
greaterThanOrEqual
-
elem
-
notElem
-
andAlso
-
orElse
-
plus
-
minus
-
times
-
divide
-
div
-
mod
-
caret
-
o
-
except
-
intersect
-
union
-
negate
-
cons
-
foldCons
-
let
-
valDecl
-
valDecl
-
valBind
-
match
-
caseOf
-
from
-
from
-
fromEq
Wraps an expression to distinguish "from x = e" from "from x in e". -
fromSuchThat
Wraps an expression to distinguish "from x suchthat e" from "from x in e". -
fn
-
fn
-
funDecl
-
funBind
-
funMatch
-
apply
-
ifThenElse
-
infixPat
-
annotatedExp
-
infixCall
-
datatypeDecl
-
datatypeBind
-
typeConstructor
-
tupleType
-
compositeType
-
functionType
-
foldFunctionType
-
foldRight
-
aggregate
-
ref
Returns a reference to a built-in: either a name (e.g. "true") or a field reference (e.g. "#hd List"). -
map
-
scan
-
order
-
orderItem
-
compute
-
group
-
where
-
skip
-
take
-
yield
-