id = ((TokenPattern) getValue(child, 0)).getId();
break;
case GrammarConstants.LEFT_PAREN:
case GrammarConstants.LEFT_BRACE:
case GrammarConstants.LEFT_BRACKET:
ProductionPatternElement elem;
if (child.getId() == GrammarConstants.LEFT_BRACE) {
min = 0;
max = -1;
} else if (child.getId() == GrammarConstants.LEFT_BRACKET) {
min = 0;
max = 1;
}
elem = getProductionElement(getChildAt(node, 1));
token = elem.isToken();
id = elem.getId();
break;
}
// Handle optional '?', '*' or '+'
child = getChildAt(node, node.getChildCount() - 1);
if (child.getId() == GrammarConstants.QUESTION_MARK) {
min = 0;
max = 1;
} else if (child.getId() == GrammarConstants.ASTERISK) {
min = 0;
max = -1;
} else if (child.getId() == GrammarConstants.PLUS_SIGN) {
min = 1;
max = -1;
}
// Create production pattern element
node.addValue(new ProductionPatternElement(token, id, min, max));
return node;
}