1 <?xml version="1.0" encoding="UTF-8"?>
4 Authors: Marco Barisione, Emanuele Aina
5 Copyright (C) 2005-2007 Marco Barisione <barisione@gmail.com>
6 Copyright (C) 2005-2007 Emanuele Aina
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version.
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Library General Public License for more details.
18 You should have received a copy of the GNU Library General Public
19 License along with this library; if not, write to the
20 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA.
24 <language id="faust" _name="Faust" version="2.0" _section="Sources">
26 <property name="mimetypes">text/x-faust</property>
27 <property name="globs">*.dsp</property>
28 <property name="line-comment-start">//</property>
29 <property name="block-comment-start">/*</property>
30 <property name="block-comment-end">*/</property>
34 <style id="primitive" _name="Primitive" map-to="def:keyword"/>
35 <style id="structure" _name="Structure" map-to="def:statement"/>
37 <style id="comment" _name="Comment" map-to="def:comment"/>
38 <style id="error" _name="Error" map-to="def:error"/>
39 <style id="string" _name="String" map-to="def:string"/>
40 <style id="preprocessor" _name="Preprocessor" map-to="def:preprocessor"/>
41 <style id="common-defines" _name="Common Defines" map-to="def:special-constant"/>
42 <style id="included-file" _name="Included File" map-to="def:string"/>
43 <style id="char" _name="Character" map-to="def:character"/>
44 <style id="keyword" _name="Keyword" map-to="def:keyword"/>
45 <style id="type" _name="Data Type" map-to="def:type"/>
46 <style id="storage-class" _name="Storage Class" map-to="def:type"/>
47 <style id="printf" _name="printf Conversion" map-to="def:special-char"/>
48 <style id="escaped-character" _name="Escaped Character" map-to="def:special-char"/>
49 <style id="floating-point" _name="Floating point number" map-to="def:floating-point"/>
50 <style id="decimal" _name="Decimal number" map-to="def:decimal"/>
51 <style id="octal" _name="Octal number" map-to="def:base-n-integer"/>
52 <style id="hexadecimal" _name="Hexadecimal number" map-to="def:base-n-integer"/>
53 <style id="boolean" _name="Boolean value" map-to="def:boolean"/>
57 <!-- TODO: what about scanf ? -->
59 <context id="printf" style-ref="printf" extend-parent="false">
60 <match extended="true">
62 (?:[1-9][0-9]*\$)? # argument
63 [#0\-\ \+\'I]* # flags
64 (?:[1-9][0-9]*|\*)? # width
65 (?:\.\-?(?:[0-9]+|\*))? # precision
66 (?:hh|ll|[hlLqjzt])? # length modifier
67 [diouxXeEfFgGaAcsCSpnm] # conversion specifier
71 <define-regex id="escaped-character" extended="true">
72 \\( # leading backslash
73 [\\\"\'nrbtfav\?] | # escaped character
74 [0-7]{1,3} | # one, two, or three octal digits
75 x[0-9A-Fa-f]+ # 'x' followed by hex digits
83 <context ref="gtk-doc:inline-docs-section"/>
86 <context id="comment" style-ref="comment" end-at-line-end="true">
89 <context ref="def:in-line-comment"/>
93 <context id="comment-multiline" style-ref="comment">
97 <context ref="def:in-comment"/>
101 <context id="close-comment-outside-comment" style-ref="error">
102 <match>\*/(?!\*)</match>
105 <!-- Preprocessor -->
106 <define-regex id="preproc-start">^\s*#\s*</define-regex>
108 <context id="if0-comment" style-ref="comment">
109 <start>\%{preproc-start}if\b\s*0\b</start>
110 <end>\%{preproc-start}(endif|else|elif)\b</end>
112 <context id="if-in-if0">
113 <start>\%{preproc-start}if(n?def)?\b</start>
114 <end>\%{preproc-start}endif\b</end>
116 <context ref="if-in-if0"/>
117 <context ref="def:in-comment"/>
120 <context ref="def:in-comment"/>
124 <context id="include" style-ref="preprocessor">
125 <match extended="true">
131 <context id="included-file" sub-pattern="2" style-ref="included-file"/>
135 <context id="preprocessor" style-ref="preprocessor" end-at-line-end="true">
136 <start extended="true">
138 (define|undef|error|pragma|ident|if(n?def)?|else|elif|endif|line|warning)
142 <context ref="def:line-continue" ignore-style="true"/>
143 <context ref="string" ignore-style="true"/>
144 <context ref="comment"/>
145 <context ref="comment-multiline"/>
149 <context id="string" style-ref="string" end-at-line-end="true">
153 <context ref="printf"/>
154 <context id="escaped-character" style-ref="escaped-character">
155 <match>\%{escaped-character}</match>
157 <context ref="def:line-continue"/>
161 <context id="char" style-ref="char">
162 <match>L?'(\%{escaped-character}|.)'</match>
165 <!-- http://www.lysator.liu.se/c/ANSI-C-grammar-l.html -->
166 <context id="float" style-ref="floating-point">
167 <match extended="true">
169 ((\.[0-9]+ | [0-9]+\.[0-9]*) ([Ee][+-]?[0-9]*)? |
170 ([0-9]+[Ee][+-]?[0-9]*))
176 <context id="hexadecimal" style-ref="hexadecimal">
177 <match extended="true">
179 0[xX][a-fA-F0-9]+[uUlL]*
184 <context id="octal" style-ref="octal">
185 <match extended="true">
192 <context id="decimal" style-ref="decimal">
193 <match extended="true">
201 <context id="primitive" style-ref="primitive">
202 <keyword>mem</keyword>
203 <keyword>prefix</keyword>
204 <keyword>int</keyword>
205 <keyword>float</keyword>
206 <keyword>rdtable</keyword>
207 <keyword>rwtable</keyword>
208 <keyword>select2</keyword>
209 <keyword>select3</keyword>
210 <keyword>ffunction</keyword>
211 <keyword>fconstant</keyword>
212 <keyword>fvariable</keyword>
213 <keyword>button</keyword>
214 <keyword>checkbox</keyword>
215 <keyword>vslider</keyword>
216 <keyword>hslider</keyword>
217 <keyword>nentry</keyword>
218 <keyword>vgroup</keyword>
219 <keyword>hgroup</keyword>
220 <keyword>tgroup</keyword>
221 <keyword>vbargraph</keyword>
222 <keyword>hbargraph</keyword>
223 <keyword>attach</keyword>
224 <keyword>acos</keyword>
225 <keyword>asin</keyword>
226 <keyword>atan</keyword>
227 <keyword>atan2</keyword>
228 <keyword>cos</keyword>
229 <keyword>sin</keyword>
230 <keyword>tan</keyword>
231 <keyword>exp</keyword>
232 <keyword>log</keyword>
233 <keyword>log10</keyword>
234 <keyword>pow</keyword>
235 <keyword>sqrt</keyword>
236 <keyword>abs</keyword>
237 <keyword>min</keyword>
238 <keyword>max</keyword>
239 <keyword>fmod</keyword>
240 <keyword>remainder</keyword>
241 <keyword>floor</keyword>
242 <keyword>ceil</keyword>
243 <keyword>rint</keyword>
246 <context id="structure" style-ref="structure">
247 <keyword>process</keyword>
249 <keyword>with</keyword>
250 <keyword>case</keyword>
251 <keyword>seq</keyword>
252 <keyword>par</keyword>
253 <keyword>sum</keyword>
254 <keyword>prod</keyword>
255 <keyword>import</keyword>
257 <keyword>component</keyword>
258 <keyword>library</keyword>
259 <keyword>environment</keyword>
261 <keyword>declare</keyword>