@Test @DisplayName("or-ed alternatives do not need parentheses, | has higher precedence than listing") void syntaxExample1() { var klass = FluentBuilder.from(MyClass.class); final var sut = klass.syntax("kw (parameter | (usage help))"); Assertions.assertEquals("kw (parameter|(usage help))", sut.toString()); final var sutWithoutParentheses = klass.syntax("kw parameter | (usage help)"); sut.optimize(); Assertions.assertEquals("kw (parameter|(usage help))", sutWithoutParentheses.toString()); }
public Syntax(Lexer lexer, FluentNodeCreator nodeCreator) { this.lexer = lexer; this.nodeCreator = nodeCreator; }
Syntax { public Syntax(Lexer lexer, FluentNodeCreator nodeCreator) { this.lexer = lexer; this.nodeCreator = nodeCreator; } }
Syntax { public Syntax(Lexer lexer, FluentNodeCreator nodeCreator) { this.lexer = lexer; this.nodeCreator = nodeCreator; } Syntax(Lexer lexer, FluentNodeCreator nodeCreator); }
Syntax { public Syntax(Lexer lexer, FluentNodeCreator nodeCreator) { this.lexer = lexer; this.nodeCreator = nodeCreator; } Syntax(Lexer lexer, FluentNodeCreator nodeCreator); List<Node> expression(); List<Node> subExpression(); List<Node> alternate(); List<Node> simple(); List<Node> terminal(); }
Syntax { public Syntax(Lexer lexer, FluentNodeCreator nodeCreator) { this.lexer = lexer; this.nodeCreator = nodeCreator; } Syntax(Lexer lexer, FluentNodeCreator nodeCreator); List<Node> expression(); List<Node> subExpression(); List<Node> alternate(); List<Node> simple(); List<Node> terminal();  }