     (doseq [[k v] (sort @*tokmap*)]
       (println k ": " v))))
 
+(defn tok [^long i]
+  (@*tokmap* i))
+
 (defn- setrules [^String grammar]
-  (let [lexname (str grammar "Lexer")
+  (let [lexname grammar ;; (str grammar "Lexer")
         lxr (eval `(new ~(Class/forName lexname) nil))
         rules (.getRuleNames lxr)
         rulemap (.getRuleIndexMap lxr)]

  [^String grammar ;; e.g. "org.mobileink.antlr.sym"
   ^String the-string ;; file to scan
   ]
  (let [lexname (str grammar "Lexer")
        strinput (ANTLRInputStream. the-string)
        lxr (eval `(new ~(Class/forName lexname) nil))
        devnull (.setInputStream lxr strinput)

   ^String file ;; file to parse
   ]
  (let [
        lexname grammar ;; (str grammar "Lexer")
        infile (ANTLRFileStream. file)
        lxr (eval `(new ~(Class/forName lexname) nil))
        devnull (.setInputStream lxr infile)
