diff options
-rw-r--r-- | sources/scala/runtime/matching/PatternGrammar.scala | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sources/scala/runtime/matching/PatternGrammar.scala b/sources/scala/runtime/matching/PatternGrammar.scala new file mode 100644 index 0000000000..6fcb210b7e --- /dev/null +++ b/sources/scala/runtime/matching/PatternGrammar.scala @@ -0,0 +1,17 @@ +package scala.runtime.matching ; + +import scala.util.alphabet.IntAlphabet ; +import scala.collection.{ immutable, mutable, Map, Set }; + +/** runtime representation of patterns. This class augments + * scala.util.grammar.TreeHedgeGrammar, with an abstract representation + * of variable bindings. Variables are simply consecutive integers, + * following pre-order of occurrence in pattern + * @caseVars an array, field i holding the number of variables in case i + */ +abstract class PatternGrammar extends scala.util.grammar.ImmutableTreeHedgeGrammar[IntAlphabet] { + + val vars:Array[Int]; + + def test(test:Int, inp:Any): Boolean; +} |