Hello,

I am parsing JavaScript file using org.mozilla.javascript.Parser.
Inside the function call, i am looking for an expression say
(nokia.device.load("camera");). What is the way to get this
expression? can I have some sample code? this is something urgent...
sample JavaScript code is below:

function init()
{
        if (window.menu) {
                nokia.device.load("camera");
        // set tab-navigation mode and hide softkeys
        widget.setNavigationEnabled(false);

                // create menu
                var photoSetsMenuItem = new MenuItem("Photo Sets", 1001);
                photoSetsMenuItem.onSelect = showPhotoSetView;
                menu.append(photoSetsMenuItem);

                menu.showSoftkeys();
    }

Java code used to parse:

ScriptOrFnNode tree = p.parse(source, path, 1);
FunctionNode fun = tree.getFunctionNode(tree.getFunctionCount()-1);
Node node = fun.getFirstChild();

>From here on i didnt find a way to get that expression..

Thank you,
Mallikarjun.
_______________________________________________
dev-tech-js-engine-rhino mailing list
dev-tech-js-engine-rhino@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to