@Test @DisplayName("The syntax tree is flattened when there are multiple deel level of list of the same type") void flattenDeepExpressions() { var sut = FluentBuilder.from(MyClass.class) .syntax(" executor | help | ( executor|regex) | regex | (usage (executor |kw |( kw| kw)))"); sut.optimize(); Assertions.assertEquals("(executor|help|regex|(usage (executor|kw)))", sut.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();  }