I guess it shoud return next portion of script, but I donot know exactly.
The approach I suggested is found by experiments.
 
Valeri
-----Original Message-----
From: Achyuth [mailto:achyuth_k@huawei.com]
Sent: Friday, December 17, 2004 10:55 AM
To: beanshell-users@lists.sourceforge.net
Cc: Kireitchik, Valeri
Subject: RE: [Beanshell-users] How much java syntax validation is supported?

Thank you Valeri for your reply.

 

I have one more thing to ask you. What does the parser.Line() function call do? The javadoc of bean shell provides me no explanation

 

Regards,

Achyuth

(Huawei Technologies India Pvt. Ltd.)

 

-----Original Message-----
From: beanshell-users-admin@lists.sourceforge.net [mailto:beanshell-users-admin@lists.sourceforge.net] On Behalf Of Kireitchik, Valeri
Sent: Friday, December 17, 2004 12:37 PM
To: achyuth_k@huawei.com; beanshell-users@lists.sourceforge.net
Subject: RE: [Beanshell-users] How much java syntax validation is supported?

 

I can try to explain: If you use Interpreter#eval you have the following:

1st interpreted int Function(){...}

Then interpreted return 1;

Interpretation stops. Remainning } is not interpreted.

 

In order to make syntaxis validation of the whole script try this:

          Parser parser = new Parser(new StringBufferInputStream(script));
          while (! (parser.Line())) {
          }

Best regards

 

Valeri

-----Original Message-----
From: beanshell-users-admin@lists.sourceforge.net [mailto:beanshell-users-admin@lists.sourceforge.net]On Behalf Of Achyuth
Sent: Friday, December 17, 2004 8:56 AM
To: beanshell-users@lists.sourceforge.net
Subject: [Beanshell-users] How much java syntax validation is supported?

Hi,

 

I am using beanshell to validate some scripts. I want to know to what extent beanshell is validating the script(syntactically)?

 

I tried this: (just a sample)

int Function()

{

            int a = 10;

            b = 10 + a;

}

return 1;

}

 

Beanshell takes this to be valid. Is there any document that can help me out with this?

 

Thank you,

Kind Regards,

Achyuth