Skip to content

Commit

Permalink
feat(plc4x/codegen): reorder attributes to after params
Browse files Browse the repository at this point in the history
  • Loading branch information
sruehl committed Nov 4, 2021
1 parent 3bed94d commit ecb4bb0
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand All @@ -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']
Expand Down
4 changes: 2 additions & 2 deletions protocols/opcua/src/main/xslt/opc-manual.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ecb4bb0

Please sign in to comment.