public int lookup(String name) { Object found = get(name); if (found == null) return -1; else return ((Integer)found).intValue(); }
private int readIdentifier(int c, Token token) { StringBuffer tbuf = textBuffer; tbuf.setLength(0); do { tbuf.append((char)c); c = getc(); } while (Character.isJavaIdentifierPart((char)c)); ungetc(c); String name = tbuf.toString(); int t = ktable.lookup(name); if (t >= 0) return t; else { /* tbuf.toString() is executed quickly since it does not * need memory copy. Using a hand-written extensible * byte-array class instead of StringBuffer is not a good idea * for execution speed. Converting a byte array to a String * object is very slow. Using an extensible char array * might be OK. */ token.textValue = name; return Identifier; } }
public void append(String name, int t) { put(name, t); } }
public int lookup(String name) { return containsKey(name) ? get(name) : -1; }
public void append(String name, int t) { put(name, new Integer(t)); } }
private int readIdentifier(int c, Token token) { StringBuffer tbuf = textBuffer; tbuf.setLength(0); do { tbuf.append((char)c); c = getc(); } while (Character.isJavaIdentifierPart((char)c)); ungetc(c); String name = tbuf.toString(); int t = ktable.lookup(name); if (t >= 0) return t; /* tbuf.toString() is executed quickly since it does not * need memory copy. Using a hand-written extensible * byte-array class instead of StringBuffer is not a good idea * for execution speed. Converting a byte array to a String * object is very slow. Using an extensible char array * might be OK. */ token.textValue = name; return Identifier; }
public int lookup(String name) { Object found = get(name); if (found == null) return -1; else return ((Integer)found).intValue(); }
public void append(String name, int t) { put(name, new Integer(t)); } }
private int readIdentifier(int c, Token token) { StringBuffer tbuf = textBuffer; tbuf.setLength(0); do { tbuf.append((char)c); c = getc(); } while (Character.isJavaIdentifierPart((char)c)); ungetc(c); String name = tbuf.toString(); int t = ktable.lookup(name); if (t >= 0) return t; else { /* tbuf.toString() is executed quickly since it does not * need memory copy. Using a hand-written extensible * byte-array class instead of StringBuffer is not a good idea * for execution speed. Converting a byte array to a String * object is very slow. Using an extensible char array * might be OK. */ token.textValue = name; return Identifier; } }
public int lookup(String name) { Object found = get(name); if (found == null) return -1; else return ((Integer)found).intValue(); }
public void append(String name, int t) { put(name, new Integer(t)); } }
private int readIdentifier(int c, Token token) { StringBuffer tbuf = textBuffer; tbuf.setLength(0); do { tbuf.append((char)c); c = getc(); } while (Character.isJavaIdentifierPart((char)c)); ungetc(c); String name = tbuf.toString(); int t = ktable.lookup(name); if (t >= 0) return t; else { /* tbuf.toString() is executed quickly since it does not * need memory copy. Using a hand-written extensible * byte-array class instead of StringBuffer is not a good idea * for execution speed. Converting a byte array to a String * object is very slow. Using an extensible char array * might be OK. */ token.textValue = name; return Identifier; } }
public int lookup(String name) { Object found = get(name); if (found == null) return -1; else return ((Integer)found).intValue(); }
public void append(String name, int t) { put(name, new Integer(t)); } }
private int readIdentifier(int c, Token token) { StringBuffer tbuf = textBuffer; tbuf.setLength(0); do { tbuf.append((char)c); c = getc(); } while (Character.isJavaIdentifierPart((char)c)); ungetc(c); String name = tbuf.toString(); int t = ktable.lookup(name); if (t >= 0) return t; else { /* tbuf.toString() is executed quickly since it does not * need memory copy. Using a hand-written extensible * byte-array class instead of StringBuffer is not a good idea * for execution speed. Converting a byte array to a String * object is very slow. Using an extensible char array * might be OK. */ token.textValue = name; return Identifier; } }
public int lookup(String name) { Object found = get(name); if (found == null) return -1; else return ((Integer)found).intValue(); }
public void append(String name, int t) { put(name, new Integer(t)); } }
private int readIdentifier(int c, Token token) { StringBuffer tbuf = textBuffer; tbuf.setLength(0); do { tbuf.append((char)c); c = getc(); } while (Character.isJavaIdentifierPart((char)c)); ungetc(c); String name = tbuf.toString(); int t = ktable.lookup(name); if (t >= 0) return t; else { /* tbuf.toString() is executed quickly since it does not * need memory copy. Using a hand-written extensible * byte-array class instead of StringBuffer is not a good idea * for execution speed. Converting a byte array to a String * object is very slow. Using an extensible char array * might be OK. */ token.textValue = name; return Identifier; } }
public int lookup(String name) { Object found = get(name); if (found == null) return -1; else return ((Integer)found).intValue(); }
public void append(String name, int t) { put(name, new Integer(t)); } }