summaryrefslogtreecommitdiff
path: root/sources/meta
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-04-23 14:14:42 +0000
committerpaltherr <paltherr@epfl.ch>2003-04-23 14:14:42 +0000
commit544dd4f57ec5a932e3324fe11a6374d95a0f6c06 (patch)
tree7b77d8e65923d6a6d169160647d8b8f70e0d3238 /sources/meta
parent336eabe34a6f6e0d0164c8812877ba81fcc087c1 (diff)
downloadscala-544dd4f57ec5a932e3324fe11a6374d95a0f6c06.tar.gz
scala-544dd4f57ec5a932e3324fe11a6374d95a0f6c06.tar.bz2
scala-544dd4f57ec5a932e3324fe11a6374d95a0f6c06.zip
- Added TreeFieldLink.java
Diffstat (limited to 'sources/meta')
-rw-r--r--sources/meta/scalac/ast/TreeFieldLink.java54
1 files changed, 54 insertions, 0 deletions
diff --git a/sources/meta/scalac/ast/TreeFieldLink.java b/sources/meta/scalac/ast/TreeFieldLink.java
new file mode 100644
index 0000000000..b338ccd6eb
--- /dev/null
+++ b/sources/meta/scalac/ast/TreeFieldLink.java
@@ -0,0 +1,54 @@
+/* ____ ____ ____ ____ ______ *\
+** / __// __ \/ __// __ \/ ____/ SOcos COmpiles Scala **
+** __\_ \/ /_/ / /__/ /_/ /\_ \ (c) 2002, LAMP/EPFL **
+** /_____/\____/\___/\____/____/ **
+\* */
+
+// $Id$
+
+package meta.scalac.ast;
+
+/**
+ * This class describes the possible links between a given field of a
+ * tree and the symbol of that tree.
+ */
+public class TreeFieldLink {
+
+ //########################################################################
+ // Public Cases
+
+ /** Field is linked to the symbol's flags */
+ public case SymFlags;
+
+ /** Field is linked to the symbol's name */
+ public case SymName;
+
+ //########################################################################
+ // Public Methods
+
+ /** Returns the field or method to invoke to get the linked value. */
+ public String getLink() {
+ switch (this) {
+ case SymFlags:
+ return "flags";
+ case SymName:
+ return "name";
+ default:
+ throw new Error("unknown case: " + this);
+ }
+ }
+
+ /** Returns the name of this link. */
+ public String toString() {
+ switch (this) {
+ case SymFlags:
+ return "flags";
+ case SymName:
+ return "name";
+ default:
+ throw new Error("unknown case: " + this);
+ }
+ }
+
+ //########################################################################
+}