Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2005

Tip: Looking for answers? Try searching our database.

BCEL and IfThenElse construct

Thread view: 
Thomas Zangl - 04 May 2005 19:39 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.

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



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.