1 |
<?xml version="1.0" encoding="UTF-8"?> |
2 |
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
3 |
Syntax definition file for ASCEND modelling language. |
4 |
Put this file into /usr/share/gtksourceview-[VERSION]/language-specs/ascend.lang |
5 |
|
6 |
John Pye (C) 2005 |
7 |
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> |
8 |
|
9 |
<!-- gtksourceview ASCEND IV language specification --> |
10 |
|
11 |
<!DOCTYPE language SYSTEM "language.dtd"> |
12 |
<language _name="ASCEND" version="1.0" _section="Sources" mimetypes="text/x-ascend"> |
13 |
|
14 |
<escape-char>\</escape-char> |
15 |
|
16 |
<!-- notes --> |
17 |
|
18 |
<block-comment _name = "Note" style= "Others 2" end-at-line-end = "FALSE"> |
19 |
<start-regex>^\s*NOTES</start-regex> |
20 |
<end-regex>END\s+NOTES</end-regex> |
21 |
</block-comment> |
22 |
|
23 |
<block-comment _name = "Stop" style= "Comment" end-at-line-end = "FALSE"> |
24 |
<start-regex>STOP\s+\{</start-regex> |
25 |
<end-regex>\}</end-regex> |
26 |
</block-comment> |
27 |
|
28 |
<!-- Literals --> |
29 |
|
30 |
<string _name="Text" style="String" end-at-line-end="FALSE"> |
31 |
<start-regex>"</start-regex> |
32 |
<end-regex>"</end-regex> |
33 |
</string> |
34 |
|
35 |
<string _name="String Constant" style="String" end-at-line-end="FALSE"> |
36 |
<start-regex>'</start-regex> |
37 |
<end-regex>'</end-regex> |
38 |
</string> |
39 |
|
40 |
<pattern-item _name="Integer Literals" style="Decimal"> |
41 |
<regex>\b[0-9]+\b</regex> |
42 |
</pattern-item> |
43 |
|
44 |
<pattern-item _name="Number Literals" style="Floating Point"> |
45 |
<regex>(\b[-+]?[0-9]+(\.[0-9]+)?|\.[0-9]+)([Ee][\+-]?[0-9]+)?\b</regex> |
46 |
</pattern-item> |
47 |
|
48 |
|
49 |
<!-- Comments --> |
50 |
|
51 |
|
52 |
<block-comment _name="Block Comment" style="Comment"> |
53 |
<start-regex>\(\*</start-regex> |
54 |
<end-regex>\*\)</end-regex> |
55 |
</block-comment> |
56 |
|
57 |
<!-- punctuation --> |
58 |
|
59 |
<!-- |
60 |
<pattern-item _name="Punctuation" style="Keyword"> |
61 |
<regex>(:=|[\+\*\/\-\|\^\(\)=;-])</regex> |
62 |
</pattern-item> |
63 |
--> |
64 |
|
65 |
<!-- Reserved Words --> |
66 |
|
67 |
<keyword-list _name="Keywords" style="Keyword" case-sensitive="TRUE"> |
68 |
<keyword>ADD</keyword> |
69 |
<keyword>AND</keyword> |
70 |
<keyword>ALIASES</keyword> |
71 |
<keyword>ARE_ALIKE</keyword> |
72 |
<keyword>ARE_THE_SAME</keyword> |
73 |
<keyword>ARE_NOT_THE_SAME</keyword> |
74 |
<keyword>ASSERT</keyword> |
75 |
<keyword>ATOM</keyword> |
76 |
<keyword>CALL</keyword> |
77 |
<keyword>CASE</keyword> |
78 |
<keyword>CARD</keyword> |
79 |
<keyword>CHECK</keyword> |
80 |
<keyword>CHOICE</keyword> |
81 |
<keyword>CONSTANT</keyword> |
82 |
<keyword>CONDITIONAL</keyword> |
83 |
<keyword>CREATE</keyword> |
84 |
<keyword>DATA</keyword> |
85 |
<keyword>DEFAULT</keyword> |
86 |
<keyword>DEFINITION</keyword> |
87 |
<keyword>DO</keyword> |
88 |
<keyword>ELSE</keyword> |
89 |
<keyword>END</keyword> |
90 |
<keyword>FIX</keyword> |
91 |
<keyword>FOR</keyword> |
92 |
<keyword>FREE</keyword> |
93 |
<keyword>IF</keyword> |
94 |
<keyword>IMPORT</keyword> |
95 |
<keyword>IN</keyword> |
96 |
<keyword>INPUT</keyword> |
97 |
<keyword>INTERSECTION</keyword> |
98 |
<keyword>IS_A</keyword> |
99 |
<keyword>IS_REFINED_TO</keyword> |
100 |
<keyword>MAX</keyword> |
101 |
<keyword>MAXIMIZE</keyword> |
102 |
<keyword>METHOD</keyword> |
103 |
<keyword>METHODS</keyword> |
104 |
<keyword>MIN</keyword> |
105 |
<keyword>MINIMIZE</keyword> |
106 |
<keyword>MODEL</keyword> |
107 |
<keyword>NOTES</keyword> |
108 |
<keyword>OF</keyword> |
109 |
<keyword>OR</keyword> |
110 |
<keyword>OTHERWISE</keyword> |
111 |
<keyword>OUTPUT</keyword> |
112 |
<keyword>PROVIDE</keyword> |
113 |
<keyword>PROD</keyword> |
114 |
<keyword>REPLACE</keyword> |
115 |
<keyword>REQUIRE</keyword> |
116 |
<keyword>REFINES</keyword> |
117 |
<keyword>RUN</keyword> |
118 |
<keyword>SATISFIED</keyword> |
119 |
<keyword>SELECT</keyword> |
120 |
<keyword>SELF</keyword> |
121 |
<keyword>STUDY</keyword> |
122 |
<keyword>SUCH_THAT</keyword> |
123 |
<keyword>SUM</keyword> |
124 |
<keyword>SWITCH</keyword> |
125 |
<keyword>THEN</keyword> |
126 |
<keyword>UNIVERSAL</keyword> |
127 |
<keyword>UNION</keyword> |
128 |
<keyword>UNITS</keyword> |
129 |
<keyword>USE</keyword> |
130 |
<keyword>WHEN</keyword> |
131 |
<keyword>WHERE</keyword> |
132 |
<keyword>WITH_VALUE</keyword> |
133 |
<keyword>WILL_BE</keyword> |
134 |
<keyword>WILL_BE_THE_SAME</keyword> |
135 |
<keyword>WILL_NOT_BE_THE_SAME</keyword> |
136 |
</keyword-list> |
137 |
|
138 |
<!-- units --> |
139 |
|
140 |
<pattern-item _name="Units" style="Data Type"> |
141 |
<regex>\{[A-Za-z^0-9_/\*\?]+\}</regex> |
142 |
</pattern-item> |
143 |
|
144 |
<!-- dimension --> |
145 |
|
146 |
<pattern-item _name="Dimension" style="Data Type"> |
147 |
<regex>\bDIMENSIONLESS|DIMENSION (1/)?(([MQTLCEPS]|TMP|LUM)(\^[0-9]+)?)([\*\/]([MQTLCEPS]|TMP|LUM)(\^[0-9]+)?)*\b</regex> |
148 |
</pattern-item> |
149 |
|
150 |
<!-- constant --> |
151 |
|
152 |
<keyword-list _name="Builtin Constants" style="Preprocessor" case-sensitive="true"> |
153 |
<keyword>FALSE</keyword> |
154 |
<keyword>TRUE</keyword> |
155 |
|
156 |
<keyword>real_constant</keyword> |
157 |
<keyword>integer_constant</keyword> |
158 |
<keyword>symbol_constant</keyword> |
159 |
<keyword>boolean_constant</keyword> |
160 |
|
161 |
<keyword>real</keyword> |
162 |
<keyword>integer</keyword> |
163 |
<keyword>symbol</keyword> |
164 |
<keyword>boolean</keyword> |
165 |
<keyword>set</keyword> |
166 |
</keyword-list> |
167 |
|
168 |
<keyword-list _name="Standard Constants" style="Preprocessor" case-sensitive="true"> |
169 |
<keyword>constant</keyword> |
170 |
<keyword>critical_compressibility</keyword> |
171 |
<keyword>acentric_factor</keyword> |
172 |
<keyword>UNIFAC_size</keyword> |
173 |
<keyword>Wilson_constant</keyword> |
174 |
<keyword>vapor_pressure_constant</keyword> |
175 |
<keyword>factor_constant</keyword> |
176 |
<keyword>molar_weight_constant</keyword> |
177 |
<keyword>atomic_mass_constant</keyword> |
178 |
<keyword>temperature_constant</keyword> |
179 |
<keyword>boiling_temperature</keyword> |
180 |
<keyword>critical_temperature</keyword> |
181 |
<keyword>reference_temperature</keyword> |
182 |
<keyword>UNIFAC_a</keyword> |
183 |
<keyword>length_constant</keyword> |
184 |
<keyword>pressure_constant</keyword> |
185 |
<keyword>critical_pressure</keyword> |
186 |
<keyword>reference_pressure</keyword> |
187 |
<keyword>molar_volume_constant</keyword> |
188 |
<keyword>critical_volume</keyword> |
189 |
<keyword>reference_molar_volume</keyword> |
190 |
<keyword>reference_mass_density</keyword> |
191 |
<keyword>molar_energy_constant</keyword> |
192 |
<keyword>reference_molar_energy</keyword> |
193 |
<keyword>enthalpy_of_formation_constant</keyword> |
194 |
<keyword>enthalpy_of_formation_constant</keyword> |
195 |
<keyword>heat_of_vaporization_constant</keyword> |
196 |
<keyword>Wilson_energy_constant</keyword> |
197 |
<keyword>molar_entropy_constant</keyword> |
198 |
<keyword>reference_molar_entropy</keyword> |
199 |
<keyword>heat_capacity_constant</keyword> |
200 |
<keyword>heat_capacity_a_constant</keyword> |
201 |
<keyword>heat_capacity_b_constant</keyword> |
202 |
<keyword>heat_capacity_c_constant</keyword> |
203 |
<keyword>heat_capacity_d_constant</keyword> |
204 |
<keyword>gas_constant</keyword> |
205 |
<keyword>gravity_constant</keyword> |
206 |
<keyword>circle_constant</keyword> |
207 |
<keyword>speed_of_light</keyword> |
208 |
<keyword>planck_constant</keyword> |
209 |
<keyword>avogadro_constant</keyword> |
210 |
<keyword>permittivity_constant</keyword> |
211 |
<keyword>permeability_constant</keyword> |
212 |
<keyword>electron_charge</keyword> |
213 |
<keyword>electron_mass</keyword> |
214 |
<keyword>proton_mass</keyword> |
215 |
<keyword>boolean_start_true</keyword> |
216 |
<keyword>boolean_start_false</keyword> |
217 |
<keyword>start_true</keyword> |
218 |
<keyword>start_false</keyword> |
219 |
<keyword>free_energy_of_formation_constant</keyword> |
220 |
<keyword>permeability_constant</keyword> |
221 |
<keyword>permeability_constant</keyword> |
222 |
<keyword>permeability_constant</keyword> |
223 |
<keyword>permeability_constant</keyword> |
224 |
<keyword>permeability_constant</keyword> |
225 |
<keyword>permeability_constant</keyword> |
226 |
</keyword-list> |
227 |
|
228 |
<!-- equation labels --> |
229 |
|
230 |
<pattern-item _name="Equation Labels" style="String"> |
231 |
<regex>^\s*[a-zA-Z][a-zA-Z0-9_]*(\[[a-zA-Z][a-zA-Z0-9_]*\]|\[0-9]+\])?\:</regex> |
232 |
</pattern-item> |
233 |
|
234 |
|
235 |
<!-- Functions --> |
236 |
|
237 |
<!-- Single-Row Functions --> |
238 |
|
239 |
<keyword-list _name="Numerical Functions" style="Function" case-sensitive="TRUE"> |
240 |
<keyword>abs</keyword> |
241 |
<keyword>(arc)?(cos|sin|tan)h?</keyword> |
242 |
<keyword>erf</keyword> |
243 |
<keyword>exp</keyword> |
244 |
<keyword>lnm?</keyword> |
245 |
<keyword>log10</keyword> |
246 |
</keyword-list> |
247 |
|
248 |
<!-- METHODS --> |
249 |
|
250 |
<keyword-list _name="Standard model methods" style="Function" case-sensitive="TRUE"> |
251 |
<keyword>default_self</keyword> |
252 |
<keyword>on_load</keyword> |
253 |
<keyword>ode_init</keyword> |
254 |
<keyword>specify</keyword> |
255 |
<keyword>values</keyword> |
256 |
<keyword>self_test</keyword> |
257 |
<keyword>ClearAll</keyword> |
258 |
<keyword>bound_self</keyword> |
259 |
<keyword>scale_self</keyword> |
260 |
<keyword>reset</keyword> |
261 |
</keyword-list> |
262 |
|
263 |
<!-- Default measures --> |
264 |
|
265 |
<keyword-list _name = "System Atoms" style="Data Type" case-sensitive="TRUE"> |
266 |
<keyword>relation</keyword> |
267 |
<keyword>logic_relation</keyword> |
268 |
<keyword>solver_var</keyword> |
269 |
<keyword>lower_bound</keyword> |
270 |
<keyword>upper_bound</keyword> |
271 |
<keyword>nominal</keyword> |
272 |
<keyword>included</keyword> |
273 |
<keyword>message</keyword> |
274 |
<keyword>fixed</keyword> |
275 |
<keyword>boolean_var</keyword> |
276 |
<keyword>generic_real</keyword> |
277 |
<keyword>solver_int</keyword> |
278 |
<keyword>relaxed</keyword> |
279 |
<keyword>is_zero</keyword> |
280 |
<keyword>solver_binary</keyword> |
281 |
<keyword>solver_semi</keyword> |
282 |
</keyword-list> |
283 |
|
284 |
<keyword-list _name = "Standard Atoms" style="Data Type" case-sensitive="TRUE"> |
285 |
<keyword>bound_width</keyword> |
286 |
<keyword>scaling_constant</keyword> |
287 |
<keyword>ode_counter</keyword> |
288 |
<keyword>obs_counter</keyword> |
289 |
<keyword>real_parameter</keyword> |
290 |
<keyword>length_parameter</keyword> |
291 |
<keyword>positive_variable</keyword> |
292 |
<keyword>variable</keyword> |
293 |
<keyword>fraction</keyword> |
294 |
<keyword>positive_factor</keyword> |
295 |
<keyword>small_factor</keyword> |
296 |
<keyword>small_positive_factor</keyword> |
297 |
<keyword>reduced_pressure</keyword> |
298 |
<keyword>exp_sub</keyword> |
299 |
<keyword>power_sub</keyword> |
300 |
<keyword>inverse_temperature</keyword> |
301 |
<keyword>force</keyword> |
302 |
<keyword>force_per_length</keyword> |
303 |
<keyword>surface_tension</keyword> |
304 |
<keyword>vapor_pressure</keyword> |
305 |
<keyword>k_constant</keyword> |
306 |
<keyword>molar_mass</keyword> |
307 |
<keyword>molar_rate</keyword> |
308 |
<keyword>mass</keyword> |
309 |
<keyword>mole_scale</keyword> |
310 |
<keyword>mole</keyword> |
311 |
<keyword>mass_rate</keyword> |
312 |
<keyword>mass_rate_rate</keyword> |
313 |
<keyword>mass_flux</keyword> |
314 |
<keyword>molar_rate_scale</keyword> |
315 |
<keyword>conc_rate</keyword> |
316 |
<keyword>mole_fraction</keyword> |
317 |
<keyword>mass_fraction</keyword> |
318 |
<keyword>molar_volume</keyword> |
319 |
<keyword>volume_scale</keyword> |
320 |
<keyword>volume_rate_scale</keyword> |
321 |
<keyword>volume_rate_square</keyword> |
322 |
<keyword>volume_expansivity</keyword> |
323 |
<keyword>molar_density</keyword> |
324 |
<keyword>mass_density</keyword> |
325 |
<keyword>density_rate</keyword> |
326 |
<keyword>molar_energy</keyword> |
327 |
<keyword>energy_scale</keyword> |
328 |
<keyword>energy_rate_scale</keyword> |
329 |
<keyword>energy_rate</keyword> |
330 |
<keyword>heat_capacity</keyword> |
331 |
<keyword>heat_transfer_coefficient</keyword> |
332 |
<keyword>molar_energy_rate</keyword> |
333 |
<keyword>molar_heat_capacity</keyword> |
334 |
<keyword>molar_entropy</keyword> |
335 |
<keyword>relative_volatility</keyword> |
336 |
<keyword>power_per_length</keyword> |
337 |
<keyword>power_per_volume</keyword> |
338 |
<keyword>pressure_per_temperature</keyword> |
339 |
<keyword>irradiance</keyword> |
340 |
<keyword>irradiation</keyword> |
341 |
<keyword>specific_energy</keyword> |
342 |
<keyword>specific_enthalpy</keyword> |
343 |
<keyword>specific_entropy</keyword> |
344 |
<keyword>specific_heat_capacity</keyword> |
345 |
<keyword>specific_volume</keyword> |
346 |
<keyword>specific_power</keyword> |
347 |
<keyword>specific_energy_rate</keyword> |
348 |
<keyword>entropy</keyword> |
349 |
<keyword>entropy_rate</keyword> |
350 |
<keyword>conc_rate</keyword> |
351 |
<keyword>partition_coefficient</keyword> |
352 |
<keyword>monetary_unit</keyword> |
353 |
<keyword>cost_per_volume</keyword> |
354 |
<keyword>cost_per_mass</keyword> |
355 |
<keyword>cost_per_time</keyword> |
356 |
<keyword>cost_per_energy</keyword> |
357 |
<keyword>inverse_area</keyword> |
358 |
<keyword>angle</keyword> |
359 |
<keyword>solid_angle</keyword> |
360 |
<keyword>time</keyword> |
361 |
<keyword>speed</keyword> |
362 |
<keyword>acceleration</keyword> |
363 |
<keyword>stiffness</keyword> |
364 |
<keyword>viscosity</keyword> |
365 |
<keyword>thermal_conductivity</keyword> |
366 |
<keyword>diffusivity</keyword> |
367 |
<keyword>voltage</keyword> |
368 |
<keyword>resistance</keyword> |
369 |
<keyword>current</keyword> |
370 |
<keyword>capacitance</keyword> |
371 |
<keyword>inductance</keyword> |
372 |
<keyword>magnetic_field</keyword> |
373 |
<keyword>electric_field</keyword> |
374 |
<keyword>delta_distance</keyword> |
375 |
<keyword>delta_temperature</keyword> |
376 |
<keyword>temperature_rate</keyword> |
377 |
<keyword>delta_pressure</keyword> |
378 |
<keyword>delta_mass</keyword> |
379 |
<keyword>delta_mole</keyword> |
380 |
<keyword>delta_mass_rate</keyword> |
381 |
<keyword>delta_molar_rate</keyword> |
382 |
<keyword>delta_volume_rate</keyword> |
383 |
<keyword>delta_energy_rate</keyword> |
384 |
<keyword>delta_molar_energy_rate</keyword> |
385 |
<keyword>delta_entropy_rate</keyword> |
386 |
<keyword>mass_sec</keyword> |
387 |
<keyword>mole_sec</keyword> |
388 |
<keywork>rate</keywork> |
389 |
</keyword-list> |
390 |
|
391 |
<keyword-list _name = "Data Types" style = "Data Type" case-sensitive="TRUE"> |
392 |
<keyword>factor</keyword> |
393 |
<keyword>distance</keyword> |
394 |
<keyword>pressure</keyword> |
395 |
<keyword>area</keyword> |
396 |
<keyword>volume</keyword> |
397 |
<keyword>temperature</keyword> |
398 |
<keyword>energy</keyword> |
399 |
<keyword>volume_rate</keyword> |
400 |
<keyword>frequency</keyword> |
401 |
<keyword>factor</keyword> |
402 |
</keyword-list> |
403 |
|
404 |
<!-- variables --> |
405 |
|
406 |
<!-- |
407 |
<pattern-item _name="Variables" style="Variable"> |
408 |
<regex>[a-zA-Z_][a-zA-Z0-9_]*</regex> |
409 |
</pattern-item> |
410 |
--> |
411 |
|
412 |
</language> |