orc.ast.extended.pattern
Class TypedPattern
java.lang.Object
orc.ast.extended.pattern.Pattern
orc.ast.extended.pattern.TypedPattern
- All Implemented Interfaces:
- ASTNode, Locatable, Located
public class TypedPattern
- extends Pattern
A pattern with a type ascription.
WARNING: The pattern simplifier will occasionally ignore type ascriptions because they
are not ascribed to attachments.
- Author:
- dkitchin
Method Summary |
|
accept(Visitor<E> visitor)
|
void |
process(Variable fragment,
PatternSimplifier visitor)
Visit a pattern recursively, creating two products:
An expression that will examine a value to determine
whether it matches a pattern, building an output tuple
of all value fragments which will be bound to variables. |
boolean |
strict()
|
java.lang.String |
toString()
|
Methods inherited from class orc.ast.extended.pattern.Pattern |
caseof, compare, condense, fail, getSourceLocation, lift, nth, process, setSourceLocation, trycons, trynil, trysize, unapply |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
p
public Pattern p
t
public Type t
TypedPattern
public TypedPattern(Pattern p,
Type t)
strict
public boolean strict()
- Overrides:
strict
in class Pattern
process
public void process(Variable fragment,
PatternSimplifier visitor)
throws PatternException
- Description copied from class:
Pattern
- Visit a pattern recursively, creating two products:
An expression that will examine a value to determine
whether it matches a pattern, building an output tuple
of all value fragments which will be bound to variables.
An expression transformer that will examine such an
output tuple and bind its elements to variables in
a given expression.
- Specified by:
process
in class Pattern
- Parameters:
fragment
- A variable holding the current fragment of the value to be matchedvisitor
- A visitor object which accumulates an expression and a transformer
- Throws:
PatternException
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
accept
public <E> E accept(Visitor<E> visitor)