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
public abstract class AstNode extends Object
Abstract 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.abstract voidaccept(Visitor visitor)Accepts a visitor, calling theShuttle.visit(net.hydromatic.morel.ast.Ast.Literal)method appropriate to the type of this node, and returning the result.StringtoString()Converts this node into an ML string.Stringunparse(AstWriter w)Converts this node into an ML string, with a given writer.(package private) abstract AstWriterunparse(AstWriter w, int left, int right)
-
-
-
Method Detail
-
toString
public final 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), 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
public final String unparse(AstWriter w)
Converts this node into an ML string, with a given writer.
-
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.
-
accept
public abstract void accept(Visitor visitor)
Accepts a visitor, calling theShuttle.visit(net.hydromatic.morel.ast.Ast.Literal)method appropriate to the type of this node, and returning the result.
-
-