gtksourceview3 2.2.4-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (334) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +59 -0
  3. data/ext/gtksourceview3/depend +6 -0
  4. data/ext/gtksourceview3/extconf.rb +67 -0
  5. data/ext/gtksourceview3/gtksourceview3.def +2 -0
  6. data/ext/gtksourceview3/rbgtksource.c +53 -0
  7. data/ext/gtksourceview3/rbgtksourcebuffer.c +318 -0
  8. data/ext/gtksourceview3/rbgtksourcegutter.c +82 -0
  9. data/ext/gtksourceview3/rbgtksourcegutterrenderer.c +143 -0
  10. data/ext/gtksourceview3/rbgtksourcegutterrendererpixbuf.c +42 -0
  11. data/ext/gtksourceview3/rbgtksourcegutterrenderertext.c +40 -0
  12. data/ext/gtksourceview3/rbgtksourcelanguage.c +124 -0
  13. data/ext/gtksourceview3/rbgtksourcelanguagemanager.c +114 -0
  14. data/ext/gtksourceview3/rbgtksourcemark.c +85 -0
  15. data/ext/gtksourceview3/rbgtksourcemarkattributes.c +77 -0
  16. data/ext/gtksourceview3/rbgtksourceprintcompositor.c +171 -0
  17. data/ext/gtksourceview3/rbgtksourcestyle.c +42 -0
  18. data/ext/gtksourceview3/rbgtksourcestylescheme.c +72 -0
  19. data/ext/gtksourceview3/rbgtksourcestyleschememanager.c +140 -0
  20. data/ext/gtksourceview3/rbgtksourceundomanager.c +83 -0
  21. data/ext/gtksourceview3/rbgtksourceview.c +94 -0
  22. data/ext/gtksourceview3/rbgtksourceview3conversions.h +50 -0
  23. data/ext/gtksourceview3/rbgtksourceview3private.h +53 -0
  24. data/extconf.rb +49 -0
  25. data/lib/2.0/gtksourceview3.so +0 -0
  26. data/lib/2.1/gtksourceview3.so +0 -0
  27. data/lib/2.2/gtksourceview3.so +0 -0
  28. data/lib/gtksourceview3.rb +20 -0
  29. data/lib/gtksourceview3/deprecated.rb +47 -0
  30. data/sample/sourcelanguagemanager.rb +21 -0
  31. data/sample/test.rb +32 -0
  32. data/test/run-test.rb +44 -0
  33. data/test/test_mark_attributes.rb +26 -0
  34. data/test/test_source_gutter_renderer.rb +33 -0
  35. data/test/test_source_language_manager.rb +46 -0
  36. data/test/test_source_view.rb +57 -0
  37. data/vendor/local/bin/libgtksourceview-3.0-1.dll +0 -0
  38. data/vendor/local/include/gtksourceview-3.0/gtksourceview/completion-providers/words/gtksourcecompletionwords.h +65 -0
  39. data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksource.h +54 -0
  40. data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcebuffer.h +213 -0
  41. data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcecompletion.h +142 -0
  42. data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcecompletioncontext.h +95 -0
  43. data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcecompletioninfo.h +78 -0
  44. data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcecompletionitem.h +70 -0
  45. data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcecompletionproposal.h +97 -0
  46. data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcecompletionprovider.h +137 -0
  47. data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourceencoding.h +54 -0
  48. data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcefile.h +115 -0
  49. data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcefileloader.h +122 -0
  50. data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcefilesaver.h +147 -0
  51. data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcegutter.h +90 -0
  52. data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcegutterrenderer.h +229 -0
  53. data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcegutterrendererpixbuf.h +87 -0
  54. data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcegutterrenderertext.h +83 -0
  55. data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcelanguage.h +85 -0
  56. data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcelanguagemanager.h +84 -0
  57. data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcemark.h +71 -0
  58. data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcemarkattributes.h +100 -0
  59. data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourceprintcompositor.h +175 -0
  60. data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcesearchcontext.h +133 -0
  61. data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcesearchsettings.h +85 -0
  62. data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcestyle.h +45 -0
  63. data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcestylescheme.h +109 -0
  64. data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcestyleschememanager.h +86 -0
  65. data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcetypes.h +101 -0
  66. data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourceundomanager.h +75 -0
  67. data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourceutils.h +34 -0
  68. data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourceview-typebuiltins.h +88 -0
  69. data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourceview.h +213 -0
  70. data/vendor/local/lib/girepository-1.0/GtkSource-3.0.typelib +0 -0
  71. data/vendor/local/lib/libgtksourceview-3.0.dll.a +0 -0
  72. data/vendor/local/lib/libgtksourceview-3.0.la +41 -0
  73. data/vendor/local/lib/locale/ar/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  74. data/vendor/local/lib/locale/as/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  75. data/vendor/local/lib/locale/ast/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  76. data/vendor/local/lib/locale/az/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  77. data/vendor/local/lib/locale/be/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  78. data/vendor/local/lib/locale/bg/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  79. data/vendor/local/lib/locale/bn/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  80. data/vendor/local/lib/locale/bn_IN/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  81. data/vendor/local/lib/locale/bs/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  82. data/vendor/local/lib/locale/ca/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  83. data/vendor/local/lib/locale/ca@valencia/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  84. data/vendor/local/lib/locale/cs/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  85. data/vendor/local/lib/locale/cy/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  86. data/vendor/local/lib/locale/da/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  87. data/vendor/local/lib/locale/de/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  88. data/vendor/local/lib/locale/dz/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  89. data/vendor/local/lib/locale/el/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  90. data/vendor/local/lib/locale/en@shaw/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  91. data/vendor/local/lib/locale/en_CA/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  92. data/vendor/local/lib/locale/en_GB/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  93. data/vendor/local/lib/locale/eo/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  94. data/vendor/local/lib/locale/es/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  95. data/vendor/local/lib/locale/et/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  96. data/vendor/local/lib/locale/eu/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  97. data/vendor/local/lib/locale/fa/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  98. data/vendor/local/lib/locale/fi/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  99. data/vendor/local/lib/locale/fr/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  100. data/vendor/local/lib/locale/ga/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  101. data/vendor/local/lib/locale/gl/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  102. data/vendor/local/lib/locale/gu/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  103. data/vendor/local/lib/locale/he/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  104. data/vendor/local/lib/locale/hi/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  105. data/vendor/local/lib/locale/hr/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  106. data/vendor/local/lib/locale/hu/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  107. data/vendor/local/lib/locale/id/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  108. data/vendor/local/lib/locale/it/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  109. data/vendor/local/lib/locale/ja/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  110. data/vendor/local/lib/locale/kn/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  111. data/vendor/local/lib/locale/ko/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  112. data/vendor/local/lib/locale/lt/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  113. data/vendor/local/lib/locale/lv/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  114. data/vendor/local/lib/locale/mai/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  115. data/vendor/local/lib/locale/mg/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  116. data/vendor/local/lib/locale/mk/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  117. data/vendor/local/lib/locale/ml/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  118. data/vendor/local/lib/locale/mn/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  119. data/vendor/local/lib/locale/mr/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  120. data/vendor/local/lib/locale/ms/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  121. data/vendor/local/lib/locale/nb/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  122. data/vendor/local/lib/locale/ne/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  123. data/vendor/local/lib/locale/nl/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  124. data/vendor/local/lib/locale/nn/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  125. data/vendor/local/lib/locale/oc/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  126. data/vendor/local/lib/locale/or/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  127. data/vendor/local/lib/locale/pa/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  128. data/vendor/local/lib/locale/pl/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  129. data/vendor/local/lib/locale/pt/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  130. data/vendor/local/lib/locale/pt_BR/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  131. data/vendor/local/lib/locale/ro/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  132. data/vendor/local/lib/locale/ru/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  133. data/vendor/local/lib/locale/rw/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  134. data/vendor/local/lib/locale/si/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  135. data/vendor/local/lib/locale/sk/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  136. data/vendor/local/lib/locale/sl/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  137. data/vendor/local/lib/locale/sq/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  138. data/vendor/local/lib/locale/sr/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  139. data/vendor/local/lib/locale/sr@latin/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  140. data/vendor/local/lib/locale/sv/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  141. data/vendor/local/lib/locale/ta/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  142. data/vendor/local/lib/locale/te/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  143. data/vendor/local/lib/locale/tg/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  144. data/vendor/local/lib/locale/th/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  145. data/vendor/local/lib/locale/tr/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  146. data/vendor/local/lib/locale/ug/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  147. data/vendor/local/lib/locale/uk/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  148. data/vendor/local/lib/locale/vi/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  149. data/vendor/local/lib/locale/xh/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  150. data/vendor/local/lib/locale/zh_CN/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  151. data/vendor/local/lib/locale/zh_HK/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  152. data/vendor/local/lib/locale/zh_TW/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
  153. data/vendor/local/lib/pkgconfig/gtksourceview-3.0.pc +12 -0
  154. data/vendor/local/share/gir-1.0/GtkSource-3.0.gir +11360 -0
  155. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceBuffer.html +2143 -0
  156. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceCompletion.html +1129 -0
  157. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceCompletionContext.html +397 -0
  158. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceCompletionInfo.html +348 -0
  159. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceCompletionItem.html +367 -0
  160. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceCompletionProposal.html +572 -0
  161. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceCompletionProvider.html +750 -0
  162. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceCompletionWords.html +345 -0
  163. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceEncoding.html +366 -0
  164. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceFile.html +563 -0
  165. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceFileLoader.html +769 -0
  166. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceFileSaver.html +962 -0
  167. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceGutter.html +490 -0
  168. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceGutterRenderer.html +1700 -0
  169. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceGutterRendererPixbuf.html +468 -0
  170. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceGutterRendererText.html +228 -0
  171. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceLanguage.html +584 -0
  172. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceLanguageManager.html +476 -0
  173. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceMark.html +310 -0
  174. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceMarkAttributes.html +897 -0
  175. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourcePrintCompositor.html +2149 -0
  176. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceSearchContext.html +1116 -0
  177. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceSearchSettings.html +606 -0
  178. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceStyle.html +358 -0
  179. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceStyleScheme.html +398 -0
  180. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceStyleSchemeManager.html +463 -0
  181. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceUndoManager.html +462 -0
  182. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceView.html +1990 -0
  183. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/annotation-glossary.html +81 -0
  184. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/api-index-3-0.html +43 -0
  185. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/api-index-3-10.html +195 -0
  186. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/api-index-3-12.html +39 -0
  187. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/api-index-3-14.html +299 -0
  188. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/api-index-3-4.html +35 -0
  189. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/api-index-deprecated.html +95 -0
  190. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/api-index-full.html +2187 -0
  191. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/ch01.html +119 -0
  192. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/ch02.html +47 -0
  193. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/gtksourceview-3.0-GtkSourceUtils.html +154 -0
  194. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/gtksourceview-3.0.devhelp2 +601 -0
  195. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/home.png +0 -0
  196. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/index.html +146 -0
  197. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/index.sgml +882 -0
  198. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/lang-reference.html +873 -0
  199. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/lang-tutorial.html +654 -0
  200. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/left-insensitive.png +0 -0
  201. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/left.png +0 -0
  202. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/object-tree.html +71 -0
  203. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/right-insensitive.png +0 -0
  204. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/right.png +0 -0
  205. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/style-reference.html +283 -0
  206. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/style.css +476 -0
  207. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/up-insensitive.png +0 -0
  208. data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/up.png +0 -0
  209. data/vendor/local/share/gtksourceview-3.0/language-specs/R.lang +2199 -0
  210. data/vendor/local/share/gtksourceview-3.0/language-specs/actionscript.lang +268 -0
  211. data/vendor/local/share/gtksourceview-3.0/language-specs/ada.lang +221 -0
  212. data/vendor/local/share/gtksourceview-3.0/language-specs/ansforth94.lang +729 -0
  213. data/vendor/local/share/gtksourceview-3.0/language-specs/asp.lang +1097 -0
  214. data/vendor/local/share/gtksourceview-3.0/language-specs/automake.lang +330 -0
  215. data/vendor/local/share/gtksourceview-3.0/language-specs/awk.lang +138 -0
  216. data/vendor/local/share/gtksourceview-3.0/language-specs/bennugd.lang +267 -0
  217. data/vendor/local/share/gtksourceview-3.0/language-specs/bibtex.lang +93 -0
  218. data/vendor/local/share/gtksourceview-3.0/language-specs/bluespec.lang +188 -0
  219. data/vendor/local/share/gtksourceview-3.0/language-specs/boo.lang +257 -0
  220. data/vendor/local/share/gtksourceview-3.0/language-specs/c.lang +332 -0
  221. data/vendor/local/share/gtksourceview-3.0/language-specs/cg.lang +232 -0
  222. data/vendor/local/share/gtksourceview-3.0/language-specs/changelog.lang +93 -0
  223. data/vendor/local/share/gtksourceview-3.0/language-specs/chdr.lang +43 -0
  224. data/vendor/local/share/gtksourceview-3.0/language-specs/cmake.lang +408 -0
  225. data/vendor/local/share/gtksourceview-3.0/language-specs/cobol.lang +647 -0
  226. data/vendor/local/share/gtksourceview-3.0/language-specs/cpp.lang +120 -0
  227. data/vendor/local/share/gtksourceview-3.0/language-specs/csharp.lang +282 -0
  228. data/vendor/local/share/gtksourceview-3.0/language-specs/css.lang +542 -0
  229. data/vendor/local/share/gtksourceview-3.0/language-specs/cuda.lang +292 -0
  230. data/vendor/local/share/gtksourceview-3.0/language-specs/d.lang +318 -0
  231. data/vendor/local/share/gtksourceview-3.0/language-specs/def.lang +262 -0
  232. data/vendor/local/share/gtksourceview-3.0/language-specs/desktop.lang +300 -0
  233. data/vendor/local/share/gtksourceview-3.0/language-specs/diff.lang +85 -0
  234. data/vendor/local/share/gtksourceview-3.0/language-specs/docbook.lang +476 -0
  235. data/vendor/local/share/gtksourceview-3.0/language-specs/dosbatch.lang +167 -0
  236. data/vendor/local/share/gtksourceview-3.0/language-specs/dot.lang +140 -0
  237. data/vendor/local/share/gtksourceview-3.0/language-specs/dpatch.lang +48 -0
  238. data/vendor/local/share/gtksourceview-3.0/language-specs/dtd.lang +140 -0
  239. data/vendor/local/share/gtksourceview-3.0/language-specs/eiffel.lang +239 -0
  240. data/vendor/local/share/gtksourceview-3.0/language-specs/erlang.lang +258 -0
  241. data/vendor/local/share/gtksourceview-3.0/language-specs/fcl.lang +113 -0
  242. data/vendor/local/share/gtksourceview-3.0/language-specs/forth.lang +235 -0
  243. data/vendor/local/share/gtksourceview-3.0/language-specs/fortran.lang +591 -0
  244. data/vendor/local/share/gtksourceview-3.0/language-specs/fsharp.lang +325 -0
  245. data/vendor/local/share/gtksourceview-3.0/language-specs/gap.lang +85 -0
  246. data/vendor/local/share/gtksourceview-3.0/language-specs/gdb-log.lang +152 -0
  247. data/vendor/local/share/gtksourceview-3.0/language-specs/glsl.lang +483 -0
  248. data/vendor/local/share/gtksourceview-3.0/language-specs/go.lang +275 -0
  249. data/vendor/local/share/gtksourceview-3.0/language-specs/gtk-doc.lang +91 -0
  250. data/vendor/local/share/gtksourceview-3.0/language-specs/gtkrc.lang +116 -0
  251. data/vendor/local/share/gtksourceview-3.0/language-specs/haddock.lang +162 -0
  252. data/vendor/local/share/gtksourceview-3.0/language-specs/haskell-literate.lang +59 -0
  253. data/vendor/local/share/gtksourceview-3.0/language-specs/haskell.lang +228 -0
  254. data/vendor/local/share/gtksourceview-3.0/language-specs/html.lang +281 -0
  255. data/vendor/local/share/gtksourceview-3.0/language-specs/idl-exelis.lang +620 -0
  256. data/vendor/local/share/gtksourceview-3.0/language-specs/idl.lang +154 -0
  257. data/vendor/local/share/gtksourceview-3.0/language-specs/imagej.lang +784 -0
  258. data/vendor/local/share/gtksourceview-3.0/language-specs/ini.lang +95 -0
  259. data/vendor/local/share/gtksourceview-3.0/language-specs/j.lang +240 -0
  260. data/vendor/local/share/gtksourceview-3.0/language-specs/java.lang +190 -0
  261. data/vendor/local/share/gtksourceview-3.0/language-specs/javascript.lang +339 -0
  262. data/vendor/local/share/gtksourceview-3.0/language-specs/json.lang +123 -0
  263. data/vendor/local/share/gtksourceview-3.0/language-specs/julia.lang +378 -0
  264. data/vendor/local/share/gtksourceview-3.0/language-specs/language.dtd +73 -0
  265. data/vendor/local/share/gtksourceview-3.0/language-specs/language.rng +373 -0
  266. data/vendor/local/share/gtksourceview-3.0/language-specs/language2.rng +482 -0
  267. data/vendor/local/share/gtksourceview-3.0/language-specs/latex.lang +600 -0
  268. data/vendor/local/share/gtksourceview-3.0/language-specs/lex.lang +209 -0
  269. data/vendor/local/share/gtksourceview-3.0/language-specs/libtool.lang +56 -0
  270. data/vendor/local/share/gtksourceview-3.0/language-specs/llvm.lang +315 -0
  271. data/vendor/local/share/gtksourceview-3.0/language-specs/lua.lang +157 -0
  272. data/vendor/local/share/gtksourceview-3.0/language-specs/m4.lang +1375 -0
  273. data/vendor/local/share/gtksourceview-3.0/language-specs/makefile.lang +193 -0
  274. data/vendor/local/share/gtksourceview-3.0/language-specs/mallard.lang +124 -0
  275. data/vendor/local/share/gtksourceview-3.0/language-specs/markdown.lang +402 -0
  276. data/vendor/local/share/gtksourceview-3.0/language-specs/matlab.lang +171 -0
  277. data/vendor/local/share/gtksourceview-3.0/language-specs/mediawiki.lang +327 -0
  278. data/vendor/local/share/gtksourceview-3.0/language-specs/modelica.lang +262 -0
  279. data/vendor/local/share/gtksourceview-3.0/language-specs/mxml.lang +65 -0
  280. data/vendor/local/share/gtksourceview-3.0/language-specs/nemerle.lang +263 -0
  281. data/vendor/local/share/gtksourceview-3.0/language-specs/netrexx.lang +319 -0
  282. data/vendor/local/share/gtksourceview-3.0/language-specs/nsis.lang +88 -0
  283. data/vendor/local/share/gtksourceview-3.0/language-specs/objc.lang +120 -0
  284. data/vendor/local/share/gtksourceview-3.0/language-specs/objj.lang +128 -0
  285. data/vendor/local/share/gtksourceview-3.0/language-specs/ocaml.lang +302 -0
  286. data/vendor/local/share/gtksourceview-3.0/language-specs/ocl.lang +139 -0
  287. data/vendor/local/share/gtksourceview-3.0/language-specs/octave.lang +859 -0
  288. data/vendor/local/share/gtksourceview-3.0/language-specs/ooc.lang +265 -0
  289. data/vendor/local/share/gtksourceview-3.0/language-specs/opal.lang +343 -0
  290. data/vendor/local/share/gtksourceview-3.0/language-specs/opencl.lang +600 -0
  291. data/vendor/local/share/gtksourceview-3.0/language-specs/pascal.lang +268 -0
  292. data/vendor/local/share/gtksourceview-3.0/language-specs/perl.lang +1045 -0
  293. data/vendor/local/share/gtksourceview-3.0/language-specs/php.lang +363 -0
  294. data/vendor/local/share/gtksourceview-3.0/language-specs/pkgconfig.lang +62 -0
  295. data/vendor/local/share/gtksourceview-3.0/language-specs/po.lang +94 -0
  296. data/vendor/local/share/gtksourceview-3.0/language-specs/prolog.lang +249 -0
  297. data/vendor/local/share/gtksourceview-3.0/language-specs/protobuf.lang +101 -0
  298. data/vendor/local/share/gtksourceview-3.0/language-specs/puppet.lang +697 -0
  299. data/vendor/local/share/gtksourceview-3.0/language-specs/python.lang +472 -0
  300. data/vendor/local/share/gtksourceview-3.0/language-specs/python3.lang +192 -0
  301. data/vendor/local/share/gtksourceview-3.0/language-specs/rpmspec.lang +212 -0
  302. data/vendor/local/share/gtksourceview-3.0/language-specs/rst.lang +142 -0
  303. data/vendor/local/share/gtksourceview-3.0/language-specs/ruby.lang +750 -0
  304. data/vendor/local/share/gtksourceview-3.0/language-specs/scala.lang +384 -0
  305. data/vendor/local/share/gtksourceview-3.0/language-specs/scheme.lang +302 -0
  306. data/vendor/local/share/gtksourceview-3.0/language-specs/scilab.lang +209 -0
  307. data/vendor/local/share/gtksourceview-3.0/language-specs/sh.lang +499 -0
  308. data/vendor/local/share/gtksourceview-3.0/language-specs/sml.lang +201 -0
  309. data/vendor/local/share/gtksourceview-3.0/language-specs/sparql.lang +448 -0
  310. data/vendor/local/share/gtksourceview-3.0/language-specs/sql.lang +618 -0
  311. data/vendor/local/share/gtksourceview-3.0/language-specs/sweave.lang +67 -0
  312. data/vendor/local/share/gtksourceview-3.0/language-specs/systemverilog.lang +263 -0
  313. data/vendor/local/share/gtksourceview-3.0/language-specs/t2t.lang +150 -0
  314. data/vendor/local/share/gtksourceview-3.0/language-specs/tcl.lang +146 -0
  315. data/vendor/local/share/gtksourceview-3.0/language-specs/texinfo.lang +448 -0
  316. data/vendor/local/share/gtksourceview-3.0/language-specs/vala.lang +365 -0
  317. data/vendor/local/share/gtksourceview-3.0/language-specs/vbnet.lang +245 -0
  318. data/vendor/local/share/gtksourceview-3.0/language-specs/verilog.lang +476 -0
  319. data/vendor/local/share/gtksourceview-3.0/language-specs/vhdl.lang +248 -0
  320. data/vendor/local/share/gtksourceview-3.0/language-specs/xml.lang +220 -0
  321. data/vendor/local/share/gtksourceview-3.0/language-specs/xslt.lang +108 -0
  322. data/vendor/local/share/gtksourceview-3.0/language-specs/yacc.lang +177 -0
  323. data/vendor/local/share/gtksourceview-3.0/language-specs/yaml.lang +214 -0
  324. data/vendor/local/share/gtksourceview-3.0/styles/classic.xml +121 -0
  325. data/vendor/local/share/gtksourceview-3.0/styles/cobalt.xml +148 -0
  326. data/vendor/local/share/gtksourceview-3.0/styles/kate.xml +171 -0
  327. data/vendor/local/share/gtksourceview-3.0/styles/oblivion.xml +129 -0
  328. data/vendor/local/share/gtksourceview-3.0/styles/solarized-dark.xml +101 -0
  329. data/vendor/local/share/gtksourceview-3.0/styles/solarized-light.xml +101 -0
  330. data/vendor/local/share/gtksourceview-3.0/styles/styles.rng +142 -0
  331. data/vendor/local/share/gtksourceview-3.0/styles/tango.xml +130 -0
  332. data/vendor/local/share/license/gtksourceview/AUTHORS +13 -0
  333. data/vendor/local/share/license/gtksourceview/COPYING +504 -0
  334. metadata +389 -0
@@ -0,0 +1,654 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
+ <title>GtkSourceView 3 Reference Manual: Language Definition v2.0 Tutorial</title>
6
+ <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
7
+ <link rel="home" href="index.html" title="GtkSourceView 3 Reference Manual">
8
+ <link rel="up" href="ch02.html" title="Syntax highlighting reference">
9
+ <link rel="prev" href="ch02.html" title="Syntax highlighting reference">
10
+ <link rel="next" href="lang-reference.html" title="Language Definition v2.0 Reference">
11
+ <meta name="generator" content="GTK-Doc V1.21.1 (XML mode)">
12
+ <link rel="stylesheet" href="style.css" type="text/css">
13
+ </head>
14
+ <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15
+ <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
16
+ <td width="100%" align="left" class="shortcuts"></td>
17
+ <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
18
+ <td><a accesskey="u" href="ch02.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
19
+ <td><a accesskey="p" href="ch02.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
20
+ <td><a accesskey="n" href="lang-reference.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
21
+ </tr></table>
22
+ <div class="refentry">
23
+ <a name="lang-tutorial"></a><div class="titlepage"></div>
24
+ <div class="refnamediv"><table width="100%"><tr>
25
+ <td valign="top">
26
+ <h2><span class="refentrytitle">Language Definition v2.0 Tutorial</span></h2>
27
+ <p>Language Definition v2.0 Tutorial —
28
+ Guide to the GtkSourceView language definition file format
29
+ </p>
30
+ </td>
31
+ <td class="gallery_image" valign="top" align="right"></td>
32
+ </tr></table></div>
33
+ <div class="refsect1">
34
+ <a name="tutorial"></a><h2>A language definition for the C language</h2>
35
+ <div class="note"><p>
36
+ The version 2 here refers to the language definition file format,
37
+ not to the version of GtkSourceView. So this tutorial is suitable
38
+ for GtkSourceView 2 and 3.
39
+ </p></div>
40
+ <p>
41
+ To describe the syntax of a language GtkSourceView uses an XML format which
42
+ defines nested context to be highlighted. Each context roughly corresponds
43
+ to a portion of the syntax which has to be highlighted (e.g. keywords,
44
+ strings, comments), and can contain nested contexts (e.g. escaped
45
+ characters.)
46
+ </p>
47
+ <p>
48
+ In this tutorial we will analyze a simple example to highlight a subset of
49
+ C, based on the full C language definition.
50
+ </p>
51
+ <p>
52
+ Like every well formed XML document, the language description starts with a
53
+ XML declaration:
54
+ </p>
55
+ <pre class="programlisting">
56
+ &lt;?xml version="1.0" encoding="UTF-8"?&gt;
57
+ </pre>
58
+ <p>
59
+ After the usual preamble, the main tag is the <code class="code">&lt;language&gt;</code> element:
60
+ </p>
61
+ <pre class="programlisting">
62
+ &lt;language id="c" _name="C" version="2.0" _section="Source"&gt;
63
+ </pre>
64
+ <p>
65
+ The attribute <code class="code">id</code> is used in external references and defines a standard
66
+ way to refer to this language definition, while the <code class="code">name</code> attribute is
67
+ the name presented to the user (it is translatable using gettext prepending a
68
+ <code class="code">_</code>.)
69
+ </p>
70
+ <p>
71
+ The attribute <code class="code">section</code>, also translatable, tells the category where
72
+ this language should be grouped when it is presented to the user. Currently
73
+ available categories in GtkSourceView are "Source", "Script", "Markup",
74
+ "Scientific" and "Other".
75
+ </p>
76
+ <p>
77
+ The attribute <code class="code">version</code> specifies the version of the xml syntax
78
+ used in your language definition file, so it should always be <code class="code">2.0</code>.
79
+ </p>
80
+ <p>
81
+ The <code class="code">&lt;language&gt;</code> element contains three sections:
82
+ <code class="code">&lt;metadata&gt;</code>, <code class="code">&lt;styles&gt;</code> and
83
+ <code class="code">&lt;definitions&gt;</code>
84
+ </p>
85
+ <pre class="programlisting">
86
+ &lt;metadata&gt;
87
+ </pre>
88
+ <p>
89
+ The <code class="code">&lt;metadata&gt;</code> element is optional and provides a collection
90
+ of properties which specify arbitrary information about the language definition
91
+ file itself. It is particularly important to specify the conventional
92
+ <code class="code">mimetypes</code> and <code class="code">globs</code> properties that
93
+ GtkSourceView uses to automatically detect which syntax highlighting to use
94
+ for a given file. They respectively contain a semi-colon separated list of
95
+ mimetypes and filename extensions.
96
+ </p>
97
+ <pre class="programlisting">
98
+ &lt;metadata&gt;
99
+ &lt;property name="mimetypes"&gt;text/x-c;text/x-csrc&lt;/property&gt;
100
+ &lt;property name="globs"&gt;*.c&lt;/property&gt;
101
+ &lt;/metadata&gt;
102
+ </pre>
103
+ <pre class="programlisting">
104
+ &lt;styles&gt;
105
+ </pre>
106
+ <p>
107
+ This element contains every association between the styles used in the
108
+ description and the defaults stored internally in GtkSourceView.
109
+ For each style there is a <code class="code">&lt;style&gt;</code> element:
110
+ </p>
111
+ <pre class="programlisting">
112
+ &lt;style id="comment" _name="Comment" map-to="def:comment"/&gt;
113
+ </pre>
114
+ <p>
115
+ This defines a <code class="code">comment</code> style, which inherits the font
116
+ properties from the defaults style <code class="code">def:comment</code>.
117
+ The <code class="code">name</code> attribute contains the translatable name for this
118
+ style, which is the name to show to the user.
119
+ </p>
120
+ <p>
121
+ For each style used in the language definition there is a corresponding
122
+ <code class="code">&lt;style&gt;</code> element; every style can be used in different
123
+ contexts, so they will share the same appearance.
124
+ </p>
125
+ <pre class="programlisting">
126
+ &lt;style id="string" _name="String" map-to="def:string"/&gt;
127
+ &lt;style id="escaped-character" _name="Escaped Character" map-to="def:special-char"/&gt;
128
+ &lt;style id="preprocessor" _name="Preprocessor" map-to="def:preprocessor"/&gt;
129
+ &lt;style id="included-file" _name="Included File" map-to="def:string"/&gt;
130
+ &lt;style id="char" _name="Character" map-to="def:character"/&gt;
131
+ &lt;style id="keyword" _name="Keyword" map-to="def:keyword"/&gt;
132
+ &lt;style id="type" _name="Data Type" map-to="def:type"/&gt;
133
+ </pre>
134
+ <p>
135
+ Following the <code class="code">&lt;styles&gt;</code> element there is the
136
+ <code class="code">&lt;definitions&gt;</code> element, which contains the
137
+ description proper of the syntax:
138
+ </p>
139
+ <pre class="programlisting">
140
+ &lt;definitions&gt;
141
+ </pre>
142
+ <p>
143
+ Here we should define a main context, the one we enter at the beginning of
144
+ the file: to do so we use the <code class="code">&lt;context&gt;</code> tag, with an
145
+ <code class="code">id</code> equal to the <code class="code">id</code> of the
146
+ <code class="code">&lt;language&gt;</code> element:
147
+ </p>
148
+ <pre class="programlisting">
149
+ &lt;context id="c"&gt;
150
+ </pre>
151
+ <p>
152
+ The element <code class="code">&lt;include&gt;</code> contains the list of sub-contexts
153
+ for the current context: as we are in the main context we should put here
154
+ the top level contexts for the C language:
155
+ </p>
156
+ <pre class="programlisting">
157
+ &lt;include&gt;
158
+ </pre>
159
+ <p>
160
+ The first context defined is the one for single-line C style comments: they
161
+ start with a double slash <code class="code">//</code> and end at the end of the line:
162
+ </p>
163
+ <pre class="programlisting">
164
+ &lt;context id="comment" style-ref="comment"&gt;
165
+ &lt;start&gt;\/\/&lt;/start&gt;
166
+ &lt;end&gt;$&lt;/end&gt;
167
+ &lt;/context&gt;
168
+ </pre>
169
+ <p>
170
+ The <code class="code">&lt;start&gt;</code> element contains the regular expression telling
171
+ the highlighting engine to enter in the defined context, until the terminating
172
+ regular expression contained in the <code class="code">&lt;end&gt;</code> element is found.
173
+ </p>
174
+ <p>
175
+ Those regular expressions are PCRE regular expressions in the form
176
+ <code class="code">/regex/options</code> (see the documentation of PCRE for details.) If
177
+ there are no options to be specified and you don't need to match the spaces at
178
+ the start and at the end of the regular expression, you can omit the slashes,
179
+ putting here only <code class="code">regex</code>.
180
+ </p>
181
+ <p>
182
+ The possible options are:
183
+ </p>
184
+ <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
185
+ <li class="listitem"><p>
186
+ <code class="code">i</code>: case insensitive;
187
+ </p></li>
188
+ <li class="listitem"><p>
189
+ <code class="code">x</code>: extended (spaces are ignored and it is possible to put comments
190
+ starting with <code class="code">#</code> and ending at the end of the line);
191
+ </p></li>
192
+ <li class="listitem"><p>
193
+ <code class="code">s</code>: the metacharacter <code class="code">.</code> matches the <code class="code">\n</code>.
194
+ </p></li>
195
+ </ul></div>
196
+ <p>
197
+ You can set the default options using the <code class="code">&lt;default-regex-options</code> tag
198
+ before the <code class="code">&lt;definitions&gt;</code> element. To disable a group of options,
199
+ instead, you have to preced them with a hyphen (<code class="code">-</code>).
200
+ [FIXME: add an example]
201
+ </p>
202
+ <p>
203
+ In GtkSourceView are available also some extensions to the standard perl
204
+ style regular expressions:
205
+ </p>
206
+ <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
207
+ <li class="listitem"><p>
208
+ <code class="code">\%[</code> and <code class="code">\%]</code> are custom word boundaries, which can
209
+ be redefined with the <code class="code">&lt;keyword-char-class&gt;</code> tag (in
210
+ contrast with <code class="code">\b</code>);
211
+ </p></li>
212
+ <li class="listitem"><p>
213
+ <code class="code">\%{id}</code> will include the regular expression defined in the
214
+ <code class="code">&lt;define-regex&gt;</code> tag with the same id, useful if you have
215
+ common portions of regular expressions used in different contexts;
216
+ </p></li>
217
+ <li class="listitem"><p>
218
+ <code class="code">\%{subpattern@start}</code> can be used only inside the
219
+ <code class="code">&lt;end&gt;</code> tag and will be substituted with the
220
+ string matched in the corresponding
221
+ sub-pattern (can be a number or a name if named sub-patterns are
222
+ used) in the preceding <code class="code">&lt;start&gt;</code> element. For an example
223
+ see the implementation of here-documents in the <code class="filename">sh.lang</code>
224
+ language description distribuited with GtkSourceView.
225
+ </p></li>
226
+ </ul></div>
227
+ <p>
228
+ The next context is for C-style strings. They start and end with a double
229
+ quote but they can contain escaped double quotes, so we sould make sure
230
+ we don't end the string prematurely:
231
+ </p>
232
+ <pre class="programlisting">
233
+ &lt;context id="string" end-at-line-end="true" style-ref="string"&gt;
234
+ </pre>
235
+ <p>
236
+ The <code class="code">end-at-line-end</code> attribute tells the engine that the current context
237
+ should be forced to terminate at the end of the line, even if the ending
238
+ regular expression is not found, and that an error should be displayed.
239
+ </p>
240
+ <pre class="programlisting">
241
+ &lt;start&gt;"&lt;/start&gt;
242
+ &lt;end&gt;"&lt;/end&gt;
243
+ &lt;include&gt;
244
+ </pre>
245
+ <p>
246
+ To implement the escape handling we include a <code class="code">escape</code> context:
247
+ </p>
248
+ <pre class="programlisting">
249
+ &lt;context id="escape" style-ref="escaped-character"&gt;
250
+ &lt;match&gt;\\.&lt;/match&gt;
251
+ &lt;/context&gt;
252
+ </pre>
253
+ <p>
254
+ This is a simple context matching a single regular expression, contained in
255
+ the <code class="code">&lt;match&gt;</code> element. This context will extend its parent, causing the
256
+ ending regular expression of the <code class="code">"string"</code> context to not match the escaped
257
+ double quote.
258
+ </p>
259
+ <pre class="programlisting">
260
+ &lt;/include&gt;
261
+ &lt;/context&gt;
262
+ </pre>
263
+ <p>
264
+ Multiline C-style comment can span over multiple lines and cannot be
265
+ escaped, but to make things more interesting we want to highlight every
266
+ internet address contained:
267
+ </p>
268
+ <pre class="programlisting">
269
+ &lt;context id="comment-multiline" style-ref="comment"&gt;
270
+ &lt;start&gt;\/\*&lt;/start&gt;
271
+ &lt;end&gt;\*\/&lt;/end&gt;
272
+ &lt;include&gt;
273
+ &lt;context id="net-address" style-ref="net-address" extend-parent="false"&gt;
274
+ </pre>
275
+ <p>
276
+ In this case, the child should be terminated if the end of the parent is
277
+ found, so we use <code class="code">false</code> in the <code class="code">extend-parent</code> attribute.
278
+ </p>
279
+ <pre class="programlisting">
280
+ &lt;match&gt;http:\/\/[^\s]*&lt;/match&gt;
281
+ &lt;/context&gt;
282
+ &lt;/include&gt;
283
+ &lt;/context&gt;
284
+ </pre>
285
+ <p>
286
+ For instance in the following comment the string <code class="code">http://www.gnome.org*/</code>
287
+ matches the <code class="code">net-address</code> context but it contains the end of the parent
288
+ context (<code class="code">*/</code>.) As <code class="code">extend-parent</code> is false,
289
+ only <code class="code">http://www.gnome.org</code> is
290
+ highlighted as an address and <code class="code">*/</code> is correctly recognized as the end of
291
+ the comment.
292
+ </p>
293
+ <pre class="programlisting">
294
+ /* This is a comment http://www.gnome.org */
295
+ </pre>
296
+ <p>
297
+ Character constants in C are delimited by single quotes (<code class="code">'</code>) and can
298
+ contain escaped characters:
299
+ </p>
300
+ <pre class="programlisting">
301
+ &lt;context id="char" end-at-line-end="true" style-ref="string"&gt;
302
+ &lt;start&gt;'&lt;/start&gt;
303
+ &lt;end&gt;'&lt;/end&gt;
304
+ &lt;include&gt;
305
+ &lt;context ref="escape"/&gt;
306
+ </pre>
307
+ <p>
308
+ The <code class="code">ref</code> attribute is used when we want to reuse a previously defined
309
+ context. Here we reuse the <code class="code">escape</code> context defined in the <code class="code">string</code>
310
+ context, without repeating its definition.
311
+ </p>
312
+ <pre class="programlisting">
313
+ &lt;/include&gt;
314
+ &lt;/context&gt;
315
+ </pre>
316
+ <p>
317
+ Using <code class="code">ref</code> it is also possible to refer to contexts defined in other
318
+ languages, preceding the id of the context with the id of the containing
319
+ language, separating them with a colon:
320
+ </p>
321
+ <pre class="programlisting">
322
+ &lt;context ref="def:decimal"/&gt;
323
+ &lt;context ref="def:float"/&gt;
324
+ </pre>
325
+ <p>
326
+ The definitions for decimal and float constants are in a external file,
327
+ with id <code class="code">def</code>, which is not associated with any language but contains
328
+ reusable contexts wich every language definition can import.
329
+ </p>
330
+ <p>
331
+ The <code class="code">def</code> language file contains an <code class="code">in-comment</code> context that can contain
332
+ addresses and tags such as FIXME and TODO, so we can write a new version of
333
+ our <code class="code">comment-multiline</code> context that uses the definitions from <code class="code">def.lang</code>.
334
+ </p>
335
+ <pre class="programlisting">
336
+ &lt;context id="comment-multiline" style-ref="comment"&gt;
337
+ &lt;start&gt;\/\*&lt;/start&gt;
338
+ &lt;end&gt;\*\/&lt;/end&gt;
339
+ &lt;include&gt;
340
+ &lt;context ref="def:in-comment"/&gt;
341
+ </pre>
342
+ <pre class="programlisting">
343
+ &lt;/include&gt;
344
+ &lt;/context&gt;
345
+ </pre>
346
+ <p>
347
+ Keywords can be grouped in a context using a list of <code class="code">&lt;keyword&gt;</code>
348
+ elements:
349
+ </p>
350
+ <pre class="programlisting">
351
+ &lt;context id="keywords" style-ref="keyword"&gt;
352
+ &lt;keyword&gt;if&lt;/keyword&gt;
353
+ &lt;keyword&gt;else&lt;/keyword&gt;
354
+ &lt;keyword&gt;for&lt;/keyword&gt;
355
+ &lt;keyword&gt;while&lt;/keyword&gt;
356
+ &lt;keyword&gt;return&lt;/keyword&gt;
357
+ &lt;keyword&gt;break&lt;/keyword&gt;
358
+ &lt;keyword&gt;switch&lt;/keyword&gt;
359
+ &lt;keyword&gt;case&lt;/keyword&gt;
360
+ &lt;keyword&gt;default&lt;/keyword&gt;
361
+ &lt;keyword&gt;do&lt;/keyword&gt;
362
+ &lt;keyword&gt;continue&lt;/keyword&gt;
363
+ &lt;keyword&gt;goto&lt;/keyword&gt;
364
+ &lt;keyword&gt;sizeof&lt;/keyword&gt;
365
+ &lt;/context&gt;
366
+ </pre>
367
+ <p>
368
+ Keywords with different meaning can be grouped in different context, making
369
+ possible to highlight them differently:
370
+ </p>
371
+ <pre class="programlisting">
372
+ &lt;context id="types" style-ref="type"&gt;
373
+ &lt;keyword&gt;char&lt;/keyword&gt;
374
+ &lt;keyword&gt;const&lt;/keyword&gt;
375
+ &lt;keyword&gt;double&lt;/keyword&gt;
376
+ &lt;keyword&gt;enum&lt;/keyword&gt;
377
+ &lt;keyword&gt;float&lt;/keyword&gt;
378
+ &lt;keyword&gt;int&lt;/keyword&gt;
379
+ &lt;keyword&gt;long&lt;/keyword&gt;
380
+ &lt;keyword&gt;short&lt;/keyword&gt;
381
+ &lt;keyword&gt;signed&lt;/keyword&gt;
382
+ &lt;keyword&gt;static&lt;/keyword&gt;
383
+ &lt;keyword&gt;struct&lt;/keyword&gt;
384
+ &lt;keyword&gt;typedef&lt;/keyword&gt;
385
+ &lt;keyword&gt;union&lt;/keyword&gt;
386
+ &lt;keyword&gt;unsigned&lt;/keyword&gt;
387
+ &lt;keyword&gt;void&lt;/keyword&gt;
388
+ &lt;/context&gt;
389
+ </pre>
390
+ <p>
391
+ You can also set a prefix (or a suffix) common to every keyword using the
392
+ <code class="code">&lt;prefix&gt;</code> and <code class="code">&lt;suffix&gt;</code> tags:
393
+ </p>
394
+ <pre class="programlisting">
395
+ &lt;context id="preprocessor" style-ref="preprocessor"&gt;
396
+ &lt;prefix&gt;^#&lt;/prefix&gt;
397
+ </pre>
398
+ <p>
399
+ If not specified, <code class="code">&lt;prefix&gt;</code> and <code class="code">&lt;suffix&gt;</code>
400
+ are set to, respectively, <code class="code">\%[</code> and
401
+ <code class="code">\%]</code>.
402
+ </p>
403
+ <pre class="programlisting">
404
+ &lt;keyword&gt;define&lt;/keyword&gt;
405
+ &lt;keyword&gt;undef&lt;/keyword&gt;
406
+ </pre>
407
+ <p>
408
+ Keep in mind that every keyword is a regular expression:
409
+ </p>
410
+ <pre class="programlisting">
411
+ &lt;keyword&gt;if(n?def)?&lt;/keyword&gt;
412
+ &lt;keyword&gt;else&lt;/keyword&gt;
413
+ &lt;keyword&gt;elif&lt;/keyword&gt;
414
+ &lt;keyword&gt;endif&lt;/keyword&gt;
415
+ &lt;/context&gt;
416
+ </pre>
417
+ <p>
418
+ In C, there is a common pratice to use <code class="code">#if 0</code> to express multi-line
419
+ nesting comments. To make things easier to the user, we want to highlight
420
+ these pseudo-comments as comments:
421
+ </p>
422
+ <pre class="programlisting">
423
+ &lt;context id="if0-comment" style-ref="comment"&gt;
424
+ &lt;start&gt;^#if 0\b&lt;/start&gt;
425
+ &lt;end&gt;^#(endif|else|elif)\b&lt;/end&gt;
426
+ &lt;include&gt;
427
+ </pre>
428
+ <p>
429
+ As <code class="code">#if 0</code> comments are nesting, we should consider that inside a comment
430
+ we can find other <code class="code">#if</code>s with the corresponding <code class="code">#endif</code>s, avoiding
431
+ the termination of the comment on the wrong <code class="code">#endif</code>. To do so we use a
432
+ nested context, that will extend the parent on every nested
433
+ <code class="code">#if</code>/<code class="code">#endif</code>:
434
+ </p>
435
+ <pre class="programlisting">
436
+ &lt;context id="if-in-if0"&gt;
437
+ &lt;start&gt;^#if(n?def)?\b&lt;/start&gt;
438
+ &lt;end&gt;^#endif\b&lt;/end&gt;
439
+ &lt;include&gt;
440
+ </pre>
441
+ <p>
442
+ Nested contexts can be recursive:
443
+ </p>
444
+ <pre class="programlisting">
445
+ &lt;context ref="if-in-if0"/&gt;
446
+ &lt;/include&gt;
447
+ &lt;/context&gt;
448
+ &lt;/include&gt;
449
+ &lt;/context&gt;
450
+ </pre>
451
+ <p>
452
+ Because contexts defined before have higher priority, <code class="code">if0-comment</code> will
453
+ never be matched. To make things work we should move it before the
454
+ <code class="code">preprocessor</code> context, thus giving <code class="code">if0-comment</code> a higher priority.
455
+ </p>
456
+ <p>
457
+ For the <code class="code">#include</code> preprocessor directive it could be useful to highlight
458
+ differently the included file:
459
+ </p>
460
+ <pre class="programlisting">
461
+ &lt;context id="include" style-ref="preprocessor"&gt;
462
+ &lt;match&gt;^#include (".*"|&amp;lt;.*&amp;gt;)&lt;/match&gt;
463
+ &lt;include&gt;
464
+ </pre>
465
+ <p>
466
+ To do this we use grouping sub-patterns in the regular expression,
467
+ associating them with a context with the <code class="code">sub-pattern</code> attribute:
468
+ </p>
469
+ <pre class="programlisting">
470
+ &lt;context id="included-file" sub-pattern="1"
471
+ style-ref="included-file"/&gt;
472
+ </pre>
473
+ <p>
474
+ In the <code class="code">sub-pattern</code> attribute we could use:
475
+ </p>
476
+ <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
477
+ <li class="listitem"><p>
478
+ 0: the whole regular expression;
479
+ </p></li>
480
+ <li class="listitem"><p>
481
+ 1: the first sub-pattern (a sub-espression enclosed in
482
+ parenthesis);
483
+ </p></li>
484
+ <li class="listitem"><p>
485
+ 2: the second;
486
+ </p></li>
487
+ <li class="listitem"><p>
488
+ ...
489
+ </p></li>
490
+ <li class="listitem"><p>
491
+ <code class="code">name</code>: a named sub-pattern with name <code class="code">name</code> (see the PCRE
492
+ documentation.)
493
+ </p></li>
494
+ </ul></div>
495
+ <p>
496
+ We could also use a <code class="code">where</code> attribute with value
497
+ <code class="code">start</code> or <code class="code">end</code> to
498
+ specify the regular expression the context is referring, when we have both
499
+ the <code class="code">&lt;start&gt;</code> and <code class="code">&lt;end&gt;</code> element.
500
+ </p>
501
+ <pre class="programlisting">
502
+ &lt;/include&gt;
503
+ &lt;/context&gt;
504
+ </pre>
505
+ <p>
506
+ Having defined a good subset of the C syntax we close every tag still open:
507
+ </p>
508
+ <pre class="programlisting">
509
+ &lt;/include&gt;
510
+ &lt;/context&gt;
511
+ &lt;/definitions&gt;
512
+ &lt;/language&gt;
513
+ </pre>
514
+ </div>
515
+ <div class="refsect1">
516
+ <a name="id-1.3.2.4"></a><h2>The full language definition</h2>
517
+ <p>
518
+ This is the full language definition for the subset of C taken in consideration
519
+ for this tutorial:
520
+ </p>
521
+ <pre class="programlisting">
522
+ &lt;?xml version="1.0" encoding="UTF-8"?&gt;
523
+ &lt;language id="c" _name="C" version="2.0" _section="Source"&gt;
524
+ &lt;metadata&gt;
525
+ &lt;property name="mimetypes"&gt;text/x-c;text/x-csrc&lt;/property&gt;
526
+ &lt;property name="globs"&gt;*.c&lt;/property&gt;
527
+ &lt;/metadata&gt;
528
+ &lt;styles&gt;
529
+ &lt;style id="comment" _name="Comment" map-to="def:comment"/&gt;
530
+ &lt;style id="string" _name="String" map-to="def:string"/&gt;
531
+ &lt;style id="escaped-character" _name="Escaped Character" map-to="def:special-char"/&gt;
532
+ &lt;style id="preprocessor" _name="Preprocessor" map-to="def:preprocessor"/&gt;
533
+ &lt;style id="included-file" _name="Included File" map-to="def:string"/&gt;
534
+ &lt;style id="char" _name="Character" map-to="def:character"/&gt;
535
+ &lt;style id="keyword" _name="Keyword" map-to="def:keyword"/&gt;
536
+ &lt;style id="type" _name="Data Type" map-to="def:type"/&gt;
537
+ &lt;/styles&gt;
538
+ &lt;definitions&gt;
539
+ &lt;context id="c"&gt;
540
+ &lt;include&gt;
541
+
542
+ &lt;context id="comment" style-ref="comment"&gt;
543
+ &lt;start&gt;\/\/&lt;/start&gt;
544
+ &lt;end&gt;$&lt;/end&gt;
545
+ &lt;/context&gt;
546
+
547
+ &lt;context id="string" end-at-line-end="true" style-ref="string"&gt;
548
+ &lt;start&gt;"&lt;/start&gt;
549
+ &lt;end&gt;"&lt;/end&gt;
550
+ &lt;include&gt;
551
+ &lt;context id="escape" style-ref="escaped-character"&gt;
552
+ &lt;match&gt;\\.&lt;/match&gt;
553
+ &lt;/context&gt;
554
+ &lt;/include&gt;
555
+ &lt;/context&gt;
556
+
557
+ &lt;context id="comment-multiline" style-ref="comment"&gt;
558
+ &lt;start&gt;\/\*&lt;/start&gt;
559
+ &lt;end&gt;\*\/&lt;/end&gt;
560
+ &lt;include&gt;
561
+ &lt;context ref="def:in-comment"/&gt;
562
+ &lt;/include&gt;
563
+ &lt;/context&gt;
564
+
565
+ &lt;context id="char" end-at-line-end="true" style-ref="string"&gt;
566
+ &lt;start&gt;'&lt;/start&gt;
567
+ &lt;end&gt;'&lt;/end&gt;
568
+ &lt;include&gt;
569
+ &lt;context ref="escape"/&gt;
570
+ &lt;/include&gt;
571
+ &lt;/context&gt;
572
+
573
+ &lt;context ref="def:decimal"/&gt;
574
+ &lt;context ref="def:float"/&gt;
575
+
576
+ &lt;context id="keywords" style-ref="keyword"&gt;
577
+ &lt;keyword&gt;if&lt;/keyword&gt;
578
+ &lt;keyword&gt;else&lt;/keyword&gt;
579
+ &lt;keyword&gt;for&lt;/keyword&gt;
580
+ &lt;keyword&gt;while&lt;/keyword&gt;
581
+ &lt;keyword&gt;return&lt;/keyword&gt;
582
+ &lt;keyword&gt;break&lt;/keyword&gt;
583
+ &lt;keyword&gt;switch&lt;/keyword&gt;
584
+ &lt;keyword&gt;case&lt;/keyword&gt;
585
+ &lt;keyword&gt;default&lt;/keyword&gt;
586
+ &lt;keyword&gt;do&lt;/keyword&gt;
587
+ &lt;keyword&gt;continue&lt;/keyword&gt;
588
+ &lt;keyword&gt;goto&lt;/keyword&gt;
589
+ &lt;keyword&gt;sizeof&lt;/keyword&gt;
590
+ &lt;/context&gt;
591
+
592
+ &lt;context id="types" style-ref="type"&gt;
593
+ &lt;keyword&gt;char&lt;/keyword&gt;
594
+ &lt;keyword&gt;const&lt;/keyword&gt;
595
+ &lt;keyword&gt;double&lt;/keyword&gt;
596
+ &lt;keyword&gt;enum&lt;/keyword&gt;
597
+ &lt;keyword&gt;float&lt;/keyword&gt;
598
+ &lt;keyword&gt;int&lt;/keyword&gt;
599
+ &lt;keyword&gt;long&lt;/keyword&gt;
600
+ &lt;keyword&gt;short&lt;/keyword&gt;
601
+ &lt;keyword&gt;signed&lt;/keyword&gt;
602
+ &lt;keyword&gt;static&lt;/keyword&gt;
603
+ &lt;keyword&gt;struct&lt;/keyword&gt;
604
+ &lt;keyword&gt;typedef&lt;/keyword&gt;
605
+ &lt;keyword&gt;union&lt;/keyword&gt;
606
+ &lt;keyword&gt;unsigned&lt;/keyword&gt;
607
+ &lt;keyword&gt;void&lt;/keyword&gt;
608
+ &lt;/context&gt;
609
+
610
+ &lt;context id="if0-comment" style-ref="comment"&gt;
611
+ &lt;start&gt;^#if 0\b&lt;/start&gt;
612
+ &lt;end&gt;^#(endif|else|elif)\b&lt;/end&gt;
613
+ &lt;include&gt;
614
+ &lt;context id="if-in-if0"&gt;
615
+ &lt;start&gt;^#if(n?def)?\b&lt;/start&gt;
616
+ &lt;end&gt;^#endif\b&lt;/end&gt;
617
+ &lt;include&gt;
618
+ &lt;context ref="if-in-if0"/&gt;
619
+ &lt;/include&gt;
620
+ &lt;/context&gt;
621
+ &lt;/include&gt;
622
+ &lt;/context&gt;
623
+
624
+ &lt;context id="preprocessor" style-ref="preprocessor"&gt;
625
+ &lt;prefix&gt;^#&lt;/prefix&gt;
626
+ &lt;keyword&gt;define&lt;/keyword&gt;
627
+ &lt;keyword&gt;undef&lt;/keyword&gt;
628
+ &lt;keyword&gt;if(n?def)?&lt;/keyword&gt;
629
+ &lt;keyword&gt;else&lt;/keyword&gt;
630
+ &lt;keyword&gt;elif&lt;/keyword&gt;
631
+ &lt;keyword&gt;endif&lt;/keyword&gt;
632
+ &lt;/context&gt;
633
+
634
+ &lt;context id="include" style-ref="preprocessor"&gt;
635
+ &lt;match&gt;^#include (".*"|&amp;lt;.*&amp;gt;)&lt;/match&gt;
636
+ &lt;include&gt;
637
+ &lt;context id="included-file"
638
+ sub-pattern="1"
639
+ style-ref="included-file"/&gt;
640
+ &lt;/include&gt;
641
+ &lt;/context&gt;
642
+
643
+ &lt;/include&gt;
644
+ &lt;/context&gt;
645
+ &lt;/definitions&gt;
646
+ &lt;/language&gt;
647
+ </pre>
648
+ </div>
649
+ </div>
650
+ <div class="footer">
651
+ <hr>
652
+ Generated by GTK-Doc V1.21.1</div>
653
+ </body>
654
+ </html>