public SourcePosition getPosition() {
        // Find the toplevel.  From there use a tree-walking utility
        // that finds the tree for our symbol, and with it the position.
        Env<AttrContext> enterEnv = getEnterEnv();
        if (enterEnv == null)
            return null;
        JCTree.JCCompilationUnit toplevel = enterEnv.toplevel;
        JavaFileObject sourcefile = toplevel.sourcefile;
        if (sourcefile == null)
            return null;
        int pos = TreeInfo.positionFor(sym, toplevel);

        return new SourcePositionImpl(sourcefile, pos, toplevel.lineMap);
    }