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.FunBind,Ast.FunMatch,Ast.Match,Ast.Pat,Ast.TyCon,Ast.Type,Ast.ValBind
public abstract class AstNode extends java.lang.ObjectAbstract syntax tree node.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract AstNodeaccept(Shuttle shuttle)Accepts a shuttle, calling theShuttle.visit(net.hydromatic.morel.ast.Ast.Literal)method appropriate to the type of this node, and returning the result.java.lang.StringtoString()Converts this node into an ML string.(package private) abstract AstWriterunparse(AstWriter w, int left, int right)
-
-
-
Method Detail
-
toString
public final java.lang.String 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, int, int), 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.
- Overrides:
toStringin classjava.lang.Object
-
accept
public abstract AstNode accept(Shuttle shuttle)
Accepts a shuttle, calling theShuttle.visit(net.hydromatic.morel.ast.Ast.Literal)method appropriate to the type of this node, and returning the result.
-
-