// i points at the identifier you think may be a standard function invocation // This function tries to distinguish those invocations from method declarations. scope tok_isMethodDeclarationNotSFInvocation // these prefix tokens mark a non-invocation (TODO: expand) static Set #pre = lithashset( ".", "void", "S", "String", "int", "bool", "boolean", "A", "Object", "O", "]", "double", "float", "short", "char", "long"); sbool tok_isMethodDeclarationNotSFInvocation(LS tok, int i, S mainClassName, IPred isKnownClassName) { if (i == 1) false; S prev = tok.get(i-2); if (eq(prev, ".") && eqGet(tok, i-4, mainClassName)) false; if (pre.contains(prev)) true; if (isKnownClassName != null && isKnownClassName.get(prev)) true; false; }