JSCodeModel codeModel = new CodeModelImpl();
JSProgram program = codeModel.program();
JSFunctionDeclaration f = program.functionDeclaration("f");
JSVariable x = f.parameter("x");
JSVariable y = f.parameter("y");
JSFunctionBody body = f.getBody();
JSBlock assignmentExpressions = body.block();
assignmentExpressions.expression(x.assign(y));
assignmentExpressions.expression(x.mulAssign(y));
assignmentExpressions.expression(x.divAssign(y));
assignmentExpressions.expression(x.modAssign(y));
assignmentExpressions.expression(x.plusAssign(y));
assignmentExpressions.expression(x.minusAssign(y));
assignmentExpressions.expression(x.shlAssign(y));
assignmentExpressions.expression(x.shrAssign(y));
assignmentExpressions.expression(x.shrzAssign(y));
assignmentExpressions.expression(x.bandAssign(y));
assignmentExpressions.expression(x.borAssign(y));
assignmentExpressions.expression(x.xorAssign(y));
JSBlock conditionalExpressions = assignmentExpressions.block();
conditionalExpressions.expression(x.cond(y, y.not()));
JSBlock logicalORExpressions = conditionalExpressions.block();
logicalORExpressions.expression(x.or(y));
JSBlock logicalANDExpressions = logicalORExpressions.block();
logicalANDExpressions.expression(x.and(y));
JSBlock bitwiseORExpressions = logicalANDExpressions.block();
bitwiseORExpressions.expression(x.bor(y));
JSBlock bitwiseXORExpressions = bitwiseORExpressions.block();
bitwiseXORExpressions.expression(x.xor(y));
JSBlock bitwiseANDExpressions = bitwiseXORExpressions.block();
bitwiseANDExpressions.expression(x.band(y));
JSBlock equalityExpressions = bitwiseANDExpressions.block();
equalityExpressions.expression(x.eq(y));
equalityExpressions.expression(x.ne(y));
equalityExpressions.expression(x.eeq(y));
equalityExpressions.expression(x.nee(y));
JSBlock relationalExpressions = equalityExpressions.block();
relationalExpressions.expression(x.lt(y));
relationalExpressions.expression(x.gt(y));
relationalExpressions.expression(x.le(y));
relationalExpressions.expression(x.ge(y));
relationalExpressions.expression(x._instanceof(y));
relationalExpressions.expression(x.in(y));
JSBlock shiftExpressions = relationalExpressions.block();
shiftExpressions.expression(x.shl(y));
shiftExpressions.expression(x.shr(y));
shiftExpressions.expression(x.shrz(y));
JSBlock additiveExpressions = shiftExpressions.block();
additiveExpressions.expression(x.plus(y));
additiveExpressions.expression(x.minus(y));
JSBlock multiplicativeExpressions = additiveExpressions.block();
multiplicativeExpressions.expression(x);
multiplicativeExpressions.expression(x.mul(y));
multiplicativeExpressions.expression(x.div(y));
multiplicativeExpressions.expression(x.mod(y));
JSBlock unaryExpressions = multiplicativeExpressions.block();
unaryExpressions.expression(x.delete());
unaryExpressions.expression(x._void());
unaryExpressions.expression(x.typeof());
unaryExpressions.expression(x.preIncr());
unaryExpressions.expression(x.preDecr());
unaryExpressions.expression(x.positive());
unaryExpressions.expression(x.negative());
unaryExpressions.expression(x.complement());
unaryExpressions.expression(x.not());
JSBlock postfixExpressions = unaryExpressions.block();
postfixExpressions.expression(x.postIncr());
postfixExpressions.expression(x.postDecr());
JSBlock leftHandSideExpressions = postfixExpressions.block();
JSBlock callExpressions = leftHandSideExpressions.block();
callExpressions.expression(x.i().args(y).args(y).args(y));
callExpressions.expression(x.i().args(y));
callExpressions.expression(x.i().args(y, y, y));
callExpressions.expression(x.i().args(y).i()
.args(codeModel.integer(0), codeModel.integer(1)));
callExpressions.expression(x.i().args(y).e(codeModel.integer(0)));
callExpressions.expression(x.i().args(y).p("zero"));
callExpressions.expression(x.i().args(y).p(codeModel.integer(0)));
callExpressions.expression(x.i().args(y).p(codeModel.string("two")));
JSBlock newExpressions = leftHandSideExpressions.block();
newExpressions.expression(x._new());
JSBlock memberExpressions = newExpressions.block();
memberExpressions.expression(codeModel.function());
JSFunctionExpression.Function foo = codeModel.function("foo");
JSVariable a = foo.parameter("a");
JSVariable b = foo.parameter("b");
JSVariable c = foo.parameter("c");
foo.getBody().expression(a.plus(b));
foo.getBody()._return(c);
memberExpressions.expression(foo);
memberExpressions.expression(x.e(codeModel.integer(0)));
memberExpressions.expression(x.p("zero"));