private void factor() {
            this.currentToken = this.lexer.next();

            if (this.currentToken instanceof VariableToken) {
                Variable variable = new Variable();
                variable.variable = ((VariableToken) this.currentToken).string;
                this.root = variable;
                this.currentToken = this.lexer.next();
            } else if (this.currentToken == ConstantToken.NOT) {
                Not not = new Not();
                factor();
                not.child = this.root;
                this.root = not;
            } else if (this.currentToken == ConstantToken.OPEN_BRACKET) {
                exp();
                if (this.currentToken != ConstantToken.CLOSE_BRACKET) {
                    throw new ParserException("Brackets are not matched");
                }
                this.currentToken = this.lexer.next();
            } else {
                throw new ParserException("Malformed expression");
            }
        }
The current root of the AST
common/src/main/java/me/lucko/luckperms/common/verbose/expression/BooleanExpressionCompiler.java