checking in stuff
[IRC.git] / Robust / JavaGrammar / Lex / Identifier.java
diff --git a/Robust/JavaGrammar/Lex/Identifier.java b/Robust/JavaGrammar/Lex/Identifier.java
new file mode 100644 (file)
index 0000000..1d90994
--- /dev/null
@@ -0,0 +1,17 @@
+package Lex;
+
+import java_cup.runtime.Symbol;
+
+public class Identifier extends Token {
+  String identifier;
+  public Identifier(String identifier) { this.identifier=identifier; }
+
+  public String toString() { return "Identifier <"+identifier+">"; }
+
+  /* Ben Walter <bwalter@mit.edu> correctly pointed out that
+   * the first released version of this grammar/lexer did not
+   * return the string value of the identifier in the parser token.
+   * Should be fixed now. ;-) <cananian@alumni.princeton.edu>
+   */
+  Symbol token() { return new Symbol(Sym.IDENTIFIER, identifier); }
+}