1 8 13 package jfun.parsec.tokens; 14 15 21 public final class Tokens { 22 29 public static <T> TypedToken<T> createTypedToken(final String text, T type){ 30 return new TypedToken<T>(text, type); 31 } 32 37 public static TokenReserved reserved(final String n){ 38 return new TokenReserved(n); 39 } 40 45 public static TokenWord word(final String n){return new TokenWord(n);} 46 47 53 @Deprecated 54 public static MyToken my(final String text, final int kind){ 55 return new MyToken(text, kind); 56 } 57 62 public static TokenDecimal decimal_literal(final String s){ 63 return new TokenDecimal(s); 64 } 65 70 public static Character char_literal(final char c){ 71 return new Character (c); 72 } 73 79 public static Long int_literal(final long n){ 80 return long_literal(n); 81 } 82 88 public static Long long_literal(final long n){ 89 return new Long (n); 90 } 91 98 public static TokenQuoted quoted_string(final String open, final String close, final String s){ 99 return new TokenQuoted(open, close, s); 100 } 101 106 public static String str_literal(final String s){ 107 return s; 108 } 109 113 public static TokenEof eof(){ 114 return TokenEof.instance(); 115 } 116 } 117 118 | Popular Tags |