use of net.sourceforge.sqlexplorer.parsers.scp.StructuredCommentException in project tdq-studio-se by Talend.
the class BasicQueryParser method parse.
/* (non-JavaDoc)
* @see net.sourceforge.sqlexplorer.parsers.QueryParser#parse()
*/
public void parse() throws ParserException {
if (sql == null)
return;
Preferences prefs = SQLExplorerPlugin.getDefault().getPluginPreferences();
if (prefs.getBoolean(IConstants.ENABLE_STRUCTURED_COMMENTS)) {
StringBuffer buffer = new StringBuffer(sql.toString());
Tokenizer tokenizer = new Tokenizer(buffer);
StructuredCommentParser structuredComments = new StructuredCommentParser(this, buffer);
// Otherwise just use a standard tokenizer
try {
Token token;
while ((token = tokenizer.nextToken()) != null) {
if (token.getTokenType() == Tokenizer.TokenType.EOL_COMMENT || token.getTokenType() == Tokenizer.TokenType.ML_COMMENT) {
structuredComments.addComment(token);
}
}
} catch (StructuredCommentException e) {
}
// Do the structured comments and then reset the tokenizer
structuredComments.process();
tokenizer.reset();
tokenizer = null;
sql = buffer;
}
_sQuerys = prepareSQL(sql.toString());
_sNextQuery = doParse();
sql = null;
}
Aggregations