tokenizer.addTerminator("\n", true);
tokenizer.addTerminator(";", false);
+ tokenizer.addTerminator("{", false);
+ tokenizer.addTerminator("}", false);
+ tokenizer.addTerminator("(", false);
+ tokenizer.addTerminator(")", false);
+ tokenizer.addTerminator("[", false);
+ tokenizer.addTerminator("]", false);
while (true) {
final TokenizerMatch match = tokenizer.getToken();
if (match.token.equals("import"))
parseImport(tokenizer);
+
+ if (match.token.equals("package"))
+ parsePackage(tokenizer);
+
}
}
private void parseImport(final Tokenizer tokenizer) {
final Import imp = new Import();
- final TokenizerMatch match = tokenizer.getToken();
+ TokenizerMatch match = tokenizer.getToken();
if (match.token.equals("static")) {
imp.isStatic = true;
imp.path = match.token;
imports.add(imp);
+
+ // ;
+ match = tokenizer.getToken();
+ }
+
+ private void parsePackage(final Tokenizer tokenizer) {
+
+ TokenizerMatch match = tokenizer.getToken();
+
+ System.out.println(match.token);
+
+ // ;
+ match = tokenizer.getToken();
}
private void readFile() throws FileNotFoundException, IOException {