Package net.hydromatic.morel.ast
Class Core.Pat
java.lang.Object
net.hydromatic.morel.ast.AstNode
net.hydromatic.morel.ast.Core.BaseNode
net.hydromatic.morel.ast.Core.Pat
- Direct Known Subclasses:
Core.Con0Pat,Core.ConPat,Core.ListPat,Core.LiteralPat,Core.NamedPat,Core.RecordPat,Core.TuplePat,Core.WildcardPat
- Enclosing class:
Core
Base class for a pattern.
For example, "x" in "val x = 5" is a Core.IdPat; the "(x, y) in "val
(x, y) = makePair 1 2" is a Core.TuplePat.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Core.PatAccepts a shuttle, calling theShuttle.visit(net.hydromatic.morel.ast.Ast.Literal)method appropriate to the type of this node, and returning the result.Converts this pattern to a string.type()Returns the type.Methods inherited from class net.hydromatic.morel.ast.Core.BaseNode
accept
-
Field Details
-
type
-
-
Constructor Details
-
Pat
-
-
Method Details
-
type
Returns the type. -
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.- Overrides:
acceptin classCore.BaseNode
-
describe
Converts this pattern to a string.The result is similar to that of
AstNode.toString(), except that identifiers are permuted. For example, if a pattern includes "c.3" and "c.2" but not "c.0" or "c.1", then "c.3" will be printed as "c" and "c.2" will be printed as "c.1".This behavior makes plans more concise if their local variables happen to have the same name as other variables that occur in functions in the session history.
-