|
@@ -11,8 +11,10 @@
|
|
|
package org.yakindu.sct.generator.c;
|
|
|
|
|
|
import static org.yakindu.sct.generator.c.features.ICFeatureConstants.FEATURE_TRACING;
|
|
|
+import static org.yakindu.sct.generator.c.features.ICFeatureConstants.FEATURE_INCLUDES;
|
|
|
import static org.yakindu.sct.generator.c.features.ICFeatureConstants.PARAMETER_TRACING_ENTER_STATE;
|
|
|
import static org.yakindu.sct.generator.c.features.ICFeatureConstants.PARAMETER_TRACING_EXIT_STATE;
|
|
|
+import static org.yakindu.sct.generator.c.features.ICFeatureConstants.PARAMETER_INCLUDES_USE_RELATIVE_PATHS;
|
|
|
import static org.yakindu.sct.model.sexec.transformation.IModelSequencer.ADD_TRACES;
|
|
|
|
|
|
import org.yakindu.sct.generator.c.types.CTypeSystemAccess;
|
|
@@ -38,7 +40,11 @@ public class CCodeGeneratorModule implements GeneratorModule {
|
|
|
binder.bind(IExecutionFlowGenerator.class).to(CGenerator.class);
|
|
|
binder.bind(INamingService.class).to(CNamingService.class);
|
|
|
binder.bind(ICodegenTypeSystemAccess.class).to(CTypeSystemAccess.class);
|
|
|
- binder.bind(IGenArtifactConfigurations.class).to(DefaultGenArtifactConfigurations.class);
|
|
|
+ bindIGenArtifactConfigurations(entry, binder);
|
|
|
+ bindTracingProperty(entry, binder);
|
|
|
+ }
|
|
|
+
|
|
|
+ protected void bindTracingProperty(GeneratorEntry entry, Binder binder) {
|
|
|
FeatureParameterValue traceEnterFeature = entry.getFeatureParameterValue(FEATURE_TRACING,
|
|
|
PARAMETER_TRACING_ENTER_STATE);
|
|
|
FeatureParameterValue traceExitFeature = entry.getFeatureParameterValue(FEATURE_TRACING,
|
|
@@ -46,7 +52,17 @@ public class CCodeGeneratorModule implements GeneratorModule {
|
|
|
boolean traceEnter = traceEnterFeature != null ? traceEnterFeature.getBooleanValue() : false;
|
|
|
boolean traceExit = traceExitFeature != null ? traceEnterFeature.getBooleanValue() : false;
|
|
|
binder.bind(Boolean.class).annotatedWith(Names.named(ADD_TRACES)).toInstance(traceEnter || traceExit);
|
|
|
+ }
|
|
|
|
|
|
+ protected void bindIGenArtifactConfigurations(GeneratorEntry entry, Binder binder) {
|
|
|
+ FeatureParameterValue useRelativePathParam = entry.getFeatureParameterValue(FEATURE_INCLUDES,
|
|
|
+ PARAMETER_INCLUDES_USE_RELATIVE_PATHS);
|
|
|
+ boolean useRelativePath = useRelativePathParam != null ? useRelativePathParam.getBooleanValue() : true;
|
|
|
+ if (useRelativePath) {
|
|
|
+ binder.bind(IGenArtifactConfigurations.class).to(DefaultGenArtifactConfigurations.class);
|
|
|
+ } else {
|
|
|
+ binder.bind(IGenArtifactConfigurations.class).to(SimpleGenArtifactConfigurations.class);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|