Closed m8pple closed 3 years ago
Couldn't easily see where the problem was, but changing the input from:
if( (deviceState->i < 16) && (0==(deviceState->i&1)) ){
to
if( (deviceState->i < 16) && (0==(deviceState->i& 1)) ){
So searching and replacing &1
with & 1
is a workaround.
Worth noting, &
is ASCII 38, and $
is ASCII 36 (decimal). Did you observe that the transformation was consistent?
Found it. @m8pple: I've opened a PR, but would be grateful if you could either test with your example, or send your example to me to test with.
It's one of the v4 reference graphs, so available here:
Running that example, I get a bunch of other structural errors, which appear to be related to other issues. Can you please drop the XML you ran here?
Errors, for reference:
........................................................................................................................
14/06/2021 14:04:37.06
Checking client file ../ring_test.xml
against grammar file ../Config/V4Grammar3.ocfg
(lin,col) refers to element closure location in client file
Structural analysis:
1. (1864, 9) : Element ../ring_test.xml.Graphs
contains 0 instance(s) of attribute "appname": this (0) should be exactly 1
2. ( 32, 20) : Element ../ring_test.xml.Graphs.GraphType.MessageTypes.MessageType
contains 0 instance(s) of element "CDATA": this (0) should be exactly 1
3. ( 32, 20) : Element ../ring_test.xml.Graphs.GraphType.MessageTypes.MessageType
contains 1 instance(s) of element "Message": this (1) should be exactly 0
4. ( 31, 13) : Element ../ring_test.xml.Graphs.GraphType.MessageTypes.MessageType.Message
contains 1 instance(s) of element "CDATA": this (1) should be exactly 0
5. ( 38, 20) : Element ../ring_test.xml.Graphs.GraphType.MessageTypes.MessageType
contains 0 instance(s) of element "CDATA": this (0) should be exactly 1
6. ( 38, 20) : Element ../ring_test.xml.Graphs.GraphType.MessageTypes.MessageType
contains 1 instance(s) of element "Message": this (1) should be exactly 0
7. ( 37, 13) : Element ../ring_test.xml.Graphs.GraphType.MessageTypes.MessageType.Message
contains 1 instance(s) of element "CDATA": this (1) should be exactly 0
8. ( 43, 20) : Element ../ring_test.xml.Graphs.GraphType.MessageTypes.MessageType
contains 0 instance(s) of element "CDATA": this (0) should be exactly 1
9. ( 43, 20) : Element ../ring_test.xml.Graphs.GraphType.MessageTypes.MessageType
contains 1 instance(s) of element "Message": this (1) should be exactly 0
10. ( 42, 13) : Element ../ring_test.xml.Graphs.GraphType.MessageTypes.MessageType.Message
contains 1 instance(s) of element "CDATA": this (1) should be exactly 0
11. ( 48, 20) : Element ../ring_test.xml.Graphs.GraphType.MessageTypes.MessageType
contains 0 instance(s) of element "CDATA": this (0) should be exactly 1
12. ( 48, 20) : Element ../ring_test.xml.Graphs.GraphType.MessageTypes.MessageType
contains 1 instance(s) of element "Message": this (1) should be exactly 0
13. ( 47, 13) : Element ../ring_test.xml.Graphs.GraphType.MessageTypes.MessageType.Message
contains 1 instance(s) of element "CDATA": this (1) should be exactly 0
14. ( 53, 20) : Element ../ring_test.xml.Graphs.GraphType.MessageTypes.MessageType
contains 0 instance(s) of element "CDATA": this (0) should be exactly 1
15. ( 53, 20) : Element ../ring_test.xml.Graphs.GraphType.MessageTypes.MessageType
contains 1 instance(s) of element "Message": this (1) should be exactly 0
16. ( 52, 13) : Element ../ring_test.xml.Graphs.GraphType.MessageTypes.MessageType.Message
contains 1 instance(s) of element "CDATA": this (1) should be exactly 0
17. ( 56, 20) : Element ../ring_test.xml.Graphs.GraphType.MessageTypes.MessageType
contains 0 instance(s) of element "CDATA": this (0) should be exactly 1
18. ( 56, 20) : Element ../ring_test.xml.Graphs.GraphType.MessageTypes.MessageType
contains 1 instance(s) of element "Message": this (1) should be exactly 0
19. ( 71, 18) : Element ../ring_test.xml.Graphs.GraphType.DeviceTypes.DeviceType.InputPin.State
contains 0 instance(s) of element "CDATA": this (0) should be exactly 1
20. ( 92, 20) : Element ../ring_test.xml.Graphs.GraphType.DeviceTypes.DeviceType.OutputPin
contains 1 instance(s) of attribute "indexed": this (1) should be exactly 0
21. ( 98, 25) : Element ../ring_test.xml.Graphs.GraphType.DeviceTypes.DeviceType.OnHardwareIdle
contains 0 instance(s) of element "CDATA": this (0) should be exactly 1
22. ( 99, 23) : Element ../ring_test.xml.Graphs.GraphType.DeviceTypes.DeviceType.OnDeviceIdle
contains 0 instance(s) of element "CDATA": this (0) should be exactly 1
23. ( 148, 18) : Element ../ring_test.xml.Graphs.GraphType.DeviceTypes.DeviceType.InputPin.State
contains 0 instance(s) of element "CDATA": this (0) should be exactly 1
24. ( 163, 18) : Element ../ring_test.xml.Graphs.GraphType.DeviceTypes.DeviceType.InputPin.State
contains 0 instance(s) of element "CDATA": this (0) should be exactly 1
25. ( 191, 18) : Element ../ring_test.xml.Graphs.GraphType.DeviceTypes.DeviceType.InputPin.State
contains 0 instance(s) of element "CDATA": this (0) should be exactly 1
26. ( 253, 20) : Element ../ring_test.xml.Graphs.GraphType.DeviceTypes.DeviceType.OutputPin
contains 1 instance(s) of attribute "indexed": this (1) should be exactly 0
27. ( 273, 20) : Element ../ring_test.xml.Graphs.GraphType.DeviceTypes.DeviceType.OutputPin
contains 1 instance(s) of attribute "indexed": this (1) should be exactly 0
28. ( 291, 20) : Element ../ring_test.xml.Graphs.GraphType.DeviceTypes.DeviceType.OutputPin
contains 1 instance(s) of attribute "indexed": this (1) should be exactly 0
29. ( 326, 25) : Element ../ring_test.xml.Graphs.GraphType.DeviceTypes.DeviceType.OnHardwareIdle
contains 0 instance(s) of element "CDATA": this (0) should be exactly 1
30. ( 327, 23) : Element ../ring_test.xml.Graphs.GraphType.DeviceTypes.DeviceType.OnDeviceIdle
contains 0 instance(s) of element "CDATA": this (0) should be exactly 1
31. ( 367, 23) : Element ../ring_test.xml.Graphs.GraphType.DeviceTypes.DeviceType.InputPin.Properties
contains 0 instance(s) of element "CDATA": this (0) should be exactly 1
32. ( 368, 18) : Element ../ring_test.xml.Graphs.GraphType.DeviceTypes.DeviceType.InputPin.State
contains 0 instance(s) of element "CDATA": this (0) should be exactly 1
33. ( 381, 18) : Element ../ring_test.xml.Graphs.GraphType.DeviceTypes.DeviceType.InputPin.State
contains 0 instance(s) of element "CDATA": this (0) should be exactly 1
34. ( 404, 18) : Element ../ring_test.xml.Graphs.GraphType.DeviceTypes.DeviceType.InputPin.State
contains 0 instance(s) of element "CDATA": this (0) should be exactly 1
35. ( 459, 20) : Element ../ring_test.xml.Graphs.GraphType.DeviceTypes.DeviceType.OutputPin
contains 1 instance(s) of attribute "indexed": this (1) should be exactly 0
36. ( 475, 20) : Element ../ring_test.xml.Graphs.GraphType.DeviceTypes.DeviceType.OutputPin
contains 1 instance(s) of attribute "indexed": this (1) should be exactly 0
37. ( 492, 20) : Element ../ring_test.xml.Graphs.GraphType.DeviceTypes.DeviceType.OutputPin
contains 1 instance(s) of attribute "indexed": this (1) should be exactly 0
38. ( 527, 25) : Element ../ring_test.xml.Graphs.GraphType.DeviceTypes.DeviceType.OnHardwareIdle
contains 0 instance(s) of element "CDATA": this (0) should be exactly 1
39. ( 528, 23) : Element ../ring_test.xml.Graphs.GraphType.DeviceTypes.DeviceType.OnDeviceIdle
contains 0 instance(s) of element "CDATA": this (0) should be exactly 1
40. ( 538, 23) : Element ../ring_test.xml.Graphs.GraphType.DeviceTypes.DeviceType.InputPin.Properties
contains 0 instance(s) of element "CDATA": this (0) should be exactly 1
41. ( 539, 18) : Element ../ring_test.xml.Graphs.GraphType.DeviceTypes.DeviceType.InputPin.State
contains 0 instance(s) of element "CDATA": this (0) should be exactly 1
42. ( 563, 20) : Element ../ring_test.xml.Graphs.GraphType.DeviceTypes.DeviceType.OutputPin
contains 1 instance(s) of attribute "indexed": this (1) should be exactly 0
43. ( 573, 20) : Element ../ring_test.xml.Graphs.GraphType.DeviceTypes.DeviceType.OutputPin
contains 1 instance(s) of attribute "indexed": this (1) should be exactly 0
44. ( 584, 25) : Element ../ring_test.xml.Graphs.GraphType.DeviceTypes.DeviceType.OnHardwareIdle
contains 0 instance(s) of element "CDATA": this (0) should be exactly 1
45. ( 585, 23) : Element ../ring_test.xml.Graphs.GraphType.DeviceTypes.DeviceType.OnDeviceIdle
contains 0 instance(s) of element "CDATA": this (0) should be exactly 1
46. ( 594, 23) : Element ../ring_test.xml.Graphs.GraphType.DeviceTypes.DeviceType.InputPin.Properties
contains 0 instance(s) of element "CDATA": this (0) should be exactly 1
47. ( 595, 18) : Element ../ring_test.xml.Graphs.GraphType.DeviceTypes.DeviceType.InputPin.State
contains 0 instance(s) of element "CDATA": this (0) should be exactly 1
48. ( 607, 25) : Element ../ring_test.xml.Graphs.GraphType.DeviceTypes.DeviceType.OnHardwareIdle
contains 0 instance(s) of element "CDATA": this (0) should be exactly 1
49. ( 608, 23) : Element ../ring_test.xml.Graphs.GraphType.DeviceTypes.DeviceType.OnDeviceIdle
contains 0 instance(s) of element "CDATA": this (0) should be exactly 1
...Client file ../ring_test.xml
exhibits 49 accumulated (syntax/structure) errors in 63 msecs
------------------------------------------------------------------------------------------------------------------------
I probably don't have a version of this file that will get far enough in stock 1.0.0-alpha, as the branch I'm mentioned (e992e8b7f16481e06f32a4fb794a4865cef9c485) contains multiple fixes.
I manually applied the patch to my branch, then un-patched the XML to get the &1 back, and then tried. Switching that character from $ to & and back seems to change it from broken to working to broken, so I think it has fixed it.
This was done on development_dt10_branch (e992e8b7f16481e06f32a4fb794a4865cef9c485), as otherwise I cant get through parsing through to compilation. The branch has the current 1.0.0-alpha merged in.
During code generation some ampersands in handlers get changed into dollars. For example, this:
gets changed into:
The specific problem is:
versus:
As a consequence, this fails to compose:
Microlog: