Create the HelloWorld model

Create the HelloWorld model

Once the model file is created and the Xtext nature is added, you can create the model as you did it for Java. Creating the model is not the focus of this tutorial. Therefore copy and paste the following code into your model file. Optionally you can open and layout the diagrams. Recognize the C specific parts: - The action code contains C instead of Java. Later versions will contain a common action language, but for the moment the action language is target specific. - The application must be shutdown on model level (see also etRuntimeConfig.h).

RoomModel HelloWorldCModel {
import room.basic.types.* from "../../org.eclipse.etrice.modellib.c/model/Types.room"
SubSystemClass HelloWorldCSubSysClass {
ActorRef HelloETriceTopRef:AHelloWorldCTop 
}
ActorClass AHelloWorldCTop {
Structure { }
Behavior {
StateMachine {
Transition init: initial -> state0 { }
State state0 {
entry {
"printf(\"HelloWorldC !\\n\");"
"SubSysClass_shutdown();"
"\t\t\t\t\t\t"
}
}
}
}
}
}