private static MethodInvocationTarget parseMethodInvocationPattern(
String mip
) throws CompileException, IOException {
MethodInvocationTarget mit = new MethodInvocationTarget();
Scanner scanner = new Scanner(null, new StringReader(mip));
Parser parser = new Parser(scanner);
for (;;) {
String s = JGrep.readIdentifierPattern(parser);
if (parser.peekOperator("(")) {
mit.methodNamePattern = s;
parser.eatToken();
List l = new ArrayList();
if (!parser.peekOperator(")")) {
for (;;) {
l.add(JGrep.readIdentifierPattern(parser));
if (parser.peekOperator(")")) break;
parser.readOperator(",");
}
}
mit.optionalArgumentTypeNamePatterns = (String[]) l.toArray(new String[l.size()]);
return mit;
} else
if (parser.peekOperator(".")) {
if (mit.optionalClassNamePattern == null) {
mit.optionalClassNamePattern = s;
} else
{
mit.optionalClassNamePattern += '.' + s;
}
parser.eatToken();
} else
if (scanner.peek().isEOF()) {
mit.methodNamePattern = s;
return mit;
}