public void tokenise() {

        try {
            file = readFile(fileLocation);

        } catch (IOException e) {
            e.printStackTrace();
        }
        file = file.replaceAll("\\s", "");

        tokens.clear();
        while (!file.equals("")) {
            boolean match = false;


            for (TokenInfo info : tokenInfos) {
                Matcher m = info.regex.matcher(file);
                if (m.find()) {
                    match = true;
                    String tok = m.group().trim();
                    tokens.add(new Token(info.token, tok));
                    file = m.replaceFirst("");
                }
            }

            if (!match) {

                throw new RuntimeException("Unexpected character in input: " + file);

            }
        }
    }