Skip to content
Snippets Groups Projects
Commit d3e05729 authored by Ludovic Apvrille's avatar Ludovic Apvrille Committed by Andrea Enrici
Browse files

corrected issue with C code generation

parent 3f4171e6
No related branches found
No related tags found
No related merge requests found
......@@ -37,7 +37,7 @@
<SystemCCodeExecuteCommand data="/home/andream/TURTLE/simulators/c++2/run.x -ovcd /home/andream/TURTLE/simulators/c++2/vcddump.vcd" />
<SystemCCodeInteractiveExecuteCommand data="/home/andream/TURTLE/simulators/c++2/run.x -server" />
<TMLCodeDirectory data="/home/andream/TURTLE/tmlcode" />
<CCodeDirectory data="/home/andream/TURTLE/Ccode" />
<CcodeDirectory data="/home/andream/TURTLE/Ccode" />
<GTKWavePath data="/opt/local/bin/gtkwave" />
<VCDPath data="/home/andream/TURTLE/vcd/" />
<UPPAALCodeDirectory data="/home/andream/TURTLE/uppaal/" />
......
......@@ -133,7 +133,7 @@ public class TMLCCodeGeneration {
prexList = new ArrayList<TMLPort>();
buffersList = new ArrayList<Buffer>();
dataTransfersList = new ArrayList<DataTransfer>();
debugFileName = ConfigurationTTool.CcodeDirectory + "/debugFile.txt";
debugFileName = ConfigurationTTool.CcodeDirectory + "debugFile.txt";
tmlcpsList = new ArrayList<TMLCP>();
}
......
......@@ -53,16 +53,38 @@ public class TMLCCodeGenerationError {
// type
public final static int ERROR_STRUCTURE = 0;
public final static int WARNING_STRUCTURE = 1;
public final static int ERROR_BEHAVIOR = 2;
public final static int WARNING_STRUCTURE = 1;
public final static int ERROR_BEHAVIOR = 2;
public final static int WARNING_BEHAVIOR = 3;
public int type; // ERROR, WARNING
public String message;
public TMLTask task;
public TMLActivityElement element;
public TMLTask task;
public TMLActivityElement element;
public TMLCCodeGenerationError( int _type ) {
type = _type;
}
@Override public String toString() {
String error_type = "";
switch( type ) {
case 0:
error_type = "ERROR_STRUCTURE";
break;
case 1:
error_type = "WARNING_STRUCTURE";
break;
case 2:
error_type = "ERROR_BEHAVIOR";
break;
case 3:
error_type = "WARNING_BEHAVIOR";
break;
default:
error_type = "NO RECOGNIZED ERROR TYPE";
break;
}
return "TMLCCodeGenerationError of type: " + error_type;
}
}
......@@ -433,6 +433,7 @@ public class GTURTLEModeling {
syntax.check();
if( syntax.hasErrors() ) {
for( TMLCCodeGenerationError error: syntax.getErrors() ) {
TraceManager.addDev( "ERROR: " + error.toString() );
if( error.type == TMLCCodeGenerationError.ERROR_STRUCTURE ) {
type = CheckingError.STRUCTURE_ERROR;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment