Package net.hydromatic.morel.ast
Class AstNode
java.lang.Object
net.hydromatic.morel.ast.AstNode
- Direct Known Subclasses:
Ast.Aggregate,Ast.DatatypeBind,Ast.Decl,Ast.Exp,Ast.FromStep,Ast.FunBind,Ast.FunMatch,Ast.Match,Ast.OrderItem,Ast.Pat,Ast.TyCon,Ast.Type,Ast.ValBind,Core.BaseNode
Abstract syntax tree node.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract AstNodeAccepts a shuttle, calling theShuttle.visit(net.hydromatic.morel.ast.Ast.Literal)method appropriate to the type of this node, and returning the result.abstract voidAccepts a visitor, calling theShuttle.visit(net.hydromatic.morel.ast.Ast.Literal)method appropriate to the type of this node, and returning the result.final StringtoString()Converts this node into an ML string.final StringConverts this node into an ML string, with a given writer.(package private) abstract AstWriter
-
Field Details
-
pos
-
op
-
-
Constructor Details
-
AstNode
-
-
Method Details
-
toString
Converts this node into an ML string.The purpose of this string is debugging. If you want to generate an expression, use
unparse(net.hydromatic.morel.ast.AstWriter), which will insert parentheses as necessary for operator precedence.Derived classes may override, but they must produce the same result; so the only reason to override is if they can do it more efficiently.
-
unparse
Converts this node into an ML string, with a given writer. -
unparse
-
accept
Accepts a shuttle, calling theShuttle.visit(net.hydromatic.morel.ast.Ast.Literal)method appropriate to the type of this node, and returning the result. -
accept
Accepts a visitor, calling theShuttle.visit(net.hydromatic.morel.ast.Ast.Literal)method appropriate to the type of this node, and returning the result.
-