use of org.seasar.doma.internal.jdbc.sql.node.ForBlockNode in project doma by domaframework.
the class SqlParser method parseForBlockComment.
protected void parseForBlockComment() {
ForBlockNode forBlockNode = new ForBlockNode();
appendNode(forBlockNode);
push(forBlockNode);
String expr = tokenType.extract(token);
int pos = expr.indexOf(":");
if (pos == -1) {
throw new JdbcException(Message.DOMA2124, sql, tokenizer.getLineNumber(), tokenizer.getPosition());
}
String identifier = expr.substring(0, pos).trim();
if (identifier.isEmpty()) {
throw new JdbcException(Message.DOMA2125, sql, tokenizer.getLineNumber(), tokenizer.getPosition());
}
String expression = expr.substring(pos + 1).trim();
if (expression.isEmpty()) {
throw new JdbcException(Message.DOMA2126, sql, tokenizer.getLineNumber(), tokenizer.getPosition());
}
ForNode forNode = new ForNode(getLocation(), identifier, expression, token);
forBlockNode.setForNode(forNode);
push(forNode);
}
use of org.seasar.doma.internal.jdbc.sql.node.ForBlockNode in project doma by domaframework.
the class SqlParser method validate.
protected void validate() {
if (isAfterValueNode()) {
ValueNode valueNode = pop();
throw new JdbcException(Message.DOMA2110, sql, tokenizer.getLineNumber(), tokenizer.getPosition(), valueNode.getText());
}
if (isInIfBlockNode()) {
removeNodesTo(IfBlockNode.class);
IfBlockNode ifBlockNode = pop();
SqlLocation location = ifBlockNode.getIfNode().getLocation();
throw new JdbcException(Message.DOMA2133, sql, location.getLineNumber(), location.getPosition());
}
if (isInForBlockNode()) {
removeNodesTo(ForBlockNode.class);
ForBlockNode forBlockNode = pop();
SqlLocation location = forBlockNode.getForNode().getLocation();
throw new JdbcException(Message.DOMA2134, sql, location.getLineNumber(), location.getPosition());
}
}
Aggregations