gtksourceview3 2.2.4-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Rakefile +59 -0
- data/ext/gtksourceview3/depend +6 -0
- data/ext/gtksourceview3/extconf.rb +67 -0
- data/ext/gtksourceview3/gtksourceview3.def +2 -0
- data/ext/gtksourceview3/rbgtksource.c +53 -0
- data/ext/gtksourceview3/rbgtksourcebuffer.c +318 -0
- data/ext/gtksourceview3/rbgtksourcegutter.c +82 -0
- data/ext/gtksourceview3/rbgtksourcegutterrenderer.c +143 -0
- data/ext/gtksourceview3/rbgtksourcegutterrendererpixbuf.c +42 -0
- data/ext/gtksourceview3/rbgtksourcegutterrenderertext.c +40 -0
- data/ext/gtksourceview3/rbgtksourcelanguage.c +124 -0
- data/ext/gtksourceview3/rbgtksourcelanguagemanager.c +114 -0
- data/ext/gtksourceview3/rbgtksourcemark.c +85 -0
- data/ext/gtksourceview3/rbgtksourcemarkattributes.c +77 -0
- data/ext/gtksourceview3/rbgtksourceprintcompositor.c +171 -0
- data/ext/gtksourceview3/rbgtksourcestyle.c +42 -0
- data/ext/gtksourceview3/rbgtksourcestylescheme.c +72 -0
- data/ext/gtksourceview3/rbgtksourcestyleschememanager.c +140 -0
- data/ext/gtksourceview3/rbgtksourceundomanager.c +83 -0
- data/ext/gtksourceview3/rbgtksourceview.c +94 -0
- data/ext/gtksourceview3/rbgtksourceview3conversions.h +50 -0
- data/ext/gtksourceview3/rbgtksourceview3private.h +53 -0
- data/extconf.rb +49 -0
- data/lib/2.0/gtksourceview3.so +0 -0
- data/lib/2.1/gtksourceview3.so +0 -0
- data/lib/2.2/gtksourceview3.so +0 -0
- data/lib/gtksourceview3.rb +20 -0
- data/lib/gtksourceview3/deprecated.rb +47 -0
- data/sample/sourcelanguagemanager.rb +21 -0
- data/sample/test.rb +32 -0
- data/test/run-test.rb +44 -0
- data/test/test_mark_attributes.rb +26 -0
- data/test/test_source_gutter_renderer.rb +33 -0
- data/test/test_source_language_manager.rb +46 -0
- data/test/test_source_view.rb +57 -0
- data/vendor/local/bin/libgtksourceview-3.0-1.dll +0 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/completion-providers/words/gtksourcecompletionwords.h +65 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksource.h +54 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcebuffer.h +213 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcecompletion.h +142 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcecompletioncontext.h +95 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcecompletioninfo.h +78 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcecompletionitem.h +70 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcecompletionproposal.h +97 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcecompletionprovider.h +137 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourceencoding.h +54 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcefile.h +115 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcefileloader.h +122 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcefilesaver.h +147 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcegutter.h +90 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcegutterrenderer.h +229 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcegutterrendererpixbuf.h +87 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcegutterrenderertext.h +83 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcelanguage.h +85 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcelanguagemanager.h +84 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcemark.h +71 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcemarkattributes.h +100 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourceprintcompositor.h +175 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcesearchcontext.h +133 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcesearchsettings.h +85 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcestyle.h +45 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcestylescheme.h +109 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcestyleschememanager.h +86 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourcetypes.h +101 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourceundomanager.h +75 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourceutils.h +34 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourceview-typebuiltins.h +88 -0
- data/vendor/local/include/gtksourceview-3.0/gtksourceview/gtksourceview.h +213 -0
- data/vendor/local/lib/girepository-1.0/GtkSource-3.0.typelib +0 -0
- data/vendor/local/lib/libgtksourceview-3.0.dll.a +0 -0
- data/vendor/local/lib/libgtksourceview-3.0.la +41 -0
- data/vendor/local/lib/locale/ar/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/as/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/ast/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/az/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/be/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/bg/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/bn/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/bn_IN/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/bs/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/ca/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/ca@valencia/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/cs/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/cy/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/da/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/de/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/dz/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/el/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/en@shaw/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/en_CA/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/en_GB/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/eo/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/es/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/et/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/eu/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/fa/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/fi/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/fr/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/ga/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/gl/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/gu/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/he/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/hi/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/hr/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/hu/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/id/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/it/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/ja/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/kn/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/ko/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/lt/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/lv/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/mai/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/mg/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/mk/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/ml/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/mn/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/mr/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/ms/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/nb/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/ne/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/nl/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/nn/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/oc/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/or/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/pa/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/pl/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/pt/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/pt_BR/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/ro/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/ru/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/rw/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/si/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/sk/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/sl/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/sq/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/sr/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/sr@latin/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/sv/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/ta/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/te/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/tg/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/th/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/tr/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/ug/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/uk/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/vi/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/xh/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/zh_CN/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/zh_HK/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/locale/zh_TW/LC_MESSAGES/gtksourceview-3.0.mo +0 -0
- data/vendor/local/lib/pkgconfig/gtksourceview-3.0.pc +12 -0
- data/vendor/local/share/gir-1.0/GtkSource-3.0.gir +11360 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceBuffer.html +2143 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceCompletion.html +1129 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceCompletionContext.html +397 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceCompletionInfo.html +348 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceCompletionItem.html +367 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceCompletionProposal.html +572 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceCompletionProvider.html +750 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceCompletionWords.html +345 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceEncoding.html +366 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceFile.html +563 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceFileLoader.html +769 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceFileSaver.html +962 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceGutter.html +490 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceGutterRenderer.html +1700 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceGutterRendererPixbuf.html +468 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceGutterRendererText.html +228 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceLanguage.html +584 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceLanguageManager.html +476 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceMark.html +310 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceMarkAttributes.html +897 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourcePrintCompositor.html +2149 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceSearchContext.html +1116 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceSearchSettings.html +606 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceStyle.html +358 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceStyleScheme.html +398 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceStyleSchemeManager.html +463 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceUndoManager.html +462 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/GtkSourceView.html +1990 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/annotation-glossary.html +81 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/api-index-3-0.html +43 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/api-index-3-10.html +195 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/api-index-3-12.html +39 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/api-index-3-14.html +299 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/api-index-3-4.html +35 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/api-index-deprecated.html +95 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/api-index-full.html +2187 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/ch01.html +119 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/ch02.html +47 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/gtksourceview-3.0-GtkSourceUtils.html +154 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/gtksourceview-3.0.devhelp2 +601 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/home.png +0 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/index.html +146 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/index.sgml +882 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/lang-reference.html +873 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/lang-tutorial.html +654 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/left-insensitive.png +0 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/left.png +0 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/object-tree.html +71 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/right-insensitive.png +0 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/right.png +0 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/style-reference.html +283 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/style.css +476 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/up-insensitive.png +0 -0
- data/vendor/local/share/gtk-doc/html/gtksourceview-3.0/up.png +0 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/R.lang +2199 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/actionscript.lang +268 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/ada.lang +221 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/ansforth94.lang +729 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/asp.lang +1097 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/automake.lang +330 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/awk.lang +138 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/bennugd.lang +267 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/bibtex.lang +93 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/bluespec.lang +188 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/boo.lang +257 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/c.lang +332 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/cg.lang +232 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/changelog.lang +93 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/chdr.lang +43 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/cmake.lang +408 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/cobol.lang +647 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/cpp.lang +120 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/csharp.lang +282 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/css.lang +542 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/cuda.lang +292 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/d.lang +318 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/def.lang +262 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/desktop.lang +300 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/diff.lang +85 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/docbook.lang +476 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/dosbatch.lang +167 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/dot.lang +140 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/dpatch.lang +48 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/dtd.lang +140 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/eiffel.lang +239 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/erlang.lang +258 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/fcl.lang +113 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/forth.lang +235 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/fortran.lang +591 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/fsharp.lang +325 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/gap.lang +85 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/gdb-log.lang +152 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/glsl.lang +483 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/go.lang +275 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/gtk-doc.lang +91 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/gtkrc.lang +116 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/haddock.lang +162 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/haskell-literate.lang +59 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/haskell.lang +228 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/html.lang +281 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/idl-exelis.lang +620 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/idl.lang +154 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/imagej.lang +784 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/ini.lang +95 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/j.lang +240 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/java.lang +190 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/javascript.lang +339 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/json.lang +123 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/julia.lang +378 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/language.dtd +73 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/language.rng +373 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/language2.rng +482 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/latex.lang +600 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/lex.lang +209 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/libtool.lang +56 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/llvm.lang +315 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/lua.lang +157 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/m4.lang +1375 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/makefile.lang +193 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/mallard.lang +124 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/markdown.lang +402 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/matlab.lang +171 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/mediawiki.lang +327 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/modelica.lang +262 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/mxml.lang +65 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/nemerle.lang +263 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/netrexx.lang +319 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/nsis.lang +88 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/objc.lang +120 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/objj.lang +128 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/ocaml.lang +302 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/ocl.lang +139 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/octave.lang +859 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/ooc.lang +265 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/opal.lang +343 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/opencl.lang +600 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/pascal.lang +268 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/perl.lang +1045 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/php.lang +363 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/pkgconfig.lang +62 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/po.lang +94 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/prolog.lang +249 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/protobuf.lang +101 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/puppet.lang +697 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/python.lang +472 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/python3.lang +192 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/rpmspec.lang +212 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/rst.lang +142 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/ruby.lang +750 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/scala.lang +384 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/scheme.lang +302 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/scilab.lang +209 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/sh.lang +499 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/sml.lang +201 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/sparql.lang +448 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/sql.lang +618 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/sweave.lang +67 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/systemverilog.lang +263 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/t2t.lang +150 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/tcl.lang +146 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/texinfo.lang +448 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/vala.lang +365 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/vbnet.lang +245 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/verilog.lang +476 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/vhdl.lang +248 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/xml.lang +220 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/xslt.lang +108 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/yacc.lang +177 -0
- data/vendor/local/share/gtksourceview-3.0/language-specs/yaml.lang +214 -0
- data/vendor/local/share/gtksourceview-3.0/styles/classic.xml +121 -0
- data/vendor/local/share/gtksourceview-3.0/styles/cobalt.xml +148 -0
- data/vendor/local/share/gtksourceview-3.0/styles/kate.xml +171 -0
- data/vendor/local/share/gtksourceview-3.0/styles/oblivion.xml +129 -0
- data/vendor/local/share/gtksourceview-3.0/styles/solarized-dark.xml +101 -0
- data/vendor/local/share/gtksourceview-3.0/styles/solarized-light.xml +101 -0
- data/vendor/local/share/gtksourceview-3.0/styles/styles.rng +142 -0
- data/vendor/local/share/gtksourceview-3.0/styles/tango.xml +130 -0
- data/vendor/local/share/license/gtksourceview/AUTHORS +13 -0
- data/vendor/local/share/license/gtksourceview/COPYING +504 -0
- 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
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
57
|
+
</pre>
|
58
|
+
<p>
|
59
|
+
After the usual preamble, the main tag is the <code class="code"><language></code> element:
|
60
|
+
</p>
|
61
|
+
<pre class="programlisting">
|
62
|
+
<language id="c" _name="C" version="2.0" _section="Source">
|
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"><language></code> element contains three sections:
|
82
|
+
<code class="code"><metadata></code>, <code class="code"><styles></code> and
|
83
|
+
<code class="code"><definitions></code>
|
84
|
+
</p>
|
85
|
+
<pre class="programlisting">
|
86
|
+
<metadata>
|
87
|
+
</pre>
|
88
|
+
<p>
|
89
|
+
The <code class="code"><metadata></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
|
+
<metadata>
|
99
|
+
<property name="mimetypes">text/x-c;text/x-csrc</property>
|
100
|
+
<property name="globs">*.c</property>
|
101
|
+
</metadata>
|
102
|
+
</pre>
|
103
|
+
<pre class="programlisting">
|
104
|
+
<styles>
|
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"><style></code> element:
|
110
|
+
</p>
|
111
|
+
<pre class="programlisting">
|
112
|
+
<style id="comment" _name="Comment" map-to="def:comment"/>
|
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"><style></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
|
+
<style id="string" _name="String" map-to="def:string"/>
|
127
|
+
<style id="escaped-character" _name="Escaped Character" map-to="def:special-char"/>
|
128
|
+
<style id="preprocessor" _name="Preprocessor" map-to="def:preprocessor"/>
|
129
|
+
<style id="included-file" _name="Included File" map-to="def:string"/>
|
130
|
+
<style id="char" _name="Character" map-to="def:character"/>
|
131
|
+
<style id="keyword" _name="Keyword" map-to="def:keyword"/>
|
132
|
+
<style id="type" _name="Data Type" map-to="def:type"/>
|
133
|
+
</pre>
|
134
|
+
<p>
|
135
|
+
Following the <code class="code"><styles></code> element there is the
|
136
|
+
<code class="code"><definitions></code> element, which contains the
|
137
|
+
description proper of the syntax:
|
138
|
+
</p>
|
139
|
+
<pre class="programlisting">
|
140
|
+
<definitions>
|
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"><context></code> tag, with an
|
145
|
+
<code class="code">id</code> equal to the <code class="code">id</code> of the
|
146
|
+
<code class="code"><language></code> element:
|
147
|
+
</p>
|
148
|
+
<pre class="programlisting">
|
149
|
+
<context id="c">
|
150
|
+
</pre>
|
151
|
+
<p>
|
152
|
+
The element <code class="code"><include></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
|
+
<include>
|
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
|
+
<context id="comment" style-ref="comment">
|
165
|
+
<start>\/\/</start>
|
166
|
+
<end>$</end>
|
167
|
+
</context>
|
168
|
+
</pre>
|
169
|
+
<p>
|
170
|
+
The <code class="code"><start></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"><end></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"><default-regex-options</code> tag
|
198
|
+
before the <code class="code"><definitions></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"><keyword-char-class></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"><define-regex></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"><end></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"><start></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
|
+
<context id="string" end-at-line-end="true" style-ref="string">
|
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
|
+
<start>"</start>
|
242
|
+
<end>"</end>
|
243
|
+
<include>
|
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
|
+
<context id="escape" style-ref="escaped-character">
|
250
|
+
<match>\\.</match>
|
251
|
+
</context>
|
252
|
+
</pre>
|
253
|
+
<p>
|
254
|
+
This is a simple context matching a single regular expression, contained in
|
255
|
+
the <code class="code"><match></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
|
+
</include>
|
261
|
+
</context>
|
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
|
+
<context id="comment-multiline" style-ref="comment">
|
270
|
+
<start>\/\*</start>
|
271
|
+
<end>\*\/</end>
|
272
|
+
<include>
|
273
|
+
<context id="net-address" style-ref="net-address" extend-parent="false">
|
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
|
+
<match>http:\/\/[^\s]*</match>
|
281
|
+
</context>
|
282
|
+
</include>
|
283
|
+
</context>
|
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
|
+
<context id="char" end-at-line-end="true" style-ref="string">
|
302
|
+
<start>'</start>
|
303
|
+
<end>'</end>
|
304
|
+
<include>
|
305
|
+
<context ref="escape"/>
|
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
|
+
</include>
|
314
|
+
</context>
|
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
|
+
<context ref="def:decimal"/>
|
323
|
+
<context ref="def:float"/>
|
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
|
+
<context id="comment-multiline" style-ref="comment">
|
337
|
+
<start>\/\*</start>
|
338
|
+
<end>\*\/</end>
|
339
|
+
<include>
|
340
|
+
<context ref="def:in-comment"/>
|
341
|
+
</pre>
|
342
|
+
<pre class="programlisting">
|
343
|
+
</include>
|
344
|
+
</context>
|
345
|
+
</pre>
|
346
|
+
<p>
|
347
|
+
Keywords can be grouped in a context using a list of <code class="code"><keyword></code>
|
348
|
+
elements:
|
349
|
+
</p>
|
350
|
+
<pre class="programlisting">
|
351
|
+
<context id="keywords" style-ref="keyword">
|
352
|
+
<keyword>if</keyword>
|
353
|
+
<keyword>else</keyword>
|
354
|
+
<keyword>for</keyword>
|
355
|
+
<keyword>while</keyword>
|
356
|
+
<keyword>return</keyword>
|
357
|
+
<keyword>break</keyword>
|
358
|
+
<keyword>switch</keyword>
|
359
|
+
<keyword>case</keyword>
|
360
|
+
<keyword>default</keyword>
|
361
|
+
<keyword>do</keyword>
|
362
|
+
<keyword>continue</keyword>
|
363
|
+
<keyword>goto</keyword>
|
364
|
+
<keyword>sizeof</keyword>
|
365
|
+
</context>
|
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
|
+
<context id="types" style-ref="type">
|
373
|
+
<keyword>char</keyword>
|
374
|
+
<keyword>const</keyword>
|
375
|
+
<keyword>double</keyword>
|
376
|
+
<keyword>enum</keyword>
|
377
|
+
<keyword>float</keyword>
|
378
|
+
<keyword>int</keyword>
|
379
|
+
<keyword>long</keyword>
|
380
|
+
<keyword>short</keyword>
|
381
|
+
<keyword>signed</keyword>
|
382
|
+
<keyword>static</keyword>
|
383
|
+
<keyword>struct</keyword>
|
384
|
+
<keyword>typedef</keyword>
|
385
|
+
<keyword>union</keyword>
|
386
|
+
<keyword>unsigned</keyword>
|
387
|
+
<keyword>void</keyword>
|
388
|
+
</context>
|
389
|
+
</pre>
|
390
|
+
<p>
|
391
|
+
You can also set a prefix (or a suffix) common to every keyword using the
|
392
|
+
<code class="code"><prefix></code> and <code class="code"><suffix></code> tags:
|
393
|
+
</p>
|
394
|
+
<pre class="programlisting">
|
395
|
+
<context id="preprocessor" style-ref="preprocessor">
|
396
|
+
<prefix>^#</prefix>
|
397
|
+
</pre>
|
398
|
+
<p>
|
399
|
+
If not specified, <code class="code"><prefix></code> and <code class="code"><suffix></code>
|
400
|
+
are set to, respectively, <code class="code">\%[</code> and
|
401
|
+
<code class="code">\%]</code>.
|
402
|
+
</p>
|
403
|
+
<pre class="programlisting">
|
404
|
+
<keyword>define</keyword>
|
405
|
+
<keyword>undef</keyword>
|
406
|
+
</pre>
|
407
|
+
<p>
|
408
|
+
Keep in mind that every keyword is a regular expression:
|
409
|
+
</p>
|
410
|
+
<pre class="programlisting">
|
411
|
+
<keyword>if(n?def)?</keyword>
|
412
|
+
<keyword>else</keyword>
|
413
|
+
<keyword>elif</keyword>
|
414
|
+
<keyword>endif</keyword>
|
415
|
+
</context>
|
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
|
+
<context id="if0-comment" style-ref="comment">
|
424
|
+
<start>^#if 0\b</start>
|
425
|
+
<end>^#(endif|else|elif)\b</end>
|
426
|
+
<include>
|
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
|
+
<context id="if-in-if0">
|
437
|
+
<start>^#if(n?def)?\b</start>
|
438
|
+
<end>^#endif\b</end>
|
439
|
+
<include>
|
440
|
+
</pre>
|
441
|
+
<p>
|
442
|
+
Nested contexts can be recursive:
|
443
|
+
</p>
|
444
|
+
<pre class="programlisting">
|
445
|
+
<context ref="if-in-if0"/>
|
446
|
+
</include>
|
447
|
+
</context>
|
448
|
+
</include>
|
449
|
+
</context>
|
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
|
+
<context id="include" style-ref="preprocessor">
|
462
|
+
<match>^#include (".*"|&lt;.*&gt;)</match>
|
463
|
+
<include>
|
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
|
+
<context id="included-file" sub-pattern="1"
|
471
|
+
style-ref="included-file"/>
|
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"><start></code> and <code class="code"><end></code> element.
|
500
|
+
</p>
|
501
|
+
<pre class="programlisting">
|
502
|
+
</include>
|
503
|
+
</context>
|
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
|
+
</include>
|
510
|
+
</context>
|
511
|
+
</definitions>
|
512
|
+
</language>
|
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
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
523
|
+
<language id="c" _name="C" version="2.0" _section="Source">
|
524
|
+
<metadata>
|
525
|
+
<property name="mimetypes">text/x-c;text/x-csrc</property>
|
526
|
+
<property name="globs">*.c</property>
|
527
|
+
</metadata>
|
528
|
+
<styles>
|
529
|
+
<style id="comment" _name="Comment" map-to="def:comment"/>
|
530
|
+
<style id="string" _name="String" map-to="def:string"/>
|
531
|
+
<style id="escaped-character" _name="Escaped Character" map-to="def:special-char"/>
|
532
|
+
<style id="preprocessor" _name="Preprocessor" map-to="def:preprocessor"/>
|
533
|
+
<style id="included-file" _name="Included File" map-to="def:string"/>
|
534
|
+
<style id="char" _name="Character" map-to="def:character"/>
|
535
|
+
<style id="keyword" _name="Keyword" map-to="def:keyword"/>
|
536
|
+
<style id="type" _name="Data Type" map-to="def:type"/>
|
537
|
+
</styles>
|
538
|
+
<definitions>
|
539
|
+
<context id="c">
|
540
|
+
<include>
|
541
|
+
|
542
|
+
<context id="comment" style-ref="comment">
|
543
|
+
<start>\/\/</start>
|
544
|
+
<end>$</end>
|
545
|
+
</context>
|
546
|
+
|
547
|
+
<context id="string" end-at-line-end="true" style-ref="string">
|
548
|
+
<start>"</start>
|
549
|
+
<end>"</end>
|
550
|
+
<include>
|
551
|
+
<context id="escape" style-ref="escaped-character">
|
552
|
+
<match>\\.</match>
|
553
|
+
</context>
|
554
|
+
</include>
|
555
|
+
</context>
|
556
|
+
|
557
|
+
<context id="comment-multiline" style-ref="comment">
|
558
|
+
<start>\/\*</start>
|
559
|
+
<end>\*\/</end>
|
560
|
+
<include>
|
561
|
+
<context ref="def:in-comment"/>
|
562
|
+
</include>
|
563
|
+
</context>
|
564
|
+
|
565
|
+
<context id="char" end-at-line-end="true" style-ref="string">
|
566
|
+
<start>'</start>
|
567
|
+
<end>'</end>
|
568
|
+
<include>
|
569
|
+
<context ref="escape"/>
|
570
|
+
</include>
|
571
|
+
</context>
|
572
|
+
|
573
|
+
<context ref="def:decimal"/>
|
574
|
+
<context ref="def:float"/>
|
575
|
+
|
576
|
+
<context id="keywords" style-ref="keyword">
|
577
|
+
<keyword>if</keyword>
|
578
|
+
<keyword>else</keyword>
|
579
|
+
<keyword>for</keyword>
|
580
|
+
<keyword>while</keyword>
|
581
|
+
<keyword>return</keyword>
|
582
|
+
<keyword>break</keyword>
|
583
|
+
<keyword>switch</keyword>
|
584
|
+
<keyword>case</keyword>
|
585
|
+
<keyword>default</keyword>
|
586
|
+
<keyword>do</keyword>
|
587
|
+
<keyword>continue</keyword>
|
588
|
+
<keyword>goto</keyword>
|
589
|
+
<keyword>sizeof</keyword>
|
590
|
+
</context>
|
591
|
+
|
592
|
+
<context id="types" style-ref="type">
|
593
|
+
<keyword>char</keyword>
|
594
|
+
<keyword>const</keyword>
|
595
|
+
<keyword>double</keyword>
|
596
|
+
<keyword>enum</keyword>
|
597
|
+
<keyword>float</keyword>
|
598
|
+
<keyword>int</keyword>
|
599
|
+
<keyword>long</keyword>
|
600
|
+
<keyword>short</keyword>
|
601
|
+
<keyword>signed</keyword>
|
602
|
+
<keyword>static</keyword>
|
603
|
+
<keyword>struct</keyword>
|
604
|
+
<keyword>typedef</keyword>
|
605
|
+
<keyword>union</keyword>
|
606
|
+
<keyword>unsigned</keyword>
|
607
|
+
<keyword>void</keyword>
|
608
|
+
</context>
|
609
|
+
|
610
|
+
<context id="if0-comment" style-ref="comment">
|
611
|
+
<start>^#if 0\b</start>
|
612
|
+
<end>^#(endif|else|elif)\b</end>
|
613
|
+
<include>
|
614
|
+
<context id="if-in-if0">
|
615
|
+
<start>^#if(n?def)?\b</start>
|
616
|
+
<end>^#endif\b</end>
|
617
|
+
<include>
|
618
|
+
<context ref="if-in-if0"/>
|
619
|
+
</include>
|
620
|
+
</context>
|
621
|
+
</include>
|
622
|
+
</context>
|
623
|
+
|
624
|
+
<context id="preprocessor" style-ref="preprocessor">
|
625
|
+
<prefix>^#</prefix>
|
626
|
+
<keyword>define</keyword>
|
627
|
+
<keyword>undef</keyword>
|
628
|
+
<keyword>if(n?def)?</keyword>
|
629
|
+
<keyword>else</keyword>
|
630
|
+
<keyword>elif</keyword>
|
631
|
+
<keyword>endif</keyword>
|
632
|
+
</context>
|
633
|
+
|
634
|
+
<context id="include" style-ref="preprocessor">
|
635
|
+
<match>^#include (".*"|&lt;.*&gt;)</match>
|
636
|
+
<include>
|
637
|
+
<context id="included-file"
|
638
|
+
sub-pattern="1"
|
639
|
+
style-ref="included-file"/>
|
640
|
+
</include>
|
641
|
+
</context>
|
642
|
+
|
643
|
+
</include>
|
644
|
+
</context>
|
645
|
+
</definitions>
|
646
|
+
</language>
|
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>
|