Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Paring JavaScript using org.mozilla.javascript.Parser

66 views
Skip to first unread message

Mallikarjun nbsg

unread,
Apr 23, 2010, 1:18:13 AM4/23/10
to
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.

Parhs

unread,
Apr 23, 2010, 9:25:11 PM4/23/10
to

what do you mean get?

0 new messages