Package net.hydromatic.morel.ast
Enum AstBuilder
- java.lang.Object
-
- java.lang.Enum<AstBuilder>
-
- net.hydromatic.morel.ast.AstBuilder
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<AstBuilder>
public enum AstBuilder extends java.lang.Enum<AstBuilder>
Builds parse tree nodes.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description astThe singleton instance of the AST builder.
-
Constructor Summary
Constructors Modifier Constructor Description privateAstBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Ast.Aggregateaggregate(Pos pos, Ast.Exp aggregate, Ast.Exp argument, Ast.Id id)Ast.ExpandAlso(Ast.Exp a0, Ast.Exp a1)Ast.ExpannotatedExp(Pos pos, Ast.Type type, Ast.Exp expression)Ast.PatannotatedPat(Pos pos, Ast.Pat pat, Ast.Type type)Ast.Applyapply(Ast.Exp fn, Ast.Exp arg)Ast.LiteralboolLiteral(Pos p, boolean b)Creates abooleanliteral.Ast.Expcaret(Ast.Exp a0, Ast.Exp a1)Ast.CasecaseOf(Pos pos, Ast.Exp e, java.lang.Iterable<? extends Ast.Match> matchList)Ast.LiteralcharLiteral(Pos p, char c)Creates acharliteral.Ast.TypecompositeType(Pos pos, java.lang.Iterable<Ast.Type> types)Ast.Con0Patcon0Pat(Pos pos, Ast.Id tyCon)Ast.ConPatconPat(Pos pos, Ast.Id tyCon, Ast.Pat pat)Ast.Expcons(Ast.Exp a0, Ast.Exp a1)Ast.PatconsPat(Ast.Pat p0, Ast.Pat p1)Ast.DatatypeBinddatatypeBind(Pos pos, Ast.Id name, java.lang.Iterable<Ast.TyVar> tyVars, java.lang.Iterable<Ast.TyCon> tyCons)Ast.DatatypeDecldatatypeDecl(Pos pos, java.lang.Iterable<Ast.DatatypeBind> binds)Ast.Expdiv(Ast.Exp a0, Ast.Exp a1)Ast.Expdivide(Ast.Exp a0, Ast.Exp a1)Ast.Expequal(Ast.Exp a0, Ast.Exp a1)Ast.Fnfn(Pos pos, java.lang.Iterable<? extends Ast.Match> matchList)Ast.Fnfn(Pos pos, Ast.Match... matchList)Ast.ExpfoldCons(java.util.List<Ast.Exp> list)Ast.TypefoldFunctionType(java.util.List<Ast.Type> types)private <E> EfoldRight(java.util.List<E> list, java.util.function.BiFunction<E,E,E> fold)Ast.Fromfrom(Pos pos, java.util.Map<Ast.Id,Ast.Exp> sources, Ast.Exp filterExp, Ast.Exp yieldExp, java.util.List<Pair<Ast.Exp,Ast.Id>> groupExps, java.util.List<Ast.Aggregate> aggregates)Ast.FunBindfunBind(Pos pos, java.lang.Iterable<? extends Ast.FunMatch> matchList)Ast.FunctionTypefunctionType(Pos pos, Ast.Type fromType, Ast.Type toType)Ast.FunDeclfunDecl(Pos pos, java.lang.Iterable<? extends Ast.FunBind> valBinds)Ast.FunMatchfunMatch(Pos pos, java.lang.String name, java.lang.Iterable<? extends Ast.Pat> patList, Ast.Exp e)Ast.ExpgreaterThan(Ast.Exp a0, Ast.Exp a1)Ast.ExpgreaterThanOrEqual(Ast.Exp a0, Ast.Exp a1)Ast.Idid(Pos pos, java.lang.String name)Ast.PatidPat(Pos pos, java.lang.String name)Ast.ExpifThenElse(Pos pos, Ast.Exp condition, Ast.Exp ifTrue, Ast.Exp ifFalse)java.lang.StringimplicitLabel(Ast.Exp e)private Ast.InfixCallinfix(Op op, Ast.Exp a0, Ast.Exp a1)Creates a call to an infix operator.Ast.ExpinfixCall(Pos pos, Op op, Ast.Exp a0, Ast.Exp a1)Ast.InfixPatinfixPat(Pos pos, Op op, Ast.Pat p0, Ast.Pat p1)Ast.LiteralintLiteral(java.math.BigDecimal value, Pos pos)Creates anintliteral.Ast.ExplessThan(Ast.Exp a0, Ast.Exp a1)Ast.ExplessThanOrEqual(Ast.Exp a0, Ast.Exp a1)Ast.LetExplet(Pos pos, java.lang.Iterable<? extends Ast.Decl> decls, Ast.Exp e)Ast.Listlist(Pos pos, java.lang.Iterable<? extends Ast.Exp> list)Ast.ListPatlistPat(Pos pos, java.lang.Iterable<? extends Ast.Pat> args)Ast.ListPatlistPat(Pos pos, Ast.Pat... args)Ast.LiteralPatliteralPat(Pos pos, Op op, java.lang.Comparable value)Ast.Expmap(Pos pos, Ast.Exp e1, Ast.Exp e2)Ast.Matchmatch(Pos pos, Ast.Pat pat, Ast.Exp e)Ast.Expminus(Ast.Exp a0, Ast.Exp a1)Ast.Expmod(Ast.Exp a0, Ast.Exp a1)Ast.TypenamedType(Pos pos, java.lang.Iterable<? extends Ast.Type> types, java.lang.String name)Ast.Expnegate(Pos p, Ast.Exp a)Ast.ExpnotEqual(Ast.Exp a0, Ast.Exp a1)Ast.ExporElse(Ast.Exp a0, Ast.Exp a1)Ast.Expplus(Ast.Exp a0, Ast.Exp a1)Ast.PrefixCallprefixCall(Pos p, Op op, Ast.Exp a)Creates a call to a prefix operator.Ast.LiteralrealLiteral(java.math.BigDecimal value, Pos pos)Creates afloatliteral.Ast.Exprecord(Pos pos, java.util.Map<java.lang.String,Ast.Exp> map)Ast.RecordPatrecordPat(Pos pos, boolean ellipsis, java.util.Map<java.lang.String,? extends Ast.Pat> args)Ast.RecordSelectorrecordSelector(Pos pos, java.lang.String name)Ast.RecordTyperecordType(Pos pos, java.util.Map<java.lang.String,Ast.Type> fieldTypes)Ast.LiteralstringLiteral(Pos pos, java.lang.String value)Creates a string literal.Ast.Exptimes(Ast.Exp a0, Ast.Exp a1)Ast.Tupletuple(Pos pos, java.lang.Iterable<? extends Ast.Exp> list)Ast.TuplePattuplePat(Pos pos, java.lang.Iterable<? extends Ast.Pat> args)Ast.TuplePattuplePat(Pos pos, Ast.Pat... args)Ast.TypetupleType(Pos pos, java.lang.Iterable<Ast.Type> types)Ast.TyContypeConstructor(Pos pos, Ast.Id id, Ast.Type type)Ast.TyVartyVar(Pos pos, java.lang.String name)Ast.LiteralunitLiteral(Pos p)Creates a unit literal.Ast.ValBindvalBind(Pos pos, boolean rec, Ast.Pat pat, Ast.Exp e)Ast.ValDeclvalDecl(Pos pos, java.lang.Iterable<? extends Ast.ValBind> valBinds)Ast.ValDeclvalDecl(Pos pos, Ast.ValBind... valBinds)static AstBuildervalueOf(java.lang.String name)Returns 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.Ast.WildcardPatwildcardPat(Pos pos)
-
-
-
Enum Constant Detail
-
ast
public static final AstBuilder ast
The singleton instance of the AST builder. The short name is convenient for use via 'import static', but checkstyle does not approve.
-
-
Method Detail
-
values
public static AstBuilder[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (AstBuilder c : AstBuilder.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static AstBuilder valueOf(java.lang.String name)
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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
implicitLabel
public java.lang.String implicitLabel(Ast.Exp e)
-
infix
private Ast.InfixCall infix(Op op, Ast.Exp a0, Ast.Exp a1)
Creates a call to an infix operator.
-
prefixCall
public Ast.PrefixCall prefixCall(Pos p, Op op, Ast.Exp a)
Creates a call to a prefix operator.
-
boolLiteral
public Ast.Literal boolLiteral(Pos p, boolean b)
Creates abooleanliteral.
-
charLiteral
public Ast.Literal charLiteral(Pos p, char c)
Creates acharliteral.
-
intLiteral
public Ast.Literal intLiteral(java.math.BigDecimal value, Pos pos)
Creates anintliteral.
-
realLiteral
public Ast.Literal realLiteral(java.math.BigDecimal value, Pos pos)
Creates afloatliteral.
-
stringLiteral
public Ast.Literal stringLiteral(Pos pos, java.lang.String value)
Creates a string literal.
-
unitLiteral
public Ast.Literal unitLiteral(Pos p)
Creates a unit literal.
-
recordType
public Ast.RecordType recordType(Pos pos, java.util.Map<java.lang.String,Ast.Type> fieldTypes)
-
recordSelector
public Ast.RecordSelector recordSelector(Pos pos, java.lang.String name)
-
namedType
public Ast.Type namedType(Pos pos, java.lang.Iterable<? extends Ast.Type> types, java.lang.String name)
-
literalPat
public Ast.LiteralPat literalPat(Pos pos, Op op, java.lang.Comparable value)
-
wildcardPat
public Ast.WildcardPat wildcardPat(Pos pos)
-
conPat
public Ast.ConPat conPat(Pos pos, Ast.Id tyCon, Ast.Pat pat)
-
con0Pat
public Ast.Con0Pat con0Pat(Pos pos, Ast.Id tyCon)
-
tuplePat
public Ast.TuplePat tuplePat(Pos pos, java.lang.Iterable<? extends Ast.Pat> args)
-
tuplePat
public Ast.TuplePat tuplePat(Pos pos, Ast.Pat... args)
-
listPat
public Ast.ListPat listPat(Pos pos, java.lang.Iterable<? extends Ast.Pat> args)
-
listPat
public Ast.ListPat listPat(Pos pos, Ast.Pat... args)
-
recordPat
public Ast.RecordPat recordPat(Pos pos, boolean ellipsis, java.util.Map<java.lang.String,? extends Ast.Pat> args)
-
let
public Ast.LetExp let(Pos pos, java.lang.Iterable<? extends Ast.Decl> decls, Ast.Exp e)
-
valDecl
public Ast.ValDecl valDecl(Pos pos, java.lang.Iterable<? extends Ast.ValBind> valBinds)
-
valDecl
public Ast.ValDecl valDecl(Pos pos, Ast.ValBind... valBinds)
-
valBind
public Ast.ValBind valBind(Pos pos, boolean rec, Ast.Pat pat, Ast.Exp e)
-
caseOf
public Ast.Case caseOf(Pos pos, Ast.Exp e, java.lang.Iterable<? extends Ast.Match> matchList)
-
from
public Ast.From from(Pos pos, java.util.Map<Ast.Id,Ast.Exp> sources, Ast.Exp filterExp, Ast.Exp yieldExp, java.util.List<Pair<Ast.Exp,Ast.Id>> groupExps, java.util.List<Ast.Aggregate> aggregates)
-
funDecl
public Ast.FunDecl funDecl(Pos pos, java.lang.Iterable<? extends Ast.FunBind> valBinds)
-
funBind
public Ast.FunBind funBind(Pos pos, java.lang.Iterable<? extends Ast.FunMatch> matchList)
-
funMatch
public Ast.FunMatch funMatch(Pos pos, java.lang.String name, java.lang.Iterable<? extends Ast.Pat> patList, Ast.Exp e)
-
infixPat
public Ast.InfixPat infixPat(Pos pos, Op op, Ast.Pat p0, Ast.Pat p1)
-
datatypeDecl
public Ast.DatatypeDecl datatypeDecl(Pos pos, java.lang.Iterable<Ast.DatatypeBind> binds)
-
datatypeBind
public Ast.DatatypeBind datatypeBind(Pos pos, Ast.Id name, java.lang.Iterable<Ast.TyVar> tyVars, java.lang.Iterable<Ast.TyCon> tyCons)
-
functionType
public Ast.FunctionType functionType(Pos pos, Ast.Type fromType, Ast.Type toType)
-
foldRight
private <E> E foldRight(java.util.List<E> list, java.util.function.BiFunction<E,E,E> fold)
-
aggregate
public Ast.Aggregate aggregate(Pos pos, Ast.Exp aggregate, Ast.Exp argument, Ast.Id id)
-
-