From IR to C file Output
Hi sir ,
I'm using the GeCoS Software installed in eclipse
I am a beginner in this software
I installed it with all his features
but i had a problem in generating a a C code from the IR representation
using the command
output(project, "c", "src-regen"); # Generate C source code from the IR
and this is the hole code for the compiler script
project = CreateGecosProject("tutorial"); # Just create a GeCoS project AddSourceToGecosProject(project, "src/ex1.c"); # Add source to the GeCoS project CDTFrontend(project); # Call the GeCoS Front-end and build the GeCoS IR corresponding to the project
output(project, "c", "src-regen"); # Generate C source code from the IR
in the result he always create the new file ex1.c but it is empty
and he display the following error :
Problem during output operation for method public void fr.irisa.cairn.gecos.model.c.generator.XtendCgeneratorOutput.print(gecos.gecosproject.GecosProject) used with tutorial:GecosProjectImpl evaluation failed java.lang.RuntimeException: evaluation failed at fr.irisa.r2d2.gecos.framework.internal.ScriptConfiguration.run(ScriptConfiguration.java:48) at fr.irisa.r2d2.gecos.framework.internal.GecosApplication.run(GecosApplication.java:90) at fr.irisa.r2d2.gecos.framework.internal.GecosApplication.start(GecosApplication.java:102) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610) at org.eclipse.equinox.launcher.Main.run(Main.java:1519) at org.eclipse.equinox.launcher.Main.main(Main.java:1492)
can you help me please solving this problem
in fact I am solving a test case
Task: The goal is to develop a source-to-source compiler that reduces the memory requirements of a C program. A source-to-source compiler is an application that reads the text file of a C program and writes a modified C program. GeCoS is a compiler infrastructure that that can read C programs into an internal data structure, allows to modify it using GeCoS transformations and writes the internal data structure back into a C file. Therefore, a GeCoS transformation should be developed replacing all data types with data types of half the size. Implement this for the data types double (to float) and integer (to short).
and I should develop the solution for his problem thank you
thank you in advance best regards Kendil Hamdi