Exemplo n.º 1
0
        public void PrintSimpleFunctionTest()
        {
            var ifStatement = new CIf((CExpression)5 != 3.2f, new CBlock(
                                          new CLabel("Start"),
                                          new CWhile(true),
                                          new CGoto("Start"),
                                          CExpression.Assign(new CVariable("Something")[5], "Thing")
                                          ));
            var procedure = new CMethod("test_a", (new CType("void", true), "a"), (new CType("int"), "b"))
            {
                IsStatic = true,
                Body     = new CBlock(ifStatement)
            };

            Console.WriteLine(procedure);
        }
    }
Exemplo n.º 2
0
 public override IEnumerable <CStatement> ToCCode()
 {
     yield return(CExpression.Assign(
                      CExpression.Deref(new CCast(new CType(Type.ToCType(), true), Address.ToCExpression())),
                      Operand.ToCExpression()));
 }
Exemplo n.º 3
0
 public override IEnumerable <CStatement> ToCCode()
 {
     yield return(CExpression.Assign(Destination.ToCExpression(), Source.ToCExpression()));
 }