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); } }
public override IEnumerable <CStatement> ToCCode() { yield return(CExpression.Assign( CExpression.Deref(new CCast(new CType(Type.ToCType(), true), Address.ToCExpression())), Operand.ToCExpression())); }
public override IEnumerable <CStatement> ToCCode() { yield return(CExpression.Assign(Destination.ToCExpression(), Source.ToCExpression())); }