-
Notifications
You must be signed in to change notification settings - Fork 12
/
sqfc.grammar
171 lines (169 loc) · 9.41 KB
/
sqfc.grammar
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?xml version="1.0" encoding="UTF-8"?>
<ufwb version="1.17">
<grammar name="SQFC" start="id:5" author="dedmen" fileextension=".sqfc">
<scripts>
<script name="test" type="DataType" id="12">
<source language="Lua">
function parseByteRange(element, byteView, bitPos, bitLength, results)
-- this method parses data
print "parseByteRange"
-- return number of processed bytes
return 0
end
function fillByteRange(value, byteArray, bitPos, bitLength)
-- this method translates edited values back to the file
print "fillByteRange"
end
</source>
</script>
</scripts>
<structure name="<File>" id="5" encoding="ISO_8859-1:1987" endian="little" signed="no">
<number name="version" id="6" type="integer" length="4"/>
<structure name="TopLevelBlocks" id="7" repeatmax="64">
<structref name="<TopLevelConstant>" id="9" repeatmin="0" structure="id:8"/>
<structref name="<TopLevelLocationInfo>" id="11" repeatmin="0" structure="id:10"/>
<structref name="<TopLevelCode>" id="13" repeatmin="0" structure="id:12"/>
<structref name="<TopLevelConstantCompressed>" id="15" repeatmin="0" structure="id:14"/>
</structure>
</structure>
<structure name="TopLevelConstant" id="8" length="0" alignment="0" encoding="ISO_8859-1:1987" endian="little" signed="no">
<number name="Type" mustmatch="yes" id="18" type="integer" length="1">
<fixedvalues>
<fixedvalue name="Constant" value="0"/>
</fixedvalues>
</number>
<number name="TLConstantCount" id="19" type="integer" length="2" minval="1" maxval="128"/>
<structure name="ConstantElements" id="20" repeat="id:19" repeatmin="TLConstantCount" repeatmax="TLConstantCount">
<structref name="<ConstantElement>" id="22" structure="id:21"/>
</structure>
</structure>
<structure name="ConstantElement" id="21" repeat="id:19" encoding="ISO_8859-1:1987" endian="little" signed="no" order="variable">
<structure name="ConstantCode" id="25" repeatmin="0">
<number name="Type" mustmatch="yes" id="26" type="integer" length="1">
<fixedvalues>
<fixedvalue name="Code" value="0"/>
</fixedvalues>
</number>
<number name="codeStringRef" id="27" type="integer" length="8"/>
<structref name="<CodeInstructions>" id="29" structure="id:28"/>
</structure>
<structure name="ConstantString" id="31" repeatmin="0">
<number name="Type" mustmatch="yes" id="32" type="integer" length="1">
<fixedvalues>
<fixedvalue name="String" value="1"/>
<fixedvalue name="CallNular" value="5"/>
</fixedvalues>
</number>
<structref name="<String>" id="34" structure="id:33"/>
</structure>
<structure name="ConstantScalar" id="36" repeatmin="0">
<number name="Type" mustmatch="yes" id="37" type="integer" length="1">
<fixedvalues>
<fixedvalue name="Scalar" value="2"/>
</fixedvalues>
</number>
<number name="ScalarValue" id="38" type="float" length="32" lengthunit="bit"/>
</structure>
<structure name="ConstantBool" id="40" repeatmin="0">
<number name="Type" mustmatch="yes" id="41" type="integer" length="1">
<fixedvalues>
<fixedvalue name="Bool" value="3"/>
</fixedvalues>
</number>
<number name="BoolValue" id="42" type="integer" length="1"/>
</structure>
<structure name="ConstantArray" id="44" repeatmin="0">
<number name="Type" mustmatch="yes" id="45" type="integer" length="1">
<fixedvalues>
<fixedvalue name="Array" value="4"/>
</fixedvalues>
</number>
<number name="cArrCount" id="46" type="integer" length="4" maxval="0"/>
<structure name="ConstantElements" id="47" repeat="id:46">
<structref name="<ConstantElement>" id="48" structure="id:21"/>
</structure>
</structure>
<structure name="ConstantCallNular" id="94"/>
</structure>
<structure name="CodeInstructions" id="28" encoding="ISO_8859-1:1987" endian="little" signed="no">
<number name="instructionCount" id="52" type="integer" length="4"/>
<structure name="InstructionElement" id="53" repeat="id:52" repeatmin="instructionCount" repeatmax="instructionCount" order="variable">
<structure name="InstructionEndStatement" id="54" repeatmin="0">
<number name="Type" mustmatch="yes" id="55" type="integer" length="1">
<fixedvalues>
<fixedvalue name="endStatement" value="0"/>
</fixedvalues>
</number>
</structure>
<structure name="InstructionPush" id="57" repeatmin="0">
<number name="Type" mustmatch="yes" id="58" type="integer" length="1">
<fixedvalues>
<fixedvalue name="Push" value="1"/>
</fixedvalues>
</number>
<number name="constantIndex" id="59" type="integer" length="2"/>
</structure>
<structure name="InstructionCallCommand" id="61" repeatmin="0">
<number name="Type" mustmatch="yes" id="62" type="integer" length="1">
<fixedvalues>
<fixedvalue name="callUnary" value="2"/>
<fixedvalue name="callBinary" value="3"/>
<fixedvalue name="callNular" value="4"/>
<fixedvalue name="assignTo" value="5"/>
<fixedvalue name="assignToLocal" value="6"/>
<fixedvalue name="getVariable" value="7"/>
</fixedvalues>
</number>
<number name="offset" id="63" type="integer" length="4" minval="0" maxval="0"/>
<number name="fileIndex" id="64" type="integer" length="1"/>
<number name="fileLine" id="65" type="integer" length="2" minval="0"/>
<structref name="content" id="66" structure="id:33"/>
</structure>
<structure name="InstructionMakeArray" id="68">
<number name="Type" mustmatch="yes" id="69" type="integer" length="1">
<fixedvalues>
<fixedvalue name="makeArray" value="8"/>
</fixedvalues>
</number>
<number name="offset" id="70" type="integer" length="4"/>
<number name="fileIndex" id="71" type="integer" length="1"/>
<number name="fileLIne" id="72" type="integer" length="2"/>
<number name="arraySize" id="73" type="integer" length="2"/>
</structure>
</structure>
</structure>
<structure name="String" id="33" encoding="ISO_8859-1:1987" endian="little" signed="no">
<number name="stringLength" id="77" type="integer" length="3"/>
<string name="<string>" id="78" type="fixed-length" length="stringLength"/>
</structure>
<structure name="TopLevelLocationInfo" id="10" encoding="ISO_8859-1:1987" endian="little" signed="no">
<number name="Type" mustmatch="yes" id="80" type="integer" length="1">
<fixedvalues>
<fixedvalue name="locationInfo" value="2"/>
</fixedvalues>
</number>
<number name="numberOfFiles" id="81" type="integer" length="2"/>
<structure name="File" id="82" repeatmin="numberOfFiles" repeatmax="numberOfFiles">
<structref name="<String>" id="83" structure="id:33"/>
</structure>
</structure>
<structure name="TopLevelCode" id="12" encoding="ISO_8859-1:1987" endian="little" signed="no">
<number name="Type" mustmatch="yes" id="86" type="integer" length="1">
<fixedvalues>
<fixedvalue name="Code" value="3"/>
<fixedvalue name="CodeDebug" value="4"/>
</fixedvalues>
</number>
<number name="codeIndex" id="87" type="integer" length="8"/>
</structure>
<structure name="TopLevelConstantCompressed" id="14" encoding="ISO_8859-1:1987" endian="little" signed="no">
<number name="Type" mustmatch="yes" id="89" type="integer" length="1">
<fixedvalues>
<fixedvalue name="ConstantCompressed" value="1"/>
</fixedvalues>
</number>
<number name="uncompressedSize" id="91" type="integer" length="4"/>
<binary name="<binary>" id="92" length="compressedSize"/>
</structure>
</grammar>
</ufwb>