PL-Editor

 

For a lecture called “Prozess-Lenkung” we were supposed to generate C-Code by copy, paste existing templates. Then perform a “replace all” to generate customized state machine code. From the very first moment I thought that it hilariously stupid to do it that way. And as I just heard of XText before I used it to let a generator generate the code from a human readable description. And of course the editor had all the nice Eclipse features such a auto-completion, syntax highlighting, navigation etc. A description would look like this:


state starten start debug{

action entry gabel_ausfahren {

message RFZ_Gabel_ausfahren -> NQ_Prozessinterface

}

reaction ext {

transition RFZ_Gabel_eingefahren -> werkstueck_ablegen

}

}


state werkstueck_ablegen normal debug{


action entry senken {

message RFZ_Senken -> NQ_Prozessinterface

method "napms(500);"

message RFZ_Vertikalstopp

goto gabel_einfahren

}

}



state gabel_einfahren normal debug{

action entry gabel_einfahren {


message RFZ_Gabel_einfahren -> NQ_Prozessinterface

}

reaction ext {

transition RFZ_Gabel_ausgefahren -> gabel_heben

}

}