RENode.Group group = new RENode.Group(disjunction1, GroupType.CAPTURING_GROUP); RENode.Alternative alternative1 = new RENode.Alternative(group); alternative.replaceBy(alternative1); disjunction.setAlternative( new RENode.Alternative( new RENode.Group( new RENode.Disjunction(), GroupType.CAPTURING_GROUP))); new RENode.Disjunction( new RENode.Alternative( new RENode.Group( new RENode.Disjunction(), GroupType.CAPTURING_GROUP))));
RENode.Group group = new RENode.Group(disjunction1, GroupType.CAPTURING_GROUP); RENode.Alternative alternative1 = new RENode.Alternative(group); alternative.replaceBy(alternative1); disjunction.setAlternative( new RENode.Alternative( new RENode.Group( new RENode.Disjunction(), GroupType.CAPTURING_GROUP))); new RENode.Disjunction( new RENode.Alternative( new RENode.Group( new RENode.Disjunction(), GroupType.CAPTURING_GROUP))));
disjunction.clearNext(); RENode.Alternative group = new RENode.Alternative( new RENode.Group( new RENode.Disjunction(alternative, next), GroupType.CAPTURING_GROUP)); disjunction.setAlternative(group); new RENode.Group( new RENode.Disjunction(alternative), GroupType.CAPTURING_GROUP)); disjunction.setAlternative(group); disjunction.clearNext(); RENode.Alternative group = new RENode.Alternative( new RENode.Group( new RENode.Disjunction(next), GroupType.CAPTURING_GROUP)); disjunction.setAlternative(group); new RENode.Group( new RENode.Disjunction(), GroupType.CAPTURING_GROUP)); disjunction.setAlternative(group);
disjunction.clearNext(); RENode.Alternative group = new RENode.Alternative( new RENode.Group( new RENode.Disjunction(alternative, next), GroupType.CAPTURING_GROUP)); disjunction.setAlternative(group); new RENode.Group( new RENode.Disjunction(alternative), GroupType.CAPTURING_GROUP)); disjunction.setAlternative(group); disjunction.clearNext(); RENode.Alternative group = new RENode.Alternative( new RENode.Group( new RENode.Disjunction(next), GroupType.CAPTURING_GROUP)); disjunction.setAlternative(group); new RENode.Group( new RENode.Disjunction(), GroupType.CAPTURING_GROUP)); disjunction.setAlternative(group);
public RENode.Expr parseExpression() throws SyntaxException { RENode.Expr expr; if (lexer.next(Kind.BEGIN)) { expr = new RENode.Assertion.Begin(); } else if (lexer.next(Kind.END)) { expr = new RENode.Assertion.End(); } else if (lexer.next(Kind.GROUP_OPEN)) { GroupType groupType = GroupType.forPrefix(lexer.getToken()); RENode.Disjunction group = parseDisjunction(); if (lexer.next(Kind.GROUP_CLOSE)) { expr = new RENode.Group(group, groupType); } else { throw new SyntaxException("Group not closed "); } } else { expr = parseCharacter(); } if (expr != null) { Quantifier quantifier = parseQuantifier(); if (quantifier != null) { expr.setQuantifier(quantifier); } } return expr; }
public RENode.Expr parseExpression() throws SyntaxException { RENode.Expr expr; if (lexer.next(Kind.BEGIN)) { expr = new RENode.Assertion.Begin(); } else if (lexer.next(Kind.END)) { expr = new RENode.Assertion.End(); } else if (lexer.next(Kind.GROUP_OPEN)) { GroupType groupType = GroupType.forPrefix(lexer.getToken()); RENode.Disjunction group = parseDisjunction(); if (lexer.next(Kind.GROUP_CLOSE)) { expr = new RENode.Group(group, groupType); } else { throw new SyntaxException("Group not closed "); } } else { expr = parseCharacter(); } if (expr != null) { Quantifier quantifier = parseQuantifier(); if (quantifier != null) { expr.setQuantifier(quantifier); } } return expr; }