// Path: src/main/java/me/legrange/mikrotik/impl/Scanner.java
// enum Token {
// 
//     SLASH("/"), COMMA(","), EOL(), WS, TEXT,
//     LESS("<"), MORE(">"), EQUALS("="), NOT_EQUALS("!="), PIPE("!"),
//     LEFT_BRACKET("("), RIGHT_BRACKET(")"),
//     WHERE, NOT, AND, OR, RETURN;
// 
//     @Override
//     public String toString() {
//         return (symb == null) ? name() : symb;
//     }
// 
//     private Token(String symb) {
//         this.symb = symb;
//     }
// 
//     private Token() {
//         symb = null;
//     }
// 
//     private final String symb;
// }


import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import me.legrange.mikrotik.impl.Scanner.Token;
package me.legrange.mikrotik.impl;



/**
 * Parse the pseudo-command line into command objects.
 *
 * @author GideonLeGrange
 */
class Parser {

    /**
     * parse the given bit of text into a Command object
     */
    static Command parse(String text) throws ParseException {
        Parser parser = new Parser(text);
        return parser.parse();
    }

    /**
     * run parse on the internal data and return the command object
     */
    private Command parse() throws ParseException {
        command();
// Path: src/main/java/me/legrange/mikrotik/impl/Scanner.java
// enum Token {
// 
//     SLASH("/"), COMMA(","), EOL(), WS, TEXT,
//     LESS("<"), MORE(">"), EQUALS("="), NOT_EQUALS("!="), PIPE("!"),
//     LEFT_BRACKET("("), RIGHT_BRACKET(")"),
//     WHERE, NOT, AND, OR, RETURN;
// 
//     @Override
//     public String toString() {
//         return (symb == null) ? name() : symb;
//     }
// 
//     private Token(String symb) {
//         this.symb = symb;
//     }
// 
//     private Token() {
//         symb = null;
//     }
// 
//     private final String symb;
// }


// Path: src/main/java/me/legrange/mikrotik/impl/Parser.java
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import me.legrange.mikrotik.impl.Scanner.Token;

package me.legrange.mikrotik.impl;



/**
 * Parse the pseudo-command line into command objects.
 *
 * @author GideonLeGrange
 */
class Parser {

    /**
     * parse the given bit of text into a Command object
     */
    static Command parse(String text) throws ParseException {
        Parser parser = new Parser(text);
        return parser.parse();
    }

    /**
     * run parse on the internal data and return the command object
     */
    private Command parse() throws ParseException {
        command();
        while (!is(Token.WHERE, Token.RETURN, Token.EOL)) {