1 package org.hibernate.hql.ast; 3 4 import java.io.InputStream ; 5 import java.io.Reader ; 6 7 import antlr.Token; 8 import org.hibernate.QueryException; 9 import org.hibernate.hql.antlr.HqlBaseLexer; 10 11 15 class HqlLexer extends HqlBaseLexer { 16 19 private boolean possibleID = false; 20 21 public HqlLexer(InputStream in) { 22 super( in ); 23 } 24 25 public HqlLexer(Reader in) { 26 super(in); 27 } 28 29 public void setTokenObjectClass(String cl) { 30 super.setTokenObjectClass( HqlToken.class.getName() ); 32 } 33 34 protected void setPossibleID(boolean possibleID) { 35 this.possibleID = possibleID; 36 } 37 38 protected Token makeToken(int i) { 39 HqlToken token = ( HqlToken ) super.makeToken( i ); 40 token.setPossibleID( possibleID ); 41 possibleID = false; 42 return token; 43 } 44 45 public int testLiteralsTable(int i) { 46 int ttype = super.testLiteralsTable( i ); 47 return ttype; 48 } 49 50 public void panic() { 51 panic("CharScanner: panic"); 53 } 54 55 public void panic(String s) { 56 throw new QueryException(s); 58 } 59 } 60 | Popular Tags |