Package org.hisrc.jscm.codemodel.impl

Examples of org.hisrc.jscm.codemodel.impl.CodeModelImpl.integer()


    JSFunctionDeclaration factorial = program
        .functionDeclaration("factorial");
    // Add a function parameter
    JSVariable x = factorial.parameter("x");
    // Create an integer literal
    JSDecimalIntegerLiteral one = codeModel.integer(1);
    // Add a return statement to the function body
    factorial.getBody()._return(
        x.le(one).cond(
            one,
            x.mul(factorial.getFunctionExpression().i()
View Full Code Here


    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")));
View Full Code Here

    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")));
View Full Code Here

    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();
View Full Code Here

    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());
View Full Code Here

    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"));
    memberExpressions.expression(x.p(codeModel.integer(1)));
    memberExpressions.expression(x.p(codeModel.string("two")));
    memberExpressions.expression(x.instantiate().args(y));
View Full Code Here

    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"));
    memberExpressions.expression(x.p(codeModel.integer(1)));
    memberExpressions.expression(x.p(codeModel.string("two")));
    memberExpressions.expression(x.instantiate().args(y));

    JSBlock primaryExpressions = memberExpressions.block();
View Full Code Here

    JSBlock literals = primaryExpressions.block();
    literals.expression(codeModel._null());
    literals.expression(codeModel._boolean(true));
    literals.expression(codeModel._boolean(false));
    literals.expression(codeModel.integer(-1L));
    literals.expression(codeModel.integer(0L));
    literals.expression(codeModel.integer(1L));
    literals.expression(codeModel.decimal("-1.1"));
    literals.expression(codeModel.decimal("0.0"));
    literals.expression(codeModel.decimal("1.1"));
View Full Code Here

    JSBlock literals = primaryExpressions.block();
    literals.expression(codeModel._null());
    literals.expression(codeModel._boolean(true));
    literals.expression(codeModel._boolean(false));
    literals.expression(codeModel.integer(-1L));
    literals.expression(codeModel.integer(0L));
    literals.expression(codeModel.integer(1L));
    literals.expression(codeModel.decimal("-1.1"));
    literals.expression(codeModel.decimal("0.0"));
    literals.expression(codeModel.decimal("1.1"));
    literals.expression(codeModel.string("a"));
View Full Code Here

    literals.expression(codeModel._null());
    literals.expression(codeModel._boolean(true));
    literals.expression(codeModel._boolean(false));
    literals.expression(codeModel.integer(-1L));
    literals.expression(codeModel.integer(0L));
    literals.expression(codeModel.integer(1L));
    literals.expression(codeModel.decimal("-1.1"));
    literals.expression(codeModel.decimal("0.0"));
    literals.expression(codeModel.decimal("1.1"));
    literals.expression(codeModel.string("a"));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.