Package net.hydromatic.morel.ast
Class Ast.AsPat
java.lang.Object
net.hydromatic.morel.ast.AstNode
net.hydromatic.morel.ast.Ast.Pat
net.hydromatic.morel.ast.Ast.AsPat
- Enclosing class:
Ast
Layered pattern.
For example, in "val h as (i, j) = (1, 2)", if the pattern matches, "h" is assigned the whole tuple, and "i" and "j" are assigned the left and right members of the tuple.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAccepts a shuttle, calling theShuttle.visit(net.hydromatic.morel.ast.Ast.Literal)method appropriate to the type of this node, and returning the result.voidAccepts a visitor, calling theShuttle.visit(net.hydromatic.morel.ast.Ast.Literal)method appropriate to the type of this node, and returning the result.Creates a copy of thisAsPatwith given contents, orthisif the contents are the same.voidforEachArg(ObjIntConsumer<Ast.Pat> action) (package private) AstWriter
-
Field Details
-
id
-
pat
-
-
Constructor Details
-
AsPat
-
-
Method Details
-
accept
Description copied from class:AstNodeAccepts a shuttle, calling theShuttle.visit(net.hydromatic.morel.ast.Ast.Literal)method appropriate to the type of this node, and returning the result. -
accept
Description copied from class:AstNodeAccepts a visitor, calling theShuttle.visit(net.hydromatic.morel.ast.Ast.Literal)method appropriate to the type of this node, and returning the result. -
forEachArg
- Overrides:
forEachArgin classAst.Pat
-
unparse
-
copy
Creates a copy of thisAsPatwith given contents, orthisif the contents are the same.
-