+ parse();
+ }
+
+ public void parse() throws IOException {
+ System.out.println("java file: " + file);
+
+ readFile();
+
+ final Tokenizer tokenizer = new Tokenizer(contents.toString());
+ tokenizer.addTerminator(" ", true);
+ tokenizer.addTerminator("\t", true);
+ tokenizer.addTerminator("\n", true);
+
+ tokenizer.addTerminator(";", false);
+
+ while (true) {
+ final TokenizerMatch match = tokenizer.getToken();
+ if (match == null)
+ break;
+
+ if (match.token.equals("import"))
+ parseImport(tokenizer);
+ }
+
+ }
+
+ private void parseImport(final Tokenizer tokenizer) {
+ final Import imp = new Import();
+
+ final TokenizerMatch match = tokenizer.getToken();
+
+ if (match.token.equals("static")) {
+ imp.isStatic = true;
+ imp.path = tokenizer.getToken().token;
+ } else
+ imp.path = match.token;
+
+ imports.add(imp);