This is an automated email from the ASF dual-hosted git repository.

sruehl pushed a commit to branch feature/mspec-ng
in repository https://gitbox.apache.org/repos/asf/plc4x.git


The following commit(s) were added to refs/heads/feature/mspec-ng by this push:
     new ecb4bb0  feat(plc4x/codegen): reorder attributes to after params
ecb4bb0 is described below

commit ecb4bb0c8e7e895124323ce9cf6dc5bd8e4703f6
Author: Sebastian Rühl <[email protected]>
AuthorDate: Thu Nov 4 11:12:07 2021 +0100

    feat(plc4x/codegen): reorder attributes to after params
---
 .../apache/plc4x/plugins/codegenerator/language/mspec/MSpec.g4    | 8 ++++----
 .../firmata/src/main/resources/protocols/firmata/firmata.mspec    | 2 +-
 .../genericcan/src/main/resources/protocols/can/genericcan.mspec  | 2 +-
 protocols/modbus/src/main/resources/protocols/modbus/modbus.mspec | 4 ++--
 protocols/opcua/src/main/xslt/opc-manual.xsl                      | 4 ++--
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git 
a/code-generation/protocol-base-mspec/src/main/antlr4/org/apache/plc4x/plugins/codegenerator/language/mspec/MSpec.g4
 
b/code-generation/protocol-base-mspec/src/main/antlr4/org/apache/plc4x/plugins/codegenerator/language/mspec/MSpec.g4
index c881540..820feb6 100644
--- 
a/code-generation/protocol-base-mspec/src/main/antlr4/org/apache/plc4x/plugins/codegenerator/language/mspec/MSpec.g4
+++ 
b/code-generation/protocol-base-mspec/src/main/antlr4/org/apache/plc4x/plugins/codegenerator/language/mspec/MSpec.g4
@@ -27,10 +27,10 @@ complexTypeDefinition
  ;
 
 complexType
- : 'type' name=idExpression (attributes=attributeList) (LRBRACKET 
params=argumentList RRBRACKET)? (fieldDefinition|batchSetDefinition)*
- | 'discriminatedType' name=idExpression (attributes=attributeList) (LRBRACKET 
params=argumentList RRBRACKET)? (fieldDefinition|batchSetDefinition)+
- | 'enum' (type=typeReference)? name=idExpression (attributes=attributeList) 
(LRBRACKET params=argumentList RRBRACKET)? enumValues=enumValueDefinition+
- | 'dataIo' name=idExpression (attributes=attributeList) (LRBRACKET 
params=argumentList RRBRACKET)? dataIoTypeSwitch=dataIoDefinition
+ : 'type' name=idExpression (LRBRACKET params=argumentList RRBRACKET)? 
attributes=attributeList (fieldDefinition|batchSetDefinition)*
+ | 'discriminatedType' name=idExpression (LRBRACKET params=argumentList 
RRBRACKET)? attributes=attributeList (fieldDefinition|batchSetDefinition)+
+ | 'enum' (type=typeReference)? name=idExpression (LRBRACKET 
params=argumentList RRBRACKET)? attributes=attributeList 
enumValues=enumValueDefinition+
+ | 'dataIo' name=idExpression (LRBRACKET params=argumentList RRBRACKET)? 
(attributes=attributeList) dataIoTypeSwitch=dataIoDefinition
  ;
 
 fieldDefinition
diff --git 
a/protocols/firmata/src/main/resources/protocols/firmata/firmata.mspec 
b/protocols/firmata/src/main/resources/protocols/firmata/firmata.mspec
index 1374686..c6aad0d 100644
--- a/protocols/firmata/src/main/resources/protocols/firmata/firmata.mspec
+++ b/protocols/firmata/src/main/resources/protocols/firmata/firmata.mspec
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-[discriminatedType FirmataMessage byteOrder='"BIG_ENDIAN"'(bit 'response')
+[discriminatedType FirmataMessage(bit 'response') byteOrder='"BIG_ENDIAN"'
     [discriminator uint 4 'messageType']
     [typeSwitch 'messageType'
         // Reading operations
diff --git 
a/protocols/genericcan/src/main/resources/protocols/can/genericcan.mspec 
b/protocols/genericcan/src/main/resources/protocols/can/genericcan.mspec
index 6614221..72471a1 100644
--- a/protocols/genericcan/src/main/resources/protocols/can/genericcan.mspec
+++ b/protocols/genericcan/src/main/resources/protocols/can/genericcan.mspec
@@ -40,7 +40,7 @@
     [REAL64      ['64'] ]
 ]
 
-[dataIo DataItem byteOrder='"LITTLE_ENDIAN"' (GenericCANDataType 'dataType')
+[dataIo DataItem(GenericCANDataType 'dataType') byteOrder='"LITTLE_ENDIAN"'
     [typeSwitch 'dataType'
         ['BYTE' BYTE
             [simple byte 'value']
diff --git a/protocols/modbus/src/main/resources/protocols/modbus/modbus.mspec 
b/protocols/modbus/src/main/resources/protocols/modbus/modbus.mspec
index 3a0c06f..b762bba 100644
--- a/protocols/modbus/src/main/resources/protocols/modbus/modbus.mspec
+++ b/protocols/modbus/src/main/resources/protocols/modbus/modbus.mspec
@@ -23,7 +23,7 @@
     [const          uint 16     'modbusTcpDefaultPort' '502']
 ]
 
-[type ModbusTcpADU byteOrder='"BIG_ENDIAN"' (bit 'response')
+[type ModbusTcpADU(bit 'response') byteOrder='"BIG_ENDIAN"'
     // It is used for transaction pairing, the MODBUS server copies in the 
response the transaction
     // identifier of the request.
     [simple         uint 16     'transactionIdentifier']
@@ -45,7 +45,7 @@
     [simple         ModbusPDU('response')   'pdu']
 ]
 
-[type ModbusSerialADU byteOrder='"LITTLE_ENDIAN"' (bit 'response')
+[type ModbusSerialADU(bit 'response') byteOrder='"LITTLE_ENDIAN"'
     [simple         uint 16     'transactionId']
     [reserved       uint 16     '0x0000']
     [simple         uint 16     'length']
diff --git a/protocols/opcua/src/main/xslt/opc-manual.xsl 
b/protocols/opcua/src/main/xslt/opc-manual.xsl
index 10d5388..14832d0 100644
--- a/protocols/opcua/src/main/xslt/opc-manual.xsl
+++ b/protocols/opcua/src/main/xslt/opc-manual.xsl
@@ -55,11 +55,11 @@
     <xsl:template match="/">
 // Remark: The different fields are encoded in Little-endian.
 
-[type OpcuaAPU byteOrder='"LITTLE_ENDIAN"' (bit 'response')
+[type OpcuaAPU(bit 'response') byteOrder='"LITTLE_ENDIAN"'
     [simple MessagePDU('response') 'message']
 ]
 
-[discriminatedType MessagePDU (bit 'response')
+[discriminatedType MessagePDU(bit 'response')
     [discriminator string 24            'messageType']
     [typeSwitch 'messageType','response'
         ['"HEL"','false'     OpcuaHelloRequest

Reply via email to