public List<Token> tokensToList(Lexer lexer) {
        Token lastToken = null;
        List<Token> tokens = new LinkedList<>();

        for (Token token : lexer) {
            if(token.getType().equals(LexerType.OPENING_PARENTHESIS)
                    && lastToken != null
                    && (lastToken.getType().equals(LexerType.CLOSING_PARENTHESIS)
                    || lastToken.getType().equals(LexerType.VALUE))) {
                tokens.add(new Token("*", LexerType.OPERATOR));
                tokens.add(new Token(token.getOperator(), token.getType()));
            } else {
                tokens.add(new Token(token.getOperator(), token.getType()));
            }

            lastToken = token;
        }
        
        return tokens;
    }