Browse Source

support embedded types from other state machines

master
Volker Birk 7 months ago
parent
commit
a57274ba65
3 changed files with 14 additions and 5 deletions
  1. +2
    -2
      asn.1/Makefile
  2. +4
    -0
      codegen/fsm.yml2
  3. +8
    -3
      codegen/gen_messages.ysl2

+ 2
- 2
asn.1/Makefile View File

@ -19,8 +19,8 @@ libasn1.a: $(ALL_OBJECTS)
%.o: %.c %.h
$(CC) $(CFLAGS) $(CPPFLAGS) $(OPTIMIZE) $(ASN1C_INC) -c $< -o $@
Sync.c: sync.asn1 keysync.asn1 trustsync.asn1 groupsync.asn1 pEp.asn1
$(ASN1C) -gen-PER -fincludes-quoted -fcompound-names -pdu=auto pEp.asn1 keysync.asn1 trustsync.asn1 groupsync.asn1 $<
Sync.c: sync.asn1 keysync.asn1 trustsync.asn1 groupsync.asn1 pEp.asn1 distribution.asn1
$(ASN1C) -gen-PER -fincludes-quoted -fcompound-names -pdu=auto pEp.asn1 keysync.asn1 trustsync.asn1 groupsync.asn1 distribution.asn1 keyreset.asn1 managedgroup.asn1 exploration.asn1 $<
rm -f converter-sample.c
touch Sync.c


+ 4
- 0
codegen/fsm.yml2 View File

@ -66,3 +66,7 @@ decl auto < field >;
decl list < field >;
// emped message from other state machine
decl embed @protocol @type @name;

+ 8
- 3
codegen/gen_messages.ysl2 View File

@ -15,7 +15,7 @@ tstylesheet {
include ./functions.ysl2
function "pEp_imports"
| IMPORTS Version, Identity, IdentityList, TID, Hash, Rating FROM PEP;
| IMPORTS Version, Identity, IdentityList, TID, Hash, Rating FROM PEP
function "header"
||
@ -74,6 +74,8 @@ tstylesheet {
EXPORTS «@name»;
`` call "pEp_imports"
`` apply "message/embed", mode=import
;
`` apply "message//list|message", 0, mode=impl;
«@name» ::= CHOICE {
@ -88,7 +90,7 @@ tstylesheet {
template "message", mode=impl
||
«@name» ::= SEQUENCE {
`` apply "field|auto|list", mode=direct
`` apply "field|auto|list|embed", mode=direct
}
||
@ -101,10 +103,13 @@ tstylesheet {
||
template "field|auto", mode=direct
template "field|auto|embed", mode=direct
| «func:asn1name()» «func:asn1type()»`if "position()!=last()" > ,`
template "list", mode=direct
| «func:asn1name()» SEQUENCE OF «func:asn1type()»`if "position()!=last()" > ,`
template "embed", mode=import
| «@type» FROM «yml:ucase(@protocol)»
}

Loading…
Cancel
Save