BCEL and IfThenElse construct

Discussion in 'Java' started by Thomas Zangl, May 4, 2005.

  1. Thomas Zangl

    Thomas Zangl Guest

    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,
    --
    ----------------------------------------------------------------
    ,yours Thomas Zangl - -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/
     
    Thomas Zangl, May 4, 2005
    #1
    1. Advertising

  2. Thomas Zangl wrote:
    > 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: ...


    --
    Daniel Sjöblom
    Remove _NOSPAM to reply by mail
     
    =?ISO-8859-1?Q?Daniel_Sj=F6blom?=, May 4, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Thomas Zangl

    [BCEL] If then else construct - again

    Thomas Zangl, May 13, 2005, in forum: Java
    Replies:
    4
    Views:
    842
    =?ISO-8859-1?Q?Daniel_Sj=F6blom?=
    May 13, 2005
  2. Replies:
    1
    Views:
    804
    Thomas Hawtin
    Sep 7, 2005
  3. Francesco Devittori

    ASM (vs. BCEL) - can I do this?

    Francesco Devittori, Dec 20, 2005, in forum: Java
    Replies:
    2
    Views:
    1,336
    Francesco Devittori
    Dec 21, 2005
  4. desktop

    IfThenElse template

    desktop, May 13, 2007, in forum: C++
    Replies:
    3
    Views:
    289
    Markus Schoder
    May 13, 2007
  5. Mukesh
    Replies:
    4
    Views:
    628
    Paul N
    Mar 26, 2010
Loading...

Share This Page