1// line comment 2/* block comment */ 3 4little_endian_packets 5 6/* stuff */ 7enum FourBits : 4 { 8 ONE = 1, 9 TWO = 2, 10 THREE = 3, 11 FIVE = 5, 12 TEN = 10, 13 LAZY_ME = 15, 14} 15 16/* other stuff */ 17enum FourBits : 4 { 18 ONE = 1, 19 TWO = 2, 20 THREE = 3, 21 FIVE = 5, 22 TEN = 10, 23 LAZY_ME = 15 24} 25 26packet Test { 27 /* Checksum */ 28 _checksum_start_ (crc16), 29 /* Padding */ 30 _padding_ [1], 31 /* Size */ 32 _size_ (_payload_) : 1, 33 _size_ (_body_) : 1, 34 _size_ (id) : 1, 35 /* Body */ 36 _body_, 37 /* Payload */ 38 _payload_, 39 _payload_ : [+1], 40 /* Fixed */ 41 _fixed_ = 1:1, 42 _fixed_ = id:id, 43 /* Reserved */ 44 _reserved_ : 1, 45 /* Array */ 46 id: 1[+1], 47 id: id[+1], 48 id: 1[1], 49 id: id[1], 50 id: 1[], 51 id: id[], 52 /* Scalar */ 53 id: 1, 54 /* Typedef */ 55 id : id, 56 /* Group */ 57 id { a=1, b=2 }, 58 id, 59} 60 61packet TestChild : Test { 62} 63 64packet TestChild (a=1, b=2) { 65} 66 67packet TestChild : Test (a=1, b=2) { 68} 69 70checksum id: 1 "id" 71 72custom_field id : 1 "id" 73custom_field id "id" 74 75test Test { 76 "1111", 77 "2222", 78} 79