Commit 38d32895 authored by Depasse Arthur's avatar Depasse Arthur

Ajout de la génération de asn&

parent d05409e2
[comment encoding = UTF-8 /]
[module generateASN1('http://fr.supelec.plong9.fsm')]
[template public generateASN1(msg : Message)]
[file (msg.name + '.asn1', false, 'UTF-8')]
[msg.name/] DEFINITIONS IMPLICIT TAGS::=
BEGIN
[for (d : StringToStringMap | msg.data)]
[if (d.value.startsWith('ENUMDEF:'))]
[d.key.toUpper()/] ::= ENUMERATED {[d.value.substring(9)/]}
[/if]
[/for]
[msg.name/] ::= SEQUENCE {
[for (d : StringToStringMap | msg.data) separator(',')]
[if (not d.value.startsWith('ENUMDEF:'))]
[d.key.toLower()/] [d.value.toUpper()/]
[/if]
[/for]
}
END
[/file]
[/template]
......@@ -4,11 +4,14 @@
[import fr::supelec::plong9::acceleo::generation::file::generateMain /]
[import fr::supelec::plong9::acceleo::generation::file::generatePOM /]
[import fr::supelec::plong9::acceleo::generation::file::generateAction /]
[import fr::supelec::plong9::acceleo::generation::file::generateASN1 /]
[template public Main(aFSM : FSM)]
[comment @main/]
[for (msg : Message | aFSM.ownedMessages)]
[msg.generateASN1()/]
[/for]
[aFSM.generatePOM()/]
[aFSM.generateMain()/]
[aFSM.generateAction()/]
......
......@@ -17,4 +17,9 @@
<ownedActions name="DisconnectClientAction"/>
<ownedActions name="PongAction2"/>
<ownedGuards name="PongGuard"/>
<ownedMessages event="//@ownedEvents.0" name="MessagePing">
<data key="MessageType" value="ENUMDEF:ping,pong"/>
<data key="id" value="INTEGER"/>
<data key="type" value="MessageType"/>
</ownedMessages>
</fsm:FSM>
MessagePing DEFINITIONS IMPLICIT TAGS::=
BEGIN
MESSAGETYPE ::= ENUMERATED {ping,pong}
MessagePing ::= SEQUENCE {
, id INTEGER
, type MESSAGETYPE
}
END
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment