public interface ITokenHandle
package test.interfaceDemo; import gudusoft.gsqlparser.*; import junit.framework.TestCase; class myTokenHandle implements ITokenHandle{ public boolean processToken(TSourceToken st){ if (st.toString().equalsIgnoreCase("limit")){ st.tokencode = TBaseType.cmtslashstar;//treat this token as a comment } return true; } } public class testITokenHandle extends TestCase { public void test1(){ TGSqlParser sqlparser = new TGSqlParser(EDbVendor.dbvmysql); sqlparser.sqltext = "select * from dual limit"; sqlparser.setTokenHandle(new myTokenHandle()); assertTrue(sqlparser.parse() == 0); } }
Modifier and Type | Method and Description |
---|---|
boolean |
processToken(TSourceToken st) |
boolean processToken(TSourceToken st)
Copyright © 2019. All rights reserved.