Hi,
I have some piece of code which I want to convert to Java using the
BCEL. Methodcalls etc work fine but now I am stuck with the "if then
else" structure.
Can someone please post an example for something simple like:
if y > x then
Foo()
else
Bar()
TIA!
Best regards,

Signature
----------------------------------------------------------------
,yours Thomas Zangl -thomas@tzi.dhs.org- -TZ1-6BONE-
-http://tzi.dhs.org - http://www.borg-kindberg.ac.at
Use YAMC! now! Get it at http://www.borg-kindberg.ac.at/yamc/
Daniel Sjöblom - 04 May 2005 20:01 GMT
> Hi,
>
> I have some piece of code which I want to convert to Java using the
> BCEL. Methodcalls etc work fine but now I am stuck with the "if then
> else" structure.
It is unclear what exactly you want to convert to java. If you meant to
write java bytecode, then see below.
> Can someone please post an example for something simple like:
>
> if y > x then
> Foo()
> else
> Bar()
Bytecode:
...
iload_y
iload_x
IF: if_icmple ELSE
invokexxx Foo
goto END_IF
ELSE:
invokexxx Bar
END_IF: ...

Signature
Daniel Sjöblom
Remove _NOSPAM to reply by mail