summaryrefslogtreecommitdiff
path: root/sources/scalac/checkers/CheckSymbols.java
diff options
context:
space:
mode:
Diffstat (limited to 'sources/scalac/checkers/CheckSymbols.java')
-rw-r--r--sources/scalac/checkers/CheckSymbols.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/sources/scalac/checkers/CheckSymbols.java b/sources/scalac/checkers/CheckSymbols.java
new file mode 100644
index 0000000000..ab1a76ae2d
--- /dev/null
+++ b/sources/scalac/checkers/CheckSymbols.java
@@ -0,0 +1,36 @@
+/* ____ ____ ____ ____ ______ *\
+** / __// __ \/ __// __ \/ ____/ SOcos COmpiles Scala **
+** __\_ \/ /_/ / /__/ /_/ /\_ \ (c) 2002, LAMP/EPFL **
+** /_____/\____/\___/\____/____/ **
+\* */
+
+// $Id$
+
+package scalac.checkers;
+
+import scalac.ast.Tree;
+import scalac.symtab.Symbol;
+import scalac.Global;
+
+/**
+ * Verify that all tree nodes for which hasSymbol() is true have a
+ * non-null symbol.
+ *
+ * @author Michel Schinz
+ * @version 1.0
+ */
+
+public class CheckSymbols extends Checker {
+ public CheckSymbols(Global global) { super(global); }
+
+ public void check(Tree tree) {
+ verify(tree,
+ implies(tree.hasSymbol(), tree.symbol() != null),
+ "symbol not null",
+ "hasSymbol => symbol not null");
+ verify(tree,
+ implies(tree.hasSymbol(), tree.symbol() != Symbol.NONE),
+ "symbol not NONE",
+ "hasSymbol => symbol not NONE");
+ }
+}