Skip to content

[feature] chaining blocks and instructions #97

@glelouet

Description

@glelouet

I think it may be better to have some kind of navigation inside the blocks. Typically I can create a sub block in a JBlock, why not also be able to go back ?

Here is an example : to represent

if(a) {
 for(int i=0;i>0;){ }
} else {
 while(true){}
}

a call would be ( assuming bl is the current block)

bl._if(a) // create a if and go in the then block
 ._for(integer, "i", lit(0)) // create a for 
 .test(fr->fr.var("i").lt(a 0)) // make the <0
.update() // and go in the for block with a new variable
 .up() // return in the then
 .elseBlock()
 ._while(cm.true);

I started working on this in the branch https://github.com/guiguilechat/jcodemodel/tree/blockrework

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions