初歩的なレクサーを実装しようとしています。現在、ファイルの解析に行き詰まっています。
public ArrayList<Token> ParseFile () {
    int lineIndex = 0;
    Scanner scanner = new Scanner(this.fileName);
    while (scanner.hasNextLine()) {
        lineIndex++;
        String line = scanner.nextLine();
        if (line.equals(""))
        continue;
        String[] split = line.split("\\s"); 
        for (String s : split) {
        if (s.equals("") || s.equals("\\s*") || s.equals("\t"))
        continue;
        Token token = new Token(s, lineIndex);
        parsedFile.add(token);
        }
    }
    scanner.close();
    return this.parsedFile;
}
これは「p++.ppp」と呼ばれる私のファイルです
#include<iostream>
using namespace std ;
int a ;
int b ;
int main ( ) {
    cin >> a ;
    cin >> b ;
    while ( a != b ) {
        if ( a > b )
            a = a - b ;
        if ( b > a )
            b = b - a ;
    }
    cout << b ;
    return 0 ;
}
ファイルを解析すると、次のようになりますError, token: p++.ppp on line: 1 is not valid。しかし、p++.ppp はファイル名です!
また、デバッグすると、ファイル名が読み取られ、scanner.hasNextLine()終了します。何が欠けていますか?