Example #1
0
    public static void Main()
    {
        // ((10 * 20) + 10)
        Expr expr = new Plus(
            new Multiply(
                new Constant(10),
                new Constant(20)),
            new Constant(30));

        expr.GenCode();
    }
    public static void Main()
    {
        Expr.SetTarget(Target.DOTNET);
        // (10 + (20 - 30))
        Expr expr = new Plus(
            new Constant(10),
            new Sub(
                new Constant(20),
                new Constant(30)));

        expr.GenCode();
    }
Example #3
0
    public static void Main()
    {
        Expr.SetTarget(new JVMTarget());
        // ((10 * 20) + 30)
        Expr expr = new Plus(
            new Mult(
                new Constant(10),
                new Constant(20)),
            new Constant(30));

        expr.GenCode();
    }