summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorburaq <buraq@epfl.ch>2004-07-14 14:05:53 +0000
committerburaq <buraq@epfl.ch>2004-07-14 14:05:53 +0000
commit000f4bea97f55d7a71e97ed42c764cea09f2f27e (patch)
tree6ab17ea02c6c583aa4000c35f5cc97f99a7ee708 /sources
parent15bccea34e297fbd12ccd3ba644c561bda139c50 (diff)
downloadscala-000f4bea97f55d7a71e97ed42c764cea09f2f27e.tar.gz
scala-000f4bea97f55d7a71e97ed42c764cea09f2f27e.tar.bz2
scala-000f4bea97f55d7a71e97ed42c764cea09f2f27e.zip
patterns
Diffstat (limited to 'sources')
-rw-r--r--sources/scala/runtime/matching/PatternGrammar.scala17
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;
+}