public static Expr parse(Query query, String s, boolean checkAllUsed)
{
try {
Reader in = new StringReader(s) ;
ARQParser parser = new ARQParser(in) ;
parser.setQuery(query) ;
Expr expr = parser.Expression() ;
if ( checkAllUsed )
{
Token t = parser.getNextToken() ;
if ( t.kind != ARQParserTokenManager.EOF )
throw new QueryParseException("Extra tokens beginning \""+t.image+"\" starting line "+t.beginLine+", column "+t.beginColumn,
t.beginLine, t.beginColumn) ;
}
return expr ;