@Test public void test8() throws ParseException { String expr = "(a AND b) OR NOT c"; assertEquals("a b AND c NOT OR", new PostfixExpression(expr).toString().trim()); }
@Override public String toString() { StringBuilder sb = new StringBuilder(); for (Token token : expr) { sb.append(token.name).append(" "); } return sb.toString(); }
PostfixExpression implements Iterable<PostfixExpression.Token> { @Override public String toString() { StringBuilder sb = new StringBuilder(); for (Token token : expr) { sb.append(token.name).append(" "); } return sb.toString(); } }
PostfixExpression implements Iterable<PostfixExpression.Token> { @Override public String toString() { StringBuilder sb = new StringBuilder(); for (Token token : expr) { sb.append(token.name).append(" "); } return sb.toString(); } PostfixExpression(String expr); }
PostfixExpression implements Iterable<PostfixExpression.Token> { @Override public String toString() { StringBuilder sb = new StringBuilder(); for (Token token : expr) { sb.append(token.name).append(" "); } return sb.toString(); } PostfixExpression(String expr); Token[] getExpression(); @Override Iterator<Token> iterator(); Object visit(Visitor visitor); @Override String toString(); }
PostfixExpression implements Iterable<PostfixExpression.Token> { @Override public String toString() { StringBuilder sb = new StringBuilder(); for (Token token : expr) { sb.append(token.name).append(" "); } return sb.toString(); } PostfixExpression(String expr); Token[] getExpression(); @Override Iterator<Token> iterator(); Object visit(Visitor visitor); @Override String toString(); static final int ARG; static final int NOT; static final int AND; static final int OR; static final int PARA; static final int LPARA; static final int RPARA; }