summaryrefslogtreecommitdiff
path: root/support/highlight
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/highlight
Initial commit
Diffstat (limited to 'support/highlight')
-rw-r--r--support/highlight/.easiboxrc31
-rw-r--r--support/highlight/AUTHORS55
-rw-r--r--support/highlight/COPYING674
-rw-r--r--support/highlight/ChangeLog1295
-rw-r--r--support/highlight/Doxyfile235
-rw-r--r--support/highlight/INSTALL148
-rw-r--r--support/highlight/README687
-rw-r--r--support/highlight/README_DE709
-rw-r--r--support/highlight/README_LANGLIST172
-rw-r--r--support/highlight/README_REGEX247
-rw-r--r--support/highlight/TODO4
-rw-r--r--support/highlight/examples/highlight_pipe.php170
-rw-r--r--support/highlight/examples/highlight_pipe.pm65
-rw-r--r--support/highlight/examples/highlight_pipe.py46
-rw-r--r--support/highlight/examples/plugins/dokuwiki/syntax.php242
-rw-r--r--support/highlight/examples/plugins/movabletype/README35
-rw-r--r--support/highlight/examples/plugins/movabletype/highlight.pl88
-rw-r--r--support/highlight/examples/plugins/serendipity_event_highlight/lang_de.inc.php32
-rw-r--r--support/highlight/examples/plugins/serendipity_event_highlight/lang_en.inc.php32
-rw-r--r--support/highlight/examples/plugins/serendipity_event_highlight/serendipity_event_highlight.php329
-rw-r--r--support/highlight/examples/plugins/wordpress/README33
-rw-r--r--support/highlight/examples/plugins/wordpress/highlight.php140
-rw-r--r--support/highlight/examples/swig/README_SWIG21
-rw-r--r--support/highlight/examples/swig/highlight.i13
-rw-r--r--support/highlight/examples/swig/makefile34
-rw-r--r--support/highlight/examples/swig/testmod.pl28
-rw-r--r--support/highlight/examples/swig/testmod.py88
-rw-r--r--support/highlight/filetypes.conf64
-rw-r--r--support/highlight/gui_files/ext/fileopenfilter.conf144
-rw-r--r--support/highlight/gui_files/l10n/highlight_de_DE.qmbin0 -> 23548 bytes
-rw-r--r--support/highlight/gui_files/l10n/highlight_es_ES.qmbin0 -> 20598 bytes
-rwxr-xr-xsupport/highlight/highlight.desktop10
-rw-r--r--support/highlight/highlight.spec116
-rw-r--r--support/highlight/langDefs/4gl.lang55
-rw-r--r--support/highlight/langDefs/a4c.lang32
-rw-r--r--support/highlight/langDefs/abnf.lang30
-rw-r--r--support/highlight/langDefs/abp.lang50
-rw-r--r--support/highlight/langDefs/ada.lang53
-rw-r--r--support/highlight/langDefs/agda.lang33
-rw-r--r--support/highlight/langDefs/ahk.lang75
-rw-r--r--support/highlight/langDefs/ampl.lang46
-rw-r--r--support/highlight/langDefs/amtrix.lang44
-rw-r--r--support/highlight/langDefs/applescript.lang51
-rw-r--r--support/highlight/langDefs/arc.lang64
-rw-r--r--support/highlight/langDefs/arm.lang48
-rw-r--r--support/highlight/langDefs/as.lang68
-rw-r--r--support/highlight/langDefs/asm.lang55
-rw-r--r--support/highlight/langDefs/asp.lang35
-rw-r--r--support/highlight/langDefs/aspect.lang148
-rw-r--r--support/highlight/langDefs/ats.lang52
-rw-r--r--support/highlight/langDefs/au3.lang67
-rw-r--r--support/highlight/langDefs/avenue.lang244
-rw-r--r--support/highlight/langDefs/awk.lang36
-rw-r--r--support/highlight/langDefs/bat.lang47
-rw-r--r--support/highlight/langDefs/bb.lang98
-rw-r--r--support/highlight/langDefs/bbcode.lang24
-rw-r--r--support/highlight/langDefs/bib.lang28
-rw-r--r--support/highlight/langDefs/bms.lang48
-rw-r--r--support/highlight/langDefs/bnf.lang25
-rw-r--r--support/highlight/langDefs/boo.lang47
-rw-r--r--support/highlight/langDefs/c.lang61
-rw-r--r--support/highlight/langDefs/cb.lang66
-rw-r--r--support/highlight/langDefs/cfc.lang58
-rw-r--r--support/highlight/langDefs/chl.lang51
-rw-r--r--support/highlight/langDefs/clipper.lang71
-rw-r--r--support/highlight/langDefs/clojure.lang50
-rw-r--r--support/highlight/langDefs/clp.lang633
-rw-r--r--support/highlight/langDefs/cob.lang49
-rw-r--r--support/highlight/langDefs/cs.lang67
-rw-r--r--support/highlight/langDefs/css.lang63
-rw-r--r--support/highlight/langDefs/d.lang88
-rw-r--r--support/highlight/langDefs/diff.lang27
-rw-r--r--support/highlight/langDefs/dot.lang69
-rw-r--r--support/highlight/langDefs/dylan.lang47
-rw-r--r--support/highlight/langDefs/e.lang38
-rw-r--r--support/highlight/langDefs/ebnf.lang29
-rw-r--r--support/highlight/langDefs/erl.lang43
-rw-r--r--support/highlight/langDefs/euphoria.lang58
-rw-r--r--support/highlight/langDefs/exp.lang81
-rw-r--r--support/highlight/langDefs/f77.lang36
-rw-r--r--support/highlight/langDefs/f90.lang42
-rw-r--r--support/highlight/langDefs/flx.lang49
-rw-r--r--support/highlight/langDefs/frink.lang67
-rw-r--r--support/highlight/langDefs/fs.lang47
-rw-r--r--support/highlight/langDefs/go.lang50
-rw-r--r--support/highlight/langDefs/haskell.lang92
-rw-r--r--support/highlight/langDefs/hcl.lang37
-rw-r--r--support/highlight/langDefs/html.lang35
-rw-r--r--support/highlight/langDefs/httpd.lang102
-rw-r--r--support/highlight/langDefs/hx.lang50
-rw-r--r--support/highlight/langDefs/icl.lang38
-rw-r--r--support/highlight/langDefs/icn.lang38
-rw-r--r--support/highlight/langDefs/idl.lang46
-rw-r--r--support/highlight/langDefs/idlang.lang171
-rw-r--r--support/highlight/langDefs/ili.lang51
-rw-r--r--support/highlight/langDefs/inc_luatex.lang51
-rw-r--r--support/highlight/langDefs/ini.lang30
-rw-r--r--support/highlight/langDefs/inp.lang83
-rw-r--r--support/highlight/langDefs/io.lang53
-rw-r--r--support/highlight/langDefs/iss.lang103
-rw-r--r--support/highlight/langDefs/j.lang55
-rw-r--r--support/highlight/langDefs/java.lang755
-rw-r--r--support/highlight/langDefs/js.lang40
-rw-r--r--support/highlight/langDefs/jsp.lang31
-rw-r--r--support/highlight/langDefs/lbn.lang40
-rw-r--r--support/highlight/langDefs/ldif.lang41
-rw-r--r--support/highlight/langDefs/lgt.lang141
-rw-r--r--support/highlight/langDefs/lhs.lang23
-rw-r--r--support/highlight/langDefs/lisp.lang33
-rw-r--r--support/highlight/langDefs/lotos.lang38
-rw-r--r--support/highlight/langDefs/ls.lang71
-rw-r--r--support/highlight/langDefs/lsl.lang46
-rw-r--r--support/highlight/langDefs/lua.lang48
-rw-r--r--support/highlight/langDefs/ly.lang36
-rw-r--r--support/highlight/langDefs/m.lang80
-rw-r--r--support/highlight/langDefs/make.lang51
-rw-r--r--support/highlight/langDefs/mel.lang154
-rw-r--r--support/highlight/langDefs/mercury.lang48
-rw-r--r--support/highlight/langDefs/mib.lang53
-rw-r--r--support/highlight/langDefs/miranda.lang52
-rw-r--r--support/highlight/langDefs/ml.lang51
-rw-r--r--support/highlight/langDefs/mo.lang41
-rw-r--r--support/highlight/langDefs/mod2.lang43
-rw-r--r--support/highlight/langDefs/mod3.lang49
-rw-r--r--support/highlight/langDefs/mpl.lang102
-rw-r--r--support/highlight/langDefs/ms.lang43
-rw-r--r--support/highlight/langDefs/mssql.lang104
-rw-r--r--support/highlight/langDefs/n.lang47
-rw-r--r--support/highlight/langDefs/nas.lang36
-rw-r--r--support/highlight/langDefs/nbc.lang96
-rw-r--r--support/highlight/langDefs/nice.lang25
-rw-r--r--support/highlight/langDefs/nrx.lang50
-rw-r--r--support/highlight/langDefs/nsi.lang86
-rw-r--r--support/highlight/langDefs/nut.lang34
-rw-r--r--support/highlight/langDefs/nxc.lang56
-rw-r--r--support/highlight/langDefs/oberon.lang39
-rw-r--r--support/highlight/langDefs/objc.lang50
-rw-r--r--support/highlight/langDefs/octave.lang65
-rw-r--r--support/highlight/langDefs/oorexx.lang55
-rw-r--r--support/highlight/langDefs/os.lang36
-rw-r--r--support/highlight/langDefs/oz.lang50
-rw-r--r--support/highlight/langDefs/pas.lang55
-rw-r--r--support/highlight/langDefs/php.lang57
-rw-r--r--support/highlight/langDefs/pike.lang55
-rw-r--r--support/highlight/langDefs/pl.lang48
-rw-r--r--support/highlight/langDefs/pl1.lang193
-rw-r--r--support/highlight/langDefs/pov.lang59
-rw-r--r--support/highlight/langDefs/pro.lang47
-rw-r--r--support/highlight/langDefs/progress.lang261
-rw-r--r--support/highlight/langDefs/ps.lang33
-rw-r--r--support/highlight/langDefs/ps1.lang38
-rw-r--r--support/highlight/langDefs/psl.lang50
-rw-r--r--support/highlight/langDefs/pure.lang37
-rw-r--r--support/highlight/langDefs/py.lang63
-rw-r--r--support/highlight/langDefs/pyx.lang41
-rw-r--r--support/highlight/langDefs/q.lang42
-rw-r--r--support/highlight/langDefs/qmake.lang44
-rw-r--r--support/highlight/langDefs/qu.lang45
-rw-r--r--support/highlight/langDefs/r.lang339
-rw-r--r--support/highlight/langDefs/rb.lang53
-rw-r--r--support/highlight/langDefs/rebol.lang37
-rw-r--r--support/highlight/langDefs/rexx.lang73
-rw-r--r--support/highlight/langDefs/rnc.lang22
-rw-r--r--support/highlight/langDefs/s.lang266
-rw-r--r--support/highlight/langDefs/sas.lang33
-rw-r--r--support/highlight/langDefs/sc.lang132
-rw-r--r--support/highlight/langDefs/scala.lang26
-rw-r--r--support/highlight/langDefs/scilab.lang60
-rw-r--r--support/highlight/langDefs/sh.lang57
-rw-r--r--support/highlight/langDefs/sma.lang38
-rw-r--r--support/highlight/langDefs/smalltalk.lang40
-rw-r--r--support/highlight/langDefs/sml.lang41
-rw-r--r--support/highlight/langDefs/sno.lang39
-rw-r--r--support/highlight/langDefs/spec.lang44
-rw-r--r--support/highlight/langDefs/spn.lang38
-rw-r--r--support/highlight/langDefs/sql.lang95
-rw-r--r--support/highlight/langDefs/sybase.lang116
-rw-r--r--support/highlight/langDefs/tcl.lang43
-rw-r--r--support/highlight/langDefs/tcsh.lang46
-rw-r--r--support/highlight/langDefs/test_re.lang56
-rw-r--r--support/highlight/langDefs/tex.lang45
-rw-r--r--support/highlight/langDefs/ttcn3.lang45
-rw-r--r--support/highlight/langDefs/txt.lang22
-rw-r--r--support/highlight/langDefs/vala.lang56
-rw-r--r--support/highlight/langDefs/vb.lang42
-rw-r--r--support/highlight/langDefs/verilog.lang48
-rw-r--r--support/highlight/langDefs/vhd.lang59
-rw-r--r--support/highlight/langDefs/xml.lang27
-rw-r--r--support/highlight/langDefs/xpp.lang35
-rw-r--r--support/highlight/langDefs/y.lang53
-rw-r--r--support/highlight/langDefs/yaiff.lang36
-rw-r--r--support/highlight/langDefs/znn.lang47
-rw-r--r--support/highlight/makefile161
-rw-r--r--support/highlight/man/highlight.1.gzbin0 -> 3936 bytes
-rw-r--r--support/highlight/src/cli/arg_parser.cc193
-rw-r--r--support/highlight/src/cli/arg_parser.h95
-rw-r--r--support/highlight/src/cli/cmdlineoptions.cpp1031
-rw-r--r--support/highlight/src/cli/cmdlineoptions.h471
-rw-r--r--support/highlight/src/cli/help.cpp185
-rw-r--r--support/highlight/src/cli/help.h42
-rw-r--r--support/highlight/src/cli/main.cpp709
-rw-r--r--support/highlight/src/cli/main.h117
-rw-r--r--support/highlight/src/core/ansigenerator.cpp109
-rw-r--r--support/highlight/src/core/ansigenerator.h89
-rw-r--r--support/highlight/src/core/astyle/ASBeautifier.cpp2658
-rw-r--r--support/highlight/src/core/astyle/ASEnhancer.cpp582
-rw-r--r--support/highlight/src/core/astyle/ASFormatter.cpp4520
-rw-r--r--support/highlight/src/core/astyle/ASResource.cpp547
-rw-r--r--support/highlight/src/core/astyle/ASStreamIterator.cpp167
-rw-r--r--support/highlight/src/core/astyle/ASStreamIterator.h101
-rw-r--r--support/highlight/src/core/astyle/astyle.h802
-rw-r--r--support/highlight/src/core/astyle/astyle_main.cpp2535
-rw-r--r--support/highlight/src/core/astyle/astyle_main.h268
-rw-r--r--support/highlight/src/core/bbcodegenerator.cpp128
-rw-r--r--support/highlight/src/core/bbcodegenerator.h90
-rw-r--r--support/highlight/src/core/charcodes.h99
-rw-r--r--support/highlight/src/core/codegenerator.cpp1804
-rw-r--r--support/highlight/src/core/codegenerator.h729
-rw-r--r--support/highlight/src/core/configurationreader.cpp112
-rw-r--r--support/highlight/src/core/configurationreader.h80
-rw-r--r--support/highlight/src/core/ctagsreader.cpp99
-rw-r--r--support/highlight/src/core/ctagsreader.h104
-rw-r--r--support/highlight/src/core/datadir.cpp181
-rw-r--r--support/highlight/src/core/datadir.h108
-rw-r--r--support/highlight/src/core/documentstyle.cpp168
-rw-r--r--support/highlight/src/core/documentstyle.h138
-rw-r--r--support/highlight/src/core/elementstyle.cpp111
-rw-r--r--support/highlight/src/core/elementstyle.h121
-rw-r--r--support/highlight/src/core/enums.h109
-rw-r--r--support/highlight/src/core/htmlgenerator.cpp477
-rw-r--r--support/highlight/src/core/htmlgenerator.h195
-rw-r--r--support/highlight/src/core/languagedefinition.cpp396
-rw-r--r--support/highlight/src/core/languagedefinition.h325
-rw-r--r--support/highlight/src/core/latexgenerator.cpp335
-rw-r--r--support/highlight/src/core/latexgenerator.h118
-rw-r--r--support/highlight/src/core/platform_fs.cpp339
-rw-r--r--support/highlight/src/core/platform_fs.h68
-rw-r--r--support/highlight/src/core/preformatter.cpp206
-rw-r--r--support/highlight/src/core/preformatter.h150
-rw-r--r--support/highlight/src/core/re/Matcher.cpp178
-rw-r--r--support/highlight/src/core/re/Matcher.h255
-rw-r--r--support/highlight/src/core/re/Pattern.cpp1655
-rw-r--r--support/highlight/src/core/re/Pattern.h1658
-rw-r--r--support/highlight/src/core/rtfgenerator.cpp363
-rw-r--r--support/highlight/src/core/rtfgenerator.h146
-rw-r--r--support/highlight/src/core/stringtools.cpp111
-rw-r--r--support/highlight/src/core/stringtools.h90
-rw-r--r--support/highlight/src/core/stylecolour.cpp157
-rw-r--r--support/highlight/src/core/stylecolour.h106
-rw-r--r--support/highlight/src/core/svggenerator.cpp248
-rw-r--r--support/highlight/src/core/svggenerator.h95
-rw-r--r--support/highlight/src/core/texgenerator.cpp303
-rw-r--r--support/highlight/src/core/texgenerator.h93
-rw-r--r--support/highlight/src/core/version.h36
-rw-r--r--support/highlight/src/core/xhtmlgenerator.cpp92
-rw-r--r--support/highlight/src/core/xhtmlgenerator.h68
-rw-r--r--support/highlight/src/core/xmlgenerator.cpp202
-rw-r--r--support/highlight/src/core/xmlgenerator.h86
-rw-r--r--support/highlight/src/core/xterm256generator.cpp208
-rw-r--r--support/highlight/src/core/xterm256generator.h111
-rw-r--r--support/highlight/src/gui-qt/Makefile277
-rw-r--r--support/highlight/src/gui-qt/highlight-gui.qrc6
-rw-r--r--support/highlight/src/gui-qt/highlight.pro39
-rw-r--r--support/highlight/src/gui-qt/highlight.xpm1173
-rw-r--r--support/highlight/src/gui-qt/highlight_de_DE.ts1159
-rw-r--r--support/highlight/src/gui-qt/highlight_es_ES.ts1156
-rw-r--r--support/highlight/src/gui-qt/hl_icon2.pngbin0 -> 105947 bytes
-rw-r--r--support/highlight/src/gui-qt/hl_icon_exe.icobin0 -> 9662 bytes
-rw-r--r--support/highlight/src/gui-qt/io_report.cpp68
-rw-r--r--support/highlight/src/gui-qt/io_report.h56
-rw-r--r--support/highlight/src/gui-qt/io_report.ui121
-rw-r--r--support/highlight/src/gui-qt/main.cpp54
-rw-r--r--support/highlight/src/gui-qt/mainwindow.cpp1080
-rw-r--r--support/highlight/src/gui-qt/mainwindow.h123
-rw-r--r--support/highlight/src/gui-qt/mainwindow.ui2147
-rw-r--r--support/highlight/src/gui-qt/moc_io_report.cpp69
-rw-r--r--support/highlight/src/gui-qt/moc_mainwindow.cpp134
-rw-r--r--support/highlight/src/gui-qt/moc_showtextfile.cpp79
-rw-r--r--support/highlight/src/gui-qt/precomp.h26
-rw-r--r--support/highlight/src/gui-qt/showtextfile.cpp72
-rw-r--r--support/highlight/src/gui-qt/showtextfile.h54
-rw-r--r--support/highlight/src/gui-qt/showtextfile.ui84
-rw-r--r--support/highlight/src/gui-qt/ui_io_report.h134
-rw-r--r--support/highlight/src/gui-qt/ui_mainwindow.h1860
-rw-r--r--support/highlight/src/gui-qt/ui_showtextfile.h105
-rw-r--r--support/highlight/src/makefile218
-rw-r--r--support/highlight/themes/acid.style22
-rw-r--r--support/highlight/themes/bipolar.style21
-rw-r--r--support/highlight/themes/blacknblue.style20
-rw-r--r--support/highlight/themes/bright.style20
-rw-r--r--support/highlight/themes/contrast.style21
-rw-r--r--support/highlight/themes/darkblue.style21
-rw-r--r--support/highlight/themes/darkness.style20
-rw-r--r--support/highlight/themes/desert.style22
-rw-r--r--support/highlight/themes/easter.style20
-rw-r--r--support/highlight/themes/emacs.style20
-rw-r--r--support/highlight/themes/golden.style21
-rw-r--r--support/highlight/themes/greenlcd.style21
-rw-r--r--support/highlight/themes/ide-anjuta.style20
-rw-r--r--support/highlight/themes/ide-codewarrior.style20
-rw-r--r--support/highlight/themes/ide-eclipse.style20
-rw-r--r--support/highlight/themes/ide-kdev.style20
-rw-r--r--support/highlight/themes/ide-msvs2008.style20
-rw-r--r--support/highlight/themes/ide-xcode.style19
-rw-r--r--support/highlight/themes/jedit.style20
-rw-r--r--support/highlight/themes/kwrite.style20
-rw-r--r--support/highlight/themes/lucretia.style21
-rw-r--r--support/highlight/themes/matlab.style17
-rw-r--r--support/highlight/themes/moe.style21
-rw-r--r--support/highlight/themes/navy.style20
-rw-r--r--support/highlight/themes/nedit.style20
-rw-r--r--support/highlight/themes/neon.style20
-rw-r--r--support/highlight/themes/night.style21
-rw-r--r--support/highlight/themes/orion.style21
-rw-r--r--support/highlight/themes/pablo.style20
-rw-r--r--support/highlight/themes/peachpuff.style20
-rw-r--r--support/highlight/themes/print.style20
-rw-r--r--support/highlight/themes/rand01.style21
-rw-r--r--support/highlight/themes/seashell.style20
-rw-r--r--support/highlight/themes/the.style20
-rw-r--r--support/highlight/themes/typical.style20
-rw-r--r--support/highlight/themes/vampire.style20
-rw-r--r--support/highlight/themes/vim-dark.style20
-rw-r--r--support/highlight/themes/vim.style20
-rw-r--r--support/highlight/themes/whitengrey.style20
-rw-r--r--support/highlight/themes/zellner.style21
326 files changed, 56419 insertions, 0 deletions
diff --git a/support/highlight/.easiboxrc b/support/highlight/.easiboxrc
new file mode 100644
index 0000000000..c2e1428631
--- /dev/null
+++ b/support/highlight/.easiboxrc
@@ -0,0 +1,31 @@
+boxFormats = ['tar.gz', 'tar.bz2']
+archiveDestination = "~/archive/"
+
+include("*")
+include(".easiboxrc")
+include("examples/*", SUBDIRS)
+include("src/*", SUBDIRS)
+exclude("src/*.o", SUBDIRS)
+include("themes/*")
+include("langDefs/*")
+include("man/*")
+include("gui_files/*", SUBDIRS)
+
+exclude("*.kdevelop*")
+exclude("*.kdev4*")
+exclude("*.kdevses")
+exclude("*.cbp")
+exclude("*.layout")
+exclude("src/highlight")
+exclude("src/highlight-gui")
+exclude("src/libhighlight*")
+exclude("src/gui-qt/qrc*")
+exclude("*.css")
+exclude("*.html")
+
+exclude("*.Debug", SUBDIRS)
+exclude("*.Release", SUBDIRS)
+exclude("*.pro.user", SUBDIRS)
+exclude("src/gui-qt/highlight-gui.gch/*")
+
+exclude("*~", SUBDIRS)
diff --git a/support/highlight/AUTHORS b/support/highlight/AUTHORS
new file mode 100644
index 0000000000..ed88b48065
--- /dev/null
+++ b/support/highlight/AUTHORS
@@ -0,0 +1,55 @@
+Developer/Maintainer:
+André Simon <andre.simon1 at gmx de>
+
+Developer of the Artistic Style classes:
+Tal Davidson <davidsont at bigfoot com>
+Jim Pattee <jimp03 at email com>
+
+Developer of Regex classes:
+Jeffery Stuart <mail_address>
+
+Developer of xterm 256 colour best matching functions:
+Wolfgang Frisch <wf at frexx de>
+
+Developer of the argparser class:
+Antonio Diaz Diaz
+
+CLI translators:
+French: Gauthier S.
+Spanish: David Villa
+
+GUI translators:
+Spanish: Fidel Barrera
+
+Language definitions:
+Christian Perle (Povray)
+Andreas Schoenberg (AWK)
+Olivier Girondel (Pike)
+Christian Siefkes (NG Relax Compact)
+Paul Connell (Coldfusion MX)
+Peter Bartke (Miranda)
+Joerg Walter (Smalltalk)
+Pierre Larochelle (Arc, Clojure)
+Roberto Mendoza (IDL)
+Paulo Moura (Logtalk)
+
+Colour themes:
+David (matlab)
+Mark Hessling (THE)
+Alexandre Bonneau (Acid)
+Sunrise Telephone Systems Ltd. (ide-xcode)
+Joerg Walter (moe)
+
+Patches:
+Marc Duponcheel (gcc 3.x compatibility)
+Jonas Fonseca (Ruby language definition)
+Georg Young (gcc 3.x compatibility)
+weasel@debian.org (suppress compile warnings of Debian package)
+Jeremy Weinberger (RTF bugfix)
+Alan Briolat (shebang recognition with stdin stream)
+Jeremy Bopp (makefile prefix/destdir variables)
+Antonio Diaz Diaz (argparser replacement for getopt_long)
+Samuli Suominen (various makefile bugfixes)
+Detlef Reichelt (gcc 4.3 compatibility)
+Jochen Schmitt (gcc 4.4 compatibility)
+Nathaniel Gray (makefile bugfix) \ No newline at end of file
diff --git a/support/highlight/COPYING b/support/highlight/COPYING
new file mode 100644
index 0000000000..94a9ed024d
--- /dev/null
+++ b/support/highlight/COPYING
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/support/highlight/ChangeLog b/support/highlight/ChangeLog
new file mode 100644
index 0000000000..6599329c50
--- /dev/null
+++ b/support/highlight/ChangeLog
@@ -0,0 +1,1295 @@
+CHANGELOG Highlight
+
+highlight 2.16
+
+29-03-2010
+
+-updated astyle code to release 1.24
+-added indentation styles 1tbs and horstmann
+-added --no-trailing-nl switch (suggested by Adiel Mittmann)
+-added Modula2 definition (thanks to Benjamin Kowarsch)
+-added EBNF definition (thanks to Mate Ory)
+-added ABNF, AutoHotKey, BBCode and Clean language definitions
+-updated C++ definition to support C++0x syntax
+-added StartupNotify switch in desktop file (patch by Jochen Schmitt)
+
+---
+highlight 2.15
+
+25-02-2010
+
+-improved HTML nested language patterns (thanks to Simone)
+-improved Rexx and PL1 definitions (thabnks to Robert Prins)
+-added support for NXC and NBC
+-GUI: added copy and paste support (thanks to Torsten Flammiger)
+-GUI: fixed preview of UTF-8 input
+
+---
+highlight 2.14
+
+04-01-2010
+
+-fixed Rexx output (thanks to Marc Hessling)
+-added support for Go and Pure
+-added support for BNF (thanks to Julien Fontanet)
+-updated Logtalk definition (thanks to Paulo Moura)
+-updated THE theme (thanks to Marc Hessling)
+-CLI: --quiet switch supresses "Unknown source file extension" error
+ (suggested by Nathan Gray)
+
+---
+highlight 2.13
+
+02-10-2009
+
+-fixed SVG output (thanks to Xico)
+-GUI: added new icon
+
+---
+highlight 2.12
+
+07-09-2009
+
+-fixed bug with $INCLUDE statement
+-fixed ctags file parsing
+-added nested language recognition within a source file (suggested by Pavel Striz)
+-added $NESTED statement to language definitions (pas, html, tex)
+-added support for F# (fs.lang)
+-added support for haXe (hx.lang)
+-improved various language definitions
+-revised documentation
+-LIB: added version to shared lib output name
+-CLI: added options --start-nested and --print-style
+
+---
+highlight 2.11
+
+23-07-2009
+
+-added BBCode output option (--bbcode, suggested by Qui Peccavit)
+-added new --delim-cr option to cope with MacOS 9 files
+ (suggested by Steven Haddock)
+-added shared lib target (make lib-shared, suggested by Dario Teixeira)
+-list of installed languages (--list-langs) was enhanced to include mapped file
+ extensions (suggested by Martin Kammerlander)
+-improved many colour themes using Agave (agave.sf.net)
+
+---
+highlight 2.10
+
+24-06-2009
+
+-fixed CR parsing bug on MacOS (thanks to Shiro Wilde)
+-fixed SWIG makefile (thanks to David Bremner)
+-license changed from GPLv2 to GPLv3 (incl. included libs)
+-updated Artistic Style lib to version 1.23
+-new indentation schemes: stroustrup, whitesmith, banner
+-removed indentSchemes and helpmsg directories
+-removed README_INDENT
+-replaced ide-devcpp theme by a new jedit theme
+-added support for Interactive Data Language (idlang, thanks to Roberto
+ Mendoza)
+-added support for Rebol, Oz, Mercury, Zonnon, ATS (Applied Type System),
+ CHILL, NetRexx, Inno Setup and INTERLIS
+-added pp, rjs, jnlp, groovy, gnad, es, sblc, ooc, gst, sq extensions
+ to filetypes.conf
+-improved Prolog, Pike, Oberon, Nice, Java, Lisp, Lua, Haskell, C# and SML
+ definitions
+-improved spec.lang for RPM (thanks to Luoyi Ly)
+-CLI: option --help-lang is deprecated
+-API: dropped setSpecialOptions(), renamed initializing methods to init*
+
+---
+highlight 2.9
+
+30-April-2009
+
+-added more customized boxes for the LaTeX --pretty-symbols switch
+ (thanks to Romain Francois)
+-GUI: fixed makefile to pass costum paths to the Qt project makefile
+ (thanks to Joerg Germeroth)
+-GUI: reduced window height (thanks to Fidel Barrera)
+-GUI: added Spanish translation (thanks to Fidel Barrera)
+-GUI: added drag and drop for input files
+
+---
+highlight 2.8
+
+30-March-2009
+
+-added --pretty-symbols option to improve LaTeX output quality of tilde and
+ braces (thanks to Romain Francois)
+-omitted warning message if --syntax parameter is contained in the --skip list
+ (thanks to Bob Smith)
+-included language descriptions in --list-langs output
+-dropped dependency of --replace-quotes and --fragment options
+-enhanced Python SWIG example (testmod.py)
+-added qmake language definition
+-fixed SWIG scripts (thanks to David Bremner)
+-fixed gcc 4.4 compilation (patch by Jochen Schmitt)
+-dropped core/html32generator.*
+-dropped src/gui (wxWidgets based interface)
+-GUI: rewrote the user interface using Qt
+
+---
+highlight 2.7
+
+12-January-2009
+
+-changed versioning scheme to major.minor
+-fixed infinite loop in the W32 build when outputting LaTeX/TeX as UTF-8
+ (thanks to Christophe Bal)
+-fixed VHDL and Scilab definitions (thanks to Frederik Teichert)
+-fixed XML definition (thanks to Edin)
+-fixed -r switch (thanks to Frederik Teichert)
+-fixed default number recognition regex
+-added Clojure language definition (thanks to Pierre Larochelle)
+-added wrapping arrow in LaTeX/HTML output if --wrap/--wrap-simple is set
+ (suggested by Frederik Teichert)
+-updated ide-msvcpp.style to match current Visual Studio appearance
+ (suggested by Pieter Kruger)
+-added make targets "lib" and "cli"
+-organized sources in subdirectories (core, cli, gui) and adjusted makefiles
+
+---
+highlight 2.6-14
+
+21-October-2008
+
+-added --ctags-file option to add tooltips with meta information in HTML output
+-added options to improve compatibility with GNU source-highlight:
+ --doc, --no-doc, --tab, --css, --output-dir, --failsafe, --out-format,
+ --src-lang, --line-number, --line-number-ref
+-fixed ADA95, C#, Eiffel, Fortran, TCL, Bash definitions
+-added Vala language definition
+-added several file suffixes to filetypes.conf
+-fixed gcc 4.3 compilation issues (patch by Detlef Reichelt)
+-fixed race condition in makefile (patch by Jochen Schmitt)
+-added exit condition if input path matches output path
+ (suggested by James Haefner)
+-GUI: added ctags file selection options (only wx2.9 version)
+
+---
+highlight 2.6-13
+
+29-September-2008
+
+-added --skip option to ignore unknown file types (suggested by Bob Smith)
+-added Haskell LHS language definition (suggested by Sebastian Roeder)
+-added regex description for Perl and Ruby definitions
+-improved Bison, Paradox, SML, Snobol, Verilog definitions
+-renamed snobol.lang to sno.lang
+-updated Artistic Style lib to version 1.22
+-replaced dirstream lib by a faster file globbing method
+ (invoked with --batch-recursive)
+-support for USE_FN_MATCH compile flag was dropped
+-Makefile generates libhighlight.a (suggested by Adiel Mittmann)
+-Updated SWIG makefile and documentation
+
+---
+highlight 2.6-12
+
+04-August-2008
+
+-added RTF character stylesheet option (suggested by Klaus Nordby)
+-fixed filetypes.conf path in RPM specfile (thanks to Nikita Borodikhin)
+
+---
+highlight 2.6-11
+
+09-July-2008
+
+-added SVG output option (--svg)
+-reassigned -G short option from --class-name to --svg
+-fixed various makefile issues (patches by Samuli Suominen)
+-added highlight.desktop file (suggested by Samuli Suominen)
+-GUI: added SVG and font selection options (only wx2.9 version)
+-GUI: reduced window height by hiding format specific input controls
+-updated highlight.spec to compile wx2.9 GUI
+
+---
+highlight 2.6-10
+
+07-May-2008
+
+-fixed XHTML output (thanks to Allen McPherson)
+-added Logtalk definition (thanks to Paulo Moura)
+-added support for Eiffel ecf project files (thanks to Jérémie Blaser)
+-various code improvements (patch by Antonio Diaz Diaz)
+
+---
+highlight 2.6-9
+
+26-March-2008
+
+-fixed --validate-input option with input from stdin
+-fixed missing DESTDIR prefix in makefile (thanks to Bob Smith)
+-fixed handling of several keyword regexes using the same group name
+-added support for Lilypond
+-added support for Arc (thanks to Pierre Larochelle)
+-added support for embedded output instructions (see README)
+-added examples/highlight_pipe.* (PHP, Perl and Python interface scripts)
+-replaced getopt_long by argparser class
+-language definition parameters $kw_list and $kw_re are merged to $keywords
+-GUI: fixed preview of UTF-8 files (thanks to Victor Woo)
+-GUI: added all-gui-wx29 target in Makefile to compile with wxWidgets 2.9
+
+---
+highlight 2.6-8
+
+01-February-2008
+
+-fixed highlighting issue with nested comments, if delimiters are distinct
+-fixed XML and CSS highlighting
+-fixed C escape sequence parsing of octal and hex sequences
+-language definition tag tag_delim was dropped
+-outdated file README_ES was dropped
+-gcc4.3 compilation support was added (patch by Jochen Schmitt)
+-font-family parameter is enclosed in apostrophes in HTML output
+-added --kw-case=capitalize option
+-added --enclose-pre option
+-added file README_LANGLIST
+-improved several language definitions
+-GUI: decreased window height
+-GUI: preview window is scrolled to last view position after a content update
+-GUI: windows saves and restores previous position and size
+
+---
+highlight 2.6-7
+
+04-January-2008
+
+-support for RTF background colour was added
+-regex() in language definitions expression allows optional definition of
+ capturing group number
+-added --add-config-dir option to define config search path
+ (suggested by Nathaniel Gray)
+-allowed invocation of makefile with CFLAGS and LDFLAGS as parameters
+ (patch by Nathaniel Gray)
+-fixed OCaml definition (thanks to Nathaniel Gray)
+-fixed AutoIt definition
+-added case insensitive file suffix matching (thanks to Stefan Boumans)
+-GUI: added RTF mimetype to clipboard data (thanks to Stefan Boumans)
+-GUI: fixed preview update after tab width change (thanks to Stefan Boumans)
+
+---
+highlight 2.6-6
+
+10-December-2007
+
+-added Smalltalk definition and moe theme (thanks to Joerg Walter)
+-added support for diff and patch files
+-GUI: added clipboard button (suggested by Klaus Schueller and Stefan Boumans)
+-fixed Matlab definition (thanks to Andreas Boehler)
+-fixed print.style (thanks to Albert Neu)
+-fixed output of lines with CR/LF (bug of 2.6.5)
+-fixed php and css definitions
+-updated ActionScript definition (thanks to Samuel Toulouse)
+-updated sql definition (thanks to Stefan Boumans)
+-dropped dull theme
+
+---
+highlight 2.6-5
+
+02-October-2007
+
+-fixed compilation warning on 64 Bit OS (thanks to Uwe Sassenberg)
+-allowed embedded comments in Pascal definition (thanks to Helmut Giritzer)
+-fixed memory leak
+-improved performance
+-added serendipity plugin in examples/plugins
+-added support for diff (and patch) files (suggested by Dan Christensen)
+-adjusted SWIG makefiles and sample scripts
+-improved definitions of Bash, Ruby, Maya, Tcl, Agda and Haskell
+
+---
+highlight 2.6-4
+
+13-September-2007
+
+-fixed TeX and LaTeX output (space after strings were omitted,
+ thanks to Andre Schade)
+-fixed Perl language definition (thanks to Jens Kadenbach)
+-fixed gui.cpp compilation with wxWigets unicode build (thanks to Dennis Veatch)
+-updated R language definition (thanks to Yihui Xie)
+
+---
+highlight 2.6-3
+
+06-September-2007
+
+-added --inline-css option to output CSS within each tag element
+-renamed previewgenerator.* files to html32generator.*
+-GUI: changed GUI configuration format (using wx config classes)
+-GUI: added inline CSS option
+-binaries are no longer stripped by default (src/makefile)
+-added notes to makefiles and INSTALL concerning static linking
+ (thanks to Ken Poole)
+-improved MacOS X compatibility (thanks to Benjamin Kowarsch)
+-added ide-xcode theme (thanks to Benjamin Kowarsch)
+-README files were updated
+-updated plugin scripts to use the new --inline-css option
+
+---
+highlight 2.6-2
+
+19-July-2007
+
+-dropped deprecated option --format-style
+-added --html option for plausibility (HTML output is still default)
+-reassigned -H option to --html
+-added option --kw-case to output keywords in upper case or lower case if
+ the language is not case sensitive
+-added option --mark-line to highlight several code lines in HTML output
+-added mark-line parameter to colour themes, renamed kw_group parameter
+ to kw-group
+-added option --validate-input to test if input file is text (if the input
+ is considered binary, no parsing takes place)
+-updated astyle code to release 1.21
+-improved PHP4 compatibility of the wordpress plugin (thanks to Thomas Keller)
+-added support for Open Object Rexx (oorexx.lang)
+-updated documentation
+
+---
+highlight 2.6-1
+
+21-May-2007
+
+-support of HTML colour notation in theme files (ie #12aa00)
+-fixed bad formatting of single line comment and directive substrings after
+ line wrapping took place (multiline comments may still be screwed up)
+-enabled "highlight -c stdout" to print style definition to stdout
+-moved highlight/highlight subdir to highlight/src
+-removed examples/cgi
+-added examples/plugins
+-moved gui file directories ext and i18n to DATADIR/gui_files/
+-removed themes: berries-light, whatis
+-added themes: lucretia, orion
+-fixed SWIG interface files and scripts
+-fixed makefile and filetypes.conf (thanks to Axel Dyks)
+-improved ini.lang (thanks to Axel Dyks)
+-GUI: added Brazilian Portuguese translation (thanks to Yorick)
+
+---
+highlight 2.6-0
+
+05-May-2007
+
+-fixed bug with line number count starting at zero by default
+-modified makefile to support PREFIX and DESTDIR variables (patch by Jeremy Bopp)
+
+---
+highlight 2.5-6 beta
+
+20-April-2007
+
+-added new option --class-name (suggested by John Pye)
+-fixed XML output (thanks to Hilmar Bunjes)
+-updated README files
+
+---
+highlight 2.5-5 beta
+
+05-April-2007
+
+-renamed --line-number-width to --line-number-length
+-added new option --line-length
+-fixed compilation error with gcc 4.3 (thanks to Martin Michlmayr)
+-added script shebang recognition with stdin input (patch by Alan Briolat)
+-added support for Boo scripting language
+-fixed translated help texts
+-added *.p, *.i, *.w as Progress file suffixes (thanks to Mark Reeves)
+
+---
+highlight 2.5-4 beta
+
+07-March-2007
+
+-improved display quality of preview font (Courier New)
+-updated astyle to version 1.20.2
+
+---
+highlight 2.5-3 beta
+
+03-March-2007
+
+-fixed bug in GUI preview update
+-reduced GUI height
+-added support for Linden script (Second Life)
+
+---
+highlight 2.5-2 beta
+
+28-February-2007
+
+-added prefix and prefix_bin variables to makefile (suggested by Thomas Link)
+-removed LaTeX page dimension directives (suggested by Thomas Link)
+-improved several color themes
+-removed berries-dark, added seashell theme
+
+---
+highlight 2.5-1 beta
+
+29-January-2007
+
+-fixed GTK GUI language file encoding to UTF 8
+-improved Ruby language definition
+-added gui subsection in the RPM specfile
+
+---
+highlight 2.5-0 beta
+
+17-January-2007
+
+-added Miranda language definition (thanks to Peter Bartke)
+-added Powershell (Monad) language definition
+-fixed ignored conf_dir parameter in makefiles (thanks to Bob Smith)
+-included source files and additional make rules to compile a wxWidgets GUI
+ (binary: highlight-gui; make all-gui; needs wxWidgets 2.6+)
+
+---
+highlight 2.4-8
+
+19-October-2006
+
+-added xterm 256 color output (-M, --xterm256) (thanks to Wolfgang Frisch)
+-prints warning if output format ignores the theme background colour
+-fixed Java and Python language definitions
+-revised README files
+
+---
+highlight 2.4-7
+
+10-June-2006
+
+-fixed segfault in symbol parsing procedure (thanks to Veit Wedtstein)
+-updated Lua and Lisp definitions
+-added AutoIt, NSIS, Graphviz and Qore definitions
+-updated SWIG sample scripts
+
+---
+02-May-2006
+
+highlight 2.4-6
+
+-fixed segfault when outputting ANSI (thanks to Philip Jenvey)
+
+---
+20-March-2006
+
+highlight 2.4-5
+
+-fixed bug which caused segfault on x86_64 (thanks to Eric Hopper)
+-fixed wrong enumeration start when outputting text w/o highlighting
+ (thanks to Russell Yanofsky)
+-added anchor-prefix option (suggested by Peter Biechele)
+-added anchor-filename option (suggested by Mazy)
+-added $description entry to language file format
+-added D language file
+-updated regex classes to version 1.05.02
+
+---
+19-February-2006
+
+highlight 2.4-4
+
+-added print-config option
+-added scilab definition (thanks to Gunnar Lindholm)
+-dropped support for XSL-FO (use XML instead for further processing)
+-dropped deprecated options (css-infile, css-outfile, include-css)
+-fixed line numbering (starting at 1, printed if syntax option is txt)
+ (thanks to Russell Yanofsky)
+-renamed extensions.conf to filetypes.conf
+-moved content of scriptre.conf into filetypes.conf
+-renamed option help-int to help-lang
+-renamed option format-style to reformat
+-updated regex classes to version 1.04
+-code cleanup
+-updated documentation
+
+---
+30-October-2005
+
+highlight 2.4-3
+
+-added RTF page-size option (suggested by David Strip)
+-fixed bug in RTF output, which prevented italic and bold output
+ (patch by Jeremy Weinberger)
+-renamed colour theme parameter KW_CLASS to KW_GROUP
+
+---
+25-September-2005
+
+highlight 2.4-2
+
+-added line-number-start switch (suggested by Roie Black)
+-added babel switch to make output compatible with LaTeX Babel
+ package (disables Babel shorthands)
+-fixed ampl.lang (thanks to David Strip)
+-fixed error message if language definition is unknown
+-added Nemerle definition (n.lang)
+-added SAS definition (thanks to Alexandre Detiste)
+-added TTCN3 definition (thanks to Peter Biechele)
+-added tcsh.lang (thanks to Igor Furlan)
+-Unix package: moved *.conf to /etc/highlight/
+ (suggested by Jochen Schmitt)
+
+---
+23-July-2005
+
+highlight 2.4-1
+
+-dropped include-pkg option
+-added CSS style for list items (--ordered-list)
+-fixed default number regex
+-fixed VHDL event recognition
+-added missing KWD keyword style to several colour themes
+-added $STRING_UNEQUAL parameter for language definitions
+-added string CodeGenerator::generateString(const string &)
+-improved Ruby and Octave highlighting
+-added SWIG interface in examples/swig
+-removed examples/python-binding
+-removed themes: neon2 fluke greyish ide-jbuilder4 ide-jcreator2
+ ide-synedit neon2 rand02 ron whitenblue website
+
+---
+02-July-2005
+
+highlight 2.3-6 beta
+
+-fixed crash in language definition loader
+-saved helpmsg/cs.help as iso-8859-2
+-added include-pkg option to define a list of LaTeX packages
+ which should be included
+-fixed output of UTF-8 characters (replaced isspace by iswspace)
+
+---
+26-June-2005
+
+highlight 2.3-5 beta
+
+-fixed LaTeX and TeX output
+-added support for UTF-8 LaTeX output (suggested by Sungmin Cho)
+-dropped automatic conversion of ASCII characters > 127, package
+ latin1 is included instead
+
+---
+17-June-2005
+
+highlight 2.3-4 beta
+
+-added font and fontsize options (submitted by Yves Bailly)
+-added line-number-width (suggested by Yves Bailly)
+-code cleanup
+
+---
+16-May-2005
+
+highlight 2.3-3 beta
+
+-added kwd keyword class to most of the colour themes
+-added regular expressions to some language definitions
+
+---
+04-May-2005
+
+highlight 2.3-2 beta
+
+-improved number regex
+-added --ordered-list option (suggested by Dominic Lchinger)
+-fixed tag parsing (broken in 2.3-1)
+-updated docs
+-added Brazilian help text (thanks to Adao Raul)
+-added Czech help text
+
+---
+23-April-2005
+
+highlight 2.3-1 beta
+
+-added support for regular expressions in language definitions
+
+---
+25-March-2005
+
+highlight 2.2-10
+
+-added support for PowerPC Assembler (thanks to Juergen Frank)
+-added support for AppleScript (thanks to Andreas Amann)
+-added encoding option to set proper output encoding type in XML and
+ HTML output formats (default encoding: ISO-8895-1)
+ Note: encoding name has to match input file encoding
+-style definitions are generated if only --fragment and --style-outpath
+ options are set
+-added simple recognition of scripts without file extension
+ (Bash, Perl, AWK, Python)
+-added config file scriptre.conf to configure script recognition
+-moved langDefs/extensions.conf to package base directory
+-added --force option to generate output if language type is unknown
+-fixed parsing of escape sequences outside of strings in Perl
+ (last six points suggested by Andreas Amann)
+-fixed output of CR line terminators
+-added classes pre.hl and body.hl in CSS definitions
+
+---
+27-February-2005
+
+highlight 2.2-9
+
+-fixed --output option
+-fixed line number indentation in TeX and LaTeX output
+-fixed compilation error for Darwin (OSX) (thanks to Plumber)
+-fixed LaTeX compilation warnings (thanks to Tyranix)
+-fixed xml default file suffix
+-closing style tags are no longer printed in the following output line
+ (suggested by Yves Bailly)
+-fixed rb.lang (Ruby is case sensitive)
+-external style definitions and inclusion of user defined styles were
+ added to LaTeX and TeX output
+-installation directory configuration is improved in the makefiles
+ (all suggested by Thomas Link)
+-new options: style-outfile, style-infile, include-style
+-deprecated options: css-outfile, css-infile, include-css
+
+---
+20-February-2005
+
+highlight 2.2-8
+
+-added XML output (suggested by Matteo Bertini)
+-added support for MS SQL (thanks to Magnus ?erg)
+-added support for Pyrex (thanks to Matteo Bertini)
+-added support for Hecl, Luban and Qu
+
+---
+12-January-2005
+
+highlight 2.2-7
+
+-fixed compilation error on AMD64/gcc4.0 (thanks to Andreas Jochens)
+-fixed tab replacement (thanks to Adrian Bader)
+-fixed parsing of keywords with special characters as prefix ($ALLOWEDCHARS)
+ (thanks to Magnus ?erg)
+-single spaces in (La)TeX are no longer preceeded by backslash
+
+---
+03-December-2004
+
+highlight 2.2-6
+
+-fixed compilation error with getopt and Solaris 5.8
+ (thanks to Philippe Cornu and Jean-Emmanuel Reynaud)
+-enabled css-infile option when include-css is set
+-improved IO and Perl language definitions
+-updated dirstram classes to release 0.4
+-W32 port: fixed installation path determination
+
+---
+31-October-2004
+
+highlight 2.2-5
+
+-fixed some compiler warnings in various Debian builds (thanks to Ayman Negm)
+-fixed indentation error in LaTeX output and output of "--" in bold font
+ (thanks to Michael Suess)
+-added background colour attribute of body element to the CSS output to
+ improve compability with old browsers (NS Communicator 4.8)
+ (thanks to Wojciech Stryjewski)
+-in CSS output, user defined CSS definitions are now included after highlight
+ style definitions to make modifications easier
+-highlight returns EXIT_FAILURE after every IO failure
+-updated Spanish manual and help message (thanks to David Villa)
+
+---
+26-September-2004
+
+highlight 2.2-4
+
+-changed ANSI output colours to vim style (suggested by David Villa)
+-added new acid indentation scheme and acid colour theme
+ (thanks to Alexandre "AciD" Bonneau)
+-highlight returns 1 (EXIT_FAILURE) if file operations failed
+ (suggested by David Villa)
+-fixed bug in LaTeX output: [ and * characters after a linebreak (\\) caused
+ latex compilation to stop (thanks to Christian Schilling)
+-improved error reports
+
+---
+10-September-2004
+
+highlight 2.2-3
+
+-applied patch to suppress compiler warnings on several platforms
+ (thanks to weasel@debian.org)
+-renamed the /utils directory to /examples, which moved to
+ /usr/share/doc/highlight/ (suggested by Ayman Negm)
+-if --output is defined and output format is (X)HTML, the CSS file is stored in
+ the directory given by --output (suggested by Vicky Brown)
+-added spanish translations: README_ES and es.help (thanks to David Villa)
+-added support for SNMPv1 and SNMPv2 files: mib.lang (thanks to Roman Surma)
+-fixed highlighting of escape sequences in Pascal (thanks to Grzegorz Tworek)
+-added Pascal multi line comment delimiters: (*, *)
+-added a third keyword style (kwc) to all themes
+-added a third keyword group: ada.lang, gawk.lang, c.lang, java.lang, pas.lang
+-fixed some language definition with old $keyword entries
+
+---
+20-July-2004
+
+highlight 2.2-2
+
+-removed $STRINGDELIMITERPAIR parameter
+-internal changes
+
+---
+11-July-2004
+
+highlight 2.2-1
+
+-added content-type (iso-8859-1) to HTML output
+-added possibility to define custom keyword groups (suggested by Daniel Bonniot)
+-reformatting and indentation schemes are customizable, config files are located
+ in /indentSchemes (suggested by Petri Heiramo)
+-added new output format: ANSI terminal sequences (--ansi)
+ (suggested by David Villa)
+ assigned -A to --ansi, -g to --fop-compatible
+-added $SL-COMMENT parameter to colour themes (enables seperate highlighting
+ of single and multi line comments)
+-added option to fill linenumbers with zeroes
+-improved quality of colour themes
+-changed names of following command line options:
+ deletetabs -> replace-tabs
+ listthemes -> list-themes
+ listlangs -> list-langs
+ includecss -> include-css
+ printindex -> print-index
+-dropped support for C# member attributes (was a nasty workaround)
+-dropped support for Forth
+-removed unnecessary --batch (-b) option
+-removed utils/cgi/perl/README_CGI
+-fixed raw string highlighting bug: r"""\n""" in Python is parsed correctly
+-fixed some old parameters in language definitions
+-added source directory names to generated index file (-C)
+
+---
+20-June-2004
+
+highlight 2.0-25
+
+-fixed quote replacement in LaTeX (\dq -> \dq{}) (thanks to Adrian Bader)
+-fixed crash if $HOME is not defined (thanks to Kostas Maistelis)
+-added compile flag CONFIG_FILE_PATH to define a custom path to the config file
+-added local copy of getopt, which is compiled if the system does not provide it
+ (removed win32cmdline.*)
+-fixed VHDL event parsing
+-removed some poor quality colour themes and improved some others
+-added ide-eclipse style
+
+---
+10-June-2004
+
+highlight 2.0-24
+
+-improved VHDL support (thanks to Aaron D. Marasco)
+-added Coldfusion MX definition (thanks to Paul Connell)
+-added $REFORMATTING option to language definitions
+-added a Python binding in utils/python-binding
+-some code clean up
+
+---
+16-May-2004
+
+highlight 2.0-23
+
+-fixed ABAP definition (thanks to Kevin Barter)
+-fixed Python definition
+-fixed parsing of methods applied to numerical literals (possible in Ruby)
+-fixed indentation of line numbers in LaTeX (thanks to Michael Berndt)
+-reduced LaTeX output file size
+-improved layout of LaTeX document
+-applied some patches to Artistic Style code (see astyle.sourceforge.net)
+-added updated phpwiki-plugin utils/cgi/php/SyntaxHighlighter.php
+ (thanks to Reini Urban)
+
+---
+19-April-2004
+
+highlight 2.0-22
+
+-improved Fortran 77 parsing (thanks to Geraldo Veiga),
+ moved parsing information to f77.lang and f90.lang
+-added highlighting of float literals like .5
+-added new language definitions: ABAP/4, ARM, Bison, Dylan, FAME,Informix, Lisp,
+ Octave, R, Scala, Snobol, Verilog
+-removed -d option
+-added -P option to display a progress bar in batch mode
+
+---
+23-March-2004
+
+highlight 2.0-21
+
+-added option (-r) to replace " by \dq in LaTeX (thanks to Nikolai Mikuszeit)
+-added option (-E) to define another search path, where language definitions
+ and themes may be stored (suggested by a Debian package tester)
+-fixed bug which disabled HTML anchors (thanks to Richard Beauchamp)
+-fixed wrong current working directory detection in W32 code (thanks to Ian Oliver)
+-improved fragmented TeX output
+-fixed man page
+-changed path of config file to ~/.highlightrc (Unix)
+-added options to config file
+-changed parameter prefix from "/" to the more convenient "$" in configuration files
+-changed "typesmods" parameter in language definitions to "types"
+-improved some colour themes
+-added $INCLUDE statement in language definitions to include content of other files
+
+---
+09-March-2004
+
+highlight 2.0-20
+
+-added new parser options: TYPEDELIMITERS and KEYWORDDELIMITERS to enable
+ highlighting of variables like ${var}
+-changed RTF font to Courier New
+-added symbol highlighting (last two suggested by Anssi Lehtinen)
+-added new colour themes (darkblue, zellner, ron, peachpuff, pablo, nedit)
+-added a new directive to add a custom installation directory at compile time
+ (CUSTOM_INSTALL_DIR in highlight/makefile)
+-added Doxygen documentation
+-updated spec.lang, sh.lang and make.lang
+-fixed some case insensitive language files
+-replaced make by ${MAKE} in makefile (suggested by Thomas Dettbarn)
+-removed utils/frontend (see homepage for highlight-gui package)
+-moved German help to README_DE
+-moved documentation files to /usr/share/doc/highlight (suggested by Ayman Negm)
+
+---
+21-February-2004
+
+highlight 2.0-19
+
+-improved whitespace indentation in TeX and LaTeX
+-fixed output of +, -, =, <, > in TeX
+-fixed output of blank lines in TeX
+ (all suggested by Milan Straka)
+-updated Java language definition to 1.5
+-added support for BibTex, Erlang, Icon, Lisp, Lotos, Maple, Objectice C,
+ Prolog, PostScript and RPM Spec
+
+---
+08-February-2004
+
+highlight 2.0-18
+
+-changed hskip unit in LaTeX output vom mm to em
+-fixed different font width of spaces in TeX output
+ (thanks to Milan Straka)
+-added macros in TeX output to reduce file size
+-fixed bug which made first line number disappear (introduced in 2.0-17)
+-declared XSL-FO output as experimental, added a switch to provide
+ modified output for both Apache FOP and xmlto/xsltproc
+
+---
+01-February-2004
+
+highlight 2.0-17
+
+-enabled multiple input file names and real batch processing wildcards
+-improved debugging output
+-added new PHP Wiki plugin (thanks to Alec Thomas)
+-fixed newlines at the beginning and the ending of HTML output
+-fixed Java and Nice language definitions (thanks to Daniel Bonniot)
+-general cleanup (code, makefiles, docs)
+
+---
+12-January-2004
+
+highlight 2.0-16
+
+-added new options to wrap long lines (suggested by Johannes Wei�)
+-added new colour themes: vim, vim-dark and ide-codewarrior
+-improved Java, Nice and C parsing
+
+---
+04-January-2004
+
+highlight 2.0-15
+
+-improved XSL-FO output (thanks to Daniel Bonniot)
+-reduced LaTeX output file size
+
+---
+21-December-2003
+
+highlight 2.0-14
+
+-added XSL-FO output format (suggested by Daniel Bonniot)
+-fixed segfault when theme file was not found
+-improved makefiles
+-ported code to Solaris (thanks to Ade Fewings)
+
+---
+25-November-2003
+
+highlight 2.0-13
+
+-fixed parsing of XML comments
+-fixed conversion of umlauts and accents
+-improved parsing of numbers (suffixes like 30L, 4.5f; exponents)
+-'@' in HTML output is replaced by HTML entity to confuse spam robots
+-fixed Avenue, Perl, Progress and Clipper language definitions
+-added support for Action Script, Objective Caml, Standard ML, Felix,
+ Frink, IO, Nasal, MaxScript, Oberon, Object Script
+-replaced AutoConf build process by customizable makefile (suggested by John Skaller)
+
+---
+09-November-2003
+
+highlight 2.0-12
+
+-fixed parsing of subtractions (i.e: varName-1)
+-added support for SuperX++ (thanks to Kimanzi Mati)
+-added Relax NG Compact language definition (thanks to Christian Siefkes)
+
+---
+26-October-2003
+
+highlight 2.0-11
+
+-fixed LaTeX and Squirrel language definitions
+ (thanks to Stephan Bhme and Alberto Dechemelis)
+-fixed number parsing (allow 'a'-'f' in Hex numbers only)
+-replaced double quotes by single quotes in fragmented LaTeX output
+-added a new subdirectory "utils/", moved "cgi/" there
+-added a new Python Qt-Frontend
+-added a PHP module (thanks to Philip Van Hoof)
+-added Nice language definition
+
+---
+21-September-2003
+
+highlight 2.0-10
+
+-changed LaTeX font settings to \tt and \it
+-improved fragmented LaTeX output
+-fixed LaTeX language definition
+-fixed multi line compiler directive parsing with strings
+-added new Squirrel ans JSP language definitions
+
+---
+14-September-2003
+
+highlight 2.0-9
+
+-trailing whitespace from input is ignored
+-modified LaTeX fragmented output to simplify inclusion of code in
+ existing documents
+-added support for multiple line compiler directives
+-added new THE style (thanks to Mark Hessling)
+
+---
+15-August-2003
+
+highlight 2.0-8 Hot Summer Build
+
+-fixed bug which prevented highlighting of escape characters within strings
+ which start a new line
+-fixed XHTML line anchors attribute to "id"
+-added background colour support for plain TeX
+-improved recognition of strings with different open/close delimiters
+-added a reasonable 4th support
+-internal changes to improve speed
+-changed XHTML encoding from utf-8 to iso-8859-1 and xhtml version to 1.1
+-removed comment in XHTML header to enable highlighting when style
+ definition is included in output
+-added recognition of hex, octal and unicode escape sequences (\123, \xff)
+-improved Python and Tcl support
+
+---
+04-August-2003
+
+highlight 2.0-7
+
+-fixed parsing of C# simplified strings (thanks to Cerda)
+-added support for C# member attributes (thanks to Gauthier)
+-added --listlangs option (suggested by Mark Hessling)
+-improved plausibility of --outdir option (thanks to Otto Barnes II)
+
+---
+27-July-2003
+
+highlight 2.0-6
+
+-fixed bug in HTML and XHTML output, which caused insertion of too many
+ "</span>" tags (thanks to Mark Hessling)
+
+---
+20-July-2003
+
+highlight 2.0-5
+
+-improved LaTeX, TeX and RTF colour output
+-fixed TeX output formatting errors
+-fixed LaTeX line number output (thanks to Johannes Nolte)
+-improved code portability (thanks to Gauthier)
+-added french help (thanks to Gauthier)
+
+---
+01-July-2003
+
+highlight 2.0-4
+
+-improved Ada 95 output (thanks to Frank Piron)
+-added HTML index file option
+-simplified API
+-added some language definitions
+
+---
+28-May-2003
+
+highlight 2.0-2
+
+-fixed bug causing lowercase output of case insensitive
+ languages (thanks to David and Mark Hessling)
+-added new Matlab colour theme (thanks to David)
+-improved Rexx language definition (thanks to Mark Hessling)
+-added plain text language definition
+
+---
+01-May-2003
+
+highlight 2.0
+
+-fixed memory leak in DataDir::searchDataDir()
+-fixed configuration file parsing
+-added data-dir option
+-added batch-recursive option
+-changed CmdLineoptions.cpp to compile under Windows
+
+---
+27-April-2003
+
+highlight 2.0b-9
+
+-improved integer literal and C++ multiline comment parsing
+ (both suggested by Benjamin Kaufmann)
+-improved directive line parsing
+
+---
+20-April-2003
+
+highlight 2.0b-8
+
+-added Pike language definition (thanks to Olivier Girondel)
+-added support for Forth (suggested by Hans Bezemer)
+-fixed bugs in language definition loader method
+-fixed segfault
+
+---
+07-April-2003
+
+highlight 2.0b-7
+
+-added Artistic Style indentation and reformatting
+
+---
+31-March-2003
+
+highlight 2.0b-6
+
+-fixed fortran code parsing ( thanks to Henning Weber)
+-improved performance
+
+---
+highlight 2.0b-5
+
+-fixed theme files which had DOS line terminators
+-presets reader method was fixed
+-changed RTF output to Courier and 20 pt font size
+-help screen fixed
+
+---
+19-March-2003
+
+highlight 2.0b-4
+
+-added css-infile and css-outfile options to make generation of customizable css
+ definitons clearer (suggested by Markus Werle)
+-fixed bug reading fontsize parameter of themes
+
+---
+16-March-2003
+
+highlight 2.0b-3
+
+-improved RTF output
+
+---
+09-March-2003
+
+highlight 2.0b-2
+
+-improved RTF output (added bold/italics/underline attributes)
+-improved TeX output (added theme colors [thanks to Markus Henning for TeX-URL],
+ bold and italics)
+-added a decription how to use the highlight parser in own applications
+
+---
+05-March-2003
+
+highlight 2.0b
+-memory leak was fixed
+-the parser was rewritten to add more flexibility and stability
+-added ability to highlight code with tags (XML, HTML...)
+-added ability to highlight strings with prefixes
+ (variableprefix, keywordprefix)
+-different source file extensions are stored in a configuration file
+ (extensions.conf)
+-configuration reader was modified to allow storing parameter values
+ in multiple lines
+-added some more language definitions
+
+---
+30-January-2003
+
+highlight 1.3.4-2
+
+-added option to disable directive line bug
+-added ability to search *.style and *.lang files in different directories,
+ which may be set as prefix option of ./configure
+ (suggested by Jose Santiago)
+
+---
+28-January-2003
+
+highlight 1.3.4
+
+-fixed LaTeX output regarding escape characters outside of strings
+-fixed unmasked escape characters
+ (both bugs reported by Peter Albert)
+-added \ttfamily to LaTeX header (suggested by Peter Albert)
+-rpm-spec file allows relocatable builds (thanks to Dwight Engen)
+-added "CPP" to recogniced source file suffixes (suggested by Maniac)
+-replaced verb-|- by \textbar
+-fixed php.lang and py.lang
+
+---
+08-January-2003
+
+highlight 1.3.3
+
+-fixed Asm.lang (lower case of keywords/types)
+-added option to specify target directory of the output files
+-fixed bug in LateX/RTF/TeX output; last opened tag being closed now
+-improved LaTeX output
+-added ability to read presets from the configuration file $HOME/.highlight.conf
+-added simple cgi script (Perl)
+
+---
+29-November-2002
+
+highlight 1.3.2-2
+
+- fixed LaTeX output of | and ~ characters (thanks to Martin Idelberger)
+
+---
+26-November-2002
+
+highlight 1.3.2
+
+-fixed buffer overflow problem (thanks to Christian Perle)
+-added Rexx, Modula3, Agda, Haskell language definition
+-added (G)AWK language definition (thanks to Andreas Schoenberg)
+-added Bold and Italic font support, and background colour to LaTeX output
+-highlight compiles without warnings with gcc 3.2
+
+---
+20-November-2002
+
+highlight 1.3.1-2
+
+-applied gcc 3.2 patch (thanks to Georg Young)
+
+---
+18-November-2002
+
+highlight 1.3.1
+
+-fixed bug whioch disabled batch mode
+-added POV Ray Definition (thanks to Christian Perle)
+-added emacs and kwrite style
+
+---
+11-November-2002
+
+highlight 1.3 (beta)
+
+-applied Ruby definition file patch (thanks to Jonas Fonseca)
+-introduced style definition files
+-added background colour to style definitions
+-added line anchors in HTML output
+
+---
+05-October-2002
+
+highlight 1.2.1
+
+-applied patch to make highlight compile with gcc 3.x (thanks to Marc Duponcheel)
+-fixed LaTeX output of "^" and /hskip (thanks to Dan Muller)
+-fixed TeX output
+
+---
+26-August-2002
+
+highlight 1.2
+
+-fixed bug which caused wrong output file suffixes in batch mode
+-fixed (X)HTML output of french characters
+-added frech character output (accent graphe, acute) to rtf, TeX and LaTeX output
+-ability to recognize keywords with "-"
+-added new language definitions (Ruby, COBOL, Fortran)
+
+---
+20-August-2002
+
+highlight 1.1
+
+-TeX output
+-fixed documentation regarding LaTeX / TeX output (Thanks to Keith Briggs)
+-fixed bug which caused single line comments left unmasked
+-french letters like ? ?are masked
+
+---
+13-August-2002
+
+highlight 1.0 <stable>
+
+-reduced tex output file size
+-Perl and Visual Basic definition file
+-fixed error in help msg (Thanks to Jan van Haarst)
+
+---
+25-July-2002
+
+highlight 0.1
+
+-RTF and La(Tex) output
+-Lua definition file
+-header and footer part of output file may be omitted
+-changed path of language definitions to /usr/share/highlight
+
+---
+06-May-2002:
+
+src2css 0.2
+
+-batch mode, converting all files matching a given wildcard
+-XHTML output
+-Python definition file
+
+---
+04-Apr-2002:
+
+src2css 0.1
+
+-initial release
diff --git a/support/highlight/Doxyfile b/support/highlight/Doxyfile
new file mode 100644
index 0000000000..cea6c7ec8f
--- /dev/null
+++ b/support/highlight/Doxyfile
@@ -0,0 +1,235 @@
+# Doxyfile 1.3.4-KDevelop
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME = "Highlight Code Converter"
+PROJECT_NUMBER = 2.6.13
+OUTPUT_DIRECTORY = apidocs
+OUTPUT_LANGUAGE = English
+USE_WINDOWS_ENCODING = NO
+BRIEF_MEMBER_DESC = YES
+REPEAT_BRIEF = YES
+ALWAYS_DETAILED_SEC = NO
+INLINE_INHERITED_MEMB = NO
+FULL_PATH_NAMES = NO
+STRIP_FROM_PATH =
+SHORT_NAMES = NO
+JAVADOC_AUTOBRIEF = NO
+MULTILINE_CPP_IS_BRIEF = NO
+DETAILS_AT_TOP = NO
+INHERIT_DOCS = YES
+DISTRIBUTE_GROUP_DOC = NO
+TAB_SIZE = 8
+ALIASES =
+OPTIMIZE_OUTPUT_FOR_C = NO
+OPTIMIZE_OUTPUT_JAVA = NO
+SUBGROUPING = YES
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+EXTRACT_ALL = NO
+EXTRACT_PRIVATE = NO
+EXTRACT_STATIC = NO
+EXTRACT_LOCAL_CLASSES = YES
+HIDE_UNDOC_MEMBERS = NO
+HIDE_UNDOC_CLASSES = NO
+HIDE_FRIEND_COMPOUNDS = NO
+HIDE_IN_BODY_DOCS = NO
+INTERNAL_DOCS = NO
+CASE_SENSE_NAMES = YES
+HIDE_SCOPE_NAMES = NO
+SHOW_INCLUDE_FILES = NO
+INLINE_INFO = YES
+SORT_MEMBER_DOCS = YES
+GENERATE_TODOLIST = YES
+GENERATE_TESTLIST = YES
+GENERATE_BUGLIST = YES
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS =
+MAX_INITIALIZER_LINES = 30
+SHOW_USED_FILES = YES
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET = YES
+WARNINGS = NO
+WARN_IF_UNDOCUMENTED = YES
+WARN_IF_DOC_ERROR = YES
+WARN_FORMAT = "$file:$line: $text"
+WARN_LOGFILE =
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT = ./src
+FILE_PATTERNS = *.c \
+ *.cc \
+ *.cxx \
+ *.cpp \
+ *.c++ \
+ *.java \
+ *.ii \
+ *.ixx \
+ *.ipp \
+ *.i++ \
+ *.inl \
+ *.h \
+ *.hh \
+ *.hxx \
+ *.hpp \
+ *.h++ \
+ *.idl \
+ *.odl \
+ *.cs \
+ *.php \
+ *.php3 \
+ *.inc \
+ *.C \
+ *.H \
+ *.tlh \
+ *.diff \
+ *.patch \
+ *.moc \
+ *.xpm \
+ *.dox
+RECURSIVE = yes
+EXCLUDE =
+EXCLUDE_SYMLINKS = NO
+EXCLUDE_PATTERNS =
+EXAMPLE_PATH =
+EXAMPLE_PATTERNS = *
+EXAMPLE_RECURSIVE = NO
+IMAGE_PATH =
+INPUT_FILTER =
+FILTER_SOURCE_FILES = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER = NO
+INLINE_SOURCES = NO
+STRIP_CODE_COMMENTS = YES
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION = YES
+VERBATIM_HEADERS = YES
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX = NO
+COLS_IN_ALPHA_INDEX = 5
+IGNORE_PREFIX =
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML = YES
+HTML_OUTPUT = html
+HTML_FILE_EXTENSION = .html
+HTML_HEADER =
+HTML_FOOTER =
+HTML_STYLESHEET =
+HTML_ALIGN_MEMBERS = YES
+GENERATE_HTMLHELP = NO
+CHM_FILE =
+HHC_LOCATION =
+GENERATE_CHI = NO
+BINARY_TOC = NO
+TOC_EXPAND = NO
+DISABLE_INDEX = NO
+ENUM_VALUES_PER_LINE = 4
+GENERATE_TREEVIEW = NO
+TREEVIEW_WIDTH = 250
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX = NO
+LATEX_OUTPUT = latex
+LATEX_CMD_NAME = latex
+MAKEINDEX_CMD_NAME = makeindex
+COMPACT_LATEX = NO
+PAPER_TYPE = a4wide
+EXTRA_PACKAGES =
+LATEX_HEADER =
+PDF_HYPERLINKS = NO
+USE_PDFLATEX = NO
+LATEX_BATCHMODE = NO
+LATEX_HIDE_INDICES = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF = NO
+RTF_OUTPUT = rtf
+COMPACT_RTF = NO
+RTF_HYPERLINKS = NO
+RTF_STYLESHEET_FILE =
+RTF_EXTENSIONS_FILE =
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN = NO
+MAN_OUTPUT = man
+MAN_EXTENSION = .3
+MAN_LINKS = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML = NO
+XML_OUTPUT = xml
+XML_SCHEMA =
+XML_DTD =
+XML_PROGRAMLISTING = YES
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD = NO
+PERLMOD_LATEX = NO
+PERLMOD_PRETTY = YES
+PERLMOD_MAKEVAR_PREFIX =
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING = YES
+MACRO_EXPANSION = NO
+EXPAND_ONLY_PREDEF = NO
+SEARCH_INCLUDES = YES
+INCLUDE_PATH =
+INCLUDE_FILE_PATTERNS =
+PREDEFINED =
+EXPAND_AS_DEFINED =
+SKIP_FUNCTION_MACROS = YES
+#---------------------------------------------------------------------------
+# Configuration::addtions related to external references
+#---------------------------------------------------------------------------
+TAGFILES =
+GENERATE_TAGFILE =
+ALLEXTERNALS = NO
+EXTERNAL_GROUPS = YES
+PERL_PATH = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS = YES
+HIDE_UNDOC_RELATIONS = YES
+HAVE_DOT = NO
+CLASS_GRAPH = YES
+COLLABORATION_GRAPH = YES
+UML_LOOK = NO
+TEMPLATE_RELATIONS = NO
+INCLUDE_GRAPH = YES
+INCLUDED_BY_GRAPH = YES
+CALL_GRAPH = NO
+GRAPHICAL_HIERARCHY = YES
+DOT_IMAGE_FORMAT = png
+DOT_PATH =
+DOTFILE_DIRS =
+MAX_DOT_GRAPH_WIDTH = 1024
+MAX_DOT_GRAPH_HEIGHT = 1024
+MAX_DOT_GRAPH_DEPTH = 1000
+GENERATE_LEGEND = YES
+DOT_CLEANUP = YES
+#---------------------------------------------------------------------------
+# Configuration::addtions related to the search engine
+#---------------------------------------------------------------------------
+SEARCHENGINE = NO
diff --git a/support/highlight/INSTALL b/support/highlight/INSTALL
new file mode 100644
index 0000000000..ce2d52a2f4
--- /dev/null
+++ b/support/highlight/INSTALL
@@ -0,0 +1,148 @@
+Highlight installation instructions
+-----------------------------------
+
+Content
+=======
+
+0. Package structure
+1. Basic installation
+2. Known compiler issues
+3. LaTeX unicode support
+4. Lazy pointer issue under MacOS X
+5. Static linking (run highlight as service)
+
+
+01. Package structure
+=====================
+
+root of highlight-x.x
+|
+|-- examples # examples for highlight scripting
+| |-- plugins # plugins for various web toolkits
+| `-- swig # SWIG interface and sample code
+|-- gui_files # supporting files for the optional GUI
+| |-- ext # file open filter configuration
+| `-- l10n # GUI translations
+|-- langDefs # language definitions (*.lang)
+|-- man # man page
+|-- src # source code
+| |-- cli # command line interface code
+| |-- core # highlight core code (builds the library)
+| | |-- astyle # Artistic Style code
+| | `-- re # Regex code
+| `-- gui-qt # optional GUI code
+`-- themes # color themes (*.theme)
+
+AUTHORS # contributors of code and patches
+ChangeLog # list of changes
+COPYING # license
+Doxyfile # Doxygen configuration
+filetypes.conf # file type extension configuration
+highlight.desktop # desktop integration of optional GUI
+highlight.spec # RPM build description
+INSTALL # this file
+makefile # basic makefile
+README # user manual
+README_DE # German user manual
+README_LANGLIST # list of supported languages
+README_REGEX # regular expression manual
+TODO # just ideas, no plans
+
+
+1. Basic installation
+=====================
+
+ 1. tar xzvf highlight-x.x.tar.gz
+
+ 2. cd highlight-x.x
+
+ 3. make help
+
+ 4. make / make cli (compile static library and the CLI interface)
+ make lib-static (optional, compile static library only)
+ make lib-shared (optional, compile shared library only)
+ make gui (optional, compile static library and the Qt 4.x GUI)
+
+ 5, make install
+ (depending on your installation destination, you need to be root)
+
+ 6. make install-gui (optional)
+ Install additional files if you have compiled the highlight GUI binary.
+ (depending on your installation destination, you need to be root)
+
+ 7. make clean (optional)
+
+ 8. make apidocs (optional)
+ (you need to have doxygen installed)
+
+ After the compilation of the CLI or GUI, a library (libhighlight.a) was
+ generated which may be used for other C++ projects.
+
+ Highlight's default data directory is /usr/share/highlight.
+ You may alter this directory at compile time or at run time:
+ - See the makefile how to add a compiler directive which defines an
+ installation directory (data_dir variable)
+ - Use the --data-dir option to define a new directory at run time. You may
+ want to save this parameter in the highlight configuration file
+ ($HOME/.highlightrc)
+ - You can add an additional data directory by the --add-data-dir option.
+ Files will be searched in this directory first. This may also be configured
+ in $HOME/.highlightrc.
+ - See the makefile to change the configuration file directory
+ (conf_dir variable).
+
+
+2. Known compiler issues
+========================
+
+These errors occour with old gcc releases:
+
+ 1. Is there a stringstream / sstream header for gcc 2.95.2?
+
+ See http://sources.redhat.com/ml/libstdc++/2000-q2/msg00700/sstream
+
+ 2. Core dumps with gcc 2.96 (RedHat 7.1, 7.3)
+
+ RedHat included this unofficial release of gcc, which had a buggy stringstream
+ implementation.
+ See http://www.mail-archive.com/gcc-bugs@gcc.gnu.org/msg22146.html
+ There is no workaround, please upgrade to gcc 3.x. (Reported by Mark Hessling)
+
+ 3. Compilation error with "right" IO manipulator
+
+ In htmlcode.cpp: `right' undeclared (first use this function)
+ (Each undeclared identifier is reported only once for each function it
+ appears in.)
+ There is no workaround, please upgrade to gcc 3.x. (Reported by Christoph Bier)
+
+
+3. LaTeX unicode support
+========================
+
+To enable UTF-8 support in LaTeX, the ucs package has to be installed.
+See the following package names or sources:
+
+Fedora: tetex-unicode
+SuSE: latex-ucs
+
+Source: http://www.unruh.de/DniQ/latex/unicode/
+
+
+4. Lazy pointer issue under MacOS X
+===================================
+
+Stripping the highlight binary causes program termination at runtime:
+
+dyld: lazy symbol binding failed: lazy pointer not found
+dyld: lazy pointer not found
+Trace/BPT trap
+
+To avoid this issue, edit the makefile to not strip the binary after
+linkage (see src/makefile, LDFLAGS variable).
+
+
+5. Static linking (run highlight as service)
+============================================
+
+If highlight cannot be run as service because of shared linkage, link
+it with the -static option (see src/makefile, LDFLAGS variable).
diff --git a/support/highlight/README b/support/highlight/README
new file mode 100644
index 0000000000..b43a8ac3ae
--- /dev/null
+++ b/support/highlight/README
@@ -0,0 +1,687 @@
+-------------------------------------------------------------------------------
+--- HIGHLIGHT MANUAL - Version 2.16 ------------------------- March 2010 ---
+-------------------------------------------------------------------------------
+
+OSI Certified Open Source Software
+
+Deutsche Anleitung: README_DE
+
+-------------------------------------------------------------------------------
+
+Highlight converts sourcecode to HTML, XHTML, RTF, LaTeX, TeX, SVG, BBCode, XML
+and terminal escape sequences with coloured syntax highlighting.
+Language definitions and colour themes are customizable.
+
+
+CONTENT:
+-------------------------------------------------------------------------------
+
+0. Quick introduction
+1. Platforms
+2. Supported programming/markup languages
+3. Features
+4. Input/Output
+5. Highlight file format
+6. Language definitions
+7. Colour themes
+8. Keyword groups
+9. Embedded output instructions
+10. Configuration file
+11. Advanced options
+12. Plugins
+13. SWIG interface
+14. GNU Source-highlight compatibility
+15. Contact
+
+
+
+0. Quick introduction
+-------------------------------------------------------------------------------
+
+The following examples show how to produce a highlighted C++ file, using an
+input file called main.cpp:
+
+- Generate HTML:
+ highlight -i main.cpp -o main.cpp.html
+ highlight < main.cpp > main.cpp.html --syntax cpp
+
+You will find the HTML file and highlight.css in the working directory.
+If you use IO redirection, you must define the syntax type with --syntax.
+
+- Generate HTML with embedded CSS definitions and line numbers:
+ highlight -i main.cpp -o main.cpp.html --include-style --linenumbers
+
+- Generate HTML with inline CSS definitions:
+ highlight -i main.cpp -o main.cpp.html --inline-css
+
+- Generate HTML using "ANSI" source formatting style and "neon" colour theme:
+ highlight -i main.cpp -o main.cpp.html --reformat ansi --style neon
+
+- Generate LaTeX:
+ highlight --latex -i main.cpp -o main.cpp.tex
+
+ Other output formats:
+ XHTML (--xhtml), TeX (--tex), LaTeX (--latex), RTF (--rtf), terminal colour
+ escape codes (--ansi, --xterm256), SVG (--svg), BBCode (--bbcode), XML (--xml).
+ HTML is the default output format if no other format is specified.
+
+- Define an output directory:
+ highlight -O some/target/dir/ *.cpp *.h
+
+See "highlight --help" or "man highlight" for more details.
+
+
+
+1. PLATFORMS:
+-------------------------------------------------------------------------------
+
+Highlight is written in ISO C++. The following platforms are supported:
+- UNIX console and GUI application
+- W32 console and GUI application
+
+The website www.andre-simon.de offers more precompiled packages for several
+operating systems (like Debian, Solaris, MacOS X).
+
+Note for the path names in this document:
+The highlight directory $HL_DIR may be one of the directories listed in INSTALL.
+For UNIX, this is usually /usr/share/highlight, for Windows, it is the path
+of the highlight executable. You redefine this directory at run time by
+the --data-dir option, or by modification of the makefile (see INSTALL).
+Highlight expects the subdirectories langDefs/ and themes/ within the data
+directory.
+Apart from $HL_DIR, the directory $CONF_DIR is the place where configuration
+files are stored (Unix: /etc/highlight/, Windows: executable path).
+
+The optional GUI is not included in all precompiled packages. In order to
+compile the GUI from source, the Qt4 devel package is required. See INSTALL
+for detailed instructions.
+
+
+
+2. SUPPORTED PROGRAMMING / MARKUP LANGUAGES:
+-------------------------------------------------------------------------------
+
+Please see README_LANGLIST for the current compilation of supported languages.
+You may also run "highlight --list-langs" to get a list of supported file
+extensions.
+
+
+
+3. FEATURES:
+-------------------------------------------------------------------------------
+
+* highlighting of keywords, types, strings, numbers, escape sequences, comments,
+ symbols and directive lines
+* recognition of nested languages within a file
+* custom keyword groups, which may be defined using regular expressions
+* coloured output in HTML, XHTML 1.1, RTF, TeX, LaTeX, SVG, BBCode, terminal
+ escape sequences and XML format
+* customizable reformatting and indentation of C, C++, C# and Java source code
+* wrapping of long lines
+* output of line numbers
+* choice to embed the formatting information in the output HTML, LaTeX, TeX or
+ SVG file or to save them in a separate style file, which is referenced by the
+ generated documents
+* customizable colour themes
+* recursive batch processing of directories
+
+
+
+4. INPUT/OUTPUT:
+-------------------------------------------------------------------------------
+
+Apart from defining input and output files using -i and -o, it is possible to
+use IO redirection.
+If no input or output file name is defined by --input and --output options,
+highlight will use stdin and stdout for file processing.
+If multiple input files are given, highlight switches to batch mode.
+
+If no input filename is defined by --input or given at the prompt, highlight is
+not able to determine the language type by means of the file extension (only
+some scripting languages are determined by the shebang in the first input
+line). In this case you have to pass highlight the given langage with --syntax
+(this should be the file suffix of the source file in most cases).
+Example: If you want to convert a Python file, highlight needs to load the
+py.lang language definition. The correct argument of --syntax would be "py".
+If you pass the filename directly to highlight, the program fetches the ".py"
+extension from the file name.
+
+highlight test.py
+highlight < test.py --syntax py # --syntax option necessary
+cat test.py | highlight --syntax py
+
+If there exist multiple suffixes (like C, cc, cpp, h with C++ - files),
+you assign them to the matching language definition in the file
+$CONF_DIR/filetypes.conf.
+
+Highlight enters the batch processing mode if the --batch-recursive (-B) option
+was given or if multiple input files were defined.
+In batch mode, highlight will save the generated files with the original
+filename, appending the extension of the chosen output type.
+The -O option is useful with -B. Use --quiet to improve performance
+(recommended for usage in shell scripts).
+
+
+HTML, TeX, LaTeX and SVG output
+-------------------------------
+
+The HTML, TeX, LaTeX and SVG output formats allow to reference style definition
+files which contain the formatting information (stylesheets).
+
+In HTML and SVG output, this file contains CSS definitions and is saved as
+'highlight.css'. In LaTeX and TeX, this file contains macro definitions, and
+is saved as 'highlight.sty'.
+
+Name and path of the stylesheet may be modified with --style-outfile.
+If the --outdir option is given, all generated output, including stylesheets,
+are stored in this directory.
+
+Use the --include-style switch to save the style information embedded in
+the output documents without referencing a stylesheet.
+
+The usage of referenced style definitions has the advantage to have all
+formatting information in a central place, which affects all referencing
+documents.
+
+Using the --style-infile option you can define a file to be included in the
+final formatting information of the document. You can enhance or redefine
+the default highlight style definitions without editing generated code.
+
+Example:
+
+/* content of user.css (add document frame and a line to linenumbers) */
+pre.hl {
+ border-width: 1px;
+ border-style:solid;
+ border-left-color: silver;
+ border-top-color: silver;
+ border-right-color: gray;
+ border-bottom-color: gray;
+ padding: 0.5cm;
+ margin: 2cm;
+}
+.hl.line {
+ /* background-color:#EEEEEE; color:#505050; */
+ border-right:1px solid #555555;
+ font-style:normal;
+ font-weight:normal;
+ padding:1px;
+ text-decoration:none;
+}
+
+Usage: highlight -l --style-infile user.css main.cpp
+
+
+Terminal output:
+----------------
+
+highlight --ansi <inputfile> | less -R
+highlight --xterm256 <inputfile> | less -R
+
+displays coloured sourcecode in a terminal.
+
+Since there are limited colours defined for ANSI terminal output, there exists
+only one hard coded colour theme with --ansi. You should therefore use --xterm256
+to enable output in 256 colours. The 256 colour mode is supported by recent
+releases of xterm, rxvt and Putty (among others).
+
+
+Text processing:
+----------------
+
+If the language definition is specified as "txt", no highlighting takes place.
+
+highlight -S txt -L README > README.tex
+
+
+Examples
+--------
+
+The following commands write the content of hello.c to hello.html:
+
+highlight -o hello.html -i hello.c
+highlight -o hello.html hello.c
+highlight -o hello.html --syntax c < hello.c
+highlight --syntax c < hello.c > hello.html
+
+Apart from hello.html, a file highlight.css is generated in the current working
+directory.
+
+highlight -X --batch-recursive '*.cpp' --outdir /home/you/html_code/
+This command converts all *.cpp files in the current directory and its sub-
+directories to xhtml files, and stores the output in /home/you/html_code.
+
+highlight hello.c --mark-line="5=Initialize some stuff; 15; 21=Log result"
+This command will mark the lines 5, 15 and 21 in HTML output.
+The lines 5 and 21 will include tooltips with the given help texts.
+
+highlight -L * --outdir /home/you/latex_code/
+This command onverts all files to LaTeX, stored in /home/you/latex_code/.
+
+highlight -c stdout -s seashell --print-style
+This command prints only the CSS information to stdout (theme: Seashell).
+
+
+
+5. HIGHLIGHT FILE FORMAT
+-------------------------------------------------------------------------------
+
+All Highlight configuration files are stored as plain ASCII text files, using
+the convention:
+
+$ParamName=ParamValue
+
+ParamName is the identifier of the parameter, ParamValue is its value.
+Parameter names are not case sensitive.
+The value may be a single character, a list of words or a regular expression.
+Lists may be split in multiple lines.
+
+Comments start with # as the first character in a line.
+
+
+
+6. LANGUAGE DEFINITIONS:
+-------------------------------------------------------------------------------
+
+
+A language definition describes all elements of a programming language which
+will be highlighted by different colours and font types.
+Save the new file in $HL_DIR/langDefs (see section 1), using the following name
+convention:
+
+<usual extension of sourcecode files>.lang
+
+Examples: PHP -> php.lang, Java -> java.lang
+
+If there exist multiple suffixes, list them in $HL_DIR/filetypes.conf.
+
+FILE FORMAT:
+
+# Regular expression to describe valid number tokens
+# Default value: (?:0x|0X)[0-9a-fA-F]+|\d*[\.]?\d+(?:[eE][\-\+]\\d+)?[lLuU]?
+$DIGIT=regex(<RE>)
+
+# Regular expression to describe valid identifier tokens
+# Default value: [a-zA-Z_]\w*
+$IDENTIFIER=regex(<RE>)
+
+# List of keywords or regular expression.
+# <group> is the name of the keyword group
+# The group must be defined in the applied colour theme to provide a matching
+# highlighting style.
+# If the regex contains multiple grouping parantheses, GROUP-NUM may be defined.
+# This parameter contains the number of the group, whose match should be
+# returned as keyword (count number from left to right)
+# The capturing states of the groups are irrelevant for counting.
+# Legal index values: 0 <= GROUP-NUM <= highest group index
+# 0 describes the complete regex match
+# If GROUP-NUM is undefined, the group match with the highest number will be
+# returned.
+$KEYWORDS(<group>)=regex(<RE> <, GROUP-NUM>) | <List>
+
+# List of String delimiters
+$STRINGDELIMITERS=<List>
+
+# List of string delimiters which are not equal (open != close)
+$STRING_UNEQUAL=<open close>
+
+# List of escape characters in strings (ie. "\") or regular expression
+$ESCCHAR=<List> | regex(<RE>)
+
+# Escape characters may appear outside of strings
+$ALLOWEXTESCAPE=<true|false>
+
+# Prefix which disables highlighting of escape characters within a string
+$RAWSTRINGPREFIX=<character>
+
+# Delimiters of multi line comments
+# Delimiter comment_close may be omitted if $ALLOWNESTEDCOMMENTS is false
+$ML_COMMENT=<comment_begin comment_close>
+
+# List of strings which start single line comments
+$SL_COMMENT=<List> | regex(<RE>)
+
+# Prefix of preprocessor directive lines
+$DIRECTIVE=<prefix> | regex(<RE>)
+
+# Character which continues a compiler directive after a line break
+$CONTINUATIONSYMBOL=<symbol>
+
+# Source code may be reformatted (only C-style languages compatible with
+# astyle (astyle.sf.net)
+$REFORMATTING=<true | false>
+
+# Symbols (brackets or operators)
+$SYMBOLS=<List>
+
+# Multiple line comments may be nested
+$ALLOWNESTEDCOMMENTS=<true | false>
+
+# Programming language is case sensitive
+$IGNORECASE=<true | false>
+
+# Include another language definition stored in the same data directory
+$INCLUDE=<language definition>
+
+# define the opening and closing expressions of the embedded language.
+# There may be multiple entries for the same language
+$NESTED(language)=regex(<RE open>) regex(<RE close>)
+
+See the file README_REGEX for a detailed description of the regular expression
+syntax.
+
+Example:
+--------
+
+#Content of pas.lang (Pascal/Objekt Pascal)
+
+$KEYWORDS(kwa)= absolute abstract and array as asm assembler automated begin case
+cdecl class const constructor destructor dispid dispinterface div do downto
+# [...]
+$KEYWORDS(kwb)=boolean char integer pointer real text
+true false cardinal longint byte word single double int64
+$KEYWORDS(kwc)=if else then downto do for repeat while to until with
+$KEYWORDS(kwd)=regex((\w+?)\s*\()
+$STRINGDELIMITERS=" '
+$SL_COMMENT=//
+$ML_COMMENT={ } (* *)
+$IGNORECASE=true
+$SYMBOLS= ( ) [ ] , ; : & | < > ! = / * % + - @
+$ESCCHAR=#
+$ALLOWEXTESCAPE=true
+
+HINT: To test new language definitions or if you do not have permission to save
+ files in the default installation directory (HL_DIR), pass highlight
+ another search path with the --add-data-dir option.
+
+
+
+7. THEME DEFINITIONS
+-------------------------------------------------------------------------------
+
+Colour themes contain the formatting information of the language elements which
+are described in language definitions.
+
+The files have to be stored as *.style in HL_DIR/themes* (see section 1).
+Apply a style with the --style option.
+
+FILE FORMAT:
+
+<Colour> = #RRGGBB
+RR GG BB describe the red/green/blue hex-values which define the colour.
+Value range: 00 (none) - FF (full)
+
+<Format> = <bold> <italic> <underline>
+Bold, italic und underline are optional attributes and may be combined.
+
+# Colour of unspecified text
+$DEFAULTCOLOUR=<Colour>
+
+# Background colour
+$BGCOLOUR=<Colour>
+
+# Font size
+$FONTSIZE=<number>
+
+# Formatting of keywords, which belong to the corresponding keyword group
+$KW-GROUP(<group>)=<Colour> <Format>
+
+# Formatting of numbers
+$NUMBER=<Colour> <Format>
+
+# Formatting of escape characters
+$ESCAPECHAR=<Colour> <Format>
+
+# Formatting of strings
+$STRING=<Colour> <Format>
+
+# Formatting of comments
+$COMMENT=<Colour> <Format>
+
+# Formatting of single line comm. (optional, equals to $COMMENT if omitted)
+$SL-COMMENT=<Colour> <Format>
+
+# Formatting of compiler directives
+$DIRECTIVE=<Colour> <Format>
+
+# Formatting of strings within compiler directives
+$STRING-DIRECTIVE=<Colour> <Format>
+
+# Formatting of symbols (optional, equals to $DEFAULTCOLOUR if omitted)
+$SYMBOL=<Colour> <Format>
+
+# Formatting of line numbers
+$LINE=<Colour> <Format>
+
+# Background colour of marked lines
+$MARK-LINE=<Colour>
+
+Example:
+
+# golden.style
+$DEFAULTCOLOUR=#ddbb00
+$BGCOLOUR=#000000
+$FONTSIZE=10
+$KW-GROUP(kwa)=#ffed8a bold
+$KW-GROUP(kwb)=#ffed8a
+$KW-GROUP(kwc)=#dedede bold
+$KW-GROUP(kwd)=#ddbb00 bold
+$NUMBER=#ffffff
+$ESCAPECHAR=#ff0000
+$STRING=#ff0000
+$STRING-DIRECTIVE=#ff0000
+$COMMENT=#978345 italic
+$DIRECTIVE=#ffddaa
+$LINE=#898989
+$SYMBOL=#ababab
+$MARK-LINE=#404040
+
+
+
+8. KEYWORD GROUPS
+-------------------------------------------------------------------------------
+
+You may define custom keyword groups and corresponding highlighting styles.
+This is useful if you want to highlight functions of a third party library,
+macros, constants etc.
+
+You define a new group in two steps:
+
+ 1. Define a new group in your language definition:
+
+ $KEYWORDS(group)
+
+ The group attribute is the name of the new keyword group.
+ You may use the same group name for different group descriptions.
+
+ 2. Add a corresponding highlighting style in your colour theme:
+
+ $KW-GROUP(group) = #RRGGBB <bold> <italic> <underline>
+
+Note that every group name which is listed in a language definition should be
+defined in the used colour theme. The keyword groups "kwa"-"kwd" are predefined
+in all packaged colour themes.
+
+
+Example:
+
+# Some language definition...
+$KEYWORDS(kwa)=for repeat while [...]
+$KEYWORDS(debug)=ASSERT DEBUG
+$ML_COMMENT=/* */
+# ...
+
+# Some colour theme...
+$KW-GROUP(kwa)=#ddbb00 bold
+$KW-GROUP(debug)=#ff0000 bold
+$COMMENT=#978345 italic
+# ...
+
+
+
+9. EMBEDDED OUTPUT INSTRUCTIONS
+-------------------------------------------------------------------------------
+
+If highlight encounters the identifier @highlight within a single line comment
+in an input source file, the following special handling is applied to the line
+content: The data after @highlight will be copied to the output without
+escaping symbols of the output file format. So it is possible to add HTML tags
+or LaTeX commands without the need of external scripts. Apart from that, there
+is a set of variables that can be used to output additional information:
+
+$infile: input file path
+$outfile: output file path
+$font-face: font face
+$font-size: font size
+$theme: theme path
+$title: document title
+$encoding: encoding
+$linenum: line number
+$nl: newline
+
+The comment line will not be outputted as highlighted comment, nor will it
+increase the line number count.
+Embedded instructions are only recognized in single line comments, not in multi
+line comments.
+
+Example:
+
+The following comment line is part of main.cpp:
+
+//@highlight <h1>$title</h1><br>Filename: $infile $nl
+
+highlight main.cpp --doc-title=Masterpiece
+
+This command will result in the following HTML output:
+
+<h1>Masterpiece</h1><br>Filename: main.cpp
+
+
+
+10. CONFIGURATION FILE:
+-------------------------------------------------------------------------------
+
+A plain ASCII text file may be stored in the following path, depending
+on your platform:
+
+UNIX: $HOME/.highlightrc
+W32 : <Path of highlight.exe>\highlight.conf
+
+The options in the file behave like their equivalent long command line options
+of the same name. Flags (options without parameter) expect true or false as
+value.
+
+
+Example:
+
+$style=emacs
+$linenumbers=true
+$style-outfile=format.css
+$reformat=gnu
+
+The options defined in this file may be redefined by command line parameters
+(except flags).
+
+
+
+11. ADVANCED OPTIONS
+-------------------------------------------------------------------------------
+
+Adding Exuberant Ctags information
+
+HTML output can be enhanced with descriptive tooltips based on ctags data:
+ctags *.*
+highlight --ctags-file *.cpp
+
+The default ctags-file parameter is "tags", so it is omitted in this example.
+This command will add the type, namespace and definition file path of recognized
+language tokens.
+Example: "member | class:highlight::HtmlGenerator | htmlgenerator.h"
+
+
+Marking input lines
+
+In HTML output, lines can be highlighted with a different background colour.
+A tooltip may show additional information describing the marked code section.
+
+highlight --mark-line='3;10,21' -l main.cpp
+This command highlights the lines 3, 10 and 21.
+
+highlight --mark-line='5;10=Getter and setter definitions' -l main.cpp
+This command highlights the lines 5 and 10. Line 10 also includes a tooltip
+containing "Getter and setter definitions".
+
+
+Prevent parsing of binary input files
+
+If highlight could be invoked with all kinds of input, you can disable parsing
+of binary files using --validate-input. This flag causes highlight to match the
+input file header with a list of magic numbers. If a binary file type is
+detected, highlight quits with an error message. This switch also removes the
+UTF-8 BOM.
+
+
+Highlight nested code without starting delimiter
+
+If a file starts with an embedded code section which misses the starting
+delimiter, the --start-nested option will switch to the nested language mode.
+This can happen with LuaTeX files:
+highlight luatex.tex --latex -t4 -semacs --start-nested=inc_luatex
+
+The inc_luatex definition is a Lua definition with TeX line comments.
+Note that the nested code section has to end with the ending delimiter defined
+in the host language definition.
+
+
+
+12. PLUGINS
+-------------------------------------------------------------------------------
+
+See the /examples subdirectory in the highlight installation for some plugins
+which integrate highlight in Wiki and blogging software:
+
+-DokuWiki
+-MovableType
+-Wordpress
+-Serendipity
+
+
+
+13. SWIG INTERFACE
+-------------------------------------------------------------------------------
+
+A SWIG interface file is located in /examples/swig.
+See README_SWIG for installation instructions and the example scripts as
+programming reference.
+
+
+
+14. GNU SOURCE-HIGHLIGHT COMPATIBILITY
+-------------------------------------------------------------------------------
+
+The command line interface is extensively harmonised with source-highlight
+(http://www.gnu.org/software/src-highlite/).
+
+The following highlight options have the same meaning as in source-highlight:
+ --input, --output, --help, --version, --out-format, --title, --data-dir,
+ --verbose, --quiet, --ctags-file
+
+These options were added to enhance compatibility:
+ --css, --doc, --failsafe, --line-number, --line-number-ref, --no-doc, --tab,
+ --output-dir, --src-lang
+
+These switches provide a common highlighter interface for scripts, plugins etc.
+
+
+
+15. CONTACT
+-------------------------------------------------------------------------------
+
+Andre Simon
+andre.simon1@gmx.de
+as@andre-simon.de
+http://www.andre-simon.de/
+
+http://wiki.andre-simon.de/
+Because of repeated spamming abuse, you have to login to edit pages.
+The wiki login: user, Password h1gHL1te
diff --git a/support/highlight/README_DE b/support/highlight/README_DE
new file mode 100644
index 0000000000..4311b871d2
--- /dev/null
+++ b/support/highlight/README_DE
@@ -0,0 +1,709 @@
+-------------------------------------------------------------------------------
+--- HIGHLIGHT MANUAL - Version 2.16 -------------------------- Maerz 2010 ---
+-------------------------------------------------------------------------------
+
+OSI Certified Open Source Software
+
+English manual: README
+
+-------------------------------------------------------------------------------
+
+Highlight konvertiert Sourcecode in XHTML, HTML, RTF, TeX, LaTeX, SVG, BBCode,
+XML und Terminal Escape-Sequenzen mit farbiger Syntaxhervorhebung.
+Sprachdefinitionen und Farbstile sind konfigurierbar.
+
+INHALT
+-------------------------------------------------------------------------------
+
+0. Schnellstart
+1. Plattformen
+2. Unterstuetzte Programmier- und Auszeichnungssprachen
+3. Funktionen
+4. Ein- und Ausgabe
+5. Highlight Dateiformat
+6. Sprachdefinitionen
+7. Farbstile
+8. Schluesselwortgruppen
+9. Eingebettete Ausgabeanweisungen
+10. Konfigurationsdatei
+11. Fortgeschrittene Optionen
+12. Plugins
+13. SWIG Schnittstelle
+14. GNU Source-highlight Kompatibilitaet
+15. Kontakt
+
+
+
+0. Schnellstart
+-------------------------------------------------------------------------------
+
+Folgende Beispiele zeigen, wie man die hervorgehobene Ausgabe einer C++-Datei
+namens main.cpp erzeugt:
+
+- HTML ausgeben:
+ highlight -i main.cpp -o main.cpp.html
+ highlight < main.cpp > main.cpp.html --syntax cpp
+
+ Sie werden die HTML-Datei und die CSS-Datei highlight.css im aktuellen
+ Verzeichnis finden. Falls Sie Eingabe-Umleitung verwenden, geben Sie den Typ
+ der Programmiersprache mit --syntax an.
+
+- HTML mit eingebetteter CSS Definition und Zeilennummerierung ausgeben:
+ highlight -i main.cpp -o main.cpp.html --include-style --linenumbers
+
+- HTML mit direkter CSS-Formatierung ausgeben:
+ highlight -i main.cpp -o main.cpp.html --inline-css
+
+- HTML mit Code-Formatierung im "ANSI" Stil und dem Farbschema "Neon" ausgeben:
+ highlight -i main.cpp -o main.cpp.html --reformat ansi --style neon
+
+- LaTeX ausgeben:
+ highlight --latex -i main.cpp -o main.cpp.tex
+
+ Andere moegliche Ausgabeformate:
+ XHTML (--xhtml), LaTeX (--latex), TeX (--tex), RTF (--rtf), Terminal-Escapecodes
+ (--ansi, --xterm256), SVG (--svg), BBCode (--bbcode), XML (--xml).
+ HTML ist das Default-Format und wird ausgegeben, wenn kein anderes Format
+ angegeben ist.
+
+- Font und Schriftgroesse anpassen:
+ highlight --syntax ada --xhtml --font-size 12 --font Verdana
+ highlight --syntax ada --latex --font-size tiny --font sffamily
+
+- Ausgabeverzeichnis definieren:
+ highlight -O some/target/dir/ *.cpp *.h
+
+Geben Sie "highlight --help" bzw "man highlight" ein, um mehr Details zu
+erfahren.
+
+
+
+1. PLATTFORMEN
+-------------------------------------------------------------------------------
+
+Highlight ist in ISO C++ geschrieben. Es existieren folgende Pakete:
+- UNIX Konsolenanwendung
+- UNIX GTK GUI
+- W32 Konsolenanwendung
+- W32 GUI
+
+Auf der Website www.andre-simon.de sind vorkompilierte Pakete fuer weitere
+Betriebssysteme verfuegbar (z.B. Debian, Solaris, MacOS X).
+
+Fuer die Pfadangaben in diesem Dokument gilt:
+Das Highlight Installationsverzeichnis $HL_DIR ist eines der in INSTALL
+aufgelisteten Verzeichnisse. Unter Unix lautet der Pfad ueblicherweise
+/usr/share/highlight, unter Windows ist es der Pfad der Datei highlight.exe.
+Dieser Pfad kann ueber das makefile (siehe INSTALL) angepasst oder zur
+Laufzeit mit --data-dir geaendert werden.
+Highlight erwartet in dem angegebenen Verzeichnis die Unterverzeichnisse
+langDefs/ und themes/.
+Neben $HL_DIR ist $CONF_DIR das Verzeichnis, in dem die Konfigurationsdateien
+abgelegt werden (Unix: /etc/highlight/, Windows: Programmpfad).
+
+Die optionale GUI ist nicht in allen vorkompilieretn Paketen enthalten. um
+die GUI zu kompilieren, wird das Qt4 devel-Paket benötigt. Siehe INSTALL, um
+weitere Informationen zu erhalten.
+
+
+
+2. UNTERSTUETZTE PROGRAMMIER- UND AUSZEICHNUNGSSPRACHEN:
+-------------------------------------------------------------------------------
+
+Die Liste aller unterstuetzten Sprachen befindet sich in README_LANGLIST.
+Das Kommando "highlight --list-langs" zeigt eine Liste aller Sprachen und
+Dateiendungen.
+
+
+
+3. FUNKTIONEN:
+-------------------------------------------------------------------------------
+
+* Hervorhebung von Schluesselwoertern, Typbezeichnern, Strings, Zahlen,
+ Escapesequenzen, Symbolen, Direktiven und Kommentaren
+* Unterstuetzt selbstdefinierte Schluesselwort-Gruppen, die mit regulaeren
+ Ausdruecken beschrieben werden koennen
+* Erkennung eingebetteter Sprachen innerhalb einer Datei
+* Farbige Ausgabe in HTML, XHTML, RTF, TeX, LaTeX, SVG, BBCode, Terminal-
+ Escapesequenzen und XML
+* Konfigurierbare Neuformatierung und Einrueckung von C, C++, C# und Java Code
+* Umbrechen von ueberlangen Zeilen
+* Ausgabe von Zeilennummern
+* Speichern von Stylesheets wahlweise in separater Datei oder innerhalb der
+ Ausgabedatei (HTML, LaTeX, TeX, SVG)
+* Anpassbare Farbstile
+* Rekursive Konvertierung von Verzeichnissen
+
+
+
+4. EIN- UND AUSGABE:
+-------------------------------------------------------------------------------
+
+Neben der Angabe von Ein- und Ausgabedateien mit -i und -o, kann auch stdin bzw.
+stdout benutzt werden.
+Wenn kein Dateiname mit --input bzw. --output angegeben wird, benutzt highlight
+stdin bzw. stdout fuer die Ein- und Ausgabe.
+Werden mehrere Eingabedateien angegeben, wechselt highlight in den Batch-Modus.
+
+Wird die Eingabedatei nicht direkt auf der Kommandozeile als Argument bzw. mit
+--input angegeben, kann Highlight die passende Sprachinformation nicht
+automatisch anhand der Dateiendung bestimmen. Lediglich einige Skriptsprachen
+werden anhand des Shebangs in der ersten Zeile erkannt.
+Mit der Option --syntax muss dann der Typ der Datei vom Benutzer angegeben
+werden (das Argument ist normalerweise die fuer die Programmiersprache uebliche
+Dateierweiterung).
+Beispiel: Wenn Sie eine Python-Datei konvertieren wollen, muss highlight die
+Sprachdefinition py.lang einlesen. Das korrekte Argument fuer --syntax ist
+also "py".
+
+highlight test.java # Option --syntax nicht noetig
+highlight < test.java --syntax java # --syntax muss angegeben werden
+cat test.java | highlight --syntax java
+
+Sollte es mehrere Dateierweiterungen fuer Dateien einer Programmiersprache
+geben (wie z.B. C, cc, cpp, h bei C++), werden diese in der Datei
+$CONF_DIR/filetypes.conf einer Sprachdefinition zugewiesen.
+
+Wenn mehrere Eingabedateien an Highlight uebergeben werden oder die Option
+--batch-recursive (-B) gesetzt ist, wechselt das Tool in den Batch-Modus.
+In diesem Modus werden die Ausgabedateien unter dem Namen der Eingabedateien
+gespeichert, lediglich die Dateierweiterung des gewaehlten Ausgabeformats
+wird angehangen.
+Die --outdir Option ist im Batch Modus besonders nuetzlich. In Skripten sollte
+--quiet angegeben werden, um die Geschwindigkeit der Verarbeitung zu erhoehen.
+
+
+HTML, TeX, LaTeX und SVG Ausgabe:
+--------------------------------
+
+Die HTML, TeX, LaTeX und SVG-Formate erlauben die Einbindung von externen Dateien,
+welche die Formatierungsinformationen enthalten ("Stylesheet-Dateien").
+
+Bei der HTML- und SVG-Ausgabe enthaelt diese Datei CSS-Definitionen und wird, wenn
+nicht anders angegeben, als "highlight.css" gespeichert.
+
+Bei TeX und LaTeX enthaelt die Datei Makros, und wird per Default als
+"highlight.sty" gespeichert.
+
+Name und Pfad des Stylesheets werden mit --style-outfile bestimmt.
+Wenn --outdir definiert ist, wird auch das Stylesheet im angegebenen
+Ausgabeverzeichnis gespeichert.
+
+Mit --include-style fuegt Highlight die Formatierungsangaben direkt in die
+Ausgabedokumente ein, statt einen Verweis auf externe Stylesheets zu setzen.
+
+Der Verweis auf externe Dateien hat den Vorteil, die Formatierung an einer
+zentralen Stelle zu verwalten, auf die die Ausgabedokumente verweisen.
+
+Wenn UTF-8 Dateien mit LaTeX verabeitet werden sollen, sollte das Paket ucs
+installiert werden.
+
+Mit --style-infile kann eine Datei mit zusaetzlichen Formatierungsangaben in
+die Ausgabedateien eingebunden werden, welche die vorgegebene highlight-
+Formatierung erweitert oder ersetzt.
+
+Beispiel:
+
+/* Inhalt von user.css (fuege Rahmen und Line an der Zeilennummerierung
+hinzu) */
+pre.hl {
+ border-width: 1px;
+ border-style:solid;
+ border-left-color: silver;
+ border-top-color: silver;
+ border-right-color: gray;
+ border-bottom-color: gray;
+ padding: 0.5cm;
+ margin: 2cm;
+}
+.hl.line {
+ /* background-color:#EEEEEE; color:#505050; */
+ border-right:1px solid #555555;
+ font-style:normal;
+ font-weight:normal;
+ padding:1px;
+ text-decoration:none;
+}
+
+Usage: highlight -l --style-infile user.css main.cpp
+
+
+Terminal-Ausgabe:
+--------------------
+
+highlight --ansi <inputfile> | less -R
+highlight --xterm256 <inputfile> | less -R
+
+zeigt farbigen Sourcecode direkt im Terminal an.
+
+Da es nur wenige Farben zur ANSI-Ausgabe im Terminal gibt, existiert nur ein
+hartkodiertes Farbschema fuer --ansi. Daher sollte nach Moeglichkeit --xterm256
+verwendet werden, um eine Ausgabe in 256 Farben zu erhalten. Der 256 Farb-Modus
+wird z.B. von den aktuellen Versionen von xterm, rxvt und Putty untersttzt.
+
+
+Text-Ausgabe:
+-------------
+
+Wird als Sprachdefinition txt angegeben, findet keine Syntaxhervorhebung statt.
+
+Beispiel:
+
+highlight -S txt -L README > readme.tex
+
+
+Beispiele:
+----------
+
+Die folgenden Kommandos schreiben den Inhalt von hello.c nach hello.html:
+
+highlight -o hello.html -i hello.c
+highlight -o hello.html hello.c
+highlight -o hello.html --syntax c < hello.c
+highlight --syntax c < hello.c > hello.html
+
+Neben hello.html wird highlight.css im aktuellen Verzeichnis erzeugt.
+
+highlight -X --batch-recursive '*.cpp' --outdir /home/you/html_code/
+Dieses Kommando konvertiert alle *.cpp Dateien im aktuellen Verzeichnis und den
+Unterverzeichnissen in XHTML-Dateien, und speichert die Ausgabe in
+/home/you/html_code.
+
+highlight hello.c --mark-line="5=Initialize some stuff; 15; 21=Log result"
+Dieses Kommando markiert die Zeilen 5, 15 und 21 in der HTML Ausgabe.
+Die Zeilen 5 und 21 werden einen Tooltip mit den angegebenen Texten anzeigen.
+
+highlight -L * --outdir /home/you/latex_code/
+Dieses Kommando konvertiert alle Dateien in LaTeX, und speichert sie in
+/home/you/latex_code/.
+
+highlight -c stdout -s seashell --print-style
+Dieses Kommando gibt nur die CSS-Informationen des angegebenen Stils (hier:
+Seashell) nach stdout aus.
+
+
+
+5. HIGHLIGHT DATEIFORMAT
+-------------------------------------------------------------------------------
+
+Alle Konfigurationsdateien werden als ASCII-Textdateien gespeichert.
+
+Format: $ParameterName=ParameterWert
+
+ParameterName ist der Bezeichner fuer den Paramter, ParameterWert ist sein Wert.
+Die Bezeichner sind nicht case sensitive.
+Der Wert besteht aus einem Zeichen, einer Liste von Woertern oder einem regulaeren
+Ausdruck.
+Listen koennen in mehrere Zeilen aufgeteilt sein.
+
+Kommentare beginnen mit # als erstem Zeichen der Zeile.
+
+
+
+6. SPRACHDEFINITIONEN
+-------------------------------------------------------------------------------
+
+Eine Sprachdefinition beschreibt die Elemente einer Programmiersprache, die
+durch verschiedene Farben und Schrifttypen hervorgehoben werden.
+Die Datei muss in $HL_DIR/langDefs/ (siehe Abschnitt 1) unter folgendem Namen
+gespeichert werden:
+
+<ueliche Erweiterung der Sourcecodedateien>.lang
+
+Beispiele: PHP -> php.lang, Java -> java.lang
+
+Sollte es mehrere gebrauechliche Erweiterungen geben, werden diese in der Datei
+$HL_DIR/filetypes.conf einer Sprachdefinition zugeordnet.
+
+DATEIFORMAT:
+
+# Regulaerer Ausdruck, der Zahl-Literale beschreibt
+# Default: (?:0x|0X)[0-9a-fA-F]+|\d*[\.]?\d+(?:[eE][\-\+]\\d+)?[lLuU]?
+$DIGIT=regex(<RE>)
+
+# Regulaerer Ausdruck, der gueltige Bezeichner beschreibt
+# Default: [a-zA-Z_]\w*
+$IDENTIFIER=regex(<RE>)
+
+# Liste von Schluesselwoertern, <group> ist der Name der Schluesselwort-Gruppe
+# Die Gruppe muss in dem angewandten Farbschema definiert sein, um eine passende
+# Hervorhebung zu ermoeglichen
+$KEYWORDS(<group>)=<List>
+
+# Regulaerer Ausdruck, der Schluesselwoerter beschreibt.
+# Wenn die Regex mehrere Gruppen enthaelt, kann GROUP-NUM angegeben werden.
+# Dieser Parameter gibt die Nummer der Gruppe an, deren Match als Schluesselwort
+# hervorgehoben werden soll (gezaehlt wird von links nach rechts).
+# Der Capturing-Status der Gruppen spielt bei der Zaehlung keine Rolle.
+# Gueltige Indexwerte: 0 <= GROUP-NUM <= hoechster Gruppen-Index
+# 0 entspricht dem kompletten Match der Regex
+# Wenn GROUP-NUM nicht angegeben ist, wird der Match der hoechsten Gruppen-
+# Nummer ausgewertet.
+$KEYWORDS(<group>)=regex(<RE> <, GROUP-NUM>)
+
+# Liste der Stringbegrenzer
+$STRINGDELIMITERS=<Liste>
+
+# Liste von ungleichen Stringbegrenzern
+$STRING_UNEQUAL=<Beginn Ende>
+
+# Liste der Escapecharacter innerhalb von Strings (normalerweise \)
+$ESCCHAR=<Liste> | regex(<RE>)
+
+# Escapesequenzen ausserhalb von Strings erlauben
+$ALLOWEXTESCAPE=<true|false>
+
+# Praefix, die das Hervorheben von Escapesequenzen in "Raw Strings" verhindert
+$RAWSTRINGPREFIX=<Character>
+
+# Kommentarbeginn und -ende beim mehrzeiligen Kommentar
+# Kommentarende ist optional, wenn $ALLOWNESTEDCOMMENTS false ist
+$ML_COMMENT=<Kommentarbeginn Kommentarende>
+
+# Liste der Bezeichner, die einen einzeiligen Kommentar einleiten
+$SL_COMMENT=<Liste> | regex(<RE>)
+
+# Praefix von Compilerdirektiven
+$DIRECTIVE=<Praefix> | regex(<RE>)
+
+# Character, der eine Compiler-Direktive nach Zeilenumbruch fortsetzt
+$CONTINUATIONSYMBOL=<symbol>
+
+# Sprache kann formatiert werden
+# (nur C-aehnliche Sprachen, die mit astyle (astyle.sf.net) kompatibel sind)
+$REFORMATTING=<true | false>
+
+# Symbole (z.B. Klammern oder Operatoren)
+$SYMBOLS=<Liste>
+
+# Mehrzeilige Kommentare koennen verschachtelt sein
+$ALLOWNESTEDCOMMENTS=<true | false>
+
+# Programmiersprache ist case-sensitive
+$IGNORECASE=<true | false>
+
+# Fuege eine weitere Sprachdefinition ein
+$INCLUDE=<language>
+
+# Definiere die begrenzenden Ausdruecke der eingebetteten Sprache "language".
+# Es kann fuer jede Sprache mehrere Eintraege geben.
+$NESTED(language)=regex(<RE open>) regex(<RE close>)
+
+In der Datei README_REGEX finden Sie detaillierte Informationen zu regulaeren
+Ausdruecken.
+
+Beispiel:
+---------
+
+#Inhalt von pas.lang (Pascal/Objekt Pascal)
+
+$KEYWORDS(kwa)= absolute abstract and array as asm assembler automated begin case
+cdecl class const constructor destructor dispid dispinterface div do downto
+# [...]
+$KEYWORDS(kwb)=boolean char integer pointer real text
+true false cardinal longint byte word single double int64
+$KEYWORDS(kwc)=if else then downto do for repeat while to until with
+$KEYWORDS(kwd)=regex((\w+?)\s*\()
+$STRINGDELIMITERS=" '
+$SL_COMMENT=//
+$ML_COMMENT={ } (* *)
+$IGNORECASE=true
+$SYMBOLS= ( ) [ ] , ; : & | < > ! = / * % + - @
+$ESCCHAR=#
+$ALLOWEXTESCAPE=true
+
+TIP: Wenn Sie neue Sprachdefinitionen testen wollen und diese nicht im
+ Installationsverzeichnis ($HL_DIR) speichern moechten bzw. keine Berechtigung
+ dazu haben, koennen Sie mit --add-data-dir einen zusaetzlichen Suchpfad
+ angeben und die Dateien dort in dem Verzeichnis ./langDefs ablegen.
+
+
+
+7. FARBSTILE
+-------------------------------------------------------------------------------
+
+Farbstile legen die Formatierung der Sprachelemente fest, die in den Sprach-
+definitionen beschrieben wurden.
+
+Die Dateien muessen mit der Endung .style in $HL_DIR/themes (siehe Abschnitt 1)
+gespeichert werden. Mit der --style (-s) Option wird das Farbschema angewandt.
+
+DATEIFORMAT:
+
+<Colour> = #RRGGBB
+
+RR GG BB steht dabei fuer die hexadezimalen Rot/Gruen/Blau-Anteile der
+gewnschten Farbe. Wertebereich: 00 (kein Anteil) - FF (voller Anteil)
+
+<Format> = <bold> <italic> <underline>
+Bold, italic und underline sind optional und koennen kombiniert werden.
+
+# Default-Textfarbe
+$DEFAULTCOLOUR=<Colour>
+
+# Hintergrundfarbe
+$BGCOLOUR=<Colour>
+
+# Schriftgroesse
+$FONTSIZE=<number>
+
+# Formatierung von Schluesselwoertern, die zu der gleichnamigen Gruppe gehoeren
+$KW-GROUP(<group>)=<Colour> <Format>
+
+# Formatierung von Zahlen
+$NUMBER=<Colour> <Format>
+
+# Formatierung von Escape Charactern
+$ESCAPECHAR=<Colour> <Format>
+
+# Formatierung von Strings
+$STRING=<Colour> <Format>
+
+# Formatierung von Kommentaren
+$COMMENT=<Colour> <Format>
+
+# Formatierung von einzeiligen Kommentaren (optional, sonst wie $COMMENT)
+$SL-COMMENT=<Colour> <Format>
+
+# Formatierung von Compilerdirektiven
+$DIRECTIVE=<Colour> <Format>
+
+# Formatierung von Strings innerhalb von Compilerdirektiven
+$STRING-DIRECTIVE=<Colour> <Format>
+
+# Formatierung von Symbolen (Klammern etc) (optional, sonst wie $DEFAULTCOLOR)
+$SYMBOL=<Colour> <Format>
+
+# Formatierung von Zeilennummern
+$LINE=<Colour> <Format>
+
+# Hintergrundfarbe von markierten Zeilen
+$MARK-LINE=<Colour>
+
+
+Beispiel:
+
+# golden.style
+$DEFAULTCOLOUR=#ddbb00
+$BGCOLOUR=#000000
+$FONTSIZE=10
+$KW-GROUP(kwa)=#ffed8a bold
+$KW-GROUP(kwb)=#ffed8a
+$KW-GROUP(kwc)=#dedede bold
+$KW-GROUP(kwd)=#ddbb00 bold
+$NUMBER=#ffffff
+$ESCAPECHAR=#ff0000
+$STRING=#ff0000
+$STRING-DIRECTIVE=#ff0000
+$COMMENT=#978345 italic
+$DIRECTIVE=#ffddaa
+$LINE=#898989
+$SYMBOL=#ababab
+$MARK-LINE=#404040
+
+
+
+8. SCHLUESSELWORTGRUPPEN
+-------------------------------------------------------------------------------
+
+Sie koennen mehrere Schluesselwort-Gruppen festlegen und jeder Gruppe eine eigene
+Formatierung zuweisen. Das ist nuetzlich wenn Sie z.B. Bibliotheksfunktionen,
+Makros oder Konstanten gesondert hervorheben moechten.
+
+Eine Gruppe wird in zwei Schritten definiert:
+
+ 1. Die Schluesselwort-Gruppe wird mit folgendem Parameter in der
+ Sprachdefinition festgelegt:
+
+ $KEYWORDS(group)
+
+ Das group-Attribut ist der Bezeichner der neuen Schluesselwort-Gruppe.
+ Sie koennen Bezeichner mehrmals verwenden.
+
+ 2. Der Gruppe eine Formatierung im gewuenschten Farbschema zuweisen:
+
+ $KW-GROUP(group) = #RRGGBB <bold> <italic> <underline>
+
+Beachten Sie, dass jeder Gruppenname, der in einer Sprachdefinition aufgelistet
+ist, auch im verwendeten Farbschema definiert sein sollte.
+Die Klassen "kwa"-"kwd" sind in allen mitgelieferten Farbschemen vordefiniert.
+
+Beispiel:
+
+# Some language definition with new group "debug"...
+$KEYWORDS(kwa)=for repeat while [...]
+$KEYWORDS(debug)=ASSERT DEBUG
+$ML_COMMENT=/* */
+# ...
+
+# Some colour theme...
+$KW-GROUP(kwa)=#ddbb00 bold
+$KW-GROUP(debug)=#ff0000 bold
+$COMMENT=#978345 italic
+# ...
+
+
+
+9. EINGEBETTETE AUSGABEANWEISUNGEN
+-------------------------------------------------------------------------------
+
+Wenn highlight innerhalb eines Zeilenkommentars der Eingabedatei die
+Zeichenfolge @highlight findet, wird der Inhalt der Zeile wie folgt behandelt:
+Die Daten hinter @highlight werden in die Ausgabe kopiert, ohne Symbole des
+Ausgabeformats zu maskieren. So koennen HTML Tags oder LaTeX Kommandos eingesetzt
+werden, ohne externe Skripte einsetzen zu muessen. Ausserdem koennen mit folgenden
+Variablen Zusatzinformationen ausgegeben werden:
+
+$infile: Pfad Eingabedatei
+$outfile: Pfad Ausgabedatei
+$font-face: Fontname
+$font-size: Schriftgroesse
+$theme: Pfad Themedatei
+$title: Titel des Dokuments
+$encoding: Encoding
+$linenum: Zeilennummer
+$nl: Zeilenumbruch
+
+Die Kommentarzeile wird nicht als Kommentar hervorgehoben ausgegeben, und der
+Zeilenzaehler wird nicht erhoeht.
+Eingebettete Anweisungen werden nur in einzeiligen Kommentaren erkannt, nicht
+in mehrzeiligen Kommentaren.
+
+Beispiel:
+
+Die folgende Kommentarzeile ist in main.cpp enthalten:
+
+//@highlight <h1>$title</h1><br>Filename: $infile $nl
+
+highlight main.cpp --doc-title=Masterpiece
+
+Dieses Kommando erzeugt folgende HTML Ausgabe:
+
+<h1>Masterpiece</h1><br>Filename: main.cpp
+
+
+
+10. KONFIGURATIONSDATEI:
+-------------------------------------------------------------------------------
+
+Die Konfigurationdatei wird unter folgendem Pfad gespeichert:
+
+UNIX: $HOME/.highlightrc
+W32 : <Pfad der highlight.exe>\highlight.conf
+
+Die Optionen der Datei entsprechen den gleichnamigen langen Kommandozeilen-
+optionen. Flags (Optionen ohne Parameter) erwarten true oder false als Wert.
+
+
+Beispiel:
+
+$style=emacs
+$linenumbers=true
+$style-outfile=format.css
+$reformat=gnu
+
+
+
+11. FORTGESCHRITTENE OPTIONEN
+-------------------------------------------------------------------------------
+
+Exuberant Ctags Informationen hinzufuegen
+
+Die HTML-Ausgabe kann um beschreibende Tooltips mit ctags Daten erweitert werden:
+ctags *.*
+highlight --ctags-file *.cpp
+
+Der Default-Parameter von ctags-file ist "tags", daher konnte er im obigen
+Beispiel weggelassen werden.
+Dises Kommando fuegt den Typ, den Namespace und den Pfad zur Definition des
+erkannten Tokens hinzu.
+Beispiel: "member | class:highlight::HtmlGenerator | htmlgenerator.h"
+
+
+Markierung von Zeilen
+
+Bei der HTML-Ausgabe können einzelne Zeilen durch eine andere Hintergrundfarbe
+hervorgehoben werden. Ein Tooltip kann erklaerende Informationen zu diesem Code-
+Abschnitt anzeigen.
+
+highlight --mark-line='3;10,21' -l main.cpp
+Dieses Kommando markiert die Zeilen 3, 10 und 21.
+
+highlight --mark-line='5;10=Getter and setter definitions' -l main.cpp
+Dieses Kommando markiert die Zeilen 5 und 10. Zeile 10 enthaelt zudem einen
+Tooltip mit dem Inhalt "Getter and setter definitions".
+
+
+Parsen von Binaerdaten vermeiden
+
+Wenn highlight mit einer unbestimmten Menge von Eingabedaten aufgerufen wird,
+kann die Verarbeitung von binaeren Daten mit --validate-input verhindert werden.
+Dieser Schalter fuehrt zu einem Vergleich der Datei-Haeder mit einer Liste von
+"Magic Numbers". Wenn ein Binaer-Typ erkannt wird, bricht highlight die
+Verarbeitungmit einer Fehlermeldung ab.
+
+
+Hervorbung von eingebettetem Code ohne oeffnenden Delimiter
+
+Wenn eine Datei mit eingebettetem Code ohne den einleitenden Delimiter beginnt,
+kann mit der --start-nested Option in diese Sprache gewechselt werden.
+Dies kann bei LuaTeX Dateien passieren:
+highlight luatex.tex --latex -t4 -semacs --start-nested=inc_luatex
+
+Die inc_luatex Definition ist eine Lua-Beschreibung mit TeX Kommentaren.
+Beachten Sie, dass die Code-Sektion mit dem in der Host-Beschreibung
+aufgelisteten End-Delimiter abgeschlossen werden muss.
+
+
+
+12. PLUGINS
+-------------------------------------------------------------------------------
+
+Im /examples Unterverzeichnis der highlight Installation befinden sich einige
+Plugins, die Highlight in Webanwendungen integrieren:
+
+-DokuWiki
+-MovableType
+-Wordpress
+-Serendipity
+
+
+
+13. SWIG SCHNITTSTELLE
+-------------------------------------------------------------------------------
+
+Eine SWIG Interface-Datei befindet sich in /examples/swig.
+Installationshinweise finden Sie in README_SWIG, Programmierbeispiele in
+den vorhandenen Skripten.
+
+
+
+14. GNU SOURCE-HIGHLIGHT KOMPATIBILITAET
+-------------------------------------------------------------------------------
+
+Die Kommandozeilenschnittstelle ueberschneidet sich zu einem grossen Teil mit
+source-highlight (http://www.gnu.org/software/src-highlite/).
+
+Diese highlight-Optionen haben dieselbe Bedeutung wie bei source-highlight:
+ --input, --output, --help, --version, --out-format, --title, --data-dir,
+ --verbose, --quiet, --ctags-file
+
+Diese Optionen wurden hinzugefuegt, um die Kompatibilitaet zu verbessern:
+ --css, --doc, --failsafe, --line-number, --line-number-ref, --no-doc, --tab,
+ --output-dir, --src-lang
+
+Die obigen Optionen bilden eine gemeinsame Highlighter-Schnittstelle fuer
+Skripte, Plugins etc.
+
+
+
+15. KONTAKT
+-------------------------------------------------------------------------------
+Andre Simon
+andre.simon1@gmx.de
+as@andre-simon.de
+http://www.andre-simon.de
+http://wiki.andre-simon.de/
+
+Wegen wiederholtem Spamming ist das Wiki passwortgeschuetzt.
+Der Zugang lautet: user, Password h1gHL1te
diff --git a/support/highlight/README_LANGLIST b/support/highlight/README_LANGLIST
new file mode 100644
index 0000000000..c68d072c04
--- /dev/null
+++ b/support/highlight/README_LANGLIST
@@ -0,0 +1,172 @@
+-------------------------------------------------------------------------------
+--- HIGHLIGHT LANGUAGE LIST --------------------------------- October 2009 ---
+-------------------------------------------------------------------------------
+
+All supported languages and the syntax definition file names are listed below.
+The parens contain filename extensions configured in filetypes.conf.
+By default, the *.lang files are located in /usr/share/highlight/langDefs/.
+
+Since release 2.12, it is possible to highlight source files with multiple
+languages (ie HTML+PHP), see the NESTED instruction in README.
+
+Installed language definitions (located in /usr/share/highlight/langDefs/):
+
+Informix : 4gl
+ASCEND : a4c
+ABAP/4 : abp
+ABNF : abnf
+ADA95 : ada ( a adb ads gnad )
+Agda : agda
+AutoHotKeys : ahk
+AMPL : ampl ( dat run )
+AMTrix : amtrix ( hnd s4 s4h s4t t4 )
+AppleScript : applescript
+Arc : arc
+ARM : arm
+Action Script : as
+Assembler : asm ( 29k 68s 68x a51 x68 )
+ASP : asp ( asa )
+Abstract : aspect ( was wud )
+Applied Type System : ats ( dats )
+AutoIt : au3
+Avenue : avenue
+(G)AWK : awk
+DOS Batch : bat ( cmd )
+Blitz Basic : bb
+BibTeX : bib
+BM Script : bms
+BNF : bnf
+Boo : boo
+C and C++ : c ( c++ cc cpp cxx h hh hpp hxx )
+ClearBasic : cb
+ColdFusion MX : cfc ( cfm )
+CHILL : chl
+Clipper : clipper
+Clojure : clojure
+Clips : clp
+COBOL : cob ( cbl )
+C# : cs
+CSS : css
+D : d
+Diff : diff ( patch )
+Graphviz : dot
+Dylan : dylan
+Eiffel : e ( se )
+EBNF : ebnf
+Erlang : erl ( hrl )
+Euphoria : euphoria ( eu ew ex exu exw )
+Express : exp
+Fortran 77 : f77 ( f for ftn )
+Fortran 90 : f90 ( f95 )
+Felix : flx
+Frink : frink
+F# : fs ( fsx )
+Go : go
+Haskell : haskell ( hs )
+Hecl : hcl
+HTML : html ( htm xhtml )
+Apache Config : httpd
+haXe : hx
+Clean : icl
+Icon : icn
+IDL : idl
+Interactive Data Language: idlang
+INTERLIS : ili
+Lua (for LuaTeX) : inc_luatex
+INI : ini
+FAME : inp
+IO : io
+Inno Setup : iss
+Jasmin : j
+Java : java ( groovy grv )
+Javascript : js
+JSP : jsp
+Luban : lbn
+LDAP : ldif
+Logtalk : lgt
+Haskell LHS : lhs
+Lisp : lisp ( cl clisp el lsp sbcl )
+Lotos : lotos
+Lotus : ls
+Linden Script : lsl
+Lua : lua
+Lilypond : ly
+Matlab : m
+Make : make ( mak mk )
+Maya : mel
+Mercury : mercury
+SNMP : mib ( smi )
+Miranda : miranda
+Objective Caml : ml ( mli ocaml )
+Modelica : mo
+Modula2 : mod2 ( mod def )
+Modula3 : mod3 ( m3 i3 )
+Maple : mpl
+MaxScript : ms
+MSSQL : mssql
+Nemerle : n
+Nasal : nas
+NBC : nbc
+Nice : nice
+NetRexx : nrx
+NSIS : nsi
+Squirrel : nut
+NXC : nxc
+Oberon : oberon ( ooc )
+Objective C : objc
+Octave : octave
+Open Object Rexx : oorexx
+Object Script : os
+Oz : oz
+Pascal : pas
+PHP : php ( php3 php4 php5 php6 )
+Pike : pike ( pmod )
+Perl : pl ( cgi perl plex plx pm )
+PL/1 : pl1 ( bdy ff fp fpp rpp sf sp spb spe spp sps wf wp wpb wpp wps )
+POV-Ray : pov
+Prolog : pro
+Progress : progress ( i p w )
+PostScript : ps
+Pure : pure
+Microsoft PowerShell: ps1
+PATROL : psl
+Python : py
+Pyrex : pyx
+Qore : q
+QMake Project : qmake
+Qu : qu
+R : r
+Ruby : rb ( pp rjs ruby )
+Rebol : rebol
+Rexx : rexx ( rex rx the )
+Relax NG : rnc
+PowerPC Assembler : s
+SAS : sas
+Paradox : sc
+Scala : scala
+Scilab : scilab
+Bash : sh ( bash ebuild eclass )
+SMALL : sma
+Smalltalk : smalltalk ( gst sq st )
+Standard ML : sml
+SNOBOL : sno
+RPM Spec : spec
+SPIN SQL : spn
+PL/SQL : sql
+Sybase SQL : sybase
+Tcl/Tk : tcl ( itcl wish )
+TCSH : tcsh
+Regex tests : test_re
+TeX and LaTeX : tex ( cls sty )
+TTCN3 : ttcn3
+Plain text : txt
+Vala : vala
+Visual Basic : vb ( bas basic bi vbs )
+Verilog : verilog ( v )
+VHDL : vhd
+XML : xml ( dtd ecf ent hdr hub jnlp nrm sgm sgml svg tld vxml wml xsl )
+SuperX++ : xpp
+Bison : y
+Zonnon : znn
+
+Use the name of the desired language with the --syntax option.
diff --git a/support/highlight/README_REGEX b/support/highlight/README_REGEX
new file mode 100644
index 0000000000..cf7b7e1436
--- /dev/null
+++ b/support/highlight/README_REGEX
@@ -0,0 +1,247 @@
+-------------------------------------------------------------------------------
+--- REGULAR EXPRESSIONS MANUAL -----------------------------------------------
+-------------------------------------------------------------------------------
+
+This file is based on the original API documentation of Jeffery Stuart's
+Pattern class.
+
+-------------------------------------------------------------------------------
+
+You can use regular expressions in highlight language definitions.
+Note that the expression has to be defined as regex(<RE> <, GRUP-NUM>), where
+RE is the regex string, and GROUP-NUM is an optional parameter which defines
+the group number whose match should be returned.
+
+See README which definition parameters support regular expressions.
+
+
+Content:
+--------
+
+- Regex rules
+- Backslashes, escapes, and quoting
+- Character Classes
+- Groups and capturing
+- Examples
+
+-------------------------------------------------------------------------------
+
+
+Regex rules:
+------------
+
+Construct Matches
+
+Characters
+
+x The character x
+\\ The character \
+\0nn The character with octal ASCII value nn
+\0nnn The character with octal ASCII value nnn
+\xhh The character with hexadecimal ASCII value hh
+\t A tab character
+\r A carriage return character
+\n A new-line character
+
+
+Character Classes
+
+[abc] Either a, b, or c
+[^abc] Any character but a, b, or c
+[a-zA-Z] Any character ranging from a thru z, or A thru Z
+[^a-zA-Z] Any character except those ranging from a thru z, or A thru Z
+[a\-z] Either a, -, or z
+[a-z[A-Z]] Same as [a-zA-Z]
+[a-z&&[g-i]] Any character in the intersection of a-z and g-i
+[a-z&&[^g-i]] Any character in a-z and not in g-i
+
+
+Predefined character classes
+
+. Any character. Multiline matching must be compiled into the
+ pattern for . to match a \r or a \n. Even if multiline matching
+ is enabled, . will not match a \r\n, only a \r or a \n.
+\d [0-9]
+\D [^\d]
+\s [ \t\r\n\x0B]
+\S [^\s]
+\w [a-zA-Z0-9_]
+\W [^\w]
+
+
+POSIX character classes
+
+\p{Lower} [a-z]
+\p{Upper} [A-Z]
+\p{ASCII} [\x00-\x7F]
+\p{Alpha} [a-zA-Z]
+\p{Digit} [0-9]
+\p{Alnum} [\w&&[^_]]
+\p{Punct} [!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~]
+\p{XDigit} [a-fA-F0-9]
+
+
+Boundary Matches
+
+^ The beginning of a line. Also matches the beginning of input.
+$ The end of a line. Also matches the end of input.
+\b A word boundary
+\B A non word boundary
+\A The beginning of input
+\G The end of the previous match. Ensures that a "next" match will
+ only happen if it begins with the character immediately
+ following the end of the "current" match.
+\Z The end of input. Will also match if there is a single trailing
+ \r\n, a single trailing \r, or a single trailing \n.
+\z The end of input
+
+
+Greedy Quantifiers
+
+x? x, either zero times or one time
+x* x, zero or more times
+x+ x, one or more times
+x{n} x, exactly n times
+x{n,} x, at least n times
+x{,m} x, at most m times
+x{n,m} x, at least n times and at most m times
+
+
+Possessive Quantifiers
+
+x?+ x, either zero times or one time
+x*+ x, zero or more times
+x++ x, one or more times
+x{n}+ x, exactly n times
+x{n,}+ x, at least n times
+x{,m}+ x, at most m times
+x{n,m}+ x, at least n times and at most m times
+
+
+Reluctant Quantifiers
+
+x?? x, either zero times or one time
+x*? x, zero or more times
+x+? x, one or more times
+x{n}? x, exactly n times
+x{n,}? x, at least n times
+x{,m}? x, at most m times
+x{n,m}? x, at least n times and at most m times
+
+
+Operators
+
+xy x then y
+x|y x or y
+(x) x as a capturing group
+
+
+Quoting
+
+\Q Nothing, but treat every character (including \s) literally
+ until a matching \E
+\E Nothing, but ends its matching \Q
+
+Special Constructs
+
+(?:x) x, but not as a capturing group
+(?=x) x, via positive lookahead. This means that the expression will
+ match only if it is trailed by x. It will not "eat" any of the
+ characters matched by x.
+(?!x) x, via negative lookahead. This means that the expression will
+ match only if it is not trailed by x. It will not "eat" any of
+ the characters matched by x.
+(?<=x) x, via positive lookbehind. x cannot contain any quantifiers.
+(?x) x, via negative lookbehind. x cannot contain any quantifiers.
+(?>x) x{1}+
+
+
+
+Backslashes, escapes, and quoting:
+----------------------------------
+
+The backslash character ('\') serves to introduce escaped constructs, as defined
+in the table above, as well as to quote characters that otherwise would be
+interpreted as unescaped constructs. Thus the expression \\ matches a single
+backslash and \{ matches a left brace.
+
+It is an error to use a backslash prior to any alphabetic character that does
+not denote an escaped construct; these are reserved for future extensions to the
+regular-expression language. A backslash may be used prior to a non-alphabetic
+character regardless of whether that character is part of an unescaped
+construct.
+
+It is necessary to double backslashes in string literals that represent regular
+expressions to protect them from interpretation by a compiler. The string
+literal "\b", for example, matches a single backspace character when interpreted
+as a regular expression, while "\\b" matches a word boundary. The string litera
+"\(hello\)" is illegal and leads to a compile-time error; in order to match the
+string (hello) the string literal "\\(hello\\)" must be used.
+
+
+Character Classes:
+------------------
+
+Character classes may appear within other character classes, and may be composed
+by the union operator (implicit) and the intersection operator (&&). The union
+operator denotes a class that contains every character that is in at least one
+of its operand classes. The intersection operator denotes a class that contains
+every character that is in both of its operand classes.
+
+The precedence of character-class operators is as follows, from highest to
+lowest:
+
+ 1 Literal escape \x
+ 2 Range a-z
+ 3 Grouping [...]
+ 4 Intersection [a-z&&[aeiou]]
+ 5 Union [a-e][i-u]
+
+Note that a different set of metacharacters are in effect inside a character
+class than outside a character class. For instance, the regular expression .
+loses its special meaning inside a character class, while the expression -
+becomes a range forming metacharacter.
+
+
+Groups and capturing:
+---------------------
+
+Capturing groups are numbered by counting their opening parentheses from left to
+right. In the expression ((A)(B(C))), for example, there are four such groups:
+
+ 1 ((A)(B(C)))
+ 2 (A)
+ 3 (B(C))
+ 4 (C)
+
+Group zero always stands for the entire expression. Note that highlight will
+only evaluate the highest group number to make regular expressions more suitable
+for language definitions. Use (?:) syntax to avoid a capture of the new group.
+
+
+Examples:
+---------
+
+$KEYWORDS(kwa)=regex([A-Z]\w+)
+Highlight identifiers beginning with a capital letter.
+
+$KEYWORDS(kwb)=regex([$@%]\w+)
+Highlight variables beginning with $, @ or %.
+
+$KEYWORDS(kwc)=regex(\$\{(\w+)\})
+or
+$KEYWORDS(kwc)=regex(\$\{(\w+)\}, 1)
+Highlight variable names like ${name}. Only the name is highlighted as keyword.
+The grouping feature is used to achieve this effect. If no capturing group
+index is defined (like in the first example above), the right-most group's match
+(highest capturing index) is returned.
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+Highlight method names. Note that grouping is used again.
+
+
+---
+Andre Simon
+andre.simon1@gmx.de
+http://www.andre-simon.de/
+http://wiki.andre-simon.de/
diff --git a/support/highlight/TODO b/support/highlight/TODO
new file mode 100644
index 0000000000..de0e24409e
--- /dev/null
+++ b/support/highlight/TODO
@@ -0,0 +1,4 @@
+Planned for future releases:
+
+-add localization support for command line interface (gettext)
+-add scripting capabilities to the language definitions (ie integrate Lua in highlight)
diff --git a/support/highlight/examples/highlight_pipe.php b/support/highlight/examples/highlight_pipe.php
new file mode 100644
index 0000000000..0e0f690bf5
--- /dev/null
+++ b/support/highlight/examples/highlight_pipe.php
@@ -0,0 +1,170 @@
+<?php
+
+/**This PHP class serves as interface to the highlight utility.
+Input and output streams are handled with pipes.
+Command line parameters are validated before use.
+*/
+
+class HighlightPipe {
+
+ // alter these members to control highlight output
+ // see manpage for the options
+
+ var $hl_option = array(
+ 'hl_bin' => 'highlight', // configure path of highlight binary
+ 'syntax' => 'txt',
+ 'theme' => 'kwrite',
+ 'force' => 1,
+ 'linenumbers' => 0,
+ 'line-number-length' => 4,
+ 'line-number-start' => 0,
+ 'zeroes' => 0,
+ 'wraptype' => 0,
+ 'line-length' => 0,
+ 'reformat' => '',
+ 'kw-case' => '',
+ 'replace-tabs' => 0,
+ 'encoding' => '',
+ 'enclose-pre' => 1,
+ 'inline-css' => 1,
+ 'fragment' => 1,
+ );
+
+ // this member contains the input source code
+ var $input='';
+
+ // this member will contain the command string after getResult() was called
+ var $hl_cmd_str='';
+
+ function getInfo(){
+ return array(
+ 'author' => 'Andre Simon',
+ 'email' => 'andre.simon1@gmx.de',
+ 'date' => '2008-02-20',
+ 'url' => 'http://www.andre-simon.de/',
+ 'version' => '1.1',
+ );
+ }
+
+ // call this method to generate highlighted HTML code
+ function getResult() {
+
+ foreach ($this->hl_option as $key => $value) {
+ $this->hl_option[$key] = $this->validate( $value );
+ }
+
+ $descriptorspec = array(
+ 0 => array("pipe", "r"),
+ 1 => array("pipe", "w")
+ );
+
+ $this->hl_cmd_str = $this->hl_option['hl_bin'];
+
+ if ($this->hl_option['linenumbers']){
+ $this->hl_cmd_str .= " -l -m 1";
+ /*$this->hl_cmd_str .= $this->get_config('hl_linenumbersberstart');*/
+ if ($this->hl_option['zeroes']){
+ $this->hl_cmd_str .= " -z ";
+ }
+ if ($this->hl_option['line-number-length']!='0' && is_numeric($this->hl_option['line-number-length'])) {
+ $this->hl_cmd_str .= ' -j ';
+ $this->hl_cmd_str .=$this->hl_option['line-number-length'];
+ }
+ }
+
+ if (is_numeric($this->hl_option['replace-tabs']) and $this->hl_option['replace-tabs']>0) {
+ $this->hl_cmd_str .= " -t ";
+ $this->hl_cmd_str .= $this->hl_option['replace-tabs'];
+ }
+
+ if ($this->hl_option['wraptype']>0){
+ $this->hl_cmd_str .= ($this->hl_option['wraptype'] == 1)? ' -V ':' -W ';
+ if ($this->hl_option['line-length']>0 && is_numeric($this->hl_option['line-length'])) {
+ $this->hl_cmd_str .= " -J ";
+ $this->hl_cmd_str .= $this->hl_option['line-length'];
+ }
+ }
+
+ if (strlen($this->hl_option['reformat'])>1){
+ $this->hl_cmd_str .= " -F ";
+ $this->hl_cmd_str .= $this->hl_option['reformat'];
+ }
+
+ if (strlen($this->hl_option['kw-case'])>1){
+ $this->hl_cmd_str .= " --kw-case ";
+ $this->hl_cmd_str .= $this->hl_option['kw-case'];
+ }
+
+ if ($this->hl_option['force']){
+ $this->hl_cmd_str .= " --force ";
+ }
+
+ if ($this->hl_option['inline-css']){
+ $this->hl_cmd_str .= " --inline-css ";
+ }
+
+ if ($this->hl_option['fragment']){
+ $this->hl_cmd_str .= " -f ";
+ }
+
+ if ($this->hl_option['theme']){
+ $this->hl_cmd_str .= " -s ";
+ $this->hl_cmd_str .= $this->hl_option['theme'];
+ }
+
+ if ($this->hl_option['encoding']){
+ $this->hl_cmd_str .= " -u ";
+ $this->hl_cmd_str .= $this->hl_option['encoding'];
+ }
+
+ if ($this->hl_option['enclose-pre']){
+ $this->hl_cmd_str .= " --enclose-pre ";
+ }
+
+ $this->hl_cmd_str .= " -S ";
+ $this->hl_cmd_str .= $this->hl_option['syntax'];
+
+ $process = proc_open($this->hl_cmd_str, $descriptorspec, $pipes);
+ if (is_resource($process)) {
+
+ fwrite($pipes[0], $this->input);
+ fclose($pipes[0]);
+
+ $output = stream_get_contents($pipes[1]);
+ fclose($pipes[1]);
+
+ // It is important that you close any pipes before calling
+ // proc_close in order to avoid a deadlock
+ proc_close($process);
+ }
+ return $output;
+ }
+
+
+ // PRIVATE STUFF
+ var $special = array(' ', '/','!','&','*','\\', '.', '|', '´','\'', '<', '>');
+
+ function validate($string) {
+ return (strlen($string)>50)? "" : str_replace($this->special,"",$string);
+ }
+
+ }
+
+/*****************************************************************************/
+
+/*
+
+// Sample code:
+
+ $generator = new HighlightPipe;
+ $generator->input='int main () { return 0; }';
+
+ $generator->hl_option['theme']='neon';
+ $generator->hl_option['syntax']='c';
+
+ $result= $generator->getResult();
+
+ print $result;
+*/
+
+?> \ No newline at end of file
diff --git a/support/highlight/examples/highlight_pipe.pm b/support/highlight/examples/highlight_pipe.pm
new file mode 100644
index 0000000000..6435501b5b
--- /dev/null
+++ b/support/highlight/examples/highlight_pipe.pm
@@ -0,0 +1,65 @@
+package highlight_pipe;
+
+# This Perl package serves as interface to the highlight utility.
+# Input and output streams are handled with pipes.
+# Command line parameter length is validated before use.
+
+use IPC::Open3;
+
+my $hl_bin='highlight';
+
+sub new {
+ my $object = shift;
+ my $ref = {};
+ bless($ref,$object);
+ return($ref);
+}
+
+sub getResult {
+ my $object = shift;
+ my $src = shift;
+
+ my @hl_args = ();
+ my $option;
+ while ( my ($key, $value) = each(%$object) ) {
+ $option =" --$key";
+ if ($value ne "1") {$option .= "=$value"};
+ if (length($option)<50) { push (@hl_args, $option); }
+ }
+ local(*HIS_IN, *HIS_OUT, *HIS_ERR);
+
+ my $childpid = IPC::Open3::open3(\*HIS_IN, \*HIS_OUT, \*HIS_ERR, $hl_bin. join ' ', @hl_args)
+ or die ("error invoking highlight");
+
+ print HIS_IN $src;
+ close(HIS_IN); # Give end of file to kid.
+
+ my @outlines = <HIS_OUT>; # Read till EOF.
+ my @errlines = <HIS_ERR>; # Read till EOF.
+ close HIS_OUT;
+ close HIS_ERR;
+ waitpid($childpid, 0);
+
+ if (@errlines) { die (join '\n', @errlines); }
+
+ return join '', @outlines;
+}
+
+###############################################################################
+# Sample code:
+
+# insert use statement in other perl scripts:
+#use highlight_pipe;
+
+my $html = highlight_pipe -> new();
+
+$html->{'syntax'} ='c';
+$html->{'fragment'} = 1;
+$html->{'inline-css'} = 1;
+$html->{'enclose-pre'} = 1;
+$html->{'style'} = 'vim';
+
+my $input='int main () { return 0; }';
+my $output=$html->getResult($input);
+
+print "Result:\n$output\n";
diff --git a/support/highlight/examples/highlight_pipe.py b/support/highlight/examples/highlight_pipe.py
new file mode 100644
index 0000000000..b9132a91bc
--- /dev/null
+++ b/support/highlight/examples/highlight_pipe.py
@@ -0,0 +1,46 @@
+from subprocess import *
+
+class HighlightPipe:
+ """ This Python package serves as interface to the highlight utility.
+ Input and output streams are handled with pipes.
+ Command line parameter length is validated before use."""
+
+ def __init__(self):
+ self.cmd = 'highlight'
+ self.src=''
+ self.options=dict()
+ self.success=False
+
+ def getResult(self):
+ cmd = self.cmd
+ for k, v in self.options.iteritems():
+ option=" --%s" % k
+ if ( v != '1'): option += "=%s" % v
+ if (len(option)<50): cmd += option
+ p = Popen(cmd, shell=True, bufsize=512, stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=True)
+ (child_stdin, child_stdout, child_stderr) = (p.stdin, p.stdout, p.stderr)
+
+ child_stdin.write(self.src)
+ child_stdin.close()
+ err_msg = child_stderr.readlines()
+ if (len(err_msg)>0): return err_msg
+ self.success=True
+ return child_stdout.readlines()
+
+
+###############################################################################
+
+def main():
+ gen = HighlightPipe();
+ gen.options['syntax'] = 'c'
+ gen.options['style'] = 'vim'
+ gen.options['enclose-pre'] = '1'
+ gen.options['fragment'] = '1'
+ gen.options['inline-css'] = '1'
+ gen.src = 'int main ()\n{ return 0; }'
+
+ print gen.getResult()
+ if not gen.success: print "Execution failed."
+
+if __name__=="__main__":
+ main()
diff --git a/support/highlight/examples/plugins/dokuwiki/syntax.php b/support/highlight/examples/plugins/dokuwiki/syntax.php
new file mode 100644
index 0000000000..b47e8fabde
--- /dev/null
+++ b/support/highlight/examples/plugins/dokuwiki/syntax.php
@@ -0,0 +1,242 @@
+<?php
+/*
+Plugin Name: Highlight
+Plugin URI: http://www.andre-simon.de
+Description: Plugin which uses the highlight utility to generate coloured source code
+Author: André Simon
+Version: 1.2
+Author URI: http://www.andre-simon.de
+
+
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+/*
+== Description ==
+
+The highlight utility converts source code of 120 programming languages to HTML
+with syntax highlighting. This plugin pipes the content of <highlight>-Tags associated
+with a lang parameter to highlight, and returns the output code which is included
+in the Wiki page.
+
+Usage:
+
+Paste the following in the edit section of the wiki editing form:
+
+<highlight cpp>#include <stdio.h>
+
+int main (void){
+ printf("This is some random code");
+ return 0;
+}</highlight>
+
+Use the lang parameter to define the programming language (c, php, py, xml, etc).
+See the highlight documentation to learn all possible languages.
+See the syntax.php file for some formatting options (line numbering, code
+indentation, line wrapping etc).
+
+== Installation ==
+
+1. Install highlight (www.andre-simon.de) on your host
+2. Unzip the dokuwiki_highlight.zip file and upload the content to the
+ `lib/plugins/` directory
+ */
+
+if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/');
+if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
+require_once(DOKU_PLUGIN.'syntax.php');
+
+class syntax_plugin_highlight extends DokuWiki_Syntax_Plugin {
+
+ function getInfo(){
+ return array(
+ 'author' => 'Andre Simon',
+ 'email' => 'andre.simon1@gmx.de',
+ 'date' => '2007-05-29',
+ 'name' => 'Highlight Plugin',
+ 'desc' => 'Plugin which uses the highlight utility (http://www.andre-simon.de) instead of Geshi for source code highlighting',
+ 'url' => 'http://wiki.splitbrain.org/wiki:plugins',
+ );
+ }
+
+ /**
+ * What kind of syntax are we?
+ */
+ function getType(){
+ return 'formatting';
+ }
+
+ /**
+ * What kind of syntax do we allow (optional)
+ */
+// function getAllowedTypes() {
+// return array();
+// }
+
+ /**
+ * What about paragraphs? (optional)
+ */
+ function getPType(){
+ return 'block';
+ }
+
+ /**
+ * Where to sort in?
+ */
+ function getSort(){
+ return 199;
+ }
+
+
+ /**
+ * Connect pattern to lexer
+ */
+ function connectTo($mode) {
+ $this->Lexer->addEntryPattern('<highlight(?=[^\r\n]*?>.*?</highlight>)',$mode,'plugin_highlight');
+ }
+
+ function postConnect() {
+ $this->Lexer->addExitPattern('</highlight>','plugin_highlight');
+ }
+
+ /**
+ * Handle the match
+ */
+ function handle($match, $state, $pos, &$handler){
+
+ switch ($state) {
+ case DOKU_LEXER_ENTER :
+ break;
+ case DOKU_LEXER_UNMATCHED :
+ list($lang, $content) = preg_split('/>/u',$match,2);
+ $lang = trim($lang);
+ return array($state, $lang, $content);
+
+ case DOKU_LEXER_EXIT :
+ break;
+ }
+ return array();
+ }
+
+ /**
+ * Create output
+ */
+ function render($mode, &$renderer, $data) {
+ // Highlight options:
+ $hl_options=array();
+ $hl_options['hl_binary']='/highlight'; // path to the highlight binary
+ $hl_options['linenumbers']=false;
+ $hl_options['theme']='kwrite'; // set color theme
+ $hl_options['linenumber-start']=1;
+ $hl_options['linenumber-zeroes']=1; // set to 1 if line numbers should be padded with zeros
+ $hl_options['linenumber-length']=2;
+ $hl_options['reformat-style']="gnu"; // possible values for C, C++ and Java Code: ansi, gnu, java, kr, linux
+ $hl_options['replace-tabs']=4; //number of spaces which replace a tab
+ $hl_options['wrap-style']=2; //0 -> disable, 1-> wrap, 2-> wrap and indent function names
+ $hl_options['wrap-line-length']=80; // if wrap-style <>0, this defines the line length before wrapping takes place
+
+
+ if($mode == 'xhtml'){
+ list($state, $lang, $input_code) = $data;
+ $lang = preg_replace("'[^a-zA-Z]'","",$lang);
+ switch ($state) {
+ case DOKU_LEXER_ENTER :
+ break;
+
+ case DOKU_LEXER_UNMATCHED : // $renderer->doc .= $renderer->_xmlEntities($match); break;
+
+ $search = array("&amp;","&quot;", "&lt;", "&gt;","&#92;","&#39;","&nbsp;");
+ $replace = array("&","\"", "<", ">","\\","\'", " ");
+ $input_code = str_replace($search, $replace, $input_code);
+
+ $descriptorspec = array(
+ 0 => array("pipe", "r"), // stdin is a pipe that the child will read from
+ 1 => array("pipe", "w") // stdout is a pipe that the child will write to
+ );
+
+ $hl_cmd_str = $hl_options['hl_binary'];
+ $hl_cmd_str .= ' --inline-css -f ';
+
+ if ($hl_options['linenumbers']){
+ $hl_cmd_str .= " -l -m ";
+ $hl_cmd_str .= $hl_options['linenumber-start'];
+ if ($hl_options['linenumber-zeroes']){
+ $hl_cmd_str .= " -z -j ";
+ $hl_cmd_str .= $hl_options['linenumber-length'];
+ }
+ }
+
+ if ($hl_options['replace-tabs']) {
+ $hl_cmd_str .= " -t ";
+ $hl_cmd_str .= $hl_options['replace-tabs'];
+ }
+
+ if ($hl_options['wrap-style']){
+ $hl_cmd_str .= ($hl_options['wrap-style'] == 1)? ' -V ':' -W ';
+ $hl_cmd_str .= " -J ";
+ $hl_cmd_str .= $hl_options['wrap-line-length'];
+ }
+
+ if ($hl_options['reformat-style']){
+ $hl_cmd_str .= " -F ";
+ $hl_cmd_str .= $hl_options['reformat-style'];
+ }
+
+ if ($hl_options['theme']){
+ $hl_cmd_str .= " -s ";
+ $hl_cmd_str .= $hl_options['theme'];
+ }
+
+ $hl_cmd_str .= " -S $lang ";
+
+ $process = proc_open($hl_cmd_str, $descriptorspec, $pipes);
+
+ if (is_resource($process)) {
+
+ fwrite($pipes[0], $input_code);
+ fclose($pipes[0]);
+
+ $output = stream_get_contents($pipes[1]);
+ fclose($pipes[1]);
+
+ // It is important that you close any pipes before calling
+ // proc_close in order to avoid a deadlock
+ proc_close($process);
+ }
+ if (!strlen($output)) {
+ $renderer->doc .= "<small>ERROR: Execution of highlight ($hl_cmd_str) failed or missing input. Check binary path.</small>";
+ $renderer->doc .= "<pre style=\"font-size:9pt;\">";
+ $renderer->doc .= $renderer->_xmlEntities($input_code);
+ $renderer->doc .= "</pre>";
+
+ } else {
+ $renderer->doc .= "<pre style=\"font-size:9pt;\">";
+ $renderer->doc .= $output;
+ $renderer->doc .= "</pre>";
+ }
+
+ //$renderer->doc .= "<br>cmd=".$hl_cmd_str;
+
+ break;
+ case DOKU_LEXER_EXIT :
+ break;
+ }
+ return true;
+ }
+ return false;
+ }
+}
+
diff --git a/support/highlight/examples/plugins/movabletype/README b/support/highlight/examples/plugins/movabletype/README
new file mode 100644
index 0000000000..0988649366
--- /dev/null
+++ b/support/highlight/examples/plugins/movabletype/README
@@ -0,0 +1,35 @@
+Plugin Name: Highlight
+Plugin URI: http://www.andre-simon.de
+Description: Plugin which uses the highlight utility to generate coloured source code
+Author: André Simon
+Version: 1.2
+Author URI: http://www.andre-simon.de/
+
+== Description ==
+
+The highlight utility converts source code of 120 programming languages to HTML
+with syntax highlighting. This plugin pipes the content of <highlight>-Tags associated
+with a lang parameter to highlight, and returns the output code which is finally included
+in the MT page.
+
+Usage:
+
+Paste the following in the edit section of the MT blog editing form:
+
+<highlight lang="cpp">#include <stdio.h>
+
+int main (void){
+ printf("This is some random code");
+ return 0;
+}</highlight>
+
+Use the lang parameter to define the programming language (c, php, py, xml, etc).
+See the highlight documentation to learn all possible languages.
+See the syntax.php file for some formatting options (line numbering, code
+indentation, line wrapping etc).
+
+== Installation ==
+
+1. Install highlight (www.andre-simon.de) on your host
+2. Unzip the mt_highlight.zip file and upload the content to the
+ `plugins/` directory \ No newline at end of file
diff --git a/support/highlight/examples/plugins/movabletype/highlight.pl b/support/highlight/examples/plugins/movabletype/highlight.pl
new file mode 100644
index 0000000000..57d107633f
--- /dev/null
+++ b/support/highlight/examples/plugins/movabletype/highlight.pl
@@ -0,0 +1,88 @@
+#Plugin Name: Highlight
+#Plugin URI: http://www.andre-simon.de
+#Description: Plugin which uses the highlight utility to generate coloured source code
+#Author: André Simon
+#Version: 1.2
+#Author URI: http://www.andre-simon.de/
+
+#This file is part of Highlight.
+#
+#Highlight is free software: you can redistribute it and/or modify
+#it under the terms of the GNU General Public License as published by
+#the Free Software Foundation, either version 3 of the License, or
+#(at your option) any later version.
+#
+#Highlight is distributed in the hope that it will be useful,
+#but WITHOUT ANY WARRANTY; without even the implied warranty of
+#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+#GNU General Public License for more details.
+#
+#You should have received a copy of the GNU General Public License
+#along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+
+package MT::Plugin::Highlight;
+
+use strict;
+use IPC::Open3;
+use MT;
+use MT::Entry;
+use MT::Plugin;
+use MT::Template::Context;
+use MT::WeblogPublisher;
+
+my $plugin = new MT::Plugin();
+$plugin->name("MT Highlight");
+$plugin->description('Source code highlighter using highlight (http://www.andre-simon.de)');
+$plugin->doc_link('http://wiki.andre-simon.de/');
+$plugin->author_name('Andre Simon');
+$plugin->author_link('http://www.andre-simon.de/');
+$plugin->plugin_link('http://wiki.andre-simon.de/');
+$plugin->version('1.2');
+
+MT->add_callback("BuildPage", 1, $plugin, \&highlight_callback);
+MT->add_plugin($plugin);
+
+sub highlight_callback
+{
+ my ($cb, %args) = @_;
+ use Data::Dumper;
+ my $html = ${$args{'Content'}};
+ $html =~ s/<highlight([^>]*?)lang="([^"]+?)"([^>]*?)>(.*?)<\/highlight>/highlight_code($2,$4)/ges;
+ ${$args{'Content'}} = $html;
+ return 1;
+}
+
+sub highlight_code
+{
+ my ($lang, $source) = @_;
+
+ $lang =~ s/[^a-zA-Z]//g; # delete special chars in user input
+ $source =~ s/\<br \/\>//g; # get rid of <br> Tags inserted by MT
+ $source =~ s/\<\/?p\>//g; # MT inserts <p> Tags if <, > are present in input code
+
+ local(*HIS_IN, *HIS_OUT, *HIS_ERR);
+
+ my @hl_args = ('-f', "-S$lang");
+ push (@hl_args, '--inline-css'); # use inline css definitions
+ push (@hl_args, '-skwrite'); # coloring theme
+ push (@hl_args, '-l'); # linenumbers
+ push (@hl_args, '-j2'); # linenumber length
+ push (@hl_args, '-z'); # linenumber zeroes
+ push (@hl_args, '-Fgnu'); # reformat
+ push (@hl_args, '-t4'); # replace tabs
+ my $childpid = IPC::Open3::open3(*HIS_IN, *HIS_OUT, *HIS_ERR, 'highlight', @hl_args);
+ print HIS_IN $source;
+ close(HIS_IN); # Give end of file to kid.
+ my @outlines = <HIS_OUT>; # Read till EOF.
+
+ close HIS_OUT;
+ close HIS_ERR;
+ waitpid($childpid, 0);
+
+ my $htext = join "", @outlines;
+
+ return "<pre>".$htext."</pre>";
+}
+
+
+
diff --git a/support/highlight/examples/plugins/serendipity_event_highlight/lang_de.inc.php b/support/highlight/examples/plugins/serendipity_event_highlight/lang_de.inc.php
new file mode 100644
index 0000000000..508858ca3f
--- /dev/null
+++ b/support/highlight/examples/plugins/serendipity_event_highlight/lang_de.inc.php
@@ -0,0 +1,32 @@
+<?php
+
+@define('PLUGIN_EVENT_HIGHLIGHT_NAME', 'Markup: Highlight');
+@define('PLUGIN_EVENT_HIGHLIGHT_DESC', 'Farbige Syntax-Hervorhebung mit dem highlight tool. Einbindung mit dem Tag: [highlight lang=langName ] code [/highlight]');
+@define('PLUGIN_EVENT_HIGHLIGHT_TRANSFORM', 'Benutzen Sie <b>[highlight lang=langName][/highlight]</b> Tags, um Sourcecode farbig hervorzuheben.');
+@define('PLUGIN_EVENT_HIGHLIGHT_VERSION','01');
+
+@define('PLUGIN_EVENT_HIGHLIGHT_HLBINDIR','Highlight Pfad');
+@define('PLUGIN_EVENT_HIGHLIGHT_HLBINDIR_DESC','Pfad der highlight Programdatei');
+@define('PLUGIN_EVENT_HIGHLIGHT_HLDATADIR','Highlight Datenverzeichnis');
+@define('PLUGIN_EVENT_HIGHLIGHT_HLDATADIR_DESC','Dieses Verzeichnis enthält die Programmdaten, z.B. die Unterverzeichnisse langDefs, themes etc');
+@define('PLUGIN_EVENT_HIGHLIGHT_LINENUMBERS', 'Ausgabe Zeilennummern');
+@define('PLUGIN_EVENT_HIGHLIGHT_LINENUMBERS_DESC','Sollen Zeilennummern ausgegeben werden?');
+@define('PLUGIN_EVENT_HIGHLIGHT_LINENUMBERZEROES', 'Zeilennummern füllen');
+@define('PLUGIN_EVENT_HIGHLIGHT_LINENUMBERZEROES_DESC','Sollen Zeilennummern mit Nullen aufgefüllt werden?');
+@define('PLUGIN_EVENT_HIGHLIGHT_LINENUMBERSTART', 'Beginn der Nummerierung');
+@define('PLUGIN_EVENT_HIGHLIGHT_LINENUMBERSTART_DESC','Wo soll die Nummerierung beginnen?');
+@define('PLUGIN_EVENT_HIGHLIGHT_LINENUMBERLEN', 'Zeilennnummernbreite');
+@define('PLUGIN_EVENT_HIGHLIGHT_LINENUMBERLEN_DESC','Mit wievielen Stellen soll die Nummerierung ausgegeben werden?');
+@define('PLUGIN_EVENT_HIGHLIGHT_THEMES', 'Farbschema');
+@define('PLUGIN_EVENT_HIGHLIGHT_THEMES_DESC','Wähle ein Farbschema aus, das zu deinem Blog-Style passt.');
+@define('PLUGIN_EVENT_HIGHLIGHT_FORMAT', 'Neuformatierung und Einrückung');
+@define('PLUGIN_EVENT_HIGHLIGHT_FORMAT_DESC','Wähle ein Schema aus, um C, C++, C# und Java Code einheitlich zu formatieren.');
+
+@define('PLUGIN_EVENT_HIGHLIGHT_WRAP', 'Zeilenumbruch');
+@define('PLUGIN_EVENT_HIGHLIGHT_WRAP_DESC','Bestimme, ob Zeilen umgebrochen werden sollen. WRAP INTELLIGENT bedeutet, dass Funktionsparameter und Zuweisungen nach dem Umbruch korrekt eingerückt werden.');
+@define('PLUGIN_EVENT_HIGHLIGHT_WRAPLEN', 'Zeilenlänge vor Umbruch');
+@define('PLUGIN_EVENT_HIGHLIGHT_WRAPLEN_DESC','Gib die maximale Zeilenlänge an (nur wirksam wenn obige Option Zeilenumbruch nicht deaktiviert ist).');
+@define('PLUGIN_EVENT_HIGHLIGHT_TABLEN', 'Tabulatorbreite');
+@define('PLUGIN_EVENT_HIGHLIGHT_TABLEN_DESC','Bestimme die Anzahl von Leerzeichen, die ein Tab ersetzen.');
+
+?>
diff --git a/support/highlight/examples/plugins/serendipity_event_highlight/lang_en.inc.php b/support/highlight/examples/plugins/serendipity_event_highlight/lang_en.inc.php
new file mode 100644
index 0000000000..cf8a6e24d1
--- /dev/null
+++ b/support/highlight/examples/plugins/serendipity_event_highlight/lang_en.inc.php
@@ -0,0 +1,32 @@
+<?php
+
+@define('PLUGIN_EVENT_HIGHLIGHT_NAME', 'Markup: Highlight');
+@define('PLUGIN_EVENT_HIGHLIGHT_DESC', 'Coloured Syntax Highlighting using the highlight utility. Tag usage: [highlight lang=langName ] code [/highlight]');
+@define('PLUGIN_EVENT_HIGHLIGHT_TRANSFORM', 'You can use <b>[highlight lang=langName][/highlight]</b> tags to embed source code snippets');
+@define('PLUGIN_EVENT_HIGHLIGHT_VERSION','01');
+
+@define('PLUGIN_EVENT_HIGHLIGHT_HLBINDIR','Path of highlight binary');
+@define('PLUGIN_EVENT_HIGHLIGHT_HLBINDIR_DESC','Path of the highlight binary');
+@define('PLUGIN_EVENT_HIGHLIGHT_HLDATADIR','Path of highlight data directory');
+@define('PLUGIN_EVENT_HIGHLIGHT_HLDATADIR_DESC','This directory contains the data files located in the subdirectories langDefs, themes etc');
+@define('PLUGIN_EVENT_HIGHLIGHT_LINENUMBERS', 'Line number printout');
+@define('PLUGIN_EVENT_HIGHLIGHT_LINENUMBERS_DESC','Define if the line numbers should be shown.');
+@define('PLUGIN_EVENT_HIGHLIGHT_LINENUMBERZEROES', 'Line number padding');
+@define('PLUGIN_EVENT_HIGHLIGHT_LINENUMBERZEROES_DESC','Define if the line numbers should be padded with zeroes.');
+@define('PLUGIN_EVENT_HIGHLIGHT_LINENUMBERSTART', 'Line number start');
+@define('PLUGIN_EVENT_HIGHLIGHT_LINENUMBERSTART_DESC','Define where the line numbering should start.');
+@define('PLUGIN_EVENT_HIGHLIGHT_LINENUMBERLEN', 'Line number width');
+@define('PLUGIN_EVENT_HIGHLIGHT_LINENUMBERLEN_DESC','Define the line number width.');
+@define('PLUGIN_EVENT_HIGHLIGHT_THEMES', 'Color theme');
+@define('PLUGIN_EVENT_HIGHLIGHT_THEMES_DESC','Choose a color theme which matches your blog.');
+@define('PLUGIN_EVENT_HIGHLIGHT_FORMAT', 'Code reformatting');
+@define('PLUGIN_EVENT_HIGHLIGHT_FORMAT_DESC','Choose a indentation and reformatting scheme to reformat C, C++, C# and Java code.');
+
+@define('PLUGIN_EVENT_HIGHLIGHT_WRAP', 'Line wrapping');
+@define('PLUGIN_EVENT_HIGHLIGHT_WRAP_DESC','Define if long lines should be wrapped. WRAP INTELLIGENT means that function parameters and assignments are intended after wrapping.');
+@define('PLUGIN_EVENT_HIGHLIGHT_WRAPLEN', 'Line length before wrapping');
+@define('PLUGIN_EVENT_HIGHLIGHT_WRAPLEN_DESC','Set the maximum line length (only available if line wrapping is not disabled above).');
+@define('PLUGIN_EVENT_HIGHLIGHT_TABLEN', 'Tab width');
+@define('PLUGIN_EVENT_HIGHLIGHT_TABLEN_DESC','Define how many spaces should replace a tab.');
+
+?>
diff --git a/support/highlight/examples/plugins/serendipity_event_highlight/serendipity_event_highlight.php b/support/highlight/examples/plugins/serendipity_event_highlight/serendipity_event_highlight.php
new file mode 100644
index 0000000000..7c30a84e73
--- /dev/null
+++ b/support/highlight/examples/plugins/serendipity_event_highlight/serendipity_event_highlight.php
@@ -0,0 +1,329 @@
+<?php
+/**
+
+serendipity_event_highlight.php
+
+=== Highlight plugin ===
+
+This plugin uses highlight (http://www.andre-simon.de/) to add syntax highlighting to serendipity.
+
+== Description ==
+
+The highlight utility converts source code of 120 programming languages to HTML
+with syntax highlighting. This plugin pipes the content of [highlight] tags associated
+with a lang parameter to highlight, and returns the output code which is included
+in the Serendipity blog entry.
+The plugin configuration menu offers the most important options of the highlight utility.
+The highlighted code is formatted with inline CSS to avoid complicated plugin setup.
+
+Usage:
+
+Paste the following in the code section of the blog editing form:
+
+[highlight lang=c]#include <stdio.h>
+
+int main (void){
+ printf("This is some random code");
+ return 0;
+} [/highlight]
+
+Normally the file extension can be used for the lang parameter (like pl, py, java, pas etc).
+Execute 'highlight --list-langs' to get a list of all supported programming langauges.
+
+== Installation ==
+
+1. Install the highlight utility on your host (www.andre-simon.de)
+2. Copy the serendipity_event_highlight dir into the serendipity plugin dir
+3. Activate and configure the plugin in the serendipity administration menu
+
+ IMPORTANT:
+ To avoid insertion of superfluous <br> Tags by the nl2br plugin, add the
+ string "highlight" to the "list of HTML-tags where no breaks shall be
+ converted" in the nl2br configuration menu.
+
+ */
+
+
+if (IN_serendipity !== true) {
+ die ("Don't hack!");
+}
+
+// Probe for a language include with constants. Still include defines later on, if some constants were missing
+$probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
+if (file_exists($probelang)) {
+ include $probelang;
+}
+
+include dirname(__FILE__) . '/lang_en.inc.php';
+
+class serendipity_event_highlight extends serendipity_event
+{
+ var $title = PLUGIN_EVENT_HIGHLIGHT_NAME;
+ // Top Level Configuration, requires name of the Plugin, description text, and configuration information in an array..
+ function introspect(&$propbag)
+ {
+ global $serendipity;
+
+ $propbag->add('name', PLUGIN_EVENT_HIGHLIGHT_NAME);
+ $propbag->add('description', PLUGIN_EVENT_HIGHLIGHT_DESC);
+ $propbag->add('stackable', false);
+ $propbag->add('author', 'Andre Simon');
+ $propbag->add('requirements', array(
+ 'serendipity' => '0.9',
+ 'highlight' => '2.6.4'
+ ));
+ $propbag->add('version', '0.1');
+ $propbag->add('event_hooks', array('frontend_display' => true, 'frontend_comment' => true));
+ $propbag->add('groups', array('MARKUP'));
+
+ $this->markup_elements = array(
+ array(
+ 'name' => 'ENTRY_BODY',
+ 'element' => 'body',
+ ),
+ array(
+ 'name' => 'EXTENDED_BODY',
+ 'element' => 'extended',
+ ),
+ array(
+ 'name' => 'COMMENT',
+ 'element' => 'comment',
+ ),
+ array(
+ 'name' => 'HTML_NUGGET',
+ 'element' => 'html_nugget',
+ )
+ );
+
+ #Colour themes of a highlight default installation
+ $this->themes = array(
+ "acid", "bipolar", "blacknblue", "bright", "contrast", "darkblue", "darkness", "desert", "dull", "easter", "emacs", "golden", "greenlcd",
+ "ide-anjuta", "ide-codewarrior", "ide-devcpp", "ide-eclipse", "ide-kdev", "ide-msvcpp", "ide-xcode", "kwrite", "lucretia", "matlab", "navy",
+ "nedit", "neon", "night", "orion", "pablo", "peachpuff", "print", "rand01", "seashell", "the", "typical", "vampire", "vim-dark", "vim",
+ "whitengrey", "zellner"
+ );
+
+ #Reformatting schemes of a highlight default installation
+ $this->reformatschemes = array ("disabled","ansi", "gnu", "java", "kr", "linux");
+
+ #highlight output options
+ $conf_array = array('hl_bin_dir','hl_data_dir','hl_linenumbers','hl_linenumberstart','hl_linenumberzeroes','hl_linenumberlen',
+ 'hl_wrap','hl_wrap_len','hl_tab_len', 'hl_theme','hl_format');
+
+ foreach($this->markup_elements as $element) {
+ $conf_array[] = $element['name'];
+ }
+ $propbag->add('configuration', $conf_array);
+ }
+
+ function generate_content(&$title) {
+ $title = $this->title;
+ }
+
+
+ function introspect_config_item($name, &$propbag) {
+ switch ($name) {
+ case 'hl_bin_dir' :
+ $propbag->add('name', PLUGIN_EVENT_HIGHLIGHT_HLBINDIR);
+ $propbag->add('type', 'string');
+ $propbag->add('description', PLUGIN_EVENT_HIGHLIGHT_HLBINDIR_DESC);
+ $propbag->add('default', 'highlight');
+ break;
+ case 'hl_data_dir' :
+ $propbag->add('name', PLUGIN_EVENT_HIGHLIGHT_HLDATADIR);
+ $propbag->add('type', 'string');
+ $propbag->add('description', PLUGIN_EVENT_HIGHLIGHT_HLDATADIR_DESC);
+ $propbag->add('default', '/usr/share/highlight/');
+ break;
+ case 'hl_linenumbers' :
+ $propbag->add('name', PLUGIN_EVENT_HIGHLIGHT_LINENUMBERS);
+ $propbag->add('type', 'boolean');
+ $propbag->add('description', PLUGIN_EVENT_HIGHLIGHT_LINENUMBERS_DESC);
+ $propbag->add('default', 'false');
+ break;
+ case 'hl_linenumberzeroes' :
+ $propbag->add('name', PLUGIN_EVENT_HIGHLIGHT_LINENUMBERZEROES);
+ $propbag->add('type', 'boolean');
+ $propbag->add('description', PLUGIN_EVENT_HIGHLIGHT_LINENUMBERZEROES_DESC);
+ $propbag->add('default', 'false');
+ break;
+ case 'hl_linenumberstart' :
+ $propbag->add('name', PLUGIN_EVENT_HIGHLIGHT_LINENUMBERSTART);
+ $propbag->add('type', 'string');
+ $propbag->add('description', PLUGIN_EVENT_HIGHLIGHT_LINENUMBERSTART_DESC);
+ $propbag->add('default', '1');
+ $propbag->add('validate', 'number');
+ break;
+
+ case 'hl_linenumberlen' :
+ $propbag->add('name', PLUGIN_EVENT_HIGHLIGHT_LINENUMBERLEN);
+ $propbag->add('type', 'string');
+ $propbag->add('description', PLUGIN_EVENT_HIGHLIGHT_LINENUMBERLEN_DESC);
+ $propbag->add('default', '2');
+ $propbag->add('validate', 'number');
+ break;
+
+ case 'hl_theme' :
+ $propbag->add('type', 'select');
+ $propbag->add('name', PLUGIN_EVENT_HIGHLIGHT_THEMES);
+ $propbag->add('description', PLUGIN_EVENT_HIGHLIGHT_THEMES_DESC);
+ $propbag->add('select_values', $this->themes);
+ $propbag->add('default', '1');
+ break;
+
+ case 'hl_format' :
+ $propbag->add('type', 'select');
+ $propbag->add('name', PLUGIN_EVENT_HIGHLIGHT_FORMAT);
+ $propbag->add('description', PLUGIN_EVENT_HIGHLIGHT_FORMAT_DESC);
+ $propbag->add('select_values', $this->reformatschemes);
+ $propbag->add('default', '0');
+ break;
+
+ case 'hl_wrap' :
+ $wrapstyles=array ('No wrap', 'Simple wrap','Intelligent wrap');
+ $propbag->add('type', 'select');
+ $propbag->add('name', PLUGIN_EVENT_HIGHLIGHT_WRAP);
+ $propbag->add('description', PLUGIN_EVENT_HIGHLIGHT_WRAP_DESC);
+ $propbag->add('select_values', $wrapstyles);
+ $propbag->add('default', '0');
+ break;
+ case 'hl_wrap_len' :
+ $propbag->add('name', PLUGIN_EVENT_HIGHLIGHT_WRAPLEN);
+ $propbag->add('type', 'string');
+ $propbag->add('description', PLUGIN_EVENT_HIGHLIGHT_WRAPLEN_DESC);
+ $propbag->add('default', '60');
+ $propbag->add('validate', 'number');
+ break;
+ case 'hl_tab_len' :
+ $propbag->add('name', PLUGIN_EVENT_HIGHLIGHT_TABLEN);
+ $propbag->add('type', 'string');
+ $propbag->add('description', PLUGIN_EVENT_HIGHLIGHT_TABLEN_DESC);
+ $propbag->add('default', '4');
+ $propbag->add('validate', 'number');
+ break;
+ default :
+ $propbag->add('name', constant($name));
+ $propbag->add('type', 'boolean');
+ $propbag->add('default', 'true');
+ $propbag->add('description', sprintf(APPLY_MARKUP_TO, constant($name)));
+ }
+ return true;
+ }
+
+ function geshi($input) {
+ $input = preg_replace_callback('/\[highlight(?:\s)*lang=([A-Za-z0-9_\-]+)(?:\s)*()?\](.*?)\[\/highlight\]/si', array(&$this, 'highlightcallback'), $input);
+ return $input;
+ }
+
+ function event_hook($event, &$bag, &$eventData) {
+ global $serendipity;
+
+ $hooks = &$bag->get('event_hooks');
+
+ if (isset($hooks[$event])) {
+ switch($event) {
+ case 'frontend_display':
+ foreach ($this->markup_elements as $temp) {
+ if (serendipity_db_bool($this->get_config($temp['name'], true)) && isset($eventData[$temp['element']]) &&
+ !$eventData['properties']['ep_disable_markup_' . $this->instance] &&
+ !isset($serendipity['POST']['properties']['disable_markup_' . $this->instance])) {
+ $element = $temp['element'];
+ $eventData[$element] = $this->geshi($eventData[$element]);
+ }
+ }
+ return true;
+ break;
+
+ case 'frontend_comment':
+ if (serendipity_db_bool($this->get_config('COMMENT', true))) {
+ echo '<div class="serendipity_commentDirection serendipity_comment_geshi">' . PLUGIN_EVENT_HIGHLIGHT_TRANSFORM . '</div>';
+ }
+ return true;
+ break;
+
+ default:
+ return false;
+ }
+ } else {
+ return false;
+ }
+ }
+
+ function highlightcallback($matches) {
+
+ $search = array("&amp;","&quot;", "&lt;", "&gt;","&#92;","&#39;","&nbsp;");
+ $replace = array("&","\"", "<", ">","\\","\'", " ");
+ $input_code = str_replace($search, $replace, $matches[3]);
+
+ $descriptorspec = array(
+ 0 => array("pipe", "r"), // stdin is a pipe that the child will read from
+ 1 => array("pipe", "w") // stdout is a pipe that the child will write to
+ );
+
+ $hl_cmd_str = $this->get_config('hl_bin_dir');
+ $hl_cmd_str .= ' --inline-css -f ';
+
+ if ( $this->get_config('hl_linenumbers')){
+ $hl_cmd_str .= " -l -m ";
+ $hl_cmd_str .= $this->get_config('hl_linenumberstart');
+ if ($this->get_config('hl_linenumberzeroes')){
+ $hl_cmd_str .= " -z ";
+ }
+ $hl_cmd_str .= ' -j ';
+ $hl_cmd_str .= $this->get_config('hl_linenumberlen');
+ }
+
+ if ($this->get_config('hl_tab_len')) {
+ $hl_cmd_str .= " -t ";
+ $hl_cmd_str .= $this->get_config('hl_tab_len');
+ }
+
+ if ($this->get_config('hl_wrap')>0){
+ $hl_cmd_str .= ($this->get_config('hl_wrap') == 1)? ' -V ':' -W ';
+ $hl_cmd_str .= " -J ";
+ $hl_cmd_str .= $this->get_config('hl_wrap_len');
+ }
+
+ if ($this->get_config('hl_format')>1){
+ $hl_cmd_str .= " -F ";
+ $hl_cmd_str .= $this->reformatschemes[$this->get_config('hl_format')];
+ }
+
+
+ $hl_cmd_str .= " -s ";
+ $hl_cmd_str .= $this->themes[$this->get_config('hl_theme')];
+
+
+ $lang = strtolower($matches[1]);
+ $hl_cmd_str .= " -S $lang ";
+
+ $process = proc_open($hl_cmd_str, $descriptorspec, $pipes);
+ if (is_resource($process)) {
+
+ fwrite($pipes[0], $matches[3]);
+ fclose($pipes[0]);
+
+ $output = stream_get_contents($pipes[1]);
+ fclose($pipes[1]);
+
+ // It is important that you close any pipes before calling
+ // proc_close in order to avoid a deadlock
+ proc_close($process);
+ }
+ $result='';
+ if (!strlen($output)) {
+ $result .= "<small>ERROR: Execution of highlight ($hl_cmd_str) failed or missing input. Check binary path.</small>";
+ $result .= "<pre style=\"font-size:9pt;\">";
+ $result .= $input_code;
+ $result .= "</pre>";
+
+ } else {
+ $result .= "<pre style=\"font-size:9pt;\">";
+ $result .= $output;
+ $result .= "</pre>";
+ }
+ return $result;
+ }
+}
+
+?> \ No newline at end of file
diff --git a/support/highlight/examples/plugins/wordpress/README b/support/highlight/examples/plugins/wordpress/README
new file mode 100644
index 0000000000..f408d495a4
--- /dev/null
+++ b/support/highlight/examples/plugins/wordpress/README
@@ -0,0 +1,33 @@
+=== Highlight plugin ===
+
+This plugin uses highlight (http://www.andre-simon.de) to add syntax highlighting to WordPress.
+
+== Description ==
+
+The highlight utility converts source code of 120 programming languages to HTML
+with syntax highlighting. This plugin pipes the content of <pre>-Tags associated
+with a lng parameter to highlight, and returns the output code which is included
+in the WordPress blog entry.
+
+Usage:
+
+Paste the following in the code section of the blog editing form:
+
+<pre lang="c">#include <stdio.h>
+
+int main (void){
+ printf("This is some random code");
+ return 0;
+}</pre>
+
+Use the lang parameter to define the programming language (c, php, py, xml, etc).
+See the highlight documentation to learn all possible languages.
+See the highlight.php file for some formatting options (line numbering, code
+indentation, line wrapping etc).
+
+== Installation ==
+
+1. Install highlight (www.andre-simon.de) on your host
+2. Unzip the wp_highlight.zip file and upload the content to the
+ `/wp-content/plugins/` directory
+3. Activate the plugin
diff --git a/support/highlight/examples/plugins/wordpress/highlight.php b/support/highlight/examples/plugins/wordpress/highlight.php
new file mode 100644
index 0000000000..6b4fb4604f
--- /dev/null
+++ b/support/highlight/examples/plugins/wordpress/highlight.php
@@ -0,0 +1,140 @@
+<?php
+/*
+Plugin Name: Highlight
+Plugin URI: http://www.andre-simon.de
+Description: Plugin which uses the highlight utility to generate coloured source code
+Author: Andre Simon
+Version: 1.2
+Author URI: http://www.andre-simon.de
+
+
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+// Highlight options:
+
+$hl_options=array();
+$hl_options['hl_binary']='highlight'; // path to the highlight binary
+$hl_options['theme']='kwrite'; // set color theme
+$hl_options['linenumbers']=true;
+$hl_options['linenumber-start']=1;
+$hl_options['linenumber-zeroes']=1; // set to 1 if line numbers should be padded with zeros
+$hl_options['linenumber-length']=2;
+$hl_options['reformat-style']="gnu"; // possible values for C, C++ and Java Code: ansi, gnu, java, kr, linux
+$hl_options['replace-tabs']=4; // number of spaces which replace a tab
+$hl_options['wrap-style']=2; // 0 -> disable, 1-> wrap, 2-> wrap and indent function names
+$hl_options['wrap-line-length']=60; // if wrap-style <>0, this defines the line length before wrapping takes place
+
+class as_highlight {
+
+ var $ch_is_excerpt = false;
+ function __construct()
+ {
+ add_filter('the_content',array(&$this, 'hl_the_content_filter'),1);
+ }
+ // PHP 4 Constructor
+ function as_highlight ()
+ {
+ $this->__construct() ;
+ }
+
+ function as_highlight_code($matches){
+ global $hl_options;
+
+ $lang = preg_replace("'[^a-zA-Z]'","",$matches[1]);
+ // undo nl and p formatting
+ $input_code = $matches[2];
+ $input_code = preg_replace("'<br\s*\/?>\r?\n?'","\n",$input_code);
+ $search = array("&amp;","&quot;", "&lt;", "&gt;","&#92;","&#39;","&nbsp;");
+ $replace = array("&","\"", "<", ">","\\","\'", " ");
+ $input_code = str_replace($search, $replace, $input_code);
+
+ $descriptorspec = array(
+ 0 => array("pipe", "r"), // stdin is a pipe that the child will read from
+ 1 => array("pipe", "w") // stdout is a pipe that the child will write to
+ );
+
+ $hl_cmd_str = $hl_options['hl_binary'];
+ $hl_cmd_str .= ' --inline-css -I -f ';
+
+ if ($hl_options['linenumbers']){
+ $hl_cmd_str .= " -l -m ";
+ $hl_cmd_str .= $hl_options['linenumber-start'];
+ if ($hl_options['linenumber-zeroes']){
+ $hl_cmd_str .= " -z -j ";
+ $hl_cmd_str .= $hl_options['linenumber-length'];
+ }
+ }
+
+ if ($hl_options['replace-tabs']) {
+ $hl_cmd_str .= " -t ";
+ $hl_cmd_str .= $hl_options['replace-tabs'];
+ }
+
+ if ($hl_options['wrap-style']){
+ $hl_cmd_str .= ($hl_options['wrap-style'] == 1)? ' -V ':' -W ';
+ $hl_cmd_str .= " -J ";
+ $hl_cmd_str .= $hl_options['wrap-line-length'];
+ }
+
+ if ($hl_options['reformat-style']){
+ $hl_cmd_str .= " -F ";
+ $hl_cmd_str .= $hl_options['reformat-style'];
+ }
+
+ if ($hl_options['theme']){
+ $hl_cmd_str .= " -s ";
+ $hl_cmd_str .= $hl_options['theme'];
+ }
+
+ $hl_cmd_str .= " -S $lang ";
+
+ $process = proc_open($hl_cmd_str, $descriptorspec, $pipes);
+
+ if (is_resource($process)) {
+
+ fwrite($pipes[0], $input_code);
+ fclose($pipes[0]);
+ if (function_exists("stream_get_contents"))
+ {
+ $output = stream_get_contents($pipes[1]);
+ }
+ else
+ {
+ $output = "";
+ while (!feof($pipes[1])) $output .= fgets($pipes[1]);
+ }
+ fclose($pipes[1]);
+
+ // It is important that you close any pipes before calling
+ // proc_close in order to avoid a deadlock
+ $return_value = proc_close($process);
+ }
+ $newContent = "<pre>". $output ."</pre>";
+ return $newContent;
+ }
+
+ function hl_the_content_filter($content) {
+ return preg_replace_callback("/<pre\s+.*lang\s*=\"(.*)\">(.*)<\/pre>/siU",
+ array(&$this, "as_highlight_code"),
+ $content);
+ }
+}
+
+if (!function_exists('as_highlight'))
+ $as_highlight = new as_highlight();
+
+?>
diff --git a/support/highlight/examples/swig/README_SWIG b/support/highlight/examples/swig/README_SWIG
new file mode 100644
index 0000000000..07a10a0c01
--- /dev/null
+++ b/support/highlight/examples/swig/README_SWIG
@@ -0,0 +1,21 @@
+
+HIGHLIGHT SWIG INTERFACE GENERATION
+-----------------------------------
+
+SWIG (http://www.swig.org/) is a tool to generate interfaces for more than 10
+programming languages, inluding Python, Perl, Java and C#.
+The interface file highlight.i contains all information to generate wrapper code
+for the highlight::CodeGenerator class. The output module gives you access to
+the highlight parser from within your favorite (scripting) language.
+
+
+See the makefile how to compile Python and Perl modules:
+
+1. make python
+ make perl
+
+2. Run the test scripts
+ python testmod.py
+ perl testmod.pl
+
+See http://wiki.andre-simon.de/ for more information.
diff --git a/support/highlight/examples/swig/highlight.i b/support/highlight/examples/swig/highlight.i
new file mode 100644
index 0000000000..ec17c4494c
--- /dev/null
+++ b/support/highlight/examples/swig/highlight.i
@@ -0,0 +1,13 @@
+%module highlight
+%include stl.i
+%include std_string.i
+%apply const std::string& { const string& };
+%apply std::string { string };
+
+%{
+#include "../../src/core/codegenerator.h"
+%}
+
+%include "../../src/core/enums.h"
+%include "../../src/core/languagedefinition.h"
+%include "../../src/core/codegenerator.h"
diff --git a/support/highlight/examples/swig/makefile b/support/highlight/examples/swig/makefile
new file mode 100644
index 0000000000..3c4a73cd7d
--- /dev/null
+++ b/support/highlight/examples/swig/makefile
@@ -0,0 +1,34 @@
+
+CXX=g++
+CFLAGS=-g -O2 -fPIC
+
+HL_SRC=../../src/
+
+PYTHON_INC=/usr/include/python2.5/
+
+PERL_INC=`perl -MExtUtils::Embed -eperl_inc`
+
+lib-stamp:
+ make -C ${HL_SRC} -f ./makefile clean
+ make -C ${HL_SRC} -f ./makefile CFLAGS="${CFLAGS}" libhighlight.a
+ touch $@
+
+python: lib-stamp
+ swig -c++ -python -o highlight_wrap.cpp highlight.i
+ ${CXX} ${CFLAGS} -c highlight_wrap.cpp -I${PYTHON_INC} -I${HL_SRC}
+ ${CXX} -shared -s highlight_wrap.o -L${HL_SRC} -lhighlight -o _highlight.so
+
+perl: lib-stamp
+ swig -c++ -perl -o highlight_wrap.cpp highlight.i
+ ${CXX} ${CFLAGS} -c highlight_wrap.cpp ${PERL_INC} -I${HL_SRC}
+ ${CXX} -shared -s highlight_wrap.o -L${HL_SRC} -lhighlight -o highlight.so
+
+
+clean: python-clean perl-clean
+ rm *-stamp
+
+perl-clean:
+ rm -f highlight.so highlight_wrap.cpp highlight.pm *.o
+
+
+.PHONY: python python-clean perl perl-clean clean
diff --git a/support/highlight/examples/swig/testmod.pl b/support/highlight/examples/swig/testmod.pl
new file mode 100644
index 0000000000..7d2aa474d5
--- /dev/null
+++ b/support/highlight/examples/swig/testmod.pl
@@ -0,0 +1,28 @@
+# Perl SWIG module test script
+#
+# Import highlight.pm, which is the interface for the highlight.so module.
+# See highlight.pm for all available attributes and class members.
+
+use highlight;
+
+#get a generator instance (for HTML output)
+my $gen = highlightc::CodeGenerator_getInstance($highlightc::HTML);
+
+
+#initialize the generator with a colour theme and the language definition
+$gen->initTheme("/usr/share/highlight/themes/kwrite.style");
+$gen->loadLanguage("/usr/share/highlight/langDefs/c.lang");
+
+#set some parameters
+$gen->setIncludeStyle(1);
+$gen->setEncoding("ISO-8859-1");
+
+#get output string
+my $output=$gen->generateString("int main(int argc, char **argv) {\n".
+ " HighlightApp app;\n".
+ " return app.run(argc, argv);\n".
+ "}\n");
+print $output;
+
+# clear the instance
+highlightc::CodeGenerator_deleteInstance($gen);
diff --git a/support/highlight/examples/swig/testmod.py b/support/highlight/examples/swig/testmod.py
new file mode 100644
index 0000000000..bcaae30264
--- /dev/null
+++ b/support/highlight/examples/swig/testmod.py
@@ -0,0 +1,88 @@
+# -*- coding: utf-8 -*-
+# More advanced SWIG module test script
+#
+# Import highlight.py, which is the interface for the _highlight.so module.
+# See highlight.py for all available attributes and class members.
+#
+# Example: swig_cli.py testmod.py testmod.py.html -l --style emacs
+
+import highlight
+import sys
+from optparse import OptionParser
+
+formatList = { "html": highlight.HTML,
+ "xhtml": highlight.XHTML,
+ "latex": highlight.LATEX,
+ "rtf": highlight.RTF,
+ "tex": highlight.TEX,
+ "ansi": highlight.ANSI,
+ "xterm256": highlight.XTERM256,
+ "svg": highlight.SVG,
+ "xml": highlight.XML
+ }
+
+HL_DIR="/usr/share/highlight"
+
+def highlightFile():
+
+ parser = OptionParser("usage: %prog [options] input-file output-file")
+ parser.add_option("-O", "--format", default="html",
+ choices=("html","xhtml","latex","tex","rtf","ansi","xterm256","svg","xml"),
+ help="Output format (html, xhtml, latex, tex, rtf, ansi, xterm256, svg, xml)")
+ parser.add_option("-d", "--doc-title", default="Source file",
+ help="document title")
+ parser.add_option("-f", "--fragment", action="store_true",
+ help="omit file header and footer")
+ parser.add_option("-F", "--reformat",
+ choices=('allman','gnu','java','kr','linux', 'banner','stroustrup','whitesmith'),
+ help="reformats and indents output in given style")
+ parser.add_option("-l", "--linenumbers", action="store_true",
+ help="print line numbers in output file")
+ parser.add_option("-S", "--syntax",
+ help="specify type of source code")
+ parser.add_option("-s", "--style", default="kwrite",
+ help="defines colour style")
+ parser.add_option("-u", "--encoding", default="ISO-8859-1",
+ help="define output encoding which matches input file encoding")
+
+ (options, args) = parser.parse_args(sys.argv[1:])
+ if len(args)!=2:
+ parser.print_help()
+ return
+
+ formatName=options.format.lower()
+ outFormat = formatName in formatList and formatList[formatName] or highlight.HTML
+
+ (infile, outfile) = args
+
+ #get a generator instance (for HTML output)
+ gen=highlight.CodeGenerator_getInstance(outFormat);
+
+ #initialize the generator with a colour theme and the language definition
+ gen.initTheme("%s/themes/%s.style" % (HL_DIR, options.style));
+
+ if options.reformat:
+ gen.initIndentationScheme(options.reformat)
+
+ if (options.syntax):
+ syntax = options.syntax
+ else:
+ syntax = infile[infile.rindex(".")+1:]
+
+ gen.loadLanguage("%s/langDefs/%s.lang"% (HL_DIR, syntax))
+
+ gen.setIncludeStyle(1);
+ gen.setTitle(options.doc_title)
+ gen.setFragmentCode(options.fragment)
+ gen.setPrintLineNumbers(options.linenumbers)
+ gen.setEncoding(options.encoding);
+
+ gen.generateFile(infile, outfile)
+
+ # clear the instance
+ highlight.CodeGenerator_deleteInstance(gen);
+
+###############################################################################
+if __name__ == "__main__":
+ highlightFile()
+
diff --git a/support/highlight/filetypes.conf b/support/highlight/filetypes.conf
new file mode 100644
index 0000000000..a8a48c98d5
--- /dev/null
+++ b/support/highlight/filetypes.conf
@@ -0,0 +1,64 @@
+# Extension mapping
+# -----------------
+# This file is a part of highlight, a free source code converter released
+# under the GPL.
+# Format: $ext(lang) = <extensions of source files>
+# where lang is the file name of the language definition
+# If there exists only one extension, you do not have to list it here.
+# See README in the highlight directory for details.
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$ext(ada)=adb ads a gnad
+$ext(ampl)=dat run
+$ext(amtrix)=s4 s4t s4h hnd t4
+$ext(asm)=a51 29k 68s 68x x68
+$ext(asp)=asa
+$ext(ats)=dats
+$ext(aspect)=was wud
+$ext(bat)=cmd
+$ext(c)=c++ cpp cxx cc h hh hxx hpp
+$ext(cfc)=cfm
+$ext(cob)=cbl
+$ext(diff)=patch
+$ext(e)=se
+$ext(erl)=hrl
+$ext(euphoria)=ex exw exu ew eu
+$ext(f77)=f for ftn
+$ext(f90)=f95
+$ext(haskell)=hs
+$ext(java)=groovy grv
+$ext(lisp)=cl clisp el lsp sbcl
+$ext(make)=mak mk
+$ext(mib)=smi
+$ext(ml)=mli ocaml
+$ext(mod2)=mod def
+$ext(mod3)=m3 i3
+$ext(oberon)=ooc
+$ext(php)=php3 php4 php5 php6
+$ext(pike)=pmod
+$ext(pl1)=ff fp fpp rpp sf sp spb spp sps wp wf wpp wps wpb bdy spe
+$ext(pl)=perl cgi pm plx plex
+$ext(progress)=p i w
+$ext(rb)=ruby pp rjs
+$ext(rexx)=rex rx the
+$ext(sh)=bash ebuild eclass
+$ext(smalltalk)=st gst sq
+$ext(sybase)=sp
+$ext(tcl)=wish itcl
+$ext(tex)=sty cls
+$ext(vb)=bas basic bi vbs
+$ext(verilog)=v
+$ext(html)=htm xhtml
+$ext(xml)=sgm sgml nrm ent hdr hub dtd wml vxml wml tld svg xsl ecf jnlp
+$ext(fs)=fsx
+
+# Input file recognition
+# Highlight matches the first input line with the listed expressions.
+# Format: $shebang(lang) = <regex>
+
+$shebang(sh)=^#!(\/usr)?(\/local)?\/bin\/(bash|t?csh|[akz]?sh)
+$shebang(pl)=^#!(\/usr)?(\/local)?\/bin\/perl
+$shebang(py)=^#!(\/usr)?(\/local)?\/bin\/python
+$shebang(awk)=^#!(\/usr)?(\/local)?\/bin\/[gn]?awk
diff --git a/support/highlight/gui_files/ext/fileopenfilter.conf b/support/highlight/gui_files/ext/fileopenfilter.conf
new file mode 100644
index 0000000000..d7bbc3b372
--- /dev/null
+++ b/support/highlight/gui_files/ext/fileopenfilter.conf
@@ -0,0 +1,144 @@
+All source files (*)
+ABAP/4 (*.abp)
+ABNF (*.abnf)
+Ada95 (*.a *.adb *.ads *.gnad)
+Agda (*.agda)
+AMPL (*.mod *.dat *.run)
+AMTrix (*.s4 *.s4t *.s4h *.hnd *.t4)
+Arc (*.arc)
+ARM (*.arm)
+Ascend (*.a4c)
+Aspect (*.was *.wud)
+ATS (*.ats *.dats)
+AutoHotKey (*.ahk)
+AutoIt3 (*.au3)
+Avenue (*.avenue)
+AWK (*.awk)
+Bash (*.sh)
+Batch (*.bat)
+BBCode (*.bbcode)
+BibTeX (*.bib)
+Bison (*.y)
+BlitzBasic (*.bb)
+BMScript (*.bm)
+BNF (*.bnf)
+Boo (*.boo)
+C/C++ (*.cpp *.cc *.c *.C *.hpp *.h)
+C# (*.cs)
+CHILL (*.chl)
+ClearBasic (*.cb)
+Clipper (*.clipper)
+Clips (*.clp)
+COBOL (*.cob)
+Coldfusion-MX (*.cfc *.cfm)
+D (*.d)
+Delphi (*.pas)
+Diff (*.diff *.patch)
+Dylan (*.dylan)
+EBNF (*.ebnf)
+Eiffel (*.e *.ecf *.se)
+Erlang (*.erl)
+Euphoria (*.ex *.exw *.exu *.ew *.eu)
+Express (*.exp)
+F# (*.fs *.fsx)
+Fame (*.inp)
+Felix (*.flx)
+Fortran77 (*.f *.f77 *.for *.ftn)
+Fortran90 (*.f95 *.f90)
+Frink (*.frink)
+Graphviz (*.dot)
+Groovy (*.groovy *.grv)
+Haskell (*.hs *.lhs *.icl *.sbcl)
+haXe (*.hx)
+Hecl (*.hcl)
+Httpd (*.httpd)
+HTML (*.html *.htm *.xhtml)
+Icon (*.icn)
+IDL (*.idl)
+Informix (*.4gl)
+INI (*.ini)
+InnoSetup (*.iss)
+Interlis (*.ili)
+IO (*.io)
+Jasmin (*.j)
+Java (*.java)
+Javascript (*.js)
+JSP2.0 (*.jsp)
+LaTeX (*.tex)
+LDIF (*.ldif)
+Lilypond (*.ly)
+LindenScript (*.lsl)
+Lisp (*.lisp *.sblc)
+Logtalk (*.lgt)
+Lotos (*.lotos)
+LotusScript (*.ls)
+Lua (*.lua)
+Luban (*.lbn)
+Make (*.mak *.mk)
+Maple (*.mpl)
+Markup (*.html *.htm *.xhtml *.sgml *.dtd *.tld *.wml *.xml *.xsl)
+Matlab (*.m)
+MaxScript (*.ms)
+Maya (*.mel)
+Mercury (*.mercury)
+Modelica (*.mo)
+Modula2 (*.mod *.def)
+Modula3 (*.m3 *.i3)
+MS-SQL (*.mssql)
+Nasal (*.nas)
+NBC (*.nbc)
+Nemerle (*.n)
+NetRexx (*.nrx)
+Nice (*.nice)
+NSIS (*.nsi)
+NXC (*.nxc)
+Oberon (*.ooc)
+Objective-Caml (*.ml *.mli)
+Objective-C (*.objc)
+Octave (*.octave)
+Oz (*.oz)
+Paradox (*.sc)
+Pascal (*.pas)
+Patrol (*.psl)
+Perl (*.pl *.perl *.cgi *.pm *.plx *.plex *.04)
+PHP (*.php *.php3)
+Pike (*.pike *.pmod)
+PL/1 (*.pl1)
+PL/SQL (*.sql)
+PostScript (*.ps)
+POV-Ray (*.pov)
+PowerShell (*.ps1)
+Progress (*.p *.i *.w)
+Prolog (*.pro)
+Pyrex (*.pyx)
+Python (*.py)
+Qore (*.q)
+Qu (*.qu)
+Rebol (*.rebol)
+Relax-NG-Compact (*.rnc)
+Rexx (*.rexx)
+RPM-Spec (*.spec)
+R (*.r)
+Ruby (*.rb *.pp *.rjs)
+Scala (*.scala)
+Scilab (*.sci *.sce)
+Small (*.sma)
+Smalltalk (*.st *.gst *.sq)
+SML (*.sml)
+SNMP (*.mib *.smi)
+Snobol (*.sno)
+Spin (*.spn)
+Squirrel (*.nut)
+Statistical-Analysis-System (*.sas)
+SVG (*.svg)
+Sybase (*.sp)
+Tcl/Tk (*.tcl)
+TCSH (*.tcsh)
+TeX (*.tex)
+Text (*.txt)
+TTCN3 (*.ttcn3)
+Verilog (*.verilog)
+VHDL (*.vhd)
+VisualBasic/Basic (*.bas *.bi *.b)
+XML (*.xml)
+Zonnon (*.znn) \ No newline at end of file
diff --git a/support/highlight/gui_files/l10n/highlight_de_DE.qm b/support/highlight/gui_files/l10n/highlight_de_DE.qm
new file mode 100644
index 0000000000..beabef3993
--- /dev/null
+++ b/support/highlight/gui_files/l10n/highlight_de_DE.qm
Binary files differ
diff --git a/support/highlight/gui_files/l10n/highlight_es_ES.qm b/support/highlight/gui_files/l10n/highlight_es_ES.qm
new file mode 100644
index 0000000000..8b12b7d4b6
--- /dev/null
+++ b/support/highlight/gui_files/l10n/highlight_es_ES.qm
Binary files differ
diff --git a/support/highlight/highlight.desktop b/support/highlight/highlight.desktop
new file mode 100755
index 0000000000..e16168b19a
--- /dev/null
+++ b/support/highlight/highlight.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Version=1.0
+Name=Highlight
+Type=Application
+Comment=Converts source code to formatted text (HTML, RTF, TeX, LaTeX, SVG, BBCode, XML) with syntax highlighting
+Exec=highlight-gui
+TryExec=highlight-gui
+Icon=highlight
+Categories=Utility;TextTools;
+StartupNotify=true
diff --git a/support/highlight/highlight.spec b/support/highlight/highlight.spec
new file mode 100644
index 0000000000..f86953c1f9
--- /dev/null
+++ b/support/highlight/highlight.spec
@@ -0,0 +1,116 @@
+#%define prefix /usr
+
+# Release number can be specified with rpmbuild --define 'rel SOMETHING' ...
+# If no such --define is used, the release number is 1.
+#
+# Source archive's extension can be specified with --define 'srcext .foo'
+# where .foo is the source archive's actual extension.
+# To compile an RPM from a .bz2 source archive, give the command
+# rpmbuild -tb --define 'srcext bz2' @PACKAGE@-@VERSION@.tar.bz2
+#
+#%if %{?rel:0}%{!?rel:1}
+%define rel 1
+#%endif
+
+%if %{?srcext:0}%{!?srcext:1}
+%define srcext bz2
+%endif
+
+Name: highlight
+Summary: Universal source code to formatted text converter
+Version: 2.16
+Release: %{rel}
+Group: Development/Tools
+License: GPLv2
+Vendor: Andre Simon <andre.simon1@gmx.de>
+URL: http://www.andre-simon.de/
+
+Source0: http://www.andre-simon.de/zip/%{name}-%{version}.tar.%{srcext}
+Buildroot: %{_tmppath}/%{name}-%{version}.%{release}-root
+BuildRequires: qt-devel
+
+%package gui
+Summary: The optional highlight Qt GUI
+Group: Development/Tools
+%description gui
+A intuitive user interface of the highlight utility.
+
+%description
+A utility that converts sourcecode to HTML, XHTML, RTF, LaTeX, TeX, XML, BBCode or
+terminal escape sequences with syntax highlighting.
+It supports about 140 programming and markup languages.
+Language descriptions are configurable and support regular expressions.
+The utility offers indentation and reformatting capabilities.
+It is easily possible to create new language definitions and colour themes.
+
+%prep
+%setup -q -n highlight-%{version}
+
+%build
+make cli
+make gui
+
+%install
+if [ -d $RPM_BUILD_ROOT ]; then rm -r $RPM_BUILD_ROOT; fi
+install -d $RPM_BUILD_ROOT%
+install -d $RPM_BUILD_ROOT%{_datadir}/highlight/themes $RPM_BUILD_ROOT%{_datadir}/highlight/langDefs
+install -d $RPM_BUILD_ROOT%{_defaultdocdir}/highlight/examples/plugins/dokuwiki
+install -d $RPM_BUILD_ROOT%{_defaultdocdir}/highlight/examples/plugins/movabletype
+install -d $RPM_BUILD_ROOT%{_defaultdocdir}/highlight/examples/plugins/wordpress
+install -d $RPM_BUILD_ROOT%{_defaultdocdir}/highlight/examples/plugins/serendipity_event_highlight
+install -d $RPM_BUILD_ROOT%{_defaultdocdir}/highlight/examples/swig
+
+install -d $RPM_BUILD_ROOT/etc/highlight/
+install -d $RPM_BUILD_ROOT%{_mandir}/man1
+install -d $RPM_BUILD_ROOT%{_defaultdocdir}/highlight/
+
+install -m644 ./man/highlight.1.gz $RPM_BUILD_ROOT%{_mandir}/man1/highlight.1.gz
+install -m644 ./langDefs/*.lang $RPM_BUILD_ROOT%{_datadir}/highlight/langDefs/
+install -m644 ./*.conf $RPM_BUILD_ROOT/etc/highlight/
+install -m644 ./themes/*.style $RPM_BUILD_ROOT%{_datadir}/highlight/themes/
+install -m644 ./examples/plugins/dokuwiki/* $RPM_BUILD_ROOT%{_defaultdocdir}/highlight/examples/plugins/dokuwiki
+install -m644 ./examples/plugins/movabletype/* $RPM_BUILD_ROOT%{_defaultdocdir}/highlight/examples/plugins/movabletype
+install -m644 ./examples/plugins/wordpress/* $RPM_BUILD_ROOT%{_defaultdocdir}/highlight/examples/plugins/wordpress
+install -m644 ./examples/plugins/serendipity_event_highlight/* $RPM_BUILD_ROOT%{_defaultdocdir}/highlight/examples/plugins/serendipity_event_highlight
+install -m644 ./examples/swig/* $RPM_BUILD_ROOT%{_defaultdocdir}/highlight/examples/swig
+install -m644 ./examples/highlight_pipe.* $RPM_BUILD_ROOT%{_defaultdocdir}/highlight/examples
+install -m644 ./ChangeLog ./AUTHORS ./COPYING ./TODO ./README ./README_DE ./README_REGEX ./README_LANGLIST ./INSTALL $RPM_BUILD_ROOT%{_defaultdocdir}/highlight/
+mkdir -p $RPM_BUILD_ROOT%{_bindir}
+install -m755 ./src/highlight $RPM_BUILD_ROOT%{_bindir}
+
+install -d $RPM_BUILD_ROOT%{_datadir}/highlight/gui_files/ext $RPM_BUILD_ROOT%{_datadir}/highlight/gui_files/l10n
+install -m644 ./gui_files/l10n/* $RPM_BUILD_ROOT%{_datadir}/highlight/gui_files/l10n/
+install -m644 ./gui_files/ext/* $RPM_BUILD_ROOT%{_datadir}/highlight/gui_files/ext/
+install -m755 ./src/highlight-gui $RPM_BUILD_ROOT%{_bindir}
+
+%clean
+rm -fr %{buildroot}
+
+%postun
+rmdir %{_datadir}/highlight/themes %{_datadir}/highlight/indentSchemes %{_datadir}/highlight/langDefs %{_datadir}/highlight/helpmsg
+rmdir --ignore-fail-on-non-empty %{_datadir}/highlight
+
+%postun gui
+rmdir %{_datadir}/highlight/gui_files/l10n %{_datadir}/highlight/gui_files/ext
+rmdir %{_datadir}/highlight/gui_files
+rmdir --ignore-fail-on-non-empty %{_datadir}/highlight
+
+%files
+%defattr(-,root,root,-)
+
+%{_defaultdocdir}/highlight
+/etc/highlight/*.conf
+%{_datadir}/highlight/langDefs/*.lang
+%{_datadir}/highlight/themes/*.style
+%{_mandir}/man1/highlight.1.gz
+%{_bindir}/highlight
+
+%files gui
+%{_datadir}/highlight/gui_files/ext/*
+%{_datadir}/highlight/gui_files/l10n/*
+%{_bindir}/highlight-gui
+
+%changelog
+* Tue Feb 26 2002 Andre Simon <andre.simon1@gmx.de>
+- Initial build
+
diff --git a/support/highlight/langDefs/4gl.lang b/support/highlight/langDefs/4gl.lang
new file mode 100644
index 0000000000..aa9cc59571
--- /dev/null
+++ b/support/highlight/langDefs/4gl.lang
@@ -0,0 +1,55 @@
+# INFORMIX language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 13.04.04
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Informix
+
+$KEYWORDS(kwa)=add after all allowing and any arg_val array arr_count arr_curr
+as asc at attribute attributes auto autonext average avg before between bottom
+by call case check clear clipped close column columns command comment comments
+commit composites connect construct continue correct count current cursor
+database declare default defer define delimiters desc describe display
+displayonly distinct do down downshift else end entry every execute exists exit
+extern false fetch field finish first for foreach form format formonly found
+from function globals group having header help if in include input insert
+instructions into is joining key label last lenght let line lineno lines log
+main margin master matches max mdy menu message min mode name need next
+nextfield no normal not notfound null num_args of on open option options or
+order otherwise outer output page pageno prepare previous print printer
+privileges program prompt query queryclear quit record register report resource
+return returning reverse right row rowid run screen scroll scr_line select set
+set_count share sizeof skip some sqlca start startlog static statistics status
+step stop sum switch synonym systables then through thru to top trailer true
+union unique unlock up upshift user using validate value values verify view
+waiting warning when whenever where while with without work wrap
+
+$types=alter break create delete drop editadd editupdate error errorlog err_get
+err_print err_quit exclusive exitnow goto grant initialize interrupt lock
+modify pause pipe public recover remove rename revoke rollback rollforward
+sleep sqlerrd table tables temp update char date day dba decimal double dec
+float index int integer like long lookup money month noentry noupdate percent
+picture required short smallfloat smallint struct serial space spaces time
+today type typedef unsigned weekday year zerofill
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=# --
+
+$ML_COMMENT={ }
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] , ; : & | < > ! = / * % + -
diff --git a/support/highlight/langDefs/a4c.lang b/support/highlight/langDefs/a4c.lang
new file mode 100644
index 0000000000..966fb5bb37
--- /dev/null
+++ b/support/highlight/langDefs/a4c.lang
@@ -0,0 +1,32 @@
+# ASCEND language definition for 'highlight'
+
+$DESCRIPTION=ASCEND
+
+$KEYWORDS(kwa)=ADD AND ALIASES ARE_ALIKE ARE_THE_SAME ARE_NOT_THE_SAME ASSERT ATOM CALL CASE CARD CHECK CHOICE
+CONSTANT CONDITIONAL CREATE DATA DEFAULT DEFINITION DO ELSE FIX FOR FREE IF IN INPUT
+INTERSECTION IS_A IS_REFINED_TO MAX MAXIMIZE MIN MINIMIZE NOTES OF OR
+OTHERWISE OUTPUT PROVIDE PROD REPLACE REFINES RUN SATISFIED SELECT SELF STUDY SUCH_THAT
+SUM SWITCH THEN UNIVERSAL UNION UNITS USE WHEN WHERE WITH_VALUE WILL_BE WILL_BE_THE_SAME
+WILL_NOT_BE_THE_SAME
+
+$KEYWORDS(kwb)=FALSE TRUE real_constant integer_constant symbol_constant boolean_constant real integer symbol
+boolean set
+
+$KEYWORDS(kwc)=IMPORT REQUIRE MODEL END METHOD METHODS
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS='
+$STRING_UNEQUAL={ }
+
+$ML_COMMENT=(* *)
+
+$ALLOWNESTEDCOMMENTS=true
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; . : & | < > ! = / * % + - ~
+
+$REFORMATTING=true
diff --git a/support/highlight/langDefs/abnf.lang b/support/highlight/langDefs/abnf.lang
new file mode 100644
index 0000000000..ea84fe862c
--- /dev/null
+++ b/support/highlight/langDefs/abnf.lang
@@ -0,0 +1,30 @@
+# ABNF language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 24 Mar 2010
+#
+# Based on ebnf.lang.
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+
+$DESCRIPTION=Advanced Backus-Naur Form
+
+$KEYWORDS(kwa)=regex(^\s*([^=]+)\s*=)
+$KEYWORDS(kwb)=regex([?][^?]+[?])
+$KEYWORDS(kwc)=regex([a-zA-Z][-a-zA-Z0-9]*)
+
+$KEYWORDS(kwd)= ALPHA DIGIT HEXDIG DQUOTE SP HTAB WSP LWSP VCHAR CHAR OCTET CTL CR LF CRLF BIT
+
+$STRINGDELIMITERS=" '
+
+$ML_COMMENT=(* *)
+
+$IGNORECASE=false
+
+$SYMBOLS= ( ) [ ] { } ; | - * / = \ No newline at end of file
diff --git a/support/highlight/langDefs/abp.lang b/support/highlight/langDefs/abp.lang
new file mode 100644
index 0000000000..685ce56c0c
--- /dev/null
+++ b/support/highlight/langDefs/abp.lang
@@ -0,0 +1,50 @@
+# SAP - ABAP/4 language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 13.04.04
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=ABAP/4
+
+$KEYWORDS(kwa)=abs acos add add-corresponding adjacent all and analyzer append ascending asin at atan authority-check avg back begin between
+binary blank block break-point by ca call case catch ceil centered change check checkbox clear clear: close cn cnt co collect color
+commit communication compute concatenate condense constants constants: continue control controls convert copy cos cosh count country cp
+currency customer-function data data: dataset decimals define default delete descending describe dialog distinct div divide divide-
+corresponding do duplicates editor-call else elseif end endcatch end-of-definition end-of-page end-of-selection endat endcase enddo
+endform endfunction endif endloop endmodule endon endprovide endselect endwhile entries eq exceptions exec exit exp exponent export
+exporting extended extract fetch field-group field-symbols field-symbols: floor for form format frac frame free from function function-
+pool ge generate get gt hide hotspot header heading. heading icon if import importing in include index infotypes initial initialization
+input insert into intensified inverse is key language le leave left-justified like line line-count line-size lines list-processing load
+local local locale log log10 loop lt message-id message m margin max min mod mode modify module move move-corresponding multiply
+multiply-corresponding na ne new-line new-page no-gap no-heading no-scrolling no-sign no-title no-zero not np ns no standard page
+heading o obligatory occurs of off on open or order output overlay pack parameters parameters: perform pf-status position print print-
+control program provide put page radiobutton raise raising ranges read receive refresh reject replace report reserve reset right-
+justified rollback round run scan screen scroll scroll-boundary search select select-options select-options: selection-screen selection-
+screen: selection-table set shift sign sin select single sinh skip sort space split sql sqrt standard start-of-selection statics stop
+strlen structure submit substract substract-corresponding sum suppress dialog symbol syntax-check syntax-trace system-exceptions table
+tables tables: tan tanh then time title titlebar to top-of-page transaction transfer translate trunc type-pools type-pool types type
+uline under unit unpack update user-command using value when where while window with with-title work write write-to
+
+$IDENTIFIER=regex([a-zA-Z_][\w\-]*)
+
+$STRINGDELIMITERS='
+
+$SL_COMMENT=* "
+
+$IGNORECASE=true
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / % + - .
+
diff --git a/support/highlight/langDefs/ada.lang b/support/highlight/langDefs/ada.lang
new file mode 100644
index 0000000000..159e37fa50
--- /dev/null
+++ b/support/highlight/langDefs/ada.lang
@@ -0,0 +1,53 @@
+# ADA 95 language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 10.06.2003
+# Update: 08.10.2008
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=ADA95
+
+$KEYWORDS(kwa)= abort else new return abs elsif not reverse abstract end null
+accept entry select access exception separate aliased exit of subtype all
+or and for others tagged array function out task at terminate generic
+package then begin goto pragma type body private if procedure case in
+protected until constant is use raise declare range when delay limited
+record while delta loop rem with digits renames do mod requeue xor
+
+$KEYWORDS(kwb)=boolean integer natural positive float character
+string duration short_integer long_integer short_float long_float
+
+$KEYWORDS(kwc)=wide_character wide_string short_short_integer long_long_integer
+short_short_float long_long_float
+
+$KEYWORDS(kwd)=true false
+
+# Workaround: distinguish string delimiters and event markers
+# (same eymbol: ')
+$KEYWORDS(kwd)=regex([\w\)]+('\w+))
+
+#workaround for special string '''
+$KEYWORDS(kwd)=regex(''')
+
+$STRINGDELIMITERS=" '
+
+#$STRINGDELIMITERS="
+
+$SL_COMMENT=--
+
+$IGNORECASE=true
+
+#$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + - .
diff --git a/support/highlight/langDefs/agda.lang b/support/highlight/langDefs/agda.lang
new file mode 100644
index 0000000000..c734cbf73f
--- /dev/null
+++ b/support/highlight/langDefs/agda.lang
@@ -0,0 +1,33 @@
+# Agda language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 21.11.2002
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+
+$DESCRIPTION=Agda
+
+$KEYWORDS(kwa)=abstract case concrete data do in interface let module mutual of open native
+package postulate private public sig struct type use set type
+abstract data forall hiding import in infix infixl infixr
+let module mutual open postulate primitive private public record
+renaming using where with
+
+$KEYWORDS(kwb)= integer int float double bool char
+$STRINGDELIMITERS="
+$SL_COMMENT=--
+$ML_COMMENT={- -}
+$IGNORECASE=true
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / \ * % + - '
diff --git a/support/highlight/langDefs/ahk.lang b/support/highlight/langDefs/ahk.lang
new file mode 100644
index 0000000000..ddc86957d1
--- /dev/null
+++ b/support/highlight/langDefs/ahk.lang
@@ -0,0 +1,75 @@
+# AutoHotKey language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 24.03.2010
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=AutoHotKey
+
+# commands
+$KEYWORDS(kwa)=autotrim blockinput break click clipwait continue control controlclick
+controlfocus controlget controlgetfocus controlgetpos controlgettext
+controlmove controlsend controlsettext coordmode critical
+detecthiddentext detecthiddenwindows dllcall drive driveget
+drivespacefree edit else envadd envdiv envget envmult envset envsub
+envupdate exit exitapp fileappend filecopy filecopydir filecreatedir
+filecreateshortcut filedelete fileinstall filegetattrib filegetshortcut
+filegetsize filegettime filegetversion filemove filemovedir fileread
+filereadline filerecycle filerecycleempty fileremovedir fileselectfile
+fileselectfolder displays filesetattrib filesettime formattime
+getkeystate gosub goto groupactivate groupadd groupclose groupdeactivate
+gui guicontrol guicontrolget hideautoitwin, hotkey if ifequal/ifnotequal
+ifexist ifgreater ifgreaterorequal ifinstring ifless/iflessorequal
+ifmsgbox ifwinactive ifwinexist imagesearch inidelete iniread iniwrite
+input inputbox keyhistory keywait leftclick leftclickdrag listhotkeys
+listlines listvars loop loop loop loop loop menu mouseclick
+mouseclickdrag mousegetpos mousemove msgbox onexit onmessage
+outputdebug pause pixelgetcolor pixelsearch postmessage process progress
+random regexmatch regexreplace regdelete regread regwrite
+registercallback reload repeat endrepeat return rightclick
+rightclickdrag run runas runwait send sendmessage sendmode setbatchlines
+setcapslockstate setcontroldelay setdefaultmousespeed setenv setformat
+setkeydelay setmousedelay setnumlockstate setscrolllockstate
+setstorecapslockmode settimer settitlematchmode setwindelay
+setworkingdir shutdown sleep sort soundbeep soundget soundgetwavevolume
+soundplay soundset soundsetwavevolume splashimage splashtexton
+splashtextoff splitpath statusbargettext statusbarwait stringcasesense
+stringgetpos stringleft stringlen stringlower stringmid stringreplace
+stringright stringsplit stringtrimleft stringtrimright stringupper
+suspend sysget thread tooltip transform traytip urldownloadtofile var
+var varsetcapacity while-loop winactivate winactivatebottom winclose
+wingetactivestats wingetactivetitle wingetclass winget wingetpos
+wingettext wingettitle winhide winkill winmaximize winmenuselectitem
+winminimize winminimizeall winminimizeallundo winmove winrestore winset
+winsettitle winshow winwait winwaitactive winwaitclose winwaitnotactive
+
+# if :: follows, # is part of a hotkey
+$KEYWORDS(kwa)=regex(\#\w+(?!\:\:))
+
+# hotkeys
+$KEYWORDS(kwb)=regex([\#\!\^\+\&\<\>\*\~\$]*[\w\&\s]+?\:\:)
+
+# hotstrings
+$KEYWORDS(kwd)=regex(\:.+?\:\:)
+
+# variables
+$KEYWORDS(kwc)=regex(%\w+?%)
+
+$STRINGDELIMITERS="
+
+$SL_COMMENT=;
+
+$IGNORECASE=true
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * \ `
diff --git a/support/highlight/langDefs/ampl.lang b/support/highlight/langDefs/ampl.lang
new file mode 100644
index 0000000000..1ee903136a
--- /dev/null
+++ b/support/highlight/langDefs/ampl.lang
@@ -0,0 +1,46 @@
+# AMPL language definition file
+#
+# Author: André Simon
+# Mail: andre.simon1@gmx.de
+# Date: 28.06.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=AMPL
+
+$KEYWORDS(kwa)=and arc by check cross close diff difference div data display drop
+else exists end forall fix function if in inter intersection interval include
+less let maximize minimize min max mod model node not or objective option param
+prod product print printf quit reset restore set setof subject subj s.t.
+symdiff sum shell solution then to union update unfix var write binary circular
+coeff coef cover dimen dimension default display_1col display_eps
+display_max_2d_cols display_precison display_round display_transpose
+display_width from gutter_width integer Infinity ordered obj
+objective_precision omit_zero_cols omit_zero_rows output_precision
+print_precision print_round print_seperator symbolic within
+
+$KEYWORDS(kwb)= abs acos acosh alias asin asinh atan atan2 atanh Beta ceil cos
+card Cauchy exp Exponential floor first Gamma Irand224 int log log10 last
+member Normal next nextw ord ord0 Poisson precision prev prevw round sin sinh
+sqrt tan tanh trunc Uniform Uniform01
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=#
+
+$ML_COMMENT=/* */
+
+$IGNORECASE=false
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
+
+
diff --git a/support/highlight/langDefs/amtrix.lang b/support/highlight/langDefs/amtrix.lang
new file mode 100644
index 0000000000..336ec2d670
--- /dev/null
+++ b/support/highlight/langDefs/amtrix.lang
@@ -0,0 +1,44 @@
+# AMTrix language definition file
+#
+# Author: André Simon
+# Mail: andre.simon1@gmx.de
+# Date: 02.03.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=AMTrix
+
+$KEYWORDS(kwa)=argument amtrix_logid and append arg_list arg_opt argumentcount arraysize as
+assignment begin binary bit_and bit_not bit_or bit_shift bit_xor block bounded break by
+call case catch center char charset close comments commit composite conditional constant
+constants continue control convert copy count currentdate data database date debug declare
+delete destination dir_close dir_open dir_read dir_rewind edi edi_charset edi_read_charset
+edi_read_interchange edi_truncate element else error exec execute exit export expressions
+file float for format from from_iso8859 function getopt group if import include input
+insert integer into left lock log logid loop mandatory module move ndec nolog on open
+optdta_read optdta_write optional or order others output pragma print raw_close raw_flush
+raw_open raw_read raw_seek raw_tell raw_write read readtag receive regexp relation release
+repeat reserved return right rollback scan segment select send sequence set sleep source
+sourcefile sourceline sourcemodule sourceprocedure split sql statement str_field
+str_fields str_lower str_upper strcnv strfield strfields string strlen strmid sub switch
+system table text throw to to_iso8859 trunc truncate try type types unbounded unique_id
+unique_name unlock update values variable variables while when where work writetag
+
+$STRINGDELIMITERS="
+
+$SL_COMMENT=#
+
+$ML_COMMENT=/* */
+
+$IGNORECASE=true
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
diff --git a/support/highlight/langDefs/applescript.lang b/support/highlight/langDefs/applescript.lang
new file mode 100644
index 0000000000..d26f7351be
--- /dev/null
+++ b/support/highlight/langDefs/applescript.lang
@@ -0,0 +1,51 @@
+# AppleScript language definition file
+#
+# Author: Andreas Amann
+# Mail: aamann@mac.com
+# Date: 12.3.2005
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=AppleScript
+
+$KEYWORDS(kwa)=and as at beginning considering contain contains does div else end
+equal error every exit first from get global greater if ignoring in is last local
+me mod my not of on or property reopen repeat return script set tell than the then
+to transaction try with without which while whose
+
+$KEYWORDS(kwc)=AppleScript access activate after alias application ascending ASCII at
+attached before box button buttons case cell cells character characters choose class
+close column columns content contents control controls copy count current data date
+day default delay delete delimiter descending desktop dialog display document
+documents domain duplicate enabled ends eof equal entry entries exists false field
+fields file files folder folders for icon icons indicator indicators item items
+length list load location localized make matrix menu menus missing month months name
+new number offset open order panel panels path popup print process progress
+properties quit read response row rows scroll select selected selection sheet size
+sort sorted source specification start starting stop string table text title true
+Unicode update user value visible view views window windows write year years
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS="
+
+$SL_COMMENT=--
+
+$ML_COMMENT=(* *)
+
+$ALLOWNESTEDCOMMENTS=false
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\u\d{4}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$REFORMATTING=false
diff --git a/support/highlight/langDefs/arc.lang b/support/highlight/langDefs/arc.lang
new file mode 100644
index 0000000000..29508dfe51
--- /dev/null
+++ b/support/highlight/langDefs/arc.lang
@@ -0,0 +1,64 @@
+# Arc language definition file
+#
+# Author: Pierre Larochelle
+# Mail: pierrebombay@gmail.com
+# Date: 05.25.08
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+#
+# ----------
+
+$DESCRIPTION=Arc
+
+# Function, macro, and template definitions
+$KEYWORDS(kwa)=def defhook defmem defop defops defset deftem mac
+
+# Looping
+$KEYWORDS(kwb)=drain each for forlen loop noisy-each on ontable while whiler whilet until
+
+# Conditionals
+$KEYWORDS(kwc)=case caselet check if iflet when whenlet unless
+
+# General functions
+$KEYWORDS(kwd)=aand abs accum acons addtem adjoin afn after aif alist all alphadig alref and andf annotate
+apply assert assoc atend atlet atom atomic atomic-invoke atwith atwiths avg awhen bar* before begins best
+bestn blank bound break-threadcaar cache cadr call-w/stdin call-w/stdout car carif caris catch
+ccc cddr cdr client-ip close coerce commonest compare complement compose consif conswhen copy count
+counts current-gc-milliseconds current-process-milliseconds cut date days-since dead dedup
+ deq details dir dir-exists disp do do1 dotted downcase ellipsize empty endmatch enq
+enq-limit ensure-dir ero err errsafe eval even exact expand-metafn-call expand= expand=list expt file-exists
+fill-table find findsubseq firstn firstn-that flat fn for forlen fromstring headmatch hook hooks* hours-since
+idfn in infile insert-sorted inside insort insortnew inst instring intersperse is isa isnt iso join jtime
+keep keys kill-thread last len len< len> let list listtab litmatch load load-table load-tables macex macex1
+map map1 mappend maptable max median mem memo memtable merge mergesort metafn min mismatch mod most msec multiple
+multisubst n-of new-thread newstring no nonwhite nor nthcdr num number obj odd on-err only
+ontree open-socket or orf outfile outstring pair parse-format peekc pipe-from plural point pop pos positive
+posmatch pr prall prf prn protect prs pull punc push pushnew qlen qlist quasiquote queue quit quote rand
+rand-choice rand-string random-elt range read read-table readall readb readc readfile readfile1 readline
+readstring1 reclist recstring reduce reinsert-sorted rem rep repeat rev rfn rmfile rotate round roundup rreduce
+safe-load-table saferead safeset save-table scar scdr seconds set setforms setter sig since single sleep
+socket-accept some sort split sqrt sread sref ssexpand ssyntax stderr stdin stdout string subst summing
+swap sym system table tablist temload temloadall templates* templatize temread testify thread time
+time10 to-nearest tokens tostring trav tree-subst treewise trim trues trunc tuples type union uniq
+upcase urldecode vals w/appendfile w/bars w/infile w/instring w/outfile w/outstring w/socket
+w/stdin w/stdout w/table w/uniq warn whitec wipe with withs write write-table
+writeb writec writefile1 zap
+
+$IDENTIFIER=regex([a-zA-Z_][\w\-\/]*)
+
+# The rest is taken directly from André Simon's lisp.lang definition
+$STRINGDELIMITERS="
+
+$ML_COMMENT=;| |;
+
+$SL_COMMENT=;
+
+#$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , : & < > ! + = / * '
diff --git a/support/highlight/langDefs/arm.lang b/support/highlight/langDefs/arm.lang
new file mode 100644
index 0000000000..e41eeb01a7
--- /dev/null
+++ b/support/highlight/langDefs/arm.lang
@@ -0,0 +1,48 @@
+# ARM language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 19.04.04
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=ARM
+
+$KEYWORDS(kwa)= AND and EOR eor SUB sub RSB rsb ADD add ADC adc SBC sbc RSC rsc TST
+ tst TEQ teq CMP cmp CMN cmn ORR orr MOV mov BIC bic MVN mvn LSL lsl LSR lsr
+ ASL asl ASR asr ROR ror RRX rrx NEG neg MUL mul MLA mla SMULL smull UMULL
+ umull SMLAL smlal UMLAL umlal LDR ldr STR str LDM ldm STM stm SWP swp PUSH
+ push POP pop SWI swi BKPT bkpt CLZ clz MRS mrs MSR msr CDP cdp MRC mrc MCR mcr
+ LDC ldc STC stc OPT EXT EQU DC ALIGN ADR RN FN DIV SQR SWAP VDU NOP BRK SMUL
+ UMUL SMLA UMLA LDF STF ASSERT FILL FILE COND HEAD ORG CN CP DN EXPORT GLOBAL
+ EXTERN FN GBL IMPORT KEEP LCL RLIST RN SET SN ALIGN DATA DC FIELD LTORG MAP
+ SPACE ELSE ENDIF GET INCLUDE IF INCBIN MACRO MEND MEXIT WEND WHILE ENDFUNC
+ ENDP FRAME ADDRESS POP PUSH REGISTER RESTORE SAVE STATE REMEMBER RESTORE
+ FUNCTION PROC AREA ASSERT CODE16 CODE32 END ENTRY INFO NOFP OPT REQUIRE ROUT
+ SUBT TTL VFPASSERT SCALAR VECTOR ADR FLD LDF NOP
+
+
+
+$KEYWORDS(kwb)=A1 A2 A3 A4 F0 F1 F2 F3 F4 F5 F6 F7 FP IP LR PC R0 R1 R10 R11 R12 R13
+R14 R15 R2 R3 R4 R5 R6 R7 R8 R9 SL SP V1 V2 V3 V4 V5 V6 a1 a2 a3 a4 f0 f1 f2
+f3 f4 f5 f6 f7 fp ip lr pc r0 r1 r10 r11 r12 r13 r14 r15 r2 r3 r4 r5 r6 r7 r8
+r9 sl sp v1 v2 v3 v4 v5 v6
+
+$IGNORECASE=false
+
+$STRINGDELIMITERS="
+
+$SL_COMMENT=/ ; rem REM Rem
+
+$IGNORECASE=false
+
+$SYMBOLS= ( ) [ ] { } , : & | < > ! = / * % + -
diff --git a/support/highlight/langDefs/as.lang b/support/highlight/langDefs/as.lang
new file mode 100644
index 0000000000..b160d71f50
--- /dev/null
+++ b/support/highlight/langDefs/as.lang
@@ -0,0 +1,68 @@
+# Action Script language definition file
+# Based upon syntax file for EditPlus written by Aqeel A Malik
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 20.11.2003
+# Update: 28.11.2007
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Action Script
+
+$KEYWORDS(kwa)=FCheckBox FComboBox FListBox FPushButton FRadioButton FScrollBar FScrollPane FStyleFormat getEnabled getLabel getValue registerSkinElement setChangeHandler setEnabled
+setLabel setLabelPlacement setSize setStyleProperty setValue addItem addItemAt getItemAt getLength getRowCount getScrollPosition getSelectedIndex getSelectedItem removeAll
+removeitemAt replaceItemAt setDataProvider setEditable setItemSymbol setRowCount setSelectionIndex sortItemsBy getSelectedIndices getSelectedItems getSelectMultiple
+setAutoHideScrollBar setScrollPosition setSelectedIndex setSelectedIndices setSelectMultiple setWidth setClickHandler getGroupName setGroupName getData getState setData setState
+setScrollTarget setSmallScroll setScrollProperties setHorizontal setLargeScroll getPaneHeight getPaneWidth getScrollContent loadScrollContent refreshPane setDragContent
+setHScroll setScrollContent setVScroll globalStyleFormat addListener applyChanges removeListener arrow background backgroundDisabled check darkshadow embedFonts face
+focusRectInner focusRectOuter foregroundDisabled highlight highlight3D radioDot ScrollTrack selection selectionDisabled selectionUnfocused shadow textAlign textBold textColor
+textDisabled textFont textIndent textItalic textLeftMargin textRightMargin textSelected textSize textUnderline
+
+
+$KEYWORDS(kwb)=abs acos add and appendChild Array asin atan atan2 attachMovie attachSound attributes BACKSPACE Boolean break call CAPSLOCK ceil charAt charCodeAt childNodes chr
+cloneNode close Color concat connect constructor continue CONTROL cos createElement createTextNode Date delete DELETEKEY do docTypeDecl DOWN duplicateMovieClip E else END ENTER
+eq ESCAPE escape eval evaluate exp false firstChild floor for fromCharCode fscommand function ge getAscii getBeginIndex getBounds getBytesLoaded getBytesTotal getCaretIndex
+getCode getDate getDay getEndIndex getFocus getFullYear getHours getMilliseconds getMinutes getMonth getPan getProperty getRGB getSeconds getTime getTimer getTimezoneOffset
+getTransform getURL getUTCDate getUTCDay getUTCFullYear getUTCHours getUTCMilliseconds getUTCMinutes getUTCMonth getUTCSeconds getVersion getVolume getYear globalToLocal
+gotoAndPlay gotoAndStop gt hasChildNodes hide hitTest HOME if ifFrameLoaded in indexOf Infinity INSERT insertBefore int isDown isFinite isNaN isToggled join Key lastChild
+lastIndexOf le LEFT length LN10 LN2 load loaded loadMovie loadVariables localToGlobal log LOG10E LOG2E lt Math max MAX_VALUE maxscroll mbchr mblength mbord mbsubstring min
+MIN_VALUE Mouse MovieClip NaN ne NEGATIVE_INFINITY new newline nextFrame nextScene nextSibling nodeName nodeType nodeValue not null Number Object onClipEvent onClose onConnect
+OnLoad onXML or ord parentNode parseFloat parseInt parseXML PGDN PGUP PI play pop POSITIVE_INFINITY pow prevFrame previousSibling prevScene print printAsBitmap push random
+removeMovieClip removeNode return reverse RIGHT round scroll Selection send sendAndLoad set setDate setFocus setFullYear setHours setMilliseconds setMinutes setMonth setPan
+setProperty setRGB setSeconds setSelection setTime setTransform setUTCDate setUTCFullYear setUTCHours setUTCMilliseconds setUTCMinutes setUTCMonth setUTCSeconds setVolume
+setYear shift SHIFT show sin slice sort Sound SPACE splice split sqrt SQRT1_2 SQRT2 start startDrag status stop stopAllSounds stopDrag String substr substring swapDepths TAB tan
+targetPath tellTarget this toggleHighQuality toLowerCase toString toUpperCase trace true typeof unescape unloadMovie unshift UP updateAfterEvent UTC valueOf var while with void
+XML xmlDecl XMLSocket apply Arguments asfunction beginFill beginGradientFill blockIndent bullet Button callee caller capabilities case check clear clearInterval contentType
+createEmptyMovieClip createTextField curveTo default docTypeDecl duration ^#endinitclip embedFonts enabled endFill face font foregroundDisabled _global gloablStyleFormat
+hasAccessibility hasAudio hasAudioEncoder hasMP3 hasVideoEncoder height hitArea hscroll html htmlText ignoreWhite indent ^#initclip install instanceof isActive italic language
+leading leftMargin lineStyle lineTo list loadMovieNum loadScrollContent loadSound loadVariablesNum LoadVars manufacturer method moveTo multiline onChanged onData onDragOut
+onDragOver onEnterFrame onKeyDown onKeyUp onKillFocus onMouseDown onMouseMove onMouseUp onPress onRelease onReleaseOutside onResize onRollout onRollOver onScroller onSetFocus
+onSort onSoundComplete onUnload os password pixelAspectRatio position printAsBitmapNum printNum registerClass resolutionX resoultionY restrict scaleMode screenColor screenDPI
+screenResolution size super switch System target textWidthtrackAsMenu type undefined underline uninstall unLoadMovieNum unwatch url useHandCursor variable version watch width
+wordWrap class import public private protected void
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS="
+
+$SL_COMMENT=//
+
+$ML_COMMENT=/* */
+
+$ALLOWNESTEDCOMMENTS=true
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + - .
diff --git a/support/highlight/langDefs/asm.lang b/support/highlight/langDefs/asm.lang
new file mode 100644
index 0000000000..3172a085c9
--- /dev/null
+++ b/support/highlight/langDefs/asm.lang
@@ -0,0 +1,55 @@
+# Assembler language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 6.1.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Assembler
+
+$KEYWORDS(kwa)= aaa aad aam aas adc add and arpl bound bsf bsr bswap bt btc btr bts call cbw cdq clc
+cld cli clts cmc cmp cmps cmpsb cmpsd cmpsw cmpxchg cwd cwde daa das dec div enter esc f2xm1 fabs
+fadd faddp fbld fbstp fchs fclex fcom fcomp fcompp fcos fdecstp fdisi fdiv fdivp fdivr fdivrp feni
+ffree fiadd ficom ficomp fidiv fidivr fild fimul fincstp finit fist fistp fisub fisubr fld fld1
+fldcw fldenv fldl2e fldl2t fldlg2 fldln2 fldpi fldz fmul fmulp fnclex fndisi fneni fninit fnop
+fnsave fnstcw fnstenv fnstsw fpatan fprem fprem1 fptan frndint frstor fsave fscale fsetpm fsin
+fsincos fsqrt fst fstcw fstenv fstp fstsw fsub fsubp fsubr fsubrp ftst fucom fucomp fucompp fwait
+fxam fxch fxtract fyl2x fyl2xp1 hlt idiv imul in inc insb insd insw int into invd invlpg iret iretd
+ja jae jb jbe jc jcxz je jecxz jg jge jl jle jmp jna jnae jnb jnbe jnc jne jng jnge jnl jnle jno
+jnp jns jnz jo jp jpe jpo js jz lahf lar lds lea leave les lfs lgdt lgs lidt lldt lmsw lock lods
+lodsb lodsd lodsw loop loopd loopde loopdne loopdnz loopdz loope loopne loopnz loopz lsl lss ltr
+mov movs movsb movsd movsw movsx movzx mul neg nop not or out outsb outsd outsw pop popa popad
+popf popfd push pusha pushad pushf pushfd rcl rcr rep repe repne repnz repz ret retf retn rol ror
+sahf sal sar sbb scas scasb scasd scasw segcs segds seges segfs seggs segss seta setae setb setbe
+setc sete setg setge setl setle setna setnae setnb setnbe setnc setne setng setnge setnl setnle
+setno setnp setns setnz seto setp setpe setpo sets setz sgdt shl shld shr shrd sidt sldt smsw stc
+std sti stos stosb stosd stosw str sub test verr verw wait wbinvd xadd xchg xlat xor assume
+omment db dd dq dt dw end endm endp ends eq equ exitm ex trn far ge group gt include label large
+le length local lt macro mask name near org page proc public purge record rept seg segment short
+size small struc subttl symtype this title width
+
+$KEYWORDS(kwb)= ah al and ax bh bl bp bx byte ch cl cs cx dh di dl ds dword dx eax ebp ebx ecx edi edx
+eip es esi esp fs gs high low mod not offset or ptr qword shl shr si sp ss st tbyte type word xor
+
+$DIGIT=regex((?:0x|0X)[0-9a-fA-F]+|\d*[\.\_]?\d+(?:[eE][\-\+]\d+)?[hHlLuU]*)
+
+$SL_COMMENT=;
+
+# for Pascal inline assembly
+$ML_COMMENT={ }
+
+$STRINGDELIMITERS=" '
+
+$IGNORECASE=true
+
+$SYMBOLS= ( ) [ ] , : & | < > ! = / * % + - @
diff --git a/support/highlight/langDefs/asp.lang b/support/highlight/langDefs/asp.lang
new file mode 100644
index 0000000000..f83a2607f4
--- /dev/null
+++ b/support/highlight/langDefs/asp.lang
@@ -0,0 +1,35 @@
+# ASP language definition file
+#
+# Author: Andr?Simon
+# Mail: andre.simon1@gmx.de
+# Date: 19.11.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=ASP
+
+$KEYWORDS(kwa)=and response write case select continue date dim server
+createobject do if else end empty then next set
+default movenext open close activeconnection false true BOF
+eof each for sub function len cstr include
+cdbl cdate is null object redirect request querystring exit
+clng redim session form not nothing loop while
+
+$STRINGDELIMITERS="
+
+$SL_COMMENT='
+
+$IGNORECASE=true
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
diff --git a/support/highlight/langDefs/aspect.lang b/support/highlight/langDefs/aspect.lang
new file mode 100644
index 0000000000..9141914022
--- /dev/null
+++ b/support/highlight/langDefs/aspect.lang
@@ -0,0 +1,148 @@
+# Abstract language definition file
+#
+# Author: André Simon
+# Mail: andre.simon1@gmx.de
+# Date: 04.03.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Abstract
+
+$KEYWORDS(kwa)=addfilename alarm ansitokey ansitooem atof atoi atol beep bitmap
+bitmapbkg break breakpoint call capture capturestr case ceil chain chdir
+checkbox clear clearxoff cliptofile cliptostr combobox comgetc commandmode
+compile computc comread comwrite connect connectmanual copyfile crc16 ddeadvise
+ddeexecute ddeinit ddepoke dderequest ddeterminate ddeunadvise decrypt default
+delfile dial dialadd dialcancel dialclass dialcount dialcreate dialdelete
+dialfind dialinsert dialload dialname dialnumber dialogbox dialsave dialstats
+dir dirlistbox dirpath disable disconnect diskfree dlgctrlwin dlgdestroy
+dlgevent dlgexists dlglist dlgsave dlgshow dlgupdate dlgwin dlgwinctrl dllcall
+dllfree dllload dllobject dllobjfile dllobjupdt dos editbox elifdef has failed.
+else elseif enable encrypt endcase enddialog endfor endfunc endgroup endif
+endproc endswitch endwhile errormsg execute exit exitfor exitswitch exitwhile
+exitwindows faxcancel faxlist faxmodem faxpoll faxprint faxremove faxsend
+faxstatus faxview fclear fclose fcombobox fdelblock feditbox feof ferror fetch
+fflush fgetc fgets fileget fileset filetoclip fileview findfirst findnext
+finsblock firsttask flength flistbox float floor fopen for fputc fputs fread
+fseek fstrfmt ftell ftext ftoa ftp ftruncate fullpath func fwrite getcur getdir
+getenv getfile getfilename getpathname getvolume goto groupbox halt hangup help
+hotspot icon iconbutton if integer intsltime isfile itemcount itemcreate
+itemfind itemname itemremove itoa kermserve keyflush keyget keystate keytoansi
+keytooem listbox locate long longjmp loopfor loopwhile ltimeelapsed ltimeints
+ltimemisc ltimestring ltimestrs ltoa makepath mapisend mciexec mcisend
+memaddress memalloc memavail memchr memcmp memfree memgetc memicmp memmove
+memputc memread memrealloc memset memsize memwrite menubar menucheck menuitem
+menuitemcount menupopup menupopupid menuselect menushow menushowpopup menustate
+metafile metafilebkg metakey mkdir monthstr mspause nexttask nullstr numtostr
+objcoord objhide objmove objpaint objpointid objremove objshow oemtoansi
+oemtokey param pastetext pause pkmode pkrecv pksend playback printalign
+printattr printcapture printchar printer printfit printfont printmargin
+printstr printtabs printtabstr proc profilerd profilewr pushbutton putenv
+pwexit pwmode pwtitlebar radiobutton radiogroup rand rename return rewind rget
+rmdir rstrcmp run rxflush sbsave screentowin sdlgfopen sdlginput sdlgmsgbox
+sdlgsaveas sendfile sendkey sendkeystr sendvkey set setjmp setpointer setup
+shell shortpath snapshot splitpath statclear statmsg strcat strchr strcmp
+strcpy strcspn strdelete strextract strfind strfmt strgetc stricmp string
+strinsert strlen strlwr strncmp strnicmp strputc strquote strrchr strread
+strreplace strrev strright strsearch strset strsltime strspn strtoclip strtok
+strtonum strupdt strupr strwrite substr switch taskactivate taskexists taskexit
+taskname taskpath taskwin termgetc termgets termkey termmsg termputc termputs
+termreadc termreads termreset termvkey termwritec termwrites text transmit
+txflush usermsg uwincreate uwinpaint uwinremove uwutowin waitfor waitquiet
+waituntil weekdaystr when while winactivate winclose wincoord winenabled
+winexists winfocus winhide winmaximize winminimize winmove winowner winrestore
+winshow winsize winstate wintask wintext wintoscreen wintouwu winvisible wizard
+xfercancel xlatin xlatout xlatstr
+
+$KEYWORDS(kwb)=abortdnld abortretry access action actionbar adaptive19200
+adaptiveans addcallinfo address adds60 adds90 adm31 adm3a adm5 alarmtime alt
+altctrl altctrlshift alternate altshift always anonymouslogon ansibbs ansrings
+append areacode ascii asciixlat aspdebug aspect aspectpath aspfile aspline
+aspmenu aspversion att4410 att605 attribute auto autoansoff autoanswer autobaud
+autodnld autologon autoreliable autosize autostart background backspace
+baudrate begin betweencalls binary binarymode bit8mode bit8quote blankexpand
+blinkrate block blockcheck blockcursor blockmode blockstart bold bottom
+breaklen by callerid calleridoff calltype callwaiting callwaitoff cancel
+cardnum cdinxfer cellular center character charpace charset chatmode cisb class
+class1 class2 clipboard clipchar clipfilermv close closed cmdsuffix cnctmsg
+code codepage colors columns com1 com2 com3 com4 com5 com6 com7 com8 com9
+company complete completed connectall connected connection contents control
+conventional converter countrycode coversheet cr crashrecover crc crc32 create
+crlfxlat crlf_etx cr_lf cslipcompress ctrl ctrlquote ctrlshift current
+cursorkeyapp cursorpos data database databits datafax datakey date dblclick dec
+decimal declinewrap delay delete delline delpages dest device dgd100 dgd200
+dgd210 dialacalways dialacforld dialcmd dialdir dialed dialentry dialingbox
+dialog dialspeed dim direct disabled disk display distinctring dlgctrl dnld
+dnldpath dnldprompt dnsaddress downto dropdown dropdownlist dropdtr duplex
+dynamic echo ecm editor elapsed endsequence enquiry enquirystr entercrlf
+enterkey entry entrynum environment eolchar eolconvert eolstr eot errorcorrect
+errordetect escapem esprit3 etx even exact exclamation expand extended f0 f1 f2
+f3 f4 f5 f6 f7 f8 f9 failure fast fax faxnumber file filelist filetype filexfer
+filexferbox filter filtered finish first fixed flowcontrol flush font fontname
+fontsize footer forever frame full global group half hardflow hardware header
+heath19 helpfile hidden high hold homepage host hostdir hostprint hosttype
+hotkeys hscroll html i0 i1 i2 i3 i4 i5 i6 i7 i8 i9 ibm3101 ibm3161 ibm3270
+ibmpc iconflash iconpath inbox incnctlist incremental ind$file information init
+insert internal internet intl intlprefix into ipaddress ipaddresstype ipport
+iskey iso italic item keep kermit keyboardfile keypadapp keys l0 l1 l2 l3 l4 l5
+l6 l7 l8 l9 landscape ldlineout ldprefix left length lf linepace linetype
+linewrap lmouse local localdir locked loclineout logging logonname logontimeout
+logout longdistance longfilename low lrecl ltime mail manager margins mark
+masked matchcase maximized maxlength medium memload memo memory memtotal menu
+metakeyfile metakeys method minimized misc miscnum mnp4 mnp5 mode modem
+mousecoord multiline multiple multipleconnect music mvs_tso nameprefix
+negotiate negotiation never newer news next no nocnctmsg noerrorcorrect
+noncontig nondest none nopaint normal not notes notesfile notespath
+nullsuppress numberprefix odd off offdial offset ok okcancel on once onuntilcd
+onverify open options organization orientation origtime other outbox overwrite
+pacechar pacelines pacing packetsize padchar padnum pagenumbers pageupdate
+paging parent parity passivemode password path pattern pausechar permanent
+phonecard phonenumber physical pinnum pixels playbackpace popup port portrait
+ppp prefix print program prompt proprietary protect protectattr protocol pulse
+pwmenu query question quickoption quickselect quiet raw rawascii rawprint read
+readappend readwrite reboot receive received receiver recfm recordmode recvbaud
+recvcmd recvprint recvview recycle relaxed remote remotecmd remove repaint
+replyaddress reset restart restore resume retainfiles retries retrycancel
+retrydelay reverse reversebit rgetchar right ringmsg rip rmouse rmvpolled rows
+rxcr rxdata s0 s1 s2 s3 s4 s5 s6 s7 s7cmd s8 s9 save sbbuffer sbpages scale
+scheduled screen scriptfile scriptpath scriptstart scroll scrollmethod search
+security select send sendcmd sendcr sender sendpolled sent separator
+serveraddress servicenum shared shift short showfaxstatus sierra signaturefile
+simple single size skip slip slow softflow software sort space spawn speaker
+stationid statusattr statusline stop stopbits streaming strip stripbit8 style
+subnetmask success suffix suspend tabexpand tabkey tabstops target telnet
+termcolors termfont terminal terminalid tight tiled time timeout timestamp
+timing tone tooltips top topic translate tty turnchar tvi910 tvi912 tvi920
+tvi922 tvi925 tvi950 tvi955 txmethod txpace type underline unselect until
+update upld upldpace upldpath upto uselrecl usepacechar usephonecard userecfm
+userexit userid username userwin us_cr uwus v23 v42 variable vidtex viewcursor
+viewgif viewgraphics virtual visual vm_cms voice voicenumber volume vt100 vt102
+vt220 vt320 vt52 waitcnct wavefile whensuspend whentarget wincolors window with
+word write wyse100 wyse50 wyse60 wyse75 xfermode xferyield xmitbaud xmodem xoff
+xwindow yes yesno yesnocancel ymodem ymodemg zmodem
+
+#$KW_PREFIX(kwb)=$
+$KEYWORDS(kwb)=regex(\$\w+)
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=;
+
+$ML_COMMENT= #comment #endcomment
+
+$IGNORECASE=true
+
+$DIRECTIVE=#
+
+$ESCCHAR=regex(`\d{3}|`x\d{2}|^[ntvbrfa`\?'"])
+
+$SYMBOLS= ( ) [ ] { } , : & | < > ! = / * % + -
diff --git a/support/highlight/langDefs/ats.lang b/support/highlight/langDefs/ats.lang
new file mode 100644
index 0000000000..c520a654aa
--- /dev/null
+++ b/support/highlight/langDefs/ats.lang
@@ -0,0 +1,52 @@
+# ATS language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 04.06.2009
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Applied Type System
+
+$DIRECTIVE=#
+
+$KEYWORDS(kwa)=and as assert asr begin class constraint do done downto else
+end exception external false for fun function functor if in include inherit
+initializer land lazy let lor lsl lsr lxor match method mod module mutable new
+object of open or private rec sig struct then to true try type val virtual when
+while with value
+staload macdef typedef static inline return extern implement
+
+# Types and type variables
+$KEYWORDS(kwb)=bool string int real word float unit option ref
+$KEYWORDS(kwb)=regex('[a-zA-Z0-9_']+)
+
+# Modules
+$KEYWORDS(kwc)=regex(\b[A-Z][a-zA-Z0-9_']*(?=\.))
+
+# Constructors
+$KEYWORDS(kwd)=regex(\b[A-Z][a-zA-Z0-9_']*)
+
+$STRINGDELIMITERS=" '
+
+$ML_COMMENT=/* */ (* *)
+
+$SL_COMMENT=//
+
+$ALLOWNESTEDCOMMENTS=true
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = _ * % + - . ^
+
+$DIGIT=regex((?:0x|0X|0b|0B)[0-9a-fA-F]+|\d*[\.\_]?\d+(?:[eE][\-\+]\d+)?[lLuUbfdm]*)
diff --git a/support/highlight/langDefs/au3.lang b/support/highlight/langDefs/au3.lang
new file mode 100644
index 0000000000..90c6f340b7
--- /dev/null
+++ b/support/highlight/langDefs/au3.lang
@@ -0,0 +1,67 @@
+# AutoIt 3 language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 28.05.06
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=AutoIt
+
+$KEYWORDS(kwa)=continueloop dim global local const do until exit exitloop for next
+func return endfunc if then elseif else endif redim select case endselect while wend
+
+#include-once
+#include
+#NoTrayIcon
+
+$KEYWORDS(kwb)=abs acos adlibdisable adlibenable asc asin assign atan autoitsetoption autoitwingettitle autoitwinsettitle bitand bitnot bitor bitshift bitxor
+blockinput break call cdtray chr clipget clipput consolewrite controlclick controlcommand controldisable controlenable controlfocus controlgetfocus
+controlgethandle controlgetpos controlgettext controlhide controllistview controlmove controlsend controlsettext controlshow cos dec dircopy
+dircreate dirgetsize dirmove dirremove dllcall dllclose dllopen drivegetdrive drivegetfilesystem drivegetlabel drivegetserial drivegettype
+drivemapadd drivemapdel drivemapget drivesetlabel drivespacefree drivespacetotal drivestatus envget envset envupdate eval exp filechangedir
+fileclose filecopy filecreateshortcut filedelete fileexists filefindfirstfile filefindnextfile filegetattrib filegetlongname filegetshortcut
+filegetshortname filegetsize filegettime filegetversion fileinstall filemove fileopen fileopendialog fileread filereadline filerecycle
+filerecycleempty filesavedialog fileselectfolder filesetattrib filesettime filewrite filewriteline ftpsetproxy guicreate guictrlcreateavi
+guictrlcreatebutton guictrlcreatecheckbox guictrlcreatecombo guictrlcreatecontextmenu guictrlcreatedate guictrlcreatedummy guictrlcreateedit
+guictrlcreategroup guictrlcreateicon guictrlcreateinput guictrlcreatelabel guictrlcreatelist guictrlcreatelistview guictrlcreatelistviewitem
+guictrlcreatemenu guictrlcreatemenuitem guictrlcreatepic guictrlcreateprogress guictrlcreateradio guictrlcreateslider guictrlcreatetab
+guictrlcreatetabitem guictrlcreatetreeview guictrlcreatetreeviewitem guictrlcreateupdown guictrldelete guictrlgetstate guictrlread guictrlrecvmsg
+guictrlsendmsg guictrlsendtodummy guictrlsetbkcolor guictrlsetcolor guictrlsetcursor guictrlsetdata guictrlsetfont guictrlsetimage guictrlsetlimit
+guictrlsetonevent guictrlsetpos guictrlsetresizing guictrlsetstate guictrlsetstyle guictrlsettip guidelete guigetcursorinfo guigetmsg guisetbkcolor
+guisetcoord guisetcursor guisetfont guisethelp guiseticon guisetonevent guisetstate guistartgroup guiswitch hex hotkeyset httpsetproxy inetget
+inetgetsize inidelete iniread inireadsection inireadsectionnames iniwrite inputbox int isadmin isarray isdeclared isfloat isint isnumber isstring
+log memgetstats mod mouseclick mouseclickdrag mousedown mousegetcursor mousegetpos mousemove mouseup mousewheel msgbox number ping pixelchecksum
+pixelgetcolor pixelsearch processclose processexists processlist processsetpriority processwait processwaitclose progressoff progresson progressset
+random regdelete regenumkey regenumval regread regwrite round run runasset runwait send seterror setextended shutdown sin sleep soundplay
+soundsetwavevolume splashimageon splashoff splashtexton sqrt statusbargettext string stringaddcr stringformat stringinstr stringisalnum
+stringisalpha stringisascii stringisdigit stringisfloat stringisint stringislower stringisspace stringisupper stringisxdigit stringleft stringlen
+stringlower stringmid stringreplace stringright stringsplit stringstripcr stringstripws stringtrimleft stringtrimright stringupper tan timerdiff
+timerinit tooltip traytip ubound winactivate winactive winclose winexists wingetcaretpos wingetclasslist wingetclientsize wingethandle
+wingetpos wingetprocess wingetstate wingettext wingettitle winkill winlist winmenuselectitem winminimizeall winminimizeallundo winmove winsetontop winsetstate winsettitle winsettrans winwait winwaitactive winwaitclose winwaitnotactive
+
+$KEYWORDS(kwc)=regex([@$]\w+)
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$ML_COMMENT=#comments-start #comments-end #cs #ce
+
+$SL_COMMENT=;
+
+$DIRECTIVE=regex(#(?!cs|ce|comments\-start|comments\-end).*$, 0)
+
+$IGNORECASE=true
+
+$SYMBOLS= ( ) [ ] { } , . : & | < > ! = / * % + - ~
+
diff --git a/support/highlight/langDefs/avenue.lang b/support/highlight/langDefs/avenue.lang
new file mode 100644
index 0000000000..c607d0cecf
--- /dev/null
+++ b/support/highlight/langDefs/avenue.lang
@@ -0,0 +1,244 @@
+# Avenue language definition file
+#
+# Author: André Simon
+# Mail: andre.simon1@gmx.de
+# Date: 04.03.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Avenue
+
+$KEYWORDS(kwa)=break continue CR each end exit false for if in nil NL return TAB then true while
+Abs ACos Activate Add AddAnnoFields AddBatch AddBreak AddDefaultOwner AddDialog AddDoc AddFields AddGUI AddListener AddMissingRules AddName AddRecord
+AddScript AddTheme AddUser AdjustBlue AdjustGreen AdjustRed AdjustSaturation AdjustValue AlignSelected AllowIntersections AllYesNo Along And Apply Area
+ArrangeIcons AsASCII AsChar AsDate AsDays AsDegrees AsEncrypted AsEnum AsFileName AsHexString AsHours ASin AsLine AsLineM AsLineZ AsList AsMinutes
+AsMultiPoint AsMultiPointM AsMultiPointZ AsNumber AsPattern AsPoint AsPointM AsPointZ AsPolygon AsPolygonM AsPolygonZ AsPolyLine AsPolyLineM AsPolyLineZ
+AsRadians AsRectM AsSeconds AsSecondsOld AsSrcName AsString AsTemplate AsTokens AsWeeks AsYears AutoComplete
+Banner BasicEcho BasicPaste BasicProper BasicSetFasteners BasicTrim BatchMatch Beep BeginClip BeginTransaction BlinkRecord BlinkRow BreakExists
+BroadcastUpdate BuildBandStatistics BuildQuery By
+CalcHorizon Calculate CanAddFields CanAddRecord CancelEditing CanConvertOverlappingLabels CanDelete CanDeleteFromView CanDoCustom CanDoIntersections
+CanDoSpheroid CanEdit CanEditText CanExportToFTab CanFindByPoint CanHotLink CanLabel CanMake CanManageDataSet CanModifyIndex CanProject CanRedo
+CanRemoveFields CanRemoveRecords CanRestoreGraphic CanReturnClassCounts CanSelect CanSetSize CanSetup CanSimplify CanTransform CanUndo CanUndoErase
+CanUndoZoom CanUnload CanUnloadLibrary CascadeWindows Ceiling Changed ChangedListeners ChoiceAsString Clean Clear ClearAll ClearAllBreaks ClearBreak
+ClearGlobals ClearMsg ClearRange ClearSelected ClearSelection ClearStatus ClearStyles ClearTransforms ClearUndoStack ClearWorkingStatus Click
+ClipSelected Clone Close CloseAll ColumnChart Commit Compile Connect ConstrainBounds Contains ContainsCenter ContainsFile Context Convert ConvertArea
+ConvertDecimalDegrees ConvertOverlappingLabels ConvertRecordToRow ConvertRowToRecord Copy CopySelected CopyThemes Cos Count CountLines CountParts
+CreateIndex Customize CutSelected CutThemes
+DeActivate DeepClone DefineFromDictionary DefineFromInterval DefineFromList DefineFromVTab DefineUniqueFromVTab DelayedRun Delete DeleteColumns
+DeleteRows DeleteTheme DeleteUserPoint Depth DetachFromExtension Difference DisableRedraw DisableZoomUndo DisplayNoDataClass Distance DoIt Dot
+DotProduct Draw DrawCircle DrawEllipse DrawGeoCurve DrawHandles DrawIcon DrawLabeledRect DrawLegend DrawLine DrawMultiPoint DrawOval DrawPoint
+DrawPolygon DrawPolyLine DrawRect DrawSel DrawShape DrawSymbolSample DrawText DrawTextLine DrawTextPolyLine
+Echo Edit EditChartPart EditLegend EditMatch EditName EditProfile EditProperties EditProps EditSizeAndPos EditTable EditText EditValues Empty
+EnableRedraw EnableZoomUndo EncryptScripts EndBatch EndClip EndMatch EndTransaction Equals Erase EraseWithPolygon Error ErrorHelp Execute Exists
+ExistsInPaths ExpandBy Explode Export ExportClean ExportEnd ExportProjected ExportStartFN ExportStartParams ExportToBMP ExportToFile ExportToFTab
+ExportToGeoJPEG ExportToGIF ExportToJPEG ExportUnprojected Extract
+FileExists FillFrames Find FindAllByClass FindAllByLocation FindAllByName FindAllByObjectTag FindBestStyle FindByClass FindByLocation FindByName
+FindByObjectTag FindByPoint FindByScript FindByValue FindDialog FindDoc FindField FindGUI FindGUIsFor FindProc FindScript FindSize FindStr FindStyle
+FindTheme FindThemeByClass FitColumns FitRows FixExtent FlashShape Flip FlipPart Floor Flush Focus FocusLost FormattedEquals FromList
+Get GetAbout GetActionScript GetActionUpdateScript GetActivate GetActive GetActiveDoc GetActiveField GetActiveGUI GetActiveThemes GetActiveWin GetAlias
+GetAliasTable GetAlignment GetAltitude GetAltSize GetAngle GetAnnoAddFieldsPreference GetApply GetArch GetAttrUpdateRules GetAutoLabels GetAuxIncrement
+GetAvailableMemory GetAVFile GetAVProcessID GetBackgroundSymbol GetBand GetBaseName GetBaseTableClass GetBaseTableFileName GetBestCand GetBgColor
+GetBgSym GetBlack GetBlue GetBlueBand GetBottom GetBounds GetBoundsMax GetBoundsMin GetBroadcaster GetButtonBar GetButtons GetCanUnloadScript
+GetCapStyle GetChanged GetCharacter GetCharSpacing GetChart GetChartDisplay GetChartLegend GetChoice GetClass GetClassesFile GetClassifications
+GetClassName GetClassType GetClick GetClose GetCloseScript GetCodepage GetCodepageConvert GetColor GetColorLock GetColumnCount GetColumnWidth
+GetComments GetComponents GetConstraint GetControl GetControlPanel GetControls GetControlSet GetCoordinatePrecision GetCreationDate GetCreator
+GetCrossGroup GetCrossValue GetCurrentColumn GetCurrentField GetCurrentLocation GetCurrentRecord GetCurrentRow GetCurrentTopic GetCurrentValue GetCWD
+GetCyan GetDataSetName GetDataSource GetDateFormat GetDay GetDayOfMonth GetDayOfYear GetDefAliasTable GetDefault GetDefaultButton GetDefaultSymbol
+GetDefBitmap GetDefFormat GetDefinition GetDefOffset GetDefSqueeze GetDefStylesODB GetDensity GetDependencies GetDepth GetDialog GetDialogs
+GetDictionary GetDigitTics GetDimension GetDisplay GetDisplayField GetDisplayQuality GetDistanceUnits GetDivisions GetDocActivate GetDocBaseName
+GetDocs GetDocsWithGroupGUI GetDocsWithGUI GetDocument GetDotDensity GetDotSymbol GetDrag GetEditableTheme GetEditString GetEmpty GetEnvVar GetEolType
+GetErrorID GetErrorMsg GetErrorPos GetErrorReporting GetErrorTopic GetEuler GetEventField GetEventRouteId GetEventTable GetExplicitExtensions
+GetExtension GetExtensions GetExtensionWin GetExtent GetExtVersion GetFamily GetFeatureSymbol GetFeatureWeight GetField GetFieldLabel GetFieldNames
+GetFieldNamesVisible GetFields GetFile GetFileDescriptorLimit GetFileName GetFiles GetFillObject GetFindString GetFixedSizeText GetFlip GetFlushCount
+GetFocusLost GetFont GetFormat GetFormatUseCount GetFramedDoc GetFramedDocClass GetFrameObjs GetFromField GetFTab GetFullName GetGraphics GetGray
+GetGreen GetGreenBand GetGroupGap GetGroupGUI GetGroupLabel GetGUI GetGUINames GetGUIs GetHAlign GetHeight GetHelp GetHelpTopic GetHorizon GetHotField
+GetHotScriptName GetHours GetIcon GetImgSrc GetIncrement GetIndex GetIndexPath GetInstallScript GetIntensity GetInteractiveSnapTolerance GetInterval
+GetIntervals GetJobName GetJoinField GetJoinStyle GetJulianDate GetJustification GetKey GetLabel GetLabelField GetLabelPoint GetLabelSize
+GetLabelTextSym GetLabelWeight GetLastAddress GetLastSelection GetLastViewDoc GetLastZone GetLeft GetLegend GetLegendEditorScript GetLegendLineFlatness
+GetLegendType GetLengthsAtM GetLevel GetLibrarianName GetLicensedSite GetLicensedUser GetLineOffset GetLinePlacement GetLineSpacing GetList GetListeners
+GetLoadAverage GetLoadBalance GetLoadScript GetLocation GetLockError GetLook GetLower GetM GetMagenta GetMainIncrement GetMajorGridSpacing GetMapDisplay
+GetMark GetMarkLayerX GetMarkLayerY GetMatchFields GetMatchPref GetMatchSource GetMatchSourceRec GetMatchSourceRec2 GetMAtLength GetMAtPosition GetMax
+GetMaxScore GetMaxSize GetMaxUndoTransactionSize GetMaxValue GetMean GetMeasureField GetMenuBar GetMForPoint GetMilliseconds GetMin GetMinimum
+GetMinorGridSpacing GetMinSize GetMinutes GetMinValue GetMKeyZone GetModalResult GetMode GetMonth GetMonthOfYear GetMouseLoc GetName GetNewScript
+GetNewUpdateScript GetNext GetNextControl GetNextDoc GetNextRecord GetNextSet GetNormFieldName GetNormType GetNthCand GetNthField GetNull GetNullSymbol
+GetNullValue GetNumBands GetNumberFormat GetNumCands GetNumClasses GetNumColumns GetNumFields GetNumGroups GetNumImages GetNumRecords GetNumRows
+GetNumSelRecords GetNumSeries GetNumStdDev GetNumValues GetObjectTag GetODBGUINames GetODBVersion GetOffset GetOffsetField GetOlColor GetOlWidth GetOpen
+GetOpenScript GetOpenUpdateScript GetOrigin GetOS GetOSVariant GetOutFileName GetOverlapLabelColor GetOwner GetPalette GetPanel GetPassword GetPath
+GetPenSize GetPi GetPixelWidth GetPoint GetPointsFromDig GetPopups GetPos GetPosition GetPositionsAtM GetPrecision GetPredefined GetPref GetPreferences
+GetPreserveInterval GetPrevSet GetProcs GetProject GetProjection GetProjections GetProjectSaveScript GetPuckClick GetPuckLoc GetQuality GetRadius
+GetRangeApply GetRangeSelect GetRangeType GetRatRouteId GetRecordLabelField GetRed GetRedBand GetRedImageLookup GetRefresh GetRefreshRate GetRefScale
+GetRemainActiveState GetResolution GetResultBitmap GetResultField GetRgbList GetRight GetRightToLeft GetRmsDigErr GetRmsMapErr GetRotationFieldName
+GetRouteSys GetRowCount GetRowHeight GetSaveAsUNIX GetScore GetScript GetScripts GetSearchPaths GetSearchString GetSeconds GetSelColor GetSelect
+GetSelected GetSelectedDocs GetSelectedExtent GetSelectedGUI GetSelection GetSelectionStyle GetSelectMode GetSerialNumber GetSeriesColor GetSeriesLabel
+GetSeriesOverlap GetServer GetServerActivated GetServerClosed GetServerDeactivated GetServerDefinitionChanged GetServerOpened GetServerRecordsAdded
+GetServerRecordsDeleted GetServerSelectionChanged GetShape GetShapeClass GetShortcut GetShowStatus GetShutDown GetSiblingList GetSiblings GetSide
+GetSize GetSizeFieldName GetSizeInches GetSnapTolerance GetSource GetSpacing GetSpheroid GetSpheroidName GetSqueeze GetSrcName GetStandardDeviation
+GetStanRules GetStartUp GetStatus GetStipple GetStyle GetStyles GetSubName GetSymbol GetSymbols GetSymbolWin GetSysDefault GetTag GetTemplate GetText
+GetTextPositioner GetTextRatio GetTextType GetThemes GetThreshold GetTicDigList GetTicMapList GetTimeAsSeconds GetTimeout GetTitle GetTmpDir GetTOC
+GetTOCWidth GetTocWidthScale GetToField GetToolBar GetTop GetTopic GetType GetUNCFilename GetUndoStackSize GetUniformScaling GetUninstallScript
+GetUnionRule GetUnits GetUnloadScript GetUpdate GetUpdateScript GetUpper GetUsed GetUserDefault GetUserField GetUserGroup GetUserPart GetUserRecord
+GetUserRow GetUserScale GetUserSeries GetVAlign GetValue GetValueIncrement GetValuePercentage GetValueString GetVersion GetView GetViewFrame
+GetVisibleGUIsWidth GetVisibleThemes GetVTab GetWeekOfYear GetWeight GetWideness GetWidth GetWin GetWorkDir GetX GetXAxis GetXDelimiter GetXField
+GetXMatchFields GetXMaxScore GetXOffset GetXSeparation GetY GetYAxis GetYear GetYOffset GetYSeparation GetZoneField GetZoneKey GoColumn GoDown GoField
+GoFirst GoFirstSelected GoLast GoLeft GoNext GoNextSelected GoPrevious GoRecord GoRecordField GoRight GoRow GoRowColumn GotoBeg GotoEnd GoUp
+GroupSelected
+HasAttributes HasControlFastener HasDoc HasError HasFastener HasField HasHiddenText HasHorizontalScroll HasInstances HasIntersection HasIntersections
+HasKindOf HasLabels HasLockError HasOverlappingLabels HasScript HasSelected HasSelection HasServer HasSiblings HasStepButtons HasStyle HasTable
+HasTitleBar HasValidIndex HasVerticalScroll HasVisibleBorder HasZ HasZone HookupSymbol
+Identify Import ImportAILineSet ImportAIShadeSet ImportFromFile IncrementByDays IncrementByHours IncrementByMinutes IncrementByMonths IncrementBySeconds
+IncrementByWeeks IncrementByYears IndexOf Info InitGeoTheme Input Insert InsertColumns InsertRows InsertText InsetBy Intersects IntersectSelected
+IntersectWith Invalidate InvalidateLegend InvalidateRect InvalidateTOC InvalIndex Is Is32BitDLL Is8Dot3 IsAccessControlled IsActive IsActiveLocked
+IsADependency IsAltKeyDown IsAlwaysOnTop IsAnno IsArcStorm IsAssumedBestCentury IsAtEnd IsAvailable IsAxisVisible IsBase IsBeingEditedWithRecovery
+IsBlockDisplayEnabled IsBold IsBoundsUsed IsBtnLeftClick IsBtnLeftDblClick IsBtnLeftDrag IsBtnMiddleClick IsBtnMiddleDblClick IsBtnMiddleDrag
+IsBtnRightClick IsBtnRightDblClick IsBtnRightDrag IsButtonAssignedForAction IsCenterContainedIn IsChartScatter IsCloseable IsClosing IsCodepageValid
+IsCompiled IsConnected IsContainedIn IsControlKeyDown IsCrossValueUsed IsCustomizable IsdBASE IsDir IsDisjoint IsDouble IsDoubleClick IsDrawing
+IsEditable IsEmpty IsEnabled IsEscapeEnabled IsExtentPreserved IsFieldIndexed IsFile IsFileValid IsFilled IsFilledBy IsFixedFont IsGeocoded
+IsGeoReferenced IsGridActive IsGridVisible IsGroup IsHelping IsHit IsHooked IsHorizontal IsInColor IsInfinity IsINFO IsInteractiveSnapping IsItalic
+IsJoinedField IsLabelVisible IsLegendVisible IsLibrary IsLinked IsListening IsLiveLinked IsLocked IsLog IsMachine IsMajorGridVisible IsMarginVisible
+IsMatchable IsMatched IsMaximumOn IsMeasured IsMemoryAvailable IsMetaKeyDown IsMinimumOn IsMinorGridVisible IsModal IsModified IsMonoSpaced IsMoveable
+IsNoData IsNoDataClassDisplayed IsNowVisible IsNull IsNumber IsOff IsOK IsOpen IsOutlined IsOwnerActive IsPlotMarks IsPoint IsPortrait IsQuoted
+IsReadOnly IsReady IsRedefined IsRequired IsResizable IsRoot IsScaled IsScalePreserved IsScratch IsSelected IsSelfIntersecting IsSeriesFromRecords
+IsSeriesSeparated IsSerif IsShiftKeyDown IsSnapping IsSubclassOf IsSuffixUsed IsSymWinClient IsText IsTickLabelsVisible IsTOCUnResizable IsTopic
+IsTouchedBy IsTracking IsTransparent IsTypeNumber IsTypeShape IsTypeString IsUnProjectable IsUsingPrinterMargins IsUsingPrinterPageSize IsValid
+IsValidFileName IsValueAxis IsVisible IsVisibleLocked IsWithin IsWorldFileEnabled IsWritable
+Join
+KillLine
+Label LabelThemes LCase Left LineIntersection Link ListAsString ListEnd Ln Load LoadFromFile LoadIcon LoadLibrary Log LongYesNo Lookup LowerCase
+Make MakeBuffer MakeClipboard MakeColorGray MakeColorWheel MakeDefault MakeDisjoint MakeDocName MakeEmpty MakeExisting MakeField MakeFileName
+MakeFromFile MakeFromNumber MakeFromResName MakeFromSource MakeFromSrc MakeFromTwoPoints MakeGeoRef MakeGrayScale MakeGUIName MakeLine MakeNew
+MakeNominal MakeNull MakeRamp MakeRandom MakeShort MakeSQL MakeStandard MakeSysDefault MakeTmp MakeTmpIMS MakeUserDefault MakeUsingDialog MakeWithGUI
+MakeXY Match MatchPoints MatchRectangles Max Maximize Merge MergeFile MergePath MergeSelected Middle Min Minimize MiniYesNo Minus MMultiply Mod MOffset
+Move MoveSelectedToBack MoveSelectedToFront MoveTo MoveUserRect MultiInput
+Natural Negate New Normalize Not NotRange Now
+Offset OffsetSelected Open OpenAndInstall OpenIndex Or
+Pan PanTo Password Paste Peek PieChart PixelOffset PlaySound PointIntersection PointPosition Poke Pop Print PrintDisplay PrintMemory PrintTOC PrintTopic
+ProcessAllInvals ProjectedMove ProjectPt ProjectRect PromoteSelection Proper PurgeObjects Push
+Quantile Query QueryConnected QueryCrossProduct QueryDifference QueryLocalMachineName QueryMinus QueryPlus QueryPointDistance QueryShape Quit Quote
+RampColors RampSavedColors RampSizes RampSubset RandomColors RandomSymbols RangeApply RangeSelect Read ReadElt ReadFiles Recalculate Redo Refresh
+RefreshPalette RefreshScale RefreshWindows RegisterExtension RegisterFormat RegTics RegTicsFromList RememberSelection Remove RemoveDefaultOwner
+RemoveDialog RemoveDoc RemoveDuplicates RemoveExtension RemoveFields RemoveGraphic RemoveGUI RemoveIndex RemoveListener RemoveObj RemovePrivateTmpDir
+RemoveRangeApply RemoveRangeSelect RemoveRecord RemoveRecords RemoveScript RemovingDuplicates Report Request Reset ResetClasses ResetDocActivate
+ResetGUIs ReShape Resize ResizeTo Restore RestoreGraphic RestoreSymbols ReturnActiveLayers ReturnAOI ReturnArea ReturnAxes ReturnAzimuth
+ReturnAzimuthOfCentralLine ReturnBestDensity ReturnBox ReturnBtnClick ReturnBuffered ReturnCenter ReturnCentralLatitude ReturnCentralLongitude
+ReturnCentralMeridian ReturnClassCounts ReturnClassInfo ReturnClipExtent ReturnClipped ReturnCommonFamilyName ReturnConnected ReturnCurrentSymbol
+ReturnDataSets ReturnDefaultLegend ReturnDefaultRules ReturnDefaultSymbol ReturnDensified ReturnDescription ReturnDialogBox ReturnDifference ReturnDir
+ReturnEccentricity ReturnEnd ReturnExportFormats ReturnExtensions ReturnExtent ReturnFalseEasting ReturnFalseNorthing ReturnFamilies ReturnFieldNames
+ReturnFiles ReturnFontName ReturnFrameSymbol ReturnGeodesicAzimuth ReturnIndexSrcNames ReturnInnerExtent ReturnInsertPos ReturnIntersection ReturnKeys
+ReturnLabel ReturnLatitudeOfTrueScale ReturnLayers ReturnLegendExt ReturnLength ReturnLibrarians ReturnLocation ReturnLowerStandardParallel
+ReturnMapExtent ReturnMarginExtent ReturnMargins ReturnMaximum ReturnMBB ReturnMerged ReturnMinimum ReturnNumberPoints ReturnOffset
+ReturnOpenFilesAsList ReturnOrigin ReturnPageExtent ReturnPageSize ReturnPattern ReturnPhysicalBtnClick ReturnPixmap ReturnPointAlongGeodesic
+ReturnPrjName ReturnProjected ReturnProjectedEnd ReturnProjectedOrigin ReturnProjectedStart ReturnProjection ReturnQuery ReturnRadius ReturnRange
+ReturnRangeString ReturnReferenceLatitude ReturnRelativeLocation ReturnRhumbLine ReturnRotationAngle ReturnRouteMeasure ReturnScale
+ReturnScreenSizeInches ReturnScreenSizePixels ReturnSelectedExtent ReturnSelectedLayers ReturnShift ReturnSize ReturnSrcNames ReturnStandardParallel
+ReturnStart ReturnSymbols ReturnSymbolSize ReturnText ReturnType ReturnTypeFromFileExt ReturnUnion ReturnUniqueName ReturnUnprojected
+ReturnUpperStandardParallel ReturnUserCircle ReturnUserEllipse ReturnUserGeoCurve ReturnUserLine ReturnUserPoint ReturnUserPolygon ReturnUserPolyLine
+ReturnUserRect ReturnValue ReturnValueNumber ReturnValueString ReturnVisExtent ReturnWorldFile Right Rotate RotateBy Round Run
+Save SaveChanges SaveEditsAs SaveGraphic SaveSelectedGraphics SaveStyles SaveToFile Scale ScaleSymbols ScoreCandidates Search SearchUsing Select
+SelectAll SelectByFTab SelectByLine SelectByPoint SelectByPolygon SelectByPolyLine SelectByRect SelectByShapes SelectByTheme SelectCurrent SelectDefault
+SelectEdit SelectFirst SelectLabels SelectRect SelectSymbol SelectToEdit SelectToEditByPoint Set SetAbout SetAccessControlled SetActionScript
+SetActionUpdateScript SetActivate SetActive SetActiveField SetActiveLocked SetAlias SetAliasTable SetAlignment SetAll SetAltitude SetAltSize
+SetAlwaysOnTop SetAngle SetAnnoAddFieldsPreference SetAOI SetApply SetAssumedBestCentury SetAttrUpdateRules SetAuxIncrement SetAVFile SetAxes
+SetAxisVisible SetAzimuth SetAzimuthOfCentralLine SetBackgroundSymbol SetBand SetBeep SetBgColor SetBgSym SetBlockDisplayEnable SetBlueBand
+SetBlueImageLookup SetBounds SetBoundsMax SetBoundsMin SetBoundsUsed SetCanUnloadScript SetCapStyle SetCenter SetCentralLatitude SetCentralLongitude
+SetCentralMeridian SetChanged SetCharacter SetCharSpacing SetChecking SetChoice SetClassesFile SetClassInfo SetCleanPreference SetClick SetClipExtent
+SetClose SetCloseable SetCloseScript SetCodepage SetCodepageConvert SetColor SetColorGray SetColorLock SetColorMap SetColorMapSize SetColorWheel
+SetColumnWidth SetComments SetConstraint SetControlFasteners SetCoordinatePrecision SetCoordsVisible SetCreator SetCrossGroup SetCrossValue
+SetCrossValueUsed SetCurrentDocWin SetCurrentValue SetCustomizable SetCWD SetDataSource SetDateFormat SetDefAliasTable SetDefault SetDefaultButton
+SetDefaultLegend SetDefaultSymbol SetDefBitmap SetDefFormat SetDefinition SetDefOffset SetDefSqueeze SetDensity SetDescription SetDialogBox SetDisplay
+SetDisplayField SetDisplayQuality SetDistanceUnits SetDivisions SetDocActivate SetDocBaseName SetDotDensity SetDotSymbol SetDrag SetDynamicBreak
+SetEditable SetEditableTheme SetEmpty SetEnabled SetEnvVar SetEolType SetErrorReporting SetEscapeEnabled SetExtension SetExtensionChecking SetExtensions
+SetExtent SetExtentPreserved SetExtVersion SetFalseEasting SetFalseNorthing SetFastener SetFasteners SetFeatureWeight SetField SetFieldNames
+SetFieldNamesVisible SetFile SetFileDescriptorLimit SetFileName SetFillObject SetFixedFont SetFixedSizeText SetFlip SetFlushCount SetFocusLost SetFont
+SetFormat SetFormatPrecision SetGrayScale SetGreenBand SetGreenImageLookup SetGridActive SetGridMesh SetGridVisible SetGroupGap SetGroupGUI
+SetGroupLabel SetGUI SetHAlign SetHeight SetHelp SetHelping SetHelpTopic SetHiddenText SetHorizontal SetHorizontalScroll SetHotField SetHotScriptName
+SetIcon SetImageLookup SetInColor SetIncrement SetInnerExtent SetInsertPos SetInstallScript SetIntensity SetInteractiveSnapping
+SetInteractiveSnappingPersistent SetInteractiveSnapTolerance SetInterval SetIntervals SetJobName SetJoinField SetJoinStyle SetJustification SetKey
+SetLabel SetLabelField SetLabelSize SetLabelTextSym SetLabelVisible SetLabelWeight SetLatitudeOfTrueScale SetLegend SetLegendEditorScript
+SetLegendLineFlatness SetLegendType SetLegendVisible SetLineEvent SetLineOffset SetLinePlacement SetLineSpacing SetListeners SetLoadScript SetLocked
+SetLog SetLook SetLower SetLowerStandardParallel SetM SetMainIncrement SetMajorAndMinorAxes SetMajorGridSpacing SetMajorGridVisible SetMapExtent
+SetMargin SetMarginVisible SetMark SetMarkLayer SetMatchPref SetMatchSource SetMAtLength SetMAtPosition SetMax SetMaximum SetMaximumOn SetMaxSize
+SetMaxUndoTransactionSize SetMaxValue SetMean SetMForPoint SetMin SetMinimum SetMinimumOn SetMinorGridSpacing SetMinorGridVisible SetMinSize SetMinValue
+SetModal SetModalResult SetMode SetModified SetMToNil SetName SetNewScript SetNewUpdateScript SetNextControl SetNominal SetNormFieldName SetNormType
+SetNull SetNullSymbol SetNullValue SetNumberFormat SetNumberPoints SetNumValues SetObjectTag SetOffset SetOffsetField SetOlColor SetOlWidth SetOpen
+SetOpenScript SetOpenUpdateScript SetOrderLocked SetOrigin SetOutFileName SetOutlined SetOverlapLabelColor SetPageSize SetPanel SetPassword SetPattern
+SetPenSize SetPixelWidth SetPlotMarks SetPointEvent SetPos SetPosition SetPrecision SetPref SetPrefVal SetPreserveInterval SetPrivateTmpDir
+SetProjection SetProjectSaveScript SetQuality SetRadiusAndFlattening SetRamp SetRandom SetRange SetRangeApply SetRangeSelect SetRangeType SetReadOnly
+SetRedBand SetRedImageLookup SetRedrawDeferred SetReferenceLatitude SetRefresh SetRefScale SetRemainActiveState SetResizable SetResolution
+SetResultBitmap SetResultField SetRgbList SetRightToLeft SetRotationAngle SetRotationFieldName SetRowHeight SetSaveAsUNIX SetScale SetScalePreserved
+SetScaleSymbols SetScaleVisible SetScratch SetScreenSizeInches SetSearchPaths SetSelColor SetSelect SetSelected SetSelectedControl SetSelectedDoc
+SetSelectedExtent SetSelectedGUI SetSelectedLayers SetSelection SetSelectionStyle SetSelectMode SetSeriesColor SetSeriesOverlap SetSeriesSeparated
+SetServer SetServerActivated SetServerClosed SetServerDeactivated SetServerDefinitionChanged SetServerOpened SetServerRecordsAdded
+SetServerRecordsDeleted SetServerSelectionChanged SetShape SetShift SetShowStatus SetShutDown SetSize SetSizeFieldName SetSizeInches SetSnapping
+SetSnapTolerance SetSource SetSpacing SetSpheroid SetSqueeze SetStandardDeviation SetStandardParallel SetStartUp SetStatus SetStipple SetStreamTolerance
+SetStyle SetSubName SetSuffixUsed SetSwitchButton SetSymbol SetSymbols SetTag SetTemplate SetText SetTextRatio SetTextType SetThreshold
+SetTickLabelsVisible SetTimeout SetTitle SetTOCUnResizable SetTOCWidth SetTocWidthScale SetTransparent SetType SetUndoStackSize SetUniformScaling
+SetUninstallScript SetUnionRule SetUnits SetUnloadScript Setup SetUpdate SetUpdateScript SetUpper SetUpperStandardParallel SetUserScale
+SetUsingPrinterMargins SetUsingPrinterPageSize SetValue SetValueIncrement SetValueNumber SetValuePercentage SetValues SetValueString SetVerticalScroll
+SetViewFrame SetVisible SetVisibleBorder SetVisibleGUIsWidth SetVisibleLocked SetWidth SetWorkDir SetWorkingStatus SetWorldFile SetWorldFileEnable SetX
+SetXDelimiter SetXField SetXOffset SetXSeparation SetY SetZoneKey Shift ShiftLeft ShiftRight Show ShowCandidate ShowClass ShowCodepage ShowCurrent
+ShowGallery ShowLibraries ShowMsg ShowRow ShowStepButtons ShowStopButton ShowToleranceCursor ShowTopic ShowUsingDefault ShowVariables ShowWithDefault
+Shuffle SimplifySelection Sin SingleMatch SingleSymbol SkipLine Snap Sort SortAscending SortDescending Split SplitLines Sqrt Start
+StartEditingWithRecovery StartListening StartNamed StdDev Step Stop StopAllDraw StopDraw StopEditing StopEditingWithRecovery StopListening StripFile
+Substitute SubtractShape Summarize SupportsAOI SuspendDraw
+Tan The TileWindows Translate Trim Truncate
+UCase Undo UndoZoom UngroupSelected UnHook UniformColor UnionSelected UnionWith Unique UniqueInPaths UnjoinAll UnlinkAll Unload UnloadLibrary UnProject
+UnProjectPt UnProjectRect Unquote UnregisterExtension UnregisterFormat Unselect UnselectAll UnselectAllExcept Update UpdateDefBitmap UpdateLegend
+UpdateSelection UserSnapPoint UseTemplate UseTitleBar UseWaitCursor
+Validate
+Warning Write WriteAll WriteElt WriteMatch WriteQStr WriteUnMatch
+Xor
+YesNo YesNoCancel
+ZoomIn ZoomOut ZoomToActual ZoomToPage ZoomToRect ZoomToScale
+
+
+#Classes:
+$KEYWORDS(kwb)=AddressStyle Albers Annotation Application AreaOfInterestDialog AttrRange AttrSingle AttrUpdate AutoLabelDialog AV Axis
+BandStatistics BasicMarker BasicPen Bitmap Boolean Button ButtonBar
+Cassini Chart ChartDisplay ChartLegend ChartPart ChartSymbol CheckBox Choice Circle Class Classification Clipboard Codepage Collection Color ColorMap
+ColumnChartSymbol ComboBox CompositeArcInfoPen CompositeFill CompositeMarker CompositePen Control ControlPanel ControlSet CoordSys Coverage
+Date DDEClient DDEServer Dialog DialogEditor Dictionary Digitizer Display DLL DLLProc Doc DocFrame DocGUI DocumentExtension DocWin Duration DynName
+Ellipse EncryptedScript EnumerationElt EqualAreaAzimuthal EqualAreaCylindrical EquidistantAzimuthal EquidistantConic EquidistantCylindrical EventDialog
+Extension ExtensionObject ExtensionWin
+Field File FileDialog FileName Fill Font FontManager Frame FTab FTheme
+GEdgeRec GenericPrinter GeocodeDialog GeoCurve GeoName Gesamt GNodeRec Gnomonic Graphic GraphicControl GraphicGroup GraphicLabel GraphicList GraphicSet
+GraphicShape GraphicText GShapeRec
+Hammer Help
+Icon IconBox IconMgr IdentifyWin IdentityLookup ImageLegend ImageLookup ImageWin ImgCat ImgDLL ImgSrc INFODir Interval IntervalLookup ISrc ITheme
+LabelButton Labeler Lambert Layer Layout Legend LegendExtension LegendFrame Librarian Library Line LinearLookup LineFile LineM LineZ List ListBox
+ListDisplay LocateDialog LOCKMGR
+MapDisplay Marker MatchCand MatchCase MatchField MatchKey MatchPref MatchPrefDialog MatchSource Menu MenuBar Mercator Miller ModalDialog Mollweide MsgBox
+MultiBandLegend MultiPatch MultiPoint MultiPointM MultiPointZ
+NameDictionary Nearside NewZealand NorthArrow NorthArrowMgr Number
+Obj ObliqueMercator ODB Orthographic Oval
+PageDisplay PageManager PageSetupDialog Palette Pattern Pen Perspective PictureFrame PieChartSymbol Pixmap Point PointM PointTextPositioner PointZ Polygon
+PolygonM PolygonTextPositioner PolygonZ PolyLine PolyLineM PolyLineTextPositioner PolyLineZ Popup PopupSet Printer Prj Project ProjectionDialog PropWin
+QueryWin
+RadioButton RasterFill Rect RectM RectZ ReMatchDialog Robinson RPCClient RPCServer RSO
+ScaleBarFrame Script ScriptMgr SEd Shape SingleBandLegend Sinusoid Slider SourceDialog SourceManager Space Spheroid SplineText SQLCur SQLWin SrcExtension
+SrcName Stack StanEditDialog Stereographic Stipple String SummaryDialog Symbol SymbolList SymbolWin System
+Table Template TemplateGraphic TemplateMgr TextBox TextComposer TextFile TextLabel TextLine TextPositioner TextSymbol TextWin Theme ThemeExtension
+ThemeOnThemeDialog Threshold Title TOC Tool ToolBar ToolMenu TransverseMercator
+Units
+Value Vector VectorFill VectorPen VectorPenArrow VectorPenDiamond VectorPenDot VectorPenHash VectorPenHollow VectorPenMarker VectorPenScallop
+VectorPenScrub VectorPenSlant VectorPenVertexMarker VectorPenZigZag View ViewFrame VpfName VTab
+Window
+XAxis XYName YAxis
+
+$STRINGDELIMITERS="
+
+$SL_COMMENT='
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$IGNORECASE=false
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
diff --git a/support/highlight/langDefs/awk.lang b/support/highlight/langDefs/awk.lang
new file mode 100644
index 0000000000..3e3f5b3654
--- /dev/null
+++ b/support/highlight/langDefs/awk.lang
@@ -0,0 +1,36 @@
+# (G)AWK script language definition file
+#
+# Author: Andreas Schoenberg
+# Mail: asg@ftpproxy.org
+# Date: 26.11.2002
+# Version: 1.1
+# ChangeLog: added escchar <andre.simon1@gmx.de>
+ changed format
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+
+$DESCRIPTION=(G)AWK
+
+$KEYWORDS(kwa)=begin break close continue delete do else end exit for
+getline gsub if index length match next print printf return split sprintf sub
+substr system tolower toupper while
+
+$KEYWORDS(kwb)=argc argind argv convfmt environ errno fieldwidths filename fnr
+fs ignorecase nf nr ofmt ofs ors rlength rs rstart rt subset
+
+$KEYWORDS(kwc)=function
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=#
+
+$IGNORECASE=true
+
+$ESCCHAR=regex([\\%]\d{3}|[\\%]x\d{2}|[\\%][ntvbrfa\\\?'"%])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * + -
diff --git a/support/highlight/langDefs/bat.lang b/support/highlight/langDefs/bat.lang
new file mode 100644
index 0000000000..1bd3e8c17b
--- /dev/null
+++ b/support/highlight/langDefs/bat.lang
@@ -0,0 +1,47 @@
+# DOS Batch script language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 02.03.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=DOS Batch
+
+$KEYWORDS(kwa)=do else end errorlevel exist exit for goto if not pause return
+say select then when
+
+# DOS Cmds
+$KEYWORDS(kwb)=ansi append assign attrib autofail backup basedev boot break
+buffers cache call cd chcp chdir chkdsk choice cls cmd codepage command comp
+copy country date ddinstal debug del detach device devicehigh devinfo dir
+diskcoache diskcomp diskcopy doskey dpath dumpprocess eautil endlocal erase
+exit_vdm extproc fcbs fdisk fdiskpm files find format fsaccess fsfilter
+graftabl iopl join keyb keys label lastdrive libpath lh loadhigh makeini
+maxwait md mem memman mkdir mode move net patch path pauseonerror picview
+pmrexx print printmonbufsize priority priority_disk_io prompt protectonly
+protshell pstat rd recover reipl ren rename replace restore rmdir rmsize run
+set setboot setlocal shell shift sort spool start subst suppresspopups swappath
+syslevel syslog threads time timeslice trace tracebuf tracefmt trapdump tree
+type undelete unpack use ver verify view vmdisk vol xcopy xcopy32 xdfcopy
+echo
+
+# Variables
+$KEYWORDS(kwc)=regex(%\S+)
+
+$STRINGDELIMITERS="
+
+$SL_COMMENT=regex(^(rem|Rem|REM).*)
+
+$IGNORECASE=true
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
diff --git a/support/highlight/langDefs/bb.lang b/support/highlight/langDefs/bb.lang
new file mode 100644
index 0000000000..a91c8302ed
--- /dev/null
+++ b/support/highlight/langDefs/bb.lang
@@ -0,0 +1,98 @@
+# Blitz Basic 3D language definition file
+#
+# Author: André Simon
+# Mail: andre.simon1@gmx.de
+# Date: 04.03.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+
+$DESCRIPTION=Blitz Basic
+
+$KEYWORDS(kwa)=after and before case const data default delete dim each else elseif end endif
+exit false field first for forever function global gosub goto handle if include insert
+last local new next not null object or read repeat restore return select step then to
+true type until wend while
+
+# Functions:
+$KEYWORDS(kwb)=acos asin atan atan2 abs accepttcpstream apptitle asc
+automidhandle availvidmem backbuffer banksize bin ceil changedir channelpan channelpitch
+channelplaying channelvolume chr closedir closefile closetcpserver closetcpstream cls
+clscolor color colorblue colorgreen colorred commandline copybank copyfile copyimage
+copypixel copypixelfast copyrect copystream cos countgfxdrivers countgfxmodes createbank
+createdir createimage createnetplayer createtcpserver createtimer currentdate currentdir
+currenttime debuglog delay deletedir deletefile deletenetplayer drawblock drawblockrect
+drawimage drawimagerect eof execfile exp filepos filesize filetype flip float floor
+flushjoy flushkeys flushmouse fontheight fontwidth freebank freefont freeimage freesound
+freetimer frontbuffer getcolor getjoy getkey getmouse gfxdrivername gfxmodedepth
+gfxmodeexists gfxmodeheight gfxmodewidth grabimage graphics graphicsbuffer graphicsdepth
+graphicsheight graphicswidth handleimage hex hidepointer hostnetgame imagebuffer
+imageheight imagerectcollide imagerectoverlap imagewidth imagexhandle imageyhandle
+imagescollide imagesoverlap input instr int joinnetgame joyhit joytype joyx joyy joyz
+keydown keyhit left len line loadanimimage loadbuffer loadfont loadimage loadsound
+lockbuffer log log10 loopsound lower lset maskimage mid midhandle millisecs mod
+mousedown mousehit mousex mousexspeed mousey mouseyspeed mousez mousezspeed movemouse
+netmsgdata netmsgfrom netmsgto netmsgtype netplayerlocal netplayername nextfile openfile
+opentcpstream origin oval pausechannel peekbyte peekfloat peekint peekshort pi
+playcdtrack playmusic playsound plot pokebyte pokefloat pokeint pokeshort print rset
+rand readavail readbyte readbytes readdir readfile readfloat readint readline readpixel
+readpixelfast readshort readstring rect rectsoverlap recvnetmsg replace resizebank
+resizeimage resumechannel right rnd rotateimage runtimeerror sar savebuffer saveimage
+scaleimage scanline seedrand seekfile setbuffer setfont setgfxdriver setnetmsg sgn shl
+showpointer shr sin soundpan soundpitch soundvolume sqr startnetgame stop stopchannel
+stopnetgame str string stringheight stringwidth tcptimeouts tformfilter tformimage tan
+text tileblock tileimage totalvidmem trim unlockbuffer upper vwait viewport waitjoy
+waitkey waitmouse waittimer write writebyte writebytes writefile writefloat writeint
+writeline writepixel writepixelfast writeshort writestring xor addanimseq addtriangle
+addvertex aligntovector ambientlight animate animatemd2 animating animlength animseq
+animtime antialias brushalpha brushblend brushcolor brushfx brushshininess brushtexture
+cameraclscolor cameraclsmode camerafogcolor camerafogmode camerafogrange camerapick
+cameraproject camerarange cameraviewport camerazoom captureworld clearcollisions
+clearsurface cleartexturefilters clearworld collisionentity collisionnx collisionny
+collisionnz collisions collisionsurface collisiontime collisiontriangle collisionx
+collisiony collisionz copyentity countchildren countcollisions countsurfaces
+counttriangles countvertices createbrush createcamera createcone createcube
+createcylinder createlight createlistener createmesh createmirror createpivot
+createplane createsphere createsprite createsurface createterrain createtexture dither
+emitsound entityalpha entityanimating entityanimtime entityautofade entityblend
+entitybox entitycollided entitycolor entitydistance entityfx entityinview entityname
+entityorder entityparent entitypick entitypickmode entitypitch entityradius entityroll
+entityshininess entitytexture entitytype entityvisible entityx entityy entityyaw entityz
+findchild findsurface fitmesh flipmesh freebrush freeentity freetexture getchild
+getentitytype getparent getsurface gfxdriver3d gfxmode3d graphics3d handlesprite
+hideentity hwmultitex lightcolor lightconeangles lightmesh lightrange linepick
+load3dsound loadanimmesh loadanimseq loadanimtexture loadbrush loadermatrix loadmd2
+loadmesh loadsprite loadterrain loadtexture md2animating md2animlength md2animtime
+meshdepth meshesintersect meshheight meshwidth modifyterrain moveentity nameentity
+paintentity paintmesh paintsurface pickedentity pickednx pickedny pickednz pickedsurface
+pickedtime pickedtriangle pickedx pickedy pickedz pointentity positionentity
+positionmesh positiontexture projectedx projectedy projectedz renderworld resetentity
+rotateentity rotatemesh rotatesprite rotatetexture scaleentity scalemesh scalesprite
+scaletexture setanimkey showentity spriteviewmode terraindetail terrainheight
+terrainshading terrainsize terrainx terrainy terrainz textureblend texturebuffer
+texturecoords texturefilter textureheight texturewidth tformedx tformedy tformedz
+tformnormal tformpoint tformvector translateentity trianglevertex turnentity
+updatenormals updateworld vertexblue vertexcolor vertexcoords vertexgreen vertexnormal
+vertexnx vertexny vertexnz vertexred vertextexcoords vertexu vertexv vertexw vertexx
+vertexy vertexz wbuffer windowed3d wireframe
+
+$STRINGDELIMITERS="
+
+$SL_COMMENT=;
+
+$IGNORECASE=true
+
+$SYMBOLS= ( ) [ ] { } , : & | < > ! = / * % + -
+
+
+
+
diff --git a/support/highlight/langDefs/bbcode.lang b/support/highlight/langDefs/bbcode.lang
new file mode 100644
index 0000000000..c5688cdb63
--- /dev/null
+++ b/support/highlight/langDefs/bbcode.lang
@@ -0,0 +1,24 @@
+# BBcode language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 29.03.2010
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=BBcode
+
+$KEYWORDS(kwa)=regex(\[\/?\w+|\], 0)
+
+$KEYWORDS(kwb)=regex(#\p{XDigit}{6})
+
+#$STRINGDELIMITERS="
+$IGNORECASE=true
diff --git a/support/highlight/langDefs/bib.lang b/support/highlight/langDefs/bib.lang
new file mode 100644
index 0000000000..f76cba97cd
--- /dev/null
+++ b/support/highlight/langDefs/bib.lang
@@ -0,0 +1,28 @@
+# BibTex language definition file
+#
+# Author: André Simon
+# Mail: andre.simon1@gmx.de
+# Date: 08.02.2004
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=BibTeX
+
+$KEYWORDS(kwa)=address annote author title type abstract
+volume pages number note key organization school series
+chapter month department keywords howpublished
+institution journal publisher editon editor year booktitle
+
+$SL_COMMENT=%
+
+$IGNORECASE=false
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * + -
diff --git a/support/highlight/langDefs/bms.lang b/support/highlight/langDefs/bms.lang
new file mode 100644
index 0000000000..f026019d1b
--- /dev/null
+++ b/support/highlight/langDefs/bms.lang
@@ -0,0 +1,48 @@
+# BM Script language definition file
+#
+# Author: André Simon
+# Mail: andre.simon1@gmx.de
+# Date: 02.03.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=BM Script
+
+$KEYWORDS(kwa)=advance aggregate_member action base_model commit commit_zero computed_item computed_member
+cycle conversion hange_model dimension dynamic_span decommission delete delete_task delete_job
+end_command files item join_model job load_conversion_data load_items load_time load_cycles
+load_dimension load_model member model nullify period queue_job route_file run_task specials spans
+start_job_queue stop_job_queue span time task unit
+
+
+#Functions:
+$KEYWORDS(kwb)=aggregation average aggregate_members additive_only ascii_extractor accumulator break_time
+bad_outputs cycles consolidation computed_members consolidation commit_version cycle_dimension
+converter displays dynamic_spans dimensions default dimension_only display_set uplicator
+end_transformer expander exclude full flatten fixed_extractor fielder good_outputs gdl history
+hierarchic_subtractive hierarchic_only holder items item_hierarchy include_all include inverted
+incremental item_dimension incycle_dimension include_only joiner keyed limited load_model_incremental
+logger members models name normal no non_keyed none normal new_version nullify_current nullify_from
+precompute periods pivot qualifier retained restated repeated run_task_step synoyms subtractive_only
+service sql_extractor stripper target time_latest time_dimension top_incycle transformer timer yes
+across_field by_field copy cycle_field data default_allowed error file fields field_or_unit field
+input_0 input_1 ignore item_specifier level meta numeric outputs output_0 output_1 password prepend
+period_field query separator short_records source to text user value warning business end exclusive
+new shared sp
+
+$STRINGDELIMITERS="
+
+$SL_COMMENT=#
+
+$IGNORECASE=true
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
diff --git a/support/highlight/langDefs/bnf.lang b/support/highlight/langDefs/bnf.lang
new file mode 100644
index 0000000000..8507ccd867
--- /dev/null
+++ b/support/highlight/langDefs/bnf.lang
@@ -0,0 +1,25 @@
+# BNF language definition file
+#
+# Author: Julien Fontanet
+# Mail: julien.fontanet@isonoe.net
+# Date: 2009-12-06
+# ------------------------------------------
+
+$DESCRIPTION=Backus-Naur Form
+
+$IDENTIFIER=regex([-a-zA-Z_]+|<[-a-zA-Z_]+>)
+
+$KEYWORDS(kwa)=regex(^[ \t]*([-a-zA-Z_]+|<[-a-zA-Z_]+>)\s*[:=])
+
+$IGNORECASE=false
+
+$STRINGDELIMITERS="
+
+$SL_COMMENT=//
+
+$ML_COMMENT=/* */
+
+$ALLOWNESTEDCOMMENTS=false
+
+$SYMBOLS= ( ) [ ] { } | . : =
+
diff --git a/support/highlight/langDefs/boo.lang b/support/highlight/langDefs/boo.lang
new file mode 100644
index 0000000000..4b2f9007a3
--- /dev/null
+++ b/support/highlight/langDefs/boo.lang
@@ -0,0 +1,47 @@
+# Python language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 12.3.2007
+# ------------------------------------------
+# This file is part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Boo
+
+#keywords
+$KEYWORDS(kwa)= abstract and as AST break callable cast char class constructor
+continue def destructor do elif else ensure enum event except failure
+final from for false get given goto if import in interface internal is isa not
+null of or otherwise override namespace partial pass public protected
+private raise ref retry return self set super static struct success transient
+true try typeof unless virtual when while yield
+
+#macros
+$KEYWORDS(kwb)=print assert using lock debug
+
+#$KEYWORDS(kwc)=
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=""" ''' " '
+
+$RAWSTRINGPREFIX=r
+
+$SL_COMMENT=# //
+
+$ML_COMMENT=/* */
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; . : & | < > ! = / * % + - @
diff --git a/support/highlight/langDefs/c.lang b/support/highlight/langDefs/c.lang
new file mode 100644
index 0000000000..06950ee422
--- /dev/null
+++ b/support/highlight/langDefs/c.lang
@@ -0,0 +1,61 @@
+# C and C++ language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 24.7.2002
+# updated 12.01.04 to add more types (ansi c, iso 99)
+# updated 22.03.10 to add C++0x keywords, R"", "\uxxxx"
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=C and C++
+
+$KEYWORDS(kwa)=goto break return continue asm case default if else switch while for do sizeof
+typeof stdcall cdecl const_cast delete dynamic_cast goto namespace new pascal
+reinterpret_cast static_cast this throw try catch using true false bitand and bitor or xor
+compl and_eq or_eq xor_eq not not_eq assert static_assert
+
+$KEYWORDS(kwb)=int long short char void signed unsigned float double size_t wchar_t
+ptrdiff_t sig_atomic_t fpos_t clock_t time_t va_list jmp_buf FILE DIR div_t ldiv_t static
+const bool struct union enum size_t wchar_t ptrdiff_t sig_atomic_t fpos_t clock_t time_t
+va_list jmp_buf FILE DIR div_t ldiv_t mbstate_t wctrans_t wint_t wctype_t bool complex
+int8_t int16_t int32_t int64_t uint8_t uint16_t uint32_t uint64_t int_least8_t int_least16_t
+int_least32_t int_least64_t uint_least8_t uint_least16_t uint_least32_t uint_least64_t
+int_fast8_t int_fast16_t int_fast32_t int_fast64_t uint_fast8_t uint_fast16_t uint_fast32_t
+uint_fast64_t intptr_t uintptr_t intmax_t uintmax_t
+
+$KEYWORDS(kwc)=typedef inline auto class explicit extern friend inline mutable operator
+register template private protected public typeid virtual volatile constexpr nullptr decltype
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=//
+
+$ML_COMMENT=/* */
+
+$ALLOWNESTEDCOMMENTS=false
+
+$IGNORECASE=false
+
+$DIRECTIVE=#
+
+$ESCCHAR=regex(\\u\p{XDigit}{4}|\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; . : & | < > ! = / * % + - ~
+
+$CONTINUATIONSYMBOL=\
+
+$REFORMATTING=true
+
+$RAWSTRINGPREFIX=R
diff --git a/support/highlight/langDefs/cb.lang b/support/highlight/langDefs/cb.lang
new file mode 100644
index 0000000000..f3e4699a55
--- /dev/null
+++ b/support/highlight/langDefs/cb.lang
@@ -0,0 +1,66 @@
+# ClearBasic language definition file
+#
+# Author: André Simon
+# Mail: andre.simon1@gmx.de
+# Date: 04.03.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=ClearBasic
+
+
+$KEYWORDS(kwa)=and as byref byval case declare dim else elseif end for function
+global if me not new next or select set step sub then to type while aix
+dodefault false hpux irix linux mac68k macppc macintosh netware nothing null
+os2 osf1 pi sco solaris sunos true unix ultrix unixware vms win16 win32
+cbabortretryignore cbascending cbbyref cbbyvalue cbclosechildren cbclosemessage
+cbdefclosedwindow cbdefclosedwindow cbdescending cbequal cbfirstmessage
+cbfrontifup cbgreater cbgreaterorequal cbidabort cbidcancel cbiddiscard
+cbidignore cbidno cbidok cbidretry cbidsave cbidyes cbin cbless cblessorequal
+cblike cbnodefault cbnotequal cbnotlike cbok cbokcancel cbrefreshmessage
+cbretrycancel cbsavediscardcancel cbsoundslike cbyesno cbyesnocancel ebaix
+ebabort ebabortretryignore ebapplicationmodal ebarchive ebarray ebback ebbold
+ebbolditalic ebboolean ebcfbitmap ebcfdib ebcfmetafile ebcfpalette ebcftext
+ebcfunicode ebcancel ebcr ebcrlf ebcritical ebcurrency ebdos ebdataobject
+ebdate ebdefaultbutton1 ebdefaultbutton2 ebdefaultbutton3 ebdirectory ebdouble
+ebempty eberror ebexclamation ebfirstfourdays ebfirstfullweek ebfirstjan1
+ebformfeed ebfriday ebfromunicode ebhpux ebhidden ebhide ebhiragana
+ebimealphadbl ebimealphasng ebimedisabled ebimehiragana ebimekatakanadbl
+ebimekatakanasng ebimenoop ebimeoff ebimeon ebignore ebinformation ebinteger
+ebirix ebitalic ebkatakana eblinux eblandscape ebleftbutton eblf eblong
+eblowercase ebmacintosh ebmaximized ebmaximizedfocus ebminimized
+ebminimizedfocus ebminimizednofocus ebmonday ebnarrow ebnetware ebno ebnone
+ebnormal ebnormalfocus ebnormalnofocus ebnull ebnullchar ebnullstring ebok
+ebokcancel ebokonly ebos2 ebosf1 ebobject ebportrait ebpropercase ebquestion
+ebreadonly ebregular ebrestored ebretry ebretrycancel ebrightbutton ebsco
+ebsaturday ebsingle ebsolaris ebstring ebsunos ebsunday ebsystem ebsystemmodal
+ebtab ebthursday ebtuesday ebultrix ebunicode ebunixware ebuppercase ebvms
+ebvariant ebverticaltab ebvolume ebwednesday ebwide ebwin16 ebwin32 ebwindows
+ebyes ebyesno ebyesnocancel
+
+$KEYWORDS(kwb)=app appmenu basic bool boolean bulkretrieve bulksave clarifydb
+clipboard commondialog contextualobject control dde debug err form integer list
+long msg net powerquery printer record sqldb screen servicemessage string
+
+
+$STRINGDELIMITERS="
+
+$SL_COMMENT='
+$ML_COMMENT=/* */
+
+$IGNORECASE=true
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
+
+
+
+
diff --git a/support/highlight/langDefs/cfc.lang b/support/highlight/langDefs/cfc.lang
new file mode 100644
index 0000000000..fb5cc13d5c
--- /dev/null
+++ b/support/highlight/langDefs/cfc.lang
@@ -0,0 +1,58 @@
+# Coldfusion MX language definition file
+#
+# Author: Paul Connell
+# Mail: paulc@fusionworkshop.com
+# Date: 04.06.2004
+# 28.01.2008 Replaced KW_DELIM entry by regexes (ASim)
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# paulc@fusionworkshop.com
+# http:/www.fusionworkshop.com/
+
+$DESCRIPTION=ColdFusion MX
+
+$KEYWORDS(kwa)=3Dcfabort cfapplet cfapplication cfargument cfassociate cfbreak cfcache
+cfcase cfcatch cfchart cfchartdata cfchartseries cfcol cfcollection cfcomponent
+cfcontent cfcookie cfdefaultcase cfdirectory cfdump cfelse cfelseif cferror cfexecute
+cfexit cffile cfflush cfform cfftp cffunction cfgrid cfgridcolumn cfgridrow
+cfgridupdate cfheader cfhtmlhead cfhttp cfhttpparam= cfif cfimport cfinclude cfindex
+cfinput cfinsert cfinvoke cfinvokeargument cfldap cflocation cflock cflog cflogin
+cfloginuser cflogout cfloop cfmail cfmailparam cfmailpart cfmodule cfobject
+cfobjectcache cfoutput cfparam cfpop cfprocessingdirective cfprocparam cfprocresult
+cfproperty cfquery cfqueryparam cfregistry cfreport cfrethrow cfreturn cfsavecontent
+cfschedule cfscript cfsearch cfselect cfset cfsetting cfsilent cfslider cfstoredproc
+cfswitch cftable cftextinput cfthrow cftrace cftransaction cftree cftreeitem cftry
+cfupdate cfwddx cfxml
+
+$STRINGDELIMITERS=" '
+
+# set true if programming language is case sensitive
+# Keyword and types have to be lower case if true
+$IGNORECASE=true
+
+# set true if multiple line comments may be nested
+$ALLOWNESTEDCOMMENTS=true
+
+# comment begin and end (delimiters of multi-line comments)
+$ML_COMMENT=<!--- --->
+
+# List of strings which start one line comments
+$SL_COMMENT=//
+
+#$TAG_DELIM(kwa)=< >
+
+$KEYWORDS(kwa)=regex(<!?\/?\w+>?|/?>)
+$KEYWORDS(kwb)=regex(([-\w]+)=")
+$KEYWORDS(kwc)=regex(\&\#?\w+;)
+
+# Prefix which defines variables
+$KEYWORDS(kwd)=regex(\#\w+)
+
+$SYMBOLS= ( ) [ ] { } , ; : & | ! = / * % + - .
diff --git a/support/highlight/langDefs/chl.lang b/support/highlight/langDefs/chl.lang
new file mode 100644
index 0000000000..b058d0a222
--- /dev/null
+++ b/support/highlight/langDefs/chl.lang
@@ -0,0 +1,51 @@
+# CHILL (CCITT High Level Language) language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 22.06.09
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+# + mpol
+
+$DESCRIPTION=CHILL
+
+$KEYWORDS(kwa)= AND BEGIN CASE DIV DO ELSE ELSIF END ESAC EXIT FI FOR GOTO IF IN
+MOD NOT OD OF ON OR OUT RESULT RETURN THEN THEN TO UNTIL USES WHILE WITH XOR
+
+#types
+$KEYWORDS(kwb)=ARRAY DCL GRANT LABEL MODULE NEWMODE PROC POWERSET SEIZE SET STRUCT SYN SYNMODE TYPE PACK
+
+$KEYWORDS(kwc)= BIN CHAR INT RANGE BOOL PTR REF
+
+$KEYWORDS(kwd)=MODULE_DESCRIPTION_HEADER PATCH_INFOS LIO_INFOS SWSG_INFOS MSG_XREF
+EJECT FALSE NULL TRUE
+
+$STRINGDELIMITERS=" '
+
+#$SL_COMMENT=//
+
+$ML_COMMENT=/* */ <> <>
+
+$ALLOWNESTEDCOMMENTS=false
+
+$IGNORECASE=true
+
+#$DIRECTIVE=#
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; . : & | < > ! = / * % + - ~
+
+#$CONTINUATIONSYMBOL=\
+
+#$REFORMATTING=true
diff --git a/support/highlight/langDefs/clipper.lang b/support/highlight/langDefs/clipper.lang
new file mode 100644
index 0000000000..5469986cb5
--- /dev/null
+++ b/support/highlight/langDefs/clipper.lang
@@ -0,0 +1,71 @@
+# Clipper language definition file
+#
+# Author: André Simon
+# Mail: andre.simon1@gmx.de
+# Date: 04.03.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Clipper
+
+$KEYWORDS(kwa)=announce begin break case declare do elseif else endif enddo end
+endcase exit external field for if local loop memvar next otherwise parameters
+private public recover request return sequence step static using while with
+accept append all alternate box blank bell call cancel clear close commit
+continue copy count create century color confirm console cursor delete dir
+display date decimals default deleted delimiters device eject erase extended
+epoch escape exact exclusive file find form from filter fixed format function
+get gets go index init input intensity join keyboard key label list locate
+memory menu margin message note order pack procedure prompt path printer quit
+read recall reindex release rename replace report restore run relation say
+screen structure save seek select set scoreboard softseek skip sort store sum
+to typeahead text total type unique unlock update use wrap wait zap
+
+
+#Functions:
+$KEYWORDS(kwb)=aadd abs achoice aclone acopy adel adir aeval afields afill ains
+alert alias alltrim altd array asc ascan asize asort at atail average bin2i
+bin2l bin2w bof browse cdow chr cmonth col colorselect ctod curdir day dbappend
+dbclearfilter dbclearindex dbclearrelation dbcloseall dbclosearea dbcommit
+dbcommitall dbcreate dbcreateindex dbdelete dbedit dbeval dbf dbfilter
+dbgobottom dbgoto dbgotop dbrecall dbreindex dbrelation dbrselect dbseek
+dbselectarea dbsetdriver dbsetfilter dbsetindex dbsetorder dbsetrelation dbskip
+dbstruct dbunlock dbunlockall dbusearea descend devout devoutpict devpos
+directory diskspace dispbegin dispbox dispcount dispend dispout doserror dow
+dtoc dtos empty eof errorblock errorlevel eval exp fclose fcount fcreate ferase
+ferror fieldblock fieldget fieldname fieldpos fieldput fieldwblock fklabel
+fkmax flock fopen found fread freadstr frename fseek fwrite getenv hardcr
+header i2bin indexext indexkey indexord inkey int isalpha iscolor isdigit
+islower isprinter isupper l2bin lastkey lastrec left len log lower ltrim
+lupdate max maxcol maxrow memoedit memoline memoread memotran memowrit
+memvarblock min mlcount mlctopos mlpos mod month mpostolc neterr netname
+nextkey nosnow os outerr outstd pad pcol pcount procline procname prow qout rat
+readexit readinsert readkey readmodal readvar reccount recno recsize replicate
+restscreen right rlock round row rtrim savescreen scroll seconds setblink
+setcancel setcolor setcursor setkey setmode setpos setprc soundex space sqrt
+str strtran stuff substr time tone transform updated upper val valtype
+version word year
+
+
+$STRINGDELIMITERS=" '
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SL_COMMENT=// *
+
+$ML_COMMENT=/* */
+
+$IGNORECASE=true
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / % + -
+
+
diff --git a/support/highlight/langDefs/clojure.lang b/support/highlight/langDefs/clojure.lang
new file mode 100644
index 0000000000..f8d78f7a59
--- /dev/null
+++ b/support/highlight/langDefs/clojure.lang
@@ -0,0 +1,50 @@
+# Clojure language definition file
+#
+# Author: Pierre Larochelle
+# Mail: pierrebombay@gmail.com
+# Date: 11.18.08
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter
+# released under the GPL.
+#
+# The file is used to describe keywords and special symbols of
+# programming languages.
+# See README in the highlight directory for details.
+#
+#
+# ----------
+
+$DESCRIPTION=Clojure
+
+# Function, macro, and template definitions
+$KEYWORDS(kwa)=def defn defmacro fn defstruct defmulti defmethod remove-method
+
+# Looping
+$KEYWORDS(kwb)=for loop recur dotimes doseq
+
+# Conditionals
+$KEYWORDS(kwc)=case caselet check if let when whenlet unless
+
+# List ops
+$KEYWORDS(kwd)=first rest cons ffirst frest rrest second every? not-every? some not-any? concat map mapcat reducefilter take take-nth take-while drop nthrest drop-while reverse cycle interleave split-at split-with repeat replicate iterate range into distinct sort sort-by zipmap fnseq lazy-cons lazy-cat when-first
+
+# Namespaces
+$KEYWORDS(kde)=in-ns create-ns find-ns all-ns remove-nd import refer ns-name ns-map ns-intern ns-publics ns-imports ns-refers ns-resolve resolve ns-unmap name namespace
+
+# General functions
+$KEYWORDS(kwf)=eval load load-file . .. doto new set! and or when when-not cond macroexpand-1 macroexpand = not= apply partial comp nil? not false? true? compliment constantly identical? identity str time comparator symbol keyword line-seq pr prn print println pr-str prn-str print-str println-str with-out-str newline with-open assert string? symbol? map? seq? vector? re-matcher re-find re-matches re-groups re-seq + - * / quot rem == < > >= <= min max inc dec zero? pos? neg? bit-and bit-or bit-xor nit-not bit-shift-right bit-shift-left gensym count conj seq list list* peek pop vector assoc get nth peek pop rseq subvec hash-map sorted-map sorted-map-by assoc dissoc get contains? find select-keys key val keys vals merge merge-with create-struct struct-map struct accessor array-map set union difference intersection select index rename join meta with-meta binding find-var with-local-vars var-get var-set ref dosync deref ensure alter ref-set commute agent deref send send-off agent-errors clear-agent-errors await await-for-timeout-ms locking -> parse
+
+$IDENTIFIER=regex([a-zA-Z_][\w\-\/]*)
+
+# The rest is taken directly from André Simon's lisp.lang definition
+$STRINGDELIMITERS="
+
+$ML_COMMENT=;| |;
+
+$SL_COMMENT=;
+
+#$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , : & < > ! + = / * '
diff --git a/support/highlight/langDefs/clp.lang b/support/highlight/langDefs/clp.lang
new file mode 100644
index 0000000000..95ad82be5b
--- /dev/null
+++ b/support/highlight/langDefs/clp.lang
@@ -0,0 +1,633 @@
+# Clips language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 04.03.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Clips
+
+
+$KEYWORDS(kwa)=and bind break defglobal deffunction evenp else eq floatpfloatp false
+if integerp lexemep loop-for-count multifieldp neq not numberp or oddp pointerp
+progn progn$ return stringp switch symbolp then true while
+
+#Functions:
+$KEYWORDS(kwb)=acos acosh acot acoth acsc acsch asec asech asin asinh atan atanh
+abs assert assert-string build create cos cosh cot coth csc csch close
+call-next-method call-specific-method class class-abstractp class-existp
+class-reactivep class-slots class-subclasses class-superclasses
+call-next-handler delete deg-grad deg-rad div defgeneric-module duplicate
+deftemplate-module defrule-module defglobal-module deffunction-module
+dynamic-get dynamic-put direct-slot-delete direct-slot-insert
+direct-slot-replace defclass-module definstances-module delete-instance eval
+explode exp expand first float format fact-index
+get-sequence-operator-recognition gensym get-function_restrictions grad-deg
+get-defgeneric-list get-defmethod-list get-method-restrictions
+get-deftemplate-list get-defrule-list get-defmodule-list get-defglobal-list
+get-deffunction-list get-focus get-focus-stack get-defclass-list
+get-defmessage-handler-list get-definstances-list implode insert integer
+instance-addressp instance-existp instance-namep instancep init-slots
+instance-address instance-name instance-name-to-symbol lowcase length length
+log log10 member mod max min modify message-handler-existp nth next-handlerp
+next-methodp open override-next-handler override-next-method pi printout
+pop-focus replace rest random rad-deg round read readline remove rename retract
+str-length sub-string sym-cat str-cat str-compare str-index
+set-sequence-operator-recognition subseq subsetp seed setgen sec sech sin sinh
+sec sech sin sinh sqrt slot-delete slot-insert slot-replace
+symbol-to-instance-name slot-allowed-values slot-cardinality
+slot-direct-accessp slot-existp slot-facets slot-initablep slot-publicp
+slot-range slot-sources slot-types slot-writablep subclassp superclassp time
+tan tanh type upcase unmake-instance app-create app-get-show-frame-on-init
+app-on-init app-set-show-frame-on-init arc-annotation-get-name
+arc-image-change-attachment arc-image-control-point-add
+arc-image-control-point-count arc-image-control-point-move
+arc-image-control-point-remove arc-image-control-point-x
+arc-image-control-point-y arc-image-create arc-image-get-alignment-type
+arc-image-get-attachment-from arc-image-get-attachment-to
+arc-image-get-image-from arc-image-get-image-to arc-image-is-leg
+arc-image-is-spline arc-image-is-stem arc-image-set-alignment-type
+arc-image-set-spline batch begin-busy-cursor bell brush-create brush-delete
+button-create button-create-from-bitmap bitmap-create bitmap-delete
+bitmap-get-colourmap bitmap-get-height bitmap-get-width bitmap-load-from-file
+canvas-scroll canvas-set-scroll-page-y canvas-set-scroll-pos-x
+canvas-set-scroll-pos-y canvas-set-scroll-range-x canvas-set-scroll-range-y
+canvas-view-start-x canvas-view-start-y card-create card-delete
+card-deselect-all card-find-by-title card-get-canvas card-get-first-item
+card-get-frame card-get-height card-get-next-item card-get-special-item
+card-get-string-attribute card-get-toolbar card-get-width card-get-x card-get-y
+card-iconize card-is-modified card-is-shown card-is-valid card-move card-quit
+card-select-all card-send-command card-set-icon card-set-modified
+card-set-status-text card-set-string-attribute card-show chdir clean-windows
+clear-ide-window clear-resources copy-file cursor-create cursor-delete
+cursor-load-from-file connection-advise connection-execute
+connection-disconnect connection-poke connection-request
+connection-start-advise connection-stop-advise client-create colour-create
+colour-red colour-green colour-blue client-make-connection choice-create
+choice-append choice-find-string choice-clear choice-get-selection
+choice-get-string-selection choice-set-selection choice-set-string-selection
+choice-get-string check-box-create check-box-set-value check-box-get-value
+canvas-create canvas-get-dc canvas-get-scroll-page-x canvas-get-scroll-page-y
+canvas-get-scroll-pos-x canvas-get-scroll-pos-y canvas-get-scroll-range-x
+canvas-get-scroll-range-y canvas-get-scroll-pixels-per-unit-x
+canvas-get-scroll-pixels-per-unit-x canvas-on-char canvas-on-scroll
+canvas-set-scrollbars canvas-set-scroll-page-x container-region-add-node-image
+container-region-remove-node-image convert-bitmap-to-rtf
+convert-metafile-to-rtf database-close database-create database-delete
+database-error-occurred database-get-data-source database-get-database-name
+database-get-error-code database-get-error-message database-get-error-number
+database-is-open database-open date-add-days date-add-months date-add-self
+date-add-weeks date-add-years date-create date-create-julian date-create-string
+date-delete date-eq date-format date-ge date-geq date-get-day
+date-get-day-of-week date-get-day-of-week-name date-get-day-of-year
+date-get-days-in-month date-get-first-day-of-month date-get-julian-date
+date-get-month date-get-month-end date-get-month-name date-get-month-start
+date-get-week-of-month date-get-week-of-year date-get-year date-get-year-end
+date-get-year-start date-is-leap-year date-l date-leq date-neq
+date-set-current-date date-set-date date-set-format date-set-julian
+date-set-option date-subtract date-subtract-days date-subtract-self
+dc-begin-drawing dc-blit dc-clear dc-delete dc-destroy-clipping-region
+dc-draw-ellipse dc-draw-line dc-draw-lines dc-draw-point dc-draw-polygon
+dc-draw-rectangle dc-draw-rounded-rectangle dc-draw-spline dc-draw-text
+dc-end-doc dc-end-drawing dc-end-page dc-get-max-x dc-get-max-y dc-get-min-x
+dc-get-min-y dc-get-text-extent-height dc-get-text-extent-width dc-ok
+dc-set-background dc-set-background-mode dc-set-brush dc-set-clipping-region
+dc-set-colourmap dc-set-font dc-set-logical-function dc-set-pen
+dc-set-text-background dc-set-text-foreground dc-start-doc dc-start-page
+dde-advise-global debug-msg diagram-card-clear-canvas diagram-card-copy
+diagram-card-create diagram-card-create-expansion diagram-card-cut
+diagram-card-delete-all-images diagram-card-find-root
+diagram-card-get-first-arc-image diagram-card-get-first-arc-object
+diagram-card-get-first-descendant diagram-card-get-first-node-image
+diagram-card-get-first-node-object diagram-card-get-grid-spacing
+diagram-card-get-next-arc-image diagram-card-get-next-arc-object
+diagram-card-get-next-descendant diagram-card-get-next-node-image
+diagram-card-get-next-node-object diagram-card-get-parent-card
+diagram-card-get-parent-image diagram-card-get-print-height
+diagram-card-get-print-width diagram-card-get-scale diagram-card-layout-graph
+diagram-card-layout-tree diagram-card-load-file diagram-card-paste
+diagram-card-popup-menu diagram-card-print-hierarchy diagram-card-redraw
+diagram-card-save-bitmap diagram-card-save-file diagram-card-save-metafile
+diagram-card-set-grid-spacing diagram-card-set-layout-parameters
+diagram-card-set-scale diagram-image-add-annotation
+diagram-image-annotation-get-drop-site
+diagram-image-annotation-get-logical-name diagram-image-annotation-get-name
+diagram-image-delete diagram-image-delete-annotation diagram-image-draw
+diagram-image-draw-text diagram-image-erase diagram-image-get-brush-colour
+diagram-image-get-card diagram-image-get-first-annotation
+diagram-image-get-first-expansion diagram-image-get-height
+diagram-image-get-item diagram-image-get-next-annotation
+diagram-image-get-next-expansion diagram-image-get-object
+diagram-image-get-pen-colour diagram-image-get-text-colour
+diagram-image-get-width diagram-image-get-x diagram-image-get-y
+diagram-image-is-shown diagram-image-move diagram-image-pending-delete
+diagram-image-put-to-front diagram-image-resize diagram-image-select
+diagram-image-selected diagram-image-set-brush-colour
+diagram-image-set-pen-colour diagram-image-set-shadow-mode
+diagram-image-set-text-colour diagram-image-show diagram-item-get-image
+diagram-object-add-attribute diagram-object-delete-attribute
+diagram-object-format-text diagram-object-get-first-attribute
+diagram-object-get-first-image diagram-object-get-next-attribute
+diagram-object-get-next-image diagram-object-get-string-attribute
+diagram-object-set-format-string diagram-object-set-string-attribute
+diagram-palette-get-arc-selection diagram-palette-get-arc-selection-image
+diagram-palette-get-first-annotation-selection
+diagram-palette-get-next-annotation-selection
+diagram-palette-get-node-selection diagram-palette-set-annotation-selection
+diagram-palette-set-arc-selection diagram-palette-set-node-selection
+diagram-palette-show dialog-box-create dialog-box-create-from-resource
+dialog-box-is-modal dialog-box-set-modal dir-exists end-busy-cursor
+event-get-event-type execute file-exists file-selector find-window-by-label
+find-window-by-name float-to-string font-create font-delete frame-create
+frame-create-status-line frame-iconize frame-on-size frame-set-icon
+frame-set-menu-bar frame-set-status-text frame-set-title frame-set-tool-bar
+gauge-create gauge-set-bezel-face gauge-set-shadow-width gauge-set-value
+get-active-window get-choice get-elapsed-time get-ide-window get-os-version
+get-platform get-resource get-text-from-user grid-adjust-scrollbars
+grid-append-cols grid-append-rows grid-clear-grid grid-create grid-create-grid
+grid-delete-cols grid-delete-rows grid-get-cell-alignment
+grid-get-cell-background-colour grid-get-cell-bitmap grid-get-cell-text-colour
+grid-get-cell-value grid-get-cols grid-get-column-width grid-get-cursor-column
+grid-get-cursor-row grid-get-editable grid-get-label-alignment
+grid-get-label-background-colour grid-get-label-size grid-get-label-text-colour
+grid-get-label-value grid-get-row-height grid-get-rows grid-get-scroll-pos-x
+grid-get-scroll-pos-y grid-get-text-item grid-insert-cols grid-insert-rows
+grid-on-activate grid-on-paint grid-on-size grid-set-cell-alignment
+grid-set-cell-background-colour grid-set-cell-bitmap grid-set-cell-text-colour
+grid-set-cell-text-font grid-set-cell-value grid-set-column-width
+grid-set-divider-pen grid-set-editable grid-set-grid-cursor
+grid-set-label-alignment grid-set-label-background-colour grid-set-label-size
+grid-set-label-text-colour grid-set-label-text-font grid-set-label-value
+grid-set-row-height grid-update-dimensions group-box-create hardy-clear-index
+hardy-command-int-to-string hardy-command-string-to-int
+hardy-diagram-definition-get-first-arc-type
+hardy-diagram-definition-get-first-node-type
+hardy-diagram-definition-get-next-arc-type
+hardy-diagram-definition-get-next-node-type hardy-get-browser-frame
+hardy-get-first-card hardy-get-first-diagram-definition hardy-get-next-card
+hardy-get-next-diagram-definition hardy-get-top-card hardy-get-top-level-frame
+hardy-get-version hardy-help-display-block hardy-help-display-contents
+hardy-help-display-section hardy-help-keyword-search hardy-help-load-file
+hardy-load-index hardy-path-search hardy-preview-all
+hardy-preview-diagram-card hardy-print-all hardy-print-diagram-card
+hardy-print-diagram-in-box hardy-print-diagram-page
+hardy-print-get-header-footer hardy-print-get-info hardy-print-header-footer
+hardy-print-set-header-footer hardy-print-set-info hardy-print-set-title
+hardy-print-text-in-box hardy-save-index hardy-send-command
+hardy-set-about-string hardy-set-author hardy-set-custom-help-file
+hardy-set-help-file hardy-set-name hardy-set-title help-create help-delete
+help-display-block help-display-contents help-display-section
+help-keyword-search help-load-file html-back html-cancel html-clear-cache
+html-create html-get-current-url html-on-size html-open-file html-open-url
+html-resize html-save-file hwnd-find hwnd-iconize hwnd-move hwnd-quit
+hwnd-refresh hwnd-send-message hwnd-show hypertext-block-add
+hypertext-block-clear hypertext-block-get-item hypertext-block-get-text
+hypertext-block-get-type hypertext-block-selected hypertext-block-set-type
+hypertext-card-create hypertext-card-get-current-char
+hypertext-card-get-current-line hypertext-card-get-first-selection
+hypertext-card-get-line-length hypertext-card-get-next-selection
+hypertext-card-get-no-lines hypertext-card-get-offset-position
+hypertext-card-get-span-text hypertext-card-insert-text
+hypertext-card-load-file hypertext-card-save-file hypertext-card-string-search
+hypertext-card-translate hypertext-card-translator-close-file
+hypertext-card-translator-open-file hypertext-card-translator-output
+hypertext-item-get-block icon-create icon-delete icon-get-height icon-get-width
+icon-load-from-file instance-table-add-entry instance-table-delete-entry
+instance-table-get-instance item-get-first-link item-get-kind
+item-get-next-link item-get-type item-goto item-set-kind key-event-alt-down
+key-event-control-down key-event-get-key-code key-event-position-x
+key-event-position-y key-event-shift-down link-cards link-get-card-from
+link-get-card-to link-get-item-from link-get-item-to link-get-kind
+link-get-type link-items link-set-kind list-box-append list-box-clear
+list-box-create list-box-delete list-box-find-string
+list-box-get-first-selection list-box-get-next-selection list-box-get-selection
+list-box-get-string list-box-get-string-selection list-box-number
+list-box-set-selection list-box-set-string-selection load-resource-file
+long-to-string make-metafile-placeable mci-send-string media-block-create
+media-block-get-item media-block-get-position media-block-get-type
+media-block-set-type media-card-append-text media-card-apply-family
+media-card-apply-foreground-colour media-card-apply-point-size
+media-card-apply-style media-card-apply-underline media-card-apply-weight
+media-card-clear media-card-clear-all-blocks media-card-copy media-card-create
+media-card-cut media-card-delete media-card-find-string
+media-card-get-character media-card-get-first-block
+media-card-get-last-position media-card-get-line-for-position
+media-card-get-line-length media-card-get-next-block
+media-card-get-number-of-lines media-card-get-position-for-line
+media-card-get-selection-end media-card-get-selection-start media-card-get-text
+media-card-insert-image media-card-insert-text media-card-load-file
+media-card-paste media-card-redo media-card-save-file
+media-card-scroll-to-position media-card-select-block media-card-set-selection
+media-card-undo media-item-get-block memory-dc-create memory-dc-select-object
+menu-append menu-append-separator menu-bar-append menu-bar-check
+menu-bar-checked menu-bar-create menu-bar-enable menu-break menu-check
+menu-create menu-enable message-box message-create message-create-from-bitmap
+metafile-dc-close metafile-dc-create metafile-delete metafile-set-clipboard
+mkdir mouse-event-button mouse-event-button-down mouse-event-control-down
+mouse-event-dragging mouse-event-is-button mouse-event-left-down
+mouse-event-left-up mouse-event-middle-down mouse-event-middle-up
+mouse-event-position-x mouse-event-position-y mouse-event-right-down
+mouse-event-right-up mouse-event-shift-down multi-text-copy multi-text-create
+multi-text-cut multi-text-get-insertion-point multi-text-get-last-position
+multi-text-get-line-length multi-text-get-line-length
+multi-text-get-number-of-lines multi-text-get-value multi-text-paste
+multi-text-position-to-char multi-text-position-to-line multi-text-remove
+multi-text-replace multi-text-set-insertion-point multi-text-set-selection
+multi-text-set-value multi-text-show-position multi-text-write
+multi-text-xy-to-position node-image-create node-image-duplicate
+node-image-get-container node-image-get-container-parent
+node-image-get-first-arc-image node-image-get-first-child
+node-image-get-first-container-region node-image-get-next-arc-image
+node-image-get-next-child node-image-get-next-container-region
+node-image-get-parent node-image-is-composite node-image-is-container
+node-image-is-junction node-image-order-arcs node-object-get-first-arc-object
+node-object-get-next-arc-object now object-get-type object-is-valid
+object-type-get-first-attribute-name object-type-get-next-attribute-name
+panel-create panel-create-from-resource panel-item-get-command-event
+panel-item-get-label panel-item-set-default panel-item-set-label panel-new-line
+panel-set-button-font panel-set-label-font panel-set-label-position pen-create
+pen-delete postscript-dc-create printer-dc-create quit radio-box-create
+radio-box-get-selection radio-box-set-selection read-string recordset-create
+recordset-delete recordset-execute-sql recordset-get-char-data
+recordset-get-col-name recordset-get-col-type recordset-get-columns
+recordset-get-data-sources recordset-get-database recordset-get-error-code
+recordset-get-filter recordset-get-float-data recordset-get-foreign-keys
+recordset-get-int-data recordset-get-number-cols recordset-get-number-fields
+recordset-get-number-params recordset-get-number-records
+recordset-get-primary-keys recordset-get-result-set recordset-get-table-name
+recordset-get-tables recordset-goto recordset-is-bof recordset-is-col-nullable
+recordset-is-eof recordset-is-field-dirty recordset-is-field-null
+recordset-is-open recordset-move recordset-move-first recordset-move-last
+recordset-move-next recordset-move-prev recordset-query
+recordset-set-table-name register-event-handler return-result rmdir
+server-create set-work-proc show-ide-window sleep slider-create
+slider-get-value slider-set-value start-timer string-sort string-to-float
+string-to-long string-to-symbol symbol-to-string text-card-load-file
+text-create text-get-value text-set-value text-window-clear text-window-copy
+text-window-create text-window-cut text-window-discard-edits
+text-window-get-contents text-window-get-insertion-point
+text-window-get-last-position text-window-get-line-length
+text-window-get-line-length text-window-get-number-of-lines
+text-window-load-file text-window-modified text-window-on-char
+text-window-paste text-window-position-to-char text-window-position-to-line
+text-window-remove text-window-replace text-window-save-file
+text-window-set-editable text-window-set-insertion-point
+text-window-set-selection text-window-show-position text-window-write
+text-window-xy-to-position timer-create timer-delete timer-start timer-stop
+toolbar-add-separator toolbar-add-tool toolbar-clear-tools toolbar-create
+toolbar-create-tools toolbar-enable-tool toolbar-get-max-height
+toolbar-get-max-width toolbar-get-tool-client-data toolbar-get-tool-enabled
+toolbar-get-tool-long-help toolbar-get-tool-short-help toolbar-get-tool-state
+toolbar-layout toolbar-on-paint toolbar-set-default-size toolbar-set-margins
+toolbar-set-tool-long-help toolbar-set-tool-short-help toolbar-toggle-tool
+window-add-callback window-centre window-close window-delete window-enable
+window-fit window-get-client-height window-get-client-width window-get-height
+window-get-name window-get-next-child window-get-parent window-get-width
+window-get-x window-get-y window-is-shown window-make-modal window-popup-menu
+window-refresh window-remove-callback window-set-client-size window-set-cursor
+window-set-focus window-set-size window-set-size-hints window-show
+write-resource wxclips-object-exists yield carddelete carddeletealllinks
+carddeletelink cardeditfilename cardedittitle cardgotocontrolwindow
+cardlinknewcard cardlinktoselection cardopenfile cardorderlinks cardquit
+cardsavefile cardsavefileas cardselectitem cardtogglelinkpanel
+diagramaddannotation diagramaddcontrol diagramapplydefinition diagrambrowse
+diagramchangefont diagramclearall diagramcopy diagramcopydiagram
+diagramcopyselection diagramcopytoclipboard diagramcut diagramdeleteannotation
+diagramdeletecontrol diagramdeselectall diagramduplicateselection
+diagrameditoptions diagramformatgraph diagramformattext diagramformattree
+diagramgotoroot diagramhelp diagramhorizontalalign diagramhorizontalalignbottom
+diagramhorizontalaligntop diagramnewexpansion diagrampaste diagramprint
+diagramprintall diagramprinteps diagramprintpreview diagramrefresh
+diagramsavebitmap diagramsavemetafile diagramselectall diagramstraighten
+diagramtoback diagramtofront diagramtogglepalette diagramtoggletoolbar
+diagramverticalalign diagramverticalalignleft diagramverticalalignright
+diagramzoom100 diagramzoom30 diagramzoom40 diagramzoom50 diagramzoom60
+diagramzoom70 diagramzoom80 diagramzoom90 hardybrowsefiles hardyclearindex
+hardyconfigure hardydeselectallitems hardydrawtree hardyexit hardyfindorphans
+hardyhelpabout hardyhelpcontents hardyhelpsearch hardyloadapplication
+hardyloadfile hardyprint hardyprintpreview hardyprintsetup hardysavefile
+hardysavefileas hardysearchcards hardyshowarcsymboleditor
+hardyshowdevelopmentwindow hardyshowdiagrammanager hardyshowhypertextmanager
+hardyshownodesymboleditor hardyshowpackagetool hardyshowsymbollibrarian
+hardyviewtopcard create cos cosh cot coth csc csch close call-next-method
+call-specific-method class class-abstractp class-existp class-reactivep
+class-slots class-subclasses class-superclasses call-next-handler delete
+deg-grad deg-rad div defgeneric-module duplicate deftemplate-module
+defrule-module defglobal-module deffunction-module dynamic-get dynamic-put
+direct-slot-delete direct-slot-insert direct-slot-replace defclass-module
+definstances-module delete-instance eval explode exp expand first float format
+fact-index get-sequence-operator-recognition gensym get-function_restrictions
+grad-deg get-defgeneric-list get-defmethod-list get-method-restrictions
+get-deftemplate-list get-defrule-list get-defmodule-list get-defglobal-list
+get-deffunction-list get-focus get-focus-stack get-defclass-list
+get-defmessage-handler-list get-definstances-list implode insert integer
+instance-addressp instance-existp instance-namep instancep init-slots
+instance-address instance-name instance-name-to-symbol lowcase length length
+log log10 member mod max min modify message-handler-existp nth next-handlerp
+next-methodp open override-next-handler override-next-method pi printout
+pop-focus replace rest random rad-deg round read readline remove rename retract
+str-length sub-string sym-cat str-cat str-compare str-index
+set-sequence-operator-recognition subseq subsetp seed setgen sec sech sin sinh
+sec sech sin sinh sqrt slot-delete slot-insert slot-replace
+symbol-to-instance-name slot-allowed-values slot-cardinality
+slot-direct-accessp slot-existp slot-facets slot-initablep slot-publicp
+slot-range slot-sources slot-types slot-writablep subclassp superclassp time
+tan tanh type upcase unmake-instance app-create app-get-show-frame-on-init
+app-on-init app-set-show-frame-on-init arc-annotation-get-name
+arc-image-change-attachment arc-image-control-point-add
+arc-image-control-point-count arc-image-control-point-move
+arc-image-control-point-remove arc-image-control-point-x
+arc-image-control-point-y arc-image-create arc-image-get-alignment-type
+arc-image-get-attachment-from arc-image-get-attachment-to
+arc-image-get-image-from arc-image-get-image-to arc-image-is-leg
+arc-image-is-spline arc-image-is-stem arc-image-set-alignment-type
+arc-image-set-spline batch begin-busy-cursor bell brush-create brush-delete
+button-create button-create-from-bitmap bitmap-create bitmap-delete
+bitmap-get-colourmap bitmap-get-height bitmap-get-width bitmap-load-from-file
+canvas-scroll canvas-set-scroll-page-y canvas-set-scroll-pos-x
+canvas-set-scroll-pos-y canvas-set-scroll-range-x canvas-set-scroll-range-y
+canvas-view-start-x canvas-view-start-y card-create card-delete
+card-deselect-all card-find-by-title card-get-canvas card-get-first-item
+card-get-frame card-get-height card-get-next-item card-get-special-item
+card-get-string-attribute card-get-toolbar card-get-width card-get-x card-get-y
+card-iconize card-is-modified card-is-shown card-is-valid card-move card-quit
+card-select-all card-send-command card-set-icon card-set-modified
+card-set-status-text card-set-string-attribute card-show chdir clean-windows
+clear-ide-window clear-resources copy-file cursor-create cursor-delete
+cursor-load-from-file connection-advise connection-execute
+connection-disconnect connection-poke connection-request
+connection-start-advise connection-stop-advise client-create colour-create
+colour-red colour-green colour-blue client-make-connection choice-create
+choice-append choice-find-string choice-clear choice-get-selection
+choice-get-string-selection choice-set-selection choice-set-string-selection
+choice-get-string check-box-create check-box-set-value check-box-get-value
+canvas-create canvas-get-dc canvas-get-scroll-page-x canvas-get-scroll-page-y
+canvas-get-scroll-pos-x canvas-get-scroll-pos-y canvas-get-scroll-range-x
+canvas-get-scroll-range-y canvas-get-scroll-pixels-per-unit-x
+canvas-get-scroll-pixels-per-unit-x canvas-on-char canvas-on-scroll
+canvas-set-scrollbars canvas-set-scroll-page-x container-region-add-node-image
+container-region-remove-node-image convert-bitmap-to-rtf
+convert-metafile-to-rtf database-close database-create database-delete
+database-error-occurred database-get-data-source database-get-database-name
+database-get-error-code database-get-error-message database-get-error-number
+database-is-open database-open date-add-days date-add-months date-add-self
+date-add-weeks date-add-years date-create date-create-julian date-create-string
+date-delete date-eq date-format date-ge date-geq date-get-day
+date-get-day-of-week date-get-day-of-week-name date-get-day-of-year
+date-get-days-in-month date-get-first-day-of-month date-get-julian-date
+date-get-month date-get-month-end date-get-month-name date-get-month-start
+date-get-week-of-month date-get-week-of-year date-get-year date-get-year-end
+date-get-year-start date-is-leap-year date-l date-leq date-neq
+date-set-current-date date-set-date date-set-format date-set-julian
+date-set-option date-subtract date-subtract-days date-subtract-self
+dc-begin-drawing dc-blit dc-clear dc-delete dc-destroy-clipping-region
+dc-draw-ellipse dc-draw-line dc-draw-lines dc-draw-point dc-draw-polygon
+dc-draw-rectangle dc-draw-rounded-rectangle dc-draw-spline dc-draw-text
+dc-end-doc dc-end-drawing dc-end-page dc-get-max-x dc-get-max-y dc-get-min-x
+dc-get-min-y dc-get-text-extent-height dc-get-text-extent-width dc-ok
+dc-set-background dc-set-background-mode dc-set-brush dc-set-clipping-region
+dc-set-colourmap dc-set-font dc-set-logical-function dc-set-pen
+dc-set-text-background dc-set-text-foreground dc-start-doc dc-start-page
+dde-advise-global debug-msg diagram-card-clear-canvas diagram-card-copy
+diagram-card-create diagram-card-create-expansion diagram-card-cut
+diagram-card-delete-all-images diagram-card-find-root
+diagram-card-get-first-arc-image diagram-card-get-first-arc-object
+diagram-card-get-first-descendant diagram-card-get-first-node-image
+diagram-card-get-first-node-object diagram-card-get-grid-spacing
+diagram-card-get-next-arc-image diagram-card-get-next-arc-object
+diagram-card-get-next-descendant diagram-card-get-next-node-image
+diagram-card-get-next-node-object diagram-card-get-parent-card
+diagram-card-get-parent-image diagram-card-get-print-height
+diagram-card-get-print-width diagram-card-get-scale diagram-card-layout-graph
+diagram-card-layout-tree diagram-card-load-file diagram-card-paste
+diagram-card-popup-menu diagram-card-print-hierarchy diagram-card-redraw
+diagram-card-save-bitmap diagram-card-save-file diagram-card-save-metafile
+diagram-card-set-grid-spacing diagram-card-set-layout-parameters
+diagram-card-set-scale diagram-image-add-annotation
+diagram-image-annotation-get-drop-site
+diagram-image-annotation-get-logical-name diagram-image-annotation-get-name
+diagram-image-delete diagram-image-delete-annotation diagram-image-draw
+diagram-image-draw-text diagram-image-erase diagram-image-get-brush-colour
+diagram-image-get-card diagram-image-get-first-annotation
+diagram-image-get-first-expansion diagram-image-get-height
+diagram-image-get-item diagram-image-get-next-annotation
+diagram-image-get-next-expansion diagram-image-get-object
+diagram-image-get-pen-colour diagram-image-get-text-colour
+diagram-image-get-width diagram-image-get-x diagram-image-get-y
+diagram-image-is-shown diagram-image-move diagram-image-pending-delete
+diagram-image-put-to-front diagram-image-resize diagram-image-select
+diagram-image-selected diagram-image-set-brush-colour
+diagram-image-set-pen-colour diagram-image-set-shadow-mode
+diagram-image-set-text-colour diagram-image-show diagram-item-get-image
+diagram-object-add-attribute diagram-object-delete-attribute
+diagram-object-format-text diagram-object-get-first-attribute
+diagram-object-get-first-image diagram-object-get-next-attribute
+diagram-object-get-next-image diagram-object-get-string-attribute
+diagram-object-set-format-string diagram-object-set-string-attribute
+diagram-palette-get-arc-selection diagram-palette-get-arc-selection-image
+diagram-palette-get-first-annotation-selection
+diagram-palette-get-next-annotation-selection
+diagram-palette-get-node-selection diagram-palette-set-annotation-selection
+diagram-palette-set-arc-selection diagram-palette-set-node-selection
+diagram-palette-show dialog-box-create dialog-box-create-from-resource
+dialog-box-is-modal dialog-box-set-modal dir-exists end-busy-cursor
+event-get-event-type execute file-exists file-selector find-window-by-label
+find-window-by-name float-to-string font-create font-delete frame-create
+frame-create-status-line frame-iconize frame-on-size frame-set-icon
+frame-set-menu-bar frame-set-status-text frame-set-title frame-set-tool-bar
+gauge-create gauge-set-bezel-face gauge-set-shadow-width gauge-set-value
+get-active-window get-choice get-elapsed-time get-ide-window get-os-version
+get-platform get-resource get-text-from-user grid-adjust-scrollbars
+grid-append-cols grid-append-rows grid-clear-grid grid-create grid-create-grid
+grid-delete-cols grid-delete-rows grid-get-cell-alignment
+grid-get-cell-background-colour grid-get-cell-bitmap grid-get-cell-text-colour
+grid-get-cell-value grid-get-cols grid-get-column-width grid-get-cursor-column
+grid-get-cursor-row grid-get-editable grid-get-label-alignment
+grid-get-label-background-colour grid-get-label-size grid-get-label-text-colour
+grid-get-label-value grid-get-row-height grid-get-rows grid-get-scroll-pos-x
+grid-get-scroll-pos-y grid-get-text-item grid-insert-cols grid-insert-rows
+grid-on-activate grid-on-paint grid-on-size grid-set-cell-alignment
+grid-set-cell-background-colour grid-set-cell-bitmap grid-set-cell-text-colour
+grid-set-cell-text-font grid-set-cell-value grid-set-column-width
+grid-set-divider-pen grid-set-editable grid-set-grid-cursor
+grid-set-label-alignment grid-set-label-background-colour grid-set-label-size
+grid-set-label-text-colour grid-set-label-text-font grid-set-label-value
+grid-set-row-height grid-update-dimensions group-box-create hardy-clear-index
+hardy-command-int-to-string hardy-command-string-to-int
+hardy-diagram-definition-get-first-arc-type
+hardy-diagram-definition-get-first-node-type
+hardy-diagram-definition-get-next-arc-type
+hardy-diagram-definition-get-next-node-type hardy-get-browser-frame
+hardy-get-first-card hardy-get-first-diagram-definition hardy-get-next-card
+hardy-get-next-diagram-definition hardy-get-top-card hardy-get-top-level-frame
+hardy-get-version hardy-help-display-block hardy-help-display-contents
+hardy-help-display-section hardy-help-keyword-search hardy-help-load-file
+hardy-load-index hardy-path-search hardy-preview-all
+hardy-preview-diagram-card hardy-print-all hardy-print-diagram-card
+hardy-print-diagram-in-box hardy-print-diagram-page
+hardy-print-get-header-footer hardy-print-get-info hardy-print-header-footer
+hardy-print-set-header-footer hardy-print-set-info hardy-print-set-title
+hardy-print-text-in-box hardy-save-index hardy-send-command
+hardy-set-about-string hardy-set-author hardy-set-custom-help-file
+hardy-set-help-file hardy-set-name hardy-set-title help-create help-delete
+help-display-block help-display-contents help-display-section
+help-keyword-search help-load-file html-back html-cancel html-clear-cache
+html-create html-get-current-url html-on-size html-open-file html-open-url
+html-resize html-save-file hwnd-find hwnd-iconize hwnd-move hwnd-quit
+hwnd-refresh hwnd-send-message hwnd-show hypertext-block-add
+hypertext-block-clear hypertext-block-get-item hypertext-block-get-text
+hypertext-block-get-type hypertext-block-selected hypertext-block-set-type
+hypertext-card-create hypertext-card-get-current-char
+hypertext-card-get-current-line hypertext-card-get-first-selection
+hypertext-card-get-line-length hypertext-card-get-next-selection
+hypertext-card-get-no-lines hypertext-card-get-offset-position
+hypertext-card-get-span-text hypertext-card-insert-text
+hypertext-card-load-file hypertext-card-save-file hypertext-card-string-search
+hypertext-card-translate hypertext-card-translator-close-file
+hypertext-card-translator-open-file hypertext-card-translator-output
+hypertext-item-get-block icon-create icon-delete icon-get-height icon-get-width
+icon-load-from-file instance-table-add-entry instance-table-delete-entry
+instance-table-get-instance item-get-first-link item-get-kind
+item-get-next-link item-get-type item-goto item-set-kind key-event-alt-down
+key-event-control-down key-event-get-key-code key-event-position-x
+key-event-position-y key-event-shift-down link-cards link-get-card-from
+link-get-card-to link-get-item-from link-get-item-to link-get-kind
+link-get-type link-items link-set-kind list-box-append list-box-clear
+list-box-create list-box-delete list-box-find-string
+list-box-get-first-selection list-box-get-next-selection list-box-get-selection
+list-box-get-string list-box-get-string-selection list-box-number
+list-box-set-selection list-box-set-string-selection load-resource-file
+long-to-string make-metafile-placeable mci-send-string media-block-create
+media-block-get-item media-block-get-position media-block-get-type
+media-block-set-type media-card-append-text media-card-apply-family
+media-card-apply-foreground-colour media-card-apply-point-size
+media-card-apply-style media-card-apply-underline media-card-apply-weight
+media-card-clear media-card-clear-all-blocks media-card-copy media-card-create
+media-card-cut media-card-delete media-card-find-string
+media-card-get-character media-card-get-first-block
+media-card-get-last-position media-card-get-line-for-position
+media-card-get-line-length media-card-get-next-block
+media-card-get-number-of-lines media-card-get-position-for-line
+media-card-get-selection-end media-card-get-selection-start media-card-get-text
+media-card-insert-image media-card-insert-text media-card-load-file
+media-card-paste media-card-redo media-card-save-file
+media-card-scroll-to-position media-card-select-block media-card-set-selection
+media-card-undo media-item-get-block memory-dc-create memory-dc-select-object
+menu-append menu-append-separator menu-bar-append menu-bar-check
+menu-bar-checked menu-bar-create menu-bar-enable menu-break menu-check
+menu-create menu-enable message-box message-create message-create-from-bitmap
+metafile-dc-close metafile-dc-create metafile-delete metafile-set-clipboard
+mkdir mouse-event-button mouse-event-button-down mouse-event-control-down
+mouse-event-dragging mouse-event-is-button mouse-event-left-down
+mouse-event-left-up mouse-event-middle-down mouse-event-middle-up
+mouse-event-position-x mouse-event-position-y mouse-event-right-down
+mouse-event-right-up mouse-event-shift-down multi-text-copy multi-text-create
+multi-text-cut multi-text-get-insertion-point multi-text-get-last-position
+multi-text-get-line-length multi-text-get-line-length
+multi-text-get-number-of-lines multi-text-get-value multi-text-paste
+multi-text-position-to-char multi-text-position-to-line multi-text-remove
+multi-text-replace multi-text-set-insertion-point multi-text-set-selection
+multi-text-set-value multi-text-show-position multi-text-write
+multi-text-xy-to-position node-image-create node-image-duplicate
+node-image-get-container node-image-get-container-parent
+node-image-get-first-arc-image node-image-get-first-child
+node-image-get-first-container-region node-image-get-next-arc-image
+node-image-get-next-child node-image-get-next-container-region
+node-image-get-parent node-image-is-composite node-image-is-container
+node-image-is-junction node-image-order-arcs node-object-get-first-arc-object
+node-object-get-next-arc-object now object-get-type object-is-valid
+object-type-get-first-attribute-name object-type-get-next-attribute-name
+panel-create panel-create-from-resource panel-item-get-command-event
+panel-item-get-label panel-item-set-default panel-item-set-label panel-new-line
+panel-set-button-font panel-set-label-font panel-set-label-position pen-create
+pen-delete postscript-dc-create printer-dc-create quit radio-box-create
+radio-box-get-selection radio-box-set-selection read-string recordset-create
+recordset-delete recordset-execute-sql recordset-get-char-data
+recordset-get-col-name recordset-get-col-type recordset-get-columns
+recordset-get-data-sources recordset-get-database recordset-get-error-code
+recordset-get-filter recordset-get-float-data recordset-get-foreign-keys
+recordset-get-int-data recordset-get-number-cols recordset-get-number-fields
+recordset-get-number-params recordset-get-number-records
+recordset-get-primary-keys recordset-get-result-set recordset-get-table-name
+recordset-get-tables recordset-goto recordset-is-bof recordset-is-col-nullable
+recordset-is-eof recordset-is-field-dirty recordset-is-field-null
+recordset-is-open recordset-move recordset-move-first recordset-move-last
+recordset-move-next recordset-move-prev recordset-query
+recordset-set-table-name register-event-handler return-result rmdir
+server-create set-work-proc show-ide-window sleep slider-create
+slider-get-value slider-set-value start-timer string-sort string-to-float
+string-to-long string-to-symbol symbol-to-string text-card-load-file
+text-create text-get-value text-set-value text-window-clear text-window-copy
+text-window-create text-window-cut text-window-discard-edits
+text-window-get-contents text-window-get-insertion-point
+text-window-get-last-position text-window-get-line-length
+text-window-get-line-length text-window-get-number-of-lines
+text-window-load-file text-window-modified text-window-on-char
+text-window-paste text-window-position-to-char text-window-position-to-line
+text-window-remove text-window-replace text-window-save-file
+text-window-set-editable text-window-set-insertion-point
+text-window-set-selection text-window-show-position text-window-write
+text-window-xy-to-position timer-create timer-delete timer-start timer-stop
+toolbar-add-separator toolbar-add-tool toolbar-clear-tools toolbar-create
+toolbar-create-tools toolbar-enable-tool toolbar-get-max-height
+toolbar-get-max-width toolbar-get-tool-client-data toolbar-get-tool-enabled
+toolbar-get-tool-long-help toolbar-get-tool-short-help toolbar-get-tool-state
+toolbar-layout toolbar-on-paint toolbar-set-default-size toolbar-set-margins
+toolbar-set-tool-long-help toolbar-set-tool-short-help toolbar-toggle-tool
+window-add-callback window-centre window-close window-delete window-enable
+window-fit window-get-client-height window-get-client-width window-get-height
+window-get-name window-get-next-child window-get-parent window-get-width
+window-get-x window-get-y window-is-shown window-make-modal window-popup-menu
+window-refresh window-remove-callback window-set-client-size window-set-cursor
+window-set-focus window-set-size window-set-size-hints window-show
+write-resource wxclips-object-exists yield carddelete carddeletealllinks
+carddeletelink cardeditfilename cardedittitle cardgotocontrolwindow
+cardlinknewcard cardlinktoselection cardopenfile cardorderlinks cardquit
+cardsavefile cardsavefileas cardselectitem cardtogglelinkpanel
+diagramaddannotation diagramaddcontrol diagramapplydefinition diagrambrowse
+diagramchangefont diagramclearall diagramcopy diagramcopydiagram
+diagramcopyselection diagramcopytoclipboard diagramcut diagramdeleteannotation
+diagramdeletecontrol diagramdeselectall diagramduplicateselection
+diagrameditoptions diagramformatgraph diagramformattext diagramformattree
+diagramgotoroot diagramhelp diagramhorizontalalign diagramhorizontalalignbottom
+diagramhorizontalaligntop diagramnewexpansion diagrampaste diagramprint
+diagramprintall diagramprinteps diagramprintpreview diagramrefresh
+diagramsavebitmap diagramsavemetafile diagramselectall diagramstraighten
+diagramtoback diagramtofront diagramtogglepalette diagramtoggletoolbar
+diagramverticalalign diagramverticalalignleft diagramverticalalignright
+diagramzoom100 diagramzoom30 diagramzoom40 diagramzoom50 diagramzoom60
+diagramzoom70 diagramzoom80 diagramzoom90 hardybrowsefiles hardyclearindex
+hardyconfigure hardydeselectallitems hardydrawtree hardyexit hardyfindorphans
+hardyhelpabout hardyhelpcontents hardyhelpsearch hardyloadapplication
+hardyloadfile hardyprint hardyprintpreview hardyprintsetup hardysavefile
+hardysavefileas hardysearchcards hardyshowarcsymboleditor
+hardyshowdevelopmentwindow hardyshowdiagrammanager hardyshowhypertextmanager
+hardyshownodesymboleditor hardyshowpackagetool hardyshowsymbollibrarian
+hardyviewtopcard
+
+
+$STRINGDELIMITERS="
+
+#$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SL_COMMENT=;
+
+#$ML_COMMENT=/* */
+
+$IGNORECASE=true
+
+$IDENTIFIER=regex([a-zA-Z_][\w\-]*)
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
+
+
diff --git a/support/highlight/langDefs/cob.lang b/support/highlight/langDefs/cob.lang
new file mode 100644
index 0000000000..2892e14648
--- /dev/null
+++ b/support/highlight/langDefs/cob.lang
@@ -0,0 +1,49 @@
+# COBOL language definition file (ANSI 74/85)
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 24.8.2002
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=COBOL
+
+$KEYWORDS(kwa)=accept access add advancing after all alphabet alphabetic alphabetic-lower alphabetic-upper
+alphanumeric alphanumeric-edited also alter alternate and any are area areas ascending assign at author
+before binary blank block bottom by call cancel cd cf ch character characters class clock-units
+close cobol code code-set collating column comma common communication comp comp-0 comp-1 comp-2 comp-3
+comp-4 comp-5 comp-6 comp-x computational computational-0 computational-1 computational-2 computational-3
+computational-4 computational-5 computational-6 computational-x compute configuration contains content continue
+control control-area controls converting copy corr corresponding count currency data date date-compiled
+date-written day day-of-week de debug-contents debug-item debug-line debug-name debug-sub-1 debug-sub-2 debug-sub-3
+debugging decimal-point declaratives delete delimited delimiter depending descending destination detail disable
+display divide division down duplicates dynamic egi else emi enable end end-add end-call end-compute end-delete
+end-divide end-evaluate end-if end-multiply end-of-page end-perform end-read end-receive end-return end-rewrite
+end-search end-start end-string end-subtract end-unstring end-write enter environment eop equal error
+esi evaluate every exception exit extend external false fd file file-control filler final first
+footing for from function generate giving global go greater group heading high-value high-values i-o i-o-control
+identification if in index indexed indicate initial initialize initiate input input-output inspect installation
+into invalid just justified key label last leading left length less limit limits linage linage-counter
+line line-counter lines linkage lock low-value low-values memory merge message mode modules more-labels
+move multiple multiply native negative next no not number numeric numeric-edited object-computer occurs
+of off omitted on open optional or order organization other output overflow packed-decimal padding page
+page-counter perform pf ph pic picture plus pointer position positive printing procedure procedures proceed program program-id purge queue quote quotes random rd read receive record records redefines reel reference references relative release remainder removal renames replace replacing report reporting reports rerun reserve return reversed rewind rewrite rf rh right rounded run same sd search section security segment segment-limit select send sentence separate sequence sequential set sign size sort sort-merge source source-computer space spaces special-names standard standard-1 standard-2 start status stop string sub-queue-1 sub-queue-2 sub-queue-3 subtract sum super suppress symbolic sync synchronized tallying tape terminal terminate test text than then through thru time times to top trailing true type unit unstring until up upon usage use using value values varying when with words working-storage write zero zeroes zeros
+
+$IGNORECASE=true
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=* /
+
+$IDENTIFIER=regex([a-zA-Z_][\w\-]*)
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = % + -
diff --git a/support/highlight/langDefs/cs.lang b/support/highlight/langDefs/cs.lang
new file mode 100644
index 0000000000..1e5fb84d13
--- /dev/null
+++ b/support/highlight/langDefs/cs.lang
@@ -0,0 +1,67 @@
+# C# language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 16.08.2002
+#
+# 01/08/2003
+# words added
+# - return value add remove get set readonly in $KEYWORDS(kwa)
+# - object in $KEYWORDS(kwb)
+# added $DIRECTIVE=# because it also exist in c#
+#
+# 02/08/2003
+# added $MEMBERATTRDELIMITERS and $RAWSTRINGPREFIX parameter
+#
+# 10/08/2003
+# added $STRINGDELIMITERPAIR parameter
+#
+# 01/06/2004
+# removed $MEMBERATTRDELIMITERS
+#
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=C#
+
+$KEYWORDS(kwa)= return value add remove get set readonly break case default else
+if switch catch checked finally throw try unchecked abstract base class
+delegate event explicit implicit interface internal new operator override
+private protected public sealed static this virtual false null true
+namespace using break continue do for foreach while goto in ref
+
+$KEYWORDS(kwb)= object bool byte char const decimal double enum float int long
+sbyte short string struct uint ulong ushort void
+
+$KEYWORDS(kwc)=regex(^\s*(\w+):)
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=//
+
+$ML_COMMENT=/* */
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$DIRECTIVE=#
+
+$RAWSTRINGPREFIX=@
+
+$SYMBOLS= ( ) [ ] { } , ; . : & | < > ! = / * % + -
+
+$CONTINUATIONSYMBOL=\
+
+$REFORMATTING=true
diff --git a/support/highlight/langDefs/css.lang b/support/highlight/langDefs/css.lang
new file mode 100644
index 0000000000..e706b975f4
--- /dev/null
+++ b/support/highlight/langDefs/css.lang
@@ -0,0 +1,63 @@
+## CSS language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 04.03.2003
+# Update: 30.03.2010 added keywords
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=CSS
+
+$KEYWORDS(kwa)=background background-attachment background-color background-image
+background-position background-repeat border border-bottom-color
+border-bottom-style border-bottom-width border-bottom border-color
+border-left border-left-color border-left-style border-left-width
+border-right border-right-color border-right-style border-right-width
+border-style border-top border-top-color border-top-style border-top-width
+border-width outline outline-color outline-style outline-width height
+max-height max-width min-height min-width width font font-family
+font-size font-style font-variant font-weight content counter-increment
+counter-reset quotes list-style list-style-image list-style-position
+list-style-type margin margin-bottom margin-left margin-right
+margin-top padding padding-bottom padding-left padding-right
+padding-top bottom clear clip cursor display float left overflow
+position right top visibility z-index orphans page-break-after
+page-break-before page-break-inside widows border-collapse border-spacing
+caption-side empty-cells table-layout color direction letter-spacing
+line-height text-align text-decoration text-indent text-shadow
+text-transform vertical-align white-space word-spacing
+
+$KEYWORDS(kwb)= a abbr acronym address applet area b base
+basefont bdo big blockquote body br button caption
+center cite code col colgroup dd del dfn
+dir div dl dt em fieldset font form
+frame frameset h1-h6 head hr html i iframe
+img input ins isindex kbd label legend li
+link map menu meta noframes noscript object ol
+optgroup option p param pre q s samp
+script select small span strike strong style sub
+sup table tbody td textarea tfoot th thead
+title tr tt u ul var
+
+$KEYWORDS(kwc)=regex((\..+?)\s*\{)
+
+$STRINGDELIMITERS=" '
+
+$ML_COMMENT=/* */
+
+$IGNORECASE=true
+
+$IDENTIFIER=regex([a-zA-Z_][\w\-]*)
+$DIGIT=regex(\#\p{XDigit}{3,6}|\d*\.?\d+?\w*)
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + - .
diff --git a/support/highlight/langDefs/d.lang b/support/highlight/langDefs/d.lang
new file mode 100644
index 0000000000..6bddcfcd5e
--- /dev/null
+++ b/support/highlight/langDefs/d.lang
@@ -0,0 +1,88 @@
+# D language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 18.3.2002
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=D
+
+$DESCRIPTION=D definition
+
+$KEYWORDS(kwa)=abstract alias align asm assert auto bit body break byte case cast catch cdouble cent cfloat char class const continue creal
+dchar debug default delegate delete deprecated do double else enum export extern false final finally float for foreach function goto
+idouble if ifloat import in inout int interface invariant ireal is long mixin module new null out override package pragma private
+protected public real return short static struct super switch synchronized template this throw true try typedef typeid typeof ubyte ucent
+uint ulong union unittest ushort version void volatile wchar while with
+
+# special tokens
+$KEYWORDS(kwb)=__FILE__ __LINE__ __DATE__ __TIME__ __TIMESTAMP__
+
+# assembler upcodes
+$KEYWORDS(kwc)=aaa aad aam aas adc add addpd addps addsd addss and andnpd andnps andpd andps arpl bound bsf bsr
+bswap bt btc btr bts call cbw cdq clc cld clflush cli clts cmc cmova cmovae cmovb cmovbe cmovc cmove cmovg
+cmovge cmovl cmovle cmovna cmovnae cmovnb cmovnbe cmovnc cmovne cmovng cmovnge cmovnl cmovnle cmovno cmovnp cmovns cmovnz
+cmovo cmovp cmovpe cmovpo cmovs cmovz cmp cmppd cmpps cmps cmpsb cmpsd cmpss cmpsw cmpxch8b cmpxchg comisd
+comiss cpuid cvtdq2pd cvtdq2ps cvtpd2dq cvtpd2pi cvtpd2ps cvtpi2pd cvtpi2ps cvtps2dq cvtps2pd cvtps2pi
+cvtsd2si cvtsd2ss cvtsi2sd cvtsi2ss cvtss2sd cvtss2si cvttpd2dq cvttpd2pi cvttps2dq cvttps2pi cvttsd2si
+cvttss2si cwd cwde da daa das db dd de dec df di div divpd divps divsd divss dl dq ds dt dw emms enter f2xm1
+fabs fadd faddp fbld fbstp fchs fclex fcmovb fcmovbe fcmove fcmovnb fcmovnbe fcmovne fcmovnu fcmovu fcom
+fcomi fcomip fcomp fcompp fcos fdecstp fdisi fdiv fdivp fdivr fdivrp feni ffree fiadd ficom ficomp fidiv
+fidivr fild fimul fincstp finit fist fistp fisub fisubr fld fld1 fldcw fldenv fldl2e fldl2t fldlg2 fldln2 fldpi
+fldz fmul fmulp fnclex fndisi fneni fninit fnop fnsave fnstcw fnstenv fnstsw fpatan fprem fprem1 fptan frndint
+frstor fsave fscale fsetpm fsin fsincos fsqrt fst fstcw fstenv fstp fstsw fsub fsubp fsubr fsubrp ftst fucom
+fucomi fucomip fucomp fucompp fwait fxam fxch fxrstor fxsave fxtract fyl2x fyl2xp1 hlt idiv imul in inc ins
+insb insd insw int into invd invlpg iret iretd ja jae jb jbe jc jcxz je jecxz jg jge jl jle jmp jna jnae
+jnb jnbe jnc jne jng jnge jnl jnle jno jnp jns jnz jo jp jpe jpo js jz lahf lar ldmxcsr lds lea leave les
+lfence lfs lgdt lgs lidt lldt lmsw lock lods lodsb lodsd lodsw loop loope loopne loopnz loopz lsl lss ltr
+maskmovdqu maskmovq maxpd maxps maxsd maxss mfence minpd minps minsd minss mov movapd movaps movd movdq2q movdqa
+movdqu movhlps movhpd movhps movlhps movlpd movlps movmskpd movmskps movntdq movnti movntpd movntps movntq movq movq2dq
+movs movsb movsd movss movsw movsx movupd movups movzx mul mulpd mulps mulsd mulss neg nop not or orpd orps
+out outs outsb outsd outsw packssdw packsswb packuswb paddb paddd paddq paddsb paddsw paddusb paddusw paddw
+pand pandn pavgb pavgw pcmpeqb pcmpeqd pcmpeqw pcmpgtb pcmpgtd pcmpgtw pextrw pinsrw pmaddwd pmaxsw pmaxub pminsw pminub
+pmovmskb pmulhuw pmulhw pmullw pmuludq pop popa popad popf popfd por prefetchnta prefetcht0 prefetcht1 prefetcht2
+psadbw pshufd pshufhw pshuflw pshufw pslld pslldq psllq psllw psrad psraw psrld psrldq psrlq psrlw psubb psubd
+psubq psubsb psubsw psubusb psubusw psubw punpckhbw punpckhdq punpckhqdq punpckhwd punpcklbw punpckldq punpcklqdq
+punpcklwd push pusha pushad pushf pushfd pxor rcl rcpps rcpss rcr rdmsr rdpmc rdtsc rep repe repne repnz
+repz ret retf rol ror rsm rsqrtps rsqrtss sahf sal sar sbb scas scasb scasd scasw seta setae setb
+setbe setc sete setg setge setl setle setna setnae setnb setnbe setnc setne setng setnge setnl setnle
+setno setnp setns setnz seto setp setpe setpo sets setz sfence sgdt shl shld shr shrd shufpd shufps sidt
+sldt smsw sqrtpd sqrtps sqrtsd sqrtss stc sti stmxcsr stos stosb stosd stosw str sub subpd subps subsd
+subss sysenter sysexit test ucomisd ucomiss ud2 unpckhpd unpckhps unpcklpd unpcklps verr
+verw wait wbinvd wrmsr xadd xchg xlat xlatb xor xorpd xorps addsubpd addsubps fisttp haddpd haddps hsubpd hsubps lddqu
+monitor movddup movshdup movsldup mwait pavgusb pf2id pfacc pfadd pfcmpeq pfcmpge pfcmpgt pfmax pfmin pfmul pfnacc pfpnacc
+pfrcp pfrcpit1 pfrcpit2 pfrsqit1 pfrsqrt pfsub pfsubr pi2fd pmulhrw pswapd
+
+
+#$KEYWORDS(kwb)=regex([A-Z]+)
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" ' `
+$RAWSTRINGPREFIX=r
+
+$SL_COMMENT=//
+$ML_COMMENT=/* */
+$ML_COMMENT=/+ +/
+
+$ALLOWNESTEDCOMMENTS=false
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$ALLOWEXTESCAPE=true
+
+$DIGIT=regex((?:0x|0X)[0-9a-fA-F]+|\d*[\.\_]?\d+(?:[eE][\-\+]\d+)?[lLuUbfdm]*)
+
+$SYMBOLS= ( ) [ ] { } , ; . : & | < > ! = / * % + - ~
diff --git a/support/highlight/langDefs/diff.lang b/support/highlight/langDefs/diff.lang
new file mode 100644
index 0000000000..d021c44a91
--- /dev/null
+++ b/support/highlight/langDefs/diff.lang
@@ -0,0 +1,27 @@
+# Diff language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 02.10.2007
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Diff
+
+$DESCRIPTION=Diff
+
+$KEYWORDS(kwa)=regex(^[+<].*)
+$KEYWORDS(kwb)=regex(^[->].*)
+$KEYWORDS(kwc)=regex(^\.$)
+$KEYWORDS(kwd)=regex(^@@.*@@$)
+
+$DIGIT=regex(^[\d,]*[ac]\d*)
+$SL_COMMENT=regex(^\-\-\-$)
diff --git a/support/highlight/langDefs/dot.lang b/support/highlight/langDefs/dot.lang
new file mode 100644
index 0000000000..2d0b11ca68
--- /dev/null
+++ b/support/highlight/langDefs/dot.lang
@@ -0,0 +1,69 @@
+# This file was generated by context2highlight from the original ConTEXT highlighting scheme "Graphviz.chl"
+# THIS FILE HAS NOT BEEN TESTED AND MAY NEED SOME MORE WORK
+# Credits go to the original author of the CHL file, who is listed below.
+# ConTEXT: http://context.cx/
+# Highlight: http://www.andre-simon.de/
+#
+# Beginning of converted content...
+#////////////////////////////////////////////////////////////////////////////
+
+$DESCRIPTION=Graphviz
+
+$IGNORECASE=true
+
+$SL_COMMENT=//
+
+$KEYWORDS(kwa)=digraph graph node edge subgraph strict
+# attribs
+
+$KEYWORDS(kwb)=bottomlabel color comment distortion fillcolor fixedsize fontcolor fontname fontsize
+group height label layer orientation peripheries regular shape shapefile sides skew
+style toplabel width z arrowhead arrowsize arrowtail color comment constraint
+decorate dir fontcolor fontname fontsize headlabel headport headurl label labelangle
+labeldistance labelfloat labelfontcolor labelfontname labelfontsize layer lhead ltail
+minlen samehead sametail style taillabel tailport tailurl weight bgcolor center
+clusterrank color comment compound concentrate fillcolor fontcolor fontname fontpath
+fontsize label labeljust labelloc layers margin mclimit nodesep nslimit nslimitl
+ordering orientation page pagedir quantum rank rankdir ranksep ratio remincross
+rotate samplepoints searchsize size style url splines
+
+# node / edge types / color names
+$KEYWORDS(kwc)=none normal inv dot odot invdot invodot open halfopen empty invempty diamond odiamond
+box obox tee crow box polygon ellipse circle point egg triangle plaintext diamond
+trapezium parallelogram house hexagon octagon doublecircle doubleoctagon tripleoctagon
+invtriangle invtrapezium invhouse mdiamond msquare mcircle record mrecord epsf
+turquoise antiquewhite coral darkgoldenrod azure crimson gold bisque darksalmon goldenrod aliceblue
+blanchedalmond deeppink greenyellow blue cornsilk firebrick lightgoldenrod blueviolet
+floralwhite hotpink lightgoldenrodyellow cadetblue gainsboro indianred lightyellow cornflowerblue
+ghostwhite lightpink palegoldenrod darkslateblue honeydew lightsalmon yellow deepskyblue
+ivory maroon yellowgreen dodgerblue lavender mediumvioletred indigo lavenderblush orangered lightblue
+lemonchiffon palevioletred chartreuse lightskyblue linen pink darkgreen lightslateblue
+mintcream red darkolivegreen mediumblue mistyrose salmon darkseagreen mediumslateblue
+moccasin tomato forestgreen midnightblue navajowhite violetred green navy
+oldlace greenyellow navyblue papayawhip browns lawngreen powderblue peachpuff beige lightseagreen royalblue
+seashell brown limegreen skyblue snow burlywood mediumseagreen slateblue thistle chocolate
+mediumspringgreen steelblue wheat darkkhaki mintcream white khaki olivedrab whitesmoke peru palegreen blueviolet
+rosybrown seagreen darkorchid saddlebrown springgreen darkviolet darkslategray sandybrown yellowgreen magenta
+dimgray sienna mediumorchid gray tan mediumpurple gray aquamarine mediumvioletred lightgray oranges cyan orchid
+lightslategray darkorange darkturquoise palevioletred slategray orange lightcyan plum orangered mediumaquamarine purple
+mediumturquoise violet black paleturquoise violetred true solid dashed dotted bold invis filled
+diagonals
+
+$STRINGDELIMITERS="
+
+$ML_COMMENT=/* */
+
+$SYMBOLS=( ) {} - > < : . ; ,
+
+# Ending of converted content.
+
+# Uncomment the following lines to highlight regex matches...
+
+# Highlight method names:
+#$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+# Highlight variable names like ${name}. Only the name is highlighted as keyword.
+#$KEYWORDS(kwd)=regex(\$\{(\w+)\})
+
+# Highlight variables beginning with $, @ or %
+#$KEYWORDS(kwd)=regex([$@%]\w+)
diff --git a/support/highlight/langDefs/dylan.lang b/support/highlight/langDefs/dylan.lang
new file mode 100644
index 0000000000..99c434d335
--- /dev/null
+++ b/support/highlight/langDefs/dylan.lang
@@ -0,0 +1,47 @@
+# Dylan language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 15.4.2004
+# 28.01.2008 Replaced KW_DELIM entry by regexes (ASim)
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Dylan
+
+$KEYWORDS(kwa)=interface library macro method class function cleanup block afterwards
+end constant variable generic primary begin method above below from by in instance
+local slot subclass then to virtual if when select case else elseif unless finally
+otherwise then for until while from to define let otherwise finally exception
+handler signal import rename create use export exclude abstract concrete primary
+inherited inline open sealed domain singleton
+
+#$TAG_DELIM(kwa)=< >
+$KEYWORDS(kwa)=regex(<!?\/?\w+>?|>)
+$KEYWORDS(kwb)=regex(([-\w]+)=")
+$KEYWORDS(kwc)=regex(\&\#?\w+;)
+
+$KEYWORDS(kwb)=module synopsis author copyright
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=//
+
+$ML_COMMENT=/* */
+
+$ALLOWNESTEDCOMMENTS=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | ! = / * % + -
diff --git a/support/highlight/langDefs/e.lang b/support/highlight/langDefs/e.lang
new file mode 100644
index 0000000000..04c3f5cb5b
--- /dev/null
+++ b/support/highlight/langDefs/e.lang
@@ -0,0 +1,38 @@
+# Eiffel language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 21.11.2002
+# Update: 08.10.2008
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Eiffel
+
+$KEYWORDS(kwa)=agent alias all and as assign check class convert create current debug deferred do else elseif end ensure
+expanded export external false feature from frozen if implies indexing infix inherit inspect invariant is
+like local loop not obsolete old once or prefix precursor pure redefine reference rename require rescue result
+retry separate then true tuple undefine creation until insert
+
+$KEYWORDS(kwb)= integer real double character boolean string
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$ESCCHAR=regex(%\d{3}|\\x\p{XDigit}{2}|%[nNtvbrfa%\?'"]|%$)
+
+$SL_COMMENT=--
+
+$IGNORECASE=true
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! - + = / * + - .
diff --git a/support/highlight/langDefs/ebnf.lang b/support/highlight/langDefs/ebnf.lang
new file mode 100644
index 0000000000..53c346dffa
--- /dev/null
+++ b/support/highlight/langDefs/ebnf.lang
@@ -0,0 +1,29 @@
+# EBNF language definition file
+#
+# Author: Ory, Mate
+# Mail: orymate@ubuntu.com
+# Date: 24 Mar 2010
+# Version: 1.0
+#
+# Based on {awk,ini}.lang.
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+
+$DESCRIPTION=Extended Backus-Naur Form
+
+$KEYWORDS(kwa)=regex(^\s*([^=]+)\s*=)
+$KEYWORDS(kwb)=regex([?][^?]+[?])
+$KEYWORDS(kwc)=regex([a-zA-Z][-a-zA-Z0-9]*)
+
+$STRINGDELIMITERS=" '
+
+$ML_COMMENT=(* *)
+
+$IGNORECASE=false
+
+$SYMBOLS= ( ) [ ] { } ; | - *
diff --git a/support/highlight/langDefs/erl.lang b/support/highlight/langDefs/erl.lang
new file mode 100644
index 0000000000..50771d788f
--- /dev/null
+++ b/support/highlight/langDefs/erl.lang
@@ -0,0 +1,43 @@
+# Erlang language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 08.02.04
+# Update: 08.10.2008
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Erlang
+
+$KEYWORDS(kwa)=after begin case catch cond end fun if let of query receive when
+
+$KEYWORDS(kwb)=abs alive apply atom_to_list binary_to_list binary_to_term concat_binary date disconnect_node element
+erase exit float float_to_list get get_keys group_leader halt hd integer_to_list is_alive length link list_to_atom
+list_to_binary list_to_float list_to_integer list_to_pid list_to_tuple load_module make_ref monitor_node node nodes
+now open_port pid_to_list process_flag process_info process put register registered round self setelement size spawn
+spawn_link split_binary statistics term_to_binary throw time tl trunc tuple_to_list unlink unregister whereis
+atom binary constant function integer list number pid ports port_close port_info reference record
+check_process_code delete_module get_cookie hash math module_loaded preloaded processes purge_module set_cookie set_node
+acos asin atan atan2 cos cosh exp log log10 pi pow power sin sinh sqrt tan tanh
+
+$KEYWORDS(kwc)=regex((\w+):)
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=%
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * + - .
diff --git a/support/highlight/langDefs/euphoria.lang b/support/highlight/langDefs/euphoria.lang
new file mode 100644
index 0000000000..73d339e280
--- /dev/null
+++ b/support/highlight/langDefs/euphoria.lang
@@ -0,0 +1,58 @@
+# Euphoria Script language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 02.03.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Euphoria
+
+
+$KEYWORDS(kwa)=and by constant do else elsif end exit for function global if include
+not or procedure return then to type while with without xor append arcsin
+arccos arctan and_bits allow_break abort all_palette allocate allocate_low
+allocate_string atom_to_float64 atom_to_float32 bk_color bytes_to_int
+bits_to_int compare custom_sort cos close current_dir chdir check_break
+command_line clear_screen cursor call crash_file crash_message call_proc
+call_func c_proc c_func call_back dir date display_text_image draw_line
+display_image dos_interrupt define_c_proc define_c_func define_c_var equal
+ellipse find floor flush free free_low float64_to_atom float32_to_atom
+free_console get getc gets get_bytes get_key get_mouse getenv get_position
+graphics_mode get_all_palette get_active_page get_display_page get_screen_char
+get_pixel get_vector int_to_bytes int_to_bits instance length lower log
+lock_file lock_memory match mouse_events mouse_pointer machine_func
+machine_proc mem_copy mem_set message_box not_bits or_bits open open_dll pi
+prepend power print printf puts prompt_string prompt_number platform profile
+position palette put_screen_char pixel polygon peek peek4s peek4u poke poke4
+rand repeat reverse remainder read_bitmap register_block routine_id sin sort
+sqrt sprintf seek system system_exec sleep scroll save_bitmap set_active_page
+set_display_page sound save_text_image save_screen save_image set_vector
+set_rand tan time tick_rate trace text_color text_rows upper unlock_file
+unregister_block use_vesa value video_config wildcard_match wildcard_file
+wait_key where walk_dir wrap xor_bits
+
+$KEYWORDS(kwb)=atom integer object sequence
+
+$KEYWORDS(kwc)=regex(\#\p{XDigit}+)
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS="
+
+$SL_COMMENT=--
+
+$IGNORECASE=true
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! ? = / * % + -
diff --git a/support/highlight/langDefs/exp.lang b/support/highlight/langDefs/exp.lang
new file mode 100644
index 0000000000..d0e733171b
--- /dev/null
+++ b/support/highlight/langDefs/exp.lang
@@ -0,0 +1,81 @@
+# Express language definition file
+#
+# Author: André Simon
+# Mail: andre.simon1@gmx.de
+# Date: 04.03.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Express
+
+
+$KEYWORDS(kwa)=abs aggindex aggmap aggmapinfo aggregate aggregate allcompile allstat
+antilog antilog10 any arccos arcsin arctan argcount argfr args average back
+badline begindate blank blankstrip break cache cachehits cachemisses
+cachetries calendarweek call calltype categorize changechars charlist charset
+chdir chdrive chgdfn colval colwidth commas compile compilemessage compilewarn
+comquery comset comset comunit connect consider context context continue
+convert copydfn correlation cos cosh count cumsum database dateformat dateorder
+dayabbrlen daynames dayof dbdescribe dbgoutfile dbgsession dbreport dbwaittime
+ddof decimaloverflow decimals define delete deprdecl deprdeclsw deprsl deprsoyd
+describe dimension dir disconnect dividebyzero do doend dseconds echoprompt
+eifbytes else enddate endof eproduct erelease errnames escapebase eversion
+every execbreak execstart execstatus execute execwait exists export exptrace
+extargs extchars extcols extlines fcclose fcexec fcopen fcquery fcset fetch
+fileclose filecopy filedelete fileerror fileget filemodemask filemove filenext
+fileopen filepage fileput filequery fileread fileset fileview filterlines
+findchars findlines fintsched for forecast fpmtsched fulldsc get goto growrate
+heading hide hiercheck if ifcopy import include infile info inlist inschars
+inscols inslines instat intpart irr isdate isvalue joinchars joincols joinlines
+key lag lagabspct lagdif lagpct largest lcolwidth ld lead likecase likenl
+likeescape limit linenum linesleft listby listfiles listnames load log log10
+longobjnames lowcase lsize maintain makedate max maxchars maxfetch median min
+mkdir mmof moddamp mode model moderror modgamma modinputorder modmaxiters
+modoverflow modsimultype modtolerance modtrace monitor monthabbrlen monthnames
+move movingaverage movingmax movingmin movingtotal nafill name napagefree
+naskip naskip2 naspell none noprint normal nospell npv numchars numlines obj
+objlist obscure off okforlimit on outfile outfileunit page pagepause pageprompt
+parens parse pause percentage permit permiterror permitreset pgcachehits
+pgcachemisses pop poplevel program property push pushlevel qual random rank
+recap recno recursive redo reedit regress relation rem remchars remcols
+remlines rename replchars replcols repllines report reserved retrieve return
+rmdir rollup rootofnegative round row row rpr runtotal seconds sessionquery set
+sharesession shell show shw signal sin sinh sleep smallest smooth sort
+sortcomposite sortlines sparseindex sql sqlblockmax sqlmessages sqrt startof
+statall statfirst statlast statlen statlist statmax statmin statrank status
+statval stddev stdhdr strip subtotal switch sysinfo system tally tan tanh
+tconvert tempstat textfill then thousandschar threadextcall tod today total
+trace trackprg translate transport trap triggermaxdepth triggerstoreok unhide
+uniquelines unravel upcase update upd valsperpage values vintsched vnf
+vpmtsched watch weekdaysnewyear weekof while wksdata xabort xcaportnumber
+xclose xopen xopen yesspell yrabstart yyof zerorow zerototal zspell
+
+#Variables:
+$KEYWORDS(kwb)=arg argument bmargin bool boolean dbextendpath dbsearchpath
+dbtemppath decimalchar eifextensionpath eifnames eifshortnames eiftypes
+eifupdbytes errorname errortext int integer oknullstatus pagenum pageprg
+pagesize paging prgtrace sqlcode sqlerrm text tmargin variable vrb
+
+
+$STRINGDELIMITERS='
+
+$SL_COMMENT="
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$IGNORECASE=true
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
+
+
+
+
diff --git a/support/highlight/langDefs/f77.lang b/support/highlight/langDefs/f77.lang
new file mode 100644
index 0000000000..f43d4fb087
--- /dev/null
+++ b/support/highlight/langDefs/f77.lang
@@ -0,0 +1,36 @@
+# Fortran 77 language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 01.04.04
+# Update: 08.10.2008
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Fortran 77
+
+$IGNORECASE=true
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=regex(^[cC].*)
+
+$IDENTIFIER=regex([a-zA-Z_][\w\d\*]*)
+
+$KEYWORDS(kwb)= character complex double precision real real*8 integer common logical
+implicit dimension external parameter
+
+$KEYWORDS(kwa)= break common continue date default dimension do else enddo endif for
+goto go to if then return end format write read subroutine function switch
+program call while stop
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + - .
diff --git a/support/highlight/langDefs/f90.lang b/support/highlight/langDefs/f90.lang
new file mode 100644
index 0000000000..dfe6f99e68
--- /dev/null
+++ b/support/highlight/langDefs/f90.lang
@@ -0,0 +1,42 @@
+# Fortran 90 language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 30.03.03
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Fortran 90
+
+$IGNORECASE=false
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=!
+
+$KEYWORDS(kwb)= integer real double precision complex logical character
+
+$KEYWORDS(kwa)=accept endmap pause assign endstructure pointer automatic endunion print backspace entry
+program blockdata equivalence read byte external readonly call find real character format record
+close function return common goto rewind complex if rewrite continue implicit save data implicitnone
+shared decode implicitundefined static definefile include stop delete inquire structure dimension
+integer subroutine do intrinsic then doublecomplex key to doubleprecision logical type else map
+undefined elseif namelist union encode none unlock end nospanblocks virtual enddo open volatile
+endfile options while endif parameter write module interface use contains stop
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$IGNORECASE=true
+
+$DIGIT=regex((?:0x|0X)[0-9a-fA-F]+|\d*[\.\_]?\d+(?:[eE][\-\+]\d+)?[lLuUbfdm]*)
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > - + = / * % + - . $
diff --git a/support/highlight/langDefs/flx.lang b/support/highlight/langDefs/flx.lang
new file mode 100644
index 0000000000..e89937ed73
--- /dev/null
+++ b/support/highlight/langDefs/flx.lang
@@ -0,0 +1,49 @@
+# Felix language definition file
+#
+# Author: André Simon
+# Mail: andre.simon1@gmx.de
+# Date: 18.11.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+
+$DESCRIPTION=Felix
+
+$KEYWORDS(kwa)=all and as body call case class code const define elif else endif
+endmatch except export fork fun function functor goto header if in inf
+interface lambda let match module NaN not of open or proc procedure raise read
+regexp regmatch return struct then to todo type typedef union use val var when
+with header body code open use endl print include true false not and or lnot
+land lor pow eol
+
+$KEYWORDS(kwb)=tiny short int long vlong utiny ushort uint ulong uvlong int8
+int16 int32 int64 uint8 uint16 uint32 uint64 float double ldouble float32
+float64 float80 char wchar uchar string wstring ustring void unit bool any
+address byte
+
+$STRINGDELIMITERS=""" ''' " '
+
+$SL_COMMENT=//
+
+$ML_COMMENT=/* */
+
+$ALLOWNESTEDCOMMENTS=true
+
+$IGNORECASE=false
+
+$RAWSTRINGPREFIX=r
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$DIRECTIVE=#
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
diff --git a/support/highlight/langDefs/frink.lang b/support/highlight/langDefs/frink.lang
new file mode 100644
index 0000000000..5152030d1c
--- /dev/null
+++ b/support/highlight/langDefs/frink.lang
@@ -0,0 +1,67 @@
+# Frink language definition file *PROPOSAL*
+#
+# Author: André Simon
+# Mail: andre.simon1@gmx.de
+# Date: 15.11.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Frink
+
+$KEYWORDS(kwa)=if then else for to step next use while var class interface
+return mod div conforms square sq cubic cu squared cube is true TRUE false
+FALSE and AND or OR NOT not nand NAND nor NOR xor XOR implies IMPLIES dict
+println sin cos tan sec csc cot arcsin arccos arcsin arccsc arcsec arccot
+arctan floor ceil round round int trunc inv recip sqrt log ln abs format format
+random randomBits bitLength modPow binary ternary trinary quaternary quinary
+senary sexenary septenary octal oct octonary nonary decimal denary undenary
+duodecimal duodenary tridecimal quattuordecimal quindecimal hexadecimal
+sexadecimal hex septendecimal octodecimal nonadecimal vigesimal char uppercase
+uc lowercase lc substr substring substrLen substringLen timezone timezones now
+deltaT subst split join lines read stripHTML url urlHost urlProtocol select
+sort newJava callJava staticJava English en German Deutsch de Spanish Espanol
+Español es French Francais Français fr Italian Italiano it Portuguese pt Korean
+ko SimplifiedChinese zh TraditionalChinese Chinese zt Russian ru Japanese jp
+Dutch Nederlands nl FromEnglish from_en FromGerman from_de FromSpanish from_es
+FromFrench from_fr FromItalian from_it FromPortuguese from_pt FromJapanese
+from_ja FromKorean from_ko FromRussian from_ru Default FromSimplifiedChinese
+from_zh FromTraditionalChinese FromChinese from_zt FromDutch from_nl
+EnglishToGerman en_de EnglishToSpanish en_es EnglishToFrench en_fr
+EnglishToItalian en_it EnglishToPortuguese en_pt EnglishToKorean en_ko
+EnglishToJapanese en_ja EnglishToRussian en_ru EnglishToSimplifiedChinese en_zh
+EnglishToTraditionalChinese en_zt EnglishToDutch en_nl GermanToEnglish Englisch
+de_en GermanToFrench franzoesisch Franzoesisch französisch Französisch de_fr
+SpanishToEnglish Inglés Ingles es_en SpanishToFrench frances Frances francés
+Francés es_fr FrenchToEnglish Anglais fr_en FrenchToGerman Allemand allemand
+fr_de FrenchToSpanish Espagnol espagnol fr_es FrenchToPortuguese Portugais
+portugais fr_pt FrenchToItalian Italien italien fr_it ItalianToEnglish Inglese
+it_en ItalianToFrench Francese francese it_fr PortugueseToEnglish Inglês pt_en
+PortugueseToFrench francês Francês pt_fr JapaneseToEnglish ja_en
+KoreanToEnglish ko_en RussianToEnglish ru_en SimplifiedChineseToEnglish zh_en
+TraditionalChineseToEnglish ChineseToEnglish zt_en DutchToEnglish Engels nl_en
+
+
+# As there are no type identifiers in frink, one could include units here.
+# Extracting them by a script from units.txt would be reasonable, unless they are already stored as plain text somewhere
+$KEYWORDS(kwb)=
+
+$STRINGDELIMITERS=""" "
+
+$SL_COMMENT=//
+
+$ALLOWNESTEDCOMMENTS=false
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
diff --git a/support/highlight/langDefs/fs.lang b/support/highlight/langDefs/fs.lang
new file mode 100644
index 0000000000..20f492c580
--- /dev/null
+++ b/support/highlight/langDefs/fs.lang
@@ -0,0 +1,47 @@
+# F# language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 07.09.2009
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=F#
+
+$KEYWORDS(kwa)=abstract lsl and lsr as lxor assert match member asr mod begin module class mutable namespace default new delegate null do of done open downcast or downto override else rec end sig exception static false struct finally then for to fun true function try if type in val inherit when inline upcast interface while land with lor let
+
+# Types and type variables
+$KEYWORDS(kwb)=bool string int real word float unit option ref
+#$KEYWORDS(kwb)=regex('[a-zA-Z0-9_']+)
+
+# Modules
+#$KEYWORDS(kwc)=regex(\b[A-Z][a-zA-Z0-9_']*(?=\.))
+
+# Constructors
+$KEYWORDS(kwd)=regex(\b[A-Z][a-zA-Z0-9_']*)
+
+$STRINGDELIMITERS=" '
+$RAWSTRINGPREFIX=@
+
+$DIRECTIVE=#
+
+$ML_COMMENT=(* *)
+$SL_COMMENT=//
+$ALLOWNESTEDCOMMENTS=true
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + - . @ ? ^
+
+$DIGIT=regex((?:0x|0X|0b|0B|0o)[0-9a-fA-F]+?\w*|\d*[\.\_]?\d+(?:[eE][\-\+]\d+)?\w*)
diff --git a/support/highlight/langDefs/go.lang b/support/highlight/langDefs/go.lang
new file mode 100644
index 0000000000..16b3e184ef
--- /dev/null
+++ b/support/highlight/langDefs/go.lang
@@ -0,0 +1,50 @@
+# Go language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 17.11.2009
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Go
+
+$KEYWORDS(kwa)=break default func interface select
+case defer go map struct
+chan else goto package switch
+const fallthrough if range type
+continue for import return var
+
+$KEYWORDS(kwb)=
+bool byte float32 float64 int8 int16 int32 int64
+string uint8 uint16 uint32 uint64
+float int uint uintptr true false iota
+nil cap close closed len make new panic panicln print printlnr
+
+#$KEYWORDS(kwc)=
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+# raw strings ` not implemented yet
+$STRINGDELIMITERS=" ' `
+
+$SL_COMMENT=//
+
+$ML_COMMENT=/* */
+
+$ALLOWNESTEDCOMMENTS=false
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\u\p{XDigit}{4}|\\U\p{XDigit}{8}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; . : & | < > ! = / * % + - ^
+
diff --git a/support/highlight/langDefs/haskell.lang b/support/highlight/langDefs/haskell.lang
new file mode 100644
index 0000000000..625e4f41fb
--- /dev/null
+++ b/support/highlight/langDefs/haskell.lang
@@ -0,0 +1,92 @@
+# Haskell language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 21.11.2002
+# Update: 08.06.2009 added ghc keywords
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+
+$DESCRIPTION=Haskell
+
+$KEYWORDS(kwa)= absolute value addition and array boolean ceiling character concatenate
+concatenation constant continuation passing style cosine cosine hyperbolic cosine
+hyperbolic inverse cosine inverse division empty equality even floor function
+composition index lazy evaluation length list list calculation list construction
+list insertion list item modulo monad multiplication nint odd or order power
+round sine sine hyperbolic sine hyperbolic inverse sine inverse split string
+subtraction sum tangent tangent hyperbolic tangent hyperbolic inverse tangent
+inverse trigonometry truncation tuple True
+False
+
+$KEYWORDS(kwb)=Array Bool BufferMode CalendarTime Char ClockTime Complex Complex Day Double Either
+ExitCode FilePath Float Handle HandlePosn Int Integer IO IOError IOMode Maybe Month
+Ordering Permissions Ratio Rational Rational Read ReadS SeekMode Show ShowS StdGen
+String TimeDiff TimeLocale
+
+$KEYWORDS(kwc)=abs accum accumArray acos acosh addToClockTime all and any ap appendFile
+approxRational array asin asinh assocs asTypeOf atan atan2 atanh bounds bracket
+bracket_ break calendarTimeToString catch catMaybes ceiling chr cis compare concat
+concatMap conjugate const cos cosh cpuTimePrecision createDirectory curry cycle
+decodeFloat defaultTimeLocale delete deleteBy denominator diffClockTimes digitToInt
+div divMod doesDirectoryExist doesFileExist drop dropWhile either elem elemIndex
+elemIndices elems encodeFloat enumFrom enumFromThen enumFromThenTo enumFromTo error
+even executable exitFailure exitWith exp exponent fail filter filterM find findIndex
+findIndices flip floatDigits floatRadix floatRange floatToDigits floor fmap foldl
+foldl1 foldM foldr foldr1 formatCalendarTime fromEnum fromInteger fromIntegral
+fromJust fromMaybe fromRat fromRational fst gcd genericDrop genericIndex genericLength
+genericReplicate genericSplitAt genericTake getArgs getChar getClockTime getContents
+getCPUTime getCurrentDirectory getDirectoryContents getEnv getLine getModificationTime
+getPermissions getProgName getStdGen getStdRandom group groupBy guard hClose head
+hFileSize hFlush hGetBuffering hGetChar hGetContents hGetLine hGetPosn hIsClosed
+hIsEOF hIsOpen hIsReadable hIsSeekable hIsWritable hLookAhead hPrint hPutChar hPutStr
+hPutStrLn hReady hSeek hSetBuffering hSetPosn hWaitForInput id imagPart index indices
+init inits inRange insert insertBy interact intersect intersectBy intersperse
+intToDigit ioeGetErrorString ioeGetFileName ioeGetHandle ioError isAlpha isAlphaNum
+isAlreadyExistsError isAlreadyInUseError isAscii isControl isDenormalized isDigit
+isDoesNotExistError isEOF isEOFError isFullError isHexDigit isIEEE isIllegalOperation
+isInfinite isJust isLatin1 isLower isNaN isNegativeZero isNothing isOctDigit
+isPermissionError isPrefixOf isPrint isSpace isSuffixOf isUpper isUserError iterate
+ixmap join last lcm length lex lexDigits lexLitChar liftM liftM2 liftM3 liftM4 liftM5
+lines listArray listToMaybe log logBase lookup magnitude map mapAccumL mapAccumR
+mapAndUnzipM mapM mapM_ mapMaybe max maxBound maximum maximumBy maybe maybeToList min
+minBound minimum minimumBy mkPolar mkStdGen mod msum negate newStdGen next not notElem
+nub nubBy null numerator odd openFile or ord otherwise partition phase pi polar pred
+print product properFraction putChar putStr putStrLn quot quotRem random randomIO
+randomR randomRIO randomRs randoms range rangeSize read readable readDec readFile
+readFloat readHex readInt readIO readList readLitChar readLn readOct readParen reads
+readSigned readsPrec realPart realToFrac recip rem removeDirectory removeFile
+renameDirectory renameFile repeat replicate return reverse round scaleFloat scanl
+scanl1 scanr scanr1 searchable seq sequence sequence_ setCurrentDirectory
+setPermissions setStdGen show showChar showEFloat showFFloat showFloat showGFloat
+showInt showList showLitChar showParen shows showSigned showsPrec showString
+significand signum sin sinh snd sort sortBy split splitAt sqrt stderr stdin stdout
+subtract succ sum system tail tails take takeWhile tan tanh toCalendarTime toClockTime
+toEnum toInteger toLower toRational toUpper toUTCTime transpose truncate try uncurry
+undefined unfoldr union unionBy unless unlines until unwords unzip unzip3 unzip4
+unzip5 unzip6 unzip7 userError when words writable writeFile zip zip3 zip4 zip5 zip6
+zip7 zipWith zipWith3 zipWith4 zipWith5 zipWith6 zipWith7 zipWithM zipWithM_
+
+#GHC keywords
+$KEYWORDS(kwd)= as case of class data default deriving do forall foreign hiding
+if then else import infix infixl infixr instance let in mdo module newtype
+qualified type where
+
+$STRINGDELIMITERS="
+
+$SL_COMMENT=--
+$ML_COMMENT={- -}
+
+$IGNORECASE=false
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + - . ' # @ $ \
diff --git a/support/highlight/langDefs/hcl.lang b/support/highlight/langDefs/hcl.lang
new file mode 100644
index 0000000000..3e890591a0
--- /dev/null
+++ b/support/highlight/langDefs/hcl.lang
@@ -0,0 +1,37 @@
+# Hecl language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 14.02.2005
+# ---------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Hecl
+
+$KEYWORDS(kwa)= append break catch continue eq eval filter for foreach global hash if
+incr intro join lappend lindex list llen lset proc puts return search set sindex slen
+sort source split time append upeval while
+
+#$KW_PREFIX(kwb)=$
+$KEYWORDS(kwb)=regex(\$\w+)
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=#
+
+$ALLOWNESTEDCOMMENTS=false
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) { } [ ] , ; . : & | < > ! = / * % + -
diff --git a/support/highlight/langDefs/html.lang b/support/highlight/langDefs/html.lang
new file mode 100644
index 0000000000..2cd9a120be
--- /dev/null
+++ b/support/highlight/langDefs/html.lang
@@ -0,0 +1,35 @@
+# HTML language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 02.03.2003
+# Update: 06.01.2009
+# 01.09.2009: Added nested directive
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=HTML
+
+$KEYWORDS(kwa)=regex(<!?(?!\-\-)\/?[\w\:\-]+>?|/?>, 0)
+
+$KEYWORDS(kwb)=regex(([-\w]+)=")
+$KEYWORDS(kwd)=regex(\&\#?\w+;)
+$STRINGDELIMITERS="
+$ML_COMMENT= <!-- -->
+$IGNORECASE=true
+
+$NESTED(php)=regex(\<\?php) regex(\?\>)
+$NESTED(jsp)=regex(\<\%[@!\=]?) regex(.*(%>).*)
+$NESTED(css)=regex(\<style\s+type\=[\'\"]text\/css[\'\"]\>) regex(\<\/style\>)
+
+#$NESTED(js)=regex(\<script\s+language\=\"[jJ]ava[sS]cript\"(?:\s+type\=\"text\/javascript\")?\>) regex(\<\/script\>)
+$NESTED(js)=regex(\<script\s+language=[\"\'][jJ]ava[sS]cript[\"\'](?:\s+type=[\"\']text/javascript[\"\'])?[^>]*\>) regex(\<\/script\>)
+$NESTED(js)=regex(\<script(?:\s+type=[\"\']text/javascript[\"\'])\s+language=[\"\'][jJ]ava[sS]cript[\"\']?[^>]*\>) regex(\<\/script\>) \ No newline at end of file
diff --git a/support/highlight/langDefs/httpd.lang b/support/highlight/langDefs/httpd.lang
new file mode 100644
index 0000000000..b36dd83e5b
--- /dev/null
+++ b/support/highlight/langDefs/httpd.lang
@@ -0,0 +1,102 @@
+# Apache Conf language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 28.06.2003
+# 28.01.2008 Replaced KW_DELIM entry by regexes (ASim)
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http://www.andre-simon.de/
+
+$DESCRIPTION=Apache Config
+
+
+$KEYWORDS(kwa)=AccessConfig AccessFileName Action AddAlt AddAltByEncoding AddAltByType AddCharset
+AddDefaultCharset AddDescription AddEncoding AddHandler AddIcon AddIconByEncoding
+AddIconByType AddLanguage AddModule AddModuleInfo AddType AgentLog Alias AliasMatch
+Allow AllowCONNECT AllowOverride Anonymous Anonymous_Authoritative Anonymous_LogEmail
+Anonymous_MustGiveEmail Anonymous_NoUserID Anonymous_VerifyEmail AuthAuthoritative
+AuthDBAuthoritative AuthDBGroupFile AuthDBMAuthoritative AuthDBMGroupFile AuthDBMGroupFile
+AuthDBMUserFile AuthDBUserFile AuthDigestFile AuthGroupFile AuthName AuthType
+AuthUserFile
+BindAddress BrowserMatch BrowserMatchNoCase BS2000Account
+CacheDefaultExpire CacheDirLength CacheDirLevels CacheForceCompletion CacheGcInterval
+CacheLastModifiedFactor CacheMaxExpire CacheNegotiatedDocs CacheRoot CacheSize
+CheckSpelling ClearModuleList ContentDigest CookieExpires CookieLogCookieLog
+CookieTracking CoreDumpDirectory CustomLog
+DefaultIcon DefaultLanguage DefaultType Deny DirectoryIndex DocumentRoot
+ErrorDocument ErrorLog Example ExpiresActive ExpiresByType ExpiresDefault ExtendedStatus
+FancyIndexing ForceType
+Group
+Header HeaderName HostNameLookups
+IdentityCheck ImapBase ImapDefault ImapMenu Include IndexIgnore IndexOptions
+IndexOrderDefault ISAPIAppendLogToErrors ISAPIAppendLogToQuery ISAPILogNotSupported
+ISAPIReadAheadBuffer
+KeepAlive KeepAliveTimeout
+LanguagePriority LimitRequestBody LimitRequestFields LimitRequestFieldsize
+LimitRequestLine Listen ListenBacklog LoadFile LoadModule LockFile LogFormat LogLevel
+MaxClients MaxKeepAliveRequests MaxRequestsPerChild MaxSpareServers MetaDir
+MetaFiles MetaSuffix MimeMagicFile MinSpareServers MMapFile
+NameVirtualHost NoCache
+Options Order
+PassEnv PidFile Port ProxyBlock ProxyDomain ProxyPass ProxyPassReverse
+ProxyReceiveBufferSize ProxyRemote ProxyRequests ProxyVia
+ReadmeName Redirect RedirectMatch RedirectPermanent RedirectTemp RefererIgnore
+RefererLog RemoveEncoding RemoveHandler RemoveType Require ResourceConfig
+RewriteBase RewriteCond RewriteEngine RewriteLock RewriteLog RewriteLogLevel
+RewriteMap RewriteOptions RewriteRule RLimitCPU RLimitMEM RLimitNPROC
+Satisfy ScoreBoardFile Script ScriptAlias ScriptAliasMatch ScriptInterpreterSource
+ScriptLog ScriptLogBuffer ScriptLogLength SendBufferSize ServerAdmin ServerAlias
+ServerName ServerPath ServerRoot ServerSignature ServerTokens ServerType
+SetEnv SetEnvIf SetEnvIfNoCase SetHandler StartServers
+ThreadsPerChild TimeOut TransferLog TypesConfig
+UnsetEnv UseCanonicalName User UserDir
+VirtualDocumentRoot VirtualDocumentRootIP VirtualScriptAlias VirtualScriptAliasIP
+XBitHack
+
+
+$KEYWORDS(kwb)=alert All any Ascending AuthConfig
+Basic block
+cgi-script CONNECT COPY crit
+Date debug DELETE Descending Description Digest dns double
+EMail emerg error ExecCGI
+FileInfo FollowSymLinks formatted from Full
+GET
+Host
+imap-file Includes IncludesNOEXEC Indexes inetd info isapi-isa
+Limit LOCK
+map max Minimal MKCOL MOVE MultiViews
+Name nocontent None notice
+Off On OS
+PATCH POST ProductOnly PROPFIND PROPPATCH PUT
+referer Remote_Addr Remote_Host Remote_User Request_Method Request_Protocol
+Request_URI
+semiformatted send-as-is server-parsed server-status Size standalone
+SymLinksIfOwnerMatch
+TRACE type-map
+unformatted UNLOCK
+valid-user
+warn
+
+#$TAG_DELIM(kwa)=< >
+$KEYWORDS(kwa)=regex(<!?\/?\w+>?|/?>)
+$KEYWORDS(kwb)=regex(([-\w]+)=")
+$KEYWORDS(kwc)=regex(\&\#?\w+;)
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=#
+
+$IGNORECASE=false
+
+$IDENTIFIER=regex([a-zA-Z_][\w\-]*)
+
+$SYMBOLS= ( ) [ ] { } , ; : & | ! = / * % + -
diff --git a/support/highlight/langDefs/hx.lang b/support/highlight/langDefs/hx.lang
new file mode 100644
index 0000000000..fcbdc6245e
--- /dev/null
+++ b/support/highlight/langDefs/hx.lang
@@ -0,0 +1,50 @@
+# haXe language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 24.7.2002
+# updated 12.1.04 to add more types (ansi c, iso 99)
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=haXe
+
+#reserved words
+$KEYWORDS(kwa)=function class static var if else while do for break return
+continue extends implements import switch case default private public try catch
+new this throw extern enum in interface untyped cast override typedef dynamic
+package callback inline here
+
+#types
+$KEYWORDS(kwb)=Void Float Int Bool Dynamic true false null
+
+# pattern to highlight regexes ( -/.../)
+$KEYWORDS(kwc)=regex(~\/.*?\/[igms]*)
+#~/{([a-z]+)}/g
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=//
+
+$ML_COMMENT=/* */
+
+$ALLOWNESTEDCOMMENTS=false
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; . : & | < > ! = / * % + - ~
+
+$DIGIT=regex((?:0x|0X)[0-9a-fA-F]+|\d*[\.\_]?\d+(?:[eE][\-\+]?\d+)?[lLuUbfdm]*)
+
diff --git a/support/highlight/langDefs/icl.lang b/support/highlight/langDefs/icl.lang
new file mode 100644
index 0000000000..933415d28a
--- /dev/null
+++ b/support/highlight/langDefs/icl.lang
@@ -0,0 +1,38 @@
+# Clean language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 22.03.2010
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+
+$DESCRIPTION=Clean
+
+$KEYWORDS(kwa)= default definition derive case class code export from if implementation import in
+infix infixl infixr instance let module of otherwise special system where with
+
+$KEYWORDS(kwb)=Bool Char File Int Real World
+
+$KEYWORDS(kwc)=True False
+
+$KEYWORDS(kwd)=
+
+$STRINGDELIMITERS="
+
+$SL_COMMENT=//
+$ML_COMMENT=/* */
+$ALLOWNESTEDCOMMENTS=true
+
+$IGNORECASE=false
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + - . ' # @ $ \
diff --git a/support/highlight/langDefs/icn.lang b/support/highlight/langDefs/icn.lang
new file mode 100644
index 0000000000..a34757fa4b
--- /dev/null
+++ b/support/highlight/langDefs/icn.lang
@@ -0,0 +1,38 @@
+# Icon language definition file
+#
+# Author: André Simon
+# Mail: andre.simon1@gmx.de
+# Date: 08.02.04
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Icon
+
+$KEYWORDS(kwa)= by case create default do else every if initial next of repeat then to until while
+break end fail global invocable link local procedure record return static suspend
+
+$KEYWORDS(kwb)= co-expression cset tfile integer list null real set string table window
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=#
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+#$KW_PREFIX(kwb)=$
+#$KW_PREFIX(kwa)=&
+$KEYWORDS(kwa)=regex(\&\w+)
+$KEYWORDS(kwb)=regex(\$\w+)
+
+$SYMBOLS= ( ) [ ] { } , ; : | < > ! - + = / * + -
diff --git a/support/highlight/langDefs/idl.lang b/support/highlight/langDefs/idl.lang
new file mode 100644
index 0000000000..b0e7c5e369
--- /dev/null
+++ b/support/highlight/langDefs/idl.lang
@@ -0,0 +1,46 @@
+# IDL language definition file
+#
+# Author: André Simon
+# Mail: andre.simon1@gmx.de
+# Date: 02.03.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=IDL
+
+
+$KEYWORDS(kwa)=case coclass dispinterface enum interface library module pipe struct
+switch typedef union
+
+$KEYWORDS(kwb)=auto boolean bstr byte char double error_status_t float handle_t
+hbitmap henhmetafile hglobal hmetafile hmetafile_pict hpalette hresult hyper
+int long safearray short signed small unsigned variant variant_bool void
+wchar_t aggregatable appobject bindable broadcast callback const
+context_handle control custom default defaultbind defaultcollelem defaultvalue
+defaultvtable displaybind dllname dual endpoint entry first_is handle
+helpcontext helpfile helpstring helpstringcontext helpstringdll hidden id
+idempotentent ignore iid_is immediatebind in last_is lcid length_is licensed
+local max_is maybe message ms_union nonbrowsable noncreatable nonextensible
+object oleautomation optional out pointer_default propget propput propputref
+ptr public range readonly ref requestedit restricted retval size_is source
+string switch_is switch_type transmit_as uidefault unique user_marshal
+usesgetlasterror uuid v1_enum vararg version wire_marshal
+
+$STRINGDELIMITERS="
+
+$SL_COMMENT=//
+
+$ML_COMMENT=/* */
+
+$IGNORECASE=true
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
diff --git a/support/highlight/langDefs/idlang.lang b/support/highlight/langDefs/idlang.lang
new file mode 100644
index 0000000000..1c863bf854
--- /dev/null
+++ b/support/highlight/langDefs/idlang.lang
@@ -0,0 +1,171 @@
+# Interactive Data Language definition file for highlight (http://www.andre-simon.de/)
+# http://en.wikipedia.org/wiki/IDL_(programming_language)
+#
+#------------------------------------------------------------------------------
+
+$DESCRIPTION=Interactive Data Language
+
+$IGNORECASE=true
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=;
+
+$IDENTIFIER=regex([a-zA-Z_][\w\d\*]*)
+
+$KEYWORDS(kwa)= pro function
+
+$CONTINUATIONSYMBOL=$
+
+$KEYWORDS(kwb)= a_correlate abs acos adapt_hist_equal alog alog10
+amoeba annotate arg_present array_equal arrow
+ascii_template asin assoc atan axis bar_plot
+beseli beselj beselk besely beta bilinear bin_date
+binary_template bindgen binomial blas_axpy blk_con
+box_cursor break breakpoint broyden bytarr byte
+byteorder bytscl c_correlate caldat calendar
+call_external call_function call_method
+call_procedure catch cd ceil chebyshev check_math
+chisqr_cvf chisqr_pdf choldc cholsol cindgen
+cir_3pnt close clust_wts cluster color_convert
+color_quan colormap_applicable comfit common
+complex complexarr complexround
+compute_mesh_normals cond congrid conj
+constrained_min contour convert_coord convol
+coord2to3 correlate cos cosh cramer create_struct
+create_view crossp crvlength ct_luminance cti_test
+cursor curvefit cv_coord cvttobm cw_animate
+cw_animate_getp cw_animate_load cw_animate_run
+cw_arcball cw_bgroup cw_clr_index cw_colorsel
+cw_defroi cw_field cw_filesel cw_form cw_fslider
+cw_light_editor cw_light_editor_get
+cw_light_editor_set cw_orient cw_palette_editor
+cw_palette_editor_get cw_palette_editor_set
+cw_pdmenu cw_rgbslider cw_tmpl cw_zoom dblarr
+dcindgen dcomplex dcomplexarr define_key defroi
+defsysv delete_symbol dellog delvar deriv derivsig
+determ device dfpmin dialog_message
+dialog_pickfile dialog_printersetup
+dialog_printjob dialog_read_image
+dialog_write_image digital_filter dilate dindgen
+dissolve dist dlm_load dlm_register
+do_apple_script doc_library double draw_roi efont
+eigenql eigenvec elmhes empty enable_sysrtn eof
+erase erode errorf errplot execute exit exp expand
+expand_path expint extrac extract_slice f_cvf
+f_pdf factorial fft file_chmod file_delete
+file_expand_path file_mkdir file_test file_which
+filepath findfile findgen finite fix flick float
+floor flow3 fltarr flush for format_axis_values
+forward_function free_lun fstat fulstr funct
+fv_test fx_root fz_roots gamma gamma_ct
+gauss_cvf gauss_pdf gauss2dfit gaussfit gaussint
+get_drive_list get_kbrd get_lun get_screen_size
+get_symbol getenv goto grid_tps grid3 gs_iter
+h_eq_ct h_eq_int hanning heap_gc help hilbert
+hist_2d hist_equal histogram hls hough hqr hsv
+ibeta identity idl_container idlanroi
+idlanroigroup idlffdicom idlffdxf idlfflanguagecat
+idlffshape idlgraxis idlgrbuffer idlgrclipboard
+idlgrcolorbar idlgrcontour idlgrfont idlgrimage
+idlgrlegend idlgrlight idlgrmodel idlgrmpeg
+idlgrpalette idlgrpattern idlgrplot idlgrpolygon
+idlgrpolyline idlgrprinter idlgrroi idlgrroigroup
+idlgrscene idlgrsurface idlgrsymbol
+idlgrtessellator idlgrtext idlgrview
+idlgrviewgroup idlgrvolume idlgrvrml idlgrwindow
+igamma image_cont image_statistics imaginary
+indgen int_2d int_3d int_tabulated intarr interpol
+interpolate invert ioctl ishft isocontour
+isosurface journal julday keyword_set krig2d
+kurtosis kw_test l64indgen label_date label_region
+ladfit laguerre leefilt legendre linbcg lindgen
+linfit linkimage live_contour live_control
+live_destroy live_export live_image live_info
+live_line live_load live_oplot live_plot
+live_print live_rect live_style live_surface
+live_text ljlct ll_arc_distance lmfit lmgr lngamma
+lnp_test loadct locale_get lon64arr lonarr long
+long64 lsode lu_complex ludc lumprove lusol
+m_correlate machar make_array make_dll map_2points
+map_continents map_grid map_image map_patch
+map_proj_info map_set matrix_multiply md_test mean
+meanabsdev median memory mesh_clip mesh_decimate
+mesh_issolid mesh_merge mesh_numtriangles mesh_obj
+mesh_smooth mesh_surfacearea mesh_validate
+mesh_volume message min_curve_surf mk_html_help
+modifyct moment morph_close morph_distance
+morph_gradient morph_hitormiss morph_open
+morph_thin morph_tophat mpeg_close mpeg_open
+mpeg_put mpeg_save msg_cat_close msg_cat_compile
+msg_cat_open multi n_elements n_params n_tags
+newton norm obj_class obj_destroy obj_isa obj_new
+obj_valid objarr on_error on_ioerror online_help
+open openr openw oplot oploterr p_correlate
+particle_trace pcomp plot plot_3dbox plot_field
+ploterr plots pnt_line point_lun polar_contour
+polar_surface poly poly_2d poly_area poly_fit
+polyfill polyfillv polyshade polywarp popd powell
+primes print printf printd profile profiler
+profiles project_vol ps_show_fonts psafm pseudo
+ptr_free ptr_new ptr_valid ptrarr pushd qromb
+qromo qsimp r_correlate r_test radon randomn
+randomu ranks rdpix read readf read_ascii
+read_binary read_bmp read_dicom read_image
+read_interfile read_jpeg read_pict read_png
+read_ppm read_spr read_srf read_sylk read_tiff
+read_wav read_wave read_x11_bitmap read_xwd reads
+readu rebin recall_commands recon3 reduce_colors
+reform regress replicate replicate_inplace
+resolve_all resolve_routine restore retall return
+reverse rewind rk4 roberts rot rotate round
+routine_info rs_test s_test save savgol scale3
+scale3d search2d search3d set_plot set_shading
+set_symbol setenv setlog setup_keys sfit
+shade_surf shade_surf_irr shade_volume shift show3
+showfont sin sindgen sinh size skewness skipf
+slicer3 slide_image smooth sobel socket sort spawn
+sph_4pnt sph_scat spher_harm spl_init spl_interp
+spline spline_p sprsab sprsax sprsin sprstp sqrt
+standardize stddev stop strarr strcmp strcompress
+streamline stregex stretch string strjoin strlen
+strlowcase strmatch strmessage strmid strpos
+strput strsplit strtrim struct_assign struct_hide
+strupcase surface surfr svdc svdfit svsol
+swap_endian switch systime t_cvf t_pdf t3d
+tag_names tan tanh taprd tapwrt tek_color
+temporary tetra_clip tetra_surface tetra_volume
+thin threed time_test2 timegen tm_test total trace
+transpose tri_surf triangulate trigrid triql
+trired trisol trnlog ts_coef ts_diff ts_fcast
+ts_smooth tv tvcrs tvlct tvrd tvscl uindgen uint
+uintarr ul64indgen ulindgen ulon64arr ulonarr
+ulong ulong64 uniq usersym value_locate variance
+vax_float vector_field vel velovect vert_t3d voigt
+voronoi voxel_proj wait warp_tri watershed wdelete
+weof wf_draw where widget_base widget_button
+widget_control widget_draw widget_droplist
+widget_event widget_info widget_label widget_list
+widget_slider widget_table widget_text window
+write_bmp write_image write_jpeg write_nrif
+write_pict write_png write_ppm write_spr write_srf
+write_sylk write_tiff write_wav write_wave writeu
+wset wshow wtn wv_applet wv_cw_wavelet wv_cwt
+wv_denoise wv_dwt wv_fn_coiflet wv_fn_daubechies
+wv_fn_gaussian wv_fn_haar wv_fn_morlet wv_fn_paul
+wv_fn_symlet wv_import_data wv_import_wavelet
+wv_plot3d_wps wv_plot_multires wv_pwt
+wv_tool_denoise xbm_edit xdisplayfile xdxf xfont
+xinteranimate xloadct xmanager xmng_tmpl xmtool
+xobjview xpalette xpcolor xplot3d xregistered xroi
+xsq_test xsurface xvaredit xvolume xvolume_rotate
+xvolume_write_image xyouts zoom zoom_24
+
+$KEYWORDS(kwc)= if else then for while case switch endcase endelse endfor endswitch
+endif endrep endwhile repeat until continue
+
+$KEYWORDS(kwd)= return continue mod do break compile_opt forward_function goto begin
+common end of inherits on_ioerror begin stop and eq ge gt le lt ne or xor
+
+$SYMBOLS= ( ) [ ] { } , : & | < > ! = / * % + - .
+
diff --git a/support/highlight/langDefs/ili.lang b/support/highlight/langDefs/ili.lang
new file mode 100644
index 0000000000..1822758ec1
--- /dev/null
+++ b/support/highlight/langDefs/ili.lang
@@ -0,0 +1,51 @@
+# INTERLIS language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 22.06.09
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=INTERLIS
+
+$KEYWORDS(kwa)= ANY ARCS AREA BASE BLANK CODE CONTINUE CONTOUR COORD2 COORD3 DATE DEFAULT
+DEGREES DERIVATIVES DIM1 DIM2 DOMAIN END FIX FONT FORMAT FREE GRADS HALIGNMENT
+I16 I32 IDENT LINEATTR LINESIZE MODEL NO OPTIONAL OVERLAPS PERIPHERY POLYLINE
+RADIANS STRAIGHTS SURFACE TABLE TEXT TID TIDSIZE TOPIC TRANSFER UNDEFINED
+VALIGNMENT VERTEX VERTEXINFO VIEW WITH WITHOUT ABSTRACT ACCORDING AGGREGATES
+AGGREGATION ALL AND ANY ANYCLASS ANYSTRUCTURE ARCS AREA AS ASSOCIATION AT
+ATTRIBUTE ATTRIBUTES BAG BASE BASED BASKET BINARY BLACKBOX BOOLEAN BY
+CARDINALITY CIRCULAR CLASS CLOCKWISE CONSTRAINT CONSTRAINTS CONTINUE CONTINUOUS
+CONTRACTED COORD COUNTERCLOCKWISE DEFINED DEPENDS DERIVED DIRECTED DOMAIN END
+ENUMTREEVAL ENUMVAL EQUAL EXISTENCE EXTENDED EXTENDS EXTERNAL FINAL FIRST FORM
+FROM FUNCTION GRAPHIC HALIGNMENT HIDING IMPORTS IN INHERITANCE INSPECTION
+INTERLIS JOIN LAST LINE LIST LNBASE LOCAL MANDATORY METAOBJECT MODEL MTEXT NAME
+NOT NO NULL NUMERIC OBJECT OF OID ON OR ORDERED OTHERS OVERLAPS PARAMETER PARENT
+PI POLYLINE PROJECTION REFERENCE REFSYSTEM REQUIRED RESTRICTED ROTATION SET SIGN
+STRAIGHTS STRUCTURE SUBDIVISION SURFACE SYMBOLOGY TEXT THATAREA THIS THISAREA TO
+TOPIC TRANSIENT TRANSLATION TYPE UNDEFINED UNION UNIQUE UNIT UNQUALIFIED URI
+VALIGNMENT VERSION VERTEX VIEW WHEN WHERE WITH WITHOUT
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=!! //
+
+$ML_COMMENT=/* */
+
+$ALLOWNESTEDCOMMENTS=false
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; . : & | < > ! = / * % + - ~
+
diff --git a/support/highlight/langDefs/inc_luatex.lang b/support/highlight/langDefs/inc_luatex.lang
new file mode 100644
index 0000000000..9dcea89cce
--- /dev/null
+++ b/support/highlight/langDefs/inc_luatex.lang
@@ -0,0 +1,51 @@
+# Lua embedded in TeX language definition file
+#
+# Author: Andre Simon
+#
+# Mail: andre.simon1@gmx.de
+# Date: 22.07.2002
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Lua (for LuaTeX)
+
+$KEYWORDS(kwa)=and break do else elseif
+end false for function if
+in local nil not or
+repeat return then true until while
+
+$KEYWORDS(kwb)=number string function userdata table
+assert call collectgarbage copytagmethods dofile
+dostring error foreach foreachi getglobal getn gettagmethod globals newtag
+next print rawget rawset setglobal settag settagmethod sort tag tonumber
+tostring tinsert tremove type abs acos asin atan atan2 ceil cos deg exp
+floor log log10 max min mod rad sin sqrt tan frexp ldexp random randomseed
+openfile closefile readfrom writeto appendto remove rename flush seek tmpname
+read write clock date execute exit getenv setlocale strbyte strchar strfind
+strlen strlower strrep strsub strupper format gsub
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$ML_COMMENT=--[[ ]]
+
+# this differs from lua.lang
+$SL_COMMENT=%
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) { } [ ] , ; . : & | < > ! = / * + - ~ # \ %
+
+
diff --git a/support/highlight/langDefs/ini.lang b/support/highlight/langDefs/ini.lang
new file mode 100644
index 0000000000..29809abff9
--- /dev/null
+++ b/support/highlight/langDefs/ini.lang
@@ -0,0 +1,30 @@
+# INI language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 28.06.2003
+# Update: 21.06.2007
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http://www.andre-simon.de/
+
+$DESCRIPTION=INI
+
+$SYMBOLS= ( ) { } , : & | < > ! = / * % + -
+
+$SL_COMMENT=regex(^\s*([;#].*))
+
+#$TAG_DELIM(kwa)=[ ]
+$KEYWORDS(kwa)=regex(^\s*(\[.*\]))
+$KEYWORDS(kwb)=regex(^\s*([^=]+)\s*=)
+$KEYWORDS(kwc)=regex(^\s*[^=]+\s*=\s*(\S.*))
+
+$STRINGDELIMITERS="
diff --git a/support/highlight/langDefs/inp.lang b/support/highlight/langDefs/inp.lang
new file mode 100644
index 0000000000..65d87c1301
--- /dev/null
+++ b/support/highlight/langDefs/inp.lang
@@ -0,0 +1,83 @@
+# FAME language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 19.04.04
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=FAME
+
+$KEYWORDS(kwa)=abort accelerator access alias almon append area arguments
+arimaconstant arrow assist astime axis background band base basis batch
+behavioral boolean bottom box bring brown button cache calendar caption case
+cell century channel character chset class color column commas confirm
+constrain contents convert criterion date decimal depic depict description
+device dimension disable division echo eject error expand explode fetch field
+finish fon force forecast forms fraction frame frdb frequency future generate
+glue grid history holdout holiday ignore image indent index influence infobar
+intercept interrupt item justify keep kind label language left leftmargin
+legend length limit lines link lprefix map margins mark match memory method
+missingvalues name negative number object observed offset order overwrite pack
+page partial past pause pgcell pierce placement plot position positive prefix
+range remarks render reorder replace report response restore review right
+robiterlimit scalar scatter seasonal see series shiller show size speed squeeze
+store stringlength style suffix suspend symbolize tag technique text thickness
+threed tick time title top trace transform trigger trimvalue tune turn type
+ucharacter underline unit verify view wedge weights width window xyset year
+zerovalues abs acf aggr agr all alpha amort annpct any ar arima arma atan ave
+biwk boolfmt caseorder cave channels channeltype checkaccess cmax cmin conname
+corr cos cprod created crosslist csum ctot datefmt dateof dateorder day db
+dbcreated dbupdated diff dty eof errortext eval exists exp extract file
+filespec first firstcase firstdate firstvalue font fperiod fyear getenv getid
+growth hour id iniscan interp irr largest last lastcase lastdate lasterror
+lastvalue lave lengthcase lengthdate list listaccess lmax lmedian lmin location
+log log10 lookup lower lprod lstddev lsum ltrim lvar ma magic make makedate
+mave mavec max maxcase maxdate mcorr mean median merge min mincase mindate
+minute mirror missing mmax mmedian mmin month mprod mstddev msum mvar nameloc
+nl normal now npv numfmt overlay pacf pad payback pct pending period pixels
+points precfmt prod realname remeval repeat reverse robloc robvar round rtrim
+sannpct sarima scan screeninfo script second selectnames shift shiftmtn shiftyr
+sign sin sl slice smallest sortdata sortindex sortname source special sqrt
+stddev string stuff substring sum system systemerror thisday today trim trunc
+uniform unique updated upper var weekday wildlist wildnames winframeinfo
+wininfo writeacct ytd ytydiff ytypct
+
+$types=accept activate adjust apply argument associate attribute backto best
+blank block buffer cancel catalog catch cd check clear close compile conceal
+connect copy correlate create data dbstatus deactivated delete disconnect
+display documentation down draw edit else end endogenize enter entry escape
+execute exhibit exit exogenize extradots extrapolate find fit footing form
+formula function get ghost glformula glname goto graph heading help hide if
+include info initialize input insert leave line load local loop marking menu
+message model modify move new newpage next note open output otherwise picture
+pie post print procedure prompt quit rabort rassert rattribute rcommit rcopy
+rdelete read recalculate redo reenter refile refresh region rename reopen reset
+resignal return reveal rrename rset run save score search select set setenv
+signal sleep stest stroke substitute summarize terminate try then unghost
+unload unsave unsetenv up update validate valprint whats which write xyget
+alias associate basis description dimension documentation extradots observed
+stringlength amrt and div eq eql except gt ge intersect lt le mod ne nel not or
+subset union false no off on true yes
+
+
+$IGNORECASE=true
+
+$STRINGDELIMITERS="
+
+$SL_COMMENT=// --
+
+$IGNORECASE=true
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
diff --git a/support/highlight/langDefs/io.lang b/support/highlight/langDefs/io.lang
new file mode 100644
index 0000000000..dcc65b1568
--- /dev/null
+++ b/support/highlight/langDefs/io.lang
@@ -0,0 +1,53 @@
+# IO language definition file
+#
+# Author: Andr�Simon
+# Mail: andre.simon1@gmx.de
+# Date: 18.11.2003
+# 29.11.1004 added more keywords and symbols
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=IO
+
+$KEYWORDS(kwa)=activate activeCoroCount and block break catch
+chedulerSleepSeconds clone collectGarbage compileString continue do doFile
+doMessage doString else elseif exit for foreach forward getSlot getenv hasSlot
+if ifFalse ifNil ifTrue isActive isNil list message method or parent pass
+pause perform performWithArgList print proto raise removeSlot resend resume
+return self sender setSchedulerSleepSeconds setSlot shallowCopy slotNames
+super system then thisBlock thisContext thisMessage try type uniqueId
+updateSlot wait write yield
+
+$KEYWORDS(kwb)=Array AudioDevice AudioMixer Block Box Buffer CFunction CGI
+Color Curses DBM DNSResolver DOConnection DOProxy DOServer Date Directory
+Duration DynLib Error Exception FFT File Fnmatch Font Future GL GLE GLScissor
+GLU GLUCylinder GLUQuadric GLUSphere GLUT Host Image Importer LinkList List
+Lobby Locals MD5 MP3Decoder MP3Encoder Map Message Movie NULL Nil Nop
+Notification Number Object OpenGL Point Protos Regex SGMLTag SQLite Server
+ShowMessage SleepyCat SleepyCatCursor Socket SocketManager Sound Soup Store
+String Tree UDPSender UPDReceiver URL User Warning WeakLink
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=""" ''' " '
+
+$SL_COMMENT=# //
+
+$ML_COMMENT=/* */
+
+$ALLOWNESTEDCOMMENTS=false
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + - ^ @ .
diff --git a/support/highlight/langDefs/iss.lang b/support/highlight/langDefs/iss.lang
new file mode 100644
index 0000000000..8a867aaee9
--- /dev/null
+++ b/support/highlight/langDefs/iss.lang
@@ -0,0 +1,103 @@
+# Inno Setup language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 22.06.09
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Inno Setup
+
+$KEYWORDS(kwa)=Compression DiskClusterSize DiskSliceSize DiskSpanning Encryption
+InternalCompressLevel MergeDuplicateFiles OutputBaseFilename OutputDir
+ReserveBytes SlicesPerDisk SolidCompression SourceDir UseSetupLdr
+VersionInfoCompany VersionInfoDescription VersionInfoTextVersion
+VersionInfoVersion AllowCancelDuringInstall AllowNoIcons AllowRootDirectory
+AllowUNCPath AlwaysRestart AlwaysShowComponentsList AlwaysShowDirOnReadyPage
+AlwaysShowGroupOnReadyPage AlwaysUsePersonalGroup AppendDefaultDirName
+AppendDefaultGroupName AppComments AppContact AppId AppModifyPath AppMutex
+AppName AppPublisher AppPublisherURL AppReadmeFile AppSupportURL AppUpdatesURL
+AppVersion AppVerName ChangesAssociations CreateAppDir CreateUninstallRegKey
+DefaultDirName DefaultGroupName DefaultUserInfoName DefaultUserInfoOrg
+DefaultUserInfoSerial DirExistsWarning DisableDirPage DisableFinishedPage
+DisableProgramGroupPage DisableReadyMemo DisableReadyPage DisableStartupPrompt
+EnableDirDoesntExistWarning ExtraDiskSpaceRequired InfoAfterFile InfoBeforeFile
+LanguageDetectionMethod LicenseFile MinVersion OnlyBelowVersion Password
+PrivilegesRequired RestartIfNeededByRun ShowLanguageDialog TimeStampRounding
+TimeStampsInUTC TouchDate TouchTime Uninstallable UninstallDisplayIcon
+UninstallDisplayName UninstallFilesDir UninstallLogMode UninstallRestartComputer
+UpdateUninstallLogAppName UsePreviousAppDir UsePreviousGroup
+UsePreviousSetupType UsePreviousTasks UsePreviousUserInfo UserInfoPage
+AppCopyright BackColor BackColor2 BackColorDirection BackSolid
+FlatComponentsList SetupIconFile ShowComponentSizes ShowTasksTreeLines
+UninstallStyle WindowShowCaption WindowStartMaximized WindowResizable
+WindowVisible WizardImageBackColor WizardImageFile WizardImageStretch
+WizardSmallImageBackColor WizardSmallImageFile UninstallIconFile
+
+$KEYWORDS(kwb)=AfterInstall Attribs BeforeInstall Check Comment Components
+CopyMode Description DestDir DestName Excludes ExtraDiskSpaceRequired Filename
+Flags FontInstall GroupDescription HotKey IconFilename IconIndex InfoBeforeFile
+InfoAfterFile Key MessagesFile Name Parameters Permissions Root RunOnceId
+Section Source StatusMsg String Subkey Tasks Type Types ValueType ValueName
+ValueData WorkingDir
+
+$KEYWORDS(kwc)=allowunsafefiles checkedonce closeonexit compact comparetimestamp
+confirmoverwrite createkeyifdoesntexist createonlyiffileexists
+createvalueifdoesntexist deleteafterinstall deletekey deletevalue desktopicon
+dirifempty disablenouninstallwarning dontcloseonexit dontcopy dontcreatekey
+dontinheritcheck dontverifychecksum exclusive external files filesandordirs
+fixed fontisnttruetype full ignoreversion iscustom isreadme hidden hidewizard
+modify nocompression noencryption noerror noregerror nowait onlyifdestfileexists
+onlyifdoesntexist overwritereadonly postinstall preservestringtype promptifolder
+quicklaunchicon read readonly readexec recursesubdirs regserver regtypelib
+replacesameversion restart restartreplace runhidden runmaximized runminimized
+sharedfile shellexec skipifnotsilent skipifsilent skipifdoesntexist
+skipifsourcedoesntexist sortfilesbyextension system touch unchecked
+uninsalwaysuninstall uninsclearvalue uninsdeleteentry uninsdeletekey
+uninsdeletekeyifempty uninsdeletesection uninsdeletesectionifempty
+uninsdeletevalue uninsneveruninstall uninsremovereadonly uninsrestartdelete
+useapppaths waituntilidle
+
+$KEYWORDS(kwd)=regex(^\[\w+\])
+
+
+# pascal stuff:
+
+$KEYWORDS(kwa)= absolute abstract and array as asm assembler automated begin case
+cdecl class const constructor destructor dispid dispinterface div do downto
+dynamic else end except export exports external far file finalization finally
+for forward function goto if implementation in initialization inherited inline
+interface is label library message mod near nil not object of or out override
+packed pascal private procedure program property protected public published
+raise record register repeat resourcestring safecall set shl shr stdcall string
+then threadvar to try type unit until uses var virtual while with xor
+
+$KEYWORDS(kwb)=boolean char integer pointer real text
+true false cardinal longint byte word single double int64
+
+$KEYWORDS(kwc)=if else then downto do for repeat while to until with
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=regex(^;.*)
+
+$ML_COMMENT={ } (* *)
+
+$IGNORECASE=true
+
+$SYMBOLS= ( ) [ ] , ; : & | < > ! = / * % + - @ . ^
+
+$ESCCHAR=regex(\#\$\p{XDigit}{2}|\#\d{,3})
+
+$DIGIT=regex((?:0x|0X|\$)[0-9a-fA-F]+|\d*[\.\_]?\d+(?:[eE][\-\+]\d+)?[lLuUbfdm]*)
diff --git a/support/highlight/langDefs/j.lang b/support/highlight/langDefs/j.lang
new file mode 100644
index 0000000000..ae30c9c1de
--- /dev/null
+++ b/support/highlight/langDefs/j.lang
@@ -0,0 +1,55 @@
+# Jasmin language definition file
+#
+# Author: André Simon
+# Mail: andre.simon1@gmx.de
+# Date: 04.03.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Jasmin
+
+
+$KEYWORDS(kwa)=catch class end field implements interface limit line method source
+super throws var aaload aastore aconst_null aload aload_0 aload_1 aload_2
+aload_3 anewarray areturn arraylength astore astore_0 astore_1 astore_2
+astore_3 athrow baload bastore bipush breakpoint caload castore checkcast d2f
+d2i d2l dadd daload dastore dcmpg dcmpl dconst_0 dconst_1 ddiv dead dload
+dload_0 dload_1 dload_2 dload_3 dmul dneg drem dreturn dstore dstore_0 dstore_1
+dstore_2 dstore_3 dsub dup dup2 dup2_x1 dup2_x2 dup_x1 dup_x2 f2d f2i f2l fadd
+faload fastore fcmpg fcmpl fconst_0 fconst_1 fconst_2 fdiv fload fload_0
+fload_1 fload_2 fload_3 fmul fneg frem freturn fstore fstore_0 fstore_1
+fstore_2 fstore_3 fsub getfield getstatic goto goto_w i2b i2c i2d i2f i2l i2s
+iadd iaload iand iastore iconst_0 iconst_1 iconst_2 iconst_3 iconst_4 iconst_5
+iconst_m1 idiv if_acmpeq if_acmpne if_icmpeq if_icmpge if_icmpgt if_icmple
+if_icmplt if_icmpne ifeq ifge ifgt ifle iflt ifne ifnonnull ifnull iinc iload
+iload_0 iload_1 iload_2 iload_3 imul ineg instanceof int2byte int2char
+int2short invokeinterface invokenonvirtual invokespecial invokestatic
+invokevirtual ior irem ireturn ishl ishr istore istore_0 istore_1 istore_2
+istore_3 isub iushr ixor jsr jsr_w l2d l2f l2i label ladd laload land lastore
+lcmp lconst_0 lconst_1 ldc ldc2_w ldc_w ldiv lload lload_0 lload_1 lload_2
+lload_3 lmul lneg lor lrem lreturn lshl lshr lstore lstore_0 lstore_1 lstore_2
+lstore_3 lsub lushr lxor monitorenter monitorexit multianewarray new newarray
+nop pop pop2 putfield putstatic ret return saload sastore sipush swap try wide
+
+$KEYWORDS(kwb)=abstract default final from is lookupswitch native private protected
+public static synchronized tableswitch to transient using volatile
+
+$STRINGDELIMITERS='
+
+$SL_COMMENT=;
+
+$IGNORECASE=true
+
+$SYMBOLS= ( ) [ ] { } , : & | < > ! = / * % + -
+
+
+
diff --git a/support/highlight/langDefs/java.lang b/support/highlight/langDefs/java.lang
new file mode 100644
index 0000000000..c1140b8bf3
--- /dev/null
+++ b/support/highlight/langDefs/java.lang
@@ -0,0 +1,755 @@
+# Java language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 10.1.2002
+# 09.02.2004 added Java 1.5 Keywords and some class names of runtime libs
+# 08-06.2009 added Groovy keywords
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon1.de/
+
+$DESCRIPTION=Java
+
+$KEYWORDS(kwa)=abstract default if private this do implements protected
+throw break import public throws else instanceof return transient
+case extends try catch final interface static finally strictfp volatile
+class native super while const for new switch continue goto package synchronized
+as in def property
+
+$KEYWORDS(kwb)=boolean double byte int short void char long float
+
+$KEYWORDS(kwc)=AWTError AWTEvent AWTEventListener AWTEventListenerProxy
+AWTEventMulticaster AWTException AWTKeyStroke AWTPermission AbstractAction
+AbstractBorderAbstractButton AbstractCellEditor AbstractCollection
+AbstractColorChooserPanel AbstractDocument
+AbstractInterruptibleChannelAbstractLayoutCacheAbstractList AbstractListModel
+AbstractMap AbstractMethodError AbstractPreferences AbstractQueue
+AbstractSchemaImpl AbstractSelectableChannel AbstractSelectionKey
+AbstractSelector AbstractSequentialList AbstractSet AbstractSpinnerModel
+AbstractTableModel AbstractUndoableEdit AbstractVersion AbstractWriter
+AccessControlContext AccessControlException AccessController AccessException
+Accessible AccessibleAction AccessibleAttributeSequence AccessibleBundle
+AccessibleComponent AccessibleContext AccessibleEditableText
+AccessibleExtendedComponent AccessibleExtendedTable AccessibleExtendedText
+AccessibleHyperlink AccessibleHypertext AccessibleIcon AccessibleKeyBinding
+AccessibleObject AccessibleRelation AccessibleRelationSet
+AccessibleResourceBundle AccessibleRole AccessibleSelection AccessibleState
+AccessibleStateSet AccessibleStreamable AccessibleTable
+AccessibleTableModelChange AccessibleText AccessibleTextSequence
+AccessibleValue AccountException AccountExpiredException AccountLockedException
+AccountNotFoundException Acl AclEntry AclNotFoundException Action ActionEvent
+ActionListener ActionMap ActionMapUIResource Activatable
+ActivateFailedException ActivationDesc ActivationException ActivationGroup
+ActivationGroupDesc ActivationGroupID ActivationGroup_Stub ActivationID
+ActivationInstantiator ActivationMonitor ActivationSystem Activator ActiveEvent
+AdapterActivator AdapterActivatorOperations AdapterAlreadyExists
+AdapterAlreadyExistsHelper AdapterInactive AdapterInactiveHelper
+AdapterManagerIdHelper AdapterNameHelper AdapterNonExistent
+AdapterNonExistentHelper AdapterStateHelper AddressHelper Adjustable
+AdjustmentEvent AdjustmentListener Adler32 AffineTransform AffineTransformOp
+AlgorithmParameterGenerator AlgorithmParameterGeneratorSpi
+AlgorithmParameterSpec AlgorithmParameters AlgorithmParametersSpi AllPermission
+AlphaComposite AlreadyBound AlreadyBoundException AlreadyBoundHelper
+AlreadyBoundHolder AlreadyConnectedException AncestorEvent AncestorListener
+AnnotatedElement Annotation Annotation AnnotationTypeMismatchError Any
+AnyHolder AnySeqHelper AnySeqHelper AnySeqHolder AppConfigurationEntry
+Appendable Applet AppletContext AppletInitializer AppletStub
+ApplicationException Arc2D Area AreaAveragingScaleFilter ArithmeticException
+Array Array ArrayBlockingQueue ArrayIndexOutOfBoundsException ArrayList
+ArrayStoreException ArrayType Arrays AssertionError AsyncBoxView
+AsynchronousCloseException AtomicBoolean AtomicInteger AtomicIntegerArray
+AtomicIntegerFieldUpdater AtomicLong AtomicLongArray AtomicLongFieldUpdater
+AtomicMarkableReference AtomicReference AtomicReferenceArray
+AtomicReferenceFieldUpdater AtomicStampedReference Attr Attribute Attribute
+Attribute AttributeChangeNotification AttributeChangeNotificationFilter
+AttributeException AttributeInUseException AttributeList AttributeList
+AttributeList AttributeListImpl AttributeModificationException
+AttributeNotFoundException AttributeSet AttributeSet
+AttributeSet.ColorAttribute AttributeSet.FontAttribute
+AttributeSet.ParagraphAttribute AttributeSetUtilities AttributeValueExp
+AttributedCharacterIterator AttributedString Attributes Attributes Attributes
+AttributesImpl AudioClip AudioFileFormat AudioFileReader AudioFileWriter
+AudioFormat AudioInputStream AudioPermission AudioSystem AuthPermission
+AuthProvider AuthenticationException AuthenticationException
+AuthenticationNotSupportedException Authenticator AuthorizeCallback Autoscroll
+BAD_CONTEXT BAD_INV_ORDER BAD_OPERATION BAD_PARAM BAD_POLICY BAD_POLICY_TYPE
+BAD_POLICY_VALUE BAD_TYPECODE BMPImageWriteParam BackingStoreException
+BadAttributeValueExpException BadBinaryOpValueExpException BadKind
+BadLocationException BadPaddingException BadStringOperationException
+BandCombineOp BandedSampleModel BaseRowSet BasicArrowButton BasicAttribute
+BasicAttributes BasicBorders BasicButtonListener BasicButtonUI
+BasicCheckBoxMenuItemUI BasicCheckBoxUI BasicColorChooserUI
+BasicComboBoxEditor BasicComboBoxRenderer BasicComboBoxUI BasicComboPopup
+BasicControl BasicDesktopIconUI BasicDesktopPaneUI BasicDirectoryModel
+BasicEditorPaneUI BasicFileChooserUI BasicFormattedTextFieldUI
+BasicGraphicsUtils BasicHTML BasicIconFactory BasicInternalFrameTitlePane
+BasicInternalFrameUI BasicLabelUI BasicListUI BasicLookAndFeel BasicMenuBarUI
+BasicMenuItemUI BasicMenuUI BasicOptionPaneUI BasicPanelUI BasicPasswordFieldUI
+BasicPermission BasicPopupMenuSeparatorUI BasicPopupMenuUI BasicProgressBarUI
+BasicRadioButtonMenuItemUI BasicRadioButtonUI BasicRootPaneUI BasicScrollBarUI
+BasicScrollPaneUI BasicSeparatorUI BasicSliderUI BasicSpinnerUI
+BasicSplitPaneDivider BasicSplitPaneUI BasicStroke BasicTabbedPaneUI
+BasicTableHeaderUI BasicTableUI BasicTextAreaUI BasicTextFieldUI
+BasicTextPaneUI BasicTextUI BasicToggleButtonUI BasicToolBarSeparatorUI
+BasicToolBarUI BasicToolTipUI BasicTreeUI BasicViewportUI BatchUpdateException
+BeanContext BeanContextChild BeanContextChildComponentProxy
+BeanContextChildSupport BeanContextContainerProxy BeanContextEvent
+BeanContextMembershipEvent BeanContextMembershipListener BeanContextProxy
+BeanContextServiceAvailableEvent BeanContextServiceProvider
+BeanContextServiceProviderBeanInfo BeanContextServiceRevokedEvent
+BeanContextServiceRevokedListener BeanContextServices
+BeanContextServicesListener BeanContextServicesSupport BeanContextSupport
+BeanDescriptor BeanInfo Beans BevelBorder Bidi BigDecimal BigInteger
+BinaryRefAddr BindException Binding Binding BindingHelper BindingHolder
+BindingIterator BindingIteratorHelper BindingIteratorHolder
+BindingIteratorOperations BindingIteratorPOA BindingListHelper
+BindingListHolder BindingType BindingTypeHelper BindingTypeHolder BitSet Blob
+BlockView BlockingQueue Book Boolean BooleanControl BooleanHolder
+BooleanSeqHelper BooleanSeqHolder Border BorderFactory BorderLayout
+BorderUIResource BoundedRangeModel Bounds Bounds Box BoxLayout BoxView
+BoxedValueHelper BreakIterator BrokenBarrierException Buffer BufferCapabilities
+BufferOverflowException BufferStrategy BufferUnderflowException BufferedImage
+BufferedImageFilter BufferedImageOp BufferedInputStream BufferedOutputStream
+BufferedReader BufferedWriter Button ButtonGroup ButtonModel ButtonUI Byte
+ByteArrayInputStream ByteArrayOutputStream ByteBuffer ByteChannel ByteHolder
+ByteLookupTable ByteOrder CDATASection CMMException COMM_FAILURE CRC32 CRL
+CRLException CRLSelector CSS CTX_RESTRICT_SCOPE CacheRequest CacheResponse
+CachedRowSet Calendar Callable CallableStatement Callback CallbackHandler
+CancelablePrintJob Cancellable CancellableTask CancellationException
+CancelledKeyException CannotProceed CannotProceedException CannotProceedHelper
+CannotProceedHolder CannotRedoException CannotUndoException Canvas CardLayout
+Caret CaretEvent CaretListener CellEditor CellEditorListener CellRendererPane
+CertPath CertPathBuilder CertPathBuilderException CertPathBuilderResult
+CertPathBuilderSpi CertPathParameters CertPathTrustManagerParameters
+CertPathValidator CertPathValidatorException CertPathValidatorResult
+CertPathValidatorSpi CertSelector CertStore CertStoreException
+CertStoreParameters CertStoreSpi Certificate Certificate Certificate
+CertificateEncodingException CertificateEncodingException CertificateException
+CertificateException CertificateExpiredException CertificateExpiredException
+CertificateFactory CertificateFactorySpi CertificateNotYetValidException
+CertificateNotYetValidException CertificateParsingException
+CertificateParsingException ChangeEvent ChangeListener ChangedCharSetException
+Channel ChannelBinding Channels CharArrayReader CharArrayWriter CharBuffer
+CharConversionException CharHolder CharSeqHelper CharSeqHolder CharSequence
+Character CharacterCodingException CharacterData CharacterIterator Charset
+CharsetDecoder CharsetEncoder CharsetProvider Checkbox CheckboxGroup
+CheckboxMenuItem CheckedInputStream CheckedOutputStream Checksum Choice
+ChoiceCallback ChoiceFormat Chromaticity Cipher CipherInputStream
+CipherOutputStream CipherSpi Class ClassCastException ClassCircularityError
+ClassDefinition ClassDesc ClassFileTransformer ClassFormatError ClassLoader
+ClassLoaderRepository ClassLoadingMBean ClassNotFoundException
+ClientRequestInfo ClientRequestInfoOperations ClientRequestInterceptor
+ClientRequestInterceptorOperations Clip Clipboard ClipboardOwner Clob
+CloneNotSupportedException Cloneable Closeable ClosedByInterruptException
+ClosedChannelException ClosedSelectorException CodeSets CodeSigner CodeSource
+Codec CodecFactory CodecFactoryHelper CodecFactoryOperations CodecOperations
+CoderMalfunctionError CoderResult CodingErrorAction CollationElementIterator
+CollationKey Collator Collection CollectionCertStoreParameters Collections
+Color ColorChooserComponentFactory ColorChooserUI ColorConvertOp ColorModel
+ColorSelectionModel ColorSpace ColorSupported ColorType ColorUIResource
+ComboBoxEditor ComboBoxModel ComboBoxUI ComboPopup Comment
+CommunicationException Comparable Comparator CompilationMBean Compiler
+CompletionStatus CompletionStatusHelper Component ComponentAdapter
+ComponentColorModel ComponentEvent ComponentIdHelper ComponentInputMap
+ComponentInputMapUIResource ComponentListener ComponentOrientation
+ComponentSampleModel ComponentUI ComponentView Composite CompositeContext
+CompositeData CompositeDataSupport CompositeName CompositeType CompositeView
+CompoundBorder CompoundControl CompoundEdit CompoundName Compression
+ConcurrentHashMap ConcurrentLinkedQueue ConcurrentMap
+ConcurrentModificationException Condition Configuration ConfigurationException
+ConfirmationCallback ConnectException ConnectIOException Connection
+ConnectionEvent ConnectionEventListener ConnectionPendingException
+ConnectionPoolDataSource ConsoleHandler Constructor Container ContainerAdapter
+ContainerEvent ContainerListener ContainerOrderFocusTraversalPolicy
+ContentHandler ContentHandlerFactory ContentModel Context ContextList
+ContextNotEmptyException ContextualRenderedImageFactory Control ControlFactory
+ControllerEventListener ConvolveOp CookieHandler CookieHolder Copies
+CopiesSupported CopyOnWriteArrayList CopyOnWriteArraySet CountDownLatch
+CounterMonitor CounterMonitorMBean CredentialException
+CredentialExpiredException CredentialNotFoundException CropImageFilter
+CubicCurve2D Currency Current CurrentHelper CurrentHelper CurrentHelper
+CurrentHolder CurrentOperations CurrentOperations CurrentOperations Cursor
+CustomMarshal CustomValue Customizer CyclicBarrier DATA_CONVERSION DESKeySpec
+DESedeKeySpec DGC DHGenParameterSpec DHKey DHParameterSpec DHPrivateKey
+DHPrivateKeySpec DHPublicKey DHPublicKeySpec DISCARDING DOMConfiguration
+DOMError DOMErrorHandler DOMException DOMImplementation DOMImplementationLS
+DOMImplementationList DOMImplementationListImpl DOMImplementationRegistry
+DOMImplementationSource DOMLocator DOMLocator DOMResult DOMSource DOMStringList
+DSAKey DSAKeyPairGenerator DSAParameterSpec DSAParams DSAPrivateKey
+DSAPrivateKeySpec DSAPublicKey DSAPublicKeySpec DTD DTDConstants DTDHandler
+DataBuffer DataBufferByte DataBufferDouble DataBufferFloat DataBufferInt
+DataBufferShort DataBufferUShort DataFlavor DataFormatException DataInput
+DataInputStream DataInputStream DataLine DataOutput DataOutputStream
+DataOutputStream DataSource DataTruncation DatabaseMetaData DatagramChannel
+DatagramPacket DatagramSocket DatagramSocketImpl DatagramSocketImplFactory Date
+Date DateFormat DateFormatSymbols DateFormatter DateTimeAtCompleted
+DateTimeAtCreation DateTimeAtProcessing DateTimeSyntax DebugGraphics
+DecimalFormat DecimalFormatSymbols DeclHandler DefaultBoundedRangeModel
+DefaultButtonModel DefaultCaret DefaultCellEditor DefaultColorSelectionModel
+DefaultComboBoxModel DefaultDesktopManager DefaultEditorKit DefaultFocusManager
+DefaultFocusTraversalPolicy DefaultFormatter DefaultFormatterFactory
+DefaultHandler DefaultHighlighter DefaultKeyboardFocusManager
+DefaultListCellRenderer DefaultListModel DefaultListSelectionModel
+DefaultLoaderRepository DefaultLoaderRepository DefaultMenuLayout
+DefaultMetalTheme DefaultMutableTreeNode DefaultPersistenceDelegate
+DefaultSingleSelectionModel DefaultStyledDocument DefaultTableCellRenderer
+DefaultTableColumnModel DefaultTableModel DefaultTextUI DefaultTreeCellEditor
+DefaultTreeCellRenderer DefaultTreeModel DefaultTreeSelectionModel
+DefinitionKind DefinitionKindHelper Deflater DeflaterOutputStream DelayQueue
+Delayed Delegate Delegate Delegate DelegationPermission Deprecated Descriptor
+DescriptorAccess DescriptorSupport DesignMode DesktopIconUI DesktopManager
+DesktopPaneUI Destination DestroyFailedException Destroyable Dialog Dictionary
+DigestException DigestInputStream DigestOutputStream Dimension Dimension2D
+DimensionUIResource DirContext DirObjectFactory DirStateFactory
+DirectColorModel DirectoryManager DisplayMode DnDConstants Doc DocAttribute
+DocAttributeSet DocFlavor DocPrintJob Document Document DocumentBuilder
+DocumentBuilderFactory DocumentEvent DocumentFilter DocumentFragment
+DocumentHandler DocumentListener DocumentName DocumentParser DocumentType
+Documented DomainCombiner DomainManager DomainManagerOperations Double
+DoubleBuffer DoubleHolder DoubleSeqHelper DoubleSeqHolder DragGestureEvent
+DragGestureListener DragGestureRecognizer DragSource DragSourceAdapter
+DragSourceContext DragSourceDragEvent DragSourceDropEvent DragSourceEvent
+DragSourceListener DragSourceMotionListener Driver DriverManager
+DriverPropertyInfo DropTarget DropTargetAdapter DropTargetContext
+DropTargetDragEvent DropTargetDropEvent DropTargetEvent DropTargetListener
+DuplicateFormatFlagsException DuplicateName DuplicateNameHelper Duration DynAny
+DynAnyFactory DynAnyFactoryHelper DynAnyFactoryOperations DynAnyHelper
+DynAnyOperations DynAnySeqHelper DynArray DynArray DynArrayHelper
+DynArrayOperations DynEnum DynEnum DynEnumHelper DynEnumOperations DynFixed
+DynFixed DynFixedHelper DynFixedOperations DynSequence DynSequence
+DynSequenceHelper DynSequenceOperations DynStruct DynStruct DynStructHelper
+DynStructOperations DynUnion DynUnion DynUnionHelper DynUnionOperations
+DynValue DynValue DynValueBox DynValueBoxOperations DynValueCommon
+DynValueCommonOperations DynValueHelper DynValueOperations
+DynamicImplementation DynamicImplementation DynamicMBean ECField ECFieldF2m
+ECFieldFp ECGenParameterSpec ECKey ECParameterSpec ECPoint ECPrivateKey
+ECPrivateKeySpec ECPublicKey ECPublicKeySpec ENCODING_CDR_ENCAPS EOFException
+EditorKit Element ElementIterator ElementType Ellipse2D EllipticCurve
+EmptyBorder EmptyStackException EncodedKeySpec Encoder Encoding
+EncryptedPrivateKeyInfo Entity EntityReference EntityResolver Enum EnumControl
+EnumMap EnumSet EnumSyntax Enumeration Environment Error ErrorHandler
+ErrorListener ErrorManager EtchedBorder Event EventContext EventDirContext
+EventHandler EventListener EventListenerList EventListenerProxy EventObject
+EventQueue EventSetDescriptor Exception ExceptionDetailMessage
+ExceptionInInitializerError ExceptionList ExceptionListener Exchanger
+ExecutionException Executor ExecutorService Executors ExemptionMechanism
+ExemptionMechanismException ExemptionMechanismSpi ExpandVetoException
+ExportException Expression ExtendedRequest ExtendedResponse Externalizable
+FREE_MEM FactoryConfigurationError FailedLoginException FeatureDescriptor
+Fidelity Field FieldNameHelper FieldPosition FieldView File
+FileCacheImageInputStream FileCacheImageOutputStream FileChannel FileChooserUI
+FileDialog FileFilter FileHandler FileImageInputStream FileImageOutputStream
+FileInputStream FileLock FileLockInterruptionException FileNameMap
+FileNotFoundException FileOutputStream FilePermission FileReader FileSystemView
+FileView FileWriter FilenameFilter Filter FilterInputStream FilterOutputStream
+FilterReader FilterWriter FilteredImageSource FilteredRowSet Finishings
+FixedHeightLayoutCache FixedHolder FlatteningPathIterator FlavorEvent
+FlavorException FlavorListener FlavorMap FlavorTable Float FloatBuffer
+FloatControl FloatHolder FloatSeqHelper FloatSeqHolder FlowLayout FlowView
+FocusAdapter FocusEvent FocusListener FocusManager FocusTraversalPolicy Font
+FontFormatException FontMetrics FontRenderContext FontUIResource
+FormSubmitEvent FormView Format FormatConversionProvider
+FormatFlagsConversionMismatchException FormatMismatch FormatMismatchHelper
+Formattable Formatter Formatter FormatterClosedException ForwardRequest
+ForwardRequest ForwardRequestHelper ForwardRequestHelper Frame Future
+FutureTask GSSContext GSSCredential GSSException GSSManager GSSName
+GZIPInputStream GZIPOutputStream GapContent GarbageCollectorMBean
+GatheringByteChannel GaugeMonitor GaugeMonitorMBean GeneralPath
+GeneralSecurityException GenericArrayType GenericDeclaration
+GenericSignatureFormatError GlyphJustificationInfo GlyphMetrics GlyphVector
+GlyphView GradientPaint GraphicAttribute Graphics Graphics2D
+GraphicsConfigTemplate GraphicsConfiguration GraphicsDevice GraphicsEnvironment
+GrayFilter GregorianCalendar GridBagConstraints GridBagLayout GridLayout Group
+Guard GuardedObject HOLDING HTML HTMLDocument HTMLEditorKit
+HTMLFrameHyperlinkEvent HTMLWriter Handler HandlerBase HandshakeCompletedEvent
+HandshakeCompletedListener HasControls HashAttributeSet HashDocAttributeSet
+HashMap HashPrintJobAttributeSet HashPrintRequestAttributeSet
+HashPrintServiceAttributeSet HashSet Hashtable HeadlessException
+HierarchyBoundsAdapter HierarchyBoundsListener HierarchyEvent HierarchyListener
+Highlighter HostnameVerifier HttpURLConnection HttpsURLConnection
+HyperlinkEvent HyperlinkListener ICC_ColorSpace ICC_Profile ICC_ProfileGray
+ICC_ProfileRGB IDLEntity IDLType IDLTypeHelper IDLTypeOperations
+ID_ASSIGNMENT_POLICY_ID ID_UNIQUENESS_POLICY_ID IIOByteBuffer IIOException
+IIOImage IIOInvalidTreeException IIOMetadata IIOMetadataController
+IIOMetadataFormat IIOMetadataFormatImpl IIOMetadataNode IIOParam
+IIOParamController IIOReadProgressListener IIOReadUpdateListener
+IIOReadWarningListener IIORegistry IIOServiceProvider IIOWriteProgressListener
+IIOWriteWarningListener IMPLICIT_ACTIVATION_POLICY_ID IMP_LIMIT INACTIVE
+INITIALIZE INTERNAL INTF_REPOS INVALID_TRANSACTION INV_FLAG INV_IDENT
+INV_OBJREF INV_POLICY IOException IOR IORHelper IORHolder IORInfo
+IORInfoOperations IORInterceptor IORInterceptorOperations IORInterceptor_3_0
+IORInterceptor_3_0Helper IORInterceptor_3_0Holder IORInterceptor_3_0Operations
+IRObject IRObjectOperations Icon IconUIResource IconView IdAssignmentPolicy
+IdAssignmentPolicyOperations IdAssignmentPolicyValue IdUniquenessPolicy
+IdUniquenessPolicyOperations IdUniquenessPolicyValue IdentifierHelper Identity
+IdentityHashMap IdentityScope IllegalAccessError IllegalAccessException
+IllegalArgumentException IllegalBlockSizeException IllegalBlockingModeException
+IllegalCharsetNameException IllegalClassFormatException
+IllegalComponentStateException IllegalFormatCodePointException
+IllegalFormatConversionException IllegalFormatException
+IllegalFormatFlagsException IllegalFormatPrecisionException
+IllegalFormatWidthException IllegalMonitorStateException
+IllegalPathStateException IllegalSelectorException IllegalStateException
+IllegalThreadStateException Image ImageCapabilities ImageConsumer ImageFilter
+ImageGraphicAttribute ImageIO ImageIcon ImageInputStream ImageInputStreamImpl
+ImageInputStreamSpi ImageObserver ImageOutputStream ImageOutputStreamImpl
+ImageOutputStreamSpi ImageProducer ImageReadParam ImageReader ImageReaderSpi
+ImageReaderWriterSpi ImageTranscoder ImageTranscoderSpi ImageTypeSpecifier
+ImageView ImageWriteParam ImageWriter ImageWriterSpi ImagingOpException
+ImplicitActivationPolicy ImplicitActivationPolicyOperations
+ImplicitActivationPolicyValue IncompatibleClassChangeError
+IncompleteAnnotationError InconsistentTypeCode InconsistentTypeCode
+InconsistentTypeCodeHelper IndexColorModel IndexOutOfBoundsException
+IndexedPropertyChangeEvent IndexedPropertyDescriptor IndirectionException
+Inet4Address Inet6Address InetAddress InetSocketAddress Inflater
+InflaterInputStream InheritableThreadLocal Inherited InitialContext
+InitialContextFactory InitialContextFactoryBuilder InitialDirContext
+InitialLdapContext InlineView InputContext InputEvent InputMap
+InputMapUIResource InputMethod InputMethodContext InputMethodDescriptor
+InputMethodEvent InputMethodHighlight InputMethodListener InputMethodRequests
+InputMismatchException InputSource InputStream InputStream InputStream
+InputStreamReader InputSubset InputVerifier Insets InsetsUIResource
+InstanceAlreadyExistsException InstanceNotFoundException InstantiationError
+InstantiationException Instrument Instrumentation
+InsufficientResourcesException IntBuffer IntHolder Integer IntegerSyntax
+Interceptor InterceptorOperations InternalError InternalFrameAdapter
+InternalFrameEvent InternalFrameFocusTraversalPolicy InternalFrameListener
+InternalFrameUI InternationalFormatter InterruptedException
+InterruptedIOException InterruptedNamingException InterruptibleChannel
+IntrospectionException IntrospectionException Introspector Invalid
+InvalidAddress InvalidAddressHelper InvalidAddressHolder
+InvalidAlgorithmParameterException InvalidApplicationException
+InvalidAttributeIdentifierException InvalidAttributeValueException
+InvalidAttributeValueException InvalidAttributesException InvalidClassException
+InvalidDnDOperationException InvalidKeyException InvalidKeyException
+InvalidKeySpecException InvalidMarkException InvalidMidiDataException
+InvalidName InvalidName InvalidName InvalidNameException InvalidNameHelper
+InvalidNameHelper InvalidNameHolder InvalidObjectException
+InvalidOpenTypeException InvalidParameterException
+InvalidParameterSpecException InvalidPolicy InvalidPolicyHelper
+InvalidPreferencesFormatException InvalidPropertiesFormatException
+InvalidRelationIdException InvalidRelationServiceException
+InvalidRelationTypeException InvalidRoleInfoException InvalidRoleValueException
+InvalidSearchControlsException InvalidSearchFilterException InvalidSeq
+InvalidSlot InvalidSlotHelper InvalidTargetObjectTypeException
+InvalidTransactionException InvalidTypeForEncoding InvalidTypeForEncodingHelper
+InvalidValue InvalidValue InvalidValueHelper InvocationEvent InvocationHandler
+InvocationTargetException InvokeHandler IstringHelper ItemEvent ItemListener
+ItemSelectable Iterable Iterator IvParameterSpec JApplet JButton JCheckBox
+JCheckBoxMenuItem JColorChooser JComboBox JComponent JDesktopPane JDialog
+JEditorPane JFileChooser JFormattedTextField JFrame JInternalFrame JLabel
+JLayeredPane JList JMException JMRuntimeException JMXAuthenticator
+JMXConnectionNotification JMXConnector JMXConnectorFactory JMXConnectorProvider
+JMXConnectorServer JMXConnectorServerFactory JMXConnectorServerMBean
+JMXConnectorServerProvider JMXPrincipal JMXProviderException
+JMXServerErrorException JMXServiceURL JMenu JMenuBar JMenuItem JOptionPane
+JPEGHuffmanTable JPEGImageReadParam JPEGImageWriteParam JPEGQTable JPanel
+JPasswordField JPopupMenu JPopupMenu.Separator JProgressBar JRadioButton
+JRadioButtonMenuItem JRootPane JScrollBar JScrollPane JSeparator JSlider
+JSpinner JSplitPane JTabbedPane JTable JTable.PrintMode JTableHeader JTextArea
+JTextComponent JTextField JTextPane JToggleButton JToolBar JToolBar.Separator
+JToolTip JTree JViewport JWindow JarEntry JarException JarFile JarInputStream
+JarOutputStream JarURLConnection JdbcRowSet JobAttributes JobHoldUntil
+JobImpressions JobImpressionsCompleted JobImpressionsSupported JobKOctets
+JobKOctetsProcessed JobKOctetsSupported JobMediaSheets JobMediaSheetsCompleted
+JobMediaSheetsSupported JobMessageFromOperator JobName JobOriginatingUserName
+JobPriority JobPrioritySupported JobSheets JobState JobStateReason
+JobStateReasons JoinRowSet Joinable KerberosKey KerberosPrincipal
+KerberosTicket Kernel Key KeyAdapter KeyAgreement KeyAgreementSpi
+KeyAlreadyExistsException KeyEvent KeyEventDispatcher KeyEventPostProcessor
+KeyException KeyFactory KeyFactorySpi KeyGenerator KeyGeneratorSpi KeyListener
+KeyManagementException KeyManager KeyManagerFactory KeyManagerFactorySpi
+KeyPair KeyPairGenerator KeyPairGeneratorSpi KeyRep KeyRep.Type KeySpec
+KeyStore KeyStoreBuilderParameters KeyStoreException KeyStoreSpi KeyStroke
+KeyboardFocusManager Keymap LDAPCertStoreParameters LIFESPAN_POLICY_ID
+LOCATION_FORWARD LSInput LSLoadEvent LSOutput LSParser LSParserFilter
+LSProgressEvent LSResourceResolver LSSerializer LSSerializerFilter Label
+LabelUI LabelView LanguageCallback LastOwnerException LayeredHighlighter
+LayeredHighlighter.LayerPainter LayoutFocusTraversalPolicy LayoutManager
+LayoutManager2 LayoutQueue LdapContext LdapName LdapReferralException Lease
+Level LexicalHandler LifespanPolicy LifespanPolicyOperations
+LifespanPolicyValue LimitExceededException Line Line.Info Line2D Line2D.Double
+Line2D.Float LineBorder LineBreakMeasurer LineEvent LineEvent.Type LineListener
+LineMetrics LineNumberInputStream LineNumberReader LineUnavailableException
+LinkException LinkLoopException LinkRef LinkageError LinkedBlockingQueue
+LinkedHashMap LinkedHashSet LinkedList List List ListCellRenderer ListDataEvent
+ListDataListener ListIterator ListModel ListResourceBundle ListSelectionEvent
+ListSelectionListener ListSelectionModel ListUI ListView
+ListenerNotFoundException LoaderHandler LocalObject Locale LocateRegistry
+Locator LocatorImpl Lock LockSupport LogManager LogRecord LogStream Logger
+LoggingPermission LoginContext LoginException LoginModule Long LongBuffer
+LongHolder LongLongSeqHelper LongLongSeqHolder LongSeqHelper LongSeqHolder
+LookAndFeel LookupOp LookupTable MARSHAL MBeanAttributeInfo
+MBeanConstructorInfo MBeanException MBeanFeatureInfo MBeanInfo
+MBeanNotificationInfo MBeanOperationInfo MBeanParameterInfo MBeanPermission
+MBeanRegistration MBeanRegistrationException MBeanServer MBeanServerBuilder
+MBeanServerConnection MBeanServerDelegate MBeanServerDelegateMBean
+MBeanServerFactory MBeanServerForwarder MBeanServerInvocationHandler
+MBeanServerNotification MBeanServerNotificationFilter MBeanServerPermission
+MBeanTrustPermission MGF1ParameterSpec MLet MLetMBean Mac MacSpi
+MalformedInputException MalformedLinkException MalformedObjectNameException
+MalformedParameterizedTypeException MalformedURLException ManageReferralControl
+ManagementFactory ManagementPermission ManagerFactoryParameters Manifest Map
+Map.Entry MappedByteBuffer MarshalException MarshalledObject MaskFormatter
+MatchResult Matcher Math MathContext MatteBorder Media MediaName
+MediaPrintableArea MediaSize MediaSize.Engineering MediaSize.ISO MediaSize.JIS
+MediaSize.NA MediaSize.Other MediaSizeName MediaTracker MediaTray Member
+MemoryCacheImageInputStream MemoryCacheImageOutputStream MemoryHandler
+MemoryImageSource MemoryMBean MemoryManagerMBean MemoryNotification
+MemoryPoolMBean MemoryType MemoryUsage Menu MenuBar MenuBarUI MenuComponent
+MenuContainer MenuDragMouseEvent MenuDragMouseListener MenuElement MenuEvent
+MenuItem MenuItemUI MenuKeyEvent MenuKeyListener MenuListener
+MenuSelectionManager MenuShortcut MessageDigest MessageDigestSpi MessageFormat
+MessageFormat.Field MessageProp MetaEventListener MetaMessage MetalBorders
+MetalButtonUI MetalCheckBoxIcon MetalCheckBoxUI MetalComboBoxButton
+MetalComboBoxEditor MetalComboBoxEditor.UIResource MetalComboBoxIcon
+MetalComboBoxUI MetalDesktopIconUI MetalFileChooserUI MetalIconFactory
+MetalInternalFrameTitlePane MetalInternalFrameUI MetalLabelUI MetalLookAndFeel
+MetalMenuBarUI MetalPopupMenuSeparatorUI MetalProgressBarUI MetalRadioButtonUI
+MetalRootPaneUI MetalScrollBarUI MetalScrollButton MetalScrollPaneUI
+MetalSeparatorUI MetalSliderUI MetalSplitPaneUI MetalTabbedPaneUI
+MetalTextFieldUI MetalTheme MetalToggleButtonUI MetalToolBarUI MetalToolTipUI
+MetalTreeUI Method MethodDescriptor MidiChannel MidiDevice MidiDevice.Info
+MidiDeviceProvider MidiEvent MidiFileFormat MidiFileReader MidiFileWriter
+MidiMessage MidiSystem MidiUnavailableException MimeTypeParseException
+MinimalHTMLWriter MissingFormatArgumentException MissingFormatWidthException
+MissingResourceException Mixer Mixer.Info MixerProvider ModelMBean
+ModelMBeanAttributeInfo ModelMBeanConstructorInfo ModelMBeanInfo
+ModelMBeanInfoSupport ModelMBeanNotificationBroadcaster
+ModelMBeanNotificationInfo ModelMBeanOperationInfo ModificationItem Modifier
+Monitor MonitorMBean MonitorNotification MonitorSettingException MouseAdapter
+MouseDragGestureRecognizer MouseEvent MouseInfo MouseInputAdapter
+MouseInputListener MouseListener MouseMotionAdapter MouseMotionListener
+MouseWheelEvent MouseWheelListener MultiButtonUI MultiColorChooserUI
+MultiComboBoxUI MultiDesktopIconUI MultiDesktopPaneUI MultiDoc MultiDocPrintJob
+MultiDocPrintService MultiFileChooserUI MultiInternalFrameUI MultiLabelUI
+MultiListUI MultiLookAndFeel MultiMenuBarUI MultiMenuItemUI MultiOptionPaneUI
+MultiPanelUI MultiPixelPackedSampleModel MultiPopupMenuUI MultiProgressBarUI
+MultiRootPaneUI MultiScrollBarUI MultiScrollPaneUI MultiSeparatorUI
+MultiSliderUI MultiSpinnerUI MultiSplitPaneUI MultiTabbedPaneUI
+MultiTableHeaderUI MultiTableUI MultiTextUI MultiToolBarUI MultiToolTipUI
+MultiTreeUI MultiViewportUI MulticastSocket MultipleComponentProfileHelper
+MultipleComponentProfileHolder MultipleDocumentHandling MultipleMaster
+MutableAttributeSet MutableComboBoxModel MutableTreeNode NON_EXISTENT
+NO_IMPLEMENT NO_MEMORY NO_PERMISSION NO_RESOURCES NO_RESPONSE NVList Name
+NameAlreadyBoundException NameCallback NameClassPair NameComponent
+NameComponentHelper NameComponentHolder NameDynAnyPair NameDynAnyPairHelper
+NameDynAnyPairSeqHelper NameHelper NameHolder NameList NameNotFoundException
+NameParser NameValuePair NameValuePair NameValuePairHelper NameValuePairHelper
+NameValuePairSeqHelper NamedNodeMap NamedValue NamespaceChangeListener
+NamespaceContext NamespaceSupport Naming NamingContext NamingContextExt
+NamingContextExtHelper NamingContextExtHolder NamingContextExtOperations
+NamingContextExtPOA NamingContextHelper NamingContextHolder
+NamingContextOperations NamingContextPOA NamingEnumeration NamingEvent
+NamingException NamingExceptionEvent NamingListener NamingManager
+NamingSecurityException NavigationFilter NavigationFilter.FilterBypass
+NegativeArraySizeException NetPermission NetworkInterface NoClassDefFoundError
+NoConnectionPendingException NoContext NoContextHelper
+NoInitialContextException NoPermissionException NoRouteToHostException
+NoServant NoServantHelper NoSuchAlgorithmException NoSuchAttributeException
+NoSuchElementException NoSuchFieldError NoSuchFieldException NoSuchMethodError
+NoSuchMethodException NoSuchObjectException NoSuchPaddingException
+NoSuchProviderException Node NodeChangeEvent NodeChangeListener NodeList
+NonReadableChannelException NonWritableChannelException
+NoninvertibleTransformException NotActiveException NotBoundException
+NotCompliantMBeanException NotContextException NotEmpty NotEmptyHelper
+NotEmptyHolder NotFound NotFoundHelper NotFoundHolder NotFoundReason
+NotFoundReasonHelper NotFoundReasonHolder NotOwnerException
+NotSerializableException NotYetBoundException NotYetConnectedException Notation
+Notification NotificationBroadcaster NotificationBroadcasterSupport
+NotificationEmitter NotificationFilter NotificationFilterSupport
+NotificationListener NotificationResult NullCipher NullPointerException Number
+NumberFormat NumberFormat.Field NumberFormatException NumberFormatter
+NumberOfDocuments NumberOfInterveningJobs NumberUp NumberUpSupported
+NumericShaper OAEPParameterSpec OBJECT_NOT_EXIST OBJ_ADAPTER OMGVMCID ORB ORB
+ORBIdHelper ORBInitInfo ORBInitInfoOperations ORBInitializer
+ORBInitializerOperations ObjID Object Object ObjectAlreadyActive
+ObjectAlreadyActiveHelper ObjectChangeListener ObjectFactory
+ObjectFactoryBuilder ObjectHelper ObjectHolder ObjectIdHelper ObjectIdHelper
+ObjectImpl ObjectImpl ObjectInput ObjectInputStream ObjectInputStream.GetField
+ObjectInputValidation ObjectInstance ObjectName ObjectNotActive
+ObjectNotActiveHelper ObjectOutput ObjectOutputStream
+ObjectOutputStream.PutField ObjectReferenceFactory ObjectReferenceFactoryHelper
+ObjectReferenceFactoryHolder ObjectReferenceTemplate
+ObjectReferenceTemplateHelper ObjectReferenceTemplateHolder
+ObjectReferenceTemplateSeqHelper ObjectReferenceTemplateSeqHolder
+ObjectStreamClass ObjectStreamConstants ObjectStreamException ObjectStreamField
+ObjectView Observable Observer OctetSeqHelper OctetSeqHolder Oid
+OpenDataException OpenMBeanAttributeInfo OpenMBeanAttributeInfoSupport
+OpenMBeanConstructorInfo OpenMBeanConstructorInfoSupport OpenMBeanInfo
+OpenMBeanInfoSupport OpenMBeanOperationInfo OpenMBeanOperationInfoSupport
+OpenMBeanParameterInfo OpenMBeanParameterInfoSupport OpenType OpenType
+OperatingSystemMBean Operation OperationNotSupportedException
+OperationsException Option OptionPaneUI OptionalDataException
+OrientationRequested OutOfMemoryError OutputDeviceAssigned OutputKeys
+OutputStream OutputStream OutputStream OutputStreamWriter
+OverlappingFileLockException OverlayLayout Overrides Owner PBEKey PBEKeySpec
+PBEParameterSpec PDLOverrideSupported PERSIST_STORE PKCS8EncodedKeySpec
+PKIXBuilderParameters PKIXCertPathBuilderResult PKIXCertPathChecker
+PKIXCertPathValidatorResult PKIXParameters POA POAHelper POAManager
+POAManagerOperations POAOperations PRIVATE_MEMBER PSSParameterSpec PSource
+PSource.PSpecified PUBLIC_MEMBER Pack200 Package PackedColorModel
+PageAttributes PageFormat PageRanges Pageable PagedResultsControl
+PagedResultsResponseControl PagesPerMinute PagesPerMinuteColor Paint
+PaintContext PaintEvent Panel PanelUI Paper ParagraphView ParagraphView
+Parameter ParameterBlock ParameterDescriptor ParameterMetaData ParameterMode
+ParameterModeHelper ParameterModeHolder ParameterizedType ParseException
+ParsePosition Parser Parser ParserAdapter ParserConfigurationException
+ParserDelegator ParserFactory PartialResultException PasswordAuthentication
+PasswordCallback PasswordView Patch PathIterator Pattern PatternSyntaxException
+Permission Permission PermissionCollection Permissions PersistenceDelegate
+PersistentMBean PhantomReference Pipe Pipe.SinkChannel Pipe.SourceChannel
+PipedInputStream PipedOutputStream PipedReader PipedWriter PixelGrabber
+PixelInterleavedSampleModel PlainDocument PlainView Point Point2D
+Point2D.Double Point2D.Float PointerInfo Policy Policy Policy PolicyError
+PolicyErrorCodeHelper PolicyErrorHelper PolicyErrorHolder PolicyFactory
+PolicyFactoryOperations PolicyHelper PolicyHolder PolicyListHelper
+PolicyListHolder PolicyNode PolicyOperations PolicyQualifierInfo
+PolicyTypeHelper Polygon PooledConnection Popup PopupFactory PopupMenu
+PopupMenuEvent PopupMenuListener PopupMenuUI Port Port.Info
+PortUnreachableException PortableRemoteObject PortableRemoteObjectDelegate
+Position Position.Bias Predicate PreferenceChangeEvent PreferenceChangeListener
+Preferences PreferencesFactory PreparedStatement PresentationDirection
+Principal Principal PrincipalHolder PrintEvent PrintException PrintGraphics
+PrintJob PrintJobAdapter PrintJobAttribute PrintJobAttributeEvent
+PrintJobAttributeListener PrintJobAttributeSet PrintJobEvent PrintJobListener
+PrintQuality PrintRequestAttribute PrintRequestAttributeSet PrintService
+PrintServiceAttribute PrintServiceAttributeEvent PrintServiceAttributeListener
+PrintServiceAttributeSet PrintServiceLookup PrintStream PrintWriter Printable
+PrinterAbortException PrinterException PrinterGraphics PrinterIOException
+PrinterInfo PrinterIsAcceptingJobs PrinterJob PrinterLocation
+PrinterMakeAndModel PrinterMessageFromOperator PrinterMoreInfo
+PrinterMoreInfoManufacturer PrinterName PrinterResolution PrinterState
+PrinterStateReason PrinterStateReasons PrinterURI PriorityBlockingQueue
+PriorityQueue PrivateClassLoader PrivateCredentialPermission PrivateKey
+PrivateMLet PrivilegedAction PrivilegedActionException
+PrivilegedExceptionAction PrivilegedFutureTask Process ProcessBuilder
+ProcessingInstruction ProfileDataException ProfileIdHelper ProgressBarUI
+ProgressMonitor ProgressMonitorInputStream Properties PropertyChangeEvent
+PropertyChangeListener PropertyChangeListenerProxy PropertyChangeSupport
+PropertyDescriptor PropertyEditor PropertyEditorManager PropertyEditorSupport
+PropertyPermission PropertyResourceBundle PropertyVetoException
+ProtectionDomain ProtocolException Provider Provider.Service ProviderException
+Proxy Proxy Proxy.Type ProxySelector PublicKey PushbackInputStream
+PushbackReader QName QuadCurve2D QuadCurve2D.Double QuadCurve2D.Float Query
+QueryEval QueryExp Queue QueuedJobCount RC2ParameterSpec RC5ParameterSpec
+REQUEST_PROCESSING_POLICY_ID RGBImageFilter RMIClassLoader RMIClassLoaderSpi
+RMIClientSocketFactory RMIConnection RMIConnectionImpl RMIConnector
+RMIConnectorServer RMICustomMaxStreamFormat RMIFailureHandler RMIIIOPServerImpl
+RMIJRMPServerImpl RMISecurityException RMISecurityManager RMIServer
+RMIServerImpl RMIServerSocketFactory RMISocketFactory RSAKey
+RSAKeyGenParameterSpec RSAMultiPrimePrivateCrtKey
+RSAMultiPrimePrivateCrtKeySpec RSAOtherPrimeInfo RSAPrivateCrtKey
+RSAPrivateCrtKeySpec RSAPrivateKey RSAPrivateKeySpec RSAPublicKey
+RSAPublicKeySpec RTFEditorKit Random RandomAccess RandomAccessFile Raster
+RasterFormatException RasterOp Rdn ReadOnlyBufferException ReadWriteLock
+Readable ReadableByteChannel Reader RealmCallback RealmChoiceCallback Receiver
+Rectangle Rectangle2D Rectangle2D.Double Rectangle2D.Float RectangularShape
+ReentrantLock ReentrantLock.ConditionObject ReentrantReadWriteLock
+ReentrantReadWriteLock.WriterConditionObject Ref RefAddr Reference Reference
+ReferenceQueue ReferenceUriSchemesSupported Referenceable ReferralException
+ReflectPermission ReflectionException RefreshFailedException Refreshable Region
+RegisterableService Registry RegistryHandler RejectedExecutionException
+RejectedExecutionHandler Relation RelationException RelationNotFoundException
+RelationNotification RelationService RelationServiceMBean
+RelationServiceNotRegisteredException RelationSupport RelationSupportMBean
+RelationType RelationTypeNotFoundException RelationTypeSupport
+RemarshalException Remote RemoteCall RemoteException RemoteObject
+RemoteObjectInvocationHandler RemoteRef RemoteServer RemoteStub RenderContext
+RenderableImage RenderableImageOp RenderableImageProducer RenderedImage
+RenderedImageFactory Renderer RenderingHints RenderingHints.Key RepaintManager
+ReplicateScaleFilter RepositoryIdHelper Request RequestInfo
+RequestInfoOperations RequestProcessingPolicy RequestProcessingPolicyOperations
+RequestProcessingPolicyValue RequestingUserName RequiredModelMBean RescaleOp
+ResolutionSyntax ResolveResult Resolver ResourceBundle ResponseCache
+ResponseHandler Result ResultSet ResultSetMetaData Retention RetentionPolicy
+ReverbType Robot Role RoleInfo RoleInfoNotFoundException RoleList
+RoleNotFoundException RoleResult RoleStatus RoleUnresolved RoleUnresolvedList
+RootPaneContainer RootPaneUI RoundRectangle2D RoundRectangle2D.Double
+RoundRectangle2D.Float RoundingMode RowMapper RowSet RowSetEvent RowSetInternal
+RowSetListener RowSetMetaData RowSetMetaDataImpl RowSetReader RowSetWarning
+RowSetWriter RuleBasedCollator RunTime RunTimeOperations Runnable Runtime
+RuntimeErrorException RuntimeException RuntimeMBean RuntimeMBeanException
+RuntimeOperationsException RuntimePermission SAXException
+SAXNotRecognizedException SAXNotSupportedException SAXParseException SAXParser
+SAXParserFactory SAXResult SAXSource SAXTransformerFactory
+SERVANT_RETENTION_POLICY_ID SQLData SQLException SQLInput SQLInputImpl
+SQLOutput SQLOutputImpl SQLPermission SQLWarning SSLContext SSLContextSpi
+SSLEngine SSLEngineResult SSLEngineResult.HandshakeStatus
+SSLEngineResult.Status SSLException SSLHandshakeException SSLKeyException
+SSLPeerUnverifiedException SSLPermission SSLProtocolException SSLServerSocket
+SSLServerSocketFactory SSLSession SSLSessionBindingEvent
+SSLSessionBindingListener SSLSessionContext SSLSocket SSLSocketFactory
+SUCCESSFUL SYNC_WITH_TRANSPORT SYSTEM_EXCEPTION SampleModel Sasl SaslClient
+SaslClientFactory SaslException SaslServer SaslServerFactory Savepoint Scanner
+ScatteringByteChannel ScheduledCancellable ScheduledExecutor ScheduledFuture
+Schema SchemaFactory SchemaFactoryFinder SchemaFactoryLoader
+SchemaViolationException ScrollBarUI ScrollPane ScrollPaneAdjustable
+ScrollPaneConstants ScrollPaneLayout ScrollPaneLayout.UIResource ScrollPaneUI
+Scrollable Scrollbar SealedObject SearchControls SearchResult SecretKey
+SecretKeyFactory SecretKeyFactorySpi SecretKeySpec SecureCacheResponse
+SecureClassLoader SecureProcessing SecureRandom SecureRandomSpi Security
+SecurityException SecurityManager SecurityPermission Segment SelectableChannel
+SelectionKey Selector SelectorProvider Semaphore SeparatorUI Sequence
+SequenceInputStream Sequencer Sequencer.SyncMode SerialArray SerialBlob
+SerialClob SerialDatalink SerialException SerialJavaObject SerialRef
+SerialStruct Serializable SerializablePermission Servant ServantActivator
+ServantActivatorHelper ServantActivatorOperations ServantActivatorPOA
+ServantAlreadyActive ServantAlreadyActiveHelper ServantLocator
+ServantLocatorHelper ServantLocatorOperations ServantLocatorPOA ServantManager
+ServantManagerOperations ServantNotActive ServantNotActiveHelper ServantObject
+ServantRetentionPolicy ServantRetentionPolicyOperations
+ServantRetentionPolicyValue ServerCloneException ServerError ServerException
+ServerIdHelper ServerNotActiveException ServerRef ServerRequest
+ServerRequestInfo ServerRequestInfoOperations ServerRequestInterceptor
+ServerRequestInterceptorOperations ServerRuntimeException ServerSocket
+ServerSocketChannel ServerSocketFactory ServiceContext ServiceContextHelper
+ServiceContextHolder ServiceContextListHelper ServiceContextListHolder
+ServiceDetail ServiceDetailHelper ServiceIdHelper ServiceInformation
+ServiceInformationHelper ServiceInformationHolder ServiceNotFoundException
+ServicePermission ServiceRegistry ServiceRegistry.Filter ServiceUI
+ServiceUIFactory ServiceUnavailableException Set SetOfIntegerSyntax
+SetOverrideType SetOverrideTypeHelper Severity Shape ShapeGraphicAttribute
+SheetCollate Short ShortBuffer ShortBufferException ShortHolder
+ShortLookupTable ShortMessage ShortSeqHelper ShortSeqHolder Sides Signature
+SignatureException SignatureSpi SignedObject Signer SimpleAttributeSet
+SimpleBeanInfo SimpleDateFormat SimpleDoc SimpleFormatter SimpleTimeZone
+SimpleType SinglePixelPackedSampleModel SingleSelectionModel Size2DSyntax
+SizeLimitExceededException SizeRequirements SizeSequence Skeleton
+SkeletonMismatchException SkeletonNotFoundException SliderUI Socket
+SocketAddress SocketChannel SocketException SocketFactory SocketHandler
+SocketImpl SocketImplFactory SocketOptions SocketPermission
+SocketSecurityException SocketTimeoutException SoftBevelBorder SoftReference
+SortControl SortKey SortResponseControl SortedMap SortedSet
+SortingFocusTraversalPolicy Soundbank SoundbankReader SoundbankResource Source
+SourceDataLine SourceLocator SpinnerDateModel SpinnerListModel SpinnerModel
+SpinnerNumberModel SpinnerUI SplitPaneUI Spring SpringLayout
+SpringLayout.Constraints Stack StackOverflowError StackTraceElement
+StandardMBean StartTlsRequest StartTlsResponse State StateEdit StateEditable
+StateFactory Statement Statement StreamCorruptedException StreamHandler
+StreamPrintService StreamPrintServiceFactory StreamResult StreamSource
+StreamTokenizer Streamable StreamableValue StrictMath String StringBuffer
+StringBufferInputStream StringBuilder StringCharacterIterator StringContent
+StringHolder StringIndexOutOfBoundsException StringMonitor StringMonitorMBean
+StringNameHelper StringReader StringRefAddr StringSelection StringSeqHelper
+StringSeqHolder StringTokenizer StringValueExp StringValueHelper StringWriter
+Stroke Struct StructMember StructMemberHelper Stub StubDelegate
+StubNotFoundException Style StyleConstants StyleContext StyleSheet
+StyleSheet.BoxPainter StyleSheet.ListPainter StyledDocument StyledEditorKit
+Subject SubjectDelegationPermission SubjectDomainCombiner
+SupportedValuesAttribute SwingConstants SwingPropertyChangeSupport
+SwingUtilities SyncFactory SyncFactoryException SyncFailedException
+SyncProvider SyncProviderException SyncResolver SyncScopeHelper
+SynchronousQueue SynthConstants SynthContext SynthGraphicsUtils
+SynthLookAndFeel SynthPainter SynthStyle SynthStyleFactory Synthesizer
+SysexMessage System SystemColor SystemException SystemFlavorMap
+TAG_ALTERNATE_IIOP_ADDRESS TAG_CODE_SETS TAG_INTERNET_IOP TAG_JAVA_CODEBASE
+TAG_MULTIPLE_COMPONENTS TAG_ORB_TYPE TAG_POLICIES
+TAG_RMI_CUSTOM_MAX_STREAM_FORMAT TCKind THREAD_POLICY_ID TRANSACTION_REQUIRED
+TRANSACTION_ROLLEDBACK TRANSIENT TRANSPORT_RETRY TabExpander TabSet TabStop
+TabableView TabbedPaneUI TableCellEditor TableCellRenderer TableColumn
+TableColumnModel TableColumnModelEvent TableColumnModelListener TableHeaderUI
+TableModel TableModelEvent TableModelListener TableUI TableView TabularData
+TabularDataSupport TabularType TagElement TaggedComponent TaggedComponentHelper
+TaggedComponentHolder TaggedProfile TaggedProfileHelper TaggedProfileHolder
+Target TargetDataLine TargetedNotification Templates TemplatesHandler Text
+TextAction TextArea TextAttribute TextComponent TextEvent TextField TextHitInfo
+TextInputCallback TextLayout TextLayout.CaretPolicy TextListener TextMeasurer
+TextOutputCallback TextSyntax TextUI TexturePaint Thread
+Thread.UncaughtExceptionHandler ThreadDeath ThreadFactory ThreadGroup
+ThreadInfo ThreadLocal ThreadMBean ThreadPolicy ThreadPolicyOperations
+ThreadPolicyValue ThreadPoolExecutor ThreadPoolExecutor.AbortPolicy
+ThreadPoolExecutor.CallerRunsPolicy ThreadPoolExecutor.DiscardOldestPolicy
+ThreadPoolExecutor.DiscardPolicy ThreadState Throwable Tie TileObserver Time
+TimeLimitExceededException TimeUnit TimeZone TimeoutException Timer Timer Timer
+TimerAlarmClockNotification TimerMBean TimerNotification TimerTask Timestamp
+Timestamp TitledBorder TooManyListenersException ToolBarUI ToolTipManager
+ToolTipUI Toolkit Track TransactionRequiredException
+TransactionRolledbackException TransactionService TransactionalWriter
+TransferHandler Transferable TransformAttribute Transformer
+TransformerConfigurationException TransformerException TransformerFactory
+TransformerFactoryConfigurationError TransformerHandler Transmitter
+Transparency TreeCellEditor TreeCellRenderer TreeExpansionEvent
+TreeExpansionListener TreeMap TreeModel TreeModelEvent TreeModelListener
+TreeNode TreePath TreeSelectionEvent TreeSelectionListener TreeSelectionModel
+TreeSet TreeUI TreeWillExpandListener TrustAnchor TrustManager
+TrustManagerFactory TrustManagerFactorySpi Type TypeCode TypeCodeHolder
+TypeInfo TypeInfoProvider TypeMismatch TypeMismatch TypeMismatch
+TypeMismatchHelper TypeMismatchHelper TypeNotPresentException TypeVariable
+Types UID UIDefaults UIDefaults.ActiveValue UIDefaults.LazyInputMap
+UIDefaults.LazyValue UIDefaults.ProxyLazyValue UIManager
+UIManager.LookAndFeelInfo UIResource ULongLongSeqHelper ULongLongSeqHolder
+ULongSeqHelper ULongSeqHolder UNKNOWN UNKNOWN UNSUPPORTED_POLICY
+UNSUPPORTED_POLICY_VALUE URI URIException URIResolver URISyntax
+URISyntaxException URL URLClassLoader URLConnection URLDecoder URLEncoder
+URLStreamHandler URLStreamHandlerFactory URLStringHelper USER_EXCEPTION
+UShortSeqHelper UShortSeqHolder UTFDataFormatException UUID
+UndeclaredThrowableException UndoManager UndoableEdit UndoableEditEvent
+UndoableEditListener UndoableEditSupport UnexpectedException
+UnicastRemoteObject UnionMember UnionMemberHelper UnknownEncoding
+UnknownEncodingHelper UnknownError UnknownException
+UnknownFormatConversionException UnknownFormatFlagsException
+UnknownGroupException UnknownHostException UnknownHostException
+UnknownObjectException UnknownServiceException UnknownUserException
+UnknownUserExceptionHelper UnknownUserExceptionHolder
+UnmappableCharacterException UnmarshalException UnmodifiableSetException
+UnrecoverableEntryException UnrecoverableKeyException Unreferenced
+UnresolvedAddressException UnresolvedPermission UnsatisfiedLinkError
+UnsolicitedNotification UnsolicitedNotificationEvent
+UnsolicitedNotificationListener UnsupportedAddressTypeException
+UnsupportedAudioFileException UnsupportedCallbackException
+UnsupportedCharsetException UnsupportedClassVersionError
+UnsupportedEncodingException UnsupportedFlavorException
+UnsupportedLookAndFeelException UnsupportedOperationException UserDataHandler
+UserException Util UtilDelegate Utilities VMID VM_ABSTRACT VM_CUSTOM VM_NONE
+VM_TRUNCATABLE Validator ValidatorHandler ValueBase ValueBaseHelper
+ValueBaseHolder ValueExp ValueFactory ValueHandler ValueHandlerMultiFormat
+ValueInputStream ValueMember ValueMemberHelper ValueOutputStream
+VariableHeightLayoutCache Vector VerifyError Version VersionImpl
+VersionSpecHelper VetoableChangeListener VetoableChangeListenerProxy
+VetoableChangeSupport View ViewFactory ViewportLayout ViewportUI
+VirtualMachineError Visibility VisibilityHelper VoiceStatus Void VolatileImage
+WCharSeqHelper WCharSeqHolder WStringSeqHelper WStringSeqHolder
+WStringValueHelper WeakHashMap WeakReference WebRowSet WildcardType Window
+WindowAdapter WindowConstants WindowEvent WindowFocusListener WindowListener
+WindowStateListener WrappedPlainView WritableByteChannel WritableRaster
+WritableRenderedImage WriteAbortedException Writer WrongAdapter
+WrongAdapterHelper WrongPolicy WrongPolicyHelper WrongTransaction
+WrongTransactionHelper WrongTransactionHolder X500Principal
+X500PrivateCredential X509CRL X509CRLEntry X509CRLSelector X509CertSelector
+X509Certificate X509Certificate X509EncodedKeySpec X509Extension X509KeyManager
+X509TrustManager XAConnection XADataSource XAException XAResource XMLConstants
+XMLDecoder XMLEncoder XMLFilter XMLFilterImpl XMLFormatter XMLGregorianCalendar
+XMLParseException XMLReader XMLReaderAdapter XMLReaderFactory XMLUtils XPath
+XPathConstants XPathException XPathExpression XPathExpressionException
+XPathFactory XPathFactoryConfigurationException XPathFunction
+XPathFunctionException XPathFunctionResolver XPathVariableResolver Xid
+XmlReader XmlWriter ZipEntry ZipException ZipFile ZipInputStream
+ZipOutputStream ZoneView
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=//
+
+$ML_COMMENT=/* */
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\u\d{4}|\\x?\d{3}|\\\w|\\[\'\\\"])
+
+$REFORMATTING=true
+
+$SYMBOLS= ( ) [ ] { } , ; . : & | < > ! = / * % + -
+
+//$ALLOWNESTEDCOMMENTS=true
diff --git a/support/highlight/langDefs/js.lang b/support/highlight/langDefs/js.lang
new file mode 100644
index 0000000000..e74161435f
--- /dev/null
+++ b/support/highlight/langDefs/js.lang
@@ -0,0 +1,40 @@
+# Javascript language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 26.1.2002
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Javascript
+
+$KEYWORDS(kwa)= abstract break class const continue debugger default
+delete enum export extends finally instanceof import implements in goto
+native package private protected public super throw throws transient
+typeof void false with for this switch try while if do else return null case catch true
+ new prototype var function
+
+$KEYWORDS(kwb)= boolean byte char double float int long short static
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$SL_COMMENT= //
+
+$ML_COMMENT= /* */
+
+$STRINGDELIMITERS= " '
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + - .
diff --git a/support/highlight/langDefs/jsp.lang b/support/highlight/langDefs/jsp.lang
new file mode 100644
index 0000000000..4915f80671
--- /dev/null
+++ b/support/highlight/langDefs/jsp.lang
@@ -0,0 +1,31 @@
+# JSP 2.0 language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 19.9.2003
+# 28.01.2008 Replaced KW_DELIM entry by regexes (ASim)
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=JSP
+
+$INCLUDE=java
+
+#$STRINGDELIMITERS=" '
+
+#$KEYWORDS(kwa)=regex(<!?\/?\w+>?|>)
+#$KEYWORDS(kwb)=regex(([-\w]+)=")
+#$KEYWORDS(kwc)=regex(\&\#?\w+;)
+
+#$ML_COMMENT=<%-- --%>
+
+#$IGNORECASE=false
diff --git a/support/highlight/langDefs/lbn.lang b/support/highlight/langDefs/lbn.lang
new file mode 100644
index 0000000000..4f313b164b
--- /dev/null
+++ b/support/highlight/langDefs/lbn.lang
@@ -0,0 +1,40 @@
+# Luban language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 14.02.2005
+# ---------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Luban
+
+$KEYWORDS(kwa)=as break continue else finish for foreach if implements in input isa
+namespace output static store struct typedef wait waitfor while println
+
+
+$KEYWORDS(kwb)=bool char string vector map set null error enum range int double
+
+$KEYWORDS(kwc)=true false and or not
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=//
+
+$ML_COMMENT=/* */
+
+$ALLOWNESTEDCOMMENTS=false
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; . : & | < > ! = / * % + - ~
diff --git a/support/highlight/langDefs/ldif.lang b/support/highlight/langDefs/ldif.lang
new file mode 100644
index 0000000000..f485b7fd25
--- /dev/null
+++ b/support/highlight/langDefs/ldif.lang
@@ -0,0 +1,41 @@
+# LDAP LDIF Script language definition file
+#
+# Author: André Simon
+# Mail: andre.simon1@gmx.de
+# Date: 28.06.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http://www.andre-simon.de/
+
+$DESCRIPTION=LDAP
+
+$KEYWORDS(kwa)=binary businesscategory
+carlicense changetype cn commonname departmentnumber description dn
+employeenumber employeetype facsimiletelephonenumber givenname homephone homepostaladdress initials internationalisdnnumber
+jpegphoto l labeleduri locality mail mailalternateaddress maildeliveryoption mailhost manager mobile objectclass
+pager photo postofficebox preferreddeliverymethod preferredlanguage physicaldeliveryofficename postaladdress postalcode
+registeredaddress roleoccupant roomnumber secretary seealso sn st street surname telephonenumber title
+uid userpassword usercertificate usercertificate usersmimecertificate x500uniqueidentifier add c
+dc delete modify o ou crypt inetorgperson mailrecipient nslicenseuser organizationalperson organizationalrole residentialperson
+person sha top nsserversecurity nsserverid nsbinddn nsbasedn serverroot nsserverport
+nssecureserverport serverproductname serverversionnumber installationtimestamp installationtimestamp serverhostname
+nstasklabel creatorsname modifiersname createtimestamp modifytimestamp nsuniqueid aci uniquemember passwordExpirationTime nsAdminDomainName
+nshardwareplatform nsosversion nsproductname nsproductversion nsnickname nsbuildnumber nsvendor nsinstalledlocation nsdirectoryinforef nsclassname nsexecref nsmerge
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=#
+
+$IGNORECASE=true
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
+
+
diff --git a/support/highlight/langDefs/lgt.lang b/support/highlight/langDefs/lgt.lang
new file mode 100644
index 0000000000..bd7fd4c154
--- /dev/null
+++ b/support/highlight/langDefs/lgt.lang
@@ -0,0 +1,141 @@
+# Logtalk language definition file
+#
+# http://logtalk.org/
+#
+# Author: Paulo Moura
+# Mail: pmoura@logtalk.org
+# Date: 25.10.09
+# Version: 1.5
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+
+$DESCRIPTION=Logtalk
+
+# variables
+$KEYWORDS(kwb)=regex((?<!0')[A-Z_]\w*)
+
+# conditional compilation directives
+$KEYWORDS(kwa)=regex(^\s*:-\s((el)?if)(?=[(]), 1)
+$KEYWORDS(kwa)=regex(^\s*:-\s(e(lse|ndif))(?=\.), 1)
+
+# encapsulation directives
+$KEYWORDS(kwa)=regex(^\s*:-\s(category|protocol|object)(?=[(]), 1)
+$KEYWORDS(kwa)=regex(^\s+((extend|i(mp(or|lemen)t|nstantiate)|specialize)s)(?=[(]), 1)
+$KEYWORDS(kwa)=regex(^\s*:-\s(end_(protocol|category|object))(?=\.), 1)
+
+# entity and predicate directives
+$KEYWORDS(kwa)=regex(^\s*:-\s(calls|public|protected|private|encoding|ensure_loaded|export|info|initialization|alias|dynamic|discontiguous|meta_predicate|mode|module|multifile|reexport|set_logtalk_flag|set_prolog_flag|synchronized|op|uses|use_module)(?=[(]), 1)
+$KEYWORDS(kwa)=regex(^\s*:-\s(dynamic|synchronized|threaded)(?=\.), 1)
+
+# event handlers
+$KEYWORDS(kwc)=regex((after|before)(?=[(]), 1)
+# method execution context
+$KEYWORDS(kwc)=regex((parameter|this|se(lf|nder))(?=[(]), 1)
+# reflection
+$KEYWORDS(kwc)=regex((current_predicate|predicate_property)(?=[(]), 1)
+# DCGs
+$KEYWORDS(kwc)=regex((expand_(goal|term))(?=[(]), 1)
+$KEYWORDS(kwc)=regex(((?:goal|term)_expansion|phrase)(?=[(]), 1)
+# entity
+$KEYWORDS(kwc)=regex(((abolish|c(reate|urrent))_(object|protocol|category))(?=[(]), 1)
+$KEYWORDS(kwc)=regex(((object|protocol|category)_property)(?=[(]), 1)
+# entity relations
+$KEYWORDS(kwc)=regex((complements_object)(?=[(]), 1)
+$KEYWORDS(kwc)=regex((extends_(object|protocol|category))(?=[(]), 1)
+$KEYWORDS(kwc)=regex((imp(lements_protocol|orts_category))(?=[(]), 1)
+$KEYWORDS(kwc)=regex(((instantiat|specializ)es_class)(?=[(]), 1)
+# events
+$KEYWORDS(kwc)=regex((current_event|(abolish|define)_events)(?=[(]), 1)
+# flags
+$KEYWORDS(kwc)=regex(((current|set)_logtalk_flag)(?=[(]), 1)
+# compiling, loading, and library paths
+$KEYWORDS(kwc)=regex((logtalk_(compile|l(ibrary_path|oad)))(?=[(]), 1)
+# database
+$KEYWORDS(kwc)=regex((clause|retract(all)?)(?=[(]), 1)
+$KEYWORDS(kwc)=regex((a(bolish|ssert(a|z)))(?=[(]), 1)
+# control
+$KEYWORDS(kwc)=regex((call|catch|throw)(?=[(]), 1)
+$KEYWORDS(kwc)=regex((fail|true), 1)
+# all solutions
+$KEYWORDS(kwc)=regex((bagof|setof|findall|forall)(?=[(]), 1)
+# multi-threading meta-predicates
+$KEYWORDS(kwc)=regex((threaded(_(call|once|ignore|exit|peek|wait|notify))?)(?=[(]), 1)
+# term unification
+$KEYWORDS(kwc)=regex((unify_with_occurs_check)(?=[(]), 1)
+# term creation and decomposition
+$KEYWORDS(kwc)=regex((functor|arg|copy_term)(?=[(]), 1)
+# evaluable functors
+$KEYWORDS(kwc)=regex((rem|mod|abs|sign)(?=[(]), 1)
+$KEYWORDS(kwc)=regex((float(_(integer|fractional)_part)?)(?=[(]), 1)
+$KEYWORDS(kwc)=regex((floor|truncate|round|ceiling)(?=[(]), 1)
+# other arithmetic functors
+$KEYWORDS(kwc)=regex((cos|atan|exp|log|s(in|qrt))(?=[(]), 1)
+# term testing
+$KEYWORDS(kwc)=regex((var|atomic|atom|integer|float|compound|nonvar|number)(?=[(]), 1)
+# stream selection and control
+$KEYWORDS(kwc)=regex(((curren|se)t_(in|out)put)(?=[(]), 1)
+$KEYWORDS(kwc)=regex((open|close)(?=[(]), 1)
+$KEYWORDS(kwc)=regex((flush_output)(?=[(]), 1)
+$KEYWORDS(kwc)=regex((flush_output), 1)
+$KEYWORDS(kwc)=regex((stream_property|at_end_of_stream|set_stream_position)(?=[(]), 1)
+$KEYWORDS(kwc)=regex((at_end_of_stream), 1)
+# character and byte input/output
+$KEYWORDS(kwc)=regex((nl|(get|peek|put)_(byte|char|code))(?=[(]), 1)
+$KEYWORDS(kwc)=regex((nl), 1)
+# term input/output
+$KEYWORDS(kwc)=regex((read(_term)?)(?=[(]), 1)
+$KEYWORDS(kwc)=regex((write(q|_(canonical|term))?)(?=[(]), 1)
+$KEYWORDS(kwc)=regex(((current_)?op)(?=[(]), 1)
+$KEYWORDS(kwc)=regex(((current_)?char_conversion)(?=[(]), 1)
+# atomic term processing
+$KEYWORDS(kwc)=regex((atom_(length|c(hars|o(ncat|des))))(?=[(]), 1)
+$KEYWORDS(kwc)=regex((char_code|sub_atom)(?=[(]), 1)
+$KEYWORDS(kwc)=regex((number_c(har|ode)s)(?=[(]), 1)
+# implementation defined hooks functions
+$KEYWORDS(kwc)=regex(((?:se|curren)t_prolog_flag)(?=[(]), 1)
+$KEYWORDS(kwc)=regex((halt), 1)
+$KEYWORDS(kwc)=regex((halt)(?=[(]), 1)
+# logic and control
+$KEYWORDS(kwc)=regex((once)(?=[(]), 1)
+$KEYWORDS(kwc)=regex((repeat), 1)
+
+# Logtalk message sending operators
+$KEYWORDS(kwd)=regex((::|\^\^|<<|:))
+# Logtalk external-call control construct
+$KEYWORDS(kwd)=regex(([{}]))
+# Prolog operators
+$KEYWORDS(kwd)=regex((\\\+|->|=\.\.|;|!|:-|\^))
+# Prolog arithmetic operators
+$KEYWORDS(kwd)=regex((is|mod|rem|//|[+\-]|/(?!\*)|(?<=\*)/|[*][*]))
+# Prolog arithmetic comparison operators
+$KEYWORDS(kwd)=regex((=<|<|=:=|=\\=|>=|>))
+# Prolog term comparison operators
+$KEYWORDS(kwd)=regex((@<|@=<|==|\\==|@>|@>=))
+# Prolog unification operators
+$KEYWORDS(kwd)=regex((=|\\=))
+# Logtalk mode operators
+$KEYWORDS(kwd)=regex((\?|@))
+# Prolog bitwise operators
+$KEYWORDS(kwd)=regex((/\\|\\/|>>|\\))
+
+$STRINGDELIMITERS=" '
+
+# numbers
+$KEYWORDS(kwc)=regex((0['].), 1)
+$KEYWORDS(kwc)=regex((0b[0-1]+|0o[0-7]+|0x\p{XDigit}+), 1)
+$KEYWORDS(kwc)=regex((\d+(\.\d+)?([eE]([-+])?\d+)?), 1)
+
+$SL_COMMENT=%
+
+$ML_COMMENT=/* */
+
+$ALLOWNESTEDCOMMENTS=false
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\[0-7]+\\|\\x\p{XDigit}+\\|\\[abfnrtv\\'"])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * + -
diff --git a/support/highlight/langDefs/lhs.lang b/support/highlight/langDefs/lhs.lang
new file mode 100644
index 0000000000..882f34dfb3
--- /dev/null
+++ b/support/highlight/langDefs/lhs.lang
@@ -0,0 +1,23 @@
+# Haskell LHS language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 11.08.2008
+
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Haskell LHS
+
+$INCLUDE=haskell
+
+# All lines not starting with > are comments
+$SL_COMMENT=regex(^\s*([^\>].*)) \ No newline at end of file
diff --git a/support/highlight/langDefs/lisp.lang b/support/highlight/langDefs/lisp.lang
new file mode 100644
index 0000000000..ac2ebc6df5
--- /dev/null
+++ b/support/highlight/langDefs/lisp.lang
@@ -0,0 +1,33 @@
+# Lisp language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 08.02.04
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Lisp
+
+
+$KEYWORDS(kwa)=regex(\(([\w\-\_]+))
+
+$STRINGDELIMITERS="
+
+$ML_COMMENT=;| |;
+
+$SL_COMMENT=;
+
+$IDENTIFIER=regex([a-zA-Z_][\w\-]*)
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , : & < > ! + = / * ' @ # `
diff --git a/support/highlight/langDefs/lotos.lang b/support/highlight/langDefs/lotos.lang
new file mode 100644
index 0000000000..05f0d5cdd2
--- /dev/null
+++ b/support/highlight/langDefs/lotos.lang
@@ -0,0 +1,38 @@
+# Lotos (ISO 8807) language definition file
+#
+# Author: André Simon
+# Mail: andre.simon1@gmx.de
+# Date: 08.02.04
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Lotos
+
+$KEYWORDS(kwa)=accept actualizedby any behavior behaviour choice endlib endproc
+endspec endtype eqns exit for forall formaleqns formalopns formalsorts hide
+iin is let library noexit of ofsort opnnames opns par process renamedby
+sortnames sorts specification stop type using where false true
+
+
+$KEYWORDS(kwb)=Bit BitString Bool DecDigit DecString Element FBool HexDigit
+HexStringOctDigit Octet OctString Nat NonEmptyString OctetString Set String
+BasicNaturalNumber BasicNonEmptyString BitNatRepr Boolean FBoolean DecNatRepr
+HexNatRepr NatRepresentations NaturalNumber OctNatRepr RicherNonEmptyString
+String0 String1
+
+$STRINGDELIMITERS=" '
+
+$ML_COMMENT=(* *)
+
+$IGNORECASE=false
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
diff --git a/support/highlight/langDefs/ls.lang b/support/highlight/langDefs/ls.lang
new file mode 100644
index 0000000000..7cf11e18e9
--- /dev/null
+++ b/support/highlight/langDefs/ls.lang
@@ -0,0 +1,71 @@
+# Lotus Script language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 28.06.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Lotus
+
+
+$KEYWORDS(kwa)=Abs Access ACos ActivateApp Alias And Any Append As Asc ASin Atn Atn2
+Base Beep Bin Bin$ Binary Bind ByVal Call CCur CDat CDbl ChDir ChDrive Chr Chr$
+CInt Class CLng Close Command Command$ Compare Const Cos CSng CStr CurDir
+CurDir$ CurDrive CurDrive$ CVar DataType Date Date$ DateNumber DateValue Day
+Declare DefCur DefDbl DefInt DefLng DefSng DefStr DefVar Delete Dim Dir Dir$
+Environ Environ$ EOF Eqv Erase Erl Err Error Error$ Evaluate Event Execute Exit
+Exp FALSE FileAttr FileCopy FileDateTime FileLen Fix Format Format$ Fraction
+FreeFile FromFunction Get GetFileAttr Hex Hex$ Hour IMEStatus Imp In Input
+Input$ InputB InputB$ InputBox InputBox$ InputBP InputBP$ InStr InStrB InStrBP
+Int Is IsArray IsDate IsElement IsEmpty IsList IsNull IsNumeric IsObject
+IsScalar IsUnknown Kill LBound LCase LCase$ Left Left$ LeftB LeftB$ LeftBP
+LeftBP$ Len LenB LenBP Let Lib Like Line List ListTag LMBCS Loc Lock LOF Log
+Loop LSet LTrim LTrim$ Me MessageBox Mid Mid$ MidB MidB$ Minute MkDir Mod Month
+Name New NoCase NoPitch Not NOTHING Now NULL Oct Oct$ On Open Option Or Output
+PI Pitch Preserve Print Private Property Public Put Random Randomize Read ReDim
+Rem Remove Reset Resume Return Right Right$ RightB RightB$ RightBP RightBP$
+RmDir Rnd Round RSet RTrim RTrim$ Second Seek SendKeys Set SetFileAttr Sgn
+Shared Shell Sin Space Space$ Spc Sqr Static Step Stop Str Str$ StrCompare
+String$ Sub Tab Tan Time Time$ TimeNumber Timer TimeValue To Today Trim Trim$
+TRUE Type TypeName UBound UCase UCase$ UChr UChr$ Uni Unicode Unlock Use UseLSX
+UString UString$ Val With Write Xor Year Yield Case Do Else End ElseIf For
+Forall If Next Select Then Until Wend While GoSub GoTo NotesACLNotesACLEntry
+NotesAgent NotesDatabase NotesDateRange NotesDateTime NotesDbDirectory
+NotesDocument NotesDocumentCollection NotesEmbeddedObject NotesForm
+NotesInternational NotesItem NotesLog NotesName NotesNewsLetter
+NotesRegistration NotesRichTextItem NotesRichTextStyle NotesSession NotesTimer
+NotesView NotesViewColumn NotesUIDatabase NotesUIDocument NotesUIView
+NotesUIWorkspace Navigator notesaclnotesaclentry notesagent notesdatabase
+notesdaterange notesdatetime notesdbdirectory notesdocument
+notesdocumentcollection notesembeddedobject notesform notesinternational
+notesitem noteslog notesname notesnewsletter notesregistration
+notesrichtextitem notesrichtextstyle notessession notestimer notesview
+notesviewcolumn notesuidatabase notesuidocument notesuiview notesuiworkspace
+navigator
+
+
+$KEYWORDS(kwb)=Currency Double Integer Long Single String Variant
+
+$IDENTIFIER=regex([a-zA-Z_][\w]*\$?)
+
+#$STRINGDELIMITERS=" '
+
+$SL_COMMENT='
+
+$ML_COMMENT=%REM %END
+
+$IGNORECASE=false
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * + -
+
+
diff --git a/support/highlight/langDefs/lsl.lang b/support/highlight/langDefs/lsl.lang
new file mode 100644
index 0000000000..5ee62fb28d
--- /dev/null
+++ b/support/highlight/langDefs/lsl.lang
@@ -0,0 +1,46 @@
+# Linden Script (Second Life) language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 03.03.2007
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Linden Script
+
+$KEYWORDS(kwa)=for do while if else jump
+
+$KEYWORDS(kwb)=integer float string key vector rotation list
+
+$KEYWORDS(kwc)=regex((ll\w+)\s*\()
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=//
+
+#$ML_COMMENT=/* */
+
+$ALLOWNESTEDCOMMENTS=false
+
+$IGNORECASE=false
+
+#$DIRECTIVE=#
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; . : & | < > ! = / * % + - ~
+
+$CONTINUATIONSYMBOL=\
+
+#$REFORMATTING=true
diff --git a/support/highlight/langDefs/lua.lang b/support/highlight/langDefs/lua.lang
new file mode 100644
index 0000000000..4777dc9312
--- /dev/null
+++ b/support/highlight/langDefs/lua.lang
@@ -0,0 +1,48 @@
+# Lua language definition file
+#
+# Author: Andre Simon
+#
+# Mail: andre.simon1@gmx.de
+# Date: 22.07.2002
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Lua
+
+$KEYWORDS(kwa)=and break do else elseif
+end false for function if
+in local nil not or
+repeat return then true until while
+
+$KEYWORDS(kwb)=number string function userdata table
+assert call collectgarbage copytagmethods dofile
+dostring error foreach foreachi getglobal getn gettagmethod globals newtag
+next print rawget rawset setglobal settag settagmethod sort tag tonumber
+tostring tinsert tremove type abs acos asin atan atan2 ceil cos deg exp
+floor log log10 max min mod rad sin sqrt tan frexp ldexp random randomseed
+openfile closefile readfrom writeto appendto remove rename flush seek tmpname
+read write clock date execute exit getenv setlocale strbyte strchar strfind
+strlen strlower strrep strsub strupper format gsub
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$ML_COMMENT=--[[ ]]
+
+$SL_COMMENT=--
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) { } [ ] , ; . : & | < > ! = / * % + - ~ # \
diff --git a/support/highlight/langDefs/ly.lang b/support/highlight/langDefs/ly.lang
new file mode 100644
index 0000000000..6b7da74f12
--- /dev/null
+++ b/support/highlight/langDefs/ly.lang
@@ -0,0 +1,36 @@
+# Lilypond language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 15.02.2008
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Lilypond
+
+#allow decimals to follow identifier names without ws
+$IDENTIFIER=regex(([a-z]+)\d*)
+
+$KEYWORDS(kwa)=c d e f g a h b cis dis eis fis gis ais des es ges as s bes
+
+$KEYWORDS(kwb)=regex(\\[\w<>!\\]+)
+
+$STRINGDELIMITERS="
+
+# { is not supposed to follow % in single line comment
+$SL_COMMENT=regex(%(?!\{).*)
+
+$ML_COMMENT=%{ }%
+
+$IGNORECASE=false
+
+$SYMBOLS= ( ) [ ] { } < > ' , . / : ^ = # * _ | !
diff --git a/support/highlight/langDefs/m.lang b/support/highlight/langDefs/m.lang
new file mode 100644
index 0000000000..71bb299e93
--- /dev/null
+++ b/support/highlight/langDefs/m.lang
@@ -0,0 +1,80 @@
+# Matlab language definition file
+#
+# Author: Andr� Simon
+# Mail: andre.simon1@gmx.de
+# Date: 04.03.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Matlab
+
+$KEYWORDS(kwa)=assignin break case catch cell char class dbclear dbcont dbdown
+dbquit dbstack dbstatus dbstep dbstop dbtype dbup debug double else elseif end
+error eval evalin feval fieldnames for function getfield global if input isa
+iscell ischar isempty isequal isfield isnumeric isstruct keyboard lasterr
+logical length long menu mexdebug nargchk nargin nargout ones otherwise pause
+persistent return rmfield script setfield sparse speye struct switch try
+varargin varargout while acsl binpatch cd cedit clc clear computer delete diary
+dir disp doc dos echo fileparts format fullfile getenv help home hostid info
+inquire load lookfor ls matlabro memory mlock more munlock mislocked pack path
+pwd quit readme save size subscrib type unix ver version vms what whatsnew
+which who whos why
+
+
+# functions
+$KEYWORDS(kwb)=abs acos acosh acot acoth acsc acsch angle asec asech asin asinh
+atan atan2 atanh ceil conj cos cosh cot coth csc csch exp fix floor imag log
+log10 real rem round sec sech sign sin sinh sqrt tan tanh auread auwright axes
+axis blt capture cinvert cla clf clg close colstyle dc2sc dialog drawnow
+errordlg figflag figure findobj gca gcf gco get getframe ginput graymon
+hardcopy helpdlg hold image imagesc imfinfo imread imwright ishold layout meta
+movie moviein newplot orient patch print questdlg rbbox refresh reset rotate
+sc2dc set shg sound soundsc subplot swapprev terminal uicontrol uigetfile
+uiguide uimenu uiputfile uisetcolor uisetfont waitforbuttonpress warndlg
+wavread wavwright whitebg zoom all any arith balance bar blanks bone brighten
+caxis cdf2rdf chol clabel cmdmatch colon colorbar colormap comet comet3 compass
+cond contour contour3 contourc contrast conv conv2 cool copper corrcoef cov
+cplxpair cross csvread csvwrite cumprod cumsum cylinder deblank dec2hex deconv
+del2 delstext det diff diffuse dlmread dlmwrite dot eig errorbar exist expm
+expm1 expm2 expm3 fclose feather feof ferror fft fft2 fftshift fgetl fgets
+filesep fill fill3 filter filter2 find findstr finite fixstext flag fmin fmins
+fopen foptions fplot fprintf fread frewind fscanf fseek ftell funm fwrite fzero
+getcargs getstext gradient gray grid griddata gtext hess hex2dec hex2num hdf
+hidden hist hk hot hsv hsv2rgb icubic ifft ifft2 int2str interp1 interp2
+interp3 interp4 interp5 interp6 interpft inv isglobal isinf isletter isnan
+isreal isspace isstr jet kron legend line loglog logm lower lscan lscov lu
+mat2str matlabroot max mean median mesh meshc meshz mexext min mkpp move1sto
+moveaxis nextpow2 nnls norm null num2str ode23 ode23p ode45 orth paren
+partialpath pathsep pcolor pink pinv planerot plot plot3 polar poly polyder
+polyeig polyfit polyline polymark polyval polyvalm ppval printsto prism prod
+punct qr qrdelete qrinsert quad quad8 quad8stp quadstp quiver qz rank rcond
+readstfm relop resi2 residue rgb2hsv rgbplot roots rose rref rsf2csf schur
+semilogx semilogy setstext setstr shading slash slegend slice sort specular
+sphere spinmap spline spreview sprintf sqrtm sscanf stairs std stem stext
+stextbox stfixps stitle stodemo str2mat str2num str2rng strcmp strings strrep
+strtok subspace sum surf surface surfc surfl surfnorm svd sxlabel sylabel
+szlabel table1 table2 tempdir tempname text title trace trapz unmkpp unwrap
+upper view viewmtx waterfall white wk1const wk1read wk1wrec wk1write xlabel xor
+xyzchk ylabel zlabel
+
+$STRINGDELIMITERS="
+
+$ML_COMMENT=/* */
+$SL_COMMENT=%
+
+$IGNORECASE=true
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * + -
+
+
+
+
diff --git a/support/highlight/langDefs/make.lang b/support/highlight/langDefs/make.lang
new file mode 100644
index 0000000000..4e01910766
--- /dev/null
+++ b/support/highlight/langDefs/make.lang
@@ -0,0 +1,51 @@
+# Make script language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 02.03.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Make
+
+
+$KEYWORDS(kwa)=addprefix addsuffix basename dir filter filter-out findstring
+firstword foreach join notdir origin patsubst shell sort strip subst suffix
+wildcard word words all_cflags ar arflags as asflags cc cflags co coflags cpp
+cppflags ctangle cweave cxx cxxflags fc fflags force get gflags install_data
+install_program ld ldflags lex lflags makeinfo pc pflags rflags rm tags tangle
+tex texi2dvi weave yacc yaccr yflags all bindir check clean clobber datadir
+dist distclean dvi exec_prefix includedir info infodir install installcheck
+installdirs libdir man0dir man0ext man1dir man1ext man2dir man2ext man3dir
+man3ext man4dir man4ext man5dir man5ext man6dir man6ext man7dir man7ext man8dir
+man8ext man9dir man9ext mandir manext mostlyclean oldincludedir prefix print
+realclean shar srcdir statedir tar test uninstall
+
+
+# directives
+$KEYWORDS(kwb)=define else endef endif export ifdef ifeq ifndef ifneq include
+override unexport
+
+$STRINGDELIMITERS=" ' `
+
+$SL_COMMENT=#
+
+$IGNORECASE=false
+
+$KEYWORDS(kwb)=regex(\$\w+)
+
+$IDENTIFIER=regex([a-zA-Z_][\w\d\-]*)
+
+$KEYWORDS(kwc)=regex((\$\{(\w+)\}))
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + - $
+
diff --git a/support/highlight/langDefs/mel.lang b/support/highlight/langDefs/mel.lang
new file mode 100644
index 0000000000..5d5979ef0a
--- /dev/null
+++ b/support/highlight/langDefs/mel.lang
@@ -0,0 +1,154 @@
+# Maya script language definition file
+#
+# Author: Andr� Simon
+# Mail: andre.simon1@gmx.de
+# Date: 04.03.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Maya
+
+$KEYWORDS(kwa)=float int matrix string vector false no off on true yes break case
+continue default do else for if in switch while alias catch global proc return
+source
+
+# functions
+$KEYWORDS(kwb)=about addattr aimconstraint air aliasattr aligncurve alignsurface
+ambientlight anglebetween animcurveeditor animdisplay animview applytake
+arclendimcontext arclengthdimension arclen arraymapper assigncommand
+assigninputdevice attachcurve attachdeviceattr attachsurface attrcolorslidergrp
+attrcompatibility attrenumoptionmenu attrenumoptionmenugrp attrfieldgrp
+attrfieldslidergrp attrnavigationcontrolgrp attributequery autokeyframe
+autoplace bakeresults bakesimulation batchrender bevel bindpose bindskin blend
+blendshape blendshapeeditor blendshapepanel blendtwoattr bonelattice boundary
+boxdollyctx boxzoomctx buildbookmarkmenu buildkeyframemenu button buttonmanip
+camera cameraview cancreatemanip canvas channelbox checkbox checkboxgrp choice
+circle circularfillet closecurve closesurface cluster cmdshell collision color
+coloreditor colorindex colorindexslidergrp colorsliderbuttongrp colorslidergrp
+columnlayout commandecho commandline commandport commonpaintctx condition cone
+confirmdialog connectattr connectcontrol connectdynamic connectjoint
+connectioninfo constrain constructionhistory contextinfo control convertsolidtx
+convertunit copykey createdrawctx createeditor createnode ctxabort
+ctxcompletion ctxeditmode ctxtraverse currentctx currenttime currenttimectx
+currentunit curve curveaddptctx curvecvctx curveepctx curveeditorctx
+curvemoveepctx curveonsurface curvesketchctx cutkey cyclecheck cylinder
+dagobjecthit defaultnavigation definedataserver defineeditor
+defineeditortemplate definevirtualdevice delete deleteattr deleteui detachcurve
+detachdeviceattr detachsurface devicepanel dimwhen directkeyctx
+directionallight disable disconnectattr disconnectjoint displayaffected
+displaycolor displaycull displaylevelofdetail displaypref displayrgbcolor
+displaysmoothness displaystats displaysurface distancedimcontext
+distancedimension dolly dollyctx dopesheeteditor doubleprofilebirailsurface
+drag draggercontext dropofflocator duplicate duplicatecurve dyncache dyncontrol
+dynexport dynexpression dynparticlectx dynreledpanel dynreleditor dynamicload
+editor editortemplate effector emitter enabledevice encodestring eval
+evaldeferred evalecho event exclusivelightcheckbox expression
+expressioneditorlisten extendcurve extendsurface extrude file filebrowserdialog
+filedialog filletcurve filter filterexpand findkeyframe finder fitbspline
+flexor floatfield floatfieldgrp floatscrollbar floatslider floatsliderbuttongrp
+floatslidergrp flow flushthumbnailcache flushundo fontdialog formlayout
+framelayout freeformfillet geometryconstraint getattr getclassification
+getinputdevicerange getpanel getparticleattr glrender glrendereditor goal
+grabcolor graphdollyctx graphselectcontext graphtrackctx gravity grid
+gridlayout group handlerotatectx hardenpointcurve hardware hardwarerenderpanel
+help helpline hide hilite hotbox hotkey hotkeycheck hypergraph hyperpanel
+icontextbutton icontextcheckbox icontextradiobutton icontextradiocollection
+icontextstaticlabel ikhandle ikhandlectx ikhandledisplayscale iksolver
+iksplinehandlectx iksplinemanipctx iksystem iksysteminfo image index
+inherittransform insertjoint insertjointctx insertkeyctx insertknotcurve
+insertknotsurface instance intfield intfieldgrp intscrollbar intslider
+intslidergrp internalvar interpport intersect isconnected isdirty istrue
+itemfilter itemfilterattr itemfilterrender itemfiltertype joint jointcluster
+jointctx jointdisplayscale jointlattice journal keytangent keyframe
+keyframeoutliner keyframeregioncurrenttimectx keyframeregiondirectkeyctx
+keyframeregiondollyctx keyframeregioninsertkeyctx keyframeregionmovekeyctx
+keyframeregionscalekeyctx keyframeregionselectkeyctx keyframeregionsetkeyctx
+keyframeregiontrackctx keyframestats lastmenuitem lattice layeredshaderport
+lightlist lightlisteditor lightlistpanel listanimatable listattr listcameras
+listconnections listdeviceattachments listhistory listinputdeviceaxes
+listinputdevicebuttons listinputdevices listnodetypes listrelatives
+listereditor loadplugin loft lookthru ls lsthroughfilter lsui makeidentity
+makelive manipmovecontext manipmovelimitsctx manipoptions maniprotatecontext
+maniprotatelimitsctx manipscalecontext manipscalelimitsctx marker memory menu
+menubarlayout menueditor menuitem messageline minimizeapp mirrorjoint
+modelcurrenttimectx modeleditor modelpanel movin movout move movekeyctx
+multiprofilebirailsurface namecommand namefield newpanelitems newton
+nodeoutliner nodetype normalconstraint nurbscube nurbsplane nurbstopoly
+nurbstopolygonspref objexists objectcenter objecttype objecttypeui offsetcurve
+offsetcurveonsurface openmayapref optionmenu optionmenugrp optionvar orbit
+orbitctx orientconstraint outlinereditor outlinerpanel overridemodifier
+paletteport panelayout panel panelconfiguration panelhistory paramdimcontext
+paramdimension paramlocator parent particle particlerenderinfo partition
+pastekey pathanimation pause percent performanceoptions pickwalk picture
+pixelmove planarsrf plane play playbackoptions playblast plugininfo
+pointconstraint pointcurveconstraint pointlight pointoncurve pointonsurface
+polevectorconstraint polyappend polybevel polychipoff polycloseborder
+polycollapseedge polycollapsefacet polycone polycreatefacet polycube
+polycylinder polycylindricalprojection polydeledge polydelfacet polydelvertex
+polyevaluate polyextrudefacet polyinstallaction polymapcut polymapdel
+polymapsew polymergeedge polymergefacet polymoveedge polymovefacet
+polymovefacetuv polymoveuv polymovevertex polynormal polyoptions
+polyplanarprojection polyplane polyquad polyselectconstraint
+polyselectconstraintmonitor polyseparate polysmooth polysoftedge polysphere
+polysphericalprojection polysplit polysubdivideedge polysubdividefacet
+polysuperctx polytorus polytriangulate polyunite popupmenu projfileviewer
+projectcurve projectlight projectlighteditor projecttangent projectioncontext
+projectionmanip promptdialog propmodctx propmove puttyctx quit radial
+radiobutton radiobuttongrp radiocollection radiomenuitemcollection
+rampcolorport rangecontrol readtake rebuildcurve rebuildsurface recordattr
+recorddevice redo refresh reloadimage removejoint removemultiinstance rename
+renameui render renderglobalsnode renderinfo rendermanip renderpartition
+renderqualitynode renderthumbnailupdate renderwindoweditor
+renderwindowselectcontext reorder reorderdeformers requires reroot resettool
+resolutionnode reversecurve reversesurface revolve rigidbody rigidsolver roll
+rollctx rotate rowcolumnlayout rowlayout saveallshelves saveimage
+saveinitialstate savemenu saveprefs saveshelf savetoolsettings scale
+scaleconstraint scalekey scalekeyctx sceneuireplacement sceneviewer scriptjob
+scriptedpanel scriptedpaneltype scrollfield scrolllayout sculpt select
+selectcontext selectkey selectkeyctx selectmode selectpaintctx selectpref
+selectpriority selecttype selectedline selectednodes selectionconnection
+separator setattr setattrmapping setdefaultshadinggroup setdrivenkeyframe
+setdynamic seteditctx seteditor setescapectx setfocus setinfinity
+setinputdevicemapping setkeyctx setkeypath setkeyframe setparent
+setparticleattr setstartupmessage settoolto setuitemplate sets
+shadingconnection shadinggeometryrelctx shadinggroupdialogdaemon
+shadinglightrelctx shadingnode shelfbutton shelflayout shelftablayout
+shellfield showhidden showmanipctx showselectionintitle
+showshadinggroupattreditor showwindow simplify singleprofilebirailsurface
+snapmode snapshot soft sound soundcontrol spacelocator sphere spotlight
+spotlightpreviewport spreadsheeteditor spring srtcontext stacktrace
+stitchsurface stitchsurfacepoints superctx surface surfacepaintctx
+surfaceshaderlist swatchdisplayport symbolbutton symbolcheckbox tablayout
+tangentconstraint texmanipcontext texselectcontext texwintoolctx text
+textcurves textfield textfieldbuttongrp textfieldgrp textscrolllist
+textureplacementcontext texturewindow timecontrol timeport toggle toggleaxis
+togglewindowvisibility tolerance toolbutton toolcollection tooldropped
+toolhasoptions toolpropertywindow track trackctx transformlimits translator
+trim tumble tumblectx turbulence uitemplate unassigninputdevice undo undoinfo
+ungroup uniform unloadplugin untrim upaxis userctx userpaintctx valuepaintctx
+view2dtoolctx viewcamera viewclipplane viewfit viewheadon viewlookat viewplace
+viewset vortex waitcursor window windowpref wire wirecontext workspace wrinkle
+wrinklecontext writetake wtpaintctx xform xpmpicker
+
+$KEYWORDS(kwc)=regex(\$\w+)
+
+$STRINGDELIMITERS=" `
+
+$ML_COMMENT=/* */
+$SL_COMMENT=//
+
+$IGNORECASE=true
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
+
+
+
diff --git a/support/highlight/langDefs/mercury.lang b/support/highlight/langDefs/mercury.lang
new file mode 100644
index 0000000000..c19c89c22d
--- /dev/null
+++ b/support/highlight/langDefs/mercury.lang
@@ -0,0 +1,48 @@
+# Mercury language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 06.8.2009
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Mercury
+
+$KEYWORDS(kwa)=is and or func impure pred semipure not when
+then if else where all
+arbitrary promise_equivalent_solutions
+promise_equivalent_solution_sets promise_exclusive
+promise_exclusive_exhaustive promise_exhaustive
+promise_impure promise_impure_implicit
+promise_pure promise_pure_implicit
+promise_semipure promise_semipure_implicit some
+ype solver end_module import_module include_module
+initialise initialize finalise finalize inst instance mode module
+pragma promise rule typeclass use_module
+interface implementation det
+
+$KEYWORDS(kwa)=div mod rem
+
+$KEYWORDS(kwc)=regex([A-Z]\w+)
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=%
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; . : & | < > ! = / * + - ~
+
diff --git a/support/highlight/langDefs/mib.lang b/support/highlight/langDefs/mib.lang
new file mode 100644
index 0000000000..05065f2e30
--- /dev/null
+++ b/support/highlight/langDefs/mib.lang
@@ -0,0 +1,53 @@
+# SNMPv1 and SNMPv2 MIB and SMI files
+#
+# Author: Roman Surma, based on mib.vim by David Pascoe <pascoedj@spamcop.net>
+# Mail: sur{_at_}loniir{_dot_}ru
+# Date: 30.08.2004
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+
+$DESCRIPTION=SNMP
+
+$KEYWORDS(kwa)= ACCESS ANY AUGMENTS BEGIN BIT BITS BOOLEAN CHOICE
+COMPONENTS CONTACT-INFO DEFINITIONS DEFVAL
+DESCRIPTION DISPLAY-HINT END ENTERPRISE EXTERNAL FALSE
+FROM GROUP IDENTIFIER IMPLICIT IMPLIED IMPORTS INDEX
+LAST-UPDATED MANDATORY-GROUPS MAX-ACCESS
+MIN-ACCESS MODULE MODULE-COMPLIANCE MODULE-IDENTITY
+NOTIFICATION-GROUP NOTIFICATION-TYPE NOTIFICATIONS
+NULL OBJECT OBJECT-GROUP OBJECT-IDENTITY OBJECT-TYPE
+OBJECTS OF OPTIONAL ORGANIZATION REFERENCE
+REVISION SEQUENCE SET SIZE STATUS SYNTAX
+TEXTUAL-CONVENTION TRAP-TYPE TRUE UNITS VARIABLES
+WRITE-SYNTAX ::=
+
+$KEYWORDS(kwb)= accessible-for-notify current DisplayString
+deprecated mandatory not-accessible obsolete optional
+read-create read-only read-write write-only INTEGER
+Counter Gauge IpAddress OCTET STRING experimental mib-2
+TimeTicks RowStatus TruthValue UInteger32 Unsigned32 snmpModules
+Integer32 Counter32 TestAndIncr TimeStamp InstancePointer
+Gauge32 AutonomousType Counter64
+PhysAddress TimeInterval MacAddress StorageType RowPointer
+TDomain TAddress ifIndex
+
+$KEYWORDS(kwc)= FORCE-INCLUDE EXCLUDE cookie get-function set-function
+test-function get-function-async set-function-async
+test-function-async next-function next-function-async
+leaf-name DEFAULT contained
+
+$SL_COMMENT= --
+
+$STRINGDELIMITERS= "
+
+$IDENTIFIER=regex([a-zA-Z_][\w\-]*)
+
+$IGNORECASE=false
+
+$SYMBOLS= ( ) [ ] { } , ; : | = .
diff --git a/support/highlight/langDefs/miranda.lang b/support/highlight/langDefs/miranda.lang
new file mode 100644
index 0000000000..a2ce1f847f
--- /dev/null
+++ b/support/highlight/langDefs/miranda.lang
@@ -0,0 +1,52 @@
+# Miranda language definition file
+#
+# Author: André Simon
+# Mail: andre.simon1@gmx.de
+# Date: 7.12.2006
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Miranda
+
+$KEYWORDS(kwa)=abstype div if mod otherwise readvals show type where
+ with sys_message False True Appendfile Closefile Exit Stderr
+ Stdout System Tofile abs and arctan cjustify code concat const
+ converse cos decode digit drop dropwhile entier error exp
+ filemode filter foldl foldl1 foldr foldr1 force fst getenv hd
+ hugenum id index init integer iterate last lay layn letter limit
+ lines ljustify log log10 map map2 max max2 member merge min min2
+ mkset neg numval or pi postfix product read rep repeat reverse
+ rjustify scan seq showfloat shownum showscaled sin snd sort
+ spaces sqrt subtract sum system take takewhile tinynum tl
+ transpose undef until zip2 zip3 zip4 zip5 zip6 zip
+
+$KEYWORDS(kwb)=num char bool
+
+# Regex which renders type declarations on one line using `::', `==' and `::='
+$KEYWORDS(kwd)=regex((\s*[a-zA-Z][a-zA-Z0-9_']*\s*.*\s*::\s+.*|\s*[a-zA-Z][a-zA-Z0-9_']*\s*[\* ]*\s*==\s+.*|\s*[a-zA-Z][a-zA-Z0-9_']*\s*[\* ]*\s*::=\s+.*))
+
+# Indentifier syntax includes the single quote
+$IDENTIFIER=regex([a-z][a-zA-Z0-9_']*)
+
+# %include %export %free %insert
+$DIRECTIVE=%
+
+$STRINGDELIMITERS="
+
+$SL_COMMENT=||
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] . , ; : & | < > ! = / * % + - ~ ^
+
diff --git a/support/highlight/langDefs/ml.lang b/support/highlight/langDefs/ml.lang
new file mode 100644
index 0000000000..f97dee0c92
--- /dev/null
+++ b/support/highlight/langDefs/ml.lang
@@ -0,0 +1,51 @@
+# Objective Caml language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 17.11.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Objective Caml
+
+$KEYWORDS(kwa)=and as assert asr begin class constraint do done downto else
+end exception external false for fun function functor if in include inherit
+initializer land lazy let lor lsl lsr lxor match method mod module mutable new
+object of open or private rec sig struct then to true try type val virtual when
+while with value
+
+# Types and type variables
+$KEYWORDS(kwb)=bool string int real word float unit option ref
+$KEYWORDS(kwb)=regex('[a-zA-Z0-9_']+)
+
+# Modules
+$KEYWORDS(kwc)=regex(\b[A-Z][a-zA-Z0-9_']*(?=\.))
+
+# Constructors
+$KEYWORDS(kwd)=regex(\b[A-Z][a-zA-Z0-9_']*)
+
+$STRINGDELIMITERS=" '
+
+$ML_COMMENT=(* *)
+
+$ALLOWNESTEDCOMMENTS=true
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + - .
+
+$DIGIT=regex((?:0x|0X|0b|0B)[0-9a-fA-F]+|\d*[\.\_]?\d+(?:[eE][\-\+]\d+)?[lLuUbfdm]*)
+
+# This breaks keywords (kwa) for some reason:
+# $IDENTIFIER=regex([a-z_][a-zA-Z0-9_']*)
diff --git a/support/highlight/langDefs/mo.lang b/support/highlight/langDefs/mo.lang
new file mode 100644
index 0000000000..c049ca3e1d
--- /dev/null
+++ b/support/highlight/langDefs/mo.lang
@@ -0,0 +1,41 @@
+# Modelica script language definition file
+#
+# Author: André Simon
+# Mail: andre.simon1@gmx.de
+# Date: 04.03.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Modelica
+
+$KEYWORDS(kwa)=annotation assert block class connector constant discrete else elseif
+elsewhen end exit extends external final flow for function if in inner input
+import loop model nondiscrete outer output package parameter record redeclare
+replaceable return size terminate then type when while algorithm equation
+protected public and false not or true
+
+# functions
+$KEYWORDS(kwb)=abs acos asin atan atan2 connect cos cosh cross der edge exp initial
+noEvent pre reinit sample sign sin sinh tan tanh terminal
+
+$STRINGDELIMITERS="
+
+$ML_COMMENT=/* */
+$SL_COMMENT=//
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+$IGNORECASE=true
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
+
+
+
+
diff --git a/support/highlight/langDefs/mod2.lang b/support/highlight/langDefs/mod2.lang
new file mode 100644
index 0000000000..7b02dcb07c
--- /dev/null
+++ b/support/highlight/langDefs/mod2.lang
@@ -0,0 +1,43 @@
+# Highlight Modula-2 language definition file
+#
+# Author: B. Kowarsch
+# Date: March 25, 2010
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Modula2
+
+# Reserved words
+$KEYWORDS(kwa)=AND ARRAY BEGIN BY CASE CONST DEFINITION DIV DO ELSE
+ELSIF END EXCEPT EXIT EXPORT FINALLY FOR FORWARD FROM IF IMPLEMENTATION
+IMPORT IN LOOP MOD MODULE NOT OF OR PACKEDSET POINTER PROCEDURE
+QUALIFIED RECORD REM REPEAT RETRY RETURN SET THEN TO TYPE UNTIL VAR
+WHILE WITH
+
+# Pervasive identifiers
+$KEYWORDS(kwb)=ABS BITSET BOOLEAN CAP CARDINAL CHAR CHR DEC DISPOSE
+EXCL FALSE FLOAT HALT HIGH INC INCL INTEGER LONGCARD LONGINT LONGREAL
+MAX MIN NEW NIL ODD ORD PROC REAL SIZE TRUE TRUNC TSIZE VAL
+
+# Other identifiers
+
+$KEYWORDS(kwd)=regex((\w+?)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$ML_COMMENT=(* *)
+
+$ALLOWNESTEDCOMMENTS=true
+
+$IGNORECASE=false
+
+$SYMBOLS=( ) [ ] { } , ; : | ^ ~ & + - / * = # < >
diff --git a/support/highlight/langDefs/mod3.lang b/support/highlight/langDefs/mod3.lang
new file mode 100644
index 0000000000..fb71562689
--- /dev/null
+++ b/support/highlight/langDefs/mod3.lang
@@ -0,0 +1,49 @@
+# Modula 3 language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 21.11.2002
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Modula3
+
+$KEYWORDS(kwa)=and do from not repeat until
+any else generic object return untraced
+array elsif if of reveal value
+as end import or root var
+begin eval in overrides set while
+bits except interface procedure then with
+branded exception lock raise to
+by exit loop raises try
+case exports methods readonly type
+const finally mod record typecase
+div for module ref unsafe
+
+$KEYWORDS(kwb)=abs bytesize extended integer min number text
+address cardinal false istype mutex ord true
+adr ceiling first last narrow real trunc
+adrsize char float longreal new refany typecode
+bitsize dec floor loophole nil round val
+boolean dispose inc max null subarray
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=//
+
+$ML_COMMENT=(* *)
+
+$IGNORECASE=true
+
+$SYMBOLS=( ) [ ] { } , ; : & | < > ! = / * % + -
diff --git a/support/highlight/langDefs/mpl.lang b/support/highlight/langDefs/mpl.lang
new file mode 100644
index 0000000000..0a0e4b1878
--- /dev/null
+++ b/support/highlight/langDefs/mpl.lang
@@ -0,0 +1,102 @@
+# Maple language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 08.02.04
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Maple
+
+$KEYWORDS(kwa)=and or xor union intersect minus mod not assuming break by catch
+description do done elif else end error export fi finally for from global if
+implies in local module next od option options proc quit read return save stop
+psubset then to try use while true false
+
+$KEYWORDS(kwb)=about ans add addcoords additionally addproperty addressof
+AFactor AFactors AIrreduc AiryAi AiryAiZeros AiryBi AiryBiZeros algebraic
+algsubs alias allvalues anames AngerJ antihermitian antisymm apply applyop
+applyrule arccos arccosh arccot arccoth arccsc arccsch arcsec arcsech arcsin
+arcsinh arctan arctanh argument Array array ArrayDims ArrayElems ArrayIndFns
+ArrayOptions assign assigned asspar assume asympt attributes band Berlekamp
+bernoulli bernstein BesselI BesselJ BesselJZeros BesselK BesselY BesselYZeros
+Beta branches C cat ceil changecoords charfcn ChebyshevT ChebyShevU CheckArgs
+Chi chrem Ci close coeff coeffs coeftayl collect combine comparray compiletable
+compoly CompSeq conjugate constant Content content convergs convert coords copy
+CopySign cos cosh cot coth coulditbe csc csch csgn currentdir curry CylinderD
+CylinderU CylinderV D dawson Default0 DefaultOverflow DefaultUnderflow define
+define_external degree denom depends DESol Det diagon Diff diff diffop Digits
+dilog dinterp Dirac disassemble discont discrim dismantle DistDeg Divide divide
+dsolve efficiency Ei Eigenvals eliminate ellipsoid EllipticCE EllipticCK
+EllipticCPi EllipticE EllipticF EllipticK EllipticModulus EllipticNome
+EllipticPi elliptic_int entries erf erfc erfi euler eulermac Eval eval evala
+evalapply evalb evalc evalf evalfint evalhf evalm evaln evalr evalrC events
+Excel exists exp Expand expand expandoff expandon exports extract extrema
+Factor factor Factors factors fclose fdiscont feof fflush FFT filepos fixdiv
+float floor fnormal fold fopen forall forget fprintf frac freeze frem fremove
+FresnelC Fresnelf Fresnelg FresnelS FromInert frontend fscanf fsolve galois
+GAMMA GaussAGM Gausselim Gaussjord gc Gcd gcd Gcdex gcdex GegenbauerC genpoly
+getenv GetResultDataType GetResultShape GF Greek HankelH1 HankelH2 harmonic has
+hasfun hasoption hastype heap Heaviside Hermite HermiteH hermitian Hessenberg
+hfarray history hypergeom icontent identity IEEEdiffs ifactor ifactors iFFT
+igcd igcdex ilcm ilog10 ilog2 ilog Im implicitdiff ImportMatrix ImportVector
+indets index indexed indices inifcn ininame initialcondition initialize insert
+int intat interface Interp interp Inverse invfunc invztrans iostatus iperfpow
+iquo iratrecon irem iroot Irreduc irreduc is iscont isdifferential
+IsMatrixShape isolate isolve ispoly isprime isqrfree isqrt issqr ithprime
+JacobiAM JacobiCD JacobiCN JacobiCS JacobiDC JacobiDN JacobiDS JacobiNC
+JacobiND JacobiNS JacobiP JacobiSC JacobiSD JacobiSN JacobiTheta1 JacobiTheta2
+JacobiTheta3 JacobiTheta4 JacobiZeta KelvinBei KelvinBer KelvinHei KelvinHer
+KelvinKei KelvinKer KummerM KummerU LaguerreL LambertW latex lattice lcm Lcm
+lcoeff leadterm LegendreP LegendreQ length LerchPhi lexorder lhs CLi Limit
+limit Linsolve ln lnGAMMA log log10 LommelS1 Lommels2 lprint map map2
+Maple_floats match MatlabMatrix Matrix matrix MatrixOptions max maximize
+maxnorm maxorder MeijerG member min minimize mkdir ModifiedMeijerG modp modp1
+modp2 modpol mods module MOLS msolve mtaylor mul NextAfter nextprime nops norm
+norm Normal normal nprintf Nullspace numboccur numer NumericClass NumericEvent
+NumericEventHandler NumericException numerics NumericStatus odetest op open
+order OrderedNE parse patmatch pclose PDEplot_options pdesolve pdetest pdsolve
+piecewise plot plot3d plotsetup pochhammer pointto poisson polar polylog
+polynom Power Powmod powmod Prem prem Preprocessor prevprime Primitive Primpart
+primpart print printf ProbSplit procbody ProcessOptions procmake Product
+product proot property protect Psi psqrt queue Quo quo radfield radnormal
+radsimp rand randomize Randpoly randpoly Randprime range ratinterp rationalize
+Ratrecon ratrecon Re readbytes readdata readlib readline readstat realroot
+Record Reduce references release Rem rem remove repository requires residue
+RESol Resultant resultant rhs rmdir root rootbound RootOf Roots roots round
+Rounding rsolve rtable rtable_algebra rtable_dims rtable_elems rtable_indfns
+rtable_options rtable_printf rtable_scanf SampleRTable savelib Scale10 Scale2
+scalar scan scanf SearchText searchtext sec sech select selectfun selectremove
+seq series setattribute SFloatExponent SFloatMantissa shale Shi showprofile
+showtime Si sign signum Simplify simplify sin sinh singular sinterp smartplot3d
+Smith solve solvefor sort sparse spec_eval_rule spline spreadsheet SPrem sprem
+sprintf Sqrfree sqrfree sqrt sscanf Ssi ssystem storage string StruveH StruveL
+sturm sturmseq subs subsindets subsop substring subtype Sum sum surd Svd
+symmdiff symmetric syntax system table tan tang taylor testeq testfloat TEXT
+thaw thiele time timelimit ToInert TopologicalSort traperror triangular
+trigsubs trunc type typematch unames unapply unassign undefined unit Unordered
+unprotect update UseHardwareFloats userinfo value Vector vector verify
+WeierstrassP WeberE WeierstrassPPrime WeierstrassSigma WeierstrassZeta whattype
+WhittakerM WhittakerW with worksheet writebytes writedata writeline writestat
+writeto zero Zeta zip ztrans
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" ' `
+
+$SL_COMMENT=//
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + - ^
diff --git a/support/highlight/langDefs/ms.lang b/support/highlight/langDefs/ms.lang
new file mode 100644
index 0000000000..8d08bd5fa9
--- /dev/null
+++ b/support/highlight/langDefs/ms.lang
@@ -0,0 +1,43 @@
+# MaxScript language definition file
+#
+# Author: André Simon
+# Mail: andre.simon1@gmx.de
+# Date: 20.11.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=MaxScript
+
+$KEYWORDS(kwa)=about animate as at by case catch collect continue coordsys
+default do else exit fn for function global group if in level local local
+mapped max of on parent persistent pivot return selection set struct then throw
+time to try undo where while with with world true false on off ok undefined
+unsupplied or and not
+
+$KEYWORDS(kwb)=utility rollout label button edittext combobox dropdownlist
+listbox spinner slider pickbutton pushbutton checkbutton macrobutton
+radiobuttons checkbox colorpicker mapbutton materialbutton progressbar timer
+bitmap rcmenu menuitem separator submenu macroscript tool plugin parameters
+
+$STRINGDELIMITERS="
+
+$SL_COMMENT=--
+
+$ML_COMMENT=/* */
+
+$ALLOWNESTEDCOMMENTS=false
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
diff --git a/support/highlight/langDefs/mssql.lang b/support/highlight/langDefs/mssql.lang
new file mode 100644
index 0000000000..81f65eee5e
--- /dev/null
+++ b/support/highlight/langDefs/mssql.lang
@@ -0,0 +1,104 @@
+# MSSQL, Microsoft SQL Server TSQL language definition file
+#
+# Author: Magnus Öberg
+# Mail: moggen@moggen.org
+# Date: 14.01.2005
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released
+# under the GPL.
+#
+
+$DESCRIPTION=MSSQL
+
+$KEYWORDS(kwa)= absolute action after all all_constraints all_errormsgs
+all_indexes all_levels alter and any ansi_defaults ansi_null_dflt_off
+ansi_null_dflt_on ansi_nulls ansi_padding ansi_warnings append
+arithabort arithignore as asc attach authorization auto backup begin
+between break browse bulk by cascade case check checkalloc checkcatalog
+checkconstraints checkdb checkfilegroup checkident checkpoint checktable
+cleantable close clustered collate commit committed compute concat
+concat_null_yields_null concurrencyviolation constraint contains
+containstable context_info continue count_rows create cross cube current
+cursor cursor_close_on_commit database datefirst dateformat dbcc
+dbrepair dbreindex deadlock_priority deallocate declare default delay
+delete deny desc disable_def_cnst_chk disk display distinct distributed
+drop drop_existing dropcleanbuffers dump dynamic elements else emptyfile
+encryption end entry escape estimateonly exec execute exists explicit
+fast fast_forward fastfirstrow fetch filegroup filegrowth file
+filelistonly filename fillfactor fips_flagger first fmtonly for force
+forceplan foreign forward_only free freeproccache freetext from full
+fullscan function global grant group go goto hash having headeronly help
+holdlock identity identity_insert if ignore_dup_key
+implicit_transactions in intermediate into index indexdefrag inner
+inputbuffer insert instead intensive into io is isolation join keep
+keep_replication key keyset kill labelonly language last left level like
+load loadhistory local lock_timeout log logspace loop low maxdop maxsize
+medianame mediapassword merge move name newalloc next no_infomsgs
+nocount noexec nonclustered noindex nolock norecompute norecovery
+noreseed noreset norewind normal not notruncate nounload nowait null
+numeric_roundabort of off offsets on only open opentran optimistic
+option or order outer output outputbuffer override pad_index paglock
+parse_only partial password percent physical_only primary prior pintable
+plan print privileges proc proccache procedure profile
+query_governor_cost_limit quoted_identifier raw read read_only
+readcommited readpast readtext readuncommited recompile reconfigure
+recovery references relative remote_proc_transactions
+repair_allow_data_loss repair_fast repair_rebuild repeatable
+repeatableread replace replication reseed reset restart restore
+restricted_user return returns revoke rewind right robust rollback
+rollup rowcount rowguidcol rowlock rows rule sample save schema
+schemabinding scroll scroll_locks select serializable set setuser
+showcontig show_statistics showplan_all showplan_text shrinkdatabase
+shrinkfile shutdown size some sqlperf standby startlog static statistics
+statistics_norecompute stats statusonly stopat stopatmark stopbefore
+stoplog some sort_in_tempdb table tableresults tablock tablockx tape
+textimage_on textsize then time to top traceoff traceon tracestatus tran
+transaction trigger truncate truncateonly type_warning uncommitted union
+unique unlimited unload unpintable update updatetext updateusage updlock
+use useoptions values varying verifyonly view view_metadata waitfor when
+where while with work xact_abort xml xmldata
+
+$KEYWORDS(kwb)= bigint binary bit char character datetime dec decimal
+double float image int integer money national nchar numeric nvarchar
+ntext precision real rowversion smalldatetime smallint smallmoney
+sql_variant text timestamp tinyint uniqueidetifier varbinary varchar
+varying
+
+$KEYWORDS(kwc)= @@connections @@cpu_busy @@cursor_rows @@datefirst @@dbts
+@@error @@fetch_status @@identity @@idle @@io_busy @@langid @@language
+@@lock_timeout @@max_connections @@max_precision @@nestlevel @@options
+@@pack_received @@pack_sent @@packet_errors @@procid @@remserver
+@@rowcount @@servername @@servicename @@spid @@textsize @@timeticks
+@@total_errors @@total_read @@total_write @@trancount @@version abs acos
+app_name ascii asin atan atn2 avg binary_checksum cast convert ceiling
+charindex checksum checksum_agg coalesce collationproperty col_length
+col_name columnproperty columns_updated cos cot count count_big
+current_timestamp current_user cursor_status databaseproperty
+databasepropertyex datalength dateadd datediff datename datepart day
+db_id db_name degrees difference exp file_id file_name filegroup_id
+filegroup_name filegroupproperty fileproperty floor formatmessage
+freetext freetexttable fulltextcatalogproperty fulltextserviceproperty
+getansinull getdate getutcdate grouping has_dbaccess host_id host_name
+ident_current ident_incr ident_seed indexkey_property indexproperty
+index_col is_member is_srvrolemember isdate isnull isnumeric left len
+log lower ltrim max min month newid nullif object_id object_name
+objectproperty opendatasource openquery openrowset openxml parsename
+patindex permissions pi power quotename radians raiseerror rand
+replicate reverse right round rowcount_big rtrim scope_identity
+serverproperty session_user sessionproperty sign sin soundex space
+sql_variant_property square sqrt stats_date stdev sdevp str stuff
+substring sum suser_id suser_name suser_sid suser_sname system_user tan
+textptr textvalid trigger_nestlevel typeproperty unicode upper user
+user_id user_name var varp year
+
+$STRINGDELIMITERS='
+
+$SL_COMMENT=--
+
+$ML_COMMENT=/* */
+
+$IGNORECASE=true
+
+$SYMBOLS= ( ) [ ] , ; : & | < > ! = / * % + - ^ ~
+
+$IDENTIFIER=regex(@?@?[a-zA-Z_][\w]*)
diff --git a/support/highlight/langDefs/n.lang b/support/highlight/langDefs/n.lang
new file mode 100644
index 0000000000..792639c6d4
--- /dev/null
+++ b/support/highlight/langDefs/n.lang
@@ -0,0 +1,47 @@
+# Nemerle language definition file
+# (http://nermerle.org)
+#
+# Author: Andre Simon
+# Mail: andre simon1 at gmx de
+# Date: 15/09/2005
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Nemerle
+
+$DIGIT=regex((?:0x|0X)[0-9a-fA-F]+|\d*[\.\_]?\d+(?:[eE][\-\+]\d+)?[lLuUbfdm]*)
+
+$KEYWORDS(kwa)= _ abstract and array as base catch class def delegate do else enum event extern finally for foreach fun if implements in interface
+internal lock macro match module mutable namespace new out override params private protected public ref sealed static struct syntax this throw try
+type typeof unless using variant virtual void when where while assert ignore
+
+$KEYWORDS(kwb)=array float int string void uint long ulong short decimal byte sbyte ushort double list
+
+$KEYWORDS(kwc)=true false null
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$RAWSTRINGPREFIX=@
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SL_COMMENT=//
+
+$ML_COMMENT=/* */
+
+$IGNORECASE=false
+
+$DIRECTIVE=#
+
+$SYMBOLS= ( ) [ ] { } , ; : . & | < > ! = / * % + -
diff --git a/support/highlight/langDefs/nas.lang b/support/highlight/langDefs/nas.lang
new file mode 100644
index 0000000000..9ad2ac955c
--- /dev/null
+++ b/support/highlight/langDefs/nas.lang
@@ -0,0 +1,36 @@
+# Nasal language definition file
+#
+# Author: André Simon
+# Mail: andre.simon1@gmx.de
+# Date: 18.11.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Nasal
+
+$KEYWORDS(kwa)= and or nil if elsif else for foreach while return
+break continue func size keys append pop int streq substr contains
+typeof
+
+$KEYWORDS(kwb)=parents me arg
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=#
+
+$ALLOWNESTEDCOMMENTS=false
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
diff --git a/support/highlight/langDefs/nbc.lang b/support/highlight/langDefs/nbc.lang
new file mode 100644
index 0000000000..178f2e122c
--- /dev/null
+++ b/support/highlight/langDefs/nbc.lang
@@ -0,0 +1,96 @@
+# NBC language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon@gmx.de
+# Date: 25.02.2010
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=NeXT Byte Codes
+
+$KEYWORDS(kwa)=add sub neg mul div mod and
+or xor not cmp tst index replace arrsize arrbuild arrsubset arrinit mov
+set flatten unflatten numtostr strtonum strcat strsubset strtoarr
+arrtostr jmp brcmp brtst syscall stop exit exitto acquire release
+subcall subret setin setout getin getout wait gettick thread endt
+subroutine follows precedes segment ends typedef struct dd void waitv
+call return abs sign strindex strreplace strlen shl shr sizeof compchk
+compif compelse compend valueof isconst asl asr lsl lsr rotl rotr start
+stopthread priority cmnt fmtnum compchktype
+
+$KEYWORDS(kwb)=byte ubyte db sbyte word uword dw sword dword udword dd
+sdword long ulong slong mutex
+
+$KEYWORDS(kwc)=tan sin cos sinh cosh arctan cotan arg exp ln log log
+logn sqr sqrt trunc int ceil floor heav abs sign zero ph rnd random max
+min power intpower InputIOType InputIOInputMode InputIORawValue
+InputIONormalizedValue InputIOScaledValue InputIOInvalidData
+OutputIOUpdateFlags OutputIOOutputMode OutputIOPower OutputIOActualSpeed
+OutputIOTachoCount OutputIOTachoLimit OutputIORunState OutputIOTurnRatio
+OutputIORegMode OutputIOOverload OutputIORegPValue OutputIORegIValue
+OutputIORegDValue OutputIOBlockTachoCount OutputIORotationCount
+FileOpenRead FileOpenWrite FileOpenAppend FileRead FileWrite FileClose
+FileResolveHandle FileRename FileDelete SoundPlayFile SoundPlayTone
+SoundGetState SoundSetState DrawText DrawPoint DrawLine DrawCircle
+DrawRect DrawGraphic SetScreenMode ReadButton CommLSWrite CommLSRead
+CommLSCheckStatus RandomNumber GetStartTick MessageWrite MessageRead
+CommBTCheckStatus CommBTWrite KeepAlive IOMapRead IOMapWrite
+IOMapReadByID IOMapWriteByID DisplayExecuteFunction CommExecuteFunction
+LoaderExecuteFunction
+Type
+InputMode
+RawValue
+NormalizedValue
+ScaledValue
+InvalidData
+UpdateFlags
+OutputMode
+Power
+ActualSpeed
+TachoCount
+TachoLimit
+RunState
+TurnRatio
+RegMode
+Overload
+RegPValue
+RegIValue
+RegDValue
+BlockTachoCount
+RotationCount
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$KEYWORDS(kwd)=regex(^(\w+)\:)
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=// ;
+
+$ML_COMMENT=/* */
+
+$ALLOWNESTEDCOMMENTS=false
+
+$IGNORECASE=false
+
+$DIRECTIVE=#
+
+$ESCCHAR=regex(\\\d{}|\\x\p{XDigit}{}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; . : & | < > ! = / * % + - ~
+
+$CONTINUATIONSYMBOL=\
+
+$REFORMATTING=true
+
+
+$DIGIT=regex((?:x|X)[-a-fA-F]+|\d*[\.]?\d+(?:[eE][\-\+]\\d+)?[lLuU]*)
diff --git a/support/highlight/langDefs/nice.lang b/support/highlight/langDefs/nice.lang
new file mode 100644
index 0000000000..b3b7802846
--- /dev/null
+++ b/support/highlight/langDefs/nice.lang
@@ -0,0 +1,25 @@
+# Nice language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 20.10.2003
+# 28.02.2004: added "class abstract" (thanks to Daniel Bonniot)
+# 22.03.2004: added $include statement
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Nice
+
+$KEYWORDS(kwa)=native requires ensures let var
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$INCLUDE=java
diff --git a/support/highlight/langDefs/nrx.lang b/support/highlight/langDefs/nrx.lang
new file mode 100644
index 0000000000..2fc9c33554
--- /dev/null
+++ b/support/highlight/langDefs/nrx.lang
@@ -0,0 +1,50 @@
+# NetRexx language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 24.7.2002
+# updated 12.1.04 to add more types (ansi c, iso 99)
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=NetRexx
+
+$KEYWORDS(kwa)= class private public abstract final interface dependent adapter
+deprecated extends uses implements
+method native returns signals
+properties private public inheritable constant static volatile unused
+transient indirect
+
+$KEYWORDS(kwb)= do label protect catch finally end signal
+if then else select case when otherwise
+loop forever for to by over until while leave iterate
+return exit
+
+$KEYWORDS(kwc)=ask digits form null source this super parent sourceline version
+trace var all results off methods
+package import numeric scientific engineering
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=--
+
+$ML_COMMENT=/* */
+
+$ALLOWNESTEDCOMMENTS=false
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; . : & | < > ! = / * % + - ~
diff --git a/support/highlight/langDefs/nsi.lang b/support/highlight/langDefs/nsi.lang
new file mode 100644
index 0000000000..5767926a3e
--- /dev/null
+++ b/support/highlight/langDefs/nsi.lang
@@ -0,0 +1,86 @@
+# This file was generated by context2highlight from the original ConTEXT highlighting scheme "NsisScript.chl"
+# THIS FILE HAS NOT BEEN TESTED AND MAY NEED SOME MORE WORK
+# Credits go to the original author of the CHL file, who is listed below.
+# ConTEXT: http://context.cx/
+# Highlight: http://www.andre-simon.de/
+#
+# Beginning of converted content...
+#////////////////////////////////////////////////////////////////////////////
+#
+# NSIS Script Highlighter written by Marc Noirot, noirotm AT free DOT fr
+#
+# Updated for NSIS 1.94 by Vedran Miletic, riva_station AT yahoo DOT com
+#
+# ConTEXT, Winamp2, Winamp3, NSIS, so fabulous apps :)
+#
+#////////////////////////////////////////////////////////////////////////////
+
+$DESCRIPTION=NSIS
+
+$IGNORECASE=false
+
+$SL_COMMENT=; #
+
+$KEYWORDS(kwa)=OutFile Name Caption SubCaption BrandingText Icon
+WindowIcon BGGradient SilentInstall SilentUnInstall
+CRCCheck MiscButtonText InstallButtonText FileErrorText
+InstallDir InstallDirRegKey LicenseText LicenseData
+ComponentText InstType EnabledBitmap DisabledBitmap
+SpaceTexts DirShow DirText AllowRootDirInstall
+InstallColors InstProgressFlags AutoCloseWindow
+ShowInstDetails DetailsButtonText CompletedText
+UninstallText UninstallIcon UninstallCaption
+UninstallSubCaption ShowUninstDetails
+UninstallButtonText SetOverwrite SetCompress
+SetDatablockOptimize SetDateSave Section SectionIn
+SectionEnd SectionDivider AddSize Function FunctionEnd
+XPStyle Var goto end
+
+#functions
+$KEYWORDS(kwb)=SetOutPath File Exec ExecWait ExecShell Rename Delete
+RMDir WriteRegStr WriteRegExpandStr WriteRegDWORD
+WriteRegBin WriteINIStr ReadRegStr ReadRegDWORD
+ReadINIStr ReadEnvStr ExpandEnvStrings DeleteRegValue
+DeleteRegKey EnumRegKey EnumRegValue DeleteINISec
+DeleteINIStr CreateDirectory CopyFiles
+SetFileAttributes CreateShortCut GetFullPathName
+SearchPath GetTempFileName CallInstDLL RegDLL UnRegDLL
+GetDLLVersion GetDLLVersionLocal GetFileTime
+GetFileTimeLocal Goto Call Return IfErrors ClearErrors
+SetErrors FindWindow SendMessage IsWindow IfFileExists
+MessageBox StrCmp IntCmp IntCmpU Abort Quit
+GetFunctionAddress GetLabelAddress GetCurrentAddress
+FindFirst FindNext FindClose FileOpen FileClose
+FileRead FileWrite FileReadByte FileWriteByte FileSeek
+SetDetailsView SetDetailsPrint SetAutoClose DetailPrint
+Sleep BringToFront HideWindow StrCpy StrLen Push Pop
+Exch IntOp IntFmt RebootIf RebootFlag SetRebootFlag
+WriteUninstaller
+
+#variables and constants
+$KEYWORDS(kwc)=SW_SHOWNORMAL SW_SHOWMAXIMIZED SW_SHOWMINIMIZED
+HKCR HKEY_CLASSES_ROOT HKLM HKEY_LOCAL_MACHINE HKCU
+HKEY_CURRENT_USER HKU HKEY_USERS HKCC
+HKEY_CURRENT_CONFIG HKDD HKEY_DYN_DATA HKPD
+HKEY_PERFORMANCE_DATA MB_OK MB_OKCANCEL
+MB_ABORTRETRYIGNORE MB_RETRYCANCEL MB_YESNO
+MB_YESNOCANCEL MB_ICONEXCLAMATION MB_ICONQUESTION
+MB_ICONSTOP MB_TOPMOST MB_SETFOREGROUND MB_RIGHT
+IDABORT IDCANCEL IDIGNORE IDNO IDOK IDRETRY IDYES
+NORMAL FILE_ATTRIBUTE_NORMAL ARCHIVE
+FILE_ATTRIBUTE_ARCHIVE HIDDEN FILE_ATTRIBUTE_HIDDEN
+OFFLINE FILE_ATTRIBUTE_OFFLINE READONLY
+FILE_ATTRIBUTE_READONLY SYSTEM FILE_ATTRIBUTE_SYSTEM
+TEMPORARY FILE_ATTRIBUTE_TEMPORARY ALT CONTROL EXT
+SHIFT
+
+$STRINGDELIMITERS=" '
+
+$SYMBOLS= ( ) [ ] { } , . : & | < > = / * % + - ~
+
+# Highlight variable names like ${name}. Only the name is highlighted as keyword.
+$KEYWORDS(kwd)=regex((\$\{\w+\}))
+
+# Highlight variables beginning with $, @ or %
+$KEYWORDS(kwd)=regex(\$\w+)
+$KEYWORDS(kwc)=regex(\!\w+)
diff --git a/support/highlight/langDefs/nut.lang b/support/highlight/langDefs/nut.lang
new file mode 100644
index 0000000000..79b6d88754
--- /dev/null
+++ b/support/highlight/langDefs/nut.lang
@@ -0,0 +1,34 @@
+# Squirrel language definition file
+#
+# Author: André Simon
+# Mail: andre.simon1@gmx.de
+# Date: 15.09.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Squirrel
+
+$KEYWORDS(kwa)=break catch clone continue case delegate delete default do else
+local for function foreach if in long null return resume switch this throw try
+typeof while yield
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=//
+
+$ML_COMMENT=/* */
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
diff --git a/support/highlight/langDefs/nxc.lang b/support/highlight/langDefs/nxc.lang
new file mode 100644
index 0000000000..74a40c5505
--- /dev/null
+++ b/support/highlight/langDefs/nxc.lang
@@ -0,0 +1,56 @@
+# NXC language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon@gmx.de
+# Date: 25.02.2010
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Not eXactly C
+
+$KEYWORDS(kwa)=__RETURN__ __RETVAL__ __STRRETVAL__ __TMPBYTE__
+__TMPWORD__ __TMPLONG__ abs asm bool break byte case char const continue
+default do else false for goto if inline int long mutex priority repeat
+return safecall short sign start stop string struct sub switch task true
+typedef until void while
+
+$KEYWORDS(kwb)=bool byte unsigned char char int short long long mutex
+string struct
+
+$KEYWORDS(kwc)=
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=//
+
+$ML_COMMENT=/* */
+
+$ALLOWNESTEDCOMMENTS=false
+
+$IGNORECASE=false
+
+$DIRECTIVE=#
+
+$ESCCHAR=regex(\\\d{}|\\x\p{XDigit}{}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; . : & | < > ! = / * % + - ~
+
+$CONTINUATIONSYMBOL=\
+
+$REFORMATTING=true
+
+
+$DIGIT=regex((?:x|X)[-a-fA-F]+|\d*[\.]?\d+(?:[eE][\-\+]\\d+)?[lLuU]*)
+
+$NESTED(asm)=regex(asm) regex(\})
diff --git a/support/highlight/langDefs/oberon.lang b/support/highlight/langDefs/oberon.lang
new file mode 100644
index 0000000000..a012e42bd3
--- /dev/null
+++ b/support/highlight/langDefs/oberon.lang
@@ -0,0 +1,39 @@
+# Oberon language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 20.11.2003
+# Update: 09.06.2009 added FOR keyword
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Oberon
+
+
+$KEYWORDS(kwa)=ARRAY BEGIN CASE CONST DIV DO ELSE ELSIF END EXIT IF IMPORT IN IS
+LOOP MOD MODULE NIL OF OR PROCEDURE RECORD REPEAT RETURN THEN TO TYPE UNTIL
+VAR WHILE WITH ABS ODD CAP ASH LEN MAX MIN SIZE ORD CHR SHORT LONG ENTIER INC
+DEC INCL EXCL COPY NEW HALT ADR BIT CC LSH ROT VAL GET PUT MOVE NEW FOR
+
+$KEYWORDS(kwb)=BOOLEAN CHAR SHORTINT INTEGER LONGINT REAL LONGREAL SET ARRAY
+RECORD POINTER BYTE
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS="
+
+$ML_COMMENT=(* *)
+
+$IGNORECASE=false
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * . + - #
+
diff --git a/support/highlight/langDefs/objc.lang b/support/highlight/langDefs/objc.lang
new file mode 100644
index 0000000000..7cc435bd4e
--- /dev/null
+++ b/support/highlight/langDefs/objc.lang
@@ -0,0 +1,50 @@
+# Objective C language definition file
+#
+# Author: Andr�Simon
+# Mail: andre.simon1@gmx.de
+# Date: 08.02.04
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Objective C
+
+$KEYWORDS(kwa)=goto break return continue asm case default if else switch while for do sizeof typeof
+typedef inline stdcall auto cdecl class const_cast delete dynamic_cast explicit
+extern friend goto inline mutable namespace new operator pascal register reinterpret_cast private
+protected public static_cast template this throw try catch typeid using virtual volatile true false
+id Class SEL IMP BOOL oneway in out inout bycopy byref self super nil NIL TRUE FALSE
+
+$KEYWORDS(kwb)=int long short char void signed unsigned float double size_t wchar_t ptrdiff_t
+sig_atomic_t fpos_t clock_t time_t va_list jmp_buf FILE DIR div_t ldiv_t static register auto
+volatile extern const bool struct union enum
+
+#$KW_PREFIX(kwa)=@
+
+$KEYWORDS(kwa)=regex(@\w+)
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=//
+
+$ML_COMMENT=/* */
+
+$ALLOWNESTEDCOMMENTS=false
+
+$IGNORECASE=false
+
+$DIRECTIVE=#
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
diff --git a/support/highlight/langDefs/octave.lang b/support/highlight/langDefs/octave.lang
new file mode 100644
index 0000000000..98ca6f3276
--- /dev/null
+++ b/support/highlight/langDefs/octave.lang
@@ -0,0 +1,65 @@
+# Octave language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 13.04.04
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Octave
+
+$KEYWORDS(kwa)=all_va_args elseif endfunction global return break end endif gplot try
+catch end_try_catch endwhile gsplot unwind_protect continue end_unwind_protect for
+ifunwind_protect_cleanup else endfor function persistent while
+
+$KEYWORDS(kwb)=DEFAULT_EXEC_PATH current_script_file_name max_recursion_depth variables_can_hide_functions
+DEFAULT_LOADPATH debug_on_error octave_core_file_formatwarn_assign_as_truth_value
+EDITOR debug_on_interrupt octave_core_file_limit warn_divide_by_zero
+EXEC_PATH debug_on_warning octave_core_file_namewarn_empty_list_elements
+FFTW_WISDOM_PROGRAM debug_symtab_lookups output_max_field_width warn_fortran_indexing
+IMAGEPATH default_save_formatoutput_precision warn_function_name_clash
+INFO_FILE echo_executing_commandspage_output_immediatelywarn_future_time_stamp
+INFO_PROGRAM fixed_point_format page_screen_output warn_imag_to_real
+LOADPATH gnuplot_binary print_answer_id_name warn_matlab_incompatible
+MAKEINFO_PROGRAM gnuplot_command_axes print_empty_dimensions warn_missing_semicolon
+PAGER gnuplot_command_end print_rhs_assign_val warn_neg_dim_as_zero
+PS1 gnuplot_command_plot save_header_format_stringwarn_num_to_str
+PS2 gnuplot_command_replot save_precision warn_precedence_change
+PS4 gnuplot_command_splot saving_history warn_reload_forces_clear
+__kluge_procbuf_delay__ gnuplot_command_title sighup_dumps_octave_core warn_resize_on_range_error
+__nargin__ gnuplot_command_usingsigterm_dumps_octave_corewarn_separator_insert
+ansgnuplot_command_with silent_functions warn_single_quote_string
+automatic_replot gnuplot_has_frames split_long_rowswarn_str_to_num
+beep_on_errorhistory_file string_fill_char warn_undefined_return_values
+completion_append_char history_size struct_levels_to_print warn_variable_switch_label
+crash_dumps_octave_coreignore_function_time_stamp suppress_verbose_help_message
+
+
+$KEYWORDS(kwc)=abs asinh cosh floor isalpha isinf isspace real tan
+acos atan erf gammaisascii islower isupper roundtanh
+acoshatanherfc gammaln iscntrl isna isxdigitsign toascii
+angleceil exp imag isdigit isnanlgamma sin tolower
+arg conj finite is_nan_or_na isfiniteisprint log sinh toupper
+asin cos fix isalnum isgraph ispunct log10sqrt
+
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=#
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
diff --git a/support/highlight/langDefs/oorexx.lang b/support/highlight/langDefs/oorexx.lang
new file mode 100644
index 0000000000..0180b0d899
--- /dev/null
+++ b/support/highlight/langDefs/oorexx.lang
@@ -0,0 +1,55 @@
+# Open Object Rexx language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 27.06.2007
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Open Object Rexx
+
+# Keyword-instructions
+
+$KEYWORDS(kwa)=address additional any arg arguments array by call caseless
+continue class description digits do drop end engineering error exit expose
+else failure for forever form forward fuzz guard halt if interpret iterate
+leave lower lostdigits message name nop nomethod nostring notready novalue
+numeric on off otherwise parse procedure pull push propagate queue raise reply
+return ret rc say scientific select sigl signal source syntax then to trace
+upper until use user version when while with
+
+# Directives
+$KEYWORDS(kwb)=class method requires routine
+
+# built in functions
+$KEYWORDS(kwc)=abbrev abs address arg b2x beep bitand bitor bitxor c2d c2x center
+changestr charin charout chars compare condition copies countstr d2c d2x
+datatype date delstr delword digits directory endlocal errortext filespec
+form format fuzz insert lastpos left length linein lineout lines max min
+overlay pos queued random reverse right rxfuncadd rxfuncdrop rxfuncquery
+rxqueue setlocal sign sourceline space stream strip substr subword symbol
+time trace translate trunc userid value var verify word wordindex wordlength
+wordpos words x2b x2c x2d xrange
+
+$KEYWORDS(kwd)=regex((\w+)\s*\:)
+
+$SL_COMMENT=-- #
+
+$ML_COMMENT=/* */
+
+$STRINGDELIMITERS=' "
+
+#$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS=+ - \ / % * | | & = > < . , ; : ( ) [ ] ~
+
+$IGNORECASE=true
diff --git a/support/highlight/langDefs/os.lang b/support/highlight/langDefs/os.lang
new file mode 100644
index 0000000000..bd4838aaf2
--- /dev/null
+++ b/support/highlight/langDefs/os.lang
@@ -0,0 +1,36 @@
+# Object Script language definition file
+#
+# Author: André Simon
+# Mail: andre.simon1@gmx.de
+# Date: 20.11.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Object Script
+
+$KEYWORDS(kwa)=new instanceof castToBoolean castToString castToExactNumber castToInexactNumber
+var writeln if while for break continue try catch finally throw synchronized const public
+function extends return eval this true false null import write
+
+$KEYWORDS(kwb)=Object ExactNumber String Exception Thread
+
+$STRINGDELIMITERS="
+
+$ML_COMMENT=/* */
+
+$SL_COMMENT=//
+
+$IGNORECASE=false
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
+
+
diff --git a/support/highlight/langDefs/oz.lang b/support/highlight/langDefs/oz.lang
new file mode 100644
index 0000000000..305341b193
--- /dev/null
+++ b/support/highlight/langDefs/oz.lang
@@ -0,0 +1,50 @@
+# Oz language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 24.7.2002
+# updated 12.1.04 to add more types (ansi c, iso 99)
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Oz
+
+$KEYWORDS(kwa)=andthen at attr case catch choice
+class cond declare define dis
+div else elsecase elseif end
+export fail false feat finally from
+fun functor if import in local
+lock meth mod not of or orelse
+prepare proc prop raise require
+self skip then thread true try
+unit for do
+
+$KEYWORDS(kwb)=
+
+$KEYWORDS(kwc)=
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS="
+
+$SL_COMMENT=%
+
+$ML_COMMENT=/* */
+
+$ALLOWNESTEDCOMMENTS=true
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; . : & | < > ! = / * % + - ~ # @
+
diff --git a/support/highlight/langDefs/pas.lang b/support/highlight/langDefs/pas.lang
new file mode 100644
index 0000000000..8ac71d2934
--- /dev/null
+++ b/support/highlight/langDefs/pas.lang
@@ -0,0 +1,55 @@
+# Pascal/Object Pascal language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 10.1.2002
+# 27.10.2004: Added modifications made by Jens Theess for the TotalCommander
+# Lister plugin (http://www.theess.com/highlight)
+# 01.09.2009: Added nested directive
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Pascal
+
+$KEYWORDS(kwa)= absolute abstract and array as asm assembler automated begin case
+cdecl class const constructor destructor dispid dispinterface div do downto
+dynamic else end except export exports external far file finalization finally
+for forward function goto if implementation in initialization inherited inline
+interface is label library message mod near nil not object of or out override
+packed pascal private procedure program property protected public published
+raise record register repeat resourcestring safecall set shl shr stdcall string
+then threadvar to try type unit until uses var virtual while with xor
+
+$KEYWORDS(kwb)=boolean char integer pointer real text
+true false cardinal longint byte word single double int64
+
+$KEYWORDS(kwc)=if else then downto do for repeat while to until with
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=//
+
+$ML_COMMENT={ } (* *)
+
+$IGNORECASE=true
+
+$SYMBOLS= ( ) [ ] , ; : & | < > ! = / * % + - @ . ^
+
+$ESCCHAR=regex(\#\$\p{XDigit}{2}|\#\d{,3})
+
+$DIGIT=regex((?:0x|0X|\$)[0-9a-fA-F]+|\d*[\.\_]?\d+(?:[eE][\-\+]\d+)?[lLuUbfdm]*)
+
+$ALLOWEXTESCAPE=true
+
+$NESTED(asm)=regex(asm) regex(end;)
diff --git a/support/highlight/langDefs/php.lang b/support/highlight/langDefs/php.lang
new file mode 100644
index 0000000000..f73d50c419
--- /dev/null
+++ b/support/highlight/langDefs/php.lang
@@ -0,0 +1,57 @@
+# PHP3/4/5 language definition file
+#
+# Author: Andre Simon
+# (most keywords taken from the VIM-syntax file)
+# Mail: andre.simon1@gmx.de
+# Date: 27.1.2003
+# Update 28.02.04: added "class function extends"
+# Update 01.09.09: removed all library function names, added regex for uppercase constants
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=PHP
+
+$KEYWORDS(kwa)= abstract and array as break
+case catch cfunction class clone
+const continue declare default do
+else elseif enddeclare endfor endforeach
+endif endswitch endwhile extends final
+for foreach function global goto
+if implements interface instanceof
+namespace new old_function or private
+protected public static switch throw
+try use var while xor
+__CLASS__ __DIR__ __FILE__ __FUNCTION__ __METHOD__ __NAMESPACE__
+die echo empty exit eval
+include include_once isset list require
+require_once return print unset
+
+$KEYWORDS(kwb)= int integer real double float string array object
+
+#$KEYWORDS(kwb)=regex([A-Z\_]+)
+
+$KEYWORDS(kwc)=regex(\$\w+)
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=// #
+
+$ML_COMMENT=/* */
+
+$IGNORECASE=true
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * + - . @
diff --git a/support/highlight/langDefs/pike.lang b/support/highlight/langDefs/pike.lang
new file mode 100644
index 0000000000..af03b48b1b
--- /dev/null
+++ b/support/highlight/langDefs/pike.lang
@@ -0,0 +1,55 @@
+# Pike language definition file
+#
+# Author: Olivier Girondel
+# Mail: olivier.girondel@cw.com
+# Date: 2003/04/08
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+
+$DESCRIPTION=Pike
+
+$KEYWORDS(kwc)=__parse_pike_type _disable_threads _do_call_outs _exit _gc_status _leak _memory_usage
+_next _prev _refs _static_modules _typeof abs acos add_constant add_include_path add_module_path
+add_program_path aggregate aggregate_mapping aggregate_multiset alarm all_constants all_threads
+allocate array_sscanf arrayp asin atan atan2 atexit backtrace basename call_function call_out
+call_out_info cd ceil chmod chown chroot cleargroups clone closelog column combine_path
+combine_path_nt combine_path_unix compile compile_file compile_string copy_value cos cpp crypt
+ctime decode_value delay describe_backtrace describe_error destruct dirname encode_value
+encode_value_canonic endgrent endpwent enumerate equal errno exece exit exp explode_path file_stat
+file_truncate filesystem_stat filter find_call_out floatp floor fork function_name function_object
+functionp gc get_all_groups get_all_users get_dir get_groups_for_user get_weak_flag getcwd getegid
+getenv geteuid getgid getgrent getgrgid getgrnam getgroups gethostbyaddr gethostbyname gethostname
+gethrtime getpgrp getpid getppid getpwent getpwnam getpwuid getsid getuid glob gmtime hardlink
+has_index has_prefix has_suffix has_value hash hash_7_0 indices initgroups innetgr intp
+is_absolute_path kill load_module localtime log lower_case m_delete map mappingp master max min
+mkdir mkmapping mkmultiset mktime multisetp mv new next_object normalize_path object_program
+object_variablep objectp openlog pow programp putenv query_num_arg random random_seed random_string
+readlink remove_call_out remove_include_path remove_module_path remove_program_path replace
+replace_master reverse rm round rows rusage search set_priority set_weak_flag setegid seteuid setgid
+setgrent setgroups setpgrp setpwent setresgid setresuid setsid setuid sgn signal signame signum sin
+sizeof sleep sort sprintf sqrt strerror string_to_unicode string_to_utf8 stringp strlen symlink
+syslog tan this_object this_thread thread_create thread_local throw time trace ualarm umask uname
+unicode_to_string upper_case utf8_to_string utime values version werror write zero_type
+
+$KEYWORDS(kwb)=array constant extern float function int local mapping mixed multiset object program static string void
+
+$KEYWORDS(kwa)=constant enum typedef if do for while else foreach case switch
+break continue return sscanf typeof catch gauge class lambda import inherit
+facet final static private local public protected nomask inline extern optional variant
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=//
+
+$ML_COMMENT=/* */
+
+$IGNORECASE=false
+
+$DIRECTIVE=#
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
diff --git a/support/highlight/langDefs/pl.lang b/support/highlight/langDefs/pl.lang
new file mode 100644
index 0000000000..6ae342f4eb
--- /dev/null
+++ b/support/highlight/langDefs/pl.lang
@@ -0,0 +1,48 @@
+# Perl language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 28.01.2003
+# Update: 11.09.2007 (regex kwb)
+# Update: 11.09.2008 (regex pattern)
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Perl
+
+$KEYWORDS(kwa)=and cmp continue else elsif eq for foreach ge goto gt if last
+le lt do ne next not or package return sub switch unless until use while xor
+
+# TODO string functions, array functions etc
+$KEYWORDS(kwc)=my local print
+
+$STRINGDELIMITERS=" ' END
+
+$SL_COMMENT=#
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$ALLOWEXTESCAPE=true
+
+$KEYWORDS(kwb)=regex([$@%]\#?\w+)
+
+#$KEYWORDS(kwc)=regex((\$\{(\w+)\}))
+
+# pattern to highlight regexes (m//, s///, tr ///)
+$KEYWORDS(kwc)=regex(m?\/.*?\/|(s|tr)\/.*?\/.*?\/[cegimosx]*, 0)
+
+$KEYWORDS(kwd)=regex((->)?([a-zA-Z_]+)\s*[\(;])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * + - $ . ^ ~ %
+
diff --git a/support/highlight/langDefs/pl1.lang b/support/highlight/langDefs/pl1.lang
new file mode 100644
index 0000000000..d865386433
--- /dev/null
+++ b/support/highlight/langDefs/pl1.lang
@@ -0,0 +1,193 @@
+# PL/1 script language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 04.03.2003
+# 22.02.2010 added group kwc
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=PL/1
+
+$KEYWORDS(kwa)=call chksucc close dcl do end if open put read
+
+# functions
+$KEYWORDS(kwb)=afpbdoc afpbfld afpbgrp afpbpag afpbpar afpbrow afpbtbl afpcare
+afpdfld afpdfnt afpdrow afpeare afpedoc afpefld afpegrp afpend afpepag afpepar
+afperow afpetbl afpiobj afpiovl afpipsg afpinit afpinvm afppare afppbox afppchs
+afpprul afpptag afpptxt afpqatt afpqpos afpsclr afpsfnt afpsics afpslib afpsout
+afpspos afpsrth afpsuni afpswsp afpterm afpxare afp_reuse_option afpapi_handle
+afp_alignment_char afp_alignment_option afp_alignment_position afp_area_frame
+afp_area_handle afp_area_rotation afp_area_width afp_bottom_thickness
+afp_bot_rule_offset afp_box_depth afp_box_width afp_character_spacing
+afp_character_string afp_code_page afp_color afp_column_width_array
+afp_concatenate afp_current_handle afp_descriptive_name afp_desc_name_length
+afp_direction afp_document_handle afp_doc_page_depth afp_doc_page_width
+afp_field_id afp_first_line_indent afp_first_line_offset afp_font_id
+afp_font_library afp_font_width afp_format_option afp_group_name
+afp_inline_option afp_left_margin afp_left_thickness afp_line_length
+afp_line_spacing afp_max_area_depth afp_max_table_depth afp_medium_map_name
+afp_min_subrow_depth_array afp_number_columns afp_number_subrows
+afp_object_depth afp_object_library afp_object_mapping_option afp_object_name
+afp_object_rotation afp_object_width afp_object_x_offset afp_object_y_offset
+afp_output_filemode afp_output_filename afp_output_filetype
+afp_output_record_size afp_ovly_name afp_page_depth afp_page_handle
+afp_page_orientation afp_page_width afp_paragraph_frame afp_paragraph_handle
+afp_point_size afp_position_option afp_pseg_library afp_pseg_name afp_replace
+afp_right_margin afp_right_thickness afp_rotation afp_row_arrange_array
+afp_row_id afp_rt_rule_offset afp_rule_length afp_rule_thickness
+afp_shading_intensity afp_shading_pattern afp_string_length afp_style
+afp_table_handle afp_table_rotation afp_table_width afp_tag_name afp_tag_value
+afp_text_orientation afp_top_thickness afp_trace afp_underline
+afp_unit_of_measure afp_vertical_format afp_weight afp_word_spacing
+afp_x_coordinate afp_x_ref_coord_sys afp_y_coordinate afp_y_ref_coord_sys
+afp_errdata afp_area_depth afp_current_table_depth afp_paragraph_depth
+afp_remaining_length afp_remaining_string afp_ret_code afp_severity_code
+afp_table_depth do_afpbdoc do_afpbfld do_afpbgrp do_afpbpag do_afpbpar
+do_afpbrow do_afpbtbl do_afpcare do_afpdfld do_afpdfnt do_afpdrow do_afpeare
+do_afpedoc do_afpefld do_afpegrp do_afpend do_afpepag do_afpepar do_afperow
+do_afpetbl do_afpinit do_afpinvm do_afpiobj do_afpiovl do_afpipsg do_afppare
+do_afppbox do_afppchs do_afpprul do_afpptag do_afpptxt do_afpqatt do_afpqpos
+do_afpsclr do_afpsfnt do_afpsics do_afpslib do_afpsout do_afpspos do_afpsrth
+do_afpsuni do_afpswsp do_afpterm do_afpxare afp_default black blue bold brown
+center center_and_trim char cm condensed cyan default_map double_dot errer
+expanded extrabold extracond extraexp extralight fals fatal focenter fojustify
+foleft foright green inch italic light l_ft magenta media medium mm noerror
+normal noshade orient0 orient180 orient270 orient90 orientdoc point_to_pel
+position_and_trim red roman rotate0 rotate180 rotate270 rotate90 rotate_default
+r_ght scale_to_fit screen semibold semicond semiexp semilight severe stndard
+tru txtor0_0 txtor180_270 txtor270_0 txtor90_180 u1440 u240 ultrabold ultracond
+ultraexp ultralight verbottom vercenter vertop warning xabs xdirection xrel
+yabs ydirection yellow ylines yrel er_abort er_aparent er_applmem er_areamem
+er_areanotfnd er_area_off_page er_attsmem er_back er_beggrp er_beginfld
+er_beginrow er_blkmem er_blktype er_codepage er_createpara er_createtable
+er_dcffenv er_dcfmem er_deffield er_deffont er_defrow er_depth_exceeded
+er_docexists er_dparent er_end er_enddoc er_endfld er_endgrp er_endpage
+er_endpara er_endrow er_endtable er_end_of_page er_fail er_fieldndef
+er_fieldnotfnd er_fldatsmem er_fldmem er_fontatsmem er_fontdefs er_fontindex
+er_fontmem er_fontnotfnd er_fontsize er_formatter_abend er_incobj er_incovly
+er_incpseg er_inullptr er_invfont er_invmm er_invpseg er_invsubrow er_ivalign
+er_ivarealen er_ivarearot er_ivareawid er_ivarshade er_ivarshint er_ivblkp
+er_ivblock er_ivboxdepth er_ivboxwidth er_ivbxshade er_ivbxshint er_ivcodepg
+er_ivcolor er_ivcolorp er_ivcolwid er_ivcontrol er_ivcspace er_ivcspacep
+er_ivdatas er_ivddname er_ivdepth er_ivdesclen er_ivdescnm er_ivdirection
+er_ivfldbot er_ivfldfr er_ivfldlft er_ivfldor er_ivfldrght er_ivfmode er_ivfont
+er_ivfontid er_ivfontlib er_ivfontrot er_ivformat er_ivgrpname er_ivhor
+er_ivinline er_ivlinesp er_ivlmar er_ivlthick er_ivnumcols er_ivnumrows
+er_ivobjdepth er_ivobjlib er_ivobjmap er_ivobjrot er_ivobjwidth er_ivobjxpos
+er_ivobjypos er_ivoutds er_ivparabof er_ivparadep er_ivparaform er_ivparaind
+er_ivparalen er_ivparalof er_ivparalsp er_ivparamar er_ivparaoff er_ivpgdep
+er_ivpgwid er_ivprshade er_ivprshint er_ivpseglib er_ivptsize er_ivrequest
+er_ivrmar er_ivrotate er_ivrowdep er_ivrowfr er_ivrowid er_ivrulelen er_ivshade
+er_ivshint er_ivspace er_ivstrlen er_ivstyle er_ivtabldep er_ivtablerot
+er_ivtagname er_ivtagvalue er_ivtblbot er_ivtbllft er_ivtblrght er_ivtbltop
+er_ivthick er_ivtype er_ivunitp er_ivunits er_ivver er_ivweight er_ivwidth
+er_ivwspace er_ivxpos er_ivxposp er_ivxref er_ivypos er_ivyposp er_ivyref
+er_linelen_overf er_loadmod er_marg_overf er_mbarea er_negative er_nestgrps
+er_noactgrp er_noattptr er_noatts er_nobeggrp er_nocursor er_nofldptr
+er_nofontptr er_norowptr er_notacst er_notact er_notact_bgrp er_notact_def
+er_notact_efld er_notact_egrp er_notact_epar er_notact_erow er_notact_etbl
+er_notact_inc er_notact_incobj er_notact_incps er_notact_invmm er_notact_mov
+er_notact_out er_notact_ptag er_notact_put er_notact_puta er_notact_putd
+er_notact_putf er_notact_putl er_notact_sbox er_notact_set er_notact_setcol
+er_notact_setisp er_notact_setwsp er_notact_sfld er_notact_slibs er_notact_srow
+er_notend er_notended er_notfound er_notinit er_notstrt er_no_definition
+er_no_formatter_handle er_no_object er_no_shade er_no_storage er_nullcontrol
+er_nullptr er_off_page er_overflow er_pagexists er_paraexists er_pparent
+er_putarea er_putbox er_putline er_putstr er_puttag er_puttext er_qatts
+er_qfont_notfound er_read_lib er_replace er_rowatsmem er_rowmem er_rownotfnd
+er_row_too_deep er_setcolor er_setcspac er_setfont er_setlibs er_setlthck
+er_setout er_setpgor er_setunits er_setwordsp er_startfont er_tablexists
+er_term er_too_big er_too_wide er_trace er_write_output
+
+
+$KEYWORDS(kwc)= abnormal abs acos acosf add addbuff addr addrdata alias aligned all
+alloc allocate allocation allocn allocsize any anycondition area ascii
+asin asinf asm asmtdli assembler assignable atan atand atanf atanh
+attach attention attn auto automatic availablearea backwards based begin
+bigendian bin binary binaryvalue bind binvalue bit bitloc bitlocation
+bkwd blksize bool buf buffered buffers bufnd bufni bufoff bufsp builtin
+bx by byaddr byte byvalue b4 cast cds ceil center centerleft
+centerright centre centreleft centreright char character charg
+chargraphic charval check checkstg cmpat cobol col collate column
+comment compare compiledate compiletime completion complex cond
+condition conjg conn connected consecutive controlled conv conversion
+copy cos cosd cosf cosh count counter cpln cplx cs cstg ctl ctlasa
+ctl360 currentsize currentstorage data datafield date datetime days
+daystodate daystosecs db dec decimal declare def default define
+defined delay delete descriptor descriptors detach dft dim dimacross
+dimension direct display divide downthru edit else empty endfile
+endpage entry entryaddr env environment epsilon erf erfc error event
+excl exclusive exit exp expf exponent exports ext external fb fbs fetch
+file fileddint fileddtest fileddword fileid fileopen fileread fileseek
+filetell filewrite finish first fixed fixedbin fixeddec fixedoverflow
+float floatbin floatdec floor flush fofl format fortran free from
+fromalien fs gamma generic genkey get getenv go goto graphic gx handle
+hbound hex hexadec heximage high huge iand ieee ieor ignore imag in
+index indexarea indexed init initial inline inot input int inter
+internal into invalidop ior irred irreducible isfinite isigned isinf
+isll ismain isnan isnormal iszero isrl iunsigned key keyed keyfrom
+keylength keyloc keyto label last lbound leave left length like limited
+line lineno linesize linkage list littleendian loc locate location log
+logf loggamma log10 log10f log2 low lowercase lower2 maccol maclmar
+macname macrmar main max maxexp maxlength memconvert memindex memsearch
+memsearchr memverify memverifyr min minexp mod mpstr multiply name
+native ncp new nocharg nochargraphic nocheck nocmpat noconv noconversion
+nodescriptor noexecops nofixedoverflow nofofl noinline nolock nomap
+nomapin nomapout nonassignable nonconnected nonnative noofl nooverflow
+norescan normal nosize nostrg nostringrange nostringsize nostrz nosubrg
+nosubscriptrange noufl nounderflow nowrite nozdiv nozerodivide null
+offset offsetadd offsetdiff offsetsubtract offsetvalue ofl omitted on
+onchar oncode oncondcond oncondid oncount onfile ongsource onkey online
+onloc onoffset onsource onsubcode onwchar onwsource optional
+options order ordinal ordinalname ordinalpred ordinalsucc other
+otherwise output overflow package packagename page pageno pagesize
+parameter parmset password pending pic picspec picture places pliascii
+plicanc plickpt plidelete plidump pliebcdic plifill plifree plimove
+pliover plirest pliretc pliretv plisaxa plisaxb plisaxc plisrta plisrtb
+plisrtc plisrtd plitdli pointer pointeradd pointerdiff pointersubtract
+pointervalue poly pos position prec precision pred present print
+priority proc procedure procedurename procname prod ptr ptradd ptrdiff
+ptrsubtract ptrvalue putenv quote radix raise2 random range rank
+real record recsize recursive red reducible reentrant refer
+regional reg12 release rem reorder repattern repeat replaceby2 reply
+reread rescan reserved reserves resignal respec retcode return returns
+reuse reverse revert rewrite right round samekey scalarvarying scale
+search searchr secs secstodate secstodays select seql sequential
+serialize4 set sign signal signed sin sind sinf sinh sis size skip snap
+sourcefile sourceline sqrt sqrtf stackaddr statement static status stg
+stmt stop storage stream strg string stringrange stringsize structure
+strz subrg subscriptrange substr subtract succ sum suppress sysin
+sysnull sysparm sysprint system sysversion tally tan tand tanf tanh task
+then thread threadid time tiny title to total tpk tpm transient
+translate transmit trim trkofl trunc type ufl ulength ulength16 ulength8
+unal unaligned unallocated unbuf unbuffered undefinedfile underflow undf
+unlock unsigned unspec until update upos uppercase upthru usubstr uvalid
+uwidth valid validdate value var varglist vargsize variable varying
+varyingz vb vbs verify verifyr vs vsam wait wchar wcharval weekday when
+whigh while widechar wlow write xmlchar y4date y4julian y4year zdiv
+zerodivide
+
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS="
+
+$SL_COMMENT=--
+
+$ML_COMMENT=/* */
+
+$IGNORECASE=true
+
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
+
diff --git a/support/highlight/langDefs/pov.lang b/support/highlight/langDefs/pov.lang
new file mode 100644
index 0000000000..c70df5df97
--- /dev/null
+++ b/support/highlight/langDefs/pov.lang
@@ -0,0 +1,59 @@
+# POV-Ray 3.1 language definition file
+#
+# Author: Christian Perle
+# Mail: perle@itm.tu-clausthal.de
+# Date: 15.11.2002
+# (01.03.03) Format updated by André Simon
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=POV-Ray
+
+$KEYWORDS(kwa)=bicubic_patch blob box camera cone cubic cylinder difference disc height_field intersection julia_fractal lathe
+light_source merge mesh object plane poly polygon prism quadric quartic smooth_triangle sor sphere superellipsoid text
+torus triangle union
+
+$KEYWORDS(kwb)=aa_level aa_threshold abs acos acosh adaptive adc_bailout agate agate_turb all alpha ambient ambient_light angle
+aperture arc_angle area_light asc asin asinh assumed_gamma atan atan2 atanh atmosphere atmospheric_attenuation attenuating
+average background black_hole blue blur_samples bounded_by box_mapping bozo break brick brick_size brightness brilliance
+bumps bumpy1 bumpy2 bumpy3 bump_map bump_size case caustics ceil checker chr clipped_by clock color color_map colour
+colour_map component composite concat confidence conic_sweep constant control0 control1 cos cosh count crackle crand
+cube cubic_spline cylindrical_mapping debug declare default degrees dents diffuse direction distance distance_maximum div
+dust dust_type eccentricity else emitting end error error_bound exp exponent fade_distance fade_power falloff falloff_angle
+false file_exists filter finish fisheye flatness flip floor focal_point fog fog_alt fog_offset fog_type frequency gif
+global_settings glowing gradient granite gray_threshold green halo hexagon hf_gray_16 hierarchy hollow hypercomplex if
+ifdef iff image_map incidence include int interpolate inverse ior irid irid_wavelength jitter lambda leopard linear
+linear_spline linear_sweep location log looks_like look_at low_error_factor mandel map_type marble material_map matrix max
+max_intersections max_iteration max_trace_level max_value metallic min minimum_reuse mod mortar nearest_count no normal
+normal_map no_shadow number_of_waves octaves off offset omega omnimax on once onion open orthographic panoramic pattern1
+pattern2 pattern3 perspective pgm phase phong phong_size pi pigment pigment_map planar_mapping png point_at pot pow ppm
+precision pwr quadratic_spline quaternion quick_color quick_colour quilted radial radians radiosity radius rainbow
+ramp_wave rand range reciprocal recursion_limit red reflection refraction render repeat rgb rgbf rgbft rgbt right ripples
+rotate roughness samples scale scallop_wave scattering seed shadowless sin sine_wave sinh sky sky_sphere slice slope_map
+smooth specular spherical_mapping spiral spiral1 spiral2 spotlight spotted sqr sqrt statistics str strcmp strength strlen
+strlwr strupr sturm substr switch sys t tan tanh test_camera_1 test_camera_2 test_camera_3 test_camera_4 texture texture_map
+tga thickness threshold tightness tile2 tiles track transform translate transmit triangle_wave true ttf turbulence turb_depth
+type u ultra_wide_angle up use_color use_colour use_index u_steps v val variance vaxis_rotate vcross vdot version vlength
+vnormalize volume_object volume_rendered vol_with_light vrotate v_steps warning warp water_level waves while width wood
+wrinkles x y yes z
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=//
+
+$ML_COMMENT=/* */
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
diff --git a/support/highlight/langDefs/pro.lang b/support/highlight/langDefs/pro.lang
new file mode 100644
index 0000000000..d40f136053
--- /dev/null
+++ b/support/highlight/langDefs/pro.lang
@@ -0,0 +1,47 @@
+# Prolog language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 08.02.04
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Prolog
+
+$KEYWORDS(kwa)= true fail at_end_of_stream nl repeat halt is rem mod
+
+
+$KEYWORDS(kwb)=call catch throw unify_with_occurs_check var atom integer float atomic compound nonvar number functor arg copy_term clause current_predicate asserta assertz retract
+abolish findall bagof setof current_input current_output set_input set_output open close stream_property at_end_of_stream set_stream_position get_char get_code peek_char
+peek_code put_char put_code nl get_byte peek_byte put_byte read_term read write_term write writeq write_canonical op current_op char_conversion current_char_conversion once
+atom_length atom_concat sub_atom atom_chars atom_codes char_code number_chars number_codes set_prolog_flag current_prolog_flag halt sin cos atan exp log sqrt
+
+#avoid highlighting of 0'var as string
+$KEYWORDS(kwc)=regex(0(')\w+)
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=%
+
+$ML_COMMENT=/* */
+
+$ALLOWNESTEDCOMMENTS=false
+
+$IGNORECASE=false
+
+$DIRECTIVE=#
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * + - .
diff --git a/support/highlight/langDefs/progress.lang b/support/highlight/langDefs/progress.lang
new file mode 100644
index 0000000000..769556166e
--- /dev/null
+++ b/support/highlight/langDefs/progress.lang
@@ -0,0 +1,261 @@
+# Progress script language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 04.03.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+$DESCRIPTION=Progress
+
+$KEYWORDS(kwa)=accum ACCUMU ACCUMUL ACCUMULA ACCUMULAT ACCUMULATE ACTIVE-WINDOW ADD ALIAS ALL ALTER AMBIG AMBIGU AMBIGUO AMBIGUOU AMBIGUOUS ANALYZE AND ANY APPLY AS ASC ASCE ASCEN
+ASCEND ASCENDI ASCENDIN ASCENDING ASSIGN ASYNCHRONOUS AT ATTR ATTR- ATTR-S ATTR-SP ATTR-SPA ATTR-SPAC ATTR-SPACE AUTHORIZATION AUTO-RET AUTO-RETU AUTO-RETUR AUTO-RETURN
+AVAIL AVAILA AVAILAB AVAILABL AVAILABLE
+BACK BACKG BACKGR BACKGRO BACKGROU BACKGROUN BACKGROUND BEFORE-H BEFORE-HI BEFORE-HID BEFORE-HIDE BEGINS BELL BETWEEN BIG-ENDIAN BLANK BREAK BTOS BUFFER-COMP BUFFER-COMPA
+BUFFER-COMPAR BUFFER-COMPARE BUFFER-COPY BY BY-POINTER BY-VARIANT-POINT BY-VARIANT-POINTE BY-VARIANT-POINTER
+CALL CAN-DO CAN-FIND CASE CASE-SEN CASE-SENS CASE-SENSI CASE-SENSIT CASE-SENSITI CASE-SENSITIV CASE-SENSITIVE CENTER CENTERE CENTERED CHECK CHR CLEAR CLIPBOARD COL COLON
+COLOR COLUMN COLUMNS COLUMN-LAB COLUMN-LABE COLUMN-LABEL COM-SELF COMPILER COMPONENT-SELF CONNECTED CONTROL COUNT-OF CPSTREAM CREATE CTOS CURRENT CURRENT-CHANGED
+CURRENT-LANG CURRENT-LANGU CURRENT-LANGUA CURRENT-LANGUAG CURRENT-LANGUAGE CURRENT-WINDOW CURRENT_DATE CURS CURSO CURSOR
+DATABASE DATASERVERS DBCODEPAGE DBCOLLATION DBNAME DBPARAM DBREST DBRESTR DBRESTRI DBRESTRIC DBRESTRICT DBRESTRICTI DBRESTRICTIO DBRESTRICTION DBRESTRICTIONS DBTASKID
+DBTYPE DBVERS DBVERSI DBVERSIO DBVERSION DDE DEBLANK DEBUG-LIST DEBUGGER DECIMALS DECLARE DEF DEFI DEFIN DEFINE DEFAULT DEFAULT-NOXL DEFAULT-NOXLA DEFAULT-NOXLAT
+DEFAULT-NOXLATE DEFAULT-WINDOW DELETE DELIMITER DESC DESCE DESCEN DESCEND DESCENDI DESCENDIN DESCENDING DICT DICTI DICTIO DICTION DICTIONA DICTIONAR DICTIONARY DISABLE DISCON
+DISCONN DISCONNE DISCONNEC DISCONNECT DISP DISPL DISPLA DISPLAY DISTINCT DO DOS DOWN DROP DYNAMIC-FUNC DYNAMIC-FUNCT DYNAMIC-FUNCTI DYNAMIC-FUNCTIO DYNAMIC-FUNCTION
+EACH EDITING ELSE ENABLE ENCODE END ENTRY ERROR-STAT ERROR-STATU ERROR-STATUS ESCAPE ETIME EVENT-PROCEDURE EXCEPT EXCLUSIVE EXCLUSIVE-L EXCLUSIVE-LO EXCLUSIVE-LOC
+EXCLUSIVE-LOCK EXCLUSIVE-WEB EXCLUSIVE-WEB- EXCLUSIVE-WEB-U EXCLUSIVE-WEB-US EXCLUSIVE-WEB-USE EXCLUSIVE-WEB-USER EXISTS EXPORT
+FALSE FETCH FIELD FIELDS FILE-INFO FILE-INFOR FILE-INFORM FILE-INFORMA FILE-INFORMAT FILE-INFORMATI FILE-INFORMATIO FILE-INFORMATION FILL FIND FIND-CASE-SENSITIVE
+FIND-GLOBAL FIND-NEXT-OCCURRENCE FIND-PREV-OCCURRENCE FIND-SELECT FIND-WRAP-AROUND FIRST FIRST-OF FOCUS FONT FOR FORM FORMA FORMAT FRAM FRAME FRAME-COL FRAME-DB FRAME-DOWN
+FRAME-FIELD FRAME-FILE FRAME-INDE FRAME-INDEX FRAME-LINE FRAME-NAME FRAME-ROW FRAME-VAL FRAME-VALU FRAME-VALUE FROM FROM-C FROM-CH FROM-CHA FROM-CHAR FROM-CHARS FROM-P
+FROM-PI FROM-PIX FROM-PIXE FROM-PIXEL FROM-PIXELS FROMNOREORDER
+GATEWAY GATEWAYS GET-BYTE GET-CODEPAGE GET-CODEPAGES GET-COLL GET-COLLA GET-COLLAT GET-COLLATI GET-COLLATIO GET-COLLATION GET-COLLATIONS GET-KEY-VAL GET-KEY-VALU
+GET-KEY-VALUE GETBYTE GLOBAL GO-ON GO-PEND GO-PENDI GO-PENDIN GO-PENDING GRANT GRAPHIC-E GRAPHIC-ED GRAPHIC-EDG GRAPHIC-EDGE GROUP
+HAVING HEADER HELP HIDE HOST-BYTE-ORDER
+IF IMPORT IN INDEX INDICATOR INPUT INPUT-O INPUT-OU INPUT-OUT INPUT-OUTP INPUT-OUTPU INPUT-OUTPUT INSERT INTO IS IS-ATTR IS-ATTR- IS-ATTR-S IS-ATTR-SP IS-ATTR-SPA
+IS-ATTR-SPAC IS-ATTR-SPACE
+JOIN
+KBLABEL KEY-CODE KEY-FUNC KEY-FUNCT KEY-FUNCTI KEY-FUNCTIO KEY-FUNCTION KEY-LABEL KEYCODE KEYFUNC KEYFUNCT KEYFUNCTI KEYFUNCTIO KEYFUNCTION KEYLABEL KEYS KEYWORD
+LABEL LAST LAST-EVEN LAST-EVENT LAST-KEY LAST-OF LASTKEY LDBNAME LEAVE LIBRARY LIKE LINE-COUNT LINE-COUNTE LINE-COUNTER LISTI LISTIN LISTING LITTLE-ENDIAN LOCKED LOOKUP
+MACHINE-CLASS MAP MEMBER MESSAGE MESSAGE-LINES MOUSE MPE
+NEW NEXT NEXT-PROMPT NO NO-ATTR NO-ATTR-S NO-ATTR-SP NO-ATTR-SPA NO-ATTR-SPAC NO-ATTR-SPACE NO-ERROR NO-F NO-FI NO-FIL NO-FILL NO-HELP NO-HIDE NO-LABEL NO-LABELS NO-LOCK
+NO-MAP NO-MES NO-MESS NO-MESSA NO-MESSAG NO-MESSAGE NO-PAUSE NO-PREFE NO-PREFET NO-PREFETC NO-PREFETCH NO-RETURN-VAL NO-RETURN-VALU NO-RETURN-VALUE NO-UNDO NO-VAL NO-VALI
+NO-VALID NO-VALIDA NO-VALIDAT NO-VALIDATE NO-WAIT NOT NULL NUM-ALI NUM-ALIA NUM-ALIAS NUM-ALIASE NUM-ALIASES NUM-DBS NUM-ENTRIES
+OF OFF OLD ON OPEN OPSYS OPTION OR OS-APPEND OS-COMMAND OS-COPY OS-CREATE-DIR OS-DELETE OS-DIR OS-DRIVE OS-DRIVES OS-ERROR OS-RENAME OS2 OS400 OTHERWISE OUTPUT OVERLAY
+PAGE PAGE-BOT PAGE-BOTT PAGE-BOTTO PAGE-BOTTOM PAGE-NUM PAGE-NUMB PAGE-NUMBE PAGE-NUMBER PAGE-TOP PARAM PARAME PARAMET PARAMETE PARAMETER PAUSE PDBNAME PERSIST PERSISTE
+PERSISTEN PERSISTENT PIXELS PREPROC PREPROCE PREPROCES PREPROCESS PRIVILEGES PROC-HA PROC-HAN PROC-HAND PROC-HANDL PROC-HANDLE PROC-ST PROC-STA PROC-STAT PROC-STATU PROC-
+PROCESS PROFILER PROGRAM-NAME PROGRESS PROMPT PROMPT-F PROMPT-FO PROMPT-FOR PROMSGS PROPATH PROVERS PROVERSI PROVERSIO PROVERSION PUBLISH PUT PUT-BYTE PUT-KEY-VAL
+PUT-KEY-VALU PUT-KEY-VALUE PUTBYTE
+QUERY QUERY-TUNING QUIT
+R-INDEX RCODE-INFO RCODE-INFOR RCODE-INFORM RCODE-INFORMA RCODE-INFORMAT RCODE-INFORMATI RCODE-INFORMATIO RCODE-INFORMATION READ-AVAILABLE READ-EXACT-NUM READKEY RECID
+RECORD-LEN RECORD-LENG RECORD-LENGT RECORD-LENGTH RECT RECTA RECTAN RECTANG RECTANGL RECTANGLE RELEASE REPEAT REPOSITION RETAIN RETRY RETURN RETURN-VAL RETURN-VALU
+RETURN-VALUE REVERT REVOKE RUN
+SAVE SCHEMA SCREEN SCREEN-IO SCREEN-LINES SCROLL SDBNAME SEARCH SEARCH-SELF SEARCH-TARGET SEEK SELECT SELF SESSION SET SETUSER SETUSERI SETUSERID SHARE SHARE- SHARE-L
+SHARE-LO SHARE-LOC SHARE-LOCK SHARED SHOW-STAT SHOW-STATS SKIP SOME SOURCE-PROCEDURE SPACE STATUS STREAM STREAM-IO STRING-XREF SUBSCRIBE SUPER SYSTEM-DIALOG STATUS
+TABLE TABLE-HANDLE TARGET-PROCEDURE TERM TERMINAL TEXT TEXT-CURSOR TEXT-SEG TEXT-SEG- TEXT-SEG-G TEXT-SEG-GR TEXT-SEG-GRO TEXT-SEG-GROW TEXT-SEG-GROWT TEXT-SEG-GROWTH
+THEN THIS-PROCEDURE TIME TITLE TO TODAY TOP-ONLY TRANS TRANSACT TRANSACTI TRANSACTIO TRANSACTION TRIGGER TRIGGERS TRIM TRUE
+UNDERL UNDERLI UNDERLIN UNDERLINE UNDO UNFORM UNFORMA UNFORMAT UNFORMATT UNFORMATTE UNFORMATTED UNION UNIQUE UNIX UNLESS-HIDDEN UNSUBSCRIBE UP UPDATE USE-INDEX
+USE-REVVIDEO USE-UNDERLINE USER USERID USING
+V6FRAME VALUE VALUES VIEW VIEW-AS VMS
+WAIT-FOR WEB-CON WEB-CONT WEB-CONTE WEB-CONTEX WEB-CONTEXT WHEN WHERE WHILE WINDOW WINDOW-DELAYED-MIN WINDOW-DELAYED-MINI WINDOW-DELAYED-MINIM WINDOW-DELAYED-MINIMI
+WINDOW-DELAYED-MINIMIZ WINDOW-DELAYED-MINIMIZE WINDOW-MAXIM WINDOW-MAXIMI WINDOW-MAXIMIZ WINDOW-MAXIMIZE WINDOW-MAXIMIZED WINDOW-MAXIMIZED WINDOW-MINIM WINDOW-MINIMI
+WINDOW-MINIMIZ WINDOW-MINIMIZE WINDOW-MINIMIZED WINDOW-MINIMIZED WINDOW-NORMAL WITH WORK-TAB WORK-TABL WORK-TABLE WORKFILE WRITE
+XCODE XREF
+YES
+_CBIT _CONTROL _LIST _MEMORY _MSG _PCONTROL _SERIAL-NUM _TRACE
+
+
+# functions
+$KEYWORDS(kwb)=ABS ABSO ABSOL ABSOLU ABSOLUT ABSOLUTE ACCELERATOR ACROSS ADD-BUFFER ADD-CALC-COL ADD-CALC-COLU ADD-CALC-COLUM ADD-CALC-COLUMN ADD-COLUMNS-FROM ADD-EVENTS-PROC
+ADD-EVENTS-PROCE ADD-EVENTS-PROCED ADD-EVENTS-PROCEDU ADD-EVENTS-PROCEDUR ADD-EVENTS-PROCEDURE ADD-FIELDS-FROM ADD-FIRST ADD-INDEX-FIELD ADD-LAST ADD-LIKE-COL ADD-LIKE-COLU
+ADD-LIKE-COLUM ADD-LIKE-COLUMN ADD-LIKE-FIELD ADD-LIKE-INDEX ADD-NEW-FIELD ADD-NEW-INDEX ADD-SUPER-PROC ADD-SUPER-PROCE ADD-SUPER-PROCED ADD-SUPER-PROCEDU
+ADD-SUPER-PROCEDUR ADD-SUPER-PROCEDURE ADM-DATA ADVISE ALERT-BOX ALLOW-COLUMN-SEARCHING ALLOW-REPLICATION ALTERNATE-KEY ALWAYS-ON-TOP ANSI-ONLY ANYWHERE APPEND APPEND-CHILD
+APPL-ALERT APPL-ALERT- APPL-ALERT-B APPL-ALERT-BO APPL-ALERT-BOX APPL-ALERT-BOXE APPL-ALERT-BOXES APPLICATION ARRAY-M ARRAY-ME ARRAY-MES ARRAY-MESS ARRAY-MESSA ARRAY-MESSAG
+ARRAY-MESSAGE AS-CURSOR ASK-OVERWRITE ASYNC-REQUEST-COUNT ATTACH ATTACHM ATTACHME ATTACHMEN ATTACHMENT ATTRIBUTE-NAMES ATTRIBUTE-TYPE AUTO-COMP AUTO-COMPL AUTO-COMPLE
+AUTO-COMPLET AUTO-COMPLETI AUTO-COMPLETIO AUTO-COMPLETION AUTO-DELETE-XML AUTO-END-KEY AUTO-ENDKEY AUTO-GO AUTO-IND AUTO-INDE AUTO-INDEN AUTO-INDENT AUTO-RESIZE AUTO-VAL
+AUTO-VALI AUTO-VALID AUTO-VALIDA AUTO-VALIDAT AUTO-VALIDATE AUTO-Z AUTO-ZA AUTO-ZAP AUTOMATIC AVAILABLE-FORMATS AVE AVER AVERA AVERAG AVERAGE AVG
+BACKWARD BACKWARDS BASE-KEY BATCH BATCH- BATCH-M BATCH-MO BATCH-MOD BATCH-MODE BGC BGCO BGCOL BGCOLO BGCOLOR BINARY BIND-WHERE BLOCK-ITERATION-DISPLAY BORDER-B BORDER-BO
+BORDER-BOT BORDER-BOTT BORDER-BOTTO BORDER-BOTTOM BORDER-BOTTOM-C BORDER-BOTTOM-CH BORDER-BOTTOM-CHA BORDER-BOTTOM-CHAR BORDER-BOTTOM-CHARS BORDER-BOTTOM-P
+BORDER-BOTTOM-PI BORDER-BOTTOM-PIX BORDER-BOTTOM-PIXE BORDER-BOTTOM-PIXEL BORDER-BOTTOM-PIXELS BORDER-L BORDER-LE BORDER-LEF BORDER-LEFT BORDER-LEFT-C BORDER-LEFT-CH
+BORDER-LEFT-CHA BORDER-LEFT-CHAR BORDER-LEFT-CHARS BORDER-LEFT-P BORDER-LEFT-PI BORDER-LEFT-PIX BORDER-LEFT-PIXE BORDER-LEFT-PIXEL BORDER-LEFT-PIXELS BORDER-R BORDER-RI
+BORDER-RIG BORDER-RIGH BORDER-RIGHT BORDER-RIGHT-C BORDER-RIGHT-CH BORDER-RIGHT-CHA BORDER-RIGHT-CHAR BORDER-RIGHT-CHARS BORDER-RIGHT-P BORDER-RIGHT-PI BORDER-RIGHT-PIX
+BORDER-RIGHT-PIXE BORDER-RIGHT-PIXEL BORDER-RIGHT-PIXELS BORDER-T BORDER-TO BORDER-TOP BORDER-TOP-C BORDER-TOP-CH BORDER-TOP-CHA BORDER-TOP-CHAR BORDER-TOP-CHARS BORDER-TOP-P
+BORDER-TOP-PI BORDER-TOP-PIX BORDER-TOP-PIXE BORDER-TOP-PIXEL BORDER-TOP-PIXELS BOTH BOTTOM BOX BOX-SELECT BOX-SELECTA BOX-SELECTAB BOX-SELECTABL BOX-SELECTABLE BROWSE
+BROWSE-COLUMN-DATA-TYPES BROWSE-COLUMN-FORMATS BROWSE-COLUMN-LABELS BROWSE-HEADER BUFFER BUFFER-CHARS BUFFER-CREATE BUFFER-DELETE BUFFER-FIELD BUFFER-HANDLE BUFFER-LINES
+BUFFER-N BUFFER-NA BUFFER-NAM BUFFER-NAME BUFFER-RELEAS BUFFER-RELEASE BUFFER-VALUE BUTTON BUTTONS BYTE BYTES-READ BYTES-WRITTEN
+CACHE CACHE-SIZE CAN-CREA CAN-CREAT CAN-CREATE CAN-DELE CAN-DELET CAN-DELETE CAN-QUERY CAN-READ CAN-SET CAN-WRIT CAN-WRITE CANCEL-BREAK CANCEL-BUTTON CANCEL-REQUESTS
+CANCELLED CAPS CAREFUL-PAINT CDECL CHAINED CHAR CHARA CHARAC CHARACT CHARACTE CHARACTER CHARACTER_LENGTH CHARSET CHECKED CHILD-NUM CHOOSE CLEAR-SELECT CLEAR-SELECTI
+CLEAR-SELECTIO CLEAR-SELECTION CLIENT-CONNECTION-ID CLIENT-TYPE CLONE-NODE CLOSE CODE CODEPAGE CODEPAGE-CONVERT COL-OF COLLATE COLON-ALIGN COLON-ALIGNE COLON-ALIGNED
+COLOR-TABLE COLUMN-BGC COLUMN-BGCO COLUMN-BGCOL COLUMN-BGCOLO COLUMN-BGCOLOR COLUMN-DCOLOR COLUMN-FGC COLUMN-FGCO COLUMN-FGCOL COLUMN-FGCOLO COLUMN-FGCOLOR COLUMN-FONT
+COLUMN-LABEL-BGC COLUMN-LABEL-BGCO COLUMN-LABEL-BGCOL COLUMN-LABEL-BGCOLO COLUMN-LABEL-BGCOLOR COLUMN-LABEL-DCOLOR COLUMN-LABEL-FGC COLUMN-LABEL-FGCO COLUMN-LABEL-FGCOL
+COLUMN-LABEL-FGCOLO COLUMN-LABEL-FGCOLOR COLUMN-LABEL-FONT COLUMN-LABEL-HEIGHT-C COLUMN-LABEL-HEIGHT-CH COLUMN-LABEL-HEIGHT-CHA COLUMN-LABEL-HEIGHT-CHAR
+COLUMN-LABEL-HEIGHT-CHARS COLUMN-LABEL-HEIGHT-P COLUMN-LABEL-HEIGHT-PI COLUMN-LABEL-HEIGHT-PIX COLUMN-LABEL-HEIGHT-PIXE COLUMN-LABEL-HEIGHT-PIXEL COLUMN-LABEL-HEIGHT-PIXELS
+COLUMN-MOVABLE COLUMN-OF COLUMN-PFC COLUMN-PFCO COLUMN-PFCOL COLUMN-PFCOLO COLUMN-PFCOLOR COLUMN-READ-ONLY COLUMN-RESIZABLE COLUMN-SC COLUMN-SCR COLUMN-SCRO COLUMN-SCROL
+COLUMN-SCROLL COLUMN-SCROLLI COLUMN-SCROLLIN COLUMN-SCROLLING COM-HANDLE COMBO-BOX COMMAND COMPARE COMPARES COMPILE COMPLETE COMPONENT-HANDLE CONFIG-NAME CONNECT CONSTRAINED
+CONTAINS CONTENTS CONTEXT CONTEXT-HELP CONTEXT-HELP-FILE CONTEXT-HELP-ID CONTEXT-POP CONTEXT-POPU CONTEXT-POPUP CONTROL-BOX CONTROL-CONT CONTROL-CONTA CONTROL-CONTAI
+CONTROL-CONTAIN CONTROL-CONTAINE CONTROL-CONTAINER CONTROL-FRAM CONTROL-FRAME CONVERT CONVERT-3D CONVERT-3D- CONVERT-3D-C CONVERT-3D-CO CONVERT-3D-COL CONVERT-3D-COLO
+CONVERT-3D-COLOR CONVERT-3D-COLORS CONVERT-TO-OFFS CONVERT-TO-OFFSE CONVERT-TO-OFFSET COUNT COVERAGE CPCASE CPCOLL CPINT CPINTE CPINTER CPINTERN CPINTERNA CPINTERNAL
+CPLOG CPPRINT CPRCODEIN CPRCODEOUT CPTERM CRC-VAL CRC-VALU CRC-VALUE CREATE-LIKE CREATE-NODE CREATE-NODE-NAMESPACE CREATE-ON-ADD CREATE-RESULT-LIST-ENTRY CREATE-TEST-FILE
+CURRENT-COLUMN CURRENT-ENV CURRENT-ENVI CURRENT-ENVIR CURRENT-ENVIRO CURRENT-ENVIRON CURRENT-ENVIRONM CURRENT-ENVIRONME CURRENT-ENVIRONMEN CURRENT-ENVIRONMENT
+CURRENT-ITERATION CURRENT-RESULT-ROW CURRENT-ROW-MODIFIED CURRENT-VALUE CURSOR-CHAR CURSOR-LINE CURSOR-OFFSET
+DATA-B DATA-BI DATA-BIN DATA-BIND DATA-ENTRY-RET DATA-ENTRY-RETU DATA-ENTRY-RETUR DATA-ENTRY-RETURN DATA-T DATA-TY DATA-TYP DATA-TYPE DATE DATE-F DATE-FO DATE-FOR
+DATE-FORM DATE-FORMA DATE-FORMAT DAY DB-REFERENCES DCOLOR DDE-ERROR DDE-I DDE-ID DDE-ITEM DDE-NAME DDE-TOPIC DEBU DEBUG DEBUG-ALERT DEC DECI DECIM DECIMA DECIMAL
+DEFAULT-BUFFER-HANDLE DEFAULT-BUT DEFAULT-BUTT DEFAULT-BUTTO DEFAULT-BUTTON DEFAULT-COMMIT DEFAULT-EX DEFAULT-EXT DEFAULT-EXTE DEFAULT-EXTEN DEFAULT-EXTENS DEFAULT-EXTENSI
+DEFAULT-EXTENSIO DEFAULT-EXTENSION DEFER-LOB-FETCH DEFINED DELETE-CHAR DELETE-CURRENT-ROW DELETE-LINE DELETE-NODE DELETE-RESULT-LIST-ENTRY DELETE-SELECTED-ROW
+DELETE-SELECTED-ROWS DESCRIPT DESCRIPTI DESCRIPTIO DESCRIPTION DESELECT-FOCUSED-ROW DESELECT-ROWS DESELECT-SELECTED-ROW DETACH DIALOG-BOX DIALOG-HELP DIR DIRECTORY
+DISABLE-AUTO-ZAP DISABLE-CONNECTIONS DISABLED DISPLAY-MESSAGE DISPLAY-T DISPLAY-TY DISPLAY-TYP DISPLAY-TYPE DOUBLE DRAG-ENABLED DROP-DOWN DROP-DOWN-LIST DROP-TARGET DUMP
+DYNAMIC
+ECHO EDGE EDGE-C EDGE-CH EDGE-CHA EDGE-CHAR EDGE-CHARS EDGE-P EDGE-PI EDGE-PIX EDGE-PIXE EDGE-PIXEL EDGE-PIXELS EDIT-CAN-PASTE EDIT-CAN-UNDO EDIT-CLEAR EDIT-COPY EDIT-CUT
+EDIT-PASTE EDIT-UNDO EDITOR EMPTY EMPTY-TEMP-TABLE ENABLE-CONNECTIONS ENABLED ENCODING END-FILE-DROP END-KEY ENDKEY ENTERED EQ ERROR ERROR-COL ERROR-COLU ERROR-COLUM
+ERROR-COLUMN ERROR-ROW EVENT-PROCEDURE-CONTEXT EVENT-T EVENT-TY EVENT-TYP EVENT-TYPE EVENTS EXCLUSIVE-ID EXECUTE EXECUTION-LOG EXP EXPAND EXPANDABLE EXPLICIT EXTENDED
+EXTENT EXTERNAL EXTRACT
+FETCH-SELECTED-ROW FGC FGCO FGCOL FGCOLO FGCOLOR FILE FILE-ACCESS-D FILE-ACCESS-DA FILE-ACCESS-DAT FILE-ACCESS-DATE FILE-ACCESS-T FILE-ACCESS-TI FILE-ACCESS-TIM
+FILE-ACCESS-TIME FILE-CREATE-D FILE-CREATE-DA FILE-CREATE-DAT FILE-CREATE-DATE FILE-CREATE-T FILE-CREATE-TI FILE-CREATE-TIM FILE-CREATE-TIME FILE-MOD-D FILE-MOD-DA
+FILE-MOD-DAT FILE-MOD-DATE FILE-MOD-T FILE-MOD-TI FILE-MOD-TIM FILE-MOD-TIME FILE-NAME FILE-OFF FILE-OFFS FILE-OFFSE FILE-OFFSET FILE-SIZE FILE-TYPE FILENAME FILL-IN FILLED
+FILTERS FIND-BY-ROWID FINDER FIRST-ASYNC FIRST-ASYNC- FIRST-ASYNC-R FIRST-ASYNC-RE FIRST-ASYNC-REQ FIRST-ASYNC-REQU FIRST-ASYNC-REQUE FIRST-ASYNC-REQUES
+FIRST-ASYNC-REQUEST FIRST-BUFFER FIRST-CHILD FIRST-COLUMN FIRST-PROC FIRST-PROCE FIRST-PROCED FIRST-PROCEDU FIRST-PROCEDUR FIRST-PROCEDURE FIRST-SERV FIRST-SERVE FIRST-SERVER
+FIRST-SERVER-SOCKET FIRST-SOCKET FIRST-TAB-I FIRST-TAB-IT FIRST-TAB-ITE FIRST-TAB-ITEM FIXED-ONLY FLAT-BUTTON FLOAT FOCUSED-ROW FOCUSED-ROW-SELECTED FONT-TABLE FORCE-FILE FORE
+FOREG FOREGR FOREGRO FOREGROU FOREGROUN FOREGROUND FORM-INPUT FORWARD FORWARDS FRAME-SPA FRAME-SPAC FRAME-SPACI FRAME-SPACIN FRAME-SPACING FRAME-X FRAME-Y FREQUENCY
+FROM-CUR FROM-CURR FROM-CURRE FROM-CURREN FROM-CURRENT FULL-HEIGHT FULL-HEIGHT-C FULL-HEIGHT-CH FULL-HEIGHT-CHA FULL-HEIGHT-CHAR FULL-HEIGHT-CHARS FULL-HEIGHT-P FULL-HEIGHT-PI
+FULL-HEIGHT-PIX FULL-HEIGHT-PIXE FULL-HEIGHT-PIXEL FULL-HEIGHT-PIXELS FULL-PATHN FULL-PATHNA FULL-PATHNAM FULL-PATHNAME FULL-WIDTH FULL-WIDTH- FULL-WIDTH-C FULL-WIDTH-CH
+FULL-WIDTH-CHA FULL-WIDTH-CHAR FULL-WIDTH-CHARS FULL-WIDTH-P FULL-WIDTH-PI FULL-WIDTH-PIX FULL-WIDTH-PIXE FULL-WIDTH-PIXEL FULL-WIDTH-PIXELS FUNCTION
+GE GET GET-ATTRIBUTE GET-BITS GET-BLUE GET-BLUE- GET-BLUE-V GET-BLUE-VA GET-BLUE-VAL GET-BLUE-VALU GET-BLUE-VALUE GET-BROWSE-COL GET-BROWSE-COLU GET-BROWSE-COLUM
+GET-BROWSE-COLUMN GET-BUFFER-HANDLE GET-BYTE-ORDER GET-BYTES GET-BYTES-AVAILABLE GET-CGI-LIST GET-CGI-VALUE GET-CHILD GET-CONFIG-VALUE GET-CURR GET-CURRE GET-CURREN
+GET-CURRENT GET-DOCUMENT-ELEMENT GET-DOUBLE GET-DROPPED-FILE GET-DYNAMIC GET-FILE GET-FIRS GET-FIRST GET-FLOAT GET-GREEN GET-GREEN- GET-GREEN-V GET-GREEN-VA GET-GREEN-VAL
+GET-GREEN-VALU GET-GREEN-VALUE GET-ITERATION GET-LAST GET-LICENSE GET-LONG GET-MESSAGE GET-NEXT GET-NUMBER GET-PARENT GET-POINTER-VALUE GET-PREV GET-PRINTERS GET-RED
+GET-RED- GET-RED-V GET-RED-VA GET-RED-VAL GET-RED-VALU GET-RED-VALUE GET-REPOSITIONED-ROW GET-RGB GET-RGB- GET-RGB-V GET-RGB-VA GET-RGB-VAL GET-RGB-VALU GET-RGB-VALUE
+GET-SELECTED GET-SELECTED- GET-SELECTED-W GET-SELECTED-WI GET-SELECTED-WID GET-SELECTED-WIDG GET-SELECTED-WIDGE GET-SELECTED-WIDGET GET-SHORT GET-SIGNATURE GET-SIZE
+GET-SOCKET-OPTION GET-STRING GET-TAB-ITEM GET-TEXT-HEIGHT GET-TEXT-HEIGHT-C GET-TEXT-HEIGHT-CH GET-TEXT-HEIGHT-CHA GET-TEXT-HEIGHT-CHAR GET-TEXT-HEIGHT-CHARS
+GET-TEXT-HEIGHT-P GET-TEXT-HEIGHT-PI GET-TEXT-HEIGHT-PIX GET-TEXT-HEIGHT-PIXE GET-TEXT-HEIGHT-PIXEL GET-TEXT-HEIGHT-PIXELS GET-TEXT-WIDTH GET-TEXT-WIDTH-C GET-TEXT-WIDTH-CH
+GET-TEXT-WIDTH-CHA GET-TEXT-WIDTH-CHAR GET-TEXT-WIDTH-CHARS GET-TEXT-WIDTH-P GET-TEXT-WIDTH-PI GET-TEXT-WIDTH-PIX GET-TEXT-WIDTH-PIXE GET-TEXT-WIDTH-PIXEL
+GET-TEXT-WIDTH-PIXELS GET-UNSIGNED-SHORT GET-WAIT GET-WAIT- GET-WAIT-S GET-WAIT-ST GET-WAIT-STA GET-WAIT-STAT GET-WAIT-STATE GRAYED GRID-FACTOR-H GRID-FACTOR-HO GRID-FACTOR-HOR
+GRID-FACTOR-HORI GRID-FACTOR-HORIZ GRID-FACTOR-HORIZO GRID-FACTOR-HORIZON GRID-FACTOR-HORIZONT GRID-FACTOR-HORIZONTA GRID-FACTOR-HORIZONTAL GRID-FACTOR-V GRID-FACTOR-VE
+GRID-FACTOR-VER GRID-FACTOR-VERT GRID-FACTOR-VERTI GRID-FACTOR-VERTIC GRID-FACTOR-VERTICA GRID-FACTOR-VERTICAL GRID-SET GRID-SNAP GRID-UNIT-HEIGHT GRID-UNIT-HEIGHT-C
+GRID-UNIT-HEIGHT-CH GRID-UNIT-HEIGHT-CHA GRID-UNIT-HEIGHT-CHAR GRID-UNIT-HEIGHT-CHARS GRID-UNIT-HEIGHT-P GRID-UNIT-HEIGHT-PI GRID-UNIT-HEIGHT-PIX GRID-UNIT-HEIGHT-PIXE
+GRID-UNIT-HEIGHT-PIXEL GRID-UNIT-HEIGHT-PIXELS GRID-UNIT-WIDTH GRID-UNIT-WIDTH-C GRID-UNIT-WIDTH-CH GRID-UNIT-WIDTH-CHA GRID-UNIT-WIDTH-CHAR GRID-UNIT-WIDTH-CHARS
+GRID-UNIT-WIDTH-P GRID-UNIT-WIDTH-PI GRID-UNIT-WIDTH-PIX GRID-UNIT-WIDTH-PIXE GRID-UNIT-WIDTH-PIXEL GRID-UNIT-WIDTH-PIXELS GRID-VISIBLE GT
+HANDLE HAS-RECORDS HEIGHT HEIGHT-C HEIGHT-CH HEIGHT-CHA HEIGHT-CHAR HEIGHT-CHARS HEIGHT-P HEIGHT-PI HEIGHT-PIX HEIGHT-PIXE HEIGHT-PIXEL HEIGHT-PIXELS HELP-CON HELP-CONT
+HELP-CONTE HELP-CONTEX HELP-CONTEXT HELP-TOPIC HELPFILE-N HELPFILE-NA HELPFILE-NAM HELPFILE-NAME HIDDEN HINT HORI HORIZ HORIZO HORIZON HORIZONT HORIZONTA HORIZONTAL
+HTML-END-OF-LINE HTML-END-OF-PAGE HTML-FRAME-BEGIN HTML-FRAME-END HTML-HEADER-BEGIN HTML-HEADER-END HTML-TITLE-BEGIN HTML-TITLE-END HWND
+ICON IMAGE IMAGE-DOWN IMAGE-INSENSITIVE IMAGE-SIZE IMAGE-SIZE-C IMAGE-SIZE-CH IMAGE-SIZE-CHA IMAGE-SIZE-CHAR IMAGE-SIZE-CHARS IMAGE-SIZE-P IMAGE-SIZE-PI IMAGE-SIZE-PIX
+IMAGE-SIZE-PIXE IMAGE-SIZE-PIXEL IMAGE-SIZE-PIXELS IMAGE-UP IMMEDIATE-DISPLAY IMPORT-NODE INCREMENT-EXCLUSIVE-ID INDEX-HINT INDEX-INFO INDEX-INFOR INDEX-INFORM
+INDEX-INFORMA INDEX-INFORMAT INDEX-INFORMATI INDEX-INFORMATIO INDEX-INFORMATION INDEXED-REPOSITION INFO INFOR INFORM INFORMA INFORMAT INFORMATI INFORMATIO INFORMATION INIT
+INITIAL INITIAL-DIR INITIAL-FILTER INITIALIZE-DOCUMENT-TYPE INITIATE INNER INNER-CHARS INNER-LINES INPUT-VALUE INSERT-B INSERT-BA INSERT-BAC INSERT-BACK INSERT-BACKT
+INSERT-BACKTA INSERT-BACKTAB INSERT-BEFORE INSERT-FILE INSERT-ROW INSERT-STRING INSERT-T INSERT-TA INSERT-TAB INT INTE INTEG INTEGE INTEGER INTERNAL-ENTRIES IS-LEAD-BYTE
+IS-OPEN IS-ROW-SELECTED IS-SELECTED IS-XML ITEM ITEMS-PER-ROW
+JOIN-BY-SQLDB
+KEEP-FRAME-Z KEEP-FRAME-Z- KEEP-FRAME-Z-O KEEP-FRAME-Z-OR KEEP-FRAME-Z-ORD KEEP-FRAME-Z-ORDE KEEP-FRAME-Z-ORDER KEEP-MESSAGES KEEP-TAB-ORDER KEY KEYWORD-ALL
+LABEL-BGC LABEL-BGCO LABEL-BGCOL LABEL-BGCOLO LABEL-BGCOLOR LABEL-DC LABEL-DCO LABEL-DCOL LABEL-DCOLO LABEL-DCOLOR LABEL-FGC LABEL-FGCO LABEL-FGCOL LABEL-FGCOLO
+LABEL-FGCOLOR LABEL-FONT LABEL-PFC LABEL-PFCO LABEL-PFCOL LABEL-PFCOLO LABEL-PFCOLOR LABELS LANDSCAPE LANGUAGE LANGUAGES LARGE LARGE-TO-SMALL LAST-ASYNC LAST-ASYNC-
+LAST-ASYNC-R LAST-ASYNC-RE LAST-ASYNC-REQ LAST-ASYNC-REQU LAST-ASYNC-REQUE LAST-ASYNC-REQUES LAST-ASYNC-REQUEST LAST-CHILD LAST-PROCE LAST-PROCED LAST-PROCEDU LAST-PROCEDUR
+LAST-PROCEDURE LAST-SERV LAST-SERVE LAST-SERVER LAST-SERVER-SOCKET LAST-SOCKET LAST-TAB-I LAST-TAB-IT LAST-TAB-ITE LAST-TAB-ITEM LC LE LEADING LEFT LEFT-ALIGN LEFT-ALIGNE
+LEFT-ALIGNED LEFT-TRIM LENGTH LINE LIST-EVENTS LIST-ITEM-PAIRS LIST-ITEMS LIST-QUERY-ATTRS LIST-SET-ATTRS LIST-WIDGETS LISTINGS LOAD LOAD-FROM LOAD-ICON LOAD-IMAGE
+LOAD-IMAGE-DOWN LOAD-IMAGE-INSENSITIVE LOAD-IMAGE-UP LOAD-MOUSE-P LOAD-MOUSE-PO LOAD-MOUSE-POI LOAD-MOUSE-POIN LOAD-MOUSE-POINT LOAD-MOUSE-POINTE LOAD-MOUSE-POINTER
+LOAD-PICTURE LOAD-SMALL-ICON LOCAL-HOST LOCAL-NAME LOCAL-PORT LOG LOG-ID LOGICAL LONG LOOKAHEAD LOWER LT
+MANDATORY MANUAL-HIGHLIGHT MARGIN-EXTRA MARGIN-HEIGHT MARGIN-HEIGHT-C MARGIN-HEIGHT-CH MARGIN-HEIGHT-CHA MARGIN-HEIGHT-CHAR MARGIN-HEIGHT-CHARS MARGIN-HEIGHT-P
+MARGIN-HEIGHT-PI MARGIN-HEIGHT-PIX MARGIN-HEIGHT-PIXE MARGIN-HEIGHT-PIXEL MARGIN-HEIGHT-PIXELS MARGIN-WIDTH MARGIN-WIDTH-C MARGIN-WIDTH-CH MARGIN-WIDTH-CHA MARGIN-WIDTH-CHAR
+MARGIN-WIDTH-CHARS MARGIN-WIDTH-P MARGIN-WIDTH-PI MARGIN-WIDTH-PIX MARGIN-WIDTH-PIXE MARGIN-WIDTH-PIXEL MARGIN-WIDTH-PIXELS MATCHES MAX MAX-BUTTON MAX-CHARS
+MAX-DATA-GUESS MAX-HEIGHT MAX-HEIGHT-C MAX-HEIGHT-CH MAX-HEIGHT-CHA MAX-HEIGHT-CHAR MAX-HEIGHT-CHARS MAX-HEIGHT-P MAX-HEIGHT-PI MAX-HEIGHT-PIX MAX-HEIGHT-PIXE MAX-HEIGHT-PIXEL
+MAX-HEIGHT-PIXELS MAX-ROWS MAX-SIZE MAX-VAL MAX-VALU MAX-VALUE MAX-WIDTH MAX-WIDTH-C MAX-WIDTH-CH MAX-WIDTH-CHA MAX-WIDTH-CHAR MAX-WIDTH-CHARS MAX-WIDTH-P MAX-WIDTH-PI
+MAX-WIDTH-PIX MAX-WIDTH-PIXE MAX-WIDTH-PIXEL MAX-WIDTH-PIXELS MAXIMIZE MAXIMUM MEMORY MEMPTR MENU MENU-BAR MENU-ITEM MENU-K MENU-KE MENU-KEY MENU-M MENU-MO MENU-MOU
+MENU-MOUS MENU-MOUSE MENUBAR MESSAGE-AREA MESSAGE-AREA-FONT MESSAGE-LINE MIN MINI MINIM MINIMU MINIMUM MIN-BUTTON MIN-HEIGHT MIN-HEIGHT-C MIN-HEIGHT-CH MIN-HEIGHT-CHA
+MIN-HEIGHT-CHAR MIN-HEIGHT-CHARS MIN-HEIGHT-P MIN-HEIGHT-PI MIN-HEIGHT-PIX MIN-HEIGHT-PIXE MIN-HEIGHT-PIXEL MIN-HEIGHT-PIXELS MIN-ROW-HEIGHT MIN-ROW-HEIGHT-C
+MIN-ROW-HEIGHT-CH MIN-ROW-HEIGHT-CHA MIN-ROW-HEIGHT-CHAR MIN-ROW-HEIGHT-CHARS MIN-ROW-HEIGHT-P MIN-ROW-HEIGHT-PI MIN-ROW-HEIGHT-PIX MIN-ROW-HEIGHT-PIXE MIN-ROW-HEIGHT-PIXEL
+MIN-ROW-HEIGHT-PIXELS MIN-SIZE MIN-VAL MIN-VALU MIN-VALUE MIN-WIDTH MIN-WIDTH-C MIN-WIDTH-CH MIN-WIDTH-CHA MIN-WIDTH-CHAR MIN-WIDTH-CHARS MIN-WIDTH-P MIN-WIDTH-PI MIN-WIDTH-PIX
+MIN-WIDTH-PIXE MIN-WIDTH-PIXEL MIN-WIDTH-PIXELS MOD MODIFIED MODULO MONTH MOUSE-P MOUSE-PO MOUSE-POI MOUSE-POIN MOUSE-POINT MOUSE-POINTE MOUSE-POINTER MOVABLE MOVE-AFTER
+MOVE-AFTER- MOVE-AFTER-T MOVE-AFTER-TA MOVE-AFTER-TAB MOVE-AFTER-TAB- MOVE-AFTER-TAB-I MOVE-AFTER-TAB-IT MOVE-AFTER-TAB-ITE MOVE-AFTER-TAB-ITEM MOVE-BEFOR MOVE-BEFORE
+MOVE-BEFORE- MOVE-BEFORE-T MOVE-BEFORE-TA MOVE-BEFORE-TAB MOVE-BEFORE-TAB- MOVE-BEFORE-TAB-I MOVE-BEFORE-TAB-IT MOVE-BEFORE-TAB-ITE MOVE-BEFORE-TAB-ITEM MOVE-COL
+MOVE-COLU MOVE-COLUM MOVE-COLUMN MOVE-TO-B MOVE-TO-BO MOVE-TO-BOT MOVE-TO-BOTT MOVE-TO-BOTTO MOVE-TO-BOTTOM MOVE-TO-EOF MOVE-TO-T MOVE-TO-TO MOVE-TO-TOP MULTIPLE MULTIPLE-KEY
+MULTITASKING-INTERVAL MUST-EXIST
+NAME NAMESPACE-PREFIX NAMESPACE-URI NATIVE NE NEW-ROW NEXT-COL NEXT-COLU NEXT-COLUM NEXT-COLUMN NEXT-SIBLING NEXT-TAB-ITE NEXT-TAB-ITEM NEXT-VALUE NO-APPLY NO-ARRAY-M
+NO-ARRAY-ME NO-ARRAY-MES NO-ARRAY-MESS NO-ARRAY-MESSA NO-ARRAY-MESSAG NO-ARRAY-MESSAGE NO-ASSIGN NO-ATTR-L NO-ATTR-LI NO-ATTR-LIS NO-ATTR-LIST NO-AUTO-VALIDATE NO-BIND-WHERE
+NO-BOX NO-COLUMN-SC NO-COLUMN-SCR NO-COLUMN-SCRO NO-COLUMN-SCROL NO-COLUMN-SCROLL NO-COLUMN-SCROLLI NO-COLUMN-SCROLLIN NO-COLUMN-SCROLLING NO-CONSOLE NO-CONVERT
+NO-CONVERT-3D NO-CONVERT-3D- NO-CONVERT-3D-C NO-CONVERT-3D-CO NO-CONVERT-3D-COL NO-CONVERT-3D-COLO NO-CONVERT-3D-COLOR NO-CONVERT-3D-COLORS NO-CURRENT-VALUE NO-DEBUG NO-DRAG
+NO-ECHO NO-FOCUS NO-INDEX-HINT NO-JOIN-BY-SQLDB NO-LOOKAHEAD NO-ROW-MARKERS NO-SCROLLBAR-V NO-SCROLLBAR-VE NO-SCROLLBAR-VER NO-SCROLLBAR-VERT NO-SCROLLBAR-VERTI
+NO-SCROLLBAR-VERTIC NO-SCROLLBAR-VERTICA NO-SCROLLBAR-VERTICAL NO-SCROLLING NO-SEPARATE-CONNECTION NO-SEPARATORS NO-TAB NO-TAB- NO-TAB-S NO-TAB-ST NO-TAB-STO NO-TAB-STOP
+NO-UND NO-UNDE NO-UNDER NO-UNDERL NO-UNDERLI NO-UNDERLIN NO-UNDERLINE NO-WORD-WRAP NODE-TYPE NODE-VALUE NONE NORMALIZE NUM-BUFFERS NUM-BUT NUM-BUTT NUM-BUTTO NUM-BUTTON
+NUM-BUTTONS NUM-CHILDREN NUM-COL NUM-COLU NUM-COLUM NUM-COLUMN NUM-COLUMNS NUM-COPIES NUM-DROPPED-FILES NUM-FIELDS NUM-FORMATS NUM-ITEMS NUM-ITERATIONS NUM-LINES
+NUM-LOCKED-COL NUM-LOCKED-COLU NUM-LOCKED-COLUM NUM-LOCKED-COLUMN NUM-LOCKED-COLUMNS NUM-MESSAGES NUM-REPL NUM-REPLA NUM-REPLAC NUM-REPLACE NUM-REPLACED NUM-RESULTS
+NUM-SELECTED NUM-SELECTED-ROWS NUM-SELECTED-WIDGETS NUM-TABS NUM-TO-RETAIN NUM-VISIBLE-COL NUM-VISIBLE-COLU NUM-VISIBLE-COLUM NUM-VISIBLE-COLUMN NUM-VISIBLE-COLUMNS NUMERIC
+NUMERIC-DEC NUMERIC-DECI NUMERIC-DECIM NUMERIC-DECIMA NUMERIC-DECIMAL NUMERIC-DECIMAL- NUMERIC-DECIMAL-P NUMERIC-DECIMAL-PO NUMERIC-DECIMAL-POI NUMERIC-DECIMAL-POIN
+NUMERIC-DECIMAL-POINT NUMERIC-F NUMERIC-FO NUMERIC-FOR NUMERIC-FORM NUMERIC-FORMA NUMERIC-FORMAT NUMERIC-SEP NUMERIC-SEPA NUMERIC-SEPAR NUMERIC-SEPARA NUMERIC-SEPARAT
+NUMERIC-SEPARATO NUMERIC-SEPARATOR
+OBJECT OCTET_LENGTH OK OK-CANCEL OLE-INVOKE-LOCA OLE-INVOKE-LOCAL OLE-INVOKE-LOCALE OLE-NAMES-LOCA OLE-NAMES-LOCAL OLE-NAMES-LOCALE ON-FRAME ON-FRAME- ON-FRAME-B
+ON-FRAME-BO ON-FRAME-BOR ON-FRAME-BORD ON-FRAME-BORDE ON-FRAME-BORDER ORDERED-JOIN ORDINAL ORIENTATION OS-GETENV OUTER OUTER-JOIN OVERRIDE OWNER OWNER-DOCUMENT
+PAGE-SIZE PAGE-WID PAGE-WIDT PAGE-WIDTH PAGED PARENT PARTIAL-KEY PASCAL PATHNAME PERF PERFO PERFOR PERFORM PERFORMA PERFORMAN PERFORMANC PERFORMANCE PERSISTENT-PROCEDURE
+PFC PFCO PFCOL PFCOLO PFCOLOR PINNABLE PIXELS-PER-COL PIXELS-PER-COLU PIXELS-PER-COLUM PIXELS-PER-COLUMN PIXELS-PER-ROW POPUP-M POPUP-ME POPUP-MEN POPUP-MENU POPUP-O
+POPUP-ON POPUP-ONL POPUP-ONLY PORTRAIT POSITION PRECISION PREPARE-STRING PREPARED PRESEL PRESELE PRESELEC PRESELECT PREV PREV-COL PREV-COLU PREV-COLUM PREV-COLUMN
+PREV-SIBLING PREV-TAB-I PREV-TAB-IT PREV-TAB-ITE PREV-TAB-ITEM PRIMARY PRINTER PRINTER-CONTROL-HANDLE PRINTER-HDC PRINTER-NAME PRINTER-PORT PRINTER-SETUP PRIVATE PRIVATE-D
+PRIVATE-DA PRIVATE-DAT PRIVATE-DATA PROCE PROCED PROCEDU PROCEDUR PROCEDURE PROCEDURE-NAME PROFILE-FILE PROFILING PROGRESS-S PROGRESS-SO PROGRESS-SOU PROGRESS-SOUR
+PROGRESS-SOURC PROGRESS-SOURCE PROXY PUBLIC-ID PUBLISHED-EVENTS PUT-BITS PUT-BYTES PUT-DOUBLE PUT-FLOAT PUT-LONG PUT-SHORT PUT-STRING PUT-UNSIGNED-SHORT
+QUERY-CLOSE QUERY-OFF-END QUERY-OPEN QUERY-PREPARE QUESTION
+RADIO-BUTTONS RADIO-SET RANDOM RAW RAW-TRANSFER READ READ-FILE READ-ONLY REAL RECURSIVE REFRESH REFRESHABLE REMOTE REMOTE-HOST REMOTE-PORT REMOVE-ATTRIBUTE REMOVE-CHILD
+REMOVE-EVENTS-PROC REMOVE-EVENTS-PROCE REMOVE-EVENTS-PROCED REMOVE-EVENTS-PROCEDU REMOVE-EVENTS-PROCEDUR REMOVE-EVENTS-PROCEDURE REMOVE-SUPER-PROC REMOVE-SUPER-PROCE
+REMOVE-SUPER-PROCED REMOVE-SUPER-PROCEDU REMOVE-SUPER-PROCEDUR REMOVE-SUPER-PROCEDURE REPLACE REPLACE-CHILD REPLACE-SELECTION-TEXT REPLICATION-CREATE REPLICATION-DELETE
+REPLICATION-WRITE REPOSITION-BACK REPOSITION-BACKW REPOSITION-BACKWA REPOSITION-BACKWAR REPOSITION-BACKWARD REPOSITION-BACKWARDS REPOSITION-FORW REPOSITION-FORWA
+REPOSITION-FORWAR REPOSITION-FORWARD REPOSITION-FORWARDS REPOSITION-TO-ROW REPOSITION-TO-ROWID REQUEST RESIZA RESIZAB RESIZABL RESIZABLE RESIZE RESULT RETAIN-S RETAIN-SH
+RETAIN-SHA RETAIN-SHAP RETAIN-SHAPE RETRY-CANCEL RETURN-INS RETURN-INSE RETURN-INSER RETURN-INSERT RETURN-INSERTE RETURN-INSERTED RETURN-TO-START-DI RETURN-TO-START-DIR
+RETURNS REVERSE-FROM RGB-V RGB-VA RGB-VAL RGB-VALU RGB-VALUE RIGHT RIGHT-ALIGN RIGHT-ALIGNE RIGHT-ALIGNED RIGHT-TRIM ROUND ROW ROW-HEIGHT ROW-HEIGHT-C ROW-HEIGHT-CH
+ROW-HEIGHT-CHA ROW-HEIGHT-CHAR ROW-HEIGHT-CHARS ROW-HEIGHT-P ROW-HEIGHT-PI ROW-HEIGHT-PIX ROW-HEIGHT-PIXE ROW-HEIGHT-PIXEL ROW-HEIGHT-PIXELS ROW-MA ROW-MAR ROW-MARK ROW-MARKE
+ROW-MARKER ROW-MARKERS ROW-OF ROW-RESIZABLE ROWID RULE RULE-ROW RULE-Y RUN-PROC RUN-PROCE RUN-PROCED RUN-PROCEDU RUN-PROCEDUR RUN-PROCEDURE
+SAVE-AS SAVE-FILE SAX-XML SCREEN-VAL SCREEN-VALU SCREEN-VALUE SCROLL-BARS SCROLL-DELTA SCROLL-HORIZ-VALUE SCROLL-OFFSET SCROLL-TO-CURRENT-ROW SCROLL-TO-I SCROLL-TO-IT
+SCROLL-TO-ITE SCROLL-TO-ITEM SCROLL-TO-SELECTED-ROW SCROLL-VERT-VALUE SCROLLABLE SCROLLBAR-H SCROLLBAR-HO SCROLLBAR-HOR SCROLLBAR-HORI SCROLLBAR-HORIZ SCROLLBAR-HORIZO
+SCROLLBAR-HORIZON SCROLLBAR-HORIZONT SCROLLBAR-HORIZONTA SCROLLBAR-HORIZONTAL SCROLLBAR-V SCROLLBAR-VE SCROLLBAR-VER SCROLLBAR-VERT SCROLLBAR-VERTI SCROLLBAR-VERTIC
+SCROLLBAR-VERTICA SCROLLBAR-VERTICAL SCROLLED-ROW-POS SCROLLED-ROW-POSI SCROLLED-ROW-POSIT SCROLLED-ROW-POSITI SCROLLED-ROW-POSITIO SCROLLED-ROW-POSITION SCROLLING
+SE-CHECK-POOLS SE-ENABLE-OFF SE-ENABLE-ON SE-NUM-POOLS SE-USE-MESSAGE SECTION SELECT-ALL SELECT-FOCUSED-ROW SELECT-NEXT-ROW SELECT-PREV-ROW SELECT-REPOSITIONED-ROW
+SELECT-ROW SELECTABLE SELECTED SELECTED-ITEMS SELECTION-END SELECTION-LIST SELECTION-START SELECTION-TEXT SEND SENSITIVE SEPARATE-CONNECTION SEPARATOR-FGC SEPARATOR-FGCO
+SEPARATOR-FGCOL SEPARATOR-FGCOLO SEPARATOR-FGCOLOR SEPARATORS SERVER SERVER-CONNECTION-BO SERVER-CONNECTION-BOU SERVER-CONNECTION-BOUN SERVER-CONNECTION-BOUND
+SERVER-CONNECTION-BOUND-RE SERVER-CONNECTION-BOUND-REQ SERVER-CONNECTION-BOUND-REQU SERVER-CONNECTION-BOUND-REQUE SERVER-CONNECTION-BOUND-REQUES
+SERVER-CONNECTION-BOUND-REQUEST SERVER-CONNECTION-CO SERVER-CONNECTION-CON SERVER-CONNECTION-CONT SERVER-CONNECTION-CONTE SERVER-CONNECTION-CONTEX SERVER-CONNECTION-CONTEXT
+SERVER-CONNECTION-ID SERVER-OPERATING-MODE SERVER-SOCKET SESSION-END SET-ATTRIBUTE SET-BLUE SET-BLUE- SET-BLUE-V SET-BLUE-VA SET-BLUE-VAL SET-BLUE-VALU SET-BLUE-VALUE SET-BREAK
+SET-BUFFERS SET-BYTE-ORDER SET-CELL-FOCUS SET-COMMIT SET-CONNECT-PROCEDURE SET-CONTENTS SET-DYNAMIC SET-GREEN SET-GREEN- SET-GREEN-V SET-GREEN-VA SET-GREEN-VAL SET-GREEN-VALU
+SET-GREEN-VALUE SET-LEAKPOINT SET-NUMERIC-FORM SET-NUMERIC-FORMA SET-NUMERIC-FORMAT SET-POINTER-VAL SET-POINTER-VALU SET-POINTER-VALUE SET-READ-RESPONSE-PROCEDURE SET-RED
+SET-RED- SET-RED-V SET-RED-VA SET-RED-VAL SET-RED-VALU SET-RED-VALUE SET-REPOSITIONED-ROW SET-RGB SET-RGB- SET-RGB-V SET-RGB-VA SET-RGB-VAL SET-RGB-VALU SET-RGB-VALUE
+SET-ROLLBACK SET-SELECTION SET-SIZE SET-SOCKET-OPTION SET-WAIT SET-WAIT- SET-WAIT-S SET-WAIT-ST SET-WAIT-STA SET-WAIT-STAT SET-WAIT-STATE SHORT SHOW-IN-TASK SHOW-IN-TASKB
+SHOW-IN-TASKBA SHOW-IN-TASKBAR SIDE-LAB SIDE-LABE SIDE-LABEL SIDE-LABEL-H SIDE-LABEL-HA SIDE-LABEL-HAN SIDE-LABEL-HAND SIDE-LABEL-HANDL SIDE-LABEL-HANDLE SIDE-LABELS SILENT
+SIMPLE SINGLE SIZE SIZE-C SIZE-CH SIZE-CHA SIZE-CHAR SIZE-CHARS SIZE-P SIZE-PI SIZE-PIX SIZE-PIXE SIZE-PIXEL SIZE-PIXELS SKIP-DELETED-REC SKIP-DELETED-RECO
+SKIP-DELETED-RECOR SKIP-DELETED-RECORD SKIP-SCHEMA-CHECK SLIDER SMALL-ICON SMALL-TITLE SMALLINT SOCKET SORT SOURCE SQL SQRT START STATUS-AREA STATUS-AREA-FONT STATUS-BAR
+STDCALL STENCILED STOP STOPPE STOPPED STORED-PROC STORED-PROCE STORED-PROCED STORED-PROCEDU STORED-PROCEDUR STORED-PROCEDURE STRETCH-TO-FIT STRING STRING-VALUE SUB-AVE
+SUB-AVER SUB-AVERA SUB-AVERAG SUB-AVERAGE SUB-COUNT SUB-MAX SUB-MAXI SUB-MAXIM SUB-MAXIMU SUB-MAXIMUM SUB-MENU SUB-MENU-HELP SUB-MIN SUB-MINI SUB-MINIM SUB-MINIMU SUB-MINIMUM
+SUB-TOTAL SUBST SUBSTI SUBSTIT SUBSTITU SUBSTITUT SUBSTITUTE SUBSTR SUBSTRI SUBSTRIN SUBSTRING SUBTYPE SUM SUMMARY SUPER-PROC SUPER-PROCE SUPER-PROCED SUPER-PROCEDU
+SUPER-PROCEDUR SUPER-PROCEDURE SUPER-PROCEDURES SUPPRESS-W SUPPRESS-WA SUPPRESS-WAR SUPPRESS-WARN SUPPRESS-WARNI SUPPRESS-WARNIN SUPPRESS-WARNING SUPPRESS-WARNINGS SYSTEM-ALERT
+SYSTEM-ALERT- SYSTEM-ALERT-B SYSTEM-ALERT-BO SYSTEM-ALERT-BOX SYSTEM-ALERT-BOXE SYSTEM-ALERT-BOXES SYSTEM-HELP SYSTEM-ID
+TAB-POSITION TAB-STOP TABLE-NUM TABLE-NUMB TABLE-NUMBE TABLE-NUMBER TARGET TEMP-DIR TEMP-DIRE TEMP-DIREC TEMP-DIRECT TEMP-DIRECTO TEMP-DIRECTOR TEMP-DIRECTORY TEMP-TABLE
+TEMP-TABLE-PREPAR TEMP-TABLE-PREPARE TERMINATE TEXT-SELECTED THREE-D THROUGH THRU TIC-MARKS TIME-SOURCE TITLE-BGC TITLE-BGCO TITLE-BGCOL TITLE-BGCOLO TITLE-BGCOLOR
+TITLE-DC TITLE-DCO TITLE-DCOL TITLE-DCOLO TITLE-DCOLOR TITLE-FGC TITLE-FGCO TITLE-FGCOL TITLE-FGCOLO TITLE-FGCOLOR TITLE-FO TITLE-FON TITLE-FONT TO-ROWID TOGGLE-BOX TOOL-BAR
+TOOLTIP TOOLTIPS TOP TOPIC TOTAL TRACE-FILTER TRACING TRAILING TRANS-INIT-PROC TRANS-INIT-PROCE TRANS-INIT-PROCED TRANS-INIT-PROCEDU TRANS-INIT-PROCEDUR
+TRANS-INIT-PROCEDURE TRANSACTION-MODE TRANSPAR TRANSPARE TRANSPAREN TRANSPARENT TRUNC TRUNCA TRUNCAT TRUNCATE TYPE
+UNBUFF UNBUFFE UNBUFFER UNBUFFERE UNBUFFERED UNIQUE-ID UNIQUE-MATCH UNLOAD UNSIGNED-SHORT UPPER URL-DECODE URL-ENCODE USE USE-DIC USE-DICT USE-DICT- USE-DICT-E
+USE-DICT-EX USE-DICT-EXP USE-DICT-EXPS USE-FILENAME USE-TEXT USER-DATA UTC-OFFSET
+V6DISPLAY VALID-EVENT VALID-HANDLE VALIDATE VALIDATE-EXPRESSIO VALIDATE-EXPRESSION VALIDATE-MESSAGE VALIDATE-XML VAR VARI VARIA VARIAB VARIABL VARIABLE VERB VERBO VERBOS
+VERBOSE VERT VERTI VERTIC VERTICA VERTICAL VIRTUAL-HEIGHT VIRTUAL-HEIGHT-C VIRTUAL-HEIGHT-CH VIRTUAL-HEIGHT-CHA VIRTUAL-HEIGHT-CHAR VIRTUAL-HEIGHT-CHARS VIRTUAL-HEIGHT-P
+VIRTUAL-HEIGHT-PI VIRTUAL-HEIGHT-PIX VIRTUAL-HEIGHT-PIXE VIRTUAL-HEIGHT-PIXEL VIRTUAL-HEIGHT-PIXELS VIRTUAL-WIDTH VIRTUAL-WIDTH-C VIRTUAL-WIDTH-CH VIRTUAL-WIDTH-CHA
+VIRTUAL-WIDTH-CHAR VIRTUAL-WIDTH-CHARS VIRTUAL-WIDTH-P VIRTUAL-WIDTH-PI VIRTUAL-WIDTH-PIX VIRTUAL-WIDTH-PIXE VIRTUAL-WIDTH-PIXEL VIRTUAL-WIDTH-PIXELS VISIBLE
+WAIT WARNING WEEKDAY WIDGET WIDGET-E WIDGET-EN WIDGET-ENT WIDGET-ENTE WIDGET-ENTER WIDGET-H WIDGET-HA WIDGET-HAN WIDGET-HAND WIDGET-HANDL WIDGET-HANDLE WIDGET-L WIDGET-LE
+WIDGET-LEA WIDGET-LEAV WIDGET-LEAVE WIDGET-POOL WIDTH WIDTH-C WIDTH-CH WIDTH-CHA WIDTH-CHAR WIDTH-CHARS WIDTH-P WIDTH-PI WIDTH-PIX WIDTH-PIXE WIDTH-PIXEL WIDTH-PIXELS
+WINDOW-NAME WINDOW-STA WINDOW-STAT WINDOW-STATE WINDOW-SYS WINDOW-SYST WINDOW-SYSTE WINDOW-SYSTEM WORD-INDEX WORD-WRAP WORK-AREA-HEIGHT-P WORK-AREA-HEIGHT-PI
+WORK-AREA-HEIGHT-PIX WORK-AREA-HEIGHT-PIXE WORK-AREA-HEIGHT-PIXEL WORK-AREA-HEIGHT-PIXELS WORK-AREA-WIDTH-P WORK-AREA-WIDTH-PI WORK-AREA-WIDTH-PIX WORK-AREA-WIDTH-PIXE
+WORK-AREA-WIDTH-PIXEL WORK-AREA-WIDTH-PIXELS WORK-AREA-X WORK-AREA-Y WRITE-DATA
+X X-DOCUMENT X-NODEREF X-OF
+Y Y-OF YEAR YEAR-OFFSET YES-NO YES-NO-CANCEL
+
+$STRINGDELIMITERS="
+
+$ML_COMMENT=/* */
+
+$ESCCHAR=regex(~\d{3}|~x\d{2}|^[ntvbrfa~\?'"])
+
+$IGNORECASE=false
+
+$DIRECTIVE=&
+
+$IDENTIFIER=regex([a-zA-Z_][\w\-]*)
+
+$SYMBOLS= ( ) [ ] { } , ; : < > ! = / * % + -
+
+
diff --git a/support/highlight/langDefs/ps.lang b/support/highlight/langDefs/ps.lang
new file mode 100644
index 0000000000..401fc5c043
--- /dev/null
+++ b/support/highlight/langDefs/ps.lang
@@ -0,0 +1,33 @@
+# PostScript language definition file
+#
+# Author: André Simon
+# Mail: andre.simon1@gmx.de
+# Date: 08.02.04
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=PostScript
+
+$KEYWORDS(kwa)= pop exch dup copy roll clear count mark cleartomark counttomark exec if ifelse for repeat loop exit stop stopped
+countexecstack execstack quit start
+
+$KEYWORDS(kwb)=adddiv idiv mod mul sub abs ned ceiling floor round truncate sqrt atan cos sin expln log rand srand rrand true false
+NULL
+
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=%
+
+$IGNORECASE=false
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * + -
diff --git a/support/highlight/langDefs/ps1.lang b/support/highlight/langDefs/ps1.lang
new file mode 100644
index 0000000000..6d64510c9f
--- /dev/null
+++ b/support/highlight/langDefs/ps1.lang
@@ -0,0 +1,38 @@
+# MS PowerShell language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 13.12.2006
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Microsoft PowerShell
+
+$KEYWORDS(kwa)=Add-Content Add-History Add-Member Add-PSSnapin Clear-Content Clear-Item Clear-ItemProperty Clear-Variable Compare-Object ConvertFrom-SecureString Convert-Path ConvertTo-Html ConvertTo-SecureString Copy-Item Copy-ItemProperty Export-Alias Export-Clixml Export-Console Export-Csv ForEach-Object Format-Custom Format-List Format-Table Format-Wide Get-Acl Get-Alias Get-AuthenticodeSignature Get-ChildItem Get-Command Get-Content Get-Credential Get-Culture Get-Date Get-EventLog Get-ExecutionPolicy Get-Help Get-History Get-Host Get-Item Get-ItemProperty Get-Location Get-Member Get-PfxCertificate Get-Process Get-PSDrive Get-PSProvider Get-PSSnapin Get-Service Get-TraceSource Get-UICulture Get-Unique Get-Variable Get-WmiObject Group-Object Import-Alias Import-Clixml Import-Csv Invoke-Expression Invoke-History Invoke-Item Join-Path Measure-Command Measure-Object Move-Item Move-ItemProperty New-Alias New-Item New-ItemProperty New-Object New-PSDrive New-Service New-TimeSpan New-Variable Out-Default Out-File Out-Host Out-Null Out-Printer Out-String Pop-Location Push-Location Read-Host Remove-Item Remove-ItemProperty Remove-PSDrive Remove-PSSnapin Remove-Variable Rename-Item Rename-ItemProperty Resolve-Path Restart-Service Resume-Service Select-Object Select-String Set-Acl Set-Alias Set-AuthenticodeSignature Set-Content Set-Date Set-ExecutionPolicy Set-Item Set-ItemProperty Set-Location Set-PSDebug Set-Service Set-TraceSource Set-Variable Sort-Object Split-Path Start-Service Start-Sleep Start-Transcript Stop-Process Stop-Service Stop-Transcript Suspend-Service Tee-Object Test-Path Trace-Command Update-FormatData Update-TypeData Where-Object Write-Debug Write-Error Write-Host Write-Output Write-Progress Write-Verbose Write-Warning switch function if throw else while break
+
+$KEYWORDS(kwb)=ac asnp clc cli clp clv cpi cpp cvpa diff epal epcsv fc fl foreach % ft fw gal gc gci gcm gdr ghy gi gl gm gp gps group gsv gsnp gu gv gwmi iex ihy ii ipal ipcsv mi mp nal ndr ni nv oh rdr ri rni rnp rp rsnp rv rvpa sal sasv sc select si sl sleep sort sp spps spsv sv tee where ? write cat cd clear cp h history kill lp ls mount mv popd ps pushd pwd r rm rmdir echo cls chdir copy del dir erase move rd ren set type
+
+$KEYWORDS(kwc)=CIM_DataFile CIM_DirectoryContainsFile CIM_ProcessExecutable CIM_VideoControllerResolution Msft_Providers Msft_WmiProvider_Counters NetDiagnostics Win32_1394Controller Win32_1394ControllerDevice Win32_AccountSID Win32_ActionCheck Win32_ActiveRoute Win32_AllocatedResource Win32_ApplicationCommandLine Win32_ApplicationService Win32_AssociatedBattery Win32_AssociatedProcessorMemory Win32_AutochkSetting Win32_BaseBoard Win32_Battery Win32_Binary Win32_BindImageAction Win32_BIOS Win32_BootConfiguration Win32_Bus Win32_CacheMemory Win32_CDROMDrive Win32_CheckCheck Win32_CIMLogicalDeviceCIMDataFile Win32_ClassicCOMApplicationClasses Win32_ClassicCOMClass Win32_ClassicCOMClassSetting Win32_ClassicCOMClassSettings Win32_ClassInfoAction Win32_ClientApplicationSetting Win32_CodecFile Win32_COMApplicationSettings Win32_ComClassAutoEmulator Win32_ComClassEmulator Win32_CommandLineAccess Win32_ComponentCategory Win32_ComputerSystem Win32_ComputerSystemProcessor Win32_ComputerSystemProduct Win32_ComputerSystemWindowsProductActivationSetting Win32_Condition Win32_ConnectionShare Win32_ControllerHasHub Win32_CreateFolderAction Win32_CurrentProbe Win32_DCOMApplication Win32_DCOMApplicationAccessAllowedSetting Win32_DCOMApplicationLaunchAllowedSetting Win32_DCOMApplicationSetting Win32_DependentService Win32_Desktop Win32_DesktopMonitor Win32_DeviceBus Win32_DeviceMemoryAddress Win32_DfsNode Win32_DfsNodeTarget Win32_DfsTarget Win32_Directory Win32_DirectorySpecification Win32_DiskDrive Win32_DiskDrivePhysicalMedia Win32_DiskDriveToDiskPartition Win32_DiskPartition Win32_DiskQuota Win32_DisplayConfiguration Win32_DisplayControllerConfiguration Win32_DMAChannel Win32_DriverForDevice Win32_DriverVXD Win32_DuplicateFileAction Win32_Environment Win32_EnvironmentSpecification Win32_ExtensionInfoAction Win32_Fan Win32_FileSpecification Win32_FloppyController Win32_FloppyDrive Win32_FontInfoAction Win32_Group Win32_GroupInDomain Win32_GroupUser Win32_HeatPipe Win32_IDEController Win32_IDEControllerDevice Win32_ImplementedCategory Win32_InfraredDevice Win32_IniFileSpecification Win32_InstalledSoftwareElement Win32_IP4PersistedRouteTable Win32_IP4RouteTable Win32_IRQResource Win32_Keyboard Win32_LaunchCondition Win32_LoadOrderGroup Win32_LoadOrderGroupServiceDependencies Win32_LoadOrderGroupServiceMembers Win32_LocalTime Win32_LoggedOnUser Win32_LogicalDisk Win32_LogicalDiskRootDirectory Win32_LogicalDiskToPartition Win32_LogicalFileAccess Win32_LogicalFileAuditing Win32_LogicalFileGroup Win32_LogicalFileOwner Win32_LogicalFileSecuritySetting Win32_LogicalMemoryConfiguration Win32_LogicalProgramGroup Win32_LogicalProgramGroupDirectory Win32_LogicalProgramGroupItem Win32_LogicalProgramGroupItemDataFile Win32_LogicalShareAccess Win32_LogicalShareAuditing Win32_LogicalShareSecuritySetting Win32_LogonSession Win32_LogonSessionMappedDisk Win32_MappedLogicalDisk Win32_MemoryArray Win32_MemoryArrayLocation Win32_MemoryDevice Win32_MemoryDeviceArray Win32_MemoryDeviceLocation Win32_MIMEInfoAction Win32_MotherboardDevice Win32_MountPoint Win32_MoveFileAction Win32_NamedJobObject Win32_NamedJobObjectActgInfo Win32_NamedJobObjectLimit Win32_NamedJobObjectLimitSetting Win32_NamedJobObjectProcess Win32_NamedJobObjectSecLimit Win32_NamedJobObjectSecLimitSetting Win32_NamedJobObjectStatistics Win32_NetworkAdapter Win32_NetworkAdapterConfiguration Win32_NetworkAdapterSetting Win32_NetworkClient Win32_NetworkConnection Win32_NetworkLoginProfile Win32_NetworkProtocol Win32_NTDomain Win32_NTEventlogFile Win32_NTLogEvent Win32_NTLogEventComputer Win32_NTLogEventLog Win32_NTLogEventUser Win32_ODBCAttribute Win32_ODBCDataSourceAttribute Win32_ODBCDataSourceSpecification Win32_ODBCDriverAttribute Win32_ODBCDriverSoftwareElement Win32_ODBCDriverSpecification Win32_ODBCSourceAttribute Win32_ODBCTranslatorSpecification Win32_OnBoardDevice Win32_OperatingSystem Win32_OperatingSystemAutochkSetting Win32_OperatingSystemQFE Win32_OSRecoveryConfiguration Win32_PageFile Win32_PageFileElementSetting Win32_PageFileSetting Win32_PageFileUsage Win32_ParallelPort Win32_Patch Win32_PatchFile Win32_PatchPackage Win32_PCMCIAController Win32_PerfFormattedData_ContentFilter_IndexingServiceFilter Win32_PerfFormattedData_ContentIndex_IndexingService Win32_PerfFormattedData_Fax_FaxServices Win32_PerfFormattedData_IPSec_IPSecv4Driver Win32_PerfFormattedData_IPSec_IPSecv4IKE Win32_PerfFormattedData_ISAPISearch_HttpIndexingService Win32_PerfFormattedData_MSDTC_DistributedTransactionCoordinator Win32_PerfFormattedData_NETFramework_NETCLRExceptions Win32_PerfFormattedData_NETFramework_NETCLRInterop Win32_PerfFormattedData_NETFramework_NETCLRJit Win32_PerfFormattedData_NETFramework_NETCLRLoading Win32_PerfFormattedData_NETFramework_NETCLRLocksAndThreads Win32_PerfFormattedData_NETFramework_NETCLRMemory Win32_PerfFormattedData_NETFramework_NETCLRRemoting Win32_PerfFormattedData_NETFramework_NETCLRSecurity Win32_PerfFormattedData_NTDS_NTDS Win32_PerfFormattedData_PerfDisk_LogicalDisk Win32_PerfFormattedData_PerfDisk_PhysicalDisk Win32_PerfFormattedData_PerfNet_Browser Win32_PerfFormattedData_PerfNet_Redirector Win32_PerfFormattedData_PerfNet_Server Win32_PerfFormattedData_PerfNet_ServerWorkQueues Win32_PerfFormattedData_PerfOS_Cache Win32_PerfFormattedData_PerfOS_Memory Win32_PerfFormattedData_PerfOS_Objects Win32_PerfFormattedData_PerfOS_PagingFile Win32_PerfFormattedData_PerfOS_Processor Win32_PerfFormattedData_PerfOS_System Win32_PerfFormattedData_PerfProc_FullImage_Costly Win32_PerfFormattedData_PerfProc_Image_Costly Win32_PerfFormattedData_PerfProc_JobObject Win32_PerfFormattedData_PerfProc_JobObjectDetails Win32_PerfFormattedData_PerfProc_Process Win32_PerfFormattedData_PerfProc_ProcessAddressSpace_Costly Win32_PerfFormattedData_PerfProc_Thread Win32_PerfFormattedData_PerfProc_ThreadDetails_Costly Win32_PerfFormattedData_RemoteAccess_RASPort Win32_PerfFormattedData_RemoteAccess_RASTotal Win32_PerfFormattedData_RSVP_ACSRSVPInterfaces Win32_PerfFormattedData_RSVP_ACSRSVPService Win32_PerfFormattedData_Spooler_PrintQueue Win32_PerfFormattedData_TapiSrv_Telephony Win32_PerfFormattedData_Tcpip_ICMP Win32_PerfFormattedData_Tcpip_ICMPv6 Win32_PerfFormattedData_Tcpip_IP Win32_PerfFormattedData_Tcpip_IPv4 Win32_PerfFormattedData_Tcpip_IPv6 Win32_PerfFormattedData_Tcpip_NBTConnection Win32_PerfFormattedData_Tcpip_NetworkInterface Win32_PerfFormattedData_Tcpip_TCP Win32_PerfFormattedData_Tcpip_TCPv4 Win32_PerfFormattedData_Tcpip_TCPv6 Win32_PerfFormattedData_Tcpip_UDP Win32_PerfFormattedData_Tcpip_UDPv4 Win32_PerfFormattedData_Tcpip_UDPv6 Win32_PerfFormattedData_TermService_TerminalServices Win32_PerfFormattedData_TermService_TerminalServicesSession Win32_PerfRawData_ASP_ActiveServerPages Win32_PerfRawData_ContentFilter_IndexingServiceFilter Win32_PerfRawData_ContentIndex_IndexingService Win32_PerfRawData_Fax_FaxServices Win32_PerfRawData_FileReplicaConn_FileReplicaConn Win32_PerfRawData_FileReplicaSet_FileReplicaSet Win32_PerfRawData_IAS_IASAccountingClients Win32_PerfRawData_IAS_IASAccountingServer Win32_PerfRawData_IAS_IASAuthenticationClients Win32_PerfRawData_IAS_IASAuthenticationServer Win32_PerfRawData_InetInfo_InternetInformationServicesGlobal Win32_PerfRawData_IPSec_IPSecv4Driver Win32_PerfRawData_IPSec_IPSecv4IKE Win32_PerfRawData_ISAPISearch_HttpIndexingService Win32_PerfRawData_MSDTC_DistributedTransactionCoordinator Win32_PerfRawData_NETFramework_NETCLRExceptions Win32_PerfRawData_NETFramework_NETCLRInterop Win32_PerfRawData_NETFramework_NETCLRJit Win32_PerfRawData_NETFramework_NETCLRLoading Win32_PerfRawData_NETFramework_NETCLRLocksAndThreads Win32_PerfRawData_NETFramework_NETCLRMemory Win32_PerfRawData_NETFramework_NETCLRRemoting Win32_PerfRawData_NETFramework_NETCLRSecurity Win32_PerfRawData_NTDS_NTDS Win32_PerfRawData_NTFSDRV_SMTPNTFSStoreDriver Win32_PerfRawData_PerfDisk_LogicalDisk Win32_PerfRawData_PerfDisk_PhysicalDisk Win32_PerfRawData_PerfNet_Browser Win32_PerfRawData_PerfNet_Redirector Win32_PerfRawData_PerfNet_Server Win32_PerfRawData_PerfNet_ServerWorkQueues Win32_PerfRawData_PerfOS_Cache Win32_PerfRawData_PerfOS_Memory Win32_PerfRawData_PerfOS_Objects Win32_PerfRawData_PerfOS_PagingFile Win32_PerfRawData_PerfOS_Processor Win32_PerfRawData_PerfOS_System Win32_PerfRawData_PerfProc_FullImage_Costly Win32_PerfRawData_PerfProc_Image_Costly Win32_PerfRawData_PerfProc_JobObject Win32_PerfRawData_PerfProc_JobObjectDetails Win32_PerfRawData_PerfProc_Process Win32_PerfRawData_PerfProc_ProcessAddressSpace_Costly Win32_PerfRawData_PerfProc_Thread Win32_PerfRawData_PerfProc_ThreadDetails_Costly Win32_PerfRawData_RemoteAccess_RASPort Win32_PerfRawData_RemoteAccess_RASTotal Win32_PerfRawData_RSVP_ACSPerRSVPService Win32_PerfRawData_RSVP_ACSRSVPInterfaces Win32_PerfRawData_RSVP_ACSRSVPService Win32_PerfRawData_SMTPSVC_SMTPServer Win32_PerfRawData_Spooler_PrintQueue Win32_PerfRawData_TapiSrv_Telephony Win32_PerfRawData_Tcpip_ICMP Win32_PerfRawData_Tcpip_ICMPv6 Win32_PerfRawData_Tcpip_IP Win32_PerfRawData_Tcpip_IPv4 Win32_PerfRawData_Tcpip_IPv6 Win32_PerfRawData_Tcpip_NBTConnection Win32_PerfRawData_Tcpip_NetworkInterface Win32_PerfRawData_Tcpip_TCP Win32_PerfRawData_Tcpip_TCPv4 Win32_PerfRawData_Tcpip_TCPv6 Win32_PerfRawData_Tcpip_UDP Win32_PerfRawData_Tcpip_UDPv4 Win32_PerfRawData_Tcpip_UDPv6 Win32_PerfRawData_TermService_TerminalServices Win32_PerfRawData_TermService_TerminalServicesSession Win32_PerfRawData_W3SVC_WebService Win32_PhysicalMedia Win32_PhysicalMemory Win32_PhysicalMemoryArray Win32_PhysicalMemoryLocation Win32_PingStatus Win32_PNPAllocatedResource Win32_PnPDevice Win32_PnPEntity Win32_PnPSignedDriver Win32_PnPSignedDriverCIMDataFile Win32_PointingDevice Win32_PortableBattery Win32_PortConnector Win32_PortResource Win32_POTSModem Win32_POTSModemToSerialPort Win32_Printer Win32_PrinterConfiguration Win32_PrinterController Win32_PrinterDriver Win32_PrinterDriverDll Win32_PrinterSetting Win32_PrinterShare Win32_PrintJob Win32_Process Win32_Processor Win32_ProductOptional Win32_ProductCheck Win32_ProductResource Win32_ProductSoftwareFeatures Win32_ProgIDSpecification Win32_ProgramGroup Win32_ProgramGroupContents Win32_Property Win32_ProtocolBinding Win32_Proxy Win32_PublishComponentAction Win32_QuickFixEngineering Win32_QuotaSetting Win32_Refrigeration Win32_Registry Win32_RegistryAction Win32_RemoveFileAction Win32_RemoveIniAction Win32_ReserveCost Win32_ScheduledJob Win32_SCSIController Win32_SCSIControllerDevice Win32_SecuritySettingOfLogicalFile Win32_SecuritySettingOfLogicalShare Win32_SelfRegModuleAction Win32_SerialPort Win32_SerialPortConfiguration Win32_SerialPortSetting Win32_ServerConnection Win32_ServerSession Win32_Service Win32_ServiceControl Win32_ServiceSpecification Win32_ServiceSpecificationService Win32_SessionConnection Win32_SessionProcess Win32_ShadowBy Win32_ShadowCopy Win32_ShadowDiffVolumeSupport Win32_ShadowFor Win32_ShadowOn Win32_ShadowProvider Win32_ShadowStorage Win32_ShadowVolumeSupport Win32_Share Win32_ShareToDirectory Win32_ShortcutAction Win32_ShortcutFile Win32_ShortcutSAP Win32_SID Win32_SoftwareElement Win32_SoftwareElementAction Win32_SoftwareElementCheck Win32_SoftwareElementCondition Win32_SoftwareElementResource Win32_SoftwareFeature Win32_SoftwareFeatureAction Win32_SoftwareFeatureCheck Win32_SoftwareFeatureParent Win32_SoftwareFeatureSoftwareElements Win32_SoundDevice Win32_StartupCommand Win32_SubDirectory Win32_SystemAccount Win32_SystemBIOS Win32_SystemBootConfiguration Win32_SystemDesktop Win32_SystemDevices Win32_SystemDriver Win32_SystemDriverPNPEntity Win32_SystemEnclosure Win32_SystemLoadOrderGroups Win32_SystemLogicalMemoryConfiguration Win32_SystemNetworkConnections Win32_SystemOperatingSystem Win32_SystemPartitions Win32_SystemProcesses Win32_SystemProgramGroups Win32_SystemResources Win32_SystemServices Win32_SystemSlot Win32_SystemSystemDriver Win32_SystemTimeZone Win32_SystemUsers Win32_TapeDrive Win32_TCPIPPrinterPort Win32_TemperatureProbe Win32_Terminal Win32_TerminalService Win32_TerminalServiceSetting Win32_TerminalServiceToSetting Win32_TerminalTerminalSetting Win32_Thread Win32_TimeZone Win32_TSAccount Win32_TSClientSetting Win32_TSEnvironmentSetting Win32_TSGeneralSetting Win32_TSLogonSetting Win32_TSNetworkAdapterListSetting Win32_TSNetworkAdapterSetting Win32_TSPermissionsSetting Win32_TSRemoteControlSetting Win32_TSSessionDirectory Win32_TSSessionDirectorySetting Win32_TSSessionSetting Win32_TypeLibraryAction Win32_UninterruptiblePowerSupply Win32_USBController Win32_USBControllerDevice Win32_USBHub Win32_UserAccount Win32_UserDesktop Win32_UserInDomain Win32_UTCTime Win32_VideoConfiguration Win32_VideoController Win32_VideoSettings Win32_VoltageProbe Win32_Volume Win32_VolumeQuota Win32_VolumeQuotaSetting Win32_VolumeUserQuota Win32_WindowsProductActivation Win32_WMIElementSetting Win32_WMISetting
+
+$KEYWORDS(kwd)=regex([$]\w+)
+
+$STRINGDELIMITERS="
+
+$SL_COMMENT=#
+
+$IGNORECASE=true
+
+$ESCCHAR=regex(`\d{3}|`x\d{2}|^[ntvbrfa`\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; . : & | < > ! = / * % + - ~
+
+$REFORMATTING=false
diff --git a/support/highlight/langDefs/psl.lang b/support/highlight/langDefs/psl.lang
new file mode 100644
index 0000000000..552cf2813b
--- /dev/null
+++ b/support/highlight/langDefs/psl.lang
@@ -0,0 +1,50 @@
+# PATROL language definition file
+#
+# Author: André Simon
+# Mail: andre.simon1@gmx.de
+# Date: 02.03.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=PATROL
+
+$KEYWORDS(kwa)=else elsif exit export foreach function if last local main next
+requires return switch while
+
+#Functions:
+$KEYWORDS(kwb)=acos annotate annotate_get asctime asin atan blackout cat ceil
+chan_exists change_state close cond_signal cond_wait console_type convert_date
+cos cosh create date debugger destroy destroy_lock difference event_archive
+event_catalog_get event_check event_query event_range_manage event_range_query
+event_report event_schedule event_trigger event_trigger2 execute exists exp
+fabs file floor fmod fopen fseek ftell full_discovery get get_chan_info getenv
+getpid get_ranges get_vars grep history history_get_retention index int
+internal intersection in_transition isnumber is_var kill length lines lock log
+loge log10 ntharg nthargf nthline nthlinef num_consoles pconfig popen pow print
+printf proc_exists process Pslexecute random read readln refresh_parameters
+remote_close remote_event_query remote_event_trigger remote_file_send
+remote_open response response_get_value rindex set share sin sinh sleep
+snmp_agent_config snmp_agent_stop snmp_close snmp_config _snmp_debug snmp_get
+snmp_get_next snmp_h_get snmp__h_get_next snmp_h_set snmp_open snmp_set
+snmp_trap_ignore snmp_trap_listen snmp_trap_raise_std_trap snmp_trap_receive
+snmp_trap_register_im snmp_trap_send snmp_walk sort sprintf sqrt srandom subset
+substr system tail tanh time tmpnam tolower toupper trim union unique unlock
+unset va_arg va_start write
+
+
+$STRINGDELIMITERS="
+
+$SL_COMMENT=#
+
+$IGNORECASE=true
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
diff --git a/support/highlight/langDefs/pure.lang b/support/highlight/langDefs/pure.lang
new file mode 100644
index 0000000000..26af3afbae
--- /dev/null
+++ b/support/highlight/langDefs/pure.lang
@@ -0,0 +1,37 @@
+# Pure language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 08.12.2009
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Pure
+
+$KEYWORDS(kwa)=case const def else end extern if infix infixl infixr let namespace
+nonfix of otherwise outfix postfix prefix private public then using when with
+
+$KEYWORDS(kwb)=regex(::(\w+))
+
+#$KEYWORDS(kwc)=
+
+$STRINGDELIMITERS="
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntbfr\\\?'"])
+
+$SL_COMMENT=//
+$ML_COMMENT=/* */
+
+$IGNORECASE=false
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + - . ' # @ $ \ ~
+
diff --git a/support/highlight/langDefs/py.lang b/support/highlight/langDefs/py.lang
new file mode 100644
index 0000000000..f298c1bc1a
--- /dev/null
+++ b/support/highlight/langDefs/py.lang
@@ -0,0 +1,63 @@
+# Python language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 3.4.2002
+# ------------------------------------------
+# This file is part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+# "keyword" groups are taken from the VIM-Syntaxfile of Neil Schemenauer
+# (almost: None is a keyword now; True and False are planned to become
+# keywords)
+
+$DESCRIPTION=Python
+
+#keywords
+$KEYWORDS(kwa)= break continue del except exec finally pass print raise
+return try global assert lambda yield def class for while if elif else
+and in is not or import from as None True False
+
+#builtins, including types
+$KEYWORDS(kwb)= bool enumerate set frozenset help reversed sorted sum
+Ellipsis NotImplemented __import__ abs apply buffer callable chr
+classmethod cmp coerce compile complex delattr dict dir divmod eval
+execfile file filter float getattr globals hasattr hash hex id input
+int intern isinstance issubclass iter len list locals long map max min
+object oct open ord pow property range raw_input reduce reload repr
+round setattr slice staticmethod str super tuple type unichr unicode
+vars xrange zip
+
+#exceptions
+$KEYWORDS(kwc)= ArithmeticError AssertionError AttributeError
+DeprecationWarning EOFError EnvironmentError Exception
+FloatingPointError IOError ImportError IndentationError IndexError
+KeyError KeyboardInterrupt LookupError MemoryError NameError
+NotImplementedError OSError OverflowError OverflowWarning
+ReferenceError RuntimeError RuntimeWarning StandardError StopIteration
+SyntaxError SyntaxWarning SystemError SystemExit TabError TypeError
+UnboundLocalError UnicodeError UnicodeEncodeError UnicodeDecodeError
+UnicodeTranslateError UserWarning ValueError Warning WindowsError
+ZeroDivisionError
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=""" ''' " '
+
+$RAWSTRINGPREFIX=r
+
+$SL_COMMENT=#
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; . : & | < > ! = / * % + - @
diff --git a/support/highlight/langDefs/pyx.lang b/support/highlight/langDefs/pyx.lang
new file mode 100644
index 0000000000..2c772e5ce7
--- /dev/null
+++ b/support/highlight/langDefs/pyx.lang
@@ -0,0 +1,41 @@
+# Pyrex language definition file
+# (http://nz.cosc.canterbury.ac.nz/~greg/python/Pyrex/)
+#
+# Author: Matteo Bertini
+# Mail: matteo.bertini@gmail.com
+# Date: 20.01.2005
+
+$DESCRIPTION=Pyrex
+
+#Functions
+$KEYWORDS(kwa)= global nextgroup pythonfunction skipwhite
+contained chr cmp coerce compile complex delattr dir divmod eval execfile
+filter getattr globals hasattr hash hex id input intern isinstance
+issubclass len list locals long map max min oct open ord pow range raw_input
+reduce reload repr round setattr slice str tuple type vars xrange
+apply sizeof abs callable exec
+
+#keywords
+$KEYWORDS(kwb)=import from self public extern struct as
+break continue del except finally pass print raise return lambda class
+try assert def for while if elif else and in is not or cdef ctypedef
+
+#Exceptions ed types
+$KEYWORDS(kwc)=arithmeticerror assertionerror attributeerror eoferror
+exception floatingpointerror ioerror importerror indexerror keyerror
+keyboardinterrupt lookuperror memoryerror nameerror notimplementederror
+oserror overflowerror runtimeerror standarderror syntaxerror systemerror
+systemexit typeerror valueerror zerodivisionerror environmenterror
+void char int float object
+
+$STRINGDELIMITERS=""" ''' " '
+
+$RAWSTRINGPREFIX=r
+
+$SL_COMMENT=#
+
+$IGNORECASE=true
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; . : & | < > ! = / * % + -
diff --git a/support/highlight/langDefs/q.lang b/support/highlight/langDefs/q.lang
new file mode 100644
index 0000000000..691a2d95c7
--- /dev/null
+++ b/support/highlight/langDefs/q.lang
@@ -0,0 +1,42 @@
+# Qore language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 10.06.06
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Qore
+
+$KEYWORDS(kwa)=class private synchronized new inherits shift where do while if else for
+foreach const namespace return my our try throw catch find delete background exists
+thread_exit in elements keys sub context sortBy sortDescendingBy NULL NOTHING summarize
+by subcontext break continue option
+
+$KEYWORDS(kwb)=regex([$]\w+)
+$KEYWORDS(kwc)=regex([%][\w\-]+)
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$ML_COMMENT=/* */
+
+$SL_COMMENT=#
+
+$DIRECTIVE=%
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$IGNORECASE=false
+
+$SYMBOLS= ( ) [ ] { } , ; . : & | < > ! = / \ * % + - ~
diff --git a/support/highlight/langDefs/qmake.lang b/support/highlight/langDefs/qmake.lang
new file mode 100644
index 0000000000..87794ccb28
--- /dev/null
+++ b/support/highlight/langDefs/qmake.lang
@@ -0,0 +1,44 @@
+# QMake project language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 30.03.2009
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=QMake Project
+
+# Functions
+$KEYWORDS(kwa)=basename contains count dirname error eval exists find for
+include infile isEmpty join member message prompt quote sprintf system unique
+warning else
+
+#Variables
+$KEYWORDS(kwb)=regex(([A-Z_]+)\W)
+
+# conditions
+$KEYWORDS(kwc)=regex(\s*([\w\+\-]+)\:?\w*\s*\{)
+
+# $$ variables
+$KEYWORDS(kwd)=regex(\$?\$\w+|\$\$)
+
+$STRINGDELIMITERS="
+
+$SL_COMMENT=#
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } : & | ! = * % + ~ \
+
+$CONTINUATIONSYMBOL=\
diff --git a/support/highlight/langDefs/qu.lang b/support/highlight/langDefs/qu.lang
new file mode 100644
index 0000000000..6203535b33
--- /dev/null
+++ b/support/highlight/langDefs/qu.lang
@@ -0,0 +1,45 @@
+# Qu language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 14.02.2005
+# ---------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Qu
+
+$KEYWORDS(kwa)= abstract as atomic break case catch class const continue default
+do each elif else end enum ensure final finally for if in is lambda local loop
+me nil once pass public redo return self static struct sub super switch
+throw true try until use var while xor yield
+alias private import of on to from swap unless
+
+$KEYWORDS(kwb)=bool char string vector map set null error new
+
+$KEYWORDS(kwc)=or and not
+
+#$KW_PREFIX(kwc)=__
+$KEYWORDS(kwc)=regex(__\w+)
+
+$STRINGDELIMITERS=" ' ` ```
+
+$SL_COMMENT=#
+
+$ML_COMMENT=/* */
+
+$ALLOWNESTEDCOMMENTS=false
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) { } [ ] , ; . : & | < > ! = / * % + - ~ ^
diff --git a/support/highlight/langDefs/r.lang b/support/highlight/langDefs/r.lang
new file mode 100644
index 0000000000..28ae565d46
--- /dev/null
+++ b/support/highlight/langDefs/r.lang
@@ -0,0 +1,339 @@
+# R language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 13.04.04
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+#
+# Modified by Yihui XIE
+# Homepage: http://www.yihui.name/en (English); http://www.yihui.name (Chinese)
+#
+# For the process of making this file, please refer to:
+# http://www.yihui.name/en/read.php/6.htm
+
+$DESCRIPTION=R
+
+$KEYWORDS(kwa)=if else repeat while function for in next break ifelse switch
+
+$KEYWORDS(kwb)=NULL NA Inf NaN TRUE T FALSE F
+
+$KEYWORDS(kwc)=acf acf2AR add.scope add1 addmargins aggregate
+aggregate.data.frame aggregate.default aggregate.ts AIC alias anova anova.glm
+anova.glmlist anova.lm anova.lmlist anova.mlm anovalist.lm ansari.test aov
+approx approxfun ar ar.burg ar.mle ar.ols ar.yw arima arima.sim arima0
+arima0.diag ARMAacf ARMAtoMA as.dendrogram as.dist as.formula as.hclust
+as.stepfun as.ts asOneSidedFormula ave bandwidth.kernel bartlett.test
+binom.test binomial biplot Box.test bw.bcv bw.nrd bw.nrd0 bw.SJ bw.ucv C cancor
+case.names ccf chisq.test clearNames cmdscale coef coefficients complete.cases
+confint confint.default constrOptim contr.helmert contr.poly contr.SAS
+contr.sum contr.treatment contrasts convolve cooks.distance cophenetic cor
+cor.test cov cov.wt cov2cor covratio cpgram cutree cycle D dbeta dbinom dcauchy
+dchisq decompose delete.response deltat dendrapply density density.default
+deriv deriv.default deriv.formula deriv3 deriv3.default deriv3.formula deviance
+dexp df df.kernel df.residual dfbeta dfbetas dffits dgamma dgeom dhyper diff.ts
+diffinv dist dlnorm dlogis dmultinom dnbinom dnorm dpois drop.scope drop.terms
+drop1 dsignrank dt dummy.coef dunif dweibull dwilcox ecdf eff.aovlist effects
+embed end estVar expand.model.frame extractAIC factanal factor.scope family fft
+filter fisher.test fitted fitted.values fivenum fligner.test formula frequency
+friedman.test ftable Gamma gaussian get_all_vars getInitial glm glm.control
+glm.fit glm.fit.null hasTsp hat hatvalues hatvalues.lm hclust heatmap
+HoltWinters influence influence.measures integrate interaction.plot
+inverse.gaussian IQR is.empty.model is.leaf is.mts is.stepfun is.ts is.tskernel
+isoreg KalmanForecast KalmanLike KalmanRun KalmanSmooth kernapply kernel kmeans
+knots kruskal.test ks.test ksmooth lag lag.plot line lines.ts lm lm.fit
+lm.fit.null lm.influence lm.wfit lm.wfit.null loadings loess loess.control
+loess.smooth logLik loglin lowess ls.diag ls.print lsfit mad mahalanobis
+make.link makeARIMA makepredictcall manova mantelhaen.test mauchley.test
+mauchly.test mcnemar.test median median.default medpolish model.extract
+model.frame model.frame.aovlist model.frame.default model.frame.glm
+model.frame.lm model.matrix model.matrix.default model.matrix.lm model.offset
+model.response model.tables model.weights monthplot mood.test mvfft na.action
+na.contiguous na.exclude na.fail na.omit na.pass napredict naprint naresid
+nextn nlm nlminb nls nls.control NLSstAsymptotic NLSstClosestX NLSstLfAsymptote
+NLSstRtAsymptote numericDeriv offset oneway.test optim optimise optimize
+order.dendrogram p.adjust p.adjust.methods pacf pairwise.prop.test
+pairwise.t.test pairwise.table pairwise.wilcox.test pbeta pbinom pbirthday
+pcauchy pchisq pexp pf pgamma pgeom phyper plclust plnorm plogis plot.density
+plot.ecdf plot.lm plot.mlm plot.spec plot.spec.coherency plot.spec.phase
+plot.stepfun plot.ts plot.TukeyHSD pnbinom pnorm poisson poly polym power
+power.anova.test power.prop.test power.t.test PP.test ppoints ppois ppr prcomp
+predict predict.glm predict.lm predict.mlm predict.poly preplot princomp
+print.anova print.coefmat print.density print.family print.formula print.ftable
+print.glm print.infl print.integrate print.lm print.logLik print.terms print.ts
+printCoefmat profile proj promax prop.test prop.trend.test psignrank pt ptukey
+punif pweibull pwilcox qbeta qbinom qbirthday qcauchy qchisq qexp qf qgamma
+qgeom qhyper qlnorm qlogis qnbinom qnorm qpois qqline qqnorm qqnorm.default
+qqplot qsignrank qt qtukey quade.test quantile quantile.default quasi
+quasibinomial quasipoisson qunif qweibull qwilcox r2dtable rbeta rbinom rcauchy
+rchisq read.ftable rect.hclust reformulate relevel reorder replications reshape
+reshapeLong reshapeWide resid residuals residuals.default residuals.glm
+residuals.lm rexp rf rgamma rgeom rhyper rlnorm rlogis rmultinom rnbinom rnorm
+rpois rsignrank rstandard rstandard.glm rstandard.lm rstudent rstudent.glm
+rstudent.lm rt runif runmed rweibull rwilcox scatter.smooth screeplot sd
+se.contrast selfStart setNames shapiro.test simulate smooth smooth.spline
+smoothEnds sortedXyData spec.ar spec.pgram spec.taper spectrum spline splinefun
+SSasymp SSasympOff SSasympOrig SSbiexp SSD SSfol SSfpl SSgompertz SSlogis
+SSmicmen SSweibull start stat.anova step stepfun stl StructTS summary.aov
+summary.aovlist summary.glm summary.infl summary.lm summary.manova summary.mlm
+summary.stepfun supsmu symnum t.test termplot terms terms.aovlist terms.default
+terms.formula terms.terms time toeplitz ts ts.intersect ts.plot ts.union tsdiag
+tsp tsSmooth TukeyHSD TukeyHSD.aov uniroot update update.default update.formula
+var var.test variable.names varimax vcov weighted.mean weighted.residuals
+weights wilcox.test window write.ftable xtabs abline arrows assocplot axis Axis
+axis.Date axis.POSIXct axTicks barplot barplot.default box boxplot
+boxplot.default bxp cdplot close.screen co.intervals contour contour.default
+coplot curve dotchart erase.screen filled.contour fourfoldplot frame grid hist
+hist.default identify image image.default layout layout.show lcm legend lines
+lines.default locator matlines matplot matpoints mosaicplot mtext pairs
+pairs.default panel.smooth par persp pie piechart plot plot.default plot.design
+plot.new plot.window plot.xy points points.default polygon rect rug screen
+segments spineplot split.screen stars stem strheight stripchart strwidth
+sunflowerplot symbols text text.default title xinch xyinch yinch
+as.graphicsAnnot bitmap bmp boxplot.stats bringToTop check.options chull
+CIDFont cm cm.colors col2rgb colorConverter colorRamp colorRampPalette colors
+colorspaces colours contourLines convertColor dev.control dev.copy dev.copy2eps
+dev.cur dev.interactive dev.list dev.next dev.off dev.prev dev.print dev.set
+dev2bitmap embedFonts extendrange getGraphicsEvent graphics.off gray
+gray.colors grey grey.colors hcl heat.colors Hershey hsv jpeg make.rgb n2mfrow
+nclass.FD nclass.scott nclass.Sturges palette pdf pdfFonts pictex png
+postscript postscriptFont postscriptFonts ps.options rainbow recordGraphics
+recordPlot replayPlot rgb rgb2hsv savePlot terrain.colors topo.colors trans3d
+Type1Font win.graph win.metafile win.print windows windowsFont windowsFonts x11
+X11 xfig xy.coords xyz.coords alarm apropos argsAnywhere as.person
+as.personList as.roman assignInNamespace available.packages browseEnv browseURL
+bug.report capture.output checkCRAN choose.dir choose.files chooseCRANmirror
+citation citEntry citFooter citHeader close.socket combn compareVersion
+contrib.url count.fields CRAN.packages data data.entry dataentry de de.ncols
+de.restore de.setup debugger demo DLL.version download.file download.packages
+dump.frames edit emacs example file.edit file_test Filters find fix
+fixInNamespace fixup.libraries.URLs fixup.package.URLs flush.console formatOL
+formatUL getAnywhere getClipboardFormats getFromNamespace getIdentification
+getS3method getWindowsHandle getWindowTitle glob2rx head head.matrix help
+help.search help.start history index.search install.packages installed.packages
+limitedLabels link.html.help loadhistory loadRconsole localeToCharset ls.str
+lsf.str make.packages.html make.search.html make.socket
+makeRweaveLatexCodeRunner memory.limit memory.size menu methods mirror2html
+modifyList new.packages normalizePath object.size old.packages package.contents
+package.skeleton packageDescription packageStatus page person personList pico
+prompt promptData promptPackage read.csv read.csv2 read.delim read.delim2
+read.DIF read.fortran read.fwf read.socket read.table readCitationFile
+readClipboard readNEWS recover remove.packages Rprof Rprofmem RShowDoc
+RSiteSearch Rtangle RtangleSetup RtangleWritedoc RweaveChunkPrefix
+RweaveEvalWithOpt RweaveLatex RweaveLatexFinish RweaveLatexOptions
+RweaveLatexSetup RweaveLatexWritedoc RweaveTryStop savehistory select.list
+sessionInfo setRepositories setStatusBar setWindowTitle shortPathName stack
+Stangle str strOptions summaryRprof Sweave SweaveHooks SweaveSyntaxLatex
+SweaveSyntaxNoweb SweaveSyntConv tail tail.matrix timestamp toBibtex toLatex
+type.convert unstack update.packages update.packageStatus upgrade url.show
+URLdecode URLencode vi View vignette win.version winDialog winDialogString
+winMenuAdd winMenuAddItem winMenuDel winMenuDelItem winMenuItems winMenuNames
+withVisible write.csv write.csv2 write.socket write.table writeClipboard
+wsbrowser xedit xemacs zip.file.extract zip.unpack ability.cov airmiles
+AirPassengers airquality anscombe attenu attitude austres beaver1 beaver2
+BJsales BJsales.lead BOD cars ChickWeight chickwts co2 CO2 crimtab discoveries
+DNase esoph euro euro.cross eurodist EuStockMarkets faithful fdeaths
+Formaldehyde freeny freeny.x freeny.y HairEyeColor Harman23.cor Harman74.cor
+Indometh infert InsectSprays iris iris3 islands JohnsonJohnson LakeHuron
+ldeaths lh LifeCycleSavings Loblolly longley lynx mdeaths morley mtcars nhtemp
+Nile nottem Orange OrchardSprays PlantGrowth precip presidents pressure
+Puromycin quakes randu rivers rock Seatbelts sleep stack.loss stack.x stackloss
+state.abb state.area state.center state.division state.name state.region
+state.x77 sunspot.month sunspot.year sunspots swiss Theoph Titanic ToothGrowth
+treering trees UCBAdmissions UKDriverDeaths UKgas USAccDeaths USArrests
+USJudgeRatings USPersonalExpenditure uspop VADeaths volcano warpbreaks women
+WorldPhones WWWusage addNextMethod allGenerics allNames Arith as
+asMethodDefinition assignClassDef assignMethodsMetaData balanceMethodsList
+cacheGenericsMetaData cacheMetaData cacheMethod callGeneric callNextMethod
+canCoerce cbind2 checkSlotAssignment classMetaName coerce Compare
+completeClassDefinition completeExtends completeSubclasses Complex
+conformMethod defaultDumpName defaultPrototype doPrimitiveMethod dumpMethod
+dumpMethods el elNamed empty.dump emptyMethodsList existsFunction existsMethod
+extends finalDefaultMethod findClass findFunction findMethod findUnique
+fixPre1.8 formalArgs functionBody generic.skeleton getAccess getAllMethods
+getAllSuperClasses getClass getClassDef getClasses getClassName getClassPackage
+getDataPart getExtends getFunction getGeneric getGenerics getGroup
+getGroupMembers getMethod getMethods getMethodsForDispatch getMethodsMetaData
+getPackageName getProperties getPrototype getSlots getSubclasses getValidity
+getVirtual hasArg hasMethod initialize insertMethod is isClass isClassDef
+isClassUnion isGeneric isGrammarSymbol isGroup isSealedClass isSealedMethod
+isVirtualClass languageEl linearizeMlist listFromMethods listFromMlist
+loadMethod Logic makeClassRepresentation makeExtends makeGeneric
+makeMethodsList makePrototypeFromClassDef makeStandardGeneric matchSignature
+Math Math2 mergeMethods metaNameUndo method.skeleton MethodAddCoerce
+methodSignatureMatrix MethodsList MethodsListSelect methodsPackageMetaName
+missingArg mlistMetaName new newBasic newClassRepresentation newEmptyObject Ops
+packageSlot possibleExtends promptClass promptMethods prototype Quote rbind2
+reconcilePropertiesAndPrototype rematchDefinition removeClass removeGeneric
+removeMethod removeMethods removeMethodsObject representation requireMethods
+resetClass resetGeneric sealClass seemsS4Object selectMethod sessionData setAs
+setClass setClassUnion setDataPart setGeneric setGroupGeneric setIs setMethod
+setOldClass setPackageName setPrimitiveMethods setReplaceMethod setValidity
+show showClass showDefault showExtends showMethods showMlist signature
+SignatureMethod sigToEnv slot slotNames substituteDirect substituteFunctionArgs
+Summary superClassDepth testVirtual traceOff traceOn tryNew trySilent
+unRematchDefinition validObject validSlotNames abbreviate abs acos acosh
+addTaskCallback agrep alist all all.equal all.equal.character all.equal.default
+all.equal.factor all.equal.formula all.equal.language all.equal.list
+all.equal.numeric all.equal.POSIXct all.equal.raw all.names all.vars any aperm
+append apply Arg args array as.array as.call as.character
+as.character.condition as.character.Date as.character.default
+as.character.error as.character.factor as.character.hexmode
+as.character.octmode as.character.package_version as.character.POSIXt
+as.character.srcref as.complex as.complex.default as.data.frame
+as.data.frame.array as.data.frame.AsIs as.data.frame.character
+as.data.frame.complex as.data.frame.data.frame as.data.frame.Date
+as.data.frame.default as.data.frame.difftime as.data.frame.factor
+as.data.frame.integer as.data.frame.list as.data.frame.logical
+as.data.frame.matrix as.data.frame.model.matrix as.data.frame.numeric
+as.data.frame.ordered as.data.frame.package_version as.data.frame.POSIXct
+as.data.frame.POSIXlt as.data.frame.raw as.data.frame.table as.data.frame.ts
+as.data.frame.vector as.Date as.Date.character as.Date.date as.Date.dates
+as.Date.default as.Date.factor as.Date.POSIXct as.Date.POSIXlt as.difftime
+as.double as.double.default as.double.difftime as.environment as.expression
+as.expression.default as.factor as.function as.function.default as.integer
+as.integer.default as.list as.list.data.frame as.list.default
+as.list.environment as.list.factor as.logical as.logical.default as.matrix
+as.matrix.data.frame as.matrix.default as.matrix.noquote as.matrix.POSIXlt
+as.name as.null as.null.default as.numeric as.numeric.POSIXlt as.ordered
+as.package_version as.pairlist as.POSIXct as.POSIXct.date as.POSIXct.Date
+as.POSIXct.dates as.POSIXct.default as.POSIXct.POSIXlt as.POSIXlt as.qr as.raw
+as.real as.single as.single.default as.symbol as.table as.table.default
+as.vector as.vector.factor asin asinh asNamespace asS4 assign atan atan2 atanh
+attach attachNamespace attr attr.all.equal attributes autoload autoloader
+backsolve baseenv basename besselI besselJ besselK besselY beta bindingIsActive
+bindingIsLocked bindtextdomain body bquote browser builtins by by.data.frame
+by.default bzfile c c.Date c.noquote c.package_version c.POSIXct c.POSIXlt call
+callCC capabilities casefold cat category cbind cbind.data.frame ceiling
+char.expand character charmatch charToRaw chartr check_tzones chol chol2inv
+choose class close close.connection close.srcfile closeAllConnections codes
+codes.factor codes.ordered col colMeans colnames colSums commandArgs comment
+complex computeRestarts conditionCall conditionCall.condition conditionMessage
+conditionMessage.condition conflicts Conj contributors cos cosh crossprod
+Cstack_info cummax cummin cumprod cumsum cut cut.Date cut.default cut.POSIXt
+data.class data.frame data.matrix date debug default.stringsAsFactors delay
+delayedAssign deparse det detach determinant determinant.matrix dget diag diff
+diff.Date diff.default diff.POSIXt difftime digamma dim dim.data.frame dimnames
+dimnames.data.frame dir dir.create dirname do.call double dput dQuote drop dump
+duplicated duplicated.array duplicated.data.frame duplicated.default
+duplicated.matrix duplicated.POSIXlt dyn.load dyn.unload eapply eigen emptyenv
+encodeString Encoding env.profile environment environmentIsLocked
+environmentName eval eval.parent evalq exists exp expand.grid expm1 expression
+factor factorial fifo file file.access file.append file.choose file.copy
+file.create file.exists file.info file.path file.remove file.rename file.show
+file.symlink findInterval findPackageEnv findRestart floor flush
+flush.connection force formals format format.AsIs format.char format.data.frame
+format.Date format.default format.difftime format.factor format.hexmode
+format.info format.octmode format.POSIXct format.POSIXlt format.pval formatC
+formatDL forwardsolve gamma gammaCody gc gc.time gcinfo gctorture get
+getAllConnections getCallingDLL getCallingDLLe getCConverterDescriptions
+getCConverterStatus getConnection getDLLRegisteredRoutines
+getDLLRegisteredRoutines.character getDLLRegisteredRoutines.DLLInfo getenv
+geterrmessage getExportedValue getHook getLoadedDLLs getNamespace
+getNamespaceExports getNamespaceImports getNamespaceInfo getNamespaceName
+getNamespaceUsers getNamespaceVersion getNativeSymbolInfo getNumCConverters
+getOption getRversion getSrcLines getTaskCallbackNames gettext gettextf getwd
+gl globalenv gregexpr grep gsub gzcon gzfile httpclient I iconv iconvlist
+identical Im importIntoEnv inherits integer interaction interactive intersect
+intToBits intToUtf8 inverse.rle invisible invokeRestart
+invokeRestartInteractively is.array is.atomic is.call is.character is.complex
+is.data.frame is.double is.element is.environment is.expression is.factor
+is.finite is.function is.infinite is.integer is.language is.list is.loaded
+is.logical is.matrix is.na is.na.data.frame is.na.POSIXlt is.name is.nan
+is.null is.numeric is.object is.ordered is.package_version is.pairlist
+is.primitive is.qr is.R is.raw is.real is.recursive is.single is.symbol
+is.table is.unsorted is.vector isBaseNamespace isIncomplete isNamespace ISOdate
+ISOdatetime isOpen isRestart isS4 isSeekable isSymmetric isSymmetric.matrix
+isTRUE jitter julian julian.Date julian.POSIXt kappa kappa.default kappa.lm
+kappa.qr kappa.tri kronecker l10n_info La.chol La.chol2inv La.eigen La.svd
+labels labels.default lapply last.warning lazyLoad lbeta lchoose length letters
+LETTERS levels lfactorial lgamma library library.dynam library.dynam.unload
+licence license list list.files load loadedNamespaces loadingNamespaceInfo
+loadNamespace loadURL local lockBinding lockEnvironment log log10 log1p log2
+logb logical lower.tri ls machine Machine make.names make.unique
+makeActiveBinding manglePackageName mapply margin.table mat.or.vec match
+match.arg match.call match.fun Math.data.frame Math.Date Math.difftime
+Math.factor Math.POSIXt matrix max max.col mean mean.data.frame mean.Date
+mean.default mean.difftime mean.POSIXct mean.POSIXlt mem.limits memory.profile
+merge merge.data.frame merge.default message mget min missing Mod mode
+month.abb month.name months months.Date months.POSIXt names namespaceExport
+namespaceImport namespaceImportClasses namespaceImportFrom
+namespaceImportMethods nargs nchar ncol NCOL new.env NextMethod ngettext
+nlevels noquote nrow NROW numeric objects oldClass on.exit open open.connection
+open.srcfile open.srcfilecopy Ops.data.frame Ops.Date Ops.difftime Ops.factor
+Ops.ordered Ops.package_version Ops.POSIXt options order ordered outer
+package.description package_version packageEvent packageHasNamespace
+packageStartupMessage packBits pairlist parent.env parent.frame parse parse.dcf
+parseNamespaceFile paste path.expand pentagamma pi pipe Platform pmatch pmax
+pmax.int pmin pmin.int polyroot pos.to.env pretty prettyNum print print.AsIs
+print.atomic print.by print.condition print.connection print.data.frame
+print.Date print.default print.difftime print.DLLInfo print.DLLInfoList
+print.DLLRegisteredRoutines print.factor print.hexmode print.libraryIQR
+print.listof print.NativeRoutineList print.noquote print.octmode
+print.package_version print.packageInfo print.POSIXct print.POSIXlt
+print.proc_time print.restart print.rle print.simple.list print.srcfile
+print.srcref print.summary.table print.table print.warnings printNoClass
+prmatrix proc.time prod prop.table provide psigamma pushBack pushBackLength q
+qr qr.coef qr.fitted qr.Q qr.qty qr.qy qr.R qr.resid qr.solve qr.X quarters
+quarters.Date quarters.POSIXt quit quote R.home R.version R.Version
+R.version.string range range.default rank rapply raw rawShift rawToBits
+rawToChar rbind rbind.data.frame Re read.dcf read.table.url readBin readChar
+readline readLines real Recall reg.finalizer regexpr registerS3method
+registerS3methods remove removeCConverter removeTaskCallback rep rep.Date
+rep.factor rep.int rep.POSIXct rep.POSIXlt replace replicate require restart
+restartDescription restartFormals retracemem return rev rev.default rle rm
+RNGkind RNGversion round round.Date round.difftime round.POSIXt row row.names
+row.names.data.frame row.names.default rowMeans rownames rowsum
+rowsum.data.frame rowsum.default rowSums sample sapply save save.image
+saveNamespaceImage scale scale.default scan scan.url search searchpaths seek
+seek.connection seq seq.Date seq.default seq.int seq.POSIXt seq_along seq_len
+sequence serialize set.seed setCConverterStatus setdiff setequal setHook
+setNamespaceInfo setwd shell shell.exec showConnections shQuote sign
+signalCondition signif simpleCondition simpleError simpleMessage simpleWarning
+sin single sinh sink sink.number slice.index socketConnection socketSelect
+solve solve.default solve.qr sort sort.default sort.int sort.list sort.POSIXlt
+source source.url split split.data.frame split.default sprintf sqrt sQuote
+srcfile srcfilecopy srcref standardGeneric stderr stdin stdout stop stopifnot
+storage.mode strftime strptime strsplit strtrim structure strwrap sub subset
+subset.data.frame subset.default subset.matrix substitute substr substring sum
+summary summary.connection summary.data.frame Summary.data.frame summary.Date
+Summary.Date summary.default Summary.difftime summary.factor Summary.factor
+summary.matrix Summary.package_version summary.POSIXct Summary.POSIXct
+summary.POSIXlt Summary.POSIXlt summary.table suppressMessages
+suppressPackageStartupMessages suppressWarnings svd sweep symbol.C symbol.For
+sys.call sys.calls Sys.Date sys.frame sys.frames sys.function Sys.getenv
+Sys.getlocale Sys.getpid Sys.glob Sys.info sys.load.image Sys.localeconv
+sys.nframe sys.on.exit sys.parent sys.parents Sys.putenv sys.save.image
+Sys.setenv Sys.setlocale Sys.sleep sys.source sys.status Sys.time Sys.timezone
+Sys.unsetenv system system.file system.time t t.data.frame t.default table
+tabulate tan tanh tapply taskCallbackManager tcrossprod tempdir tempfile
+testPlatformEquivalence tetragamma textConnection textConnectionValue tolower
+topenv toString toString.default toupper trace traceback tracemem tracingState
+transform transform.data.frame transform.default trigamma trunc trunc.Date
+trunc.POSIXt truncate truncate.connection try tryCatch typeof unclass undebug
+union unique unique.array unique.data.frame unique.default unique.matrix
+unique.POSIXlt units units.difftime unix unix.time unlink unlist
+unloadNamespace unlockBinding unname unserialize unsplit untrace untracemem unz
+upper.tri url UseMethod utf8ToInt vector Vectorize version Version warning
+warnings weekdays weekdays.Date weekdays.POSIXt which which.max which.min with
+with.default withCallingHandlers withRestarts write write.dcf write.table0
+writeBin writeChar writeLines xor xpdrows.data.frame zapsmall lset xtable
+
+$IDENTIFIER=regex([a-zA-Z_][\w\.]*)
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=#
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + - ~
diff --git a/support/highlight/langDefs/rb.lang b/support/highlight/langDefs/rb.lang
new file mode 100644
index 0000000000..f8fdcf4f9c
--- /dev/null
+++ b/support/highlight/langDefs/rb.lang
@@ -0,0 +1,53 @@
+# Ruby language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 24.8.2002
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Ruby
+
+$IDENTIFIER=regex([a-zA-Z_][\w\-]*)
+
+$DIGIT=regex((?:0x|0X|0b)[0-9a-fA-F]+|\d*[\.\_]?\d+(?:[eE][\-\+]\d+)?[lLuU]?)
+
+$KEYWORDS(kwa)=alias and begin begin break case class def defined loop
+do else elsif end end ensure false for if in module next nil not or redo rescue retry
+return require self super then true undef unless until when while yield true false
+nil stdin stdout stderr env argf argv data version ruby-release-date ruby-platform
+include extend eval
+
+$KEYWORDS(kwb)=regex([\$\@][\/\w]+)
+
+# pattern to highlight regexes (m//, s///, tr ///)
+$KEYWORDS(kwc)=regex(m?\/.*?\/|(s|tr)\/.*?\/.*?\/[cegimosx]*, 0)
+
+$KEYWORDS(kwc)=TRUE FALSE NIL STDIN STDOUT STDERR ENV ARGF ARGV DATA RUBY_VERSION
+RUBY_RELEASE_DATE RUBY_PLATFORM
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$IGNORECASE=false
+
+$STRINGDELIMITERS=" ' `
+
+# breaks closing parantheses:
+#$STRING_UNEQUAL=%q( ) %Q( ) %( ) %x( )
+
+$SL_COMMENT=#
+
+$ML_COMMENT= =begin =end
+
+$SYMBOLS= ( ) [ ] { } , ; : . & | < > ! - + / * = ? %
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
diff --git a/support/highlight/langDefs/rebol.lang b/support/highlight/langDefs/rebol.lang
new file mode 100644
index 0000000000..9445b69177
--- /dev/null
+++ b/support/highlight/langDefs/rebol.lang
@@ -0,0 +1,37 @@
+# Rebol language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 09.08.2009
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Rebol
+
+$KEYWORDS(kwa)=REBOL rebol return for while print repeat doq
+
+$KEYWORDS(kwc)=regex(\b([\w\-]+\??):)
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS="
+
+$ML_COMMENT={ }
+$SL_COMMENT=; //
+
+$ALLOWNESTEDCOMMENTS=false
+
+$IGNORECASE=true
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] , ; . : & | < > ! = / * % + - ~ ? # '
diff --git a/support/highlight/langDefs/rexx.lang b/support/highlight/langDefs/rexx.lang
new file mode 100644
index 0000000000..9001d7701e
--- /dev/null
+++ b/support/highlight/langDefs/rexx.lang
@@ -0,0 +1,73 @@
+# Rexx language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 21.11.2002
+# 22.02.2010 added TSO/E Commands / DBCS Functions
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Rexx
+
+$KEYWORDS(kwa)=address additional any arg arguments array by call caseless
+continue class description digits do drop end engineering error exit expose
+else failure for forever form forward fuzz guard halt if interpret iterate
+leave lower lostdigits message name nop nomethod nostring notready novalue
+numeric on off otherwise parse procedure pull push propagate queue raise reply
+return ret rc result say scientific select sigl signal source syntax then to trace
+upper until use user version when while with
+
+# built in functions:
+$KEYWORDS(kwb)=abbrev abs append beep binary bitand bitor bitxor both b2x center centre
+changestr char charin charout chars compare condition copies countstr close c2d
+c2x datetime datatype date delstr delword directory d2c d2x errortext exists
+filespec flush format handle insert lastpos left length line linein lineout
+lines max min nobuffer open overlay pos position queued query random reclength
+read replace reverse right seek sign size shared shareread sharewrite
+sourceline space stream streamtype strip subword substr symbol sys time
+timestamp translate trunc var value verify word wordindex wordlength wordpos
+words write xrange x2b x2c x2d pid pprio ptime rxfuncadd rxfuncdrop rxfuncquery
+rxqueue rxmessagebox rxwinexec sysaddrexxmacro sysbootdrive
+sysclearrexxmacrospace syscloseeventsem sysclosemutexsem syscls
+syscreateeventsem syscreatemutexsem syscurpos syscurstate sysdriveinfo
+sysdrivemap sysdropfuncs sysdroprexxmacro sysdumpvariables sysfiledelete
+sysfilesearch sysfilesystemtype sysgetfiledatetime sysfiletree sysgetkey sysini
+sysloadfuncs sysloadrexxmacrospace sysmkdir sysopeneventsem sysopenmutexsem
+sysposteventsem syspulseeventsem sysqueryprocess sysqueryrexxmacro
+sysreleasemutexsem sysreorderrexxmacro sysrequestmutexsem sysreseteventsem
+sysrmdir syssaverexxmacrospace syssearchpath syssetfiledatetime syssetpriority
+syssleep sysstemcopy sysstemdelete syssteminsert sysstemsort sysswitchsession
+syssystemdirectory systempfilename systextscreenread systextscreensize
+sysutilversion sysvolumelabel syswaiteventsem syswaitnamedpipe sysversion
+syswinver
+
+# TSO/E Commands / DBCS Functions
+$KEYWORDS(kwc)=externals find getmsg index justify linesize listdsi msg mvsvar outtrap
+prompt setlang storage syscpus sysdsn sysvar userid dbadjust dbbracket
+dbcenter dbcjustify dbcs dbleft dbright dbrleft dbrright dbtodbcs
+dbtosbcs dbunbracket dbvalidate dbwidth delstack dropbuf execio executil
+he hi ht makebuf newstack qbuf qelem qstack rt subcom te ts
+
+$KEYWORDS(kwd)=regex((\w+)\s*\:)
+
+$STRINGDELIMITERS=" '
+
+$ML_COMMENT=/* */
+
+$SL_COMMENT=-- #!
+
+# avoid highlighting of "attribute numbers"
+$DIGIT=regex((?:0x|0X)[0-9a-fA-F]+|\d+[\.]?\d+(?:[eE][\-\+]\d+)?[lLuU]*)
+
+$IGNORECASE=true
+
+$SYMBOLS= ( ) [ ] . , ; : & | < > ! = / * % + - \ No newline at end of file
diff --git a/support/highlight/langDefs/rnc.lang b/support/highlight/langDefs/rnc.lang
new file mode 100644
index 0000000000..f01c949e02
--- /dev/null
+++ b/support/highlight/langDefs/rnc.lang
@@ -0,0 +1,22 @@
+# Relax NG Compact Syntax <http://www.relaxng.org/compact-20021121.html>
+# definition file for the "highlight" <http://www.andre-simon.de/> source
+# code converter
+#
+# Author: Christian Siefkes
+# Mail: christian@siefkes.net
+# Date: 2003-10-04
+
+$DESCRIPTION=Relax NG
+
+$KEYWORDS(kwa)=attribute default datatypes div element external grammar include
+inherit list mixed namespace notAllowed parent start
+
+$KEYWORDS(kwb)=empty string text token
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=#
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
diff --git a/support/highlight/langDefs/s.lang b/support/highlight/langDefs/s.lang
new file mode 100644
index 0000000000..bd83f10259
--- /dev/null
+++ b/support/highlight/langDefs/s.lang
@@ -0,0 +1,266 @@
+# PowerPC Assembler language definition file
+#
+# Author: Juergen Frank
+# Mail: juergen.frank@freescale.com
+# Date: 11.3.2005
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+
+$DESCRIPTION=PowerPC Assembler
+
+# keywords
+$KEYWORDS(kwa)= attn tdlgti tdllti tdeqi tdlgei tdlnli tdllei tdlngi tdgti tdgei tdnli
+ tdlti tdlei tdngi tdnei tdi twlgti tlgti twllti tllti tweqi teqi
+ twlgei tlgei twlnli tlnli twllei tllei twlngi tlngi twgti tgti twgei
+ tgei twnli tnli twlti tlti twlei tlei twngi tngi twnei tnei
+ twi ti macchw macchw. macchwo macchwo. macchws macchws. macchwso macchwso. macchwsu
+ macchwsu. macchwsuo macchwsuo. macchwu macchwu. macchwuo macchwuo. machhw machhw. machhwo machhwo.
+ machhws machhws. machhwso machhwso. machhwsu machhwsu. machhwsuo machhwsuo. machhwu machhwu. machhwuo
+ machhwuo. maclhw maclhw. maclhwo maclhwo. maclhws maclhws. maclhwso maclhwso. maclhwsu maclhwsu.
+ maclhwsuo maclhwsuo. maclhwu maclhwu. maclhwuo maclhwuo. mulchw mulchw. mulchwu mulchwu. mulhhw
+ mulhhw. mulhhwu mulhhwu. mullhw mullhw. mullhwu mullhwu. nmacchw nmacchw. nmacchwo nmacchwo.
+ nmacchws nmacchws. nmacchwso nmacchwso. nmachhw nmachhw. nmachhwo nmachhwo. nmachhws nmachhws. nmachhwso
+ nmachhwso. nmaclhw nmaclhw. nmaclhwo nmaclhwo. nmaclhws nmaclhws. nmaclhwso nmaclhwso. mfvscr mtvscr
+ efscfd efdabs efdnabs efdneg efdadd efdsub efdmul efddiv efdcmpgt efdcmplt efdcmpeq
+ efdtstgt efdtstlt efdtsteq efdcfsi efdcfsid efdcfui efdcfuid efdcfsf efdcfuf efdctsi efdctsidz
+ efdctsiz efdctui efdctuidz efdctuiz efdctsf efdctuf efdcfs vaddcuw vaddfp vaddsbs vaddshs
+ vaddsws vaddubm vaddubs vadduhm vadduhs vadduwm vadduws vand vandc vavgsb vavgsh
+ vavgsw vavgub vavguh vavguw vcfsx vcfux vcmpbfp vcmpbfp. vcmpeqfp vcmpeqfp. vcmpequb
+ vcmpequb. vcmpequh vcmpequh. vcmpequw vcmpequw. vcmpgefp vcmpgefp. vcmpgtfp vcmpgtfp. vcmpgtsb vcmpgtsb.
+ vcmpgtsh vcmpgtsh. vcmpgtsw vcmpgtsw. vcmpgtub vcmpgtub. vcmpgtuh vcmpgtuh. vcmpgtuw vcmpgtuw. vctsxs
+ vctuxs vexptefp vlogefp vmaddfp vmaxfp vmaxsb vmaxsh vmaxsw vmaxub vmaxuh vmaxuw
+ vmhaddshs vmhraddshs vminfp vminsb vminsh vminsw vminub vminuh vminuw vmladduhm vmrghb
+ vmrghh vmrghw vmrglb vmrglh vmrglw vmsummbm vmsumshm vmsumshs vmsumubm vmsumuhm vmsumuhs
+ vmulesb vmulesh vmuleub vmuleuh vmulosb vmulosh vmuloub vmulouh vnmsubfp vnor vor
+ vperm vpkpx vpkshss vpkshus vpkswss vpkswus vpkuhum vpkuhus vpkuwum vpkuwus vrefp
+ vrfim vrfin vrfip vrfiz vrlb vrlh vrlw vrsqrtefp vsel vsl vslb
+ vsldoi vslh vslo vslw vspltb vsplth vspltisb vspltish vspltisw vspltw vsr
+ vsrab vsrah vsraw vsrb vsrh vsro vsrw vsubcuw vsubfp vsubsbs vsubshs
+ vsubsws vsububm vsububs vsubuhm vsubuhs vsubuwm vsubuws vsumsws vsum2sws vsum4sbs vsum4shs
+ vsum4ubs vupkhpx vupkhsb vupkhsh vupklpx vupklsb vupklsh vxor evaddw evaddiw evsubfw
+ evsubw evsubifw evsubiw evabs evneg evextsb evextsh evrndw evcntlzw evcntlsw brinc
+ evand evandc evmr evor evorc evxor eveqv evnand evnot evnor evrlw
+ evrlwi evslw evslwi evsrws evsrwu evsrwis evsrwiu evsplati evsplatfi evmergehi evmergelo
+ evmergehilo evmergelohi evcmpgts evcmpgtu evcmplts evcmpltu evcmpeq evsel evldd evlddx
+ evldw evldwx evldh evldhx evlwhe evlwhex evlwhou evlwhoux evlwhos evlwhosx evlwwsplat
+ evlwwsplatx evlwhsplat evlwhsplatx evlhhesplat evlhhesplatx evlhhousplat evlhhousplatx evlhhossplat evlhhossplatx evstdd evstddx
+ evstdw evstdwx evstdh evstdhx evstwwe evstwwex evstwwo evstwwox evstwhe evstwhex evstwho
+ evstwhox evfsabs evfsnabs evfsneg evfsadd evfssub evfsmul evfsdiv evfscmpgt evfscmplt evfscmpeq
+ evfststgt evfststlt evfststeq evfscfui evfsctuiz evfscfsi evfscfuf evfscfsf evfsctui evfsctsi evfsctsiz
+ evfsctuf evfsctsf efsabs efsnabs efsneg efsadd efssub efsmul efsdiv efscmpgt efscmplt
+ efscmpeq efststgt efststlt efststeq efscfui efsctuiz efscfsi efscfuf efscfsf efsctui efsctsi
+ efsctsiz efsctuf efsctsf evmhossf evmhossfa evmhosmf evmhosmfa evmhosmi evmhosmia evmhoumi evmhoumia
+ evmhessf evmhessfa evmhesmf evmhesmfa evmhesmi evmhesmia evmheumi evmheumia evmhossfaaw evmhossiaaw evmhosmfaaw
+ evmhosmiaaw evmhousiaaw evmhoumiaaw evmhessfaaw evmhessiaaw evmhesmfaaw evmhesmiaaw evmheusiaaw evmheumiaaw evmhossfanw evmhossianw
+ evmhosmfanw evmhosmianw evmhousianw evmhoumianw evmhessfanw evmhessianw evmhesmfanw evmhesmianw evmheusianw evmheumianw evmhogsmfaa
+ evmhogsmiaa evmhogumiaa evmhegsmfaa evmhegsmiaa evmhegumiaa evmhogsmfan evmhogsmian evmhogumian evmhegsmfan evmhegsmian evmhegumian
+ evmwhssf evmwhssfa evmwhsmf evmwhsmfa evmwhsmi evmwhsmia evmwhumi evmwhumia evmwlumi evmwlumia evmwlssiaaw
+ evmwlsmiaaw evmwlusiaaw evmwlumiaaw evmwlssianw evmwlsmianw evmwlusianw evmwlumianw evmwssf evmwssfa evmwsmf evmwsmfa
+ evmwsmi evmwsmia evmwumi evmwumia evmwssfaa evmwsmfaa evmwsmiaa evmwumiaa evmwssfan evmwsmfan evmwsmian
+ evmwumian evaddssiaaw evaddsmiaaw evaddusiaaw evaddumiaaw evsubfssiaaw evsubfsmiaaw evsubfusiaaw evsubfumiaaw evmra evdivws
+ evdivwu mulli muli subfic sfi dozi bce bcel bcea bcela cmplwi
+ cmpldi cmpli cmpli cmpwi cmpdi cmpi cmpi addic ai subic addic.
+ ai. subic. li lil addi cal subi la lis liu addis
+ cau subis bdnz- bdnz+ bdnz bdn bdnzl- bdnzl+ bdnzl bdnl bdnza-
+ bdnza+ bdnza bdna bdnzla- bdnzla+ bdnzla bdnla bdz- bdz+ bdz bdzl-
+ bdzl+ bdzl bdza- bdza+ bdza bdzla- bdzla+ bdzla blt- blt+ blt
+ bltl- bltl+ bltl blta- blta+ blta bltla- bltla+ bltla bgt- bgt+
+ bgt bgtl- bgtl+ bgtl bgta- bgta+ bgta bgtla- bgtla+ bgtla beq-
+ beq+ beq beql- beql+ beql beqa- beqa+ beqa beqla- beqla+ beqla
+ bso- bso+ bso bsol- bsol+ bsol bsoa- bsoa+ bsoa bsola- bsola+
+ bsola bun- bun+ bun bunl- bunl+ bunl buna- buna+ buna bunla-
+ bunla+ bunla bge- bge+ bge bgel- bgel+ bgel bgea- bgea+ bgea
+ bgela- bgela+ bgela bnl- bnl+ bnl bnll- bnll+ bnll bnla- bnla+
+ bnla bnlla- bnlla+ bnlla ble- ble+ ble blel- blel+ blel blea-
+ blea+ blea blela- blela+ blela bng- bng+ bng bngl- bngl+ bngl
+ bnga- bnga+ bnga bngla- bngla+ bngla bne- bne+ bne bnel- bnel+
+ bnel bnea- bnea+ bnea bnela- bnela+ bnela bns- bns+ bns bnsl-
+ bnsl+ bnsl bnsa- bnsa+ bnsa bnsla- bnsla+ bnsla bnu- bnu+ bnu
+ bnul- bnul+ bnul bnua- bnua+ bnua bnula- bnula+ bnula bdnzt- bdnzt+
+ bdnzt bdnztl- bdnztl+ bdnztl bdnzta- bdnzta+ bdnzta bdnztla- bdnztla+ bdnztla bdnzf-
+ bdnzf+ bdnzf bdnzfl- bdnzfl+ bdnzfl bdnzfa- bdnzfa+ bdnzfa bdnzfla- bdnzfla+ bdnzfla
+ bt- bt+ bt bbt btl- btl+ btl bbtl bta- bta+ bta
+ bbta btla- btla+ btla bbtla bf- bf+ bf bbf bfl- bfl+
+ bfl bbfl bfa- bfa+ bfa bbfa bfla- bfla+ bfla bbfla bdzt-
+ bdzt+ bdzt bdztl- bdztl+ bdztl bdzta- bdzta+ bdzta bdztla- bdztla+ bdztla
+ bdzf- bdzf+ bdzf bdzfl- bdzfl+ bdzfl bdzfa- bdzfa+ bdzfa bdzfla- bdzfla+
+ bdzfla bc- bc+ bc bcl- bcl+ bcl bca- bca+ bca bcla-
+ bcla+ bcla sc svc svcl svca svcla b bl ba bla
+ mcrf blr br blrl brl bdnzlr bdnzlr- bdnzlr- bdnzlr+ bdnzlr+ bdnzlrl
+ bdnzlrl- bdnzlrl- bdnzlrl+ bdnzlrl+ bdzlr bdzlr- bdzlr- bdzlr+ bdzlr+ bdzlrl bdzlrl-
+ bdzlrl- bdzlrl+ bdzlrl+ bltlr bltlr- bltlr- bltlr+ bltlr+ bltr bltlrl bltlrl-
+ bltlrl- bltlrl+ bltlrl+ bltrl bgtlr bgtlr- bgtlr- bgtlr+ bgtlr+ bgtr bgtlrl
+ bgtlrl- bgtlrl- bgtlrl+ bgtlrl+ bgtrl beqlr beqlr- beqlr- beqlr+ beqlr+ beqr
+ beqlrl beqlrl- beqlrl- beqlrl+ beqlrl+ beqrl bsolr bsolr- bsolr- bsolr+ bsolr+
+ bsor bsolrl bsolrl- bsolrl- bsolrl+ bsolrl+ bsorl bunlr bunlr- bunlr- bunlr+
+ bunlr+ bunlrl bunlrl- bunlrl- bunlrl+ bunlrl+ bgelr bgelr- bgelr- bgelr+ bgelr+
+ bger bgelrl bgelrl- bgelrl- bgelrl+ bgelrl+ bgerl bnllr bnllr- bnllr- bnllr+
+ bnllr+ bnlr bnllrl bnllrl- bnllrl- bnllrl+ bnllrl+ bnlrl blelr blelr- blelr-
+ blelr+ blelr+ bler blelrl blelrl- blelrl- blelrl+ blelrl+ blerl bnglr bnglr-
+ bnglr- bnglr+ bnglr+ bngr bnglrl bnglrl- bnglrl- bnglrl+ bnglrl+ bngrl bnelr
+ bnelr- bnelr- bnelr+ bnelr+ bner bnelrl bnelrl- bnelrl- bnelrl+ bnelrl+ bnerl
+ bnslr bnslr- bnslr- bnslr+ bnslr+ bnsr bnslrl bnslrl- bnslrl- bnslrl+ bnslrl+
+ bnsrl bnulr bnulr- bnulr- bnulr+ bnulr+ bnulrl bnulrl- bnulrl- bnulrl+ bnulrl+
+ btlr btlr- btlr- btlr+ btlr+ bbtr btlrl btlrl- btlrl- btlrl+ btlrl+
+ bbtrl bflr bflr- bflr- bflr+ bflr+ bbfr bflrl bflrl- bflrl- bflrl+
+ bflrl+ bbfrl bdnztlr bdnztlr- bdnztlr+ bdnztlrl bdnztlrl- bdnztlrl+ bdnzflr bdnzflr- bdnzflr+
+ bdnzflrl bdnzflrl- bdnzflrl+ bdztlr bdztlr- bdztlr+ bdztlrl bdztlrl- bdztlrl+ bdzflr bdzflr-
+ bdzflr+ bdzflrl bdzflrl- bdzflrl+ bclr+ bclrl+ bclr- bclrl- bclr bclrl bcr
+ bcrl bclre bclrel rfid crnot crnor rfmci rfi rfci rfsvc crandc
+ isync ics crclr crxor crnand crand crset creqv crorc crmove cror
+ bctr bctrl bltctr bltctr- bltctr- bltctr+ bltctr+ bltctrl bltctrl- bltctrl- bltctrl+
+ bltctrl+ bgtctr bgtctr- bgtctr- bgtctr+ bgtctr+ bgtctrl bgtctrl- bgtctrl- bgtctrl+ bgtctrl+
+ beqctr beqctr- beqctr- beqctr+ beqctr+ beqctrl beqctrl- beqctrl- beqctrl+ beqctrl+ bsoctr
+ bsoctr- bsoctr- bsoctr+ bsoctr+ bsoctrl bsoctrl- bsoctrl- bsoctrl+ bsoctrl+ bunctr bunctr-
+ bunctr- bunctr+ bunctr+ bunctrl bunctrl- bunctrl- bunctrl+ bunctrl+ bgectr bgectr- bgectr-
+ bgectr+ bgectr+ bgectrl bgectrl- bgectrl- bgectrl+ bgectrl+ bnlctr bnlctr- bnlctr- bnlctr+
+ bnlctr+ bnlctrl bnlctrl- bnlctrl- bnlctrl+ bnlctrl+ blectr blectr- blectr- blectr+ blectr+
+ blectrl blectrl- blectrl- blectrl+ blectrl+ bngctr bngctr- bngctr- bngctr+ bngctr+ bngctrl
+ bngctrl- bngctrl- bngctrl+ bngctrl+ bnectr bnectr- bnectr- bnectr+ bnectr+ bnectrl bnectrl-
+ bnectrl- bnectrl+ bnectrl+ bnsctr bnsctr- bnsctr- bnsctr+ bnsctr+ bnsctrl bnsctrl- bnsctrl-
+ bnsctrl+ bnsctrl+ bnuctr bnuctr- bnuctr- bnuctr+ bnuctr+ bnuctrl bnuctrl- bnuctrl- bnuctrl+
+ bnuctrl+ btctr btctr- btctr- btctr+ btctr+ btctrl btctrl- btctrl- btctrl+ btctrl+
+ bfctr bfctr- bfctr- bfctr+ bfctr+ bfctrl bfctrl- bfctrl- bfctrl+ bfctrl+ bcctr-
+ bcctr+ bcctrl- bcctrl+ bcctr bcctrl bcc bccl bcctre bcctrel rlwimi rlimi
+ rlwimi. rlimi. rotlwi clrlwi rlwinm rlinm rotlwi. clrlwi. rlwinm. rlinm. rlmi
+ rlmi. be bel bea bela rotlw rlwnm rlnm rotlw. rlwnm. rlnm.
+ nop ori oril oris oriu xori xoril xoris xoriu andi. andil.
+ andis. andiu. rotldi clrldi rldicl rotldi. clrldi. rldicl. rldicr rldicr. rldic
+ rldic. rldimi rldimi. rotld rldcl rotld. rldcl. rldcr rldcr. cmpw cmpd
+ cmp cmp twlgt tlgt twllt tllt tweq teq twlge tlge twlnl
+ tlnl twlle tlle twlng tlng twgt tgt twge tge twnl tnl
+ twlt tlt twle tle twng tng twne tne trap tw t
+ subfc sf subc subfc. sf. subc. subfco sfo subco subfco. sfo.
+ subco. mulhdu mulhdu. addc a addc. a. addco ao addco. ao.
+ mulhwu mulhwu. isellt iselgt iseleq isel mfocrf mfcr mfcr lwarx ldx
+ icbt icbt lwzx lx slw sl slw. sl. cntlzw cntlz cntlzw.
+ cntlz. sld sld. and and. maskg maskg. icbte lwzxe cmplw cmpld
+ cmpl cmpl subf sub subf. sub. subfo subo subfo. subo. ldux
+ dcbst lwzux lux dcbste lwzuxe cntlzd cntlzd. andc andc. tdlgt tdllt
+ tdeq tdlge tdlnl tdlle tdlng tdgt tdge tdnl tdlt tdle tdng
+ tdne td mulhd mulhd. mulhw mulhw. dlmzb dlmzb. mtsrd mfmsr ldarx
+ dcbf lbzx dcbfe lbzxe neg neg. nego nego. mul mul. mulo
+ mulo. mtsrdin clf lbzux not nor not. nor. lwarxe lbzuxe wrtee
+ dcbtstls subfe sfe subfe. sfe. subfeo sfeo subfeo. sfeo. adde ae
+ adde. ae. addeo aeo addeo. aeo. dcbtstlse mtocrf mtcr mtcrf mtmsr
+ stdx stwcx. stwx stx stwcxe. stwxe slq slq. sle sle. wrteei
+ dcbtls dcbtlse mtmsrd stdux stwux stux sliq sliq. stwuxe subfze sfze
+ subfze. sfze. subfzeo sfzeo subfzeo. sfzeo. addze aze addze. aze. addzeo
+ azeo addzeo. azeo. mtsr stdcx. stbx sllq sllq. sleq sleq. stbxe
+ icblc subfme sfme subfme. sfme. subfmeo sfmeo subfmeo. sfmeo. mulld mulld.
+ mulldo mulldo. addme ame addme. ame. addmeo ameo addmeo. ameo. mullw
+ muls mullw. muls. mullwo mulso mullwo. mulso. icblce mtsrin mtsri dcbtst
+ stbux slliq slliq. dcbtste stbuxe mfdcrx doz doz. dozo dozo. add
+ cax add. cax. addo caxo addo. caxo. tlbiel mfapidi lscbx lscbx.
+ dcbt lhzx eqv eqv. dcbte lhzxe tlbie tlbi eciwx lhzux xor
+ xor. lhzuxe mfexisr mfexier mfbr0 mfbr1 mfbr2 mfbr3 mfbr4 mfbr5 mfbr6
+ mfbr7 mfbear mfbesr mfiocr mfdmacr0 mfdmact0 mfdmada0 mfdmasa0 mfdmacc0 mfdmacr1 mfdmact1
+ mfdmada1 mfdmasa1 mfdmacc1 mfdmacr2 mfdmact2 mfdmada2 mfdmasa2 mfdmacc2 mfdmacr3 mfdmact3 mfdmada3
+ mfdmasa3 mfdmacc3 mfdmasr mfdcr div div. divo divo. mfpmr mfmq mfxer
+ mfrtcu mfrtcl mfdec mfdec mflr mfctr mftid mfdsisr mfdar mfsdr0 mfsdr1
+ mfsrr0 mfsrr1 mfpid mfpid mfcsrr0 mfcsrr1 mfdear mfdear mfesr mfesr mfivpr
+ mfcmpa mfcmpb mfcmpc mfcmpd mficr mfder mfcounta mfcountb mfcmpe mfcmpf mfcmpg
+ mfcmph mflctrl1 mflctrl2 mfictrl mfbar mfvrsave mfusprg0 mfsprg4 mfsprg4 mfsprg5 mfsprg5
+ mfsprg6 mfsprg6 mfsprg7 mfsprg7 mftb mftb mftbl mftbl mftbu mftbu mfsprg
+ mfsprg0 mfsprg1 mfsprg2 mfsprg3 mfasr mfear mfpir mfpvr mfdbsr mfdbsr mfdbcr0
+ mfdbcr0 mfdbcr1 mfdbcr1 mfdbcr2 mfiac1 mfiac1 mfiac2 mfiac2 mfiac3 mfiac3 mfiac4
+ mfiac4 mfdac1 mfdac1 mfdac2 mfdac2 mfdvc1 mfdvc1 mfdvc2 mfdvc2 mftsr mftsr
+ mftcr mftcr mfivor0 mfivor1 mfivor2 mfivor3 mfivor4 mfivor5 mfivor6 mfivor7 mfivor8
+ mfivor9 mfivor10 mfivor11 mfivor12 mfivor13 mfivor14 mfivor15 mfspefscr mfbbear mfbbtar mfivor32
+ mfivor33 mfivor34 mfivor35 mfibatu mfibatl mfdbatu mfdbatl mfic_cst mfic_adr mfic_dat mfdc_cst
+ mfdc_adr mfmcsrr0 mfdc_dat mfmcsrr1 mfmcsr mfmcar mfdpdr mfdpir mfimmr mfmi_ctr mfmi_ap
+ mfmi_epn mfmi_twc mfmi_rpn mfmd_ctr mfm_casid mfmd_ap mfmd_epn mfmd_twb mfmd_twc mfmd_rpn mfm_tw
+ mfmi_dbcam mfmi_dbram0 mfmi_dbram1 mfmd_dbcam mfmd_dbram0 mfmd_dbram1 mfummcr0 mfupmc1 mfupmc2 mfusia mfummcr1
+ mfupmc3 mfupmc4 mfzpr mfccr0 mfmmcr0 mfpmc1 mfsgr mfpmc2 mfdcwr mfsia mfsler
+ mfmmcr1 mfsu0r mfpmc3 mfpmc4 mficdbdr mfevpr mfcdbcr mfpit mftbhi mftblo mfsrr2
+ mfsrr3 mfl2cr mfdccr mficcr mfictc mfpbl1 mfthrm1 mfpbu1 mfthrm2 mfpbl2 mfthrm3
+ mfpbu2 mfspr lwax dst dstt lhax lhaxe dstst dststt dccci abs
+ abs. abso abso. divs divs. divso divso. tlbia lwaux lhaux lhauxe
+ mtdcrx dcblc subfe64 subfe64o adde64 adde64o dcblce slbmte sthx lfqx lfqux
+ stfqx stfqux orc orc. sradi sradi. sthxe slbie ecowx sthux sthuxe
+ mr or mr. or. mtexisr mtexier mtbr0 mtbr1 mtbr2 mtbr3 mtbr4
+ mtbr5 mtbr6 mtbr7 mtbear mtbesr mtiocr mtdmacr0 mtdmact0 mtdmada0 mtdmasa0 mtdmacc0
+ mtdmacr1 mtdmact1 mtdmada1 mtdmasa1 mtdmacc1 mtdmacr2 mtdmact2 mtdmada2 mtdmasa2 mtdmacc2 mtdmacr3
+ mtdmact3 mtdmada3 mtdmasa3 mtdmacc3 mtdmasr mtdcr subfze64 subfze64o divdu divdu. divduo
+ divduo. addze64 addze64o divwu divwu. divwuo divwuo. mtmq mtxer mtlr mtctr
+ mttid mtdsisr mtdar mtrtcu mtrtcl mtdec mtsdr0 mtsdr1 mtsrr0 mtsrr1 mtpid
+ mtpid mtdecar mtcsrr0 mtcsrr1 mtdear mtdear mtesr mtesr mtivpr mtcmpa mtcmpb
+ mtcmpc mtcmpd mticr mtder mtcounta mtcountb mtcmpe mtcmpf mtcmpg mtcmph mtlctrl1
+ mtlctrl2 mtictrl mtbar mtvrsave mtusprg0 mtsprg mtsprg0 mtsprg1 mtsprg2 mtsprg3 mtsprg4
+ mtsprg5 mtsprg6 mtsprg7 mtasr mtear mttbl mttbu mtdbsr mtdbsr mtdbcr0 mtdbcr0
+ mtdbcr1 mtdbcr1 mtdbcr2 mtiac1 mtiac1 mtiac2 mtiac2 mtiac3 mtiac3 mtiac4 mtiac4
+ mtdac1 mtdac1 mtdac2 mtdac2 mtdvc1 mtdvc1 mtdvc2 mtdvc2 mttsr mttsr mttcr
+ mttcr mtivor0 mtivor1 mtivor2 mtivor3 mtivor4 mtivor5 mtivor6 mtivor7 mtivor8 mtivor9
+ mtivor10 mtivor11 mtivor12 mtivor13 mtivor14 mtivor15 mtspefscr mtbbear mtbbtar mtivor32 mtivor33
+ mtivor34 mtivor35 mtibatu mtibatl mtdbatu mtdbatl mtmcsrr0 mtmcsrr1 mtmcsr mtummcr0 mtupmc1
+ mtupmc2 mtusia mtummcr1 mtupmc3 mtupmc4 mtzpr mtccr0 mtmmcr0 mtsgr mtpmc1 mtdcwr
+ mtpmc2 mtsler mtsia mtsu0r mtmmcr1 mtpmc3 mtpmc4 mticdbdr mtevpr mtcdbcr mtpit
+ mttbhi mttblo mtsrr2 mtsrr3 mtl2cr mtdccr mticcr mtictc mtpbl1 mtthrm1 mtpbu1
+ mtthrm2 mtpbl2 mtthrm3 mtpbu2 mtspr dcbi nand nand. dcbie dcread mtpmr
+ icbtls nabs subfme64 nabs. nabso subfme64o nabso. divd divd. divdo divdo.
+ addme64 addme64o divw divw. divwo divwo. icbtlse slbia cli stdcxe. mcrxr
+ bblels mcrxr64 clcs lswx lsx lwbrx lbrx lfsx srw sr srw.
+ sr. rrib rrib. srd srd. maskir maskir. lwbrxe lfsxe bbelr tlbsync
+ lfsux lfsuxe mfsr lswi lsi lwsync ptesync msync sync dcs lfdx
+ lfdxe mfsri dclst lfdux lfduxe mfsrin stswx stsx stwbrx stbrx stfsx
+ srq srq. sre sre. stwbrxe stfsxe stfsux sriq sriq. stfsuxe stswi
+ stsi stfdx srlq srlq. sreq sreq. stfdxe dcba stfdux srliq srliq.
+ dcbae stfduxe tlbivax tlbivaxe lhbrx sraw sra sraw. sra. srad srad.
+ lhbrxe ldxe lduxe rac dss dssall srawi srai srawi. srai. slbmfev
+ mbar eieio tlbsx tlbsx tlbsx. tlbsx. tlbsxe tlbsxe. slbmfee sthbrx sraq
+ sraq. srea srea. extsh exts extsh. exts. sthbrxe stdxe tlbrehi tlbrelo
+ tlbre tlbre sraiq sraiq. extsb extsb. stduxe iccci tlbwehi tlbwelo tlbwe
+ tlbld icbi stfiwx extsw extsw. icread icbie stfiwxe tlbli dcbzl dcbz
+ dclz dcbze lvebx lvehx lvewx lvsl lvsr lvx lvxl stvebx stvehx
+ stvewx stvx stvxl lwz l lwzu lu lbz lbzu stw st
+ stwu stu stb stbu lhz lhzu lha lhau sth sthu lmw
+ lm stmw stm lfs lfsu lfd lfdu stfs stfsu
+ stfd stfdu lq lfq lfqu lbze lbzue lhze lhzue lhae lhaue
+ lwze lwzue stbe stbue sthe sthue stwe stwue ld ldu lwa
+ fdivs fdivs. fsubs fsubs. fadds fadds. fsqrts fsqrts. fres fres. fmuls
+ fmuls. fmsubs fmsubs. fmadds fmadds. fnmsubs fnmsubs. fnmadds fnmadds. stfq stfqu
+ lde ldue lfse lfsue lfde lfdue stde stdue stfse stfsue stfde
+ stfdue std stdu stq fcmpu frsp frsp. fctiw fcir fctiw. fcir.
+ fctiwz fcirz fctiwz. fcirz. fdiv fd fdiv. fd. fsub fs fsub.
+ fs. fadd fa fadd. fa. fsqrt fsqrt. fsel fsel. fmul fm
+ fmul. fm. frsqrte frsqrte. fmsub fms fmsub. fms. fmadd fma fmadd.
+ fma. fnmsub fnms fnmsub. fnms. fnmadd fnma fnmadd. fnma. fcmpo mtfsb1
+ mtfsb1. fneg fneg. mcrfs mtfsb0 mtfsb0. fmr fmr. mtfsfi mtfsfi. fnabs
+ fnabs. fabs fabs. mffs mffs. mtfsf mtfsf. fctid fctid. fctidz fctidz.
+ fcfid fcfid. extldi extldi. extrdi extrdi. insrdi insrdi. rotrdi rotrdi. sldi
+ sldi. srdi srdi. clrrdi clrrdi. clrlsldi clrlsldi. extlwi extlwi. extrwi extrwi.
+ inslwi inslwi. insrwi insrwi. rotrwi rotrwi. slwi sli slwi. sli. srwi
+ sri srwi. sri. clrrwi clrrwi. clrlslwi clrlslwi.
+
+#types / register, HID0 is the first reg of supervisor mode
+$KEYWORDS(kwb)= r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 r16 r17 r18 r19 r20
+r21 r22 r23 r24 r25 r26 r27 r28 r29 r30 r31 f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13
+f14 f15 f16 f17 f18 f19 f20 f21 f22 f23 f24 f25 f26 f27 f28 f29 f30 f31 cr cr0 cr1 fpscr xer lr
+ctr tbl tbh hid0 hid1 hid2 sprg0 sprg1 sprg2 sprg3 sprg4 sprg5 sprg6 sprg7
+ibat0u ibat0l ibat1u ibat1l ibat2u ibat2l ibat3u ibat3l ibat4u ibat4l ibat5u ibat5l ibat6u ibat6l ibat7u ibat7l
+dbat0u dbat0l dbat1u dbat1ldbat2u dbat2l dbat3u dbat3l dbat4u dbat4l dbat5u dbat5l dbat6u dbat6l dbat7u dbat7l
+csrr0 csrr1 msr mbar dsisr srr0 srr1 dar iabr iabr1 dabr dabr2 svr pvr dmis dcmp hash1 hash2 imiss icmp rpa sdr1
+sr0 sr2 sr3 sr4 sr5 sr6 sr7 sr8 sr9 sr10 sr11 sr12 sr13 sr14 sr15 dec ear ibcr dbcr
+
+
+$ML_COMMENT=/* */
+$SL_COMMENT=#
+$ALLOWNESTEDCOMMENTS=false
+
+$IDENTIFIER=regex([a-zA-Z_]\w*[\.\+\-]?)
+
+$DIRECTIVE=.
+
+$STRINGDELIMITERS=" '
+
+$IGNORECASE=true
+
+$SYMBOLS= ( ) [ ] { } , : & | < > ! = / * % + -
+
+$REFORMATTING=true
diff --git a/support/highlight/langDefs/sas.lang b/support/highlight/langDefs/sas.lang
new file mode 100644
index 0000000000..d4e67e3382
--- /dev/null
+++ b/support/highlight/langDefs/sas.lang
@@ -0,0 +1,33 @@
+# SAS language definition file
+# (Statistical Analysis System)
+#
+# Author: Alexandre Detiste
+# Mail: alexandre@detiste.be
+# Date: 11/09/2005
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=SAS
+
+$KEYWORDS(kwa)=put
+
+$KEYWORDS(kwb)=proc data set merge run output
+
+$KEYWORDS(kwc)=drop keep in retain file infile put if then else while for
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=//
+
+$ML_COMMENT=/* */
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
diff --git a/support/highlight/langDefs/sc.lang b/support/highlight/langDefs/sc.lang
new file mode 100644
index 0000000000..af21b2432f
--- /dev/null
+++ b/support/highlight/langDefs/sc.lang
@@ -0,0 +1,132 @@
+# Paradox script language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 04.03.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Paradox
+
+$KEYWORDS(kwa)=and case debug do_it else endfor endforeach endif endscan endswitch
+endwhile for foreach from if in keyto loop not on or otherwise quitloop scan
+step switch then to until wait while const endconst var endvar uses enduses method endmethod
+try onfail endtry
+
+# functions
+$KEYWORDS(kwb)=abs accept acceptdialog acos action add adjust after all alt
+altminus altspace answer append appendarray appenddelimited area array
+arraysize arrive arrivefield arrivepage arriverow arrivetable arrivewindow
+arrowstep asc ascii asin ask atan2 atan atfirst atlast attribute attributes
+auto autocommit autoindent autorefresh axes background backspace bandinfo bar
+beep before beginrecord bestmatch big binary blankdate blanknum blink blob
+border borrow bot both box break buttons by calcdebug calcedit calculated
+cancel canceldialog canceledit canclose canmaximize canmove canresize canvas
+canvasheight canvaswidth caps casesensitive caverage ccount centered change
+changed changes charlen charpos charwaiting check checkbox checkboxes
+checkdescending checkmarkstatus checkplus chr clear clearall clearimage
+clearpasswords clearpulldown click clipcopy clipcut clippaste close closed cmax
+cmin cnpv code coedit coeditkey col colno color colors columns columnsize
+commit compatible complete connection continue controlvalue convertlib copy
+copyform copyfromarray copyreport copytoarray cos create createlib crosstab
+crosstabkey cstd csum ctrl ctrlbackspace ctrlbreak ctrlend ctrlhome ctrlleft
+ctrlpgdn ctrlpgup ctrlright curline currency current cursor cursorchar
+cursorline custom cvar d dataentry date dateval day dbase default define del
+delete deleteline design device dialog differenttable directory direxists
+dirlock disable displayonly ditto dos dosbig double-line double doubleclick dow
+down downimage drag drivespace drivestatus duration dynarray dynarraysize echo
+edit editkey editlog editor empty end enddialog endmenu endofpage endproc
+endquery endsubmenu endtext enter entry eol eos eot erase errorcode errorinfo
+errormessage erroruser esc event every exactly example execevent execproc
+execute exit exp export exportimport extract f false family familyrights fast
+field fieldinfo fieldnames fieldno fieldrights fieldstr fieldtype fieldview
+file fileread files filesize fileversion filewrite fill find findnext first
+firstshow floating forcepost form formadd format formfeed formkey forms
+formtables formtype frame free-form fulllock fv getattributes getcanvas getchar
+getcolors getevent getkeyboardstate getmenuselection getwindow go gokey goto
+graph graphkey graphtype grids groupby groupoftables grouprepeats handle
+hasframe hasshadow headings height help helpmode hidden hide home horizontal
+idle ii iif iii image imagecaverage imageccount imagecmax imagecmin imagecsum
+imageno imageorder imagerights imagetype immediate import index indexorder info
+infolib ins insert instantplay instantrecord instantreport int intense
+inventory isassigned isblank isblankzero isdirname isempty isencrypted
+isfieldview isfile isformview isinsertmode islinklocked ismaster ismultiform
+ismultireport isruntime isshared istable isvalid iswindow iv justfamily justify
+keepset key keycode keylookup keypress keystroke keyviol label last leavelocked
+left legendsandlabels len length like line linefeed link linked linktype list
+ln load localizeevent locate lock lockkey lockrecord lockstatus log lookup
+lower maintained make margin mark markersandfills master match max maximize
+maximized memleft menu menuchoice menudisable menuenable menukey menuprompt
+menuselect menutag message min miniedit mod modify monitor monochrome month
+more mouse move moveto moy multiadd multientry net nettype new newdialogspec
+newentries newwaitspec next nfields nimagerecords nimages nkeyfields no noext
+nopost norefresh norestore normal noshell npages nrecords nrows num
+numberrecords numeditors numeric numval off ok only open ordertable origincol
+originrow other output overall override overwrite page pagelayout pageno
+pagestep pagewidth paintcanvas palmenu passrights password pattern per-group
+permanent pfs pgdn pgup pi pickarray pickdynarray pickdynarrayindex pickfile
+pickform picktable picture pies place play pmt position postrecord pow
+predefined preferences prev preventlock print printer printerlayout printerport
+printerstatus printertoscreem private privdir privtables pro problems proc
+procs prompt protect pushbutton pv quattro query queryorder querysave
+queryspeed quit r radiobutton radiobuttons ram rand range rangeoutput read
+readlib readonly recno record records recordstatus reflex reformat refresh
+refreshcontrol refreshdialog regroup regular release release relink remove
+rename repaintdialog repeatplay replace replacefields replacenext replicatools
+report reporttables required requiredcheck requiredvalue reset resize restart
+restructure resynccontrol resyncdialog resynckey retain retryperiod return
+retval reverse reversetab revert right rmemleft rollback rotate round row rowno
+run same sametable save savetables savevars scancode screen screentoprinter
+script scripts scroll scrollcol scrollpress scrollrow sdir search searchfrom
+select selectcontrol selend selstart separator series set setattributes
+setautosave setbatch setbw setcanvas setcolors setdir setinterrupt setkey
+setkeyboardstate setmargin setmaxsize setnegcolor setprinter setprivate
+setprivdir setqueryorder setrecordposition setrestartcount setretryperiod
+setswap setting setuimode setup setusername shift shiftpress show showarray
+showdialog showfiles showhighlight showmenu showplay showpopup showpulldown
+showtables sin single-line single size skip sleep slider slow sort
+sortdirection sortorder sound spaces sqrt standard start structure strval style
+submenu substr subtract summary suppress symphony synccursor syscolor sysinfo
+sysmode tab table tableindex tableofgroups tableorder tablerights tables
+tablesize tabular tag tan text ticks time title titles today todos
+togglepalette tools toqpro touchrecord trigger trimming true truetype type
+typein undo unlink unlinked unlock unlockrecord unpassword up update upimage
+upper usdate user username usevars valcheck value vars version vertical
+vertruler view viewgraph visicalc who width winclose window windowat winmax
+winnext winresize with wordwrap workspace wrappos write-protect write writelib
+writelock year yes zoom zoomnext allow_dup_row alter avg begin between browse
+char charindex clustered compute convert count database dateadd datediff
+datename declare desc description dialect disk distinct drop dump endsql exec
+fillfactor getdate grant group having hpldlock ignore_dup_key ignore_dup_row
+init into issql local ltrim name nofetch nonclustered null order physname
+product raiseerror remote revoke rtrim rule showplan showsql sorted_data sql
+sqlautocommit sqlbreakconnect sqlclearconnect sqlcommit sqlconnectinfo
+sqlerrorcode sqlerrormessage sqlfetch sqlisconnect sqlisreplica sqlmakeconnect
+sqlmapinfo sqlrelease sqlrestoreconnect sqlrollback sqlsave sqlsaveconnect
+sqlselectconnect sqlsetinterrupt sqlstarttrans sqlval statistics stuff sum
+substring tran transaction truncate truncate_only union unique values vdevno
+waitfor where logical string tableview library anytype smallint tcursor logical
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS="
+
+$SL_COMMENT=;
+
+$IGNORECASE=true
+
+$IDENTIFIER=regex([a-zA-Z_][\w\-]*)
+
+$SYMBOLS= ( ) [ ] { } , : & | < > ! = / * % + - .
+
+
+
diff --git a/support/highlight/langDefs/scala.lang b/support/highlight/langDefs/scala.lang
new file mode 100644
index 0000000000..75d3b5f61d
--- /dev/null
+++ b/support/highlight/langDefs/scala.lang
@@ -0,0 +1,26 @@
+# Scala language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 15.04.2004
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Scala
+
+$INCLUDE=java
+
+$KEYWORDS(kwa)=abstract def object override sealed trait type val var yield
+
+$ALLOWNESTEDCOMMENTS=true
+
+$STRINGDELIMITERS=""" " '
diff --git a/support/highlight/langDefs/scilab.lang b/support/highlight/langDefs/scilab.lang
new file mode 100644
index 0000000000..e34630818d
--- /dev/null
+++ b/support/highlight/langDefs/scilab.lang
@@ -0,0 +1,60 @@
+# Scilab language definition file
+# Entirely based on the matlab one, by André Simon.
+# Please, this file is not complete, send bugs, errors, etc!
+#
+# Author: Gunnar Lindholm
+# Mail: matematik@comhem.se
+# Date: 2006-02-ish
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released
+# under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming
+# languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always
+# appreciated ;)
+
+$DESCRIPTION=Scilab
+
+$KEYWORDS(kwa)=abort ans backslash bool2s boolean brackets break call case
+clear clearglobal colon comma comments continue date debug definedfields do
+dot else elseif empty end equal errcatch errclear error etime evstr exec
+execstr exists exit external extraction feval find for format fort funptr
+getdate getenv getfield getpid getversion global gstacksize hat host hypermat
+hypermatrices iconvert ieee if insertion intppty inttype inv_coeff iserror
+isglobal lasterror left less list lsslist lstcat matrices matrix mlist mode
+mtlb_mode names null overloading parents pause percent plus poly power predef
+pwd quit quote rational resume return rlist sciargs select semi semicolon
+setenv setfield slash stacksize star symbols testmatrix then tic tilda tlist
+toc type typename user varn what whatis where whereami whereis while who
+who_user whos function endfunction
+
+$CONTINUATIONSYMBOL=...
+
+# functions
+$KEYWORDS(kwb)=abs acos acosh acoshm acosm addf adj2sp amell and asin asinh
+asinhm asinm atan atanh atanhm atanm bessel beta binomial bloc2exp bloc2ss
+bsplin3val calerf ceil cell2mat cellstr char cmb_lin conj cos cosh coshm cosm
+cotg coth cothm cshep2d cumprod cumsum delip diag diff dlgamma double dsearch
+erf erfc erfcx eval eval_cshep2d eye fix floor frexp full gamma gammaln gsort
+imag imult ind2sub int int8 integrate interp interp1 interp2d interp3d
+interpln intersect intsplin inttrap isdef isempty isequal isinf isnan isreal
+kron ldivf legendre lex_sort linear_interpn linspace log log10 log1p log2
+logm logspace lsq_splin lstsize max maxi min mini minus modulo mps2linpro
+mtlb_sparse mulf ndgrid ndims nearfloat nextpow2 nnz norm not
+number_properties oldbessel ones or pen2ea pertrans prod rand rat rdivf real
+round setdiff sign signm sin sinc sinh sinhm sinm size smooth solve sort
+sp2adj sparse spcompack speye spget splin splin2d splin3d spones sprand
+spzeros sqrt sqrtm squarewave ssprint ssrand sub2ind subf sum sysconv sysdiag
+syslin tan tanh tanhm tanm toeplitz trfmod trianfml tril trisolve triu
+typeof union unique vectorfind whatis zeros plot
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=//
+
+$IGNORECASE=false
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * + - . ^
diff --git a/support/highlight/langDefs/sh.lang b/support/highlight/langDefs/sh.lang
new file mode 100644
index 0000000000..d5172cf961
--- /dev/null
+++ b/support/highlight/langDefs/sh.lang
@@ -0,0 +1,57 @@
+# Bash script language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 29.07.2002
+# Update: 02.10.2007 Added kwc list
+# Update: 08.10.2008
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Bash
+
+$KEYWORDS(kwa)=case in esac for do done function if then fi elif else select
+time until while
+
+# built in commands
+$KEYWORDS(kwb)=source alias bind break builtin command continue declare dirs
+disown echo enable export fc fg getopts hash help history jobs let local
+logout popd printf pushd pwd read readonly return set shift shopt suspend test
+times trap type ulimit umask unalias unset wait eval bg cd echo eval exec exit
+kill read set test trap ulimit umask wait
+
+$KEYWORDS(kwc)= ls cat tac rev cp mv rm rmdir chmod chattr ln find xargs expr
+date zdump time touch at batch cal sleep usleep hwclock clock sort tsort diff
+patch diff3 sdiff cmp comm uniq expand unexpand cat paste join head tail grep
+egrep zgrep look sed awk wc tr fold fmt ptx col column colrm nl pr gettext
+iconv recode groff lex yacc tar shar ar cpio gzip bzip2 compress uncompress
+zip unzip sq file which whereis whatis vdir shred locate slocate strings
+basename dirname split sum cksum md5sum sha1sum uuencode uudecode crypt make
+install more less host vrfy nslookup dig traceroute ping whois finger ftp
+uucp telnet rlogin rsh rcp ssh write mail vacation tput reset clear script
+factor bc dc jot seq yes banner printenv lp tee mkfifo pathchk dd od hexdump m4
+
+$STRINGDELIMITERS=" ' `
+
+$CONTINUATIONSYMBOL=\
+
+$SL_COMMENT=#
+
+$IGNORECASE=false
+
+$KEYWORDS(kwb)=regex(\$\w+)
+
+$KEYWORDS(kwd)=regex(\$\{.+?\})
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
diff --git a/support/highlight/langDefs/sma.lang b/support/highlight/langDefs/sma.lang
new file mode 100644
index 0000000000..f61961d18d
--- /dev/null
+++ b/support/highlight/langDefs/sma.lang
@@ -0,0 +1,38 @@
+# SMALL language definition file
+#
+# Author: André Simon
+# Mail: andre.simon1@gmx.de
+# Date: 28.06.20.03
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL
+#
+# The file is used to describe keywords and special symbols of programming languages
+# See README in the highlight directory for details
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=SMALL
+
+$KEYWORDS(kwa)=assert break case char const continue default defined do else enum
+exit for forward goto if native new operator public return sizeof sleep static
+stock switch while
+
+$KEYWORDS(kwb)=char defined sizeof
+
+$STRINGDELIMITERS=" '
+
+$ML_COMMENT=/* */
+
+$SL_COMMENT=//
+
+$ESCCHAR=regex(^\d{3}|^x\d{2}|^[ntvbrfa^\?'"])
+
+$IGNORECASE=true
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + - ?
+
+
diff --git a/support/highlight/langDefs/smalltalk.lang b/support/highlight/langDefs/smalltalk.lang
new file mode 100644
index 0000000000..0a157f2e17
--- /dev/null
+++ b/support/highlight/langDefs/smalltalk.lang
@@ -0,0 +1,40 @@
+# Smalltalk language definition file
+#
+# This assumes a coding style where statements don't cross lines at inappropriate moments,
+# single spaces are used in many places, and a newly defined method name appears alone on
+# a line.
+#
+# Author: Joerg Walter
+# Mail: jwalt@garni.ch
+# Date: 29.10.2007
+
+# TODO: Fix "$" recognition
+
+$DESCRIPTION=Smalltalk
+
+# Yup, that's six, and strictly speaking they aren't keywords at all.
+$KEYWORDS(kwa)=self super nil true false thisContext
+
+# messages
+$KEYWORDS(kwb)=regex(\b[a-z]\w*:(?!=)|(?<= )(?<! )(?<!\[ )(?<!\| )(?<!= )(?<!. )(?<!: )(?<!\* )(?<!- )(?<!\+ )(?<!/ )[a-z]\w*\b|[\-+/*=]|==|[<>]=|^\s*[a-z]\w+\s*$)
+
+# globals
+$KEYWORDS(kwc)=regex(\b[A-Z]\w*\b)
+
+# symbols, block parameters and local variable declarations
+$KEYWORDS(kwd)=regex(#[a-zA-Z0-9_:]+|#[\-+/*]|(?<= ):\w*\b|(?<=\[):\w*\b|\| *\w+(?: +\w+)* *\|)
+#(\| *\w+( +\w+)* *\|)
+
+$DIGIT=regex((?:0x|0X)[0-9a-fA-F]+|\d*[\.]?\d+(?:[eE][\-\+]\\d+)?[lLuU]?|\$[\w\$\#\'\-])
+
+$STRINGDELIMITERS='
+
+$ML_COMMENT_EQUAL="
+
+$ALLOWNESTEDCOMMENTS=false
+
+$IGNORECASE=false
+
+$REFORMATTING=false
+
+$SYMBOLS= : = . ; ( ) [ ] | ^ #( ! $ % { }
diff --git a/support/highlight/langDefs/sml.lang b/support/highlight/langDefs/sml.lang
new file mode 100644
index 0000000000..8d7f971947
--- /dev/null
+++ b/support/highlight/langDefs/sml.lang
@@ -0,0 +1,41 @@
+# Standard ML language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 17.11.2003
+# Update: 11.09.2008
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Standard ML
+
+$KEYWORDS(kwa)=abstraction abstype and andalso as before case datatype else end
+eqtype exception do fn fun functor handle if in include infix infixr let local
+nonfix of op open orelse overload raise rec sharing sig signature struct
+structure then type val where while with withtype o true false Bool String Int
+Real Word Char StringCvt Word8 List ListPair Vector TextIO BinIO div mod
+
+$KEYWORDS(kwb)=bool string int real word
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS="
+
+$ML_COMMENT=(* *)
+
+$ALLOWNESTEDCOMMENTS=true
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + - ' .
diff --git a/support/highlight/langDefs/sno.lang b/support/highlight/langDefs/sno.lang
new file mode 100644
index 0000000000..e1cff3a722
--- /dev/null
+++ b/support/highlight/langDefs/sno.lang
@@ -0,0 +1,39 @@
+# SNOBOL language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 15.4.2004
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=SNOBOL
+
+$KEYWORDS(kwa)=output terminal screen input arb arbno pos rpos tab trim size rtab replace dupl
+datatype convert len define trace stoptr code rem differ ident array table gt ge le
+eq lt ne lgt any notany break span date substr opsyn integer remdr bal
+
+
+$KEYWORDS(kwc)=regex(:\w*\(\w+\)$)
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=*
+
+$ALLOWNESTEDCOMMENTS=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$IGNORECASE=false
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / % + -
diff --git a/support/highlight/langDefs/spec.lang b/support/highlight/langDefs/spec.lang
new file mode 100644
index 0000000000..db8427e9f2
--- /dev/null
+++ b/support/highlight/langDefs/spec.lang
@@ -0,0 +1,44 @@
+# RPM Spec language definition file
+#
+# Author Andre Simon
+# Mail andre.simon1@gmx.de
+# Date 08.02.04
+# Update 28.05.09 added some keywords
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http/www.andre-simon.de/
+
+$DESCRIPTION=RPM Spec
+
+$KEYWORDS(kwa)=Summary Name Version Release Copyright Group URL Packager Prefix
+Distribution Vendor Icon Provides Requires Serial Conflicts AutoReqProv
+BuildArch ExcludeArch ExclusiveArch ExclusiveOS BuildRoot NoSource NoPatch
+License Buildroot Source Patch case in esac for do done function if then fi elif
+Source0 Patch0 Source1 Patch1 Source2 Patch2 Source3 Patch3 Source4 Patch4 Source5 Patch5 Source6 Patch6 Source7 Patch7 Source8 Patch8 Source9 Patch9 Source10 Patch10 Source11 Patch11 Source12 Patch12 Source13 Patch13 Source14 Patch14 Source15 Patch15 Source16 Patch16 Source17 Patch17 Source18 Patch18 Source19 Patch19 Source20 Patch20 Source21 Patch21 Source22 Patch22 Source23 Patch23 Source24 Patch24 Source25 Patch25 Source26 Patch26 Source27 Patch27 Source28 Patch28 Source29 Patch29 Source30 Patch30
+else select time until while source alias bind break builtin command continue
+declare dirs disown echo enable export fc fg getopts hash help history jobs
+let local logout popd printf pushd pwd read readonly return set shift shopt
+else select time until while source alias bind break builtin command continue
+declare dirs disown echo enable export fc fg getopts hash help history jobs
+let local logout popd printf pushd pwd read readonly return set shift shopt
+suspend test times trap type ulimit umask unalias unset wait eval bg cd echo
+eval exec exit kill read set test trap ulimit umask wait mkdir install make rm
+rmdir
+
+$KEYWORDS(kwb)=regex(\%\w+)
+
+$SL_COMMENT=#
+
+$IGNORECASE=false
+
+$KEYWORDS(kwc)=regex((\%\{.+\}))
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * + -
diff --git a/support/highlight/langDefs/spn.lang b/support/highlight/langDefs/spn.lang
new file mode 100644
index 0000000000..817dd339b7
--- /dev/null
+++ b/support/highlight/langDefs/spn.lang
@@ -0,0 +1,38 @@
+# SPIN SQL language definition file
+#
+# Author: André Simon
+# Mail: andre.simon1@gmx.de
+# Date: 28.06.20.03
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL
+#
+# The file is used to describe keywords and special symbols of programming languages
+# See README in the highlight directory for details
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=SPIN SQL
+
+$KEYWORDS(kwa)=assert init priority proctype provided active break do else empty
+enabled eval fi full goto if inline len nempty nfull od of printf run skip
+timeout xr xs unless _last _pid cond_expr false np_ pc_value STDIN true accept
+end progress atomic d_step hidden ltl never notrace trace show
+
+
+$KEYWORDS(kwb)=bit bool byte chan int local mtype short typedef unsigned
+
+$STRINGDELIMITERS="
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$ML_COMMENT=/* */
+
+$IGNORECASE=true
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
+
+
diff --git a/support/highlight/langDefs/sql.lang b/support/highlight/langDefs/sql.lang
new file mode 100644
index 0000000000..112d8274a2
--- /dev/null
+++ b/support/highlight/langDefs/sql.lang
@@ -0,0 +1,95 @@
+# SQL, PL/SQL language definition file
+#
+# Author: Andre Simon
+#
+# Mail: andre.simon1@gmx.de
+# Date: 5.6.2002
+# Date: 6.12.2007 updated mssql keywords
+# ------------------------------------------
+# This file is part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=PL/SQL
+
+$KEYWORDS(kwa)= add except percent
+all exec plan
+alter execute precision
+and exists primary
+any exit print
+as fetch proc
+asc file procedure
+authorization fillfactor public
+backup for raiserror
+begin foreign read
+between freetext readtext
+break freetexttable reconfigure
+browse from references
+bulk full replication
+by function restore
+cascade goto restrict
+case grant return
+check group revoke
+checkpoint having right
+close holdlock rollback
+clustered identity rowcount
+coalesce identity_insert rowguidcol
+collate identitycol rule
+column if save
+commit in schema
+compute index select
+constraint inner session_user
+contains insert set
+containstable intersect setuser
+continue into shutdown
+convert is some
+create join statistics
+cross key system_user
+current kill table
+current_date left textsize
+current_time like then
+current_timestamp lineno to
+current_user load top
+cursor national tran
+database nocheck transaction
+dbcc nonclustered trigger
+deallocate not truncate
+declare null tsequal
+default nullif union
+delete of unique
+deny off update
+desc offsets updatetext
+disk on use
+distinct open user
+distributed opendatasource values
+double openquery varying
+drop openrowset view
+dummy openxml waitfor
+dump option when
+else or where
+end order while
+errlvl outer with
+escape over writetext
+
+$KEYWORDS(kwb)= boolean char character date float integer long mlslabel number raw rowid varchar varchar2 varray
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=--
+
+$ML_COMMENT=/* */
+
+$IGNORECASE=true
+
+#$ESCCHAR=
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
diff --git a/support/highlight/langDefs/sybase.lang b/support/highlight/langDefs/sybase.lang
new file mode 100644
index 0000000000..0ce240f0ba
--- /dev/null
+++ b/support/highlight/langDefs/sybase.lang
@@ -0,0 +1,116 @@
+# SYBASE SQL language definition file
+#
+# Author: André Simon
+# Mail: andre.simon1@gmxde
+# Date: 28.06.20.03
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL
+#
+# The file is used to describe keywords and special symbols of programming languages
+# See README in the highlight directory for details
+#
+# New definition files for future releases of highlight are always appreciated ;)
+# ----------
+# andre.simon1@gmxde
+# http:/wwws.andre-simon.deu/
+
+$DESCRIPTION=Sybase SQL
+
+$keywords=abs acos ascii asin atan atn2 avg ceiling char charindex char_length
+coalesce col_length col_name convert cos cot count curunreservedpgs data_pgs
+datalength dateadd datediff datename datepart db_id db_name degrees difference
+exp floor getdate host_id host_name index_col isnull is_sec_service_on
+lct_admin log log10 lower ltrim max min mut_excl_roles object_id object_name
+patindex pi power proc_role ptn_data_pgs radians rand replicate reserved_pgs
+reverse right role_contain role_id role_name round rowcnt rtrim show_role
+show_sec_services sign sin soundex space sqrt str stuff substring sum suser_id
+suser_name tan textptr textvalid tsequal upper used_pgs user user_id user_name
+valid_name valid_user activation add all alter and any arith_overflow as asc at
+authorization avg begin between break browse bulk by cascade char_convert check
+checkpoint close clustered commit compute confirm connect constraint consumers
+continue controlrow convert count create current cursor database dbcc
+deallocate declare default delete desc disk distinct double drop dummy dump
+else end endtran errlvl errordata errorexit escape except exclusive exec
+execute exists exit external fetch fillfactor for foreign from goto grant group
+having holdlock identity_insert identity_start if in index insert intersect
+into is isolation key kill level like lineno load max max_rows_per_page
+membership min mirror mirrorexit national noholdlock nonclustered not null
+numeric_transaction of off offsets on once online only open option or order
+over partition passwd perm permanent plan precision prepare primary print
+privileges proc procedure processexit proxy public raiserror read readtext
+reconfigure references replace return revoke role rollback rowcount rows rule
+save schema select session set setuser shared shutdown some statistics stripe
+sum syb_identity syb_restree table temp temporary textsize to tran transaction
+trigger truncate tsequal union unique unpartition update use user user_option
+using values varying view waitfor where while with work writetext absolute
+action allocate are assertion bit bit_length both cascaded case cast catalog
+char char_length character character_length coalesce collate collation column
+connection constraints corresponding cross current_date current_time
+current_timestamp current_user date day dec decimal deferrable deferred
+describe descriptor diagnostics disconnect domain exception extract
+false first float found full get global go hour immediate indicator initially
+inner input insensitive int integer interval join language last leading left
+local lower match minute module month names natural nchar next no nullif
+numeric octet_length outer output overlaps pad partial position preserve prior
+real relative restrict right scroll second section session_user size smallint
+space sql sqlcode sqlerror sqlstate substring system_user then time timestamp
+timezone_hour timezone_minute trailing translate translation trim true unknown
+upper usage value varchar varbinary when whenever write year zone after alias
+async before boolean breadth call completion cycle data depth dictionary each
+elseif equals general ignore leave less limit loop modify new none object oid
+old operation operators others parameters pendant preorder private protected
+recursive ref referencing resignal return returns routine row savepoint search
+sensitive sequence signal similar sqlexception structure test there type under
+variable virtual visible wait without
+
+$KEYWORDS(kwb)=sp_activeroles sp_addalias sp_addauditrecord sp_addaudittable
+sp_addextendedproc sp_addexternlogin sp_addgroup sp_addlanguage sp_addlogin
+sp_addmessage sp_addobjectdef sp_addremotelogin sp_add_resource_limit
+sp_addsegment sp_addserver sp_addthreshold sp_add_time_range sp_addtype
+sp_addumpdevice sp_adduser sp_altermessage sp_autoconnect sp_bindcache
+sp_bindefault sp_bindmsg sp_bindrule sp_cacheconfig sp_cachestrategy
+sp_changedbowner sp_changegroup sp_checknames sp_checkreswords sp_checksource
+sp_chgattribute sp_clearstats sp_commonkey sp_countmetadata sp_cursorinfo
+sp_column_privileges sp_columns sp_configure sp_databases sp_datatype_info
+sp_dbcc_alterws sp_dbcc_configreport sp_dbcc_createws sp_dbcc_deletedb
+sp_dbcc_deletehistory sp_dbcc_differentialreport sp_dbcc_evaluatedb
+sp_dbcc_faultreport sp_dbcc_fullreport sp_dbcc_runcheck
+sp_dbcc_statisticsreport sp_dbcc_summaryreport sp_dbcc_updateconfig sp_dboption
+sp_defaultloc sp_depends sp_diskdefault sp_displayaudit sp_displaylevel
+sp_displaylogin sp_displayroles sp_dropalias sp_dropdevice sp_dropexeclass
+sp_dropextendedproc sp_dropexternlogin sp_dropglockpromote sp_dropgroup
+sp_dropkey sp_droplanguage sp_droplogin sp_dropmessage sp_dropobjectdef
+sp_dropremotelogin sp_drop_resource_limit sp_dropsegment sp_dropserver
+sp_dropthreshold sp_drop_time_range sp_droptype sp_dropuser sp_estspace
+sp_extendsegment sp_familylock sp_forceonline_db sp_forceonline_page
+sp_foreignkey sp_freedll sp_getmessage sp_grantlogin sp_help sp_helpartition
+sp_helpcache sp_helpconfig sp_helpconstraint sp_helpdb sp_helpdevice
+sp_helpextendedproc sp_helpexternlogin sp_helpgroup sp_helpindex sp_helpjoins
+sp_helpkey sp_helplanguage sp_helplog sp_helpobjectdef sp_helpremotelogin
+sp_help_resource_limit sp_helprotect sp_helpsegment sp_helpserver sp_helpsort
+sp_helptext sp_helpthreshold sp_helpuser sp_hidetext sp_indsuspect
+sp_listsuspect_db sp_listsuspect_page sp_lock sp_locklogin sp_logdevice
+sp_loginconfig sp_logininfo sp_logiosize sp_modifylogin
+sp_modify_resource_limit sp_modify_time_range sp_modifythreshold sp_monitor
+sp_monitorconfig sp_passthru sp_password sp_placeobject sp_plan_dbccdb
+sp_primarykey sp_processmail sp_procqmode sp_procxmode sp_recompile
+sp_remoteoption sp_remotesql sp_rename sp_renamedb sp_reportstats
+sp_revokelogin sp_role sp_serveroption sp_setlangalias sp_setpglockpromote
+sp_setpglockpromote sp_setsuspect_granularity sp_setsuspect_threshold
+sp_spaceused sp_syntax sp_sysmon sp_sysmon sp_sysmon sp_unbindcache
+sp_unbindcache_all sp_unbindefault sp_unbindmsg sp_unbindrule sp_volchanged
+sp_who sp_fkeys sp_server_info sp_special_columns sp_sproc_columns
+sp_statistics sp_stored_procedures sp_table_privileges sp_tables xp_cmdshell
+xp_deletemail xp_enumgroups xp_findnextmsg xp_logevent xp_readmail xp_sendmail
+xp_startmail xp_stopmail
+
+$STRINGDELIMITERS="
+
+$SL_COMMENT=--
+
+$ML_COMMENT=/* */
+
+$IGNORECASE=true
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
+
diff --git a/support/highlight/langDefs/tcl.lang b/support/highlight/langDefs/tcl.lang
new file mode 100644
index 0000000000..eea950d61a
--- /dev/null
+++ b/support/highlight/langDefs/tcl.lang
@@ -0,0 +1,43 @@
+# Tcl/Tk language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 16.08.2002
+# Update: 08.10.2008
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Tcl/Tk
+
+$KEYWORDS(kwa)=Safe Base encoding if pid switch Tcl eof incr pkg::create tcl_endOfWord after error info pkg_mkIndex tcl_findLibrary append eval interp proc
+tcl_startOfNextWord array exec join puts tcl_startOfPreviousWord auto_execok exit lappend pwd tcl_wordBreakAfter auto_import expr lindex re_syntax tcl_wordBreakBefore auto_load fblocked linsert read tcltest
+auto_mkindex fconfigure list regexp tclvars auto_mkindex_old fcopy llength registry tell auto_qualify file load regsub time auto_reset fileevent lrange rename trace bgerror filename lreplace resource unknown
+binary flush lsearch return unset break for lset scan update catch foreach lsort seek uplevel cd format memory set upvar clock gets msgcat socket
+variable close glob namespace source vwait concat global open split while continue history package string dde http parray subst bell entry loadTk raise tk_focusFollowsMouse tk_textPaste bind event lower
+scale tk_focusNext tkerror bindtags focus menu scrollbar tk_focusPrev tkvars bitmap font menubutton selection tk_getOpenFile tkwait button frame message
+send tk_getSaveFile toplevel canvas grab option spinbox tk_menuSetFocus winfo checkbutton grid options text tk_messageBox wm clipboard image pack tk tk_optionMenu colors keysyms panedwindow tk_bisque tk_popup
+console label photo tk_chooseColor tk_setPalette cursors labelframe place tk_chooseDirectory tk_textCopy destroy listbox radiobutton tk_dialog tk_textCut default else challenge success failure
+
+$KEYWORDS(kwb)=regex(\$\w*)
+$KEYWORDS(kwc)=regex(\W(-\w+))
+$KEYWORDS(kwd)=regex(::(\w+))
+
+$STRINGDELIMITERS="
+
+$SL_COMMENT=#
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + - \ @
+
diff --git a/support/highlight/langDefs/tcsh.lang b/support/highlight/langDefs/tcsh.lang
new file mode 100644
index 0000000000..ed161d2a01
--- /dev/null
+++ b/support/highlight/langDefs/tcsh.lang
@@ -0,0 +1,46 @@
+# Tcsh script language definition file
+#
+# Author: Igor Furlan
+# Mail: igor.furlan1@gmail.com
+# Date: 19.8.2005
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=TCSH
+
+$IDENTIFIER=regex([a-zA-Z_\@][\w\-]*)
+
+$KEYWORDS(kwa)= return if endif then else switch endsw while end foreach do done
+
+# built in commands
+$KEYWORDS(kwa)=alias bg break breaksw case chdir continue default echo
+eval exec exit fg goto glob hashstat history jobs kill limit login logout
+nohup notify nice onintr popd pushd printenv read rehash repeat set setenv
+shift source suspend time umask unalias unhash unlimit unset unsetenv wait
+alloc bindkey builtins complete echotc filetest hup log sched settc setty
+stop telltc uncomplete where which dirs ls-F @
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=#
+
+$IGNORECASE=false
+
+$KEYWORDS(kwb)=regex(\$\w+)
+
+$KEYWORDS(kwc)=regex((\$\{\w+\}))
+
+$KEYWORDS(kwd)=regex(\`.*(cd|ls|ll|mkdir|rm|file).*\`)
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
diff --git a/support/highlight/langDefs/test_re.lang b/support/highlight/langDefs/test_re.lang
new file mode 100644
index 0000000000..47e92d5132
--- /dev/null
+++ b/support/highlight/langDefs/test_re.lang
@@ -0,0 +1,56 @@
+# Some regex tests
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Regex tests
+
+$KEYWORDS(kwa)=goto break return continue asm case default if else switch while for do sizeof
+
+#Identifiers beginning with capital
+#$KEYWORDS(kwa)=regex([A-Z]\w+)
+
+# Method names
+#$KEYWORDS(kwc)=regex((\w+)\(\w*\))
+
+#script variables beginning with $
+#$KEYWORDS(kwd)=regex(\$\w+)
+
+#script variables beginning with $, enclosing name in {}
+#$KEYWORDS(kwe)=regex((\$\{\w+\}))
+
+# tags
+#$TAG_RE(kwe)=regex(\<.*\>)
+
+# prompt input
+$KEYWORDS(kwd)=regex(^\:.*)
+
+#$STRINGDELIMITERS=" '
+#$STRINGDELIMITERS=regex(["'])
+
+#$SL_COMMENT=//
+#$SL_COMMENT=regex(//.*$)
+
+# Comment beginning in coloumn 1
+#$SL_COMMENT=regex(^#.*)
+#$SL_COMMENT=regex(^COM\s.*)
+
+$ML_COMMENT=COMMENT END
+
+#$SL_COMMENT=COM
+
+#$ML_COMMENT=/* */
+#Geht nicht weil re nicht mehrzeilig
+#$ML_COMMENT=regex(\".*\")
+
+$ALLOWNESTEDCOMMENTS=false
+
+#$IGNORECASE=false
+
+#$DIRECTIVE=#
+# Pascal directive:
+#$DIRECTIVE=regex(\{\$.*\})
+
+#$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+#$ESCCHAR=regex(\\.)
diff --git a/support/highlight/langDefs/tex.lang b/support/highlight/langDefs/tex.lang
new file mode 100644
index 0000000000..705eae13f7
--- /dev/null
+++ b/support/highlight/langDefs/tex.lang
@@ -0,0 +1,45 @@
+# TeX/LaTeX language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 02.03.2003
+# 01.09.2009: Added nested directive
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=TeX and LaTeX
+
+$KEYWORDS(kwa)=regex(\\\w+)
+
+$KEYWORDS(kwb)= a4paper report ngerman dvips graphicx latin1 inputenc T1 fontenc
+color alltt document tabbing tocdepth
+
+$KEYWORDS(kwc)=regex(\#\d+)
+
+$SL_COMMENT=regex((?<!\\)%.*$, 0)
+
+$ML_COMMENT=(* *)
+
+$IGNORECASE=false
+
+$SYMBOLS={ } [ ]
+
+# PerlTeX delimiters
+# Issue: } is also a Perl symbol
+$NESTED(pl)=regex(\\perl(?:re)?newcommand\{\\\w+\}\[.*\]\{) regex(\}) regex(\{)
+$NESTED(pl)=regex(\\perl(?:re)?newenvironment\{\w+\}\[.*\]\{) regex(\}) regex(\{)
+
+# LuaTeX delimiters
+# Issue: } is also a Lua symbol
+$NESTED(inc_luatex)=regex(\\directlua0?.*?\{) regex((?<!\{)\})
+
+# Sweave delimiters
+$NESTED(r)=regex(\<\<.*\>\>\=) regex(@)
diff --git a/support/highlight/langDefs/ttcn3.lang b/support/highlight/langDefs/ttcn3.lang
new file mode 100644
index 0000000000..aaa726e8e8
--- /dev/null
+++ b/support/highlight/langDefs/ttcn3.lang
@@ -0,0 +1,45 @@
+# TTCN-3 language definition file
+#
+# Author: Peter Biechele, intaris GmbH, Germany
+# Date: 1.9.2005
+# ------------------------------------------
+
+$DESCRIPTION=TTCN3
+
+$KEYWORDS(kwa)=if else while for do return log
+testcase runs on module repeat stop function
+template import from
+alt trigger send match timeout
+setverdict getverdict
+true false
+not and or mod not4b and4b or4b xor4b
+start stop running read
+none pass fail error inconc
+
+$KEYWORDS(kwb)=boolean byte char integer float double timer record
+unsignedbyte unsignedchar unsignedshort unsignedlong
+short long charstring component
+
+$KEYWORDS(kwc)=type const var
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=//
+
+$ML_COMMENT=/* */
+
+$ALLOWNESTEDCOMMENTS=false
+
+$IGNORECASE=false
+
+$DIRECTIVE=#
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; . : & | < > ! = / * % + - ~
+
+$CONTINUATIONSYMBOL=\
+
+$REFORMATTING=true
diff --git a/support/highlight/langDefs/txt.lang b/support/highlight/langDefs/txt.lang
new file mode 100644
index 0000000000..0c779485b2
--- /dev/null
+++ b/support/highlight/langDefs/txt.lang
@@ -0,0 +1,22 @@
+# Plain Text definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 25.05.03
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+#
+# This file contains no keywords, it causes highlight to convert plain text to the given output format
+
+$DESCRIPTION=Plain text
+
+$DISABLEHIGHLIGHTING=true
diff --git a/support/highlight/langDefs/vala.lang b/support/highlight/langDefs/vala.lang
new file mode 100644
index 0000000000..67638b7fc1
--- /dev/null
+++ b/support/highlight/langDefs/vala.lang
@@ -0,0 +1,56 @@
+# Vala language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 14.10.2008
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Vala
+
+$KEYWORDS(kwa)=if else
+switch case default
+break continue return
+for foreach in
+do while try catch finally throw
+
+$KEYWORDS(kwb)= namespace interface class struct enum signal
+construct callback get set base
+const static var weak
+virtual abstract override
+public protected private
+in out ref lock using
+abstract dynamic extern internal readonly sealed volatile
+
+$KEYWORDS(kwc)=true false null bool byte char decimal double float int int8
+int16 int32 int64 long object sbyte short string uchar uint uint8 uint16 uint32
+uint64 ulong ushort void
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=//
+
+$ML_COMMENT=/* */
+
+$ALLOWNESTEDCOMMENTS=false
+
+$IGNORECASE=false
+
+$DIRECTIVE=#
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; . : & | < > ! = / * % + - ~
+
+$REFORMATTING=false
diff --git a/support/highlight/langDefs/vb.lang b/support/highlight/langDefs/vb.lang
new file mode 100644
index 0000000000..9fc3ba446b
--- /dev/null
+++ b/support/highlight/langDefs/vb.lang
@@ -0,0 +1,42 @@
+# Visual Basic language definition file
+#
+# Author: Andr� Simon
+# Mail: andre.simon1@gmx.de
+# Date: 29.7.2002
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Visual Basic
+
+$KEYWORDS(KWA)=and as begin case call continue do each else elseif end erase
+error event exit false for function get gosub goto if implement in load loop
+lset me mid new next not nothing on or property raiseevent resume return rset
+select set stop sub then to true unload until wend while with withevents
+attribute alias as byref byval compare declare explicit friend global let
+lib module object option optional preserve private property public redim type
+dim const
+
+$KEYWORDS(kwb)=boolean byte currency date decimal double enum integer long
+single static string variant
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS="
+
+#$KW_PREFIX(kwb)=$
+$KEYWORDS(kwb)=regex(\$\S+)
+
+$SL_COMMENT=' rem REM Rem
+
+$IGNORECASE=true
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + - .
diff --git a/support/highlight/langDefs/verilog.lang b/support/highlight/langDefs/verilog.lang
new file mode 100644
index 0000000000..4954ab5938
--- /dev/null
+++ b/support/highlight/langDefs/verilog.lang
@@ -0,0 +1,48 @@
+# Verilog language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 13.04.2004
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Verilog
+
+$KEYWORDS(kwa)=always and assign attribute begin buf bufif0 bufif1 case casex casez cmos deassign default defparam disable edge else end endattribute
+endcase endmodule endfunction endprimitive endspecify endtable endtask event for force forever fork function highz0 highz1 if initial
+inout input integer join large macromodule medium module nand negedge nmos nor not notif0 notif1 or output parameter pmos posedge
+primitive pull0 pull1 pullup pulldown rcmos reg release repeat rnmos rpmos rtran rtranif0 rtranif1 scalared small specify specparam
+strength strong0 strong1 supply0 supply1 table task time tran tranif0 tranif1 tri tri0 tri1 triand trior trireg use vectored wait wand
+weak0 weak1 while wire wor xnor xor
+
+#$KW_PREFIX(kwb)=$
+$KEYWORDS(kwb)=regex(\$\w+)
+
+$KEYWORDS(kwc)=regex(#\d+)
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=//
+
+$ML_COMMENT=/* */
+
+$ALLOWNESTEDCOMMENTS=false
+
+$IGNORECASE=false
+
+$DIRECTIVE=`
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + - ~
diff --git a/support/highlight/langDefs/vhd.lang b/support/highlight/langDefs/vhd.lang
new file mode 100644
index 0000000000..6a868f22b3
--- /dev/null
+++ b/support/highlight/langDefs/vhd.lang
@@ -0,0 +1,59 @@
+# VHDL language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 28.06.2003
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=VHDL
+
+$KEYWORDS(kwa)=abs access after all and architecture array assert attribute begin block body buffer bus
+case component configuration disconnect downto else elsif end entity exit file for function
+generate generic group guarded if impure in inertial inout is label library linkage literal loop
+map mod nand new next nor not null of on open or others out package port postponed procedure
+process pure range record register reject rem report return rol ror select severity shared sla sll
+sra srl then to transport unaffected units until use wait when while with xnor xor ActivPullUp
+AndN And2FF AndNFF Cnt1Bit CntNBit CntNBitDown CntNBitMod CntNBitOe CntNBitSLd CntNBitSR
+CntNBitUpDown CompNBit CompNBitFF DiffH2LWithFF DiffL2HWithFF Dff1 Dff1NegClk Dffn Encode4to5
+Mux1of2 Mux1of8 Mux1Vof2V Mux1Vof3V Mux1Vof4V PreScale1Bit PreScale1BitAR PreScale1BitARNegClk
+PreScaleNBit PreScaleNBitAR Reg1Bit Reg1BitAR Reg1BitR RegNBit RegNBitAR RSFFAsync RSFFsync
+RsSynchronizer ShiftP2SRegNBitAR ShiftRegNBitAR ShiftS2SRegNBit SRFFsync SyncAndDiffL2HWithFF
+SyncAndDiffH2LWithFF SyncAndDiffL2HWithFFAndFg SyncAndDiffH2LWithFFAndFg SyncAndDiffLL2HHWithFF
+SyncAndDiffHH2LLWithFF SyncAndDiffLL2HHWithFFAndFg SyncAndDiffHH2LLWithFFAndFg ActivPullUp_arch
+AndN_arch And2FF_arch AndNFF_arch Cnt1Bit_arch CntNBit_arch CntNBitDown_arch CntNBitMod_arch
+CntNBitOe_arch CntNBitSLd_arch CntNBitSR_arch CntNBitUpDown_arch CompNBit_arch CompNBitFF_arch
+DiffH2LWithFF_arch DiffL2HWithFF_arch Dff1_arch Dff1NegClk_arch Dffn_arch Encode4to5_arch
+Mux1of2_arch Mux1of8_arch Mux1Vof2V_arch Mux1Vof3V_arch Mux1Vof4V_arch PreScale1Bit_arch
+PreScale1BitAR_arch PreScale1BitARNegClk_arch PreScaleNBit_arch PreScaleNBitAR_arch Reg1Bit_arch
+Reg1BitAR_arch Reg1BitR_arch RegNBit_arch RegNBitAR_arch RSFFAsync_arch RSFFsync_arch
+RsSynchronizer_arch ShiftP2SRegNBitAR_arch ShiftRegNBitAR_arch ShiftS2SRegNBit_arch SRFFsync_arch
+SyncAndDiffL2HWithFF_arch SyncAndDiffH2LWithFF_arch SyncAndDiffL2HWithFFAndFg_arch
+SyncAndDiffH2LWithFFAndFg_arch SyncAndDiffLL2HHWithFF_arch SyncAndDiffHH2LLWithFF_arch
+SyncAndDiffLL2HHWithFFAndFg_arch SyncAndDiffHH2LLWithFFAndFg_arch
+
+$KEYWORDS(kwb)=bit bit_vector boolean integer real std_logic std_logic_vector time character string
+
+$KEYWORDS(kwc)=alias constant type variable signal subtype
+
+# VHDL Workaround: distinguish string delimiters and event markers
+# (same eymbol: ')
+#$KEYWORDS(kwd)=regex(\w+('\w+))
+$KEYWORDS(kwd)=regex([\w\(\)]+('\w+))
+
+$STRINGDELIMITERS='
+
+$SL_COMMENT=--
+
+$IGNORECASE=true
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
diff --git a/support/highlight/langDefs/xml.lang b/support/highlight/langDefs/xml.lang
new file mode 100644
index 0000000000..ced4d44b22
--- /dev/null
+++ b/support/highlight/langDefs/xml.lang
@@ -0,0 +1,27 @@
+# XML language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 02.03.2003
+# Update: 06.01.2009
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=XML
+
+#$KEYWORDS(kwa)=regex(<!?\/?\??[\w\:\-]+>?|\??/?>)
+$KEYWORDS(kwa)=regex(<!?(?!\-\-)\/?\??[\w\:\-]+>?|\??/?>, 0)
+
+$KEYWORDS(kwb)=regex(([-\w]+)=")
+$KEYWORDS(kwd)=regex(\&\#?\w+;)
+$STRINGDELIMITERS="
+$ML_COMMENT= <!-- -->
+$IGNORECASE=true \ No newline at end of file
diff --git a/support/highlight/langDefs/xpp.lang b/support/highlight/langDefs/xpp.lang
new file mode 100644
index 0000000000..a34f502a57
--- /dev/null
+++ b/support/highlight/langDefs/xpp.lang
@@ -0,0 +1,35 @@
+# Superx++ language definition file *PROPOSAL*
+#
+# Author: André Simon
+# Mail: andre.simon1@gmx.de
+# Date: 08.11.2003
+# 28.01.2008 Replaced KW_DELIM entry by regexes (ASim)
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=SuperX++
+
+#$TAG_DELIM(kwa)=< >
+$KEYWORDS(kwa)=regex(<!?\/?\w+>?|>)
+$KEYWORDS(kwb)=regex(([-\w]+)=")
+$KEYWORDS(kwc)=regex(\&\#?\w+;)
+
+$KEYWORDS(kwd)=bool date double float int long short string void
+
+$STRINGDELIMITERS="
+
+$ML_COMMENT= <!-- -->
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$IGNORECASE=false
+
+$ENABLETYPESWITHINSTRINGS=true
diff --git a/support/highlight/langDefs/y.lang b/support/highlight/langDefs/y.lang
new file mode 100644
index 0000000000..c629e10601
--- /dev/null
+++ b/support/highlight/langDefs/y.lang
@@ -0,0 +1,53 @@
+# BISON language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 15.04.2004
+# Update: 11.09.2008
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Bison
+
+$KEYWORDS(kwa)=error YYABORT YYACCEPT YYBACKUP YYERROR YYERROR_VERBOSE YYINITDEPTH YYLEX_PARAM
+YYLTYPE yyltype YYMAXDEPTH YYPARSE_PARAM YYRECOVERING YYSTACK_USE_ALLOCA YYSTYPE
+yychar yyclearin yydebug yyerrok yyerror yylex yylval yylloc yynerrs yyparse
+
+
+$KEYWORDS(kwb)=int long short char void signed unsigned float double size_t wchar_t
+ptrdiff_t sig_atomic_t fpos_t clock_t time_t va_list jmp_buf FILE DIR div_t ldiv_t static
+const bool struct union enum size_t wchar_t ptrdiff_t sig_atomic_t fpos_t clock_t time_t
+va_list jmp_buf FILE DIR div_t ldiv_t mbstate_t wctrans_t wint_t wctype_t bool complex
+int8_t int16_t int32_t int64_t uint8_t uint16_t uint32_t uint64_t int_least8_t int_least16_t
+int_least32_t int_least64_t uint_least8_t uint_least16_t uint_least32_t uint_least64_t
+int_fast8_t int_fast16_t int_fast32_t int_fast64_t uint_fast8_t uint_fast16_t uint_fast32_t
+uint_fast64_t intptr_t uintptr_t intmax_t uintmax_t string
+
+$KEYWORDS(kwb)=regex(\$[\w\$]+)
+
+#$KW_PREFIX(kwc)=%
+$KEYWORDS(kwc)=regex(%\S+)
+
+$KEYWORDS(kwd)=regex(^\w+:)
+
+$STRINGDELIMITERS=" '
+
+$ESCCHAR=regex(\\[ntvbrfa\\\?'"])
+
+$DIRECTIVE=#
+
+$ML_COMMENT=/* */
+$SL_COMMENT=//
+
+$IGNORECASE=false
+
+$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * + -
diff --git a/support/highlight/langDefs/yaiff.lang b/support/highlight/langDefs/yaiff.lang
new file mode 100644
index 0000000000..a518cbd97e
--- /dev/null
+++ b/support/highlight/langDefs/yaiff.lang
@@ -0,0 +1,36 @@
+# Yaiff language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 04.01.2010
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Yaiff
+
+$KEYWORDS(kwa)=def final class public private interface else if const return
+
+$KEYWORDS(kwb)=UInt8 Int8
+
+$KEYWORDS(kwc)=regex(@\w+)
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$SL_COMMENT=regex(#(?!#).*)
+
+$ML_COMMENT_EQUAL=##
+
+$IGNORECASE=false
+
+$SYMBOLS= ( ) [ ] { } , ; . : & | < > ! = / * % + - ~ ? \ No newline at end of file
diff --git a/support/highlight/langDefs/znn.lang b/support/highlight/langDefs/znn.lang
new file mode 100644
index 0000000000..e47b8a7408
--- /dev/null
+++ b/support/highlight/langDefs/znn.lang
@@ -0,0 +1,47 @@
+# Zonnon language definition file
+#
+# Author: Andre Simon
+# Mail: andre.simon1@gmx.de
+# Date: 24.7.2002
+# updated 12.1.04 to add more types (ansi c, iso 99)
+# ------------------------------------------
+# This file is a part of highlight, a free source code converter released under the GPL.
+#
+# The file is used to describe keywords and special symbols of programming languages.
+# See README in the highlight directory for details.
+#
+# New definition files for future releases of highlight are always appreciated ;)
+#
+# ----------
+# andre.simon1@gmx.de
+# http:/www.andre-simon.de/
+
+$DESCRIPTION=Zonnon
+
+$KEYWORDS(kwa)=accept activity array as await begin by case const definition div
+do else elsif end exception exit false for if
+implementation implements import in is loop mod module new nil object of on operator
+or procedure
+protocol record refines repeat return self termination then to true type until var while
+ACCEPT ACTIVITY ARRAY AS AWAIT BEGIN BY CASE CONST DEFINITION DIV DO ELSE ELSIF END
+EXCEPTION EXIT FALSE FOR IF IMPLEMENTATION IMPLEMENTS IMPORT IN IS LOOP MOD MODULE
+NEW NIL OBJECT OF ON OPERATOR OR PROCEDURE PROTOCOL RECORD REFINES REPEAT RETURN
+SELF TERMINATION THEN TO TRUE TYPE UNTIL VAR WHILE
+
+$KEYWORDS(kwb)=object boolean char integer cardinal fixed real set string
+
+$KEYWORDS(kwc)=
+
+$KEYWORDS(kwd)=regex((\w+)\s*\()
+
+$STRINGDELIMITERS=" '
+
+$ML_COMMENT=(* *)
+
+$ALLOWNESTEDCOMMENTS=true
+
+$IGNORECASE=false
+
+$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])
+
+$SYMBOLS= ( ) [ ] { } , ; . : & | < > ! = / * % + - ~
diff --git a/support/highlight/makefile b/support/highlight/makefile
new file mode 100644
index 0000000000..7961a076c2
--- /dev/null
+++ b/support/highlight/makefile
@@ -0,0 +1,161 @@
+# Installation script for highlight.
+# See INSTALL for details.
+# IMPORTANT: Update highlight.spec file after changing paths!
+
+# Installation directories:
+
+# Destination directory for installation (intended for packagers)
+DESTDIR =
+
+# Root directory for final installation
+PREFIX = /usr
+
+# Location of the highlight data files:
+data_dir = ${PREFIX}/share/highlight/
+
+# Location of the highlight binary:
+bin_dir = ${PREFIX}/bin/
+
+# Location of the highlight man page:
+man_dir = ${PREFIX}/share/man/man1/
+
+# Location of the highlight documentation:
+doc_dir = ${PREFIX}/share/doc/highlight/
+
+# Location of the highlight examples:
+examples_dir = ${doc_dir}examples/
+
+# Location of the highlight config files:
+conf_dir = /etc/highlight/
+#conf_dir = ${PREFIX}/etc/highlight/
+
+# Location of additional gui files
+desktop_apps = ${PREFIX}/share/applications/
+desktop_pixmaps = ${PREFIX}/share/pixmaps/
+
+# Commands:
+INSTALL_DATA=install -m644
+INSTALL_PROGRAM=install -m755
+MKDIR=mkdir -p -m 755
+RMDIR=rm -r -f
+
+all cli:
+ ${MAKE} -C ./src -f ./makefile HL_DATA_DIR=${data_dir} HL_CONFIG_DIR=${conf_dir}
+
+lib lib-static:
+ ${MAKE} -C ./src -f ./makefile HL_DATA_DIR=${data_dir} HL_CONFIG_DIR=${conf_dir} lib-static
+
+lib-shared:
+ ${MAKE} -C ./src -f ./makefile HL_DATA_DIR=${data_dir} HL_CONFIG_DIR=${conf_dir} PIC=1 lib-shared
+
+gui:
+ ${MAKE} -C ./src -f ./makefile HL_DATA_DIR=\"${data_dir}\" HL_CONFIG_DIR=\"${conf_dir}\" HL_DOC_DIR=\"${doc_dir}\" gui-qt
+ @echo
+ @echo "You need to run 'make install' AND 'make install-gui' now!"
+
+install:
+ @echo "This script will install highlight in the following directories:"
+ @echo "Data directory: ${DESTDIR}${data_dir}"
+ @echo "Documentation directory: ${DESTDIR}${doc_dir}"
+ @echo "Examples directory: ${DESTDIR}${examples_dir}"
+ @echo "Manual directory: ${DESTDIR}${man_dir}"
+ @echo "Binary directory: ${DESTDIR}${bin_dir}"
+ @echo "Configuration directory: ${DESTDIR}${conf_dir}"
+ @echo
+
+ ${MKDIR} ${DESTDIR}${doc_dir}
+ ${MKDIR} ${DESTDIR}${conf_dir}
+ ${MKDIR} ${DESTDIR}${examples_dir} \
+ ${DESTDIR}${examples_dir}plugins \
+ ${DESTDIR}${examples_dir}plugins/dokuwiki \
+ ${DESTDIR}${examples_dir}plugins/movabletype \
+ ${DESTDIR}${examples_dir}plugins/wordpress \
+ ${DESTDIR}${examples_dir}swig
+ ${MKDIR} ${DESTDIR}${data_dir} \
+ ${DESTDIR}${data_dir}themes \
+ ${DESTDIR}${data_dir}langDefs
+ ${MKDIR} ${DESTDIR}${man_dir}
+ ${MKDIR} ${DESTDIR}${bin_dir}
+
+ ${INSTALL_DATA} ./langDefs/*.lang ${DESTDIR}${data_dir}langDefs/
+ ${INSTALL_DATA} ./*.conf ${DESTDIR}${conf_dir}
+ ${INSTALL_DATA} ./themes/*.style ${DESTDIR}${data_dir}themes/
+ ${INSTALL_DATA} ./man/highlight.1.gz ${DESTDIR}${man_dir}
+ ${INSTALL_DATA} ./AUTHORS ${DESTDIR}${doc_dir}
+ ${INSTALL_DATA} ./README ${DESTDIR}${doc_dir}
+ ${INSTALL_DATA} ./README_DE ${DESTDIR}${doc_dir}
+ ${INSTALL_DATA} ./README_REGEX ${DESTDIR}${doc_dir}
+ ${INSTALL_DATA} ./README_LANGLIST ${DESTDIR}${doc_dir}
+ ${INSTALL_DATA} ./ChangeLog ${DESTDIR}${doc_dir}
+ ${INSTALL_DATA} ./COPYING ${DESTDIR}${doc_dir}
+ ${INSTALL_DATA} ./INSTALL ${DESTDIR}${doc_dir}
+ ${INSTALL_DATA} ./examples/plugins/dokuwiki/* ${DESTDIR}${examples_dir}plugins/dokuwiki/
+ ${INSTALL_DATA} ./examples/plugins/movabletype/* ${DESTDIR}${examples_dir}plugins/movabletype/
+ ${INSTALL_DATA} ./examples/plugins/wordpress/* ${DESTDIR}${examples_dir}plugins/wordpress/
+ ${INSTALL_DATA} ./examples/swig/*.py ./examples/swig/*.pl ${DESTDIR}${examples_dir}swig
+ ${INSTALL_DATA} ./examples/swig/*.i ./examples/swig/makefile ${DESTDIR}${examples_dir}swig
+ ${INSTALL_DATA} ./examples/swig/README_SWIG ${DESTDIR}${doc_dir}
+ ${INSTALL_DATA} ./examples/highlight_pipe.* ${DESTDIR}${examples_dir}
+ ${INSTALL_PROGRAM} ./src/highlight ${DESTDIR}${bin_dir}
+
+ @echo
+ @echo "Done."
+ @echo "Type highlight --help or man highlight for instructions."
+ @echo "Take a look at ${DESTDIR}${examples_dir} for plugins and SWIG language bindings."
+ @echo "Execute 'make install-gui' to install the highlight GUI ('make gui')."
+ @echo "Do not hesitate to report problems. Unknown bugs are hard to fix."
+
+install-gui:
+ @echo "Installing files for the GUI..."
+ ${MKDIR} ${DESTDIR}${data_dir} \
+ ${DESTDIR}${data_dir}gui_files \
+ ${DESTDIR}${data_dir}gui_files/ext \
+ ${DESTDIR}${data_dir}gui_files/l10n \
+ ${DESTDIR}${desktop_apps} \
+ ${DESTDIR}${desktop_pixmaps}
+
+ ${INSTALL_DATA} ./gui_files/l10n/* ${DESTDIR}${data_dir}gui_files/l10n/
+ ${INSTALL_DATA} ./gui_files/ext/* ${DESTDIR}${data_dir}gui_files/ext/
+ ${INSTALL_DATA} ./highlight.desktop ${DESTDIR}${desktop_apps}
+ ${INSTALL_DATA} ./src/gui-qt/highlight.xpm ${DESTDIR}${desktop_pixmaps}
+ ${INSTALL_PROGRAM} ./src/highlight-gui ${DESTDIR}${bin_dir}
+
+uninstall:
+ @echo "Removing highlight files from system..."
+ ${RMDIR} ${DESTDIR}${data_dir}
+ ${RMDIR} ${DESTDIR}${doc_dir}
+ ${RMDIR} ${DESTDIR}${conf_dir}
+ ${RMDIR} ${DESTDIR}${examples_dir}
+ rm -rf ${DESTDIR}${man_dir}highlight.1.gz
+ rm -rf ${DESTDIR}${bin_dir}highlight
+ rm -rf ${DESTDIR}${bin_dir}highlight-gui
+ rm -rf ${DESTDIR}${desktop_apps}highlight.desktop
+ rm -rf ${DESTDIR}${desktop_pixmaps}highlight.xpm
+ @echo "Done."
+
+clean cleanall:
+ $(MAKE) -C ./src -f ./makefile clean
+
+apidocs:
+ doxygen Doxyfile
+
+help:
+ @echo "This makefile offers the following options:"
+ @echo
+ @echo "(all) Compile the command line interface."
+ @echo "lib-static Compile only the static library."
+ @echo "lib-shared Compile only the shared library."
+ @echo "gui Compile the Qt (4.x) GUI."
+ @echo "install* Copy all data files to ${data_dir}."
+ @echo "install-gui* Copy GUI data files to ${data_dir}."
+ @echo "clean Remove object files and binaries."
+ @echo "apidocs Generate HTML API documentation using doxygen."
+ @echo "uninstall* Remove highlight files from system."
+ @echo
+ @echo "* Command needs root privileges."
+ @echo "See src/makefile for compilation and linking options."
+
+# Target needed for redhat 9.0 rpmbuild
+install-strip:
+
+.PHONY: clean all install apidocs help uninstall install-strip
diff --git a/support/highlight/man/highlight.1.gz b/support/highlight/man/highlight.1.gz
new file mode 100644
index 0000000000..bcb9f68d31
--- /dev/null
+++ b/support/highlight/man/highlight.1.gz
Binary files differ
diff --git a/support/highlight/src/cli/arg_parser.cc b/support/highlight/src/cli/arg_parser.cc
new file mode 100644
index 0000000000..55e440d94f
--- /dev/null
+++ b/support/highlight/src/cli/arg_parser.cc
@@ -0,0 +1,193 @@
+/* Arg_parser - A POSIX/GNU command line argument parser.
+ Copyright (C) 2006, 2007, 2008 Antonio Diaz Diaz.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <cstring>
+#include <string>
+#include <vector>
+
+#include "arg_parser.h"
+
+
+bool Arg_parser::parse_long_option( const char * const opt, const char * const arg,
+ const Option options[], int & argind ) throw()
+ {
+ unsigned int len;
+ int index = -1;
+ bool exact = false, ambig = false;
+
+ for( len = 0; opt[len+2] && opt[len+2] != '='; ++len ) ;
+
+ // Test all long options for either exact match or abbreviated matches.
+ for( int i = 0; options[i].code != 0; ++i )
+ if( options[i].name && !std::strncmp( options[i].name, &opt[2], len ) )
+ {
+ if( std::strlen( options[i].name ) == len ) // Exact match found
+ { index = i; exact = true; break; }
+ else if( index < 0 ) index = i; // First nonexact match found
+ else if( options[index].code != options[i].code ||
+ options[index].has_arg != options[i].has_arg )
+ ambig = true; // Second or later nonexact match found
+ }
+
+ if( ambig && !exact )
+ {
+ _error = "option `"; _error += opt; _error += "' is ambiguous";
+ return false;
+ }
+
+ if( index < 0 ) // nothing found
+ {
+ _error = "unrecognized option `"; _error += opt; _error += '\'';
+ return false;
+ }
+
+ ++argind;
+ data.push_back( Record( options[index].code ) );
+
+ if( opt[len+2] ) // `--<long_option>=<argument>' syntax
+ {
+ if( options[index].has_arg == no )
+ {
+ _error = "option `--"; _error += options[index].name;
+ _error += "' doesn't allow an argument";
+ return false;
+ }
+ if( options[index].has_arg == yes && !opt[len+3] )
+ {
+ _error = "option `--"; _error += options[index].name;
+ _error += "' requires an argument";
+ return false;
+ }
+ data.back().argument = &opt[len+3];
+ return true;
+ }
+
+ if( options[index].has_arg == yes )
+ {
+ if( !arg )
+ {
+ _error = "option `--"; _error += options[index].name;
+ _error += "' requires an argument";
+ return false;
+ }
+ ++argind; data.back().argument = arg;
+ return true;
+ }
+
+ return true;
+ }
+
+
+bool Arg_parser::parse_short_option( const char * const opt, const char * const arg,
+ const Option options[], int & argind ) throw()
+ {
+ int cind = 1; // character index in opt
+
+ while( cind > 0 )
+ {
+ int index = -1;
+ const unsigned char code = opt[cind];
+
+ if( code != 0 )
+ for( int i = 0; options[i].code; ++i )
+ if( code == options[i].code )
+ { index = i; break; }
+
+ if( index < 0 )
+ {
+ _error = "invalid option -- "; _error += code;
+ return false;
+ }
+
+ data.push_back( Record( code ) );
+ if( opt[++cind] == 0 ) { ++argind; cind = 0; } // opt finished
+
+ if( options[index].has_arg != no && cind > 0 && opt[cind] )
+ {
+ data.back().argument = &opt[cind]; ++argind; cind = 0;
+ }
+ else if( options[index].has_arg == yes )
+ {
+ if( !arg || !arg[0] )
+ {
+ _error = "option requires an argument -- "; _error += code;
+ return false;
+ }
+ data.back().argument = arg; ++argind; cind = 0;
+ }
+ }
+ return true;
+ }
+
+
+Arg_parser::Arg_parser( const int argc, const char * const argv[],
+ const Option options[], const bool in_order ) throw()
+ {
+ if( argc < 2 || !argv || !options ) return;
+
+ std::vector< std::string > non_options; // skipped non-options
+ int argind = 1; // index in argv
+
+ while( argind < argc )
+ {
+ const unsigned char ch1 = argv[argind][0];
+ const unsigned char ch2 = ( ch1 ? argv[argind][1] : 0 );
+
+ if( ch1 == '-' && ch2 ) // we found an option
+ {
+ const char * const opt = argv[argind];
+ const char * const arg = (argind + 1 < argc) ? argv[argind+1] : 0;
+ if( ch2 == '-' )
+ {
+ if( !argv[argind][2] ) { ++argind; break; } // we found "--"
+ else if( !parse_long_option( opt, arg, options, argind ) ) break;
+ }
+ else if( !parse_short_option( opt, arg, options, argind ) ) break;
+ }
+ else
+ {
+ if( !in_order ) non_options.push_back( argv[argind++] );
+ else { data.push_back( Record() ); data.back().argument = argv[argind++]; }
+ }
+ }
+ if( _error.size() ) data.clear();
+ else
+ {
+ for( unsigned int i = 0; i < non_options.size(); ++i )
+ { data.push_back( Record() ); data.back().argument.swap( non_options[i] ); }
+ while( argind < argc )
+ { data.push_back( Record() ); data.back().argument = argv[argind++]; }
+ }
+ }
+
+
+Arg_parser::Arg_parser( const char * const opt, const char * const arg,
+ const Option options[] ) throw()
+ {
+ if( !opt || !opt[0] || !options ) return;
+
+ if( opt[0] == '-' && opt[1] ) // we found an option
+ {
+ int argind = 1; // dummy
+ if( opt[1] == '-' )
+ { if( opt[2] ) parse_long_option( opt, arg, options, argind ); }
+ else
+ parse_short_option( opt, arg, options, argind );
+ if( _error.size() ) data.clear();
+ }
+ else { data.push_back( Record() ); data.back().argument = opt; }
+ }
diff --git a/support/highlight/src/cli/arg_parser.h b/support/highlight/src/cli/arg_parser.h
new file mode 100644
index 0000000000..b0e44a8770
--- /dev/null
+++ b/support/highlight/src/cli/arg_parser.h
@@ -0,0 +1,95 @@
+/* Arg_parser - A POSIX/GNU command line argument parser.
+ Copyright (C) 2006, 2007, 2008 Antonio Diaz Diaz.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+/* Arg_parser reads the arguments in `argv' and creates a number of
+ option codes, option arguments and non-option arguments.
+
+ In case of error, `error' returns a non-empty error message.
+
+ `options' is an array of `struct Option' terminated by an element
+ containing a code which is zero. A null name means a short-only
+ option. A code value outside the unsigned char range means a
+ long-only option.
+
+ Arg_parser normally makes it appear as if all the option arguments
+ were specified before all the non-option arguments for the purposes
+ of parsing, even if the user of your program intermixed option and
+ non-option arguments. If you want the arguments in the exact order
+ the user typed them, call `Arg_parser' with `in_order' = true.
+
+ The argument `--' terminates all options; any following arguments are
+ treated as non-option arguments, even if they begin with a hyphen.
+
+ The syntax for optional option arguments is `-<short_option><argument>'
+ (without whitespace), or `--<long_option>=<argument>'.
+*/
+
+class Arg_parser
+{
+ public:
+ enum Has_arg { no, yes, maybe };
+
+ struct Option
+ {
+ int code; // Short option letter or code ( code != 0 )
+ const char * name; // Long option name (maybe null)
+ Has_arg has_arg;
+ };
+
+ private:
+ struct Record
+ {
+ int code;
+ std::string argument;
+ Record ( const int c = 0 ) : code ( c ) {}
+ };
+
+ std::string _error;
+ std::vector< Record > data;
+
+ bool parse_long_option ( const char * const opt, const char * const arg,
+ const Option options[], int & argind ) throw();
+ bool parse_short_option ( const char * const opt, const char * const arg,
+ const Option options[], int & argind ) throw();
+
+ public:
+ Arg_parser ( const int argc, const char * const argv[],
+ const Option options[], const bool in_order = false ) throw();
+
+ // Restricted constructor. Parses a single token and argument (if any)
+ Arg_parser ( const char * const opt, const char * const arg,
+ const Option options[] ) throw();
+
+ const std::string & error() const throw() { return _error; }
+
+ // The number of arguments parsed (may be different from argc)
+ int arguments() const throw() { return data.size(); }
+
+ // If code( i ) is 0, argument( i ) is a non-option.
+ // Else argument( i ) is the option's argument (or empty).
+ int code ( const int i ) const throw()
+ {
+ if ( i >= 0 && i < arguments() ) return data[i].code;
+ else return 0;
+ }
+
+ const std::string & argument ( const int i ) const throw()
+ {
+ if ( i >= 0 && i < arguments() ) return data[i].argument;
+ else return _error;
+ }
+};
diff --git a/support/highlight/src/cli/cmdlineoptions.cpp b/support/highlight/src/cli/cmdlineoptions.cpp
new file mode 100644
index 0000000000..21c7646bda
--- /dev/null
+++ b/support/highlight/src/cli/cmdlineoptions.cpp
@@ -0,0 +1,1031 @@
+/***************************************************************************
+ cmdlineoptions.cpp - description
+ -------------------
+ begin : Sun Nov 25 2001
+ copyright : (C) 2001-2008 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#include "cmdlineoptions.h"
+#include "platform_fs.h"
+#include "configurationreader.h"
+#include "datadir.h"
+#include <sstream>
+#include <cstdio>
+
+#include "arg_parser.h"
+
+using namespace std;
+
+
+CmdLineOptions::CmdLineOptions ( const int argc, const char *argv[] ) :
+ numberSpaces ( 0 ),
+ lineNrWidth ( 5 ),
+ lineLength ( 80 ),
+ lineNrStart ( 1 ),
+ wrappingStyle ( highlight::WRAP_DISABLED ),
+ outputType ( highlight::HTML ),
+ keywordCase ( StringTools::CASE_UNCHANGED ),
+ className ( "hl" ),
+ opt_syntax ( false ),
+ opt_include_style ( false ),
+ opt_help ( false ),
+ opt_version ( false ),
+ opt_verbose ( false ),
+ opt_print_config ( false ),
+ opt_linenumbers ( false ),
+ opt_style ( false ),
+ opt_batch_mode ( false ),
+ opt_fragment ( false ) ,
+ opt_attach_line_anchors ( false ),
+ opt_show_themes ( false ),
+ opt_show_langdefs ( false ),
+ opt_printindex ( false ),
+ opt_quiet ( false ),
+ opt_replacequotes ( false ),
+ opt_babel ( false ),
+ opt_print_progress ( false ),
+ opt_fill_zeroes ( false ),
+ opt_stylepath_explicit ( false ),
+ opt_force_output ( false ),
+ opt_ordered_list ( false ),
+ opt_fnames_as_anchors ( false ),
+ opt_validate ( false ),
+ opt_inline_css ( false ),
+ opt_enclose_pre ( false ),
+ opt_char_styles ( false ),
+ opt_pretty_symbols ( false ),
+ opt_delim_CR (false),
+ opt_print_style(false),
+ opt_no_trailing_nl(false),
+ configFileRead ( false ),
+ anchorPrefix ( "l" ),
+ helpLang ( "en" ),
+ encodingName ( "ISO-8859-1" )
+{
+
+ loadConfigurationFile();
+
+ enum Optcode
+ {
+ S_OPT_ADDCONFDIR = 256, S_OPT_ENCLOSE_PRE, S_OPT_FORCE_OUTPUT,
+ S_OPT_INLINE_CSS, S_OPT_KW_CASE,
+ S_OPT_MARK_LINES, S_OPT_PRINT_CONFIG, S_OPT_TEST_INPUT,
+ S_OPT_SVG_WIDTH, S_OPT_SVG_HEIGHT, S_OPT_CLASSNAME, S_OPT_RTF_CHAR_STYLES,
+ S_OPT_SKIP_UNKNOWN,
+ S_OPT_COMPAT_DOC, S_OPT_COMPAT_NODOC, S_OPT_COMPAT_TAB, S_OPT_COMPAT_CSS,
+ S_OPT_COMPAT_OUTDIR, S_OPT_COMPAT_FAILSAFE, S_OPT_COMPAT_OUTFORMAT,
+ S_OPT_COMPAT_SRCLANG, S_OPT_COMPAT_LINENUM, S_OPT_COMPAT_LINEREF,
+ S_OPT_CTAGS_FILE, S_OPT_PRETTY_SYMBOLS, S_OPT_EOL_DELIM_CR, S_OPT_START_NESTED,
+ S_OPT_PRINT_STYLE, S_OPT_NO_TRAILING_NL
+ };
+
+ const Arg_parser::Option options[] =
+ {
+ { 'a', OPT_ANCHORS, Arg_parser::no },
+ { 'A', OPT_ANSI, Arg_parser::no },
+ { 'b', OPT_BABEL, Arg_parser::no },
+ { 'B', OPT_BATCHREC, Arg_parser::yes },
+ { 'c', OPT_STYLE_OUT, Arg_parser::yes },
+ { 'C', OPT_INDEXFILE, Arg_parser::no },
+ { 'd', OPT_DOC_TITLE, Arg_parser::yes },
+ { 'D', OPT_DATADIR, Arg_parser::yes },
+ { 'e', OPT_STYLE_IN, Arg_parser::yes },
+ { 'E', OPT_ADDDATADIR, Arg_parser::yes },
+ { 'f', OPT_FRAGMENT, Arg_parser::no },
+ { 'F', OPT_FORMAT, Arg_parser::yes },
+ { S_OPT_CLASSNAME, OPT_CLASSNAME, Arg_parser::yes },
+ { 'h', OPT_HELP, Arg_parser::no },
+ { 'H', OPT_HTML, Arg_parser::no },
+ { 'i', OPT_IN, Arg_parser::yes },
+ { 'I', OPT_INC_STYLE, Arg_parser::no },
+ { 'j', OPT_LNR_LEN, Arg_parser::yes },
+ { 'J', OPT_LINE_LEN, Arg_parser::yes },
+ { 'k', OPT_BASE_FONT, Arg_parser::yes },
+ { 'K', OPT_BASE_FONT_SIZE, Arg_parser::yes },
+ { 'l', OPT_LINENO, Arg_parser::no },
+ { 'L', OPT_LATEX, Arg_parser::no },
+ { 'm', OPT_LNR_START, Arg_parser::yes },
+ { 'M', OPT_XTERM256, Arg_parser::no },
+ { 'n', OPT_ORDERED_LIST, Arg_parser::no },
+ { 'N', OPT_ANCHOR_FN, Arg_parser::no },
+ { 'o', OPT_OUT, Arg_parser::yes },
+ { 'O', OPT_OUTDIR, Arg_parser::yes },
+ { 'p', OPT_LISTLANGS, Arg_parser::no },
+ { 'P', OPT_PROGRESSBAR, Arg_parser::no },
+ { 'q', OPT_QUIET, Arg_parser::no },
+ { 'Q', OPT_VERSION, Arg_parser::no },
+ { 'r', OPT_REPLACE_QUOTES, Arg_parser::no },
+ { 'R', OPT_RTF, Arg_parser::no },
+ { 's', OPT_STYLE, Arg_parser::yes },
+ { 'S', OPT_SYNTAX, Arg_parser::yes },
+ { 't', OPT_DELTABS, Arg_parser::yes },
+ { 'T', OPT_TEX, Arg_parser::no },
+ { 'u', OPT_ENCODING, Arg_parser::yes },
+ { 'v', OPT_VERBOSE, Arg_parser::no },
+ { 'V', OPT_WRAPSIMPLE, Arg_parser::no },
+ { 'w', OPT_LISTTHEMES, Arg_parser::no },
+ { 'W', OPT_WRAP, Arg_parser::no },
+ { 'x', OPT_RTF_PAGE_SIZE, Arg_parser::yes },
+ { 'X', OPT_XHTML, Arg_parser::no },
+ { 'y', OPT_ANCHOR_PFX, Arg_parser::yes },
+ { 'z', OPT_FILLZEROES, Arg_parser::no },
+ { 'Z', OPT_XML, Arg_parser::no },
+ { 'G', OPT_SVG, Arg_parser::no },
+ { 'Y', OPT_BBCODE, Arg_parser::no },
+ { S_OPT_SVG_WIDTH, OPT_SVG_WIDTH, Arg_parser::yes },
+ { S_OPT_SVG_HEIGHT, OPT_SVG_HEIGHT, Arg_parser::yes },
+ { S_OPT_ADDCONFDIR, OPT_ADDCONFDIR, Arg_parser::yes },
+ { S_OPT_ENCLOSE_PRE, OPT_ENCLOSE_PRE, Arg_parser::no },
+ { S_OPT_FORCE_OUTPUT, OPT_FORCE_OUTPUT, Arg_parser::no },
+ { S_OPT_INLINE_CSS, OPT_INLINE_CSS, Arg_parser::no },
+ { S_OPT_KW_CASE, OPT_KW_CASE, Arg_parser::yes },
+ { S_OPT_MARK_LINES, OPT_MARK_LINES, Arg_parser::yes },
+ { S_OPT_PRINT_CONFIG, OPT_PRINT_CONFIG, Arg_parser::no },
+ { S_OPT_TEST_INPUT, OPT_TEST_INPUT, Arg_parser::no },
+ { S_OPT_RTF_CHAR_STYLES, OPT_RTF_CHAR_STYLES, Arg_parser::no },
+ { S_OPT_SKIP_UNKNOWN, OPT_SKIP_UNKNOWN, Arg_parser::yes },
+ { S_OPT_CTAGS_FILE, OPT_CTAGS_FILE, Arg_parser::maybe },
+ { S_OPT_START_NESTED, OPT_START_NESTED, Arg_parser::yes },
+ { S_OPT_COMPAT_DOC, OPT_COMPAT_DOC, Arg_parser::no },
+ { S_OPT_COMPAT_NODOC, OPT_COMPAT_NODOC, Arg_parser::no },
+ { S_OPT_COMPAT_TAB, OPT_COMPAT_TAB, Arg_parser::yes },
+ { S_OPT_COMPAT_CSS, OPT_COMPAT_CSS, Arg_parser::yes },
+ { S_OPT_COMPAT_OUTDIR, OPT_COMPAT_OUTDIR, Arg_parser::yes },
+ { S_OPT_COMPAT_FAILSAFE, OPT_COMPAT_FAILSAFE, Arg_parser::no },
+ { S_OPT_COMPAT_OUTFORMAT, OPT_COMPAT_OUTFORMAT, Arg_parser::yes },
+ { S_OPT_COMPAT_SRCLANG, OPT_COMPAT_SRCLANG, Arg_parser::yes },
+ { S_OPT_COMPAT_LINENUM, OPT_COMPAT_LINENUM, Arg_parser::maybe },
+ { S_OPT_COMPAT_LINEREF, OPT_COMPAT_LINEREF, Arg_parser::maybe },
+ { S_OPT_PRETTY_SYMBOLS, OPT_PRETTY_SYMBOLS, Arg_parser::no },
+ { S_OPT_EOL_DELIM_CR, OPT_EOL_DELIM_CR, Arg_parser::no },
+ { S_OPT_PRINT_STYLE, OPT_PRINT_STYLE, Arg_parser::no },
+ { S_OPT_NO_TRAILING_NL, OPT_NO_TRAILING_NL, Arg_parser::no },
+
+ { 0, 0, Arg_parser::no }
+ };
+
+
+ Arg_parser parser ( argc, argv, options );
+ if ( parser.error().size() ) // bad option
+ {
+ cerr << "highlight: "<< parser.error() <<"\n";
+ cerr << "Try `highlight --help' for more information.\n";
+ exit ( 1 );
+ }
+
+ int argind = 0;
+ for ( ; argind < parser.arguments(); ++argind )
+ {
+ const int code = parser.code ( argind );
+ const std::string & arg = parser.argument ( argind );
+ if ( !code ) break; // no more options
+ switch ( code )
+ {
+ case 'a':
+ opt_attach_line_anchors = true;
+ break;
+ case 'A':
+ outputType=highlight::ANSI;
+ break;
+ case 'b':
+ opt_babel=true;
+ break;
+ case 'B':
+ opt_batch_mode = true;
+ readDirectory ( arg );
+ break;
+ case 'c':
+ case S_OPT_COMPAT_CSS:
+ styleOutFilename = arg;
+ opt_stylepath_explicit=true;
+ break;
+ case 'C':
+ opt_printindex=true;
+ break;
+ case 'd':
+ docTitle = arg;
+ break;
+ case 'D':
+ dataDir=validateDirPath ( arg );
+ break;
+ case 'e':
+ styleInFilename = arg;
+ break;
+ case 'E':
+ additionalDataDir=validateDirPath ( arg );
+ break;
+ case 'f':
+ case S_OPT_COMPAT_NODOC:
+ opt_fragment = true;
+ break;
+ case 'F':
+ indentScheme = arg;
+ break;
+ case S_OPT_CLASSNAME:
+ className = arg;
+ break;
+ case 'h':
+ opt_help = true;
+ break;
+ case 'H':
+ outputType=highlight::HTML;
+ break;
+ case 'i':
+ inputFileNames.push_back ( arg );
+ break;
+ case 'I':
+ opt_include_style = true;
+ break;
+ case 'j':
+ StringTools::str2num<int> ( lineNrWidth, arg, std::dec );
+ break;
+ case 'J':
+ StringTools::str2num<int> ( lineLength, arg, std::dec );
+ break;
+ case 'k':
+ baseFont = arg;
+ break;
+ case 'K':
+ baseFontSize = arg;
+ break;
+ case S_OPT_COMPAT_LINENUM:
+ if ( arg=="0" ) opt_fill_zeroes=true;
+ case 'l':
+ opt_linenumbers = true;
+ break;
+ case 'L':
+ outputType=highlight::LATEX;
+ break;
+ case 'm':
+ StringTools::str2num<int> ( lineNrStart, arg, std::dec );
+ break;
+ case 'M':
+ outputType=highlight::XTERM256;
+ break;
+ case 'n':
+ opt_ordered_list = opt_linenumbers = true;
+ break;
+ case 'N':
+ opt_fnames_as_anchors=true;
+ break;
+ case 'o':
+ outFilename = arg;
+ break;
+ case 'O':
+ case S_OPT_COMPAT_OUTDIR:
+ outDirectory = validateDirPath ( arg );
+ break;
+ case 'p':
+ opt_show_langdefs = true;
+ break;
+ case 'P':
+ opt_print_progress=true;
+ break;
+ case 'q':
+ opt_quiet = true;
+ break;
+ case 'Q':
+ opt_version = true;
+ break;
+ case 'r':
+ opt_replacequotes=true;
+ break;
+ case 'R':
+ outputType=highlight::RTF;
+ break;
+ case 's':
+ styleName = arg;
+ opt_style = true;
+ break;
+ case 'S':
+ case S_OPT_COMPAT_SRCLANG:
+ syntax = arg;
+ opt_syntax = true;
+ break;
+ case 't':
+ case S_OPT_COMPAT_TAB:
+ StringTools::str2num<int> ( numberSpaces, arg, std::dec );
+ break;
+ case 'T':
+ outputType=highlight::TEX;
+ break;
+ case 'u':
+ encodingName = arg;
+ break;
+ case 'v':
+ opt_verbose = true;
+ break;
+ case 'V':
+ wrappingStyle = highlight::WRAP_SIMPLE;
+ break;
+ case 'w':
+ opt_show_themes = true;
+ break;
+ case 'W':
+ wrappingStyle = highlight::WRAP_DEFAULT;
+ break;
+ case 'x':
+ pageSize = arg;
+ break;
+ case 'X':
+ outputType=highlight::XHTML;
+ break;
+ case 'y':
+ anchorPrefix = arg;
+ break;
+ case 'z':
+ opt_fill_zeroes=true;
+ break;
+ case 'Z':
+ outputType=highlight::XML;
+ break;
+ case 'G':
+ outputType=highlight::SVG;
+ break;
+ case 'Y':
+ outputType=highlight::BBCODE;
+ break;
+ case S_OPT_SVG_WIDTH:
+ svg_width = arg;
+ break;
+ case S_OPT_SVG_HEIGHT:
+ svg_height = arg;
+ break;
+ case S_OPT_ADDCONFDIR:
+ additionalConfigDir = validateDirPath ( arg );
+ break;
+ case S_OPT_ENCLOSE_PRE:
+ opt_enclose_pre=true;
+ break;
+ case S_OPT_FORCE_OUTPUT:
+ case S_OPT_COMPAT_FAILSAFE:
+ opt_force_output = true;
+ break;
+ case S_OPT_INLINE_CSS:
+ opt_inline_css=true;
+ break;
+ case S_OPT_KW_CASE:
+ {
+ const string tmp = StringTools::change_case ( arg );
+ if ( tmp == "upper" )
+ keywordCase = StringTools::CASE_UPPER;
+ else if ( tmp == "lower" )
+ keywordCase = StringTools::CASE_LOWER;
+ else if ( tmp == "capitalize" )
+ keywordCase = StringTools::CASE_CAPITALIZE;
+ }
+ break;
+ case S_OPT_COMPAT_OUTFORMAT:
+ {
+ const string tmp = StringTools::change_case ( arg );
+ if ( tmp == "xhtml" )
+ outputType = highlight::XHTML;
+ else if ( tmp == "tex" )
+ outputType = highlight::TEX;
+ else if ( tmp == "latex" )
+ outputType = highlight::LATEX;
+ else if ( tmp == "rtf" )
+ outputType = highlight::RTF;
+ else if ( tmp == "xml" )
+ outputType = highlight::XML;
+ else if ( tmp == "ansi" || tmp == "esc" ) // gnu source-highlight esc parameter
+ outputType = highlight::ANSI;
+ else if ( tmp == "xterm256" )
+ outputType = highlight::XTERM256;
+ else if ( tmp == "svg" )
+ outputType = highlight::SVG;
+ else if ( tmp == "bbcode" )
+ outputType = highlight::BBCODE;
+ else
+ outputType = highlight::HTML;
+ }
+ break;
+ case S_OPT_MARK_LINES:
+ markLinesArg = arg;
+ break;
+ case S_OPT_PRINT_CONFIG:
+ opt_print_config = true;
+ break;
+ case S_OPT_TEST_INPUT:
+ opt_validate=true;
+ break;
+ case S_OPT_RTF_CHAR_STYLES:
+ opt_char_styles=true;
+ break;
+ case S_OPT_SKIP_UNKNOWN:
+ skipArg=arg;
+ break;
+ case S_OPT_CTAGS_FILE:
+ ctagsFile = ( arg.empty() ) ? "tags" :arg;
+ break;
+ case S_OPT_PRETTY_SYMBOLS:
+ opt_pretty_symbols = true;
+ break;
+ case S_OPT_COMPAT_DOC:
+ opt_fragment = false;
+ break;
+ case S_OPT_COMPAT_LINEREF:
+ opt_linenumbers = true;
+ opt_attach_line_anchors = true;
+ anchorPrefix = ( arg.empty() ) ? "line":arg;
+ break;
+ case S_OPT_EOL_DELIM_CR:
+ opt_delim_CR = true;
+ break;
+ case S_OPT_START_NESTED:
+ startNestedLang=arg;
+ break;
+ case S_OPT_PRINT_STYLE:
+ opt_print_style = true;
+ break;
+ case S_OPT_NO_TRAILING_NL:
+ opt_no_trailing_nl = true;
+ break;
+ default:
+ cerr << "highlight: option parsing failed" << endl;
+ }
+ }
+
+ if ( argind < parser.arguments() ) //still args left
+ {
+ if ( inputFileNames.empty() )
+ {
+ while ( argind < parser.arguments() )
+ {
+ inputFileNames.push_back ( parser.argument ( argind++ ) );
+ }
+ }
+ }
+ else if ( inputFileNames.empty() )
+ {
+ inputFileNames.push_back ( "" );
+ }
+ if ( printDebugInfo() && configFileRead )
+ {
+ cout << "Configuration file \""<<configFilePath<<"\" was read.\n";
+ }
+
+ if ( skipArg.size() )
+ {
+ istringstream valueStream;
+ string elem;
+ string wildcard;
+ valueStream.str ( StringTools::change_case ( skipArg,StringTools::CASE_LOWER ) );
+
+ while ( getline ( valueStream, elem, ';' ) )
+ {
+ ignoredFileTypes.insert ( elem );
+ }
+ for ( vector<string>::iterator file=inputFileNames.begin();file!=inputFileNames.end();file++ )
+ {
+ for ( set<string>::iterator ext=ignoredFileTypes.begin();ext!=ignoredFileTypes.end();ext++ )
+ {
+ wildcard="*."+*ext;
+ if ( Platform::wildcmp ( wildcard.c_str(), ( *file ).c_str() ) )
+ {
+ inputFileNames.erase ( file );
+ file--;
+ break;
+ }
+ }
+ }
+ }
+}
+
+CmdLineOptions::~CmdLineOptions() {}
+
+const string &CmdLineOptions::getSingleOutFilename()
+{
+ if ( !inputFileNames.empty() && !outDirectory.empty() )
+ {
+ if ( outFilename.empty() )
+ {
+ outFilename = outDirectory;
+ int delim = getSingleInFilename().find_last_of ( Platform::pathSeparator ) +1;
+ outFilename += getSingleInFilename().substr ( ( delim>-1 ) ?delim:0 )
+ + getOutFileSuffix();
+ }
+ }
+ return outFilename;
+}
+
+const string &CmdLineOptions::getSingleInFilename() const
+{
+ return inputFileNames[0];
+}
+
+const string &CmdLineOptions::getOutDirectory()
+{
+ if ( !outFilename.empty() && !enableBatchMode() )
+ {
+ outDirectory=getDirName ( outFilename );
+ }
+ return outDirectory;
+}
+
+const string CmdLineOptions::getStyleOutFilename() const
+{
+ if ( !styleOutFilename.empty() ) return styleOutFilename;
+
+ if ( outputType==highlight::TEX || outputType==highlight::LATEX )
+ {
+ return "highlight.sty";
+ }
+ else
+ {
+ return "highlight.css";
+ }
+}
+const string &CmdLineOptions::getStyleInFilename() const
+{
+ return styleInFilename;
+}
+const string& CmdLineOptions::getSVGWidth() const
+{
+ return svg_width;
+}
+const string& CmdLineOptions::getSVGHeight() const
+{
+ return svg_height;
+}
+int CmdLineOptions::getNumberSpaces() const
+{
+ return numberSpaces;
+}
+bool CmdLineOptions::printVersion() const
+{
+ return opt_version;
+}
+bool CmdLineOptions::printHelp() const
+{
+ return opt_help;
+}
+bool CmdLineOptions::printDebugInfo() const
+{
+ return opt_verbose;
+}
+bool CmdLineOptions::printConfigInfo() const
+{
+ return opt_print_config;
+}
+bool CmdLineOptions::quietMode() const
+{
+ return opt_quiet;
+}
+bool CmdLineOptions::includeStyleDef() const
+{
+ return opt_include_style;
+}
+bool CmdLineOptions::useFNamesAsAnchors() const
+{
+ return opt_fnames_as_anchors;
+}
+
+bool CmdLineOptions::formatSupportsExtStyle()
+{
+ return outputType==highlight::HTML ||
+ outputType==highlight::XHTML ||
+ outputType==highlight::LATEX ||
+ outputType==highlight::TEX ||
+ outputType==highlight::SVG;
+}
+
+bool CmdLineOptions::printLineNumbers() const
+{
+ return opt_linenumbers;
+}
+
+string CmdLineOptions::getThemeName() const
+{
+ return ( ( opt_style ) ? styleName+".style" : "kwrite.style" );
+}
+bool CmdLineOptions::enableBatchMode() const
+{
+ return inputFileNames.size() >1 || opt_batch_mode;
+}
+bool CmdLineOptions::fragmentOutput() const
+{
+ return opt_fragment;
+}
+string CmdLineOptions::getOutFileSuffix() const
+{
+ switch ( outputType )
+ {
+ case highlight::XHTML: return ".xhtml";
+ case highlight::RTF: return ".rtf";
+ case highlight::TEX:
+ case highlight::LATEX: return ".tex";
+ case highlight::XML: return ".xml";
+ case highlight::SVG: return ".svg";
+ case highlight::ANSI: return ".ansi";
+ case highlight::XTERM256: return ".xterm";
+ case highlight::BBCODE: return ".bbcode";
+ default: return ".html";
+ }
+}
+string CmdLineOptions::getDirName ( const string & path )
+{
+ size_t dirNameLength=path.rfind ( Platform::pathSeparator );
+ return ( dirNameLength==string::npos ) ?string() :path.substr ( 0, dirNameLength+1 );
+}
+bool CmdLineOptions::attachLineAnchors() const
+{
+ return opt_attach_line_anchors;
+}
+bool CmdLineOptions::showThemes() const
+{
+ return opt_show_themes;
+}
+bool CmdLineOptions::showLangdefs() const
+{
+ return opt_show_langdefs;
+}
+bool CmdLineOptions::outDirGiven() const
+{
+ return !outFilename.empty();
+}
+bool CmdLineOptions::replaceQuotes() const
+{
+ return opt_replacequotes;
+}
+bool CmdLineOptions::disableBabelShorthands() const
+{
+ return opt_babel;
+}
+bool CmdLineOptions::prettySymbols() const
+{
+ return opt_pretty_symbols;
+}
+bool CmdLineOptions::getFlag ( const string& paramVal )
+{
+ return StringTools::change_case ( paramVal ) =="true";
+}
+/*
+bool CmdLineOptions::formattingEnabled(){
+ return !indentScheme.empty();
+}
+*/
+bool CmdLineOptions::orderedList() const
+{
+ return opt_ordered_list;
+}
+bool CmdLineOptions::useCRDelimiter() const {
+ return opt_delim_CR;
+}
+const string &CmdLineOptions::getDataDir() const
+{
+ return dataDir;
+}
+bool CmdLineOptions::printOnlyStyle() const {
+ return opt_print_style;
+}
+
+string CmdLineOptions::getIndentScheme() const
+{
+ return StringTools::change_case ( indentScheme );
+}
+
+const string &CmdLineOptions::getAdditionalDataDir() const
+{
+ return additionalDataDir;
+}
+const string &CmdLineOptions::getAdditionalConfDir() const
+{
+ return additionalConfigDir;
+}
+const string &CmdLineOptions::getLanguage() const
+{
+ return syntax;
+}
+const string&CmdLineOptions::getEncoding() const
+{
+ return encodingName;
+}
+
+const string& CmdLineOptions::getAnchorPrefix() const
+{
+ return anchorPrefix;
+}
+
+const string &CmdLineOptions::getPageSize() const
+{
+ return pageSize;
+}
+bool CmdLineOptions::printIndexFile() const
+{
+ return opt_printindex && ( outputType==highlight::HTML ||
+ outputType==highlight::XHTML );
+}
+bool CmdLineOptions::printProgress() const
+{
+ return opt_print_progress;
+}
+bool CmdLineOptions::fillLineNrZeroes() const
+{
+ return opt_fill_zeroes;
+}
+bool CmdLineOptions::syntaxGiven() const
+{
+ return opt_syntax;
+}
+bool CmdLineOptions::omitEncoding() const
+{
+ return StringTools::change_case ( encodingName ) =="none";
+}
+bool CmdLineOptions::forceOutput() const
+{
+ return opt_force_output;
+}
+bool CmdLineOptions::validateInput() const
+{
+ return opt_validate;
+}
+bool CmdLineOptions::inlineCSS() const
+{
+ return opt_inline_css;
+}
+bool CmdLineOptions::enclosePreTag() const
+{
+ return opt_enclose_pre;
+}
+bool CmdLineOptions::includeCharStyles() const
+{
+ return opt_char_styles;
+}
+bool CmdLineOptions::disableTrailingNL() const
+{
+ return opt_no_trailing_nl;
+}
+const string &CmdLineOptions::getConfigFilePath() const
+{
+ return configFilePath;
+}
+
+const string& CmdLineOptions::getDocumentTitle() const
+{
+ return docTitle;
+}
+
+highlight::WrapMode CmdLineOptions::getWrappingStyle() const
+{
+ return wrappingStyle;
+}
+const vector <string> & CmdLineOptions::getInputFileNames() const
+{
+ return inputFileNames;
+}
+
+const map <int,string> & CmdLineOptions::getMarkLines()
+{
+ markLines.clear();
+ istringstream valueStream;
+ string elem;
+ size_t delimPos;
+ int markLineNo;
+ valueStream.str ( markLinesArg );
+ // Format: "1=help line one; 3=help line three; 5 "
+ while ( getline ( valueStream, elem, ';' ) )
+ {
+ delimPos = elem.find ( '=' );
+ markLineNo=0;
+ StringTools::str2num<int> ( markLineNo, elem.substr ( 0,delimPos ), std::dec );
+ if ( markLineNo )
+ {
+ markLines[markLineNo] =
+ ( delimPos!=string::npos ) ?elem.substr ( delimPos+1 ) :"";
+ }
+ }
+ return markLines;
+}
+void CmdLineOptions::readDirectory ( const string & wildcard )
+{
+ // get matching files, use recursive search
+ bool directoryOK=Platform::getDirectoryEntries ( inputFileNames, wildcard, true );
+ if ( !directoryOK )
+ {
+ cerr << "highlight: No files matched the pattern \""
+ << wildcard << "\"."<< endl;
+ }
+}
+
+string CmdLineOptions::validateDirPath ( const string & path )
+{
+ return ( path[path.length()-1] !=Platform::pathSeparator ) ?
+ path+Platform::pathSeparator : path;
+}
+
+highlight::OutputType CmdLineOptions::getOutputType() const
+{
+ return outputType;
+}
+
+StringTools::KeywordCase CmdLineOptions::getKeywordCase() const
+{
+ return keywordCase;
+}
+
+bool CmdLineOptions::hasBaseFont() const
+{
+ return ( ! baseFont.empty() ) ;
+}
+
+const string& CmdLineOptions::getBaseFont() const
+{
+ return baseFont ;
+}
+
+bool CmdLineOptions::hasBaseFontSize() const
+{
+ return ( ! baseFontSize.empty() ) ;
+}
+
+const string& CmdLineOptions::getBaseFontSize() const
+{
+ return baseFontSize ;
+}
+
+const string& CmdLineOptions::getClassName() const
+{
+ return className ;
+}
+
+const string& CmdLineOptions::getTagsFile() const
+{
+ return ctagsFile;
+}
+const string& CmdLineOptions::getStartNestedLang() const
+{
+ return startNestedLang;
+}
+int CmdLineOptions::getNumberWidth()
+{
+ return lineNrWidth;
+}
+
+int CmdLineOptions::getLineLength()
+{
+ return lineLength;
+}
+
+int CmdLineOptions::getNumberStart()
+{
+ return lineNrStart;
+}
+
+void CmdLineOptions::loadConfigurationFile()
+{
+#ifndef _WIN32
+#ifdef CONFIG_FILE_PATH
+ configFilePath=CONFIG_FILE_PATH;
+#else
+ char* homeEnv=getenv ( "HOME" );
+ if ( homeEnv==NULL ) return;
+ configFilePath=string ( homeEnv ) +"/.highlightrc";
+#endif
+#else
+ configFilePath = Platform::getAppPath() + "highlight.conf";
+#endif
+ ConfigurationReader userConfig ( configFilePath );
+
+ if ( userConfig.found() )
+ {
+ string paramVal;
+ configFileRead=true;
+
+ styleOutFilename = userConfig.getParameter ( OPT_STYLE_OUT );
+ styleInFilename = userConfig.getParameter ( OPT_STYLE_IN );
+ styleName = userConfig.getParameter ( OPT_STYLE );
+ opt_style = !styleName.empty();
+ syntax = userConfig.getParameter ( OPT_SYNTAX );
+ opt_syntax = !syntax.empty();
+ StringTools::str2num<int> ( numberSpaces, userConfig.getParameter ( OPT_DELTABS ), std::dec );
+ indentScheme = userConfig.getParameter ( OPT_FORMAT );
+ baseFontSize = userConfig.getParameter ( OPT_BASE_FONT_SIZE );
+ baseFont = userConfig.getParameter ( OPT_BASE_FONT );
+ skipArg = userConfig.getParameter ( OPT_SKIP_UNKNOWN );
+
+ paramVal = userConfig.getParameter ( OPT_DATADIR );
+ if ( !paramVal.empty() )
+ {
+ dataDir=validateDirPath ( paramVal );
+ }
+ paramVal = userConfig.getParameter ( OPT_ADDDATADIR );
+ if ( !paramVal.empty() )
+ {
+ additionalDataDir=validateDirPath ( paramVal );
+ }
+ paramVal = userConfig.getParameter ( OPT_ADDCONFDIR );
+ if ( !paramVal.empty() )
+ {
+ additionalConfigDir=validateDirPath ( paramVal );
+ }
+ paramVal = userConfig.getParameter ( OPT_OUTDIR );
+ if ( !paramVal.empty() )
+ {
+ outDirectory=validateDirPath ( paramVal );
+ }
+ paramVal = userConfig.getParameter ( OPT_ENCODING );
+ if ( !paramVal.empty() )
+ {
+ encodingName=paramVal;
+ }
+ paramVal = userConfig.getParameter ( OPT_LNR_LEN );
+ if ( !paramVal.empty() )
+ {
+ StringTools::str2num<int> ( lineNrWidth, string ( paramVal ), std::dec );
+ }
+ paramVal = userConfig.getParameter ( OPT_LNR_START );
+ if ( !paramVal.empty() )
+ {
+ StringTools::str2num<int> ( lineNrStart, string ( paramVal ), std::dec );
+ }
+ paramVal = userConfig.getParameter ( OPT_ANCHOR_PFX );
+ if ( !paramVal.empty() )
+ {
+ anchorPrefix=paramVal;
+ }
+
+ opt_include_style=getFlag ( userConfig.getParameter ( OPT_INC_STYLE ) );
+ opt_verbose=getFlag ( userConfig.getParameter ( OPT_VERBOSE ) );
+ opt_ordered_list=getFlag ( userConfig.getParameter ( OPT_ORDERED_LIST ) );
+ opt_linenumbers=opt_ordered_list || getFlag ( userConfig.getParameter ( OPT_LINENO ) );
+ opt_fragment=getFlag ( userConfig.getParameter ( OPT_FRAGMENT ) );
+ opt_attach_line_anchors=getFlag ( userConfig.getParameter ( OPT_ANCHORS ) );
+ opt_printindex=getFlag ( userConfig.getParameter ( OPT_INDEXFILE ) );
+ opt_quiet=getFlag ( userConfig.getParameter ( OPT_QUIET ) );
+ opt_replacequotes=getFlag ( userConfig.getParameter ( OPT_REPLACE_QUOTES ) );
+ opt_print_progress=getFlag ( userConfig.getParameter ( OPT_PROGRESSBAR ) );
+ opt_fill_zeroes=getFlag ( userConfig.getParameter ( OPT_FILLZEROES ) );
+ opt_fnames_as_anchors=getFlag ( userConfig.getParameter ( OPT_ANCHOR_FN ) );
+ opt_validate=getFlag ( userConfig.getParameter ( OPT_TEST_INPUT ) );
+ opt_fnames_as_anchors=getFlag ( userConfig.getParameter ( OPT_ANCHOR_FN ) );
+ opt_inline_css=getFlag ( userConfig.getParameter ( OPT_INLINE_CSS ) );
+ opt_delim_CR=getFlag ( userConfig.getParameter ( OPT_EOL_DELIM_CR) );
+
+ if ( getFlag ( userConfig.getParameter ( OPT_WRAP ) ) )
+ {
+ wrappingStyle=highlight::WRAP_DEFAULT;
+ }
+ if ( getFlag ( userConfig.getParameter ( OPT_WRAPSIMPLE ) ) )
+ {
+ wrappingStyle=highlight::WRAP_SIMPLE;
+ }
+ if ( getFlag ( userConfig.getParameter ( OPT_XHTML ) ) )
+ {
+ outputType=highlight::XHTML;
+ }
+ else if ( getFlag ( userConfig.getParameter ( OPT_RTF ) ) )
+ {
+ outputType=highlight::RTF;
+ }
+ else if ( getFlag ( userConfig.getParameter ( OPT_TEX ) ) )
+ {
+ outputType=highlight::TEX;
+ }
+ else if ( getFlag ( userConfig.getParameter ( OPT_LATEX ) ) )
+ {
+ outputType=highlight::LATEX;
+ }
+ else if ( getFlag ( userConfig.getParameter ( OPT_ANSI ) ) )
+ {
+ outputType=highlight::ANSI;
+ }
+ else if ( getFlag ( userConfig.getParameter ( OPT_XML ) ) )
+ {
+ outputType=highlight::XML;
+ }
+ else if ( getFlag ( userConfig.getParameter ( OPT_SVG ) ) )
+ {
+ outputType=highlight::SVG;
+ }
+ else if ( getFlag ( userConfig.getParameter ( OPT_XTERM256 ) ) )
+ {
+ outputType=highlight::XTERM256;
+ }
+ else if ( getFlag ( userConfig.getParameter ( OPT_BBCODE) ) )
+ {
+ outputType=highlight::BBCODE;
+ }
+ }
+}
+
diff --git a/support/highlight/src/cli/cmdlineoptions.h b/support/highlight/src/cli/cmdlineoptions.h
new file mode 100644
index 0000000000..c4cbe26b6d
--- /dev/null
+++ b/support/highlight/src/cli/cmdlineoptions.h
@@ -0,0 +1,471 @@
+/***************************************************************************
+ cmdlineoptions.h - description
+ -------------------
+ begin : Sun Nov 25 2001
+ copyright : (C) 2001-2007 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#ifndef CMDLINEOPTIONS_H
+#define CMDLINEOPTIONS_H
+
+#ifdef _WIN32
+#include <windows.h>
+#endif
+
+#include <string>
+#include <map>
+#include <set>
+#include <cstdlib>
+#include <iostream>
+#include <fstream>
+#include <vector>
+
+#include "stringtools.h"
+#include "enums.h"
+
+
+#define OPT_ADDCONFDIR "add-config-dir"
+#define OPT_ADDDATADIR "add-data-dir"
+#define OPT_ANCHORS "anchors"
+#define OPT_ANCHOR_FN "anchor-filename"
+#define OPT_ANCHOR_PFX "anchor-prefix"
+#define OPT_ANSI "ansi"
+#define OPT_BABEL "babel"
+#define OPT_BASE_FONT "font"
+#define OPT_BASE_FONT_SIZE "font-size"
+#define OPT_BATCHREC "batch-recursive"
+#define OPT_CLASSNAME "class-name"
+#define OPT_DATADIR "data-dir"
+#define OPT_DELTABS "replace-tabs"
+#define OPT_DOC_TITLE "doc-title"
+#define OPT_ENCLOSE_PRE "enclose-pre"
+#define OPT_ENCODING "encoding"
+#define OPT_FILLZEROES "zeroes"
+#define OPT_FORCE_OUTPUT "force"
+#define OPT_FORMAT "reformat"
+#define OPT_FRAGMENT "fragment"
+#define OPT_HELP "help"
+#define OPT_HTML "html"
+#define OPT_IN "input"
+#define OPT_INC_STYLE "include-style"
+#define OPT_INDEXFILE "print-index"
+#define OPT_INLINE_CSS "inline-css"
+#define OPT_KW_CASE "kw-case"
+#define OPT_LATEX "latex"
+#define OPT_LINENO "linenumbers"
+#define OPT_LINE_LEN "line-length"
+#define OPT_LISTLANGS "list-langs"
+#define OPT_LISTTHEMES "list-themes"
+#define OPT_LNR_LEN "line-number-length"
+#define OPT_LNR_START "line-number-start"
+#define OPT_MARK_LINES "mark-line"
+#define OPT_ORDERED_LIST "ordered-list"
+#define OPT_OUT "output"
+#define OPT_OUTDIR "outdir"
+#define OPT_RTF_PAGE_SIZE "page-size"
+#define OPT_RTF_CHAR_STYLES "char-styles"
+#define OPT_PRINT_CONFIG "print-config"
+#define OPT_PROGRESSBAR "progress"
+#define OPT_QUIET "quiet"
+#define OPT_REPLACE_QUOTES "replace-quotes"
+#define OPT_RTF "rtf"
+#define OPT_STYLE "style"
+#define OPT_STYLE_IN "style-infile"
+#define OPT_STYLE_OUT "style-outfile"
+#define OPT_SYNTAX "syntax"
+#define OPT_TEST_INPUT "validate-input"
+#define OPT_TEX "tex"
+#define OPT_VERBOSE "verbose"
+#define OPT_VERSION "version"
+#define OPT_WRAP "wrap"
+#define OPT_WRAPSIMPLE "wrap-simple"
+#define OPT_XHTML "xhtml"
+#define OPT_XML "xml"
+#define OPT_XTERM256 "xterm256"
+#define OPT_SVG "svg"
+#define OPT_SVG_WIDTH "width"
+#define OPT_SVG_HEIGHT "height"
+#define OPT_SKIP_UNKNOWN "skip"
+#define OPT_CTAGS_FILE "ctags-file"
+#define OPT_PRETTY_SYMBOLS "pretty-symbols"
+#define OPT_EOL_DELIM_CR "delim-cr"
+#define OPT_BBCODE "bbcode"
+#define OPT_START_NESTED "start-nested"
+#define OPT_PRINT_STYLE "print-style"
+#define OPT_NO_TRAILING_NL "no-trailing-nl"
+
+// Improve CLI option compatibility with GNU source-highlight
+#define OPT_COMPAT_DOC "doc"
+#define OPT_COMPAT_NODOC "no-doc"
+#define OPT_COMPAT_TAB "tab"
+#define OPT_COMPAT_CSS "css"
+#define OPT_COMPAT_OUTDIR "output-dir"
+#define OPT_COMPAT_FAILSAFE "failsafe"
+#define OPT_COMPAT_OUTFORMAT "out-format"
+#define OPT_COMPAT_SRCLANG "src-lang"
+#define OPT_COMPAT_LINENUM "line-number"
+#define OPT_COMPAT_LINEREF "line-number-ref"
+
+using namespace std;
+
+/// handle command line options
+
+class CmdLineOptions
+{
+ public:
+
+ /**Constructor
+ \param argc Argument count
+ \param argv Argument strings
+ */
+ CmdLineOptions ( const int argc, const char *argv[] );
+ ~CmdLineOptions();
+
+ /** \return Single output file name*/
+ const string &getSingleOutFilename();
+
+ /** \return Single input file name*/
+ const string &getSingleInFilename() const;
+
+ /** \return Output directory*/
+ const string& getOutDirectory() ;
+
+ /** \return Style output file name*/
+ const string getStyleOutFilename() const;
+
+ /** \return Style input file name*/
+ const string& getStyleInFilename() const;
+
+ /** \return Char set*/
+ const string& getEncoding() const;
+
+ /** \return SVG width*/
+ const string& getSVGWidth() const;
+
+ /** \return SVG height*/
+ const string& getSVGHeight() const;
+
+ /** \return Number of spaces to replace a tab*/
+ int getNumberSpaces() const;
+
+ /** \return True if version information should be printed*/
+ bool printVersion() const;
+
+ /** \return True if help information should be printed*/
+ bool printHelp() const;
+
+ /** \return True if debug information should be printed*/
+ bool printDebugInfo() const;
+
+ /** \return True if configuration information should be printed*/
+ bool printConfigInfo() const;
+
+ /** \return True if Style definition should be included in output*/
+ bool includeStyleDef() const;
+
+ /** \return True if line numbers should be printed*/
+ bool printLineNumbers() const;
+
+ /** \return True if CR is eol delimiter */
+ bool useCRDelimiter() const;
+
+ /** \return colour theme name */
+ string getThemeName() const ;
+
+ /** gibt true zurck, falls deutsche Hilfe ausgegeben werden soll */
+ int helpLanguage() const;
+
+ /** \return True if batch mode is active*/
+ bool enableBatchMode() const;
+
+ /** \return True if output shluld be fragmented*/
+ bool fragmentOutput() const;
+
+ /** \return output file suffix */
+ string getOutFileSuffix() const;
+
+ /** \return True if anchors should be attached to line numbers*/
+ bool attachLineAnchors() const;
+
+ /** \return True if list of installed themes should be printed*/
+ bool showThemes() const;
+
+ /** \return True if list of installed language definitions should be printed*/
+ bool showLangdefs() const;
+
+ /** \return True if loutput directory is given*/
+ bool outDirGiven() const;
+
+ /** \return True if refomatting is enabled*/
+// bool formattingEnabled();
+
+ /** \return True if a new data directory is given*/
+ bool dataDirGiven() const;
+
+ /** \return True if an additional data directory is given*/
+ bool additionalDataDirGiven() const;
+
+ /** \return True if index file should be printed*/
+ bool printIndexFile() const;
+
+ /** \return True if quotes should be replaced by /dq in LaTeX*/
+ bool replaceQuotes() const;
+
+ /** \return True if shorthands of LaTeX Babel package should be disabled*/
+ bool disableBabelShorthands() const;
+
+ /** \return True if input file name should be used as anchor name */
+ bool useFNamesAsAnchors() const;
+
+ /** \return Data directory*/
+ const string &getDataDir() const;
+
+ /** \return Additional data directory*/
+ const string &getAdditionalDataDir() const;
+
+ /** \return Additional config data directory*/
+ const string &getAdditionalConfDir() const;
+
+ /** \return path of user config file*/
+ const string &getConfigFilePath() const;
+
+ /** \return True if language syntax is given*/
+ bool syntaxGiven() const;
+
+ /** \return True if quiet mode is active*/
+ bool quietMode() const;
+
+ /** \return True if progress bar should be printed in batch mode */
+ bool printProgress() const;
+
+ /** \return True if line numbers are filled with leading zeroes */
+ bool fillLineNrZeroes() const;
+
+ /** \return programming syntax */
+ const string &getLanguage() const ;
+
+ /** \return Wrapping style*/
+ highlight::WrapMode getWrappingStyle() const;
+
+ /** \return List of input file names*/
+ const vector <string> & getInputFileNames() const;
+
+ /** \return Map of marked lines*/
+ const map <int,string> &getMarkLines();
+
+ /** \return indentation and reformatting scheme*/
+ string getIndentScheme() const;
+
+ /** \return RTF page size */
+ const string &getPageSize() const;
+
+ /** \return Output file format */
+ highlight::OutputType getOutputType() const;
+
+ /** \return True if chosen output format supports referenced style files */
+ bool formatSupportsExtStyle();
+
+ /** \return True if style output path was defined by user*/
+ bool styleOutPathDefined() const
+ {
+ return opt_stylepath_explicit;
+ }
+
+ /** \return True if encoding specification should be omitted in output*/
+ bool omitEncoding() const;
+
+ /** \return True if output should be generated if languege type is unknown*/
+ bool forceOutput() const;
+
+ /** \return True if line numbers should be replaced by ordered list (HTML) */
+ bool orderedList() const;
+
+ /** \return True if a base font has been given */
+ bool hasBaseFont() const ;
+
+ /** \return True if input should be validated */
+ bool validateInput() const ;
+
+ /** \return True if CSS should be outputted within tag elements */
+ bool inlineCSS() const ;
+
+ /** \return True if fragmented html output should be enclosed with pre tags */
+ bool enclosePreTag() const ;
+
+ /** \return True if RTF output should include character styles */
+ bool includeCharStyles() const ;
+
+ /** \return True if LaTeX output should includ fancier symbols */
+ bool prettySymbols() const;
+
+ /** \return True if style should be printed */
+ bool printOnlyStyle() const;
+
+ /** \return The given base font, empty string by default */
+ const string& getBaseFont() const ;
+
+ /** \return Document title */
+ const string& getDocumentTitle() const ;
+
+ /** \return anchor prefix */
+ const string& getAnchorPrefix() const ;
+
+ /** \return class name */
+ const string& getClassName() const ;
+
+ /** \return ctags file name */
+ const string& getTagsFile() const ;
+
+ /** \return True if a base font size has been given */
+ bool hasBaseFontSize() const ;
+
+ /** \return True if trailing nl should be omitted */
+ bool disableTrailingNL() const ;
+
+ /** \return The given base font size, empty string by default */
+ const string& getBaseFontSize() const ;
+
+ /** \return name of nested syntax which starts the input */
+ const string& getStartNestedLang() const ;
+
+ /** \return line number width */
+ int getNumberWidth();
+
+ /** \return line length */
+ int getLineLength();
+
+ /** \return Line number start count */
+ int getNumberStart();
+
+ /** \return Keyword Case (upper, lower, unchanged) */
+ StringTools::KeywordCase getKeywordCase() const;
+
+ bool isSkippedExt ( const string& ext )
+ {
+ return ignoredFileTypes.count ( ext );
+ }
+
+ private:
+
+ int numberSpaces; // number of spaces which replace a tab
+ int lineNrWidth; // width of line number (left padding)
+ int lineLength; // length of line before wrapping
+ int lineNrStart; // line number start count
+ highlight::WrapMode wrappingStyle; // line wrapping mode
+ highlight::OutputType outputType;
+ StringTools::KeywordCase keywordCase;
+
+ // name of single output file
+ string outFilename,
+ // output directory
+ outDirectory,
+ // programming syntax which will be loaded
+ syntax,
+ // name of colour theme
+ styleName,
+ // name of external style file
+ styleOutFilename,
+ // name of file to be included in external style file
+ styleInFilename,
+ // used to define data directories at runtime
+ dataDir, additionalDataDir, additionalConfigDir;
+ // name of indenation scheme
+ string indentScheme,
+ pageSize, startNestedLang;
+
+ string baseFont, baseFontSize;
+ string docTitle, className;
+ string markLinesArg;
+ string skipArg;
+ string svg_height, svg_width;
+ string ctagsFile;
+
+ bool opt_syntax;
+ bool opt_include_style;
+ bool opt_help;
+ bool opt_version ;
+ bool opt_verbose;
+ bool opt_print_config;
+ bool opt_linenumbers;
+ bool opt_style;
+ bool opt_batch_mode;
+ bool opt_fragment;
+ bool opt_attach_line_anchors;
+ bool opt_show_themes;
+ bool opt_show_langdefs;
+ bool opt_asformat_output;
+ bool opt_printindex;
+ bool opt_quiet;
+ bool opt_replacequotes;
+ bool opt_babel;
+ bool opt_print_progress;
+ bool opt_fill_zeroes;
+ bool opt_stylepath_explicit;
+ bool opt_force_output;
+ bool opt_ordered_list;
+ bool opt_fnames_as_anchors;
+ bool opt_validate;
+ bool opt_inline_css;
+ bool opt_enclose_pre;
+ bool opt_char_styles;
+ bool opt_pretty_symbols;
+ bool opt_delim_CR;
+ bool opt_print_style;
+ bool opt_no_trailing_nl;
+
+ bool configFileRead;
+
+ string anchorPrefix;
+
+ string helpLang, encodingName;
+ string configFilePath;
+
+ /** list of all input file names */
+ vector <string> inputFileNames;
+
+ /** list lines which should be marked and supplied with help string */
+ map <int, string> markLines;
+
+ /** list of file types which should be ignored */
+ set <string> ignoredFileTypes;
+
+ /** load highlight configuration file */
+ void loadConfigurationFile();
+
+ /** \return file suffix */
+ string getFileSuffix ( const string & fileName ) const;
+
+ /** \return directory name of path */
+ string getDirName ( const string & path );
+
+ /** get all entries in the directory defined by wildcard */
+ void readDirectory ( const string & wildcard );
+
+ /** \return Boolean value of paramVal */
+ bool getFlag ( const string& paramVal );
+
+ /** \return Valid path name */
+ string validateDirPath ( const string & path );
+};
+
+#endif
diff --git a/support/highlight/src/cli/help.cpp b/support/highlight/src/cli/help.cpp
new file mode 100644
index 0000000000..d80312a7a9
--- /dev/null
+++ b/support/highlight/src/cli/help.cpp
@@ -0,0 +1,185 @@
+/***************************************************************************
+ help.cpp - description
+ -------------------
+ begin : Die Apr 23 2002
+ copyright : (C) 2002-2007 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#include <iostream>
+
+#include "help.h"
+
+using namespace std;
+
+namespace Help
+{
+
+ void printHelp()
+ {
+ cout<<"USAGE: highlight [OPTIONS]... [FILES]...\n";
+ cout<<"\n";
+ cout<<"General options:\n";
+ cout<<"\n";
+ cout<<" -B, --batch-recursive=<wc> convert all matching files, searches subdirs\n";
+ cout<<" (Example: -B '*.cpp')\n";
+ cout<<" -D, --data-dir=<directory> set path to data directory\n";
+ cout<<" -E, --add-data-dir=<directory> set path to an additional data directory, which\n";
+ cout<<" is searched first\n";
+ cout<<" --add-config-dir=<dir> set path to an additional config directory\n";
+ cout<<" -h, --help print this help\n";
+ cout<<" -i, --input=<file> name of single input file\n";
+ cout<<" -o, --output=<file> name of single output file\n";
+ cout<<" -O, --outdir=<directory> name of output directory\n";
+ cout<<" -p, --list-langs list installed language definitions\n";
+ cout<<" -P, --progress print progress bar in batch mode\n";
+ cout<<" -q, --quiet supress progress info in batch mode\n";
+ cout<<" -S, --syntax=<type> specify type of source code\n";
+ cout<<" -v, --verbose print debug info\n";
+ cout<<" -w, --list-themes list installed colour themes\n";
+ cout<<" --force generate output if language type is unknown\n";
+ cout<<" --print-config print path configuration\n";
+ cout<<" --print-style print only style (see --style-outfile)\n";
+ cout<<" --skip=<list> ignore listed unknown file types\n";
+ cout<<" (Example: --skip='bak;c~;h~')\n";
+ cout<<" --start-nested=<lang> define nested language which starts input\n";
+ cout<<" without opening delimiter\n";
+ cout<<" --validate-input test if input is a valid text file\n";
+ cout<<" --version print version and copyright information\n";
+ cout<<"\n";
+ cout<<"\n";
+ cout<<"Output formats:\n";
+ cout<<"\n";
+ cout<<" -H, --html generate HTML (default)\n";
+ cout<<" -A, --ansi generate terminal output (16 colours)\n";
+ cout<<" -L, --latex generate LaTeX\n";
+ cout<<" -M, --xterm256 generate terminal output (256 colours)\n";
+ cout<<" -R, --rtf generate RTF\n";
+ cout<<" -T, --tex generate TeX\n";
+ cout<<" -X, --xhtml generate XHTML 1.1\n";
+ cout<<" -Z, --xml generate XML\n";
+ cout<<" -G, --svg generate SVG (experimental)\n";
+ cout<<" -Y, --bbcode generate BBCode (experimental)\n";
+ cout<<" --out-format=<format> output file in given format\n";
+ cout<<" <format>: see long options above\n";
+ cout<<"\n";
+ cout<<"\n";
+ cout<<"Output formatting options:\n";
+ cout<<"\n";
+ cout<<" -c, --style-outfile=<file> name of style file or output to stdout, if\n";
+ cout<<" 'stdout' is given as file argument\n";
+ cout<<" -d, --doc-title=<title> document title\n";
+ cout<<" -e, --style-infile=<file> file to be included in style-outfile\n";
+ cout<<" -I, --include-style include style definition\n";
+ cout<<" -f, --fragment omit file header and footer\n";
+ cout<<" -F, --reformat=<style> reformats and indents output in given style\n";
+ cout<<" <style>=['allman', 'banner', 'gnu',\n";
+ cout<<" 'horstmann', 'java', 'kr', 'linux', 'otbs',\n";
+ cout<<" 'stroustrup', 'whitesmith']\n";
+ cout<<" -J, --line-length=<num> line length before wrapping (see -W, -V)\n";
+ cout<<" -j, --line-number-length=<num> line number width incl. left padding\n";
+ cout<<" -k, --font=<font> set font (specific to output format)\n";
+ cout<<" -K, --font-size=<num?> set font size (specific to output format)\n";
+ cout<<" -l, --linenumbers print line numbers in output file\n";
+ cout<<" -m, --line-number-start=<cnt> start line numbering with cnt (assumes -l)\n";
+ cout<<" -s, --style=<style> set colour style (see -w)\n";
+ cout<<" -t, --replace-tabs=<num> replace tabs by <num> spaces\n";
+ cout<<" -u, --encoding=<enc> set output encoding which matches input file\n";
+ cout<<" encoding; omit encoding info if enc=NONE\n";
+ cout<<" -V, --wrap-simple wrap long lines without indenting function\n";
+ cout<<" parameters and statements\n";
+ cout<<" -W, --wrap wrap long lines\n";
+ cout<<" -z, --zeroes fill leading space of line numbers with 0's\n";
+ cout<<" --kw-case=<case> change case of case insensitive keywords\n";
+ cout<<" <case> = ['upper', 'lower', 'capitalize']\n";
+ cout<<" --delim-cr set CR as end-of-line delimiter (MacOS 9)\n";
+ cout<<" --no-trailing-nl omit trailing newline\n";
+ cout<<"\n";
+ cout<<"(X)HTML output options:\n";
+ cout<<"\n";
+ cout<<" -a, --anchors attach anchor to line numbers\n";
+ cout<<" -y, --anchor-prefix=<str> set anchor name prefix\n";
+ cout<<" -N, --anchor-filename use input file name as anchor name\n";
+ cout<<" -C, --print-index print index with hyperlinks to output files\n";
+ cout<<" -n, --ordered-list print lines as ordered list items\n";
+ cout<<" --class-name=<str> set CSS class name prefix\n";
+ cout<<" --inline-css output CSS within each tag (verbose output)\n";
+ cout<<" --mark-line='n[=txt]; m' mark given lines n..m and add optional help\n";
+ cout<<" texts as tooltips\n";
+ cout<<" --enclose-pre enclose fragmented output with pre tag \n";
+ cout<<" (assumes -f)\n";
+ cout<<" --ctags-file[=<file>] read ctags file to include meta information as\n";
+ cout<<" tooltips (default value: tags)\n";
+ cout<<"\n";
+ cout<<"LaTeX output options:\n";
+ cout<<"\n";
+ cout<<" -b, --babel disable Babel package shorthands\n";
+ cout<<" -r, --replace-quotes replace double quotes by \\dq{}\n";
+ cout<<" --pretty-symbols improve appearance of brackets and other symbols\n";
+ cout<<"\n";
+ cout<<"\n";
+ cout<<"RTF output options:\n";
+ cout<<"\n";
+ cout<<" -x, --page-size=<ps> set page size \n";
+ cout<<" <ps> = [a3, a4, a5, b4, b5, b6, letter]\n";
+ cout<<" --char-styles include character stylesheets\n";
+ cout<<"\n";
+ cout<<"\n";
+ cout<<"SVG output options:\n";
+ cout<<"\n";
+ cout<<" --height set image height (units allowed)\n";
+ cout<<" --width set image width (see --height)\n";
+ cout<<"\n";
+ cout<<"\n";
+ cout<<"GNU source-highlight compatibility options:\n";
+ cout<<"\n";
+ cout<<" --doc create stand alone document\n";
+ cout<<" --no-doc cancel the --doc option\n";
+ cout<<" --css=filename the external style sheet filename\n";
+ cout<<" --src-lang=STRING source language\n";
+ cout<<" -t, --tab=INT specify tab length\n";
+ cout<<" -n, --line-number[=0] number all output lines, optional padding\n";
+ cout<<" --line-number-ref[=p] number all output lines and generate an anchor,\n";
+ cout<<" made of the specified prefix p + the line\n";
+ cout<<" number (default='line')\n";
+ cout<<" --output-dir=path output directory\n";
+ cout<<" --failsafe if no language definition is found for the\n";
+ cout<<" input, it is simply copied to the output\n";
+ cout<<"\n";
+ cout<<"\n";
+ cout<<"-t will be ignored if -F is set.\n";
+ cout<<"-i and -o will be ignored if -b or -B is set.\n";
+ cout<<"-r will be ignored if -f is not set.\n";
+ cout<<"-c will be ignored if the output format does not support referenced styles.\n";
+ cout<<"If no in- or output files are specified, stdin and stdout will be used for\n";
+ cout<<"in- or output.\n";
+ cout<<"HTML will be generated, if no other output format is given. Style definitions\n";
+ cout<<"are stored in highlight.css (HTML, XHTML, SVG) or highlight.sty (LaTeX, TeX)\n";
+ cout<<"if neither -c nor -I is given.\n";
+ cout<<"Reformatting code will only work with C, C++, C# and Java input files.\n";
+ cout<<"Wrapping lines with -V or -W will cause faulty highlighting of long single\n";
+ cout<<"line comments and directives. Use with caution.\n";
+ cout<<"\n";
+ cout<<"Updates and information: http://www.andre-simon.de/\n";
+ }
+
+}
diff --git a/support/highlight/src/cli/help.h b/support/highlight/src/cli/help.h
new file mode 100644
index 0000000000..e4500d679c
--- /dev/null
+++ b/support/highlight/src/cli/help.h
@@ -0,0 +1,42 @@
+/***************************************************************************
+ help.h - description
+ -------------------
+ begin : Die Apr 23 2002
+ copyright : (C) 2002-2007 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#ifndef HELP_H
+#define HELP_H
+
+#include <string>
+
+///Contains methods for printing help messages
+
+namespace Help
+{
+ /** print help message to stdout
+ */
+ void printHelp();
+}
+
+#endif
diff --git a/support/highlight/src/cli/main.cpp b/support/highlight/src/cli/main.cpp
new file mode 100644
index 0000000000..cb2030fdf5
--- /dev/null
+++ b/support/highlight/src/cli/main.cpp
@@ -0,0 +1,709 @@
+/***************************************************************************
+ main.cpp - description
+ -------------------
+ begin : Die Apr 23 22:16:35 CEST 2002
+ copyright : (C) 2002-2009 by Andre Simon
+ email : andre.simon1@gmx.de
+
+ Highlight is a universal source code to HTML converter. Syntax highlighting
+ is formatted by Cascading Style Sheets. It's possible to easily enhance
+ highlight's parsing database.
+
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#include <memory>
+#include <algorithm>
+#include "main.h"
+#include "re/Pattern.h"
+
+#define MAX_LINE__WIDTH 80
+
+using namespace std;
+
+void HLCmdLineApp::printVersionInfo()
+{
+ cout << "\n highlight version "
+ << HIGHLIGHT_VERSION
+ << "\n Copyright (C) 2002-2010 Andre Simon <andre.simon1 at gmx.de>"
+ << "\n\n Artistic Style Classes (1.24)"
+ << "\n Copyright (C) 2006-2010 by Jim Pattee <jimp03 at email.com>"
+ << "\n Copyright (C) 1998-2002 by Tal Davidson"
+ << "\n\n Regex library (1.09.00)"
+ << "\n Copyright (C) 2003-2008 Jeffery Stuart <stuart at cs.unr.edu>"
+ << "\n\n xterm 256 color matching functions"
+ << "\n Copyright (C) 2006 Wolfgang Frisch <wf at frexx.de>"
+ << "\n\n Argparser class"
+ << "\n Copyright (C) 2006-2008 Antonio Diaz Diaz <ant_diaz at teleline.es>"
+ << "\n\n This software is released under the terms of the GNU General "
+ << "Public License."
+ << "\n For more information about these matters, see the file named "
+ << "COPYING.\n\n";
+}
+
+void HLCmdLineApp::printBadInstallationInfo()
+{
+ cerr << "highlight: Data directory not found ("<<DataDir::LSB_DATA_DIR<<")."
+ " Bad installation or wrong "<< OPT_DATADIR << " parameter."
+ << "\n\nCopy the highlight files into one of the directories listed "
+ << "in INSTALL.\nYou may also set the data directory with "
+ << OPT_DATADIR << " and " << OPT_ADDDATADIR << ".\n";
+}
+
+bool HLCmdLineApp::printInstalledThemes()
+{
+ vector <string> filePaths;
+ string wildcard="*.style";
+ string directory= dataDir.getThemePath();
+ string searchDir = directory + wildcard;
+
+ bool directoryOK = Platform::getDirectoryEntries ( filePaths, searchDir, true );
+ if ( !directoryOK )
+ {
+ cerr << "highlight: Could not access directory "
+ << searchDir
+ << ", aborted.\n";
+ return false;
+ }
+
+ cout << "\nInstalled themes"
+ << " (located in " << directory << "):\n\n";
+
+ sort ( filePaths.begin(), filePaths.end() );
+ string temp;
+
+ for ( unsigned int i=0;i< filePaths.size(); i++ )
+ {
+ temp = ( filePaths[i] ).substr ( directory.length() );
+ cout <<temp.substr ( 1, temp.length()- wildcard.length() ) << endl;
+ }
+ cout <<"\nUse name of the desired theme"
+ << " with the --" OPT_STYLE " option.\n" << endl;
+ return true;
+}
+
+
+bool HLCmdLineApp::printInstalledLanguages()
+{
+ vector <string> filePaths;
+ string wildcard="*.lang";
+ string directory=dataDir.getLangPath();
+ string searchDir = directory + wildcard;
+
+ bool directoryOK = Platform::getDirectoryEntries ( filePaths, searchDir, true );
+ if ( !directoryOK )
+ {
+ cerr << "highlight: Could not access directory "
+ << searchDir
+ << ", aborted.\n";
+ return false;
+ }
+
+ sort ( filePaths.begin(), filePaths.end() );
+ string suffix, desc;
+ cout << "\nInstalled language definitions"
+ << " (located in " << directory << "):\n\n";
+
+ for ( unsigned int i=0;i< filePaths.size(); i++ )
+ {
+ ConfigurationReader lang ( filePaths[i] );
+ desc = lang.getParameter ( "description" );
+ suffix = ( filePaths[i] ).substr ( directory.length() ) ;
+ suffix = suffix.substr ( 1, suffix.length()- wildcard.length() );
+ cout << setw ( 20 ) <<setiosflags ( ios::left ) <<desc<<": "<<suffix;
+ int extCnt=0;
+ for (StringMap::iterator it=extensions.begin();it!=extensions.end();it++) {
+ if (it->second==suffix ) {
+
+ cout << ((++extCnt==1)?" ( ":" ")<<it->first;
+ }
+ }
+ cout << ((extCnt)?" )":"")<<endl;
+ }
+ cout <<"\nUse name of the desired language"
+ << " with the --" OPT_SYNTAX " option.\n" << endl;
+ return true;
+}
+
+void HLCmdLineApp::printDebugInfo ( const highlight::LanguageDefinition &lang,
+ const string & langDefPath )
+{
+ cerr << "\nLoading language definition:\n" << langDefPath;
+ cerr << "\n\nDescription: " << lang.getDescription();
+ cerr << "\n\nSYMBOLS (followed by states):\n" << lang.getSymbolString();
+ cerr << "\n\nREGEX:\n";
+ highlight::RegexElement *re=NULL;
+ for ( unsigned int i=0; i<lang.getRegexElements().size(); i++ )
+ {
+ re = lang.getRegexElements() [i];
+ cerr << "State "<<re->open<<":\t"<<re->rePattern->getPattern() <<"\n";
+ }
+ cerr << "\nKEYWORDS:\n";
+ highlight::KeywordMap::iterator it;
+ highlight::KeywordMap keys=lang.getKeywords();
+ for ( it=keys.begin(); it!=keys.end(); it++ )
+ {
+ cerr << " "<< it->first << "("<< it->second << ")";
+ }
+ cerr <<"\n\n";
+}
+
+void HLCmdLineApp::printConfigInfo ( const string& configFile )
+{
+ cout << "\nRoot paths (modify with --" OPT_DATADIR " and --" OPT_ADDDATADIR "):\n";
+ cout << " Data directory: "<<dataDir.getDir() <<"\n";
+ if ( !dataDir.getAdditionalDataDir().empty() )
+ cout << " User defined directory: "<<dataDir.getAdditionalDataDir() <<"\n";
+ cout << "\nDefault search paths:\n";
+ cout << " Language definitions: "<<dataDir.getLangPath ( "", true ) <<"\n";
+ cout << " Colour themes: "<<dataDir.getThemePath ( "", true ) <<"\n";
+
+ if ( !dataDir.getAdditionalDataDir().empty() )
+ {
+ cout << "\nAdditional search paths:\n";
+ cout << " Language definitions: "<<dataDir.getAdditionalLangDefDir() <<"\n";
+ cout << " Colour themes: "<<dataDir.getAdditionalThemeDir() <<"\n";
+// cout << " Indentation schemes: "<<dataDir.getAdditionalIndentSchemesDir()<<"\n";
+ }
+
+ cout << "\nConfiguration paths:\n";
+ cout << " Configuration files: "<<dataDir.getConfDir ( true ) <<"\n";
+ cout << " User configuration: "<<configFile<<"\n";
+ if ( !dataDir.getAdditionalConfDir().empty() )
+ {
+ cout << "\nAdditional search paths:\n";
+ cout << " Configuration files: "<<dataDir.getAdditionalConfDir() <<"\n";
+ }
+ cout << endl;
+#ifdef HL_DATA_DIR
+ cout << "Compiler directive HL_DATA_DIR = " <<HL_DATA_DIR<< "\n";
+#endif
+#ifdef HL_CONFIG_DIR
+ cout << "Compiler directive HL_CONFIG_DIR = " <<HL_CONFIG_DIR<< "\n";
+#endif
+
+ cout << endl;
+}
+
+string HLCmdLineApp::getFileSuffix ( const string &fileName )
+{
+ size_t ptPos=fileName.rfind ( "." );
+ return ( ptPos == string::npos ) ? "" : fileName.substr ( ptPos+1, fileName.length() );
+}
+
+bool HLCmdLineApp::loadFileTypeConfig ( const string& name, StringMap* extMap, StringMap* shebangMap )
+{
+ if ( !extMap || !shebangMap ) return false;
+ string confPath=dataDir.getConfDir() + name + ".conf";
+ ConfigurationReader config ( confPath );
+ if ( config.found() )
+ {
+ stringstream values;
+ string paramName, paramVal;
+ for ( unsigned int i=0;i<config.getParameterNames().size();i++ )
+ {
+ paramName = config.getParameterNames() [i];
+
+ if ( paramName.find ( "ext" ) != string::npos )
+ {
+ values.str ( StringTools::change_case ( config.getParameter ( paramName ) ) );
+ paramName = StringTools::getParantheseVal ( paramName );
+ while ( values >> paramVal )
+ {
+ extMap->insert ( make_pair ( paramVal, paramName ) );
+ }
+ values.clear();
+ }
+ else if ( paramName.find ( "shebang" ) != string::npos )
+ {
+ values.str ( config.getParameter ( paramName ) ) ;
+ paramName = StringTools::getParantheseVal ( paramName );
+ while ( values >> paramVal )
+ {
+ shebangMap->insert ( make_pair ( paramVal, paramName ) );
+ }
+ values.clear();
+ }
+ }
+ return true;
+ }
+ else
+ {
+ cerr << "highlight: Configuration file "<< confPath << " not found.\n";
+ return false;
+ }
+}
+
+
+int HLCmdLineApp::getNumDigits ( int i )
+{
+ int res=0;
+ while ( i )
+ {
+ i/=10;
+ ++res;
+ }
+ return res;
+}
+
+void HLCmdLineApp::printProgressBar ( int total, int count )
+{
+ if ( !total ) return;
+ int p=100*count / total;
+ int numProgressItems=p/10;
+ cout << "\r[";
+ for ( int i=0;i<10;i++ )
+ {
+ cout << ( ( i<numProgressItems ) ?"#":" " );
+ }
+ cout<< "] " <<setw ( 3 ) <<p<<"%, "<<count << " / " << total << " " <<flush;
+ if ( p==100 )
+ {
+ cout << endl;
+ }
+}
+
+void HLCmdLineApp::printCurrentAction ( const string&outfilePath,
+ int total, int count, int countWidth )
+{
+ cout << "Writing file "
+ << setw ( countWidth ) << count
+ << " of "
+ << total
+ << ": "
+ << outfilePath
+ << "\n";
+}
+
+void HLCmdLineApp::printIOErrorReport ( unsigned int numberErrorFiles,
+ vector<string> & fileList,
+ const string &action )
+{
+ cerr << "highlight: Could not "
+ << action
+ << " file"
+ << ( ( numberErrorFiles>1 ) ?"s":"" ) <<":\n";
+ copy ( fileList.begin(), fileList.end(), ostream_iterator<string> ( cerr, "\n" ) );
+ if ( fileList.size() < numberErrorFiles )
+ {
+ cerr << "... ["
+ << ( numberErrorFiles - fileList.size() )
+ << " of "
+ << numberErrorFiles
+ << " failures not shown, use --"
+ << OPT_VERBOSE
+ << " switch to print all failures]\n";
+ }
+}
+
+string HLCmdLineApp::analyzeFile ( const string& file )
+{
+ string firstLine;
+
+ if ( !file.empty() )
+ {
+ ifstream inFile ( file.c_str() );
+ getline ( inFile, firstLine );
+ }
+ else
+ {
+ // This copies all the data to a new buffer, uses the data to get the
+ // first line, then makes cin use the new buffer that underlies the
+ // stringstream instance
+ cin_bufcopy << cin.rdbuf();
+ getline ( cin_bufcopy, firstLine );
+ cin_bufcopy.seekg ( 0, ios::beg );
+ cin.rdbuf ( cin_bufcopy.rdbuf() );
+ }
+ StringMap::iterator it;
+ for ( it=scriptShebangs.begin(); it!=scriptShebangs.end();it++ )
+ {
+ if ( Pattern::matches ( it->first, firstLine ) ) return it->second;
+ }
+ return "";
+}
+
+string HLCmdLineApp::guessFileType ( const string& suffix, const string &inputFile )
+{
+ string lcSuffix = StringTools::change_case ( suffix );
+ string fileType = ( extensions.count ( lcSuffix ) ) ? extensions[lcSuffix] : lcSuffix ;
+ if ( !fileType.empty() ) return fileType;
+ return analyzeFile ( inputFile );
+}
+
+
+int HLCmdLineApp::run ( const int argc, const char*argv[] )
+{
+
+ CmdLineOptions options ( argc, argv );
+
+ // set data directory path, where /langDefs and /themes reside
+ string dataDirPath = ( options.getDataDir().empty() ) ? Platform::getAppPath() :options.getDataDir();
+
+ if ( options.printVersion() )
+ {
+ printVersionInfo();
+ return EXIT_SUCCESS;
+ }
+
+
+
+
+ dataDir.setAdditionalDataDir ( options.getAdditionalDataDir() );
+ dataDir.setAdditionalConfDir ( options.getAdditionalConfDir() );
+
+ if ( ! dataDir.searchDataDir ( dataDirPath ) )
+ {
+ printBadInstallationInfo();
+ return EXIT_FAILURE;
+ }
+
+ if ( options.printHelp() )
+ {
+ Help::printHelp();
+ return EXIT_SUCCESS;
+ }
+
+ if ( options.printConfigInfo() )
+ {
+ printConfigInfo ( options.getConfigFilePath() );
+ return EXIT_SUCCESS;
+ }
+
+ if ( options.showThemes() )
+ {
+ return printInstalledThemes() ?EXIT_SUCCESS:EXIT_FAILURE;
+ }
+
+ //call before printInstalledLanguages!
+ loadFileTypeConfig ( "filetypes", &extensions, &scriptShebangs );
+
+ if ( options.showLangdefs() )
+ {
+ return printInstalledLanguages() ?EXIT_SUCCESS:EXIT_FAILURE;
+ }
+
+ const vector <string> inFileList=options.getInputFileNames();
+
+ if ( options.enableBatchMode() && inFileList[0].empty() )
+ {
+ return EXIT_FAILURE;
+ }
+
+ string themePath=dataDir.getThemePath ( options.getThemeName() );
+
+ auto_ptr<highlight::CodeGenerator> generator ( highlight::CodeGenerator::getInstance ( options.getOutputType() ) );
+
+
+ generator->setHTMLAttachAnchors ( options.attachLineAnchors() );
+ generator->setHTMLOrderedList ( options.orderedList() );
+ generator->setHTMLInlineCSS ( options.inlineCSS() );
+ generator->setHTMLEnclosePreTag ( options.enclosePreTag() );
+ generator->setHTMLAnchorPrefix ( options.getAnchorPrefix() );
+ generator->setHTMLClassName ( options.getClassName() );
+
+ generator->setLATEXReplaceQuotes ( options.replaceQuotes() );
+ generator->setLATEXNoShorthands ( options.disableBabelShorthands() );
+ generator->setLATEXPrettySymbols ( options.prettySymbols() );
+
+ generator->setRTFPageSize ( options.getPageSize() );
+ generator->setRTFCharStyles ( options.includeCharStyles() );
+
+ generator->setSVGSize ( options.getSVGWidth(), options.getSVGHeight() );
+
+ if (options.useCRDelimiter())
+ generator->setEOLDelimiter('\r');
+
+ generator->setValidateInput ( options.validateInput() );
+ generator->setStyleInputPath ( options.getStyleInFilename() );
+ generator->setStyleOutputPath ( options.getStyleOutFilename() );
+ generator->setIncludeStyle ( options.includeStyleDef() );
+ generator->setPrintLineNumbers ( options.printLineNumbers(), options.getNumberStart() );
+ generator->setPrintZeroes ( options.fillLineNrZeroes() );
+ generator->setFragmentCode ( options.fragmentOutput() );
+ generator->setPreformatting ( options.getWrappingStyle(),
+ ( generator->getPrintLineNumbers() ) ?
+ options.getLineLength() - options.getNumberWidth() : options.getLineLength(),
+ options.getNumberSpaces() );
+
+ generator->setEncoding ( options.getEncoding() );
+ generator->setBaseFont ( options.getBaseFont() ) ;
+ generator->setBaseFontSize ( options.getBaseFontSize() ) ;
+ generator->setLineNumberWidth ( options.getNumberWidth() );
+ generator->setStartingNestedLang( options.getStartNestedLang());
+ generator->disableTrailingNL(options.disableTrailingNL());
+
+ bool styleFileWanted = !options.fragmentOutput() || options.styleOutPathDefined();
+
+ if ( !generator->initTheme ( themePath ) )
+ {
+ cerr << "highlight: Could not find style "
+ << themePath
+ << ".\n";
+ return EXIT_FAILURE;
+ }
+
+ if ( options.printOnlyStyle() )
+ {
+ if (!options.formatSupportsExtStyle()){
+ cerr << "highlight: output format supports no external styles.\n";
+ return EXIT_FAILURE;
+ }
+ bool useStdout = options.getStyleOutFilename() =="stdout";
+ string cssOutFile=options.getOutDirectory() + options.getStyleOutFilename();
+ bool success=generator->printExternalStyle ( useStdout?"":cssOutFile );
+ if ( !success )
+ {
+ cerr << "highlight: Could not write " << cssOutFile <<".\n";
+ return EXIT_FAILURE;
+ }
+ return EXIT_SUCCESS;
+ }
+
+ bool formattingEnabled = generator->initIndentationScheme ( options.getIndentScheme() );
+
+ if ( !formattingEnabled && !options.getIndentScheme().empty() )
+ {
+ cerr << "highlight: Undefined indentation scheme "
+ << options.getIndentScheme()
+ << ".\n";
+ return EXIT_FAILURE;
+ }
+
+ if ( !options.getTagsFile().empty() )
+ {
+ if ( !generator->initTagInformation ( options.getTagsFile() ) )
+ {
+ cerr << "highlight: Could not load ctags file "
+ << options.getTagsFile()
+ << ".\n";
+ return EXIT_FAILURE;
+ }
+ }
+
+ string outDirectory = options.getOutDirectory();
+#ifndef WIN32
+ ifstream dirTest ( outDirectory.c_str() );
+ if ( !outDirectory.empty() && !options.quietMode() && !dirTest )
+ {
+ cerr << "highlight: Output directory \""
+ << outDirectory
+ << "\" does not exist.\n";
+ return EXIT_FAILURE;
+ }
+ dirTest.close();
+#endif
+
+ map <int,string> markedLines = options.getMarkLines();
+ if ( !markedLines.empty() )
+ {
+ map<int, string>::iterator it;
+ for ( it=markedLines.begin(); it!=markedLines.end();it++ )
+ {
+ generator->addMarkedLine ( it->first, it->second );
+ }
+ }
+
+ bool initError=false, IOError=false;
+ unsigned int fileCount=inFileList.size(),
+ fileCountWidth=getNumDigits ( fileCount ),
+ i=0,
+ numBadFormatting=0,
+ numBadInput=0,
+ numBadOutput=0;
+
+ vector<string> badFormattedFiles, badInputFiles, badOutputFiles;
+ string inFileName, outFilePath;
+ string suffix, lastSuffix;
+
+ if ( options.syntaxGiven() ) // user defined language definition, valid for all files
+ {
+ suffix = guessFileType ( options.getLanguage() );
+ }
+
+ while ( i < fileCount && !initError )
+ {
+ if ( !options.syntaxGiven() ) // determine file type for each file
+ {
+ suffix = guessFileType ( getFileSuffix ( inFileList[i] ), inFileList[i] );
+ }
+ if ( suffix.empty() )
+ {
+ if ( !options.enableBatchMode() )
+ cerr << "highlight: Undefined language definition. Use --"
+ << OPT_SYNTAX << " option.\n";
+ if ( !options.forceOutput() )
+ {
+ initError = true;
+ break;
+ }
+ }
+
+ if ( suffix != lastSuffix )
+ {
+ string langDefPath=dataDir.getLangPath ( suffix+".lang" );
+ highlight::LoadResult loadRes= generator->loadLanguage ( langDefPath );
+ if ( loadRes==highlight::LOAD_FAILED_REGEX )
+ {
+ cerr << "highlight: Regex error ( "
+ << generator->getLanguage().getFailedRegex()
+ << " ) in "<<suffix<<".lang\n";
+ initError = true;
+ break;
+ }
+ else if ( loadRes==highlight::LOAD_FAILED )
+ {
+ // do also ignore error msg if --syntax parameter should be skipped
+ if ( ! (options.quietMode() || options.isSkippedExt ( suffix )) )
+ {
+ cerr << "highlight: Unknown source file extension \""
+ << suffix
+ << "\".\n";
+ }
+ if ( !options.forceOutput() )
+ {
+ initError = true;
+ break;
+ }
+ }
+ if ( options.printDebugInfo() && loadRes==highlight::LOAD_NEW )
+ {
+ printDebugInfo ( generator->getLanguage(), langDefPath );
+ }
+ lastSuffix = suffix;
+ }
+
+ string::size_type pos= ( inFileList[i] ).find_last_of ( Platform::pathSeparator );
+ inFileName = inFileList[i].substr ( pos+1 );
+
+ if ( options.enableBatchMode() )
+ {
+ outFilePath = outDirectory;
+ outFilePath += inFileName;
+ outFilePath += options.getOutFileSuffix();
+
+ if ( !options.quietMode() )
+ {
+ if ( options.printProgress() )
+ {
+ printProgressBar ( fileCount, i+1 );
+ }
+ else
+ {
+ printCurrentAction ( outFilePath, fileCount, i+1, fileCountWidth );
+ }
+ }
+ }
+ else
+ {
+ outFilePath = options.getSingleOutFilename();
+ if ( outFilePath.size() && outFilePath==options.getSingleInFilename() )
+ {
+ cerr << "highlight: Output path equals input path: \""
+ << outFilePath << "\".\n";
+ initError = true;
+ break;
+ }
+
+ }
+
+ if ( options.useFNamesAsAnchors() )
+ {
+ generator->setHTMLAnchorPrefix ( inFileName );
+ }
+
+ generator->setTitle ( options.getDocumentTitle().empty() ?
+ inFileList[i]:options.getDocumentTitle() );
+
+ generator->setKeyWordCase ( options.getKeywordCase() );
+
+ highlight::ParseError error = generator->generateFile ( inFileList[i], outFilePath );
+
+ if ( error==highlight::BAD_INPUT )
+ {
+ if ( numBadInput++ < IO_ERROR_REPORT_LENGTH || options.printDebugInfo() )
+ {
+ badInputFiles.push_back ( inFileList[i] );
+ }
+ }
+ else if ( error==highlight::BAD_OUTPUT )
+ {
+ if ( numBadOutput++ < IO_ERROR_REPORT_LENGTH || options.printDebugInfo() )
+ {
+ badOutputFiles.push_back ( outFilePath );
+ }
+ }
+ if ( formattingEnabled && !generator->formattingIsPossible() )
+ {
+ if ( numBadFormatting++ < IO_ERROR_REPORT_LENGTH || options.printDebugInfo() )
+ {
+ badFormattedFiles.push_back ( outFilePath );
+ }
+ }
+ ++i;
+ }
+
+
+ if ( i && !options.includeStyleDef()
+ && styleFileWanted
+ && options.formatSupportsExtStyle() )
+ {
+ string cssOutFile=outDirectory + options.getStyleOutFilename();
+ bool success=generator->printExternalStyle ( cssOutFile );
+ if ( !success )
+ {
+ cerr << "highlight: Could not write " << cssOutFile <<".\n";
+ IOError = true;
+ }
+ }
+
+ if ( i && options.printIndexFile() )
+ {
+ bool success=generator -> printIndexFile ( inFileList, outDirectory );
+ if ( !success )
+ {
+ cerr << "highlight: Could not write index file.\n";
+ IOError = true;
+ }
+ }
+
+ if ( numBadInput )
+ {
+ printIOErrorReport ( numBadInput, badInputFiles, "read input" );
+ IOError = true;
+ }
+ if ( numBadOutput )
+ {
+ printIOErrorReport ( numBadOutput, badOutputFiles, "write output" );
+ IOError = true;
+ }
+ if ( numBadFormatting )
+ {
+ printIOErrorReport ( numBadFormatting, badFormattedFiles, "reformat" );
+ }
+ return ( initError || IOError ) ? EXIT_FAILURE : EXIT_SUCCESS;
+}
+
+int main ( const int argc, const char *argv[] )
+{
+ HLCmdLineApp app;
+ return app.run ( argc, argv );
+}
diff --git a/support/highlight/src/cli/main.h b/support/highlight/src/cli/main.h
new file mode 100644
index 0000000000..2839e5c9fd
--- /dev/null
+++ b/support/highlight/src/cli/main.h
@@ -0,0 +1,117 @@
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#ifndef HIGHLIGHT_APP
+#define HIGHLIGHT_APP
+
+
+#include <iostream>
+#include <fstream>
+#include <string>
+#include <vector>
+#include <map>
+#include <iomanip>
+#include <cassert>
+
+//#include "./dirstream0.4/dirstream.h"
+#include "cmdlineoptions.h"
+#include "configurationreader.h"
+#include "codegenerator.h"
+#include "help.h"
+#include "datadir.h"
+#include "version.h"
+#include "platform_fs.h"
+
+#define IO_ERROR_REPORT_LENGTH 5
+#define SHEBANG_CNT 12
+
+typedef map<string, string> StringMap;
+
+/// Main application class of the command line interface
+
+class HLCmdLineApp
+{
+
+ public:
+
+ HLCmdLineApp() {};
+ ~HLCmdLineApp() {};
+
+ /** Start application
+ \param argc Number of command line arguments
+ \param argv values of command line arguments
+ \return EXIT_SUCCESS or EXIT_FAILURE
+ */
+ int run ( const int argc, const char *argv[] );
+
+ private:
+
+ DataDir dataDir;
+ StringMap extensions;
+ StringMap scriptShebangs;
+ stringstream cin_bufcopy;
+
+ /** print version info*/
+ void printVersionInfo();
+
+ /** print configuration info*/
+ void printConfigInfo ( const string& );
+
+ /** print error message*/
+ void printBadInstallationInfo();
+
+ /** print input and output errors */
+ void printIOErrorReport ( unsigned int numberErrorFiles, vector<string> & fileList, const string &action );
+
+ /** list installed theme files
+ \return true if theme files were found
+ */
+ bool printInstalledThemes();
+
+ /** list installed language definition files
+ \return true if lang files were found
+ */
+ bool printInstalledLanguages();
+
+ /** print debug information
+ \param lang language definition
+ \param langDefPath path to language definition
+ */
+ void printDebugInfo ( const highlight::LanguageDefinition &lang,
+ const string &langDefPath );
+
+ string getFileSuffix ( const string &fileName );
+
+ string guessFileType ( const string &suffix, const string &inputFile="" );
+
+ int getNumDigits ( int i );
+
+ void printProgressBar ( int total, int count );
+ void printCurrentAction ( const string&outfilePath,
+ int total, int count, int countWidth );
+
+ bool readInputFilePaths ( vector<string> &fileList, string wildcard,
+ bool recursiveSearch );
+
+ string analyzeFile ( const string& file );
+ bool loadFileTypeConfig ( const string& name, StringMap* map, StringMap* shebangMap );
+
+};
+
+#endif
diff --git a/support/highlight/src/core/ansigenerator.cpp b/support/highlight/src/core/ansigenerator.cpp
new file mode 100644
index 0000000000..5c3133619a
--- /dev/null
+++ b/support/highlight/src/core/ansigenerator.cpp
@@ -0,0 +1,109 @@
+/***************************************************************************
+ ansigenerator.cpp - description
+ -------------------
+ begin : Jul 5 2004
+ copyright : (C) 2004-2007 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#include <sstream>
+
+#include "ansigenerator.h"
+
+using namespace std;
+
+namespace highlight
+{
+
+ string AnsiGenerator::getOpenTag ( const string&font,
+ const string&fgCol, const string&bgCol )
+ {
+ ostringstream s;
+ s << "\033["<<font;
+ if ( !fgCol.empty() )
+ s<<";"<<fgCol;
+ if ( !bgCol.empty() )
+ s<<";"<<bgCol;
+ s << "m";
+ return s.str();
+ }
+
+
+ AnsiGenerator::AnsiGenerator() : CodeGenerator ( ANSI )
+ {
+
+ newLineTag = "\n";
+ spacer = " ";
+ }
+
+ AnsiGenerator::~AnsiGenerator() {}
+
+ void AnsiGenerator::initOutputTags(){
+ openTags.push_back ( "" );
+ openTags.push_back ( getOpenTag ( "00", "31" ) ); //str
+ openTags.push_back ( getOpenTag ( "00", "34" ) );//number
+ openTags.push_back ( getOpenTag ( "00", "34" ) );//sl comment
+ openTags.push_back ( getOpenTag ( "00", "34" ) );//ml comment
+ openTags.push_back ( getOpenTag ( "00", "35" ) );//escapeChar
+ openTags.push_back ( getOpenTag ( "00", "35" ) );//directive
+ openTags.push_back ( getOpenTag ( "00", "31" ) );//directive string
+ openTags.push_back ( getOpenTag ( "00", "30" ) );//linenum
+ openTags.push_back ( getOpenTag ( "00", "00" ) );//symbol
+
+ closeTags.push_back ( "" );
+ for ( int i=1;i<NUMBER_BUILTIN_STATES; i++ )
+ {
+ closeTags.push_back ( "\033[m" );
+ }
+ }
+
+ string AnsiGenerator::getHeader()
+ {
+ return string();
+ }
+
+ void AnsiGenerator::printBody()
+ {
+ processRootState();
+ }
+
+ string AnsiGenerator::getFooter()
+ {
+ return string();
+ }
+
+ string AnsiGenerator::maskCharacter ( unsigned char c )
+ {
+ return string ( 1, c );
+ }
+
+ string AnsiGenerator::getKeywordOpenTag ( unsigned int styleID )
+ {
+ return ( styleID ) ?getOpenTag ( "00", "32", "" ) :getOpenTag ( "00", "33" );
+ }
+
+ string AnsiGenerator::getKeywordCloseTag ( unsigned int styleID )
+ {
+ return "\033[m";
+ }
+
+}
diff --git a/support/highlight/src/core/ansigenerator.h b/support/highlight/src/core/ansigenerator.h
new file mode 100644
index 0000000000..51ac965a5c
--- /dev/null
+++ b/support/highlight/src/core/ansigenerator.h
@@ -0,0 +1,89 @@
+/***************************************************************************
+ ansicode.h - description
+ -------------------
+ begin : Jul 5 2004
+ copyright : (C) 2004-2007 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#ifndef ANSIGENERATOR_H
+#define ANSIGENERATOR_H
+
+#include <string>
+
+#include "codegenerator.h"
+#include "charcodes.h"
+#include "version.h"
+
+namespace highlight
+{
+
+ /**
+ \brief This class generates ANSI escape sequences.
+
+ It contains information about the resulting document structure (document
+ header and footer), the colour system, white space handling and text
+ formatting attributes.
+
+ * @author Andre Simon
+ */
+
+ class AnsiGenerator : public highlight::CodeGenerator
+ {
+ public:
+ AnsiGenerator();
+ ~AnsiGenerator();
+
+ /** prints document header
+ */
+ string getHeader();
+
+ /** Prints document footer*/
+ string getFooter();
+
+ /** Prints document body*/
+ void printBody();
+
+ private:
+
+ /** \return escaped character*/
+ virtual string maskCharacter ( unsigned char );
+
+
+ /** gibt ANSI-"Tags" zurueck (Farbindex+bold+kursiv)*/
+ string getOpenTag ( const string&font,
+ const string&fgCol, const string&bgCol="" );
+
+ /** initialize tags in specific format according to colouring information provided in DucumentStyle */
+ void initOutputTags();
+
+ /** @param styleID current style ID
+ @return matching sequence to begin a new element formatting*/
+ string getKeywordOpenTag ( unsigned int styleID );
+
+ /** @param styleID current style ID
+ @return matching sequence to stop element formatting*/
+ string getKeywordCloseTag ( unsigned int styleID );
+ };
+
+}
+#endif
diff --git a/support/highlight/src/core/astyle/ASBeautifier.cpp b/support/highlight/src/core/astyle/ASBeautifier.cpp
new file mode 100644
index 0000000000..899d46d16b
--- /dev/null
+++ b/support/highlight/src/core/astyle/ASBeautifier.cpp
@@ -0,0 +1,2658 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Copyright (C) 2006-2010 by Jim Pattee <jimp03@email.com>
+ * Copyright (C) 1998-2002 by Tal Davidson
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>
+ *
+ * This file is a part of Artistic Style - an indentation and
+ * reformatting tool for C, C++, C# and Java source files.
+ * <http://astyle.sourceforge.net>
+ *
+ * Artistic Style is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Artistic Style is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Artistic Style. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ */
+
+#include "astyle.h"
+
+#include <algorithm>
+#include <iostream>
+
+
+namespace astyle
+{
+// static member variables
+int ASBeautifier::beautifierFileType = 9; // initialized with an invalid type
+vector<const string*>* ASBeautifier::headers = NULL;
+vector<const string*>* ASBeautifier::nonParenHeaders = NULL;
+vector<const string*>* ASBeautifier::preBlockStatements;
+vector<const string*>* ASBeautifier::assignmentOperators = NULL;
+vector<const string*>* ASBeautifier::nonAssignmentOperators;
+vector<const string*>* ASBeautifier::indentableHeaders;
+
+
+/**
+ * ASBeautifier's constructor
+ */
+ASBeautifier::ASBeautifier()
+{
+ waitingBeautifierStack = NULL;
+ activeBeautifierStack = NULL;
+ waitingBeautifierStackLengthStack = NULL;
+ activeBeautifierStackLengthStack = NULL;
+
+ headerStack = NULL;
+ tempStacks = NULL;
+ blockParenDepthStack = NULL;
+ blockStatementStack = NULL;
+ parenStatementStack = NULL;
+ bracketBlockStateStack = NULL;
+ inStatementIndentStack = NULL;
+ inStatementIndentStackSizeStack = NULL;
+ parenIndentStack = NULL;
+ sourceIterator = NULL;
+ isIndentManuallySet = false;
+ isMinConditionalManuallySet = false;
+ isModeManuallySet = false;
+ shouldForceTabIndentation = false;
+ setSpaceIndentation(4); // also sets minConditionalIndent
+ setMaxInStatementIndentLength(40);
+ classInitializerTabs = 1;
+ setClassIndent(false);
+ setSwitchIndent(false);
+ setCaseIndent(false);
+ setBlockIndent(false);
+ setBracketIndent(false);
+ setNamespaceIndent(false);
+ setLabelIndent(false);
+ setEmptyLineFill(false);
+ setCStyle();
+ setPreprocessorIndent(false);
+
+ // initialize ASBeautifier static member vectors
+ beautifierFileType = 9; // reset to an invalid type
+ initVector(headers);
+ initVector(nonParenHeaders);
+ initVector(assignmentOperators);
+ initVector(nonAssignmentOperators);
+ initVector(preBlockStatements);
+ initVector(indentableHeaders);
+}
+
+/**
+ * ASBeautifier's copy constructor
+ * must explicitly call the base class copy constructor
+ */
+ASBeautifier::ASBeautifier(const ASBeautifier &other) : ASBase(other)
+{
+ // these don't need to copy the stack
+ waitingBeautifierStack = NULL;
+ activeBeautifierStack = NULL;
+ waitingBeautifierStackLengthStack = NULL;
+ activeBeautifierStackLengthStack = NULL;
+
+ // vector '=' operator performs a DEEP copy of all elements in the vector
+
+ headerStack = new vector<const string*>;
+ *headerStack = *other.headerStack;
+
+ //tempStacks = new vector<vector<const string*>*>;
+ //vector<vector<const string*>*>::iterator iter;
+ //for (iter = other.tempStacks->begin();
+ // iter != other.tempStacks->end();
+ // ++iter)
+ //{
+ // vector<const string*> *newVec = new vector<const string*>;
+ // *newVec = **iter;
+ // tempStacks->push_back(newVec);
+ //}
+ tempStacks = copyTempStacks(other);
+
+ blockParenDepthStack = new vector<int>;
+ *blockParenDepthStack = *other.blockParenDepthStack;
+
+ blockStatementStack = new vector<bool>;
+ *blockStatementStack = *other.blockStatementStack;
+
+ parenStatementStack = new vector<bool>;
+ *parenStatementStack = *other.parenStatementStack;
+
+ bracketBlockStateStack = new vector<bool>;
+ *bracketBlockStateStack = *other.bracketBlockStateStack;
+
+ inStatementIndentStack = new vector<int>;
+ *inStatementIndentStack = *other.inStatementIndentStack;
+
+ inStatementIndentStackSizeStack = new vector<int>;
+ *inStatementIndentStackSizeStack = *other.inStatementIndentStackSizeStack;
+
+ parenIndentStack = new vector<int>;
+ *parenIndentStack = *other.parenIndentStack;
+
+ sourceIterator = other.sourceIterator;
+
+ // protected variables
+ // variables set by ASFormatter
+ // must also be updated in activeBeautifierStack
+ inLineNumber = other.inLineNumber;
+ horstmannIndentInStatement = other.horstmannIndentInStatement;
+ nonInStatementBracket = other.nonInStatementBracket;
+ lineCommentNoBeautify = other.lineCommentNoBeautify;
+ isNonInStatementArray = other.isNonInStatementArray;
+ isSharpAccessor = other.isSharpAccessor;
+ isSharpDelegate = other.isSharpDelegate;
+ isInExtern = other.isInExtern;
+ isInBeautifySQL = other.isInBeautifySQL;
+ isInIndentableStruct = other.isInIndentableStruct;
+
+ // private variables
+ indentString = other.indentString;
+ currentHeader = other.currentHeader;
+ previousLastLineHeader = other.previousLastLineHeader;
+ probationHeader = other.probationHeader;
+ isInQuote = other.isInQuote;
+ isInVerbatimQuote = other.isInVerbatimQuote;
+ haveLineContinuationChar = other.haveLineContinuationChar;
+ isInAsm = other.isInAsm;
+ isInAsmOneLine = other.isInAsmOneLine;
+ isInAsmBlock = other.isInAsmBlock;
+ isInComment = other.isInComment;
+ isInHorstmannComment = other.isInHorstmannComment;
+ isInCase = other.isInCase;
+ isInQuestion = other.isInQuestion;
+ isInStatement = other.isInStatement;
+ isInHeader = other.isInHeader;
+ isInTemplate = other.isInTemplate;
+ isInDefine = other.isInDefine;
+ isInDefineDefinition = other.isInDefineDefinition;
+ classIndent = other.classIndent;
+ isInClassInitializer = other.isInClassInitializer;
+ isInClassHeaderTab = other.isInClassHeaderTab;
+ isInEnum = other.isInEnum;
+ switchIndent = other.switchIndent;
+ caseIndent = other.caseIndent;
+ namespaceIndent = other.namespaceIndent;
+ bracketIndent = other.bracketIndent;
+ blockIndent = other.blockIndent;
+ labelIndent = other.labelIndent;
+ preprocessorIndent = other.preprocessorIndent;
+ isInConditional = other.isInConditional;
+ isIndentManuallySet = other.isIndentManuallySet;
+ isMinConditionalManuallySet = other.isMinConditionalManuallySet;
+ isModeManuallySet = other.isModeManuallySet;
+ shouldForceTabIndentation = other.shouldForceTabIndentation;
+ emptyLineFill = other.emptyLineFill;
+ lineOpensComment = other.lineOpensComment;
+ backslashEndsPrevLine = other.backslashEndsPrevLine;
+ blockCommentNoIndent = other.blockCommentNoIndent;
+ blockCommentNoBeautify = other.blockCommentNoBeautify;
+ previousLineProbationTab = other.previousLineProbationTab;
+ fileType = other.fileType;
+ minConditionalIndent = other.minConditionalIndent;
+ parenDepth = other.parenDepth;
+ indentLength = other.indentLength;
+ blockTabCount = other.blockTabCount;
+ maxInStatementIndent = other.maxInStatementIndent;
+ classInitializerTabs = other.classInitializerTabs;
+ templateDepth = other.templateDepth;
+ prevFinalLineSpaceTabCount = other.prevFinalLineSpaceTabCount;
+ prevFinalLineTabCount = other.prevFinalLineTabCount;
+ defineTabCount = other.defineTabCount;
+ quoteChar = other.quoteChar;
+ prevNonSpaceCh = other.prevNonSpaceCh;
+ currentNonSpaceCh = other.currentNonSpaceCh;
+ currentNonLegalCh = other.currentNonLegalCh;
+ prevNonLegalCh = other.prevNonLegalCh;
+}
+
+/**
+ * ASBeautifier's destructor
+ */
+ASBeautifier::~ASBeautifier()
+{
+ deleteContainer(waitingBeautifierStack);
+ deleteContainer(activeBeautifierStack);
+ deleteContainer(waitingBeautifierStackLengthStack);
+ deleteContainer(activeBeautifierStackLengthStack);
+ deleteContainer(headerStack);
+ deleteContainer(tempStacks);
+ deleteContainer(blockParenDepthStack);
+ deleteContainer(blockStatementStack);
+ deleteContainer(parenStatementStack);
+ deleteContainer(bracketBlockStateStack);
+ deleteContainer(inStatementIndentStack);
+ deleteContainer(inStatementIndentStackSizeStack);
+ deleteContainer(parenIndentStack);
+}
+
+/**
+ * initialize the ASBeautifier.
+ *
+ * init() should be called every time a ABeautifier object is to start
+ * beautifying a NEW source file.
+ * init() recieves a pointer to a ASSourceIterator object that will be
+ * used to iterate through the source code.
+ *
+ * @param iter a pointer to the ASSourceIterator or ASStreamIterator object.
+ */
+void ASBeautifier::init(ASSourceIterator *iter)
+{
+ sourceIterator = iter;
+ init();
+}
+
+/**
+ * initialize the ASBeautifier.
+ */
+void ASBeautifier::init()
+{
+ initStatic();
+ ASBase::init(getFileType());
+
+ initContainer(waitingBeautifierStack, new vector<ASBeautifier*>);
+ initContainer(activeBeautifierStack, new vector<ASBeautifier*>);
+
+ initContainer(waitingBeautifierStackLengthStack, new vector<int>);
+ initContainer(activeBeautifierStackLengthStack, new vector<int>);
+
+ initContainer(headerStack, new vector<const string*>);
+
+ initContainer(tempStacks, new vector<vector<const string*>*>);
+ tempStacks->push_back(new vector<const string*>);
+
+ initContainer(blockParenDepthStack, new vector<int>);
+ initContainer(blockStatementStack, new vector<bool>);
+ initContainer(parenStatementStack, new vector<bool>);
+
+ initContainer(bracketBlockStateStack, new vector<bool>);
+ bracketBlockStateStack->push_back(true);
+
+ initContainer(inStatementIndentStack, new vector<int>);
+ initContainer(inStatementIndentStackSizeStack, new vector<int>);
+ inStatementIndentStackSizeStack->push_back(0);
+ initContainer(parenIndentStack, new vector<int>);
+
+ previousLastLineHeader = NULL;
+ currentHeader = NULL;
+
+ isInQuote = false;
+ isInVerbatimQuote = false;
+ haveLineContinuationChar = false;
+ isInAsm = false;
+ isInAsmOneLine = false;
+ isInAsmBlock = false;
+ isInComment = false;
+ isInHorstmannComment = false;
+ isInStatement = false;
+ isInCase = false;
+ isInQuestion = false;
+ isInClassInitializer = false;
+ isInClassHeaderTab = false;
+ isInEnum = false;
+ isInHeader = false;
+ isInTemplate = false;
+ isInConditional = false;
+
+ templateDepth = 0;
+ parenDepth = 0;
+ blockTabCount = 0;
+ prevNonSpaceCh = '{';
+ currentNonSpaceCh = '{';
+ prevNonLegalCh = '{';
+ currentNonLegalCh = '{';
+ quoteChar = ' ';
+ prevFinalLineSpaceTabCount = 0;
+ prevFinalLineTabCount = 0;
+ probationHeader = NULL;
+ backslashEndsPrevLine = false;
+ lineOpensComment = false;
+ isInDefine = false;
+ isInDefineDefinition = false;
+ defineTabCount = 0;
+ lineCommentNoBeautify = false;
+ blockCommentNoIndent = false;
+ blockCommentNoBeautify = false;
+ previousLineProbationTab = false;
+ isNonInStatementArray = false;
+ isSharpAccessor = false;
+ isSharpDelegate = false;
+ isInExtern = false;
+ isInBeautifySQL = false;
+ isInIndentableStruct = false;
+ inLineNumber = 0;
+ horstmannIndentInStatement = 0;
+ nonInStatementBracket = 0;
+}
+
+/*
+ * initialize the static vars
+ */
+void ASBeautifier::initStatic()
+{
+ if (fileType == beautifierFileType) // don't build unless necessary
+ return;
+
+ beautifierFileType = fileType;
+
+ headers->clear();
+ nonParenHeaders->clear();
+ assignmentOperators->clear();
+ nonAssignmentOperators->clear();
+ preBlockStatements->clear();
+ indentableHeaders->clear();
+
+ ASResource::buildHeaders(headers, fileType, true);
+ ASResource::buildNonParenHeaders(nonParenHeaders, fileType, true);
+ ASResource::buildAssignmentOperators(assignmentOperators);
+ ASResource::buildNonAssignmentOperators(nonAssignmentOperators);
+ ASResource::buildPreBlockStatements(preBlockStatements, fileType);
+ ASResource::buildIndentableHeaders(indentableHeaders);
+}
+
+/**
+ * set indentation style to C/C++.
+ */
+void ASBeautifier::setCStyle()
+{
+ fileType = C_TYPE;
+}
+
+/**
+ * set indentation style to Java.
+ */
+void ASBeautifier::setJavaStyle()
+{
+ fileType = JAVA_TYPE;
+}
+
+/**
+ * set indentation style to C#.
+ */
+void ASBeautifier::setSharpStyle()
+{
+ fileType = SHARP_TYPE;
+}
+
+/**
+ * set mode manually set flag
+ */
+void ASBeautifier::setModeManuallySet(bool state)
+{
+ isModeManuallySet = state;
+}
+
+/**
+ * indent using one tab per indentation
+ */
+void ASBeautifier::setTabIndentation(int length, bool forceTabs)
+{
+ indentString = "\t";
+ indentLength = length;
+ shouldForceTabIndentation = forceTabs;
+
+ if (!isMinConditionalManuallySet)
+ minConditionalIndent = indentLength * 2;
+}
+
+/**
+ * indent using a number of spaces per indentation.
+ *
+ * @param length number of spaces per indent.
+ */
+void ASBeautifier::setSpaceIndentation(int length)
+{
+ indentString = string(length, ' ');
+ indentLength = length;
+
+ if (!isMinConditionalManuallySet)
+ minConditionalIndent = indentLength * 2;
+}
+
+/**
+ * set indent manually set flag
+ */
+void ASBeautifier::setIndentManuallySet(bool state)
+{
+ isIndentManuallySet = state;
+}
+
+/**
+ * set the maximum indentation between two lines in a multi-line statement.
+ *
+ * @param max maximum indentation length.
+ */
+void ASBeautifier::setMaxInStatementIndentLength(int max)
+{
+ maxInStatementIndent = max;
+}
+
+/**
+ * set the minimum indentation between two lines in a multi-line condition.
+ *
+ * @param min minimal indentation length.
+ */
+void ASBeautifier::setMinConditionalIndentLength(int min)
+{
+ minConditionalIndent = min;
+}
+
+/**
+ * set min conditional manually set flag
+ */
+void ASBeautifier::setMinConditionalManuallySet(bool state)
+{
+ isMinConditionalManuallySet = state;
+}
+
+/**
+ * set the state of the bracket indentation option. If true, brackets will
+ * be indented one additional indent.
+ *
+ * @param state state of option.
+ */
+void ASBeautifier::setBracketIndent(bool state)
+{
+ bracketIndent = state;
+}
+
+/**
+ * set the state of the block indentation option. If true, entire blocks
+ * will be indented one additional indent, similar to the GNU indent style.
+ *
+ * @param state state of option.
+ */
+void ASBeautifier::setBlockIndent(bool state)
+{
+ blockIndent = state;
+}
+
+/**
+ * set the state of the class indentation option. If true, C++ class
+ * definitions will be indented one additional indent.
+ *
+ * @param state state of option.
+ */
+void ASBeautifier::setClassIndent(bool state)
+{
+ classIndent = state;
+}
+
+/**
+ * set the state of the switch indentation option. If true, blocks of 'switch'
+ * statements will be indented one additional indent.
+ *
+ * @param state state of option.
+ */
+void ASBeautifier::setSwitchIndent(bool state)
+{
+ switchIndent = state;
+}
+
+/**
+ * set the state of the case indentation option. If true, lines of 'case'
+ * statements will be indented one additional indent.
+ *
+ * @param state state of option.
+ */
+void ASBeautifier::setCaseIndent(bool state)
+{
+ caseIndent = state;
+}
+
+/**
+ * set the state of the namespace indentation option.
+ * If true, blocks of 'namespace' statements will be indented one
+ * additional indent. Otherwise, NO indentation will be added.
+ *
+ * @param state state of option.
+ */
+void ASBeautifier::setNamespaceIndent(bool state)
+{
+ namespaceIndent = state;
+}
+
+/**
+ * set the state of the label indentation option.
+ * If true, labels will be indented one indent LESS than the
+ * current indentation level.
+ * If false, labels will be flushed to the left with NO
+ * indent at all.
+ *
+ * @param state state of option.
+ */
+void ASBeautifier::setLabelIndent(bool state)
+{
+ labelIndent = state;
+}
+
+/**
+ * set the state of the preprocessor indentation option.
+ * If true, multiline #define statements will be indented.
+ *
+ * @param state state of option.
+ */
+void ASBeautifier::setPreprocessorIndent(bool state)
+{
+ preprocessorIndent = state;
+}
+
+/**
+ * set the state of the empty line fill option.
+ * If true, empty lines will be filled with the whitespace.
+ * of their previous lines.
+ * If false, these lines will remain empty.
+ *
+ * @param state state of option.
+ */
+void ASBeautifier::setEmptyLineFill(bool state)
+{
+ emptyLineFill = state;
+}
+
+/**
+ * get the file type.
+ */
+int ASBeautifier::getFileType()
+{
+ return fileType;
+}
+
+/**
+ * get the number of spaces per indent
+ *
+ * @return value of indentLength option.
+ */
+int ASBeautifier::getIndentLength(void)
+{
+ return indentLength;
+}
+
+/**
+ * get the char used for indentation, space or tab
+ *
+ * @return the char used for indentation.
+ */
+string ASBeautifier::getIndentString(void)
+{
+ return indentString;
+}
+
+/**
+ * get indent manually set flag
+ */
+bool ASBeautifier::getIndentManuallySet()
+{
+ return isIndentManuallySet;
+}
+
+/**
+ * get the state of the isMinConditionalManuallySet flag
+ *
+ * @return the state of isMinConditionalManuallySet.
+ */
+bool ASBeautifier::getMinConditionalManuallySet()
+{
+ return isMinConditionalManuallySet;
+}
+
+/**
+ * get mode manually set flag
+ */
+bool ASBeautifier::getModeManuallySet()
+{
+ return isModeManuallySet;
+}
+
+/**
+ * get the state of the force tab indentation option.
+ *
+ * @return state of force tab indentation.
+ */
+bool ASBeautifier::getForceTabIndentation(void)
+{
+ return shouldForceTabIndentation;
+}
+
+/**
+ * get the state of the block indentation option.
+ *
+ * @return state of blockIndent option.
+ */
+bool ASBeautifier::getBlockIndent(void)
+{
+ return blockIndent;
+}
+
+/**
+ * get the state of the bracket indentation option.
+ *
+ * @return state of bracketIndent option.
+ */
+bool ASBeautifier::getBracketIndent(void)
+{
+ return bracketIndent;
+}
+
+/**
+ * get the state of the class indentation option. If true, blocks of
+ * the 'class' statement will be indented one additional indent.
+ *
+ * @return state of classIndent option.
+ */
+bool ASBeautifier::getClassIndent(void)
+{
+ return classIndent;
+}
+
+/**
+ * get the state of the switch indentation option. If true, blocks of
+ * the 'switch' statement will be indented one additional indent.
+ *
+ * @return state of switchIndent option.
+ */
+bool ASBeautifier::getSwitchIndent(void)
+{
+ return switchIndent;
+}
+
+/**
+ * get the state of the case indentation option. If true, lines of 'case'
+ * statements will be indented one additional indent.
+ *
+ * @return state of caseIndent option.
+ */
+bool ASBeautifier::getCaseIndent(void)
+{
+ return caseIndent;
+}
+
+/**
+ * get the state of the empty line fill option.
+ * If true, empty lines will be filled with the whitespace.
+ * of their previous lines.
+ * If false, these lines will remain empty.
+ *
+ * @return state of emptyLineFill option.
+ */
+bool ASBeautifier::getEmptyLineFill(void)
+{
+ return emptyLineFill;
+}
+
+/**
+ * check if there are any indented lines ready to be read by nextLine()
+ *
+ * @return are there any indented lines ready?
+ */
+bool ASBeautifier::hasMoreLines() const
+{
+ return sourceIterator->hasMoreLines();
+}
+
+/**
+ * get the next indented line.
+ *
+ * @return indented line.
+ */
+string ASBeautifier::nextLine()
+{
+ return beautify(sourceIterator->nextLine());
+}
+
+/**
+ * beautify a line of source code.
+ * every line of source code in a source code file should be sent
+ * one after the other to the beautify method.
+ *
+ * @return the indented line.
+ * @param originalLine the original unindented line.
+ */
+string ASBeautifier::beautify(const string &originalLine)
+{
+ string line;
+ bool isInLineComment = false;
+ bool lineStartsInComment = false;
+ bool isInClass = false;
+ bool isInSwitch = false;
+ bool isInOperator = false;
+ bool isSpecialChar = false;
+ bool haveCaseIndent = false;
+ bool haveAssignmentThisLine = false;
+ bool lineBeginsWithBracket = false;
+ bool closingBracketReached = false;
+ bool shouldIndentBrackettedLine = true;
+ bool previousLineProbation = (probationHeader != NULL);
+ bool isInQuoteContinuation = isInVerbatimQuote | haveLineContinuationChar;
+ char ch = ' ';
+ char prevCh;
+ char tempCh;
+ int tabCount = 0;
+ int spaceTabCount = 0;
+ int lineOpeningBlocksNum = 0;
+ int lineClosingBlocksNum = 0;
+ int tabIncrementIn = 0;
+ int i;
+ int iPrelim;
+ string outBuffer; // the newly idented line is buffered here
+ const string *lastLineHeader = NULL;
+
+ currentHeader = NULL;
+ lineStartsInComment = isInComment;
+ blockCommentNoBeautify = blockCommentNoIndent;
+ isInAsmOneLine = false;
+ lineOpensComment = false;
+ previousLineProbationTab = false;
+ haveLineContinuationChar = false;
+
+ // handle and remove white spaces around the line:
+ // If not in comment, first find out size of white space before line,
+ // so that possible comments starting in the line continue in
+ // relation to the preliminary white-space.
+ if (isInQuoteContinuation)
+ {
+ // trim a single space added by ASFormatter, otherwise leave it alone
+ if (!(originalLine.length() == 1 && originalLine[0] == ' '))
+ line = originalLine;
+ }
+ else if (isInComment || isInBeautifySQL)
+ {
+ // trim the end of comment and SQL lines
+ line = originalLine;
+ size_t trimEnd = line.find_last_not_of(" \t");
+ if (trimEnd == string::npos)
+ trimEnd = 0;
+ else
+ trimEnd++;
+ if (trimEnd < line.length())
+ line.erase(trimEnd);
+ }
+ else
+ {
+ line = trim(originalLine);
+ if (line.length() > 0 && line[0] == '{')
+ lineBeginsWithBracket = true;
+
+ isInHorstmannComment = false;
+ size_t j = line.find_first_not_of(" \t{");
+ if (j != string::npos && line.compare(j, 2, "/*") == 0)
+ {
+ lineOpensComment = true;
+ size_t k = line.find_first_not_of(" \t");
+ if (k != string::npos && line.compare(k, 1, "{") == 0)
+ isInHorstmannComment = true;
+ }
+ }
+
+ if (line.length() == 0)
+ {
+ if (backslashEndsPrevLine) // must continue to clear variables
+ line = ' ';
+ else if (emptyLineFill && !isInQuoteContinuation && headerStack->size() > 0)
+ return preLineWS(prevFinalLineSpaceTabCount, prevFinalLineTabCount);
+ else
+ return line;
+ }
+
+ // handle preprocessor commands
+ // except C# region and endregion
+
+ if (!isInComment
+ && (line[0] == '#' || backslashEndsPrevLine)
+ && line.compare(0, 7, "#region") != 0
+ && line.compare(0, 10, "#endregion") != 0)
+ {
+ if (line[0] == '#')
+ {
+ string preproc = trim(string(line.c_str() + 1));
+
+ // When finding a multi-lined #define statement, the original beautifier
+ // 1. sets its isInDefineDefinition flag
+ // 2. clones a new beautifier that will be used for the actual indentation
+ // of the #define. This clone is put into the activeBeautifierStack in order
+ // to be called for the actual indentation.
+ // The original beautifier will have isInDefineDefinition = true, isInDefine = false
+ // The cloned beautifier will have isInDefineDefinition = true, isInDefine = true
+ if (preprocessorIndent && preproc.compare(0, 6, "define") == 0 && line[line.length() - 1] == '\\')
+ {
+ if (!isInDefineDefinition)
+ {
+ ASBeautifier *defineBeautifier;
+
+ // this is the original beautifier
+ isInDefineDefinition = true;
+
+ // push a new beautifier into the active stack
+ // this beautifier will be used for the indentation of this define
+ defineBeautifier = new ASBeautifier(*this);
+ activeBeautifierStack->push_back(defineBeautifier);
+ }
+ else
+ {
+ // the is the cloned beautifier that is in charge of indenting the #define.
+ isInDefine = true;
+ }
+ }
+ else if (preproc.compare(0, 2, "if") == 0)
+ {
+ // push a new beautifier into the stack
+ waitingBeautifierStackLengthStack->push_back(waitingBeautifierStack->size());
+ activeBeautifierStackLengthStack->push_back(activeBeautifierStack->size());
+ waitingBeautifierStack->push_back(new ASBeautifier(*this));
+ }
+ else if (preproc.compare(0, 4/*2*/, "else") == 0)
+ {
+ if (waitingBeautifierStack && !waitingBeautifierStack->empty())
+ {
+ // MOVE current waiting beautifier to active stack.
+ activeBeautifierStack->push_back(waitingBeautifierStack->back());
+ waitingBeautifierStack->pop_back();
+ }
+ }
+ else if (preproc.compare(0, 4, "elif") == 0)
+ {
+ if (waitingBeautifierStack && !waitingBeautifierStack->empty())
+ {
+ // append a COPY current waiting beautifier to active stack, WITHOUT deleting the original.
+ activeBeautifierStack->push_back(new ASBeautifier(*(waitingBeautifierStack->back())));
+ }
+ }
+ else if (preproc.compare(0, 5, "endif") == 0)
+ {
+ int stackLength;
+ ASBeautifier *beautifier;
+
+ if (waitingBeautifierStackLengthStack && !waitingBeautifierStackLengthStack->empty())
+ {
+ stackLength = waitingBeautifierStackLengthStack->back();
+ waitingBeautifierStackLengthStack->pop_back();
+ while ((int) waitingBeautifierStack->size() > stackLength)
+ {
+ beautifier = waitingBeautifierStack->back();
+ waitingBeautifierStack->pop_back();
+ delete beautifier;
+ }
+ }
+
+ if (!activeBeautifierStackLengthStack->empty())
+ {
+ stackLength = activeBeautifierStackLengthStack->back();
+ activeBeautifierStackLengthStack->pop_back();
+ while ((int) activeBeautifierStack->size() > stackLength)
+ {
+ beautifier = activeBeautifierStack->back();
+ activeBeautifierStack->pop_back();
+ delete beautifier;
+ }
+ }
+ }
+ }
+
+ // check if the last char is a backslash
+ if (line.length() > 0)
+ backslashEndsPrevLine = (line[line.length() - 1] == '\\');
+ else
+ backslashEndsPrevLine = false;
+
+ // check if this line ends a multi-line #define
+ // if so, use the #define's cloned beautifier for the line's indentation
+ // and then remove it from the active beautifier stack and delete it.
+ if (!backslashEndsPrevLine && isInDefineDefinition && !isInDefine)
+ {
+ string beautifiedLine;
+ ASBeautifier *defineBeautifier;
+
+ isInDefineDefinition = false;
+ defineBeautifier = activeBeautifierStack->back();
+ activeBeautifierStack->pop_back();
+
+ beautifiedLine = defineBeautifier->beautify(line);
+ delete defineBeautifier;
+ return beautifiedLine;
+ }
+
+ // unless this is a multi-line #define, return this precompiler line as is.
+ if (!isInDefine && !isInDefineDefinition)
+ return originalLine;
+ }
+
+ // if there exists any worker beautifier in the activeBeautifierStack,
+ // then use it instead of me to indent the current line.
+ // variables set by ASFormatter must be updated.
+ if (!isInDefine && activeBeautifierStack != NULL && !activeBeautifierStack->empty())
+ {
+ activeBeautifierStack->back()->inLineNumber = inLineNumber;
+ activeBeautifierStack->back()->horstmannIndentInStatement = horstmannIndentInStatement;
+ activeBeautifierStack->back()->nonInStatementBracket = nonInStatementBracket;
+ activeBeautifierStack->back()->lineCommentNoBeautify = lineCommentNoBeautify;
+ activeBeautifierStack->back()->isNonInStatementArray = isNonInStatementArray;
+ activeBeautifierStack->back()->isSharpAccessor = isSharpAccessor;
+ activeBeautifierStack->back()->isSharpDelegate = isSharpDelegate;
+ activeBeautifierStack->back()->isInExtern = isInExtern;
+ activeBeautifierStack->back()->isInBeautifySQL = isInBeautifySQL;
+ activeBeautifierStack->back()->isInIndentableStruct = isInIndentableStruct;
+ // must return originalLine not the trimmed line
+ return activeBeautifierStack->back()->beautify(originalLine);
+ }
+
+ // calculate preliminary indentation based on data from past lines
+
+ if (!inStatementIndentStack->empty())
+ spaceTabCount = inStatementIndentStack->back();
+
+ for (i = 0; i < (int) headerStack->size(); i++)
+ {
+ isInClass = false;
+
+ if (blockIndent)
+ {
+ // do NOT indent opening block for these headers
+ if (!((*headerStack)[i] == &AS_NAMESPACE
+ || (*headerStack)[i] == &AS_CLASS
+ || (*headerStack)[i] == &AS_STRUCT
+ || (*headerStack)[i] == &AS_UNION
+ || (*headerStack)[i] == &AS_CONST
+ || (*headerStack)[i] == &AS_INTERFACE
+ || (*headerStack)[i] == &AS_THROWS
+ || (*headerStack)[i] == &AS_STATIC))
+ ++tabCount;
+ }
+ else if (!(i > 0 && (*headerStack)[i-1] != &AS_OPEN_BRACKET
+ && (*headerStack)[i] == &AS_OPEN_BRACKET))
+ ++tabCount;
+
+ if (!isJavaStyle() && !namespaceIndent && i >= 1
+ && (*headerStack)[i-1] == &AS_NAMESPACE
+ && (*headerStack)[i] == &AS_OPEN_BRACKET)
+ --tabCount;
+
+ if (isCStyle() && i >= 1
+ && (*headerStack)[i-1] == &AS_CLASS
+ && (*headerStack)[i] == &AS_OPEN_BRACKET)
+ {
+ if (classIndent)
+ ++tabCount;
+ isInClass = true;
+ }
+
+ // is the switchIndent option is on, indent switch statements an additional indent.
+ else if (switchIndent && i > 1
+ && (*headerStack)[i-1] == &AS_SWITCH
+ && (*headerStack)[i] == &AS_OPEN_BRACKET)
+ {
+ ++tabCount;
+ isInSwitch = true;
+ }
+
+ } // end of for loop * end of for loop * end of for loop * end of for loop * end of for loop *
+
+ iPrelim = i;
+
+ if (!lineStartsInComment
+ && isCStyle()
+ && isInClass
+ && classIndent
+ && headerStack->size() >= 2
+ && (*headerStack)[headerStack->size()-2] == &AS_CLASS
+ && (*headerStack)[headerStack->size()-1] == &AS_OPEN_BRACKET
+ && line[0] == '}'
+ && bracketBlockStateStack->back() == true)
+ --tabCount;
+
+ else if (!lineStartsInComment
+ && isInSwitch
+ && switchIndent
+ && headerStack->size() >= 2
+ && (*headerStack)[headerStack->size()-2] == &AS_SWITCH
+ && (*headerStack)[headerStack->size()-1] == &AS_OPEN_BRACKET
+ && line[0] == '}')
+ --tabCount;
+
+ if (isInClassInitializer)
+ {
+ if (lineStartsInComment || lineOpensComment)
+ {
+ if (!lineBeginsWithBracket)
+ tabCount--;
+ }
+ else if (isCStyle() && !isClassAccessModifier(line))
+ {
+ isInClassHeaderTab = true;
+ tabCount += classInitializerTabs;
+ }
+ else if (blockIndent)
+ {
+ if (!lineBeginsWithBracket)
+ tabCount++;
+ }
+ }
+ // handle special case of indented horstmann brackets
+ else if (lineStartsInComment && isInHorstmannComment && bracketIndent)
+ tabCount++;
+
+ // handle special case of horstmann comment in an indented class statement
+ if (isInClass
+ && classIndent
+ && isInHorstmannComment
+ && !lineOpensComment
+ && headerStack->size() >= 2
+ && (*headerStack)[headerStack->size()-2] == &AS_CLASS)
+ --tabCount;
+
+ if (isInConditional)
+ {
+ --tabCount;
+ }
+
+
+ // parse characters in the current line.
+
+ for (i = 0; i < (int) line.length(); i++)
+ {
+ outBuffer.append(1, line[i]);
+
+ tempCh = line[i];
+ prevCh = ch;
+ ch = tempCh;
+
+ if (isInBeautifySQL)
+ continue;
+
+ if (isWhiteSpace(ch))
+ {
+ if (ch == '\t')
+ tabIncrementIn += convertTabToSpaces(i, tabIncrementIn);
+ continue;
+ }
+
+ // handle special characters (i.e. backslash+character such as \n, \t, ...)
+
+ if (isInQuote && !isInVerbatimQuote)
+ {
+ if (isSpecialChar)
+ {
+ isSpecialChar = false;
+ continue;
+ }
+ if (line.compare(i, 2, "\\\\") == 0)
+ {
+ outBuffer.append(1, '\\');
+ i++;
+ continue;
+ }
+ if (ch == '\\')
+ {
+ if (peekNextChar(line, i) == ' ') // is this '\' at end of line
+ haveLineContinuationChar = true;
+ else
+ isSpecialChar = true;
+ continue;
+ }
+ }
+ else if (isInDefine && ch == '\\')
+ continue;
+
+ // handle quotes (such as 'x' and "Hello Dolly")
+ if (!(isInComment || isInLineComment) && (ch == '"' || ch == '\''))
+ {
+ if (!isInQuote)
+ {
+ quoteChar = ch;
+ isInQuote = true;
+ if (isSharpStyle() && prevCh == '@')
+ isInVerbatimQuote = true;
+ }
+ else if (isInVerbatimQuote && ch == '"')
+ {
+ if (peekNextChar(line, i) == '"') // check consecutive quotes
+ {
+ outBuffer.append(1, '"');
+ i++;
+ }
+ else
+ {
+ isInQuote = false;
+ isInVerbatimQuote = false;
+ }
+ }
+ else if (quoteChar == ch)
+ {
+ isInQuote = false;
+ isInStatement = true;
+ continue;
+ }
+ }
+ if (isInQuote)
+ continue;
+
+ // handle comments
+
+ if (!(isInComment || isInLineComment) && line.compare(i, 2, "//") == 0)
+ {
+ isInLineComment = true;
+ outBuffer.append(1, '/');
+ i++;
+ continue;
+ }
+ else if (!(isInComment || isInLineComment) && line.compare(i, 2, "/*") == 0)
+ {
+ isInComment = true;
+ outBuffer.append(1, '*');
+ i++;
+ if (!lineOpensComment) // does line start with comment?
+ blockCommentNoIndent = true; // if no, cannot indent continuation lines
+ continue;
+ }
+ else if ((isInComment || isInLineComment) && line.compare(i, 2, "*/") == 0)
+ {
+ isInComment = false;
+ outBuffer.append(1, '/');
+ i++;
+ blockCommentNoIndent = false; // ok to indent next comment
+ continue;
+ }
+ // treat C# '#region' and '#endregion' statements as a line comment
+ else if (isSharpStyle() &&
+ (line.compare(i, 7, "#region") == 0 || line.compare(i, 10, "#endregion") == 0))
+ {
+ isInLineComment = true;
+ }
+
+ if (isInComment || isInLineComment)
+ {
+ // append rest of the comment up to the comment end
+ while (i+1 < (int) line.length()
+ && line.compare(i+1, 2, "*/") != 0)
+ outBuffer.append(1, line[++i]);
+ continue;
+ }
+
+ // if we have reached this far then we are NOT in a comment or string of special character...
+
+ // SQL if formatted in ASEnhancer
+ if (isInBeautifySQL)
+ continue;
+
+ if (probationHeader != NULL)
+ {
+ if (((probationHeader == &AS_STATIC || probationHeader == &AS_CONST) && ch == '{')
+ || (probationHeader == &AS_SYNCHRONIZED && ch == '('))
+ {
+ // insert the probation header as a new header
+ isInHeader = true;
+ headerStack->push_back(probationHeader);
+
+ // handle the specific probation header
+ isInConditional = (probationHeader == &AS_SYNCHRONIZED);
+
+ isInStatement = false;
+ // if the probation comes from the previous line, then indent by 1 tab count.
+ if (previousLineProbation
+ && ch == '{'
+ && !(blockIndent
+ && (probationHeader == &AS_CONST || probationHeader == &AS_STATIC)))
+ {
+ tabCount++;
+ previousLineProbationTab = true;
+ }
+ previousLineProbation = false;
+ }
+
+ // dismiss the probation header
+ probationHeader = NULL;
+ }
+
+ prevNonSpaceCh = currentNonSpaceCh;
+ currentNonSpaceCh = ch;
+ if (!isLegalNameChar(ch) && ch != ',' && ch != ';')
+ {
+ prevNonLegalCh = currentNonLegalCh;
+ currentNonLegalCh = ch;
+ }
+
+ if (isInHeader)
+ {
+ isInHeader = false;
+ currentHeader = headerStack->back();
+ }
+ else
+ currentHeader = NULL;
+
+ if (isCStyle() && isInTemplate
+ && (ch == '<' || ch == '>')
+ && findOperator(line, i, nonAssignmentOperators) == NULL)
+ {
+ if (ch == '<')
+ {
+ ++templateDepth;
+ }
+ else if (ch == '>')
+ {
+ if (--templateDepth <= 0)
+ {
+ if (isInTemplate)
+ ch = ';';
+ else
+ ch = 't';
+ isInTemplate = false;
+ templateDepth = 0;
+ }
+ }
+ }
+
+ // handle parenthesies
+ if (ch == '(' || ch == '[' || ch == ')' || ch == ']')
+ {
+ if (ch == '(' || ch == '[')
+ {
+ isInOperator = false;
+ // if have a struct header, this is a declaration not a definition
+ if (ch == '('
+ && (isInClassInitializer || isInClassHeaderTab)
+ && headerStack->size() > 0
+ && headerStack->back() == &AS_STRUCT)
+ {
+ headerStack->pop_back();
+ isInClassInitializer = false;
+ // -1 for isInClassInitializer, -2 for isInClassHeaderTab
+ if (isInClassHeaderTab)
+ {
+ tabCount -= (1 + classInitializerTabs);
+ isInClassHeaderTab = false;
+ }
+ if (tabCount < 0)
+ tabCount = 0;
+ }
+
+ if (parenDepth == 0)
+ {
+ parenStatementStack->push_back(isInStatement);
+ isInStatement = true;
+ }
+ parenDepth++;
+
+ inStatementIndentStackSizeStack->push_back(inStatementIndentStack->size());
+
+ if (currentHeader != NULL)
+ registerInStatementIndent(line, i, spaceTabCount, tabIncrementIn, minConditionalIndent/*indentLength*2*/, true);
+ else
+ registerInStatementIndent(line, i, spaceTabCount, tabIncrementIn, 0, true);
+ }
+ else if (ch == ')' || ch == ']')
+ {
+ parenDepth--;
+ if (parenDepth == 0)
+ {
+ if (!parenStatementStack->empty()) // in case of unmatched closing parens
+ {
+ isInStatement = parenStatementStack->back();
+ parenStatementStack->pop_back();
+ }
+ ch = ' ';
+ isInAsm = false;
+ isInConditional = false;
+ }
+
+ if (!inStatementIndentStackSizeStack->empty())
+ {
+ int previousIndentStackSize = inStatementIndentStackSizeStack->back();
+ inStatementIndentStackSizeStack->pop_back();
+ while (previousIndentStackSize < (int) inStatementIndentStack->size())
+ inStatementIndentStack->pop_back();
+
+ if (!parenIndentStack->empty())
+ {
+ int poppedIndent = parenIndentStack->back();
+ parenIndentStack->pop_back();
+
+ if (i == 0)
+ spaceTabCount = poppedIndent;
+ }
+ }
+ }
+
+ continue;
+ }
+
+
+ if (ch == '{')
+ {
+ // first, check if '{' is a block-opener or an static-array opener
+ bool isBlockOpener = ((prevNonSpaceCh == '{' && bracketBlockStateStack->back())
+ || prevNonSpaceCh == '}'
+ || prevNonSpaceCh == ')'
+ || prevNonSpaceCh == ';'
+ || peekNextChar(line, i) == '{'
+ || isInClassInitializer
+ || isNonInStatementArray
+ || isSharpAccessor
+ || isSharpDelegate
+ || isInExtern
+ || (isInDefine &&
+ (prevNonSpaceCh == '('
+ || isLegalNameChar(prevNonSpaceCh))));
+
+ // remove inStatementIndent for C++ class initializer
+ if (isInClassInitializer)
+ {
+ if (inStatementIndentStack->size() > 0)
+ inStatementIndentStack->pop_back();
+ isInStatement = false;
+ if (lineBeginsWithBracket)
+ spaceTabCount = 0;
+ isInClassInitializer = false;
+ }
+
+ if (!isBlockOpener && currentHeader != NULL)
+ {
+ for (size_t n = 0; n < nonParenHeaders->size(); n++)
+ if (currentHeader == (*nonParenHeaders)[n])
+ {
+ isBlockOpener = true;
+ break;
+ }
+ }
+
+ bracketBlockStateStack->push_back(isBlockOpener);
+
+ if (!isBlockOpener)
+ {
+ inStatementIndentStackSizeStack->push_back(inStatementIndentStack->size());
+ registerInStatementIndent(line, i, spaceTabCount, tabIncrementIn, 0, true);
+ parenDepth++;
+ if (i == 0)
+ shouldIndentBrackettedLine = false;
+
+ continue;
+ }
+
+ // this bracket is a block opener...
+
+ ++lineOpeningBlocksNum;
+
+ if (isInClassHeaderTab)
+ {
+ isInClassHeaderTab = false;
+ // decrease tab count if bracket is broken
+ size_t firstChar = line.find_first_not_of(" \t");
+ if (firstChar != string::npos
+ && line[firstChar] == '{'
+ && (int) firstChar == i)
+ {
+ tabCount -= classInitializerTabs;
+ // decrease one more if an empty class
+ if (headerStack->size() > 0
+ && (*headerStack).back() == &AS_CLASS)
+ {
+ int nextChar = getNextProgramCharDistance(line, i);
+ if (line[nextChar] == '}')
+ tabCount--;
+ }
+ }
+ }
+
+ if (bracketIndent && !namespaceIndent && headerStack->size() > 0
+ && (*headerStack).back() == &AS_NAMESPACE)
+ {
+ shouldIndentBrackettedLine = false;
+ tabCount--;
+ }
+
+ // an indentable struct is treated like a class in the header stack
+ if (headerStack->size() > 0
+ && (*headerStack).back() == &AS_STRUCT
+ && isInIndentableStruct)
+ (*headerStack).back() = &AS_CLASS;
+
+ blockParenDepthStack->push_back(parenDepth);
+ blockStatementStack->push_back(isInStatement);
+
+ inStatementIndentStackSizeStack->push_back(inStatementIndentStack->size());
+ if (inStatementIndentStack->size() > 0)
+ {
+ spaceTabCount = 0;
+ inStatementIndentStack->back() = 0;
+ }
+
+ blockTabCount += isInStatement ? 1 : 0;
+ parenDepth = 0;
+ isInStatement = false;
+
+ tempStacks->push_back(new vector<const string*>);
+ headerStack->push_back(&AS_OPEN_BRACKET);
+ lastLineHeader = &AS_OPEN_BRACKET;
+
+ continue;
+ }
+
+ //check if a header has been reached
+ bool isPotentialHeader = isCharPotentialHeader(line, i);
+
+ if (isPotentialHeader)
+ {
+ const string *newHeader = findHeader(line, i, headers);
+
+ if (newHeader != NULL)
+ {
+ char peekChar = peekNextChar(line, i + newHeader->length() - 1);
+
+ // is not a header if part of a definition
+ if (peekChar == ',' || peekChar == ')')
+ newHeader = NULL;
+ // the following accessor definitions are NOT headers
+ // goto default; is NOT a header
+ // default(int) keyword in C# is NOT a header
+ else if ((newHeader == &AS_GET || newHeader == &AS_SET || newHeader == &AS_DEFAULT)
+ && (peekChar == ';' || peekChar == '('))
+ {
+ newHeader = NULL;
+ }
+ }
+
+ if (newHeader != NULL)
+ {
+ // if we reached here, then this is a header...
+ bool isIndentableHeader = true;
+
+ isInHeader = true;
+
+ vector<const string*> *lastTempStack;
+ if (tempStacks->empty())
+ lastTempStack = NULL;
+ else
+ lastTempStack = tempStacks->back();
+
+ // if a new block is opened, push a new stack into tempStacks to hold the
+ // future list of headers in the new block.
+
+ // take care of the special case: 'else if (...)'
+ if (newHeader == &AS_IF && lastLineHeader == &AS_ELSE)
+ {
+ headerStack->pop_back();
+ }
+
+ // take care of 'else'
+ else if (newHeader == &AS_ELSE)
+ {
+ if (lastTempStack != NULL)
+ {
+ int indexOfIf = indexOf(*lastTempStack, &AS_IF);
+ if (indexOfIf != -1)
+ {
+ // recreate the header list in headerStack up to the previous 'if'
+ // from the temporary snapshot stored in lastTempStack.
+ int restackSize = lastTempStack->size() - indexOfIf - 1;
+ for (int r = 0; r < restackSize; r++)
+ {
+ headerStack->push_back(lastTempStack->back());
+ lastTempStack->pop_back();
+ }
+ if (!closingBracketReached)
+ tabCount += restackSize;
+ }
+ /*
+ * If the above if is not true, i.e. no 'if' before the 'else',
+ * then nothing beautiful will come out of this...
+ * I should think about inserting an Exception here to notify the caller of this...
+ */
+ }
+ }
+
+ // check if 'while' closes a previous 'do'
+ else if (newHeader == &AS_WHILE)
+ {
+ if (lastTempStack != NULL)
+ {
+ int indexOfDo = indexOf(*lastTempStack, &AS_DO);
+ if (indexOfDo != -1)
+ {
+ // recreate the header list in headerStack up to the previous 'do'
+ // from the temporary snapshot stored in lastTempStack.
+ int restackSize = lastTempStack->size() - indexOfDo - 1;
+ for (int r = 0; r < restackSize; r++)
+ {
+ headerStack->push_back(lastTempStack->back());
+ lastTempStack->pop_back();
+ }
+ if (!closingBracketReached)
+ tabCount += restackSize;
+ }
+ }
+ }
+ // check if 'catch' closes a previous 'try' or 'catch'
+ else if (newHeader == &AS_CATCH || newHeader == &AS_FINALLY)
+ {
+ if (lastTempStack != NULL)
+ {
+ int indexOfTry = indexOf(*lastTempStack, &AS_TRY);
+ if (indexOfTry == -1)
+ indexOfTry = indexOf(*lastTempStack, &AS_CATCH);
+ if (indexOfTry != -1)
+ {
+ // recreate the header list in headerStack up to the previous 'try'
+ // from the temporary snapshot stored in lastTempStack.
+ int restackSize = lastTempStack->size() - indexOfTry - 1;
+ for (int r = 0; r < restackSize; r++)
+ {
+ headerStack->push_back(lastTempStack->back());
+ lastTempStack->pop_back();
+ }
+
+ if (!closingBracketReached)
+ tabCount += restackSize;
+ }
+ }
+ }
+ else if (newHeader == &AS_CASE)
+ {
+ isInCase = true;
+ if (!haveCaseIndent)
+ {
+ haveCaseIndent = true;
+ if (!lineBeginsWithBracket)
+ --tabCount;
+ }
+ }
+ else if (newHeader == &AS_DEFAULT)
+ {
+ isInCase = true;
+ --tabCount;
+ }
+ else if (newHeader == &AS_STATIC
+ || newHeader == &AS_SYNCHRONIZED
+ || (newHeader == &AS_CONST && isCStyle()))
+ {
+ if (!headerStack->empty() &&
+ (headerStack->back() == &AS_STATIC
+ || headerStack->back() == &AS_SYNCHRONIZED
+ || headerStack->back() == &AS_CONST))
+ {
+ isIndentableHeader = false;
+ }
+ else
+ {
+ isIndentableHeader = false;
+ probationHeader = newHeader;
+ }
+ }
+ else if (newHeader == &AS_CONST)
+ {
+ isIndentableHeader = false;
+ }
+ else if (newHeader == &AS_TEMPLATE)
+ {
+ if (isCStyle())
+ isInTemplate = true;
+ isIndentableHeader = false;
+ }
+
+ if (isIndentableHeader)
+ {
+ headerStack->push_back(newHeader);
+ isInStatement = false;
+ if (indexOf(*nonParenHeaders, newHeader) == -1)
+ {
+ isInConditional = true;
+ }
+ lastLineHeader = newHeader;
+ }
+ else
+ isInHeader = false;
+
+ outBuffer.append(newHeader->substr(1));
+ i += newHeader->length() - 1;
+
+ continue;
+ } // newHeader != NULL
+
+ if (isCStyle() && findKeyword(line, i, AS_ENUM))
+ isInEnum = true;
+
+ } // isPotentialHeader
+
+ if (ch == '?')
+ isInQuestion = true;
+
+ // special handling of 'case' statements
+ if (ch == ':')
+ {
+ if ((int) line.length() > i + 1 && line[i+1] == ':') // look for ::
+ {
+ ++i;
+ outBuffer.append(1, ':');
+ ch = ' ';
+ continue;
+ }
+
+ else if (isInQuestion)
+ {
+ isInQuestion = false;
+ }
+
+ else if (isCStyle() && isInClassInitializer)
+ {
+ // found a 'class A : public B' definition
+ // so do nothing special
+ }
+
+ else if (isCStyle()
+ && (isInAsm || isInAsmOneLine || isInAsmBlock))
+ {
+ // do nothing special
+ }
+
+ else if (isCStyle() && isdigit(peekNextChar(line, i)))
+ {
+ // found a bit field
+ // so do nothing special
+ }
+
+ else if (isCStyle() && isInClass && prevNonSpaceCh != ')')
+ {
+ // found a 'private:' or 'public:' inside a class definition
+ --tabCount;
+ }
+
+ else if (isCStyle() && prevNonSpaceCh == ')' && !isInCase)
+ {
+ isInClassInitializer = true;
+ if (i == 0)
+ tabCount += classInitializerTabs;
+ }
+
+ else if (isJavaStyle() && lastLineHeader == &AS_FOR)
+ {
+ // found a java for-each statement
+ // so do nothing special
+ }
+
+ else
+ {
+ currentNonSpaceCh = ';'; // so that brackets after the ':' will appear as block-openers
+ if (isInCase)
+ {
+ isInCase = false;
+ ch = ';'; // from here on, treat char as ';'
+ }
+ else if (isCStyle() || (isSharpStyle() && peekNextChar(line, i) == ';')) // is in a label (e.g. 'label1:')
+ {
+ if (labelIndent)
+ --tabCount; // unindent label by one indent
+ else if (!lineBeginsWithBracket)
+ tabCount = 0; // completely flush indent to left
+ }
+ }
+ }
+
+ if ((ch == ';' || (parenDepth > 0 && ch == ',')) && !inStatementIndentStackSizeStack->empty())
+ while ((int) inStatementIndentStackSizeStack->back() + (parenDepth > 0 ? 1 : 0)
+ < (int) inStatementIndentStack->size())
+ inStatementIndentStack->pop_back();
+
+ // handle commas
+ // previous "isInStatement" will be from an assignment operator
+ if (ch == ',' && parenDepth == 0 && !isInStatement && !isNonInStatementArray)
+ {
+ // is comma at end of line
+ size_t nextChar = line.find_first_not_of(" \t", i + 1);
+ if (nextChar != string::npos)
+ {
+ if (line.compare(nextChar, 2, "//") == 0
+ || line.compare(nextChar, 2, "/*") == 0)
+ nextChar = string::npos;
+ }
+ // register indent
+ if (nextChar == string::npos)
+ {
+ // register indent at first word after the colon of a C++ class initializer
+ if (isInClassInitializer)
+ {
+ size_t firstChar = line.find_first_not_of(" \t");
+ if (firstChar != string::npos && line[firstChar] == ':')
+ {
+ size_t firstWord = line.find_first_not_of(" \t", firstChar + 1);
+ if (firstChar != string::npos)
+ {
+ int inStatementIndent = firstWord + spaceTabCount + tabIncrementIn;
+ inStatementIndentStack->push_back(inStatementIndent);
+ isInStatement = true;
+ }
+ }
+ }
+ // register indent at previous word
+ else
+ {
+ int prevWord = getInStatementIndentComma(line, i);
+ int inStatementIndent = prevWord + spaceTabCount + tabIncrementIn;
+ inStatementIndentStack->push_back(inStatementIndent);
+ isInStatement = true;
+ }
+ }
+ }
+
+ // handle ends of statements
+ if ((ch == ';' && parenDepth == 0) || ch == '}')
+ {
+ if (ch == '}')
+ {
+ // first check if this '}' closes a previous block, or a static array...
+ if (!bracketBlockStateStack->empty())
+ {
+ bool bracketBlockState = bracketBlockStateStack->back();
+ bracketBlockStateStack->pop_back();
+ if (!bracketBlockState)
+ {
+ if (!inStatementIndentStackSizeStack->empty())
+ {
+ // this bracket is a static array
+
+ int previousIndentStackSize = inStatementIndentStackSizeStack->back();
+ inStatementIndentStackSizeStack->pop_back();
+ while (previousIndentStackSize < (int) inStatementIndentStack->size())
+ inStatementIndentStack->pop_back();
+ parenDepth--;
+ if (i == 0)
+ shouldIndentBrackettedLine = false;
+
+ if (!parenIndentStack->empty())
+ {
+ int poppedIndent = parenIndentStack->back();
+ parenIndentStack->pop_back();
+ if (i == 0)
+ spaceTabCount = poppedIndent;
+ }
+ }
+ continue;
+ }
+ }
+
+ // this bracket is block closer...
+
+ ++lineClosingBlocksNum;
+
+ if (!inStatementIndentStackSizeStack->empty())
+ inStatementIndentStackSizeStack->pop_back();
+
+ if (!blockParenDepthStack->empty())
+ {
+ parenDepth = blockParenDepthStack->back();
+ blockParenDepthStack->pop_back();
+ isInStatement = blockStatementStack->back();
+ blockStatementStack->pop_back();
+
+ if (isInStatement)
+ blockTabCount--;
+ }
+
+ closingBracketReached = true;
+ isInAsmOneLine = false;
+
+ // added for release 1.24
+ // TODO: remove at the appropriate time
+ assert(isInAsm == false);
+ assert(isInAsmOneLine == false);
+ assert(isInQuote == false);
+ isInAsm = isInAsmOneLine = isInQuote = false;
+ // end remove
+
+ int headerPlace = indexOf(*headerStack, &AS_OPEN_BRACKET);
+ if (headerPlace != -1)
+ {
+ const string *popped = headerStack->back();
+ while (popped != &AS_OPEN_BRACKET)
+ {
+ headerStack->pop_back();
+ popped = headerStack->back();
+ }
+ headerStack->pop_back();
+
+ // do not indent namespace bracket unless namespaces are indented
+ if (!namespaceIndent && headerStack->size() > 0
+ && (*headerStack).back() == &AS_NAMESPACE)
+ shouldIndentBrackettedLine = false;
+
+ if (!tempStacks->empty())
+ {
+ vector<const string*> *temp = tempStacks->back();
+ tempStacks->pop_back();
+ delete temp;
+ }
+ }
+
+
+ ch = ' '; // needed due to cases such as '}else{', so that headers ('else' tn tih case) will be identified...
+ }
+
+ /*
+ * Create a temporary snapshot of the current block's header-list in the
+ * uppermost inner stack in tempStacks, and clear the headerStack up to
+ * the begining of the block.
+ * Thus, the next future statement will think it comes one indent past
+ * the block's '{' unless it specifically checks for a companion-header
+ * (such as a previous 'if' for an 'else' header) within the tempStacks,
+ * and recreates the temporary snapshot by manipulating the tempStacks.
+ */
+ if (!tempStacks->back()->empty())
+ while (!tempStacks->back()->empty())
+ tempStacks->back()->pop_back();
+ while (!headerStack->empty() && headerStack->back() != &AS_OPEN_BRACKET)
+ {
+ tempStacks->back()->push_back(headerStack->back());
+ headerStack->pop_back();
+ }
+
+ if (parenDepth == 0 && ch == ';')
+ isInStatement = false;
+
+ previousLastLineHeader = NULL;
+ isInClassInitializer = false;
+ isInEnum = false;
+ isInQuestion = false;
+
+ continue;
+ }
+
+ if (isPotentialHeader)
+ {
+ // check for preBlockStatements in C/C++ ONLY if not within parenthesies
+ // (otherwise 'struct XXX' statements would be wrongly interpreted...)
+ if (!isInTemplate && !(isCStyle() && parenDepth > 0))
+ {
+ const string *newHeader = findHeader(line, i, preBlockStatements);
+ if (newHeader != NULL
+ && !(isCStyle() && newHeader == &AS_CLASS && isInEnum)) // is it 'enum class'
+ {
+ isInClassInitializer = true;
+
+ if (!isSharpStyle())
+ headerStack->push_back(newHeader);
+ // do not need 'where' in the headerStack
+ // do not need second 'class' statement in a row
+ else if (!(newHeader == &AS_WHERE
+ || (newHeader == &AS_CLASS
+ && headerStack->size() > 0
+ && headerStack->back() == &AS_CLASS)))
+ headerStack->push_back(newHeader);
+
+ outBuffer.append(newHeader->substr(1));
+ i += newHeader->length() - 1;
+ continue;
+ }
+ }
+ const string *foundIndentableHeader = findHeader(line, i, indentableHeaders);
+
+ if (foundIndentableHeader != NULL)
+ {
+ // must bypass the header before registering the in statement
+ outBuffer.append(foundIndentableHeader->substr(1));
+ i += foundIndentableHeader->length() - 1;
+ if (!isInOperator && !isInTemplate && !isNonInStatementArray)
+ {
+ registerInStatementIndent(line, i, spaceTabCount, tabIncrementIn, 0, false);
+ isInStatement = true;
+ }
+ continue;
+ }
+
+ if (isCStyle() && findKeyword(line, i, AS_OPERATOR))
+ isInOperator = true;
+
+ // "new" operator is a pointer, not a calculation
+ if (findKeyword(line, i, AS_NEW))
+ {
+ if (prevNonSpaceCh == '=' && isInStatement && !inStatementIndentStack->empty())
+ inStatementIndentStack->back() = 0;
+ }
+
+ if (isCStyle())
+ {
+ if (findKeyword(line, i, AS_ASM)
+ || findKeyword(line, i, AS__ASM__))
+ {
+ isInAsm = true;
+ }
+ else if (findKeyword(line, i, AS_MS_ASM) // microsoft specific
+ || findKeyword(line, i, AS_MS__ASM))
+ {
+ int index = 4;
+ if (peekNextChar(line, i) == '_') // check for __asm
+ index = 5;
+
+ char peekedChar = ASBase::peekNextChar(line, i + index);
+ if (peekedChar == '{' || peekedChar == ' ')
+ isInAsmBlock = true;
+ else
+ isInAsmOneLine = true;
+ }
+ }
+
+ // append the entire name for all others
+ string name = getCurrentWord(line, i);
+ outBuffer.append(name.substr(1));
+ i += name.length() - 1;
+ continue;
+ }
+
+ // Handle operators
+
+ bool isPotentialOperator = isCharPotentialOperator(ch);
+
+ if (isPotentialOperator)
+ {
+ // Check if an operator has been reached.
+ const string *foundAssignmentOp = findOperator(line, i, assignmentOperators);
+ const string *foundNonAssignmentOp = findOperator(line, i, nonAssignmentOperators);
+
+ // Since findHeader's boundry checking was not used above, it is possible
+ // that both an assignment op and a non-assignment op where found,
+ // e.g. '>>' and '>>='. If this is the case, treat the LONGER one as the
+ // found operator.
+ if (foundAssignmentOp != NULL && foundNonAssignmentOp != NULL)
+ {
+ if (foundAssignmentOp->length() < foundNonAssignmentOp->length())
+ foundAssignmentOp = NULL;
+ else
+ foundNonAssignmentOp = NULL;
+ }
+
+ if (foundNonAssignmentOp != NULL)
+ {
+ if (foundNonAssignmentOp->length() > 1)
+ {
+ outBuffer.append(foundNonAssignmentOp->substr(1));
+ i += foundNonAssignmentOp->length() - 1;
+ }
+
+ // For C++ input/output, operator<< and >> should be
+ // aligned, if we are not in a statement already and
+ // also not in the "operator<<(...)" header line
+ if (!isInOperator
+ && inStatementIndentStack->empty()
+ && isCStyle()
+ && (foundNonAssignmentOp == &AS_GR_GR ||
+ foundNonAssignmentOp == &AS_LS_LS))
+ {
+ // this will be true if the line begins with the operator
+ if (i < 2 && spaceTabCount == 0)
+ spaceTabCount += 2 * indentLength;
+ // align to the beginning column of the operator
+ registerInStatementIndent(line, i - foundNonAssignmentOp->length(), spaceTabCount, tabIncrementIn, 0, false);
+ }
+ }
+
+ else if (foundAssignmentOp != NULL)
+ {
+ if (foundAssignmentOp->length() > 1)
+ {
+ outBuffer.append(foundAssignmentOp->substr(1));
+ i += foundAssignmentOp->length() - 1;
+ }
+
+ if (!isInOperator && !isInTemplate && !isNonInStatementArray)
+ {
+ // if multiple assignments, align on the previous word
+ if (foundAssignmentOp == &AS_ASSIGN
+ && prevNonSpaceCh != ']' // an array
+ && statementEndsWithComma(line, i))
+ {
+ if (!haveAssignmentThisLine) // only one assignment indent per line
+ {
+ // register indent at previous word
+ haveAssignmentThisLine = true;
+ int prevWordIndex = getInStatementIndentAssign(line, i);
+ int inStatementIndent = prevWordIndex + spaceTabCount + tabIncrementIn;
+ inStatementIndentStack->push_back(inStatementIndent);
+ }
+ }
+ else
+ registerInStatementIndent(line, i, spaceTabCount, tabIncrementIn, 0, false);
+
+ isInStatement = true;
+ }
+ }
+ }
+ } // end of for loop * end of for loop * end of for loop * end of for loop * end of for loop *
+
+ // handle special cases of unindentation:
+
+ /*
+ * if '{' doesn't follow an immediately previous '{' in the headerStack
+ * (but rather another header such as "for" or "if", then unindent it
+ * by one indentation relative to its block.
+ */
+
+ if (!lineStartsInComment
+ && !blockIndent
+ && outBuffer.length() > 0
+ && outBuffer[0] == '{'
+ && !(lineOpeningBlocksNum > 0 && lineOpeningBlocksNum == lineClosingBlocksNum)
+ && !(headerStack->size() > 1 && (*headerStack)[headerStack->size()-2] == &AS_OPEN_BRACKET)
+ && shouldIndentBrackettedLine)
+ --tabCount;
+
+ // must check one less in headerStack if more than one header on a line (allow-addins)...
+ else if (!lineStartsInComment
+ && (int) headerStack->size() > iPrelim + 1
+ && !blockIndent
+ && outBuffer.length() > 0
+ && outBuffer[0] == '{'
+ && !(lineOpeningBlocksNum > 0 && lineOpeningBlocksNum == lineClosingBlocksNum)
+ && !(headerStack->size() > 2 && (*headerStack)[headerStack->size()-3] == &AS_OPEN_BRACKET)
+ && shouldIndentBrackettedLine)
+ --tabCount;
+
+ // unindent a closing bracket...
+ else if (!lineStartsInComment
+ && outBuffer.length() > 0
+ && outBuffer[0] == '}'
+ && shouldIndentBrackettedLine)
+ --tabCount;
+
+ // correctly indent one-line-blocks...
+ else if (!lineStartsInComment
+ && outBuffer.length() > 0
+ && lineOpeningBlocksNum > 0
+ && lineOpeningBlocksNum == lineClosingBlocksNum
+ && previousLineProbationTab)
+ --tabCount; //lineOpeningBlocksNum - (blockIndent ? 1 : 0);
+
+ // correctly indent class continuation lines...
+ else if (!lineStartsInComment
+ && !lineOpensComment
+ && isInClassHeaderTab
+ && !blockIndent
+ && outBuffer.length() > 0
+ && lineOpeningBlocksNum == 0
+ && lineOpeningBlocksNum == lineClosingBlocksNum
+ && (headerStack->size() > 0 && headerStack->back() == &AS_CLASS))
+ --tabCount;
+
+ if (tabCount < 0)
+ tabCount = 0;
+
+ // take care of extra bracket indentatation option...
+ if (!lineStartsInComment
+ && bracketIndent
+ && shouldIndentBrackettedLine
+ && outBuffer.length() > 0
+ && (outBuffer[0] == '{' || outBuffer[0] == '}'))
+ tabCount++;
+
+ if (isInDefine)
+ {
+ if (outBuffer[0] == '#')
+ {
+ string preproc = trim(string(outBuffer.c_str() + 1));
+ if (preproc.compare(0, 6, "define") == 0)
+ {
+ if (!inStatementIndentStack->empty()
+ && inStatementIndentStack->back() > 0)
+ {
+ defineTabCount = tabCount;
+ }
+ else
+ {
+ defineTabCount = tabCount - 1;
+ tabCount--;
+ }
+ }
+ }
+
+ tabCount -= defineTabCount;
+ }
+
+ if (tabCount < 0)
+ tabCount = 0;
+ if (lineCommentNoBeautify || blockCommentNoBeautify || isInQuoteContinuation)
+ tabCount = spaceTabCount = 0;
+
+ // finally, insert indentations into begining of line
+
+ if (shouldForceTabIndentation)
+ {
+ tabCount += spaceTabCount / indentLength;
+ spaceTabCount = spaceTabCount % indentLength;
+ }
+
+ outBuffer = preLineWS(spaceTabCount, tabCount) + outBuffer;
+
+ prevFinalLineSpaceTabCount = spaceTabCount;
+ prevFinalLineTabCount = tabCount;
+
+ if (lastLineHeader != NULL)
+ previousLastLineHeader = lastLineHeader;
+
+ return outBuffer;
+}
+
+
+string ASBeautifier::preLineWS(int spaceTabCount, int tabCount)
+{
+ string ws;
+
+ for (int i = 0; i < tabCount; i++)
+ ws += indentString;
+
+ while ((spaceTabCount--) > 0)
+ ws += string(" ");
+
+ return ws;
+
+}
+
+bool ASBeautifier::isClassAccessModifier(string& line) const
+{
+ size_t firstChar = line.find_first_not_of(" \t");
+ if (firstChar == string::npos)
+ return false;
+ // bypass a colon
+ if (line[firstChar] == ':')
+ {
+ firstChar = line.find_first_not_of(" \t");
+ if (firstChar == string::npos)
+ return false;
+ }
+ if (line.compare(firstChar, 7, "public ") == 0
+ || line.compare(firstChar, 8, "private ") == 0
+ || line.compare(firstChar, 10, "protected ") == 0)
+ return true;
+ return false;
+}
+
+/**
+ * register an in-statement indent.
+ */
+void ASBeautifier::registerInStatementIndent(const string &line, int i, int spaceTabCount,
+ int tabIncrementIn, int minIndent, bool updateParenStack)
+{
+ int inStatementIndent;
+ int remainingCharNum = line.length() - i;
+ int nextNonWSChar = getNextProgramCharDistance(line, i);
+
+ // if indent is around the last char in the line, indent instead one indent from the previous indent
+ if (nextNonWSChar == remainingCharNum)
+ {
+ int previousIndent = spaceTabCount;
+ if (!inStatementIndentStack->empty())
+ previousIndent = inStatementIndentStack->back();
+ int currIndent = /*2*/ indentLength + previousIndent;
+ if (currIndent > maxInStatementIndent
+ && line[i] != '{')
+ currIndent = indentLength * 2 + spaceTabCount;
+ inStatementIndentStack->push_back(currIndent);
+ if (updateParenStack)
+ parenIndentStack->push_back(previousIndent);
+ return;
+ }
+
+ if (updateParenStack)
+ parenIndentStack->push_back(i + spaceTabCount - horstmannIndentInStatement);
+
+ int tabIncrement = tabIncrementIn;
+
+ // check for following tabs
+ for (int j = i + 1; j < (i + nextNonWSChar); j++)
+ {
+ if (line[j] == '\t')
+ tabIncrement += convertTabToSpaces(j, tabIncrement);
+ }
+
+ inStatementIndent = i + nextNonWSChar + spaceTabCount + tabIncrement;
+
+ // check for run-in statement
+ if (i > 0 && line[0] == '{')
+ inStatementIndent -= indentLength;
+
+// if (i + nextNonWSChar < minIndent)
+// inStatementIndent = minIndent + spaceTabCount;
+
+ if (inStatementIndent < minIndent)
+ inStatementIndent = minIndent + spaceTabCount;
+
+// if (i + nextNonWSChar > maxInStatementIndent)
+// inStatementIndent = indentLength * 2 + spaceTabCount;
+
+ if (inStatementIndent > maxInStatementIndent)
+ inStatementIndent = indentLength * 2 + spaceTabCount;
+
+ if (!inStatementIndentStack->empty() &&
+ inStatementIndent < inStatementIndentStack->back())
+ inStatementIndent = inStatementIndentStack->back();
+
+ // the block opener is not indented for a NonInStatementArray
+ if (isNonInStatementArray && !bracketBlockStateStack->empty() && bracketBlockStateStack->back())
+ inStatementIndent = 0;
+
+ inStatementIndentStack->push_back(inStatementIndent);
+}
+
+/**
+ * get distance to the next non-white space, non-comment character in the line.
+ * if no such character exists, return the length remaining to the end of the line.
+ */
+int ASBeautifier::getNextProgramCharDistance(const string &line, int i) const
+{
+ bool inComment = false;
+ int remainingCharNum = line.length() - i;
+ int charDistance;
+ char ch;
+
+ for (charDistance = 1; charDistance < remainingCharNum; charDistance++)
+ {
+ ch = line[i + charDistance];
+ if (inComment)
+ {
+ if (line.compare(i + charDistance, 2, "*/") == 0)
+ {
+ charDistance++;
+ inComment = false;
+ }
+ continue;
+ }
+ else if (isWhiteSpace(ch))
+ continue;
+ else if (ch == '/')
+ {
+ if (line.compare(i + charDistance, 2, "//") == 0)
+ return remainingCharNum;
+ else if (line.compare(i + charDistance, 2, "/*") == 0)
+ {
+ charDistance++;
+ inComment = true;
+ }
+ }
+ else
+ return charDistance;
+ }
+
+ return charDistance;
+}
+
+// check if a specific line position contains a header.
+const string* ASBeautifier::findHeader(const string &line, int i,
+ const vector<const string*>* possibleHeaders) const
+{
+ assert(isCharPotentialHeader(line, i));
+ // check the word
+ size_t maxHeaders = possibleHeaders->size();
+ for (size_t p = 0; p < maxHeaders; p++)
+ {
+ const string* header = (*possibleHeaders)[p];
+ const size_t wordEnd = i + header->length();
+ if (wordEnd > line.length())
+ continue;
+ int result = (line.compare(i, header->length(), *header));
+ if (result > 0)
+ continue;
+ if (result < 0)
+ break;
+ // check that this is not part of a longer word
+ if (wordEnd == line.length())
+ return header;
+ if (isLegalNameChar(line[wordEnd]))
+ continue;
+ // is not a header if part of a definition
+ const char peekChar = peekNextChar(line, wordEnd - 1);
+ if (peekChar == ',' || peekChar == ')')
+ break;
+ return header;
+ }
+ return NULL;
+}
+
+// check if a specific line position contains an operator.
+const string* ASBeautifier::findOperator(const string &line, int i,
+ const vector<const string*>* possibleOperators) const
+{
+ assert(isCharPotentialOperator(line[i]));
+ // find the operator in the vector
+ // the vector contains the LONGEST operators first
+ // must loop thru the entire vector
+ size_t maxOperators = possibleOperators->size();
+ for (size_t p = 0; p < maxOperators; p++)
+ {
+ const size_t wordEnd = i + (*(*possibleOperators)[p]).length();
+ if (wordEnd > line.length())
+ continue;
+ if (line.compare(i, (*(*possibleOperators)[p]).length(), *(*possibleOperators)[p]) == 0)
+ return (*possibleOperators)[p];
+ }
+ return NULL;
+}
+
+/**
+ * find the index number of a string element in a container of strings
+ *
+ * @return the index number of element in the container. -1 if element not found.
+ * @param container a vector of strings.
+ * @param element the element to find .
+ */
+int ASBeautifier::indexOf(vector<const string*> &container, const string *element)
+{
+ vector<const string*>::const_iterator where;
+
+ where = find(container.begin(), container.end(), element);
+ if (where == container.end())
+ return -1;
+ else
+ return (int) (where - container.begin());
+}
+
+/**
+ * convert tabs to spaces.
+ * i is the position of the character to convert to spaces.
+ * tabIncrementIn is the increment that must be added for tab indent characters
+ * to get the correct column for the current tab.
+ */
+int ASBeautifier::convertTabToSpaces(int i, int tabIncrementIn) const
+{
+ int tabToSpacesAdjustment = indentLength - 1 - ((tabIncrementIn + i) % indentLength);
+ return tabToSpacesAdjustment;
+}
+
+/**
+ * trim removes the white space surrounding a line.
+ *
+ * @return the trimmed line.
+ * @param str the line to trim.
+ */
+string ASBeautifier::trim(const string &str)
+{
+
+ int start = 0;
+ int end = str.length() - 1;
+
+ while (start < end && isWhiteSpace(str[start]))
+ start++;
+
+ while (start <= end && isWhiteSpace(str[end]))
+ end--;
+
+ string returnStr(str, start, end + 1 - start);
+ return returnStr;
+}
+
+/**
+ * Copy tempStacks for the copy constructor.
+ * The value of the vectors must also be copied.
+ */
+vector<vector<const string*>*>* ASBeautifier::copyTempStacks(const ASBeautifier &other) const
+{
+ vector<vector<const string*>*> *tempStacksNew = new vector<vector<const string*>*>;
+ vector<vector<const string*>*>::iterator iter;
+ for (iter = other.tempStacks->begin();
+ iter != other.tempStacks->end();
+ ++iter)
+ {
+ vector<const string*> *newVec = new vector<const string*>;
+ *newVec = **iter;
+ tempStacksNew->push_back(newVec);
+ }
+ return tempStacksNew;
+}
+
+/**
+ * delete a static member vector to eliminate memory leak reporting for the vector
+ */
+void ASBeautifier::deleteStaticVectors()
+{
+ beautifierFileType = 9; // reset to an invalid type
+ deleteVector(headers);
+ deleteVector(nonParenHeaders);
+ deleteVector(preBlockStatements);
+ deleteVector(assignmentOperators);
+ deleteVector(nonAssignmentOperators);
+ deleteVector(indentableHeaders);
+}
+
+/**
+ * delete a vector object
+ * T is the type of vector
+ * used for all vectors except tempStacks
+ */
+template<typename T>
+void ASBeautifier::deleteContainer(T &container)
+{
+ if (container != NULL)
+ {
+ container->clear();
+ delete (container);
+ container = NULL;
+ }
+}
+
+/**
+ * Delete the tempStacks vector object.
+ * The tempStacks is a vector of pointers to strings allocated with
+ * the 'new' operator.
+ * Therefore the strings have to be deleted in addition to the
+ * tempStacks entries.
+ */
+void ASBeautifier::deleteContainer(vector<vector<const string*>*>* &container)
+{
+ if (container != NULL)
+ {
+ vector<vector<const string*>*>::iterator iter = container->begin();
+ for (; iter != container->end(); iter++)
+ delete *iter;
+ container->clear();
+ delete (container);
+ container = NULL;
+ }
+}
+
+/**
+ * delete a vector<const string*>* object
+ */
+void ASBeautifier::deleteVector(vector<const string*>*& container)
+{
+ assert(container != NULL);
+ delete container;
+ container = NULL;
+}
+
+/**
+ * initialize a vector object
+ * T is the type of vector
+ * used for all vectors
+ */
+template<typename T>
+void ASBeautifier::initContainer(T &container, T value)
+{
+ // since the ASFormatter object is never deleted,
+ // the existing vectors must be deleted before creating new ones
+ if (container != NULL )
+ deleteContainer(container);
+ container = value;
+}
+
+/**
+ * initialize a vector<const string*>* object
+ */
+void ASBeautifier::initVector(vector<const string*>*& container)
+{
+ assert(container == NULL);
+ container = new vector<const string*>;
+}
+
+/**
+ * Determine if an assignment statement ends with a comma
+ * that is not in a function argument. It ends with a
+ * comma if a comma is the last char on the line.
+ *
+ * @return true if line ends with a comma, otherwise false.
+ */
+bool ASBeautifier::statementEndsWithComma(string &line, int index)
+{
+ assert(line[index] == '=');
+
+ bool isInComment = false;
+ bool isInQuote = false;
+ int parenCount = 0;
+ size_t lineLength = line.length();
+ size_t i = 0;
+ char quoteChar = ' ';
+
+ for (i = index + 1; i < lineLength; ++i)
+ {
+ char ch = line[i];
+
+ if (isInComment)
+ {
+ if (line.compare(i, 2, "*/") == 0)
+ {
+ isInComment = false;
+ ++i;
+ }
+ continue;
+ }
+
+ if (ch == '\\')
+ {
+ ++i;
+ continue;
+ }
+
+ if (isInQuote)
+ {
+ if (ch == quoteChar)
+ isInQuote = false;
+ continue;
+ }
+
+ if (ch == '"' || ch == '\'')
+ {
+ isInQuote = true;
+ quoteChar = ch;
+ continue;
+ }
+
+ if (line.compare(i, 2, "//") == 0)
+ break;
+
+ if (line.compare(i, 2, "/*") == 0)
+ {
+ if (isLineEndComment(line, i))
+ break;
+ else
+ {
+ isInComment = true;
+ ++i;
+ continue;
+ }
+ }
+
+ if (ch == '(')
+ parenCount++;
+ if (ch == ')')
+ parenCount--;
+ }
+ if (isInComment
+ || isInQuote
+ || parenCount > 0)
+ return false;
+
+ size_t lastChar = line.find_last_not_of(" \t", i - 1);
+
+ if (lastChar == string::npos || line[lastChar] != ',')
+ return false;
+
+ return true;
+}
+
+/**
+ * check if current comment is a line-end comment
+ *
+ * @return is before a line-end comment.
+ */
+bool ASBeautifier::isLineEndComment(string& line, int startPos) const
+{
+ assert(line.compare(startPos, 2, "/*") == 0);
+
+ // comment must be closed on this line with nothing after it
+ size_t endNum = line.find("*/", startPos + 2);
+ if (endNum != string::npos)
+ {
+ size_t nextChar = line.find_first_not_of(" \t", endNum + 2);
+ if (nextChar == string::npos)
+ return true;
+ }
+ return false;
+}
+
+/**
+ * get the previous word index for an assignment operator
+ *
+ * @return is the index to the previous word (the in statement indent).
+ */
+int ASBeautifier::getInStatementIndentAssign(const string& line, size_t currPos) const
+{
+ assert(line[currPos] == '=');
+
+ if (currPos == 0)
+ return 0;
+
+ // get the last legal word (may be a number)
+ size_t end = line.find_last_not_of(" \t", currPos-1);
+ if (end == string::npos || !isLegalNameChar(line[end]))
+ return 0;
+
+ int start; // start of the previous word
+ for (start = end; start > -1; start--)
+ {
+ if (!isLegalNameChar(line[start]) || line[start] == '.')
+ break;
+ }
+ start++;
+
+ return start;
+}
+
+/**
+ * get the instatement indent for a comma
+ *
+ * @return is the indent to the second word on the line (the in statement indent).
+ */
+int ASBeautifier::getInStatementIndentComma(const string& line, size_t currPos) const
+{
+ assert(line[currPos] == ',');
+
+ if (currPos == 0)
+ return 0;
+
+ // get first word on a line
+ size_t indent = line.find_first_not_of(" \t");
+ if (indent == string::npos || !isLegalNameChar(line[indent]))
+ return 0;
+
+ // bypass first word
+ for (; indent < currPos; indent++)
+ {
+ if (!isLegalNameChar(line[indent]))
+ break;
+ }
+ indent++;
+ if (indent >= currPos)
+ return 0;
+
+ // point to second word or assignment operator
+ indent = line.find_last_not_of(" \t", indent);
+ if (indent == string::npos || indent >= currPos)
+ return 0;
+
+ return indent;
+}
+
+
+} // end namespace astyle
+
diff --git a/support/highlight/src/core/astyle/ASEnhancer.cpp b/support/highlight/src/core/astyle/ASEnhancer.cpp
new file mode 100644
index 0000000000..7615601431
--- /dev/null
+++ b/support/highlight/src/core/astyle/ASEnhancer.cpp
@@ -0,0 +1,582 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Copyright (C) 2006-2010 by Jim Pattee <jimp03@email.com>
+ * Copyright (C) 1998-2002 by Tal Davidson
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>
+ *
+ * This file is a part of Artistic Style - an indentation and
+ * reformatting tool for C, C++, C# and Java source files.
+ * <http://astyle.sourceforge.net>
+ *
+ * Artistic Style is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Artistic Style is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Artistic Style. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ */
+
+#include "astyle.h"
+
+
+namespace astyle
+{
+
+// ---------------------------- functions for ASEnhancer Class -------------------------------------
+
+/**
+ * ASEnhancer constructor
+ */
+ASEnhancer::ASEnhancer()
+{
+ // the following prevents warning messages with cppcheck
+ // it will NOT compile if activated
+// init();
+}
+
+/**
+ * Destructor of ASEnhancer
+ */
+ASEnhancer::~ASEnhancer()
+{
+}
+
+/**
+ * initialize the ASEnhancer.
+ *
+ * init() is called each time an ASFormatter object is initialized.
+ */
+void ASEnhancer::init(int fileType,
+ int _indentLength,
+ string _indentString,
+ bool _caseIndent,
+ bool _emptyLineFill)
+{
+ // formatting variables from ASFormatter and ASBeautifier
+ ASBase::init(fileType);
+ indentLength = _indentLength;
+ if (_indentString == "\t")
+ useTabs = true;
+ else
+ useTabs = false;
+
+ caseIndent = _caseIndent;
+ emptyLineFill = _emptyLineFill;
+ quoteChar = '\'';
+
+ // unindent variables
+ lineNumber = 0;
+ bracketCount = 0;
+ isInComment = false;
+ isInQuote = false;
+ switchDepth = 0;
+ lookingForCaseBracket = false;
+ unindentNextLine = false;
+
+ // switch struct and vector
+ sw.switchBracketCount = 0;
+ sw.unindentDepth = 0;
+ sw.unindentCase = false;
+ swVector.clear();
+
+ // other variables
+ nextLineIsEventIndent = false;
+ isInEventTable = false;
+ nextLineIsDeclareIndent = false;
+ isInDeclareSection = false;
+}
+
+/**
+ * additional formatting for line of source code.
+ * every line of source code in a source code file should be sent
+ * one after the other to this function.
+ * indents event tables
+ * unindents the case blocks
+ *
+ * @param line the original formatted line will be updated if necessary.
+ */
+void ASEnhancer::enhance(string &line, bool isInSQL)
+{
+ bool isSpecialChar = false; // is a backslash escape character
+
+ lineNumber++;
+
+ // check for beginning of event table
+ if (nextLineIsEventIndent)
+ {
+ isInEventTable = true;
+ nextLineIsEventIndent = false;
+ }
+
+ // check for beginning of SQL declare section
+ if (nextLineIsDeclareIndent)
+ {
+ isInDeclareSection = true;
+ nextLineIsDeclareIndent = false;
+ }
+
+ if (line.length() == 0
+ && ! isInEventTable
+ && ! isInDeclareSection
+ && ! emptyLineFill)
+ return;
+
+ // test for unindent on attached brackets
+ if (unindentNextLine)
+ {
+ sw.unindentDepth++;
+ sw.unindentCase = true;
+ unindentNextLine = false;
+ }
+
+ // parse characters in the current line.
+
+ for (size_t i = 0; i < line.length(); i++)
+ {
+ char ch = line[i];
+
+ // bypass whitespace
+ if (isWhiteSpace(ch))
+ continue;
+
+ // handle special characters (i.e. backslash+character such as \n, \t, ...)
+ if (isSpecialChar)
+ {
+ isSpecialChar = false;
+ continue;
+ }
+ if (!(isInComment) && line.compare(i, 2, "\\\\") == 0)
+ {
+ i++;
+ continue;
+ }
+ if (!(isInComment) && ch == '\\')
+ {
+ isSpecialChar = true;
+ continue;
+ }
+
+ // handle quotes (such as 'x' and "Hello Dolly")
+ if (!isInComment && (ch == '"' || ch == '\''))
+ {
+ if (!isInQuote)
+ {
+ quoteChar = ch;
+ isInQuote = true;
+ }
+ else if (quoteChar == ch)
+ {
+ isInQuote = false;
+ continue;
+ }
+ }
+
+ if (isInQuote)
+ continue;
+
+ // handle comments
+
+ if (!(isInComment) && line.compare(i, 2, "//") == 0)
+ {
+ // check for windows line markers
+ if (line.compare(i + 2, 1, "\xf0") > 0)
+ lineNumber--;
+ break; // finished with the line
+ }
+ else if (!(isInComment) && line.compare(i, 2, "/*") == 0)
+ {
+ isInComment = true;
+ i++;
+ continue;
+ }
+ else if ((isInComment) && line.compare(i, 2, "*/") == 0)
+ {
+ isInComment = false;
+ i++;
+ continue;
+ }
+
+ if (isInComment)
+ continue;
+
+ // if we have reached this far then we are NOT in a comment or string of special characters
+
+ if (line[i] == '{')
+ bracketCount++;
+
+ if (line[i] == '}')
+ bracketCount--;
+
+ bool isPotentialKeyword = isCharPotentialHeader(line, i);
+
+ // ---------------- process event tables --------------------------------------
+
+ if (isPotentialKeyword)
+ {
+ if (findKeyword(line, i, "BEGIN_EVENT_TABLE")
+ || findKeyword(line, i, "BEGIN_MESSAGE_MAP"))
+ {
+ nextLineIsEventIndent = true;
+ break;
+ }
+
+ if (findKeyword(line, i, "END_EVENT_TABLE")
+ || findKeyword(line, i, "END_MESSAGE_MAP"))
+ {
+ isInEventTable = false;
+ break;
+ }
+ }
+
+ // ---------------- process SQL -----------------------------------------------
+
+ if (isInSQL)
+ {
+ if (isBeginDeclareSectionSQL(line, i))
+ nextLineIsDeclareIndent = true;
+ if (isEndDeclareSectionSQL(line, i))
+ isInDeclareSection = false;
+ break;
+ }
+
+ // ---------------- process switch statements ---------------------------------
+
+ if (isPotentialKeyword && findKeyword(line, i, "switch"))
+ {
+ switchDepth++;
+ swVector.push_back(sw); // save current variables
+ sw.switchBracketCount = 0;
+ sw.unindentCase = false; // don't clear case until end of switch
+ i += 5; // bypass switch statement
+ continue;
+ }
+
+ // just want unindented switch statements from this point
+
+ if (caseIndent || switchDepth == 0)
+ {
+ // bypass the entire word
+ if (isPotentialKeyword)
+ {
+ string name = getCurrentWord(line, i);
+ i += name.length() - 1;
+ }
+ continue;
+ }
+
+ i = processSwitchBlock(line, i);
+
+ } // end of for loop * end of for loop * end of for loop * end of for loop
+
+ if (isInEventTable || isInDeclareSection)
+ {
+ if (line[0] != '#')
+ indentLine(line, 1);
+ }
+
+ if (sw.unindentDepth > 0)
+ unindentLine(line, sw.unindentDepth);
+}
+
+/**
+ * find the colon following a 'case' statement
+ *
+ * @param line a reference to the line.
+ * @param i the line index of the case statement.
+ * @return the line index of the colon.
+ */
+size_t ASEnhancer::findCaseColon(string &line, size_t caseIndex) const
+{
+ size_t i = caseIndex;
+ bool isInQuote = false;
+ char quoteChar = ' ';
+ for (; i < line.length(); i++)
+ {
+ if (isInQuote)
+ {
+ if (line[i] == '\\')
+ {
+ i++;
+ continue;
+ }
+ else if (line[i] == quoteChar) // check ending quote
+ {
+ isInQuote = false;
+ quoteChar = ' ';
+ continue;
+ }
+ else
+ {
+ continue; // must close quote before continuing
+ }
+ }
+ if (line[i] == '\'' || line[i] == '\"') // check opening quote
+ {
+ isInQuote = true;
+ quoteChar = line[i];
+ continue;
+ }
+ if (line[i] == ':')
+ {
+ if ((i + 1 < line.length()) && (line[i + 1] == ':'))
+ i++; // bypass scope resolution operator
+ else
+ break; // found it
+ }
+ }
+ return i;
+}
+
+/**
+ * indent a line by a given number of tabsets
+ * by inserting leading whitespace to the line argument.
+ *
+ * @param line a reference to the line to indent.
+ * @param unindent the number of tabsets to insert.
+ * @return the number of characters inserted.
+ */
+int ASEnhancer::indentLine(string &line, int indent) const
+{
+ if (line.length() == 0
+ && ! emptyLineFill)
+ return 0;
+
+ size_t charsToInsert; // number of chars to insert
+
+ if (useTabs) // if formatted with tabs
+ {
+ charsToInsert = indent; // tabs to insert
+ line.insert((size_t) 0, charsToInsert, '\t'); // insert the tabs
+ }
+ else
+ {
+ charsToInsert = indent * indentLength; // compute chars to insert
+ line.insert((size_t)0, charsToInsert, ' '); // insert the spaces
+ }
+
+ return charsToInsert;
+}
+
+/**
+ * check for SQL "BEGIN DECLARE SECTION".
+ * must compare case insensitive and allow any spacing between words.
+ *
+ * @param line a reference to the line to indent.
+ * @param index the current line index.
+ * @return true if a hit.
+ */
+bool ASEnhancer::isBeginDeclareSectionSQL(string &line, size_t index) const
+{
+ string word;
+ size_t hits = 0;
+ size_t i;
+ for (i = index; i < line.length(); i++)
+ {
+ i = line.find_first_not_of(" \t", i);
+ if (i == string::npos)
+ return false;
+ if (line[i] == ';')
+ break;
+ if (!isCharPotentialHeader(line, i))
+ continue;
+ word = getCurrentWord(line, i);
+ for (size_t j = 0; j < word.length(); j++)
+ word[j] = (char) toupper(word[j]);
+ if (word == "EXEC" || word == "SQL")
+ {
+ i += word.length() - 1;
+ continue;
+ }
+ if (word == "DECLARE" || word == "SECTION")
+ {
+ hits++;
+ i += word.length() - 1;
+ continue;
+ }
+ if (word == "BEGIN")
+ {
+ hits++;
+ i += word.length() - 1;
+ continue;
+ }
+ return false;
+ }
+ if (hits == 3)
+ return true;
+ return false;
+}
+
+/**
+ * check for SQL "END DECLARE SECTION".
+ * must compare case insensitive and allow any spacing between words.
+ *
+ * @param line a reference to the line to indent.
+ * @param index the current line index.
+ * @return true if a hit.
+ */
+bool ASEnhancer::isEndDeclareSectionSQL(string &line, size_t index) const
+{
+ string word;
+ size_t hits = 0;
+ size_t i;
+ for (i = index; i < line.length(); i++)
+ {
+ i = line.find_first_not_of(" \t", i);
+ if (i == string::npos)
+ return false;
+ if (line[i] == ';')
+ break;
+ if (!isCharPotentialHeader(line, i))
+ continue;
+ word = getCurrentWord(line, i);
+ for (size_t j = 0; j < word.length(); j++)
+ word[j] = (char) toupper(word[j]);
+ if (word == "EXEC" || word == "SQL")
+ {
+ i += word.length() - 1;
+ continue;
+ }
+ if (word == "DECLARE" || word == "SECTION")
+ {
+ hits++;
+ i += word.length() - 1;
+ continue;
+ }
+ if (word == "END")
+ {
+ hits++;
+ i += word.length() - 1;
+ continue;
+ }
+ return false;
+ }
+ if (hits == 3)
+ return true;
+ return false;
+}
+
+/**
+ * process the character at the current index in a switch block.
+ *
+ * @param line a reference to the line to indent.
+ * @param index the current line index.
+ * @return the new line index.
+ */
+size_t ASEnhancer::processSwitchBlock(string &line, size_t index)
+{
+ size_t i = index;
+ bool isPotentialKeyword = isCharPotentialHeader(line, i);
+
+ if (line[i] == '{')
+ {
+ sw.switchBracketCount++;
+ if (lookingForCaseBracket) // if 1st after case statement
+ {
+ sw.unindentCase = true; // unindenting this case
+ sw.unindentDepth++;
+ lookingForCaseBracket = false; // not looking now
+ }
+ return i;
+ }
+ lookingForCaseBracket = false; // no opening bracket, don't indent
+
+ if (line[i] == '}') // if close bracket
+ {
+ sw.switchBracketCount--;
+ if (sw.switchBracketCount == 0) // if end of switch statement
+ {
+ switchDepth--; // one less switch
+ sw = swVector.back(); // restore sw struct
+ swVector.pop_back(); // remove last entry from stack
+ }
+ return i;
+ }
+
+ if (isPotentialKeyword
+ && (findKeyword(line, i, "case") || findKeyword(line, i, "default")))
+ {
+ if (sw.unindentCase) // if unindented last case
+ {
+ sw.unindentCase = false; // stop unindenting previous case
+ sw.unindentDepth--; // reduce depth
+ }
+
+ i = findCaseColon(line, i);
+
+ i++;
+ for (; i < line.length(); i++) // bypass whitespace
+ {
+ if (!isWhiteSpace(line[i]))
+ break;
+ }
+ if (i < line.length())
+ {
+ if (line[i] == '{')
+ {
+ sw.switchBracketCount++;
+ unindentNextLine = true;
+ return i;
+ }
+ }
+ lookingForCaseBracket = true; // bracket must be on next line
+ i--; // need to check for comments
+ return i;
+ }
+ if (isPotentialKeyword)
+ {
+ string name = getCurrentWord(line, i); // bypass the entire name
+ i += name.length() - 1;
+ }
+ return i;
+}
+
+/**
+ * unindent a line by a given number of tabsets
+ * by erasing the leading whitespace from the line argument.
+ *
+ * @param line a reference to the line to unindent.
+ * @param unindent the number of tabsets to erase.
+ * @return the number of characters erased.
+ */
+int ASEnhancer::unindentLine(string &line, int unindent) const
+{
+ size_t whitespace = line.find_first_not_of(" \t");
+
+ if (whitespace == string::npos) // if line is blank
+ whitespace = line.length(); // must remove padding, if any
+
+ if (whitespace == 0)
+ return 0;
+
+ size_t charsToErase; // number of chars to erase
+
+ if (useTabs) // if formatted with tabs
+ {
+ charsToErase = unindent; // tabs to erase
+ if (charsToErase <= whitespace) // if there is enough whitespace
+ line.erase(0, charsToErase); // erase the tabs
+ else
+ charsToErase = 0;
+ }
+ else
+ {
+ charsToErase = unindent * indentLength; // compute chars to erase
+ if (charsToErase <= whitespace) // if there is enough whitespace
+ line.erase(0, charsToErase); // erase the spaces
+ else
+ charsToErase = 0;
+ }
+
+ return charsToErase;
+}
+
+
+} // end namespace astyle
diff --git a/support/highlight/src/core/astyle/ASFormatter.cpp b/support/highlight/src/core/astyle/ASFormatter.cpp
new file mode 100644
index 0000000000..3617c325b0
--- /dev/null
+++ b/support/highlight/src/core/astyle/ASFormatter.cpp
@@ -0,0 +1,4520 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Copyright (C) 2006-2010 by Jim Pattee <jimp03@email.com>
+ * Copyright (C) 1998-2002 by Tal Davidson
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>
+ *
+ * This file is a part of Artistic Style - an indentation and
+ * reformatting tool for C, C++, C# and Java source files.
+ * <http://astyle.sourceforge.net>
+ *
+ * Artistic Style is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Artistic Style is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Artistic Style. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ */
+
+#include "astyle.h"
+
+#include <algorithm>
+#include <fstream>
+#include <iostream>
+
+
+namespace astyle
+{
+// static member variables
+int ASFormatter::formatterFileType = 9; // initialized with an invalid type
+vector<const string*>* ASFormatter::headers = NULL;
+vector<const string*>* ASFormatter::nonParenHeaders = NULL;
+vector<const string*>* ASFormatter::preDefinitionHeaders = NULL;
+vector<const string*>* ASFormatter::preCommandHeaders = NULL;
+vector<const string*>* ASFormatter::operators = NULL;
+vector<const string*>* ASFormatter::assignmentOperators = NULL;
+vector<const string*>* ASFormatter::castOperators = NULL;
+
+/**
+ * Constructor of ASFormatter
+ */
+ASFormatter::ASFormatter()
+{
+ sourceIterator = NULL;
+ enhancer = new ASEnhancer;
+ preBracketHeaderStack = NULL;
+ bracketTypeStack = NULL;
+ parenStack = NULL;
+ structStack = NULL;
+ lineCommentNoIndent = false;
+ formattingStyle = STYLE_NONE;
+ bracketFormatMode = NONE_MODE;
+ pointerAlignment = ALIGN_NONE;
+ lineEnd = LINEEND_DEFAULT;
+ shouldPadOperators = false;
+ shouldPadParensOutside = false;
+ shouldPadParensInside = false;
+ shouldPadHeader = false;
+ shouldUnPadParens = false;
+ shouldBreakOneLineBlocks = true;
+ shouldBreakOneLineStatements = true;
+ shouldConvertTabs = false;
+ shouldIndentCol1Comments = false;
+ shouldBreakBlocks = false;
+ shouldBreakClosingHeaderBlocks = false;
+ shouldBreakClosingHeaderBrackets = false;
+ shouldDeleteEmptyLines = false;
+ shouldBreakElseIfs = false;
+ shouldAddBrackets = false;
+ shouldAddOneLineBrackets = false;
+
+ // initialize ASFormatter static member vectors
+ formatterFileType = 9; // reset to an invalid type
+ initVector(headers);
+ initVector(nonParenHeaders);
+ initVector(preDefinitionHeaders);
+ initVector(preCommandHeaders);
+ initVector(operators);
+ initVector(assignmentOperators);
+ initVector(castOperators);
+
+ // the following prevents warning messages with cppcheck
+ // it will NOT compile if activated
+// init();
+}
+
+/**
+ * Destructor of ASFormatter
+ */
+ASFormatter::~ASFormatter()
+{
+ // delete ASFormatter stack vectors
+ deleteContainer(preBracketHeaderStack);
+ deleteContainer(bracketTypeStack);
+ deleteContainer(parenStack);
+ deleteContainer(structStack);
+
+ // delete static member vectors using swap to eliminate memory leak reporting
+ // delete ASFormatter static member vectors
+ formatterFileType = 9; // reset to an invalid type
+ deleteVector(headers);
+ deleteVector(nonParenHeaders);
+ deleteVector(preDefinitionHeaders);
+ deleteVector(preCommandHeaders);
+ deleteVector(operators);
+ deleteVector(assignmentOperators);
+ deleteVector(castOperators);
+
+ // delete ASBeautifier static member vectors
+ // must be done when the ASFormatter object is deleted (not ASBeautifier)
+ ASBeautifier::deleteStaticVectors();
+
+ delete enhancer;
+}
+
+/**
+ * initialize the ASFormatter.
+ *
+ * init() should be called every time a ASFormatter object is to start
+ * formatting a NEW source file.
+ * init() recieves a pointer to a ASSourceIterator object that will be
+ * used to iterate through the source code.
+ *
+ * @param sourceIterator a pointer to the ASSourceIterator or ASStreamIterator object.
+ */
+void ASFormatter::init(ASSourceIterator *si)
+{
+ buildLanguageVectors();
+ fixOptionVariableConflicts();
+
+ ASBeautifier::init(si);
+ enhancer->init(getFileType(),
+ getIndentLength(),
+ getIndentString(),
+ getCaseIndent(),
+ getEmptyLineFill());
+ sourceIterator = si;
+
+ initContainer(preBracketHeaderStack, new vector<const string*>);
+ initContainer(parenStack, new vector<int>);
+ initContainer(structStack, new vector<bool>);
+ parenStack->push_back(0); // parenStack must contain this default entry
+ initContainer(bracketTypeStack, new vector<BracketType>);
+ bracketTypeStack->push_back(NULL_TYPE);
+
+ currentHeader = NULL;
+ currentLine = "";
+ readyFormattedLine = "";
+ formattedLine = "";
+ currentChar = ' ';
+ previousChar = ' ';
+ previousCommandChar = ' ';
+ previousNonWSChar = ' ';
+ quoteChar = '"';
+ charNum = 0;
+ leadingSpaces = 0;
+ formattedLineCommentNum = 0;
+ preprocBracketTypeStackSize = 0;
+ spacePadNum = 0;
+ nextLineSpacePadNum = 0;
+ currentLineFirstBracketNum = string::npos;
+ previousReadyFormattedLineLength = string::npos;
+ templateDepth = 0;
+ traceLineNumber = 0;
+ horstmannIndentChars = 0;
+ tabIncrementIn = 0;
+ previousBracketType = NULL_TYPE;
+ previousOperator = NULL;
+
+ isVirgin = true;
+ isInLineComment = false;
+ isInComment = false;
+ noTrimCommentContinuation = false;
+ isInPreprocessor = false;
+ doesLineStartComment = false;
+ lineEndsInCommentOnly = false;
+ lineIsLineCommentOnly = false;
+ lineIsEmpty = false;
+ isImmediatelyPostCommentOnly = false;
+ isImmediatelyPostEmptyLine = false;
+ isInQuote = false;
+ isInVerbatimQuote = false;
+ haveLineContinuationChar = false;
+ isInQuoteContinuation = false;
+ isSpecialChar = false;
+ isNonParenHeader = false;
+ foundNamespaceHeader = false;
+ foundClassHeader = false;
+ foundStructHeader = false;
+ foundInterfaceHeader = false;
+ foundPreDefinitionHeader = false;
+ foundPreCommandHeader = false;
+ foundCastOperator = false;
+ foundQuestionMark = false;
+ isInLineBreak = false;
+ endOfCodeReached = false;
+ isInExecSQL = false;
+ isInAsm = false;
+ isInAsmOneLine = false;
+ isInAsmBlock = false;
+ isLineReady = false;
+ isPreviousBracketBlockRelated = false;
+ isInPotentialCalculation = false;
+ shouldReparseCurrentChar = false;
+ needHeaderOpeningBracket = false;
+ shouldBreakLineAtNextChar = false;
+ passedSemicolon = false;
+ passedColon = false;
+ clearNonInStatement = false;
+ isInTemplate = false;
+ isInBlParen = false;
+ isImmediatelyPostComment = false;
+ isImmediatelyPostLineComment = false;
+ isImmediatelyPostEmptyBlock = false;
+ isImmediatelyPostPreprocessor = false;
+ isImmediatelyPostReturn = false;
+ isImmediatelyPostOperator = false;
+ isCharImmediatelyPostReturn = false;
+ isCharImmediatelyPostOperator = false;
+ isCharImmediatelyPostComment = false;
+ isPreviousCharPostComment = false;
+ isCharImmediatelyPostLineComment = false;
+ isCharImmediatelyPostOpenBlock = false;
+ isCharImmediatelyPostCloseBlock = false;
+ isCharImmediatelyPostTemplate = false;
+ breakCurrentOneLineBlock = false;
+ isInHorstmannRunIn = false;
+ currentLineBeginsWithBracket = false;
+ isPrependPostBlockEmptyLineRequested = false;
+ isAppendPostBlockEmptyLineRequested = false;
+ prependEmptyLine = false;
+ appendOpeningBracket = false;
+ foundClosingHeader = false;
+ isImmediatelyPostHeader = false;
+ isInHeader = false;
+ isInCase = false;
+ isJavaStaticConstructor = false;
+}
+
+/**
+ * build vectors for each programing language
+ * depending on the file extension.
+ */
+void ASFormatter::buildLanguageVectors()
+{
+ if (getFileType() == formatterFileType) // don't build unless necessary
+ return;
+
+ formatterFileType = getFileType();
+
+ headers->clear();
+ nonParenHeaders->clear();
+ preDefinitionHeaders->clear();
+ preCommandHeaders->clear();
+ operators->clear();
+ assignmentOperators->clear();
+ castOperators->clear();
+
+ ASResource::buildHeaders(headers, getFileType());
+ ASResource::buildNonParenHeaders(nonParenHeaders, getFileType());
+ ASResource::buildPreDefinitionHeaders(preDefinitionHeaders, getFileType());
+ ASResource::buildPreCommandHeaders(preCommandHeaders, getFileType());
+ if (operators->size() == 0)
+ ASResource::buildOperators(operators);
+ if (assignmentOperators->size() == 0)
+ ASResource::buildAssignmentOperators(assignmentOperators);
+ if (castOperators->size() == 0)
+ ASResource::buildCastOperators(castOperators);
+}
+
+/**
+ * set the variables for each preefined style.
+ * this will override any previous settings.
+ */
+void ASFormatter::fixOptionVariableConflicts()
+{
+ if (formattingStyle == STYLE_ALLMAN)
+ {
+ setBracketFormatMode(BREAK_MODE);
+ setBlockIndent(false);
+ setBracketIndent(false);
+ }
+ else if (formattingStyle == STYLE_JAVA)
+ {
+ setBracketFormatMode(ATTACH_MODE);
+ setBlockIndent(false);
+ setBracketIndent(false);
+ }
+ else if (formattingStyle == STYLE_KandR)
+ {
+ setBracketFormatMode(LINUX_MODE);
+ setBlockIndent(false);
+ setBracketIndent(false);
+ }
+ else if (formattingStyle == STYLE_STROUSTRUP)
+ {
+ setBracketFormatMode(STROUSTRUP_MODE);
+ setBlockIndent(false);
+ setBracketIndent(false);
+ if (!getIndentManuallySet())
+ {
+ if (getIndentString() == "\t")
+ setTabIndentation(5, getForceTabIndentation());
+ else
+ setSpaceIndentation(5);
+ }
+ }
+ else if (formattingStyle == STYLE_WHITESMITH)
+ {
+ setBracketFormatMode(BREAK_MODE);
+ setBlockIndent(false);
+ setBracketIndent(true);
+ setClassIndent(true);
+ setSwitchIndent(true);
+ }
+ else if (formattingStyle == STYLE_BANNER)
+ {
+ setBracketFormatMode(ATTACH_MODE);
+ setBlockIndent(false);
+ setBracketIndent(true);
+ setClassIndent(true);
+ setSwitchIndent(true);
+ }
+ else if (formattingStyle == STYLE_GNU)
+ {
+ setBracketFormatMode(BREAK_MODE);
+ setBlockIndent(true);
+ setBracketIndent(false);
+ if (!getIndentManuallySet())
+ {
+ if (getIndentString() == "\t")
+ setTabIndentation(2, getForceTabIndentation());
+ else
+ setSpaceIndentation(2);
+ }
+ }
+ else if (formattingStyle == STYLE_LINUX)
+ {
+ setBracketFormatMode(LINUX_MODE);
+ setBlockIndent(false);
+ setBracketIndent(false);
+ if (!getIndentManuallySet())
+ {
+ if (getIndentString() == "\t")
+ setTabIndentation(8, getForceTabIndentation());
+ else
+ setSpaceIndentation(8);
+ }
+ if (!getMinConditionalManuallySet())
+ setMinConditionalIndentLength(getIndentLength() / 2);
+ }
+ else if (formattingStyle == STYLE_HORSTMANN)
+ {
+ setBracketFormatMode(HORSTMANN_MODE);
+ setBlockIndent(false);
+ setBracketIndent(false);
+ setSwitchIndent(true);
+ if (!getIndentManuallySet())
+ {
+ if (getIndentString() == "\t")
+ setTabIndentation(3, getForceTabIndentation());
+ else
+ setSpaceIndentation(3);
+ }
+ }
+ else if (formattingStyle == STYLE_1TBS)
+ {
+ setBracketFormatMode(LINUX_MODE);
+ setBlockIndent(false);
+ setBracketIndent(false);
+ setAddBracketsMode(true);
+ }
+
+ // add-one-line-brackets implies keep-one-line-blocks
+ if (shouldAddOneLineBrackets)
+ setBreakOneLineBlocksMode(false);
+ // cannot have both indent-blocks and indent-brackets, default to indent-blocks
+ if (getBlockIndent())
+ setBracketIndent(false);
+}
+
+/**
+ * get the next formatted line.
+ *
+ * @return formatted line.
+ */
+
+string ASFormatter::nextLine()
+{
+ const string *newHeader;
+ bool isInVirginLine = isVirgin;
+ isCharImmediatelyPostComment = false;
+ isPreviousCharPostComment = false;
+ isCharImmediatelyPostLineComment = false;
+ isCharImmediatelyPostOpenBlock = false;
+ isCharImmediatelyPostCloseBlock = false;
+ isCharImmediatelyPostTemplate = false;
+ traceLineNumber++;
+
+ while (!isLineReady)
+ {
+ if (shouldReparseCurrentChar)
+ shouldReparseCurrentChar = false;
+ else if (!getNextChar())
+ {
+ breakLine();
+ return beautify(readyFormattedLine);
+ }
+ else // stuff to do when reading a new character...
+ {
+ // make sure that a virgin '{' at the begining of the file will be treated as a block...
+ if (isInVirginLine && currentChar == '{'
+ && currentLineBeginsWithBracket // lineBeginsWith('{')
+ && previousCommandChar == ' ')
+ previousCommandChar = '{';
+ if (clearNonInStatement)
+ {
+ isNonInStatementArray = false;
+ clearNonInStatement = false;
+ }
+ if (isInHorstmannRunIn)
+ isInLineBreak = false;
+ if (!isWhiteSpace(currentChar))
+ isInHorstmannRunIn = false;
+ isPreviousCharPostComment = isCharImmediatelyPostComment;
+ isCharImmediatelyPostComment = false;
+ isCharImmediatelyPostTemplate = false;
+ isCharImmediatelyPostReturn = false;
+ isCharImmediatelyPostOperator = false;
+ isCharImmediatelyPostOpenBlock = false;
+ isCharImmediatelyPostCloseBlock = false;
+ }
+
+// if (inLineNumber >= 7)
+// int x = 1;
+
+ if (shouldBreakLineAtNextChar && !isWhiteSpace(currentChar))
+ {
+ isInLineBreak = true;
+ shouldBreakLineAtNextChar = false;
+ }
+
+ if (isInExecSQL && !passedSemicolon)
+ {
+ if (currentChar == ';')
+ passedSemicolon = true;
+ appendCurrentChar();
+ continue;
+ }
+
+ if (isInLineComment)
+ {
+ formatLineCommentBody();
+ continue;
+ }
+ else if (isInComment)
+ {
+ formatCommentBody();
+ continue;
+ }
+
+ // not in line comment or comment
+
+ else if (isInQuote)
+ {
+ formatQuoteBody();
+ continue;
+ }
+
+ if (isSequenceReached("//"))
+ {
+ formatLineCommentOpener();
+ continue;
+ }
+ else if (isSequenceReached("/*"))
+ {
+ formatCommentOpener();
+ continue;
+ }
+ else if (currentChar == '"' || currentChar == '\'')
+ {
+ formatQuoteOpener();
+ continue;
+ }
+ // treat these preprocessor statements as a line comment
+ else if (currentChar =='#')
+ {
+ if (isSequenceReached("#region")
+ || isSequenceReached("#endregion")
+ || isSequenceReached("#error")
+ || isSequenceReached("#warning"))
+ {
+ // check for horstmann run-in
+ if (formattedLine[0] == '{')
+ {
+ isInLineBreak = true;
+ isInHorstmannRunIn = false;
+ }
+ isInLineComment = true;
+ appendCurrentChar();
+ continue;
+ }
+ }
+
+ if (isInPreprocessor)
+ {
+ appendCurrentChar();
+ continue;
+ }
+
+ // handle white space - needed to simplify the rest.
+ if (isWhiteSpace(currentChar))
+ {
+ appendCurrentChar();
+ continue;
+ }
+
+ /* not in MIDDLE of quote or comment or SQL or white-space of any type ... */
+
+ // check if in preprocessor
+ // ** isInPreprocessor will be automatically reset at the begining
+ // of a new line in getnextChar()
+ if (currentChar == '#')
+ {
+ isInPreprocessor = true;
+ // check for horstmann run-in
+ if (formattedLine[0] == '{')
+ {
+ isInLineBreak = true;
+ isInHorstmannRunIn = false;
+ }
+ processPreprocessor();
+ // need to fall thru here to reset the variables
+ }
+
+ /* not in preprocessor ... */
+
+ if (isImmediatelyPostComment)
+ {
+ isImmediatelyPostComment = false;
+ isCharImmediatelyPostComment = true;
+ }
+
+ if (isImmediatelyPostLineComment)
+ {
+ isImmediatelyPostLineComment = false;
+ isCharImmediatelyPostLineComment = true;
+ }
+
+ if (isImmediatelyPostReturn)
+ {
+ isImmediatelyPostReturn = false;
+ isCharImmediatelyPostReturn = true;
+ }
+
+ if (isImmediatelyPostOperator)
+ {
+ isImmediatelyPostOperator = false;
+ isCharImmediatelyPostOperator = true;
+ }
+
+ // reset isImmediatelyPostHeader information
+ if (isImmediatelyPostHeader)
+ {
+ // should brackets be added
+ if (currentChar != '{' && shouldAddBrackets)
+ {
+ bool bracketsAdded = addBracketsToStatement();
+ if (bracketsAdded && !shouldAddOneLineBrackets)
+ {
+ size_t firstText = currentLine.find_first_not_of(" \t");
+ assert(firstText != string::npos);
+ if ((int) firstText == charNum)
+ breakCurrentOneLineBlock = true;
+ }
+ }
+
+ // Make sure headers are broken from their succeeding blocks
+ // (e.g.
+ // if (isFoo) DoBar();
+ // should become
+ // if (isFoo)
+ // DoBar;
+ // )
+ // But treat else if() as a special case which should not be broken!
+ if (shouldBreakOneLineStatements
+ && isOkToBreakBlock(bracketTypeStack->back()))
+ {
+ // if may break 'else if()'s, then simply break the line
+ if (shouldBreakElseIfs)
+ isInLineBreak = true;
+ }
+
+ isImmediatelyPostHeader = false;
+ }
+
+ if (passedSemicolon) // need to break the formattedLine
+ {
+ passedSemicolon = false;
+ if (parenStack->back() == 0 && currentChar != ';') // allow ;;
+ {
+ // does a one-line statement have ending comments?
+ if (isBracketType(bracketTypeStack->back(), SINGLE_LINE_TYPE))
+ {
+ size_t blockEnd = currentLine.rfind(AS_CLOSE_BRACKET);
+ assert(blockEnd != string::npos);
+ // move ending comments to this formattedLine
+ if (isBeforeAnyLineEndComment(blockEnd))
+ {
+ size_t commentStart = currentLine.find_first_not_of(" \t", blockEnd + 1);
+ assert(commentStart != string::npos);
+ assert((currentLine.compare(commentStart, 2, "//") == 0)
+ || (currentLine.compare(commentStart, 2, "/*") == 0));
+ size_t commentLength = currentLine.length() - commentStart;
+ formattedLine.append(getIndentLength() - 1, ' ');
+ formattedLine.append(currentLine, commentStart, commentLength);
+ currentLine.erase(commentStart, commentLength);
+ }
+ }
+ isInExecSQL = false;
+ shouldReparseCurrentChar = true;
+ isInLineBreak = true;
+ if (needHeaderOpeningBracket)
+ {
+ isCharImmediatelyPostCloseBlock = true;
+ needHeaderOpeningBracket = false;
+ }
+ continue;
+ }
+ }
+
+ if (passedColon)
+ {
+ passedColon = false;
+ if (parenStack->back() == 0 && !isBeforeAnyComment())
+ {
+ shouldReparseCurrentChar = true;
+ isInLineBreak = true;
+ continue;
+ }
+ }
+
+ // Check if in template declaration, e.g. foo<bar> or foo<bar,fig>
+ // If so, set isInTemplate to true
+ if (!isInTemplate && currentChar == '<')
+ {
+ int maxTemplateDepth = 0;
+ templateDepth = 0;
+ for (size_t i = charNum;
+ i < currentLine.length();
+ i++)
+ {
+ char currentChar = currentLine[i];
+
+ if (currentChar == '<')
+ {
+ templateDepth++;
+ maxTemplateDepth++;
+ }
+ else if (currentChar == '>')
+ {
+ templateDepth--;
+ if (templateDepth == 0)
+ {
+ // this is a template!
+ isInTemplate = true;
+ templateDepth = maxTemplateDepth;
+ break;
+ }
+ }
+ else if (currentLine.compare(i, 2, "&&") == 0
+ || currentLine.compare(i, 2, "||") == 0)
+ {
+ // this is not a template -> leave...
+ isInTemplate = false;
+ break;
+ }
+ else if (currentChar == ',' // comma, e.g. A<int, char>
+ || currentChar == '&' // reference, e.g. A<int&>
+ || currentChar == '*' // pointer, e.g. A<int*>
+ || currentChar == ':' // ::, e.g. std::string
+ || currentChar == '[' // [] e.g. string[]
+ || currentChar == ']' // [] e.g. string[]
+ || currentChar == '(' // (...) e.g. function definition
+ || currentChar == ')') // (...) e.g. function definition
+ {
+ continue;
+ }
+ else if (!isLegalNameChar(currentChar) && !isWhiteSpace(currentChar))
+ {
+ // this is not a template -> leave...
+ isInTemplate = false;
+ break;
+ }
+ }
+ }
+
+ // handle parenthesies
+ if (currentChar == '(' || currentChar == '[' || (isInTemplate && currentChar == '<'))
+ {
+ parenStack->back()++;
+ if (currentChar == '[')
+ isInBlParen = true;
+ }
+ else if (currentChar == ')' || currentChar == ']' || (isInTemplate && currentChar == '>'))
+ {
+ parenStack->back()--;
+ if (isInTemplate && currentChar == '>')
+ {
+ templateDepth--;
+ if (templateDepth == 0)
+ {
+ isInTemplate = false;
+ isCharImmediatelyPostTemplate = true;
+ }
+ }
+
+ // check if this parenthesis closes a header, e.g. if (...), while (...)
+ if (isInHeader && parenStack->back() == 0)
+ {
+ isInHeader = false;
+ isImmediatelyPostHeader = true;
+ }
+ if (currentChar == ']')
+ isInBlParen = false;
+ if (currentChar == ')')
+ {
+ foundCastOperator = false;
+ if (parenStack->back() == 0)
+ isInAsm = false;
+ }
+ }
+
+ // handle brackets
+ if (currentChar == '{' || currentChar == '}')
+ {
+ // if appendOpeningBracket this was already done for the original bracket
+ if (currentChar == '{' && !appendOpeningBracket)
+ {
+ BracketType newBracketType = getBracketType();
+ foundNamespaceHeader = false;
+ foundClassHeader = false;
+ foundStructHeader = false;
+ foundInterfaceHeader = false;
+ foundPreDefinitionHeader = false;
+ foundPreCommandHeader = false;
+ isInPotentialCalculation = false;
+ isJavaStaticConstructor = false;
+ needHeaderOpeningBracket = false;
+
+ isPreviousBracketBlockRelated = !isBracketType(newBracketType, ARRAY_TYPE);
+ bracketTypeStack->push_back(newBracketType);
+ preBracketHeaderStack->push_back(currentHeader);
+ currentHeader = NULL;
+ structStack->push_back(isInIndentableStruct);
+ if (isBracketType(newBracketType, STRUCT_TYPE) && isCStyle())
+ isInIndentableStruct = isStructAccessModified(currentLine, charNum);
+ else
+ isInIndentableStruct = false;
+ }
+
+ // this must be done before the bracketTypeStack is popped
+ BracketType bracketType = bracketTypeStack->back();
+ bool isOpeningArrayBracket = (isBracketType(bracketType, ARRAY_TYPE)
+ && bracketTypeStack->size() >= 2
+ && !isBracketType((*bracketTypeStack)[bracketTypeStack->size()-2], ARRAY_TYPE)
+ );
+
+ if (currentChar == '}')
+ {
+ // if a request has been made to append a post block empty line,
+ // but the block exists immediately before a closing bracket,
+ // then there is no need for the post block empty line.
+ isAppendPostBlockEmptyLineRequested = false;
+ breakCurrentOneLineBlock = false;
+ isInAsmBlock = false;
+
+ // added for release 1.24
+ // TODO: remove at the appropriate time
+ assert(isInAsm == false);
+ assert(isInAsmOneLine == false);
+ assert(isInQuote == false);
+ isInAsm = isInAsmOneLine = isInQuote = false;
+ // end remove
+
+ if (bracketTypeStack->size() > 1)
+ {
+ previousBracketType = bracketTypeStack->back();
+ bracketTypeStack->pop_back();
+ isPreviousBracketBlockRelated = !isBracketType(bracketType, ARRAY_TYPE);
+ }
+ else
+ {
+ previousBracketType = NULL_TYPE;
+ isPreviousBracketBlockRelated = false;
+ }
+
+ if (!preBracketHeaderStack->empty())
+ {
+ currentHeader = preBracketHeaderStack->back();
+ preBracketHeaderStack->pop_back();
+ }
+ else
+ currentHeader = NULL;
+
+ if (!structStack->empty())
+ {
+ isInIndentableStruct = structStack->back();
+ structStack->pop_back();
+ }
+ else
+ isInIndentableStruct = false;
+
+ if (isBracketType(bracketType, ARRAY_NIS_TYPE) && !isBracketType(bracketType, SINGLE_LINE_TYPE))
+ clearNonInStatement = true;
+ }
+
+ // format brackets
+ appendOpeningBracket = false;
+ if (isBracketType(bracketType, ARRAY_TYPE))
+ {
+ formatArrayBrackets(bracketType, isOpeningArrayBracket);
+ }
+ else
+ {
+ if (currentChar == '{')
+ formatOpeningBracket(bracketType);
+ else
+ formatClosingBracket(bracketType);
+ }
+ continue;
+ }
+
+ if ((((previousCommandChar == '{' && isPreviousBracketBlockRelated)
+ || ((previousCommandChar == '}'
+ && !isImmediatelyPostEmptyBlock
+ && isPreviousBracketBlockRelated
+ && !isPreviousCharPostComment // Fixes wrongly appended newlines after '}' immediately after comments
+ && peekNextChar() != ' '
+ && !isBracketType(previousBracketType, DEFINITION_TYPE))
+ && !isBracketType(bracketTypeStack->back(), DEFINITION_TYPE)))
+ && isOkToBreakBlock(bracketTypeStack->back()))
+ // check for array
+ || (isBracketType(bracketTypeStack->back(), ARRAY_TYPE)
+ && !isBracketType(bracketTypeStack->back(), SINGLE_LINE_TYPE)
+ && isNonInStatementArray))
+ {
+ isCharImmediatelyPostOpenBlock = (previousCommandChar == '{');
+ isCharImmediatelyPostCloseBlock = (previousCommandChar == '}');
+
+ if (isCharImmediatelyPostOpenBlock
+ && !isCharImmediatelyPostComment
+ && !isCharImmediatelyPostLineComment)
+ {
+ previousCommandChar = ' ';
+
+ if (bracketFormatMode == NONE_MODE)
+ {
+ if (shouldBreakOneLineBlocks
+ && isBracketType(bracketTypeStack->back(), SINGLE_LINE_TYPE))
+ isInLineBreak = true;
+ else if (currentLineBeginsWithBracket)
+ formatRunIn();
+ else
+ breakLine();
+ }
+ else if (bracketFormatMode == HORSTMANN_MODE
+ && currentChar != '#')
+ formatRunIn();
+ else
+ isInLineBreak = true;
+ }
+ else if (isCharImmediatelyPostCloseBlock
+ && shouldBreakOneLineStatements
+ && (isLegalNameChar(currentChar) && currentChar != '.')
+ && !isCharImmediatelyPostComment)
+ {
+ previousCommandChar = ' ';
+ isInLineBreak = true;
+ }
+ }
+
+ // reset block handling flags
+ isImmediatelyPostEmptyBlock = false;
+
+ // look for headers
+ bool isPotentialHeader = isCharPotentialHeader(currentLine, charNum);
+
+ if (isPotentialHeader && !isInTemplate)
+ {
+ isNonParenHeader = false;
+ foundClosingHeader = false;
+ newHeader = findHeader(headers);
+
+ if (newHeader != NULL)
+ {
+ char peekChar = ASBase::peekNextChar(currentLine, charNum + newHeader->length() - 1);
+
+ // is not a header if part of a definition
+ if (peekChar == ',' || peekChar == ')')
+ newHeader = NULL;
+ // the following accessor definitions are NOT headers
+ // goto default; is NOT a header
+ else if ((newHeader == &AS_GET || newHeader == &AS_SET || newHeader == &AS_DEFAULT)
+ && peekChar == ';')
+ {
+ newHeader = NULL;
+ }
+ }
+
+ if (newHeader != NULL)
+ {
+ const string *previousHeader;
+
+ // recognize closing headers of do..while, if..else, try..catch..finally
+ if ((newHeader == &AS_ELSE && currentHeader == &AS_IF)
+ || (newHeader == &AS_WHILE && currentHeader == &AS_DO)
+ || (newHeader == &AS_CATCH && currentHeader == &AS_TRY)
+ || (newHeader == &AS_CATCH && currentHeader == &AS_CATCH)
+ || (newHeader == &AS_FINALLY && currentHeader == &AS_TRY)
+ || (newHeader == &AS_FINALLY && currentHeader == &AS_CATCH)
+ || (newHeader == &AS_SET && currentHeader == &AS_GET)
+ || (newHeader == &AS_REMOVE && currentHeader == &AS_ADD))
+ foundClosingHeader = true;
+
+ previousHeader = currentHeader;
+ currentHeader = newHeader;
+ needHeaderOpeningBracket = true;
+
+ if (foundClosingHeader && previousNonWSChar == '}')
+ {
+ if (isOkToBreakBlock(bracketTypeStack->back()))
+ isLineBreakBeforeClosingHeader();
+
+ // get the adjustment for a comment following the closing header
+ if (isInLineBreak)
+ nextLineSpacePadNum = getNextLineCommentAdjustment();
+ else
+ spacePadNum = getCurrentLineCommentAdjustment();
+ }
+
+ // check if the found header is non-paren header
+ isNonParenHeader = findHeader(nonParenHeaders) != NULL;
+
+ // join 'else if' statements
+ if (currentHeader == &AS_IF && previousHeader == &AS_ELSE && isInLineBreak
+ && !shouldBreakElseIfs && !isCharImmediatelyPostLineComment)
+ {
+ // 'else' must be last thing on the line, but must not be #else
+ size_t start = formattedLine.length() >= 6 ? formattedLine.length()-6 : 0;
+ if (formattedLine.find("else", start) != string::npos
+ && formattedLine.find("#else", start) == string::npos)
+ {
+ appendSpacePad();
+ isInLineBreak = false;
+ }
+ }
+
+ appendSequence(*currentHeader);
+ goForward(currentHeader->length() - 1);
+ // if a paren-header is found add a space after it, if needed
+ // this checks currentLine, appendSpacePad() checks formattedLine
+ // in C# 'catch' can be either a paren or non-paren header
+ if (shouldPadHeader
+ && (!isNonParenHeader || (currentHeader == &AS_CATCH && peekNextChar() == '('))
+ && charNum < (int) currentLine.length() && !isWhiteSpace(currentLine[charNum+1]))
+ appendSpacePad();
+
+ // Signal that a header has been reached
+ // *** But treat a closing while() (as in do...while)
+ // as if it were NOT a header since a closing while()
+ // should never have a block after it!
+ if (!(foundClosingHeader && currentHeader == &AS_WHILE))
+ {
+ isInHeader = true;
+
+ // in C# 'catch' and 'delegate' can be a paren or non-paren header
+ if (isNonParenHeader && !isSharpStyleWithParen(currentHeader))
+ {
+ isImmediatelyPostHeader = true;
+ isInHeader = false;
+ }
+ }
+
+ if (shouldBreakBlocks
+ && isOkToBreakBlock(bracketTypeStack->back()))
+ {
+ if (previousHeader == NULL
+ && !foundClosingHeader
+ && !isCharImmediatelyPostOpenBlock
+ && !isImmediatelyPostCommentOnly)
+ {
+ isPrependPostBlockEmptyLineRequested = true;
+ }
+
+ if (currentHeader == &AS_ELSE
+ || currentHeader == &AS_CATCH
+ || currentHeader == &AS_FINALLY
+ || foundClosingHeader)
+ {
+ isPrependPostBlockEmptyLineRequested = false;
+ }
+
+ if (shouldBreakClosingHeaderBlocks
+ && isCharImmediatelyPostCloseBlock
+ && !isImmediatelyPostCommentOnly
+ && currentHeader != &AS_WHILE) // closing do-while block
+ {
+ isPrependPostBlockEmptyLineRequested = true;
+ }
+
+ }
+
+ continue;
+ }
+ else if ((newHeader = findHeader(preDefinitionHeaders)) != NULL
+ && parenStack->back() == 0)
+ {
+ if (newHeader == &AS_NAMESPACE)
+ foundNamespaceHeader = true;
+ if (newHeader == &AS_CLASS)
+ foundClassHeader = true;
+ if (newHeader == &AS_STRUCT)
+ foundStructHeader = true;
+ if (newHeader == &AS_INTERFACE)
+ foundInterfaceHeader = true;
+ foundPreDefinitionHeader = true;
+ appendSequence(*newHeader);
+ goForward(newHeader->length() - 1);
+
+ continue;
+ }
+ else if ((newHeader = findHeader(preCommandHeaders)) != NULL)
+ {
+ if (!(*newHeader == AS_CONST && previousCommandChar != ')')) // 'const' member functions is a command bracket
+ foundPreCommandHeader = true;
+ appendSequence(*newHeader);
+ goForward(newHeader->length() - 1);
+
+ continue;
+ }
+ else if ((newHeader = findHeader(castOperators)) != NULL)
+ {
+ foundCastOperator = true;
+ appendSequence(*newHeader);
+ goForward(newHeader->length() - 1);
+ continue;
+ }
+ } // (isPotentialHeader && !isInTemplate)
+
+ if (isInLineBreak) // OK to break line here
+ {
+ breakLine();
+ if (isInVirginLine) // adjust for the first line
+ {
+ lineCommentNoBeautify = lineCommentNoIndent;
+ lineCommentNoIndent = false;
+ }
+ }
+
+ if (previousNonWSChar == '}' || currentChar == ';')
+ {
+ if (currentChar == ';')
+ {
+ if ((shouldBreakOneLineStatements
+ || isBracketType(bracketTypeStack->back(), SINGLE_LINE_TYPE))
+ && isOkToBreakBlock(bracketTypeStack->back()))
+ {
+ passedSemicolon = true;
+ }
+
+ // append post block empty line for unbracketed header
+ if (shouldBreakBlocks && currentHeader != NULL && parenStack->back() == 0)
+ {
+ isAppendPostBlockEmptyLineRequested = true;
+ }
+ }
+
+ // end of block if a closing bracket was found
+ // or an opening bracket was not found (';' closes)
+ if (currentChar != ';'
+ || (needHeaderOpeningBracket && parenStack->back() == 0))
+ currentHeader = NULL;
+
+ foundQuestionMark = false;
+ foundNamespaceHeader = false;
+ foundClassHeader = false;
+ foundStructHeader = false;
+ foundInterfaceHeader = false;
+ foundPreDefinitionHeader = false;
+ foundPreCommandHeader = false;
+ foundCastOperator = false;
+ isInPotentialCalculation = false;
+ isSharpAccessor = false;
+ isSharpDelegate = false;
+ isInExtern = false;
+ nonInStatementBracket = 0;
+ }
+
+ if (currentChar == ':' && shouldBreakOneLineStatements)
+ {
+ if (isInCase
+ && previousChar != ':' // not part of '::'
+ && peekNextChar() != ':') // not part of '::'
+ {
+ isInCase = false;
+ passedColon = true;
+ }
+ else if (isCStyle() // for C/C++ only
+ && !foundQuestionMark // not in a ... ? ... : ... sequence
+ && !foundPreDefinitionHeader // not in a definition block (e.g. class foo : public bar
+ && previousCommandChar != ')' // not immediately after closing paren of a method header, e.g. ASFormatter::ASFormatter(...) : ASBeautifier(...)
+ && previousChar != ':' // not part of '::'
+ && peekNextChar() != ':' // not part of '::'
+ && !isdigit(peekNextChar()) // not a bit field
+ && !isInAsm // not in extended assembler
+ && !isInAsmOneLine // not in extended assembler
+ && !isInAsmBlock) // not in extended assembler
+ {
+ passedColon = true;
+ }
+ }
+
+ if (currentChar == '?')
+ foundQuestionMark = true;
+
+ if (isPotentialHeader && !isInTemplate)
+ {
+ if (findKeyword(currentLine, charNum, AS_CASE)
+ || findKeyword(currentLine, charNum, AS_DEFAULT))
+ isInCase = true;
+
+ if (findKeyword(currentLine, charNum, AS_NEW))
+ isInPotentialCalculation = false;
+
+ if (findKeyword(currentLine, charNum, AS_RETURN))
+ {
+ isInPotentialCalculation = true; // return is the same as an = sign
+ isImmediatelyPostReturn = true;
+ }
+
+ if (findKeyword(currentLine, charNum, AS_OPERATOR))
+ isImmediatelyPostOperator = true;
+
+ if (isCStyle() && findKeyword(currentLine, charNum, AS_EXTERN))
+ isInExtern = true;
+
+ if (isCStyle() && isExecSQL(currentLine, charNum))
+ isInExecSQL = true;
+
+ if (isCStyle())
+ {
+ if (findKeyword(currentLine, charNum, AS_ASM)
+ || findKeyword(currentLine, charNum, AS__ASM__))
+ {
+ isInAsm = true;
+ }
+ else if (findKeyword(currentLine, charNum, AS_MS_ASM) // microsoft specific
+ || findKeyword(currentLine, charNum, AS_MS__ASM))
+ {
+ int index = 4;
+ if (peekNextChar() == '_') // check for __asm
+ index = 5;
+
+ char peekedChar = ASBase::peekNextChar(currentLine, charNum + index);
+ if (peekedChar == '{' || peekedChar == ' ')
+ isInAsmBlock = true;
+ else
+ isInAsmOneLine = true;
+ }
+ }
+
+ if (isJavaStyle()
+ && (findKeyword(currentLine, charNum, AS_STATIC)
+ && isNextCharOpeningBracket(charNum + 6)))
+ isJavaStaticConstructor = true;
+
+ if (isSharpStyle()
+ && (findKeyword(currentLine, charNum, AS_DELEGATE)
+ || findKeyword(currentLine, charNum, AS_UNCHECKED)))
+ isSharpDelegate = true;
+
+ // append the entire name
+ string name = getCurrentWord(currentLine, charNum);
+ appendSequence(name);
+ goForward(name.length() - 1);
+
+ continue;
+
+ } // (isPotentialHeader && !isInTemplate)
+
+ // determine if this is a potential calculation
+
+ bool isPotentialOperator = isCharPotentialOperator(currentChar);
+ newHeader = NULL;
+
+ if (isPotentialOperator)
+ {
+ newHeader = findOperator(operators);
+
+ if (newHeader != NULL)
+ {
+ // correct mistake of two >> closing a template
+ if (isInTemplate && (newHeader == &AS_GR_GR || newHeader == &AS_GR_GR_GR))
+ newHeader = &AS_GR;
+
+ if (!isInPotentialCalculation)
+ {
+ // must determine if newHeader is an assignment operator
+ // do NOT use findOperator!!!
+ if (find(assignmentOperators->begin(), assignmentOperators->end(), newHeader)
+ != assignmentOperators->end())
+ {
+ char peekedChar = peekNextChar();
+ isInPotentialCalculation = (!(newHeader == &AS_EQUAL && peekedChar == '*')
+ && !(newHeader == &AS_EQUAL && peekedChar == '&'));
+ }
+ }
+ }
+ }
+
+ // process pointers and references
+ // check new header to elimnate things like '&&' sequence
+ if (isCStyle()
+ && (newHeader == &AS_MULT || newHeader == &AS_BIT_AND)
+ && isPointerOrReference()
+ && !isDereferenceOrAddressOf())
+ {
+ formatPointerOrReference();
+ continue;
+ }
+
+ if (shouldPadOperators && newHeader != NULL)
+ {
+ padOperators(newHeader);
+ continue;
+ }
+
+ // pad commas and semi-colons
+ if (currentChar == ';'
+ || (currentChar == ',' && shouldPadOperators))
+ {
+ char nextChar = ' ';
+ if (charNum + 1 < (int) currentLine.length())
+ nextChar = currentLine[charNum+1];
+ if (!isWhiteSpace(nextChar)
+ && nextChar != '}'
+ && nextChar != ')'
+ && nextChar != ']'
+ && nextChar != '>'
+ && nextChar != ';'
+ && !isBeforeAnyComment()
+ /* && !(isBracketType(bracketTypeStack->back(), ARRAY_TYPE)) */
+ )
+ {
+ appendCurrentChar();
+ appendSpaceAfter();
+ continue;
+ }
+ }
+
+ if ((shouldPadParensOutside || shouldPadParensInside || shouldUnPadParens)
+ && (currentChar == '(' || currentChar == ')'))
+ {
+ padParens();
+ continue;
+ }
+
+ appendCurrentChar();
+ } // end of while loop * end of while loop * end of while loop * end of while loop
+
+ // return a beautified (i.e. correctly indented) line.
+
+ string beautifiedLine;
+ size_t readyFormattedLineLength = trim(readyFormattedLine).length();
+
+ if (prependEmptyLine // prepend a blank line before this formatted line
+ && readyFormattedLineLength > 0
+ && previousReadyFormattedLineLength > 0)
+ {
+ isLineReady = true; // signal a waiting readyFormattedLine
+ beautifiedLine = beautify("");
+ previousReadyFormattedLineLength = 0;
+ }
+ else // format the current formatted line
+ {
+ isLineReady = false;
+ horstmannIndentInStatement = horstmannIndentChars;
+ beautifiedLine = beautify(readyFormattedLine);
+ previousReadyFormattedLineLength = readyFormattedLineLength;
+ // the enhancer is not called for new empty lines
+ // or no-indent line comments
+ if (!lineCommentNoBeautify)
+ enhancer->enhance(beautifiedLine, isInBeautifySQL);
+ horstmannIndentChars = 0;
+ lineCommentNoBeautify = lineCommentNoIndent;
+ lineCommentNoIndent = false;
+ isInBeautifySQL = isInExecSQL;
+ }
+
+ prependEmptyLine = false;
+ return beautifiedLine;
+}
+
+
+/**
+ * check if there are any indented lines ready to be read by nextLine()
+ *
+ * @return are there any indented lines ready?
+ */
+bool ASFormatter::hasMoreLines() const
+{
+ return !endOfCodeReached;
+}
+
+/**
+ * comparison function for BracketType enum
+ */
+bool ASFormatter::isBracketType(BracketType a, BracketType b) const
+{
+ return ((a & b) == b);
+}
+
+/**
+ * set the formatting style.
+ *
+ * @param mode the formatting style.
+ */
+void ASFormatter::setFormattingStyle(FormatStyle style)
+{
+ formattingStyle = style;
+}
+
+/**
+ * set the add brackets mode.
+ * options:
+ * true brackets added to headers for single line statements.
+ * false brackets NOT added to headers for single line statements.
+ *
+ * @param mode the bracket formatting mode.
+ */
+void ASFormatter::setAddBracketsMode(bool state)
+{
+ shouldAddBrackets = state;
+}
+
+/**
+ * set the add one line brackets mode.
+ * options:
+ * true one line brackets added to headers for single line statements.
+ * false one line brackets NOT added to headers for single line statements.
+ *
+ * @param mode the bracket formatting mode.
+ */
+void ASFormatter::setAddOneLineBracketsMode(bool state)
+{
+ shouldAddBrackets = state;
+ shouldAddOneLineBrackets = state;
+}
+
+/**
+ * set the bracket formatting mode.
+ * options:
+ *
+ * @param mode the bracket formatting mode.
+ */
+void ASFormatter::setBracketFormatMode(BracketMode mode)
+{
+ bracketFormatMode = mode;
+}
+
+/**
+ * set closing header bracket breaking mode
+ * options:
+ * true brackets just before closing headers (e.g. 'else', 'catch')
+ * will be broken, even if standard brackets are attached.
+ * false closing header brackets will be treated as standard brackets.
+ *
+ * @param state the closing header bracket breaking mode.
+ */
+void ASFormatter::setBreakClosingHeaderBracketsMode(bool state)
+{
+ shouldBreakClosingHeaderBrackets = state;
+}
+
+/**
+ * set 'else if()' breaking mode
+ * options:
+ * true 'else' headers will be broken from their succeeding 'if' headers.
+ * false 'else' headers will be attached to their succeeding 'if' headers.
+ *
+ * @param state the 'else if()' breaking mode.
+ */
+void ASFormatter::setBreakElseIfsMode(bool state)
+{
+ shouldBreakElseIfs = state;
+}
+
+/**
+ * set operator padding mode.
+ * options:
+ * true statement operators will be padded with spaces around them.
+ * false statement operators will not be padded.
+ *
+ * @param state the padding mode.
+ */
+void ASFormatter::setOperatorPaddingMode(bool state)
+{
+ shouldPadOperators = state;
+}
+
+/**
+ * set parenthesis outside padding mode.
+ * options:
+ * true statement parenthesiss will be padded with spaces around them.
+ * false statement parenthesiss will not be padded.
+ *
+ * @param state the padding mode.
+ */
+void ASFormatter::setParensOutsidePaddingMode(bool state)
+{
+ shouldPadParensOutside = state;
+}
+
+/**
+ * set parenthesis inside padding mode.
+ * options:
+ * true statement parenthesis will be padded with spaces around them.
+ * false statement parenthesis will not be padded.
+ *
+ * @param state the padding mode.
+ */
+void ASFormatter::setParensInsidePaddingMode(bool state)
+{
+ shouldPadParensInside = state;
+}
+
+/**
+ * set header padding mode.
+ * options:
+ * true headers will be padded with spaces around them.
+ * false headers will not be padded.
+ *
+ * @param state the padding mode.
+ */
+void ASFormatter::setParensHeaderPaddingMode(bool state)
+{
+ shouldPadHeader = state;
+}
+
+/**
+ * set parenthesis unpadding mode.
+ * options:
+ * true statement parenthesis will be unpadded with spaces removed around them.
+ * false statement parenthesis will not be unpadded.
+ *
+ * @param state the padding mode.
+ */
+void ASFormatter::setParensUnPaddingMode(bool state)
+{
+ shouldUnPadParens = state;
+}
+
+/**
+ * set option to break/not break one-line blocks
+ *
+ * @param state true = break, false = don't break.
+ */
+void ASFormatter::setBreakOneLineBlocksMode(bool state)
+{
+ shouldBreakOneLineBlocks = state;
+}
+
+/**
+ * set option to break/not break lines consisting of multiple statements.
+ *
+ * @param state true = break, false = don't break.
+ */
+void ASFormatter::setSingleStatementsMode(bool state)
+{
+ shouldBreakOneLineStatements = state;
+}
+
+/**
+ * set option to convert tabs to spaces.
+ *
+ * @param state true = convert, false = don't convert.
+ */
+void ASFormatter::setTabSpaceConversionMode(bool state)
+{
+ shouldConvertTabs = state;
+}
+
+/**
+ * set option to indent comments in column 1.
+ *
+ * @param state true = indent, false = don't indent.
+ */
+void ASFormatter::setIndentCol1CommentsMode(bool state)
+{
+ shouldIndentCol1Comments = state;
+}
+
+/**
+ * set option to force all line ends to a particular style.
+ *
+ * @param fmt format enum value
+ */
+void ASFormatter::setLineEndFormat(LineEndFormat fmt)
+{
+ lineEnd = fmt;
+}
+
+/**
+ * set option to break unrelated blocks of code with empty lines.
+ *
+ * @param state true = convert, false = don't convert.
+ */
+void ASFormatter::setBreakBlocksMode(bool state)
+{
+ shouldBreakBlocks = state;
+}
+
+/**
+ * set option to break closing header blocks of code (such as 'else', 'catch', ...) with empty lines.
+ *
+ * @param state true = convert, false = don't convert.
+ */
+void ASFormatter::setBreakClosingHeaderBlocksMode(bool state)
+{
+ shouldBreakClosingHeaderBlocks = state;
+}
+
+/**
+ * set option to delete empty lines.
+ *
+ * @param state true = delete, false = don't delete.
+ */
+void ASFormatter::setDeleteEmptyLinesMode(bool state)
+{
+ shouldDeleteEmptyLines = state;
+}
+
+/**
+ * set the pointer alignment.
+ * options:
+ *
+ * @param alignment the pointer alignment.
+ */
+void ASFormatter::setPointerAlignment(PointerAlign alignment)
+{
+ pointerAlignment = alignment;
+}
+
+/**
+ * jump over several characters.
+ *
+ * @param i the number of characters to jump over.
+ */
+void ASFormatter::goForward(int i)
+{
+ while (--i >= 0)
+ getNextChar();
+}
+
+/**
+ * peek at the next unread character.
+ *
+ * @return the next unread character.
+ */
+char ASFormatter::peekNextChar() const
+{
+ char ch = ' ';
+ size_t peekNum = currentLine.find_first_not_of(" \t", charNum + 1);
+
+ if (peekNum == string::npos)
+ return ch;
+
+ ch = currentLine[peekNum];
+
+ return ch;
+}
+
+/**
+ * check if current placement is before a comment
+ *
+ * @return is before a comment.
+ */
+bool ASFormatter::isBeforeComment() const
+{
+ bool foundComment = false;
+ size_t peekNum = currentLine.find_first_not_of(" \t", charNum + 1);
+
+ if (peekNum == string::npos)
+ return foundComment;
+
+ foundComment = (currentLine.compare(peekNum, 2, "/*") == 0);
+
+ return foundComment;
+}
+
+/**
+ * check if current placement is before a comment or line-comment
+ *
+ * @return is before a comment or line-comment.
+ */
+bool ASFormatter::isBeforeAnyComment() const
+{
+ bool foundComment = false;
+ size_t peekNum = currentLine.find_first_not_of(" \t", charNum + 1);
+
+ if (peekNum == string::npos)
+ return foundComment;
+
+ foundComment = (currentLine.compare(peekNum, 2, "/*") == 0
+ || currentLine.compare(peekNum, 2, "//") == 0);
+
+ return foundComment;
+}
+
+/**
+ * check if current placement is before a comment or line-comment
+ * if a block comment it must be at the end of the line
+ *
+ * @return is before a comment or line-comment.
+ */
+bool ASFormatter::isBeforeAnyLineEndComment(int startPos) const
+{
+ bool foundLineEndComment = false;
+ size_t peekNum = currentLine.find_first_not_of(" \t", startPos + 1);
+
+ if (peekNum != string::npos)
+ {
+ if (currentLine.compare(peekNum, 2, "//") == 0)
+ foundLineEndComment = true;
+ else if (currentLine.compare(peekNum, 2, "/*") == 0)
+ {
+ // comment must be closed on this line with nothing after it
+ size_t endNum = currentLine.find("*/", peekNum + 2);
+ if (endNum != string::npos)
+ {
+ size_t nextChar = currentLine.find_first_not_of(" \t", endNum + 2);
+ if (nextChar == string::npos)
+ foundLineEndComment = true;
+ }
+ }
+ }
+ return foundLineEndComment;
+}
+
+/**
+ * check if current placement is before a comment followed by a line-comment
+ *
+ * @return is before a multiple line-end comment.
+ */
+bool ASFormatter::isBeforeMultipleLineEndComments(int startPos) const
+{
+ bool foundMultipleLineEndComment = false;
+ size_t peekNum = currentLine.find_first_not_of(" \t", startPos + 1);
+
+ if (peekNum != string::npos)
+ {
+ if (currentLine.compare(peekNum, 2, "/*") == 0)
+ {
+ // comment must be closed on this line with nothing after it
+ size_t endNum = currentLine.find("*/", peekNum + 2);
+ if (endNum != string::npos)
+ {
+ size_t nextChar = currentLine.find_first_not_of(" \t", endNum + 2);
+ if (nextChar != string::npos
+ && currentLine.compare(nextChar, 2, "//") == 0)
+ foundMultipleLineEndComment = true;
+ }
+ }
+ }
+ return foundMultipleLineEndComment;
+}
+
+
+/**
+ * get the next character, increasing the current placement in the process.
+ * the new character is inserted into the variable currentChar.
+ *
+ * @return whether succeded to recieve the new character.
+ */
+bool ASFormatter::getNextChar()
+{
+ isInLineBreak = false;
+ previousChar = currentChar;
+
+ if (!isWhiteSpace(currentChar))
+ {
+ previousNonWSChar = currentChar;
+ if (!isInComment && !isInLineComment && !isInQuote
+ && !isImmediatelyPostComment
+ && !isImmediatelyPostLineComment
+ && !isInPreprocessor
+ && !isSequenceReached("/*")
+ && !isSequenceReached("//"))
+ previousCommandChar = currentChar;
+ }
+
+ if (charNum + 1 < (int) currentLine.length()
+ && (!isWhiteSpace(peekNextChar()) || isInComment || isInLineComment))
+ {
+ currentChar = currentLine[++charNum];
+
+ if (shouldConvertTabs && currentChar == '\t')
+ convertTabToSpaces();
+
+ return true;
+ }
+
+ // end of line has been reached
+ return getNextLine();
+}
+
+/**
+ * get the next line of input, increasing the current placement in the process.
+ *
+ * @param sequence the sequence to append.
+ * @return whether succeded in reading the next line.
+ */
+bool ASFormatter::getNextLine(bool emptyLineWasDeleted /*false*/)
+{
+ if (sourceIterator->hasMoreLines())
+ {
+ if (appendOpeningBracket)
+ currentLine = "{"; // append bracket that was removed from the previous line
+ else
+ currentLine = sourceIterator->nextLine(emptyLineWasDeleted);
+ // reset variables for new line
+ inLineNumber++;
+ isInCase = false;
+ isInAsmOneLine = false;
+ isInQuoteContinuation = isInVerbatimQuote | haveLineContinuationChar;
+ haveLineContinuationChar= false;
+ isImmediatelyPostEmptyLine = lineIsEmpty;
+ previousChar = ' ';
+
+ if (currentLine.length() == 0)
+ {
+ currentLine = string(" "); // a null is inserted if this is not done
+ }
+
+ // unless reading in the first line of the file, break a new line.
+ if (!isVirgin)
+ isInLineBreak = true;
+ else
+ isVirgin = false;
+
+ // check if is in preprocessor before line trimming
+ // a blank line after a \ will remove the flag
+ isImmediatelyPostPreprocessor = isInPreprocessor;
+ if (previousNonWSChar != '\\'
+ || isEmptyLine(currentLine))
+ isInPreprocessor = false;
+
+ if (passedSemicolon)
+ isInExecSQL = false;
+ initNewLine();
+ currentChar = currentLine[charNum];
+ if (isInHorstmannRunIn && previousNonWSChar == '{')
+ isInLineBreak = false;
+ isInHorstmannRunIn = false;
+
+ if (shouldConvertTabs && currentChar == '\t')
+ convertTabToSpaces();
+
+ // check for an empty line inside a command bracket.
+ // if yes then read the next line (calls getNextLine recursively).
+ // must be after initNewLine.
+ if (shouldDeleteEmptyLines
+ && lineIsEmpty
+ && isBracketType((*bracketTypeStack)[bracketTypeStack->size()-1], COMMAND_TYPE))
+ {
+ // but do NOT delete an empty line between comments if blocks are being broken
+ if (!(shouldBreakBlocks || shouldBreakClosingHeaderBlocks)
+ || !isImmediatelyPostCommentOnly
+ || !commentAndHeaderFollows())
+ {
+ isInPreprocessor = isImmediatelyPostPreprocessor; // restore
+ lineIsEmpty = false;
+ return getNextLine(true);
+ }
+ }
+
+ return true;
+ }
+ else
+ {
+ endOfCodeReached = true;
+ return false;
+ }
+}
+
+/**
+ * jump over the leading white space in the current line,
+ * IF the line does not begin a comment or is in a preprocessor definition.
+ */
+void ASFormatter::initNewLine()
+{
+ size_t len = currentLine.length();
+ size_t indent = getIndentLength();
+ charNum = 0;
+
+ if (isInPreprocessor || isInQuoteContinuation)
+ return;
+
+ // SQL continuation lines must be adjusted so the leading spaces
+ // is equivalent to the opening EXEC SQL
+ if (isInExecSQL)
+ {
+ // replace leading tabs with spaces
+ // so that continuation indent will be spaces
+ size_t tabCount = 0;
+ size_t i;
+ for (i = 0; i < currentLine.length(); i++)
+ {
+ if (!isWhiteSpace(currentLine[i])) // stop at first text
+ break;
+ if (currentLine[i] == '\t')
+ {
+ size_t numSpaces = indent - ((tabCount + i) % indent);
+ currentLine.replace(i, 1, numSpaces, ' ');
+ tabCount++;
+ i += indent - 1;
+ }
+ }
+ // correct the format if EXEC SQL is not a hanging indent
+ if (i < leadingSpaces)
+ currentLine.insert((size_t)0, leadingSpaces - i, ' ');
+ trimContinuationLine();
+ return;
+ }
+
+ // comment continuation lines must be adjusted so the leading spaces
+ // is equivalent to the opening comment
+ if (isInComment)
+ {
+ if (noTrimCommentContinuation)
+ leadingSpaces = tabIncrementIn = 0;
+ trimContinuationLine();
+ return;
+ }
+
+ // compute leading spaces
+ isImmediatelyPostCommentOnly = lineIsLineCommentOnly || lineEndsInCommentOnly;
+ lineIsLineCommentOnly = false;
+ lineEndsInCommentOnly = false;
+ doesLineStartComment = false;
+ currentLineBeginsWithBracket = false;
+ lineIsEmpty = false;
+ currentLineFirstBracketNum = string::npos;
+ tabIncrementIn = 0;
+
+ for (charNum = 0; isWhiteSpace(currentLine[charNum]) && charNum + 1 < (int) len; charNum++)
+ {
+ if (currentLine[charNum] == '\t')
+ tabIncrementIn += indent - 1 - ((tabIncrementIn + charNum) % indent);
+ }
+ leadingSpaces = charNum + tabIncrementIn;
+
+ if (isSequenceReached("/*"))
+ {
+ doesLineStartComment = true;
+ }
+ else if (isSequenceReached("//"))
+ {
+ lineIsLineCommentOnly = true;
+ }
+ else if (isSequenceReached("{"))
+ {
+ currentLineBeginsWithBracket = true;
+ currentLineFirstBracketNum = charNum;
+ size_t firstText = currentLine.find_first_not_of(" \t", charNum + 1);
+ if (firstText != string::npos)
+ {
+ if (currentLine.compare(firstText, 2, "//") == 0)
+ lineIsLineCommentOnly = true;
+ else if (currentLine.compare(firstText, 2, "/*") == 0
+ || isExecSQL(currentLine, firstText))
+ {
+ // get the extra adjustment
+ size_t j;
+ for (j = charNum + 1; isWhiteSpace(currentLine[j]) && j < firstText; j++)
+ {
+ if (currentLine[j] == '\t')
+ tabIncrementIn += indent - 1 - ((tabIncrementIn + j) % indent);
+ }
+ leadingSpaces = j + tabIncrementIn;
+ if (currentLine.compare(firstText, 2, "/*") == 0)
+ doesLineStartComment = true;
+ }
+ }
+ }
+ else if (isWhiteSpace(currentLine[charNum]) && !(charNum + 1 < (int) currentLine.length()))
+ {
+ lineIsEmpty = true;
+ }
+}
+
+/**
+ * append a string sequence to the current formatted line.
+ * Unless disabled (via canBreakLine == false), first check if a
+ * line-break has been registered, and if so break the
+ * formatted line, and only then append the sequence into
+ * the next formatted line.
+ *
+ * @param sequence the sequence to append.
+ * @param canBreakLine if true, a registered line-break
+ */
+void ASFormatter::appendSequence(const string &sequence, bool canBreakLine)
+{
+ if (canBreakLine && isInLineBreak)
+ breakLine();
+ formattedLine.append(sequence);
+}
+
+/**
+ * append a space to the current formattedline, UNLESS the
+ * last character is already a white-space character.
+ */
+void ASFormatter::appendSpacePad()
+{
+ int len = formattedLine.length();
+ if (len > 0 && !isWhiteSpace(formattedLine[len-1]))
+ {
+ formattedLine.append(1, ' ');
+ spacePadNum++;
+ }
+}
+
+/**
+ * append a space to the current formattedline, UNLESS the
+ * next character is already a white-space character.
+ */
+void ASFormatter::appendSpaceAfter()
+{
+ int len = currentLine.length();
+ if (charNum + 1 < len && !isWhiteSpace(currentLine[charNum+1]))
+ {
+ formattedLine.append(1, ' ');
+ spacePadNum++;
+ }
+}
+
+/**
+ * register a line break for the formatted line.
+ */
+void ASFormatter::breakLine()
+{
+ isLineReady = true;
+ isInLineBreak = false;
+ spacePadNum = nextLineSpacePadNum;
+ nextLineSpacePadNum = 0;
+ formattedLineCommentNum = string::npos;
+
+ // queue an empty line prepend request if one exists
+ prependEmptyLine = isPrependPostBlockEmptyLineRequested;
+
+ readyFormattedLine = formattedLine;
+ if (isAppendPostBlockEmptyLineRequested)
+ {
+ isAppendPostBlockEmptyLineRequested = false;
+ isPrependPostBlockEmptyLineRequested = true;
+ }
+ else
+ {
+ isPrependPostBlockEmptyLineRequested = false;
+ }
+
+ formattedLine = "";
+}
+
+/**
+ * check if the currently reached open-bracket (i.e. '{')
+ * opens a:
+ * - a definition type block (such as a class or namespace),
+ * - a command block (such as a method block)
+ * - a static array
+ * this method takes for granted that the current character
+ * is an opening bracket.
+ *
+ * @return the type of the opened block.
+ */
+BracketType ASFormatter::getBracketType()
+{
+ assert(currentChar == '{');
+
+ BracketType returnVal;
+
+ if ((previousNonWSChar == '='
+ || isBracketType(bracketTypeStack->back(), ARRAY_TYPE))
+ && previousCommandChar != ')')
+ returnVal = ARRAY_TYPE;
+ else if (foundPreDefinitionHeader)
+ {
+ returnVal = DEFINITION_TYPE;
+ if (foundNamespaceHeader)
+ returnVal = (BracketType)(returnVal | NAMESPACE_TYPE);
+ else if (foundClassHeader)
+ returnVal = (BracketType)(returnVal | CLASS_TYPE);
+ else if (foundStructHeader)
+ returnVal = (BracketType)(returnVal | STRUCT_TYPE);
+ else if (foundInterfaceHeader)
+ returnVal = (BracketType)(returnVal | INTERFACE_TYPE);
+ }
+ else
+ {
+ bool isCommandType = (foundPreCommandHeader
+ || (currentHeader != NULL && isNonParenHeader)
+ || (previousCommandChar == ')')
+ || (previousCommandChar == ':' && !foundQuestionMark)
+ || (previousCommandChar == ';')
+ || ((previousCommandChar == '{' || previousCommandChar == '}')
+ && isPreviousBracketBlockRelated)
+ || isJavaStaticConstructor
+ || isSharpDelegate);
+
+ // C# methods containing 'get', 'set', 'add', and 'remove' do NOT end with parens
+ if (!isCommandType && isSharpStyle() && isNextWordSharpNonParenHeader(charNum + 1))
+ {
+ isCommandType = true;
+ isSharpAccessor = true;
+ }
+
+ if (!isCommandType && isInExtern)
+ returnVal = EXTERN_TYPE;
+ else
+ returnVal = (isCommandType ? COMMAND_TYPE : ARRAY_TYPE);
+ }
+
+ if (isOneLineBlockReached(currentLine, charNum))
+ returnVal = (BracketType)(returnVal | SINGLE_LINE_TYPE);
+
+ if (isBracketType(returnVal, ARRAY_TYPE) && isNonInStatementArrayBracket())
+ {
+ returnVal = (BracketType)(returnVal | ARRAY_NIS_TYPE);
+ isNonInStatementArray = true;
+ nonInStatementBracket = formattedLine.length() - 1;
+ }
+
+ return returnVal;
+}
+
+/**
+ * check if a line is empty
+ *
+ * @return whether line is empty
+ */
+bool ASFormatter::isEmptyLine(const string &line) const
+{
+ return line.find_first_not_of(" \t") == string::npos;
+}
+
+/**
+ * Check if the currently reached '*' or '&' character is
+ * a pointer-or-reference symbol, or another operator.
+ * A pointer dereference (*) or an "address of" character (&)
+ * counts as a pointer or reference because it is not an
+ * arithmetic operator.
+ *
+ * @return whether current character is a reference-or-pointer
+ */
+bool ASFormatter::isPointerOrReference() const
+{
+ assert(currentChar == '*' || currentChar == '&');
+
+ if (!isCStyle())
+ return false;
+
+ if (currentChar == '&' && previousChar == '&')
+ return false;
+
+ if (previousNonWSChar == '=' || isCharImmediatelyPostReturn)
+ return true;
+
+ if (currentHeader == &AS_CATCH)
+ return true;
+
+ // get the last legal word (may be a number)
+ string lastWord = getPreviousWord(currentLine, charNum);
+ if (lastWord.empty())
+ lastWord[0] = ' ';
+ char nextChar = peekNextChar();
+
+ // check for preceding or following numeric values
+ if (isdigit(lastWord[0])
+ || isdigit(nextChar))
+ return false;
+
+ // checks on other chars
+ if (isLegalNameChar(lastWord[0])
+ && isLegalNameChar(nextChar)
+ && parenStack->back() > 0)
+ {
+ // if followed by an assignment it is a pointer or reference
+ size_t nextNum = currentLine.find_first_of("=;)", charNum + 1);
+ if (nextNum != string::npos && currentLine[nextNum] == '=')
+ return true;
+
+ // if a function definition it is a pointer or reference
+ // otherwise it is an arithmetic operator
+ if (!isBracketType(bracketTypeStack->back(), COMMAND_TYPE))
+ return true;
+ else
+ return false;
+ }
+
+ if (nextChar == '-'
+ || nextChar == '+')
+ {
+ size_t nextNum = currentLine.find_first_not_of(" \t", charNum + 1);
+ if (nextNum != string::npos)
+ {
+ if (currentLine.compare(nextNum, 2, "++") != 0
+ && currentLine.compare(nextNum, 2, "--") != 0)
+ return false;
+ }
+ }
+
+ bool isPR = (!isInPotentialCalculation
+ || isBracketType(bracketTypeStack->back(), DEFINITION_TYPE)
+ || (!isLegalNameChar(previousNonWSChar)
+ && !(previousNonWSChar == ')' && nextChar == '(')
+ && !(previousNonWSChar == ')' && currentChar == '*')
+ && previousNonWSChar != ']')
+ );
+
+ if (!isPR)
+ {
+ isPR |= (!isWhiteSpace(nextChar)
+ && nextChar != '-'
+ && nextChar != '('
+ && nextChar != '['
+ && !isLegalNameChar(nextChar));
+ }
+
+ return isPR;
+}
+
+/**
+ * Check if the currently reached '*' or '&' character is
+ * a dereferenced pointer or "address of" symbol.
+ * NOTE: this MUST be a pointer or reference as determined by
+ * the function isPointerOrReference().
+ *
+ * @return whether current character is a dereference or address of
+ */
+bool ASFormatter::isDereferenceOrAddressOf() const
+{
+ assert(isPointerOrReference());
+
+ if (previousNonWSChar == '='
+ || previousNonWSChar == ','
+ || previousNonWSChar == '.'
+ || previousNonWSChar == '>'
+ || previousNonWSChar == '<'
+ || isCharImmediatelyPostReturn)
+ return true;
+
+ // check for **
+ if (currentChar == '*'
+ && (int) currentLine.length() > charNum
+ && currentLine[charNum+1] == '*')
+ {
+ if (previousNonWSChar == '(')
+ return true;
+ if ((int) currentLine.length() < charNum + 2)
+ return true;
+ return false;
+ }
+
+ // check first char on the line
+ if (charNum == (int) currentLine.find_first_not_of(" \t"))
+ return true;
+
+ size_t nextChar = currentLine.find_first_not_of(" \t", charNum+1);
+ if (nextChar != string::npos
+ && (currentLine[nextChar] == ')'
+ || currentLine[nextChar] == '>'
+ || currentLine[nextChar] == ','))
+ return false;
+
+ string lastWord = getPreviousWord(currentLine, charNum);
+ if (lastWord == "else" || lastWord == "delete")
+ return true;
+
+ bool isDA = (!(isLegalNameChar(previousNonWSChar) || previousNonWSChar == '>')
+ || !isLegalNameChar(peekNextChar())
+ || (ispunct(previousNonWSChar) && previousNonWSChar != '.')
+ || isCharImmediatelyPostReturn);
+
+ return isDA;
+}
+
+/**
+ * Check if the currently reached '*' or '&' character is
+ * centered with one space on each side.
+ * Only spaces are checked, not tabs.
+ * If true then a space wil be deleted on the output.
+ *
+ * @return whether current character is centered.
+ */
+bool ASFormatter::isPointerOrReferenceCentered() const
+{
+ assert(currentLine[charNum] == '*' || currentLine[charNum] == '&');
+
+ int prNum = charNum;
+ int lineLength = (int) currentLine.length();
+ // check space before
+ if (prNum < 1
+ || currentLine[prNum-1] != ' ')
+ return false;
+
+ // check no space before that
+ if (prNum < 2
+ || currentLine[prNum-2] == ' ')
+ return false;
+
+ // check for **
+ if (prNum + 1 < lineLength
+ && currentLine[prNum+1] == '*')
+ prNum++;
+
+ // check space after
+ if (prNum + 1 < lineLength
+ && currentLine[prNum+1] != ' ')
+ return false;
+
+ // check no space after that
+ if (prNum + 2 < lineLength
+ && currentLine[prNum+2] == ' ')
+ return false;
+
+ return true;
+}
+
+/**
+ * check if the currently reached '+' or '-' character is a unary operator
+ * this method takes for granted that the current character
+ * is a '+' or '-'.
+ *
+ * @return whether the current '+' or '-' is a unary operator.
+ */
+bool ASFormatter::isUnaryOperator() const
+{
+ assert(currentChar == '+' || currentChar == '-');
+
+ return ((isCharImmediatelyPostReturn || !isLegalNameChar(previousCommandChar))
+ && previousCommandChar != '.'
+ && previousCommandChar != '\"'
+ && previousCommandChar != '\''
+ && previousCommandChar != ')'
+ && previousCommandChar != ']');
+}
+
+
+/**
+ * check if the currently reached '+' or '-' character is
+ * part of an exponent, i.e. 0.2E-5.
+ *
+ * this method takes for granted that the current character
+ * is a '+' or '-'.
+ *
+ * @return whether the current '+' or '-' is in an exponent.
+ */
+bool ASFormatter::isInExponent() const
+{
+ assert(currentChar == '+' || currentChar == '-');
+
+ int formattedLineLength = formattedLine.length();
+ if (formattedLineLength >= 2)
+ {
+ char prevPrevFormattedChar = formattedLine[formattedLineLength - 2];
+ char prevFormattedChar = formattedLine[formattedLineLength - 1];
+
+ return ((prevFormattedChar == 'e' || prevFormattedChar == 'E')
+ && (prevPrevFormattedChar == '.' || isdigit(prevPrevFormattedChar)));
+ }
+ else
+ return false;
+}
+
+/**
+ * check if an array bracket should NOT have an in-statement indent
+ *
+ * @return the array is non in-statement
+ */
+bool ASFormatter::isNonInStatementArrayBracket() const
+{
+ bool returnVal = false;
+ char nextChar = peekNextChar();
+ // if this opening bracket begins the line there will be no inStatement indent
+ if (currentLineBeginsWithBracket
+ && charNum == (int) currentLineFirstBracketNum
+ && nextChar != '}')
+ returnVal = true;
+ // if an opening bracket ends the line there will be no inStatement indent
+ if (isWhiteSpace(nextChar)
+ || isBeforeAnyLineEndComment(charNum)
+ || nextChar == '{')
+ returnVal = true;
+
+ // Java "new Type [] {...}" IS an inStatement indent
+ if (isJavaStyle() && previousNonWSChar == ']')
+ returnVal = false;
+
+ // trace
+ //if (isNonInStatementArray)
+ // cout << traceLineNumber << " " << 'x' << endl;
+ //else
+ // cout << traceLineNumber << " " << ' ' << endl
+
+ return returnVal;
+}
+
+/**
+ * check if a one-line bracket has been reached,
+ * i.e. if the currently reached '{' character is closed
+ * with a complimentry '}' elsewhere on the current line,
+ *.
+ * @return has a one-line bracket been reached?
+ */
+bool ASFormatter::isOneLineBlockReached(string& line, int startChar) const
+{
+ assert(line[startChar] == '{');
+
+ bool isInComment = false;
+ bool isInQuote = false;
+ int bracketCount = 1;
+ int lineLength = line.length();
+ char quoteChar = ' ';
+
+ for (int i = startChar + 1; i < lineLength; ++i)
+ {
+ char ch = line[i];
+
+ if (isInComment)
+ {
+ if (line.compare(i, 2, "*/") == 0)
+ {
+ isInComment = false;
+ ++i;
+ }
+ continue;
+ }
+
+ if (ch == '\\')
+ {
+ ++i;
+ continue;
+ }
+
+ if (isInQuote)
+ {
+ if (ch == quoteChar)
+ isInQuote = false;
+ continue;
+ }
+
+ if (ch == '"' || ch == '\'')
+ {
+ isInQuote = true;
+ quoteChar = ch;
+ continue;
+ }
+
+ if (line.compare(i, 2, "//") == 0)
+ break;
+
+ if (line.compare(i, 2, "/*") == 0)
+ {
+ isInComment = true;
+ ++i;
+ continue;
+ }
+
+ if (ch == '{')
+ ++bracketCount;
+ else if (ch == '}')
+ --bracketCount;
+
+ if (bracketCount == 0)
+ return true;
+ }
+
+ return false;
+}
+
+/**
+ * peek at the next word to determine if it is a C# non-paren header.
+ * will look ahead in the input file if necessary.
+ *
+ * @param char position on currentLine to start the search
+ * @return true if the next word is get or set.
+ */
+bool ASFormatter::isNextWordSharpNonParenHeader(int startChar) const
+{
+ // look ahead to find the next non-comment text
+ string nextText = peekNextText(currentLine.substr(startChar));
+ if (nextText.length() == 0)
+ return false;
+ if (nextText[0] == '[')
+ return true;
+ if (!isCharPotentialHeader(nextText, 0))
+ return false;
+ if (findKeyword(nextText, 0, AS_GET) || findKeyword(nextText, 0, AS_SET)
+ || findKeyword(nextText, 0, AS_ADD) || findKeyword(nextText, 0, AS_REMOVE))
+ return true;
+ return false;
+}
+
+/**
+ * peek at the next char to determine if it is an opening bracket.
+ * will look ahead in the input file if necessary.
+ * this determines a java static constructor.
+ *
+ * @param char position on currentLine to start the search
+ * @return true if the next word is an opening bracket.
+ */
+bool ASFormatter::isNextCharOpeningBracket(int startChar) const
+{
+ bool retVal = false;
+ string nextText = peekNextText(currentLine.substr(startChar));
+ if (nextText.compare(0, 1, "{") == 0)
+ retVal = true;
+ return retVal;
+}
+
+/**
+ * get the next non-whitespace substring on following lines, bypassing all comments.
+ *
+ * @param the first line to check
+ * @return the next non-whitespace substring.
+ */
+string ASFormatter::peekNextText(const string& firstLine, bool endOnEmptyLine /*false*/) const
+{
+ bool isFirstLine = true;
+ bool needReset = false;
+ string nextLine = firstLine;
+ size_t firstChar= string::npos;
+
+ // find the first non-blank text, bypassing all comments.
+ bool isInComment = false;
+ while (sourceIterator->hasMoreLines())
+ {
+ if (isFirstLine)
+ isFirstLine = false;
+ else
+ {
+ nextLine = sourceIterator->peekNextLine();
+ needReset = true;
+ }
+
+ firstChar = nextLine.find_first_not_of(" \t");
+ if (firstChar == string::npos)
+ {
+ if (endOnEmptyLine && !isInComment)
+ break;
+ continue;
+ }
+
+ if (nextLine.compare(firstChar, 2, "/*") == 0)
+ isInComment = true;
+
+ if (isInComment)
+ {
+ firstChar = nextLine.find("*/", firstChar);
+ if (firstChar == string::npos)
+ continue;
+ firstChar += 2;
+ isInComment = false;
+ firstChar = nextLine.find_first_not_of(" \t", firstChar);
+ if (firstChar == string::npos)
+ continue;
+ }
+
+ if (nextLine.compare(firstChar, 2, "//") == 0)
+ continue;
+
+ // found the next text
+ break;
+ }
+
+ if (needReset)
+ sourceIterator->peekReset();
+ if (firstChar == string::npos)
+ nextLine = "";
+ else
+ nextLine = nextLine.substr(firstChar);
+ return nextLine;
+}
+
+/**
+ * adjust comment position because of adding or deleting spaces
+ * the spaces are added or deleted to formattedLine
+ * spacePadNum contains the adjustment
+ */
+void ASFormatter::adjustComments(void)
+{
+ assert(spacePadNum != 0);
+ assert(currentLine.compare(charNum, 2, "//") == 0
+ || currentLine.compare(charNum, 2, "/*") == 0);
+
+
+ // block comment must be closed on this line with nothing after it
+ if (currentLine.compare(charNum, 2, "/*") == 0)
+ {
+ size_t endNum = currentLine.find("*/", charNum + 2);
+ if (endNum == string::npos)
+ return;
+ if (currentLine.find_first_not_of(" \t", endNum + 2) != string::npos)
+ return;
+ }
+
+ size_t len = formattedLine.length();
+ // don't adjust a tab
+ if (formattedLine[len-1] == '\t')
+ return;
+ // if spaces were removed, need to add spaces before the comment
+ if (spacePadNum < 0)
+ {
+ int adjust = -spacePadNum; // make the number positive
+ formattedLine.append(adjust, ' ');
+ }
+ // if spaces were added, need to delete extra spaces before the comment
+ // if cannot be done put the comment one space after the last text
+ else if (spacePadNum > 0)
+ {
+ int adjust = spacePadNum;
+ size_t lastText = formattedLine.find_last_not_of(' ');
+ if (lastText != string::npos
+ && lastText < len - adjust - 1)
+ formattedLine.resize(len - adjust);
+ else if (len > lastText + 2)
+ formattedLine.resize(lastText + 2);
+ else if (len < lastText + 2)
+ formattedLine.append(len - lastText, ' ');
+ }
+}
+
+/**
+ * append the current bracket inside the end of line comments
+ * currentChar contains the bracket, it will be appended to formattedLine
+ * formattedLineCommentNum is the comment location on formattedLine
+ * returns true f appended, false if not
+ */
+void ASFormatter::appendCharInsideComments(void)
+{
+ if (formattedLineCommentNum == string::npos) // does the comment start on the previous line?
+ {
+ appendCurrentChar(); // don't attach
+ return; // false;
+ }
+ assert(formattedLine.compare(formattedLineCommentNum, 2, "//") == 0
+ || formattedLine.compare(formattedLineCommentNum, 2, "/*") == 0);
+
+ // find the previous non space char
+ size_t end = formattedLineCommentNum;
+ size_t beg = formattedLine.find_last_not_of(" \t", end-1);
+ if (beg == string::npos) // is the previous line comment only?
+ {
+ appendCurrentChar(); // don't attach
+ return; // false;
+ }
+ beg++;
+
+ // insert the bracket
+ if (end - beg < 3) // is there room to insert?
+ formattedLine.insert(beg, 3-end+beg, ' ');
+ if (formattedLine[beg] == '\t') // don't pad with a tab
+ formattedLine.insert(beg, 1, ' ');
+ formattedLine[beg+1] = currentChar;
+
+ if (isBeforeComment())
+ breakLine();
+ else if (isCharImmediatelyPostLineComment)
+ shouldBreakLineAtNextChar = true;
+ return; // true;
+}
+
+/**
+ * add or remove space padding to operators
+ * currentChar contains the paren
+ * the operators and necessary padding will be appended to formattedLine
+ * the calling function should have a continue statement after calling this method
+ *
+ * @param *newOperator the operator to be padded
+ */
+void ASFormatter::padOperators(const string *newOperator)
+{
+ assert(newOperator != NULL);
+
+ bool shouldPad = (newOperator != &AS_COLON_COLON
+ && newOperator != &AS_PAREN_PAREN
+ && newOperator != &AS_BLPAREN_BLPAREN
+ && newOperator != &AS_PLUS_PLUS
+ && newOperator != &AS_MINUS_MINUS
+ && newOperator != &AS_NOT
+ && newOperator != &AS_BIT_NOT
+ && newOperator != &AS_ARROW
+ && !(newOperator == &AS_MINUS && isInExponent())
+ && !((newOperator == &AS_PLUS || newOperator == &AS_MINUS) // check for unary plus or minus
+ && (previousNonWSChar == '('
+ || previousNonWSChar == '='
+ || previousNonWSChar == ','))
+ && !(newOperator == &AS_PLUS && isInExponent())
+ && !isCharImmediatelyPostOperator
+ && !((newOperator == &AS_MULT || newOperator == &AS_BIT_AND)
+ && isPointerOrReference())
+ && !(newOperator == &AS_MULT
+ && (previousNonWSChar == '.'
+ || previousNonWSChar == '>')) // check for ->
+ && !((isInTemplate || isCharImmediatelyPostTemplate)
+ && (newOperator == &AS_LS || newOperator == &AS_GR))
+ && !(newOperator == &AS_GCC_MIN_ASSIGN
+ && ASBase::peekNextChar(currentLine, charNum+1) == '>')
+ && !(newOperator == &AS_GR && previousNonWSChar == '?')
+ && !isInCase
+ && !isInAsm
+ && !isInAsmOneLine
+ && !isInAsmBlock
+ );
+
+ // pad before operator
+ if (shouldPad
+ && !isInBlParen
+ && !(newOperator == &AS_COLON && !foundQuestionMark)
+ && !(newOperator == &AS_QUESTION && isSharpStyle() // check for C# nullable type (e.g. int?)
+ && currentLine.find(':', charNum+1) == string::npos)
+ )
+ appendSpacePad();
+ appendSequence(*newOperator);
+ goForward(newOperator->length() - 1);
+
+ // since this block handles '()' and '[]',
+ // the parenStack must be updated here accordingly!
+ if (newOperator == &AS_PAREN_PAREN
+ || newOperator == &AS_BLPAREN_BLPAREN)
+ parenStack->back()--;
+
+ currentChar = (*newOperator)[newOperator->length() - 1];
+ // pad after operator
+ // but do not pad after a '-' that is a unary-minus.
+ if (shouldPad
+ && !isInBlParen
+ && !isBeforeAnyComment()
+ && !(newOperator == &AS_PLUS && isUnaryOperator())
+ && !(newOperator == &AS_MINUS && isUnaryOperator())
+ && !(currentLine.compare(charNum + 1, 1, ";") == 0)
+ && !(currentLine.compare(charNum + 1, 2, "::") == 0)
+ && !(newOperator == &AS_QUESTION && isSharpStyle() // check for C# nullable type (e.g. int?)
+ && currentLine[charNum+1] == '[')
+ )
+ appendSpaceAfter();
+
+ previousOperator = newOperator;
+ return;
+}
+
+/**
+ * format pointer or reference
+ * currentChar contains the pointer or reference
+ * the symbol and necessary padding will be appended to formattedLine
+ * the calling function should have a continue statement after calling this method
+ */
+void ASFormatter::formatPointerOrReference(void)
+{
+ assert(currentChar == '*' || currentChar == '&');
+ assert(isCStyle());
+
+ // check for cast
+ char peekedChar = peekNextChar();
+ if (currentChar == '*'
+ && (int) currentLine.length() > charNum
+ && currentLine[charNum+1] == '*')
+ {
+ size_t nextChar = currentLine.find_first_not_of(" \t", charNum+2);
+ if (nextChar == string::npos)
+ peekedChar = ' ';
+ else
+ peekedChar = currentLine[nextChar];
+ }
+ if (peekedChar == ')' || peekedChar =='>' || peekedChar ==',')
+ {
+ formatPointerOrReferenceCast();
+ return;
+ }
+
+ // do this before bumping charNum
+ bool isOldPRCentered = isPointerOrReferenceCentered();
+
+ if (pointerAlignment == ALIGN_TYPE)
+ {
+ size_t prevCh = formattedLine.find_last_not_of(" \t");
+ if (prevCh == string::npos)
+ prevCh = 0;
+ if (formattedLine.length() == 0 || prevCh == formattedLine.length() - 1)
+ appendCurrentChar();
+ else
+ {
+ // exchange * or & with character following the type
+ // this may not work every time with a tab character
+ string charSave = formattedLine.substr(prevCh+1, 1);
+ formattedLine[prevCh+1] = currentChar;
+ formattedLine.append(charSave);
+ }
+ if (isSequenceReached("**"))
+ {
+ formattedLine.insert(prevCh+2, "*");
+ goForward(1);
+ }
+ // if no space after * then add one
+ if (charNum < (int) currentLine.length() - 1
+ && !isWhiteSpace(currentLine[charNum+1])
+ && currentLine[charNum+1] != ')')
+ appendSpacePad();
+ // if old pointer or reference is centered, remove a space
+ if (isOldPRCentered
+ && isWhiteSpace(formattedLine[formattedLine.length()-1]))
+ {
+ formattedLine.erase(formattedLine.length()-1, 1);
+ spacePadNum--;
+ }
+ }
+ else if (pointerAlignment == ALIGN_MIDDLE)
+ {
+ // compute current whitespace before
+ size_t wsBefore = currentLine.find_last_not_of(" \t", charNum - 1);
+ if (wsBefore == string::npos)
+ wsBefore = 0;
+ else
+ wsBefore = charNum - wsBefore - 1;
+ // adjust for **
+ string sequenceToInsert = currentChar == '*' ? "*" : "&";
+ if (isSequenceReached("**"))
+ {
+ sequenceToInsert = "**";
+ goForward(1);
+ }
+ size_t charNumSave = charNum;
+ // goForward() to convert tabs to spaces, if necessary,
+ // and move following characters to preceding characters
+ // this may not work every time with tab characters
+ for (size_t i = charNum+1; i < currentLine.length() && isWhiteSpace(currentLine[i]); i++)
+ {
+ goForward(1);
+ formattedLine.append(1, currentLine[i]);
+ }
+ // whitespace should be at least 2 chars
+ size_t wsAfter = currentLine.find_first_not_of(" \t", charNumSave + 1);
+ if (wsAfter == string::npos)
+ wsAfter = 0;
+ else
+ wsAfter = wsAfter - charNumSave - 1;
+ if (wsBefore + wsAfter < 2)
+ {
+ size_t charsToAppend = (2 - (wsBefore + wsAfter));
+ formattedLine.append(charsToAppend, ' ');
+ spacePadNum += charsToAppend;
+ if (wsBefore == 0) wsBefore++;
+ if (wsAfter == 0) wsAfter++;
+ }
+ // insert the pointer or reference char
+ size_t padAfter = (wsBefore + wsAfter) / 2;
+ formattedLine.insert(formattedLine.length() - padAfter, sequenceToInsert);
+ }
+ else if (pointerAlignment == ALIGN_NAME)
+ {
+ size_t startNum = formattedLine.find_last_not_of(" \t");
+ string sequenceToInsert = currentChar == '*' ? "*" : "&";
+ if (isSequenceReached("**"))
+ {
+ sequenceToInsert = "**";
+ goForward(1);
+ }
+ // goForward() to convert tabs to spaces, if necessary,
+ // and move following characters to preceding characters
+ // this may not work every time with tab characters
+ for (size_t i = charNum+1; i < currentLine.length() && isWhiteSpace(currentLine[i]); i++)
+ {
+ goForward(1);
+ formattedLine.append(1, currentLine[i]);
+ }
+ appendSequence(sequenceToInsert, false);
+ // if no space before * then add one
+ if (startNum != string::npos
+ && !isWhiteSpace(formattedLine[startNum+1]))
+ {
+ formattedLine.insert(startNum+1 , 1, ' ');
+ spacePadNum++;
+ }
+ // if old pointer or reference is centered, remove a space
+ if (isOldPRCentered
+ && formattedLine.length() > startNum+1
+ && isWhiteSpace(formattedLine[startNum+1]))
+ {
+ formattedLine.erase(startNum+1, 1);
+ spacePadNum--;
+ }
+ }
+ else // pointerAlignment == ALIGN_NONE
+ {
+ appendCurrentChar();
+ }
+ return;
+}
+
+/**
+ * format pointer or reference cast
+ * currentChar contains the pointer or reference
+ * NOTE: the pointers and references in function definitions
+ * are processed as a cast (e.g. void foo(void*, void*))
+ * is processed here.
+ */
+void ASFormatter::formatPointerOrReferenceCast(void)
+{
+ assert(currentChar == '*' || currentChar == '&');
+ assert(isCStyle());
+
+ string sequenceToInsert = currentChar == '*' ? "*" : "&";
+ if (isSequenceReached("**"))
+ {
+ sequenceToInsert = "**";
+ goForward(1);
+ }
+ if (pointerAlignment == ALIGN_NONE)
+ {
+ appendSequence(sequenceToInsert, false);
+ return;
+ }
+ // remove trailing whitespace
+ size_t prevCh = formattedLine.find_last_not_of(" \t");
+ if (prevCh == string::npos)
+ prevCh = 0;
+ if (formattedLine.length() > 0 && isWhiteSpace(formattedLine[prevCh+1]))
+ {
+ spacePadNum -= (formattedLine.length() - 1 - prevCh);
+ formattedLine.erase(prevCh+1);
+ }
+ if (pointerAlignment == ALIGN_TYPE)
+ {
+ appendSequence(sequenceToInsert, false);
+ }
+ else if (pointerAlignment == ALIGN_MIDDLE
+ || pointerAlignment == ALIGN_NAME)
+ {
+ appendSpacePad();
+ appendSequence(sequenceToInsert, false);
+ }
+ else
+ appendSequence(sequenceToInsert, false);
+}
+
+/**
+ * add or remove space padding to parens
+ * currentChar contains the paren
+ * the parens and necessary padding will be appended to formattedLine
+ * the calling function should have a continue statement after calling this method
+ */
+void ASFormatter::padParens(void)
+{
+ assert(currentChar == '(' || currentChar == ')');
+
+ int spacesOutsideToDelete = 0;
+ int spacesInsideToDelete = 0;
+
+ if (currentChar == '(')
+ {
+ spacesOutsideToDelete = formattedLine.length() - 1;
+ spacesInsideToDelete = 0;
+
+ // compute spaces outside the opening paren to delete
+ if (shouldUnPadParens)
+ {
+ char lastChar = ' ';
+ bool prevIsParenHeader = false;
+ size_t i = formattedLine.find_last_not_of(" \t");
+ if (i != string::npos)
+ {
+ // if last char is a bracket the previous whitespace is an indent
+ if (formattedLine[i] == '{')
+ spacesOutsideToDelete = 0;
+ else
+ {
+ spacesOutsideToDelete -= i;
+ lastChar = formattedLine[i];
+ // if previous word is a header, it will be a paren header
+ string prevWord = getPreviousWord(formattedLine, formattedLine.length());
+ const string* prevWordH = NULL;
+ if (shouldPadHeader
+ && prevWord.length() > 0
+ && isCharPotentialHeader(prevWord, 0))
+ prevWordH = ASBeautifier::findHeader(prevWord, 0, headers);
+ if (prevWordH != NULL)
+ {
+ prevIsParenHeader = true;
+ // trace
+ //cout << traceLineNumber << " " << *prevWordH << endl;
+ }
+ else if (prevWord == "return" // don't unpad return statements
+ || prevWord == "*") // don't unpad multiply or pointer
+ {
+ prevIsParenHeader = true;
+ // trace
+ //cout << traceLineNumber << " " << prevWord << endl;
+ }
+ // don't unpad variables
+ else if (prevWord == "bool"
+ || prevWord == "int"
+ || prevWord == "void"
+ || prevWord == "void*"
+ || (prevWord.length() >= 6 // check end of word for _t
+ && prevWord.compare(prevWord.length()-2, 2, "_t") == 0)
+ || prevWord == "BOOL"
+ || prevWord == "DWORD"
+ || prevWord == "HWND"
+ || prevWord == "INT"
+ || prevWord == "LPSTR"
+ || prevWord == "VOID"
+ || prevWord == "LPVOID"
+ )
+ {
+ prevIsParenHeader = true;
+ // trace
+ //cout << traceLineNumber << " " << prevWord << endl;
+ }
+ }
+ }
+ // do not unpad operators, but leave them if already padded
+ if (shouldPadParensOutside || prevIsParenHeader)
+ spacesOutsideToDelete--;
+ else if (lastChar == '|' // check for ||
+ || lastChar == '&' // check for &&
+ || lastChar == ','
+ || (lastChar == '>' && !foundCastOperator)
+ || lastChar == '<'
+ || lastChar == '?'
+ || lastChar == ':'
+ || lastChar == ';'
+ || lastChar == '='
+ || lastChar == '+'
+ || lastChar == '-'
+ || (lastChar == '*' && isInPotentialCalculation)
+ || lastChar == '/'
+ || lastChar == '%')
+ spacesOutsideToDelete--;
+
+ if (spacesOutsideToDelete > 0)
+ {
+ formattedLine.erase(i + 1, spacesOutsideToDelete);
+ spacePadNum -= spacesOutsideToDelete;
+ }
+ }
+
+ // pad open paren outside
+ char peekedCharOutside = peekNextChar();
+ if (shouldPadParensOutside)
+ if (!(currentChar == '(' && peekedCharOutside == ')'))
+ appendSpacePad();
+
+ appendCurrentChar();
+
+ // unpad open paren inside
+ if (shouldUnPadParens)
+ {
+ size_t j = currentLine.find_first_not_of(" \t", charNum + 1);
+ if (j != string::npos)
+ spacesInsideToDelete = j - charNum - 1;
+ if (shouldPadParensInside)
+ spacesInsideToDelete--;
+ if (spacesInsideToDelete > 0)
+ {
+ currentLine.erase(charNum + 1, spacesInsideToDelete);
+ spacePadNum -= spacesInsideToDelete;
+ }
+ // convert tab to space if requested
+ if (shouldConvertTabs
+ && (int)currentLine.length() > charNum
+ && currentLine[charNum+1] == '\t')
+ currentLine[charNum+1] = ' ';
+
+ }
+
+ // pad open paren inside
+ char peekedCharInside = peekNextChar();
+ if (shouldPadParensInside)
+ if (!(currentChar == '(' && peekedCharInside == ')'))
+ appendSpaceAfter();
+ // trace
+ //if(spacesOutsideToDelete > 0 || spacesInsideToDelete > 0)
+ // cout << traceLineNumber << " " << spacesOutsideToDelete << '(' << spacesInsideToDelete << endl;
+ }
+ else if (currentChar == ')' /*|| currentChar == ']'*/)
+ {
+ spacesOutsideToDelete = 0;
+ spacesInsideToDelete = formattedLine.length();
+
+ // unpad close paren inside
+ if (shouldUnPadParens)
+ {
+ size_t i = formattedLine.find_last_not_of(" \t");
+ if (i != string::npos)
+ spacesInsideToDelete = formattedLine.length() - 1 - i;
+ if (shouldPadParensInside)
+ spacesInsideToDelete--;
+ if (spacesInsideToDelete > 0)
+ {
+ formattedLine.erase(i + 1, spacesInsideToDelete);
+ spacePadNum -= spacesInsideToDelete;
+ }
+ }
+
+ // pad close paren inside
+ if (shouldPadParensInside)
+ if (!(previousChar == '(' && currentChar == ')'))
+ appendSpacePad();
+
+ appendCurrentChar();
+
+ // unpad close paren outside
+ if (shouldUnPadParens)
+ {
+ // may have end of line comments
+ size_t j = currentLine.find_first_not_of(" \t", charNum + 1);
+ if (j != string::npos)
+ if (currentLine[j] == '[' || currentLine[j] == ']')
+ spacesOutsideToDelete = j - charNum - 1;
+ if (shouldPadParensOutside)
+ spacesOutsideToDelete--;
+
+ if (spacesOutsideToDelete > 0)
+ {
+ currentLine.erase(charNum + 1, spacesOutsideToDelete);
+ spacePadNum -= spacesOutsideToDelete;
+ }
+ }
+
+ // pad close paren outside
+ char peekedCharOutside = peekNextChar();
+ if (shouldPadParensOutside)
+ if (peekedCharOutside != ';'
+ && peekedCharOutside != ','
+ && peekedCharOutside != '.'
+ && peekedCharOutside != '-') // check for ->
+ appendSpaceAfter();
+
+ // trace
+ //if(spacesInsideToDelete > 0)
+ // cout << traceLineNumber << " " << spacesInsideToDelete << ')' << 0 << endl;
+ }
+ return;
+}
+
+/**
+ * format opening bracket as attached or broken
+ * currentChar contains the bracket
+ * the brackets will be appended to the current formattedLine or a new formattedLine as necessary
+ * the calling function should have a continue statement after calling this method
+ *
+ * @param bracketType the type of bracket to be formatted.
+ */
+void ASFormatter::formatOpeningBracket(BracketType bracketType)
+{
+ assert(!isBracketType(bracketType, ARRAY_TYPE));
+ assert(currentChar == '{');
+
+ parenStack->push_back(0);
+
+ bool breakBracket = isCurrentBracketBroken();
+
+ if (breakBracket)
+ {
+ if (isBeforeAnyComment() && isOkToBreakBlock(bracketType))
+ {
+ // if comment is at line end leave the comment on this line
+ if (isBeforeAnyLineEndComment(charNum) && !currentLineBeginsWithBracket) // lineBeginsWith('{')
+ {
+ currentChar = ' '; // remove bracket from current line
+ currentLine[charNum] = currentChar;
+ appendOpeningBracket = true; // append bracket to following line
+ }
+ // else put comment after the bracket
+ else if (!isBeforeMultipleLineEndComments(charNum))
+ breakLine();
+ }
+ else if (!isBracketType(bracketType, SINGLE_LINE_TYPE))
+ breakLine();
+ else if (shouldBreakOneLineBlocks && peekNextChar() != '}')
+ breakLine();
+ else if (!isInLineBreak)
+ appendSpacePad();
+
+ appendCurrentChar();
+
+ // should a following comment break from the bracket?
+ // must break the line AFTER the bracket
+ if (isBeforeComment()
+ && formattedLine[0] == '{'
+ && isOkToBreakBlock(bracketType)
+ && (bracketFormatMode == BREAK_MODE
+ || bracketFormatMode == LINUX_MODE
+ || bracketFormatMode == STROUSTRUP_MODE))
+ {
+ shouldBreakLineAtNextChar = true;
+ }
+
+ }
+ else // attach bracket
+ {
+ // are there comments before the bracket?
+ if (isCharImmediatelyPostComment || isCharImmediatelyPostLineComment)
+ {
+ if (isOkToBreakBlock(bracketType)
+ && !(isCharImmediatelyPostComment && isCharImmediatelyPostLineComment) // don't attach if two comments on the line
+ && peekNextChar() != '}' // don't attach { }
+ && previousCommandChar != '{' // don't attach { {
+ && previousCommandChar != '}' // don't attach } {
+ && previousCommandChar != ';') // don't attach ; {
+ {
+ appendCharInsideComments();
+ }
+ else
+ {
+ appendCurrentChar(); // don't attach
+ }
+ }
+ else if (previousCommandChar == '{'
+ || previousCommandChar == '}'
+ || previousCommandChar == ';') // '}' , ';' chars added for proper handling of '{' immediately after a '}' or ';'
+ {
+ appendCurrentChar(); // don't attach
+ }
+ else
+ {
+ // if a blank line preceeds this don't attach
+ if (isEmptyLine(formattedLine))
+ appendCurrentChar(); // don't attach
+ else if (isOkToBreakBlock(bracketType)
+ && !(isImmediatelyPostPreprocessor
+ && currentLineBeginsWithBracket)) // lineBeginsWith('{')
+ {
+ if (peekNextChar() != '}')
+ {
+ appendSpacePad();
+ appendCurrentChar(false); // OK to attach
+ // should a following comment attach with the bracket?
+ // insert spaces to reposition the comment
+ if (isBeforeComment()
+ && !isBeforeMultipleLineEndComments(charNum)
+ && (!isBeforeAnyLineEndComment(charNum) || currentLineBeginsWithBracket)) // lineBeginsWith('{')
+ {
+ breakLine();
+ currentLine.insert(charNum+1, charNum+1, ' ');
+ }
+ }
+ else
+ {
+ appendSpacePad();
+ appendCurrentChar();
+ }
+ }
+ else
+ {
+ if (!isInLineBreak)
+ appendSpacePad();
+ appendCurrentChar(); // don't attach
+ }
+ }
+ }
+}
+
+/**
+ * format closing bracket
+ * currentChar contains the bracket
+ * the calling function should have a continue statement after calling this method
+ *
+ * @param bracketType the type of bracket to be formatted.
+ */
+void ASFormatter::formatClosingBracket(BracketType bracketType)
+{
+ assert(!isBracketType(bracketType, ARRAY_TYPE));
+ assert(currentChar == '}');
+
+ // parenStack must contain one entry
+ if (parenStack->size() > 1)
+ parenStack->pop_back();
+
+ // mark state of immediately after empty block
+ // this state will be used for locating brackets that appear immedately AFTER an empty block (e.g. '{} \n}').
+ if (previousCommandChar == '{')
+ isImmediatelyPostEmptyBlock = true;
+
+ if ((!(previousCommandChar == '{' && isPreviousBracketBlockRelated)) // this '{' does not close an empty block
+ && isOkToBreakBlock(bracketType) // astyle is allowed to break on line blocks
+ && !isImmediatelyPostEmptyBlock) // this '}' does not immediately follow an empty block
+ {
+ breakLine();
+ appendCurrentChar();
+ }
+ else
+ {
+ appendCurrentChar();
+ }
+
+ // if a declaration follows a definition, space pad
+ if (isLegalNameChar(peekNextChar()))
+ appendSpaceAfter();
+
+ if (shouldBreakBlocks && currentHeader != NULL && parenStack->back() == 0)
+ {
+ isAppendPostBlockEmptyLineRequested = true;
+ }
+}
+
+/**
+ * format array brackets as attached or broken
+ * determine if the brackets can have an inStatement indent
+ * currentChar contains the bracket
+ * the brackets will be appended to the current formattedLine or a new formattedLine as necessary
+ * the calling function should have a continue statement after calling this method
+ *
+ * @param bracketType the type of bracket to be formatted, must be an ARRAY_TYPE.
+ * @param isOpeningArrayBracket indicates if this is the opening bracket for the array block.
+ */
+void ASFormatter::formatArrayBrackets(BracketType bracketType, bool isOpeningArrayBracket)
+{
+ assert(isBracketType(bracketType, ARRAY_TYPE));
+ assert(currentChar == '{' || currentChar == '}');
+
+ if (currentChar == '{')
+ {
+ // is this the first opening bracket in the array?
+ if (isOpeningArrayBracket)
+ {
+ if (bracketFormatMode == ATTACH_MODE
+ || bracketFormatMode == LINUX_MODE
+ || bracketFormatMode == STROUSTRUP_MODE)
+ {
+ // don't attach to a preprocessor directive
+ if (isImmediatelyPostPreprocessor && currentLineBeginsWithBracket) // lineBeginsWith('{')
+ {
+ isInLineBreak = true;
+ appendCurrentChar(); // don't attach
+ }
+ else if (isCharImmediatelyPostComment)
+ {
+ // TODO: attach bracket to line-end comment
+ appendCurrentChar(); // don't attach
+ }
+ else if (isCharImmediatelyPostLineComment)
+ {
+ appendCharInsideComments();
+ }
+ else
+ {
+ // if a blank line preceeds this don't attach
+ if (isEmptyLine(formattedLine))
+ appendCurrentChar(); // don't attach
+ else
+ {
+ // if bracket is broken or not an assignment
+ if (currentLineBeginsWithBracket // lineBeginsWith('{')
+ && !isBracketType(bracketTypeStack->back(), SINGLE_LINE_TYPE))
+ {
+ appendSpacePad();
+ appendCurrentChar(false); // OK to attach
+
+ if (currentLineBeginsWithBracket
+ && (int)currentLineFirstBracketNum == charNum)
+ shouldBreakLineAtNextChar = true;
+ }
+ else
+ {
+ appendSpacePad();
+ appendCurrentChar();
+ }
+ }
+ }
+ }
+ else if (bracketFormatMode == BREAK_MODE)
+ {
+ if (isWhiteSpace(peekNextChar()))
+ breakLine();
+ else if (isBeforeAnyComment())
+ {
+ // do not break unless comment is at line end
+ if (isBeforeAnyLineEndComment(charNum) && !currentLineBeginsWithBracket)
+ {
+ currentChar = ' '; // remove bracket from current line
+ appendOpeningBracket = true; // append bracket to following line
+ }
+ }
+ if (!isInLineBreak)
+ appendSpacePad();
+ appendCurrentChar();
+
+ if (currentLineBeginsWithBracket
+ && (int)currentLineFirstBracketNum == charNum
+ && !isBracketType(bracketTypeStack->back(), SINGLE_LINE_TYPE))
+ shouldBreakLineAtNextChar = true;
+ }
+ else if (bracketFormatMode == HORSTMANN_MODE)
+ {
+ if (isWhiteSpace(peekNextChar()))
+ breakLine();
+ else if (isBeforeAnyComment())
+ {
+ // do not break unless comment is at line end
+ if (isBeforeAnyLineEndComment(charNum) && !currentLineBeginsWithBracket) // lineBeginsWith('{')
+ {
+ currentChar = ' '; // remove bracket from current line
+ appendOpeningBracket = true; // append bracket to following line
+ }
+ }
+ if (!isInLineBreak)
+ appendSpacePad();
+ appendCurrentChar();
+ }
+ else if (bracketFormatMode == NONE_MODE)
+ {
+ if (currentLineBeginsWithBracket) // lineBeginsWith('{')
+ {
+ appendCurrentChar(); // don't attach
+ }
+ else
+ {
+ appendSpacePad();
+ appendCurrentChar(false); // OK to attach
+ }
+ }
+ }
+ else // not the first opening bracket
+ {
+ if (bracketFormatMode == HORSTMANN_MODE)
+ {
+ if (previousNonWSChar == '{'
+ && bracketTypeStack->size() > 2
+ && !isBracketType((*bracketTypeStack)[bracketTypeStack->size()-2], SINGLE_LINE_TYPE))
+ formatArrayRunIn();
+ }
+ else if (!isInLineBreak
+ && !isWhiteSpace(peekNextChar())
+ && previousNonWSChar == '{'
+ && bracketTypeStack->size() > 2
+ && !isBracketType((*bracketTypeStack)[bracketTypeStack->size()-2], SINGLE_LINE_TYPE))
+ formatArrayRunIn();
+
+ appendCurrentChar();
+ }
+ }
+ else if (currentChar == '}')
+ {
+ // does this close the first opening bracket in the array?
+ if (!isBracketType(bracketType, SINGLE_LINE_TYPE) )
+ breakLine();
+ appendCurrentChar();
+
+ // if a declaration follows an enum definition, space pad
+ char peekedChar = peekNextChar();
+ if (isLegalNameChar(peekedChar)
+ || peekedChar == '[')
+ appendSpaceAfter();
+ }
+}
+
+/**
+ * determine if a run-in can be attached.
+ * if it can insert the indents in formattedLine and reset the current line break.
+ */
+void ASFormatter::formatRunIn()
+{
+ assert(bracketFormatMode == HORSTMANN_MODE || bracketFormatMode == NONE_MODE);
+
+ // keep one line blocks returns true without indenting the run-in
+ if (!isOkToBreakBlock(bracketTypeStack->back()))
+ return; // true;
+
+ size_t lastText = formattedLine.find_last_not_of(" \t");
+ if (lastText == string::npos || formattedLine[lastText] != '{')
+ return; // false;
+
+ // make sure the bracket is broken
+ if (formattedLine.find_first_not_of(" \t{") != string::npos)
+ return; // false;
+
+ if (isBracketType(bracketTypeStack->back(), NAMESPACE_TYPE))
+ return; // false;
+
+ bool extraIndent = false;
+ isInLineBreak = true;
+
+ // cannot attach a class modifier without indent-classes
+ if (isCStyle()
+ && isCharPotentialHeader(currentLine, charNum)
+ && (isBracketType(bracketTypeStack->back(), CLASS_TYPE)
+ || (isBracketType(bracketTypeStack->back(), STRUCT_TYPE)
+ && isInIndentableStruct)))
+ {
+ if (findKeyword(currentLine, charNum, AS_PUBLIC)
+ || findKeyword(currentLine, charNum, AS_PRIVATE)
+ || findKeyword(currentLine, charNum, AS_PROTECTED))
+ {
+ if (!getClassIndent())
+ return; // false;
+ }
+ else if (getClassIndent())
+ extraIndent = true;
+ }
+
+ // cannot attach a 'case' statement without indent-switches
+ if (!getSwitchIndent()
+ && isCharPotentialHeader(currentLine, charNum)
+ && (findKeyword(currentLine, charNum, AS_CASE)
+ || findKeyword(currentLine, charNum, AS_DEFAULT)))
+ return; // false;
+
+ // extra indent for switch statements
+ if (getSwitchIndent()
+ && !preBracketHeaderStack->empty()
+ && preBracketHeaderStack->back() == &AS_SWITCH
+ && ((isLegalNameChar(currentChar)
+ && !findKeyword(currentLine, charNum, AS_CASE))
+ || isSequenceReached("//")
+ || isSequenceReached("/*")))
+ extraIndent = true;
+
+ isInLineBreak = false;
+ // remove for extra whitespace
+ if (formattedLine.length() > lastText+1
+ && formattedLine.find_first_not_of(" \t", lastText+1) == string::npos)
+ formattedLine.erase(lastText+1);
+
+ if (getIndentString() == "\t")
+ {
+ appendChar('\t', false);
+ horstmannIndentChars = 2; // one for { and one for tab
+ if (extraIndent)
+ {
+ appendChar('\t', false);
+ horstmannIndentChars++;
+ }
+ }
+ else
+ {
+ int indent = getIndentLength();
+ formattedLine.append(indent-1, ' ');
+ horstmannIndentChars = indent;
+ if (extraIndent)
+ {
+ formattedLine.append(indent, ' ');
+ horstmannIndentChars += indent;
+ }
+ }
+ isInHorstmannRunIn = true;
+}
+
+/**
+ * remove whitepace and add indentation for an array run-in.
+ */
+void ASFormatter::formatArrayRunIn()
+{
+ assert(isBracketType(bracketTypeStack->back(), ARRAY_TYPE));
+
+ // make sure the bracket is broken
+ if (formattedLine.find_first_not_of(" \t{") != string::npos)
+ return;
+
+ size_t lastText = formattedLine.find_last_not_of(" \t");
+ if (lastText == string::npos || formattedLine[lastText] != '{')
+ return;
+
+ // check for extra whitespace
+ if (formattedLine.length() > lastText+1
+ && formattedLine.find_first_not_of(" \t", lastText+1) == string::npos)
+ formattedLine.erase(lastText+1);
+
+ if (getIndentString() == "\t")
+ {
+ appendChar('\t', false);
+ horstmannIndentChars = 2; // one for { and one for tab
+ }
+ else
+ {
+ int indent = getIndentLength();
+ formattedLine.append(indent-1, ' ');
+ horstmannIndentChars = indent;
+ }
+ isInHorstmannRunIn = true;
+ isInLineBreak = false;
+}
+
+/**
+ * delete a bracketTypeStack vector object
+ * BracketTypeStack did not work with the DeleteContainer template
+ */
+void ASFormatter::deleteContainer(vector<BracketType>* &container)
+{
+ if (container != NULL)
+ {
+ container->clear();
+ delete (container);
+ container = NULL;
+ }
+}
+
+/**
+ * delete a vector object
+ * T is the type of vector
+ * used for all vectors except bracketTypeStack
+ */
+template<typename T>
+void ASFormatter::deleteContainer(T &container)
+{
+ if (container != NULL)
+ {
+ container->clear();
+ delete (container);
+ container = NULL;
+ }
+}
+
+/**
+ * initialize a BracketType vector object
+ * BracketType did not work with the DeleteContainer template
+ */
+void ASFormatter::initContainer(vector<BracketType>* &container, vector<BracketType>* value)
+{
+ if (container != NULL)
+ deleteContainer(container);
+ container = value;
+}
+
+/**
+ * initialize a vector object
+ * T is the type of vector
+ * used for all vectors except bracketTypeStack
+ */
+template<typename T>
+void ASFormatter::initContainer(T &container, T value)
+{
+ // since the ASFormatter object is never deleted,
+ // the existing vectors must be deleted before creating new ones
+ if (container != NULL)
+ deleteContainer(container);
+ container = value;
+}
+
+/**
+ * convert a tab to spaces.
+ * charNum points to the current character to convert to spaces.
+ * tabIncrementIn is the increment that must be added for tab indent characters
+ * to get the correct column for the current tab.
+ * replaces the tab in currentLine with the required number of spaces.
+ * replaces the value of currentChar.
+ */
+void ASFormatter::convertTabToSpaces()
+{
+ assert(currentLine[charNum] == '\t');
+
+ // do NOT replace if in quotes
+ if (isInQuote || isInQuoteContinuation)
+ return;
+
+ size_t indent = getIndentLength();
+ size_t numSpaces = indent - ((tabIncrementIn + charNum) % indent);
+ currentLine.replace(charNum, 1, numSpaces, ' ');
+ currentChar = currentLine[charNum];
+}
+
+/**
+* is it ok to break this block?
+*/
+bool ASFormatter::isOkToBreakBlock(BracketType bracketType) const
+{
+ // Actually, there should not be an ARRAY_TYPE bracket here.
+ // But this will avoid breaking a one line block when there is.
+ // Otherwise they will be formatted differently on consecutive runs.
+ if (isBracketType(bracketType, ARRAY_TYPE)
+ && isBracketType(bracketType, SINGLE_LINE_TYPE))
+ return false;
+ if (!isBracketType(bracketType, SINGLE_LINE_TYPE)
+ || shouldBreakOneLineBlocks
+ || breakCurrentOneLineBlock)
+ return true;
+ return false;
+}
+
+/**
+* check if a sharp header is a paren or nonparen header
+*/
+bool ASFormatter::isSharpStyleWithParen(const string* header) const
+{
+ if (isSharpStyle() && peekNextChar() == '('
+ && (header == &AS_CATCH
+ || header == &AS_DELEGATE))
+ return true;
+ return false;
+}
+
+/**
+ * check for a following header when a comment is reached.
+ * if a header follows, the comments are kept as part of the header block.
+ * firstLine must contain the start of the comment.
+ */
+void ASFormatter::checkForFollowingHeader(const string& firstLine)
+{
+ // look ahead to find the next non-comment text
+ string nextText = peekNextText(firstLine, true);
+ if (nextText.length() == 0 || !isCharPotentialHeader(nextText, 0))
+ return;
+
+ const string* newHeader = ASBeautifier::findHeader(nextText, 0, headers);
+
+ if (newHeader == NULL)
+ return;
+
+ // may need to break if a header follows
+ bool isClosingHeader = (newHeader == &AS_ELSE
+ || newHeader == &AS_CATCH
+ || newHeader == &AS_FINALLY);
+
+ // if a closing header, reset break unless break is requested
+ if (isClosingHeader)
+ {
+ if (!shouldBreakClosingHeaderBlocks)
+ isPrependPostBlockEmptyLineRequested = false;
+ }
+ // if an opening header, break before the comment
+ else
+ {
+ isPrependPostBlockEmptyLineRequested = true;
+ }
+}
+
+/**
+ * process preprocessor statements.
+ * charNum should be the index of the preprocessor directive.
+ *
+ * delete bracketTypeStack entries added by #if if a #else is found.
+ * prevents double entries in the bracketTypeStack.
+ */
+void ASFormatter::processPreprocessor()
+{
+ assert(currentChar == '#');
+
+ const int preproc = charNum + 1;
+
+ if (currentLine.compare(preproc, 2, "if") == 0)
+ {
+ preprocBracketTypeStackSize = bracketTypeStack->size();
+ }
+ else if (currentLine.compare(preproc, 4, "else") == 0)
+ {
+ // delete stack entries added in #if
+ // should be replaced by #else
+ if (preprocBracketTypeStackSize > 0)
+ {
+ int addedPreproc = bracketTypeStack->size() - preprocBracketTypeStackSize;
+ for (int i=0; i < addedPreproc; i++)
+ bracketTypeStack->pop_back();
+ }
+ }
+}
+
+/**
+ * determine if the next line starts a comment
+ * and a header follows the comment or comments
+ */
+bool ASFormatter::commentAndHeaderFollows() const
+{
+ // is the next line a comment
+ string nextLine = sourceIterator->peekNextLine();
+ size_t firstChar = nextLine.find_first_not_of(" \t");
+ if (firstChar == string::npos
+ || !(nextLine.compare(firstChar, 2, "//") == 0
+ || nextLine.compare(firstChar, 2, "/*") == 0))
+ {
+ sourceIterator->peekReset();
+ return false;
+ }
+
+ // if next line is a comment, find the next non-comment text
+ string nextText = peekNextText(nextLine, true);
+ if (nextText.length() == 0 || !isCharPotentialHeader(nextText, 0))
+ return false;
+
+ const string* newHeader = ASBeautifier::findHeader(nextText, 0, headers);
+
+ if (newHeader == NULL)
+ return false;
+
+ bool isClosingHeader = (newHeader == &AS_ELSE
+ || newHeader == &AS_CATCH
+ || newHeader == &AS_FINALLY);
+
+ if (isClosingHeader && !shouldBreakClosingHeaderBlocks)
+ return false;
+
+ return true;
+}
+
+/**
+ * determine if a bracket should be attached or broken
+ * uses brackets in the bracketTypeStack
+ * the last bracket in the bracketTypeStack is the one being formatted
+ * returns true if the bracket should be broken
+ */
+bool ASFormatter::isCurrentBracketBroken() const
+{
+ assert(bracketTypeStack->size() > 0);
+
+ bool breakBracket = false;
+ size_t bracketTypeStackEnd = bracketTypeStack->size()-1;
+
+ if (isBracketType((*bracketTypeStack)[bracketTypeStackEnd], EXTERN_TYPE))
+ {
+ if (currentLineBeginsWithBracket
+ || bracketFormatMode == HORSTMANN_MODE)
+ breakBracket = true;
+ }
+ else if (bracketFormatMode == NONE_MODE)
+ {
+ if (currentLineBeginsWithBracket
+ && (int)currentLineFirstBracketNum == charNum) // lineBeginsWith('{')
+ breakBracket = true;
+ }
+ else if (bracketFormatMode == BREAK_MODE || bracketFormatMode == HORSTMANN_MODE)
+ {
+ breakBracket = true;
+ }
+ else if (bracketFormatMode == LINUX_MODE || bracketFormatMode == STROUSTRUP_MODE)
+ {
+ // break a class if Linux
+ if (isBracketType((*bracketTypeStack)[bracketTypeStackEnd], CLASS_TYPE))
+ {
+ if (bracketFormatMode == LINUX_MODE)
+ breakBracket = true;
+ }
+ // break a namespace or interface if Linux
+ else if (isBracketType((*bracketTypeStack)[bracketTypeStackEnd], NAMESPACE_TYPE)
+ || isBracketType((*bracketTypeStack)[bracketTypeStackEnd], INTERFACE_TYPE))
+ {
+ if (bracketFormatMode == LINUX_MODE)
+ breakBracket = true;
+ }
+ // break the first bracket if a function
+ else if (bracketTypeStackEnd == 1
+ && isBracketType((*bracketTypeStack)[bracketTypeStackEnd], COMMAND_TYPE))
+ {
+ breakBracket = true;
+ }
+ else if (bracketTypeStackEnd > 1)
+ {
+ // break the first bracket after a namespace or extern if a function
+ if (isBracketType((*bracketTypeStack)[bracketTypeStackEnd-1], NAMESPACE_TYPE)
+ || isBracketType((*bracketTypeStack)[bracketTypeStackEnd-1], EXTERN_TYPE))
+ {
+ if (isBracketType((*bracketTypeStack)[bracketTypeStackEnd], COMMAND_TYPE))
+ breakBracket = true;
+ }
+ // if not C style then break the first bracket after a class if a function
+ else if (!isCStyle())
+ {
+ if ((isBracketType((*bracketTypeStack)[bracketTypeStackEnd-1], CLASS_TYPE)
+ || isBracketType((*bracketTypeStack)[bracketTypeStackEnd-1], ARRAY_TYPE)
+ || isBracketType((*bracketTypeStack)[bracketTypeStackEnd-1], STRUCT_TYPE))
+ && isBracketType((*bracketTypeStack)[bracketTypeStackEnd], COMMAND_TYPE))
+ breakBracket = true;
+ }
+ }
+ }
+ return breakBracket;
+}
+
+/**
+ * format comment body
+ * the calling function should have a continue statement after calling this method
+ */
+void ASFormatter::formatCommentBody()
+{
+ assert(isInComment);
+
+ if (isSequenceReached("*/"))
+ {
+ isInComment = false;
+ noTrimCommentContinuation = false;
+ isImmediatelyPostComment = true;
+ appendSequence(AS_CLOSE_COMMENT);
+ goForward(1);
+ if (doesLineStartComment
+ && (currentLine.find_first_not_of(" \t", charNum+1) == string::npos))
+ lineEndsInCommentOnly = true;
+ if (peekNextChar() == '}'
+ && previousCommandChar != ';'
+ && !isBracketType(bracketTypeStack->back(), ARRAY_TYPE)
+ && isOkToBreakBlock(bracketTypeStack->back()))
+ breakLine();
+ }
+ else
+ {
+ appendCurrentChar();
+ // append the comment up to the next tab or comment end
+ // tabs must be checked for convert-tabs before appending
+ while (charNum + 1 < (int) currentLine.length()
+ && currentLine[charNum+1] != '\t'
+ && currentLine.compare(charNum+1, 2, "*/") != 0)
+ {
+ currentChar = currentLine[++charNum];
+ appendCurrentChar();
+ }
+ }
+}
+
+/**
+ * format a comment opener
+ * the comment opener will be appended to the current formattedLine or a new formattedLine as necessary
+ * the calling function should have a continue statement after calling this method
+ */
+void ASFormatter::formatCommentOpener()
+{
+ assert(isSequenceReached("/*"));
+
+ isInComment = true;
+ isImmediatelyPostLineComment = false;
+
+ if (spacePadNum != 0)
+ adjustComments();
+ formattedLineCommentNum = formattedLine.length();
+
+ // must be done BEFORE appendSequence
+ if (previousCommandChar == '{'
+ && !isImmediatelyPostComment
+ && !isImmediatelyPostLineComment)
+ {
+ if (bracketFormatMode == NONE_MODE)
+ {
+ // should a run-in statement be attached?
+ if (currentLineBeginsWithBracket)
+ formatRunIn();
+ }
+ else if (bracketFormatMode == ATTACH_MODE)
+ {
+ // if the bracket was not attached?
+ if (formattedLine[0] == '{'
+ && !isBracketType(bracketTypeStack->back(), SINGLE_LINE_TYPE))
+ isInLineBreak = true;
+ }
+ else if (bracketFormatMode == HORSTMANN_MODE)
+ {
+ // should a run-in statement be attached?
+ if (formattedLine[0] == '{')
+ formatRunIn();
+ }
+ }
+ else if (!doesLineStartComment)
+ noTrimCommentContinuation = true;
+
+ // appendSequence will write the previous line
+ appendSequence(AS_OPEN_COMMENT);
+ goForward(1);
+
+ // must be done AFTER appendSequence
+ if (shouldBreakBlocks)
+ {
+ // break before the comment if a header follows the comment
+ // for speed, do not check if previous line is empty,
+ // if previous line is a line comment or if previous line is '{'
+ if (doesLineStartComment
+ && !isImmediatelyPostEmptyLine
+ && !isImmediatelyPostComment
+ && !isImmediatelyPostLineComment
+ && previousCommandChar != '{')
+ {
+ checkForFollowingHeader(currentLine.substr(charNum-1));
+ }
+ }
+
+ if (previousCommandChar == '}')
+ currentHeader = NULL;
+}
+
+/**
+ * format a line comment body
+ * the calling function should have a continue statement after calling this method
+ */
+void ASFormatter::formatLineCommentBody()
+{
+ assert(isInLineComment);
+
+ appendCurrentChar();
+ // append the comment up to the next tab
+ // tabs must be checked for convert-tabs before appending
+ while (charNum + 1 < (int) currentLine.length()
+ && currentLine[charNum+1] != '\t')
+ {
+ currentChar = currentLine[++charNum];
+ appendCurrentChar();
+ }
+
+ // explicitely break a line when a line comment's end is found.
+ if (charNum + 1 == (int) currentLine.length())
+ {
+ isInLineBreak = true;
+ isInLineComment = false;
+ isImmediatelyPostLineComment = true;
+ currentChar = 0; //make sure it is a neutral char.
+ }
+}
+
+/**
+ * format a line comment opener
+ * the line comment opener will be appended to the current formattedLine or a new formattedLine as necessary
+ * the calling function should have a continue statement after calling this method
+ */
+void ASFormatter::formatLineCommentOpener()
+{
+ assert(isSequenceReached("//"));
+
+ if (currentLine[charNum+2] == '\xf2') // check for windows line marker
+ isAppendPostBlockEmptyLineRequested = false;
+
+ isInLineComment = true;
+ isCharImmediatelyPostComment = false;
+
+ // do not indent if in column 1 or 2
+ if (!shouldIndentCol1Comments && !lineCommentNoIndent)
+ {
+ if (charNum == 0)
+ lineCommentNoIndent = true;
+ else if (charNum == 1 && currentLine[0] == ' ')
+ lineCommentNoIndent = true;
+ }
+ // move comment if spaces were added or deleted
+ if (lineCommentNoIndent == false && spacePadNum != 0)
+ adjustComments();
+ formattedLineCommentNum = formattedLine.length();
+
+ // must be done BEFORE appendSequence
+ // check for run-in statement
+ if (previousCommandChar == '{'
+ && !isImmediatelyPostComment
+ && !isImmediatelyPostLineComment)
+ {
+ if (bracketFormatMode == NONE_MODE)
+ {
+ if (currentLineBeginsWithBracket)
+ formatRunIn();
+ }
+ else if (bracketFormatMode == HORSTMANN_MODE)
+ {
+ if (!lineCommentNoIndent)
+ formatRunIn();
+ else
+ isInLineBreak = true;
+ }
+ else if (bracketFormatMode == BREAK_MODE)
+ {
+ if (formattedLine[0] == '{')
+ isInLineBreak = true;
+ }
+ else
+ {
+ if (currentLineBeginsWithBracket)
+ isInLineBreak = true;
+ }
+ }
+
+ // appendSequence will write the previous line
+ appendSequence(AS_OPEN_LINE_COMMENT);
+ goForward(1);
+
+ if (formattedLine.compare(0, 2, "//") == 0)
+ lineIsLineCommentOnly = true;
+
+ // must be done AFTER appendSequence
+ if (shouldBreakBlocks)
+ {
+ // break before the comment if a header follows the line comment
+ // for speed, do not check if previous line is empty,
+ // if previous line is a comment or if previous line is '{'
+ if (lineIsLineCommentOnly
+ && previousCommandChar != '{'
+ && !isImmediatelyPostEmptyLine
+ && !isImmediatelyPostComment
+ && !isImmediatelyPostLineComment)
+ {
+ checkForFollowingHeader(currentLine.substr(charNum-1));
+ }
+ }
+
+ if (previousCommandChar == '}')
+ currentHeader = NULL;
+
+ // if tabbed input don't convert the immediately following tabs to spaces
+ if (getIndentString() == "\t" && lineCommentNoIndent)
+ {
+ while (charNum + 1 < (int) currentLine.length()
+ && currentLine[charNum+1] == '\t')
+ {
+ currentChar = currentLine[++charNum];
+ appendCurrentChar();
+ }
+ }
+
+ // explicitely break a line when a line comment's end is found.
+ if (charNum + 1 == (int) currentLine.length())
+ {
+ isInLineBreak = true;
+ isInLineComment = false;
+ isImmediatelyPostLineComment = true;
+ currentChar = 0; //make sure it is a neutral char.
+ }
+}
+
+/**
+ * format quote body
+ * the calling function should have a continue statement after calling this method
+ */
+void ASFormatter::formatQuoteBody()
+{
+ assert(isInQuote);
+
+ if (isSpecialChar)
+ {
+ isSpecialChar = false;
+ }
+ else if (currentChar == '\\' && !isInVerbatimQuote)
+ {
+ if (peekNextChar() == ' ') // is this '\' at end of line
+ haveLineContinuationChar = true;
+ else
+ isSpecialChar = true;
+ }
+ else if (isInVerbatimQuote && currentChar == '"')
+ {
+ if (peekNextChar() == '"') // check consecutive quotes
+ {
+ appendSequence("\"\"");
+ goForward(1);
+ return;
+ }
+ else
+ {
+ isInQuote = false;
+ isInVerbatimQuote = false;
+ }
+ }
+ else if (quoteChar == currentChar)
+ {
+ isInQuote = false;
+ }
+
+ appendCurrentChar();
+
+ // append the text to the ending quoteChar or an escape sequence
+ // tabs in quotes are NOT changed by convert-tabs
+ if (isInQuote && currentChar != '\\')
+ {
+ while (charNum + 1 < (int) currentLine.length()
+ && currentLine[charNum+1] != quoteChar
+ && currentLine[charNum+1] != '\\')
+ {
+ currentChar = currentLine[++charNum];
+ appendCurrentChar();
+ }
+ }
+}
+
+/**
+ * format a quote opener
+ * the quote opener will be appended to the current formattedLine or a new formattedLine as necessary
+ * the calling function should have a continue statement after calling this method
+ */
+void ASFormatter::formatQuoteOpener()
+{
+ assert(currentChar == '"' || currentChar == '\'');
+
+ isInQuote = true;
+ quoteChar = currentChar;
+ if (isSharpStyle() && previousChar == '@')
+ isInVerbatimQuote = true;
+
+ // a quote following a bracket is an array
+ if (previousCommandChar == '{'
+ && !isImmediatelyPostComment
+ && !isImmediatelyPostLineComment
+ && isNonInStatementArray
+ && !isBracketType(bracketTypeStack->back(), SINGLE_LINE_TYPE)
+ && !isWhiteSpace(peekNextChar()))
+ {
+ if (bracketFormatMode == NONE_MODE)
+ {
+ if (currentLineBeginsWithBracket)
+ formatRunIn();
+ }
+ else if (bracketFormatMode == HORSTMANN_MODE)
+ {
+ if (!lineCommentNoIndent)
+ formatRunIn();
+ else
+ isInLineBreak = true;
+ }
+ else if (bracketFormatMode == BREAK_MODE)
+ {
+ if (formattedLine[0] == '{')
+ isInLineBreak = true;
+ }
+ else
+ {
+ if (currentLineBeginsWithBracket)
+ isInLineBreak = true;
+ }
+ }
+ previousCommandChar = ' ';
+ appendCurrentChar();
+}
+
+/**
+ * get the next line comment adjustment that results from breaking a closing bracket.
+ * the bracket must be on the same line as the closing header.
+ * i.e "} else" changed to "} \n else".
+ */
+int ASFormatter::getNextLineCommentAdjustment()
+{
+ assert(foundClosingHeader && previousNonWSChar == '}');
+ if (charNum < 1)
+ return 0;
+ size_t lastBracket = currentLine.rfind('}', charNum - 1);
+ if (lastBracket != string::npos)
+ return (lastBracket - charNum); // return a negative number
+ return 0;
+}
+
+LineEndFormat ASFormatter::getLineEndFormat() const
+{
+ return lineEnd;
+}
+
+/**
+ * get the current line comment adjustment that results from attaching
+ * a closing header to a closing bracket.
+ * the bracket must be on the line previous to the closing header.
+ * the adjustment is 2 chars, one for the bracket and one for the space.
+ * i.e "} \n else" changed to "} else".
+ */
+int ASFormatter::getCurrentLineCommentAdjustment()
+{
+ assert(foundClosingHeader && previousNonWSChar == '}');
+ if (charNum < 1)
+ return 2;
+ size_t lastBracket = currentLine.rfind('}', charNum - 1);
+ if (lastBracket == string::npos)
+ return 2;
+ return 0;
+}
+
+/**
+ * get the previous word
+ * the argument 'end' must point to the search start.
+ *
+ * @return is the previous word.
+ */
+string ASFormatter::getPreviousWord(const string& line, int currPos) const
+{
+ // get the last legal word (may be a number)
+ if (currPos == 0)
+ return string();
+
+ size_t end = line.find_last_not_of(" \t", currPos-1);
+ if (end == string::npos || !isLegalNameChar(line[end]))
+ return string();
+
+ int start; // start of the previous word
+ for (start = end; start > -1; start--)
+ {
+ if (!isLegalNameChar(line[start]) || line[start] == '.')
+ break;
+ }
+ start++;
+
+ return (line.substr(start, end-start+1));
+}
+
+/**
+ * check if a line break is needed when a closing bracket
+ * is followed by a closing header.
+ * the break depends on the bracketFormatMode and other factors.
+ */
+void ASFormatter::isLineBreakBeforeClosingHeader()
+{
+ assert(foundClosingHeader && previousNonWSChar == '}');
+ if (bracketFormatMode == BREAK_MODE || bracketFormatMode == HORSTMANN_MODE)
+ {
+ isInLineBreak = true;
+ }
+ else if (bracketFormatMode == NONE_MODE)
+ {
+ if (shouldBreakClosingHeaderBrackets
+ || getBracketIndent() || getBlockIndent())
+ {
+ isInLineBreak = true;
+ }
+ else
+ {
+ appendSpacePad();
+ // is closing bracket broken?
+ size_t i = currentLine.find_first_not_of(" \t");
+ if (i != string::npos && currentLine[i] == '}')
+ isInLineBreak = false;
+
+ if (shouldBreakBlocks)
+ isAppendPostBlockEmptyLineRequested = false;
+ }
+ }
+ // bracketFormatMode == ATTACH_MODE, LINUX_MODE, STROUSTRUP_MODE
+ else
+ {
+ if (shouldBreakClosingHeaderBrackets
+ || getBracketIndent() || getBlockIndent())
+ {
+ isInLineBreak = true;
+ }
+ else
+ {
+ // if a blank line does not preceed this
+ // or last line is not a one line block, attach header
+ bool previousLineIsEmpty = isEmptyLine(formattedLine);
+ bool previousLineIsOneLineBlock = false;
+ size_t firstBracket = findNextChar(formattedLine, '{');
+ if (firstBracket != string::npos)
+ previousLineIsOneLineBlock = isOneLineBlockReached(formattedLine, firstBracket);
+ if (!previousLineIsEmpty
+ && !previousLineIsOneLineBlock)
+ {
+ isInLineBreak = false;
+ appendSpacePad();
+ spacePadNum = 0; // don't count as comment padding
+ }
+
+ if (shouldBreakBlocks)
+ isAppendPostBlockEmptyLineRequested = false;
+ }
+ }
+}
+
+/**
+ * Add brackets to a single line statement following a header.
+ * Brackets are not added if the proper conditions are not met.
+ * Brackets are added to the currentLine.
+ */
+bool ASFormatter::addBracketsToStatement()
+{
+ assert(isImmediatelyPostHeader);
+
+ if (currentHeader != &AS_IF
+ && currentHeader != &AS_ELSE
+ && currentHeader != &AS_FOR
+ && currentHeader != &AS_WHILE
+ && currentHeader != &AS_DO
+ && currentHeader != &AS_FOREACH)
+ return false;
+
+ // do not add if a header follows (i.e. else if)
+ if (isCharPotentialHeader(currentLine, charNum))
+ if (findHeader(headers) != NULL)
+ return false;
+
+ // find the next semi-colon
+ size_t nextSemiColon = findNextChar(currentLine, ';', charNum+1);
+ if (nextSemiColon == string::npos)
+ return false;
+
+ // add closing bracket before changing the line length
+ if (nextSemiColon == currentLine.length() - 1)
+ currentLine.append(" }");
+ else
+ currentLine.insert(nextSemiColon + 1, " }");
+ // add opening bracket
+ currentLine.insert(charNum, "{ ");
+ currentChar = '{';
+ // remove extra spaces
+ if (!shouldAddOneLineBrackets)
+ {
+ size_t lastText = formattedLine.find_last_not_of(" \t");
+ if ((formattedLine.length() - 1) - lastText > 1)
+ formattedLine.erase(lastText + 1);
+ }
+ return true;
+}
+
+/**
+ * Find the next character that is not in quotes or a comment.
+ *
+ * @param line the line to be searched.
+ * @param searchChar the char to find.
+ * @param searchStart the char to find.
+ * @return the position on the line or string::npos if not found.
+ */
+size_t ASFormatter::findNextChar(string& line, char searchChar, int searchStart /*0*/)
+{
+ // find the next searchChar
+ size_t i;
+ for (i = searchStart; i < line.length(); i++)
+ {
+ if (line.compare(i, 2, "//") == 0)
+ return string::npos;
+ if (line.compare(i, 2, "/*") == 0)
+ {
+ size_t endComment = line.find("*/", i+2);
+ if (endComment == string::npos)
+ return string::npos;
+ i = endComment + 2;
+ }
+ if (line[i] == '\'' || line[i] == '\"')
+ {
+ char quote = line[i];
+ while (i < line.length())
+ {
+ size_t endQuote = line.find(quote, i+1);
+ if (endQuote == string::npos)
+ return string::npos;
+ i = endQuote;
+ if (line[endQuote-1] != '\\') // check for '\"'
+ break;
+ if (line[endQuote-2] == '\\') // check for '\\'
+ break;
+ }
+ }
+
+ if (line[i] == searchChar)
+ break;
+
+ // for now don't process C# 'delegate' brackets
+ // do this last in case the search char is a '{'
+ if (line[i] == '{')
+ return string::npos;
+ }
+ if (i >= line.length()) // didn't find searchChar
+ return string::npos;
+
+ return i;
+}
+
+/**
+ * Look ahead in the file to see if a struct has access modifiers.
+ *
+ * @param line a reference to the line to indent.
+ * @param index the current line index.
+ * @return true if the struct has access modifiers.
+ */
+bool ASFormatter::isStructAccessModified(string &firstLine, size_t index) const
+{
+ assert(firstLine[index] == '{');
+ assert(isCStyle());
+
+ bool isFirstLine = true;
+ bool needReset = false;
+ size_t bracketCount = 1;
+ string nextLine = firstLine.substr(index + 1);
+
+ // find the first non-blank text, bypassing all comments.
+ bool isInComment = false;
+ while (sourceIterator->hasMoreLines())
+ {
+ if (isFirstLine)
+ isFirstLine = false;
+ else
+ {
+ nextLine = sourceIterator->peekNextLine();
+ needReset = true;
+ }
+ // parse the line
+ for (size_t i = 0; i < nextLine.length(); i++)
+ {
+ if (isWhiteSpace(nextLine[i]))
+ continue;
+ if (nextLine.compare(i, 2, "/*") == 0)
+ isInComment = true;
+ if (isInComment)
+ {
+ i = nextLine.find("*/", i);
+ if (i == string::npos)
+ {
+ i = nextLine.length();
+ continue;
+ }
+ i++;
+ isInComment = false;
+ continue;
+ }
+ if (nextLine.compare(i, 2, "//") == 0)
+ {
+ i = nextLine.length();
+ continue;
+ }
+ // handle brackets
+ if (nextLine[i] == '{')
+ bracketCount++;
+ if (nextLine[i] == '}')
+ bracketCount--;
+ if (bracketCount == 0)
+ {
+ if (needReset)
+ sourceIterator->peekReset();
+ return false;
+ }
+ // check for access modifiers
+ if (isCharPotentialHeader(nextLine, i))
+ {
+ if (findKeyword(nextLine, i, AS_PUBLIC)
+ || findKeyword(nextLine, i, AS_PRIVATE)
+ || findKeyword(nextLine, i, AS_PROTECTED))
+ {
+ if (needReset)
+ sourceIterator->peekReset();
+ return true;
+ }
+ string name = getCurrentWord(nextLine, i);
+ i += name.length() - 1;
+ }
+ } // end of for loop
+ } // end of while loop
+
+ if (needReset)
+ sourceIterator->peekReset();
+ return false;
+}
+
+/**
+ * Check to see if this is an EXEC SQL statement.
+ *
+ * @param line a reference to the line to indent.
+ * @param index the current line index.
+ * @return true if the statement is EXEC SQL.
+ */
+bool ASFormatter::isExecSQL(string &line, size_t index) const
+{
+ if (line[index] != 'e' && line[index] != 'E') // quick check to reject most
+ return false;
+ string word;
+ if (isCharPotentialHeader(line, index))
+ word = getCurrentWord(line, index);
+ for (size_t i = 0; i < word.length(); i++)
+ word[i] = (char) toupper(word[i]);
+ if (word != "EXEC")
+ return false;
+ size_t index2 = index + word.length();
+ index2 = line.find_first_not_of(" \t", index2);
+ if (index2 == string::npos)
+ return false;
+ word.erase();
+ if (isCharPotentialHeader(line, index2))
+ word = getCurrentWord(line, index2);
+ for (size_t i = 0; i < word.length(); i++)
+ word[i] = (char) toupper(word[i]);
+ if (word != "SQL")
+ return false;
+ return true;
+}
+
+/**
+ * The continuation lines must be adjusted so the leading spaces
+ * is equivalent to the text on the opening line.
+ *
+ * Updates currentLine and charNum.
+ */
+void ASFormatter::trimContinuationLine()
+{
+ size_t len = currentLine.length();
+ size_t indent = getIndentLength();
+ charNum = 0;
+
+ if (leadingSpaces > 0 && len > 0)
+ {
+ size_t i;
+ size_t continuationIncrementIn = 0;
+ for (i = 0; (i < len) && (i + continuationIncrementIn < leadingSpaces); i++)
+ {
+ if (!isWhiteSpace(currentLine[i])) // don't delete any text
+ {
+ i = 0;
+ continuationIncrementIn = tabIncrementIn;
+ break;
+ }
+ if (currentLine[i] == '\t')
+ continuationIncrementIn += indent - 1 - ((continuationIncrementIn + i) % indent);
+ }
+
+ if ((int) continuationIncrementIn == tabIncrementIn)
+ charNum = i;
+ else
+ {
+ // build a new line with the equivalent leading chars
+ string newLine;
+ int leadingChars = 0;
+ if ((int) leadingSpaces > tabIncrementIn)
+ leadingChars = leadingSpaces - tabIncrementIn;
+ newLine.append(leadingChars, ' ');
+ newLine.append(currentLine, i, len-i);
+ currentLine = newLine;
+ charNum = leadingChars;
+ }
+ if (i >= len)
+ charNum = 0;
+ }
+ return;
+}
+
+
+} // end namespace astyle
diff --git a/support/highlight/src/core/astyle/ASResource.cpp b/support/highlight/src/core/astyle/ASResource.cpp
new file mode 100644
index 0000000000..c2781c88a3
--- /dev/null
+++ b/support/highlight/src/core/astyle/ASResource.cpp
@@ -0,0 +1,547 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Copyright (C) 2006-2010 by Jim Pattee <jimp03@email.com>
+ * Copyright (C) 1998-2002 by Tal Davidson
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>
+ *
+ * This file is a part of Artistic Style - an indentation and
+ * reformatting tool for C, C++, C# and Java source files.
+ * <http://astyle.sourceforge.net>
+ *
+ * Artistic Style is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Artistic Style is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Artistic Style. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ */
+
+#include "astyle.h"
+#include <algorithm>
+
+
+namespace astyle
+{
+const string ASResource::AS_IF = string("if");
+const string ASResource::AS_ELSE = string("else");
+const string ASResource::AS_FOR = string("for");
+const string ASResource::AS_DO = string("do");
+const string ASResource::AS_WHILE = string("while");
+const string ASResource::AS_SWITCH = string("switch");
+const string ASResource::AS_CASE = string("case");
+const string ASResource::AS_DEFAULT = string("default");
+const string ASResource::AS_CLASS = string("class");
+const string ASResource::AS_STRUCT = string("struct");
+const string ASResource::AS_UNION = string("union");
+const string ASResource::AS_INTERFACE = string("interface");
+const string ASResource::AS_NAMESPACE = string("namespace");
+const string ASResource::AS_EXTERN = string("extern");
+const string ASResource::AS_ENUM = string("enum");
+const string ASResource::AS_PUBLIC = string("public");
+const string ASResource::AS_PROTECTED = string("protected");
+const string ASResource::AS_PRIVATE = string("private");
+const string ASResource::AS_STATIC = string("static");
+const string ASResource::AS_SYNCHRONIZED = string("synchronized");
+const string ASResource::AS_OPERATOR = string("operator");
+const string ASResource::AS_TEMPLATE = string("template");
+const string ASResource::AS_TRY = string("try");
+const string ASResource::AS_CATCH = string("catch");
+const string ASResource::AS_FINALLY = string("finally");
+const string ASResource::AS_THROWS = string("throws");
+const string ASResource::AS_CONST = string("const");
+const string ASResource::AS_WHERE = string("where");
+const string ASResource::AS_NEW = string("new");
+
+const string ASResource::AS_ASM = string("asm");
+const string ASResource::AS__ASM__ = string("__asm__");
+const string ASResource::AS_MS_ASM = string("_asm");
+const string ASResource::AS_MS__ASM = string("__asm");
+
+const string ASResource::AS_BAR_DEFINE = string("#define");
+const string ASResource::AS_BAR_INCLUDE = string("#include");
+const string ASResource::AS_BAR_IF = string("#if");
+const string ASResource::AS_BAR_EL = string("#el");
+const string ASResource::AS_BAR_ENDIF = string("#endif");
+
+const string ASResource::AS_OPEN_BRACKET = string("{");
+const string ASResource::AS_CLOSE_BRACKET = string("}");
+const string ASResource::AS_OPEN_LINE_COMMENT = string("//");
+const string ASResource::AS_OPEN_COMMENT = string("/*");
+const string ASResource::AS_CLOSE_COMMENT = string("*/");
+
+const string ASResource::AS_ASSIGN = string("=");
+const string ASResource::AS_PLUS_ASSIGN = string("+=");
+const string ASResource::AS_MINUS_ASSIGN = string("-=");
+const string ASResource::AS_MULT_ASSIGN = string("*=");
+const string ASResource::AS_DIV_ASSIGN = string("/=");
+const string ASResource::AS_MOD_ASSIGN = string("%=");
+const string ASResource::AS_OR_ASSIGN = string("|=");
+const string ASResource::AS_AND_ASSIGN = string("&=");
+const string ASResource::AS_XOR_ASSIGN = string("^=");
+const string ASResource::AS_GR_GR_ASSIGN = string(">>=");
+const string ASResource::AS_LS_LS_ASSIGN = string("<<=");
+const string ASResource::AS_GR_GR_GR_ASSIGN = string(">>>=");
+const string ASResource::AS_LS_LS_LS_ASSIGN = string("<<<=");
+const string ASResource::AS_GCC_MIN_ASSIGN = string("<?");
+const string ASResource::AS_GCC_MAX_ASSIGN = string(">?");
+
+const string ASResource::AS_RETURN = string("return");
+const string ASResource::AS_CIN = string("cin");
+const string ASResource::AS_COUT = string("cout");
+const string ASResource::AS_CERR = string("cerr");
+
+const string ASResource::AS_EQUAL = string("==");
+const string ASResource::AS_PLUS_PLUS = string("++");
+const string ASResource::AS_MINUS_MINUS = string("--");
+const string ASResource::AS_NOT_EQUAL = string("!=");
+const string ASResource::AS_GR_EQUAL = string(">=");
+const string ASResource::AS_GR_GR = string(">>");
+const string ASResource::AS_GR_GR_GR = string(">>>");
+const string ASResource::AS_LS_EQUAL = string("<=");
+const string ASResource::AS_LS_LS = string("<<");
+const string ASResource::AS_LS_LS_LS = string("<<<");
+const string ASResource::AS_QUESTION_QUESTION = string("??");
+const string ASResource::AS_EQUAL_GR = string("=>"); // C# lambda expression arrow
+const string ASResource::AS_ARROW = string("->");
+const string ASResource::AS_AND = string("&&");
+const string ASResource::AS_OR = string("||");
+const string ASResource::AS_COLON_COLON = string("::");
+const string ASResource::AS_PAREN_PAREN = string("()");
+const string ASResource::AS_BLPAREN_BLPAREN = string("[]");
+
+const string ASResource::AS_PLUS = string("+");
+const string ASResource::AS_MINUS = string("-");
+const string ASResource::AS_MULT = string("*");
+const string ASResource::AS_DIV = string("/");
+const string ASResource::AS_MOD = string("%");
+const string ASResource::AS_GR = string(">");
+const string ASResource::AS_LS = string("<");
+const string ASResource::AS_NOT = string("!");
+const string ASResource::AS_BIT_OR = string("|");
+const string ASResource::AS_BIT_AND = string("&");
+const string ASResource::AS_BIT_NOT = string("~");
+const string ASResource::AS_BIT_XOR = string("^");
+const string ASResource::AS_QUESTION = string("?");
+const string ASResource::AS_COLON = string(":");
+const string ASResource::AS_COMMA = string(",");
+const string ASResource::AS_SEMICOLON = string(";");
+
+const string ASResource::AS_FOREACH = string("foreach");
+const string ASResource::AS_LOCK = string("lock");
+const string ASResource::AS_UNSAFE = string("unsafe");
+const string ASResource::AS_FIXED = string("fixed");
+const string ASResource::AS_GET = string("get");
+const string ASResource::AS_SET = string("set");
+const string ASResource::AS_ADD = string("add");
+const string ASResource::AS_REMOVE = string("remove");
+const string ASResource::AS_DELEGATE = string("delegate");
+const string ASResource::AS_UNCHECKED = string("unchecked");
+
+const string ASResource::AS_CONST_CAST = string("const_cast");
+const string ASResource::AS_DYNAMIC_CAST = string("dynamic_cast");
+const string ASResource::AS_REINTERPRET_CAST = string("reinterpret_cast");
+const string ASResource::AS_STATIC_CAST = string("static_cast");
+
+
+/**
+ * Sort comparison function.
+ * Compares the length of the value of pointers in the vectors.
+ * The LONGEST strings will be first in the vector.
+ *
+ * @params the string pointers to be compared.
+ */
+bool sortOnLength(const string *a, const string *b)
+{
+ return (*a).length() > (*b).length();
+}
+
+/**
+ * Sort comparison function.
+ * Compares the value of pointers in the vectors.
+ *
+ * @params the string pointers to be compared.
+ */
+bool sortOnName(const string *a, const string *b)
+{
+ return *a < *b;
+}
+
+/**
+ * Build the vector of assignment operators.
+ * Used by BOTH ASFormatter.cpp and ASBeautifier.cpp
+ *
+ * @param assignmentOperators a reference to the vector to be built.
+ */
+void ASResource::buildAssignmentOperators(vector<const string*>* assignmentOperators)
+{
+ assignmentOperators->push_back(&AS_ASSIGN);
+ assignmentOperators->push_back(&AS_PLUS_ASSIGN);
+ assignmentOperators->push_back(&AS_MINUS_ASSIGN);
+ assignmentOperators->push_back(&AS_MULT_ASSIGN);
+ assignmentOperators->push_back(&AS_DIV_ASSIGN);
+ assignmentOperators->push_back(&AS_MOD_ASSIGN);
+ assignmentOperators->push_back(&AS_OR_ASSIGN);
+ assignmentOperators->push_back(&AS_AND_ASSIGN);
+ assignmentOperators->push_back(&AS_XOR_ASSIGN);
+
+ // Java
+ assignmentOperators->push_back(&AS_GR_GR_GR_ASSIGN);
+ assignmentOperators->push_back(&AS_GR_GR_ASSIGN);
+ assignmentOperators->push_back(&AS_LS_LS_ASSIGN);
+
+ // Unknown
+ assignmentOperators->push_back(&AS_LS_LS_LS_ASSIGN);
+
+ sort(assignmentOperators->begin(), assignmentOperators->end(), sortOnLength);
+}
+
+/**
+ * Build the vector of C++ cast operators.
+ * Used by ONLY ASFormatter.cpp
+ *
+ * @param castOperators a reference to the vector to be built.
+ */
+void ASResource::buildCastOperators(vector<const string*>* castOperators)
+{
+ castOperators->push_back(&AS_CONST_CAST);
+ castOperators->push_back(&AS_DYNAMIC_CAST);
+ castOperators->push_back(&AS_REINTERPRET_CAST);
+ castOperators->push_back(&AS_STATIC_CAST);
+}
+
+/**
+ * Build the vector of header words.
+ * Used by BOTH ASFormatter.cpp and ASBeautifier.cpp
+ *
+ * @param headers a reference to the vector to be built.
+ */
+void ASResource::buildHeaders(vector<const string*>* headers, int fileType, bool beautifier)
+{
+ headers->push_back(&AS_IF);
+ headers->push_back(&AS_ELSE);
+ headers->push_back(&AS_FOR);
+ headers->push_back(&AS_WHILE);
+ headers->push_back(&AS_DO);
+ headers->push_back(&AS_SWITCH);
+ headers->push_back(&AS_TRY);
+ headers->push_back(&AS_CATCH);
+
+ if (fileType == JAVA_TYPE)
+ {
+ headers->push_back(&AS_FINALLY);
+ headers->push_back(&AS_SYNCHRONIZED);
+ }
+
+ if (fileType == SHARP_TYPE)
+ {
+ headers->push_back(&AS_FINALLY);
+ headers->push_back(&AS_FOREACH);
+ headers->push_back(&AS_LOCK);
+// headers->push_back(&AS_UNSAFE);
+ headers->push_back(&AS_FIXED);
+ headers->push_back(&AS_GET);
+ headers->push_back(&AS_SET);
+ headers->push_back(&AS_ADD);
+ headers->push_back(&AS_REMOVE);
+ }
+
+ if (beautifier)
+ {
+ headers->push_back(&AS_CASE);
+ headers->push_back(&AS_DEFAULT);
+
+ if (fileType == C_TYPE)
+ {
+ headers->push_back(&AS_CONST);
+ headers->push_back(&AS_TEMPLATE);
+ }
+
+ if (fileType == JAVA_TYPE)
+ {
+ headers->push_back(&AS_STATIC); // for static constructor
+ }
+ }
+ sort(headers->begin(), headers->end(), sortOnName);
+}
+
+/**
+ * Build the vector of indentable headers.
+ * Used by ONLY ASBeautifier.cpp
+ *
+ * @param indentableHeaders a reference to the vector to be built.
+ */
+void ASResource::buildIndentableHeaders(vector<const string*>* indentableHeaders)
+{
+ indentableHeaders->push_back(&AS_RETURN);
+// indentableHeaders->push_back(&AS_COUT);
+// indentableHeaders->push_back(&AS_CERR);
+// indentableHeaders->push_back(&AS_CIN);
+
+ sort(indentableHeaders->begin(), indentableHeaders->end(), sortOnName);
+}
+
+/**
+ * Build the vector of non-assignment operators.
+ * Used by ONLY ASBeautifier.cpp
+ *
+ * @param nonAssignmentOperators a reference to the vector to be built.
+ */
+void ASResource::buildNonAssignmentOperators(vector<const string*>* nonAssignmentOperators)
+{
+ nonAssignmentOperators->push_back(&AS_EQUAL);
+ nonAssignmentOperators->push_back(&AS_PLUS_PLUS);
+ nonAssignmentOperators->push_back(&AS_MINUS_MINUS);
+ nonAssignmentOperators->push_back(&AS_NOT_EQUAL);
+ nonAssignmentOperators->push_back(&AS_GR_EQUAL);
+ nonAssignmentOperators->push_back(&AS_GR_GR_GR);
+ nonAssignmentOperators->push_back(&AS_GR_GR);
+ nonAssignmentOperators->push_back(&AS_LS_EQUAL);
+ nonAssignmentOperators->push_back(&AS_LS_LS_LS);
+ nonAssignmentOperators->push_back(&AS_LS_LS);
+ nonAssignmentOperators->push_back(&AS_ARROW);
+ nonAssignmentOperators->push_back(&AS_AND);
+ nonAssignmentOperators->push_back(&AS_OR);
+
+ sort(nonAssignmentOperators->begin(), nonAssignmentOperators->end(), sortOnLength);
+}
+
+/**
+ * Build the vector of header non-paren headers.
+ * Used by BOTH ASFormatter.cpp and ASBeautifier.cpp
+ *
+ * @param nonParenHeaders a reference to the vector to be built.
+ */
+void ASResource::buildNonParenHeaders(vector<const string*>* nonParenHeaders, int fileType, bool beautifier)
+{
+ nonParenHeaders->push_back(&AS_ELSE);
+ nonParenHeaders->push_back(&AS_DO);
+ nonParenHeaders->push_back(&AS_TRY);
+
+ if (fileType == JAVA_TYPE)
+ {
+ nonParenHeaders->push_back(&AS_FINALLY);
+ }
+
+ if (fileType == SHARP_TYPE)
+ {
+ nonParenHeaders->push_back(&AS_CATCH); // can be a paren or non-paren header
+ nonParenHeaders->push_back(&AS_FINALLY);
+// nonParenHeaders->push_back(&AS_UNSAFE);
+ nonParenHeaders->push_back(&AS_GET);
+ nonParenHeaders->push_back(&AS_SET);
+ nonParenHeaders->push_back(&AS_ADD);
+ nonParenHeaders->push_back(&AS_REMOVE);
+ }
+
+ if (beautifier)
+ {
+ nonParenHeaders->push_back(&AS_CASE);
+ nonParenHeaders->push_back(&AS_DEFAULT);
+ if (fileType == C_TYPE)
+ {
+ nonParenHeaders->push_back(&AS_CONST);
+ nonParenHeaders->push_back(&AS_TEMPLATE);
+ }
+ if (fileType == JAVA_TYPE)
+ {
+ nonParenHeaders->push_back(&AS_STATIC);
+ }
+ }
+ sort(nonParenHeaders->begin(), nonParenHeaders->end(), sortOnName);
+}
+
+/**
+ * Build the vector of operators.
+ * Used by ONLY ASFormatter.cpp
+ *
+ * @param operators a reference to the vector to be built.
+ */
+void ASResource::buildOperators(vector<const string*>* operators)
+{
+ operators->push_back(&AS_PLUS_ASSIGN);
+ operators->push_back(&AS_MINUS_ASSIGN);
+ operators->push_back(&AS_MULT_ASSIGN);
+ operators->push_back(&AS_DIV_ASSIGN);
+ operators->push_back(&AS_MOD_ASSIGN);
+ operators->push_back(&AS_OR_ASSIGN);
+ operators->push_back(&AS_AND_ASSIGN);
+ operators->push_back(&AS_XOR_ASSIGN);
+ operators->push_back(&AS_EQUAL);
+ operators->push_back(&AS_PLUS_PLUS);
+ operators->push_back(&AS_MINUS_MINUS);
+ operators->push_back(&AS_NOT_EQUAL);
+ operators->push_back(&AS_GR_EQUAL);
+ operators->push_back(&AS_GR_GR_GR_ASSIGN);
+ operators->push_back(&AS_GR_GR_ASSIGN);
+ operators->push_back(&AS_GR_GR_GR);
+ operators->push_back(&AS_GR_GR);
+ operators->push_back(&AS_LS_EQUAL);
+ operators->push_back(&AS_LS_LS_LS_ASSIGN);
+ operators->push_back(&AS_LS_LS_ASSIGN);
+ operators->push_back(&AS_LS_LS_LS);
+ operators->push_back(&AS_LS_LS);
+ operators->push_back(&AS_QUESTION_QUESTION);
+ operators->push_back(&AS_EQUAL_GR);
+ operators->push_back(&AS_GCC_MIN_ASSIGN);
+ operators->push_back(&AS_GCC_MAX_ASSIGN);
+ operators->push_back(&AS_ARROW);
+ operators->push_back(&AS_AND);
+ operators->push_back(&AS_OR);
+ operators->push_back(&AS_COLON_COLON);
+ operators->push_back(&AS_PLUS);
+ operators->push_back(&AS_MINUS);
+ operators->push_back(&AS_MULT);
+ operators->push_back(&AS_DIV);
+ operators->push_back(&AS_MOD);
+ operators->push_back(&AS_QUESTION);
+ operators->push_back(&AS_COLON);
+ operators->push_back(&AS_ASSIGN);
+ operators->push_back(&AS_LS);
+ operators->push_back(&AS_GR);
+ operators->push_back(&AS_NOT);
+ operators->push_back(&AS_BIT_OR);
+ operators->push_back(&AS_BIT_AND);
+ operators->push_back(&AS_BIT_NOT);
+ operators->push_back(&AS_BIT_XOR);
+
+ sort(operators->begin(), operators->end(), sortOnLength);
+}
+
+/**
+ * Build the vector of pre-block statements.
+ * Used by ONLY ASBeautifier.cpp
+ * NOTE: Cannot be both a header and a preBlockStatement.
+ *
+ * @param preBlockStatements a reference to the vector to be built.
+ */
+void ASResource::buildPreBlockStatements(vector<const string*>* preBlockStatements, int fileType)
+{
+ preBlockStatements->push_back(&AS_CLASS);
+ if (fileType == C_TYPE)
+ {
+ preBlockStatements->push_back(&AS_STRUCT);
+ preBlockStatements->push_back(&AS_UNION);
+ preBlockStatements->push_back(&AS_NAMESPACE);
+ }
+ if (fileType == JAVA_TYPE)
+ {
+ preBlockStatements->push_back(&AS_INTERFACE);
+ preBlockStatements->push_back(&AS_THROWS);
+ }
+ if (fileType == SHARP_TYPE)
+ {
+ preBlockStatements->push_back(&AS_INTERFACE);
+ preBlockStatements->push_back(&AS_NAMESPACE);
+ preBlockStatements->push_back(&AS_WHERE);
+ preBlockStatements->push_back(&AS_STRUCT);
+ }
+ sort(preBlockStatements->begin(), preBlockStatements->end(), sortOnName);
+}
+
+/**
+ * Build the vector of pre-command headers.
+ * Used by ONLY ASFormatter.cpp
+ *
+ * @param preCommandHeaders a reference to the vector to be built.
+ */
+void ASResource::buildPreCommandHeaders(vector<const string*>* preCommandHeaders, int fileType)
+{
+ if (fileType == C_TYPE)
+ {
+ preCommandHeaders->push_back(&AS_CONST);
+ }
+
+ if (fileType == JAVA_TYPE)
+ {
+ preCommandHeaders->push_back(&AS_THROWS);
+ }
+
+ if (fileType == SHARP_TYPE)
+ {
+ preCommandHeaders->push_back(&AS_WHERE);
+ }
+
+ sort(preCommandHeaders->begin(), preCommandHeaders->end(), sortOnName);
+}
+
+/**
+ * Build the vector of pre-definition headers.
+ * Used by ONLY ASFormatter.cpp
+ * NOTE: Do NOT add 'enum' here. It is an array type bracket.
+ * NOTE: Do NOT add 'extern' here. Do not want an extra indent.
+ *
+ * @param preDefinitionHeaders a reference to the vector to be built.
+ */
+void ASResource::buildPreDefinitionHeaders(vector<const string*>* preDefinitionHeaders, int fileType)
+{
+ preDefinitionHeaders->push_back(&AS_CLASS);
+ if (fileType == C_TYPE)
+ {
+ preDefinitionHeaders->push_back(&AS_STRUCT);
+ preDefinitionHeaders->push_back(&AS_UNION);
+ preDefinitionHeaders->push_back(&AS_NAMESPACE);
+ }
+ if (fileType == JAVA_TYPE)
+ {
+ preDefinitionHeaders->push_back(&AS_INTERFACE);
+ }
+ if (fileType == SHARP_TYPE)
+ {
+ preDefinitionHeaders->push_back(&AS_STRUCT);
+ preDefinitionHeaders->push_back(&AS_INTERFACE);
+ preDefinitionHeaders->push_back(&AS_NAMESPACE);
+ }
+ sort(preDefinitionHeaders->begin(), preDefinitionHeaders->end(), sortOnName);
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * ASBase Funtions
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+// check if a specific line position contains a keyword.
+bool ASBase::findKeyword(const string &line, int i, const string &keyword) const
+{
+ assert(isCharPotentialHeader(line, i));
+ // check the word
+ const size_t keywordLength = keyword.length();
+ const size_t wordEnd = i + keywordLength;
+ if (wordEnd > line.length())
+ return false;
+ if (line.compare(i, keywordLength, keyword) != 0)
+ return false;
+ // check that this is not part of a longer word
+ if (wordEnd == line.length())
+ return true;
+ if (isLegalNameChar(line[wordEnd]))
+ return false;
+ // is not a keyword if part of a definition
+ const char peekChar = peekNextChar(line, wordEnd - 1);
+ if (peekChar == ',' || peekChar == ')')
+ return false;
+ return true;
+}
+
+// get the current word on a line
+// index must point to the beginning of the word
+string ASBase::getCurrentWord(const string& line, size_t index) const
+{
+ assert(isCharPotentialHeader(line, index));
+ size_t lineLength = line.length();
+ size_t i;
+ for (i = index; i < lineLength; i++)
+ {
+ if (!isLegalNameChar(line[i]))
+ break;
+ }
+ return line.substr(index, i - index);
+}
+
+} // end namespace astyle
diff --git a/support/highlight/src/core/astyle/ASStreamIterator.cpp b/support/highlight/src/core/astyle/ASStreamIterator.cpp
new file mode 100644
index 0000000000..fe1cbee37c
--- /dev/null
+++ b/support/highlight/src/core/astyle/ASStreamIterator.cpp
@@ -0,0 +1,167 @@
+
+#include "ASStreamIterator.h"
+
+namespace astyle
+{
+
+
+ASStreamIterator::ASStreamIterator(istream *in)
+{
+ inStream = in;
+ buffer.reserve(200);
+ eolWindows = eolLinux = eolMacOld = 0;
+ peekStart = 0;
+ prevLineDeleted = false;
+ checkForEmptyLine = false;
+}
+
+
+ASStreamIterator::~ASStreamIterator()
+{
+}
+
+// save the last input line after input has reached EOF
+
+void ASStreamIterator::saveLastInputLine()
+{
+ assert(inStream->eof());
+ prevBuffer = buffer;
+}
+
+/**
+ * read the input stream, delete any end of line characters,
+ * and build a string that contains the input line.
+ *
+ * @return string containing the next input line minus any end of line characters
+ */
+//template<typename T>
+string ASStreamIterator::nextLine(bool emptyLineWasDeleted)
+{
+ // verify that the current position is correct
+ assert (peekStart == 0);
+
+ // a deleted line may be replaced if break-blocks is requested
+ // this sets up the compare to check for a replaced empty line
+ if (prevLineDeleted)
+ {
+ prevLineDeleted = false;
+ checkForEmptyLine = true;
+ }
+ if (!emptyLineWasDeleted)
+ prevBuffer = buffer;
+ else
+ prevLineDeleted = true;
+
+ // read the next record
+ buffer.clear();
+ char ch;
+ inStream->get(ch);
+
+ while (!inStream->eof() && ch != '\n' && ch != '\r')
+ {
+ buffer.append(1, ch);
+ inStream->get(ch);
+ }
+
+ if (inStream->eof())
+ {
+ return buffer;
+ }
+
+ int peekCh = inStream->peek();
+
+ // find input end-of-line characters
+ if (!inStream->eof())
+ {
+ if (ch == '\r') // CR+LF is windows otherwise Mac OS 9
+ {
+ if (peekCh == '\n')
+ {
+ inStream->get(ch);
+ eolWindows++;
+ }
+ else
+ eolMacOld++;
+ }
+ else // LF is Linux, allow for improbable LF/CR
+ {
+ if (peekCh == '\r')
+ {
+ inStream->get(ch);
+ eolWindows++;
+ }
+ else
+ eolLinux++;
+ }
+ }
+ else
+ {
+ inStream->clear();
+ }
+
+ // set output end of line characters
+ if (eolWindows >= eolLinux)
+ {
+ if (eolWindows >= eolMacOld)
+ strcpy(outputEOL, "\r\n"); // Windows (CR+LF)
+ else
+ strcpy(outputEOL, "\r"); // MacOld (CR)
+ }
+ else if (eolLinux >= eolMacOld)
+ strcpy(outputEOL, "\n"); // Linux (LF)
+ else
+ strcpy(outputEOL, "\r"); // MacOld (CR)
+
+ return buffer;
+}
+
+// save the current position and get the next line
+// this can be called for multiple reads
+// when finished peeking you MUST call peekReset()
+// call this function from ASFormatter ONLY
+//template<typename T>
+string ASStreamIterator::peekNextLine()
+{
+ assert (hasMoreLines());
+ string nextLine;
+ char ch;
+
+ if (peekStart == 0)
+ peekStart = inStream->tellg();
+
+ // read the next record
+ inStream->get(ch);
+ while (!inStream->eof() && ch != '\n' && ch != '\r')
+ {
+ nextLine.append(1, ch);
+ inStream->get(ch);
+ }
+
+ if (inStream->eof())
+ {
+ return nextLine;
+ }
+
+ int peekCh = inStream->peek();
+
+ // remove end-of-line characters
+ if (!inStream->eof())
+ {
+ if ((peekCh == '\n' || peekCh == '\r') && peekCh != ch) ///////////// changed //////////
+ inStream->get(ch);
+ }
+
+ return nextLine;
+}
+
+// reset current position and EOF for peekNextLine()
+//template<typename T>
+void ASStreamIterator::peekReset()
+{
+ assert(peekStart != 0);
+ inStream->clear();
+ inStream->seekg(peekStart);
+ peekStart = 0;
+}
+
+}
diff --git a/support/highlight/src/core/astyle/ASStreamIterator.h b/support/highlight/src/core/astyle/ASStreamIterator.h
new file mode 100644
index 0000000000..3065895d8a
--- /dev/null
+++ b/support/highlight/src/core/astyle/ASStreamIterator.h
@@ -0,0 +1,101 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Copyright (C) 2006-2008 by Jim Pattee <jimp03@email.com>
+ * Copyright (C) 1998-2002 by Tal Davidson
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>
+ *
+ * This file is a part of Artistic Style - an indentation and
+ * reformatting tool for C, C++, C# and Java source files.
+ * <http://astyle.sourceforge.net>
+ *
+ * Artistic Style is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Artistic Style is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Artistic Style. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ */
+
+
+#ifndef ASSTREAMITERATOR_H
+#define ASSTREAMITERATOR_H
+
+#include "astyle.h"
+#include <iostream>
+
+namespace astyle
+{
+
+class ASStreamIterator : public ASSourceIterator
+{
+ public:
+ bool checkForEmptyLine;
+
+ // function declarations
+ ASStreamIterator(istream *in);
+ virtual ~ASStreamIterator();
+ string nextLine(bool emptyLineWasDeleted);
+ string peekNextLine();
+ void peekReset();
+ void saveLastInputLine();
+
+ // inline functions
+ bool compareToInputBuffer(const string &nextLine) const { return nextLine == prevBuffer; }
+ const char* getOutputEOL() const { return outputEOL; }
+ bool hasMoreLines() const { return !inStream->eof(); }
+
+ private:
+ istream * inStream; // pointer to the input stream
+ string buffer; // current input line
+ string prevBuffer; // previous input line
+ int eolWindows; // number of Windows line endings (CRLF)
+ int eolLinux; // number of Linux line endings (LF)
+ int eolMacOld; // number of old Mac line endings (CR)
+ int peekStart; // starting position for peekNextLine()
+ char outputEOL[4]; // output end of line char
+ bool prevLineDeleted; // the previous input line was deleted
+};
+
+/*
+
+// typename will be istringstream for GUI and istream otherwise
+//template<typename T>
+class ASStreamIterator :
+ public ASSourceIterator
+{
+ public:
+ // function declarations
+ ASStreamIterator(istream *in);
+ virtual ~ASStreamIterator();
+ string nextLine();
+ string peekNextLine();
+ void peekReset();
+ void saveLastInputLine();
+
+ // inline functions
+ bool compareToInputBuffer(const string &nextLine) const { return nextLine == prevBuffer; }
+ const char* getOutputEOL() const { return outputEOL; }
+ bool hasMoreLines() const { return !inStream->eof(); }
+
+ private:
+ istream* inStream; // pointer to the input stream
+ string buffer; // current input line
+ string prevBuffer; // previous input line
+ int eolWindows; // number of Windows line endings (CRLF)
+ int eolLinux; // number of Linux line endings (LF)
+ int eolMacOld; // number of old Mac line endings (CR)
+ char outputEOL[4]; // output end of line char
+ int peekStart; // starting position for peekNextLine()
+};
+*/
+}
+
+#endif
diff --git a/support/highlight/src/core/astyle/astyle.h b/support/highlight/src/core/astyle/astyle.h
new file mode 100644
index 0000000000..d3a7c3174d
--- /dev/null
+++ b/support/highlight/src/core/astyle/astyle.h
@@ -0,0 +1,802 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Copyright (C) 2006-2010 by Jim Pattee <jimp03@email.com>
+ * Copyright (C) 1998-2002 by Tal Davidson
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>
+ *
+ * This file is a part of Artistic Style - an indentation and
+ * reformatting tool for C, C++, C# and Java source files.
+ * <http://astyle.sourceforge.net>
+ *
+ * Artistic Style is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Artistic Style is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Artistic Style. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ */
+
+#ifndef ASTYLE_H
+#define ASTYLE_H
+
+#ifdef __VMS
+#define __USE_STD_IOSTREAM 1
+#include <assert>
+#else
+#include <cassert>
+#endif
+
+#include <string.h> // need both string and string.h for GCC
+#include <string>
+#include <vector>
+#include <cctype>
+
+#ifdef _WIN32
+#define STDCALL __stdcall
+#define EXPORT __declspec(dllexport)
+#else
+#define STDCALL
+#define EXPORT
+#endif
+
+#ifdef _MSC_VER
+#pragma warning(disable: 4996) // secure version deprecation warnings
+#pragma warning(disable: 4267) // 64 bit signed/unsigned loss of data
+#endif
+
+#ifdef __BORLANDC__
+#pragma warn -aus // variable is assigned a value that is never used in function.
+#endif
+
+#ifdef __INTEL_COMPILER
+#pragma warning(disable: 383) // value copied to temporary, reference to temporary used
+#pragma warning(disable: 444) // destructor for base class is not virtual
+#pragma warning(disable: 981) // operands are evaluated in unspecified order
+#endif
+
+using namespace std;
+
+namespace astyle
+{
+
+enum FileType { C_TYPE=0, JAVA_TYPE=1, SHARP_TYPE=2 };
+
+/* The enums below are not recognized by 'vectors' in Microsoft Visual C++
+ V5 when they are part of a namespace!!! Use Visual C++ V6 or higher.
+*/
+enum FormatStyle { STYLE_NONE,
+ STYLE_ALLMAN,
+ STYLE_JAVA,
+ STYLE_KandR,
+ STYLE_STROUSTRUP,
+ STYLE_WHITESMITH,
+ STYLE_BANNER,
+ STYLE_GNU,
+ STYLE_LINUX,
+ STYLE_HORSTMANN,
+ STYLE_1TBS
+ };
+
+enum BracketMode { NONE_MODE,
+ ATTACH_MODE,
+ BREAK_MODE,
+ LINUX_MODE,
+ STROUSTRUP_MODE,
+ HORSTMANN_MODE,
+ BDAC_MODE = LINUX_MODE
+ };
+
+enum BracketType { NULL_TYPE = 0,
+ NAMESPACE_TYPE = 1, // also a DEFINITION_TYPE
+ CLASS_TYPE = 2, // also a DEFINITION_TYPE
+ STRUCT_TYPE = 4, // also a DEFINITION_TYPE
+ INTERFACE_TYPE = 8, // also a DEFINITION_TYPE
+ DEFINITION_TYPE = 16,
+ COMMAND_TYPE = 32,
+ ARRAY_NIS_TYPE = 64, // also an ARRAY_TYPE
+ ARRAY_TYPE = 128, // arrays and enums
+ EXTERN_TYPE = 256, // extern "C". not a command type extern
+ SINGLE_LINE_TYPE = 512
+ };
+
+enum PointerAlign { ALIGN_NONE,
+ ALIGN_TYPE,
+ ALIGN_MIDDLE,
+ ALIGN_NAME
+ };
+
+enum FileEncoding { ENCODING_OK,
+ UTF_16BE,
+ UTF_16LE,
+ UTF_32BE,
+ UTF_32LE
+ };
+
+enum LineEndFormat { LINEEND_DEFAULT, // Use line break that matches most of the file
+ LINEEND_WINDOWS,
+ LINEEND_LINUX,
+ LINEEND_MACOLD,
+ LINEEND_CRLF = LINEEND_WINDOWS,
+ LINEEND_LF = LINEEND_LINUX,
+ LINEEND_CR = LINEEND_MACOLD
+ };
+
+
+//----------------------------------------------------------------------------
+// Class ASSourceIterator
+// A pure virtual class is used by ASFormatter and ASBeautifier instead of
+// ASStreamIterator. This allows programs using AStyle as a plugin to define
+// their own ASStreamIterator. The ASStreamIterator class must inherit
+// this class.
+//----------------------------------------------------------------------------
+
+class ASSourceIterator
+{
+ public:
+ ASSourceIterator() {}
+ virtual ~ASSourceIterator() {}
+ virtual bool hasMoreLines() const = 0;
+ virtual string nextLine(bool emptyLineWasDeleted = false) = 0;
+ virtual string peekNextLine() = 0;
+ virtual void peekReset() = 0;
+};
+
+//----------------------------------------------------------------------------
+// Class ASResource
+//----------------------------------------------------------------------------
+
+class ASResource
+{
+ public:
+ void buildAssignmentOperators(vector<const string*>* assignmentOperators);
+ void buildCastOperators(vector<const string*>* castOperators);
+ void buildHeaders(vector<const string*>* headers, int fileType, bool beautifier=false);
+ void buildIndentableHeaders(vector<const string*>* indentableHeaders);
+ void buildNonAssignmentOperators(vector<const string*>* nonAssignmentOperators);
+ void buildNonParenHeaders(vector<const string*>* nonParenHeaders, int fileType, bool beautifier=false);
+ void buildOperators(vector<const string*>* operators);
+ void buildPreBlockStatements(vector<const string*>* preBlockStatements, int fileType);
+ void buildPreCommandHeaders(vector<const string*>* preCommandHeaders, int fileType);
+ void buildPreDefinitionHeaders(vector<const string*>* preDefinitionHeaders, int fileType);
+
+ public:
+ static const string AS_IF, AS_ELSE;
+ static const string AS_DO, AS_WHILE;
+ static const string AS_FOR;
+ static const string AS_SWITCH, AS_CASE, AS_DEFAULT;
+ static const string AS_TRY, AS_CATCH, AS_THROWS, AS_FINALLY;
+ static const string AS_PUBLIC, AS_PROTECTED, AS_PRIVATE;
+ static const string AS_CLASS, AS_STRUCT, AS_UNION, AS_INTERFACE, AS_NAMESPACE;
+ static const string AS_EXTERN, AS_ENUM;
+ static const string AS_STATIC, AS_CONST, AS_WHERE, AS_NEW;
+ static const string AS_SYNCHRONIZED;
+ static const string AS_OPERATOR, AS_TEMPLATE;
+ static const string AS_OPEN_BRACKET, AS_CLOSE_BRACKET;
+ static const string AS_OPEN_LINE_COMMENT, AS_OPEN_COMMENT, AS_CLOSE_COMMENT;
+ static const string AS_BAR_DEFINE, AS_BAR_INCLUDE, AS_BAR_IF, AS_BAR_EL, AS_BAR_ENDIF;
+ static const string AS_RETURN;
+ static const string AS_CIN, AS_COUT, AS_CERR;
+ static const string AS_ASSIGN, AS_PLUS_ASSIGN, AS_MINUS_ASSIGN, AS_MULT_ASSIGN;
+ static const string AS_DIV_ASSIGN, AS_MOD_ASSIGN, AS_XOR_ASSIGN, AS_OR_ASSIGN, AS_AND_ASSIGN;
+ static const string AS_GR_GR_ASSIGN, AS_LS_LS_ASSIGN, AS_GR_GR_GR_ASSIGN, AS_LS_LS_LS_ASSIGN;
+ static const string AS_GCC_MIN_ASSIGN, AS_GCC_MAX_ASSIGN;
+ static const string AS_EQUAL, AS_PLUS_PLUS, AS_MINUS_MINUS, AS_NOT_EQUAL, AS_GR_EQUAL, AS_GR_GR_GR, AS_GR_GR;
+ static const string AS_LS_EQUAL, AS_LS_LS_LS, AS_LS_LS;
+ static const string AS_QUESTION_QUESTION, AS_EQUAL_GR;
+ static const string AS_ARROW, AS_AND, AS_OR;
+ static const string AS_COLON_COLON, AS_PAREN_PAREN, AS_BLPAREN_BLPAREN;
+ static const string AS_PLUS, AS_MINUS, AS_MULT, AS_DIV, AS_MOD, AS_GR, AS_LS;
+ static const string AS_NOT, AS_BIT_XOR, AS_BIT_OR, AS_BIT_AND, AS_BIT_NOT;
+ static const string AS_QUESTION, AS_COLON, AS_SEMICOLON, AS_COMMA;
+ static const string AS_ASM, AS__ASM__, AS_MS_ASM, AS_MS__ASM;
+ static const string AS_FOREACH, AS_LOCK, AS_UNSAFE, AS_FIXED;
+ static const string AS_GET, AS_SET, AS_ADD, AS_REMOVE;
+ static const string AS_DELEGATE, AS_UNCHECKED;
+ static const string AS_CONST_CAST, AS_DYNAMIC_CAST, AS_REINTERPRET_CAST, AS_STATIC_CAST;
+}; // Class ASResource
+
+//----------------------------------------------------------------------------
+// Class ASBase
+//----------------------------------------------------------------------------
+
+class ASBase
+{
+ private:
+ // all variables should be set by the "init" function
+ int baseFileType; // a value from enum FileType
+
+ protected:
+ ASBase() { baseFileType = C_TYPE; }
+ ~ASBase() {}
+
+ // functions definitions are at the end of ASResource.cpp
+ bool findKeyword(const string &line, int i, const string &keyword) const;
+ string getCurrentWord(const string& line, size_t index) const;
+
+ protected:
+
+ void init(int fileTypeArg) { baseFileType = fileTypeArg; }
+ bool isCStyle() const { return (baseFileType == C_TYPE); }
+ bool isJavaStyle() const { return (baseFileType == JAVA_TYPE); }
+ bool isSharpStyle() const { return (baseFileType == SHARP_TYPE); }
+
+ // check if a specific character can be used in a legal variable/method/class name
+ bool isLegalNameChar(char ch) const {
+ if (isWhiteSpace(ch)) return false;
+ if ((unsigned) ch > 127) return false;
+ return (isalnum(ch)
+ || ch == '.' || ch == '_'
+ || (isJavaStyle() && ch == '$')
+ || (isSharpStyle() && ch == '@')); // may be used as a prefix
+ }
+
+ // check if a specific character can be part of a header
+ bool isCharPotentialHeader(const string &line, size_t i) const {
+ assert(!isWhiteSpace(line[i]));
+ char prevCh = ' ';
+ if (i > 0) prevCh = line[i-1];
+ if (!isLegalNameChar(prevCh) && isLegalNameChar(line[i]))
+ return true;
+ return false;
+ }
+
+ // check if a specific character can be part of an operator
+ bool isCharPotentialOperator(char ch) const {
+ assert(!isWhiteSpace(ch));
+ if ((unsigned) ch > 127) return false;
+ return (ispunct(ch)
+ && ch != '{' && ch != '}'
+ && ch != '(' && ch != ')'
+ && ch != '[' && ch != ']'
+ && ch != ';' && ch != ','
+ && ch != '#' && ch != '\\'
+ && ch != '\'' && ch != '\"');
+ }
+
+ // check if a specific character is a whitespace character
+ bool isWhiteSpace(char ch) const { return (ch == ' ' || ch == '\t'); }
+
+ // peek at the next unread character.
+ char peekNextChar(const string &line, int i) const {
+ char ch = ' ';
+ size_t peekNum = line.find_first_not_of(" \t", i + 1);
+ if (peekNum == string::npos)
+ return ch;
+ ch = line[peekNum];
+ return ch;
+ }
+}; // Class ASBase
+
+//----------------------------------------------------------------------------
+// Class ASBeautifier
+//----------------------------------------------------------------------------
+
+class ASBeautifier : protected ASResource, protected ASBase
+{
+ public:
+ ASBeautifier();
+ virtual ~ASBeautifier();
+ virtual void init(ASSourceIterator* iter);
+ void init();
+ virtual bool hasMoreLines() const;
+ virtual string nextLine();
+ virtual string beautify(const string &line);
+ void deleteVector(vector<const string*>*& container);
+ void initVector(vector<const string*>*& container);
+ void setTabIndentation(int length = 4, bool forceTabs = false);
+ void setSpaceIndentation(int length = 4);
+ void setMaxInStatementIndentLength(int max);
+ void setMinConditionalIndentLength(int min);
+ void setIndentManuallySet(bool state);
+ void setMinConditionalManuallySet(bool state);
+ void setModeManuallySet(bool state);
+ void setClassIndent(bool state);
+ void setSwitchIndent(bool state);
+ void setCaseIndent(bool state);
+ void setBracketIndent(bool state);
+ void setBlockIndent(bool state);
+ void setNamespaceIndent(bool state);
+ void setLabelIndent(bool state);
+ void setCStyle();
+ void setJavaStyle();
+ void setSharpStyle();
+ void setEmptyLineFill(bool state);
+ void setPreprocessorIndent(bool state);
+ int getFileType();
+ int getIndentLength(void);
+ string getIndentString(void);
+ bool getBracketIndent(void);
+ bool getBlockIndent(void);
+ bool getCaseIndent(void);
+ bool getClassIndent(void);
+ bool getEmptyLineFill(void);
+ bool getForceTabIndentation(void);
+ bool getIndentManuallySet(void);
+ bool getMinConditionalManuallySet(void);
+ bool getModeManuallySet(void);
+ bool getSwitchIndent(void);
+
+ protected:
+ void deleteStaticVectors();
+ const string* findHeader(const string &line, int i,
+ const vector<const string*>* possibleHeaders) const;
+ const string* findOperator(const string &line, int i,
+ const vector<const string*>* possibleOperators) const;
+ int getNextProgramCharDistance(const string &line, int i) const;
+ int indexOf(vector<const string*> &container, const string *element);
+ string trim(const string &str);
+
+ // variables set by ASFormatter - must be updated in activeBeautifierStack
+ int inLineNumber;
+ int horstmannIndentInStatement;
+ int nonInStatementBracket;
+ bool lineCommentNoBeautify;
+ bool isNonInStatementArray;
+ bool isSharpAccessor;
+ bool isSharpDelegate;
+ bool isInExtern;
+ bool isInBeautifySQL;
+ bool isInIndentableStruct;
+
+ private:
+ ASBeautifier(const ASBeautifier &copy);
+ ASBeautifier& operator=(ASBeautifier&); // not to be implemented
+
+ void initStatic();
+ void registerInStatementIndent(const string &line, int i, int spaceTabCount,
+ int tabIncrementIn, int minIndent, bool updateParenStack);
+ string preLineWS(int spaceTabCount, int tabCount);
+
+ static int beautifierFileType;
+ static vector<const string*>* headers;
+ static vector<const string*>* nonParenHeaders;
+ static vector<const string*>* preBlockStatements;
+ static vector<const string*>* assignmentOperators;
+ static vector<const string*>* nonAssignmentOperators;
+ static vector<const string*>* indentableHeaders;
+
+ ASSourceIterator *sourceIterator;
+ vector<ASBeautifier*> *waitingBeautifierStack;
+ vector<ASBeautifier*> *activeBeautifierStack;
+ vector<int> *waitingBeautifierStackLengthStack;
+ vector<int> *activeBeautifierStackLengthStack;
+ vector<const string*> *headerStack;
+ vector< vector<const string*>* > *tempStacks;
+ vector<int> *blockParenDepthStack;
+ vector<bool> *blockStatementStack;
+ vector<bool> *parenStatementStack;
+ vector<bool> *bracketBlockStateStack;
+ vector<int> *inStatementIndentStack;
+ vector<int> *inStatementIndentStackSizeStack;
+ vector<int> *parenIndentStack;
+ int convertTabToSpaces(int i, int tabIncrementIn) const;
+ int getInStatementIndentAssign(const string& line, size_t currPos) const;
+ int getInStatementIndentComma(const string& line, size_t currPos) const;
+ bool isClassAccessModifier(string& line) const;
+ bool isLineEndComment(string& line, int startPos) const;
+ bool statementEndsWithComma(string &line, int index);
+ vector<vector<const string*>*>* copyTempStacks(const ASBeautifier &other) const;
+ template<typename T> void deleteContainer(T &container);
+ void deleteContainer(vector<vector<const string*>*>* &container);
+ template<typename T> void initContainer(T &container, T value);
+
+ private: // variables
+ string indentString;
+ const string *currentHeader;
+ const string *previousLastLineHeader;
+ const string *probationHeader;
+ bool isInQuote;
+ bool isInVerbatimQuote;
+ bool haveLineContinuationChar;
+ bool isInAsm;
+ bool isInAsmOneLine;
+ bool isInAsmBlock;
+ bool isInComment;
+ bool isInHorstmannComment;
+ bool isInCase;
+ bool isInQuestion;
+ bool isInStatement;
+ bool isInHeader;
+ bool isInTemplate;
+ bool isInDefine;
+ bool isInDefineDefinition;
+ bool classIndent;
+ bool isInClassInitializer;
+ bool isInClassHeaderTab;
+ bool isInEnum;
+ bool switchIndent;
+ bool caseIndent;
+ bool namespaceIndent;
+ bool bracketIndent;
+ bool blockIndent;
+ bool labelIndent;
+ bool preprocessorIndent;
+ bool isInConditional;
+ bool isIndentManuallySet;
+ bool isMinConditionalManuallySet;
+ bool isModeManuallySet;
+ bool shouldForceTabIndentation;
+ bool emptyLineFill;
+ bool backslashEndsPrevLine;
+ bool lineOpensComment;
+ bool blockCommentNoIndent;
+ bool blockCommentNoBeautify;
+ bool previousLineProbationTab;
+ int fileType;
+ int minConditionalIndent;
+ int parenDepth;
+ int indentLength;
+ int blockTabCount;
+ int maxInStatementIndent;
+ int classInitializerTabs;
+ int templateDepth;
+ int prevFinalLineSpaceTabCount;
+ int prevFinalLineTabCount;
+ int defineTabCount;
+ char quoteChar;
+ char prevNonSpaceCh;
+ char currentNonSpaceCh;
+ char currentNonLegalCh;
+ char prevNonLegalCh;
+}; // Class ASBeautifier
+
+//----------------------------------------------------------------------------
+// Class ASEnhancer
+//----------------------------------------------------------------------------
+
+class ASEnhancer : protected ASBase
+{
+ public: // functions
+ ASEnhancer();
+ ~ASEnhancer();
+ void init(int, int, string, bool, bool);
+ void enhance(string &line, bool isInSQL);
+
+ private:
+ // options from command line or options file
+ int indentLength;
+ bool useTabs;
+ bool caseIndent;
+ bool emptyLineFill;
+
+ // parsing variables
+ int lineNumber;
+ bool isInQuote;
+ bool isInComment;
+ char quoteChar;
+
+ // unindent variables
+ int bracketCount;
+ int switchDepth;
+ bool lookingForCaseBracket;
+ bool unindentNextLine;
+
+ // struct used by ParseFormattedLine function
+ // contains variables used to unindent the case blocks
+ struct switchVariables {
+ int switchBracketCount;
+ int unindentDepth;
+ bool unindentCase;
+ };
+
+ switchVariables sw; // switch variables struct
+ vector<switchVariables> swVector; // stack vector of switch variables
+
+ // event table variables
+ bool nextLineIsEventIndent; // begin event table indent is reached
+ bool isInEventTable; // need to indent an event table
+
+ // SQL variables
+ bool nextLineIsDeclareIndent; // begin declare section indent is reached
+ bool isInDeclareSection; // need to indent a declare section
+
+
+ private: // functions
+ size_t findCaseColon(string &line, size_t caseIndex) const;
+ int indentLine(string &line, int indent) const;
+ bool isBeginDeclareSectionSQL(string &line, size_t index) const;
+ bool isEndDeclareSectionSQL(string &line, size_t index) const;
+ size_t processSwitchBlock(string &line, size_t index);
+ int unindentLine(string &line, int unindent) const;
+}; // Class ASEnhancer
+
+//----------------------------------------------------------------------------
+// Class ASFormatter
+//----------------------------------------------------------------------------
+
+class ASFormatter : public ASBeautifier
+{
+ public: // functions
+ ASFormatter();
+ virtual ~ASFormatter();
+ virtual void init(ASSourceIterator* iter);
+ virtual bool hasMoreLines() const;
+ virtual string nextLine();
+ LineEndFormat getLineEndFormat() const;
+ void setFormattingStyle(FormatStyle style);
+ void setAddBracketsMode(bool state);
+ void setAddOneLineBracketsMode(bool state);
+ void setBracketFormatMode(BracketMode mode);
+ void setBreakClosingHeaderBracketsMode(bool state);
+ void setBreakBlocksMode(bool state);
+ void setBreakClosingHeaderBlocksMode(bool state);
+ void setBreakElseIfsMode(bool state);
+ void setBreakOneLineBlocksMode(bool state);
+ void setDeleteEmptyLinesMode(bool state);
+ void setIndentCol1CommentsMode(bool state);
+ void setLineEndFormat(LineEndFormat fmt);
+ void setOperatorPaddingMode(bool mode);
+ void setParensOutsidePaddingMode(bool mode);
+ void setParensInsidePaddingMode(bool mode);
+ void setParensHeaderPaddingMode(bool mode);
+ void setParensUnPaddingMode(bool state);
+ void setPointerAlignment(PointerAlign alignment);
+ void setSingleStatementsMode(bool state);
+ void setTabSpaceConversionMode(bool state);
+
+ private: // functions
+ void ASformatter(ASFormatter &copy); // not to be imlpemented
+ ASFormatter& operator=(ASFormatter&); // not to be implemented
+ template<typename T> void deleteContainer(T &container);
+ template<typename T> void initContainer(T &container, T value);
+ char peekNextChar() const;
+ BracketType getBracketType();
+ bool addBracketsToStatement();
+ bool commentAndHeaderFollows() const;
+ bool getNextChar();
+ bool getNextLine(bool emptyLineWasDeleted = false);
+ bool isBeforeComment() const;
+ bool isBeforeAnyComment() const;
+ bool isBeforeAnyLineEndComment(int startPos) const;
+ bool isBeforeMultipleLineEndComments(int startPos) const;
+ bool isBracketType(BracketType a, BracketType b) const;
+ bool isCurrentBracketBroken() const;
+ bool isDereferenceOrAddressOf() const;
+ bool isExecSQL(string &line, size_t index) const;
+ bool isEmptyLine(const string &line) const;
+ bool isNextWordSharpNonParenHeader(int startChar) const;
+ bool isNonInStatementArrayBracket() const;
+ bool isPointerOrReference() const;
+ bool isPointerOrReferenceCentered() const;
+ bool isSharpStyleWithParen(const string* header) const;
+ bool isStructAccessModified(string &firstLine, size_t index) const;
+ bool isUnaryOperator() const;
+ bool isInExponent() const;
+ bool isOneLineBlockReached(string& line, int startChar) const;
+ bool isNextCharOpeningBracket(int startChar) const;
+ bool isOkToBreakBlock(BracketType bracketType) const;
+ int getCurrentLineCommentAdjustment();
+ int getNextLineCommentAdjustment();
+ void appendCharInsideComments();
+ void appendSequence(const string &sequence, bool canBreakLine = true);
+ void appendSpacePad();
+ void appendSpaceAfter();
+ void breakLine();
+ void buildLanguageVectors();
+ void checkForFollowingHeader(const string& firstLine);
+ void convertTabToSpaces();
+ void deleteContainer(vector<BracketType>* &container);
+ void formatArrayRunIn();
+ void formatRunIn();
+ void goForward(int i);
+ void initContainer(vector<BracketType>* &container, vector<BracketType>* value);
+ void initNewLine();
+ void padOperators(const string *newOperator);
+ void padParens();
+ void formatArrayBrackets(BracketType bracketType, bool isOpeningArrayBracket);
+ void formatClosingBracket(BracketType bracketType);
+ void formatCommentBody();
+ void formatCommentOpener();
+ void formatLineCommentBody();
+ void formatLineCommentOpener();
+ void formatOpeningBracket(BracketType bracketType);
+ void formatQuoteBody();
+ void formatQuoteOpener();
+ void formatPointerOrReference();
+ void formatPointerOrReferenceCast();
+ void adjustComments();
+ void isLineBreakBeforeClosingHeader();
+ void setBreakBlocksVariables();
+ void fixOptionVariableConflicts();
+ void processPreprocessor();
+ void trimContinuationLine();
+ size_t findNextChar(string& line, char searchChar, int searchStart = 0);
+ string getPreviousWord(const string& line, int currPos) const;
+ string peekNextText(const string& firstLine, bool endOnEmptyLine=false) const;
+
+ private: // variables
+ static int formatterFileType;
+ static vector<const string*>* headers;
+ static vector<const string*>* nonParenHeaders;
+ static vector<const string*>* preDefinitionHeaders;
+ static vector<const string*>* preCommandHeaders;
+ static vector<const string*>* operators;
+ static vector<const string*>* assignmentOperators;
+ static vector<const string*>* castOperators;
+
+ ASSourceIterator *sourceIterator;
+ ASEnhancer *enhancer;
+
+ vector<const string*> *preBracketHeaderStack;
+ vector<BracketType> *bracketTypeStack;
+ vector<int> *parenStack;
+ vector<bool> *structStack;
+ string readyFormattedLine;
+ string currentLine;
+ string formattedLine;
+ const string *currentHeader;
+ const string *previousOperator; // used ONLY by pad-oper
+ char currentChar;
+ char previousChar;
+ char previousNonWSChar;
+ char previousCommandChar;
+ char quoteChar;
+ int charNum;
+ int preprocBracketTypeStackSize;
+ int tabIncrementIn;
+ int spacePadNum;
+ int nextLineSpacePadNum;
+ int templateDepth;
+ int traceLineNumber;
+ int horstmannIndentChars;
+ size_t leadingSpaces;
+ size_t formattedLineCommentNum; // comment location on formattedLine
+ size_t currentLineFirstBracketNum; // first bracket location on currentLine
+ size_t previousReadyFormattedLineLength;
+ FormatStyle formattingStyle;
+ BracketMode bracketFormatMode;
+ BracketType previousBracketType;
+ PointerAlign pointerAlignment;
+ LineEndFormat lineEnd;
+ bool isVirgin;
+ bool shouldPadOperators;
+ bool shouldPadParensOutside;
+ bool shouldPadParensInside;
+ bool shouldPadHeader;
+ bool shouldUnPadParens;
+ bool shouldConvertTabs;
+ bool shouldIndentCol1Comments;
+ bool isInLineComment;
+ bool isInComment;
+ bool noTrimCommentContinuation;
+ bool isInPreprocessor;
+ bool isInTemplate;
+ bool doesLineStartComment;
+ bool lineEndsInCommentOnly;
+ bool lineIsLineCommentOnly;
+ bool lineIsEmpty;
+ bool isImmediatelyPostCommentOnly;
+ bool isImmediatelyPostEmptyLine;
+ bool isInQuote;
+ bool isInVerbatimQuote;
+ bool haveLineContinuationChar;
+ bool isInQuoteContinuation;
+ bool isInBlParen;
+ bool isSpecialChar;
+ bool isNonParenHeader;
+ bool foundQuestionMark;
+ bool foundPreDefinitionHeader;
+ bool foundNamespaceHeader;
+ bool foundClassHeader;
+ bool foundStructHeader;
+ bool foundInterfaceHeader;
+ bool foundPreCommandHeader;
+ bool foundCastOperator;
+ bool isInLineBreak;
+ bool endOfCodeReached;
+ bool lineCommentNoIndent;
+ bool isInExecSQL;
+ bool isInAsm;
+ bool isInAsmOneLine;
+ bool isInAsmBlock;
+ bool isLineReady;
+ bool isPreviousBracketBlockRelated;
+ bool isInPotentialCalculation;
+ bool isCharImmediatelyPostComment;
+ bool isPreviousCharPostComment;
+ bool isCharImmediatelyPostLineComment;
+ bool isCharImmediatelyPostOpenBlock;
+ bool isCharImmediatelyPostCloseBlock;
+ bool isCharImmediatelyPostTemplate;
+ bool isCharImmediatelyPostReturn;
+ bool isCharImmediatelyPostOperator;
+ bool breakCurrentOneLineBlock;
+ bool isInHorstmannRunIn;
+ bool currentLineBeginsWithBracket;
+ bool shouldBreakOneLineBlocks;
+ bool shouldReparseCurrentChar;
+ bool shouldBreakOneLineStatements;
+ bool shouldBreakClosingHeaderBrackets;
+ bool shouldBreakElseIfs;
+ bool shouldAddBrackets;
+ bool shouldAddOneLineBrackets;
+ bool shouldDeleteEmptyLines;
+ bool needHeaderOpeningBracket;
+ bool shouldBreakLineAtNextChar;
+ bool passedSemicolon;
+ bool passedColon;
+ bool clearNonInStatement;
+ bool isImmediatelyPostComment;
+ bool isImmediatelyPostLineComment;
+ bool isImmediatelyPostEmptyBlock;
+ bool isImmediatelyPostPreprocessor;
+ bool isImmediatelyPostReturn;
+ bool isImmediatelyPostOperator;
+
+ bool shouldBreakBlocks;
+ bool shouldBreakClosingHeaderBlocks;
+ bool isPrependPostBlockEmptyLineRequested;
+ bool isAppendPostBlockEmptyLineRequested;
+
+ bool prependEmptyLine;
+ bool appendOpeningBracket;
+ bool foundClosingHeader;
+
+ bool isInHeader;
+ bool isImmediatelyPostHeader;
+ bool isInCase;
+ bool isJavaStaticConstructor;
+
+ private: // inline functions
+ // append a character to the current formatted line.
+ void appendChar(char ch, bool canBreakLine) {
+ if (canBreakLine && isInLineBreak)
+ breakLine();
+ formattedLine.append(1, ch);
+ isImmediatelyPostCommentOnly = false;
+ }
+
+ // append the CURRENT character (curentChar) to the current formatted line.
+ void appendCurrentChar(bool canBreakLine = true) {
+ appendChar(currentChar, canBreakLine);
+ }
+
+ // check if a specific sequence exists in the current placement of the current line
+ bool isSequenceReached(const char *sequence) const {
+ return currentLine.compare(charNum, strlen(sequence), sequence) == 0;
+ }
+
+ // call ASBase::findHeader for the current character
+ const string *findHeader(const vector<const string*>* headers) {
+ return ASBeautifier::findHeader(currentLine, charNum, headers);
+ }
+
+ // call ASBase::findOperator for the current character
+ const string *findOperator(const vector<const string*>* headers) {
+ return ASBeautifier::findOperator(currentLine, charNum, headers);
+ }
+}; // Class ASFormatter
+
+
+//----------------------------------------------------------------------------
+// astyle namespace global declarations
+//----------------------------------------------------------------------------
+// sort comparison functions for ASResource
+bool sortOnLength(const string *a, const string *b);
+bool sortOnName(const string *a, const string *b);
+
+} // end of astyle namespace
+
+// end of astyle namespace --------------------------------------------------
+
+
+//----------------------------------------------------------------------------
+// declarations for library build
+// global because they are called externally and are NOT part of the namespace
+//----------------------------------------------------------------------------
+
+typedef void (STDCALL *fpError)(int, char*); // pointer to callback error handler
+typedef char* (STDCALL *fpAlloc)(unsigned long); // pointer to callback memory allocation
+extern "C" EXPORT char* STDCALL AStyleMain(const char*, const char*, fpError, fpAlloc);
+extern "C" EXPORT const char* STDCALL AStyleGetVersion (void);
+
+
+#endif // closes ASTYLE_H
diff --git a/support/highlight/src/core/astyle/astyle_main.cpp b/support/highlight/src/core/astyle/astyle_main.cpp
new file mode 100644
index 0000000000..5b8a0b7e3a
--- /dev/null
+++ b/support/highlight/src/core/astyle/astyle_main.cpp
@@ -0,0 +1,2535 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Copyright (C) 2006-2010 by Jim Pattee <jimp03@email.com>
+ * Copyright (C) 1998-2002 by Tal Davidson
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>
+ *
+ * This file is a part of Artistic Style - an indentation and
+ * reformatting tool for C, C++, C# and Java source files.
+ * <http://astyle.sourceforge.net>
+ *
+ * Artistic Style is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Artistic Style is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Artistic Style. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ */
+
+#include "astyle_main.h"
+
+#include <algorithm>
+#include <iostream>
+#include <fstream>
+#include <sstream>
+#include <cstdlib>
+#include <errno.h>
+
+// includes for recursive getFileNames() function
+#ifdef _WIN32
+#undef UNICODE // use ASCII windows functions
+#include <windows.h>
+#else
+#include <dirent.h>
+#include <sys/stat.h>
+#ifdef __VMS
+#include <unixlib.h>
+#include <rms.h>
+#include <ssdef.h>
+#include <stsdef.h>
+#include <lib$routines.h>
+#include <starlet.h>
+#endif /* __VMS */
+#endif
+
+// turn off MinGW automatic file globbing
+// this CANNOT be in the astyle namespace
+int _CRT_glob = 0;
+
+namespace astyle
+{
+
+#define IS_OPTION(arg,op) ((arg).compare(op)==0)
+#define IS_OPTIONS(arg,a,b) (IS_OPTION((arg),(a)) || IS_OPTION((arg),(b)))
+
+#define GET_PARAM(arg,op) ((arg).substr(strlen(op)))
+#define GET_PARAMS(arg,a,b) (isParamOption((arg),(a)) ? GET_PARAM((arg),(a)) : GET_PARAM((arg),(b)))
+
+#ifdef _WIN32
+char g_fileSeparator = '\\';
+bool g_isCaseSensitive = false;
+#else
+char g_fileSeparator = '/';
+bool g_isCaseSensitive = true;
+#endif
+
+#ifdef ASTYLE_LIB
+// library build variables
+stringstream* _err = NULL;
+#else
+// console build variables
+ostream* _err = &cerr; // direct error messages to cerr
+ASConsole* g_console = NULL; // class to encapsulate console variables
+#endif
+
+#ifdef ASTYLE_JNI
+// java library build variables
+JNIEnv* g_env;
+jobject g_obj;
+jmethodID g_mid;
+#endif
+
+const char* _version = "1.24";
+
+
+/**
+ * parse the options vector
+ * ITER can be either a fileOptionsVector (options file) or an optionsVector (command line)
+ *
+ * @return true if no errors, false if errors
+ */
+template<typename ITER>
+bool parseOptions(ASFormatter &formatter,
+ const ITER &optionsBegin,
+ const ITER &optionsEnd,
+ const string &errorInfo)
+{
+ ITER option;
+ bool ok = true;
+ string arg, subArg;
+
+ for (option = optionsBegin; option != optionsEnd; ++option)
+ {
+ arg = *option;
+
+ if (arg.compare(0, 2, "--") == 0)
+ ok &= parseOption(formatter, arg.substr(2), errorInfo);
+ else if (arg[0] == '-')
+ {
+ size_t i;
+
+ for (i = 1; i < arg.length(); ++i)
+ {
+ if (isalpha(arg[i]) && i > 1)
+ {
+ ok &= parseOption(formatter, subArg, errorInfo);
+ subArg = "";
+ }
+ subArg.append(1, arg[i]);
+ }
+ ok &= parseOption(formatter, subArg, errorInfo);
+ subArg = "";
+ }
+ else
+ {
+ ok &= parseOption(formatter, arg, errorInfo);
+ subArg = "";
+ }
+ }
+ return ok;
+}
+
+void importOptions(istream &in, vector<string> &optionsVector)
+{
+ char ch;
+ string currentToken;
+
+ while (in)
+ {
+ currentToken = "";
+ do
+ {
+ in.get(ch);
+ if (in.eof())
+ break;
+ // treat '#' as line comments
+ if (ch == '#')
+ while (in)
+ {
+ in.get(ch);
+ if (ch == '\n')
+ break;
+ }
+
+ // break options on spaces, tabs, commas, or new-lines
+ if (in.eof() || ch == ' ' || ch == '\t' || ch == ',' || ch == '\n')
+ break;
+ else
+ currentToken.append(1, ch);
+
+ }
+ while (in);
+
+ if (currentToken.length() != 0)
+ optionsVector.push_back(currentToken);
+ }
+}
+
+void isOptionError(const string &arg, const string &errorInfo)
+{
+#ifdef ASTYLE_LIB
+ if (_err->str().length() == 0)
+ {
+ (*_err) << errorInfo << endl; // need main error message
+ (*_err) << arg; // output the option in error
+ }
+ else
+ (*_err) << endl << arg; // put endl after previous option
+#else
+ if (errorInfo.length() > 0) // to avoid a compiler warning
+ g_console->error("Error in param: ", arg.c_str());
+#endif
+}
+
+
+bool isParamOption(const string &arg, const char *option)
+{
+ bool retVal = arg.compare(0, strlen(option), option) == 0;
+ // if comparing for short option, 2nd char of arg must be numeric
+ if (retVal && strlen(option) == 1 && arg.length() > 1)
+ if (!isdigit(arg[1]))
+ retVal = false;
+ return retVal;
+}
+
+bool isParamOption(const string &arg, const char *option1, const char *option2)
+{
+ return isParamOption(arg, option1) || isParamOption(arg, option2);
+}
+
+bool parseOption(ASFormatter &formatter, const string &arg, const string &errorInfo)
+{
+ if ( IS_OPTION(arg, "style=allman") || IS_OPTION(arg, "style=ansi") || IS_OPTION(arg, "style=bsd") )
+ {
+ formatter.setFormattingStyle(STYLE_ALLMAN);
+ }
+ else if ( IS_OPTION(arg, "style=java") )
+ {
+ formatter.setFormattingStyle(STYLE_JAVA);
+ }
+ else if ( IS_OPTION(arg, "style=k&r") || IS_OPTION(arg, "style=k/r") )
+ {
+ formatter.setFormattingStyle(STYLE_KandR);
+ }
+ else if ( IS_OPTION(arg, "style=stroustrup") )
+ {
+ formatter.setFormattingStyle(STYLE_STROUSTRUP);
+ }
+ else if ( IS_OPTION(arg, "style=whitesmith") )
+ {
+ formatter.setFormattingStyle(STYLE_WHITESMITH);
+ }
+ else if ( IS_OPTION(arg, "style=banner") )
+ {
+ formatter.setFormattingStyle(STYLE_BANNER);
+ }
+ else if ( IS_OPTION(arg, "style=gnu") )
+ {
+ formatter.setFormattingStyle(STYLE_GNU);
+ }
+ else if ( IS_OPTION(arg, "style=linux") )
+ {
+ formatter.setFormattingStyle(STYLE_LINUX);
+ }
+ else if ( IS_OPTION(arg, "style=horstmann") )
+ {
+ formatter.setFormattingStyle(STYLE_HORSTMANN);
+ }
+ else if ( IS_OPTION(arg, "style=1tbs") || IS_OPTION(arg, "style=otbs") )
+ {
+ formatter.setFormattingStyle(STYLE_1TBS);
+ }
+ else if ( isParamOption(arg, "A") )
+ {
+ int style = 0;
+ string styleParam = GET_PARAM(arg, "A");
+ if (styleParam.length() > 0)
+ style = atoi(styleParam.c_str());
+ if (style < 1 || style > 10)
+ isOptionError(arg, errorInfo);
+ else if (style == 1)
+ formatter.setFormattingStyle(STYLE_ALLMAN);
+ else if (style == 2)
+ formatter.setFormattingStyle(STYLE_JAVA);
+ else if (style == 3)
+ formatter.setFormattingStyle(STYLE_KandR);
+ else if (style == 4)
+ formatter.setFormattingStyle(STYLE_STROUSTRUP);
+ else if (style == 5)
+ formatter.setFormattingStyle(STYLE_WHITESMITH);
+ else if (style == 6)
+ formatter.setFormattingStyle(STYLE_BANNER);
+ else if (style == 7)
+ formatter.setFormattingStyle(STYLE_GNU);
+ else if (style == 8)
+ formatter.setFormattingStyle(STYLE_LINUX);
+ else if (style == 9)
+ formatter.setFormattingStyle(STYLE_HORSTMANN);
+ else if (style == 10)
+ formatter.setFormattingStyle(STYLE_1TBS);
+ }
+ // must check for mode=cs before mode=c !!!
+ else if ( IS_OPTION(arg, "mode=cs") )
+ {
+ formatter.setSharpStyle();
+ formatter.setModeManuallySet(true);
+ }
+ else if ( IS_OPTION(arg, "mode=c") )
+ {
+ formatter.setCStyle();
+ formatter.setModeManuallySet(true);
+ }
+ else if ( IS_OPTION(arg, "mode=java") )
+ {
+ formatter.setJavaStyle();
+ formatter.setModeManuallySet(true);
+ }
+ else if ( isParamOption(arg, "t", "indent=tab=") )
+ {
+ int spaceNum = 4;
+ string spaceNumParam = GET_PARAMS(arg, "t", "indent=tab=");
+ if (spaceNumParam.length() > 0)
+ spaceNum = atoi(spaceNumParam.c_str());
+ if (spaceNum < 2 || spaceNum > 20)
+ isOptionError(arg, errorInfo);
+ else
+ {
+ formatter.setTabIndentation(spaceNum, false);
+ formatter.setIndentManuallySet(true);
+ }
+ }
+ else if ( IS_OPTION(arg, "indent=tab") )
+ {
+ formatter.setTabIndentation(4);
+ // do NOT call setIndentManuallySet(true);
+ }
+ else if ( isParamOption(arg, "T", "indent=force-tab=") )
+ {
+ int spaceNum = 4;
+ string spaceNumParam = GET_PARAMS(arg, "T", "indent=force-tab=");
+ if (spaceNumParam.length() > 0)
+ spaceNum = atoi(spaceNumParam.c_str());
+ if (spaceNum < 2 || spaceNum > 20)
+ isOptionError(arg, errorInfo);
+ else
+ {
+ formatter.setTabIndentation(spaceNum, true);
+ formatter.setIndentManuallySet(true);
+ }
+ }
+ else if ( IS_OPTION(arg, "indent=force-tab") )
+ {
+ formatter.setTabIndentation(4, true);
+ // do NOT call setIndentManuallySet(true);
+ }
+ else if ( isParamOption(arg, "s", "indent=spaces=") )
+ {
+ int spaceNum = 4;
+ string spaceNumParam = GET_PARAMS(arg, "s", "indent=spaces=");
+ if (spaceNumParam.length() > 0)
+ spaceNum = atoi(spaceNumParam.c_str());
+ if (spaceNum < 2 || spaceNum > 20)
+ isOptionError(arg, errorInfo);
+ else
+ {
+ formatter.setSpaceIndentation(spaceNum);
+ formatter.setIndentManuallySet(true);
+ }
+ }
+ else if ( IS_OPTION(arg, "indent=spaces") )
+ {
+ formatter.setSpaceIndentation(4);
+ // do NOT call setIndentManuallySet(true);
+ }
+ else if ( isParamOption(arg, "m", "min-conditional-indent=") )
+ {
+ int minIndent = 8;
+ string minIndentParam = GET_PARAMS(arg, "m", "min-conditional-indent=");
+ if (minIndentParam.length() > 0)
+ minIndent = atoi(minIndentParam.c_str());
+ if (minIndent > 40)
+ isOptionError(arg, errorInfo);
+ else
+ {
+ formatter.setMinConditionalIndentLength(minIndent);
+ formatter.setMinConditionalManuallySet(true);
+ }
+ }
+ else if ( isParamOption(arg, "M", "max-instatement-indent=") )
+ {
+ int maxIndent = 40;
+ string maxIndentParam = GET_PARAMS(arg, "M", "max-instatement-indent=");
+ if (maxIndentParam.length() > 0)
+ maxIndent = atoi(maxIndentParam.c_str());
+ if (maxIndent > 80)
+ isOptionError(arg, errorInfo);
+ else
+ formatter.setMaxInStatementIndentLength(maxIndent);
+ }
+ else if ( IS_OPTIONS(arg, "B", "indent-brackets") )
+ {
+ formatter.setBracketIndent(true);
+ }
+ else if ( IS_OPTIONS(arg, "G", "indent-blocks") )
+ {
+ formatter.setBlockIndent(true);
+ }
+ else if ( IS_OPTIONS(arg, "N", "indent-namespaces") )
+ {
+ formatter.setNamespaceIndent(true);
+ }
+ else if ( IS_OPTIONS(arg, "C", "indent-classes") )
+ {
+ formatter.setClassIndent(true);
+ }
+ else if ( IS_OPTIONS(arg, "S", "indent-switches") )
+ {
+ formatter.setSwitchIndent(true);
+ }
+ else if ( IS_OPTIONS(arg, "K", "indent-cases") )
+ {
+ formatter.setCaseIndent(true);
+ }
+ else if ( IS_OPTIONS(arg, "L", "indent-labels") )
+ {
+ formatter.setLabelIndent(true);
+ }
+ else if ( IS_OPTIONS(arg, "y", "break-closing-brackets") )
+ {
+ formatter.setBreakClosingHeaderBracketsMode(true);
+ }
+ else if ( IS_OPTIONS(arg, "b", "brackets=break") )
+ {
+ formatter.setBracketFormatMode(BREAK_MODE);
+ }
+ else if ( IS_OPTIONS(arg, "a", "brackets=attach") )
+ {
+ formatter.setBracketFormatMode(ATTACH_MODE);
+ }
+ else if ( IS_OPTIONS(arg, "l", "brackets=linux") )
+ {
+ formatter.setBracketFormatMode(LINUX_MODE);
+ }
+ else if ( IS_OPTIONS(arg, "u", "brackets=stroustrup") )
+ {
+ formatter.setBracketFormatMode(STROUSTRUP_MODE);
+ }
+ else if ( IS_OPTIONS(arg, "g", "brackets=horstmann") )
+ {
+ formatter.setBracketFormatMode(HORSTMANN_MODE);
+ }
+ else if ( IS_OPTIONS(arg, "O", "keep-one-line-blocks") )
+ {
+ formatter.setBreakOneLineBlocksMode(false);
+ }
+ else if ( IS_OPTIONS(arg, "o", "keep-one-line-statements") )
+ {
+ formatter.setSingleStatementsMode(false);
+ }
+ else if ( IS_OPTIONS(arg, "P", "pad-paren") )
+ {
+ formatter.setParensOutsidePaddingMode(true);
+ formatter.setParensInsidePaddingMode(true);
+ }
+ else if ( IS_OPTIONS(arg, "d", "pad-paren-out") )
+ {
+ formatter.setParensOutsidePaddingMode(true);
+ }
+ else if ( IS_OPTIONS(arg, "D", "pad-paren-in") )
+ {
+ formatter.setParensInsidePaddingMode(true);
+ }
+ else if ( IS_OPTIONS(arg, "H", "pad-header") )
+ {
+ formatter.setParensHeaderPaddingMode(true);
+ }
+ else if ( IS_OPTIONS(arg, "U", "unpad-paren") )
+ {
+ formatter.setParensUnPaddingMode(true);
+ }
+ else if ( IS_OPTIONS(arg, "p", "pad-oper") )
+ {
+ formatter.setOperatorPaddingMode(true);
+ }
+ else if ( IS_OPTIONS(arg, "x", "delete-empty-lines") )
+ {
+ formatter.setDeleteEmptyLinesMode(true);
+ }
+ else if ( IS_OPTIONS(arg, "E", "fill-empty-lines") )
+ {
+ formatter.setEmptyLineFill(true);
+ }
+ else if ( IS_OPTIONS(arg, "w", "indent-preprocessor") )
+ {
+ formatter.setPreprocessorIndent(true);
+ }
+ else if ( IS_OPTIONS(arg, "c", "convert-tabs") )
+ {
+ formatter.setTabSpaceConversionMode(true);
+ }
+ else if ( IS_OPTIONS(arg, "F", "break-blocks=all") )
+ {
+ formatter.setBreakBlocksMode(true);
+ formatter.setBreakClosingHeaderBlocksMode(true);
+ }
+ else if ( IS_OPTIONS(arg, "f", "break-blocks") )
+ {
+ formatter.setBreakBlocksMode(true);
+ }
+ else if ( IS_OPTIONS(arg, "e", "break-elseifs") )
+ {
+ formatter.setBreakElseIfsMode(true);
+ }
+ else if ( IS_OPTIONS(arg, "j", "add-brackets") )
+ {
+ formatter.setAddBracketsMode(true);
+ }
+ else if ( IS_OPTIONS(arg, "J", "add-one-line-brackets") )
+ {
+ formatter.setAddOneLineBracketsMode(true);
+ }
+ else if ( IS_OPTIONS(arg, "Y", "indent-col1-comments") )
+ {
+ formatter.setIndentCol1CommentsMode(true);
+ }
+ else if ( IS_OPTION(arg, "align-pointer=type") )
+ {
+ formatter.setPointerAlignment(ALIGN_TYPE);
+ }
+ else if ( IS_OPTION(arg, "align-pointer=middle") )
+ {
+ formatter.setPointerAlignment(ALIGN_MIDDLE);
+ }
+ else if ( IS_OPTION(arg, "align-pointer=name") )
+ {
+ formatter.setPointerAlignment(ALIGN_NAME);
+ }
+ else if ( isParamOption(arg, "k") )
+ {
+ int align = 0;
+ string styleParam = GET_PARAM(arg, "k");
+ if (styleParam.length() > 0)
+ align = atoi(styleParam.c_str());
+ if (align < 1 || align > 3)
+ isOptionError(arg, errorInfo);
+ else if (align == 1)
+ formatter.setPointerAlignment(ALIGN_TYPE);
+ else if (align == 2)
+ formatter.setPointerAlignment(ALIGN_MIDDLE);
+ else if (align == 3)
+ formatter.setPointerAlignment(ALIGN_NAME);
+ }
+ // depreciated options /////////////////////////////////////////////////////////////////////////////////////
+ // depreciated in release 1.23
+ // removed from documentation in release 1.24
+ // may be removed at an appropriate time
+// else if ( IS_OPTION(arg, "style=kr") )
+// {
+// formatter.setFormattingStyle(STYLE_JAVA);
+// }
+ else if ( isParamOption(arg, "T", "force-indent=tab=") )
+ {
+ // the 'T' option will already have been processed
+ int spaceNum = 4;
+ string spaceNumParam = GET_PARAMS(arg, "T", "force-indent=tab=");
+ if (spaceNumParam.length() > 0)
+ spaceNum = atoi(spaceNumParam.c_str());
+ if (spaceNum < 1 || spaceNum > 20)
+ isOptionError(arg, errorInfo);
+ else
+ formatter.setTabIndentation(spaceNum, true);
+ }
+ else if ( IS_OPTION(arg, "brackets=break-closing") )
+ {
+ formatter.setBreakClosingHeaderBracketsMode(true);
+ }
+
+ else if ( IS_OPTION(arg, "one-line=keep-blocks") )
+ {
+ formatter.setBreakOneLineBlocksMode(false);
+ }
+ else if ( IS_OPTION(arg, "one-line=keep-statements") )
+ {
+ formatter.setSingleStatementsMode(false);
+ }
+ else if ( IS_OPTION(arg, "pad=paren") )
+ {
+ formatter.setParensOutsidePaddingMode(true);
+ formatter.setParensInsidePaddingMode(true);
+ }
+ else if ( IS_OPTION(arg, "pad=paren-out") )
+ {
+ formatter.setParensOutsidePaddingMode(true);
+ }
+ else if ( IS_OPTION(arg, "pad=paren-in") )
+ {
+ formatter.setParensInsidePaddingMode(true);
+ }
+ else if ( IS_OPTION(arg, "unpad=paren") )
+ {
+ formatter.setParensUnPaddingMode(true);
+ }
+ else if ( IS_OPTION(arg, "pad=oper") )
+ {
+ formatter.setOperatorPaddingMode(true);
+ }
+ // end depreciated options //////////////////////////////////////////////////////////////////////////////
+#ifdef ASTYLE_LIB
+ // End of options used by GUI
+ else
+ isOptionError(arg, errorInfo);
+#else
+ // Options used by only console
+ else if ( IS_OPTIONS(arg, "n", "suffix=none") )
+ {
+ g_console->setNoBackup(true);
+ }
+ else if ( isParamOption(arg, "suffix=") )
+ {
+ string suffixParam = GET_PARAM(arg, "suffix=");
+ if (suffixParam.length() > 0)
+ {
+ g_console->setOrigSuffix(suffixParam);
+ }
+ }
+ else if ( isParamOption(arg, "exclude=") )
+ {
+ string suffixParam = GET_PARAM(arg, "exclude=");
+ if (suffixParam.length() > 0)
+ g_console->updateExcludeVector(suffixParam);
+ }
+ else if ( IS_OPTIONS(arg, "r", "R") || IS_OPTION(arg, "recursive") )
+ {
+ g_console->setIsRecursive(true);
+ }
+ else if ( IS_OPTIONS(arg, "Z", "preserve-date") )
+ {
+ g_console->setPreserveDate(true);
+ }
+ else if ( IS_OPTIONS(arg, "v", "verbose") )
+ {
+ g_console->setIsVerbose(true);
+ }
+ else if ( IS_OPTIONS(arg, "Q", "formatted") )
+ {
+ g_console->setIsFormattedOnly(true);
+ }
+ else if ( IS_OPTIONS(arg, "q", "quiet") )
+ {
+ g_console->setIsQuiet(true);
+ }
+ else if ( IS_OPTIONS(arg, "X", "errors-to-stdout") )
+ {
+ _err = &cout;
+ }
+ else if ( IS_OPTION(arg, "lineend=windows") )
+ {
+ formatter.setLineEndFormat(LINEEND_WINDOWS);
+ }
+ else if ( IS_OPTION(arg, "lineend=linux") )
+ {
+ formatter.setLineEndFormat(LINEEND_LINUX);
+ }
+ else if ( IS_OPTION(arg, "lineend=macold") )
+ {
+ formatter.setLineEndFormat(LINEEND_MACOLD);
+ }
+ else if ( isParamOption(arg, "z") )
+ {
+ int lineendType = 0;
+ string lineendParam = GET_PARAM(arg, "z");
+ if (lineendParam.length() > 0)
+ lineendType = atoi(lineendParam.c_str());
+ if (lineendType < 1 || lineendType > 3)
+ isOptionError(arg, errorInfo);
+ else if (lineendType == 1)
+ formatter.setLineEndFormat(LINEEND_WINDOWS);
+ else if (lineendType == 2)
+ formatter.setLineEndFormat(LINEEND_LINUX);
+ else if (lineendType == 3)
+ formatter.setLineEndFormat(LINEEND_MACOLD);
+ }
+ else
+ {
+ (*_err) << errorInfo << arg << endl;
+ return false; // invalid option
+ }
+#endif
+// End of parseOption function
+ return true; //o.k.
+}
+
+//--------------------------------------------------------------------------------------
+// ASStreamIterator class
+// typename will be istringstream for GUI and istream otherwise
+//--------------------------------------------------------------------------------------
+
+template<typename T>
+ASStreamIterator<T>::ASStreamIterator(T *in)
+{
+ inStream = in;
+ buffer.reserve(200);
+ eolWindows = 0;
+ eolLinux = 0;
+ eolMacOld = 0;
+ outputEOL[0] = '\0';
+ peekStart = 0;
+ prevLineDeleted = false;
+ checkForEmptyLine = false;
+}
+
+template<typename T>
+ASStreamIterator<T>::~ASStreamIterator()
+{
+}
+
+/**
+ * read the input stream, delete any end of line characters,
+ * and build a string that contains the input line.
+ *
+ * @return string containing the next input line minus any end of line characters
+ */
+template<typename T>
+string ASStreamIterator<T>::nextLine(bool emptyLineWasDeleted)
+{
+ // verify that the current position is correct
+ assert (peekStart == 0);
+
+ // a deleted line may be replaced if break-blocks is requested
+ // this sets up the compare to check for a replaced empty line
+ if (prevLineDeleted)
+ {
+ prevLineDeleted = false;
+ checkForEmptyLine = true;
+ }
+ if (!emptyLineWasDeleted)
+ prevBuffer = buffer;
+ else
+ prevLineDeleted = true;
+
+ // read the next record
+ buffer.clear();
+ char ch;
+ inStream->get(ch);
+
+ while (!inStream->eof() && ch != '\n' && ch != '\r')
+ {
+ buffer.append(1, ch);
+ inStream->get(ch);
+ }
+
+ if (inStream->eof())
+ {
+ return buffer;
+ }
+
+ int peekCh = inStream->peek();
+
+ // find input end-of-line characters
+ if (!inStream->eof())
+ {
+ if (ch == '\r') // CR+LF is windows otherwise Mac OS 9
+ {
+ if (peekCh == '\n')
+ {
+ inStream->get();
+ eolWindows++;
+ }
+ else
+ eolMacOld++;
+ }
+ else // LF is Linux, allow for improbable LF/CR
+ {
+ if (peekCh == '\r')
+ {
+ inStream->get();
+ eolWindows++;
+ }
+ else
+ eolLinux++;
+ }
+ }
+ else
+ {
+ inStream->clear();
+ }
+
+ // set output end of line characters
+ if (eolWindows >= eolLinux)
+ {
+ if (eolWindows >= eolMacOld)
+ strcpy(outputEOL, "\r\n"); // Windows (CR+LF)
+ else
+ strcpy(outputEOL, "\r"); // MacOld (CR)
+ }
+ else if (eolLinux >= eolMacOld)
+ strcpy(outputEOL, "\n"); // Linux (LF)
+ else
+ strcpy(outputEOL, "\r"); // MacOld (CR)
+
+ return buffer;
+}
+
+// save the current position and get the next line
+// this can be called for multiple reads
+// when finished peeking you MUST call peekReset()
+// call this function from ASFormatter ONLY
+template<typename T>
+string ASStreamIterator<T>::peekNextLine()
+{
+ assert (hasMoreLines());
+ string nextLine;
+ char ch;
+
+ if (peekStart == 0)
+ peekStart = inStream->tellg();
+
+ // read the next record
+ inStream->get(ch);
+ while (!inStream->eof() && ch != '\n' && ch != '\r')
+ {
+ nextLine.append(1, ch);
+ inStream->get(ch);
+ }
+
+ if (inStream->eof())
+ {
+ return nextLine;
+ }
+
+ int peekCh = inStream->peek();
+
+ // remove end-of-line characters
+ if (!inStream->eof())
+ {
+ if ((peekCh == '\n' || peekCh == '\r') && peekCh != ch) ///////////// changed //////////
+ inStream->get();
+ }
+
+ return nextLine;
+}
+
+// reset current position and EOF for peekNextLine()
+template<typename T>
+void ASStreamIterator<T>::peekReset()
+{
+ assert(peekStart != 0);
+ inStream->clear();
+ inStream->seekg(peekStart);
+ peekStart = 0;
+}
+
+// save the last input line after input has reached EOF
+template<typename T>
+void ASStreamIterator<T>::saveLastInputLine()
+{
+ assert(inStream->eof());
+ prevBuffer = buffer;
+}
+
+// check for a change in line ends
+template<typename T>
+bool ASStreamIterator<T>::getLineEndChange(int lineEndFormat) const
+{
+ assert(lineEndFormat == LINEEND_DEFAULT
+ || lineEndFormat == LINEEND_WINDOWS
+ || lineEndFormat == LINEEND_LINUX
+ || lineEndFormat == LINEEND_MACOLD);
+
+ bool lineEndChange = false;
+ if (lineEndFormat == LINEEND_WINDOWS)
+ lineEndChange = (eolLinux + eolMacOld != 0);
+ else if (lineEndFormat == LINEEND_LINUX)
+ lineEndChange = (eolWindows + eolMacOld != 0);
+ else if (lineEndFormat == LINEEND_MACOLD)
+ lineEndChange = (eolWindows + eolLinux != 0);
+ else
+ {
+ if (eolWindows > 0)
+ lineEndChange = (eolLinux + eolMacOld != 0);
+ else if (eolLinux > 0)
+ lineEndChange = (eolWindows + eolMacOld != 0);
+ else if (eolMacOld > 0)
+ lineEndChange = (eolWindows + eolLinux != 0);
+ }
+ return lineEndChange;
+}
+
+#ifndef ASTYLE_LIB
+//--------------------------------------------------------------------------------------
+// ASConsole class
+// main function will be included only in the console build
+//--------------------------------------------------------------------------------------
+
+// rewrite a stringstream converting the line ends
+void ASConsole::convertLineEnds(ostringstream& out, int lineEnd)
+{
+ assert(lineEnd == LINEEND_WINDOWS || lineEnd == LINEEND_LINUX || lineEnd == LINEEND_MACOLD);
+ const string& inStr = out.str(); // avoids strange looking syntax
+ string outStr; // the converted ouput
+ int inLength = inStr.length();
+ for (int pos = 0; pos < inLength; pos++)
+ {
+ if (inStr[pos] == '\r')
+ {
+ if (inStr[pos+ 1] == '\n')
+ {
+ // CRLF
+ if (lineEnd == LINEEND_CR)
+ {
+ outStr += inStr[pos]; // Delete the LF
+ pos++;
+ continue;
+ }
+ else if (lineEnd == LINEEND_LF)
+ {
+ outStr += inStr[pos+1]; // Delete the CR
+ pos++;
+ continue;
+ }
+ else
+ {
+ outStr += inStr[pos]; // Do not change
+ outStr += inStr[pos+1];
+ pos++;
+ continue;
+ }
+ }
+ else
+ {
+ // CR
+ if (lineEnd == LINEEND_CRLF)
+ {
+ outStr += inStr[pos]; // Insert the CR
+ outStr += '\n'; // Insert the LF
+ continue;
+ }
+ else if (lineEnd == LINEEND_LF)
+ {
+ outStr += '\n'; // Insert the LF
+ continue;
+ }
+ else
+ {
+ outStr += inStr[pos]; // Do not change
+ continue;
+ }
+ }
+ }
+ else if (inStr[pos] == '\n')
+ {
+ // LF
+ if (lineEnd == LINEEND_CRLF)
+ {
+ outStr += '\r'; // Insert the CR
+ outStr += inStr[pos]; // Insert the LF
+ continue;
+ }
+ else if (lineEnd == LINEEND_CR)
+ {
+ outStr += '\r'; // Insert the CR
+ continue;
+ }
+ else
+ {
+ outStr += inStr[pos]; // Do not change
+ continue;
+ }
+ }
+ else
+ {
+ outStr += inStr[pos]; // Write the current char
+ }
+ }
+ // replace the stream
+ out.str(outStr);
+}
+
+void ASConsole::correctMixedLineEnds(ostringstream& out)
+{
+ LineEndFormat lineEndFormat = LINEEND_DEFAULT;
+ if (strcmp(outputEOL, "\r\n") == 0)
+ lineEndFormat = LINEEND_WINDOWS;
+ if (strcmp(outputEOL, "\n") == 0)
+ lineEndFormat = LINEEND_LINUX;
+ if (strcmp(outputEOL, "\r") == 0)
+ lineEndFormat = LINEEND_MACOLD;
+ convertLineEnds(out, lineEndFormat);
+}
+
+void ASConsole::error(const char *why, const char* what) const
+{
+ (*_err) << why << ' ' << what << '\n' << endl;
+ (*_err) << "Artistic Style has terminated!" << endl;
+ exit(EXIT_FAILURE);
+}
+
+/**
+ * If no files have been given, use cin for input and cout for output.
+ *
+ * This is used to format text for text editors like TextWrangler (Mac).
+ * Do NOT display any console messages when this function is used.
+ */
+void ASConsole::formatCinToCout(ASFormatter& formatter) const
+{
+ ASStreamIterator<istream> streamIterator(&cin); // create iterator for cin
+ formatter.init(&streamIterator);
+
+ while (formatter.hasMoreLines())
+ {
+ cout << formatter.nextLine();
+ if (formatter.hasMoreLines())
+ cout << streamIterator.getOutputEOL();
+ }
+ cout.flush();
+}
+
+/**
+ * Open input file, format it, and close the output.
+ *
+ * @param fileName The path and name of the file to be processed.
+ * @param formatter The formatter object.
+ */
+void ASConsole::formatFile(const string &fileName, ASFormatter &formatter)
+{
+ bool isFormatted = false;
+
+ // open input file
+ ifstream in(fileName.c_str(), ios::binary);
+ if (!in)
+ error("Could not open input file", fileName.c_str());
+
+ ostringstream out;
+
+ // Unless a specific language mode has been set, set the language mode
+ // according to the file's suffix.
+ if (!formatter.getModeManuallySet())
+ {
+ if (stringEndsWith(fileName, string(".java")))
+ formatter.setJavaStyle();
+ else if (stringEndsWith(fileName, string(".cs")))
+ formatter.setSharpStyle();
+ else
+ formatter.setCStyle();
+ }
+
+ ASStreamIterator<istream> streamIterator(&in);
+ formatter.init(&streamIterator);
+
+ // make sure encoding is 8 bit
+ // if not set the eofbit so the file is not formatted
+ FileEncoding encoding = getFileEncoding(in);
+ if (encoding != ENCODING_OK)
+ in.setstate(ios::eofbit);
+
+ // set line end format
+ string nextLine; // next output line
+ filesAreIdentical = true; // input and output files are identical
+ LineEndFormat lineEndFormat = formatter.getLineEndFormat();
+ initializeOutputEOL(lineEndFormat);
+
+ // format the file
+ while (formatter.hasMoreLines())
+ {
+ nextLine = formatter.nextLine();
+ out << nextLine;
+ linesOut++;
+ if (formatter.hasMoreLines())
+ {
+ setOutputEOL(lineEndFormat, streamIterator.getOutputEOL());
+ out << outputEOL;
+ }
+ else
+ streamIterator.saveLastInputLine(); // to compare the last input line
+
+ if (filesAreIdentical)
+ {
+ if (streamIterator.checkForEmptyLine)
+ {
+ if (nextLine.find_first_not_of(" \t") != string::npos)
+ filesAreIdentical = false;
+ }
+ else if (!streamIterator.compareToInputBuffer(nextLine))
+ filesAreIdentical = false;
+ streamIterator.checkForEmptyLine = false;
+ }
+ }
+ // correct for mixed line ends
+ if (lineEndsMixed)
+ {
+ correctMixedLineEnds(out);
+ filesAreIdentical = false;
+ }
+ in.close();
+
+ // if file has changed, write the new file
+ if (!filesAreIdentical || streamIterator.getLineEndChange(lineEndFormat))
+ {
+ writeOutputFile(fileName, out);
+ isFormatted = true;
+ filesFormatted++;
+ }
+ else
+ filesUnchanged++;
+
+ if (encoding != ENCODING_OK)
+ printBadEncoding(encoding);
+
+ // remove targetDirectory from filename if required by print
+ string displayName;
+ if (hasWildcard)
+ displayName = fileName.substr(targetDirectory.length() + 1);
+ else
+ displayName = fileName;
+
+ if (isFormatted)
+ printMsg("formatted " + displayName);
+ else
+ {
+ if (!isFormattedOnly || encoding != ENCODING_OK)
+ printMsg("unchanged* " + displayName);
+ }
+}
+
+// for unit testing
+vector<bool> ASConsole::getExcludeHitsVector()
+{
+ return excludeHitsVector;
+}
+
+// for unit testing
+vector<string> ASConsole::getExcludeVector()
+{ return excludeVector; }
+
+// for unit testing
+vector<string> ASConsole::getFileName()
+{ return fileName; }
+
+// for unit testing
+vector<string> ASConsole::getFileNameVector()
+{ return fileNameVector; }
+
+// for unit testing
+vector<string> ASConsole::getFileOptionsVector()
+{ return fileOptionsVector; }
+
+int ASConsole::getFilesUnchanged()
+{ return filesUnchanged; }
+
+int ASConsole::getFilesFormatted()
+{ return filesFormatted; }
+
+bool ASConsole::getIsFormattedOnly()
+{ return isFormattedOnly; }
+
+bool ASConsole::getIsQuiet()
+{ return isQuiet; }
+
+bool ASConsole::getIsRecursive()
+{ return isRecursive; }
+
+bool ASConsole::getIsVerbose()
+{ return isVerbose; }
+
+bool ASConsole::getLineEndsMixed()
+{ return lineEndsMixed; }
+
+bool ASConsole::getNoBackup()
+{ return noBackup; }
+
+string ASConsole::getOptionsFileName()
+{ return optionsFileName; }
+
+bool ASConsole::getOptionsFileRequired()
+{ return optionsFileRequired; }
+
+// for unit testing
+vector<string> ASConsole::getOptionsVector()
+{ return optionsVector; }
+
+string ASConsole::getOrigSuffix()
+{ return origSuffix; }
+
+bool ASConsole::getPreserveDate()
+{ return preserveDate; }
+
+// initialize output end of line
+void ASConsole::initializeOutputEOL(LineEndFormat lineEndFormat)
+{
+ assert(lineEndFormat == LINEEND_DEFAULT
+ || lineEndFormat == LINEEND_WINDOWS
+ || lineEndFormat == LINEEND_LINUX
+ || lineEndFormat == LINEEND_MACOLD);
+
+ outputEOL[0] = '\0'; // current line end
+ prevEOL[0] = '\0'; // previous line end
+ lineEndsMixed = false; // output has mixed line ends, LINEEND_DEFAULT only
+
+ if (lineEndFormat == LINEEND_WINDOWS)
+ strcpy(outputEOL, "\r\n");
+ else if (lineEndFormat == LINEEND_LINUX)
+ strcpy(outputEOL, "\n");
+ else if (lineEndFormat == LINEEND_MACOLD)
+ strcpy(outputEOL, "\r");
+ else
+ outputEOL[0] = '\0';
+}
+
+void ASConsole::printBadEncoding(FileEncoding encoding) const
+{
+ string msg = "********** following file unchanged: ";
+ if (encoding == UTF_16BE)
+ msg += "UTF-16BE encoding";
+ else if (encoding == UTF_16LE)
+ msg += "UTF-16LE encoding";
+ else if (encoding == UTF_32BE)
+ msg += "UTF-32BE encoding";
+ else if (encoding == UTF_32LE)
+ msg += "UTF-32LE encoding";
+ else
+ msg += "???????? encoding";
+ printMsg(msg);
+}
+
+void ASConsole::setIsFormattedOnly(bool state)
+{ isFormattedOnly = state; }
+
+void ASConsole::setIsQuiet(bool state)
+{ isQuiet = state; }
+
+void ASConsole::setIsRecursive(bool state)
+{ isRecursive = state; }
+
+void ASConsole::setIsVerbose(bool state)
+{ isVerbose = state; }
+
+void ASConsole::setNoBackup(bool state)
+{ noBackup = state; }
+
+void ASConsole::setOptionsFileName(string name)
+{ optionsFileName = name; }
+
+void ASConsole::setOptionsFileRequired(bool state)
+{ optionsFileRequired = state; }
+
+void ASConsole::setOrigSuffix(string suffix)
+{ origSuffix = suffix; }
+
+void ASConsole::setPreserveDate(bool state)
+{ preserveDate = state; }
+
+// set outputEOL variable
+void ASConsole::setOutputEOL(LineEndFormat lineEndFormat, const char* currentEOL)
+{
+ if (lineEndFormat == LINEEND_DEFAULT)
+ {
+ strcpy(outputEOL, currentEOL);
+ if (strlen(prevEOL) == 0)
+ strcpy(prevEOL, outputEOL);
+ if (strcmp(prevEOL, outputEOL) != 0)
+ {
+ lineEndsMixed = true;
+ filesAreIdentical = false;
+ strcpy(prevEOL, outputEOL);
+ }
+ }
+ else
+ {
+ strcpy(prevEOL, currentEOL);
+ if (strcmp(prevEOL, outputEOL) != 0)
+ filesAreIdentical = false;
+ }
+}
+
+#ifdef _WIN32 // Windows specific
+
+/**
+ * WINDOWS function to get the current directory.
+ * NOTE: getenv("CD") does not work for Windows Vista.
+ * The Windows function GetCurrentDirectory is used instead.
+ *
+ * @return The path of the current directory
+ */
+string ASConsole::getCurrentDirectory(const string &fileName) const
+{
+ char currdir[MAX_PATH];
+ currdir[0] = '\0';
+ if (!GetCurrentDirectory(sizeof(currdir), currdir))
+ error("Cannot find file", fileName.c_str());
+ return string(currdir);
+}
+
+/**
+ * WINDOWS function to resolve wildcards and recurse into sub directories.
+ * The fileName vector is filled with the path and names of files to process.
+ *
+ * @param directory The path of the directory to be processed.
+ * @param wildcard The wildcard to be processed (e.g. *.cpp).
+ * @param fileName An empty vector which will be filled with the path and names of files to process.
+ */
+void ASConsole::getFileNames(const string &directory, const string &wildcard)
+{
+ vector<string> subDirectory; // sub directories of directory
+ WIN32_FIND_DATA FindFileData; // for FindFirstFile and FindNextFile
+
+ // Find the first file in the directory
+ string firstFile = directory + "\\*";
+ HANDLE hFind = FindFirstFile(firstFile.c_str(), &FindFileData);
+
+ if (hFind == INVALID_HANDLE_VALUE)
+ error("Cannot open directory", directory.c_str());
+
+ // save files and sub directories
+ do
+ {
+ // skip hidden or read only
+ if (FindFileData.cFileName[0] == '.'
+ || (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)
+ || (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_READONLY))
+ continue;
+
+ // if a sub directory and recursive, save sub directory
+ if ((FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && isRecursive)
+ {
+ string subDirectoryPath = directory + g_fileSeparator + FindFileData.cFileName;
+ if (isPathExclued(subDirectoryPath))
+ printMsg("exclude " + subDirectoryPath.substr(mainDirectoryLength));
+ else
+ subDirectory.push_back(subDirectoryPath);
+ continue;
+ }
+
+ // save the file name
+ string filePathName = directory + g_fileSeparator + FindFileData.cFileName;
+ // check exclude before wildcmp to avoid "unmatched exclude" error
+ bool isExcluded = isPathExclued(filePathName);
+ // save file name if wildcard match
+ if (wildcmp(wildcard.c_str(), FindFileData.cFileName))
+ {
+ if (isExcluded)
+ printMsg("exclude " + filePathName.substr(mainDirectoryLength));
+ else
+ fileName.push_back(filePathName);
+ }
+ }
+ while (FindNextFile(hFind, &FindFileData) != 0);
+
+ // check for processing error
+ FindClose(hFind);
+ DWORD dwError = GetLastError();
+ if (dwError != ERROR_NO_MORE_FILES)
+ error("Error processing directory", directory.c_str());
+
+ // recurse into sub directories
+ // if not doing recursive subDirectory is empty
+ for (unsigned i = 0; i < subDirectory.size(); i++)
+ {
+ getFileNames(subDirectory[i], wildcard);
+ }
+
+ return;
+}
+
+#else // not _WIN32
+
+/**
+ * LINUX function to get the current directory.
+ * This is done if the fileName does not contain a path.
+ * It is probably from an editor sending a single file.
+ *
+ * @param fileName The filename is used only for the error message.
+ * @return The path of the current directory
+ */
+string ASConsole::getCurrentDirectory(const string &fileName) const
+{
+ char *currdir = getenv("PWD");
+ if (currdir == NULL)
+ error("Cannot find file", fileName.c_str());
+ return string(currdir);
+}
+
+/**
+ * LINUX function to resolve wildcards and recurse into sub directories.
+ * The fileName vector is filled with the path and names of files to process.
+ *
+ * @param directory The path of the directory to be processed.
+ * @param wildcard The wildcard to be processed (e.g. *.cpp).
+ * @param fileName An empty vector which will be filled with the path and names of files to process.
+ */
+void ASConsole::getFileNames(const string &directory, const string &wildcard)
+{
+ struct dirent *entry; // entry from readdir()
+ struct stat statbuf; // entry from stat()
+ vector<string> subDirectory; // sub directories of this directory
+
+ // errno is defined in <errno.h> and is set for errors in opendir, readdir, or stat
+ errno = 0;
+
+ DIR *dp = opendir(directory.c_str());
+ if (dp == NULL)
+ error("Cannot open directory", directory.c_str());
+
+ // save the first fileName entry for this recursion
+ const unsigned firstEntry = fileName.size();
+
+ // save files and sub directories
+ while ((entry = readdir(dp)) != NULL)
+ {
+ // get file status
+ string entryFilepath = directory + g_fileSeparator + entry->d_name;
+ if (stat(entryFilepath.c_str(), &statbuf) != 0)
+ {
+ if (errno == EOVERFLOW) // file over 2 GB is OK
+ {
+ errno = 0;
+ continue;
+ }
+ perror("errno message");
+ error("Error getting file status in directory", directory.c_str());
+ }
+ // skip hidden or read only
+ if (entry->d_name[0] == '.' || !(statbuf.st_mode & S_IWUSR))
+ continue;
+ // if a sub directory and recursive, save sub directory
+ if (S_ISDIR(statbuf.st_mode) && isRecursive)
+ {
+ if (isPathExclued(entryFilepath))
+ printMsg("exclude " + entryFilepath.substr(mainDirectoryLength));
+ else
+ subDirectory.push_back(entryFilepath);
+ continue;
+ }
+
+ // if a file, save file name
+ if (S_ISREG(statbuf.st_mode))
+ {
+ // check exclude before wildcmp to avoid "unmatched exclude" error
+ bool isExcluded = isPathExclued(entryFilepath);
+ // save file name if wildcard match
+ if (wildcmp(wildcard.c_str(), entry->d_name))
+ {
+ if (isExcluded)
+ printMsg("exclude " + entryFilepath.substr(mainDirectoryLength));
+ else
+ fileName.push_back(entryFilepath);
+ }
+ }
+ }
+
+ if (closedir(dp) != 0)
+ {
+ perror("errno message");
+ error("Error reading directory", directory.c_str());
+ }
+
+ // sort the current entries for fileName
+ if (firstEntry < fileName.size())
+ sort(&fileName[firstEntry], &fileName[fileName.size()]);
+
+ // recurse into sub directories
+ // if not doing recursive, subDirectory is empty
+ if (subDirectory.size() > 1)
+ sort(subDirectory.begin(), subDirectory.end());
+ for (unsigned i = 0; i < subDirectory.size(); i++)
+ {
+ getFileNames(subDirectory[i], wildcard);
+ }
+
+ return;
+}
+
+#endif // _WIN32
+
+// check files for 16 or 32 bit encoding
+// the file must have a Byte Order Mark (BOM)
+// NOTE: some string functions don't work with NULLs (e.g. length())
+FileEncoding ASConsole::getFileEncoding(ifstream& in) const
+{
+ // BOM max is 4 bytes
+ char buff[4] = {'\0'};
+ in.read(buff, 4);
+ in.seekg(0);
+
+ FileEncoding encoding = ENCODING_OK;
+
+ if (memcmp(buff, "\x00\x00\xFE\xFF", 4) == 0)
+ encoding = UTF_32BE;
+ else if (memcmp(buff, "\xFF\xFE\x00\x00", 4) == 0)
+ encoding = UTF_32LE;
+ else if (memcmp(buff, "\xFE\xFF", 2) == 0)
+ encoding = UTF_16BE;
+ else if (memcmp(buff, "\xFF\xFE", 2) == 0)
+ encoding = UTF_16LE;
+
+ return encoding;
+}
+
+// get individual file names from the command-line file path
+void ASConsole::getFilePaths(string &filePath)
+{
+ fileName.clear();
+ targetDirectory = string();
+ targetFilename = string();
+
+ // separate directory and file name
+ size_t separator = filePath.find_last_of(g_fileSeparator);
+ if (separator == string::npos)
+ {
+ // if no directory is present, use the currently active directory
+ targetDirectory = getCurrentDirectory(filePath);
+ targetFilename = filePath;
+ mainDirectoryLength = targetDirectory.length() + 1; // +1 includes trailing separator
+ }
+ else
+ {
+ targetDirectory = filePath.substr(0, separator);
+ targetFilename = filePath.substr(separator+1);
+ mainDirectoryLength = targetDirectory.length() + 1; // +1 includes trailing separator
+ }
+
+ if (targetFilename.length() == 0)
+ error("Missing filename in", filePath.c_str());
+
+ // check filename for wildcards
+ hasWildcard = false;
+ if (targetFilename.find_first_of( "*?") != string::npos)
+ hasWildcard = true;
+
+ // clear exclude hits vector
+ for (size_t ix = 0; ix < excludeHitsVector.size(); ix++)
+ excludeHitsVector[ix] = false;
+
+ // display directory name for wildcard processing
+ if (hasWildcard)
+ {
+ printMsg("--------------------------------------------------");
+ printMsg("directory " + targetDirectory + g_fileSeparator + targetFilename);
+ }
+
+ // create a vector of paths and file names to process
+ if (hasWildcard || isRecursive)
+ getFileNames(targetDirectory, targetFilename);
+ else
+ fileName.push_back(targetDirectory + g_fileSeparator + targetFilename);
+
+ if (hasWildcard)
+ printMsg("--------------------------------------------------");
+
+ // check for unprocessed excludes
+ bool excludeErr = false;
+ for (size_t ix = 0; ix < excludeHitsVector.size(); ix++)
+ {
+ if (excludeHitsVector[ix] == false)
+ {
+ (*_err) << "Unmatched exclude " << excludeVector[ix].c_str() << endl;
+ excludeErr = true;
+ }
+ }
+#ifndef ASTYLECON_LIB
+ // abort if not a test
+ if (excludeErr)
+ exit(EXIT_FAILURE);
+#endif
+ // check if files were found (probably an input error if not)
+ if (fileName.size() == 0)
+ (*_err) << "No file to process " << filePath.c_str() << endl;
+}
+
+bool ASConsole::fileNameVectorIsEmpty()
+{
+ return fileNameVector.empty();
+}
+
+// compare a path to the exclude vector
+// used for both directories and filenames
+// updates the g_excludeHitsVector
+// return true if a match
+bool ASConsole::isPathExclued(const string &subPath)
+{
+ bool retVal = false;
+
+ // read the exclude vector checking for a match
+ for (size_t i = 0; i < excludeVector.size(); i++)
+ {
+ string exclude = excludeVector[i];
+
+ if (subPath.length() < exclude.length())
+ continue;
+
+ size_t compareStart = subPath.length() - exclude.length();
+ // subPath compare must start with a directory name
+ if (compareStart > 0)
+ {
+ char lastPathChar = subPath[compareStart - 1];
+ if (lastPathChar != g_fileSeparator)
+ continue;
+ }
+
+ string compare = subPath.substr(compareStart);
+ if (!g_isCaseSensitive)
+ {
+ // make it case insensitive for Windows
+ for (size_t j=0; j<compare.length(); j++)
+ compare[j] = (char)tolower(compare[j]);
+ for (size_t j=0; j<exclude.length(); j++)
+ exclude[j] = (char)tolower(exclude[j]);
+ }
+ // compare sub directory to exclude data - must check them all
+ if (compare == exclude)
+ {
+ excludeHitsVector[i] = true;
+ retVal = true;
+ break;
+ }
+ }
+ return retVal;
+}
+
+void ASConsole::printHelp() const
+{
+ (*_err) << endl;
+ (*_err) << " Artistic Style " << _version << endl;
+ (*_err) << " Maintained by: Jim Pattee\n";
+ (*_err) << " Original Author: Tal Davidson\n";
+ (*_err) << endl;
+ (*_err) << "Usage : astyle [options] Source1.cpp Source2.cpp [...]\n";
+ (*_err) << " astyle [options] < Original > Beautified\n";
+ (*_err) << endl;
+ (*_err) << "When indenting a specific file, the resulting indented file RETAINS the\n";
+ (*_err) << "original file-name. The original pre-indented file is renamed, with a\n";
+ (*_err) << "suffix of \".orig\" added to the original filename.\n";
+ (*_err) << endl;
+ (*_err) << "Wildcards (* and ?) may be used in the filename.\n";
+ (*_err) << "A \'recursive\' option can process directories recursively.\n";
+ (*_err) << endl;
+ (*_err) << "By default, astyle is set up to indent C/C++/C#/Java files, with four\n";
+ (*_err) << "spaces per indent, a maximal indentation of 40 spaces inside continuous\n";
+ (*_err) << "statements, a minimum indentation of eight spaces inside conditional\n";
+ (*_err) << "statements, and NO formatting options.\n";
+ (*_err) << endl;
+ (*_err) << "Option's Format:\n";
+ (*_err) << "----------------\n";
+ (*_err) << " Long options (starting with '--') must be written one at a time.\n";
+ (*_err) << " Short options (starting with '-') may be appended together.\n";
+ (*_err) << " Thus, -bps4 is the same as -b -p -s4.\n";
+ (*_err) << endl;
+ (*_err) << "Predefined Style Options:\n";
+ (*_err) << "-------------------------\n";
+ (*_err) << " --style=allman OR --style=ansi OR --style=bsd OR -A1\n";
+ (*_err) << " Allman style formatting/indenting.\n";
+ (*_err) << " Broken brackets.\n";
+ (*_err) << endl;
+ (*_err) << " --style=java OR -A2\n";
+ (*_err) << " Java style formatting/indenting.\n";
+ (*_err) << " Attached brackets.\n";
+ (*_err) << endl;
+ (*_err) << " --style=k&r OR --style=k/r OR -A3\n";
+ (*_err) << " Kernighan & Ritchie style formatting/indenting.\n";
+ (*_err) << " Linux brackets.\n";
+ (*_err) << endl;
+ (*_err) << " --style=stroustrup OR -A4\n";
+ (*_err) << " Stroustrup style formatting/indenting.\n";
+ (*_err) << " Stroustrup brackets.\n";
+ (*_err) << endl;
+ (*_err) << " --style=whitesmith OR -A5\n";
+ (*_err) << " Whitesmith style formatting/indenting.\n";
+ (*_err) << " Broken, indented brackets.\n";
+ (*_err) << " Indented class blocks and switch blocks.\n";
+ (*_err) << endl;
+ (*_err) << " --style=banner OR -A6\n";
+ (*_err) << " Banner style formatting/indenting.\n";
+ (*_err) << " Attached, indented brackets.\n";
+ (*_err) << " Indented class blocks and switch blocks.\n";
+ (*_err) << endl;
+ (*_err) << " --style=gnu OR -A7\n";
+ (*_err) << " GNU style formatting/indenting.\n";
+ (*_err) << " Broken brackets, indented blocks, indent is 2 spaces.\n";
+ (*_err) << endl;
+ (*_err) << " --style=linux OR -A8\n";
+ (*_err) << " GNU style formatting/indenting.\n";
+ (*_err) << " Linux brackets, indent is 8 spaces.\n";
+ (*_err) << endl;
+ (*_err) << " --style=horstmann OR -A9\n";
+ (*_err) << " Horstmann style formatting/indenting.\n";
+ (*_err) << " Horstmann brackets, indented switches, indent is 3 spaces.\n";
+ (*_err) << endl;
+ (*_err) << " --style=1tbs OR --style=otbs OR -A10\n";
+ (*_err) << " One True Brace Style formatting/indenting.\n";
+ (*_err) << " Linux brackets, add brackets to all conditionals.\n";
+ (*_err) << endl;
+ (*_err) << "Tab and Bracket Options:\n";
+ (*_err) << "------------------------\n";
+ (*_err) << " default indent option\n";
+ (*_err) << " If no indentation option is set,\n";
+ (*_err) << " the default option of 4 spaces will be used.\n";
+ (*_err) << endl;
+ (*_err) << " --indent=spaces=# OR -s#\n";
+ (*_err) << " Indent using # spaces per indent. Not specifying #\n";
+ (*_err) << " will result in a default of 4 spaces per indent.\n";
+ (*_err) << endl;
+ (*_err) << " --indent=tab OR --indent=tab=# OR -t OR -t#\n";
+ (*_err) << " Indent using tab characters, assuming that each\n";
+ (*_err) << " tab is # spaces long. Not specifying # will result\n";
+ (*_err) << " in a default assumption of 4 spaces per tab.\n";
+ (*_err) << endl;
+ (*_err) << " --indent=force-tab=# OR -T#\n";
+ (*_err) << " Indent using tab characters, assuming that each\n";
+ (*_err) << " tab is # spaces long. Force tabs to be used in areas\n";
+ (*_err) << " Astyle would prefer to use spaces.\n";
+ (*_err) << endl;
+ (*_err) << " default brackets option\n";
+ (*_err) << " If no brackets option is set,\n";
+ (*_err) << " the brackets will not be changed.\n";
+ (*_err) << endl;
+ (*_err) << " --brackets=break OR -b\n";
+ (*_err) << " Break brackets from pre-block code (i.e. ANSI C/C++ style).\n";
+ (*_err) << endl;
+ (*_err) << " --brackets=attach OR -a\n";
+ (*_err) << " Attach brackets to pre-block code (i.e. Java/K&R style).\n";
+ (*_err) << endl;
+ (*_err) << " --brackets=linux OR -l\n";
+ (*_err) << " Break definition-block brackets and attach command-block\n";
+ (*_err) << " brackets.\n";
+ (*_err) << endl;
+ (*_err) << " --brackets=stroustrup OR -u\n";
+ (*_err) << " Attach all brackets except function definition brackets.\n";
+ (*_err) << endl;
+ (*_err) << " --brackets=horstmann OR -g\n";
+ (*_err) << " Break brackets from pre-block code, but allow following\n";
+ (*_err) << " run-in statements on the same line as an opening bracket.\n";
+ (*_err) << endl;
+ (*_err) << "Indentation options:\n";
+ (*_err) << "--------------------\n";
+ (*_err) << " --indent-classes OR -C\n";
+ (*_err) << " Indent 'class' blocks, so that the inner 'public:',\n";
+ (*_err) << " 'protected:' and 'private: headers are indented in\n";
+ (*_err) << " relation to the class block.\n";
+ (*_err) << endl;
+ (*_err) << " --indent-switches OR -S\n";
+ (*_err) << " Indent 'switch' blocks, so that the inner 'case XXX:'\n";
+ (*_err) << " headers are indented in relation to the switch block.\n";
+ (*_err) << endl;
+ (*_err) << " --indent-cases OR -K\n";
+ (*_err) << " Indent case blocks from the 'case XXX:' headers.\n";
+ (*_err) << " Case statements not enclosed in blocks are NOT indented.\n";
+ (*_err) << endl;
+ (*_err) << " --indent-brackets OR -B\n";
+ (*_err) << " Add extra indentation to '{' and '}' block brackets.\n";
+ (*_err) << endl;
+ (*_err) << " --indent-blocks OR -G\n";
+ (*_err) << " Add extra indentation entire blocks (including brackets).\n";
+ (*_err) << endl;
+ (*_err) << " --indent-namespaces OR -N\n";
+ (*_err) << " Indent the contents of namespace blocks.\n";
+ (*_err) << endl;
+ (*_err) << " --indent-labels OR -L\n";
+ (*_err) << " Indent labels so that they appear one indent less than\n";
+ (*_err) << " the current indentation level, rather than being\n";
+ (*_err) << " flushed completely to the left (which is the default).\n";
+ (*_err) << endl;
+ (*_err) << " --indent-preprocessor OR -w\n";
+ (*_err) << " Indent multi-line #define statements.\n";
+ (*_err) << endl;
+ (*_err) << " --indent-col1-comments OR -Y\n";
+ (*_err) << " Indent line comments that start in column one.\n";
+ (*_err) << endl;
+ (*_err) << " --max-instatement-indent=# OR -M#\n";
+ (*_err) << " Indent a maximal # spaces in a continuous statement,\n";
+ (*_err) << " relative to the previous line.\n";
+ (*_err) << endl;
+ (*_err) << " --min-conditional-indent=# OR -m#\n";
+ (*_err) << " Indent a minimal # spaces in a continuous conditional\n";
+ (*_err) << " belonging to a conditional header.\n";
+ (*_err) << endl;
+ (*_err) << "Padding options:\n";
+ (*_err) << "--------------------\n";
+ (*_err) << " --break-blocks OR -f\n";
+ (*_err) << " Insert empty lines around unrelated blocks, labels, classes, ...\n";
+ (*_err) << endl;
+ (*_err) << " --break-blocks=all OR -F\n";
+ (*_err) << " Like --break-blocks, except also insert empty lines \n";
+ (*_err) << " around closing headers (e.g. 'else', 'catch', ...).\n";
+ (*_err) << endl;
+ (*_err) << " --pad-oper OR -p\n";
+ (*_err) << " Insert space paddings around operators.\n";
+ (*_err) << endl;
+ (*_err) << " --pad-paren OR -P\n";
+ (*_err) << " Insert space padding around parenthesis on both the outside\n";
+ (*_err) << " and the inside.\n";
+ (*_err) << endl;
+ (*_err) << " --pad-paren-out OR -d\n";
+ (*_err) << " Insert space padding around parenthesis on the outside only.\n";
+ (*_err) << endl;
+ (*_err) << " --pad-paren-in OR -D\n";
+ (*_err) << " Insert space padding around parenthesis on the inside only.\n";
+ (*_err) << endl;
+ (*_err) << " --pad-header OR -H\n";
+ (*_err) << " Insert space padding after paren headers (e.g. 'if', 'for'...).\n";
+ (*_err) << endl;
+ (*_err) << " --unpad-paren OR -U\n";
+ (*_err) << " Remove unnecessary space padding around parenthesis. This\n";
+ (*_err) << " can be used in combination with the 'pad' options above.\n";
+ (*_err) << endl;
+ (*_err) << " --delete-empty-lines OR -x\n";
+ (*_err) << " Delete empty lines within a function or method.\n";
+ (*_err) << " It will NOT delete lines added by the break-blocks options.\n";
+ (*_err) << endl;
+ (*_err) << " --fill-empty-lines OR -E\n";
+ (*_err) << " Fill empty lines with the white space of their\n";
+ (*_err) << " previous lines.\n";
+ (*_err) << endl;
+ (*_err) << "Formatting options:\n";
+ (*_err) << "-------------------\n";
+ (*_err) << " --break-closing-brackets OR -y\n";
+ (*_err) << " Break brackets before closing headers (e.g. 'else', 'catch', ...).\n";
+ (*_err) << " Use with --brackets=attach, --brackets=linux, \n";
+ (*_err) << " or --brackets=stroustrup.\n";
+ (*_err) << endl;
+ (*_err) << " --break-elseifs OR -e\n";
+ (*_err) << " Break 'else if()' statements into two different lines.\n";
+ (*_err) << endl;
+ (*_err) << " --add-brackets OR -j\n";
+ (*_err) << " Add brackets to unbracketed one line conditional statements.\n";
+ (*_err) << endl;
+ (*_err) << " --add-one-line-brackets OR -J\n";
+ (*_err) << " Add one line brackets to unbracketed one line conditional\n";
+ (*_err) << " statements.\n";
+ (*_err) << endl;
+ (*_err) << " --keep-one-line-blocks OR -O\n";
+ (*_err) << " Don't break blocks residing completely on one line.\n";
+ (*_err) << endl;
+ (*_err) << " --keep-one-line-statements OR -o\n";
+ (*_err) << " Don't break lines containing multiple statements into\n";
+ (*_err) << " multiple single-statement lines.\n";
+ (*_err) << endl;
+ (*_err) << " --convert-tabs OR -c\n";
+ (*_err) << " Convert tabs to the appropriate number of spaces.\n";
+ (*_err) << endl;
+ (*_err) << " --align-pointer=type OR -k1\n";
+ (*_err) << " --align-pointer=middle OR -k2\n";
+ (*_err) << " --align-pointer=name OR -k3\n";
+ (*_err) << " Attach a pointer or reference operator (* or &) to either\n";
+ (*_err) << " the operator type (left), middle, or operator name (right).\n";
+ (*_err) << endl;
+ (*_err) << " --mode=c\n";
+ (*_err) << " Indent a C or C++ source file (this is the default).\n";
+ (*_err) << endl;
+ (*_err) << " --mode=java\n";
+ (*_err) << " Indent a Java source file.\n";
+ (*_err) << endl;
+ (*_err) << " --mode=cs\n";
+ (*_err) << " Indent a C# source file.\n";
+ (*_err) << endl;
+ (*_err) << "Other options:\n";
+ (*_err) << "--------------\n";
+ (*_err) << " --suffix=####\n";
+ (*_err) << " Append the suffix #### instead of '.orig' to original filename.\n";
+ (*_err) << endl;
+ (*_err) << " --suffix=none OR -n\n";
+ (*_err) << " Do not retain a backup of the original file.\n";
+ (*_err) << endl;
+ (*_err) << " --options=####\n";
+ (*_err) << " Specify an options file #### to read and use.\n";
+ (*_err) << endl;
+ (*_err) << " --options=none\n";
+ (*_err) << " Disable the default options file.\n";
+ (*_err) << " Only the command-line parameters will be used.\n";
+ (*_err) << endl;
+ (*_err) << " --recursive OR -r OR -R\n";
+ (*_err) << " Process subdirectories recursively.\n";
+ (*_err) << endl;
+ (*_err) << " --exclude=####\n";
+ (*_err) << " Specify a file or directory #### to be excluded from processing.\n";
+ (*_err) << endl;
+ (*_err) << " --errors-to-stdout OR -X\n";
+ (*_err) << " Print errors and help information to standard-output rather than\n";
+ (*_err) << " to standard-error.\n";
+ (*_err) << endl;
+ (*_err) << " --preserve-date OR -Z\n";
+ (*_err) << " The date and time modified will not be changed in the formatted file.\n";
+ (*_err) << endl;
+ (*_err) << " --verbose OR -v\n";
+ (*_err) << " Verbose mode. Extra informational messages will be displayed.\n";
+ (*_err) << endl;
+ (*_err) << " --formatted OR -Q\n";
+ (*_err) << " Formatted display mode. Display only the files that have been formatted.\n";
+ (*_err) << endl;
+ (*_err) << " --quiet OR -q\n";
+ (*_err) << " Quiet mode. Suppress all output except error messages.\n";
+ (*_err) << endl;
+ (*_err) << " --lineend=windows OR -z1\n";
+ (*_err) << " --lineend=linux OR -z2\n";
+ (*_err) << " --lineend=macold OR -z3\n";
+ (*_err) << " Force use of the specified line end style. Valid options\n";
+ (*_err) << " are windows (CRLF), linux (LF), and macold (CR).\n";
+ (*_err) << endl;
+ (*_err) << " --version OR -V\n";
+ (*_err) << " Print version number.\n";
+ (*_err) << endl;
+ (*_err) << " --help OR -h OR -?\n";
+ (*_err) << " Print this help message.\n";
+ (*_err) << endl;
+ (*_err) << "Default options file:\n";
+ (*_err) << "---------------------\n";
+ (*_err) << " Artistic Style looks for a default options file in the\n";
+ (*_err) << " following order:\n";
+ (*_err) << " 1. The contents of the ARTISTIC_STYLE_OPTIONS environment\n";
+ (*_err) << " variable if it exists.\n";
+ (*_err) << " 2. The file called .astylerc in the directory pointed to by the\n";
+ (*_err) << " HOME environment variable ( i.e. $HOME/.astylerc ).\n";
+ (*_err) << " 3. The file called astylerc in the directory pointed to by the\n";
+ (*_err) << " USERPROFILE environment variable ( i.e. %USERPROFILE%\\astylerc ).\n";
+ (*_err) << " If a default options file is found, the options in this file\n";
+ (*_err) << " will be parsed BEFORE the command-line options.\n";
+ (*_err) << " Long options within the default option file may be written without\n";
+ (*_err) << " the preliminary '--'.\n";
+ (*_err) << endl;
+}
+
+
+/**
+ * Process files in the fileNameVector.
+ *
+ * @param formatter The formatter object.
+ */
+void ASConsole::processFiles(ASFormatter &formatter)
+{
+ if (isVerbose)
+ printVerboseHeader();
+
+ clock_t startTime = clock(); // start time of file formatting
+
+ // loop thru input fileNameVector and process the files
+ for (size_t i = 0; i < fileNameVector.size(); i++)
+ {
+ getFilePaths(fileNameVector[i]);
+
+ // loop thru fileName vector formatting the files
+ for (size_t j = 0; j < fileName.size(); j++)
+ formatFile(fileName[j], formatter);
+ }
+
+ // files are processed, display stats
+ if (isVerbose)
+ printVerboseStats(startTime);
+
+}
+
+// process options from the command line and options file
+// build the vectors fileNameVector, excludeVector, optionsVector, and fileOptionsVector
+processReturn ASConsole::processOptions(int argc, char** argv, ASFormatter &formatter)
+{
+ string arg;
+ bool ok = true;
+ bool shouldParseOptionsFile = true;
+
+ // get command line options
+ for (int i = 1; i < argc; i++)
+ {
+ arg = string(argv[i]);
+
+ if ( IS_OPTION(arg, "--options=none") )
+ {
+ shouldParseOptionsFile = false;
+ }
+ else if ( isParamOption(arg, "--options=") )
+ {
+ optionsFileName = GET_PARAM(arg, "--options=");
+ optionsFileRequired = true;
+ if (optionsFileName.compare("") == 0)
+ setOptionsFileName(" ");
+ }
+ else if ( IS_OPTION(arg, "-h")
+ || IS_OPTION(arg, "--help")
+ || IS_OPTION(arg, "-?") )
+ {
+ printHelp();
+ return(END_SUCCESS);
+ }
+ else if ( IS_OPTION(arg, "-V" )
+ || IS_OPTION(arg, "--version") )
+ {
+ (*_err) << "Artistic Style Version " << _version << endl;
+ return(END_SUCCESS);
+ }
+ else if (arg[0] == '-')
+ {
+ optionsVector.push_back(arg);
+ }
+ else // file-name
+ {
+ standardizePath(arg);
+ fileNameVector.push_back(arg);
+ }
+ }
+
+ // get options file path and name
+ if (shouldParseOptionsFile)
+ {
+ if (optionsFileName.compare("") == 0)
+ {
+ char* env = getenv("ARTISTIC_STYLE_OPTIONS");
+ if (env != NULL)
+ setOptionsFileName(env);
+ }
+ if (optionsFileName.compare("") == 0)
+ {
+ char* env = getenv("HOME");
+ if (env != NULL)
+ setOptionsFileName(string(env) + "/.astylerc");
+ }
+ if (optionsFileName.compare("") == 0)
+ {
+ char* env = getenv("USERPROFILE");
+ if (env != NULL)
+ setOptionsFileName(string(env) + "/astylerc");
+ }
+ if (optionsFileName.compare("") != 0)
+ standardizePath(optionsFileName);
+ }
+
+ // create the options file vector and parse the options for errors
+ if (optionsFileName.compare("") != 0)
+ {
+ ifstream optionsIn(optionsFileName.c_str());
+ if (optionsIn)
+ {
+ importOptions(optionsIn, fileOptionsVector);
+ ok = parseOptions(formatter,
+ fileOptionsVector.begin(),
+ fileOptionsVector.end(),
+ string("Invalid option in default options file: "));
+ }
+ else
+ {
+ if (optionsFileRequired)
+ {
+ (*_err) << "Could not open options file: " << optionsFileName.c_str() << endl;
+ return (END_FAILURE);
+ }
+ optionsFileName.clear();
+ }
+ optionsIn.close();
+ }
+ if (!ok)
+ {
+ (*_err) << "For help on options, type 'astyle -h' " << endl;
+ return(END_FAILURE);
+ }
+
+ // parse the command line options vector for errors
+ ok = parseOptions(formatter,
+ optionsVector.begin(),
+ optionsVector.end(),
+ string("Invalid command line option: "));
+ if (!ok)
+ {
+ (*_err) << "For help on options, type 'astyle -h' \n" << endl;
+ return(END_FAILURE);
+ }
+ return(CONTINUE);
+}
+
+// remove a file and check for an error
+void ASConsole::removeFile(const char* fileName, const char* errMsg) const
+{
+ remove(fileName);
+ if (errno == ENOENT) // no file is OK
+ errno = 0;
+ if (errno)
+ {
+ perror("errno message");
+ error(errMsg, fileName);
+ }
+}
+
+// rename a file and check for an error
+void ASConsole::renameFile(const char* oldFileName, const char* newFileName, const char* errMsg) const
+{
+ rename(oldFileName, newFileName);
+ // if file still exists the remove needs more time - retry
+ if (errno == EEXIST)
+ {
+ errno = 0;
+ waitForRemove(newFileName);
+ rename(oldFileName, newFileName);
+ }
+ if (errno)
+ {
+ perror("errno message");
+ error(errMsg, oldFileName);
+ }
+}
+
+// make sure file separators are correct type (Windows or Linux)
+// remove ending file separator
+// remove beginning file separator if requested and NOT a complete file path
+void ASConsole::standardizePath(string &path, bool removeBeginningSeparator /*false*/) const
+{
+#ifdef __VMS
+ struct FAB fab;
+ struct NAML naml;
+ char less[NAML$C_MAXRSS];
+ char sess[NAM$C_MAXRSS];
+ int r0_status;
+
+ // If we are on a VMS system, translate VMS style filenames to unix
+ // style.
+ fab = cc$rms_fab;
+ fab.fab$l_fna = (char *)-1;
+ fab.fab$b_fns = 0;
+ fab.fab$l_naml = &naml;
+ naml = cc$rms_naml;
+ strcpy (sess, path.c_str());
+ naml.naml$l_long_filename = (char *)sess;
+ naml.naml$l_long_filename_size = path.length();
+ naml.naml$l_long_expand = less;
+ naml.naml$l_long_expand_alloc = sizeof (less);
+ naml.naml$l_esa = sess;
+ naml.naml$b_ess = sizeof (sess);
+ naml.naml$v_no_short_upcase = 1;
+ r0_status = sys$parse (&fab);
+ if (r0_status == RMS$_SYN)
+ {
+ error("File syntax error", path.c_str());
+ }
+ else
+ {
+ if (!$VMS_STATUS_SUCCESS(r0_status))
+ {
+ (void)lib$signal (r0_status);
+ }
+ }
+ less[naml.naml$l_long_expand_size - naml.naml$b_ver] = '\0';
+ sess[naml.naml$b_esl - naml.naml$b_ver] = '\0';
+ if (naml.naml$l_long_expand_size > naml.naml$b_esl)
+ {
+ path = decc$translate_vms (less);
+ }
+ else
+ {
+ path = decc$translate_vms (sess);
+ }
+#endif /* __VMS */
+
+ // make sure separators are correct type (Windows or Linux)
+ for (size_t i = 0; i < path.length(); i++)
+ {
+ i = path.find_first_of("/\\", i);
+ if (i == string::npos)
+ break;
+ path[i] = g_fileSeparator;
+ }
+ // remove separator from the end
+ if (path[path.length()-1] == g_fileSeparator)
+ path.erase(path.length()-1, 1);
+ // remove beginning separator if requested
+ if (removeBeginningSeparator && (path[0] == g_fileSeparator))
+ path.erase(0, 1);
+}
+
+void ASConsole::printMsg(const string &msg) const
+{
+ if (isQuiet)
+ return;
+ cout << msg << endl;
+}
+
+void ASConsole::printVerboseHeader() const
+{
+ assert(isVerbose);
+ if (isQuiet)
+ return;
+ cout << "Artistic Style " << _version << endl;
+ if (optionsFileName.compare("") != 0)
+ cout << "Using default options file " << optionsFileName << endl;
+}
+
+void ASConsole::printVerboseStats(clock_t startTime) const
+{
+ assert(isVerbose);
+ if (isQuiet)
+ return;
+ if (hasWildcard)
+ cout << "--------------------------------------------------" << endl;
+ cout << filesFormatted << " formatted, ";
+ cout << filesUnchanged << " unchanged, ";
+
+ // show processing time
+ clock_t stopTime = clock();
+ float secs = float ((stopTime - startTime) / CLOCKS_PER_SEC);
+ if (secs < 60)
+ {
+ // show tenths of a second if time is less than 20 seconds
+ cout.precision(2);
+ if (secs >= 10 && secs < 20)
+ cout.precision(3);
+ cout << secs << " seconds, ";
+ cout.precision(0);
+ }
+ else
+ {
+ // show minutes and seconds if time is greater than one minute
+ int min = (int) secs / 60;
+ secs -= min * 60;
+ int minsec = int (secs + .5);
+ cout << min << " min " << minsec << " sec, ";
+ }
+
+ cout << linesOut << " lines" << endl;
+}
+
+bool ASConsole::stringEndsWith(const string &str, const string &suffix) const
+{
+ int strIndex = (int) str.length() - 1;
+ int suffixIndex = (int) suffix.length() - 1;
+
+ while (strIndex >= 0 && suffixIndex >= 0)
+ {
+ if (tolower(str[strIndex]) != tolower(suffix[suffixIndex]))
+ return false;
+
+ --strIndex;
+ --suffixIndex;
+ }
+ // suffix longer than string
+ if (strIndex < 0 && suffixIndex >= 0)
+ return false;
+ return true;
+}
+
+void ASConsole::updateExcludeVector(string suffixParam)
+{
+ excludeVector.push_back(suffixParam);
+ standardizePath(excludeVector.back(), true);
+ excludeHitsVector.push_back(false);
+}
+
+void ASConsole::sleep(int seconds) const
+{
+ clock_t endwait;
+ endwait = clock_t (clock () + seconds * CLOCKS_PER_SEC);
+ while (clock() < endwait) {}
+}
+
+int ASConsole::waitForRemove(const char* newFileName) const
+{
+ struct stat stBuf;
+ int seconds;
+ // sleep a max of 20 seconds for the remove
+ for (seconds = 0; seconds < 20; seconds++)
+ {
+ sleep(1);
+ if (stat(newFileName, &stBuf) != 0)
+ break;
+ }
+ errno = 0;
+ return seconds;
+}
+
+// From The Code Project http://www.codeproject.com/string/wildcmp.asp
+// Written by Jack Handy - jakkhandy@hotmail.com
+// Modified to compare case insensitive for Windows
+int ASConsole::wildcmp(const char *wild, const char *data) const
+{
+ const char *cp = NULL, *mp = NULL;
+ bool cmpval;
+
+ while ((*data) && (*wild != '*'))
+ {
+ if (!g_isCaseSensitive)
+ cmpval = (tolower(*wild) != tolower(*data)) && (*wild != '?');
+ else
+ cmpval = (*wild != *data) && (*wild != '?');
+
+ if (cmpval)
+ {
+ return 0;
+ }
+ wild++;
+ data++;
+ }
+
+ while (*data)
+ {
+ if (*wild == '*')
+ {
+ if (!*++wild)
+ {
+ return 1;
+ }
+ mp = wild;
+ cp = data+1;
+ }
+ else
+ {
+ if (!g_isCaseSensitive)
+ cmpval = (tolower(*wild) == tolower(*data) || (*wild == '?'));
+ else
+ cmpval = (*wild == *data) || (*wild == '?');
+
+ if (cmpval)
+ {
+ wild++;
+ data++;
+ }
+ else
+ {
+ wild = mp;
+ data = cp++;
+ }
+ }
+ }
+
+ while (*wild == '*')
+ {
+ wild++;
+ }
+ return !*wild;
+}
+
+void ASConsole::writeOutputFile(const string &fileName, ostringstream &out) const
+{
+ // save date accessed and date modified of original file
+ struct stat stBuf;
+ bool statErr = false;
+ if (stat(fileName.c_str(), &stBuf) == -1)
+ statErr = true;
+
+ // create a backup
+ if (!noBackup)
+ {
+ string origFileName = fileName + origSuffix;
+ removeFile(origFileName.c_str(), "Could not remove pre-existing backup file");
+ renameFile(fileName.c_str(), origFileName.c_str(), "Could not create backup file");
+ }
+
+ // write the output file
+ ofstream fout(fileName.c_str(), ios::binary | ios::trunc);
+ if (!fout)
+ error("Could not open output file", fileName.c_str());
+ fout << out.str();
+ fout.close();
+
+ // change date modified to original file date
+ if (preserveDate)
+ {
+ if (!statErr)
+ {
+ struct utimbuf outBuf;
+ outBuf.actime = stBuf.st_atime;
+ // add ticks so 'make' will recoginze a change
+ // Visual Studio 2008 needs more than 1
+ outBuf.modtime = stBuf.st_mtime + 10;
+ if (utime(fileName.c_str(), &outBuf) == -1)
+ statErr = true;
+ }
+ if (statErr)
+ (*_err) << "********* could not preserve following file date" << endl;
+ }
+}
+
+#endif
+// ******************* end of console functions ***********************************************
+
+} // end of namespace astyle
+
+// ******************* end of astyle namespace ***********************************************
+
+using namespace astyle;
+
+#ifdef ASTYLE_JNI
+// ************************* JNI functions *****************************************************
+// called by a java program to get the version number
+// the function name is constructed from method names in the calling java program
+extern "C" EXPORT
+jstring STDCALL Java_AStyleInterface_AStyleGetVersion(JNIEnv* env, jclass)
+{
+ return env->NewStringUTF(_version);
+}
+
+// called by a java program to format the source code
+// the function name is constructed from method names in the calling java program
+extern "C" EXPORT
+jstring STDCALL Java_AStyleInterface_AStyleMain(JNIEnv* env,
+ jobject obj,
+ jstring textInJava,
+ jstring optionsJava)
+{
+ g_env = env; // make object available globally
+ g_obj = obj; // make object available globally
+
+ jstring textErr = env->NewStringUTF(""); // zero length text returned if an error occurs
+
+ // get the method ID
+ jclass cls = env->GetObjectClass(obj);
+ g_mid = env->GetMethodID(cls, "ErrorHandler","(ILjava/lang/String;)V");
+ if (g_mid == 0)
+ {
+ cout << "Cannot find java method ErrorHandler" << endl;
+ return textErr;
+ }
+
+ // convert jstring to char*
+ const char* textIn = env->GetStringUTFChars(textInJava, NULL);
+ const char* options = env->GetStringUTFChars(optionsJava, NULL);
+
+ // call the C++ formatting function
+ char* textOut = AStyleMain(textIn, options, javaErrorHandler, javaMemoryAlloc);
+ // if an error message occurred it was displayed by errorHandler
+ if (textOut == NULL)
+ return textErr;
+
+ // release memory
+ jstring textOutJava = env->NewStringUTF(textOut);
+ delete [] textOut;
+ env->ReleaseStringUTFChars(textInJava, textIn);
+ env->ReleaseStringUTFChars(optionsJava, options);
+
+ return textOutJava;
+}
+
+// Call the Java error handler
+void STDCALL javaErrorHandler(int errorNumber, char* errorMessage)
+{
+ jstring errorMessageJava = g_env->NewStringUTF(errorMessage);
+ g_env->CallVoidMethod(g_obj, g_mid, errorNumber, errorMessageJava);
+}
+
+// Allocate memory for the formatted text
+char* STDCALL javaMemoryAlloc(unsigned long memoryNeeded)
+{
+ // error condition is checked after return from AStyleMain
+ char* buffer = new(nothrow) char [memoryNeeded];
+ return buffer;
+}
+#endif
+
+#ifdef ASTYLE_LIB
+// ************************* GUI functions ****************************************************
+/*
+ * IMPORTANT VC DLL linker must have the parameter /EXPORT:AStyleMain=_AStyleMain@16
+ * /EXPORT:AStyleGetVersion=_AStyleGetVersion@0
+ */
+extern "C" EXPORT char* STDCALL
+AStyleMain(const char* pSourceIn, // pointer to the source to be formatted
+ const char* pOptions, // pointer to AStyle options, separated by \n
+ fpError fpErrorHandler, // pointer to error handler function
+ fpAlloc fpMemoryAlloc) // pointer to memory allocation function
+{
+ if (fpErrorHandler == NULL) // cannot display a message if no error handler
+ return NULL;
+
+ if (pSourceIn == NULL)
+ {
+ fpErrorHandler(101, (char*)"No pointer to source input.");
+ return NULL;
+ }
+ if (pOptions == NULL)
+ {
+ fpErrorHandler(102, (char*)"No pointer to AStyle options.");
+ return NULL;
+ }
+ if (fpMemoryAlloc == NULL)
+ {
+ fpErrorHandler(103, (char*)"No pointer to memory allocation function.");
+ return NULL;
+ }
+
+ ASFormatter formatter;
+
+ vector<string> optionsVector;
+ istringstream opt(pOptions);
+ _err = new stringstream;
+
+ importOptions(opt, optionsVector);
+
+ parseOptions(formatter,
+ optionsVector.begin(),
+ optionsVector.end(),
+ "Invalid Artistic Style options.\n"
+ "The following options were not processed:");
+
+ if (_err->str().length() > 0)
+ fpErrorHandler(210, (char*) _err->str().c_str());
+
+ delete _err;
+ _err = NULL;
+
+ istringstream in(pSourceIn);
+ ASStreamIterator<istringstream> streamIterator(&in);
+ ostringstream out;
+ formatter.init(&streamIterator);
+
+ while (formatter.hasMoreLines())
+ {
+ out << formatter.nextLine();
+ if (formatter.hasMoreLines())
+ out << streamIterator.getOutputEOL();
+ }
+
+ unsigned long textSizeOut = out.str().length();
+ char* pTextOut = fpMemoryAlloc(textSizeOut + 1); // call memory allocation function
+// pTextOut = NULL; // for testing
+ if (pTextOut == NULL)
+ {
+ fpErrorHandler(110, (char*)"Allocation failure on output.");
+ return NULL;
+ }
+
+ strcpy(pTextOut, out.str().c_str());
+
+ return pTextOut;
+}
+
+extern "C" EXPORT const char* STDCALL AStyleGetVersion (void)
+{
+ return _version;
+}
+
+// ASTYLECON_LIB is defined to exclude "main" from the test programs
+#elif !defined(ASTYLECON_LIB)
+
+// ************************** main function ***************************************************
+
+int main(int argc, char** argv)
+{
+ ASFormatter formatter;
+ g_console = new ASConsole;
+
+ // process command line and options file
+ // build the vectors fileNameVector, optionsVector, and fileOptionsVector
+ processReturn returnValue = g_console->processOptions(argc, argv, formatter);
+
+ // check for end of processing
+ if (returnValue == END_SUCCESS)
+ return EXIT_SUCCESS;
+ if (returnValue == END_FAILURE)
+ {
+ (*_err) << "Artistic Style has terminated!" << endl;
+ return EXIT_FAILURE;
+ }
+
+ // if no files have been given, use cin for input and cout for output
+ if (g_console->fileNameVectorIsEmpty())
+ {
+ g_console->formatCinToCout(formatter);
+ return EXIT_SUCCESS;
+ }
+
+ // process entries in the fileNameVector
+ g_console->processFiles(formatter);
+
+ delete g_console;
+ return EXIT_SUCCESS;
+}
+
+#endif
diff --git a/support/highlight/src/core/astyle/astyle_main.h b/support/highlight/src/core/astyle/astyle_main.h
new file mode 100644
index 0000000000..1ec7ea57ff
--- /dev/null
+++ b/support/highlight/src/core/astyle/astyle_main.h
@@ -0,0 +1,268 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Copyright (C) 2006-2010 by Jim Pattee <jimp03@email.com>
+ * Copyright (C) 1998-2002 by Tal Davidson
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>
+ *
+ * This file is a part of Artistic Style - an indentation and
+ * reformatting tool for C, C++, C# and Java source files.
+ * <http://astyle.sourceforge.net>
+ *
+ * Artistic Style is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Artistic Style is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Artistic Style. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ */
+
+#ifndef ASTYLE_MAIN_H
+#define ASTYLE_MAIN_H
+
+//----------------------------------------------------------------------------
+// headers
+//----------------------------------------------------------------------------
+
+#include <ctime>
+#include "astyle.h"
+
+#if defined(_MSC_VER) || defined(__DMC__)
+#include <sys/utime.h>
+#include <sys/stat.h>
+#else
+#include <utime.h>
+#include <sys/stat.h>
+#endif // end compiler checks
+
+#ifdef ASTYLE_JNI
+#include <jni.h>
+#ifndef ASTYLE_LIB // ASTYLE_LIB must be defined for ASTYLE_JNI
+#define ASTYLE_LIB
+#endif
+#endif // ASTYLE_JNI
+
+// for G++ implementation of string.compare:
+#if defined(__GNUC__) && __GNUC__ < 3
+#error - Use GNU C compiler release 3 or higher
+#endif
+
+// for namespace problem in version 5.0
+#if defined(_MSC_VER) && _MSC_VER < 1200 // check for V6.0
+#error - Use Microsoft compiler version 6 or higher
+#endif
+
+//using namespace astyle;
+
+namespace astyle
+{
+
+// return values for ASConsole
+enum processReturn { CONTINUE, END_SUCCESS, END_FAILURE };
+
+//----------------------------------------------------------------------------
+// ASStreamIterator class
+// typename will be istringstream for GUI and istream otherwise
+// ASSourceIterator is an abstract class defined in astyle.h
+//----------------------------------------------------------------------------
+
+template<typename T>
+class ASStreamIterator : public ASSourceIterator
+{
+ public:
+ bool checkForEmptyLine;
+
+ // function declarations
+ ASStreamIterator(T *in);
+ virtual ~ASStreamIterator();
+ bool getLineEndChange(int lineEndFormat) const;
+ string nextLine(bool emptyLineWasDeleted);
+ string peekNextLine();
+ void peekReset();
+ void saveLastInputLine();
+
+ private:
+ T * inStream; // pointer to the input stream
+ string buffer; // current input line
+ string prevBuffer; // previous input line
+ int eolWindows; // number of Windows line endings, CRLF
+ int eolLinux; // number of Linux line endings, LF
+ int eolMacOld; // number of old Mac line endings. CR
+ char outputEOL[4]; // next output end of line char
+ streamoff peekStart; // starting position for peekNextLine
+ bool prevLineDeleted; // the previous input line was deleted
+
+ public: // inline functions
+ bool compareToInputBuffer(const string &nextLine) const
+ { return (nextLine == prevBuffer); }
+ const char* getOutputEOL() const { return outputEOL; }
+ bool hasMoreLines() const { return !inStream->eof(); }
+};
+
+//----------------------------------------------------------------------------
+// ASConsole class for console build
+//----------------------------------------------------------------------------
+
+class ASConsole
+{
+ private: // variables
+ // command line options
+ bool isRecursive; // recursive option
+ string origSuffix; // suffix= option
+ bool noBackup; // suffix=none option
+ bool preserveDate; // preserve-date option
+ bool isVerbose; // verbose option
+ bool isQuiet; // quiet option
+ bool isFormattedOnly; // formatted lines only option
+ bool optionsFileRequired; // options= option
+ // other variables
+ bool hasWildcard; // file name includes a wildcard
+ size_t mainDirectoryLength; // directory length to be excluded in displays
+ bool filesAreIdentical; // input and output files are identical
+ bool lineEndsMixed; // outputhas mixed line ends
+ int linesOut; // number of output lines
+ int filesFormatted; // number of files formatted
+ int filesUnchanged; // number of files unchanged
+ char outputEOL[4]; // current line end
+ char prevEOL[4]; // previous line end
+
+ string optionsFileName; // file path and name of the options file to use
+ string targetDirectory; // path to the directory being processed
+ string targetFilename; // file name being processed
+
+ vector<string> excludeVector; // exclude from wildcard hits
+ vector<bool> excludeHitsVector; // exclude flags for eror reporting
+ vector<string> fileNameVector; // file paths and names from the command line
+ vector<string> optionsVector; // options from the command line
+ vector<string> fileOptionsVector; // options from the options file
+ vector<string> fileName; // files to be processed including path
+
+ public:
+ ASConsole() {
+ // command line options
+ isRecursive = false;
+ origSuffix = ".orig";
+ noBackup = false;
+ preserveDate = false;
+ isVerbose = false;
+ isQuiet = false;
+ isFormattedOnly = false;
+ optionsFileRequired = false;
+ // other variables
+ hasWildcard = false;
+ filesAreIdentical = true;
+ lineEndsMixed = false;
+ outputEOL[0] = '\0';
+ prevEOL[0] = '\0';
+ mainDirectoryLength = 0;
+ filesFormatted = 0;
+ filesUnchanged = 0;
+ linesOut = 0;
+ }
+
+ // functions
+ void convertLineEnds(ostringstream& out, int lineEnd);
+ void error(const char *why, const char* what) const;
+ void formatCinToCout(ASFormatter& formatter) const;
+ FileEncoding getFileEncoding(ifstream& in) const;
+ bool fileNameVectorIsEmpty();
+ int getFilesFormatted();
+ int getFilesUnchanged();
+ bool getIsFormattedOnly();
+ bool getIsQuiet();
+ bool getIsRecursive();
+ bool getIsVerbose();
+ bool getLineEndsMixed();
+ bool getNoBackup();
+ string getOptionsFileName();
+ bool getOptionsFileRequired();
+ string getOrigSuffix();
+ bool getPreserveDate();
+ void processFiles(ASFormatter &formatter);
+ processReturn processOptions(int argc, char** argv, ASFormatter &formatter);
+ void setIsFormattedOnly(bool state);
+ void setIsQuiet(bool state);
+ void setIsRecursive(bool state);
+ void setIsVerbose(bool state);
+ void setNoBackup(bool state);
+ void setOptionsFileName(string name);
+ void setOptionsFileRequired(bool state);
+ void setOrigSuffix(string suffix);
+ void setPreserveDate(bool state);
+ void standardizePath(string &path, bool removeBeginningSeparator=false) const;
+ bool stringEndsWith(const string &str, const string &suffix) const;
+ void updateExcludeVector(string suffixParam);
+
+ // for unit testing
+ vector<string> getExcludeVector();
+ vector<bool> getExcludeHitsVector();
+ vector<string> getFileNameVector();
+ vector<string> getOptionsVector();
+ vector<string> getFileOptionsVector();
+ vector<string> getFileName();
+
+ private:
+ void correctMixedLineEnds(ostringstream& out);
+ void formatFile(const string &fileName, ASFormatter &formatter);
+ string getCurrentDirectory(const string &fileName) const;
+ void getFileNames(const string &directory, const string &wildcard);
+ void getFilePaths(string &filePath);
+ void initializeOutputEOL(LineEndFormat lineEndFormat);
+ bool isPathExclued(const string &subPath);
+ void printBadEncoding(FileEncoding encoding) const;
+ void printHelp() const;
+ void printMsg(const string &msg) const;
+ void printVerboseHeader() const;
+ void printVerboseStats(clock_t startTime) const;
+ void removeFile(const char* fileName, const char* errMsg) const;
+ void renameFile(const char* oldFileName, const char* newFileName, const char* errMsg) const;
+ void setOutputEOL(LineEndFormat lineEndFormat, const char* currentEOL);
+ void sleep(int seconds) const;
+ int waitForRemove(const char* oldFileName) const;
+ int wildcmp(const char *wild, const char *data) const;
+ void writeOutputFile(const string &fileName, ostringstream &out) const;
+};
+
+
+//----------------------------------------------------------------------------
+// global function declarations
+// used by both console and library builds
+//----------------------------------------------------------------------------
+
+void importOptions(istream &in, vector<string> &optionsVector);
+void isOptionError(const string &arg, const string &errorInfo);
+bool isParamOption(const string &arg, const char *option);
+bool isParamOption(const string &arg, const char *option1, const char *option2);
+bool parseOption(astyle::ASFormatter &formatter, const string &arg, const string &errorInfo);
+
+template<typename ITER>
+bool parseOptions(astyle::ASFormatter &formatter, const ITER &optionsBegin,
+ const ITER &optionsEnd, const string &errorInfo);
+
+} // end of namespace astyle
+
+//----------------------------------------------------------------------------
+// declarations for java native interface (JNI) build
+// global because they are called externally and are NOT part of the namespace
+//----------------------------------------------------------------------------
+
+#ifdef ASTYLE_JNI
+void STDCALL javaErrorHandler(int errorNumber, char* errorMessage);
+char* STDCALL javaMemoryAlloc(unsigned long memoryNeeded);
+// the following function names are constructed from method names in the calling java program
+extern "C" EXPORT
+jstring STDCALL Java_AStyleInterface_AStyleGetVersion(JNIEnv* env, jclass);
+extern "C" EXPORT
+jstring STDCALL Java_AStyleInterface_AStyleMain
+(JNIEnv* env, jobject obj, jstring textInJava, jstring optionsJava);
+#endif // ASTYLE_JNI
+
+
+#endif // closes ASTYLE_MAIN_H
diff --git a/support/highlight/src/core/bbcodegenerator.cpp b/support/highlight/src/core/bbcodegenerator.cpp
new file mode 100644
index 0000000000..deab822660
--- /dev/null
+++ b/support/highlight/src/core/bbcodegenerator.cpp
@@ -0,0 +1,128 @@
+/***************************************************************************
+ bbcodegenarator.cpp - description
+ -------------------
+ begin : Jul 21 2009
+ copyright : (C) 2004-2009 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#include <sstream>
+
+#include "bbcodegenerator.h"
+
+using namespace std;
+
+namespace highlight
+{
+
+ BBCodeGenerator::BBCodeGenerator() : CodeGenerator ( BBCODE )
+ {
+ newLineTag = "\n";
+ spacer = " ";
+ }
+
+ BBCodeGenerator::~BBCodeGenerator() {}
+
+ string BBCodeGenerator::getHeader()
+ {
+ return string();
+ }
+
+ void BBCodeGenerator::printBody()
+ {
+ *out << "[size="<<getBaseFontSize()<<"]";
+ processRootState();
+ *out << "[/size]";
+ }
+
+ string BBCodeGenerator::getFooter()
+ {
+ return string();
+ }
+
+ string BBCodeGenerator::getOpenTag (const ElementStyle & elem )
+ {
+ ostringstream s;
+
+ s << "[color=#";
+ s << elem.getColour().getRed ( HTML )
+ << elem.getColour().getGreen ( HTML )
+ << elem.getColour().getBlue ( HTML )
+ << "]";
+
+ if ( elem.isBold() ) s << "[b]";
+ if ( elem.isItalic() ) s << "[i]";
+ if ( elem.isUnderline() ) s << "[u]";
+ return s.str();
+ }
+
+ string BBCodeGenerator::getCloseTag ( const ElementStyle &elem )
+ {
+ ostringstream s;
+ if ( elem.isBold() ) s << "[/b]";
+ if ( elem.isItalic() ) s << "[/i]";
+ if ( elem.isUnderline() ) s << "[/u]";
+ s << "[/color]";
+ return s.str();
+ }
+
+ void BBCodeGenerator::initOutputTags ()
+ {
+ openTags.push_back ( "");
+ openTags.push_back ( getOpenTag ( docStyle.getStringStyle() ) );
+ openTags.push_back ( getOpenTag ( docStyle.getNumberStyle() ) );
+ openTags.push_back ( getOpenTag ( docStyle.getSingleLineCommentStyle() ) );
+ openTags.push_back ( getOpenTag ( docStyle.getCommentStyle() ) );
+ openTags.push_back ( getOpenTag ( docStyle.getEscapeCharStyle() ) );
+ openTags.push_back ( getOpenTag ( docStyle.getDirectiveStyle() ) );
+ openTags.push_back ( getOpenTag ( docStyle.getDirectiveStringStyle() ) );
+ openTags.push_back ( getOpenTag ( docStyle.getLineStyle() ) );
+ openTags.push_back ( getOpenTag ( docStyle.getSymbolStyle() ) );
+
+ closeTags.push_back ( "" );
+ closeTags.push_back ( getCloseTag ( docStyle.getStringStyle() ) );
+ closeTags.push_back ( getCloseTag ( docStyle.getNumberStyle() ) );
+ closeTags.push_back ( getCloseTag ( docStyle.getSingleLineCommentStyle() ) );
+ closeTags.push_back ( getCloseTag ( docStyle.getCommentStyle() ) );
+ closeTags.push_back ( getCloseTag ( docStyle.getEscapeCharStyle() ) );
+ closeTags.push_back ( getCloseTag ( docStyle.getDirectiveStyle() ) );
+ closeTags.push_back ( getCloseTag ( docStyle.getDirectiveStringStyle() ) );
+ closeTags.push_back ( getCloseTag ( docStyle.getLineStyle() ) );
+ closeTags.push_back ( getCloseTag ( docStyle.getSymbolStyle() ) );
+ }
+
+ string BBCodeGenerator::maskCharacter ( unsigned char c )
+ {
+ return string ( 1, c );
+ }
+
+ string BBCodeGenerator::getKeywordOpenTag ( unsigned int styleID )
+ {
+ return getOpenTag (docStyle.getKeywordStyle ( langInfo.getKeywordClasses() [styleID] ) );
+ }
+
+ string BBCodeGenerator::getKeywordCloseTag ( unsigned int styleID )
+ {
+ return getCloseTag ( docStyle.getKeywordStyle ( langInfo.getKeywordClasses() [styleID] ) );
+ }
+
+}
diff --git a/support/highlight/src/core/bbcodegenerator.h b/support/highlight/src/core/bbcodegenerator.h
new file mode 100644
index 0000000000..49792984cf
--- /dev/null
+++ b/support/highlight/src/core/bbcodegenerator.h
@@ -0,0 +1,90 @@
+/***************************************************************************
+ bbcodegenerator.h - description
+ -------------------
+ begin : Jul 20 2009
+ copyright : (C) 2004-2007 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#ifndef BBCODEGENERATOR_H
+#define BBCODEGENERATOR_H
+
+#include <string>
+
+#include "codegenerator.h"
+#include "charcodes.h"
+#include "version.h"
+
+namespace highlight
+{
+
+ /**
+ \brief This class generates BBCode.
+
+ It contains information about the resulting document structure (document
+ header and footer), the colour system, white space handling and text
+ formatting attributes.
+
+ * @author Andre Simon
+ */
+
+ class BBCodeGenerator : public highlight::CodeGenerator
+ {
+ public:
+ BBCodeGenerator();
+ ~BBCodeGenerator();
+
+ /** prints document header
+ */
+ string getHeader();
+
+ /** Prints document footer*/
+ string getFooter();
+
+ /** Prints document body*/
+ void printBody();
+
+ private:
+
+ /** \return escaped character*/
+ virtual string maskCharacter ( unsigned char );
+
+ /** @return BBcode open tags */
+ string getOpenTag (const ElementStyle & elem );
+
+ /** @return BBcode close tags */
+ string getCloseTag ( const ElementStyle &elem );
+
+ /** initialize tags in specific format according to colouring information provided in DucumentStyle */
+ void initOutputTags();
+
+ /** @param styleID current style ID
+ @return matching sequence to begin a new element formatting*/
+ string getKeywordOpenTag ( unsigned int styleID );
+
+ /** @param styleID current style ID
+ @return matching sequence to stop element formatting*/
+ string getKeywordCloseTag ( unsigned int styleID );
+ };
+
+}
+#endif
diff --git a/support/highlight/src/core/charcodes.h b/support/highlight/src/core/charcodes.h
new file mode 100644
index 0000000000..d112b7553e
--- /dev/null
+++ b/support/highlight/src/core/charcodes.h
@@ -0,0 +1,99 @@
+/***************************************************************************
+ charcodes.cpp - description
+ -------------------
+ begin : Wed Nov 24 2003
+ copyright : (C) 2003 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#ifndef CHAR_CODES
+#define CHAR_CODES
+
+#ifdef _WIN32
+
+#define AUML_LC 228
+#define OUML_LC 246
+#define UUML_LC 252
+
+#define AUML_UC 196
+#define OUML_UC 214
+#define UUML_UC 220
+
+
+#define AACUTE_LC 225
+#define EACUTE_LC 233
+#define OACUTE_LC 243
+#define UACUTE_LC 250
+
+#define AACUTE_UC 193
+#define EACUTE_UC 201
+#define OACUTE_UC 211
+#define UACUTE_UC 218
+
+#define AGRAVE_LC 224
+#define EGRAVE_LC 232
+#define OGRAVE_LC 242
+#define UGRAVE_LC 249
+
+#define AGRAVE_UC 192
+#define EGRAVE_UC 200
+#define OGRAVE_UC 210
+#define UGRAVE_UC 217
+
+#define SZLIG 223
+
+#else
+
+#define AUML_LC 164
+#define OUML_LC 182
+#define UUML_LC 188
+
+#define AUML_UC 132
+#define OUML_UC 150
+#define UUML_UC 156
+
+
+#define AACUTE_LC 161
+#define EACUTE_LC 169
+#define OACUTE_LC 179
+#define UACUTE_LC 186
+
+#define AACUTE_UC 129
+#define EACUTE_UC 137
+#define OACUTE_UC 147
+#define UACUTE_UC 154
+
+#define AGRAVE_LC 160
+#define EGRAVE_LC 168
+#define OGRAVE_LC 178
+#define UGRAVE_LC 185
+
+#define AGRAVE_UC 128
+#define EGRAVE_UC 136
+#define OGRAVE_UC 146
+#define UGRAVE_UC 153
+
+#define SZLIG 159
+
+#endif
+
+#endif
diff --git a/support/highlight/src/core/codegenerator.cpp b/support/highlight/src/core/codegenerator.cpp
new file mode 100644
index 0000000000..dfb63ec48e
--- /dev/null
+++ b/support/highlight/src/core/codegenerator.cpp
@@ -0,0 +1,1804 @@
+/***************************************************************************
+ codegenerator.cpp - description
+ -------------------
+ begin : Die Jul 9 2002
+ copyright : (C) 2002-2009 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#include <climits>
+#include <memory>
+
+#include "codegenerator.h"
+
+#include "htmlgenerator.h"
+#include "xhtmlgenerator.h"
+#include "rtfgenerator.h"
+#include "latexgenerator.h"
+#include "texgenerator.h"
+#include "xmlgenerator.h"
+#include "svggenerator.h"
+#include "bbcodegenerator.h"
+#include "re/Matcher.h"
+#include "astyle/astyle.h"
+#include "astyle/ASStreamIterator.h"
+
+#if !defined (QT)
+#include "ansigenerator.h"
+#include "xterm256generator.h"
+#endif
+
+using namespace std;
+
+namespace highlight
+{
+
+ const unsigned int CodeGenerator::NUMBER_BUILTIN_STATES = 10;
+
+ const string CodeGenerator::STY_NAME_STD="std";
+ const string CodeGenerator::STY_NAME_STR="str";
+ const string CodeGenerator::STY_NAME_NUM="num";
+ const string CodeGenerator::STY_NAME_SLC="slc";
+ const string CodeGenerator::STY_NAME_COM="com" ;
+ const string CodeGenerator::STY_NAME_ESC="esc" ;
+ const string CodeGenerator::STY_NAME_DIR="dir" ;
+ const string CodeGenerator::STY_NAME_DST="dstr";
+ const string CodeGenerator::STY_NAME_LIN="line";
+ const string CodeGenerator::STY_NAME_SYM="sym" ;
+
+ CodeGenerator * CodeGenerator::getInstance ( OutputType type )
+ {
+ CodeGenerator* generator=NULL;
+ switch ( type )
+ {
+ case HTML:
+ generator = new HtmlGenerator();
+ break;
+ case XHTML:
+ generator = new XHtmlGenerator();
+ break;
+ case TEX:
+ generator = new TexGenerator ();
+ break;
+ case LATEX:
+ generator = new LatexGenerator();
+ break;
+ case RTF:
+ generator = new RtfGenerator ();
+ break;
+ case XML:
+ generator = new XmlGenerator();
+ break;
+ case SVG:
+ generator = new SVGGenerator();
+ break;
+ case BBCODE:
+ generator = new BBCodeGenerator();
+ break;
+#if !defined (QT)
+ case ANSI:
+ generator = new AnsiGenerator();
+ break;
+ case XTERM256:
+ generator = new Xterm256Generator();
+ break;
+#endif
+ default:
+ break;
+ }
+ return generator;
+ }
+
+
+ CodeGenerator::CodeGenerator ( highlight::OutputType type )
+ :in ( NULL ),
+ out ( NULL ),
+ encoding ( "none" ),
+ docTitle ( "Source file" ),
+ maskWs ( false ),
+ excludeWs ( false ),
+ fragmentOutput ( false ),
+ showLineNumbers ( false ),
+ lineNumberFillZeroes ( false ),
+ printNewLines(true),
+ lineNumber ( 0 ),
+ lineNumberOffset ( 0 ),
+ includeStyleDef ( false ),
+ lineIndex ( 0 ),
+ lineNumberWidth ( 5 ),
+ maxLineCnt ( UINT_MAX ),
+ terminatingChar ( '\0' ),
+ formatter ( NULL ),
+ formattingEnabled ( false ),
+ formattingPossible ( false ),
+ validateInput ( false ),
+ tagsEnabled ( false ),
+ noTrailingNewLine(false),
+ keywordCase ( StringTools::CASE_UNCHANGED ),
+ eolDelimiter ('\n'),
+ outputType ( type )
+ {
+ }
+
+
+ CodeGenerator::~CodeGenerator()
+ {
+ delete formatter;
+ }
+
+
+ bool CodeGenerator::initTheme ( const string& themePath )
+ {
+ this->themePath=themePath;
+ bool loadOK = docStyle.load ( themePath );
+ //docStyles.insert(docStyles.begin(), docStyle); // main style must be first
+ initOutputTags();
+ return loadOK;
+ }
+
+
+ bool CodeGenerator::hasWhiteBGColour()
+ {
+ //Colour bgCol = docStyles.front().getBgColour();
+ Colour bgCol = docStyle.getBgColour();
+ return bgCol.getRed ( HTML ) == "ff" && bgCol.getGreen ( HTML ) == "ff" && bgCol.getBlue ( HTML ) == "ff";
+ }
+
+
+ const string& CodeGenerator::getStyleName()
+ {
+ return themePath;
+ }
+
+
+ void CodeGenerator::setLineNumberWidth ( int w )
+ {
+ lineNumberWidth=w;
+ }
+
+
+ int CodeGenerator::getLineNumberWidth()
+ {
+ return lineNumberWidth;
+ }
+
+
+ void CodeGenerator::setPrintLineNumbers ( bool flag, unsigned int startCnt )
+ {
+ showLineNumbers=flag;
+ lineNumberOffset = startCnt-1;
+ }
+
+
+ bool CodeGenerator::getPrintLineNumbers()
+ {
+ return showLineNumbers;
+ }
+
+
+ void CodeGenerator::setPrintZeroes ( bool flag )
+ {
+ lineNumberFillZeroes=flag;
+ }
+
+
+ bool CodeGenerator::getPrintZeroes()
+ {
+ return lineNumberFillZeroes;
+ }
+
+
+ void CodeGenerator::setIncludeStyle ( bool flag )
+ {
+ includeStyleDef = flag;
+ }
+
+ void CodeGenerator::disableTrailingNL ( bool flag )
+ {
+ noTrailingNewLine = flag;
+ }
+
+
+ void CodeGenerator::setStyleInputPath ( const string& path )
+ {
+ styleInputPath = path;
+ }
+
+
+ void CodeGenerator::setStyleOutputPath ( const string& path )
+ {
+ styleOutputPath = path;
+ }
+
+
+ const string& CodeGenerator::getStyleInputPath()
+ {
+ return styleInputPath;
+ }
+
+
+ const string& CodeGenerator::getStyleOutputPath()
+ {
+ return styleOutputPath;
+ }
+
+
+ void CodeGenerator::setFragmentCode ( bool flag )
+ {
+ fragmentOutput=flag;
+ }
+
+
+ bool CodeGenerator::getFragmentCode()
+ {
+ return fragmentOutput;
+ }
+
+
+ void CodeGenerator::setValidateInput ( bool flag )
+ {
+ validateInput=flag;
+ }
+
+
+ bool CodeGenerator::getValidateInput()
+ {
+ return validateInput;
+ }
+
+
+ void CodeGenerator::setBaseFont ( const string& s )
+ {
+ baseFont = s;
+ }
+
+
+ void CodeGenerator::setBaseFontSize ( const string& s )
+ {
+ baseFontSize = s ;
+ }
+
+ void CodeGenerator::setStartingNestedLang(const string &langName) {
+ embedLangStart = langName;
+ }
+
+
+ const string CodeGenerator::getBaseFont() const
+ {
+ if ( !baseFont.empty() ) return baseFont;
+ switch ( outputType )
+ {
+ case LATEX:
+ return "ttfamily";
+ break;
+ case TEX:
+ return "tt";
+ break;
+ default:
+ return "Courier New";
+ }
+ }
+
+
+ const string CodeGenerator::getBaseFontSize()
+ {
+ if ( baseFontSize.empty() && outputType != LATEX && outputType != TEX )
+ {
+ //return docStyles.front().getFontSize();
+ return docStyle.getFontSize();
+ }
+ else
+ {
+ return baseFontSize;
+ }
+ }
+
+
+ void CodeGenerator::setTitle ( const string & title )
+ {
+ if ( !title.empty() ) docTitle= title;
+ }
+
+
+ string CodeGenerator::getTitle()
+ {
+ return docTitle;
+ }
+
+
+ void CodeGenerator::setEncoding ( const string& encodingName )
+ {
+ encoding = encodingName;
+ }
+
+
+ bool CodeGenerator::formattingDisabled()
+ {
+ return !formattingEnabled;
+ }
+
+
+ void CodeGenerator::setMaxInputLineCnt ( unsigned int cnt )
+ {
+ maxLineCnt = cnt;
+ }
+
+
+ bool CodeGenerator::formattingIsPossible()
+ {
+ return formattingPossible;
+ }
+
+
+ void CodeGenerator::setPreformatting ( WrapMode lineWrappingStyle,
+ unsigned int lineLength,
+ int numberSpaces )
+ {
+ bool enableWrap = lineWrappingStyle!=WRAP_DISABLED;
+ bool replaceTabs = numberSpaces > 0;
+
+ if ( enableWrap || replaceTabs )
+ {
+ preFormatter.setWrap ( enableWrap );
+ preFormatter.setWrapIndentBraces ( lineWrappingStyle==WRAP_DEFAULT );
+ preFormatter.setWrapLineLength ( lineLength );
+ preFormatter.setReplaceTabs ( replaceTabs );
+ preFormatter.setNumberSpaces ( numberSpaces );
+ }
+ }
+
+
+ void CodeGenerator::setKeyWordCase ( StringTools::KeywordCase keyCase )
+ {
+ keywordCase = keyCase;
+ }
+
+
+ void CodeGenerator::addMarkedLine ( int lineNo, string& helpTxt )
+ {
+ markLines[lineNo] = helpTxt;
+ }
+
+
+ const LanguageDefinition &CodeGenerator::getLanguage()
+ {
+ return langInfo;
+ }
+
+
+ void CodeGenerator::setEOLDelimiter(char delim){
+ eolDelimiter = delim;
+ }
+
+
+ void CodeGenerator::reset()
+ {
+ lineIndex = 0;
+ lineNumber = 0;
+ line.clear();
+ preFormatter.reset();
+ inFile.clear();
+ outFile.clear();
+ hostLangDefPath.clear();
+ embedLangDefPath.clear();
+ printNewLines=true;
+ }
+
+
+ /** sucht vorwaerts ab Position searchPos Ziffer in s und liefert Integerwert
+ der gefundenen Zahl zurueck.
+ Im SymbolString stehen die den einzelnen Symbolen zugeordneten Konstanten
+ immer HINTER diesen Symbolen*/
+ State CodeGenerator::getState ( const string &s, unsigned int searchPos )
+ {
+ string::size_type pos = s.find_first_of ( "1234567890", searchPos+1 );
+ if ( pos==string::npos ) return _UNKNOWN;
+
+ string::size_type pos2 = s.find ( ' ', pos );
+ int result=_UNKNOWN;
+ StringTools::str2num<int> ( result, s.substr ( pos, pos2-pos ), std::dec );
+ return ( State ) result;
+ }
+
+
+ unsigned int CodeGenerator::getLineNumber()
+ {
+ return lineNumber;
+ }
+
+
+ bool CodeGenerator::readNewLine ( string &newLine )
+ {
+
+ bool eof;
+ if ( lineIndex ) terminatingChar=newLine[lineIndex-1];
+ if ( formattingPossible && formattingEnabled )
+ {
+ eof=!formatter->hasMoreLines();
+ if ( !eof )
+ {
+ newLine = formatter->nextLine();
+ }
+ }
+ // reformatting not enabled
+ else
+ {
+ eof = ! getline ( *in, newLine, eolDelimiter );
+ }
+
+ return eof || ( lineNumber == maxLineCnt );
+ }
+
+
+ void CodeGenerator::matchRegex ( const string &line )
+ {
+
+ regexGroups.clear();
+ int matchBegin=0;
+ int matchLen=0;
+ int groupID=0;
+
+ // cycle through all regex, save the start and ending indices to report them later
+ for ( unsigned int i=0; i<langInfo.getRegexElements().size(); i++ )
+ {
+ RegexElement *regexElem = langInfo.getRegexElements() [i];
+ auto_ptr<Matcher> matcher ( regexElem->rePattern->createMatcher ( line ) );
+
+ while ( matcher->findNextMatch() )
+ {
+ groupID = ( regexElem->capturingGroup<0 ) ? matcher->getGroupNum()-1 : regexElem->capturingGroup;
+ matchBegin = matcher->getStartingIndex ( groupID );
+ if ( matchBegin<0 ) continue;
+
+ matchLen = matcher->getEndingIndex ( groupID ) - matchBegin;
+ /*
+ std::cerr << "\nmatchBegin="<<1+ matchBegin
+ << " matchLen old" << ( matcher->getGroup(matcher->getGroupNum()-1).size())
+ << " matchLen new" << matchLen<<" group: "<<(matcher->getGroup(matcher->getGroupNum()-1))
+ << " group id= "<<regexElem->capturingGroup
+ << " lang= "<<regexElem->langName<<"\n";
+ cerr<<"match: "<<(matcher->getGroup(matcher->getGroupNum()-1))<<" id: "<<regexElem->open<<endl;
+ */
+ regexGroups.insert (
+ make_pair ( matchBegin+1, ReGroup ( regexElem->open, matchLen, regexElem->kwClass, regexElem->langName ) ) );
+ }
+ }
+ }
+
+
+ unsigned char CodeGenerator::getInputChar()
+ {
+ bool eol = lineIndex == line.length();
+
+ if ( eol )
+ {
+ bool eof=false;
+ if ( preFormatter.isEnabled() )
+ {
+ if ( !preFormatter.hasMoreLines() )
+ {
+ eof=readNewLine ( line );
+ preFormatter.setLine ( line );
+ }
+ line = preFormatter.getNextLine();
+ }
+ else
+ {
+ eof=readNewLine ( line );
+ }
+ lineIndex=0;
+ ++lineNumber;
+ //line=StringTools::trimRight ( line );
+ matchRegex ( line );
+
+ return ( eof ) ?'\0':'\n';
+ }
+
+ return line[lineIndex++];
+ }
+
+
+ State CodeGenerator::getCurrentState ()
+ {
+
+ unsigned char c='\0';
+
+ if ( token.length() ==0 )
+ {
+ c=getInputChar();
+ }
+ else
+ {
+ lineIndex-= ( token.length()-1 );
+ c=token[0];
+ }
+ if ( c=='\n' )
+ {
+ return _EOL; // End of line
+ }
+
+ if ( c=='\0' )
+ {
+ return _EOF; // End of file
+ }
+
+ if ( c==' ' || c=='\t' )
+ {
+ token= c;
+ return _WS;
+ }
+
+ /** TODO
+ COMMENT ... END 2 eintraege in langdef (ML_COMMENT_START=regex(), ML_COMMENT_END=regex())
+ weil comment sonst als identifier erkannt wird
+ */
+
+ // Test if a regular expression was found at the current position
+ if ( !regexGroups.empty() )
+ {
+ if ( regexGroups.count ( lineIndex ) )
+ {
+ token = line.substr ( lineIndex-1, regexGroups[lineIndex].length );
+ unsigned int oldIndex= lineIndex;
+ if ( regexGroups[oldIndex].length>1 ) lineIndex+= regexGroups[oldIndex].length-1;
+
+
+ if ( regexGroups[oldIndex].state==EMBEDDED_CODE_BEGIN) {
+ embedLangDefPath = langInfo.getNewPath(regexGroups[oldIndex].name);
+ }
+
+ if ( regexGroups[oldIndex].state==IDENTIFIER_BEGIN || regexGroups[oldIndex].state==KEYWORD )
+ {
+ string reservedWord= ( langInfo.isIgnoreCase() ) ? StringTools::change_case ( token ) :token;
+ currentKeywordClass=langInfo.isKeyword ( reservedWord );
+ if ( !currentKeywordClass && regexGroups[oldIndex].state==KEYWORD )
+ currentKeywordClass = regexGroups[oldIndex].kwClass;
+ return ( currentKeywordClass ) ? KEYWORD : STANDARD;
+ }
+ else
+ {
+ return regexGroups[oldIndex].state;
+ }
+ }
+ }
+
+ unsigned int symbolLength;
+ size_t symbolPos;
+ size_t symbolFind;
+ string symbols=langInfo.getSymbolString();
+
+ //TODO this while loop kills performance - adjust search algorithm
+
+ symbolPos = symbols.find ( c );
+ // search symbols (comment delimiters, directives etc.)
+ // before keywords, because alphabetic chars may be part of symbols, too
+
+ while ( symbolPos!= string::npos && ! std::isdigit(c)) // isdigit: fix rexx issue
+ {
+ symbolFind = symbols.find ( ' ', symbolPos );
+ if ( symbolFind==string::npos ) break;
+ symbolLength=symbolFind-symbolPos;
+ token = symbols.substr ( symbolPos, symbolLength );
+ // Abfrage nach Leerzeichen in SymbolString verhindert falsches
+ // Erkennen von Symbolteilen:
+ if ( lineIndex && token == line.substr ( lineIndex-1, symbolLength )
+ && symbols[symbolPos-1]==' ' )
+ {
+ lineIndex += ( symbolLength-1 );
+ return getState ( symbols, symbolPos );
+ }
+ else
+ {
+ symbolPos = symbols.find_first_not_of ( ' ',symbols.find ( ' ',symbolPos ) );
+ }
+ }
+
+ // Character not referring to any state
+ token = c;
+ return STANDARD;
+ }
+
+
+ //it is faster to pass ostream reference
+ void CodeGenerator::maskString ( ostream& ss, const string & s )
+ {
+ for ( unsigned int i=0;i< s.length();i++ )
+ {
+ ss << maskCharacter ( s[i] );
+ }
+ }
+
+
+ void CodeGenerator::printMaskedToken ( bool addMetaInfo, bool flushWhiteSpace,
+ StringTools::KeywordCase tcase )
+ {
+ if ( flushWhiteSpace ) flushWs();
+
+ if ( addMetaInfo && tagsEnabled )
+ {
+ bool insertMetaInfo=metaInfo.tagExists ( token );
+ if ( insertMetaInfo ) *out<<getMetaInfoOpenTag ( metaInfo.getTagInfo ( token ) );
+ maskString ( *out, StringTools::change_case ( token, tcase ) );
+ if ( insertMetaInfo ) *out<<getMetaInfoCloseTag();
+ }
+ else
+ {
+ maskString ( *out, StringTools::change_case ( token, tcase ) );
+ }
+ token.clear();
+ }
+
+
+ bool CodeGenerator::styleFound()
+ {
+ return docStyle.found();
+ //return docStyles.front().found();
+ }
+
+
+ bool CodeGenerator::printIndexFile ( const vector<string> &fileList,
+ const string &outPath )
+ {
+ return true;
+ }
+
+
+ bool CodeGenerator::initIndentationScheme ( const string &indentScheme )
+ {
+
+ if ( formatter!=NULL )
+ {
+ return true;
+ }
+
+ if ( !indentScheme.size() ) return false;
+
+ formatter=new astyle::ASFormatter();
+
+ formatter->setParensHeaderPaddingMode(true);
+
+ if ( indentScheme=="allman" || indentScheme=="bsd" || indentScheme=="ansi" )
+ {
+ formatter->setFormattingStyle ( astyle::STYLE_ALLMAN );
+ }
+ else if ( indentScheme=="kr"||indentScheme=="k&r"||indentScheme=="k/r" )
+ {
+ formatter->setFormattingStyle ( astyle::STYLE_KandR );
+ }
+ else if ( indentScheme=="java" )
+ {
+ formatter->setFormattingStyle ( astyle::STYLE_JAVA );
+ }
+ else if ( indentScheme=="stroustrup" )
+ {
+ formatter->setFormattingStyle ( astyle::STYLE_STROUSTRUP );
+ }
+ else if ( indentScheme=="whitesmith" )
+ {
+ formatter->setFormattingStyle ( astyle::STYLE_WHITESMITH );
+ }
+ else if ( indentScheme=="banner" )
+ {
+ formatter->setFormattingStyle ( astyle::STYLE_BANNER );
+ }
+ else if ( indentScheme=="gnu" )
+ {
+ formatter->setFormattingStyle ( astyle::STYLE_GNU );
+ }
+ else if ( indentScheme=="linux" )
+ {
+ formatter->setFormattingStyle ( astyle::STYLE_LINUX );
+ }
+ else if ( indentScheme=="horstmann" )
+ {
+ formatter->setFormattingStyle ( astyle::STYLE_HORSTMANN );
+ }
+ else if ( indentScheme=="otbs" || indentScheme=="1tbs")
+ {
+ formatter->setFormattingStyle ( astyle::STYLE_1TBS );
+ }
+ else
+ {
+ return false;
+ }
+
+ return formattingEnabled=true;
+ }
+
+
+ LoadResult CodeGenerator::loadLanguage ( const string& langDefPath )
+ {
+ bool reloadNecessary= langInfo.needsReload ( langDefPath );
+ if ( reloadNecessary )
+ {
+ //cerr<<"LOADING"<<langDefPath<<endl;
+ if ( !langInfo.load ( langDefPath ) )
+ {
+ return langInfo.getFailedRegex().size() ? LOAD_FAILED_REGEX : LOAD_FAILED;
+ }
+
+ formattingPossible=langInfo.enableReformatting();
+
+ if ( openTags.size() >NUMBER_BUILTIN_STATES )
+ {
+ // remove dynamic keyword tag delimiters of the old language definition
+ vector<string>::iterator keyStyleOpenBegin =
+ openTags.begin() + NUMBER_BUILTIN_STATES;
+ vector<string>::iterator keyStyleCloseBegin =
+ closeTags.begin() + NUMBER_BUILTIN_STATES;
+ openTags.erase ( keyStyleOpenBegin, openTags.end() );
+ closeTags.erase ( keyStyleCloseBegin, closeTags.end() );
+ }
+ // add new keyword tag delimiters
+ for ( unsigned int i=0;i< langInfo.getKeywordClasses().size(); i++ )
+ {
+ openTags.push_back ( getKeywordOpenTag ( i ) );
+ closeTags.push_back ( getKeywordCloseTag ( i ) );
+ }
+ }
+ return ( reloadNecessary) ? LOAD_NEW : LOAD_NONE;
+ }
+
+
+ bool CodeGenerator::initTagInformation ( const string& ctagsPath )
+ {
+ if ( tagsEnabled ) return true; // load tag info once
+ tagsEnabled = metaInfo.load ( ctagsPath );
+ return tagsEnabled;
+ }
+
+
+ bool CodeGenerator::validateInputStream()
+ {
+ if ( !in ) return false;
+
+ // it is not possible to move stream pointer back with stdin
+ if ( ( int ) in->tellg() == -1 ) // -1 : stdin
+ return true;
+
+ // Sources: http://en.wikipedia.org/wiki/Magic_number_(programming)
+ // Magic configuration of "file"
+ // This is intended for web plugins - only check filetypes often found in the net
+ char magic_gif[] = {'G','I','F','8', 0};
+ char magic_png[] = {0x89,'P','N','G', 0};
+ char magic_java[] = {0xCA,0xFE,0xBA,0xBE, 0};
+ char magic_jpeg[] = {0xFF,0xD8,0xFF, 0};
+ char magic_bmp[] = {'B','M', 0};
+ char magic_pdf[] = {'%','P','D','F', 0};
+ char magic_utf8[] = {0xEF,0xBB,0xBF,0};
+ char magic_rar[] = {'R','a','r','!', 0};
+ char magic_zip[] = {'P','K',0x03,0x04, 0};
+ char magic_ace[] = {'*','*','A','C','E','*','*', 0};
+ char magic_tgz[] = {0x8b,0x1f, 0x00, 0x08, 0};
+ char magic_bzip[] = {'B','Z', 0};
+
+ char* magic_table[] = {magic_utf8,
+ magic_gif, magic_png, magic_jpeg, magic_bmp, magic_pdf,
+ magic_java,
+ magic_rar, magic_zip, magic_ace, magic_tgz, magic_bzip,
+ 0
+ };
+
+ char buffer [10]={0};
+ in->read ( buffer,8 ); //only read the first 8 bytes of input stream
+
+ int magic_index=0;
+ while ( magic_table[magic_index] )
+ {
+ if ( !strncmp ( buffer, magic_table[magic_index], strlen ( magic_table[magic_index] ) ) )
+ {
+ break;
+ }
+ magic_index++;
+ }
+ int streamReadPos=0;
+ if ( magic_table[magic_index] == magic_utf8 )
+ {
+ //setEncoding("utf-8");
+ streamReadPos=3; // remove UTF-8 magic number from output
+ }
+
+ in -> seekg ( streamReadPos, ios::beg );
+ in-> clear(); // clear fail bit to continue reading
+
+ return !magic_table[magic_index] // points to 0 if no pattern was found
+ || magic_table[magic_index] == magic_utf8;
+ }
+
+
+ ParseError CodeGenerator::generateFile ( const string &inFileName,
+ const string &outFileName )
+ {
+ if ( !docStyle.found() )
+ {
+ return BAD_STYLE;
+ }
+
+ reset();
+
+ ParseError error=PARSE_OK;
+
+ inFile=inFileName;
+ outFile=outFileName;
+ in = ( inFileName.empty() ? &cin :new ifstream ( inFileName.c_str() ) );
+
+ if ( validateInput )
+ if ( !validateInputStream() ) error= BAD_INPUT;
+
+ if ( !in->fail() && error==PARSE_OK )
+ {
+ out = ( outFileName.empty() ? &cout :new ofstream ( outFileName.c_str() ) );
+ if ( out->fail() )
+ {
+ error=BAD_OUTPUT;
+ }
+ }
+
+ if ( in->fail() )
+ {
+ error=BAD_INPUT;
+ }
+
+ if ( error==PARSE_OK )
+ {
+ if ( formatter != NULL )
+ {
+ formatter->init ( new astyle::ASStreamIterator ( in ) );
+ }
+ if ( ! fragmentOutput )
+ {
+ *out << getHeader();
+ }
+
+ printBody();
+
+ if ( ! fragmentOutput )
+ {
+ *out << getFooter();
+ }
+ }
+
+ if ( !outFileName.empty() )
+ {
+ delete out; out=NULL;
+ }
+ if ( !inFileName.empty() )
+ {
+ delete in; in=NULL;
+ }
+ return error;
+ }
+
+
+ string CodeGenerator::generateString ( const string &input )
+ {
+
+ if ( !docStyle.found() )
+ {
+ return "";
+ }
+
+ reset();
+
+ in = new istringstream ( input );
+ out = new ostringstream ();
+
+ if ( in->fail() || out->fail() )
+ {
+ return "";
+ }
+
+ if ( formatter != NULL )
+ {
+ formatter->init ( new astyle::ASStreamIterator ( in ) );
+ }
+ if ( ! fragmentOutput )
+ {
+ *out << getHeader();
+ }
+
+ printBody();
+
+ if ( ! fragmentOutput )
+ {
+ *out << getFooter();
+ }
+
+ string result = static_cast<ostringstream*> ( out )->str();
+
+ delete out; out=NULL;
+ delete in; in=NULL;
+
+ return result;
+ }
+
+
+ string CodeGenerator::generateStringFromFile ( const string &inFileName )
+ {
+
+ if ( !docStyle.found() )
+ {
+ return "";
+ }
+
+ reset();
+
+ inFile = inFileName;
+ in = new ifstream ( inFileName.c_str() );
+ out = new ostringstream ();
+
+ if ( in->fail() || out->fail() )
+ {
+ return "";
+ }
+
+ if ( validateInput && !validateInputStream() )
+ {
+ return "ERROR: detected binary input";
+ }
+
+ if ( formatter != NULL )
+ {
+ formatter->init ( new astyle::ASStreamIterator ( in ) );
+ }
+ if ( ! fragmentOutput )
+ {
+ *out << getHeader();
+ }
+
+ printBody();
+
+ if ( ! fragmentOutput )
+ {
+ *out << getFooter();
+ }
+
+ string result = static_cast<ostringstream*> ( out )->str();
+
+ delete out; out=NULL;
+ delete in; in=NULL;
+
+ return result;
+ }
+
+
+ unsigned int CodeGenerator::getStyleID ( State s, unsigned int kwClassID )
+ {
+ if ( s==KEYWORD && kwClassID )
+ {
+ return NUMBER_BUILTIN_STATES + kwClassID-1;
+ }
+ return ( unsigned int ) s ;
+ }
+
+
+ void CodeGenerator::openTag ( State s )
+ {
+ *out << openTags[ ( unsigned int ) s];
+ currentState=s;
+ }
+
+
+ void CodeGenerator::closeTag ( State s )
+ {
+ *out << closeTags[ ( unsigned int ) s];
+ flushWs();
+ currentState=_UNKNOWN;
+ }
+
+
+ void CodeGenerator::openKWTag ( unsigned int kwClassID )
+ {
+ *out << openTags.at(getStyleID ( KEYWORD, kwClassID ) );
+ currentState=KEYWORD;
+ }
+
+
+ void CodeGenerator::closeKWTag ( unsigned int kwClassID )
+ {
+ *out << closeTags.at(getStyleID ( KEYWORD, kwClassID ) );
+ flushWs();
+ currentState=_UNKNOWN;
+ }
+
+ void CodeGenerator::loadEmbeddedLang(const string&embedLangDefPath){
+ //save path of host language
+ if (hostLangDefPath.empty()) {
+ hostLangDefPath =langInfo.getCurrentPath();
+ }
+ //load syntax of embedded langage
+ loadLanguage(embedLangDefPath);
+ //pass end delimiter regex to syntax description
+ langInfo.restoreLangEndDelim(embedLangDefPath);
+ }
+
+///////////////////////////////////////////////////////////////////////////////
+
+ void CodeGenerator::processRootState()
+ {
+
+ bool eof=false,
+ firstLine=true; // avoid newline before printing the first output line
+
+ if ( langInfo.highlightingDisabled() )
+ {
+ string line;
+ while ( getline ( *in, line ) )
+ {
+ ++lineNumber;
+ insertLineNumber ( !firstLine );
+ flushWs();
+ firstLine=false;
+ maskString ( *out, line );
+ }
+ *out << flush;
+ return;
+ }
+
+ if (!embedLangStart.empty()) loadEmbeddedLang(langInfo.getNewPath(embedLangStart));
+
+ State state=STANDARD;
+
+ openTag ( STANDARD );
+ do
+ {
+ // determine next state
+ state= getCurrentState();
+
+ // handle current state
+ switch ( state )
+ {
+ case KEYWORD:
+ closeTag ( STANDARD );
+ eof=processKeywordState ( state );
+ openTag ( STANDARD );
+ break;
+ case NUMBER:
+ closeTag ( STANDARD );
+ eof=processNumberState();
+ openTag ( STANDARD );
+ break;
+ case ML_COMMENT:
+ closeTag ( STANDARD );
+ eof=processMultiLineCommentState();
+ openTag ( STANDARD );
+ break;
+ case SL_COMMENT:
+ closeTag ( STANDARD );
+ eof=processSingleLineCommentState();
+ openTag ( STANDARD );
+ break;
+ case STRING:
+ closeTag ( STANDARD );
+ eof=processStringState ( STANDARD );
+ openTag ( STANDARD );
+ break;
+ case DIRECTIVE:
+ closeTag ( STANDARD );
+ eof=processDirectiveState();
+ openTag ( STANDARD );
+ break;
+ case ESC_CHAR:
+ if ( langInfo.allowExtEscSeq() )
+ {
+ closeTag ( STANDARD );
+ eof=processEscapeCharState();
+ openTag ( STANDARD );
+ }
+ else
+ {
+ printMaskedToken();
+ }
+ break;
+ case SYMBOL:
+ closeTag ( STANDARD );
+ eof=processSymbolState();
+ openTag ( STANDARD );
+ break;
+ case EMBEDDED_CODE_BEGIN:
+ case EMBEDDED_CODE_END:
+ closeTag ( STANDARD );
+ eof=processSyntaxChangeState(state);
+ openTag ( STANDARD );
+ break;
+ case _EOL:
+ insertLineNumber ( !firstLine );
+ firstLine=false;
+ break;
+ case _EOF:
+ eof=true;
+ break;
+ case _WS:
+ processWsState();
+ break;
+ default:
+ printMaskedToken ( true );
+ break;
+ }
+ }
+ while ( !eof );
+ closeTag ( STANDARD );
+ printNewLines = !noTrailingNewLine;
+ *out << getNewLine();
+ *out << flush;
+ }
+
+ bool CodeGenerator::processSyntaxChangeState(State myState)
+ {
+ State newState=STANDARD;
+ bool eof=false,
+ exitState=false;
+ openTag ( KEYWORD );
+ do
+ {
+ if (myState==EMBEDDED_CODE_BEGIN) {
+ loadEmbeddedLang(embedLangDefPath);
+
+ //test current line again to match tokens of the embedded language
+ matchRegex(line);
+
+ }
+ else if (myState==EMBEDDED_CODE_END) {
+ // load host language syntax
+ loadLanguage(hostLangDefPath);
+ //test current line again to match tokens of the host language
+ matchRegex(line);
+
+ }
+
+ printMaskedToken ( false, newState!=_WS );
+ newState= getCurrentState();
+ switch ( newState )
+ {
+ case _WS:
+ processWsState();
+ break;
+ case _EOL:
+ insertLineNumber();
+ exitState=true;
+ break;
+ case _EOF:
+ eof = true;
+ break;
+ default:
+ exitState=true;
+ break;
+ }
+ }
+ while ( ( !exitState ) && ( !eof ) );
+
+ closeTag ( KEYWORD );
+ return eof;
+ }
+
+
+ bool CodeGenerator::processKeywordState ( State myState )
+ {
+ State newState=STANDARD;
+ unsigned int myClassID=currentKeywordClass;
+ bool eof=false,
+ exitState=false;
+
+ openKWTag ( myClassID );
+ do
+ {
+ printMaskedToken ( true, newState!=_WS,
+ ( langInfo.isIgnoreCase() ) ? keywordCase : StringTools::CASE_UNCHANGED );
+ newState= getCurrentState();
+ switch ( newState )
+ {
+ case _WS:
+ processWsState();
+ break;
+ case _EOL:
+ insertLineNumber();
+ exitState=true;
+ break;
+ case _EOF:
+ eof = true;
+ break;
+ case KEYWORD_END:
+ exitState=true;
+ break;
+ default:
+ exitState= ( myClassID!=currentKeywordClass ) || ( myState!=newState );
+ break;
+ }
+ }
+ while ( ( !exitState ) && ( !eof ) );
+
+ closeKWTag ( myClassID );
+
+ currentKeywordClass=0;
+ return eof;
+ }
+
+
+ bool CodeGenerator::processNumberState()
+ {
+ State newState=STANDARD;
+ bool eof=false,
+ exitState=false;
+ openTag ( NUMBER );
+ do
+ {
+ printMaskedToken ( false, newState!=_WS );
+ newState= getCurrentState();
+ switch ( newState )
+ {
+ case _WS:
+ processWsState();
+ break;
+ case _EOL:
+ insertLineNumber();
+ exitState=true;
+ break;
+ case _EOF:
+ eof = true;
+ break;
+ default:
+ exitState=newState!=NUMBER;
+ break;
+ }
+ }
+ while ( ( !exitState ) && ( !eof ) );
+
+ closeTag ( NUMBER );
+ return eof;
+ }
+
+
+ bool CodeGenerator::processMultiLineCommentState()
+ {
+ int commentCount=1;
+ int delimPairID = langInfo.getDelimiterPairID ( token );
+ State newState=STANDARD;
+ bool eof=false, exitState=false;
+ openTag ( ML_COMMENT );
+ do
+ {
+ printMaskedToken ( false, newState!=_WS );
+ newState= getCurrentState();
+
+ switch ( newState )
+ {
+ case _WS:
+ processWsState();
+ break;
+ case _EOL:
+ wsBuffer += closeTags[ML_COMMENT];
+ insertLineNumber();
+ wsBuffer += openTags[ML_COMMENT];
+ break;
+ case _EOF:
+ eof = true;
+ break;
+ case ML_COMMENT:
+ if ( langInfo.allowNestedMLComments() )
+ {
+ ++commentCount;
+ }
+ // if delimiters are equal, close the comment by continueing to
+ // ML_COMMENT_END section
+ if ( langInfo.delimiterIsDistinct ( ML_COMMENT ) ) break;
+
+ case ML_COMMENT_END:
+ if ( delimPairID!=langInfo.getDelimiterPairID ( token ) ) break;
+ commentCount--;
+ if ( !commentCount )
+ {
+ printMaskedToken();
+ exitState=true;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ while ( ( !exitState ) && ( !eof ) );
+
+ closeTag ( ML_COMMENT );
+ return eof;
+ }
+
+
+ bool CodeGenerator::processSingleLineCommentState()
+ {
+
+ if ( checkSpecialCmd() )
+ {
+ return in->bad(); // if input stream is bad, report eof to calling method
+ }
+
+ State newState=STANDARD;
+ bool eof=false, exitState=false;
+
+ openTag ( SL_COMMENT );
+ do
+ {
+ printMaskedToken ( false, newState!=_WS );
+ newState= getCurrentState();
+
+ switch ( newState )
+ {
+ case _WS:
+ processWsState();
+ break;
+ case _EOL:
+ printMaskedToken();
+ if ( preFormatter.isEnabled() && preFormatter.isWrappedLine ( lineNumber-1 ) )
+ {
+ exitState=false;
+ }
+ else
+ {
+ exitState=true;
+ }
+ if ( !exitState ) wsBuffer += closeTags[SL_COMMENT];
+ insertLineNumber();
+ if ( !exitState ) wsBuffer += openTags[SL_COMMENT];
+
+ break;
+ case _EOF:
+ eof = true;
+ break;
+ default:
+ break;
+ }
+ }
+ while ( ( !exitState ) && ( !eof ) );
+
+ closeTag ( SL_COMMENT );
+ return eof;
+ }
+
+
+ bool CodeGenerator::processDirectiveState()
+ {
+ State newState=STANDARD;
+ bool eof=false, exitState=false;
+
+ openTag ( DIRECTIVE );
+ do
+ {
+ printMaskedToken ( false, newState!=_WS );
+ newState= getCurrentState();
+ switch ( newState )
+ {
+ case _WS:
+ processWsState();
+ break;
+ case DIRECTIVE_END:
+ printMaskedToken();
+ exitState=true;
+ break;
+ case _EOL:
+ printMaskedToken();
+ if ( preFormatter.isEnabled() && preFormatter.isWrappedLine ( lineNumber-1 ) )
+ {
+ exitState=false;
+ }
+ else
+ {
+ exitState= ( terminatingChar!=langInfo.getContinuationChar() );
+ }
+ if ( !exitState ) wsBuffer += closeTags[DIRECTIVE];
+ insertLineNumber();
+ if ( !exitState ) wsBuffer += openTags[DIRECTIVE];
+ break;
+ case ML_COMMENT:
+ closeTag ( DIRECTIVE );
+ eof= processMultiLineCommentState();
+ openTag ( DIRECTIVE );
+ break;
+ case SL_COMMENT:
+ closeTag ( DIRECTIVE );
+ eof= processSingleLineCommentState();
+ openTag ( DIRECTIVE );
+ exitState=true;
+ break;
+ case STRING:
+ closeTag ( DIRECTIVE );
+ eof=processStringState ( DIRECTIVE );
+ openTag ( DIRECTIVE );
+ break;
+ case _EOF:
+ eof = true;
+ break;
+ default:
+ break;
+ }
+ }
+ while ( ( !exitState ) && ( !eof ) );
+
+ closeTag ( DIRECTIVE );
+ return eof;
+ }
+
+
+ bool CodeGenerator::processStringState ( State oldState )
+ {
+ State newState=STANDARD;
+ bool eof=false, exitState=false;
+ bool returnedFromOtherState=false;
+ // Test if character before string open delimiter token equals to the
+ // raw string prefix (Example: r" ", r""" """ in Python)
+ bool isRawString=false;
+ if ( lineIndex>token.length() )
+ {
+ isRawString = line[lineIndex-token.length()-1]==langInfo.getRawStringPrefix();
+ }
+ int delimPairID = langInfo.getDelimiterPairID ( token );
+ State myState= ( oldState==DIRECTIVE ) ? DIRECTIVE_STRING : STRING;
+ openTag ( myState );
+ do
+ {
+ // true if last token was an escape char
+ if ( !returnedFromOtherState )
+ {
+ printMaskedToken ( false, newState!=_WS );
+ }
+ returnedFromOtherState=false;
+ newState= getCurrentState();
+
+ switch ( newState )
+ {
+ case _WS:
+ processWsState();
+ break;
+ case _EOL:
+ wsBuffer += closeTags[myState];
+ insertLineNumber();
+ wsBuffer += openTags[myState];
+ break;
+ case STRING_END:
+ exitState= true;
+ printMaskedToken();
+ break;
+ case STRING:
+ // if there exist multiple string delimiters, close string if
+ // current delimiters is equal to the opening delimiter
+ exitState = ( delimPairID==langInfo.getDelimiterPairID ( token ) );
+ printMaskedToken();
+ break;
+ case ESC_CHAR:
+ if ( !isRawString )
+ {
+ closeTag ( myState );
+ eof=processEscapeCharState();
+ openTag ( myState );
+ returnedFromOtherState=true;
+ }
+ break;
+ case _EOF:
+ eof = true;
+ break;
+ default:
+ printMaskedToken();
+ break;
+ }
+ }
+ while ( ( !exitState ) && ( !eof ) );
+
+ closeTag ( myState );
+ return eof;
+ }
+
+
+ bool CodeGenerator::processSymbolState()
+ {
+
+ State newState=STANDARD;
+ bool eof=false,
+ exitState=false;
+
+ openTag ( SYMBOL );
+ do
+ {
+ printMaskedToken ( false, newState!=_WS );
+ newState= getCurrentState();
+ switch ( newState )
+ {
+ case _WS:
+ processWsState();
+ break;
+ case _EOL:
+ insertLineNumber();
+ exitState=true;
+ break;
+ case _EOF:
+ eof = true;
+ break;
+ default:
+ exitState=newState!=SYMBOL;
+ break;
+ }
+ }
+ while ( ( !exitState ) && ( !eof ) );
+
+ closeTag ( SYMBOL );
+ return eof;
+ }
+
+
+ bool CodeGenerator::processEscapeCharState()
+ {
+ State newState=STANDARD;
+ bool eof=false, exitState=false;
+ openTag ( ESC_CHAR );
+ do
+ {
+ printMaskedToken ( false, newState!=_WS );
+ newState= getCurrentState();
+ switch ( newState )
+ {
+ case _EOL:
+ insertLineNumber();
+ exitState=true;
+ break;
+ case _WS:
+ processWsState();
+ break;
+ case _EOF:
+ eof = true;
+ break;
+ default:
+ exitState=newState!=ESC_CHAR;
+ break;
+ }
+ }
+ while ( ( !exitState ) && ( !eof ) );
+
+ closeTag ( ESC_CHAR );
+ return eof;
+ }
+
+
+ void CodeGenerator::processWsState()
+ {
+ if ( !maskWs )
+ {
+ wsBuffer += token;
+ token.clear();
+ return;
+ }
+ flushWs();
+ int cntWs=0;
+ lineIndex--;
+
+ // while (iswspace(line[lineIndex]) ) {
+ while ( line[lineIndex]==' ' || line[lineIndex]=='\t' )
+ {
+ ++cntWs;
+ ++lineIndex;
+ }
+
+ if ( cntWs>1 )
+ {
+ unsigned int styleID=getStyleID ( currentState, currentKeywordClass );
+ if ( excludeWs && styleID!=_UNKNOWN )
+ {
+ *out << closeTags[styleID];
+ }
+ *out << maskWsBegin;
+ for ( int i=0; i<cntWs; i++ )
+ {
+ *out << spacer;
+ }
+ *out << maskWsEnd;
+ if ( excludeWs && styleID!=_UNKNOWN )
+ {
+ *out << openTags[styleID];
+ }
+ }
+ else
+ {
+ *out << spacer; //Bugfix fehlender Space nach Strings
+ }
+ token.clear();
+ }
+
+
+ void CodeGenerator::flushWs()
+ {
+ *out<<wsBuffer;
+ wsBuffer.clear();
+ }
+
+
+ string CodeGenerator::getNewLine()
+ {
+ return (printNewLines) ? newLineTag : "";
+ }
+
+
+ void CodeGenerator::insertLineNumber ( bool insertNewLine )
+ {
+
+ if ( insertNewLine )
+ {
+ wsBuffer += getNewLine();
+ }
+
+ if ( showLineNumbers )
+ {
+ ostringstream os;
+ ostringstream numberPrefix;
+ if ( lineNumberFillZeroes )
+ {
+ os.fill ( '0' );
+ }
+ os <<setw ( getLineNumberWidth() ) << right << lineNumber+lineNumberOffset;
+
+ numberPrefix << openTags[LINENUMBER];
+ maskString ( numberPrefix, os.str() );
+ numberPrefix << spacer
+ << closeTags[LINENUMBER];
+
+ wsBuffer += numberPrefix.str();
+ }
+ }
+
+
+ unsigned int CodeGenerator::getLineIndex()
+ {
+ return lineIndex;
+ }
+
+
+ bool CodeGenerator::printExternalStyle ( const string &outFile )
+ {
+ if ( !includeStyleDef && langInfo.highlightingEnabled() )
+ {
+ ostream *cssOutFile = ( outFile.empty() ? &cout :new ofstream ( outFile.c_str() ) );
+ if ( !cssOutFile->fail() )
+ {
+ *cssOutFile << styleCommentOpen
+ <<" Style definition file generated by highlight "
+ << HIGHLIGHT_VERSION << ", " << HIGHLIGHT_URL
+ << " " << styleCommentClose << "\n";
+ *cssOutFile << "\n" << styleCommentOpen
+ << " Highlighting theme definition: "
+ << styleCommentClose << "\n\n"
+ << getStyleDefinition()
+ << "\n";
+ *cssOutFile << readUserStyleDef();
+ if ( !outFile.empty() ) delete cssOutFile;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
+
+ string CodeGenerator::readUserStyleDef()
+ {
+ ostringstream ostr;
+ if ( !styleInputPath.empty() )
+ {
+ ifstream userStyleDef ( styleInputPath.c_str() );
+ if ( userStyleDef )
+ {
+ ostr << "\n" << styleCommentOpen
+ << " Content of " << styleInputPath
+ << ": " <<styleCommentClose << "\n";
+ string line;
+ while ( getline ( userStyleDef, line ) )
+ {
+ ostr << line << "\n";
+ }
+ userStyleDef.close();
+ }
+ else
+ {
+ ostr << styleCommentOpen
+ << " ERROR: Could not include " << styleInputPath
+ << "." << styleCommentClose << "\n";
+ }
+ }
+ return ostr.str();
+ }
+
+
+ bool CodeGenerator::checkSpecialCmd()
+ {
+
+ //cerr << "token: "<<token<< " index"<< lineIndex << " "<<line [ lineIndex ]<< "sizes: "<<token.size()<<"=="<<line.size()<<endl;
+ string noParseCmd="@highlight";
+ // if single line comment is described with regex, token is equal to line
+ // otherwise start searching after the token, which then consists of comment identifier
+ size_t searchStart= ( token.size() ==line.size() ) ? 0 : lineIndex;
+ size_t cmdPos = line.find ( noParseCmd, searchStart );
+ size_t pos=1;
+ if ( cmdPos!=string::npos )
+ {
+ string res;
+ string replaceVar;
+
+ auto_ptr<Pattern> reDefPattern ( Pattern::compile ( "\\$[-\\w]+" ) );
+ auto_ptr<Matcher> m ( reDefPattern->createMatcher ( line.substr ( noParseCmd.size() +cmdPos ) ) );
+ while ( m.get() && m->findNextMatch() )
+ {
+ res+=line.substr ( noParseCmd.size() +cmdPos + pos ,
+ m->getStartingIndex ( 0 )-pos );
+ replaceVar = m->getGroup ( 0 );
+ if ( replaceVar=="$nl" )
+ {
+ res+="\n";
+ }
+ else if ( replaceVar=="$infile" )
+ {
+ res+= ( inFile.size() ) ? inFile: "stdin";
+ }
+ else if ( replaceVar=="$outfile" )
+ {
+ res+= ( outFile.size() ) ? outFile: "stdout";
+ }
+ else if ( replaceVar=="$title" )
+ {
+ res+= docTitle;
+ }
+ else if ( replaceVar=="$theme"||replaceVar=="$style" )
+ {
+ res+= getStyleName();
+ }
+ else if ( replaceVar=="$font-face" )
+ {
+ res+= getBaseFont();
+ }
+ else if ( replaceVar=="$font-size" )
+ {
+ res+= getBaseFontSize();
+ }
+ else if ( replaceVar=="$encoding" )
+ {
+ res+= encoding;
+ }
+ else if ( replaceVar=="$linenum" )
+ {
+ char numBuf[10];
+ snprintf ( numBuf, sizeof ( numBuf ), "%d", lineNumber );
+ res+= string ( numBuf );
+ }
+ pos=m->getEndingIndex ( 0 );
+ }
+ res+=line.substr ( noParseCmd.size() +cmdPos + pos );
+
+ *out<<res;
+
+ // hide comment line from output
+ token.clear();
+ lineIndex=line.length();
+ getInputChar();
+ lineNumber--;
+ // end hide
+
+ return true; // do not parse line as comment
+ }
+
+ return false; //parse comment as usual
+ }
+
+}
diff --git a/support/highlight/src/core/codegenerator.h b/support/highlight/src/core/codegenerator.h
new file mode 100644
index 0000000000..d5323673a2
--- /dev/null
+++ b/support/highlight/src/core/codegenerator.h
@@ -0,0 +1,729 @@
+/***************************************************************************
+ codegenerator.h - description
+ -------------------
+ begin : Die Jul 9 2002
+ copyright : (C) 2002-2009 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#ifndef CODEPARSER_H
+#define CODEPARSER_H
+
+#include <iostream>
+#include <sstream>
+#include <string>
+#include <iomanip>
+
+#include "languagedefinition.h"
+#include "documentstyle.h"
+#include "ctagsreader.h"
+#include "astyle/astyle.h"
+#include "preformatter.h"
+#include "enums.h"
+#include "stringtools.h"
+
+/// The highlight namespace contains all classes and data structures needed for parsing input data.
+
+namespace highlight
+{
+ /** \brief Regular Expession Information
+
+ This class associates a processing state with a keyword class and the length of the matched token.
+
+ * @author Andre Simon
+ */
+ class ReGroup
+ {
+ public:
+
+ /// Constructor
+ ReGroup() : length ( 0 ), state ( STANDARD ), kwClass ( 0 ), name()
+ {
+ }
+
+ /// Constructor
+ ReGroup ( State s, unsigned int l , unsigned int c, const string&n ) :
+ length ( l ), state ( s ), kwClass ( c ), name(n)
+ {
+ }
+
+ /// Copy Constructor
+ ReGroup ( const ReGroup& other )
+ {
+ length = other.length;
+ state = other.state;
+ kwClass = other.kwClass;
+ name=other.name;
+ }
+
+ /// Operator overloading
+ ReGroup& operator= ( const ReGroup & other )
+ {
+ length = other.length;
+ state = other.state;
+ kwClass = other.kwClass;
+ name=other.name;
+ return *this;
+ }
+
+ ~ReGroup()
+ {
+ }
+
+ unsigned int length; ///< length of the token
+ State state; ///< state of the matched token (keyword, string, etc)
+ unsigned int kwClass; ///< keyword class if state is keyword
+ string name; ///< language name needed to handle embedded languages
+ };
+
+
+ /** \brief Base class for parsing. Works like a finite state machine.
+
+ The virtual class provides source code parsing functionality, based on
+ information stored in language definitions.<br>
+ The derived classes have to define the output format.<br>
+ The colour information is stored in a DocumentStyle instance.<br>
+ Codegenerator is a singleton class.<br>
+ Use getInstance for a singleton class instance. Then call the init* methods
+ and loadLanguage to initialize the parser. Init methods have to be called first.
+ Call generate* methods to get results.
+
+ * @author Andre Simon
+ */
+
+ class CodeGenerator
+ {
+
+ public:
+
+ virtual ~CodeGenerator();
+
+ /**
+ Get appropriate Codegenerator instance (should be used with auto_ptr)
+ \param type Output file type (HTML, XHTML, RTF, LATEX, TEX, ANSI, XTERM256)
+ \return CodeGenerator
+ */
+ static CodeGenerator* getInstance ( OutputType type );
+
+ /**
+ Delete CodeGenerator instance (this is intended for SWIG integration only,
+ in normal C++ code the result of getInstance() should be saved in an auto_ptr)
+ \param CodeGenerator* CodeGenerator instance
+ */
+ static void deleteInstance ( CodeGenerator* inst ) {if ( inst ) delete inst;}
+
+ /**
+ Define colour theme information; needs to be called before using a generate* method.
+ Call this method before loadLanguage().
+ \param themePath Path of style description file
+ \return true if successfull
+ */
+ bool initTheme ( const string& themePath );
+
+ /** initialize source code indentation and reformatting scheme;
+ needs to be called before using a generate* method
+ \param indentScheme Name of indentation scheme
+ \return true if successfull
+ */
+ bool initIndentationScheme ( const string&indentScheme );
+
+ /**
+ Load ctags meta information; needs to be called before using a generate* method
+ \param ctagsPath Path of tags file
+ \return true if successfull
+ */
+ bool initTagInformation ( const string& ctagsPath );
+
+ /** \param langDefPath Absolute path to language definition, may be used multiple times for a generator instance
+ \return LOAD_FAILED: failure,
+ LOAD_NEW: Reload necessary,
+ LOAD_NONE: no reload necessary
+ */
+ LoadResult loadLanguage ( const string& langDefPath );
+
+ /**
+ Generate output file from input file
+ \param inFileName Path of input file (if empty use stdin)
+ \param outFileName Path of output file (if empty use stdout)
+ \return ParseError
+ */
+ ParseError generateFile ( const string &inFileName, const string &outFileName );
+
+ /**
+ Generate output string from input string
+ \param input input code string
+ \return formatted output code
+ */
+ string generateString ( const string &input );
+
+ /**
+ Generate output string from input file
+ \param inFileName file path
+ \return formatted output code
+ */
+ string generateStringFromFile ( const string &inFileName );
+
+ /** Print style definitions to external file or stdout
+ \param outFile Path of external style definition; print to stdout if empty
+ \return true if successfull
+ */
+ bool printExternalStyle ( const string &outFile );
+
+ /** Print index file with all input file names
+ \param fileList List of output file names
+ \param outPath Output path
+ \return true if successfull
+ */
+ virtual bool printIndexFile ( const vector<string> & fileList,
+ const string &outPath );
+
+
+ /** define the preformatting parameters. Preformatting takes place before
+ the optional astyle reformatting and indenting is performed (defined by initIndentationScheme)
+ \param lineWrappingStyle wrapping style (WRAP_DISABLED, WRAP_SIMPLE, WRAP_DEFAULT)
+ \param lineLength max line length
+ \param numberSpaces number of spaces which replace a tab
+ */
+ void setPreformatting ( WrapMode lineWrappingStyle, unsigned int lineLength,int numberSpaces );
+
+ /** \deprecated
+ \return True if document style was found */
+ bool styleFound();
+
+ /** \return True if reformatting of current input is disabled */
+ bool formattingDisabled();
+
+ /** \return True if reformatting of current input is possible */
+ bool formattingIsPossible();
+
+ /** \deprecated
+ \param langDefPath Absolute path to language definition; use loadLanguage instead
+ \return LOAD_FAILED: failure,
+ LOAD_NEW: Reload necessary,
+ LOAD_NONE: no reload necessary
+ */
+ LoadResult initLanguage ( const string& langDefPath ) { return loadLanguage ( langDefPath );}
+
+ /** \return Language definition*/
+ const LanguageDefinition &getLanguage();
+
+ /** output line numbers
+ \param flag true if line numbers should be printed
+ \param startCnt line number starting count
+ */
+ void setPrintLineNumbers ( bool flag, unsigned int startCnt=1 );
+
+ /** \return line number flag */
+ bool getPrintLineNumbers();
+
+ /** output line numbers filled with zeroes
+ \param flag true if zeroes should be printed
+ */
+ void setPrintZeroes ( bool flag );
+
+ /** \return print zeroes flag */
+ bool getPrintZeroes();
+
+ /** omit document header and footer
+ \param flag true if output should be fragmented
+ */
+ void setFragmentCode ( bool flag );
+
+ /** \return fragment flag */
+ bool getFragmentCode();
+
+ /** define line number width
+ \param w width
+ */
+ void setLineNumberWidth ( int w );
+
+ /** \return line number width */
+ int getLineNumberWidth();
+
+ /** check if input is binary or text
+ \param flag true if input should be checked
+ */
+ void setValidateInput ( bool flag );
+
+ /** \return input validation flag */
+ bool getValidateInput();
+
+ /** \return style path */
+ const string& getStyleName();
+
+ /** use this font as base font
+ \param s the font name, e.g. "Courier New"
+ */
+ void setBaseFont ( const string& s );
+
+ /** \return base font */
+ const string getBaseFont() const ;
+
+ /** use this size as base font size
+ \param s the font size, e.g. "12"
+ */
+ void setBaseFontSize ( const string& s );
+
+ /** \return base font size*/
+ const string getBaseFontSize();
+
+ /** tell parser the include style definition in output
+ \param flag true if style should be included
+ */
+ void setIncludeStyle ( bool flag );
+
+
+ /** tell parser to omit trailing newline character
+ \param flag true if no trailing newline should be printed
+ */
+ void disableTrailingNL ( bool flag );
+
+ /** Set style input path
+ \param path path to style input file
+ */
+ void setStyleInputPath ( const string& path );
+
+ /** Set style output path
+ \param path path to style output file
+ */
+ void setStyleOutputPath ( const string& path );
+
+ /** Set encoding (output encoding must match input file)
+ \param encodingName encoding name
+ */
+ void setEncoding ( const string& encodingName );
+
+ /** \return style input file path */
+ const string& getStyleInputPath();
+
+ /** \return style output file path */
+ const string& getStyleOutputPath();
+
+ /** \param title Document title */
+ void setTitle ( const string & title );
+
+ /** \return Document title */
+ string getTitle();
+
+ /** \param cnt maximum number of input lines to be processed */
+ void setMaxInputLineCnt ( unsigned int cnt );
+
+ /** \return true if chosen document style has white background colour */
+ bool hasWhiteBGColour();
+
+ /** \param keyCase Keyword case */
+ void setKeyWordCase ( StringTools::KeywordCase keyCase );
+
+ /** \param lineNo number of line that should be marked
+ \param helpTxt additional help text */
+ void addMarkedLine ( int lineNo, string &helpTxt );
+
+ /** \param delim End of line delimiter (default: NL)
+ */
+ void setEOLDelimiter(char delim);
+
+ /** Define the name of a nested langage which is located at the beginning of input.
+ The opening embedded delimiter is missing, but the closing delimiter must exist.
+ \param langName name of nested language
+ */
+ void setStartingNestedLang(const string &langName);
+
+
+ /** set HTML output anchor flag
+ */
+ virtual void setHTMLAttachAnchors ( bool ) {};
+
+ /** set HTML output ordered list flag
+ */
+ virtual void setHTMLOrderedList ( bool ) {};
+
+ /** set HTML output inline CSS flag
+ */
+ virtual void setHTMLInlineCSS ( bool ) {};
+
+ /** set HTML output enclose pre tag flag
+ */
+ virtual void setHTMLEnclosePreTag ( bool ) {};
+
+ /** set HTML output anchor prefix
+ */
+ virtual void setHTMLAnchorPrefix ( const string& ) {};
+
+ /** set HTML output class name
+ */
+ virtual void setHTMLClassName ( const string& ) {};
+
+ /** set LaTeX replace quotes flag
+ */
+ virtual void setLATEXReplaceQuotes ( bool ) {};
+
+ /** set LaTeX no Babel shorthands flag
+ */
+ virtual void setLATEXNoShorthands ( bool ) {};
+
+ /** set LaTeX pretty Symbols flag
+ */
+ virtual void setLATEXPrettySymbols ( bool ) {};
+
+ /** set RTF page size
+ */
+ virtual void setRTFPageSize ( const string& ) {};
+
+ /** set RTF output character styles flag
+ */
+ virtual void setRTFCharStyles ( bool ) {};
+
+ /** set SVG page size
+ */
+ virtual void setSVGSize ( const string&, const string& ) {};
+
+
+ protected:
+
+ static const unsigned int NUMBER_BUILTIN_STATES; ///< number of token states (without keyword group IDs)
+
+ static const string STY_NAME_STD;
+ static const string STY_NAME_STR;
+ static const string STY_NAME_NUM;
+ static const string STY_NAME_SLC;
+ static const string STY_NAME_COM;
+ static const string STY_NAME_ESC;
+ static const string STY_NAME_DIR;
+ static const string STY_NAME_DST;
+ static const string STY_NAME_LIN;
+ static const string STY_NAME_SYM;
+
+ /** \param type Output type */
+ CodeGenerator ( highlight::OutputType type );
+ CodeGenerator() {};
+
+ /** \param c Character to be masked
+ \return Escape sequence of output format */
+ virtual string maskCharacter ( unsigned char c ) = 0;
+
+ /** \param ss destination stream
+ \param s string */
+ void maskString ( ostream& ss, const string &s ) ;
+
+ /** \param s Symbol string
+ \param searchPos Position where search starts
+ \return Found state (integer value) */
+ State getState ( const string &s, unsigned int searchPos );
+
+ /** Get current line number
+ \return line number */
+ unsigned int getLineNumber();
+
+ vector <string> openTags, ///< list of format delimiters (open new format descriptions)
+ closeTags; ///< list of format delimiters (close format descriptions)
+
+ /** Description of document colour style*/
+ DocumentStyle docStyle;
+
+ /** Language definition*/
+ LanguageDefinition langInfo;
+
+ /** CTags meta information */
+ CTagsReader metaInfo;
+
+ /** Tag for inserting line feeds*/
+ string newLineTag;
+
+ /** String that represents a white space in output */
+ string spacer;
+
+ /** file input*/
+ istream *in;
+
+ /** file output*/
+ ostream *out;
+
+ string maskWsBegin, ///< open whitespace mask
+ maskWsEnd; ///< close whitespace mask
+
+ string styleCommentOpen, ///< open comment delimiter
+ styleCommentClose; ///< close comment delimiter
+
+ string embedBlockOpen, ///< open block delimiter to highlight embedded code
+ embedBlockClose; ///< close block delimiter
+
+ /** Encoding name */
+ string encoding;
+
+ /** document title */
+ string docTitle;
+
+ string inFile, ///< input file name
+ outFile; ///< output file name
+
+ /** Test if maskWsBegin and maskWsEnd should be applied */
+ bool maskWs;
+
+ /** Test if whitespace sould always be separated from enclosing tokens */
+ bool excludeWs;
+
+ /** Test if header and footer should be omitted */
+ bool fragmentOutput;
+
+ /** Test if line numbers should be printed */
+ bool showLineNumbers;
+
+ /** Test if leading spyce of line number should be filled with zeroes*/
+ bool lineNumberFillZeroes;
+
+ /** Flag to test if newlines should be printed */
+ bool printNewLines;
+
+ /** The base font to use */
+ string baseFont ;
+
+ /** The base font size to use */
+ string baseFontSize ;
+
+ /** Current line of input file*/
+ string line;
+
+ /** Current line number */
+ unsigned int lineNumber;
+
+ /**output line number count start */
+ int lineNumberOffset;
+
+ /** Current state*/
+ State currentState;
+
+ /** keyword class id, used to apply the corresponding keyword style*/
+ unsigned int currentKeywordClass;
+
+ /** Processes origin state */
+ void processRootState();
+
+ /** \return line break sequence */
+ virtual string getNewLine();
+
+ /**
+ \param s current state
+ \param kwClassID keyword class (has to be set when s=KEYWORD)
+ \return Index of style tag corresponding to the states
+ */
+ unsigned int getStyleID ( State s, unsigned int kwClassID = 0 );
+
+ /** \return line index */
+ unsigned int getLineIndex();
+
+ /** print all remaining white space*/
+ void flushWs();
+
+ /** \return Content of user defined input style */
+ string readUserStyleDef();
+
+ /** \return Style definition of the chosen output format */
+ virtual string getStyleDefinition() {return "";};
+
+ /** \return true id encoding is defined */
+ bool encodingDefined() {return StringTools::change_case ( encoding ) !="none";}
+
+ /** contains white space, which will be printed after a closing tag */
+ string wsBuffer;
+
+ /** Flag to test if style definition should be included in output document */
+ bool includeStyleDef;
+
+ /** map which saves all lines that should be highlghted */
+ map <int, string> markLines;
+
+ /** Class for line wrapping and tab replacement*/
+ PreFormatter preFormatter;
+
+ private:
+
+ CodeGenerator ( const CodeGenerator& ) {}
+
+ CodeGenerator& operator= ( CodeGenerator& ) { return *this;}
+
+ /** Insert line number at the beginning of current output line */
+ virtual void insertLineNumber ( bool insertNewLine=true );
+
+ /** Prints document footer
+ @return footer */
+ virtual string getFooter() = 0;
+
+ /** Prints document body*/
+ virtual void printBody() = 0;
+
+ /** Prints document header
+ @return header
+ */
+ virtual string getHeader() = 0;
+
+ /** initialize tags in specific format according to colouring information provided in DucumentStyle */
+ virtual void initOutputTags() = 0;
+
+ /** \param keyword group id
+ \return open tag */
+ virtual string getKeywordOpenTag ( unsigned int ) = 0;
+
+ /** \param keyword group id
+ \return close tag */
+ virtual string getKeywordCloseTag ( unsigned int ) = 0;
+
+ /** return open tag to include ctags meta information
+ \param info tag information of current token
+ \return opening tag
+ */
+ virtual string getMetaInfoOpenTag ( const TagInfo& info ) {return "";}
+
+ /** return close tag of meta information
+ \return closing tag
+ */
+ virtual string getMetaInfoCloseTag() {return "";}
+
+ /** open a new tag, set current state to s*/
+ void openTag ( State s );
+
+ /** close opened tag, clear current state */
+ void closeTag ( State s );
+
+ /** close Keyword tag of corresponding style ID */
+ void closeKWTag ( unsigned int styleID );
+
+ /** open Keyword tag of corresponding style ID */
+ void openKWTag ( unsigned int styleID );
+
+
+
+ /*void closeTag ( unsigned int styleID );
+
+ void openTag ( unsigned int styleID );*/
+
+ /// path to style definition file
+ string themePath;
+
+ /// path to host language definition
+ string hostLangDefPath;
+
+ /// path to embedded language definition
+ string embedLangDefPath;
+
+ /// name of nested language which starts the input (ie opening delim missing, but closing delim exists)
+ string embedLangStart;
+
+ /// contains current position in line
+ unsigned int lineIndex;
+
+ /// width of line numbering coloumn
+ unsigned int lineNumberWidth;
+
+ /**maximum count of input lines to be processed*/
+ unsigned int maxLineCnt;
+
+ /**last character of the last line*/
+ unsigned char terminatingChar;
+
+ /** Class for reformatting */
+ astyle::ASFormatter *formatter;
+
+ /** Flag to test if formatting is enabled with current input document*/
+ bool formattingEnabled;
+
+ /** Flag to test if formatting is possible with current input document*/
+ bool formattingPossible;
+
+ /** Flag to test if input should be validated (binary or text) */
+ bool validateInput;
+
+ /** Flag to test if ctags information is available */
+ bool tagsEnabled;
+
+ /** Flag to test if trailing newline should be printed */
+ bool noTrailingNewLine;
+
+ /** flag which determines keyword output (unchangeed, uppercase, lowercase)*/
+ StringTools::KeywordCase keywordCase;
+
+ /** contains the current token*/
+ string token;
+
+ string styleInputPath, ///< style input file path
+ styleOutputPath; ///< style output file path
+
+ /** end-of-line delimiter*/
+ char eolDelimiter;
+
+ /** Resets parser to origin state, call this after every file conversion */
+ void reset();
+
+ /** read new line from in stream */
+ bool readNewLine ( string &newLine );
+
+ /** return next character from in stream */
+ unsigned char getInputChar();
+
+ /** output file type */
+ OutputType outputType;
+
+ /** return new state */
+ State getCurrentState ();
+
+ /* Methods that represent a parsing state */
+ bool processKeywordState ( State myState ); ///< process keywords
+ bool processNumberState() ; ///< process numbers
+ bool processMultiLineCommentState(); ///< process multi line comments
+ bool processSingleLineCommentState(); ///< process single line comments
+ bool processStringState ( State oldState ); ///< process strings
+ bool processEscapeCharState(); ///< process escape characters
+ bool processDirectiveState(); ///< process directives
+ bool processTagState(); ///< process tags
+ bool processSymbolState(); ///< process symbols
+ void processWsState(); ///< process whitespace
+ bool processSyntaxChangeState(State myState ); ///< process syntax change of embedded languages
+
+ /** print escaped token and clears it
+ \param addMetaInfo set true if token may have meta information
+ \param flushWhiteSpace set true if white space should be flushed
+ \param tcase keyword case
+ */
+ void printMaskedToken ( bool addMetaInfo = false, bool flushWhiteSpace = true,
+ StringTools::KeywordCase tcase = StringTools::CASE_UNCHANGED );
+
+ /** look for special commands in comments
+ \return true if command was found
+ */
+ bool checkSpecialCmd();
+
+ /** association of matched regexes and the corresponding keyword class ids*/
+ map <int, ReGroup> regexGroups;
+
+ /** test for regular expressions
+ \param line current input line*/
+ void matchRegex ( const string &line );
+
+ /** \return true if input is no binary stream */
+ bool validateInputStream();
+
+ void loadEmbeddedLang(const string&embedLangDefPath);
+
+ };
+
+}
+
+#endif
diff --git a/support/highlight/src/core/configurationreader.cpp b/support/highlight/src/core/configurationreader.cpp
new file mode 100644
index 0000000000..49b3cca2d4
--- /dev/null
+++ b/support/highlight/src/core/configurationreader.cpp
@@ -0,0 +1,112 @@
+/***************************************************************************
+ configurationreader.cpp - description
+ -------------------
+ begin : Son Nov 10 2002
+ copyright : (C) 2002 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#include "configurationreader.h"
+
+#include <string>
+#include <sstream>
+#include <map>
+#include <iostream>
+#include <fstream>
+#include <vector>
+
+#include "stringtools.h"
+
+using namespace std;
+
+ConfigurationReader::ConfigurationReader ( const string & configuration_path )
+{
+ ifstream in ( configuration_path.c_str() );
+ fileFound=in;
+ if ( fileFound )
+ {
+ string line;
+ line.reserve ( 500 );
+ size_t lineBegin;
+ size_t delimPos;
+ string paramName;
+ char suffix[10];
+ int i=0;
+
+ while ( getline ( in, line ) )
+ {
+ lineBegin=line.find_first_not_of ( "\t " );
+ if ( ( line.size() >2 ) && ( lineBegin!=string::npos )
+ && ( line.at ( lineBegin ) !='#' ) ) //comment?
+ {
+ if ( line[lineBegin]=='$' ) // new parameter?
+ {
+ delimPos=line.find ( "=",lineBegin )-1;
+ if ( delimPos!=string::npos )
+ {
+ paramName=StringTools::trimRight (
+ StringTools::change_case ( line.substr ( lineBegin+1, delimPos ) ) );
+ // if parameter already exists, make it unique
+ if ( parameterMap.count ( paramName ) )
+ {
+ snprintf ( suffix, sizeof ( suffix ), "#%05d", ++i );
+ paramName+=suffix;
+ }
+ parameterNames.push_back ( paramName );
+ parameterMap[paramName] = line.substr ( delimPos+2, line.length() );
+ }
+ }
+ else
+ {
+ parameterMap[paramName]+= ( " "+line );
+ }
+ }
+ }
+ in.close();
+ }
+}
+
+ConfigurationReader::~ConfigurationReader()
+{
+}
+
+bool ConfigurationReader::found()
+{
+ return fileFound;
+}
+
+string &ConfigurationReader::getParameter ( const string & paramName )
+{
+ return parameterMap[paramName] ;
+}
+
+const char* ConfigurationReader::getCParameter ( const string & paramName )
+{
+ return parameterMap[paramName].c_str() ;
+}
+
+vector<string> &ConfigurationReader::getParameterNames()
+{
+ return parameterNames;
+}
+
+
diff --git a/support/highlight/src/core/configurationreader.h b/support/highlight/src/core/configurationreader.h
new file mode 100644
index 0000000000..7755081c12
--- /dev/null
+++ b/support/highlight/src/core/configurationreader.h
@@ -0,0 +1,80 @@
+/***************************************************************************
+ configurationreader.h - description
+ -------------------
+ begin : Son Nov 10 2002
+ copyright : (C) 2002 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#ifndef CONFIGURATIONREADER_H
+#define CONFIGURATIONREADER_H
+
+#include <string>
+#include <map>
+#include <vector>
+
+using namespace std;
+
+/** Maps parameter keys to values*/
+typedef map<string, string> ParameterMap;
+
+
+/** \brief Class to handle ASCII config files
+
+ Configuration file format:<br>
+ $ParamName=ParamValue<br>
+ ParamValue may be splittet over multiple lines<br>
+ ParamName is not case sensitive<br>
+ Comments start with # as the first character of a line
+
+ **/
+
+class ConfigurationReader
+{
+ public:
+ /** Constructor
+ \param configuration_path Path to configuration file
+ */
+ ConfigurationReader ( const string & configuration_path );
+ ~ConfigurationReader();
+
+ /** \param paramName Name of parameter
+ \return Value of parameter */
+ string &getParameter ( const string & paramName );
+
+ /** \param paramName Name of parameter
+ \return Value of parameter */
+ const char* getCParameter ( const string & paramName );
+
+ /** \return True if config file exists */
+ bool found();
+
+ /** \return List of parameter names */
+ vector<string> &getParameterNames();
+
+ private:
+ ParameterMap parameterMap;
+ bool fileFound;
+ vector<string> parameterNames;
+};
+
+#endif
diff --git a/support/highlight/src/core/ctagsreader.cpp b/support/highlight/src/core/ctagsreader.cpp
new file mode 100644
index 0000000000..acfa35e649
--- /dev/null
+++ b/support/highlight/src/core/ctagsreader.cpp
@@ -0,0 +1,99 @@
+/***************************************************************************
+ ctagsreader.h - description
+ -------------------
+ begin : Tue Oct 21 2008
+ copyright : (C) 2008 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#include "ctagsreader.h"
+
+
+string TagInfo::getKind() const
+{
+ if ( kind.empty() ) return "";
+ switch ( kind[0] )
+ {
+ case 'c': return "class";
+ case 'd': return "define";
+ case 'e': return "enumerator";
+ case 'f': return "function";
+ case 'F': return "file";
+ case 'g': return "enumeration name";
+ case 'm': return "member";
+ case 'n': return "namespace";
+ case 'p': return "function prototype";
+ case 's': return "structure name";
+ case 't': return "typedef";
+ case 'u': return "union name";
+ case 'v': return "variable";
+ default: return "";
+ }
+}
+
+bool CTagsReader::load ( const string & ctags_path )
+{
+ ifstream in ( ctags_path.c_str() );
+ if ( in )
+ {
+ string line;
+ string tagname,
+ tagfile,
+ dummy1,
+ dummy2,
+ kind,
+ name_space,
+ file;
+ TagInfo info;
+ line.reserve ( 250 );
+ while ( getline ( in, line ) && line.size() )
+ {
+ if ( line[0]=='!' )
+ {
+ continue;
+ }
+
+ istringstream tagStream ( line );
+ if ( !getline ( tagStream, tagname, '\t' ) ) continue;
+ if ( !getline ( tagStream, tagfile, '\t' ) ) continue;
+ if ( !getline ( tagStream, dummy1, '\t' ) ) continue;
+ if ( !getline ( tagStream, dummy2, '\t' ) ) continue;
+ if (dummy2.empty()) {
+ while (dummy2.empty()) {
+ if ( !getline ( tagStream, dummy2, '\t' ) ) continue;
+ }
+ }
+ if ( !getline ( tagStream, kind, '\t' ) ) continue;
+ name_space.clear(); file.clear();
+ getline ( tagStream, name_space, '\t' );
+
+ info.file=tagfile;
+ info.kind=kind;
+ info.name_space=name_space;
+ //info.tag_exists=true;
+ tags[tagname] = info;
+ }
+ in.close();
+ return true;
+ }
+ return false;
+}
diff --git a/support/highlight/src/core/ctagsreader.h b/support/highlight/src/core/ctagsreader.h
new file mode 100644
index 0000000000..3686242dda
--- /dev/null
+++ b/support/highlight/src/core/ctagsreader.h
@@ -0,0 +1,104 @@
+/***************************************************************************
+ ctagsreader.h - description
+ -------------------
+ begin : Tue Oct 21 2008
+ copyright : (C) 2008 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#ifndef CTAGSREADER_H
+#define CTAGSREADER_H
+
+#include <string>
+#include <sstream>
+#include <map>
+#include <iostream>
+#include <fstream>
+
+using namespace std;
+
+/** TagInfo contains information about a ctags tag */
+class TagInfo
+{
+ public:
+ TagInfo() {};
+ string getKind() const;
+ string file, kind, name_space;
+
+};
+
+/** Maps parameter keys to values*/
+typedef map<string, TagInfo> TagsMap;
+
+class CTagsReader
+{
+ public:
+
+ CTagsReader() {};
+ ~CTagsReader() {};
+
+ /** load ctags file
+ \param ctags_path Path to ctags file
+ \return true if successfull
+ */
+ bool load ( const string & ctags_path );
+
+ /** test if tag infoation exists
+ \param tagname tag ot highlight token
+ \return true if tag information exists
+ */
+ bool tagExists ( const string& tagname )
+ {
+ return tags.count ( tagname ) >0;
+ }
+
+ /** return tag info, call tagExists first to avoid growing map
+ \param tagname tag ot highlight token
+ \return tag info
+ */
+ TagInfo getTagInfo ( const string &tagname )
+ {
+ return tags[tagname];
+ }
+
+ private:
+
+ TagsMap tags;
+};
+
+/*
+ c class name
+ d define (from #define XXX)
+ e enumerator
+ f function or method name
+ F file name
+ g enumeration name
+ m member (of structure or class data)
+ p function prototype
+ s structure name
+ t typedef
+ u union name
+ v variable
+
+*/
+
+#endif
diff --git a/support/highlight/src/core/datadir.cpp b/support/highlight/src/core/datadir.cpp
new file mode 100644
index 0000000000..faa929301a
--- /dev/null
+++ b/support/highlight/src/core/datadir.cpp
@@ -0,0 +1,181 @@
+/***************************************************************************
+ dataDir.cpp - description
+ -------------------
+ begin : Sam March 1 2003
+ copyright : (C) 2003 by André Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#include <string>
+#include <fstream>
+#include <vector>
+#include "platform_fs.h"
+
+#include "datadir.h"
+
+using namespace std;
+
+string DataDir::LSB_DATA_DIR="/usr/share/highlight/";
+string DataDir::LSB_CFG_DIR="/etc/highlight/";
+string DataDir::LSB_DOC_DIR="/usr/share/doc/highlight/";
+
+
+bool DataDir::searchDataDir ( const string &userDefinedDir )
+{
+
+#ifndef _WIN32
+ bool found = false;
+
+ vector <string> possibleDirs;
+ if ( !userDefinedDir.empty() ) possibleDirs.push_back ( userDefinedDir );
+// if (!additionalDataDir.empty()) possibleDirs.push_back(additionalDataDir);
+#ifdef HL_DATA_DIR
+ possibleDirs.push_back ( HL_DATA_DIR );
+#endif
+ possibleDirs.push_back ( LSB_DATA_DIR );
+
+ for ( unsigned int i=0;i<possibleDirs.size();i++ )
+ {
+ if ( fileExists ( possibleDirs[i] ) )
+ {
+ dataDir=possibleDirs[i];
+ found = true; break;
+ }
+ }
+ return found;
+#else
+ dataDir=userDefinedDir;
+ return true;
+#endif
+}
+
+DataDir::DataDir()
+{
+}
+
+void DataDir::setAdditionalDataDir ( const string& dir )
+{
+ additionalDataDir=dir;
+}
+void DataDir::setAdditionalConfDir ( const string& dir )
+{
+ additionalConfDir=dir;
+}
+
+const string & DataDir::getAdditionalDataDir()
+{
+ return additionalDataDir;
+}
+
+const string & DataDir::getAdditionalConfDir()
+{
+ return additionalConfDir;
+}
+
+const string &DataDir::getDir()
+{
+ return dataDir;
+}
+
+const string DataDir::getLangPath ( const string & file, bool forceDefault )
+{
+ if ( !forceDefault && !additionalDataDir.empty() )
+ {
+ string path=getAdditionalLangDefDir() +file;
+ if ( fileExists ( path ) )
+ {
+ return path;
+ }
+ }
+ return dataDir+"langDefs"+Platform::pathSeparator+file;
+}
+
+const string DataDir::getThemePath ( const string & file, bool forceDefault )
+{
+ if ( !forceDefault && !additionalDataDir.empty() )
+ {
+ string path=getAdditionalThemeDir() +file;
+ if ( fileExists ( path ) )
+ {
+ return path;
+ }
+ }
+ return dataDir+"themes"+Platform::pathSeparator+file;
+}
+
+const string DataDir::getConfDir ( bool forceDefault )
+{
+ if ( !forceDefault && !additionalConfDir.empty() )
+ {
+ return additionalConfDir;
+ }
+#ifndef _WIN32
+#ifdef HL_CONFIG_DIR
+ return HL_CONFIG_DIR;
+#else
+ return LSB_CFG_DIR;
+#endif
+#else
+ return getDir();
+#endif
+}
+
+const string DataDir::getAdditionalLangDefDir()
+{
+ return additionalDataDir+"langDefs"+Platform::pathSeparator;
+}
+
+const string DataDir::getAdditionalThemeDir()
+{
+ return additionalDataDir+"themes"+Platform::pathSeparator;
+}
+
+const string DataDir::getI18nDir()
+{
+ return dataDir+"gui_files"+Platform::pathSeparator+"i18n"+Platform::pathSeparator;
+}
+
+const string DataDir::getExtDir()
+{
+ return dataDir+"gui_files"+Platform::pathSeparator+"ext"+Platform::pathSeparator;
+}
+
+const string DataDir::getDocDir()
+{
+#ifndef _WIN32
+#ifdef HL_DOC_DIR
+ return HL_CONFIG_DIR;
+#else
+ return LSB_DOC_DIR;
+#endif
+#else
+ return getDir();
+#endif
+}
+
+bool DataDir::fileExists ( const string&f )
+{
+ ifstream file ( f.c_str() );
+ bool exists=!file.fail();
+ file.close();
+ return exists;
+}
diff --git a/support/highlight/src/core/datadir.h b/support/highlight/src/core/datadir.h
new file mode 100644
index 0000000000..1c180156e2
--- /dev/null
+++ b/support/highlight/src/core/datadir.h
@@ -0,0 +1,108 @@
+/***************************************************************************
+ datadir.h - description
+ -------------------
+ begin : Sam March 1 2003
+ copyright : (C) 2003 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#ifndef DATADIR_H
+#define DATADIR_H
+
+using namespace std;
+
+/** \brief Manages access to installation directories.
+
+ Apart from the standard installation directory, one can define additional
+ search paths. If the additonal paths do not exist, the default paths are
+ returned.
+ **/
+
+class DataDir
+{
+ string dataDir;
+ string additionalDataDir;
+ string additionalConfDir;
+ bool fileExists ( const string& );
+
+ public:
+
+ DataDir();
+
+ static string LSB_DATA_DIR;
+ static string LSB_CFG_DIR;
+ static string LSB_DOC_DIR;
+
+ /** search for a valid installation directory
+ \param userDefinedDir Directory defined by user
+ \return True if directory was found */
+ bool searchDataDir ( const string &userDefinedDir );
+
+ /** add another installation directory, which is added to search path
+ \param dir Directory defined by user */
+ void setAdditionalDataDir ( const string& dir );
+
+ /** add another installation directory, which is added to search path
+ \param dir Directory defined by user */
+ void setAdditionalConfDir ( const string& dir );
+
+ /** \return data Directory defined by user */
+ const string & getAdditionalDataDir();
+
+ /** \return data Directory defined by user */
+ const string & getAdditionalConfDir();
+
+ /** \return Data installation directory */
+ const string & getDir() ;
+
+ /** \param file filename
+ \param forceDefault set tue if additional directory should be ignored
+ \return Location of languafe definitions */
+ const string getLangPath ( const string & file="", bool forceDefault=false ) ;
+
+ /** \param file filename
+ \param forceDefault set tue if additional directory should be ignored
+ \return Location of themes */
+ const string getThemePath ( const string & file="", bool forceDefault=false ) ;
+
+ /** \return User defined location of languafe definitions */
+ const string getAdditionalLangDefDir() ;
+
+ /** \return User defined location of themes */
+ const string getAdditionalThemeDir() ;
+
+ /** \param forceDefault set tue if additional directory should be ignored
+ \return Location of configuration files */
+ const string getConfDir ( bool forceDefault=false ) ;
+
+ /** \return Location of GUI menu translation files */
+ const string getI18nDir();
+
+ /** \return Location of GUI file extension filter files */
+ const string getExtDir();
+
+ /** \return Location of documentation (README) files (GUI) */
+ const string getDocDir();
+
+};
+
+#endif
diff --git a/support/highlight/src/core/documentstyle.cpp b/support/highlight/src/core/documentstyle.cpp
new file mode 100644
index 0000000000..9c5f7307d5
--- /dev/null
+++ b/support/highlight/src/core/documentstyle.cpp
@@ -0,0 +1,168 @@
+/***************************************************************************
+ documentstyle.cpp - description
+ -------------------
+ begin : Son Nov 10 2002
+ copyright : (C) 2002 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#include "documentstyle.h"
+#include "stringtools.h"
+
+namespace highlight
+{
+
+ DocumentStyle::DocumentStyle ( const string &styleDefinitionFile )
+ {
+ fileFound=load ( styleDefinitionFile );
+ }
+ DocumentStyle::DocumentStyle() :fileFound ( false )
+ {}
+
+ bool DocumentStyle::load ( const string &styleDefinitionPath )
+ {
+ ConfigurationReader styleConfig ( styleDefinitionPath );
+ fileFound = false;
+ if ( styleConfig.found() )
+ {
+ fontsize = styleConfig.getParameter ( "fontsize" );
+ bgColour.setRGB ( styleConfig.getParameter ( "bgcolour" ) );
+ defaultElem.set ( styleConfig.getParameter ( "defaultcolour" ) );
+ comment.set ( styleConfig.getParameter ( "comment" ) );
+ directive.set ( styleConfig.getParameter ( "directive" ) );
+ str.set ( styleConfig.getParameter ( "string" ) );
+ escapeChar.set ( styleConfig.getParameter ( "escapechar" ) );
+ number.set ( styleConfig.getParameter ( "number" ) );
+ dstr.set ( styleConfig.getParameter ( "string-directive" ) );
+ line.set ( styleConfig.getParameter ( "line" ) );
+ symbol.set ( styleConfig.getParameter ( "symbol" ) );
+ markLineColour.setRGB ( styleConfig.getParameter ( "mark-line" ) );
+
+ string tmpstr;
+ // TODO: Remove this check as soon as all themes have a sl-comment attribute
+ tmpstr=styleConfig.getParameter ( "sl-comment" );
+ if ( tmpstr.empty() )
+ {
+ tmpstr=styleConfig.getParameter ( "comment" );
+ }
+ slcomment.set ( tmpstr );
+
+ string paramVal;
+ vector<string> paramNames=styleConfig.getParameterNames();
+
+ //collect keyword groups, save corresponding style definition
+ for ( unsigned int i=0;i<paramNames.size();i++ )
+ {
+ paramVal=paramNames[i];
+ if ( paramVal.find ( "kw-group" ) != string::npos)
+ {
+ keywordStyles.insert ( make_pair ( StringTools::getParantheseVal ( paramVal ),
+ ElementStyle ( styleConfig.getParameter ( paramVal ) ) ) );
+ }
+ }
+ fileFound = true;
+ }
+ return fileFound;
+ }
+
+ DocumentStyle::~DocumentStyle()
+ {
+ }
+
+ string DocumentStyle::getFontSize() const
+ {
+ return fontsize;
+ }
+ Colour DocumentStyle::getBgColour() const
+ {
+ return bgColour;
+ }
+ Colour DocumentStyle::getMarkLineColour() const
+ {
+ return markLineColour;
+ }
+ ElementStyle DocumentStyle::getDefaultStyle() const
+ {
+ return defaultElem;
+ }
+ ElementStyle DocumentStyle::getCommentStyle() const
+ {
+ return comment;
+ }
+ ElementStyle DocumentStyle::getSingleLineCommentStyle() const
+ {
+ return slcomment;
+ }
+ ElementStyle DocumentStyle::getStringStyle() const
+ {
+ return str;
+ }
+ ElementStyle DocumentStyle::getDirectiveStringStyle() const
+ {
+ return dstr;
+ }
+ ElementStyle DocumentStyle::getEscapeCharStyle() const
+ {
+ return escapeChar;
+ }
+ ElementStyle DocumentStyle::getNumberStyle() const
+ {
+ return number;
+ }
+ ElementStyle DocumentStyle::getDirectiveStyle() const
+ {
+ return directive;
+ }
+ ElementStyle DocumentStyle::getLineStyle() const
+ {
+ return line;
+ }
+ ElementStyle DocumentStyle::getSymbolStyle() const
+ {
+ return symbol;
+ }
+ bool DocumentStyle::found () const
+ {
+ return fileFound;
+ }
+ ElementStyle DocumentStyle::getKeywordStyle ( const string &className )
+ {
+ if ( !keywordStyles.count ( className ) ) return defaultElem;
+ return keywordStyles[className];
+ }
+
+ vector <string> DocumentStyle::getClassNames() const
+ {
+ vector <string> kwClassNames;
+ for ( KSIterator iter = keywordStyles.begin(); iter != keywordStyles.end(); iter++ )
+ {
+ kwClassNames.push_back ( ( *iter ).first );
+ }
+ return kwClassNames;
+ }
+
+ KeywordStyles DocumentStyle::getKeywordStyles() const
+ {
+ return keywordStyles;
+ }
+
+}
diff --git a/support/highlight/src/core/documentstyle.h b/support/highlight/src/core/documentstyle.h
new file mode 100644
index 0000000000..46d8aa5e7a
--- /dev/null
+++ b/support/highlight/src/core/documentstyle.h
@@ -0,0 +1,138 @@
+/***************************************************************************
+ documentstyle.h - description
+ -------------------
+ begin : Son Nov 10 2002
+ copyright : (C) 2002-2007 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#ifndef DOCUMENTSTYLE_H
+#define DOCUMENTSTYLE_H
+
+#include <string>
+#include "configurationreader.h"
+#include "elementstyle.h"
+#include "stylecolour.h"
+
+using namespace std;
+
+namespace highlight
+{
+
+ /** maps keyword class names and the corresponding formatting information*/
+ typedef map <string, ElementStyle> KeywordStyles;
+
+ /** iterator for keyword styles*/
+ typedef KeywordStyles::const_iterator KSIterator;
+
+ /** \brief Contains information about document formatting properties.
+ * @author Andre Simon
+ */
+
+ class DocumentStyle
+ {
+ private:
+ ElementStyle comment, slcomment, str, dstr,
+ escapeChar, number, directive, line, symbol;
+ ElementStyle defaultElem;
+ Colour bgColour;
+ Colour markLineColour;
+
+ string fontsize;
+ bool fileFound;
+
+ KeywordStyles keywordStyles;
+
+ public:
+ /** Constructor
+ \param styleDefinitionPath Style definition path */
+ DocumentStyle ( const string & styleDefinitionPath );
+
+ /** Constructor */
+ DocumentStyle();
+ ~DocumentStyle();
+
+ /** load style definition
+ \param styleDefinitionFile Style definition path
+ \return True if successfull */
+ bool load ( const string & styleDefinitionFile );
+
+ /** \return class names defined in the theme file */
+ vector <string> getClassNames() const;
+
+ /** \return keyword styles */
+ KeywordStyles getKeywordStyles() const;
+
+ /** \return Font size */
+ string getFontSize() const;
+
+ /** \return Background colour*/
+ Colour getBgColour() const;
+
+ /** \return Mark line colour*/
+ Colour getMarkLineColour() const;
+
+ /** \return Style of default (unrecognized) strings */
+ ElementStyle getDefaultStyle() const;
+
+ /** \return Comment style*/
+ ElementStyle getCommentStyle() const;
+
+ /** \return Single line comment style*/
+ ElementStyle getSingleLineCommentStyle() const;
+
+ /** \return String style*/
+ ElementStyle getStringStyle() const;
+
+ /** \return Directive line string style*/
+ ElementStyle getDirectiveStringStyle() const;
+
+ /** \return Escape character style*/
+ ElementStyle getEscapeCharStyle() const;
+
+ /** \return Number style*/
+ ElementStyle getNumberStyle() const;
+
+ /** \return Directive style*/
+ ElementStyle getDirectiveStyle() const;
+
+ /** \return Type style*/
+ ElementStyle getTypeStyle() const;
+
+ /** \return Line number style*/
+ ElementStyle getLineStyle() const;
+
+ /** \return Bracket style*/
+ ElementStyle getSymbolStyle() const;
+
+ /** \param className Name of keyword class (eg kwa, kwb, .., kwd)
+ \return keyword style of the given className
+ */
+ ElementStyle getKeywordStyle ( const string &className ) ;
+
+ /** \return True if language definition was found */
+ bool found() const ;
+ };
+
+}
+
+#endif
diff --git a/support/highlight/src/core/elementstyle.cpp b/support/highlight/src/core/elementstyle.cpp
new file mode 100644
index 0000000000..b1a5e408b7
--- /dev/null
+++ b/support/highlight/src/core/elementstyle.cpp
@@ -0,0 +1,111 @@
+/***************************************************************************
+ elementstyle.cpp - description
+ -------------------
+ begin : Son Nov 10 2002
+ copyright : (C) 2002-2007 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <sstream>
+#include "elementstyle.h"
+
+namespace highlight
+{
+
+ ElementStyle::ElementStyle (const Colour &col, bool b, bool i, bool u )
+ : colour ( col ) , bold ( b ), italic ( i ), underline ( u )
+ {}
+
+ ElementStyle:: ElementStyle ( const string & elementStyleString )
+ : bold ( false ), italic ( false ), underline ( false )
+ {
+ set ( elementStyleString );
+ }
+
+ ElementStyle::ElementStyle()
+ : bold ( false ), italic ( false ), underline ( false )
+ {}
+
+ void ElementStyle::set ( const string & elementStyleString )
+ {
+ istringstream valueStream ( elementStyleString );
+ string r, g, b, attr;
+
+ char c='\0';
+ valueStream >> c;
+
+ if ( c=='#' )
+ {
+ string htmlNotation;
+ valueStream >> htmlNotation;
+ if ( htmlNotation.size() < 6 ) return;
+ r = htmlNotation.substr ( 0, 2 );
+ g = htmlNotation.substr ( 2, 2 );
+ b = htmlNotation.substr ( 4, 2 );
+ }
+ else
+ {
+ valueStream.putback ( c );
+ valueStream >> r;
+ valueStream >> g;
+ valueStream >> b;
+ }
+
+ colour.setRed ( r );
+ colour.setGreen ( g );
+ colour.setBlue ( b );
+ while ( valueStream >> attr )
+ {
+ if ( attr=="italic" )
+ {
+ italic = true;
+ }
+ else if ( attr=="bold" )
+ {
+ bold = true;
+ }
+ else if ( attr=="underline" )
+ {
+ underline = true;
+ }
+ }
+ }
+
+ ElementStyle::~ElementStyle()
+ {}
+
+ bool ElementStyle::isItalic() const
+ {
+ return italic;
+ }
+ bool ElementStyle::isBold() const
+ {
+ return bold;
+ }
+ bool ElementStyle::isUnderline() const
+ {
+ return underline;
+ }
+ Colour ElementStyle::getColour() const
+ {
+ return colour;
+ }
+
+}
diff --git a/support/highlight/src/core/elementstyle.h b/support/highlight/src/core/elementstyle.h
new file mode 100644
index 0000000000..45a7c5cc44
--- /dev/null
+++ b/support/highlight/src/core/elementstyle.h
@@ -0,0 +1,121 @@
+/***************************************************************************
+ elementstyle.h - description
+ -------------------
+ begin : Son Nov 10 2002
+ copyright : (C) 2002-2007 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#ifndef ELEMENTSTYLE_H
+#define ELEMENTSTYLE_H
+
+#include "stylecolour.h"
+
+using namespace std;
+
+namespace highlight
+{
+
+ /** \brief The class stores the basic text formatting properties.
+
+ * @author Andre Simon
+ */
+
+ class ElementStyle
+ {
+ public:
+
+ /** Constructor
+ \param col Style colour
+ \param b Bold flag
+ \param i Italic flag
+ \param u Underline flag */
+ ElementStyle ( const Colour& col, bool b, bool i, bool u );
+
+ /** Constuctor
+ \param elementStyleString String with formatting information (eg "00 aa ff bold") */
+ ElementStyle ( const string & elementStyleString );
+
+ /** Constuctor */
+ ElementStyle();
+
+ /**copy constructor */
+ ElementStyle ( const ElementStyle &other )
+ {
+ colour = other.getColour();
+ bold = other.isBold();
+ italic = other.isItalic();
+ underline = other.isUnderline();
+ }
+
+ /** operator overloading */
+ ElementStyle& operator= ( const ElementStyle &other )
+ {
+ colour = other.getColour();
+ bold = other.isBold();
+ italic = other.isItalic();
+ underline = other.isUnderline();
+ return *this;
+ }
+
+ ~ElementStyle();
+
+ /** initialize object
+ \param elementStyleString String which contains formatting attributes
+ (Format: "color attr" where
+ color can be HTML hex notation or a hex RGB tuple (ie "#2244ff" or "22 44 ff")
+ attr can be a combination of "italic, "bold" and "underline")
+ */
+ void set ( const string & elementStyleString );
+
+ /** \return True if italic */
+ bool isItalic() const;
+
+ /** \return True if bold */
+ bool isBold() const;
+
+ /** \return True if underline */
+ bool isUnderline() const;
+
+ /** \param b set italic flag */
+ void setItalic ( bool b ) {italic = b;}
+
+ /** \param b set bold flag */
+ void setBold ( bool b ) { bold = b; }
+
+ /** \param b set underline flag */
+ void setUnderline ( bool b ) {underline = b; }
+
+ /** \return Element colour */
+ Colour getColour() const;
+
+ /** \param col colour of this element */
+ void setColour (const Colour& col ) {colour = col;}
+
+ private:
+ Colour colour;
+ bool bold, italic, underline;
+ };
+
+}
+
+#endif
diff --git a/support/highlight/src/core/enums.h b/support/highlight/src/core/enums.h
new file mode 100644
index 0000000000..0b5609dc0d
--- /dev/null
+++ b/support/highlight/src/core/enums.h
@@ -0,0 +1,109 @@
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#ifndef ENUMS_H
+#define ENUMS_H
+
+namespace highlight
+{
+
+ /** states which may occour during input file parsing
+ TODO Clean up!
+ */
+ enum State
+ {
+ STANDARD=0,
+ STRING,
+ NUMBER,
+ SL_COMMENT,
+ ML_COMMENT,
+ ESC_CHAR,
+ DIRECTIVE,
+ DIRECTIVE_STRING,
+ LINENUMBER,
+ SYMBOL,
+
+ // don't use constants > 10 as array indices!
+ KEYWORD,
+ STRING_END,
+ NUMBER_END,
+ SL_COMMENT_END,
+ ML_COMMENT_END,
+ ESC_CHAR_END,
+ DIRECTIVE_END,
+ SYMBOL_END,
+ KEYWORD_END,
+ IDENTIFIER_BEGIN,
+ IDENTIFIER_END,
+ EMBEDDED_CODE_BEGIN,
+ EMBEDDED_CODE_END,
+ EMBEDDED_PERL_HACK,
+
+ _UNKNOWN=100,
+ _EOL,
+ _EOF,
+ _WS
+ } ;
+
+ /** Parser return values*/
+ enum ParseError
+ {
+ PARSE_OK,
+ BAD_INPUT=1,
+ BAD_OUTPUT=2,
+ BAD_STYLE=4,
+ BAD_BINARY=8
+ };
+
+ /** line wrapping modes*/
+ enum WrapMode
+ {
+ WRAP_DISABLED,
+ WRAP_SIMPLE,
+ WRAP_DEFAULT
+ };
+
+ /** language definition loading results*/
+ enum LoadResult
+ {
+ LOAD_FAILED,
+ LOAD_FAILED_REGEX,
+ LOAD_NEW,
+ LOAD_NONE
+ };
+
+ /** output formats */
+ enum OutputType
+ {
+ HTML,
+ XHTML,
+ TEX,
+ LATEX,
+ RTF,
+ XML,
+ ANSI,
+ XTERM256,
+ HTML32,
+ SVG,
+ BBCODE
+ };
+
+}
+
+#endif
diff --git a/support/highlight/src/core/htmlgenerator.cpp b/support/highlight/src/core/htmlgenerator.cpp
new file mode 100644
index 0000000000..b21421c51c
--- /dev/null
+++ b/support/highlight/src/core/htmlgenerator.cpp
@@ -0,0 +1,477 @@
+/***************************************************************************
+ htmlgenerator.cpp - description
+ -------------------
+ begin : Wed Nov 28 2001
+ copyright : (C) 2001-2007 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#include <fstream>
+#include <iostream>
+#include <sstream>
+
+#include "htmlgenerator.h"
+#include "version.h"
+
+using namespace std;
+
+namespace highlight
+{
+
+ HtmlGenerator::HtmlGenerator () :
+ CodeGenerator ( HTML ),
+ brTag ( "<br>" ),
+ hrTag ( "<hr>" ),
+ idAttr ( "name" ),
+ fileSuffix ( ".html" ),
+ cssClassName ( "hl" ),
+ orderedList ( false ),
+ useInlineCSS ( false ),
+ enclosePreTag ( false ),
+ attachAnchors ( false ),
+ anchorPrefix ( "l" )
+ {
+ spacer = " ";
+ styleCommentOpen="/*";
+ styleCommentClose="*/";
+ }
+
+ string HtmlGenerator::getHeader()
+ {
+ ostringstream os;
+ os << getHeaderStart ( docTitle );
+ if ( !useInlineCSS )
+ {
+ if ( includeStyleDef )
+ {
+ os << "<style type=\"text/css\">\n<!--\n";
+ os << getStyleDefinition();
+ os << CodeGenerator::readUserStyleDef();
+ os << "//-->\n</style>\n";
+ }
+ else
+ {
+ os << "<link rel=\"stylesheet\" type=\"text/css\" href=\""
+ << getStyleOutputPath()
+ << "\">\n";
+ }
+ os << "</head>\n<body class=\"" << cssClassName
+ << "\">\n";
+ }
+ else
+ {
+ os << "</head>\n<body style=\""
+ << "background-color:#"
+ << ( docStyle.getBgColour().getRed ( HTML ) )
+ << ( docStyle.getBgColour().getGreen ( HTML ) )
+ << ( docStyle.getBgColour().getBlue ( HTML ) )
+ << "\">\n";
+ }
+
+ return os.str();
+ }
+
+ string HtmlGenerator::getFooter()
+ {
+ return getGeneratorComment();
+ }
+
+ void HtmlGenerator::printBody()
+ {
+ if ( !fragmentOutput || enclosePreTag )
+ {
+ if ( !useInlineCSS )
+ {
+ *out << "<pre class=\"" << cssClassName
+ << "\">";
+ }
+ else
+ {
+ *out << "<pre style=\""
+ << "color:#"
+ << ( docStyle.getDefaultStyle().getColour().getRed ( HTML ) )
+ << ( docStyle.getDefaultStyle().getColour().getGreen ( HTML ) )
+ << ( docStyle.getDefaultStyle().getColour().getBlue ( HTML ) )
+ << "; background-color:#"
+ << ( docStyle.getBgColour().getRed ( HTML ) )
+ << ( docStyle.getBgColour().getGreen ( HTML ) )
+ << ( docStyle.getBgColour().getBlue ( HTML ) )
+ << "; font-size:" << this->getBaseFontSize()
+ << "pt; font-family:'" << this->getBaseFont() <<"';\">";
+ }
+ }
+ if ( showLineNumbers && orderedList ) *out << "<ol>";
+
+ processRootState();
+
+ if ( showLineNumbers && orderedList ) *out << "\n</ol>";
+
+ if ( !fragmentOutput || enclosePreTag ) *out << "</pre>";
+ }
+
+
+ void HtmlGenerator::initOutputTags ()
+ {
+ openTags.push_back ( "" );
+ if ( useInlineCSS )
+ {
+ //embedBlockOpen = "<div style=\"background-color:#efefef;\">";
+ openTags.push_back ( getOpenTag ( docStyle.getStringStyle() ) );
+ openTags.push_back ( getOpenTag ( docStyle.getNumberStyle() ) );
+ openTags.push_back ( getOpenTag ( docStyle.getSingleLineCommentStyle() ) );
+ openTags.push_back ( getOpenTag ( docStyle.getCommentStyle() ) );
+ openTags.push_back ( getOpenTag ( docStyle.getEscapeCharStyle() ) );
+ openTags.push_back ( getOpenTag ( docStyle.getDirectiveStyle() ) );
+ openTags.push_back ( getOpenTag ( docStyle.getDirectiveStringStyle() ) );
+ openTags.push_back ( getOpenTag ( docStyle.getLineStyle() ) );
+ openTags.push_back ( getOpenTag ( docStyle.getSymbolStyle() ) );
+ }
+ else
+ {
+ //embedBlockOpen = "<div style=\"background-color:#efefef;\">";
+ openTags.push_back ( getOpenTag ( STY_NAME_STR ) );
+ openTags.push_back ( getOpenTag ( STY_NAME_NUM ) );
+ openTags.push_back ( getOpenTag ( STY_NAME_SLC ) );
+ openTags.push_back ( getOpenTag ( STY_NAME_COM ) );
+ openTags.push_back ( getOpenTag ( STY_NAME_ESC ) );
+ openTags.push_back ( getOpenTag ( STY_NAME_DIR ) );
+ openTags.push_back ( getOpenTag ( STY_NAME_DST ) );
+ openTags.push_back ( getOpenTag ( STY_NAME_LIN ) );
+ openTags.push_back ( getOpenTag ( STY_NAME_SYM ) );
+ }
+
+ closeTags.push_back ( "" );
+ for ( int i=1;i<NUMBER_BUILTIN_STATES; i++ )
+ {
+ closeTags.push_back ( "</span>" );
+ }
+ //embedBlockClose = "</div>";
+ }
+
+ string HtmlGenerator::getAttributes ( const string & elemName, const ElementStyle & elem )
+ {
+ ostringstream s;
+ if ( !elemName.empty() )
+ {
+ s << "."<<cssClassName<<"."<<elemName<<" { ";
+ }
+ s << "color:#"
+ << ( elem.getColour().getRed ( HTML ) )
+ << ( elem.getColour().getGreen ( HTML ) )
+ << ( elem.getColour().getBlue ( HTML ) )
+ << ( elem.isBold() ? "; font-weight:bold" :"" )
+ << ( elem.isItalic() ? "; font-style:italic" :"" )
+ << ( elem.isUnderline() ? "; text-decoration:underline" :"" );
+ if ( !elemName.empty() )
+ {
+ s << "; }\n" ;
+ }
+ return s.str();
+ }
+
+ string HtmlGenerator::getOpenTag ( const string& styleName )
+ {
+ return "<span class=\""+cssClassName+ " " + styleName + "\">";
+ }
+
+ string HtmlGenerator::getOpenTag ( const ElementStyle & elem )
+ {
+ return "<span style=\""+getAttributes ( "",elem ) + "\">";
+ }
+
+ string HtmlGenerator::getGeneratorComment()
+ {
+ ostringstream s;
+ s <<"\n</body>\n</html>\n<!--HTML generated by highlight "
+ << HIGHLIGHT_VERSION << ", " << HIGHLIGHT_URL <<"-->\n";
+
+ return s.str();
+ }
+
+ string HtmlGenerator::getStyleDefinition()
+ {
+ if ( styleDefinitionCache.empty() )
+ {
+ ostringstream os;
+ os << "body."<<cssClassName<<"\t{ background-color:#"
+ << ( docStyle.getBgColour().getRed ( HTML ) )
+ << ( docStyle.getBgColour().getGreen ( HTML ) )
+ << ( docStyle.getBgColour().getBlue ( HTML ) )
+ << "; }\n";
+ os << "pre."<<cssClassName<<"\t{ color:#"
+ << ( docStyle.getDefaultStyle().getColour().getRed ( HTML ) )
+ << ( docStyle.getDefaultStyle().getColour().getGreen ( HTML ) )
+ << ( docStyle.getDefaultStyle().getColour().getBlue ( HTML ) )
+ << "; background-color:#"
+ << ( docStyle.getBgColour().getRed ( HTML ) )
+ << ( docStyle.getBgColour().getGreen ( HTML ) )
+ << ( docStyle.getBgColour().getBlue ( HTML ) )
+ << "; font-size:" << this->getBaseFontSize();
+
+ os << "pt; font-family:'" << this->getBaseFont() << "';}\n";
+
+ if ( orderedList )
+ {
+ os << "li."<<cssClassName<<"\t{ margin-bottom:-"<<this->getBaseFontSize() <<"pt; }\n";
+ }
+
+ os << getAttributes ( STY_NAME_NUM, docStyle.getNumberStyle() )
+ << getAttributes ( STY_NAME_ESC, docStyle.getEscapeCharStyle() )
+ << getAttributes ( STY_NAME_STR, docStyle.getStringStyle() )
+ << getAttributes ( STY_NAME_DST, docStyle.getDirectiveStringStyle() )
+ << getAttributes ( STY_NAME_SLC, docStyle.getSingleLineCommentStyle() )
+ << getAttributes ( STY_NAME_COM, docStyle.getCommentStyle() )
+ << getAttributes ( STY_NAME_DIR, docStyle.getDirectiveStyle() )
+ << getAttributes ( STY_NAME_SYM, docStyle.getSymbolStyle() )
+ << getAttributes ( STY_NAME_LIN, docStyle.getLineStyle() );
+
+ os << "."<<cssClassName<<".mark\t{ background-color:#"
+ << ( docStyle.getMarkLineColour().getRed ( HTML ) )
+ << ( docStyle.getMarkLineColour().getGreen ( HTML ) )
+ << ( docStyle.getMarkLineColour().getBlue ( HTML ) )
+ << ";}\n";
+
+ KeywordStyles styles = docStyle.getKeywordStyles();
+ for ( KSIterator it=styles.begin(); it!=styles.end(); it++ )
+ {
+ os << getAttributes ( it->first, it->second );
+ }
+ styleDefinitionCache=os.str();
+ }
+ return styleDefinitionCache;
+ }
+
+ string HtmlGenerator::maskCharacter ( unsigned char c )
+ {
+ switch ( c )
+ {
+ case '<' :
+ return "&lt;";
+ break;
+ case '>' :
+ return "&gt;";
+ break;
+ case '&' :
+ return "&amp;";
+ break;
+ case '\"' :
+ return "&quot;";
+ break;
+
+ case '@' :
+ return "&#64;";
+ break;
+
+ default :
+ return string ( 1, c );
+ }
+ }
+
+ string HtmlGenerator::getNewLine()
+ {
+
+ string nlStr;
+
+ if ( markLines.count ( lineNumber-1 ) ) nlStr +="</span>";
+
+ if ( showLineNumbers && orderedList ) nlStr +="</li>";
+ /// set wrapping arrow if previous line was wrapped
+ //else if (preFormatter.isWrappedLine(lineNumber-1)) nlStr += "&crarr;";
+
+ if (printNewLines) nlStr+="\n";
+
+ return nlStr;
+ }
+
+ void HtmlGenerator::insertLineNumber ( bool insertNewLine )
+ {
+ if ( insertNewLine )
+ {
+ wsBuffer += getNewLine();
+ }
+ if ( showLineNumbers )
+ {
+ ostringstream numberPrefix;
+ int lineNo = lineNumber+lineNumberOffset;
+ if ( orderedList )
+ {
+ if ( useInlineCSS )
+ {
+ numberPrefix<<"<li style=\""<<getAttributes ( "", docStyle.getLineStyle() ) <<"\">";
+ }
+ else
+ {
+ numberPrefix<<"<li class=\""<<cssClassName<<"\">";
+ }
+ // Opera 8 ignores empty list items -> add &nbsp;
+ if ( line.empty() ) numberPrefix<<"&nbsp;";
+ }
+ if ( attachAnchors )
+ numberPrefix << "<a "
+ << idAttr
+ << "=\""
+ << anchorPrefix
+ << "_"
+ << lineNo
+ << "\"></a>";
+
+ if ( !orderedList )
+ {
+ ostringstream os;
+ if ( lineNumberFillZeroes ) os.fill ( '0' );
+ os <<setw ( getLineNumberWidth() ) <<right<< lineNo;
+ numberPrefix << openTags[LINENUMBER]
+ << os.str()
+ << spacer
+ << closeTags[LINENUMBER];
+ }
+ wsBuffer += numberPrefix.str();
+ }
+
+ if ( markLines.count ( lineNumber ) )
+ {
+ if ( useInlineCSS )
+ {
+ ostringstream markingFmt;
+ markingFmt <<"<span style=\""
+ <<"background-color:#"
+ << ( docStyle.getMarkLineColour().getRed ( HTML ) )
+ << ( docStyle.getMarkLineColour().getGreen ( HTML ) )
+ << ( docStyle.getMarkLineColour().getBlue ( HTML ) )
+ << ";\"";
+ wsBuffer+=markingFmt.str();
+ }
+ else
+ {
+ wsBuffer +="<span class=\""+cssClassName+" mark\"";
+ }
+ if ( !markLines[lineNumber].empty() )
+ wsBuffer +=" title=\""+markLines[lineNumber]+"\"";
+ wsBuffer +=">";
+ }
+
+ }
+
+ string HtmlGenerator::getHeaderStart ( const string &title )
+ {
+ ostringstream header;
+ header<< "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">"
+ << "\n<html>\n<head>\n";
+ if ( encodingDefined() )
+ {
+ header << "<meta http-equiv=\"content-type\" content=\"text/html; charset="
+ << encoding
+ << "\">\n";
+ }
+ header << "<title>"
+ << title
+ << "</title>\n";
+ return header.str();
+ }
+
+ bool HtmlGenerator::printIndexFile ( const vector<string> &fileList,
+ const string &outPath )
+ {
+ string suffix = fileSuffix;
+ string outFilePath = outPath + "index" + suffix;
+ ofstream indexfile ( outFilePath.c_str() );
+
+ if ( !indexfile.fail() )
+ {
+ string inFileName;
+ string inFilePath, newInFilePath;
+ indexfile << getHeaderStart ( "Source Index" );
+ indexfile << "</head>\n<body>\n<h1> Source Index</h1>\n"
+ << hrTag
+ << "\n<ul>\n";
+ string::size_type pos;
+ for ( unsigned int i=0; i < fileList.size(); i++ )
+ {
+ pos= ( fileList[i] ).find_last_of ( Platform::pathSeparator );
+ if ( pos!=string::npos )
+ {
+ newInFilePath = ( fileList[i] ).substr ( 0, pos+1 );
+ }
+ else
+ {
+ newInFilePath=Platform::pathSeparator;
+ }
+ if ( newInFilePath!=inFilePath )
+ {
+ indexfile << "</ul>\n<h2>";
+ indexfile << newInFilePath;
+ indexfile << "</h2>\n<ul>\n";
+ inFilePath=newInFilePath;
+ }
+ inFileName = ( fileList[i] ).substr ( pos+1 );
+ indexfile << "<li><a href=\"" << inFileName << suffix << "\">";
+ indexfile << inFileName << suffix <<"</a></li>\n";
+ }
+
+ indexfile << "</ul>\n"
+ << hrTag << brTag
+ << "<small>Generated by highlight "
+ << HIGHLIGHT_VERSION
+ << ", <a href=\"" << HIGHLIGHT_URL << "\" target=\"new\">"
+ << HIGHLIGHT_URL << "</a></small>";
+ indexfile << getGeneratorComment();
+ }
+ else
+ {
+ return false;
+ }
+ return true;
+ }
+
+ string HtmlGenerator::getKeywordOpenTag ( unsigned int styleID )
+ {
+ if ( useInlineCSS )
+ {
+ return getOpenTag ( docStyle.getKeywordStyle ( langInfo.getKeywordClasses() [styleID] ) );
+ }
+ return getOpenTag ( langInfo.getKeywordClasses() [styleID] );
+ }
+
+ string HtmlGenerator::getKeywordCloseTag ( unsigned int styleID )
+ {
+ return "</span>";
+ }
+
+ string HtmlGenerator::getMetaInfoOpenTag ( const TagInfo& info )
+ {
+ ostringstream tagStream;
+ tagStream<<"<span title=\""<<info.getKind() <<" | ";
+ if ( !info.name_space.empty() )
+ {
+ maskString ( tagStream, info.name_space );
+ tagStream<<" | ";
+ }
+ maskString ( tagStream, info.file ) ;
+ tagStream<<"\">";
+ return tagStream.str();
+ }
+ string HtmlGenerator::getMetaInfoCloseTag()
+ {
+ return "</span>";
+ }
+
+}
diff --git a/support/highlight/src/core/htmlgenerator.h b/support/highlight/src/core/htmlgenerator.h
new file mode 100644
index 0000000000..29e650839f
--- /dev/null
+++ b/support/highlight/src/core/htmlgenerator.h
@@ -0,0 +1,195 @@
+/***************************************************************************
+ htmlgenerator.h - description
+ -------------------
+ begin : Wed Nov 28 2001
+ copyright : (C) 2001-2007 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+
+#ifndef HTMLGENERATOR_H
+#define HTMLGENERATOR_H
+
+#include <string>
+
+#include "codegenerator.h"
+
+#include "stylecolour.h"
+#include "elementstyle.h"
+
+namespace highlight
+{
+
+ /**
+ \brief This class generates HTML.
+
+ It contains information about the resulting document structure (document
+ header and footer), the colour system, white space handling and text
+ formatting attributes.
+
+ * @author Andre Simon
+ */
+
+ class HtmlGenerator : public highlight::CodeGenerator
+ {
+ public:
+
+ HtmlGenerator();
+
+ /** Destructor, virtual as it is base for xhtmlgenerator*/
+ virtual ~HtmlGenerator() {};
+
+ /** Print style definitions to external file
+ \param outFile Path of external style definition
+ */
+ bool printExternalStyle ( const string &outFile );
+
+ /** Print index file with all input file names
+ \param fileList List of output file names
+ \param outPath Output path
+ */
+ bool printIndexFile ( const vector<string> & fileList, const string &outPath );
+
+ /**
+ \param b set true if anchors should be attached to line numbers
+ */
+ void setHTMLAttachAnchors ( bool b ) { attachAnchors = b; }
+
+ /**
+ \param prefix anchor prefix
+ */
+ void setHTMLAnchorPrefix ( const string & prefix ) { anchorPrefix = prefix; }
+
+ /**
+ \param b if true line numbers should be replaced by list items
+ */
+ void setHTMLOrderedList ( bool b ) { orderedList = b; }
+
+ /**
+ \param b if true CSS formatting will be inserted into each tag
+ */
+ void setHTMLInlineCSS ( bool b ) { useInlineCSS = b; }
+
+ /**
+ \param b if truefragmented output will be enclosed in pre tag
+ */
+ void setHTMLEnclosePreTag ( bool b ) { enclosePreTag = b; }
+
+ /**
+ \param name CSS Class name
+ */
+ void setHTMLClassName ( const string& name )
+ {
+ cssClassName = name;
+ }
+
+ protected:
+
+ string brTag, ///< break tag
+ hrTag, ///< horizontal ruler tag
+ idAttr, ///< ID tag
+ fileSuffix, ///< filename extension
+ cssClassName; ///< css class name prefix
+
+ /** caches style definition */
+ string styleDefinitionCache;
+
+ /** line count should be replaced by ordered list*/
+ bool orderedList;
+
+ /** CSS definition should be outputted inline */
+ bool useInlineCSS;
+
+ /** pre tag should be outputted in fragment mode*/
+ bool enclosePreTag;
+
+ /** \return CSS definition */
+ string getStyleDefinition();
+
+ /** \return Content of user defined style file */
+ string readUserStyleDef();
+
+ /** \param title Dociment title
+ \return Start of file header */
+ virtual string getHeaderStart ( const string &title );
+
+ /** \return Comment with program information */
+ string getGeneratorComment();
+
+ private:
+
+ /** insert line number in the beginning of the new line
+ */
+ virtual void insertLineNumber ( bool insertNewLine=true );
+
+ /** Print document header
+ */
+ string getHeader();
+
+ /** Print document body*/
+ void printBody();
+
+ /** Print document footer*/
+ string getFooter();
+
+ /** initialize tags in specific format according to colouring information provided in DucumentStyle */
+ void initOutputTags();
+
+ /** \param styleName Style name
+ \return Opening tag of the given style
+ */
+ string getOpenTag ( const string& styleName );
+
+ string getOpenTag ( const ElementStyle & elem );
+
+ /** \return escaped character*/
+ virtual string maskCharacter ( unsigned char );
+
+ /** test if anchors should be appied to line numbers*/
+ bool attachAnchors;
+
+ /**Optional anchor prefix */
+ string anchorPrefix;
+
+ /**\return text formatting attributes in HTML format */
+ string getAttributes ( const string & elemName, const ElementStyle & elem );
+
+ /** \param styleID Style ID
+ \return Opening tag of the given style
+ */
+ string getKeywordOpenTag ( unsigned int styleID );
+
+ /** \param styleID Style ID
+ \return Closing tag of the given style
+ */
+ string getKeywordCloseTag ( unsigned int styleID );
+
+ /** @return Newline string */
+ string getNewLine();
+
+ string getMetaInfoOpenTag ( const TagInfo& info );
+ string getMetaInfoCloseTag();
+ };
+
+}
+
+#endif
diff --git a/support/highlight/src/core/languagedefinition.cpp b/support/highlight/src/core/languagedefinition.cpp
new file mode 100644
index 0000000000..e52688c910
--- /dev/null
+++ b/support/highlight/src/core/languagedefinition.cpp
@@ -0,0 +1,396 @@
+/***************************************************************************
+ languagedefinition.cpp - description
+ -------------------
+ begin : Wed Nov 28 2001
+ copyright : (C) 2001-2007 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#include <memory>
+
+#include "languagedefinition.h"
+#include "stringtools.h"
+
+
+using namespace std;
+
+namespace highlight
+{
+
+ const string LanguageDefinition::REGEX_IDENTIFIER =
+ "[a-zA-Z_]\\w*";
+
+ const string LanguageDefinition::REGEX_NUMBER =
+ "(?:0x|0X)[0-9a-fA-F]+|\\d*[\\.]?\\d+(?:[eE][\\-\\+]\\d+)?[lLuU]*";
+
+ LanguageDefinition::LanguageDefinition() :
+ ignoreCase ( false ),
+ disableHighlighting ( false ),
+ allowExtEscape ( false ),
+ allowNestedComments ( true ),
+ reformatCode ( false )
+ {
+ reDefPattern=Pattern::compile ( "^regex\\((.+?)(,\\s*(\\d+))?\\)$" );
+ }
+
+ LanguageDefinition::~LanguageDefinition()
+ {
+ for ( vector<RegexElement*>::iterator it=regex.begin(); it!=regex.end();it++ )
+ {
+ delete *it;
+ }
+ delete reDefPattern;
+ }
+
+ int LanguageDefinition::isKeyword ( const string &s )
+ {
+ return ( s.length() && keywords.count ( s ) ) ? keywords[s] : 0;
+ }
+
+ void LanguageDefinition::addSymbol ( stringstream& symbolStream,
+ State stateBegin,
+ State stateEnd,
+ bool isDelimiter,
+ const string& paramValue,
+ unsigned int classID )
+ {
+ RegexDef re = extractRegex ( paramValue );
+ if ( !re.reString.empty() )
+ {
+ Pattern* p = Pattern::compile ( re.reString );
+ if ( p!=NULL ) {
+ regex.push_back ( new RegexElement ( stateBegin,stateEnd, p, re.capturingGroup ) );
+ } else {
+ failedRegex = re.reString;
+ }
+ return;
+ }
+ if ( isDelimiter )
+ {
+ addDelimiterSymbol ( symbolStream, stateBegin, stateEnd, paramValue, classID );
+ }
+ else
+ {
+ addSimpleSymbol ( symbolStream, stateBegin,paramValue );
+ }
+ }
+
+ RegexDef LanguageDefinition::extractRegex ( const string &paramValue )
+ {
+ RegexDef re_def;
+ auto_ptr<Matcher> m ( reDefPattern->createMatcher ( paramValue ) );
+ if ( m.get() && m->matches() )
+ {
+ re_def.reString = m->getGroup ( 1 );
+ if ( m->getStartingIndex ( 3 ) !=-1 )
+ {
+ StringTools::str2num<int> ( re_def.capturingGroup, m->getGroup ( 3 ), std::dec );
+ //std::cerr << "capturingGroup "<<re_def.capturingGroup<<"\n";
+ }
+ }
+ return re_def;
+ }
+
+ void LanguageDefinition::addSimpleSymbol ( stringstream& symbolStream,
+ State state,
+ const string& paramValue )
+ {
+ istringstream valueStream ( paramValue );
+ bool valExists=false;
+ string value;
+ int pairCount =0;
+ while ( valueStream >> value )
+ {
+ symbolStream << " " << value;
+ valExists = true;
+ delimiterPair[value] = ++pairCount;
+ }
+ if ( valExists )
+ {
+ symbolStream << " " << state;
+ }
+ }
+
+ void LanguageDefinition::addDelimiterSymbol ( stringstream& symbolStream,
+ State stateBegin, State stateEnd,
+ const string& paramValue,
+ unsigned int classID )
+ {
+ istringstream valueStream ( paramValue );
+ string delimPrefix, delimSuffix;
+ int pairCount =0;
+ while ( valueStream>>delimPrefix )
+ {
+ valueStream >> delimSuffix;
+ symbolStream << " "<<delimPrefix <<" " << stateBegin;
+ symbolStream <<" "<< delimSuffix<<" "<< stateEnd;
+ delimiterPrefixes.insert ( make_pair ( delimPrefix, classID ) );
+ // if no closing delimiter exists, open and close delims are equal:
+ delimiterDistinct[stateBegin] = !delimSuffix.empty();
+ ++pairCount;
+ delimiterPair[delimPrefix] = delimiterPair[delimSuffix] = pairCount;
+ //std::cout << "pair: "<< delimPrefix<<"->"<<delimiterPair[delimPrefix]
+ // <<", "<<delimSuffix<<"->"<<delimiterPair[delimSuffix]<<"\n";
+ }
+ }
+
+ void LanguageDefinition::addDelimiterRegex ( stringstream& symbolStream,
+ State stateBegin, State stateEnd,
+ const string& paramValue, const string& langName )
+ {
+ istringstream valueStream ( paramValue );
+ string delimStart, delimEnd;
+ valueStream>>delimStart;
+ valueStream>>delimEnd;
+
+ RegexDef reStart = extractRegex ( delimStart );
+ if ( !reStart.reString.empty() )
+ {
+ Pattern* p = Pattern::compile ( reStart.reString );
+ if ( p!=NULL ) {
+ regex.insert (regex.begin(),1, new RegexElement ( stateBegin,stateBegin, p, reStart.capturingGroup, -1, langName ) );
+ }
+ }
+ // end regex string needs to be saved to pass it back to host language when embedded section is over
+ //host language definiton needs to know end delimiter to recognize single line embedded sections
+ RegexDef reEnd = extractRegex ( delimEnd );
+ if ( !reEnd.reString.empty() )
+ {
+ exitDelimiters[getNewPath(langName)]=reEnd.reString;
+ }
+ }
+
+ void LanguageDefinition::restoreLangEndDelim(const string& langPath){
+ if ( !langPath.empty()&& exitDelimiters.count(langPath) )
+ {
+ Pattern* p = Pattern::compile ( exitDelimiters[langPath]);
+ if ( p!=NULL ) {
+ regex.insert (regex.begin(),1, new RegexElement ( EMBEDDED_CODE_END,EMBEDDED_CODE_END, p ) );
+ }
+ //else
+ // cerr<<"Pattern::compile fehler\n";
+ }
+ }
+
+
+ void LanguageDefinition::getFlag ( string& paramValue, bool &flag)
+ {
+ if (paramValue.size()) flag= StringTools::change_case ( paramValue ) =="true";
+ }
+
+ void LanguageDefinition::getSymbol ( const string& paramValue, unsigned char &symbol )
+ {
+ if (paramValue.empty()) return;
+ symbol=paramValue[0];
+
+/*
+ istringstream valueStream ( paramValue );
+ unsigned char symbol;
+ valueStream >> symbol;
+ return symbol;
+*/
+ }
+
+ void LanguageDefinition::addKeywords ( const string &kwList,
+ State stateBegin, State stateEnd,
+ int classID )
+ {
+ RegexDef re = extractRegex ( kwList );
+ if ( !re.reString.empty() )
+ {
+ Pattern* p = Pattern::compile ( re.reString );
+ if ( p!=NULL )
+ regex.push_back ( new RegexElement ( stateBegin,stateEnd, p, classID, re.capturingGroup ) );
+ else
+ failedRegex = re.reString;
+ return;
+ }
+ istringstream valueStream ( kwList );
+ string keyword;
+ while ( valueStream >> keyword )
+ {
+ keywords.insert ( make_pair ( keyword, classID ) );
+ }
+ }
+
+ unsigned int LanguageDefinition::generateNewKWClass ( const string& newClassName )
+ {
+ unsigned int newClassID=0;
+ bool found=false;
+ while ( newClassID<keywordClasses.size() && !found )
+ {
+ found = ( newClassName==keywordClasses[newClassID++] );
+ }
+ if ( !found )
+ {
+ newClassID++;
+ keywordClasses.push_back ( newClassName );
+ }
+ return newClassID;
+ }
+
+ bool LanguageDefinition::load ( const string& langDefPath, bool clear )
+ {
+ if ( clear ) reset();
+
+ ConfigurationReader langDef ( langDefPath );
+ if ( !langDef.found() )
+ {
+ currentPath.clear();
+ return false;
+ }
+ currentPath=langDefPath;
+ disableHighlighting=false;
+ string token;
+ stringstream symbolStrStream;
+
+ addSymbol ( symbolStrStream,
+ STRING,
+ STRING_END,
+ false,
+ langDef.getParameter ( "stringdelimiters" ) );
+
+ addSymbol ( symbolStrStream,
+ STRING,
+ STRING_END,
+ true,
+ langDef.getParameter ( "string_unequal" ) );
+
+ addSymbol ( symbolStrStream,
+ DIRECTIVE,
+ DIRECTIVE_END,
+ false,
+ langDef.getParameter ( "directive" ) );
+
+ addSymbol ( symbolStrStream,
+ ESC_CHAR,
+ ESC_CHAR_END,
+ false,
+ langDef.getParameter ( "escchar" ) );
+
+ addSymbol ( symbolStrStream,
+ SL_COMMENT,
+ SL_COMMENT_END,
+ false,
+ langDef.getParameter ( "sl_comment" ) );
+
+ addSymbol ( symbolStrStream,
+ ML_COMMENT,
+ ML_COMMENT_END,
+ true,
+ langDef.getParameter ( "ml_comment" ) );
+
+ addSymbol ( symbolStrStream,
+ ML_COMMENT,
+ ML_COMMENT_END,
+ false,
+ langDef.getParameter ( "ml_comment_equal" ) );
+
+ addSymbol ( symbolStrStream,
+ SYMBOL,
+ SYMBOL_END,
+ false,
+ langDef.getParameter ( "symbols" ) );
+
+ string paramName, className, classValue;
+ vector<string> paramNames=langDef.getParameterNames();
+ for ( unsigned int i=0;i<paramNames.size();i++ )
+ {
+ paramName=paramNames[i];
+ className=StringTools::getParantheseVal ( paramName );
+ classValue=langDef.getParameter ( paramName );
+ if ( paramName.find ( "keywords" ) != string::npos )
+ {
+ addKeywords ( classValue, KEYWORD, KEYWORD_END, generateNewKWClass ( className ) );
+ } else if (paramName.find ( "nested" ) != string::npos) {
+ addDelimiterRegex( symbolStrStream, EMBEDDED_CODE_BEGIN, EMBEDDED_CODE_END,
+ classValue, className );
+ }
+ }
+
+ // use hardcoded regex if not defined in language definition
+ // TODO save as members to alloe redefinition in langdefs with include stmt
+ string user_def_re = extractRegex ( langDef.getParameter ( "digit" ) ).reString;
+ string re_digit = ( user_def_re.empty() ) ? REGEX_NUMBER : user_def_re;
+
+ user_def_re = extractRegex ( langDef.getParameter ( "identifier" ) ).reString;
+ string re_identifier= ( user_def_re.empty() ) ? REGEX_IDENTIFIER: user_def_re;
+
+ // insert identifier and number regex after keyword regexes
+ regex.push_back ( new RegexElement ( IDENTIFIER_BEGIN, IDENTIFIER_END,
+ Pattern::compile ( re_identifier ) ) );
+ regex.push_back ( new RegexElement ( NUMBER, NUMBER_END,
+ Pattern::compile ( re_digit ) ) );
+
+ symbolString = symbolStrStream.str();
+
+ getFlag ( langDef.getParameter ( "ignorecase" ), ignoreCase);
+ getFlag ( langDef.getParameter ( "allownestedcomments" ), allowNestedComments );
+ getFlag ( langDef.getParameter ( "disablehighlighting" ), disableHighlighting );
+ getFlag ( langDef.getParameter ( "reformatting" ), reformatCode );
+ getSymbol ( langDef.getParameter ( "rawstringprefix" ), rawStringPrefix );
+ getSymbol ( langDef.getParameter ( "continuationsymbol" ), continuationChar );
+ getFlag ( langDef.getParameter ( "allowextescape" ), allowExtEscape);
+
+ langDesc = langDef.getParameter ( "description" );
+
+ //load syntax before it is overridden by calling language definition
+ string fileToInclude=langDef.getParameter ( "include" );
+ if ( !fileToInclude.empty() )
+ {
+ //string::size_type Pos = langDefPath.find_last_of ( Platform::pathSeparator );
+ //string includeLangDefPath = langDefPath.substr ( 0, Pos+1 ) + fileToInclude;
+ //load ( includeLangDefPath, false );
+ load(getNewPath(fileToInclude), false);
+ }
+
+ return failedRegex.empty();
+ }
+
+ void LanguageDefinition::reset()
+ {
+ keywords.clear();
+ keywordClasses.clear();
+ delimiterPrefixes.clear();
+ delimiterDistinct.clear();
+ delimiterPair.clear();
+ langDesc.clear();
+ ignoreCase= false;
+ allowNestedComments= reformatCode = false;
+ rawStringPrefix = continuationChar = '\0';
+ disableHighlighting=allowExtEscape=false;
+
+ // TODO eigene methode
+ for ( vector<RegexElement*>::iterator it=regex.begin(); it!=regex.end();it++ )
+ {
+ delete *it;
+ }
+ regex.clear();
+ failedRegex.clear();
+ }
+
+ string LanguageDefinition::getNewPath(const string& lang){
+ string::size_type Pos = currentPath.find_last_of ( Platform::pathSeparator );
+ return currentPath.substr ( 0, Pos+1 ) + lang + ".lang";
+ }
+
+}
diff --git a/support/highlight/src/core/languagedefinition.h b/support/highlight/src/core/languagedefinition.h
new file mode 100644
index 0000000000..08caee3fc3
--- /dev/null
+++ b/support/highlight/src/core/languagedefinition.h
@@ -0,0 +1,325 @@
+/***************************************************************************
+ languagedefinition.h - description
+ -------------------
+ begin : Wed Nov 28 2001
+ copyright : (C) 2001-2008 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#ifndef LANGUAGEDEFINITION_H
+#define LANGUAGEDEFINITION_H
+
+#include <string>
+#include <map>
+#include <iostream>
+#include <fstream>
+#include <iterator>
+#include <sstream>
+
+#include "configurationreader.h"
+#include "platform_fs.h"
+#include "enums.h"
+#include "re/Pattern.h"
+#include "re/Matcher.h"
+
+namespace highlight
+{
+
+ class RegexElement;
+
+ /** maps keywords and the corresponding class IDs*/
+ typedef map <string, int> KeywordMap;
+
+ /** maps embedded langiage names to exit delimiter regexes*/
+ typedef map <string, string> EmbedLangDelimMap;
+
+ /**\brief Contains specific data of the programming language being processed.
+
+ The load() method will only read a new language definition if the given
+ file path is not equal to the path of the current language definition.
+
+ * @author Andre Simon
+ */
+
+ class LanguageDefinition
+ {
+
+ public:
+
+ LanguageDefinition();
+
+ ~LanguageDefinition();
+
+ /** \return Symbol string, containg all known symbols with the referencing state ids*/
+ const string &getSymbolString() const { return symbolString; }
+
+ /** \return Failed regilar expression */
+ const string &getFailedRegex() const { return failedRegex; }
+
+ /** \return Prefix of raw strings */
+ unsigned char getRawStringPrefix() const { return rawStringPrefix; }
+
+ /** \return Continuation Character */
+ unsigned char getContinuationChar() const { return continuationChar; }
+
+ /** \return true if syntax highlighting is enabled*/
+ bool highlightingEnabled() const { return !disableHighlighting;}
+
+ /** \return True if language is case sensitive */
+ bool isIgnoreCase() const { return ignoreCase;}
+
+ /** \param s String
+ \return class id of keyword, 0 if s is not a keyword */
+ int isKeyword ( const string &s ) ;
+
+ /** Load new language definition
+ \param langDefPath Path of language definition
+ \param clear Test if former data should be deleted
+ \return True if successfull */
+ bool load ( const string& langDefPath, bool clear=true );
+
+ /** \return True if multi line comments may be nested */
+ bool allowNestedMLComments() const { return allowNestedComments; }
+
+ /** \return True if highlighting is disabled
+ TODO remove method */
+ bool highlightingDisabled() const { return disableHighlighting; }
+
+ /** \return True if the next load() call would load a new language definition
+ \param langDefPath Path to language definition */
+ bool needsReload ( const string &langDefPath ) const { return currentPath!=langDefPath; }
+
+ /** \return True if current language may be reformatted (c, c++, c#, java) */
+ bool enableReformatting() const { return reformatCode;}
+
+ /** \return True if escape sequences are allowed outsde of strings */
+ bool allowExtEscSeq() const { return allowExtEscape; }
+
+ /** \return keywords*/
+ const KeywordMap& getKeywords() const { return keywords; }
+
+ /** \return keyword classes*/
+ const vector<string>& getKeywordClasses() const { return keywordClasses;}
+
+ /** \return regular expressions */
+ const vector<RegexElement*>& getRegexElements() const {return regex;};
+
+ /** \return description of the programming language */
+ const string & getDescription () const {return langDesc;}
+
+ /** \param stateID state id
+ \return true, if no closing delimiter exists (open and close delimiters are equal)
+ */
+ bool delimiterIsDistinct ( int stateID )
+ {
+ return delimiterDistinct[stateID];
+ }
+
+ /** Pairs of open/close tokens have a unique ID to test if two tokens act as delimiters
+ \param token delimiter token
+ \return token ID
+ */
+ int getDelimiterPairID ( const string& token )
+ {
+ return delimiterPair[token];
+ }
+
+ string getDelimRegex(const string & lang){
+ return exitDelimiters[lang];
+ }
+
+ /** initializes end delimiter regex to switch back to host language
+ \param langPath path of embedded language definition
+ */
+ void restoreLangEndDelim(const string&langPath);
+
+ /**
+ \param lang language definition name (no path, no ".lang" extension)
+ \return absolute path based on the previously loaded definition
+ */
+ string getNewPath(const string& lang);
+
+ string getCurrentPath() { return currentPath;}
+
+ private:
+
+ static const string REGEX_IDENTIFIER;
+ static const string REGEX_NUMBER;
+
+ // string containing symbols and their IDs of the programming language
+ string symbolString;
+
+ // path to laoded language definition
+ string currentPath;
+
+ // Language description
+ string langDesc;
+
+ string failedRegex;
+
+ KeywordMap keywords;
+
+ vector <string> keywordClasses;
+
+ vector <RegexElement*> regex;
+
+ KeywordMap delimiterPrefixes;
+
+ EmbedLangDelimMap exitDelimiters;
+
+ // saves if delimiter pair consists of the same delimiter symbol
+ map <int, bool> delimiterDistinct;
+
+ map <string, int> delimiterPair;
+
+ // keywords are not case sensitive if set
+ bool ignoreCase,
+
+ // highlighting is disabled
+ disableHighlighting,
+
+ // Escape sequences are allowed outrside of strings
+ allowExtEscape,
+
+ // allow nested multi line comment blocks
+ allowNestedComments,
+
+ // single line comments have to start in coloumn 1 if set
+ fullLineComment,
+
+ // code formatting is enabled if set
+ reformatCode;
+
+ // character which is prefix of raw string (c#)
+ unsigned char rawStringPrefix,
+
+ //character which continues curreent style on next line
+ continuationChar;
+
+ /* reset members */
+ void reset();
+
+ // add a symbol sequence to the symbolStream
+ void addSimpleSymbol ( stringstream& symbolStream, State state,
+ const string& paramValue );
+
+ void addSymbol ( stringstream& symbolStream,
+ State stateBegin,
+ State stateEnd,
+ bool isDelimiter,
+ const string& paramValue,
+ unsigned int classID=0 );
+
+ // add a delimiter symbol sequence to the symbolStream
+ void addDelimiterSymbol ( stringstream& symbolStream,
+ State stateBegin, State stateEnd,
+ const string& paramValue,
+ unsigned int classID=0 );
+
+ void addDelimiterRegex ( stringstream& symbolStream,
+ State stateBegin, State stateEnd,
+ const string& paramValue, const string& langName);
+
+
+
+ //set flag if paramValue is defined
+ void getFlag ( string& paramValue, bool& flag );
+
+ void getSymbol ( const string& paramValue, unsigned char& symbol );
+
+ // generate a unique class ID of the class name
+ unsigned int generateNewKWClass ( const string& newClassName );
+
+ // add keywords to the given class
+ void addKeywords ( const string &kwList,State stateBegin, State stateEnd, int classID );
+
+ struct RegexDef extractRegex ( const string &paramValue );
+
+ Pattern * reDefPattern;
+
+ };
+
+
+ /**\brief Association of a regex with a state description
+
+ A RegexElement associates a regular expression with the state information
+ (opening and closing state, pattern, keyword class, keyword group id, language name)
+ */
+ class RegexElement
+ {
+ public:
+ RegexElement()
+ :open ( STANDARD ), end ( STANDARD ), rePattern ( NULL ), kwClass ( 0 ),capturingGroup ( -1 ), langName()
+ {
+ }
+
+ RegexElement ( State oState, State eState, Pattern *re, unsigned int cID=0, int group=-1, const string& name="" ) :
+ open ( oState ), end ( eState ), rePattern ( re ), kwClass ( cID ), capturingGroup ( group ), langName(name)
+ {
+ // cerr << "new re element "<< rePattern->getPattern() <<" open: "<<open<<" end "<<end<<"\n";
+ }
+
+ ~RegexElement() { if ( rePattern ) delete rePattern; }
+
+ State open, ///< opening state
+ end; ///< closing state
+ Pattern *rePattern; ///< regex pattern
+ unsigned int kwClass; ///< keyword class
+ int capturingGroup; ///< capturing group ID
+ string langName; ///< language name
+
+ private:
+ RegexElement (const RegexElement& rhs){
+ // does not work because Pattern misses copy constructor
+ /*open=rhs.open;
+ end=rhs.end;
+ kwClass=rhs.kwClass;
+ capturingGroup=rhs.capturingGroup;
+ Pattern *pOrig=rePattern;
+ rePattern=new Pattern(*rhs.rePattern);
+ delete pOrig;*/
+ }
+ RegexElement& operator=(const RegexElement& rhs){
+ // does not work because Pattern misses copy constructor
+ /*open=rhs.open;
+ end=rhs.end;
+ kwClass=rhs.kwClass;
+ capturingGroup=rhs.capturingGroup;
+ Pattern *pOrig=rePattern;
+ rePattern=new Pattern(*rhs.rePattern);
+ delete pOrig;
+ */
+ return *this;
+ }
+ };
+
+ /**\brief Association of a regex and its relevant capturing group
+ */
+ struct RegexDef
+ {
+ RegexDef() :capturingGroup ( -1 ) {}
+ string reString; ///< regex string
+ int capturingGroup; ///< capturing group which should be recognized as token
+ };
+
+}
+#endif
diff --git a/support/highlight/src/core/latexgenerator.cpp b/support/highlight/src/core/latexgenerator.cpp
new file mode 100644
index 0000000000..3508d790be
--- /dev/null
+++ b/support/highlight/src/core/latexgenerator.cpp
@@ -0,0 +1,335 @@
+/***************************************************************************
+ LatexCode.cpp - description
+ -------------------
+ begin : Mit Jul 24 2002
+ copyright : (C) 2002 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#include "latexgenerator.h"
+
+namespace highlight
+{
+
+ LatexGenerator::LatexGenerator()
+ : CodeGenerator ( LATEX ),
+ replaceQuotes ( false ),
+ disableBabelShortHand ( false ),
+ prettySymbols ( false )
+ {
+ // avoid "Underfull \hbox (badness 10000)" warnings
+ newLineTag = "\\\\\n";
+ longLineTag = "\\hspace*{\\fill}" + newLineTag;
+ spacer = "\\ ";
+ maskWs=true;
+ maskWsBegin = "\\hlstd{";
+ maskWsEnd = "}";
+ excludeWs=true;
+ styleCommentOpen="%";
+ }
+
+ LatexGenerator::~LatexGenerator()
+ {}
+
+ void LatexGenerator::printBody()
+ {
+ *out << "\\noindent\n" ;
+ if ( ! this->getBaseFont().empty() )
+ *out << "\\" << this->getBaseFont() << "\n" ;
+ else
+ *out << "\\ttfamily\n";
+ if ( ! this->getBaseFontSize().empty() )
+ *out << "\\" << this->getBaseFontSize() << "\n" ;
+ if ( disableBabelShortHand )
+ *out << "\\shorthandoff{\"}\n";
+
+ processRootState();
+
+ *out << "\\mbox{}\n"
+ << "\\normalfont\n";
+ if ( ! this->getBaseFontSize().empty() )
+ *out << "\\normalsize\n" ;
+ if ( disableBabelShortHand )
+ *out << "\\shorthandon{\"}\n";
+ }
+
+ string LatexGenerator::getHeader()
+ {
+ ostringstream os;
+
+ os << "\\documentclass{article}\n"
+ << "\\usepackage{color}\n"
+ << "\\usepackage{alltt}\n";
+
+ if ( StringTools::change_case ( encoding ) =="utf-8" )
+ {
+ os << "\\usepackage{ucs}\n\\usepackage[utf8x]{inputenc}\n";
+ }
+ else if ( encodingDefined() )
+ {
+ os << "\\usepackage[latin1]{inputenc}\n";
+ }
+
+ //needed for Righttorque symbol
+ if ( preFormatter.isEnabled() )
+ {
+ os << "\\usepackage{marvosym}\n";
+ }
+
+ if ( langInfo.highlightingEnabled() )
+ {
+ if ( includeStyleDef )
+ {
+ os << "\n"<<getStyleDefinition();
+ os << CodeGenerator::readUserStyleDef();
+ }
+ else
+ {
+ os << "\n\\input {"
+ << getStyleOutputPath()
+ << "}\n";
+ }
+ }
+
+ os << "\n\\title{" << docTitle << "}\n"
+ << "\\begin{document}\n"
+ << "\\pagecolor{bgcolor}\n";
+
+ if ( prettySymbols )
+ {
+ os<<"\\newsavebox{\\hlboxopenbrace}\n"
+ <<"\\newsavebox{\\hlboxclosebrace}\n"
+ <<"\\newsavebox{\\hlboxlessthan}\n"
+ <<"\\newsavebox{\\hlboxgreaterthan}\n"
+ <<"\\newsavebox{\\hlboxdollar}\n"
+ <<"\\newsavebox{\\hlboxunderscore}\n"
+ <<"\\newsavebox{\\hlboxand}\n"
+ <<"\\newsavebox{\\hlboxhash}\n"
+ <<"\\newsavebox{\\hlboxat}\n"
+ <<"\\newsavebox{\\hlboxbackslash}\n"
+ <<"\\newsavebox{\\hlboxpercent}\n"
+ <<"\\newsavebox{\\hlboxhat}\n"
+
+ <<"\\setbox\\hlboxopenbrace=\\hbox{\\verb.{.}\n"
+ <<"\\setbox\\hlboxclosebrace=\\hbox{\\verb.}.}\n"
+ <<"\\setbox\\hlboxlessthan=\\hbox{\\verb.<.}\n"
+ <<"\\setbox\\hlboxgreaterthan=\\hbox{\\verb.>.}\n"
+
+ <<"\\setbox\\hlboxdollar=\\hbox{\\verb.$.}\n"
+ <<"\\setbox\\hlboxunderscore=\\hbox{\\verb._.}\n"
+ <<"\\setbox\\hlboxand=\\hbox{\\verb.&.}\n"
+ <<"\\setbox\\hlboxhash=\\hbox{\\verb.#.}\n"
+ <<"\\setbox\\hlboxat=\\hbox{\\verb.@.}\n"
+ <<"\\setbox\\hlboxbackslash=\\hbox{\\verb.\\.}\n"
+ <<"\\setbox\\hlboxpercent=\\hbox{\\verb.\\%.}\n"
+ <<"\\setbox\\hlboxhat=\\hbox{\\verb.^.}\n"
+
+ <<"\\def\\urltilda{\\kern -.15em\\lower .7ex\\hbox{\\~{}}\\kern .04em}\n";
+ }
+
+ return os.str();
+ }
+
+ string LatexGenerator::getFooter()
+ {
+ ostringstream os;
+ os << "\\end {document}\n"
+ << "(* LaTeX generated by highlight "
+ << HIGHLIGHT_VERSION
+ << ", "
+ << HIGHLIGHT_URL
+ << " *)\n";
+ return os.str();
+ }
+
+
+ void LatexGenerator::initOutputTags(){
+ openTags.push_back ( "\\hlstd{" );
+ openTags.push_back ( "\\hlstr{" );
+ openTags.push_back ( "\\hlnum{" );
+ openTags.push_back ( "\\hlslc{" );
+ openTags.push_back ( "\\hlcom{" );
+ openTags.push_back ( "\\hlesc{" );
+ openTags.push_back ( "\\hldir{" );
+ openTags.push_back ( "\\hldstr{" );
+ openTags.push_back ( "\\hlline{" );
+ openTags.push_back ( "\\hlsym{" );
+
+ for ( int i=0;i<NUMBER_BUILTIN_STATES; i++ )
+ {
+ closeTags.push_back ( "}" );
+ }
+ }
+
+ string LatexGenerator::getAttributes ( const string & elemName,
+ const ElementStyle &elem )
+ {
+ ostringstream s;
+ s << "\\newcommand{\\hl"
+ << elemName
+ << "}[1]{\\textcolor[rgb]{"
+ << elem.getColour().getRed ( LATEX ) << ","
+ << elem.getColour().getGreen ( LATEX ) << ","
+ << elem.getColour().getBlue ( LATEX )
+ << "}{";
+
+ if ( elem.isBold() )
+ s << "\\bf{";
+ if ( elem.isItalic() )
+ s << "\\it{";
+
+ s <<"#1";
+
+ if ( elem.isBold() )
+ s << "}";
+ if ( elem.isItalic() )
+ s << "}";
+
+ s <<"}}\n";
+ return s.str();
+ }
+
+
+ string LatexGenerator::getNewLine()
+ {
+ string nl;
+
+ // set wrapping arrow if previous line was wrapped
+ if ( preFormatter.isWrappedLine ( lineNumber-1 ) )
+ {
+ nl = "\\Righttorque";
+ }
+ nl += ( showLineNumbers ) ? newLineTag:longLineTag;
+ return nl;
+ }
+
+ string LatexGenerator::maskCharacter ( unsigned char c )
+ {
+ switch ( c )
+ {
+ case ' ':
+ return spacer;
+ break;
+
+ case '<' :
+ return prettySymbols ? "\\usebox{\\hlboxlessthan}" : "$<$";
+ break;
+ case '>' :
+ return prettySymbols ? "\\usebox{\\hlboxgreaterthan}" : "$>$";
+ break;
+ case '{':
+ return prettySymbols ? "\\usebox{\\hlboxopenbrace}" : "\\{";
+ break;
+ case '}':
+ return prettySymbols ? "\\usebox{\\hlboxclosebrace}" : "\\}";
+ break;
+
+ case '&':
+ case '$':
+ case '#':
+ case '%':
+ {
+ string m ( "\\" );
+ m += c;
+ return m;
+ }
+ break;
+ case '\"':
+ return ( replaceQuotes ) ?"\\dq{}":"\"";
+ break;
+ case '_':
+ return "\\textunderscore ";
+ break;
+ case '^':
+ return "\\textasciicircum ";
+ break;
+ case '\\':
+ return "$\\backslash$";
+ break;
+ case '~':
+ return prettySymbols ? "\\urltilda " : "$\\sim$";
+ break;
+ case '|':
+ return "\\textbar ";
+ break;
+ // avoid latex compilation failure if [ or * follows a line break (\\)
+ case '*':
+ case '[':
+ case ']':
+ // avoid "merging" of consecutive '-' chars when included in bold font ( \bf )
+ case '-':
+ {
+ string m ( 1, '{' );
+ m += c;
+ m += '}';
+ return m;
+ }
+ break;
+ default :
+ return string ( 1, c );
+ }
+ }
+
+ string LatexGenerator::getKeywordOpenTag ( unsigned int styleID )
+ {
+ return "\\hl"+langInfo.getKeywordClasses() [styleID]+"{";
+ }
+
+ string LatexGenerator::getKeywordCloseTag ( unsigned int styleID )
+ {
+ return "}";
+ }
+
+ string LatexGenerator::getStyleDefinition()
+ {
+ if ( styleDefinitionCache.empty() )
+ {
+ ostringstream os;
+ os << getAttributes ( STY_NAME_STD, docStyle.getDefaultStyle() );
+ os << getAttributes ( STY_NAME_NUM, docStyle.getNumberStyle() );
+ os << getAttributes ( STY_NAME_ESC, docStyle.getEscapeCharStyle() );
+ os << getAttributes ( STY_NAME_STR, docStyle.getStringStyle() );
+ os << getAttributes ( STY_NAME_DST, docStyle.getDirectiveStringStyle() );
+ os << getAttributes ( STY_NAME_SLC, docStyle.getSingleLineCommentStyle() );
+ os << getAttributes ( STY_NAME_COM, docStyle.getCommentStyle() );
+ os << getAttributes ( STY_NAME_DIR, docStyle.getDirectiveStyle() );
+ os << getAttributes ( STY_NAME_SYM, docStyle.getSymbolStyle() );
+ os << getAttributes ( STY_NAME_LIN, docStyle.getLineStyle() );
+
+ KeywordStyles styles = docStyle.getKeywordStyles();
+ for ( KSIterator it=styles.begin(); it!=styles.end(); it++ )
+ {
+ os << getAttributes ( it->first, it->second );
+ }
+ os << "\\definecolor{bgcolor}{rgb}{"
+ << docStyle.getBgColour().getRed ( LATEX ) << ","
+ << docStyle.getBgColour().getGreen ( LATEX ) << ","
+ << docStyle.getBgColour().getBlue ( LATEX )
+ << "}\n";
+
+ styleDefinitionCache=os.str();
+ }
+ return styleDefinitionCache;
+ }
+
+
+}
diff --git a/support/highlight/src/core/latexgenerator.h b/support/highlight/src/core/latexgenerator.h
new file mode 100644
index 0000000000..a1e56c55e4
--- /dev/null
+++ b/support/highlight/src/core/latexgenerator.h
@@ -0,0 +1,118 @@
+/***************************************************************************
+ latexgenerator.h - description
+ -------------------
+ begin : Mit Jul 24 2002
+ copyright : (C) 2002 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#ifndef LATEXGENERATOR_H
+#define LATEXGENERATOR_H
+
+#include <string>
+#include <iostream>
+#include <sstream>
+
+#include "codegenerator.h"
+#include "version.h"
+#include "charcodes.h"
+
+
+namespace highlight
+{
+
+ /**
+ \brief This class generates LaTeX.
+
+ It contains information about the resulting document structure (document
+ header and footer), the colour system, white space handling and text
+ formatting attributes.
+
+ * @author Andre Simon
+ */
+
+ class LatexGenerator : public highlight::CodeGenerator
+ {
+ public:
+ LatexGenerator();
+ ~LatexGenerator();
+
+ /** set replace quotes flag
+ \param b flag
+ */
+ void setLATEXReplaceQuotes ( bool b ) { replaceQuotes = b;}
+
+ /** set disable babel shorthand flag
+ \param b flag
+ */
+ void setLATEXNoShorthands ( bool b ) { disableBabelShortHand = b; }
+
+ /** set pretty symbols flag
+ \param b flag
+ */
+ void setLATEXPrettySymbols ( bool b ) { prettySymbols = b; }
+
+ private:
+
+ /** prints document header
+ */
+ string getHeader();
+
+ /** Prints document footer*/
+ string getFooter();
+
+ /** Prints document body*/
+ void printBody();
+
+ /** initialize tags in specific format according to colouring information provided in DucumentStyle */
+ void initOutputTags();
+
+ string styleDefinitionCache;
+ string longLineTag;
+
+ /** \return escaped character*/
+ virtual string maskCharacter ( unsigned char );
+
+ /**\return text formatting attributes in LaTeX format */
+ string getAttributes ( const string & elemName,
+ const ElementStyle & elem );
+
+ /** test if double quotes should be replaced by \dq{} */
+ bool replaceQuotes;
+
+ /** test if Babel shorthand for " should be disabled */
+ bool disableBabelShortHand;
+
+ /** test if symbols like <,>,{,},~ should be replaced by nicer definitions */
+ bool prettySymbols;
+
+ string getNewLine();
+
+ string getStyleDefinition();
+
+ string getKeywordOpenTag ( unsigned int styleID );
+ string getKeywordCloseTag ( unsigned int styleID );
+ };
+
+}
+
+#endif
diff --git a/support/highlight/src/core/platform_fs.cpp b/support/highlight/src/core/platform_fs.cpp
new file mode 100644
index 0000000000..2719bf7a69
--- /dev/null
+++ b/support/highlight/src/core/platform_fs.cpp
@@ -0,0 +1,339 @@
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#include "platform_fs.h"
+
+// includes for recursive getFileNames() function
+#ifdef _WIN32
+#include <windows.h>
+#else
+#include <dirent.h>
+#include <errno.h>
+#include <sys/stat.h>
+#ifdef __VMS
+#include <unixlib.h>
+#include <rms.h>
+#include <ssdef.h>
+#include <stsdef.h>
+#include <lib$routines.h>
+#include <starlet.h>
+#endif /* __VMS */
+#endif
+
+#include <algorithm>
+#include <iostream>
+#include <errno.h>
+
+using namespace std;
+
+namespace Platform
+{
+
+#ifdef _WIN32
+#include <windows.h>
+ const char pathSeparator = '\\';
+ std::string getAppPath()
+ {
+ char pathAndName[MAX_PATH], path[MAX_PATH], drive[3];
+ GetModuleFileName ( NULL, ( wchar_t* ) pathAndName, MAX_PATH );
+ _splitpath ( pathAndName, drive, path, 0, 0 );
+ return std::string ( drive ) +path;
+ }
+#else
+ const char pathSeparator = '/';
+
+ std::string getAppPath()
+ {
+ return "";
+ }
+#endif
+
+ bool getDirectoryEntries ( vector<string> &fileList,
+ string wildcard,
+ bool recursiveSearch )
+ {
+ if ( !wildcard.empty() )
+ {
+ string directory_path;
+ string::size_type Pos = wildcard.find_last_of ( pathSeparator );
+ if ( Pos == string::npos )
+ {
+ directory_path = ".";
+ }
+ else
+ {
+ directory_path = wildcard.substr ( 0, Pos + 1 );
+ wildcard = wildcard.substr ( Pos + 1 );
+ }
+
+ /* old method using dirstream:
+ dirstr::dirstream str( directory_path.c_str(),
+ #ifdef USE_FN_MATCH
+ dirstr::pred_f(FnMatcher(wildcard.c_str(), 0)),
+ #else
+ dirstr::pattern_f(wildcard.c_str()),
+ #endif
+ (recursiveSearch)?dirstr::recursive_yes:dirstr::recursive_no);
+ for(string entry; str >> entry;) {
+ fileList.push_back(dirstr::full_path(entry));
+ //cerr << "1: "<<dirstr::full_path(entry)<<"\n";
+ }
+ */
+
+ // new method using getFileNames:
+ getFileNames ( directory_path, wildcard, fileList );
+ }
+ return ! ( fileList.empty() );
+ }
+
+
+#ifdef _WIN32 // Windows specific
+
+ /**
+ * WINDOWS function to resolve wildcards and recurse into sub directories.
+ * The fileName vector is filled with the path and names of files to process.
+ *
+ * @param directory The path of the directory to be processed.
+ * @param wildcard The wildcard to be processed (e.g. *.cpp).
+ * @param filenam An empty vector which will be filled with the path and names of files to process.
+ */
+ void getFileNames ( const string &directory,const string &wildcard, vector<string> &fileName )
+ {
+ vector<string> subDirectory; // sub directories of directory
+ WIN32_FIND_DATA FindFileData; // for FindFirstFile and FindNextFile
+
+ // Find the first file in the directory
+ string firstFile = directory + "\\*";
+ HANDLE hFind = FindFirstFile ( firstFile.c_str(), &FindFileData );
+
+ if ( hFind == INVALID_HANDLE_VALUE )
+ return;
+ //error("Cannot open directory", directory.c_str());
+
+ // save files and sub directories
+ do
+ {
+ // skip hidden or read only
+ if ( FindFileData.cFileName[0] == '.'
+ || ( FindFileData.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN )
+ || ( FindFileData.dwFileAttributes & FILE_ATTRIBUTE_READONLY ) )
+ continue;
+
+ // if a sub directory and recursive, save sub directory
+ if ( ( FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) && true /*g_isRecursive*/ )
+ {
+ string subDirectoryPath = directory + pathSeparator + FindFileData.cFileName;
+ //if (isPathExclued(subDirectoryPath))
+ //{
+ // if (!g_isQuiet)
+ // cout << "exclude " << subDirectoryPath.substr(g_mainDirectoryLength) << endl;
+ //}
+ //else
+ subDirectory.push_back ( subDirectoryPath );
+ continue;
+ }
+
+ // save the file name
+ string filePathName = directory + pathSeparator + FindFileData.cFileName;
+ // check exclude before wildcmp to avoid "unmatched exclude" error
+ //bool isExcluded = isPathExclued(filePathName);
+ // save file name if wildcard match
+ if ( wildcmp ( wildcard.c_str(), FindFileData.cFileName ) )
+ {
+ //if (isExcluded)
+ // cout << "exclude " << filePathName.substr(g_mainDirectoryLength) << endl;
+ //else
+ fileName.push_back ( filePathName );
+ }
+ }
+ while ( FindNextFile ( hFind, &FindFileData ) != 0 );
+
+ // check for processing error
+ FindClose ( hFind );
+ DWORD dwError = GetLastError();
+ if ( dwError != ERROR_NO_MORE_FILES )
+ return;
+ //error("Error processing directory", directory.c_str());
+
+ // recurse into sub directories
+ // if not doing recursive subDirectory is empty
+ for ( unsigned i = 0; i < subDirectory.size(); i++ )
+ {
+// cout << "directory " << subDirectory[i] << endl;
+ getFileNames ( subDirectory[i], wildcard, fileName );
+ continue;
+ }
+
+ return;
+ }
+
+#else // not _WIN32
+
+ /**
+ * LINUX function to resolve wildcards and recurse into sub directories.
+ * The fileName vector is filled with the path and names of files to process.
+ *
+ * @param directory The path of the directory to be processed.
+ * @param wildcard The wildcard to be processed (e.g. *.cpp).
+ * @param filenam An empty vector which will be filled with the path and names of files to process.
+ */
+ void getFileNames ( const string &directory,const string &wildcard, vector<string> &fileName )
+ {
+ struct dirent *entry; // entry from readdir()
+ struct stat statbuf; // entry from stat()
+ vector<string> subDirectory; // sub directories of this directory
+
+ // errno is defined in <errno.h> and is set for errors in opendir, readdir, or stat
+ errno = 0;
+
+ DIR *dp = opendir ( directory.c_str() );
+ if ( errno )
+ return;
+ //error("Cannot open directory", directory.c_str());
+
+ // save the first fileName entry for this recursion
+ const unsigned firstEntry = fileName.size();
+
+ // save files and sub directories
+ while ( ( entry = readdir ( dp ) ) != NULL )
+ {
+ // get file status
+ string entryFilepath = directory + pathSeparator + entry->d_name;
+ stat ( entryFilepath.c_str(), &statbuf );
+ if ( errno )
+ return;
+ //error("Error getting file status in directory", directory.c_str());
+
+ // skip hidden or read only
+ if ( entry->d_name[0] == '.' || ! ( statbuf.st_mode & S_IWUSR ) )
+ continue;
+ // if a sub directory and recursive, save sub directory
+ if ( S_ISDIR ( statbuf.st_mode ) && /*g_isRecursive*/ true ) ///TODO
+ {
+ // if (isPathExclued(entryFilepath))
+ // cout << "exclude " << entryFilepath.substr(g_mainDirectoryLength) << endl;
+ // else
+ subDirectory.push_back ( entryFilepath );
+ continue;
+ }
+
+ // if a file, save file name
+ if ( S_ISREG ( statbuf.st_mode ) )
+ {
+ // check exclude before wildcmp to avoid "unmatched exclude" error
+ // bool isExcluded = isPathExclued(entryFilepath);
+ // save file name if wildcard match
+ if ( wildcmp ( wildcard.c_str(), entry->d_name ) )
+ {
+ // if (isExcluded)
+ // cout << "exclude " << entryFilepath.substr(g_mainDirectoryLength) << endl;
+ // else
+ fileName.push_back ( entryFilepath );
+ }
+ }
+ }
+ closedir ( dp );
+
+ if ( errno )
+ return;
+ //error("Error reading directory", directory.c_str());
+
+ // sort the current entries for fileName
+ if ( firstEntry < fileName.size() )
+ sort ( &fileName[firstEntry], &fileName[fileName.size() ] );
+
+ // recurse into sub directories
+ // if not doing recursive, subDirectory is empty
+ if ( subDirectory.size() > 1 )
+ sort ( subDirectory.begin(), subDirectory.end() );
+ for ( unsigned i = 0; i < subDirectory.size(); i++ )
+ {
+ getFileNames ( subDirectory[i], wildcard, fileName );
+ continue;
+ }
+
+ return;
+ }
+
+#endif
+
+// From The Code Project http://www.codeproject.com/string/wildcmp.asp
+// Written by Jack Handy - jakkhandy@hotmail.com
+// Modified to compare case insensitive for Windows (the LC macro)
+ int wildcmp ( const char *wild, const char *data )
+ {
+ const char *cp = NULL, *mp = NULL;
+ bool cmpval;
+
+ while ( ( *data ) && ( *wild != '*' ) )
+ {
+#ifdef _WIN32
+ cmpval = ( tolower ( *wild ) != tolower ( *data ) ) && ( *wild != '?' );
+#else
+ cmpval = ( *wild != *data ) && ( *wild != '?' );
+#endif
+
+ if ( cmpval )
+ {
+ return 0;
+ }
+ wild++;
+ data++;
+ }
+
+ while ( *data )
+ {
+ if ( *wild == '*' )
+ {
+ if ( !*++wild )
+ {
+ return 1;
+ }
+ mp = wild;
+ cp = data+1;
+ }
+ else
+ {
+#ifdef _WIN32
+ cmpval = ( tolower ( *wild ) == tolower ( *data ) || ( *wild == '?' ) );
+#else
+ cmpval = ( *wild == *data ) || ( *wild == '?' );
+#endif
+
+ if ( cmpval )
+ {
+ wild++;
+ data++;
+ }
+ else
+ {
+ wild = mp;
+ data = cp++;
+ }
+ }
+ }
+
+ while ( *wild == '*' )
+ {
+ wild++;
+ }
+ return !*wild;
+ }
+
+}
diff --git a/support/highlight/src/core/platform_fs.h b/support/highlight/src/core/platform_fs.h
new file mode 100644
index 0000000000..63f36a455c
--- /dev/null
+++ b/support/highlight/src/core/platform_fs.h
@@ -0,0 +1,68 @@
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef PLATFORM_FS__H__INCLUDED
+#define PLATFORM_FS__H__INCLUDED
+
+#include <string>
+#include <iostream>
+#include <vector>
+/*
+#ifdef USE_FN_MATCH
+ #include <fnmatch.h>
+#endif
+*/
+
+namespace Platform
+{
+ extern const char pathSeparator;
+
+ std::string getAppPath();
+
+ /** \param fileList Vector where found entries will be stored
+ \param wildcard Directory path and wildcard
+ \param recursiveSearch Test if directory should be searched recursively */
+ bool getDirectoryEntries ( std::vector<std::string> &fileList,
+ std::string wildcard,
+ bool recursiveSearch=false );
+
+ void getFileNames ( const std::string &directory,const std::string &wildcard,
+ std::vector<std::string> &fileName );
+
+ int wildcmp ( const char *wild, const char *data );
+
+ /*
+ #ifdef USE_FN_MATCH
+ struct FnMatcher
+ {
+ FnMatcher(const char* pattern, int flags)
+ : pattern_(pattern)
+ , flags_(flags)
+ {}
+ bool operator()(const std::string& e) const {
+ return ! ::fnmatch(pattern_, e.c_str(), flags_);
+ }
+ private:
+ const char* pattern_;
+ int flags_;
+ };
+ #endif
+ */
+
+}
+#endif
diff --git a/support/highlight/src/core/preformatter.cpp b/support/highlight/src/core/preformatter.cpp
new file mode 100644
index 0000000000..88ef5293f5
--- /dev/null
+++ b/support/highlight/src/core/preformatter.cpp
@@ -0,0 +1,206 @@
+/***************************************************************************
+ PreFormatter.cpp - description
+ -------------------
+ begin : Mo Jan 03 2005
+ copyright : (C) 2005-2007 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#include "preformatter.h"
+
+#include <iostream>
+#include "stringtools.h"
+
+namespace highlight
+{
+
+ const std::string PreFormatter::LB_CHARS = " \t[](){}-+<>.:,;";
+ const std::string PreFormatter::WS_CHARS = " \n\r\t";
+ const std::string PreFormatter::INDENT_MARKERS = "{(=";
+
+ PreFormatter::PreFormatter() :
+ maxLineLength ( 80 ),
+ index ( 0 ),
+ numberSpaces ( 0 ),
+ lineNumber ( 0 ),
+ wsPrefixLength ( string::npos ),
+ hasMore ( false ),
+ indentAfterOpenBraces ( true ),
+ redefineWsPrefix ( false ),
+ wrapLines ( false ),
+ replaceTabs ( false )
+ {
+ }
+
+ PreFormatter::~PreFormatter()
+ {
+ }
+
+ bool PreFormatter::hasMoreLines()
+ {
+ return hasMore;
+ }
+
+ bool PreFormatter::indentCode()
+ {
+ return indentAfterOpenBraces;
+ }
+
+ void PreFormatter::setLine ( const std::string& newLine )
+ {
+
+ line=newLine;
+
+ if ( replaceTabs && numberSpaces )
+ {
+ size_t tabPos=line.find ( '\t' );
+ while ( tabPos!=string::npos )
+ {
+ line.replace ( tabPos , 1, numberSpaces - ( tabPos % numberSpaces ) , ' ' );
+ tabPos = line.find ( '\t', tabPos+1 );
+ }
+ }
+
+ if ( wrapLines )
+ {
+ wsPrefix.clear();
+ index=0;
+ wsPrefixLength=string::npos;
+ hasMore=true;
+ redefineWsPrefix=false;
+ }
+ }
+
+ std::string PreFormatter::getNextLine()
+ {
+
+ if ( !wrapLines )
+ {
+ hasMore = false;
+ return line;
+ }
+
+ ++lineNumber;
+
+ if ( !index && line.length() > maxLineLength ) // erster Durchlauf...
+ {
+ // wenn moeglich an oeffnender Klammer oder Geichheitszeichen ausrichten
+ if ( indentAfterOpenBraces )
+ {
+ wsPrefixLength=line.find_first_of ( INDENT_MARKERS );
+ }
+ // sonst die Einrckung der Originalzeile beibehalten
+ if ( wsPrefixLength==string::npos || wsPrefixLength-index>maxLineLength )
+ {
+ wsPrefixLength=line.find_first_not_of ( WS_CHARS );
+ }
+ else
+ {
+ // wsPrefix in allen neu umgebrochenen Zeilen durch Spaces ersetzen
+ redefineWsPrefix=true;
+ // Position hinter oeffnende Klammer springen
+ wsPrefixLength=line.find_first_not_of ( WS_CHARS,wsPrefixLength+1 );
+ }
+
+ if ( wsPrefixLength!=string::npos )
+ {
+ index = wsPrefixLength;
+ // Falls Anzahl der Whitespaces am beginn der ersten zeile groesser
+ // als Max. Zeilenlaenge, Whitespaces verwerfen
+ if ( wsPrefixLength>maxLineLength )
+ {
+ wsPrefixLength=0;
+ return string();
+ }
+ else
+ {
+ wsPrefix=line.substr ( 0, wsPrefixLength );
+ }
+ }
+ // Zeile enthaelt nur Whitespace; verwerfen
+ else
+ {
+ hasMore= false;
+ return string();
+ }
+ }
+ else
+ {
+ if ( redefineWsPrefix )
+ {
+ wsPrefix.clear();
+ wsPrefix.append ( wsPrefixLength, ' ' );
+ }
+ redefineWsPrefix=false;
+ }
+
+ string resultString;
+
+ // Position, ab der rueckwaerts nach Umbruchmglichkeit gesucht wird
+ unsigned int searchEndPos = maxLineLength - wsPrefixLength;
+
+ // letztes Teilstueck der Zeile ausgeben; Parsen beenden
+ if ( line.length()-index < searchEndPos )
+ {
+ hasMore=false;
+ resultString= ( index>0 ) ? wsPrefix + line.substr ( index ) : line.substr ( index );
+ return resultString;
+ }
+
+ // Umbrechposition suchen
+ size_t lbPos = line.find_last_of ( LB_CHARS, index+searchEndPos );
+ if ( lbPos <= index || lbPos == string::npos )
+ {
+ // nichts gefunden, hart umbrechen
+ lbPos = index + searchEndPos;
+ }
+ // Einrckung der Originalzeile erhalten
+ resultString+=wsPrefix;
+ // Neue Zeile erzeugen
+ resultString += line.substr ( index, lbPos-index+1 );
+
+ // Whitespace am neuen Zeilenbeginn ignorieren, ausser beim ersten Durchlauf
+ size_t newIndex=line.find_first_not_of ( WS_CHARS, lbPos+1 );
+ index= ( newIndex!=string::npos ) ?newIndex:line.length();
+
+ hasMore=index!=line.length(); // unnoetigen Leerstring vermeiden
+
+ if ( hasMore ) wrappedLines.insert ( lineNumber ); // diese Zeile wurde umgebrochen
+
+ return resultString;
+ }
+
+ void PreFormatter::setWrapLineLength ( unsigned int maxLineLength )
+ {
+ this->maxLineLength = maxLineLength;
+ }
+ void PreFormatter::setWrapIndentBraces ( bool indentAfterOpenBraces )
+ {
+ this->indentAfterOpenBraces = indentAfterOpenBraces;
+ }
+
+ void PreFormatter::setNumberSpaces ( unsigned int num )
+ {
+ numberSpaces = num;
+ }
+
+}
diff --git a/support/highlight/src/core/preformatter.h b/support/highlight/src/core/preformatter.h
new file mode 100644
index 0000000000..4afcb28464
--- /dev/null
+++ b/support/highlight/src/core/preformatter.h
@@ -0,0 +1,150 @@
+/***************************************************************************
+ PreFormatter.cpp - description
+ -------------------
+ begin : Mo Jan 03 2005
+ copyright : (C) 2005-2008 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#ifndef PreFormatter_H
+#define PreFormatter_H
+
+#include <string>
+#include <set>
+
+namespace highlight
+{
+
+ /** \brief Class which provides intelligent line wrapping.
+ * @author Andre Simon
+ */
+
+ class PreFormatter
+ {
+ public:
+
+ PreFormatter();
+
+ ~PreFormatter();
+
+ /**
+ Set wrapping mode
+ \param wrap set to true if long lines should be wrapped
+ */
+ void setWrap ( bool wrap ) {wrapLines = wrap;}
+
+ /**
+ Replace tabs by spaces
+ \param replTabs set to true if tabs should be replaced by spaces
+ */
+ void setReplaceTabs ( bool replTabs ) {replaceTabs = replTabs;}
+
+ /**
+ \return True if current line can be wrapped again
+ */
+ bool hasMoreLines();
+
+ /**
+ Sets new line to be wrapped
+ \param newline New line
+ */
+ void setLine ( const std::string & newline );
+
+ /**
+ The method will indent function calls and statements
+ \return Next line
+ */
+ std::string getNextLine();
+
+ /**
+ \return True if lines following open braces should be indented
+ */
+ bool indentCode();
+
+ /**
+ Maximum line length
+ \param maxlength max. length of output lines
+ */
+ void setWrapLineLength ( unsigned int maxlength );
+
+ /**
+ Indentation mode
+ \param indentAfterOpenBraces set true if lines should be indented after braces
+ */
+ void setWrapIndentBraces ( bool indentAfterOpenBraces=true );
+
+ /**
+ Number of spaces
+ \param num number of spaces which replace a tab
+ */
+ void setNumberSpaces ( unsigned int num );
+
+ /**
+ \return true if preformatting is enabled
+ */
+ bool isEnabled()
+ {
+ return wrapLines || replaceTabs;
+ }
+
+ /**
+ reset preformatting state to use the object with new input data
+ */
+ void reset ()
+ {
+ lineNumber=0;
+ wrappedLines.clear();
+ }
+
+ /**
+ \param lineNumber line number
+ \return true if input line linenumber was wrapped
+ */
+ bool isWrappedLine ( int lineNumber )
+ {
+ return wrappedLines.count ( lineNumber );
+ }
+
+ private:
+
+ unsigned int maxLineLength;
+
+ std::string line, wsPrefix;
+ unsigned int index;
+ unsigned int numberSpaces;
+ unsigned int lineNumber;
+ size_t wsPrefixLength;
+ bool hasMore, indentAfterOpenBraces;
+ bool redefineWsPrefix;
+ bool wrapLines, replaceTabs;
+
+ std::set<int> wrappedLines;
+
+ static const std::string LB_CHARS;
+ static const std::string WS_CHARS;
+ static const std::string INDENT_MARKERS;
+
+ };
+
+}
+
+#endif
diff --git a/support/highlight/src/core/re/Matcher.cpp b/support/highlight/src/core/re/Matcher.cpp
new file mode 100644
index 0000000000..341bfbd105
--- /dev/null
+++ b/support/highlight/src/core/re/Matcher.cpp
@@ -0,0 +1,178 @@
+#include "Matcher.h"
+#include "Pattern.h"
+
+const int Matcher::MATCH_ENTIRE_STRING = 0x01;
+
+/*
+ Detailed documentation is provided in this class' header file
+
+ @author Jeffery Stuart
+ @since November 2004
+ @version 1.05.01
+*/
+
+Matcher::Matcher(Pattern * pattern, const std::string & text)
+{
+ pat = pattern;
+ str = text;
+ gc = pattern->groupCount;
+ ncgc = -pattern->nonCapGroupCount;
+ flags = 0;
+ matchedSomething = false;
+ starts = new int[gc + ncgc];
+ ends = new int[gc + ncgc];
+ groups = new int[gc + ncgc];
+ groupPos = new int[gc + ncgc];
+ groupIndeces = new int[gc + ncgc];
+ starts = starts + ncgc;
+ ends = ends + ncgc;
+ groups = groups + ncgc;
+ groupPos = groupPos + ncgc;
+ groupIndeces = groupIndeces + ncgc;
+ for (int i = 0; i < gc; ++i) starts[i] = ends[i] = 0;
+}
+Matcher::~Matcher()
+{
+ delete [] (starts - ncgc);
+ delete [] (ends - ncgc);
+ delete [] (groups - ncgc);
+ delete [] (groupIndeces - ncgc);
+ delete [] (groupPos - ncgc);
+}
+void Matcher::clearGroups()
+{
+ int i;
+ lm = 0;
+ for (i = 0; i < gc; ++i) groups[i] = starts[i] = ends[i] = -1;
+ for (i = 1; i <= ncgc; ++i) groups[0 - i] = -1;
+}
+std::string Matcher::replaceWithGroups(const std::string & str)
+{
+ std::string ret = "";
+
+ std::string t = str;
+ while (t.size() > 0)
+ {
+ if (t[0] == '\\')
+ {
+ t = t.substr(1);
+ if (t.size() == 0)
+ {
+ ret += "\\";
+ }
+ else if (t[0] < '0' || t[0] > '9')
+ {
+ ret += t.substr(0, 1);
+ t = t.substr(1);
+ }
+ else
+ {
+ int gn = 0;
+ while (t.size() > 0 && t[0] >= '0' && t[0] <= '9')
+ {
+ gn = gn * 10 + (t[0] - '0');
+ t = t.substr(1);
+ }
+ ret += getGroup(gn);
+ }
+ }
+ else
+ {
+ ret += t.substr(0, 1);
+ t = t.substr(1);
+ }
+ }
+
+ return ret;
+}
+unsigned long Matcher::getFlags() const
+{
+ return flags;
+}
+std::string Matcher::getText() const
+{
+ return str;
+}
+
+bool Matcher::matches()
+{
+ flags = MATCH_ENTIRE_STRING;
+ matchedSomething = false;
+ clearGroups();
+ lm = 0;
+ return pat->head->match(str, this, 0) == (int)str.size();
+}
+bool Matcher::findFirstMatch()
+{
+ starts[0] = 0;
+ flags = 0;
+ clearGroups();
+ start = 0;
+ lm = 0;
+ ends[0] = pat->head->match(str, this, 0);
+ if (ends[0] >= 0)
+ {
+ matchedSomething = true;
+ return 1;
+ }
+ return 0;
+}
+bool Matcher::findNextMatch()
+{
+ int s = starts[0], e = ends[0];
+
+ if (!matchedSomething) return findFirstMatch();
+ if (s == e) ++e;
+ flags = 0;
+ clearGroups();
+
+ starts[0] = e;
+ if (e >= (int)str.size()) return 0;
+ start = e;
+ lm = e;
+ ends[0] = pat->head->match(str, this, e);
+ return ends[0] >= 0;
+}
+std::vector<std::string> Matcher::findAll()
+{
+ std::vector<std::string> ret;
+ reset();
+ while (findNextMatch())
+ {
+ ret.push_back(getGroup());
+ }
+ return ret;
+}
+
+void Matcher::reset()
+{
+ lm = 0;
+ clearGroups();
+ matchedSomething = false;
+}
+
+int Matcher::getStartingIndex(const int groupNum) const
+{
+ if (groupNum < 0 || groupNum >= gc) return -1;
+ return starts[groupNum];
+}
+int Matcher::getEndingIndex(const int groupNum) const
+{
+ if (groupNum < 0 || groupNum >= gc) return -1;
+ return ends[groupNum];
+}
+std::string Matcher::getGroup(const int groupNum) const
+{
+ if (groupNum < 0 || groupNum >= gc) return "";
+ if (starts[groupNum] < 0 || ends[groupNum] < 0) return "";
+ return str.substr(starts[groupNum], ends[groupNum] - starts[groupNum]);
+}
+std::vector<std::string> Matcher::getGroups(const bool includeGroupZero) const
+{
+ int i, start = (includeGroupZero ? 0 : 1);
+ std::vector<std::string> ret;
+
+ for (i = start; i < gc; ++i) ret.push_back(getGroup(i));
+ return ret;
+}
+
diff --git a/support/highlight/src/core/re/Matcher.h b/support/highlight/src/core/re/Matcher.h
new file mode 100644
index 0000000000..8affb5053f
--- /dev/null
+++ b/support/highlight/src/core/re/Matcher.h
@@ -0,0 +1,255 @@
+#ifndef __MATCHER_H__
+#define __MATCHER_H__
+
+#include <string>
+#include <vector>
+
+class Vector;
+class NFANode;
+class NFAStartNode;
+class NFAEndNode;
+class NFAGroupHeadNode;
+class NFAGroupLoopNode;
+class NFAGroupLoopPrologueNode;
+class NFAGroupTailNode;
+class NFALookBehindNode;
+class NFAStartOfLineNode;
+class NFAEndOfLineNode;
+class NFAEndOfMatchNode;
+class NFAReferenceNode;
+class Pattern;
+
+/**
+ A matcher is a non thread-safe object used to scan strings using a given
+ {@link Pattern Pattern} object. Using a <code>Matcher</code> is the preferred
+ method for scanning strings. Matchers are not thread-safe. Matchers require
+ very little dynamic memory, hence one is encouraged to create several
+ instances of a matcher when necessary as opposed to sharing a single instance
+ of a matcher.
+ <p>
+ The most common methods needed by the matcher are <code>matches</code>,
+ <code>findNextMatch</code>, and <code>getGroup</code>. <code>matches</code>
+ and <code>findNextMatch</code> both return success or failure, and further
+ details can be gathered from their documentation.
+ <p>
+ Unlike Java's <code>Matcher</code>, this class allows you to change the string
+ you are matching against. This provides a small optimization, since you no
+ longer need multiple matchers for a single pattern in a single thread.
+ <p>
+ This class also provides an extremely handy method for replacing text with
+ captured data via the <code>replaceWithGroups</code> method. A typical
+ invocation looks like:
+ <pre>
+ char buf[10000];
+ std::string str = "\\5 (user name \\1) uses \\7 for his/her shell and \\6 is their home directory";
+ FILE * fp = fopen("/etc/passwd", "r");
+ Pattern::registerPattern("entry", "[^:]+");
+ Pattern * p = Pattern::compile("^({entry}):({entry}):({entry}):({entry}):({entry}):({entry}):({entry})$",
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Pattern::MULTILINE_MATCHING | Pattern::UNIX_LINE_MODE);
+ Matcher * m = p->createMatcher("");
+ while (fgets(buf, 9999, fp))
+ {
+ &nbsp;&nbsp;m->setString(buf);
+ &nbsp;&nbsp;if (m->matches())
+ &nbsp;&nbsp;{
+ &nbsp;&nbsp;&nbsp;&nbsp;printf("%s\n", m->replaceWithGroups(str).c_str());
+ &nbsp;&nbsp;}
+ }
+ fclose(fp);
+
+ </pre>
+ Calling any of the following functions before first calling
+ <code>matches</code>, <code>findFirstMatch</code>, or
+ <code>findNextMatch</code> results in undefined behavior and may cause your
+ program to crash.
+ <code>
+ <ul>
+ <li>replaceWithGroups</code>
+ <li>getStartingIndex</li>
+ <li>getEndingIndex</li>
+ <li>getGroup</li>
+ <li>getGroups</li>
+ </ul>
+ </code>
+ <p>
+ The function <code>findFirstMatch</code> will attempt to find the first match
+ in the input string. The same results can be obtained by first calling
+ <code>reset</code> followed by <code>findNextMatch</code>.
+ <p>
+ To eliminate the necessity of looping through a string to find all the
+ matching substrings, <code>findAll</code> was created. The function will find
+ all matching substrings and return them in a <code>vector</code>. If you need
+ to examine specific capture groups within the substrings, then this method
+ should not be used.
+
+ @author Jeffery Stuart
+ @since March 2003, Stable Since November 2004
+ @version 1.04
+ @memo Mutable object used on instances of a Pattern class
+ */
+class Matcher
+{
+ friend class NFANode;
+ friend class NFAStartNode;
+ friend class NFAEndNode;
+ friend class NFAGroupHeadNode;
+ friend class NFAGroupLoopNode;
+ friend class NFAGroupLoopPrologueNode;
+ friend class NFAGroupTailNode;
+ friend class NFALookBehindNode;
+ friend class NFAStartOfLineNode;
+ friend class NFAEndOfLineNode;
+ friend class NFAEndOfMatchNode;
+ friend class NFAReferenceNode;
+ friend class Pattern;
+ private:
+ /**
+ Creates a new matcher object against <code>text</code> using
+ <code>pattern</code>.
+
+ @param pattern The pattern with which to search
+ @param text The text in which to search
+ */
+ Matcher(Pattern * pattern, const std::string & text);
+ protected:
+ /// The pattern we use to match
+ Pattern * pat;
+ /// The string in which we are matching
+ std::string str;
+ /// The starting point of our match
+ int start;
+ /// An array of the starting positions for each group
+ int * starts;
+ /// An array of the ending positions for each group
+ int * ends;
+ /// An array of private data used by NFANodes during matching
+ int * groups;
+ /// An array of private data used by NFANodes during matching
+ int * groupIndeces;
+ /// An array of private data used by NFANodes during matching
+ int * groupPos;
+ /// The ending index of the last match
+ int lm;
+ /// The number of capturing groups we have
+ int gc;
+ /// The number of non-capturing groups we havew
+ int ncgc;
+ /// Whether or not we have matched something (used only by findFirstMatch and findNextMatch)
+ int matchedSomething;
+ /// The flags with which we were made
+ unsigned long flags;
+ /// Called by reset to clear the group arrays
+ void clearGroups();
+ public:
+ /// Used internally by match to signify we want the entire string matched
+ const static int MATCH_ENTIRE_STRING;
+ public:
+ /// Cleans up the dynamic memory used by this matcher
+ ~Matcher();
+ /**
+ Replaces the contents of <code>str</code> with the appropriate captured
+ text. <code>str</code> should have at least one back reference, otherwise
+ this function does nothing.
+ @param str The string in which to replace text
+ @return A string with all backreferences appropriately replaced
+ */
+ std::string replaceWithGroups(const std::string & str);
+ /**
+ The flags currently being used by the matcher.
+ @return Zero
+ */
+ unsigned long getFlags() const;
+ /**
+ The text being searched by the matcher.
+ @return the text being searched by the matcher.
+ */
+ std::string getText() const;
+
+ /**
+ Scans the string from start to finish for a match. The entire string must
+ match for this function to return success. Group variables are
+ appropriately set and can be queried after this function returns.
+
+ @return Success if and only if the entire string matches the pattern
+ */
+ bool matches();
+ /**
+ Scans the string for the first substring matching the pattern. The entire
+ string does not necessarily have to match for this function to return
+ success. Group variables are appropriately set and can be queried after
+ this function returns.
+
+ @return Success if any substring matches the specified pattern
+ */
+ bool findFirstMatch();
+ /**
+ Scans the string for the next substring matching the pattern. If no calls
+ have been made to findFirstMatch of findNextMatch since the last call to
+ reset, matches, or setString, then this function's behavior results to
+ that of findFirstMatch.
+
+ @return Success if another substring can be found that matches the pattern
+ */
+ bool findNextMatch();
+ /**
+ Returns a vector of every substring in order which matches the given
+ pattern.
+
+ @return Every substring in order which matches the given pattern
+ */
+ std::vector<std::string> findAll();
+ /**
+ Resets the internal state of the matcher
+ */
+ void reset();
+ /**
+ Same as getText. Left n for backwards compatibilty with old source code
+ @return Returns the string that is currently being used for matching
+ */
+ inline std::string getString() const { return str; }
+ /**
+ Sets the string to scan
+ @param newStr The string to scan for subsequent matches
+ */
+ inline void setString(const std::string & newStr) { str = newStr; reset(); }
+
+ /**
+ Returns the starting index of the specified group.
+ @param groupNum The group to query
+ @return The starting index of the group if it was matched, -1 for an
+ invalid group or if the group was not matched
+ */
+ int getStartingIndex(const int groupNum = 0) const;
+ /**
+ Returns the ending index of the specified group.
+ @param groupNum The group to query
+ @return The ending index of the group if it was matched, -1 for an
+ invalid group or if the group was not matched
+ */
+ int getEndingIndex(const int groupNum = 0) const;
+ /**
+ Returns the specified group. An empty string ("") does not necessarily
+ mean the group was not matched. A group such as (a*b?) could be matched by
+ a zero length. If an empty string is returned, getStartingIndex can be
+ called to determine if the group was actually matched.
+ @param groupNum The group to query
+ @return The text of the group
+ */
+ std::string getGroup(const int groupNum = 0) const;
+ /**
+ Returns every capture group in a vector
+
+ @param includeGroupZero Whether or not include capture group zero
+ @return Every capture group
+ */
+ std::vector<std::string> getGroups(const bool includeGroupZero = 0) const;
+
+ /**
+ Number of captured groups
+ @return number of captured groups.
+ */
+ int getGroupNum() {return gc;}
+
+};
+
+#endif
diff --git a/support/highlight/src/core/re/Pattern.cpp b/support/highlight/src/core/re/Pattern.cpp
new file mode 100644
index 0000000000..b5fde13354
--- /dev/null
+++ b/support/highlight/src/core/re/Pattern.cpp
@@ -0,0 +1,1655 @@
+/**
+ From the author (Jeff Stuart)
+ "
+ Let me start by saying this file is pretty big. If you feel up to it, you can
+ try making changes yourself, but you would be better off to just email me at
+ stuart@cs.ucdavis.edu if you think there is a bug, or have something useful you
+ would like added. This project is very "near and dear" to me, so I am fairly
+ quick to make bug fixes. The header files for Pattern and Matcher are fairly
+ well documented and the function names are pretty self-explanatory, but if you
+ are having any trouble, feel free to email me at stuart@cs.ucdavis.edu.
+
+ If you email me, make sure you put something like C++RE in the subject because
+ I tend to delete email if I don't recognize the name and the subject is
+ something like "I Need Your Help" or "Got A Second" or "I Found It".
+ "
+ */
+
+/*
+ Detailed documentation is provided in this class' header file
+
+ @author Jeffery Stuart
+ @since November 2004
+ @version 1.05.02
+*/
+
+#include "Pattern.h"
+#include "Matcher.h"
+#include <cstring>
+#include <cstdio>
+#include <algorithm>
+#include <cctype>
+
+std::map<std::string, Pattern *> Pattern::compiledPatterns;
+std::map<std::string, std::pair<std::string, unsigned long> > Pattern::registeredPatterns;
+
+const int Pattern::MIN_QMATCH = 0x00000000;
+const int Pattern::MAX_QMATCH = 0x7FFFFFFF;
+
+const unsigned long Pattern::CASE_INSENSITIVE = 0x01;
+const unsigned long Pattern::LITERAL = 0x02;
+const unsigned long Pattern::DOT_MATCHES_ALL = 0x04;
+const unsigned long Pattern::MULTILINE_MATCHING = 0x08;
+const unsigned long Pattern::UNIX_LINE_MODE = 0x10;
+
+#ifdef _WIN32
+ #define str_icmp stricmp
+#else
+ #define str_icmp strcasecmp
+#endif
+
+Pattern::Pattern(const std::string & rhs)
+{
+ matcher = NULL;
+ pattern = rhs;
+ curInd = 0;
+ groupCount = 0;
+ nonCapGroupCount = 0;
+ error = 0;
+ head = NULL;
+}
+// convenience function in case we want to add any extra debugging output
+void Pattern::raiseError()
+{
+ switch (pattern[curInd - 1])
+ {
+ case '*':
+ case ')':
+ case '+':
+ case '?':
+ case ']':
+ case '}':
+ fprintf(stderr, "%s\n%*c^\n", pattern.c_str(), curInd - 1, ' ');
+ fprintf(stderr, "Syntax Error near here. Possible unescaped meta character.\n");
+ break;
+ default:
+ fprintf(stderr, "%s\n%*c^\n", pattern.c_str(), curInd - 1, ' ');
+ fprintf(stderr, "Syntax Error near here. \n");
+ break;
+ }
+ error = 1;
+}
+NFANode * Pattern::registerNode(NFANode * node)
+{
+ nodes[node] = 1;
+ return node;
+}
+
+std::string Pattern::classUnion (std::string s1, std::string s2) const
+{
+ char out[300];
+ std::sort(s1.begin(), s1.end());
+ std::sort(s2.begin(), s2.end());
+ *std::set_union(s1.begin(), s1.end(), s2.begin(), s2.end(), out) = 0;
+ return out;
+}
+std::string Pattern::classIntersect (std::string s1, std::string s2) const
+{
+ char out[300];
+ std::sort(s1.begin(), s1.end());
+ std::sort(s2.begin(), s2.end());
+ *std::set_intersection(s1.begin(), s1.end(), s2.begin(), s2.end(), out) = 0;
+ return out;
+}
+std::string Pattern::classNegate (std::string s1) const
+{
+ char out[300];
+ int i, ind = 0;
+ std::map<char, bool> m;
+
+ for (i = 0; i < (int)s1.size(); ++i) m[s1[i]] = 1;
+ for (i = 0xFF; i >= 0; --i) if (m.find((char)i) == m.end()) out[ind++] = (char)i;
+ out[ind] = 0;
+ return std::string(out, ind);
+}
+std::string Pattern::classCreateRange(char low, char hi) const
+{
+ char out[300];
+ int ind = 0;
+ while (low != hi) out[ind++] = low++;
+ out[ind++] = low;
+ return std::string(out, ind);
+}
+
+int Pattern::getInt(int start, int end)
+{
+ int ret = 0;
+ for (; start <= end; ++start) ret = ret * 10 + (pattern[start] - '0');
+ return ret;
+}
+bool Pattern::quantifyCurly(int & sNum, int & eNum)
+{
+ bool good = 1;
+ int i, ci = curInd + 1;
+ int commaInd = ci, endInd = ci, len = pattern.size();
+ sNum = eNum = 0;
+
+ while (endInd < len && pattern[endInd ] != '}') ++endInd;
+ while (commaInd < endInd && pattern[commaInd] != ',') ++commaInd;
+ if (endInd >= len) { raiseError(); return 0; }
+ for (i = ci; good && i < endInd; ++i) if (i != commaInd && !isdigit(pattern[i])) good = 0;
+ if (!good && commaInd < endInd) { raiseError(); return 0; }
+ if (!good) return 0;
+ /* so now everything in here is either a comma (and there is at most one comma) or a digit */
+ if (commaInd == ci) // {,*}
+ {
+ if (endInd == commaInd + 1) { sNum = MIN_QMATCH; eNum = MAX_QMATCH; } // {,} = *
+ else { sNum = MIN_QMATCH; eNum = getInt(commaInd + 1, endInd - 1); } // {,+}
+ }
+ else if (commaInd == endInd - 1) { sNum = getInt(ci, commaInd - 1); eNum = MAX_QMATCH; } // {+,}
+ else if (commaInd == endInd) { sNum = getInt(ci, endInd - 1); eNum = sNum; } // {+}
+ else { sNum = getInt(ci, commaInd - 1); eNum = getInt(commaInd + 1, endInd - 1); } // {+,+}
+ curInd = endInd + 1;
+ return 1;
+}
+NFANode * Pattern::quantifyGroup(NFANode * start, NFANode * stop, const int gn)
+{
+ NFANode * newNode = NULL;
+ int type = 0;
+
+ if (curInd < (int)pattern.size())
+ {
+ char ch = (curInd + 1 >= (int)pattern.size()) ? -1 : pattern[curInd + 1];
+ switch (pattern[curInd])
+ {
+ case '*':
+ ++curInd;
+ switch (ch)
+ {
+ case '?': ++curInd; type = 1; break;
+ case '+': ++curInd; type = 2; break;
+ }
+ newNode = registerNode(new NFAGroupLoopPrologueNode(gn));
+ newNode->next = registerNode(new NFAGroupLoopNode(start, MIN_QMATCH, MAX_QMATCH, gn, type));
+ stop->next = newNode->next;
+ return newNode;
+ case '?':
+ ++curInd;
+ switch (ch)
+ {
+ case '?': ++curInd; type = 1; break;
+ case '+': ++curInd; type = 2; break;
+ }
+ newNode = registerNode(new NFAGroupLoopPrologueNode(gn));
+ newNode->next = registerNode(new NFAGroupLoopNode(start, MIN_QMATCH, 1, gn, type));
+ stop->next = newNode->next;
+ return newNode;
+ case '+':
+ ++curInd;
+ switch (ch)
+ {
+ case '?': ++curInd; type = 1; break;
+ case '+': ++curInd; type = 2; break;
+ }
+ newNode = registerNode(new NFAGroupLoopPrologueNode(gn));
+ newNode->next = registerNode(new NFAGroupLoopNode(start, 1, MAX_QMATCH, gn, type));
+ stop->next = newNode->next;
+ return newNode;
+ case '{':
+ {
+ int s, e;
+ if (quantifyCurly(s, e))
+ {
+ ch = (curInd < (int)pattern.size()) ? pattern[curInd] : -1;
+ switch (ch)
+ {
+ case '?': ++curInd; type = 1; break;
+ case '+': ++curInd; type = 2; break;
+ }
+ newNode = registerNode(new NFAGroupLoopPrologueNode(gn));
+ newNode->next = registerNode(new NFAGroupLoopNode(start, s, e, gn, type));
+ stop->next = newNode->next;
+ return newNode;
+ }
+ }
+ default:
+ break;
+ }
+ }
+ return NULL;
+}
+
+NFANode * Pattern::quantify(NFANode * newNode)
+{
+ if (curInd < (int)pattern.size())
+ {
+ char ch = (curInd + 1 >= (int)pattern.size()) ? -1 : pattern[curInd + 1];
+ switch (pattern[curInd])
+ {
+ case '*':
+ ++curInd;
+ switch (ch)
+ {
+ case '?': ++curInd; newNode = registerNode(new NFALazyQuantifierNode (this, newNode, MIN_QMATCH, MAX_QMATCH)); break;
+ case '+': ++curInd; newNode = registerNode(new NFAPossessiveQuantifierNode(this, newNode, MIN_QMATCH, MAX_QMATCH)); break;
+ default: newNode = registerNode(new NFAGreedyQuantifierNode (this, newNode, MIN_QMATCH, MAX_QMATCH)); break;
+ }
+ break;
+ case '?':
+ ++curInd;
+ switch (ch)
+ {
+ case '?': ++curInd; newNode = registerNode(new NFALazyQuantifierNode (this, newNode, MIN_QMATCH, 1)); break;
+ case '+': ++curInd; newNode = registerNode(new NFAPossessiveQuantifierNode(this, newNode, MIN_QMATCH, 1)); break;
+ default: newNode = registerNode(new NFAGreedyQuantifierNode (this, newNode, MIN_QMATCH, 1)); break;
+ }
+ break;
+ case '+':
+ ++curInd;
+ switch (ch)
+ {
+ case '?': ++curInd; newNode = registerNode(new NFALazyQuantifierNode (this, newNode, 1, MAX_QMATCH)); break;
+ case '+': ++curInd; newNode = registerNode(new NFAPossessiveQuantifierNode(this, newNode, 1, MAX_QMATCH)); break;
+ default: newNode = registerNode(new NFAGreedyQuantifierNode (this, newNode, 1, MAX_QMATCH)); break;
+ }
+ break;
+ case '{':
+ {
+ int s, e;
+ if (quantifyCurly(s, e))
+ {
+ ch = (curInd < (int)pattern.size()) ? pattern[curInd] : -1;
+ switch (ch)
+ {
+ case '?': ++curInd; newNode = registerNode(new NFALazyQuantifierNode (this, newNode, s, e)); break;
+ case '+': ++curInd; newNode = registerNode(new NFAPossessiveQuantifierNode(this, newNode, s, e)); break;
+ default: newNode = registerNode(new NFAGreedyQuantifierNode (this, newNode, s, e)); break;
+ }
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ return newNode;
+}
+std::string Pattern::parseClass()
+{
+ std::string t, ret = "";
+ char ch, c1, c2;
+ bool inv = 0, neg = 0, quo = 0;
+
+ if (curInd < (int)pattern.size() && pattern[curInd] == '^')
+ {
+ ++curInd;
+ neg = 1;
+ }
+ while (curInd < (int)pattern.size() && pattern[curInd] != ']')
+ {
+ ch = pattern[curInd++];
+ if (ch == '[')
+ {
+ t = parseClass();
+ ret = classUnion(ret, t);
+ }
+ /*else if (ch == '-')
+ {
+ raiseError();
+ curInd = pattern.size();
+ }*/
+ else if (ch == '&' && curInd < (int)pattern.size() && pattern[curInd] == '&')
+ {
+ if (pattern[++curInd] != '[')
+ {
+ raiseError();
+ curInd = pattern.size();
+ }
+ else
+ {
+ ++curInd;
+ t = parseClass();
+ ret = classIntersect(ret, t);
+ }
+ }
+ else if (ch == '\\')
+ {
+ t = parseEscape(inv, quo);
+ if (quo)
+ {
+ raiseError();
+ curInd = pattern.size();
+ }
+ else if (inv || t.size() > 1) // cant be part of a range (a-z)
+ {
+ if (inv) t = classNegate(t);
+ ret = classUnion(ret, t);
+ }
+ else if (curInd < (int)pattern.size() && pattern[curInd] == '-') // part of a range (a-z)
+ {
+ c1 = t[0];
+ ++curInd;
+ if (curInd >= (int)pattern.size()) raiseError();
+ else
+ {
+ c2 = pattern[curInd++];
+ if (c2 == '\\')
+ {
+ t = parseEscape(inv, quo);
+ if (quo)
+ {
+ raiseError();
+ curInd = pattern.size();
+ }
+ else if (inv || t.size() > 1) raiseError();
+ else ret = classUnion(ret, classCreateRange(c1, c2));
+ }
+ else if (c2 == '[' || c2 == ']' || c2 == '-' || c2 == '&')
+ {
+ raiseError();
+ curInd = pattern.size();
+ }
+ else ret = classUnion(ret, classCreateRange(c1, c2));
+ }
+ }
+ else
+ {
+ ret = classUnion(ret, t);
+ }
+ }
+ else if (curInd < (int)pattern.size() && pattern[curInd] == '-')
+ {
+ c1 = ch;
+ ++curInd;
+ if (curInd >= (int)pattern.size()) raiseError();
+ else
+ {
+ c2 = pattern[curInd++];
+ if (c2 == '\\')
+ {
+ t = parseEscape(inv, quo);
+ if (quo)
+ {
+ raiseError();
+ curInd = pattern.size();
+ }
+ else if (inv || t.size() > 1) raiseError();
+ else ret = classUnion(ret, classCreateRange(c1, c2));
+ }
+ else if (c2 == '[' || c2 == ']' || c2 == '-' || c2 == '&')
+ {
+ raiseError();
+ curInd = pattern.size();
+ }
+ else
+ {
+ ret = classUnion(ret, classCreateRange(c1, c2));
+ }
+ }
+ }
+ else
+ {
+ ret += " ";
+ ret[ret.size() - 1] = ch;
+ }
+ }
+ if (curInd >= (int)pattern.size() || pattern[curInd] != ']')
+ {
+ raiseError();
+ ret = "";
+ }
+ else
+ {
+ ++curInd;
+ if (neg) ret = classNegate(ret);
+ }
+ return ret;
+}
+std::string Pattern::parsePosix()
+{
+ std::string s7 = pattern.substr(curInd, 7);
+ if (s7 == "{Lower}") { curInd += 7; return "abcdefghijklmnopqrstuvwxyz"; }
+ if (s7 == "{Upper}") { curInd += 7; return "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; }
+ if (s7 == "{Alpha}") { curInd += 7; return "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; }
+ if (s7 == "{Digit}") { curInd += 7; return "0123456789"; }
+ if (s7 == "{Alnum}") { curInd += 7; return "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; }
+ if (s7 == "{Punct}") { curInd += 7; return "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"; }
+ if (s7 == "{Graph}") { curInd += 7; return "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"; }
+ if (s7 == "{Print}") { curInd += 7; return "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"; }
+ if (s7 == "{Blank}") { curInd += 7; return " \t"; }
+ if (s7 == "{Space}") { curInd += 7; return " \t\n\x0B\f\r"; }
+ if (s7 == "{Cntrl}")
+ {
+ int i;
+ std::string s = " ";
+
+ for (i = 0; i < 5; ++i) s += s;
+ s += " ";
+ for (i = 0; i <= 0x1F; ++i) s[i] = i;
+ s[0x20] = 0x7F;
+ curInd += 7;
+ return s;
+ }
+ if (s7 == "{ASCII}")
+ {
+ std::string s(0x80, ' ');
+ for (int i = 0; i < 0x80; ++i) s[i] = i;
+ curInd += 7;
+ return s;
+ }
+ if (pattern.substr(curInd, 8) == "{XDigit}") { curInd += 8; return "abcdefABCDEF0123456789"; }
+ raiseError();
+ return "";
+}
+NFANode * Pattern::parseBackref()
+{
+ #define is_dig(x) ((x) >= '0' && (x) <= '9')
+ #define to_int(x) ((x) - '0')
+ int ci = curInd;
+ int oldRef = 0, ref = 0;
+
+ while (ci < (int)pattern.size() && is_dig(pattern[ci]) && (ref < 10 || ref < groupCount))
+ {
+ oldRef = ref;
+ ref = ref * 10 + to_int(pattern[ci++]);
+ }
+ if (ci == (int)pattern.size())
+ {
+ oldRef = ref;
+ ++ci;
+ }
+ if (oldRef < 0 || ci <= curInd)
+ {
+ raiseError();
+ return registerNode(new NFAReferenceNode(-1));
+ }
+ curInd = ci;
+ return registerNode(new NFAReferenceNode(ref));
+
+ #undef is_dig
+ #undef to_int
+}
+std::string Pattern::parseOctal()
+{
+ #define islowoc(x) ((x) >= '0' && (x) <= '3')
+ #define isoc(x) ((x) >= '0' && (x) <= '7')
+ #define fromoc(x) ((x) - '0')
+ int ci = curInd;
+ char ch1 = (ci + 0 < (int)pattern.size()) ? pattern[ci + 0] : -1;
+ char ch2 = (ci + 1 < (int)pattern.size()) ? pattern[ci + 1] : -1;
+ char ch3 = (ci + 2 < (int)pattern.size()) ? pattern[ci + 2] : -1;
+ std::string s = " ";
+
+ if (islowoc(ch1) && isoc(ch2))
+ {
+ curInd += 2;
+ s[0] = fromoc(ch1) * 8 + fromoc(ch2);
+ if (isoc(ch3))
+ {
+ ++curInd;
+ s[0] = s[0] * 8 + fromoc(ch3);
+ }
+ }
+ else if (isoc(ch1) && isoc(ch2))
+ {
+ curInd += 2;
+ s[0] = fromoc(ch1) * 8 + fromoc(ch2);
+ }
+ else raiseError();
+
+ return s;
+ #undef islowoc
+ #undef isoc
+ #undef fromoc
+}
+std::string Pattern::parseHex()
+{
+ #define to_low(x) (((x) >= 'A' && (x) <= 'Z') ? ((x) - 'A' + 'a') : (x))
+ #define is_dig(x) ((x) >= '0' && (x) <= '9')
+ #define is_hex(x) (is_dig(x) || (to_low(x) >= 'a' && to_low(x) <= 'f'))
+ #define to_int(x) ((is_dig(x)) ? ((x) - '0') : (to_low(x) - 'a' + 10))
+
+ int ci = curInd;
+ char ch1 = (ci + 0 < (int)pattern.size()) ? pattern[ci + 0] : -1;
+ char ch2 = (ci + 1 < (int)pattern.size()) ? pattern[ci + 1] : -1;
+ std::string s = " ";
+
+ if (is_hex(ch1) && is_hex(ch2))
+ {
+ curInd += 2;
+ s[0] = (to_int(ch1) << 4 & 0xF0) | (to_int(ch2) & 0x0F);
+ }
+
+ return s;
+ #undef to_low
+ #undef is_dig
+ #undef is_hex
+ #undef to_int
+}
+std::string Pattern::parseEscape(bool & inv, bool & quo)
+{
+ char ch = pattern[curInd++];
+ std::string classes = "";
+
+ if (curInd > (int)pattern.size())
+ {
+ raiseError();
+ return NULL;
+ }
+
+ quo = 0;
+ inv = 0;
+ switch (ch)
+ {
+ case 'p': classes = parsePosix(); break;
+ case 'P': classes = "!!"; classes += parsePosix(); break;
+ case 'd': classes = "0123456789"; break;
+ case 'D': classes = "!!0123456789"; break;
+ case 's': classes = " \t\r\n\f"; break;
+ case 'S': classes = "!! \t\r\n\f"; break;
+ case 'w': classes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"; break;
+ case 'W': classes = "!!abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"; break;
+ case '0': classes = parseOctal(); break;
+ case 'x': classes = parseHex(); break;
+
+ case 'Q': quo = 1; break;
+ case 't': classes = "\t"; break;
+ case 'r': classes = "\r"; break;
+ case 'n': classes = "\n"; break;
+ case 'f': classes = "\f"; break;
+ case 'a': classes = "\a"; break;
+ case 'e': classes = "\r"; break;
+ default: classes = " "; classes[0] = ch; break;
+ }
+ if (classes.substr(0, 2) == "!!")
+ {
+ classes = classes.substr(2);
+ inv = 1;
+ }
+ return classes;
+}
+NFANode * Pattern::parseRegisteredPattern(NFANode ** end)
+{
+ int i, j;
+ std::string s;
+ NFANode * ret = NULL;
+ for (i = curInd; i < (int)pattern.size() && pattern[i] != '}'; ++i) { }
+ if (pattern[i] != '}') { raiseError(); return NULL; }
+ if (i == curInd + 1) { raiseError(); return NULL; } // {}
+ if (
+ !(
+ (pattern[curInd] >= 'a' && pattern[curInd] <= 'z') ||
+ (pattern[curInd] >= 'A' && pattern[curInd] <= 'Z') ||
+ (pattern[curInd] == '_')
+ )
+ )
+ {
+ raiseError();
+ return NULL;
+ }
+ for (j = curInd; !error && j < i; ++j)
+ {
+ if (
+ !(
+ (pattern[j] >= 'a' && pattern[j] <= 'z') ||
+ (pattern[j] >= 'A' && pattern[j] <= 'Z') ||
+ (pattern[j] >= '0' && pattern[j] <= '9') ||
+ (pattern[j] == '_')
+ )
+ )
+ {
+ raiseError();
+ return NULL;
+ }
+ }
+ s = pattern.substr(curInd, i - curInd);
+ if (registeredPatterns.find(s) == registeredPatterns.end()) raiseError();
+ else
+ {
+ unsigned long oflags = flags;
+ std::string op = pattern;
+ int ci = i + 1;
+
+ pattern = registeredPatterns[s].first;
+ curInd = 0;
+ flags = registeredPatterns[s].second;
+
+ --groupCount;
+ ret = parse(0, 0, end);
+
+ pattern = op;
+ curInd = ci;
+ flags = oflags;
+ }
+ if (error) { *end = ret = NULL; }
+ return ret;
+}
+
+// look behind should interpret everything as a literal (except \\) since the
+// pattern must have a concrete length
+NFANode * Pattern::parseBehind(const bool pos, NFANode ** end)
+{
+ std::string t = "";
+ while (curInd < (int)pattern.size() && pattern[curInd] != ')')
+ {
+ char ch = pattern[curInd++];
+ t += " ";
+ if (ch == '\\')
+ {
+ if (curInd + 1 >= (int)pattern.size())
+ {
+ raiseError();
+ return *end = registerNode(new NFACharNode(' '));
+ }
+ ch = pattern[curInd++];
+ }
+ t[t.size() - 1] = ch;
+ }
+ if (curInd >= (int)pattern.size() || pattern[curInd] != ')') raiseError();
+ else ++curInd;
+ return *end = registerNode(new NFALookBehindNode(t, pos));
+}
+NFANode * Pattern::parseQuote()
+{
+ bool done = 0;
+ std::string s = "";
+
+ while (!done)
+ {
+ if (curInd >= (int)pattern.size())
+ {
+ raiseError();
+ done = 1;
+ }
+ else if (pattern.substr(curInd, 2) == "\\E")
+ {
+ curInd += 2;
+ done = 1;
+ }
+ else if (pattern[curInd] == '\\')
+ {
+ s += " ";
+ s[s.size() - 1] = pattern[++curInd];
+ ++curInd;
+ }
+ else
+ {
+ s += " ";
+ s[s.size() - 1] = pattern[curInd++];
+ }
+ }
+ if ((flags & Pattern::CASE_INSENSITIVE) != 0) return registerNode(new NFACIQuoteNode(s));
+ return registerNode(new NFAQuoteNode(s));
+}
+NFANode * Pattern::parse(const bool inParen, const bool inOr, NFANode ** end)
+{
+ NFANode * start, * cur, * next = NULL;
+ std::string t;
+ int grc = groupCount++;
+ bool inv, quo;
+ bool ahead = 0, pos = 0, noncap = 0, indep = 0;
+
+ if (inParen)
+ {
+ if (pattern[curInd] == '?')
+ {
+ ++curInd;
+ --groupCount;
+ if (pattern[curInd] == ':') { noncap = 1; ++curInd; grc = --nonCapGroupCount; }
+ else if (pattern[curInd] == '=') { ++curInd; ahead = 1; pos = 1; }
+ else if (pattern[curInd] == '!') { ++curInd; ahead = 1; pos = 0; }
+ else if (pattern.substr(curInd, 2) == "<=") { curInd += 2; return parseBehind(1, end); }
+ else if (pattern.substr(curInd, 2) == "<!") { curInd += 2; return parseBehind(0, end); }
+ else if (pattern[curInd] == '>') { ++curInd; indep = 1; }
+ else { raiseError(); return NULL; }
+ if (noncap) cur = start = registerNode(new NFAGroupHeadNode(grc));
+ else cur = start = registerNode(new NFASubStartNode);
+ }
+ else cur = start = registerNode(new NFAGroupHeadNode(grc));
+ }
+ else cur = start = registerNode(new NFASubStartNode);
+ while (curInd < (int)pattern.size())
+ {
+ char ch = pattern[curInd++];
+
+ next = NULL;
+ if (error) return NULL;
+ switch (ch)
+ {
+ case '^':
+ if ((flags & Pattern::MULTILINE_MATCHING) != 0) next = registerNode(new NFAStartOfLineNode);
+ else next = registerNode(new NFAStartOfInputNode);
+ break;
+ case '$':
+ if ((flags & Pattern::MULTILINE_MATCHING) != 0) next = registerNode(new NFAEndOfLineNode);
+ else next = registerNode(new NFAEndOfInputNode(0));
+ break;
+ case '|':
+ --groupCount;
+ cur->next = registerNode(new NFAAcceptNode);
+ cur = start = registerNode(new NFAOrNode(start, parse(inParen, 1)));
+ break;
+ case '\\':
+ if (curInd < (int)pattern.size())
+ {
+ bool eoi = 0;
+ switch (pattern[curInd])
+ {
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': next = parseBackref(); break;
+ case 'A': ++curInd; next = registerNode(new NFAStartOfInputNode); break;
+ case 'B': ++curInd; next = registerNode(new NFAWordBoundaryNode(0)); break;
+ case 'b': ++curInd; next = registerNode(new NFAWordBoundaryNode(1)); break;
+ case 'G': ++curInd; next = registerNode(new NFAEndOfMatchNode); break;
+ case 'Z': eoi = 1;
+ case 'z': ++curInd; next = registerNode(new NFAEndOfInputNode(eoi)); break;
+ default:
+ t = parseEscape(inv, quo);
+ if (!quo)
+ {
+ if (t.size() > 1 || inv)
+ {
+ if ((flags & Pattern::CASE_INSENSITIVE) != 0) next = registerNode(new NFACIClassNode(t, inv));
+ else next = registerNode(new NFAClassNode(t, inv));
+ }
+ else
+ {
+ next = registerNode(new NFACharNode(t[0]));
+ }
+ }
+ else
+ {
+ next = parseQuote();
+ }
+ }
+ }
+ else raiseError();
+ break;
+ case '[':
+ if ((flags & Pattern::CASE_INSENSITIVE) == 0)
+ {
+ NFAClassNode * clazz = new NFAClassNode();
+ std::string s = parseClass();
+ for (int i = 0; i < (int)s.size(); ++i) clazz->vals[s[i]] = 1;
+ next = registerNode(clazz);
+ }
+ else
+ {
+ NFACIClassNode * clazz = new NFACIClassNode();
+ std::string s = parseClass();
+ for (int i = 0; i < (int)s.size(); ++i) clazz->vals[tolower(s[i])] = 1;
+ next = registerNode(clazz);
+ }
+ break;
+ case '.':
+ {
+ bool useN = 1, useR = 1;
+ NFAClassNode * clazz = new NFAClassNode(1);
+ if ((flags & Pattern::UNIX_LINE_MODE) != 0) useR = 0;
+ if ((flags & Pattern::DOT_MATCHES_ALL) != 0) useN = useR = 0;
+ if (useN) clazz->vals['\n'] = 1;
+ if (useR) clazz->vals['\r'] = 1;
+ next = registerNode(clazz);
+ }
+ break;
+ case '(':
+ {
+ NFANode * end, * t1, * t2;
+ t1 = parse(1, 0, &end);
+ if (!t1) raiseError();
+ else if (t1->isGroupHeadNode() && (t2 = quantifyGroup(t1, end, grc)) != NULL)
+ {
+ cur->next = t2;
+ cur = t2->next;
+ }
+ else
+ {
+ cur->next = t1;
+ cur = end;
+ }
+ }
+ break;
+ case ')':
+ if (!inParen) raiseError();
+ else if (inOr)
+ {
+ --curInd;
+ cur = cur->next = registerNode(new NFAAcceptNode);
+ return start;
+ }
+ else
+ {
+ if (ahead)
+ {
+ cur = cur->next = registerNode(new NFAAcceptNode);
+ return *end = registerNode(new NFALookAheadNode(start, pos));
+ }
+ else if (indep)
+ {
+ cur = cur->next = registerNode(new NFAAcceptNode);
+ return *end = registerNode(new NFAPossessiveQuantifierNode(this, start, 1, 1));
+ }
+ else // capping or noncapping, it doesnt matter
+ {
+ *end = cur = cur->next = registerNode(new NFAGroupTailNode(grc));
+ next = quantifyGroup(start, *end, grc);
+ if (next)
+ {
+ start = next;
+ *end = next->next;
+ }
+ return start;
+ }
+ }
+ break;
+ case '{': // registered pattern
+ cur->next = parseRegisteredPattern(&next);
+ if (cur->next) cur = next;
+ break;
+ case '*':
+ case '+':
+ case '?':
+ case '}':
+ case ']':
+ raiseError();
+ break;
+ default:
+ if ((flags & Pattern::CASE_INSENSITIVE) != 0) next = registerNode(new NFACICharNode(ch));
+ else next = registerNode(new NFACharNode(ch));
+ break;
+ }
+ if (next)
+ {
+ cur = cur->next = quantify(next);
+ }
+ }
+ if (inParen) raiseError();
+ else
+ {
+ if (inOr) cur = cur->next = registerNode(new NFAAcceptNode);
+ if (end) *end = cur;
+ }
+
+ if (error) return NULL;
+
+ return start;
+}
+
+Pattern * Pattern::compile(const std::string & pattern, const unsigned long mode)
+{
+ Pattern * p = new Pattern(pattern);
+ NFANode * end;
+
+ p->flags = mode;
+ if ((mode & Pattern::LITERAL) != 0)
+ {
+ p->head = p->registerNode(new NFAStartNode);
+ if ((mode & Pattern::CASE_INSENSITIVE) != 0) p->head->next = p->registerNode(new NFACIQuoteNode(pattern));
+ else p->head->next = p->registerNode(new NFAQuoteNode(pattern));
+ p->head->next->next = p->registerNode(new NFAEndNode);
+ }
+ else
+ {
+ p->head = p->parse(0, 0, &end);
+ if (!p->head)
+ {
+ delete p;
+ p = NULL;
+ }
+ else
+ {
+ if (!(p->head && p->head->isStartOfInputNode()))
+ {
+ NFANode * n = p->registerNode(new NFAStartNode);
+ n->next = p->head;
+ p->head = n;
+ }
+ end->next = p->registerNode(new NFAEndNode);
+ }
+ }
+ if (p != NULL)
+ {
+ p->matcher = new Matcher(p, "");
+ }
+
+ return p;
+}
+
+Pattern * Pattern::compileAndKeep(const std::string & pattern, const unsigned long mode)
+{
+ Pattern * ret = NULL;
+ std::map<std::string, Pattern*>::iterator it = compiledPatterns.find(pattern);
+
+ if (it != compiledPatterns.end())
+ {
+ ret = it->second;
+ }
+ else
+ {
+ ret = compile(pattern, mode);
+ compiledPatterns[pattern] = ret;
+ }
+
+ return ret;
+}
+std::string Pattern::replace(const std::string & pattern, const std::string & str,
+ const std::string & replacementText, const unsigned long mode)
+{
+ std::string ret;
+ Pattern * p = Pattern::compile(pattern, mode);
+ if (p)
+ {
+ ret = p->replace(str, replacementText);
+ delete p;
+ }
+ return ret;
+}
+
+std::vector<std::string> Pattern::split(const std::string & pattern, const std::string & str, const bool keepEmptys,
+ const unsigned long limit, const unsigned long mode)
+{
+ std::vector<std::string> ret;
+ Pattern * p = Pattern::compile(pattern, mode);
+ if (p)
+ {
+ ret = p->split(str, keepEmptys, limit);
+ delete p;
+ }
+ return ret;
+}
+
+std::vector<std::string> Pattern::findAll(const std::string & pattern, const std::string & str, const unsigned long mode)
+{
+ std::vector<std::string> ret;
+ Pattern * p = Pattern::compile(pattern, mode);
+ if (p)
+ {
+ ret = p->findAll(str);
+ delete p;
+ }
+ return ret;
+}
+
+bool Pattern::matches(const std::string & pattern, const std::string & str, const unsigned long mode)
+{
+ bool ret = 0;
+ Pattern * p = compile(pattern, mode);
+
+ if (p)
+ {
+ ret = p->matches(str);
+ delete p;
+ }
+
+ return ret;
+}
+
+bool Pattern::registerPattern(const std::string & name, const std::string & pattern, const unsigned long mode)
+{
+ Pattern * p = Pattern::compile(pattern, mode);
+ if (!p) return 0;
+ Pattern::registeredPatterns[name] = std::make_pair(pattern, mode);
+ delete p;
+ return 1;
+}
+
+void Pattern::unregisterPatterns()
+{
+ registeredPatterns.clear();
+}
+void Pattern::clearPatternCache()
+{
+ std::map<std::string, Pattern*>::iterator it;
+ for (it = compiledPatterns.begin(); it != compiledPatterns.end(); ++it)
+ {
+ delete it->second;
+ }
+ compiledPatterns.clear();
+}
+
+std::pair<std::string, int> Pattern::findNthMatch(const std::string & pattern, const std::string & str,
+ const int matchNum, const unsigned long mode)
+{
+ std::pair<std::string, int> ret;
+ Pattern * p = Pattern::compile(pattern, mode);
+
+ ret.second = -1;
+ if (p)
+ {
+ int i = -1;
+ p->matcher->setString(str);
+ while (i < matchNum && p->matcher->findNextMatch()) { ++i; }
+ if (i == matchNum && p->matcher->getStartingIndex() >= 0)
+ {
+ ret.first = p->matcher->getGroup(0);
+ ret.second = p->matcher->getStartingIndex();
+ }
+ delete p;
+ }
+
+ return ret;
+}
+
+Pattern::~Pattern()
+{
+ /*
+ nodes.clear();
+ if (head) head->findAllNodes(nodes);
+ */
+ if (matcher) delete matcher;
+ for (std::map<NFANode*, bool>::iterator it = nodes.begin(); it != nodes.end(); ++it)
+ {
+ delete it->first;
+ }
+}
+std::string Pattern::replace(const std::string & str, const std::string & replacementText)
+{
+ int li = 0;
+ std::string ret = "";
+
+ matcher->setString(str);
+ while (matcher->findNextMatch())
+ {
+ ret += str.substr(li, matcher->getStartingIndex() - li);
+ ret += matcher->replaceWithGroups(replacementText);
+ li = matcher->getEndingIndex();
+ }
+ ret += str.substr(li);
+
+ return ret;
+}
+std::vector<std::string> Pattern::split(const std::string & str, const bool keepEmptys, const unsigned long limit)
+{
+ unsigned long lim = (limit == 0 ? MAX_QMATCH : limit);
+ int li = 0;
+ std::vector<std::string> ret;
+
+ matcher->setString(str);
+
+ while (matcher->findNextMatch() && ret.size() < lim)
+ {
+ if (matcher->getStartingIndex() == 0 && keepEmptys) ret.push_back("");
+ if ((matcher->getStartingIndex() != matcher->getEndingIndex()) || keepEmptys)
+ {
+ ret.push_back(str.substr(li, matcher->getStartingIndex() - li));
+ li = matcher->getEndingIndex();
+ }
+ }
+ if (li != (int)str.size()) ret.push_back(str.substr(li));
+
+ return ret;
+}
+std::vector<std::string> Pattern::findAll(const std::string & str)
+{
+ matcher->setString(str);
+ return matcher->findAll();
+}
+bool Pattern::matches(const std::string & str)
+{
+ matcher->setString(str);
+ return matcher->matches();
+}
+unsigned long Pattern::getFlags() const
+{
+ return flags;
+}
+std::string Pattern::getPattern() const
+{
+ return pattern;
+}
+Matcher * Pattern::createMatcher(const std::string & str)
+{
+ return new Matcher(this, str);
+}
+
+// NFANode
+
+NFANode::NFANode() { next = NULL; }
+NFANode::~NFANode() { }
+void NFANode::findAllNodes(std::map<NFANode*, bool> & soFar)
+{
+ if (soFar.find(this) == soFar.end()) return;
+ soFar[this] = 1;
+ if (next) next->findAllNodes(soFar);
+}
+
+// NFACharNode
+
+NFACharNode::NFACharNode(const char c) { ch = c; }
+int NFACharNode::match(const std::string & str, Matcher * matcher, const int curInd) const
+{
+ if (curInd < (int)str.size() && str[curInd] == ch) return next->match(str, matcher, curInd + 1);
+ return -1;
+}
+
+// NFACICharNode
+
+NFACICharNode::NFACICharNode(const char c) { ch = tolower(c); }
+int NFACICharNode::match(const std::string & str, Matcher * matcher, const int curInd) const
+{
+ if (curInd < (int)str.size() && tolower(str[curInd]) == ch) return next->match(str, matcher, curInd + 1);
+ return -1;
+}
+
+// NFAStartNode
+
+NFAStartNode::NFAStartNode() { }
+int NFAStartNode::match(const std::string & str, Matcher * matcher, const int curInd) const
+{
+ int ret = -1, ci = curInd;
+
+ matcher->starts[0] = curInd;
+ if ((matcher->getFlags() & Matcher::MATCH_ENTIRE_STRING) == (unsigned int)Matcher::MATCH_ENTIRE_STRING)
+ {
+ if (curInd != 0)
+ {
+ matcher->starts[0] = -1;
+ return -1;
+ }
+ return next->match(str, matcher, 0);
+ }
+ while ((ret = next->match(str, matcher, ci)) == -1 && ci < (int)str.size())
+ {
+ matcher->clearGroups();
+ matcher->starts[0] = ++ci;
+ }
+ if (ret < 0) matcher->starts[0] = -1;
+ return ret;
+}
+
+// NFAEndNode
+
+NFAEndNode::NFAEndNode() { }
+int NFAEndNode::match(const std::string & str, Matcher * matcher, const int curInd) const
+{
+ matcher->ends[0] = curInd;
+ if ((matcher->getFlags() & Matcher::MATCH_ENTIRE_STRING) != 0)
+ {
+ if (curInd == (int)str.size()) return curInd;
+ matcher->ends[0] = -1;
+ return -1;
+ }
+ return curInd;
+}
+
+// NFAQuantifierNode
+
+void NFAQuantifierNode::findAllNodes(std::map<NFANode*, bool> & soFar)
+{
+ inner->findAllNodes(soFar);
+ NFANode::findAllNodes(soFar);
+}
+NFAQuantifierNode::NFAQuantifierNode(Pattern * pat, NFANode * internal, const int minMatch, const int maxMatch)
+{
+ inner = internal;
+ inner->next = pat->registerNode(new NFAAcceptNode);
+ min = (minMatch < Pattern::MIN_QMATCH) ? Pattern::MIN_QMATCH : minMatch;
+ max = (maxMatch > Pattern::MAX_QMATCH) ? Pattern::MAX_QMATCH : maxMatch;
+}
+
+int NFAQuantifierNode::match(const std::string & str, Matcher * matcher, const int curInd) const
+{
+ int i0, i1, i2 = 0;
+
+ i0 = i1 = curInd;
+ while (i2 < min)
+ {
+
+ ++i2;
+ i1 = inner->match(str, matcher, i0);
+ if (i1 <= i0) return i1; // i1 < i0 means i1 is -1
+ i0 = i1;
+ }
+
+ return i1;
+}
+// NFAGreedyQuantifierNode
+
+NFAGreedyQuantifierNode::NFAGreedyQuantifierNode(Pattern * pat, NFANode * internal, const int minMatch, const int maxMatch)
+ : NFAQuantifierNode(pat, internal, minMatch, maxMatch) { }
+int NFAGreedyQuantifierNode::match(const std::string & str, Matcher * matcher, const int curInd) const
+{
+ int t = NFAQuantifierNode::match(str, matcher, curInd);
+ if (t != -1) return matchInternal(str, matcher, t, min);
+ return t;
+}
+int NFAGreedyQuantifierNode::matchInternal(const std::string & str, Matcher * matcher, const int curInd, const int soFar) const
+{
+ if (soFar >= max) return next->match(str, matcher, curInd);
+
+ int i, j;
+
+ i = inner->match(str, matcher, curInd);
+ if (i != -1)
+ {
+ j = matchInternal(str, matcher, i, soFar + 1);
+ if (j != -1) return j;
+ }
+ return next->match(str, matcher, curInd);
+}
+
+// NFALazyQuantifierNode
+
+NFALazyQuantifierNode::NFALazyQuantifierNode(Pattern * pat, NFANode * internal, const int minMatch, const int maxMatch)
+ : NFAQuantifierNode(pat, internal, minMatch, maxMatch) { }
+int NFALazyQuantifierNode::match(const std::string & str, Matcher * matcher, const int curInd) const
+{
+ int i, j, m = NFAQuantifierNode::match(str, matcher, curInd);
+
+ if (m == -1) return -1;
+
+ for (i = min; i < max; ++i)
+ {
+ j = next->match(str, matcher, m);
+ if (j == -1)
+ {
+ j = inner->match(str, matcher, m);
+ // if j < m, then j is -1, so we bail.
+ // if j == m, then we would just go and call next->match on the same index,
+ // but it already failed trying to match right there, so we know we can
+ // just bail
+ if (j <= m) return -1;
+ m = j;
+ }
+ else return j;
+ }
+ return next->match(str, matcher, m);
+}
+
+// NFAPossessiveQuantifierNode
+
+NFAPossessiveQuantifierNode::NFAPossessiveQuantifierNode(Pattern * pat, NFANode * internal, const int minMatch, const int maxMatch)
+ : NFAQuantifierNode(pat, internal, minMatch, maxMatch) { }
+int NFAPossessiveQuantifierNode::match(const std::string & str, Matcher * matcher, const int curInd) const
+{
+ int i, j, m = NFAQuantifierNode::match(str, matcher, curInd);
+
+ if (m == -1) return -1;
+ for (i = min; i < max; ++i)
+ {
+ j = inner->match(str, matcher, m);
+ if (j <= m) return next->match(str, matcher, m);
+ m = j;
+ }
+ return next->match(str, matcher, m);
+}
+
+// NFAAcceptNode
+
+NFAAcceptNode::NFAAcceptNode() { }
+int NFAAcceptNode::match(const std::string & str, Matcher * matcher, const int curInd) const
+{
+ if (!next) return curInd;
+ else return next->match(str, matcher, curInd);
+}
+
+// NFAClassNode
+
+NFAClassNode::NFAClassNode(const bool invert)
+{
+ inv = invert;
+}
+NFAClassNode::NFAClassNode(const std::string & clazz, const bool invert)
+{
+ inv = invert;
+ for (int i = 0; i < (int)clazz.size(); ++i) vals[clazz[i]] = 1;
+}
+int NFAClassNode::match(const std::string & str, Matcher * matcher, const int curInd) const
+{
+ if (curInd < (int)str.size() && ((vals.find(str[curInd]) != vals.end()) ^ inv))
+ {
+ return next->match(str, matcher, curInd + 1);
+ }
+ return -1;
+}
+
+// NFACIClassNode
+
+NFACIClassNode::NFACIClassNode(const bool invert)
+{
+ inv = invert;
+}
+NFACIClassNode::NFACIClassNode(const std::string & clazz, const bool invert)
+{
+ inv = invert;
+ for (int i = 0; i < (int)clazz.size(); ++i) vals[tolower(clazz[i])] = 1;
+}
+int NFACIClassNode::match(const std::string & str, Matcher * matcher, const int curInd) const
+{
+ if (curInd < (int)str.size() && ((vals.find(tolower(str[curInd])) != vals.end()) ^ inv))
+ {
+ return next->match(str, matcher, curInd + 1);
+ }
+ return -1;
+}
+
+#undef to_lower
+
+// NFASubStartNode
+
+NFASubStartNode::NFASubStartNode() { }
+int NFASubStartNode::match(const std::string & str, Matcher * matcher, const int curInd) const
+{
+ return next->match(str, matcher, curInd);
+}
+
+// NFAOrNode
+
+NFAOrNode::NFAOrNode(NFANode * first, NFANode * second) : one(first), two(second) { }
+void NFAOrNode::findAllNodes(std::map<NFANode*, bool> & soFar)
+{
+ if (one) one->findAllNodes(soFar);
+ if (two) two->findAllNodes(soFar);
+ NFANode::findAllNodes(soFar);
+}
+int NFAOrNode::match(const std::string & str, Matcher * matcher, const int curInd) const
+{
+ int ci = one->match(str, matcher, curInd);
+
+ if (ci != -1) ci = next->match(str, matcher, ci);
+ if (ci != -1) return ci;
+ if (ci == -1) ci = two->match(str, matcher, curInd);
+ if (ci != -1) ci = next->match(str, matcher, ci);
+ return ci;
+}
+
+// NFAQuoteNode
+
+NFAQuoteNode::NFAQuoteNode(const std::string & quoted) : qStr(quoted) { }
+int NFAQuoteNode::match(const std::string & str, Matcher * matcher, const int curInd) const
+{
+ if (curInd + qStr.size() > str.size()) return -1;
+ if (str.substr(curInd, qStr.size()) != qStr) return -1;
+ return next->match(str, matcher, curInd + qStr.size());
+}
+
+// NFACIQuoteNode
+
+NFACIQuoteNode::NFACIQuoteNode(const std::string & quoted) : qStr(quoted) { }
+int NFACIQuoteNode::match(const std::string & str, Matcher * matcher, const int curInd) const
+{
+ if (curInd + qStr.size() > str.size()) return -1;
+ if (str_icmp(str.substr(curInd, qStr.size()).c_str(), qStr.c_str())) return -1;
+ return next->match(str, matcher, qStr.size());
+}
+
+// NFALookAheadNode
+
+NFALookAheadNode::NFALookAheadNode(NFANode * internal, const bool positive) : NFANode(), pos(positive), inner(internal) { }
+void NFALookAheadNode::findAllNodes(std::map<NFANode*, bool> & soFar)
+{
+ if (inner) inner->findAllNodes(soFar);
+ NFANode::findAllNodes(soFar);
+}
+int NFALookAheadNode::match(const std::string & str, Matcher * matcher, const int curInd) const
+{
+ return ((inner->match(str, matcher, curInd) == -1) ^ pos) ? next->match(str, matcher, curInd) : -1;
+}
+
+// NFALookBehindNode
+
+NFALookBehindNode::NFALookBehindNode(const std::string & str, const bool positive) : pos(positive), mStr(str) { }
+int NFALookBehindNode::match(const std::string & str, Matcher * matcher, const int curInd) const
+{
+ if (pos)
+ {
+ if (curInd < (int)mStr.size()) return -1;
+ if (str.substr(curInd - mStr.size(), mStr.size()) == mStr) return next->match(str, matcher, curInd);
+ }
+ else
+ {
+ if (curInd < (int)mStr.size()) return next->match(str, matcher, curInd);
+ if (str.substr(curInd - mStr.size(), mStr.size()) == mStr) return -1;
+ return next->match(str, matcher, curInd);
+ }
+ return -1;
+}
+
+// NFAStartOfLineNode
+
+NFAStartOfLineNode::NFAStartOfLineNode() { }
+int NFAStartOfLineNode::match(const std::string & str, Matcher * matcher, const int curInd) const
+{
+ if (curInd == 0 || str[curInd - 1] == '\n' || str[curInd - 1] == '\r')
+ {
+ return next->match(str, matcher, curInd);
+ }
+ return -1;
+}
+
+// NFAEndOfLineNode
+
+NFAEndOfLineNode::NFAEndOfLineNode() { }
+int NFAEndOfLineNode::match(const std::string & str, Matcher * matcher, const int curInd) const
+{
+ if (curInd >= (int)str.size() || str[curInd] == '\n' || str[curInd] == '\r')
+ {
+ return next->match(str, matcher, curInd);
+ }
+ return -1;
+}
+
+// NFAReferenceNode
+
+NFAReferenceNode::NFAReferenceNode(const int groupIndex) : gi(groupIndex) { }
+int NFAReferenceNode::match(const std::string & str, Matcher * matcher, const int curInd) const
+{
+ int len = matcher->ends[gi] - matcher->starts[gi];
+ int ni = -1;
+ if (gi < 1 || matcher->ends[gi] < matcher->starts[gi] || len == 0) ni = curInd;
+ else if (curInd + len > (int)str.size()) return -1;
+ else if (str.substr(curInd, len) != str.substr(matcher->starts[gi], len)) return -1;
+ else ni = curInd + len;
+
+ return next->match(str, matcher, ni);
+}
+
+// NFAStartOfInputNode
+
+NFAStartOfInputNode::NFAStartOfInputNode() { }
+int NFAStartOfInputNode::match(const std::string & str, Matcher * matcher, const int curInd) const
+{
+ if (curInd == 0) return next->match(str, matcher, curInd);
+ return -1;
+}
+
+// NFAEndOfInputNode
+
+NFAEndOfInputNode::NFAEndOfInputNode(const bool lookForTerm) : term(lookForTerm) { }
+int NFAEndOfInputNode::match(const std::string & str, Matcher * matcher, const int curInd) const
+{
+ int len = (int)str.size();
+ if (curInd == len) return next->match(str, matcher, curInd);
+ else if (term)
+ {
+ if (curInd == len - 1 && (str[curInd] == '\r' || str[curInd] == '\n'))
+ {
+ return next->match(str, matcher, curInd);
+ }
+ else if (curInd == len - 2 && str.substr(curInd, 2) == "\r\n")
+ {
+ return next->match(str, matcher, curInd);
+ }
+ }
+ return -1;
+}
+
+// NFAWordBoundaryNode
+
+NFAWordBoundaryNode::NFAWordBoundaryNode(const bool positive) : pos(positive) { }
+int NFAWordBoundaryNode::match(const std::string & str, Matcher * matcher, const int curInd) const
+{
+ #define is_alpha(x) (((x) >= 'a' && (x) <= 'z') || ((x) >= 'A' && (x) <= 'Z'))
+
+ int len = (int)str.size();
+ bool ok = 0;
+ char c1 = (curInd - 1 < len) ? str[curInd - 1] : -1;
+ char c2 = (curInd < len) ? str[curInd ] : -1;
+
+ if (curInd == len) return next->match(str, matcher, curInd);
+ if (is_alpha(c1) ^ is_alpha(c2)) ok = 1;
+ if (ok && pos) return next->match(str, matcher, curInd);
+ return -1;
+
+ #undef is_alpha
+}
+
+// NFAEndOfMatchNode
+
+NFAEndOfMatchNode::NFAEndOfMatchNode() { }
+int NFAEndOfMatchNode::match(const std::string & str, Matcher * matcher, const int curInd) const
+{
+ if (curInd == matcher->lm) return next->match(str, matcher, curInd);
+ return -1;
+}
+
+// NFAGroupHeadNode
+
+NFAGroupHeadNode::NFAGroupHeadNode(const int groupIndex) : gi(groupIndex) { }
+int NFAGroupHeadNode::match(const std::string & str, Matcher * matcher, const int curInd) const
+{
+ int ret, o = matcher->starts[gi];
+
+ matcher->starts[gi] = curInd;
+ ret = next->match(str, matcher, curInd);
+ if (ret < 0) matcher->starts[gi] = o;
+
+ return ret;
+}
+
+// NFAGroupTailNode
+
+NFAGroupTailNode::NFAGroupTailNode(const int groupIndex) : gi(groupIndex) { }
+int NFAGroupTailNode::match(const std::string & str, Matcher * matcher, const int curInd) const
+{
+ int ret, o = matcher->ends[gi];
+
+ matcher->ends[gi] = curInd;
+ ret = next->match(str, matcher, curInd);
+ if (ret < 0) matcher->ends[gi] = o;
+
+ return ret;
+}
+
+// NFAGroupLoopPrologueNode
+
+NFAGroupLoopPrologueNode::NFAGroupLoopPrologueNode(const int groupIndex) : gi(groupIndex) { }
+int NFAGroupLoopPrologueNode::match(const std::string & str, Matcher * matcher, const int curInd) const
+{
+ int ret, o1 = matcher->groups[gi], o2 = matcher->groupPos[gi], o3 = matcher->groupIndeces[gi];
+
+ matcher->groups[gi] = 0;
+ matcher->groupPos[gi] = 0;
+ matcher->groupIndeces[gi] = -1;
+ ret = next->match(str, matcher, curInd);
+ if (ret < 0)
+ {
+ matcher->groups[gi] = o1;
+ matcher->groupPos[gi] = o2;
+ matcher->groupIndeces[gi] = o3;
+ }
+
+ return ret;
+}
+
+// NFAGroupLoopNode
+
+NFAGroupLoopNode::NFAGroupLoopNode(NFANode * internal, const int minMatch, const int maxMatch,
+ const int groupIndex, const int matchType)
+{
+ inner = internal;
+ min = minMatch;
+ max = maxMatch;
+ gi = groupIndex;
+ type = matchType;
+}
+void NFAGroupLoopNode::findAllNodes(std::map<NFANode*, bool> & soFar)
+{
+ if (inner) inner->findAllNodes(soFar);
+ NFANode::findAllNodes(soFar);
+}
+int NFAGroupLoopNode::match(const std::string & str, Matcher * matcher, const int curInd) const
+{
+ bool b = (curInd > matcher->groupIndeces[gi]);
+
+ if (b && matcher->groups[gi] < min)
+ {
+ ++matcher->groups[gi];
+ int o = matcher->groupIndeces[gi];
+ matcher->groupIndeces[gi] = curInd;
+ int ret = inner->match(str, matcher, curInd);
+ if (ret < 0)
+ {
+ matcher->groupIndeces[gi] = o;
+ --matcher->groups[gi];
+ }
+ return ret;
+ }
+ else if (!b || matcher->groups[gi] >= max)
+ {
+ return next->match(str, matcher, curInd);
+ }
+ else
+ {
+ switch (type)
+ {
+ case 0: return matchGreedy(str, matcher, curInd);
+ case 1: return matchLazy(str, matcher, curInd);
+ case 2: return matchPossessive(str, matcher, curInd);
+ }
+ }
+ return -1;
+}
+int NFAGroupLoopNode::matchGreedy(const std::string & str, Matcher * matcher, const int curInd) const
+{
+ int o = matcher->groupIndeces[gi]; // save our info for backtracking
+ matcher->groupIndeces[gi] = curInd; // move along
+ ++matcher->groups[gi];
+ int ret = inner->match(str, matcher, curInd); // match internally
+ if (ret < 0)
+ { // if we failed, then restore info and match next
+ --matcher->groups[gi];
+ matcher->groupIndeces[gi] = o;
+ ret = next->match(str, matcher, curInd);
+ }
+ return ret;
+}
+int NFAGroupLoopNode::matchLazy(const std::string & str, Matcher * matcher, const int curInd) const
+{
+ int ret = next->match(str, matcher, curInd); // be lazy, just go on
+ if (ret < 0)
+ {
+ int o = matcher->groupIndeces[gi]; // save info for backtracking
+ matcher->groupIndeces[gi] = curInd; // advance our position
+ ++matcher->groups[gi];
+ ret = inner->match(str, matcher, curInd); // match our internal stuff
+ if (ret < 0) // if we failed, then restore the info
+ {
+ --matcher->groups[gi];
+ matcher->groupIndeces[gi] = o;
+ }
+ }
+ return ret;
+}
+int NFAGroupLoopNode::matchPossessive(const std::string & str, Matcher * matcher, const int curInd) const
+{
+ int o = matcher->groupIndeces[gi]; // save info for backtracking
+ matcher->groupPos[gi] = matcher->groups[gi]; // set a flag stating we have matcher at least this much
+ matcher->groupIndeces[gi] = curInd; // move along
+ ++matcher->groups[gi];
+ int ret = inner->match(str, matcher, curInd); // try and match again
+ if (ret < 0)
+ { // if we fail, back off, but to an extent
+ --matcher->groups[gi];
+ matcher->groupIndeces[gi] = o;
+ if (matcher->groups[gi] == matcher->groupPos[gi]) ret = next->match(str, matcher, curInd);
+ }
+ return ret;
+}
diff --git a/support/highlight/src/core/re/Pattern.h b/support/highlight/src/core/re/Pattern.h
new file mode 100644
index 0000000000..a88974194c
--- /dev/null
+++ b/support/highlight/src/core/re/Pattern.h
@@ -0,0 +1,1658 @@
+#ifndef __PATTERN_H__
+#define __PATTERN_H__
+
+#include <vector>
+#include <string>
+#include <map>
+
+class Matcher;
+class NFANode;
+class NFAQuantifierNode;
+
+/**
+ This pattern class is very similar in functionality to Java's
+ java.util.regex.Pattern class. The pattern class represents an immutable
+ regular expression object. Instead of having a single object contain both the
+ regular expression object and the matching object, instead the two objects are
+ split apart. The {@link Matcher Matcher} class represents the maching
+ object.
+
+ The Pattern class works primarily off of "compiled" patterns. A typical
+ instantiation of a regular expression looks like:
+
+ <pre>
+ Pattern * p = Pattern::compile("a*b");
+ Matcher * m = p->createMatcher("aaaaaab");
+ if (m->matches()) ...
+ </pre>
+
+ However, if you do not need to use a pattern more than once, it is often times
+ okay to use the Pattern's static methods insteads. An example looks like this:
+
+ <pre>
+ if (Pattern::matches("a*b", "aaaab")) { ... }
+ </pre>
+
+ This class does not currently support unicode. The unicode update for this
+ class is coming soon.
+
+ This class is partially immutable. It is completely safe to call createMatcher
+ concurrently in different threads, but the other functions (e.g. split) should
+ not be called concurrently on the same <code>Pattern</code>.
+
+ <table border="0" cellpadding="1" cellspacing="0">
+ <tr align="left" bgcolor="#CCCCFF">
+ <td>
+ <b>Construct</b>
+ </td>
+ <td>
+ <b>Matches</b>
+ </th>
+ </tr>
+ <tr>
+ <td colspan="2">
+ &nbsp;
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <b>Characters</b>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code><i>x</i></code>
+ </td>
+ <td>
+ The character <code><i>x</i></code>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>\\</code>
+ </td>
+ <td>
+ The character <code>\</code>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>\0<i>nn</i></code>
+ </td>
+ <td>
+ The character with octal ASCII value <code><i>nn</i></code>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>\0<i>nnn</i></code>
+ </td>
+ <td>
+ The character with octal ASCII value <code><i>nnn</i></code>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>\x<i>hh</i></code>
+ </td>
+ <td>
+ The character with hexadecimal ASCII value <code><i>hh</i></code>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>\t</code>
+ </td>
+ <td>
+ A tab character
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>\r</code>
+ </td>
+ <td>
+ A carriage return character
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>\n</code>
+ </td>
+ <td>
+ A new-line character
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ &nbsp;
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>Character Classes</b>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>[abc]</code>
+ </td>
+ <td>
+ Either <code>a</code>, <code>b</code>, or <code>c</code>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>[^abc]</code>
+ </td>
+ <td>
+ Any character but <code>a</code>, <code>b</code>, or <code>c</code>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>[a-zA-Z]</code>
+ </td>
+ <td>
+ Any character ranging from <code>a</code> thru <code>z</code>, or
+ <code>A</code> thru <code>Z</code>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>[^a-zA-Z]</code>
+ </td>
+ <td>
+ Any character except those ranging from <code>a</code> thru
+ <code>z</code>, or <code>A</code> thru <code>Z</code>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>[a\-z]</code>
+ </td>
+ <td>
+ Either <code>a</code>, <code>-</code>, or <code>z</code>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>[a-z[A-Z]]</code>
+ </td>
+ <td>
+ Same as <code>[a-zA-Z]</code>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>[a-z&&[g-i]]</code>
+ </td>
+ <td>
+ Any character in the intersection of <code>a-z</code> and
+ <code>g-i</code>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>[a-z&&[^g-i]]</code>
+ </td>
+ <td>
+ Any character in <code>a-z</code> and not in <code>g-i</code>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ &nbsp;
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <b>Prefefined character classes</b>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code><b>.</b></code>
+ </td>
+ <td>
+ Any character. Multiline matching must be compiled into the pattern for
+ <code><b>.</b></code> to match a <code>\r</code> or a <code>\n</code>.
+ Even if multiline matching is enabled, <code><b>.</b></code> will not
+ match a <code>\r\n</code>, only a <code>\r</code> or a <code>\n</code>.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>\d</code>
+ </td>
+ <td>
+ <code>[0-9]</code>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>\D</code>
+ </td>
+ <td>
+ <code>[^\d]</code>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>\s</code>
+ </td>
+ <td>
+ <code>[&nbsp;\t\r\n\x0B]</code>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>\S</code>
+ </td>
+ <td>
+ <code>[^\s]</code>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>\w</code>
+ </td>
+ <td>
+ <code>[a-zA-Z0-9_]</code>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>\W</code>
+ </td>
+ <td>
+ <code>[^\w]</code>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ &nbsp;
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <b>POSIX character classes
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>\p{Lower}</code>
+ </td>
+ <td>
+ <code>[a-z]</code>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>\p{Upper}</code>
+ </td>
+ <td>
+ <code>[A-Z]</code>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>\p{ASCII}</code>
+ </td>
+ <td>
+ <code>[\x00-\x7F]</code>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>\p{Alpha}</code>
+ </td>
+ <td>
+ <code>[a-zA-Z]</code>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>\p{Digit}</code>
+ </td>
+ <td>
+ <code>[0-9]</code>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>\p{Alnum}</code>
+ </td>
+ <td>
+ <code>[\w&&[^_]]</code>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>\p{Punct}</code>
+ </td>
+ <td>
+ <code>[!"#$%&'()*+,-./:;&lt;=&gt;?@[\]^_`{|}~]</code>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>\p{XDigit}</code>
+ </td>
+ <td>
+ <code>[a-fA-F0-9]</code>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ &nbsp;
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <b>Boundary Matches</b>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>^</code>
+ </td>
+ <td>
+ The beginning of a line. Also matches the beginning of input.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>$</code>
+ </td>
+ <td>
+ The end of a line. Also matches the end of input.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>\b</code>
+ </td>
+ <td>
+ A word boundary
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>\B</code>
+ </td>
+ <td>
+ A non word boundary
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>\A</code>
+ </td>
+ <td>
+ The beginning of input
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>\G</code>
+ </td>
+ <td>
+ The end of the previous match. Ensures that a "next" match will only
+ happen if it begins with the character immediately following the end of
+ the "current" match.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>\Z</code>
+ </td>
+ <td>
+ The end of input. Will also match if there is a single trailing
+ <code>\r\n</code>, a single trailing <code>\r</code>, or a single
+ trailing <code>\n</code>.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>\z</code>
+ </td>
+ <td>
+ The end of input
+ </td>
+ </tr>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <b>Greedy Quantifiers</b>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code><i>x?</i></code>
+ </td>
+ <td>
+ <i>x</i>, either zero times or one time
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code><i>x*</i></code>
+ </td>
+ <td>
+ <i>x</i>, zero or more times
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code><i>x+</i></code>
+ </td>
+ <td>
+ <i>x</i>, one or more times
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code><i>x{n}</i></code>
+ </td>
+ <td>
+ <i>x</i>, exactly n times
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code><i>x{n,}</i></code>
+ </td>
+ <td>
+ <i>x</i>, at least <code><i>n</i></code> times
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code><i>x{,m}</i></code>
+ </td>
+ <td>
+ <i>x</i>, at most <code><i>m</i></code> times
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code><i>x{n,m}</i></code>
+ </td>
+ <td>
+ <i>x</i>, at least <code><i>n</i></code> times and at most
+ <code><i>m</i></code> times
+ </td>
+ </tr>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <b>Possessive Quantifiers</b>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code><i>x?+</i></code>
+ </td>
+ <td>
+ <i>x</i>, either zero times or one time
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code><i>x*+</i></code>
+ </td>
+ <td>
+ <i>x</i>, zero or more times
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code><i>x++</i></code>
+ </td>
+ <td>
+ <i>x</i>, one or more times
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code><i>x{n}+</i></code>
+ </td>
+ <td>
+ <i>x</i>, exactly n times
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code><i>x{n,}+</i></code>
+ </td>
+ <td>
+ <i>x</i>, at least <code><i>n</i></code> times
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code><i>x{,m}+</i></code>
+ </td>
+ <td>
+ <i>x</i>, at most <code><i>m</i></code> times
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code><i>x{n,m}+</i></code>
+ </td>
+ <td>
+ <i>x</i>, at least <code><i>n</i></code> times and at most
+ <code><i>m</i></code> times
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ &nbsp;
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <b>Reluctant Quantifiers</b>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code><i>x??</i></code>
+ </td>
+ <td>
+ <i>x</i>, either zero times or one time
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code><i>x*?</i></code>
+ </td>
+ <td>
+ <i>x</i>, zero or more times
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code><i>x+?</i></code>
+ </td>
+ <td>
+ <i>x</i>, one or more times
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code><i>x{n}?</i></code>
+ </td>
+ <td>
+ <i>x</i>, exactly n times
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code><i>x{n,}?</i></code>
+ </td>
+ <td>
+ <i>x</i>, at least <code><i>n</i></code> times
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code><i>x{,m}?</i></code>
+ </td>
+ <td>
+ <i>x</i>, at most <code><i>m</i></code> times
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code><i>x{n,m}?</i></code>
+ </td>
+ <td>
+ <i>x</i>, at least <code><i>n</i></code> times and at most
+ <code><i>m</i></code> times
+ </td>
+ </tr>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <b>Operators</b>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code><i>xy</i></code>
+ </td>
+ <td>
+ <code><i>x</i></code> then <code><i>y</i></code>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code><i>x</i></code>|<code><i>y</i></code>
+ </td>
+ <td>
+ <code><i>x</i></code> or <code><i>y</i></code>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>(<i>x</i>)</code>
+ </td>
+ <td>
+ <code><i>x</i></code> as a capturing group
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ &nbsp;
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <b>Quoting</b>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>\Q</code>
+ </td>
+ <td>
+ Nothing, but treat every character (including \s) literally until a
+ matching <code>\E</code>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>\E</code>
+ </td>
+ <td>
+ Nothing, but ends its matching <code>\Q</code>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <b>Special Constructs</b>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>(?:<i>x</i>)</code>
+ </td>
+ <td>
+ <code><i>x</i></code>, but not as a capturing group
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>(?=<i>x</i>)</code>
+ </td>
+ <td>
+ <code><i>x</i></code>, via positive lookahead. This means that the
+ expression will match only if it is trailed by <code><i>x</i></code>.
+ It will not "eat" any of the characters matched by
+ <code><i>x</i></code>.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>(?!<i>x</i>)</code>
+ </td>
+ <td>
+ <code><i>x</i></code>, via negative lookahead. This means that the
+ expression will match only if it is not trailed by
+ <code><i>x</i></code>. It will not "eat" any of the characters
+ matched by <code><i>x</i></code>.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>(?<=<i>x</i>)</code>
+ </td>
+ <td>
+ <code><i>x</i></code>, via positive lookbehind. <code><i>x</i></code>
+ cannot contain any quantifiers.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>(?<!<i>x</i>)</code>
+ </td>
+ <td>
+ <code><i>x</i></code>, via negative lookbehind. <code><i>x</i></code>
+ cannot contain any quantifiers.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>(?><i>x</i>)</code>
+ </td>
+ <td>
+ <code><i>x</i>{1}+</code>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ &nbsp;
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <b>Registered Expression Matching</b>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>{<i>x</i>}</code>
+ </td>
+ <td>
+ The registered pattern <code><i>x</i></code>
+ </td>
+ </tr>
+ </table>
+
+ <hr>
+
+ <i>Begin Text Extracted And Modified From java.util.regex.Pattern documentation</i>
+
+ <h4> Backslashes, escapes, and quoting </h4>
+
+ <p> The backslash character (<tt>'\'</tt>) serves to introduce escaped
+ constructs, as defined in the table above, as well as to quote characters
+ that otherwise would be interpreted as unescaped constructs. Thus the
+ expression <tt>\\</tt> matches a single backslash and <tt>\{</tt> matches a
+ left brace.
+
+ <p> It is an error to use a backslash prior to any alphabetic character that
+ does not denote an escaped construct; these are reserved for future
+ extensions to the regular-expression language. A backslash may be used
+ prior to a non-alphabetic character regardless of whether that character is
+ part of an unescaped construct.
+
+ <p>It is necessary to double backslashes in string literals that represent
+ regular expressions to protect them from interpretation by a compiler. The
+ string literal <tt>"&#92;b"</tt>, for example, matches a single backspace
+ character when interpreted as a regular expression, while
+ <tt>"&#92;&#92;b"</tt> matches a word boundary. The string litera
+ <tt>"&#92;(hello&#92;)"</tt> is illegal and leads to a compile-time error;
+ in order to match the string <tt>(hello)</tt> the string literal
+ <tt>"&#92;&#92;(hello&#92;&#92;)"</tt> must be used.
+
+ <h4> Character Classes </h4>
+
+ <p> Character classes may appear within other character classes, and
+ may be composed by the union operator (implicit) and the intersection
+ operator (<tt>&amp;&amp;</tt>).
+ The union operator denotes a class that contains every character that is
+ in at least one of its operand classes. The intersection operator
+ denotes a class that contains every character that is in both of its
+ operand classes.
+
+ <p> The precedence of character-class operators is as follows, from
+ highest to lowest:
+
+ <blockquote><table border="0" cellpadding="1" cellspacing="0"
+ summary="Precedence of character class operators.">
+
+ <tr><th>1&nbsp;&nbsp;&nbsp;&nbsp;</th>
+ <td>Literal escape&nbsp;&nbsp;&nbsp;&nbsp;</td>
+ <td><tt>\x</tt></td></tr>
+ <tr><th>2&nbsp;&nbsp;&nbsp;&nbsp;</th>
+ <td>Range</td>
+ <td><tt>a-z</tt></td></tr>
+ <tr><th>3&nbsp;&nbsp;&nbsp;&nbsp;</th>
+ <td>Grouping</td>
+ <td><tt>[...]</tt></td></tr>
+ <tr><th>4&nbsp;&nbsp;&nbsp;&nbsp;</th>
+ <td>Intersection</td>
+ <td><tt>[a-z&&[aeiou]]</tt></td></tr>
+ <tr><th>5&nbsp;&nbsp;&nbsp;&nbsp;</th>
+ <td>Union</td>
+ <td><tt>[a-e][i-u]<tt></td></tr>
+ </table></blockquote>
+
+ <p> Note that a different set of metacharacters are in effect inside
+ a character class than outside a character class. For instance, the
+ regular expression <tt>.</tt> loses its special meaning inside a
+ character class, while the expression <tt>-</tt> becomes a range
+ forming metacharacter.
+
+ <a name="lt">
+
+ <a name="cg">
+ <h4> Groups and capturing </h4>
+
+ <p> Capturing groups are numbered by counting their opening parentheses from
+ left to right. In the expression <tt>((A)(B(C)))</tt>, for example, there
+ are four such groups: </p>
+
+ <blockquote><table cellpadding=1 cellspacing=0 summary="Capturing group numberings">
+
+ <tr><th>1&nbsp;&nbsp;&nbsp;&nbsp;</th>
+ <td><tt>((A)(B(C)))</tt></td></tr>
+ <tr><th>2&nbsp;&nbsp;&nbsp;&nbsp;</th>
+ <td><tt>(A)</tt></td></tr>
+ <tr><th>3&nbsp;&nbsp;&nbsp;&nbsp;</th>
+ <td><tt>(B(C))</tt></td></tr>
+
+ <tr><th>4&nbsp;&nbsp;&nbsp;&nbsp;</th>
+ <td><tt>(C)</tt></td></tr>
+ </table></blockquote>
+
+ <p> Group zero always stands for the entire expression.
+
+ <p> Capturing groups are so named because, during a match, each subsequence
+ of the input sequence that matches such a group is saved. The captured
+ subsequence may be used later in the expression, via a back reference, and
+ may also be retrieved from the matcher once the match operation is complete.
+
+ <p> The captured input associated with a group is always the subsequence
+ that the group most recently matched. If a group is evaluated a second time
+ because of quantification then its previously-captured value, if any, will
+ be retained if the second evaluation fails. Matching the string
+ <tt>"aba"</tt> against the expression <tt>(a(b)?)+</tt>, for example, leaves
+ group two set to <tt>"b"</tt>. All captured input is discarded at the
+ beginning of each match.
+
+ <p> Groups beginning with <tt>(?</tt> are pure, <i>non-capturing</i> groups
+ that do not capture text and do not count towards the group total.
+
+
+ <h4> Unicode support </h4>
+
+ <p> Coming Soon.
+
+ <h4> Comparison to Perl 5 </h4>
+
+ <p>The <code>Pattern</code> engine performs traditional NFA-based matching
+ with ordered alternation as occurs in Perl 5.
+
+ <p> Perl constructs not supported by this class: </p>
+
+ <ul>
+
+ <li><p> The conditional constructs <tt>(?{</tt><i>X</i><tt>})</tt> and
+ <tt>(?(</tt><i>condition</i><tt>)</tt><i>X</i><tt>|</tt><i>Y</i><tt>)</tt>,
+ </p></li>
+
+ <li><p> The embedded code constructs <tt>(?{</tt><i>code</i><tt>})</tt>
+ and <tt>(??{</tt><i>code</i><tt>})</tt>,</p></li>
+
+ <li><p> The embedded comment syntax <tt>(?#comment)</tt>, and </p></li>
+
+ <li><p> The preprocessing operations <tt>\l</tt> <tt>&#92;u</tt>,
+ <tt>\L</tt>, and <tt>\U</tt>. </p></li>
+
+ <li><p> Embedded flags</p></li>
+
+ </ul>
+
+ <p> Constructs supported by this class but not by Perl: </p>
+
+ <ul>
+
+ <li><p> Possessive quantifiers, which greedily match as much as they can
+ and do not back off, even when doing so would allow the overall match to
+ succeed. </p></li>
+
+ <li><p> Character-class union and intersection as described
+ above.</p></li>
+
+ </ul>
+
+ <p> Notable differences from Perl: </p>
+
+ <ul>
+
+ <li><p> In Perl, <tt>\1</tt> through <tt>\9</tt> are always interpreted
+ as back references; a backslash-escaped number greater than <tt>9</tt> is
+ treated as a back reference if at least that many subexpressions exist,
+ otherwise it is interpreted, if possible, as an octal escape. In this
+ class octal escapes must always begin with a zero. In this class,
+ <tt>\1</tt> through <tt>\9</tt> are always interpreted as back
+ references, and a larger number is accepted as a back reference if at
+ least that many subexpressions exist at that point in the regular
+ expression, otherwise the parser will drop digits until the number is
+ smaller or equal to the existing number of groups or it is one digit.
+ </p></li>
+
+ <li><p> Perl uses the <tt>g</tt> flag to request a match that resumes
+ where the last match left off. This functionality is provided implicitly
+ by the <CODE>Matcher</CODE> class: Repeated invocations of the
+ <code>find</code> method will resume where the last match left off,
+ unless the matcher is reset. </p></li>
+
+ <li><p> Perl is forgiving about malformed matching constructs, as in the
+ expression <tt>*a</tt>, as well as dangling brackets, as in the
+ expression <tt>abc]</tt>, and treats them as literals. This
+ class also strict and will not compile a pattern when dangling characters
+ are encountered.</p></li>
+
+ </ul>
+
+
+ <p> For a more precise description of the behavior of regular expression
+ constructs, please see <a href="http://www.oreilly.com/catalog/regex2/">
+ <i>Mastering Regular Expressions, 2nd Edition</i>, Jeffrey E. F. Friedl,
+ O'Reilly and Associates, 2002.</a>
+ </p>
+ <P>
+
+ <i>End Text Extracted And Modified From java.util.regex.Pattern documentation</i>
+
+ <hr>
+
+ @author Jeffery Stuart
+ @since March 2003, Stable Since November 2004
+ @version 1.04
+ @memo A class used to represent "PERL 5"-ish regular expressions
+ */
+class Pattern
+{
+ friend class Matcher;
+ friend class NFANode;
+ friend class NFAQuantifierNode;
+ private:
+ /**
+ This constructor should not be called directly. Those wishing to use the
+ Pattern class should instead use the {@link compile compile} method.
+
+ @param rhs The pattern to compile
+ @memo Creates a new pattern from the regular expression in <code>rhs</code>.
+ */
+ Pattern(const std::string & rhs);
+ protected:
+ /**
+ This currently is not used, so don't try to do anything with it.
+ @memo Holds all the compiled patterns for quick access.
+ */
+ static std::map<std::string, Pattern *> compiledPatterns;
+ /**
+ Holds all of the registered patterns as strings. Due to certain problems
+ with compilation of patterns, especially with capturing groups, this seemed
+ to be the best way to do it.
+ */
+ static std::map<std::string, std::pair<std::string, unsigned long> > registeredPatterns;
+ protected:
+ /**
+ Holds all the NFA nodes used. This makes deletion of a pattern, as well as
+ clean-up from an unsuccessful compile much easier and faster.
+ */
+ std::map<NFANode*, bool> nodes;
+ /**
+ Used when methods like split are called. The matcher class uses a lot of
+ dynamic memeory, so having an instance increases speedup of certain
+ operations.
+ */
+ Matcher * matcher;
+ /**
+ The front node of the NFA.
+ */
+ NFANode * head;
+ /**
+ The actual regular expression we rerpesent
+ */
+ std::string pattern;
+ /**
+ Flag used during compilation. Once the pattern is successfully compiled,
+ <code>error</code> is no longer used.
+ */
+ bool error;
+ /**
+ Used during compilation to keep track of the current index into
+ <code>{@link pattern pattern}<code>. Once the pattern is successfully
+ compiled, <code>error</code> is no longer used.
+ */
+ int curInd;
+ /**
+ The number of capture groups this contains.
+ */
+ int groupCount;
+ /**
+ The number of non-capture groups this contains.
+ */
+ int nonCapGroupCount;
+ /**
+ The flags specified when this was compiled.
+ */
+ unsigned long flags;
+ protected:
+ /**
+ Raises an error during compilation. Compilation will cease at that point
+ and compile will return <code>NULL</code>.
+ */
+ void raiseError();
+ /**
+ Convenience function for registering a node in <code>nodes</code>.
+ @param node The node to register
+ @return The registered node
+ */
+ NFANode * registerNode(NFANode * node);
+
+ /**
+ Calculates the union of two strings. This function will first sort the
+ strings and then use a simple selection algorithm to find the union.
+ @param s1 The first "class" to union
+ @param s2 The second "class" to union
+ @return A new string containing all unique characters. Each character
+ must have appeared in one or both of <code>s1</code> and
+ <code>s2</code>.
+ */
+ std::string classUnion (std::string s1, std::string s2) const;
+ /**
+ Calculates the intersection of two strings. This function will first sort
+ the strings and then use a simple selection algorithm to find the
+ intersection.
+ @param s1 The first "class" to intersect
+ @param s2 The second "class" to intersect
+ @return A new string containing all unique characters. Each character
+ must have appeared both <code>s1</code> and <code>s2</code>.
+ */
+ std::string classIntersect (std::string s1, std::string s2) const;
+ /**
+ Calculates the negation of a string. The negation is the set of all
+ characters between <code>\x00</code> and <code>\xFF</code> not
+ contained in <code>s1</code>.
+ @param s1 The "class" to be negated.
+ @param s2 The second "class" to intersect
+ @return A new string containing all unique characters. Each character
+ must have appeared both <code>s1</code> and <code>s2</code>.
+ */
+ std::string classNegate (std::string s1) const;
+ /**
+ Creates a new "class" representing the range from <code>low</code> thru
+ <code>hi</code>. This function will wrap if <code>low</code> &gt;
+ <code>hi</code>. This is a feature, not a buf. Sometimes it is useful
+ to be able to say [\x70-\x10] instead of [\x70-\x7F\x00-\x10].
+ @param low The beginning character
+ @param hi The ending character
+ @return A new string containing all the characters from low thru hi.
+ */
+ std::string classCreateRange(char low, char hi) const;
+
+ /**
+ Extracts a decimal number from the substring of member-variable
+ <code>{@link pattern pattern}<code> starting at <code>start</code> and
+ ending at <code>end</code>.
+ @param start The starting index in <code>{@link pattern pattern}<code>
+ @param end The last index in <code>{@link pattern pattern}<code>
+ @return The decimal number in <code>{@link pattern pattern}<code>
+ */
+ int getInt(int start, int end);
+ /**
+ Parses a <code>{n,m}</code> string out of the member-variable
+ <code>{@link pattern pattern}<code> stores the result in <code>sNum</code>
+ and <code>eNum</code>.
+ @param sNum Output parameter. The minimum number of matches required
+ by the curly quantifier are stored here.
+ @param eNum Output parameter. The maximum number of matches allowed
+ by the curly quantifier are stored here.
+ @return Success/Failure. Fails when the curly does not have the proper
+ syntax
+ */
+ bool quantifyCurly(int & sNum, int & eNum);
+ /**
+ Tries to quantify the currently parsed group. If the group being parsed
+ is indeed quantified in the member-variable
+ <code>{@link pattern pattern}<code>, then the NFA is modified accordingly.
+ @param start The starting node of the current group being parsed
+ @param stop The ending node of the current group being parsed
+ @param gn The group number of the current group being parsed
+ @return The node representing the starting node of the group. If the
+ group becomes quantified, then this node is not necessarily
+ a GroupHead node.
+ */
+ NFANode * quantifyGroup(NFANode * start, NFANode * stop, const int gn);
+
+ /**
+ Tries to quantify the last parsed expression. If the character was indeed
+ quantified, then the NFA is modified accordingly.
+ @param newNode The recently created expression node
+ @return The node representing the last parsed expression. If the
+ expression was quantified, <code>return value != newNode</code>
+ */
+ NFANode * quantify(NFANode * newNode);
+ /**
+ Parses the current class being examined in
+ <code>{@link pattern pattern}</code>.
+ @return A string of unique characters contained in the current class being
+ parsed
+ */
+ std::string parseClass();
+ /**
+ Parses the current POSIX class being examined in
+ <code>{@link pattern pattern}</code>.
+ @return A string of unique characters representing the POSIX class being
+ parsed
+ */
+ std::string parsePosix();
+ /**
+ Returns a string containing the octal character being parsed
+ @return The string contained the octal value being parsed
+ */
+ std::string parseOctal();
+ /**
+ Returns a string containing the hex character being parsed
+ @return The string contained the hex value being parsed
+ */
+ std::string parseHex();
+ /**
+ Returns a new node representing the back reference being parsed
+ @return The new node representing the back reference being parsed
+ */
+ NFANode * parseBackref();
+ /**
+ Parses the escape sequence currently being examined. Determines if the
+ escape sequence is a class, a single character, or the beginning of a
+ quotation sequence.
+ @param inv Output parameter. Whether or not to invert the returned class
+ @param quo Output parameter. Whether or not this sequence starts a
+ quotation.
+ @return The characters represented by the class
+ */
+ std::string parseEscape(bool & inv, bool & quo);
+ /**
+ Parses a supposed registered pattern currently under compilation. If the
+ sequence of characters does point to a registered pattern, then the
+ registered pattern is appended to <code>*end<code>. The registered pattern
+ is parsed with the current compilation flags.
+ @param end The ending node of the thus-far compiled pattern
+ @return The new end node of the current pattern
+ */
+ NFANode * parseRegisteredPattern(NFANode ** end);
+ /**
+ Parses a lookbehind expression. Appends the necessary nodes
+ <code>*end</code>.
+ @param pos Positive or negative look behind
+ @param end The ending node of the current pattern
+ @return The new end node of the current pattern
+ */
+ NFANode * parseBehind(const bool pos, NFANode ** end);
+ /**
+ Parses the current expression and tacks on nodes until a \E is found.
+ @return The end of the current pattern
+ */
+ NFANode * parseQuote();
+ /**
+ Parses <code>{@link pattern pattern}</code>. This function is called
+ recursively when an or (<code>|</code>) or a group is encountered.
+ @param inParen Are we currently parsing inside a group
+ @param inOr Are we currently parsing one side of an or (<code>|</code>)
+ @param end The end of the current expression
+ @return The starting node of the NFA constructed from this parse
+ */
+ NFANode * parse(const bool inParen = 0, const bool inOr = 0, NFANode ** end = NULL);
+ public:
+ /// We should match regardless of case
+ const static unsigned long CASE_INSENSITIVE;
+ /// We are implicitly quoted
+ const static unsigned long LITERAL;
+ /// @memo We should treat a <code><b>.</b></code> as [\x00-\x7F]
+ const static unsigned long DOT_MATCHES_ALL;
+ /** <code>^</code> and <code>$</code> should anchor to the beginning and
+ ending of lines, not all input
+ */
+ const static unsigned long MULTILINE_MATCHING;
+ /** When enabled, only instances of <code>\n</codes> are recognized as
+ line terminators
+ */
+ const static unsigned long UNIX_LINE_MODE;
+ /// The absolute minimum number of matches a quantifier can match (0)
+ const static int MIN_QMATCH;
+ /// The absolute maximum number of matches a quantifier can match (0x7FFFFFFF)
+ const static int MAX_QMATCH;
+ public:
+ /**
+ Call this function to compile a regular expression into a
+ <code>Pattern</code> object. Special values can be assigned to
+ <code>mode</code> when certain non-standard behaviors are expected from
+ the <code>Pattern</code> object.
+ @param pattern The regular expression to compile
+ @param mode A bitwise or of flags signalling what special behaviors are
+ wanted from this <code>Pattern</code> object
+ @return If successful, <code>compile</code> returns a <code>Pattern</code>
+ pointer. Upon failure, <code>compile</code> returns
+ <code>NULL</code>
+ */
+ static Pattern * compile (const std::string & pattern,
+ const unsigned long mode = 0);
+ /**
+ Dont use this function. This function will compile a pattern, and cache
+ the result. This will eventually be used as an optimization when people
+ just want to call static methods using the same pattern over and over
+ instead of first compiling the pattern and then using the compiled
+ instance for matching.
+ @param pattern The regular expression to compile
+ @param mode A bitwise or of flags signalling what special behaviors are
+ wanted from this <code>Pattern</code> object
+ @return If successful, <code>compileAndKeep</code> returns a
+ <code>Pattern</code> pointer. Upon failure, <code>compile</code>
+ returns <code>NULL</code>.
+ */
+ static Pattern * compileAndKeep (const std::string & pattern,
+ const unsigned long mode = 0);
+
+ /**
+ Searches through <code>replace</code> and replaces all substrings matched
+ by <code>pattern</code> with <code>str</code>. <code>str</code> may
+ contain backreferences (e.g. <code>\1</code>) to capture groups. A typical
+ invocation looks like:
+ <p>
+ <code>
+ Pattern::replace("(a+)b(c+)", "abcccbbabcbabc", "\\2b\\1");
+ </code>
+ <p>
+ which would replace <code>abcccbbabcbabc</code> with
+ <code>cccbabbcbabcba</code>.
+ @param pattern The regular expression
+ @param str The replacement text
+ @param replacementText The string in which to perform replacements
+ @param mode The special mode requested of the <code>Pattern</code>
+ during the replacement process
+ @return The text with the replacement string substituted where necessary
+ */
+ static std::string replace (const std::string & pattern,
+ const std::string & str,
+ const std::string & replacementText,
+ const unsigned long mode = 0);
+
+ /**
+ Splits the specified string over occurrences of the specified pattern.
+ Empty strings can be optionally ignored. The number of strings returned is
+ configurable. A typical invocation looks like:
+ <p>
+ <code>
+ std::string str(strSize, '\0');<br>
+ FILE * fp = fopen(fileName, "r");<br>
+ fread((char*)str.data(), strSize, 1, fp);<br>
+ fclose(fp);<br>
+ <br>
+ std::vector&lt;std::string&gt; lines = Pattern::split("[\r\n]+", str, true);<br>
+ <br>
+ </code>
+
+ @param pattern The regular expression
+ @param replace The string to split
+ @param keepEmptys Whether or not to keep empty strings
+ @param limit The maximum number of splits to make
+ @param mode The special mode requested of the <code>Pattern</code>
+ during the split process
+ @return All substrings of <code>str</code> split across <code>pattern</code>.
+ */
+ static std::vector<std::string> split (const std::string & pattern,
+ const std::string & str,
+ const bool keepEmptys = 0,
+ const unsigned long limit = 0,
+ const unsigned long mode = 0);
+
+ /**
+ Finds all the instances of the specified pattern within the string. You
+ should be careful to only pass patterns with a minimum length of one. For
+ example, the pattern <code>a*</code> can be matched by an empty string, so
+ instead you should pass <code>a+</code> since at least one character must
+ be matched. A typical invocation of <code>findAll</code> looks like:
+ <p>
+ <code>
+ std::vector&lt;td::string&gt; numbers = Pattern::findAll("\\d+", string);
+ </code>
+ <p>
+
+ @param pattern The pattern for which to search
+ @param str The string to search
+ @param mode The special mode requested of the <code>Pattern</code>
+ during the find process
+ @return All instances of <code>pattern</code> in <code>str</code>
+ */
+ static std::vector<std::string> findAll (const std::string & pattern,
+ const std::string & str,
+ const unsigned long mode = 0);
+
+ /**
+ Determines if an entire string matches the specified pattern
+
+ @param pattern The pattern for to match
+ @param str The string to match
+ @param mode The special mode requested of the <code>Pattern</code>
+ during the replacement process
+ @return True if <code>str</code> is recognized by <code>pattern</code>
+ */
+ static bool matches (const std::string & pattern,
+ const std::string & str,
+ const unsigned long mode = 0);
+
+ /**
+ Registers a pattern under a specific name for use in later compilations.
+ A typical invocation and later use looks like:
+ <p>
+ <code>
+ Pattern::registerPattern("ip", "(?:\\d{1,3}\\.){3}\\d{1,3}");<br>
+ Pattern * p1 = Pattern::compile("{ip}:\\d+");<br>
+ Pattern * p2 = Pattern::compile("Connection from ({ip}) on port \\d+");<br>
+ </code>
+ <p>
+ Multiple calls to <code>registerPattern</code> with the same
+ <code>name</code> will result in the pattern getting overwritten.
+
+ @param name The name to give to the pattern
+ @param pattern The pattern to register
+ @param mode Any special flags to use when compiling pattern
+ @return Success/Failure. Fails only if <code>pattern</code> has invalid
+ syntax
+ */
+ static bool registerPattern(const std::string & name,
+ const std::string & pattern,
+ const unsigned long mode = 0);
+
+ /**
+ Clears the pattern registry
+ */
+ static void unregisterPatterns();
+ /**
+ Don't use
+ */
+ static void clearPatternCache();
+
+ /**
+ Searches through a string for the <code>n<sup>th</sup></code> match of the
+ given pattern in the string. Match indeces start at zero, not one.
+ A typical invocation looks like this:
+ <p>
+ <code>
+ std::pair&lt;std::string, int&gt; match = Pattern::findNthMatch("\\d{1,3}", "192.168.1.101:22", 1);<br>
+ printf("%s %i\n", match.first.c_str(), match.second);<br>
+ <br>
+ Output: 168 4<br>
+ <br>
+
+ @param pattern The pattern for which to search
+ @param str The string to search
+ @param matchNum Which match to find
+ @param mode Any special flags to use during the matching process
+ @return A string and an integer. The string is the string matched. The
+ integer is the starting location of the matched string in
+ <code>str</code>. You can check for success/failure by making sure
+ that the integer returned is greater than or equal to zero.
+ */
+ static std::pair<std::string, int> findNthMatch (const std::string & pattern,
+ const std::string & str,
+ const int matchNum,
+ const unsigned long mode = 0);
+ public:
+ /**
+ Deletes all NFA nodes allocated during compilation
+ */
+ ~Pattern();
+
+ std::string replace (const std::string & str,
+ const std::string & replacementText);
+ std::vector<std::string> split (const std::string & str, const bool keepEmptys = 0,
+ const unsigned long limit = 0);
+ std::vector<std::string> findAll (const std::string & str);
+ bool matches (const std::string & str);
+ /**
+ Returns the flags used during compilation of this pattern
+ @return The flags used during compilation of this pattern
+ */
+ unsigned long getFlags () const;
+ /**
+ Returns the regular expression this pattern represents
+ @return The regular expression this pattern represents
+ */
+ std::string getPattern () const;
+ /**
+ Creates a matcher object using the specified string and this pattern.
+ @param str The string to match against
+ @return A new matcher using object using this pattern and the specified
+ string
+ */
+ Matcher * createMatcher (const std::string & str);
+};
+
+class NFANode
+{
+ friend class Matcher;
+ public:
+ NFANode * next;
+ NFANode();
+ virtual ~NFANode();
+ virtual void findAllNodes(std::map<NFANode*, bool> & soFar);
+ virtual int match(const std::string & str, Matcher * matcher, const int curInd = 0) const = 0;
+ inline virtual bool isGroupHeadNode() const { return false; }
+ inline virtual bool isStartOfInputNode() const { return false; }
+};
+class NFACharNode : public NFANode
+{
+ protected:
+ char ch;
+ public:
+ NFACharNode(const char c);
+ virtual int match(const std::string & str, Matcher * matcher, const int curInd = 0) const;
+};
+class NFACICharNode : public NFANode
+{
+ protected:
+ char ch;
+ public:
+ NFACICharNode(const char c);
+ virtual int match(const std::string & str, Matcher * matcher, const int curInd = 0) const;
+};
+class NFAStartNode : public NFANode
+{
+ public:
+ NFAStartNode();
+ virtual int match(const std::string & str, Matcher * matcher, const int curInd = 0) const;
+};
+class NFAEndNode : public NFANode
+{
+ public:
+ NFAEndNode();
+ virtual int match(const std::string & str, Matcher * matcher, const int curInd = 0) const;
+};
+class NFAQuantifierNode : public NFANode
+{
+ public:
+ int min, max;
+ NFANode * inner;
+ virtual void findAllNodes(std::map<NFANode*, bool> & soFar);
+ NFAQuantifierNode(Pattern * pat, NFANode * internal,
+ const int minMatch = Pattern::MIN_QMATCH,
+ const int maxMatch = Pattern::MAX_QMATCH);
+ virtual int match(const std::string & str, Matcher * matcher, const int curInd = 0) const;
+};
+class NFAGreedyQuantifierNode : public NFAQuantifierNode
+{
+ public:
+ NFAGreedyQuantifierNode(Pattern * pat, NFANode * internal,
+ const int minMatch = Pattern::MIN_QMATCH,
+ const int maxMatch = Pattern::MAX_QMATCH);
+ virtual int match(const std::string & str, Matcher * matcher, const int curInd = 0) const;
+ virtual int matchInternal(const std::string & str, Matcher * matcher, const int curInd, const int soFar) const;
+};
+class NFALazyQuantifierNode : public NFAQuantifierNode
+{
+ public:
+ NFALazyQuantifierNode(Pattern * pat, NFANode * internal,
+ const int minMatch = Pattern::MIN_QMATCH,
+ const int maxMatch = Pattern::MAX_QMATCH);
+ virtual int match(const std::string & str, Matcher * matcher, const int curInd = 0) const;
+};
+class NFAPossessiveQuantifierNode : public NFAQuantifierNode
+{
+ public:
+ NFAPossessiveQuantifierNode(Pattern * pat, NFANode * internal,
+ const int minMatch = Pattern::MIN_QMATCH,
+ const int maxMatch = Pattern::MAX_QMATCH);
+ virtual int match(const std::string & str, Matcher * matcher, const int curInd = 0) const;
+};
+class NFAAcceptNode : public NFANode
+{
+ public:
+ NFAAcceptNode();
+ virtual int match(const std::string & str, Matcher * matcher, const int curInd = 0) const;
+};
+class NFAClassNode : public NFANode
+{
+ public:
+ bool inv;
+ std::map<char, bool> vals;
+ NFAClassNode(const bool invert = 0);
+ NFAClassNode(const std::string & clazz, const bool invert);
+ virtual int match(const std::string & str, Matcher * matcher, const int curInd = 0) const;
+};
+class NFACIClassNode : public NFANode
+{
+ public:
+ bool inv;
+ std::map<char, bool> vals;
+ NFACIClassNode(const bool invert = 0);
+ NFACIClassNode(const std::string & clazz, const bool invert);
+ virtual int match(const std::string & str, Matcher * matcher, const int curInd = 0) const;
+};
+class NFASubStartNode : public NFANode
+{
+ public:
+ NFASubStartNode();
+ virtual int match(const std::string & str, Matcher * matcher, const int curInd = 0) const;
+};
+class NFAOrNode : public NFANode
+{
+ public:
+ NFANode * one;
+ NFANode * two;
+ NFAOrNode(NFANode * first, NFANode * second);
+ virtual void findAllNodes(std::map<NFANode*, bool> & soFar);
+ virtual int match(const std::string & str, Matcher * matcher, const int curInd = 0) const;
+};
+class NFAQuoteNode : public NFANode
+{
+ public:
+ std::string qStr;
+ NFAQuoteNode(const std::string & quoted);
+ virtual int match(const std::string & str, Matcher * matcher, const int curInd = 0) const;
+};
+class NFACIQuoteNode : public NFANode
+{
+ public:
+ std::string qStr;
+ NFACIQuoteNode(const std::string & quoted);
+ virtual int match(const std::string & str, Matcher * matcher, const int curInd = 0) const;
+};
+class NFALookAheadNode : public NFANode
+{
+ public:
+ bool pos;
+ NFANode * inner;
+ NFALookAheadNode(NFANode * internal, const bool positive);
+ virtual void findAllNodes(std::map<NFANode*, bool> & soFar);
+ virtual int match(const std::string & str, Matcher * matcher, const int curInd = 0) const;
+};
+class NFALookBehindNode : public NFANode
+{
+ public:
+ bool pos;
+ std::string mStr;
+ NFALookBehindNode(const std::string & str, const bool positive);
+ virtual int match(const std::string & str, Matcher * matcher, const int curInd = 0) const;
+};
+class NFAStartOfLineNode : public NFANode
+{
+ public:
+ NFAStartOfLineNode();
+ virtual int match(const std::string & str, Matcher * matcher, const int curInd = 0) const;
+};
+class NFAEndOfLineNode : public NFANode
+{
+ public:
+ NFAEndOfLineNode();
+ virtual int match(const std::string & str, Matcher * matcher, const int curInd = 0) const;
+};
+class NFAReferenceNode : public NFANode
+{
+ public:
+ int gi;
+ NFAReferenceNode(const int groupIndex);
+ virtual int match(const std::string & str, Matcher * matcher, const int curInd = 0) const;
+};
+class NFAStartOfInputNode : public NFANode
+{
+ public:
+ NFAStartOfInputNode();
+ virtual int match(const std::string & str, Matcher * matcher, const int curInd = 0) const;
+ inline virtual bool isStartOfInputNode() const { return true; }
+};
+class NFAEndOfInputNode : public NFANode
+{
+ public:
+ bool term;
+ NFAEndOfInputNode(const bool lookForTerm);
+ virtual int match(const std::string & str, Matcher * matcher, const int curInd = 0) const;
+};
+class NFAWordBoundaryNode : public NFANode
+{
+ public:
+ bool pos;
+ NFAWordBoundaryNode(const bool positive);
+ virtual int match(const std::string & str, Matcher * matcher, const int curInd = 0) const;
+};
+class NFAEndOfMatchNode : public NFANode
+{
+ public:
+ NFAEndOfMatchNode();
+ virtual int match(const std::string & str, Matcher * matcher, const int curInd = 0) const;
+};
+class NFAGroupHeadNode : public NFANode
+{
+ public:
+ int gi;
+ NFAGroupHeadNode(const int groupIndex);
+ virtual int match(const std::string & str, Matcher * matcher, const int curInd = 0) const;
+ inline virtual bool isGroupHeadNode() const { return true; }
+};
+class NFAGroupTailNode : public NFANode
+{
+ public:
+ int gi;
+ NFAGroupTailNode(const int groupIndex);
+ virtual int match(const std::string & str, Matcher * matcher, const int curInd = 0) const;
+};
+class NFAGroupLoopPrologueNode : public NFANode
+{
+ public:
+ int gi;
+ NFAGroupLoopPrologueNode(const int groupIndex);
+ virtual int match(const std::string & str, Matcher * matcher, const int curInd = 0) const;
+};
+class NFAGroupLoopNode : public NFANode
+{
+ public:
+ int gi, min, max, type;
+ NFANode * inner;
+ NFAGroupLoopNode(NFANode * internal, const int minMatch,
+ const int maxMatch, const int groupIndex, const int matchType);
+ virtual void findAllNodes(std::map<NFANode*, bool> & soFar);
+ virtual int match(const std::string & str, Matcher * matcher, const int curInd = 0) const;
+ int matchGreedy(const std::string & str, Matcher * matcher, const int curInd = 0) const;
+ int matchLazy(const std::string & str, Matcher * matcher, const int curInd = 0) const;
+ int matchPossessive(const std::string & str, Matcher * matcher, const int curInd = 0) const;
+};
+
+#endif
+
diff --git a/support/highlight/src/core/rtfgenerator.cpp b/support/highlight/src/core/rtfgenerator.cpp
new file mode 100644
index 0000000000..dab2c805cc
--- /dev/null
+++ b/support/highlight/src/core/rtfgenerator.cpp
@@ -0,0 +1,363 @@
+/***************************************************************************
+ rtfcode.cpp - description
+ -------------------
+ begin : Die Jul 9 2002
+ copyright : (C) 2002-2007 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#include <sstream>
+
+#include "charcodes.h"
+#include "version.h"
+#include "rtfgenerator.h"
+
+using namespace std;
+
+namespace highlight
+{
+
+ string RtfGenerator::getAttributes ( const ElementStyle & col )
+ {
+ stringstream s;
+ s << "\\red"<< col.getColour().getRed ( RTF )
+ << "\\green"<<col.getColour().getGreen ( RTF )
+ << "\\blue"<<col.getColour().getBlue ( RTF )
+ << ";";
+ return s.str();
+ }
+
+ string RtfGenerator::getOpenTag ( int styleNumber,const ElementStyle & elem )
+ {
+ ostringstream s;
+ s << "{";
+ if ( addCharStyles )
+ {
+ s<<"\\*\\cs"<< ( styleNumber+2 );
+ }
+ s << "\\cf"<< ( styleNumber+2 ) <<"{";
+
+ if ( elem.isBold() ) s << "\\b ";
+ if ( elem.isItalic() ) s << "\\i ";
+ if ( elem.isUnderline() ) s << "\\ul ";
+ return s.str();
+ }
+
+
+ string RtfGenerator::getCharStyle ( int styleNumber,const ElementStyle &elem,
+ const string&styleName )
+ {
+ ostringstream s;
+ s << "{\\*\\cs"<< ( styleNumber+2 ) <<"\\additive\\cf"<< ( styleNumber+2 )
+ << "\\f1\\fs";
+ int fontSize=0;
+ StringTools::str2num<int> ( fontSize, this->getBaseFontSize(), std::dec );
+ s << ( ( fontSize ) ? fontSize*2: 20 ); // RTF needs double amount
+ if ( elem.isBold() ) s << "\\b";
+ if ( elem.isItalic() ) s << "\\i";
+ if ( elem.isUnderline() ) s << "\\ul";
+ s << "\\sbasedon222\\snext0 "<< styleName << ";}\n";
+ return s.str();
+ }
+// {\*\cs2\additive\cf2\f1\fs20\sbasedon222\snext0 HL Default;}
+
+ string RtfGenerator::getCloseTag ( const ElementStyle &elem )
+ {
+ ostringstream s;
+ if ( elem.isBold() ) s << "\\b0 ";
+ if ( elem.isItalic() ) s << "\\i0 ";
+ if ( elem.isUnderline() ) s << "\\ul0 ";
+ s << "}}";
+ return s.str();
+ }
+
+ RtfGenerator::RtfGenerator()
+ : CodeGenerator ( RTF ),
+ pageSize ( "a4" ), // Default: DIN A4
+ addCharStyles ( false )
+ {
+ newLineTag = "}\\par\\pard\n\\cbpat1{";
+ spacer = " ";
+
+ // Page dimensions
+ psMap["a3"] = PageSize ( 16837,23811 );
+ psMap["a4"] = PageSize ( 11905,16837 );
+ psMap["a5"] = PageSize ( 8390,11905 );
+
+ psMap["b4"] = PageSize ( 14173,20012 );
+ psMap["b5"] = PageSize ( 9977,14173 );
+ psMap["b6"] = PageSize ( 7086,9977 );
+
+ psMap["letter"] = PageSize ( 12240,15840 );
+ psMap["legal"] = PageSize ( 12240,20163 );
+ }
+
+ RtfGenerator::~RtfGenerator()
+ {}
+
+ string RtfGenerator::getHeader()
+ {
+ return string();
+ }
+
+ void RtfGenerator::printBody()
+ {
+ *out << "{\\rtf1\\ansi\\uc0 \\deff1"
+ << "{\\fonttbl{\\f1\\fmodern\\fprq1\\fcharset0 " ;
+ *out << this->getBaseFont() ;
+ *out << ";}}"
+ << "{\\colortbl;";
+
+ *out << "\\red" << ( docStyle.getBgColour().getRed ( RTF ) );
+ *out << "\\green" << ( docStyle.getBgColour().getGreen ( RTF ) );
+ *out << "\\blue" << ( docStyle.getBgColour().getBlue ( RTF ) );
+ *out << ";";
+
+ *out << getAttributes ( docStyle.getDefaultStyle() );
+
+ *out << getAttributes ( docStyle.getStringStyle() );
+ *out << getAttributes ( docStyle.getNumberStyle() );
+ *out << getAttributes ( docStyle.getSingleLineCommentStyle() );
+
+ *out << getAttributes ( docStyle.getCommentStyle() );
+ *out << getAttributes ( docStyle.getEscapeCharStyle() );
+ *out << getAttributes ( docStyle.getDirectiveStyle() );
+
+ *out << getAttributes ( docStyle.getDirectiveStringStyle() );
+ *out << getAttributes ( docStyle.getLineStyle() );
+ *out << getAttributes ( docStyle.getSymbolStyle() );
+
+ /* For output formats which can refer to external styles it is more safe
+ to use the colour theme's keyword class names, since the language
+ definitions (which may change during a batch conversion) do not have to define
+ all keyword classes, that are needed to highlight all input files correctly.
+ It is ok for RTF to use the language definition's class names, because RTF
+ does not refer to external styles.
+ We cannot use the theme's class names, because KSIterator returns an
+ alphabetically ordered list, which is not good because RTF is dependent
+ on the order. We access the keyword style with an ID, which is calculated
+ ignoring the alphabetic order.
+ */
+ vector<string> keywordClasses = langInfo.getKeywordClasses();
+ for ( unsigned int i=0;i<keywordClasses.size();i++ )
+ {
+ *out << getAttributes ( docStyle.getKeywordStyle ( keywordClasses[i] ) );
+ }
+
+ *out << "}\n";
+
+ if ( addCharStyles )
+ {
+ *out << "{\\stylesheet{\n";
+ *out << getCharStyle ( STANDARD, docStyle.getDefaultStyle(), "HL Default" );
+ *out << getCharStyle ( STRING, docStyle.getStringStyle(), "HL String" );
+ *out << getCharStyle ( NUMBER, docStyle.getNumberStyle(), "HL Number" );
+ *out << getCharStyle ( SL_COMMENT, docStyle.getSingleLineCommentStyle(), "HL SL Comment" );
+ *out << getCharStyle ( ML_COMMENT, docStyle.getCommentStyle(), "HL ML Comment" );
+ *out << getCharStyle ( ESC_CHAR, docStyle.getEscapeCharStyle(), "HL Escape Character" );
+ *out << getCharStyle ( DIRECTIVE, docStyle.getDirectiveStyle(), "HL Directive" );
+ *out << getCharStyle ( DIRECTIVE_STRING, docStyle.getDirectiveStringStyle(), "HL Directive String" );
+ *out << getCharStyle ( LINENUMBER, docStyle.getLineStyle(), "HL Line" );
+ *out << getCharStyle ( SYMBOL, docStyle.getSymbolStyle(), "HL Symbol" );
+ char styleName[20];
+ for ( unsigned int i=0;i<keywordClasses.size();i++ )
+ {
+ sprintf ( styleName, "HL Keyword %c", 'A'+i ); //maybe better simple numbering
+ *out << getCharStyle ( KEYWORD+i, docStyle.getKeywordStyle ( keywordClasses[i] ), string ( styleName ) );
+ }
+ *out << "}}\n";
+ }
+
+ *out << "\\paperw"<< psMap[pageSize].width <<"\\paperh"<< psMap[pageSize].height
+ << "\\margl1134\\margr1134\\margt1134\\margb1134\\sectd" // page margins
+ << "\\plain\\f1\\fs" ; // Font formatting
+ int fontSize=0;
+ StringTools::str2num<int> ( fontSize, this->getBaseFontSize(), std::dec );
+ *out << ( ( fontSize ) ? fontSize*2: 20 ); // RTF needs double amount
+ *out << "\n\\pard \\cbpat1{";
+
+ processRootState();
+
+ *out << "}}"<<endl;
+ }
+
+ string RtfGenerator::getFooter()
+ {
+ return string();
+ }
+
+ void RtfGenerator::initOutputTags ( )
+ {
+ openTags.push_back ( getOpenTag ( STANDARD, docStyle.getDefaultStyle() ) );
+ openTags.push_back ( getOpenTag ( STRING, docStyle.getStringStyle() ) );
+ openTags.push_back ( getOpenTag ( NUMBER, docStyle.getNumberStyle() ) );
+ openTags.push_back ( getOpenTag ( SL_COMMENT, docStyle.getSingleLineCommentStyle() ) );
+ openTags.push_back ( getOpenTag ( ML_COMMENT,docStyle.getCommentStyle() ) );
+ openTags.push_back ( getOpenTag ( ESC_CHAR, docStyle.getEscapeCharStyle() ) );
+ openTags.push_back ( getOpenTag ( DIRECTIVE, docStyle.getDirectiveStyle() ) );
+ openTags.push_back ( getOpenTag ( DIRECTIVE_STRING, docStyle.getDirectiveStringStyle() ) );
+ openTags.push_back ( getOpenTag ( LINENUMBER, docStyle.getLineStyle() ) );
+ openTags.push_back ( getOpenTag ( SYMBOL, docStyle.getSymbolStyle() ) );
+
+ closeTags.push_back ( getCloseTag ( docStyle.getDefaultStyle() ) );
+ closeTags.push_back ( getCloseTag ( docStyle.getStringStyle() ) );
+ closeTags.push_back ( getCloseTag ( docStyle.getNumberStyle() ) );
+ closeTags.push_back ( getCloseTag ( docStyle.getSingleLineCommentStyle() ) );
+ closeTags.push_back ( getCloseTag ( docStyle.getCommentStyle() ) );
+ closeTags.push_back ( getCloseTag ( docStyle.getEscapeCharStyle() ) );
+ closeTags.push_back ( getCloseTag ( docStyle.getDirectiveStyle() ) );
+ closeTags.push_back ( getCloseTag ( docStyle.getDirectiveStringStyle() ) );
+ closeTags.push_back ( getCloseTag ( docStyle.getLineStyle() ) );
+ closeTags.push_back ( getCloseTag ( docStyle.getSymbolStyle() ) );
+ }
+
+ string RtfGenerator::maskCharacter ( unsigned char c )
+ {
+ switch ( c )
+ {
+ case '}' :
+ case '{' :
+ case '\\' :
+ {
+ string m ( "\\" );
+ return m += c;
+ }
+ break;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ {
+ string m ( 1, '{' );
+ m += c;
+ m += '}';
+ return m;
+ }
+ break;
+
+ case AUML_LC:
+ return "\\'e4";
+ break;
+ case OUML_LC:
+ return "\\'f6";
+ break;
+ case UUML_LC:
+ return "\\'fc";
+ break;
+ case AUML_UC:
+ return "\\'c4";
+ break;
+ case OUML_UC:
+ return "\\'d6";
+ break;
+ case UUML_UC:
+ return "\\'dc";
+ break;
+
+ case AACUTE_LC:
+ return "\\'e1";
+ break;
+ case EACUTE_LC:
+ return "\\'e9";
+ break;
+ case OACUTE_LC:
+ return "\\'f3";
+ break;
+ case UACUTE_LC:
+ return "\\'fa";
+ break;
+
+ case AGRAVE_LC:
+ return "\\'e0";
+ break;
+ case EGRAVE_LC:
+ return "\\'e8";
+ break;
+ case OGRAVE_LC:
+ return "\\'f2";
+ break;
+ case UGRAVE_LC:
+ return "\\'f9";
+ break;
+
+ case AACUTE_UC:
+ return "\\'c1";
+ break;
+ case EACUTE_UC:
+ return "\\'c9";
+ break;
+ case OACUTE_UC:
+ return "\\'d3";
+ break;
+ case UACUTE_UC:
+ return "\\'da";
+ break;
+ case AGRAVE_UC:
+ return "\\'c0";
+ break;
+ case EGRAVE_UC:
+ return "\\'c8";
+ break;
+ case OGRAVE_UC:
+ return "\\'d2";
+ break;
+ case UGRAVE_UC:
+ return "\\'d9";
+ break;
+
+ case SZLIG:
+ return "\\'df";
+ break;
+
+ default :
+ return string ( 1, c );
+ }
+ }
+
+ string RtfGenerator::getKeywordOpenTag ( unsigned int styleID )
+ {
+ return getOpenTag ( KEYWORD+styleID,
+ docStyle.getKeywordStyle ( langInfo.getKeywordClasses() [styleID] ) );
+ }
+
+ string RtfGenerator::getKeywordCloseTag ( unsigned int styleID )
+ {
+ return getCloseTag ( docStyle.getKeywordStyle ( langInfo.getKeywordClasses() [styleID] ) );
+ }
+
+ void RtfGenerator::setRTFPageSize ( const string & ps )
+ {
+ if ( psMap.count ( ps ) ) pageSize = ps;
+ }
+
+ void RtfGenerator::setRTFCharStyles ( bool cs )
+ {
+ addCharStyles = cs;
+ }
+
+}
diff --git a/support/highlight/src/core/rtfgenerator.h b/support/highlight/src/core/rtfgenerator.h
new file mode 100644
index 0000000000..e3d0ca614c
--- /dev/null
+++ b/support/highlight/src/core/rtfgenerator.h
@@ -0,0 +1,146 @@
+/***************************************************************************
+ rtfcode.h - description
+ -------------------
+ begin : Die Jul 9 2002
+ copyright : (C) 2002-2008 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#ifndef RTFGENERATOR_H
+#define RTFGENERATOR_H
+
+#include <string>
+
+#include "codegenerator.h"
+
+namespace highlight
+{
+
+ /**
+ PageSize contains the RTF page dimensions.
+ */
+ struct PageSize
+ {
+ /// RTF page width
+ int width;
+ /// RTF page height
+ int height;
+
+ PageSize()
+ {
+ }
+
+ /** Constructor to define page dimensions
+ @param w width
+ @param h height*/
+ PageSize ( int w, int h )
+ {
+ width=w;
+ height = h;
+ }
+
+ };
+
+ /** mapping of page size names and dimensions */
+ typedef map<string, struct PageSize> PagesizeMap;
+
+ /**
+ \brief This class generates RTF.
+
+ It contains information about the resulting document structure (document
+ header and footer), the colour system, white space handling and text
+ formatting attributes.
+
+ * @author Andre Simon
+ */
+
+ class RtfGenerator : public highlight::CodeGenerator
+ {
+ public:
+
+ RtfGenerator();
+
+ ~RtfGenerator();
+
+ /** Define RTF page size
+ \param ps RTF page size (a3, a4, a5, b4, b5, b6, letter, legal) */
+ void setRTFPageSize ( const string & ps );
+
+ /** \param cs flag to enable character styles*/
+ void setRTFCharStyles ( bool cs );
+
+ private:
+
+ /** prints document header
+ */
+ string getHeader();
+
+ /** Prints document footer*/
+ string getFooter();
+
+ /** Prints document body*/
+ void printBody();
+
+ /** initialize tags in specific format according to colouring information provided in DucumentStyle */
+ void initOutputTags();
+
+ /** Map of several pagesizes */
+ PagesizeMap psMap;
+
+ /** name of page size which is mapped to page dimensions*/
+ string pageSize;
+
+ /** flag to add character styles */
+ bool addCharStyles;
+
+ /** \return escaped character*/
+ virtual string maskCharacter ( unsigned char );
+
+ /**\return text formatting attributes in RTF format */
+ string getAttributes ( const ElementStyle & col );
+
+ /** @param styleNumber number of current style
+ @param elem associated element style
+ @return RTF formatting seqence (colour index + bold + italic)*/
+ string getOpenTag ( int styleNumber,const ElementStyle &elem );
+
+ /** @param styleNumber number of current style
+ @param elem associated element style
+ @param styleName style name
+ @return RTF character style definition */
+ string getCharStyle ( int styleNumber,const ElementStyle &elem, const string&styleName );
+
+ /** @param elem associated element style
+ @return RTF formatting sequnce to close element formatting */
+ string getCloseTag ( const ElementStyle &elem );
+
+ /** @param styleID current style ID
+ @return matching sequence to begin a new element formatting*/
+ string getKeywordOpenTag ( unsigned int styleID );
+
+ /** @param styleID current style ID
+ @return matching sequence to stop element formatting*/
+ string getKeywordCloseTag ( unsigned int styleID );
+ };
+
+}
+#endif
diff --git a/support/highlight/src/core/stringtools.cpp b/support/highlight/src/core/stringtools.cpp
new file mode 100644
index 0000000000..6db9df9900
--- /dev/null
+++ b/support/highlight/src/core/stringtools.cpp
@@ -0,0 +1,111 @@
+/***************************************************************************
+ stringtools.cpp - description
+ -------------------
+ begin : Mon Dec 10 2001
+ copyright : (C) 2001 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#include "stringtools.h"
+
+// Avoid problems with isspace and UTF-8 characters, use iswspace
+//#include <wctype.h>
+
+
+using namespace std;
+
+namespace StringTools
+{
+
+ string change_case ( const string & s, const KeywordCase kcase ) throw()
+ {
+ string r ( s );
+ switch ( kcase )
+ {
+ case CASE_UNCHANGED:
+ break;
+ case CASE_CAPITALIZE:
+ case CASE_LOWER:
+ for ( unsigned int i = 0; i < r.size(); ++i )
+ r[i] = tolower ( r[i] );
+ if ( kcase == CASE_CAPITALIZE && r.size() )
+ r[0] = toupper ( r[0] );
+ break;
+ case CASE_UPPER:
+ for ( unsigned int i = 0; i < r.size(); ++i )
+ r[i] = toupper ( r[i] );
+ break;
+ }
+ return r;
+ }
+
+
+ string trimRight ( const string &value )
+ {
+ string::size_type where = value.find_last_not_of ( " \t\r" );
+
+ if ( where == string::npos )
+ // string has nothing but space
+ return string();
+
+ if ( where == ( value.length() - 1 ) )
+ // string has no trailing space, don't copy its contents
+ return value;
+
+ return value.substr ( 0, where + 1 );
+ }
+
+ string getParantheseVal ( const string &s )
+ {
+ string::size_type openPos=s.find ( '(' );
+ string::size_type closePos=s.rfind ( ')' );
+ if ( openPos ==string::npos || closePos==string::npos )
+ {
+ return string();
+ }
+ return s.substr ( openPos+1, closePos-openPos-1 );
+ }
+
+ vector<string> splitString ( const string& s, unsigned char delim )
+ {
+ string::size_type pos=s.find ( delim ), oldPos=0;
+ vector <string> results;
+
+ if ( pos ==string::npos )
+ {
+ if ( !s.empty() ) results.push_back ( s );
+ return results;
+ }
+
+ do
+ {
+ if ( oldPos-pos ) results.push_back ( s.substr ( oldPos, pos-oldPos ) );
+ oldPos=pos+1;
+ pos=s.find ( delim, pos+1 );
+ }
+ while ( pos!=string::npos );
+ results.push_back ( s.substr ( oldPos ) );
+
+ return results;
+ }
+
+}
diff --git a/support/highlight/src/core/stringtools.h b/support/highlight/src/core/stringtools.h
new file mode 100644
index 0000000000..861ae85822
--- /dev/null
+++ b/support/highlight/src/core/stringtools.h
@@ -0,0 +1,90 @@
+/***************************************************************************
+ stringtools.h - description
+ -------------------
+ begin : Mon Dec 10 2001
+ copyright : (C) 2001 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#ifndef STRINGTOOLS_H
+#define STRINGTOOLS_H
+
+#include <string>
+#include <vector>
+#include <sstream>
+
+using namespace std;
+
+/// Contains methods for string manipulation
+
+namespace StringTools
+{
+
+ /** Change Keyword case */
+ enum KeywordCase
+ {
+ CASE_UNCHANGED, ///< do not alter case
+ CASE_LOWER, ///< convert to lower case
+ CASE_UPPER, ///< convert to upper case
+ CASE_CAPITALIZE ///< convert first character to upper case
+ };
+
+ /** Change character case of strings
+ \param s input string
+ \param kcase case modification indicator
+ \return modified string
+ */
+ string change_case ( const string & s,
+ const KeywordCase kcase = CASE_LOWER ) throw();
+
+ /** Trim string (remove whitespace)
+ \param value String
+ \return string trimmed on the left
+ */
+ string trimRight ( const string &value );
+
+ /** Parse data within parantheses
+ \param s String, containing a opening and a closing paranthesis
+ \return value between "(", ")" */
+ string getParantheseVal ( const string &s );
+
+ /** Split string and return items separated by a delimiter
+ \param s string containing tokens
+ \param delim Token delimiter
+ \return vector containing found tokens */
+ vector <string> splitString ( const string& s, unsigned char delim );
+
+ /** Convert string to a numeric value of the given type
+ \param val variable of specified type which will contain the numeric value
+ \param s string containing a number
+ \param f format specifier function (IO manipulator)
+ \return true if successfull */
+ template <class T>
+ bool str2num ( T &val, const std::string& s, std::ios_base& ( *f ) ( std::ios_base& ) )
+ {
+ std::istringstream iss ( s );
+ return ! ( iss >> f >> val ).fail();
+ }
+
+}
+
+#endif
diff --git a/support/highlight/src/core/stylecolour.cpp b/support/highlight/src/core/stylecolour.cpp
new file mode 100644
index 0000000000..3cfec3d743
--- /dev/null
+++ b/support/highlight/src/core/stylecolour.cpp
@@ -0,0 +1,157 @@
+/***************************************************************************
+ stylecolour.cpp - description
+ -------------------
+ begin : Die Nov 5 2002
+ copyright : (C) 2002 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#include "stylecolour.h"
+#include "stringtools.h"
+
+
+#include <iostream>
+#include <sstream>
+#include <cmath>
+
+using std::string;
+
+namespace highlight
+{
+
+ Colour::Colour ( const string & red, const string & green, const string & blue )
+ {
+ ostringstream rgbStream;
+ rgbStream << red << " " << green << " " << blue;
+ setRGB ( rgbStream.str() );
+ }
+
+ Colour::Colour()
+ {
+ rgb.iRed = rgb.iGreen = rgb.iBlue = 0;
+ }
+
+ Colour::Colour ( const string & colourString )
+ {
+ setRGB ( colourString );
+ }
+
+ void Colour::setRGB ( const string & colourString )
+ {
+ if ( colourString.empty() ) return;
+
+ istringstream valueStream ( colourString.c_str() );
+ string r, g, b;
+ char c='\0';
+ valueStream >> c;
+
+ if ( c=='#' )
+ {
+ string htmlNotation;
+ valueStream >> htmlNotation;
+ if ( htmlNotation.size() < 6 ) return;
+ r = htmlNotation.substr ( 0, 2 );
+ g = htmlNotation.substr ( 2, 2 );
+ b = htmlNotation.substr ( 4, 2 );
+ }
+ else
+ {
+ valueStream.putback ( c );
+ valueStream >> r;
+ valueStream >> g;
+ valueStream >> b;
+ }
+
+ StringTools::str2num<int> ( rgb.iRed, r, std::hex );
+ StringTools::str2num<int> ( rgb.iGreen, g, std::hex );
+ StringTools::str2num<int> ( rgb.iBlue, b, std::hex );
+ }
+
+ void Colour::setRed ( const string & red )
+ {
+ StringTools::str2num<int> ( rgb.iRed, red, std::hex );
+ }
+
+ void Colour::setGreen ( const string & green )
+ {
+ StringTools::str2num<int> ( rgb.iGreen, green, std::hex );
+ }
+
+ void Colour::setBlue ( const string & blue )
+ {
+ StringTools::str2num<int> ( rgb.iBlue, blue, std::hex );
+ }
+
+ string Colour::getRed ( OutputType type ) const
+ {
+ switch ( type )
+ {
+ case RTF: return int2str ( rgb.iRed, std::dec );
+ case LATEX: return float2str ( ( float ) rgb.iRed / 255 );
+ case TEX: return float2str ( 1 - ( float ) rgb.iRed / 255 );
+ default: return int2str ( rgb.iRed, std::hex );
+ }
+ }
+
+ string Colour::getGreen ( OutputType type ) const
+ {
+ switch ( type )
+ {
+ case RTF: return int2str ( rgb.iGreen, std::dec );
+ case LATEX: return float2str ( ( float ) rgb.iGreen / 255 );
+ case TEX: return float2str ( 1 - ( float ) rgb.iGreen / 255 );
+ default: return int2str ( rgb.iGreen, std::hex );
+ }
+ }
+
+ string Colour::getBlue ( OutputType type ) const
+ {
+ switch ( type )
+ {
+ case RTF: return int2str ( rgb.iBlue, std::dec );
+ case LATEX: return float2str ( ( float ) rgb.iBlue / 255 );
+ case TEX: return float2str ( 1 - ( float ) rgb.iBlue / 255 );
+ default: return int2str ( rgb.iBlue, std::hex );
+ }
+ }
+
+
+ string Colour::int2str ( const int num, std::ios_base& ( *f ) ( std::ios_base& ) ) const
+ {
+ std::ostringstream outStream;
+ outStream.width ( 2 );
+ outStream.fill ( '0' );
+ outStream << f << num;
+
+ return outStream.str();
+ }
+
+ string Colour::float2str ( const double num ) const
+ {
+ std::ostringstream outStream;
+ outStream << ( floor ( num * 100 + .5 ) / 100 );
+
+ return outStream.str();
+ }
+
+}
+
diff --git a/support/highlight/src/core/stylecolour.h b/support/highlight/src/core/stylecolour.h
new file mode 100644
index 0000000000..943952d6c2
--- /dev/null
+++ b/support/highlight/src/core/stylecolour.h
@@ -0,0 +1,106 @@
+/***************************************************************************
+ stylecolour.h - description
+ -------------------
+ begin : Die Nov 5 2002
+ copyright : (C) 2002 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#ifndef STYLECOLOUR_H
+#define STYLECOLOUR_H
+
+#include "enums.h"
+
+#include <string>
+
+
+using namespace std;
+
+namespace highlight
+{
+
+ /**\brief Stores colours and returns red, green and blue values in different formats
+ * @author Andre Simon
+ */
+
+ struct RGBVal
+ {
+ int iRed, ///< Red value
+ iGreen, ///< Green value
+ iBlue; ///< Blue value
+ };
+
+ class Colour
+ {
+ public:
+ /** Constructor
+ \param red Red value in hex notation
+ \param green Blue value in hex notation
+ \param blue Green value in hex notation
+ */
+ Colour ( const string & red, const string & green, const string & blue );
+
+ /** Constructor
+ \param ColourString String with rgb values
+ */
+ Colour ( const string & colourString );
+
+ Colour();
+ ~Colour() {};
+
+ /** Sets red, green and blue values
+ \param ColourString String containing colour attributes
+ */
+ void setRGB ( const string & colourString );
+
+
+ /** Sets red value
+ \param red New red value */
+ void setRed ( const string & red );
+
+ /** Sets green value
+ \param green New green value */
+ void setGreen ( const string & green );
+
+ /** Sets blue value
+ \param blue New blue value */
+ void setBlue ( const string & blue );
+
+ /** @param type Output type
+ @return Red value in color representation according to output type */
+ string getRed ( OutputType type ) const;
+ /** @param type Output type
+ @return Green value in color representation according to output type */
+ string getGreen ( OutputType type ) const;
+ /** @param type Output type
+ @return Blue value in color representation according to output type */
+ string getBlue ( OutputType type ) const;
+
+ private:
+ RGBVal rgb;
+ string int2str ( int, std::ios_base& ( *f ) ( std::ios_base& ) ) const;
+ string float2str ( double ) const;
+ };
+
+}
+
+#endif
diff --git a/support/highlight/src/core/svggenerator.cpp b/support/highlight/src/core/svggenerator.cpp
new file mode 100644
index 0000000000..10e41f6c07
--- /dev/null
+++ b/support/highlight/src/core/svggenerator.cpp
@@ -0,0 +1,248 @@
+/***************************************************************************
+ xmlcode.cpp - description
+ -------------------
+ begin : Mo 23.06.2008
+ copyright : (C) 2008 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#include <string>
+#include <sstream>
+
+#include "version.h"
+#include "svggenerator.h"
+
+using namespace std;
+namespace highlight
+{
+
+ SVGGenerator::SVGGenerator()
+ : CodeGenerator ( SVG )
+ {
+ spacer = " ";
+ newLineTag = "\n";
+ styleCommentOpen="/*";
+ styleCommentClose="*/";
+ }
+
+ SVGGenerator::~SVGGenerator() {}
+
+ void SVGGenerator::initOutputTags(){
+ openTags.push_back ( "" );
+ openTags.push_back ( getOpenTag ( STY_NAME_STR ) );
+ openTags.push_back ( getOpenTag ( STY_NAME_NUM ) );
+ openTags.push_back ( getOpenTag ( STY_NAME_SLC ) );
+ openTags.push_back ( getOpenTag ( STY_NAME_COM ) );
+ openTags.push_back ( getOpenTag ( STY_NAME_ESC ) );
+ openTags.push_back ( getOpenTag ( STY_NAME_DIR ) );
+ openTags.push_back ( getOpenTag ( STY_NAME_DST ) );
+ openTags.push_back ( getOpenTag ( STY_NAME_LIN ) );
+ openTags.push_back ( getOpenTag ( STY_NAME_SYM ) );
+
+ closeTags.push_back ( "" );
+ for ( int i=1;i<NUMBER_BUILTIN_STATES; i++ )
+ {
+ closeTags.push_back ( "</tspan>" );
+ }
+ }
+
+ string SVGGenerator::getStyleDefinition()
+ {
+ if ( styleDefinitionCache.empty() )
+ {
+ ostringstream os;
+ if ( includeStyleDef )
+ {
+ os << "<style type=\"text/css\">\n"
+ << "<![CDATA[\n";
+ }
+ os << "rect { fill:#"
+ << ( docStyle.getBgColour().getRed ( XML ) )
+ << ( docStyle.getBgColour().getGreen ( XML ) )
+ << ( docStyle.getBgColour().getBlue ( XML ) )
+ << "; } \n";
+ os << "g { font-size: " << getBaseFontSize();
+ os << "; font-family: \"" << getBaseFont() << "\"; }\n";
+ os << getAttributes ( "text", docStyle.getDefaultStyle() )
+ << getAttributes ( "tspan."+STY_NAME_NUM, docStyle.getNumberStyle() )
+ << getAttributes ( "tspan."+STY_NAME_ESC, docStyle.getEscapeCharStyle() )
+ << getAttributes ( "tspan."+STY_NAME_STR, docStyle.getStringStyle() )
+ << getAttributes ( "tspan."+STY_NAME_DST, docStyle.getDirectiveStringStyle() )
+ << getAttributes ( "tspan."+STY_NAME_SLC, docStyle.getSingleLineCommentStyle() )
+ << getAttributes ( "tspan."+STY_NAME_COM, docStyle.getCommentStyle() )
+ << getAttributes ( "tspan."+STY_NAME_DIR, docStyle.getDirectiveStyle() )
+ << getAttributes ( "tspan."+STY_NAME_SYM, docStyle.getSymbolStyle() )
+ << getAttributes ( "tspan."+STY_NAME_LIN, docStyle.getLineStyle() );
+
+ KeywordStyles styles = docStyle.getKeywordStyles();
+ for ( KSIterator it=styles.begin(); it!=styles.end(); it++ )
+ {
+ os << getAttributes ( "tspan."+it->first, it->second );
+ }
+ if ( includeStyleDef )
+ {
+ os << "]]>\n"
+ << "</style>";
+ }
+ styleDefinitionCache=os.str();
+ }
+ return styleDefinitionCache;
+ }
+
+
+ string SVGGenerator::getAttributes ( const string & elemName,
+ const ElementStyle & elem )
+ {
+ ostringstream s;
+ if ( !elemName.empty() )
+ {
+ s << /*cssClassName<<"."<<*/ elemName<<" { ";
+ }
+ s << "fill:#"
+ << ( elem.getColour().getRed ( HTML ) )
+ << ( elem.getColour().getGreen ( HTML ) )
+ << ( elem.getColour().getBlue ( HTML ) )
+ << ( elem.isBold() ? "; font-weight:bold" :"" )
+ << ( elem.isItalic() ? "; font-style:italic" :"" )
+ << ( elem.isUnderline() ? "; text-decoration:underline" :"" );
+ if ( !elemName.empty() )
+ {
+ s << "; }\n" ;
+ }
+ return s.str();
+ }
+
+ string SVGGenerator::getOpenTag ( const string& styleName )
+ {
+ return "<tspan class=\""+styleName+"\">";
+ }
+
+ string SVGGenerator::getHeader()
+ {
+ ostringstream header;
+ header << "<?xml version=\"1.0\"";
+ if ( encodingDefined() )
+ {
+ header << " encoding=\"" << encoding << "\"";
+ }
+ header << "?>\n";
+ if ( !includeStyleDef )
+ {
+ header << "<?xml-stylesheet type=\"text/css\" href=\""
+ << getStyleOutputPath()
+ << "\"?>\n";
+ }
+ header << "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.2//EN\" "
+ << "\"http://www.w3.org/Graphics/SVG/1.2/DTD/svg12.dtd\">\n";
+ header << "<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.2\" "
+ << "baseProfile=\"full\" xml:space=\"preserve\"";
+ if ( width.size() ) header << " width=\""<<width<<"\"";
+ if ( height.size() ) header << " height=\""<<height<<"\"";
+ //viewBox=\"0 0 800 600\"
+ header << ">\n<desc>" << docTitle << "</desc>\n";
+ if ( includeStyleDef )
+ {
+ header << "<defs>\n";
+ header << getStyleDefinition();
+ header << "\n</defs>\n";
+ }
+ return header.str();
+ }
+
+ void SVGGenerator::printBody()
+ {
+ *out << "<g>\n<rect x=\"0\" y=\"0\" width=\"100%\" height=\"100%\"/>"; // rect: background color
+ int fontSize=0;
+ StringTools::str2num<int> ( fontSize, getBaseFontSize(), std::dec );
+ *out << "\n<text x=\"10\" y=\""<<fontSize*2<<"\">";
+ processRootState();
+ *out << "</text>\n</g>\n";
+ }
+
+
+ string SVGGenerator::getFooter()
+ {
+ ostringstream os;
+ os <<"</svg>\n";
+ os<< "<!-- SVG generated by Highlight "
+ << HIGHLIGHT_VERSION
+ << ", "
+ << HIGHLIGHT_URL
+ <<" -->\n";
+ return os.str();
+ }
+
+ string SVGGenerator::maskCharacter ( unsigned char c )
+ {
+ switch ( c )
+ {
+ case '<' :
+ return "&lt;";
+ break;
+ case '>' :
+ return "&gt;";
+ break;
+ case '&' :
+ return "&amp;";
+ break;
+ case '\"' :
+ return "&quot;";
+ break;
+ default:
+ return string ( 1, c );
+ }
+ }
+
+ string SVGGenerator::getKeywordOpenTag ( unsigned int styleID )
+ {
+ return getOpenTag ( langInfo.getKeywordClasses() [styleID] );
+ }
+
+ string SVGGenerator::getKeywordCloseTag ( unsigned int styleID )
+ {
+ return "</tspan>";
+ }
+
+ string SVGGenerator::getNewLine()
+ {
+
+ if ( lineNumber>1 )
+ {
+ ostringstream os;
+ int fontSize=0;
+ StringTools::str2num<int> ( fontSize, getBaseFontSize(), std::dec );
+ os<< "</text>\n<text x=\"10\" y=\""<< ( lineNumber*fontSize*2 ) <<"\">";
+ return os.str();
+ }
+ else
+ {
+ return "";
+ }
+ }
+
+ void SVGGenerator::setSVGSize ( const string& w, const string& h )
+ {
+ width=w;
+ height=h;
+ }
+
+}
diff --git a/support/highlight/src/core/svggenerator.h b/support/highlight/src/core/svggenerator.h
new file mode 100644
index 0000000000..35b8afe57d
--- /dev/null
+++ b/support/highlight/src/core/svggenerator.h
@@ -0,0 +1,95 @@
+/***************************************************************************
+ xmlcode.h - description
+ -------------------
+ begin : Mo 23.06.2008
+ copyright : (C) 2008 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#ifndef SVGGenerator_H
+#define SVGGenerator_H
+
+#include "codegenerator.h"
+
+namespace highlight
+{
+
+ /**
+ \brief This class generates SVG.
+
+ It contains information about the resulting document structure (document
+ header and footer), the colour system, white space handling and text
+ formatting attributes.
+
+ * @author Andre Simon
+ */
+
+ class SVGGenerator : public highlight::CodeGenerator
+ {
+ public:
+
+ SVGGenerator();
+ ~SVGGenerator();
+
+ /** Set SVG dimensions
+ \param w page width
+ \param h page height
+ */
+ void setSVGSize ( const string& w, const string& h );
+
+ private:
+
+ /** prints document header
+ */
+ string getHeader();
+
+ /** Prints document footer*/
+ string getFooter();
+
+ /** Prints document body*/
+ void printBody();
+
+ /** initialize tags in specific format according to colouring information provided in DucumentStyle */
+ void initOutputTags();
+
+ string styleDefinitionCache;
+ string width, height;
+
+ string getStyleDefinition();
+
+ string getAttributes ( const string &, const ElementStyle & );
+
+ /** \return escaped character*/
+ virtual string maskCharacter ( unsigned char );
+
+ string getOpenTag ( const string& );
+
+ string getKeywordOpenTag ( unsigned int styleID );
+ string getKeywordCloseTag ( unsigned int styleID );
+
+ /** @return Newline string */
+ string getNewLine();
+ };
+
+}
+
+#endif
diff --git a/support/highlight/src/core/texgenerator.cpp b/support/highlight/src/core/texgenerator.cpp
new file mode 100644
index 0000000000..276af5a7c6
--- /dev/null
+++ b/support/highlight/src/core/texgenerator.cpp
@@ -0,0 +1,303 @@
+/***************************************************************************
+ TexGenerator.cpp - description
+ -------------------
+ begin : Mit Jul 24 2002
+ copyright : (C) 2002 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#include <sstream>
+
+#include "charcodes.h"
+#include "version.h"
+#include "texgenerator.h"
+
+namespace highlight
+{
+
+ TexGenerator::TexGenerator()
+ : CodeGenerator ( TEX )
+ {
+
+
+ /*This makes TeX to use every par it encounters (the \\leavevmode has
+ no effect when TeX is in horizontal mode and when TeX is in vertical
+ mode, it switches it to horizontal mode).*/
+ newLineTag="\\leavevmode\\par\n";
+
+ spacer = "\\ ";
+ maskWs=true;
+ excludeWs=true;
+ maskWsBegin = "{\\hlstd";
+ maskWsEnd = "}";
+ styleCommentOpen="%";
+ }
+
+ TexGenerator::~TexGenerator()
+ {}
+
+ void TexGenerator::initOutputTags(){
+ openTags.push_back ( "{\\hl"+STY_NAME_STD+" " );
+ openTags.push_back ( "{\\hl"+STY_NAME_STR+" " );
+ openTags.push_back ( "{\\hl"+STY_NAME_NUM+" " );
+ openTags.push_back ( "{\\hl"+STY_NAME_SLC+" " );
+ openTags.push_back ( "{\\hl"+STY_NAME_COM+" " );
+ openTags.push_back ( "{\\hl"+STY_NAME_ESC+" " );
+ openTags.push_back ( "{\\hl"+STY_NAME_DIR+" " );
+ openTags.push_back ( "{\\hl"+STY_NAME_DST+" " );
+ openTags.push_back ( "{\\hl"+STY_NAME_LIN+" " );
+ openTags.push_back ( "{\\hl"+STY_NAME_SYM+" " );
+
+ for ( int i=0; i<NUMBER_BUILTIN_STATES; i++ )
+ {
+ closeTags.push_back ( "}" );
+ }
+ }
+
+ string TexGenerator::getAttributes ( const string & elemName,const ElementStyle & elem )
+ {
+ ostringstream s;
+ s << "\\def\\hl"
+ << elemName
+ << "{";
+ if ( elem.isBold() ) s << "\\bf";
+ if ( elem.isItalic() ) s << "\\it";
+ s << "\\textColor{"
+ << ( elem.getColour().getRed ( TEX ) ) <<" "
+ << ( elem.getColour().getGreen ( TEX ) ) <<" "
+ << ( elem.getColour().getBlue ( TEX ) ) <<" 0.0}}\n";
+ return s.str();
+ }
+
+ string TexGenerator::getHeader()
+ {
+ ostringstream os;
+ os << styleCommentOpen
+ << " Document title: " << docTitle << "\n\n";
+ if ( langInfo.highlightingEnabled() )
+ {
+ if ( includeStyleDef )
+ {
+ os << getStyleDefinition();
+ os << CodeGenerator::readUserStyleDef();
+ }
+ else
+ {
+ os << "\\input "
+ << getStyleOutputPath()
+ << "\n\n";
+ }
+ }
+
+ return os.str();
+ }
+
+ void TexGenerator::printBody()
+ {
+ *out << "{\n\\"<<getBaseFont() <<"\n";
+
+ processRootState();
+
+ *out << "}\n";
+ }
+
+ string TexGenerator::getFooter()
+ {
+ ostringstream os;
+ os << "\\bye\n"
+ << "% TeX generated by Highlight "
+ << HIGHLIGHT_VERSION
+ << ", "
+ << HIGHLIGHT_URL
+ << endl;
+ return os.str();
+ }
+
+ string TexGenerator:: maskCharacter ( unsigned char c )
+ {
+ switch ( c )
+ {
+ case '{':
+ case '}':
+ {
+ string m ( "$\\" );
+ m += c;
+ m += '$';
+ return m;
+ }
+ break;
+ case '^':
+ return "{\\bf\\^{}}";
+ break;
+ case '_':
+ return "\\_{}";
+ break;
+ case '&':
+ case '$':
+ case '#':
+ case '%':
+ {
+ string m ( "\\" );
+ m += c;
+ return m;
+ }
+ break;
+ case '\\':
+ return "$\\backslash$";
+ break;
+ case ' ':
+ return spacer;
+ break;
+ case '+':
+ case '-':
+ case '<':
+ case '>':
+ case '=':
+ {
+ string m ( "$\\mathord{" );
+ m += c;
+ m += "}$";
+ return m;
+ }
+ break;
+ case AUML_LC:
+ return "\\\"a";
+ break;
+ case OUML_LC:
+ return "\\\"o";
+ break;
+ case UUML_LC:
+ return "\\\"u";
+ break;
+ case AUML_UC:
+ return "\\\"A";
+ break;
+ case OUML_UC:
+ return "\\\"O";
+ break;
+ case UUML_UC:
+ return "\\\"U";
+ break;
+ case AACUTE_LC:
+ return "\\'a";
+ break;
+ case EACUTE_LC:
+ return "\\'e";
+ break;
+ case OACUTE_LC:
+ return "\\'o";
+ break;
+ case UACUTE_LC:
+ return "\\'u";
+ break;
+ case AGRAVE_LC:
+ return "\\`a";
+ break;
+ case EGRAVE_LC:
+ return "\\`e";
+ break;
+ case OGRAVE_LC:
+ return "\\`o";
+ break;
+ case UGRAVE_LC:
+ return "\\`u";
+ break;
+ case AACUTE_UC:
+ return "\\'A";
+ break;
+ case EACUTE_UC:
+ return "\\'E";
+ break;
+ case OACUTE_UC:
+ return "\\'O";
+ break;
+ case UACUTE_UC:
+ return "\\'U";
+ break;
+ case AGRAVE_UC:
+ return "\\`A";
+ break;
+ case EGRAVE_UC:
+ return "\\`E";
+ break;
+ case UGRAVE_UC:
+ return "\\`O";
+ break;
+ case OGRAVE_UC:
+ return "\\`U";
+ break;
+ case SZLIG:
+ return "\\ss ";
+ break;
+
+ default :
+ return string ( 1, c );
+ }
+ }
+
+ string TexGenerator::getKeywordOpenTag ( unsigned int styleID )
+ {
+ return "{\\hl"+langInfo.getKeywordClasses() [styleID]+" ";
+ }
+
+ string TexGenerator::getKeywordCloseTag ( unsigned int styleID )
+ {
+ return "}";
+ }
+
+
+ string TexGenerator::getStyleDefinition()
+ {
+ if ( styleDefinitionCache.empty() )
+ {
+ ostringstream os;
+ os << getAttributes ( STY_NAME_STD, docStyle.getDefaultStyle() );
+ os << getAttributes ( STY_NAME_NUM, docStyle.getNumberStyle() );
+ os << getAttributes ( STY_NAME_ESC, docStyle.getEscapeCharStyle() );
+ os << getAttributes ( STY_NAME_STR, docStyle.getStringStyle() );
+ os << getAttributes ( STY_NAME_DST, docStyle.getDirectiveStringStyle() );
+ os << getAttributes ( STY_NAME_SLC, docStyle.getSingleLineCommentStyle() );
+ os << getAttributes ( STY_NAME_COM, docStyle.getCommentStyle() );
+ os << getAttributes ( STY_NAME_DIR, docStyle.getDirectiveStyle() );
+ os << getAttributes ( STY_NAME_LIN, docStyle.getLineStyle() );
+ os << getAttributes ( STY_NAME_SYM, docStyle.getSymbolStyle() );
+
+ KeywordStyles styles = docStyle.getKeywordStyles();
+ for ( KSIterator it=styles.begin(); it!=styles.end(); it++ )
+ {
+ os << getAttributes ( it->first, it->second );
+ }
+
+ os << "% The special option is not supported by all dvi drivers\n"
+ << "\\special{background rgb "
+ << docStyle.getBgColour().getRed ( LATEX ) << " "
+ << docStyle.getBgColour().getGreen ( LATEX ) << " "
+ << docStyle.getBgColour().getBlue ( LATEX ) << "}";
+ os << "\n\\nopagenumbers\n"
+ << "\\input colordvi\n";
+ styleDefinitionCache=os.str();
+ }
+ return styleDefinitionCache;
+ }
+
+
+}
diff --git a/support/highlight/src/core/texgenerator.h b/support/highlight/src/core/texgenerator.h
new file mode 100644
index 0000000000..becd31cd57
--- /dev/null
+++ b/support/highlight/src/core/texgenerator.h
@@ -0,0 +1,93 @@
+/***************************************************************************
+ texcode.h - description
+ -------------------
+ begin : Mit Jul 24 2002
+ copyright : (C) 2002 by Andr�Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#ifndef TEXGENERATOR_H
+#define TEXGENERATOR_H
+
+#include <string>
+
+#include "codegenerator.h"
+
+
+namespace highlight
+{
+
+ /**
+ \brief This class generates TeX.
+
+ It contains information about the resulting document structure (document
+ header and footer), the colour system, white space handling and text
+ formatting attributes.
+
+ * @author Andre Simon
+ */
+
+ class TexGenerator : public highlight::CodeGenerator
+ {
+ public:
+
+ TexGenerator();
+ ~TexGenerator();
+
+ private:
+
+ /** prints document header
+ */
+ string getHeader();
+
+ /** Prints document footer*/
+ string getFooter();
+
+ /** Prints document body*/
+ void printBody();
+
+ /** initialize tags in specific format according to colouring information provided in DucumentStyle */
+ void initOutputTags();
+
+ string styleDefinitionCache;
+
+ string getStyleDefinition();
+
+ /** \return escaped character*/
+ virtual string maskCharacter ( unsigned char );
+
+ /**\return text formatting attributes in RTF format */
+ string getAttributes ( const string & elemName, const ElementStyle & elem );
+
+ /** @param styleID current style ID
+ @return matching sequence to begin a new element formatting*/
+ string getKeywordOpenTag ( unsigned int styleID );
+
+ /** @param styleID current style ID
+ @return matching sequence to stop element formatting*/
+ string getKeywordCloseTag ( unsigned int styleID );
+
+ };
+
+}
+
+#endif
diff --git a/support/highlight/src/core/version.h b/support/highlight/src/core/version.h
new file mode 100644
index 0000000000..a667705b9e
--- /dev/null
+++ b/support/highlight/src/core/version.h
@@ -0,0 +1,36 @@
+/***************************************************************************
+ version.h - description
+ -------------------
+ begin : Mon March 3 2003
+ copyright : (C) 2003-2010 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#ifndef VERSION_H
+#define VERSION_H
+
+#define HIGHLIGHT_VERSION "2.16"
+
+#define HIGHLIGHT_URL "http://www.andre-simon.de/"
+#define HIGHLIGHT_EMAIL "andre.simon1@gmx.de"
+
+#endif
diff --git a/support/highlight/src/core/xhtmlgenerator.cpp b/support/highlight/src/core/xhtmlgenerator.cpp
new file mode 100644
index 0000000000..aed05a2986
--- /dev/null
+++ b/support/highlight/src/core/xhtmlgenerator.cpp
@@ -0,0 +1,92 @@
+/***************************************************************************
+ htmlcode.cpp - description
+ -------------------
+ begin : Wed Nov 28 2001
+ copyright : (C) 2001 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#include "xhtmlgenerator.h"
+
+using namespace std;
+
+namespace highlight
+{
+
+ XHtmlGenerator::XHtmlGenerator ()
+ {
+ fileSuffix=".xhtml";
+ brTag="<br />";
+ hrTag="<hr />";
+ idAttr="id";
+ cssClassName="hl";
+ }
+
+ string XHtmlGenerator::getHeaderStart ( const string &title )
+ {
+ ostringstream header;
+ header << "<?xml version=\"1.0\"";
+ if ( encodingDefined() )
+ {
+ header << " encoding=\"" << encoding << "\"";
+ }
+ header << "?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\""
+ << " \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n"
+ << "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n"
+ << "<head>\n<title>" << title << "</title>\n";
+
+ return header.str();
+ }
+
+
+ string XHtmlGenerator::getHeader()
+ {
+ ostringstream os;
+ os << getHeaderStart ( docTitle );
+
+ if ( langInfo.highlightingEnabled() )
+ {
+ if ( includeStyleDef )
+ {
+ os << "<style type=\"text/css\">\n";
+ os << "<![CDATA[\n";
+ os << getStyleDefinition();
+ os << CodeGenerator::readUserStyleDef();
+ os << "]]>\n";
+ os << "</style>\n";
+ }
+ else
+ {
+ os << "<link rel=\"stylesheet\" type=\"text/css\" href=\""
+ << getStyleOutputPath()
+ << "\""
+ << "/"
+ << ">\n";
+ }
+ }
+ os << "</head>\n<body class=\""<<cssClassName<<"\">";
+ //if (showLineNumbers && orderedList) os << "<ol>";
+
+ return os.str();
+ }
+
+}
diff --git a/support/highlight/src/core/xhtmlgenerator.h b/support/highlight/src/core/xhtmlgenerator.h
new file mode 100644
index 0000000000..7efca1a636
--- /dev/null
+++ b/support/highlight/src/core/xhtmlgenerator.h
@@ -0,0 +1,68 @@
+/***************************************************************************
+ xhtmlgenerator.h - description
+ -------------------
+ begin : Mo Jun 21 2004
+ copyright : (C) 2004 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+
+#ifndef XHTMLGENERATOR_H
+#define XHTMLGENERATOR_H
+
+#include "htmlgenerator.h"
+
+namespace highlight
+{
+
+ /**
+ \brief This class generates XHTML.
+
+ It contains information about the resulting document structure (document
+ header and footer), the colour system, white space handling and text
+ formatting attributes.
+
+ * @author Andre Simon
+ */
+
+
+ class XHtmlGenerator : public highlight::HtmlGenerator
+ {
+ public:
+
+ XHtmlGenerator();
+
+ ~XHtmlGenerator() {};
+
+ private:
+
+ /** prints document header
+ */
+ string getHeader();
+
+ string getHeaderStart ( const string &title );
+
+ };
+
+}
+
+#endif
diff --git a/support/highlight/src/core/xmlgenerator.cpp b/support/highlight/src/core/xmlgenerator.cpp
new file mode 100644
index 0000000000..dd66dd2652
--- /dev/null
+++ b/support/highlight/src/core/xmlgenerator.cpp
@@ -0,0 +1,202 @@
+/***************************************************************************
+ xmlcode.cpp - description
+ -------------------
+ begin : Do 20.01.2005
+ copyright : (C) 2005 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#include <string>
+#include <sstream>
+
+#include "version.h"
+#include "xmlgenerator.h"
+
+using namespace std;
+namespace highlight
+{
+
+ XmlGenerator::XmlGenerator()
+ : CodeGenerator ( XML )
+ {
+ spacer = " ";
+ newLineTag = "<br />\n";
+ }
+
+ XmlGenerator::~XmlGenerator() {}
+
+ string XmlGenerator::getHeader()
+ {
+ ostringstream header;
+ header << "<?xml version=\"1.0\"";
+ if ( encodingDefined() )
+ {
+ header << " encoding=\"" << encoding << "\"";
+ }
+ header << "?>\n<document>";
+ header << "\n<title>" << docTitle << "</title>";
+ header << getStyleDefinition();
+ return header.str();
+ }
+
+ void XmlGenerator::printBody()
+ {
+ *out << "<source>\n";
+ processRootState();
+ *out << "</source>\n";
+ }
+
+
+ string XmlGenerator::getFooter()
+ {
+ ostringstream os;
+ os <<"</document>\n";
+ os<< "<!-- XML generated by Highlight "
+ << HIGHLIGHT_VERSION
+ << ", "
+ << HIGHLIGHT_URL
+ <<" -->\n";
+ return os.str();
+ }
+
+ void XmlGenerator::initOutputTags(){
+ openTags.push_back ( getOpenTag ( STY_NAME_STD ) );
+ openTags.push_back ( getOpenTag ( STY_NAME_STR ) );
+ openTags.push_back ( getOpenTag ( STY_NAME_NUM ) );
+ openTags.push_back ( getOpenTag ( STY_NAME_SLC ) );
+ openTags.push_back ( getOpenTag ( STY_NAME_COM ) );
+ openTags.push_back ( getOpenTag ( STY_NAME_ESC ) );
+ openTags.push_back ( getOpenTag ( STY_NAME_DIR ) );
+ openTags.push_back ( getOpenTag ( STY_NAME_DST ) );
+ openTags.push_back ( getOpenTag ( STY_NAME_LIN ) );
+ openTags.push_back ( getOpenTag ( STY_NAME_SYM ) );
+
+ closeTags.push_back ( getCloseTag ( STY_NAME_STD ) );
+ closeTags.push_back ( getCloseTag ( STY_NAME_STR ) );
+ closeTags.push_back ( getCloseTag ( STY_NAME_NUM ) );
+ closeTags.push_back ( getCloseTag ( STY_NAME_SLC ) );
+ closeTags.push_back ( getCloseTag ( STY_NAME_COM ) );
+ closeTags.push_back ( getCloseTag ( STY_NAME_ESC ) );
+ closeTags.push_back ( getCloseTag ( STY_NAME_DIR ) );
+ closeTags.push_back ( getCloseTag ( STY_NAME_DST ) );
+ closeTags.push_back ( getCloseTag ( STY_NAME_LIN ) );
+ closeTags.push_back ( getCloseTag ( STY_NAME_SYM ) );
+ }
+
+ string XmlGenerator::getStyleDefinition()
+ {
+ if ( styleDefinitionCache.empty() )
+ {
+ ostringstream os;
+ os << "\n<style>\n"
+ << "\t<bgcolor value=\""
+ << ( docStyle.getBgColour().getRed ( XML ) )
+ << ( docStyle.getBgColour().getGreen ( XML ) )
+ << ( docStyle.getBgColour().getBlue ( XML ) )
+ << "\" />\n";
+ os << "\t<font size=\"" << getBaseFontSize();
+ os << "\" family=\"" << getBaseFont() << "\" />\n";
+ os << getAttributes ( STY_NAME_STD, docStyle.getDefaultStyle() )
+ << getAttributes ( STY_NAME_NUM, docStyle.getNumberStyle() )
+ << getAttributes ( STY_NAME_ESC, docStyle.getEscapeCharStyle() )
+ << getAttributes ( STY_NAME_STR, docStyle.getStringStyle() )
+ << getAttributes ( STY_NAME_DST, docStyle.getDirectiveStringStyle() )
+ << getAttributes ( STY_NAME_SLC, docStyle.getSingleLineCommentStyle() )
+ << getAttributes ( STY_NAME_COM, docStyle.getCommentStyle() )
+ << getAttributes ( STY_NAME_DIR, docStyle.getDirectiveStyle() )
+ << getAttributes ( STY_NAME_SYM, docStyle.getSymbolStyle() )
+ << getAttributes ( STY_NAME_LIN, docStyle.getLineStyle() );
+
+ KeywordStyles styles = docStyle.getKeywordStyles();
+ for ( KSIterator it=styles.begin(); it!=styles.end(); it++ )
+ {
+ os << getAttributes ( it->first, it->second );
+ }
+ os << "</style>\n";
+ styleDefinitionCache=os.str();
+ }
+ return styleDefinitionCache;
+ }
+
+
+ string XmlGenerator::getAttributes ( const string & elemName,
+ const ElementStyle & elem )
+ {
+ ostringstream s;
+ s << "\t<class name=\""
+ << elemName
+ <<"\" color=\""
+ << ( elem.getColour().getRed ( XML ) )
+ << ( elem.getColour().getGreen ( XML ) )
+ << ( elem.getColour().getBlue ( XML ) )
+ << "\" bold=\""
+ << ( elem.isBold() ? "true" :"false" )
+ << "\" italic=\""
+ << ( elem.isItalic() ? "true" :"false" )
+ << "\" underline=\""
+ << ( elem.isUnderline() ? "true" :"false" )
+ << "\" />\n" ;
+ return s.str();
+ }
+
+ string XmlGenerator::getOpenTag ( const string& styleName )
+ {
+ return "<"+styleName+">";
+ }
+
+ string XmlGenerator::getCloseTag ( const string& styleName )
+ {
+ return "</"+styleName+">";
+ }
+
+ string XmlGenerator::maskCharacter ( unsigned char c )
+ {
+ switch ( c )
+ {
+ case '<' :
+ return "&lt;";
+ break;
+ case '>' :
+ return "&gt;";
+ break;
+ case '&' :
+ return "&amp;";
+ break;
+ case '\"' :
+ return "&quot;";
+ break;
+ default:
+ return string ( 1, c );
+ }
+ }
+
+ string XmlGenerator::getKeywordOpenTag ( unsigned int styleID )
+ {
+ return getOpenTag ( langInfo.getKeywordClasses() [styleID] );
+ }
+
+ string XmlGenerator::getKeywordCloseTag ( unsigned int styleID )
+ {
+ return getCloseTag ( langInfo.getKeywordClasses() [styleID] );
+ }
+
+}
diff --git a/support/highlight/src/core/xmlgenerator.h b/support/highlight/src/core/xmlgenerator.h
new file mode 100644
index 0000000000..74319fdec7
--- /dev/null
+++ b/support/highlight/src/core/xmlgenerator.h
@@ -0,0 +1,86 @@
+/***************************************************************************
+ xmlcode.h - description
+ -------------------
+ begin : Do 20.01.2005
+ copyright : (C) 2005 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#ifndef XMLGENERATOR_H
+#define XMLGENERATOR_H
+
+#include "codegenerator.h"
+
+namespace highlight
+{
+
+ /**
+ \brief This class generates XML.
+
+ It contains information about the resulting document structure (document
+ header and footer), the colour system, white space handling and text
+ formatting attributes.
+
+ * @author Andre Simon
+ */
+
+ class XmlGenerator : public highlight::CodeGenerator
+ {
+ public:
+
+ XmlGenerator();
+ ~XmlGenerator();
+
+ private:
+
+ /** prints document header
+ */
+ string getHeader();
+
+ /** Prints document footer*/
+ string getFooter();
+
+ /** Prints document body*/
+ void printBody();
+
+ /** initialize tags in specific format according to colouring information provided in DucumentStyle */
+ void initOutputTags();
+
+ string styleDefinitionCache;
+
+ string getStyleDefinition();
+
+ string getAttributes ( const string &, const ElementStyle & );
+
+ /** \return escaped character*/
+ virtual string maskCharacter ( unsigned char );
+
+ string getOpenTag ( const string& );
+ string getCloseTag ( const string& );
+
+ string getKeywordOpenTag ( unsigned int styleID );
+ string getKeywordCloseTag ( unsigned int styleID );
+ };
+
+}
+
+#endif
diff --git a/support/highlight/src/core/xterm256generator.cpp b/support/highlight/src/core/xterm256generator.cpp
new file mode 100644
index 0000000000..d351d19b8d
--- /dev/null
+++ b/support/highlight/src/core/xterm256generator.cpp
@@ -0,0 +1,208 @@
+/***************************************************************************
+ xterm256generator.cpp - description
+ -------------------
+ begin : Oct 13 2006
+ copyright : (C) 2006 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+#include <sstream>
+
+#include "xterm256generator.h"
+#include "charcodes.h"
+#include "version.h"
+
+using namespace std;
+
+namespace highlight
+{
+ Xterm256Generator::Xterm256Generator() : CodeGenerator ( XTERM256 )
+ {
+
+ newLineTag = "\n";
+ spacer = " ";
+ }
+
+ Xterm256Generator::~Xterm256Generator() {}
+
+ string Xterm256Generator::getHeader()
+ {
+ return string();
+ }
+
+ void Xterm256Generator::printBody()
+ {
+ processRootState();
+ }
+
+ string Xterm256Generator::getFooter()
+ {
+ return string();
+ }
+
+ string Xterm256Generator::maskCharacter ( unsigned char c )
+ {
+ return string ( 1, c );
+ }
+
+ void Xterm256Generator::initOutputTags ( )
+ {
+ openTags.push_back ( getOpenTag ( docStyle.getDefaultStyle() ) );
+ openTags.push_back ( getOpenTag ( docStyle.getStringStyle() ) );
+ openTags.push_back ( getOpenTag ( docStyle.getNumberStyle() ) );
+ openTags.push_back ( getOpenTag ( docStyle.getSingleLineCommentStyle() ) );
+ openTags.push_back ( getOpenTag ( docStyle.getCommentStyle() ) );
+ openTags.push_back ( getOpenTag ( docStyle.getEscapeCharStyle() ) );
+ openTags.push_back ( getOpenTag ( docStyle.getDirectiveStyle() ) );
+ openTags.push_back ( getOpenTag ( docStyle.getDirectiveStringStyle() ) );
+ openTags.push_back ( getOpenTag ( docStyle.getLineStyle() ) );
+ openTags.push_back ( getOpenTag ( docStyle.getSymbolStyle() ) );
+
+ for ( int i=0;i<NUMBER_BUILTIN_STATES; i++ )
+ {
+ closeTags.push_back ( "\033[m" );
+ }
+ }
+
+ string Xterm256Generator::getOpenTag ( const ElementStyle &col )
+ {
+
+ Colour c= col.getColour();
+ unsigned char rgb[3];
+ rgb[0] = ( unsigned char ) strtoll ( c.getRed ( HTML ).c_str(), NULL, 16 );
+ rgb[1] = ( unsigned char ) strtoll ( c.getGreen ( HTML ).c_str(), NULL, 16 );
+ rgb[2] = ( unsigned char ) strtoll ( c.getBlue ( HTML ).c_str(), NULL, 16 );
+
+ ostringstream s;
+ s << "\033[38;5;"<< ( int ) rgb2xterm ( rgb ) << "m";
+ return s.str();
+ }
+
+ string Xterm256Generator::getKeywordOpenTag ( unsigned int styleID )
+ {
+ return getOpenTag ( docStyle.getKeywordStyle ( langInfo.getKeywordClasses() [styleID] ) );
+ }
+
+ string Xterm256Generator::getKeywordCloseTag ( unsigned int styleID )
+ {
+ return "\033[m";
+ }
+
+ /* the following functions are based on Wolfgang Frischs xterm256 converter utility:
+ http://frexx.de/xterm-256-notes/
+ */
+
+ void Xterm256Generator::xterm2rgb ( unsigned char color, unsigned char* rgb )
+ {
+ // 16 basic colors
+ if ( color<16 )
+ {
+ rgb[0] = basic16[color][0];
+ rgb[1] = basic16[color][1];
+ rgb[2] = basic16[color][2];
+ }
+
+ // color cube color
+ if ( color>=16 && color<=232 )
+ {
+ color-=16;
+ rgb[0] = valuerange[ ( color/36 ) %6];
+ rgb[1] = valuerange[ ( color/6 ) %6];
+ rgb[2] = valuerange[color%6];
+ }
+
+ // gray tone
+ if ( color>=233 && color<=253 )
+ {
+ rgb[0]=rgb[1]=rgb[2] = 8+ ( color-232 ) *0x0a;
+ }
+ }
+
+ void Xterm256Generator::maketable()
+ {
+ unsigned char c, rgb[3];
+ for ( c=0;c<=253;c++ )
+ {
+ xterm2rgb ( c,rgb );
+ colortable[c][0] = rgb[0];
+ colortable[c][1] = rgb[1];
+ colortable[c][2] = rgb[2];
+ }
+ }
+
+ unsigned char Xterm256Generator::rgb2xterm ( unsigned char* rgb )
+ {
+ unsigned char c, best_match=0;
+ double d, smallest_distance;
+
+ if ( !initialized )
+ {
+ maketable();
+ initialized = true;
+ }
+
+ smallest_distance = 10000000000.0;
+
+ for ( c=0;c<=253;c++ )
+ {
+ d = pow ( colortable[c][0]-rgb[0],2.0 ) +
+ pow ( colortable[c][1]-rgb[1],2.0 ) +
+ pow ( colortable[c][2]-rgb[2],2.0 );
+ if ( d<smallest_distance )
+ {
+ smallest_distance = d;
+ best_match=c;
+ }
+ }
+ return best_match;
+ }
+
+ bool Xterm256Generator::initialized=false;
+ unsigned char Xterm256Generator::colortable[254][3];
+
+ const unsigned char Xterm256Generator::valuerange[] = { 0x00, 0x5F, 0x87, 0xAF, 0xD7, 0xFF };
+
+ const unsigned char Xterm256Generator::basic16[16][3] =
+ {
+ { 0x00, 0x00, 0x00 }, // 0
+ { 0xCD, 0x00, 0x00 }, // 1
+ { 0x00, 0xCD, 0x00 }, // 2
+ { 0xCD, 0xCD, 0x00 }, // 3
+ { 0x00, 0x00, 0xEE }, // 4
+ { 0xCD, 0x00, 0xCD }, // 5
+ { 0x00, 0xCD, 0xCD }, // 6
+ { 0xE5, 0xE5, 0xE5 }, // 7
+ { 0x7F, 0x7F, 0x7F }, // 8
+ { 0xFF, 0x00, 0x00 }, // 9
+ { 0x00, 0xFF, 0x00 }, // 10
+ { 0xFF, 0xFF, 0x00 }, // 11
+ { 0x5C, 0x5C, 0xFF }, // 12
+ { 0xFF, 0x00, 0xFF }, // 13
+ { 0x00, 0xFF, 0xFF }, // 14
+ { 0xFF, 0xFF, 0xFF } // 15
+ };
+
+
+}
diff --git a/support/highlight/src/core/xterm256generator.h b/support/highlight/src/core/xterm256generator.h
new file mode 100644
index 0000000000..e68b78c4c6
--- /dev/null
+++ b/support/highlight/src/core/xterm256generator.h
@@ -0,0 +1,111 @@
+/***************************************************************************
+ xterm256generator.h - description
+ -------------------
+ begin : Oct 13 2006
+ copyright : (C) 2006-2007 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#ifndef XTERM256GENERATOR_H
+#define XTERM256GENERATOR_H
+
+#include <string>
+
+#include "codegenerator.h"
+
+
+namespace highlight
+{
+
+ /**
+ \brief This class generates xterm 256 color escape sequences.
+
+ It contains information about the resulting document structure (document
+ header and footer), the colour system, white space handling and text
+ formatting attributes.
+
+ * @author Andre Simon
+ */
+
+ class Xterm256Generator : public highlight::CodeGenerator
+ {
+ public:
+ Xterm256Generator();
+ ~Xterm256Generator();
+
+ private:
+
+ /** prints document header
+ */
+ string getHeader();
+
+ /** Prints document footer*/
+ string getFooter();
+
+ /** Prints document body*/
+ void printBody();
+
+ /** \return escaped character*/
+ virtual string maskCharacter ( unsigned char );
+
+ /** initialize tags in specific format according to colouring information provided in DucumentStyle */
+ void initOutputTags();
+
+ /** @param style associated element style
+ @return formatting seqence */
+ string getOpenTag (const ElementStyle &style );
+
+ /** @param styleID current style ID
+ @return matching sequence to begin a new element formatting*/
+ string getKeywordOpenTag ( unsigned int styleID );
+
+ /** @param styleID current style ID
+ @return matching sequence to close element formatting*/
+ string getKeywordCloseTag ( unsigned int styleID );
+
+ /** convert an xterm color value (0-253) to 3 unsigned chars rgb
+ @param color xterm color
+ @param rgb RGB destination string */
+ void xterm2rgb ( unsigned char color, unsigned char* rgb );
+
+ /** fill the colortable for use with rgb2xterm */
+ void maketable();
+
+ /** selects the nearest xterm color for a 3xBYTE rgb value
+ @param RGB colour string */
+ unsigned char rgb2xterm ( unsigned char* rgb );
+
+ /// Flag to determine if colourtable is calculated
+ static bool initialized;
+
+ /// color tzable for nearest match calculation
+ static unsigned char colortable[254][3];
+
+ /// the 6 value iterations in the xterm color cube
+ static const unsigned char valuerange[] ;
+
+ /// 16 basic colors
+ static const unsigned char basic16[16][3];
+ };
+
+}
+#endif
diff --git a/support/highlight/src/gui-qt/Makefile b/support/highlight/src/gui-qt/Makefile
new file mode 100644
index 0000000000..588c30faec
--- /dev/null
+++ b/support/highlight/src/gui-qt/Makefile
@@ -0,0 +1,277 @@
+#############################################################################
+# Makefile for building: ../highlight-gui
+# Generated by qmake (2.01a) (Qt 4.6.2) on: Mi. Mrz 31 16:43:25 2010
+# Project: highlight.pro
+# Template: app
+# Command: /usr/bin/qmake -unix DEFINES+=DATA_DIR=\\\/usr/share/highlight/\\\\ CONFIG_DIR=\\\/etc/highlight/\\\\ DOC_DIR=\\\/usr/share/doc/highlight/\\\ -o Makefile highlight.pro
+#############################################################################
+
+####### Compiler, tools and options
+
+CC = gcc
+CXX = g++
+DEFINES = -DDATA_DIR=\"/usr/share/highlight/\" -DCONFIG_DIR=\"/etc/highlight/\" -DDOC_DIR=\"/usr/share/doc/highlight/\" -DO2 -DQT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
+CFLAGS = -pipe -march=i686 -mtune=generic -O2 -pipe -Wall -W -D_REENTRANT $(DEFINES)
+CXXFLAGS = -pipe -march=i686 -mtune=generic -O2 -pipe -Wall -W -D_REENTRANT $(DEFINES)
+INCPATH = -I/usr/share/qt/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include -I. -I../core -I. -I.
+LINK = g++
+LFLAGS = -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-O1
+LIBS = $(SUBLIBS) -L/usr/lib -L.. -lhighlight -lQtGui -lQtCore -lpthread
+AR = ar cqs
+RANLIB =
+QMAKE = /usr/bin/qmake
+TAR = tar -cf
+COMPRESS = gzip -9f
+COPY = cp -f
+SED = sed
+COPY_FILE = $(COPY)
+COPY_DIR = $(COPY) -r
+STRIP = strip
+INSTALL_FILE = install -m 644 -p
+INSTALL_DIR = $(COPY_DIR)
+INSTALL_PROGRAM = install -m 755 -p
+DEL_FILE = rm -f
+SYMLINK = ln -f -s
+DEL_DIR = rmdir
+MOVE = mv -f
+CHK_DIR_EXISTS= test -d
+MKDIR = mkdir -p
+
+####### Output directory
+
+OBJECTS_DIR = ./
+
+####### Files
+
+SOURCES = main.cpp \
+ mainwindow.cpp \
+ io_report.cpp \
+ showtextfile.cpp moc_mainwindow.cpp \
+ moc_io_report.cpp \
+ moc_showtextfile.cpp \
+ qrc_highlight-gui.cpp
+OBJECTS = main.o \
+ mainwindow.o \
+ io_report.o \
+ showtextfile.o \
+ moc_mainwindow.o \
+ moc_io_report.o \
+ moc_showtextfile.o \
+ qrc_highlight-gui.o
+DIST = /usr/share/qt/mkspecs/common/g++.conf \
+ /usr/share/qt/mkspecs/common/unix.conf \
+ /usr/share/qt/mkspecs/common/linux.conf \
+ /usr/share/qt/mkspecs/qconfig.pri \
+ /usr/share/qt/mkspecs/features/qt_functions.prf \
+ /usr/share/qt/mkspecs/features/qt_config.prf \
+ /usr/share/qt/mkspecs/features/exclusive_builds.prf \
+ /usr/share/qt/mkspecs/features/default_pre.prf \
+ /usr/share/qt/mkspecs/features/release.prf \
+ /usr/share/qt/mkspecs/features/default_post.prf \
+ /usr/share/qt/mkspecs/features/warn_on.prf \
+ /usr/share/qt/mkspecs/features/qt.prf \
+ /usr/share/qt/mkspecs/features/unix/thread.prf \
+ /usr/share/qt/mkspecs/features/moc.prf \
+ /usr/share/qt/mkspecs/features/resources.prf \
+ /usr/share/qt/mkspecs/features/uic.prf \
+ /usr/share/qt/mkspecs/features/yacc.prf \
+ /usr/share/qt/mkspecs/features/lex.prf \
+ /usr/share/qt/mkspecs/features/include_source_dir.prf \
+ highlight.pro
+QMAKE_TARGET = highlight-gui
+DESTDIR = ../
+TARGET = ../highlight-gui
+
+first: all
+####### Implicit rules
+
+.SUFFIXES: .o .c .cpp .cc .cxx .C
+
+.cpp.o:
+ $(CXX) -c -include highlight-gui $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
+
+.cc.o:
+ $(CXX) -c -include highlight-gui $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
+
+.cxx.o:
+ $(CXX) -c -include highlight-gui $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
+
+.C.o:
+ $(CXX) -c -include highlight-gui $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
+
+.c.o:
+ $(CC) -c -include highlight-gui $(CFLAGS) $(INCPATH) -o "$@" "$<"
+
+####### Build rules
+
+all: Makefile $(TARGET)
+
+$(TARGET): ui_mainwindow.h ui_io_report.h ui_showtextfile.h $(OBJECTS)
+ @$(CHK_DIR_EXISTS) ../ || $(MKDIR) ../
+ $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
+
+Makefile: highlight.pro /usr/share/qt/mkspecs/linux-g++/qmake.conf /usr/share/qt/mkspecs/common/g++.conf \
+ /usr/share/qt/mkspecs/common/unix.conf \
+ /usr/share/qt/mkspecs/common/linux.conf \
+ /usr/share/qt/mkspecs/qconfig.pri \
+ /usr/share/qt/mkspecs/features/qt_functions.prf \
+ /usr/share/qt/mkspecs/features/qt_config.prf \
+ /usr/share/qt/mkspecs/features/exclusive_builds.prf \
+ /usr/share/qt/mkspecs/features/default_pre.prf \
+ /usr/share/qt/mkspecs/features/release.prf \
+ /usr/share/qt/mkspecs/features/default_post.prf \
+ /usr/share/qt/mkspecs/features/warn_on.prf \
+ /usr/share/qt/mkspecs/features/qt.prf \
+ /usr/share/qt/mkspecs/features/unix/thread.prf \
+ /usr/share/qt/mkspecs/features/moc.prf \
+ /usr/share/qt/mkspecs/features/resources.prf \
+ /usr/share/qt/mkspecs/features/uic.prf \
+ /usr/share/qt/mkspecs/features/yacc.prf \
+ /usr/share/qt/mkspecs/features/lex.prf \
+ /usr/share/qt/mkspecs/features/include_source_dir.prf \
+ /usr/lib/libQtGui.prl \
+ /usr/lib/libQtCore.prl
+ $(QMAKE) -unix DEFINES+=DATA_DIR=\\\/usr/share/highlight/\\\\ CONFIG_DIR=\\\/etc/highlight/\\\\ DOC_DIR=\\\/usr/share/doc/highlight/\\\ -o Makefile highlight.pro
+/usr/share/qt/mkspecs/common/g++.conf:
+/usr/share/qt/mkspecs/common/unix.conf:
+/usr/share/qt/mkspecs/common/linux.conf:
+/usr/share/qt/mkspecs/qconfig.pri:
+/usr/share/qt/mkspecs/features/qt_functions.prf:
+/usr/share/qt/mkspecs/features/qt_config.prf:
+/usr/share/qt/mkspecs/features/exclusive_builds.prf:
+/usr/share/qt/mkspecs/features/default_pre.prf:
+/usr/share/qt/mkspecs/features/release.prf:
+/usr/share/qt/mkspecs/features/default_post.prf:
+/usr/share/qt/mkspecs/features/warn_on.prf:
+/usr/share/qt/mkspecs/features/qt.prf:
+/usr/share/qt/mkspecs/features/unix/thread.prf:
+/usr/share/qt/mkspecs/features/moc.prf:
+/usr/share/qt/mkspecs/features/resources.prf:
+/usr/share/qt/mkspecs/features/uic.prf:
+/usr/share/qt/mkspecs/features/yacc.prf:
+/usr/share/qt/mkspecs/features/lex.prf:
+/usr/share/qt/mkspecs/features/include_source_dir.prf:
+/usr/lib/libQtGui.prl:
+/usr/lib/libQtCore.prl:
+qmake: FORCE
+ @$(QMAKE) -unix DEFINES+=DATA_DIR=\\\/usr/share/highlight/\\\\ CONFIG_DIR=\\\/etc/highlight/\\\\ DOC_DIR=\\\/usr/share/doc/highlight/\\\ -o Makefile highlight.pro
+
+dist:
+ @$(CHK_DIR_EXISTS) .tmp/highlight-gui1.0.0 || $(MKDIR) .tmp/highlight-gui1.0.0
+ $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/highlight-gui1.0.0/ && $(COPY_FILE) --parents mainwindow.h ../core/ansigenerator.h ../core/bbcodegenerator.h ../core/charcodes.h ../core/codegenerator.h ../core/configurationreader.h ../core/ctagsreader.h ../core/datadir.h ../core/documentstyle.h ../core/elementstyle.h ../core/enums.h ../core/htmlgenerator.h ../core/languagedefinition.h ../core/latexgenerator.h ../core/platform_fs.h ../core/preformatter.h ../core/rtfgenerator.h ../core/stringtools.h ../core/stylecolour.h ../core/svggenerator.h ../core/texgenerator.h ../core/version.h ../core/xhtmlgenerator.h ../core/xmlgenerator.h ../core/xterm256generator.h precomp.h io_report.h showtextfile.h .tmp/highlight-gui1.0.0/ && $(COPY_FILE) --parents highlight-gui.qrc .tmp/highlight-gui1.0.0/ && $(COPY_FILE) --parents main.cpp mainwindow.cpp io_report.cpp showtextfile.cpp .tmp/highlight-gui1.0.0/ && $(COPY_FILE) --parents mainwindow.ui io_report.ui showtextfile.ui .tmp/highlight-gui1.0.0/ && $(COPY_FILE) --parents highlight_de_DE.ts highlight_es_ES.ts .tmp/highlight-gui1.0.0/ && (cd `dirname .tmp/highlight-gui1.0.0` && $(TAR) highlight-gui1.0.0.tar highlight-gui1.0.0 && $(COMPRESS) highlight-gui1.0.0.tar) && $(MOVE) `dirname .tmp/highlight-gui1.0.0`/highlight-gui1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/highlight-gui1.0.0
+
+
+clean:compiler_clean
+ -$(DEL_FILE) $(OBJECTS)
+ -$(DEL_FILE) highlight-gui.gch/c highlight-gui.gch/c++
+ -$(DEL_FILE) *~ core *.core
+
+
+####### Sub-libraries
+
+distclean: clean
+ -$(DEL_FILE) $(TARGET)
+ -$(DEL_FILE) Makefile
+
+
+###### Prefix headers
+highlight-gui.gch/c: precomp.h
+ @$(CHK_DIR_EXISTS) highlight-gui.gch/ || $(MKDIR) highlight-gui.gch/
+ $(CC) $(CFLAGS) $(INCPATH) -x c-header -c precomp.h -o highlight-gui.gch/c
+
+highlight-gui.gch/c++: precomp.h
+ @$(CHK_DIR_EXISTS) highlight-gui.gch/ || $(MKDIR) highlight-gui.gch/
+ $(CXX) $(CXXFLAGS) $(INCPATH) -x c++-header -c precomp.h -o highlight-gui.gch/c++
+
+mocclean: compiler_moc_header_clean compiler_moc_source_clean
+
+mocables: compiler_moc_header_make_all compiler_moc_source_make_all
+
+compiler_moc_header_make_all: moc_mainwindow.cpp moc_io_report.cpp moc_showtextfile.cpp
+compiler_moc_header_clean:
+ -$(DEL_FILE) moc_mainwindow.cpp moc_io_report.cpp moc_showtextfile.cpp
+moc_mainwindow.cpp: mainwindow.h
+ /usr/bin/moc $(DEFINES) $(INCPATH) mainwindow.h -o moc_mainwindow.cpp
+
+moc_io_report.cpp: io_report.h
+ /usr/bin/moc $(DEFINES) $(INCPATH) io_report.h -o moc_io_report.cpp
+
+moc_showtextfile.cpp: showtextfile.h
+ /usr/bin/moc $(DEFINES) $(INCPATH) showtextfile.h -o moc_showtextfile.cpp
+
+compiler_rcc_make_all: qrc_highlight-gui.cpp
+compiler_rcc_clean:
+ -$(DEL_FILE) qrc_highlight-gui.cpp
+qrc_highlight-gui.cpp: highlight-gui.qrc \
+ highlight.xpm \
+ hl_icon2.png
+ /usr/bin/rcc -name highlight-gui highlight-gui.qrc -o qrc_highlight-gui.cpp
+
+compiler_image_collection_make_all: qmake_image_collection.cpp
+compiler_image_collection_clean:
+ -$(DEL_FILE) qmake_image_collection.cpp
+compiler_moc_source_make_all:
+compiler_moc_source_clean:
+compiler_uic_make_all: ui_mainwindow.h ui_io_report.h ui_showtextfile.h
+compiler_uic_clean:
+ -$(DEL_FILE) ui_mainwindow.h ui_io_report.h ui_showtextfile.h
+ui_mainwindow.h: mainwindow.ui
+ /usr/bin/uic mainwindow.ui -o ui_mainwindow.h
+
+ui_io_report.h: io_report.ui
+ /usr/bin/uic io_report.ui -o ui_io_report.h
+
+ui_showtextfile.h: showtextfile.ui
+ /usr/bin/uic showtextfile.ui -o ui_showtextfile.h
+
+compiler_yacc_decl_make_all:
+compiler_yacc_decl_clean:
+compiler_yacc_impl_make_all:
+compiler_yacc_impl_clean:
+compiler_lex_make_all:
+compiler_lex_clean:
+compiler_clean: compiler_moc_header_clean compiler_rcc_clean compiler_uic_clean
+
+####### Compile
+
+main.o: main.cpp mainwindow.h \
+ highlight-gui.gch/c++
+ $(CXX) -c -include highlight-gui $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
+
+mainwindow.o: mainwindow.cpp mainwindow.h \
+ ui_mainwindow.h \
+ showtextfile.h \
+ io_report.h \
+ highlight-gui.gch/c++
+ $(CXX) -c -include highlight-gui $(CXXFLAGS) $(INCPATH) -o mainwindow.o mainwindow.cpp
+
+io_report.o: io_report.cpp io_report.h \
+ ui_io_report.h \
+ highlight-gui.gch/c++
+ $(CXX) -c -include highlight-gui $(CXXFLAGS) $(INCPATH) -o io_report.o io_report.cpp
+
+showtextfile.o: showtextfile.cpp showtextfile.h \
+ ui_showtextfile.h \
+ highlight-gui.gch/c++
+ $(CXX) -c -include highlight-gui $(CXXFLAGS) $(INCPATH) -o showtextfile.o showtextfile.cpp
+
+moc_mainwindow.o: moc_mainwindow.cpp highlight-gui.gch/c++
+ $(CXX) -c -include highlight-gui $(CXXFLAGS) $(INCPATH) -o moc_mainwindow.o moc_mainwindow.cpp
+
+moc_io_report.o: moc_io_report.cpp highlight-gui.gch/c++
+ $(CXX) -c -include highlight-gui $(CXXFLAGS) $(INCPATH) -o moc_io_report.o moc_io_report.cpp
+
+moc_showtextfile.o: moc_showtextfile.cpp highlight-gui.gch/c++
+ $(CXX) -c -include highlight-gui $(CXXFLAGS) $(INCPATH) -o moc_showtextfile.o moc_showtextfile.cpp
+
+qrc_highlight-gui.o: qrc_highlight-gui.cpp highlight-gui.gch/c++
+ $(CXX) -c -include highlight-gui $(CXXFLAGS) $(INCPATH) -o qrc_highlight-gui.o qrc_highlight-gui.cpp
+
+####### Install
+
+install: FORCE
+
+uninstall: FORCE
+
+FORCE:
+
diff --git a/support/highlight/src/gui-qt/highlight-gui.qrc b/support/highlight/src/gui-qt/highlight-gui.qrc
new file mode 100644
index 0000000000..cf5f269528
--- /dev/null
+++ b/support/highlight/src/gui-qt/highlight-gui.qrc
@@ -0,0 +1,6 @@
+<RCC>
+ <qresource prefix="/" >
+ <file>highlight.xpm</file>
+ <file>hl_icon2.png</file>
+ </qresource>
+</RCC>
diff --git a/support/highlight/src/gui-qt/highlight.pro b/support/highlight/src/gui-qt/highlight.pro
new file mode 100644
index 0000000000..88676f021f
--- /dev/null
+++ b/support/highlight/src/gui-qt/highlight.pro
@@ -0,0 +1,39 @@
+# -------------------------------------------------
+# Project created by QtCreator 2009-03-03T22:45:06
+# -------------------------------------------------
+TARGET = highlight-gui
+TEMPLATE = app
+INCLUDEPATH += . \
+ ../core/
+win32:CONFIG += static
+CONFIG += precompile_header
+PRECOMPILED_HEADER = precomp.h
+DEFINES += O2 QT
+win32:DESTDIR = ../../
+unix:DESTDIR = ../
+SOURCES += main.cpp \
+ mainwindow.cpp \
+ io_report.cpp \
+ showtextfile.cpp
+HEADERS += mainwindow.h \
+ ../core/*.h \
+ precomp.h \
+ io_report.h \
+ showtextfile.h
+FORMS += mainwindow.ui \
+ io_report.ui \
+ showtextfile.ui
+RESOURCES = highlight-gui.qrc
+TRANSLATIONS = highlight_de_DE.ts highlight_es_ES.ts
+
+win32:RC_FILE = highlight-gui.rc
+win32:LIBS += -L../.. -lhighlight
+unix:LIBS += -L.. -lhighlight
+
+win32:QMAKE_POST_LINK = f:/upx/upx.exe --best ../../highlight-gui.exe
+#unix {
+#DEFINES += DATA_DIR=\\\"/usr/share/highlight\\\" \
+# CONFIG_DIR=\\\"/etc/highlight\\\" \
+# DOC_DIR=\\\"/usr/share/doc/highlight\\\"
+# message("setting unix default paths")
+#}
diff --git a/support/highlight/src/gui-qt/highlight.xpm b/support/highlight/src/gui-qt/highlight.xpm
new file mode 100644
index 0000000000..bc3e73097f
--- /dev/null
+++ b/support/highlight/src/gui-qt/highlight.xpm
@@ -0,0 +1,1173 @@
+/* XPM */
+static char * highlight_xpm[] = {
+"48 48 1122 2",
+" c None",
+". c #0C5C92",
+"+ c #0D5C92",
+"@ c #0F5F94",
+"# c #0F5E94",
+"$ c #126196",
+"% c #156398",
+"& c #156498",
+"* c #18669A",
+"= c #32728E",
+"- c #588D93",
+"; c #62857B",
+"> c #739482",
+", c #748D79",
+"' c #6B7E6D",
+") c #5F847D",
+"! c #37616E",
+"~ c #2A607B",
+"{ c #196699",
+"] c #1B689C",
+"^ c #307799",
+"/ c #549192",
+"( c #609C90",
+"_ c #6AA593",
+": c #68A696",
+"< c #629785",
+"[ c #64937D",
+"} c #547967",
+"| c #546B5C",
+"1 c #53584A",
+"2 c #515549",
+"3 c #3E4747",
+"4 c #2C5F7B",
+"5 c #1B689B",
+"6 c #1E6493",
+"7 c #215E87",
+"8 c #22547C",
+"9 c #275276",
+"0 c #3B5A6F",
+"a c #3E5770",
+"b c #3D5568",
+"c c #365D6D",
+"d c #1C689A",
+"e c #1E6B9E",
+"f c #1E6A9E",
+"g c #3D8091",
+"h c #56A29C",
+"i c #499B92",
+"j c #5FA290",
+"k c #609789",
+"l c #558C7A",
+"m c #598E79",
+"n c #546857",
+"o c #485343",
+"p c #374A3F",
+"q c #4C4231",
+"r c #885229",
+"s c #A5602A",
+"t c #452C1C",
+"u c #2C4156",
+"v c #395373",
+"w c #3F526F",
+"x c #465067",
+"y c #4E4E5C",
+"z c #5A5760",
+"A c #675F5F",
+"B c #655B59",
+"C c #5A5751",
+"D c #406071",
+"E c #22648B",
+"F c #216DA0",
+"G c #448E98",
+"H c #399EA1",
+"I c #3C928D",
+"J c #548378",
+"K c #54887E",
+"L c #3F7872",
+"M c #3E6B63",
+"N c #404F47",
+"O c #41363C",
+"P c #221B20",
+"Q c #392923",
+"R c #BD9C6E",
+"S c #5A321F",
+"T c #2D1716",
+"U c #382B30",
+"V c #504550",
+"W c #65626C",
+"X c #726767",
+"Y c #78655E",
+"Z c #69574F",
+"` c #665D54",
+" . c #3F545E",
+".. c #285D7D",
+"+. c #216D9D",
+"@. c #206DA0",
+"#. c #246FA2",
+"$. c #236FA2",
+"%. c #2470A2",
+"&. c #2370A2",
+"*. c #307797",
+"=. c #498F86",
+"-. c #3C7777",
+";. c #497170",
+">. c #437072",
+",. c #435559",
+"'. c #555E59",
+"). c #58665C",
+"!. c #736852",
+"~. c #7A5334",
+"{. c #472815",
+"]. c #331D17",
+"^. c #674229",
+"/. c #5F3528",
+"(. c #513B44",
+"_. c #463B48",
+":. c #503A3F",
+"<. c #604137",
+"[. c #594133",
+"}. c #616661",
+"|. c #38667E",
+"1. c #256D9A",
+"2. c #2772A4",
+"3. c #2672A4",
+"4. c #2E769D",
+"5. c #469FA3",
+"6. c #477B78",
+"7. c #457073",
+"8. c #326471",
+"9. c #4D5156",
+"0. c #946141",
+"a. c #AC5D2A",
+"b. c #CD6F27",
+"c. c #C36924",
+"d. c #945C2E",
+"e. c #574936",
+"f. c #3C3630",
+"g. c #3B3933",
+"h. c #322523",
+"i. c #746358",
+"j. c #A99E85",
+"k. c #C3B997",
+"l. c #9F967C",
+"m. c #2C729D",
+"n. c #2672A3",
+"o. c #2974A6",
+"p. c #2974A5",
+"q. c #2975A6",
+"r. c #478F95",
+"s. c #4A7B7C",
+"t. c #3C6267",
+"u. c #3F545F",
+"v. c #737779",
+"w. c #CABFA8",
+"x. c #F4CF92",
+"y. c #C5682A",
+"z. c #9F4E21",
+"A. c #52584D",
+"B. c #254749",
+"C. c #223F43",
+"D. c #253A3C",
+"E. c #3A3B39",
+"F. c #ADA589",
+"G. c #DED7AD",
+"H. c #C5B890",
+"I. c #877C68",
+"J. c #4C7386",
+"K. c #2A74A6",
+"L. c #2975A5",
+"M. c #2C77A8",
+"N. c #2C77A7",
+"O. c #2E78A7",
+"P. c #548D85",
+"Q. c #485657",
+"R. c #9D9891",
+"S. c #E0DFD6",
+"T. c #FCFDF4",
+"U. c #FAFDF0",
+"V. c #E8E7D4",
+"W. c #78715E",
+"X. c #1F3E48",
+"Y. c #1B373E",
+"Z. c #1D363C",
+"`. c #233437",
+" + c #343431",
+".+ c #B0A88B",
+"++ c #E6E3B9",
+"@+ c #AF9D7C",
+"#+ c #594E48",
+"$+ c #3A6478",
+"%+ c #2F79A9",
+"&+ c #2F79AA",
+"*+ c #44899D",
+"=+ c #65877E",
+"-+ c #D4D3C3",
+";+ c #F4F3DF",
+">+ c #CFC4A7",
+",+ c #A59174",
+"'+ c #8F7A5E",
+")+ c #3A3839",
+"!+ c #1C2023",
+"~+ c #1A2023",
+"{+ c #161617",
+"]+ c #212120",
+"^+ c #372924",
+"/+ c #69422C",
+"(+ c #BCA88B",
+"_+ c #C1B192",
+":+ c #6C605C",
+"<+ c #455E69",
+"[+ c #327CAB",
+"}+ c #327CAC",
+"|+ c #5B9EAC",
+"1+ c #94B49B",
+"2+ c #8A8F73",
+"3+ c #6E7061",
+"4+ c #474A45",
+"5+ c #353433",
+"6+ c #2C3431",
+"7+ c #32332F",
+"8+ c #303835",
+"9+ c #2A2F2C",
+"0+ c #263535",
+"a+ c #263739",
+"b+ c #3E322A",
+"c+ c #622915",
+"d+ c #632A18",
+"e+ c #653B2D",
+"f+ c #4A3735",
+"g+ c #426780",
+"h+ c #367FAE",
+"i+ c #55A0B6",
+"j+ c #69A59B",
+"k+ c #527E6F",
+"l+ c #446055",
+"m+ c #384741",
+"n+ c #344A43",
+"o+ c #2D3C39",
+"p+ c #333A35",
+"q+ c #293B3A",
+"r+ c #283B3B",
+"s+ c #1D4142",
+"t+ c #22383A",
+"u+ c #274040",
+"v+ c #513122",
+"w+ c #692912",
+"x+ c #5C2715",
+"y+ c #623D2D",
+"z+ c #4C4241",
+"A+ c #387AA2",
+"B+ c #4389B6",
+"C+ c #438AB6",
+"D+ c #4389B7",
+"E+ c #438AB7",
+"F+ c #60A8BE",
+"G+ c #68A49A",
+"H+ c #538373",
+"I+ c #446154",
+"J+ c #416458",
+"K+ c #2F625B",
+"L+ c #265855",
+"M+ c #204E4E",
+"N+ c #21413E",
+"O+ c #405647",
+"P+ c #364238",
+"Q+ c #2D3D37",
+"R+ c #253838",
+"S+ c #283534",
+"T+ c #2C3C3B",
+"U+ c #4A3224",
+"V+ c #672810",
+"W+ c #652B13",
+"X+ c #583022",
+"Y+ c #473129",
+"Z+ c #486D7D",
+"`+ c #5196C0",
+" @ c #5195C0",
+".@ c #6AADC3",
+"+@ c #68B7AE",
+"@@ c #4C8070",
+"#@ c #477666",
+"$@ c #427167",
+"%@ c #306D66",
+"&@ c #255E5D",
+"*@ c #1F5657",
+"=@ c #205559",
+"-@ c #23504E",
+";@ c #477560",
+">@ c #4C6754",
+",@ c #464235",
+"'@ c #303A35",
+")@ c #323C36",
+"!@ c #493E32",
+"~@ c #673219",
+"{@ c #692A10",
+"]@ c #733211",
+"^@ c #633421",
+"/@ c #483129",
+"(@ c #4A6B7C",
+"_@ c #60A1C9",
+":@ c #68ACC9",
+"<@ c #6EB8B4",
+"[@ c #5B9986",
+"}@ c #528374",
+"|@ c #41726C",
+"1@ c #396B65",
+"2@ c #286764",
+"3@ c #226060",
+"4@ c #215E61",
+"5@ c #225356",
+"6@ c #2B5451",
+"7@ c #3E635C",
+"8@ c #466A6A",
+"9@ c #50615A",
+"0@ c #604830",
+"a@ c #5E3821",
+"b@ c #6A3216",
+"c@ c #76300E",
+"d@ c #79320D",
+"e@ c #823B12",
+"f@ c #683318",
+"g@ c #462E24",
+"h@ c #4E6978",
+"i@ c #5FA0C8",
+"j@ c #6DA9CE",
+"k@ c #6DA9CD",
+"l@ c #6FABCC",
+"m@ c #80C5C6",
+"n@ c #5C9480",
+"o@ c #588D7C",
+"p@ c #467970",
+"q@ c #3B726A",
+"r@ c #317570",
+"s@ c #2B6F6C",
+"t@ c #336461",
+"u@ c #2F6C6C",
+"v@ c #396966",
+"w@ c #386B6D",
+"x@ c #3F6A6E",
+"y@ c #49848B",
+"z@ c #605949",
+"A@ c #994B18",
+"B@ c #9A3906",
+"C@ c #843910",
+"D@ c #792D0A",
+"E@ c #93420E",
+"F@ c #8D4213",
+"G@ c #6F3619",
+"H@ c #4E342A",
+"I@ c #54676D",
+"J@ c #6DA8CD",
+"K@ c #7BB0D2",
+"L@ c #75B5B3",
+"M@ c #5C9885",
+"N@ c #5B907C",
+"O@ c #448074",
+"P@ c #548074",
+"Q@ c #3B7971",
+"R@ c #397F7C",
+"S@ c #3D7D79",
+"T@ c #3A736F",
+"U@ c #297172",
+"V@ c #376363",
+"W@ c #477378",
+"X@ c #48767B",
+"Y@ c #586E6B",
+"Z@ c #7C6A4F",
+"`@ c #B6520E",
+" # c #A63E05",
+".# c #8A3206",
+"+# c #873A0C",
+"@# c #984D18",
+"## c #A14F18",
+"$# c #88461E",
+"%# c #4E3327",
+"&# c #5E7177",
+"*# c #7AB0D2",
+"=# c #7BB1D2",
+"-# c #88B8D6",
+";# c #80BACA",
+"># c #5AA58D",
+",# c #5A9D8A",
+"'# c #609484",
+")# c #508077",
+"!# c #599086",
+"~# c #528C82",
+"{# c #4E8980",
+"]# c #3A7875",
+"^# c #266365",
+"/# c #3B797E",
+"(# c #517979",
+"_# c #5F8887",
+":# c #657369",
+"<# c #938462",
+"[# c #C98240",
+"}# c #D26714",
+"|# c #B94B06",
+"1# c #953F0C",
+"2# c #8B3D0F",
+"3# c #AF6427",
+"4# c #AE5D20",
+"5# c #884A23",
+"6# c #4B3227",
+"7# c #7393A0",
+"8# c #96C0DA",
+"9# c #95C0D9",
+"0# c #69B8AF",
+"a# c #4E9B88",
+"b# c #53978A",
+"c# c #59988D",
+"d# c #56827A",
+"e# c #5B8B82",
+"f# c #4D8C83",
+"g# c #357E81",
+"h# c #235F65",
+"i# c #3B7A7B",
+"j# c #5C8580",
+"k# c #5D7D7A",
+"l# c #6B7769",
+"m# c #A99263",
+"n# c #D99E4B",
+"o# c #E68D2A",
+"p# c #DA6D0F",
+"q# c #B95108",
+"r# c #9E4307",
+"s# c #A65115",
+"t# c #A8591D",
+"u# c #AE5E20",
+"v# c #93532A",
+"w# c #503F31",
+"x# c #8EB6CD",
+"y# c #96BFDA",
+"z# c #A3C7DE",
+"A# c #A3C7DF",
+"B# c #8BC7CA",
+"C# c #3EA196",
+"D# c #4B9D92",
+"E# c #499189",
+"F# c #568D86",
+"G# c #4D9189",
+"H# c #478B83",
+"I# c #3A807B",
+"J# c #2D8485",
+"K# c #36797C",
+"L# c #588283",
+"M# c #637F78",
+"N# c #727664",
+"O# c #9C8B60",
+"P# c #DBAE5A",
+"Q# c #EDA53C",
+"R# c #E6811B",
+"S# c #D66609",
+"T# c #B85109",
+"U# c #B3530D",
+"V# c #A54F0F",
+"W# c #A05921",
+"X# c #AA5C1D",
+"Y# c #844D23",
+"Z# c #676861",
+"`# c #A2C6DE",
+" $ c #A4C7DE",
+".$ c #B4D1E4",
+"+$ c #B4D0E4",
+"@$ c #B4D1E3",
+"#$ c #ADCDDB",
+"$$ c #68C3C4",
+"%$ c #329B95",
+"&$ c #35918E",
+"*$ c #298585",
+"=$ c #4B8D85",
+"-$ c #338E8D",
+";$ c #348583",
+">$ c #2B8486",
+",$ c #37949B",
+"'$ c #4B7E7A",
+")$ c #5B7D74",
+"!$ c #647C6F",
+"~$ c #837D5D",
+"{$ c #B9985C",
+"]$ c #EAA53C",
+"^$ c #EE9223",
+"/$ c #E8790F",
+"($ c #D66308",
+"_$ c #B74F07",
+":$ c #A84707",
+"<$ c #98490F",
+"[$ c #9E5F27",
+"}$ c #7F4B22",
+"|$ c #614731",
+"1$ c #9FB5BF",
+"2$ c #B4D0E3",
+"3$ c #CEDFEC",
+"4$ c #CDDFEC",
+"5$ c #9FD4D5",
+"6$ c #2DA5AA",
+"7$ c #169DA1",
+"8$ c #257073",
+"9$ c #2D878A",
+"0$ c #2F8085",
+"a$ c #338A8C",
+"b$ c #3099A1",
+"c$ c #48847F",
+"d$ c #597E78",
+"e$ c #447A7B",
+"f$ c #388692",
+"g$ c #5C7E77",
+"h$ c #9B9871",
+"i$ c #DDA246",
+"j$ c #F19C2A",
+"k$ c #EB7B0E",
+"l$ c #E06B07",
+"m$ c #BF4F03",
+"n$ c #AA4A0A",
+"o$ c #91430E",
+"p$ c #A66122",
+"q$ c #975D29",
+"r$ c #5A3B25",
+"s$ c #7B7B6C",
+"t$ c #C9DCE9",
+"u$ c #CEDFEB",
+"v$ c #E9EEF4",
+"w$ c #E8EEF4",
+"x$ c #E9EFF4",
+"y$ c #82C8CB",
+"z$ c #0B9BAA",
+"A$ c #1C7E89",
+"B$ c #55898A",
+"C$ c #1B96A7",
+"D$ c #4099A1",
+"E$ c #3E8088",
+"F$ c #49797D",
+"G$ c #3D848A",
+"H$ c #2B8193",
+"I$ c #3B838C",
+"J$ c #3F7980",
+"K$ c #828467",
+"L$ c #CA974D",
+"M$ c #E99B32",
+"N$ c #F1901E",
+"O$ c #E16D0C",
+"P$ c #CD5C09",
+"Q$ c #B44D07",
+"R$ c #9A4D19",
+"S$ c #A0632E",
+"T$ c #996A40",
+"U$ c #855F3B",
+"V$ c #675B4B",
+"W$ c #D1D9DB",
+"X$ c #8C96A6",
+"Y$ c #99B9C0",
+"Z$ c #5ECAE5",
+"`$ c #5A99A4",
+" % c #5D9C9F",
+".% c #508188",
+"+% c #448C96",
+"@% c #528A8F",
+"#% c #3D8F9F",
+"$% c #418998",
+"%% c #498B90",
+"&% c #3E7C81",
+"*% c #4F7879",
+"=% c #597B77",
+"-% c #9C8660",
+";% c #D9983E",
+">% c #F39D29",
+",% c #E7760E",
+"'% c #C75307",
+")% c #C0580F",
+"!% c #A34C10",
+"~% c #A26333",
+"{% c #9A6B3D",
+"]% c #A3733E",
+"^% c #715332",
+"/% c #707882",
+"(% c #8B95A5",
+"_% c #284B6C",
+":% c #5BB4C7",
+"<% c #3CB3D7",
+"[% c #61999E",
+"}% c #568588",
+"|% c #4D9298",
+"1% c #368496",
+"2% c #3A8092",
+"3% c #457B82",
+"4% c #467C85",
+"5% c #407E89",
+"6% c #3A7882",
+"7% c #43747B",
+"8% c #4E5951",
+"9% c #AF8444",
+"0% c #F8D25D",
+"a% c #F6961B",
+"b% c #DA6409",
+"c% c #B04A0A",
+"d% c #A1470B",
+"e% c #9D5928",
+"f% c #AB8155",
+"g% c #9A6C3C",
+"h% c #855C2F",
+"i% c #4D5B5B",
+"j% c #284B6B",
+"k% c #6AACCC",
+"l% c #6AABCC",
+"m% c #6AAFC8",
+"n% c #5DCBE8",
+"o% c #3BA5CB",
+"p% c #3F7681",
+"q% c #579CA3",
+"r% c #3F8A9C",
+"s% c #2D879E",
+"t% c #3B8597",
+"u% c #488591",
+"v% c #4A808C",
+"w% c #4A858D",
+"x% c #387B87",
+"y% c #3E6569",
+"z% c #826539",
+"A% c #F4DD72",
+"B% c #FBC342",
+"C% c #EB7A11",
+"D% c #C75C0F",
+"E% c #9F470F",
+"F% c #A3571C",
+"G% c #9D6534",
+"H% c #B1854C",
+"I% c #78522D",
+"J% c #586D6F",
+"K% c #68A9C9",
+"L% c #81CBEB",
+"M% c #80CBEC",
+"N% c #7ED0E1",
+"O% c #56C9ED",
+"P% c #3491B4",
+"Q% c #2696A7",
+"R% c #569CA5",
+"S% c #518A94",
+"T% c #5297A3",
+"U% c #53909D",
+"V% c #538B95",
+"W% c #45838E",
+"X% c #367C87",
+"Y% c #476D6F",
+"Z% c #9B7B40",
+"`% c #F9D14A",
+" & c #FCCD49",
+".& c #F99E20",
+"+& c #E17113",
+"@& c #AA5113",
+"#& c #954C16",
+"$& c #7B441B",
+"%& c #996E3E",
+"&& c #916C40",
+"*& c #67746D",
+"=& c #7BC1DF",
+"-& c #80CBEB",
+";& c #81CBEC",
+">& c #8D948C",
+",& c #87A8AA",
+"'& c #85BFCD",
+")& c #83CEEF",
+"!& c #82DBEA",
+"~& c #44C6EE",
+"{& c #2990B4",
+"]& c #238799",
+"^& c #3A7D8C",
+"/& c #4F9DAA",
+"(& c #4D97A3",
+"_& c #478E9A",
+":& c #3E808D",
+"<& c #38808A",
+"[& c #4C706B",
+"}& c #C2923D",
+"|& c #FBD656",
+"1& c #FBBC2D",
+"2& c #FCB52D",
+"3& c #F38914",
+"4& c #D26613",
+"5& c #7F3E18",
+"6& c #714627",
+"7& c #553722",
+"8& c #6E5439",
+"9& c #789FA8",
+"0& c #81CAE9",
+"a& c #83CEEE",
+"b& c #9D8880",
+"c& c #9A877C",
+"d& c #94887E",
+"e& c #8B9189",
+"f& c #7CCAD3",
+"g& c #37B1E1",
+"h& c #2A809B",
+"i& c #1F7D90",
+"j& c #348D9E",
+"k& c #2791A2",
+"l& c #2E8D9C",
+"m& c #2F8190",
+"n& c #397E85",
+"o& c #4E6964",
+"p& c #AB651D",
+"q& c #FACC3F",
+"r& c #FBBB2E",
+"s& c #FCAF20",
+"t& c #F68C10",
+"u& c #E06D0E",
+"v& c #B3520D",
+"w& c #5A2B19",
+"x& c #463025",
+"y& c #58635F",
+"z& c #71A2B1",
+"A& c #7BC2E2",
+"B& c #A59184",
+"C& c #AC9D91",
+"D& c #AE9D96",
+"E& c #A39088",
+"F& c #81CCDF",
+"G& c #48B1DD",
+"H& c #2181A1",
+"I& c #286877",
+"J& c #238697",
+"K& c #2A8290",
+"L& c #36747C",
+"M& c #3C686B",
+"N& c #54453A",
+"O& c #A8500E",
+"P& c #F6AE23",
+"Q& c #FBC333",
+"R& c #FBA718",
+"S& c #F99610",
+"T& c #EA780B",
+"U& c #CB600D",
+"V& c #843A0C",
+"W& c #473021",
+"X& c #5D7C84",
+"Y& c #73B4D3",
+"Z& c #73B5D5",
+"`& c #C1B398",
+" * c #C4B9A6",
+".* c #BEB29E",
+"+* c #BBB0A1",
+"@* c #A3BEC1",
+"#* c #51BFE7",
+"$* c #287FAD",
+"%* c #2F596B",
+"&* c #3E5150",
+"** c #4C4640",
+"=* c #564338",
+"-* c #572D1B",
+";* c #AE540B",
+">* c #F3970F",
+",* c #FCAE16",
+"'* c #FCAF1E",
+")* c #FAA119",
+"!* c #F1860E",
+"~* c #DC7617",
+"{* c #AC5C19",
+"]* c #6E6758",
+"^* c #6593A4",
+"/* c #6BA8C7",
+"(* c #6BA8C8",
+"_* c #6BA9C8",
+":* c #D4C7A0",
+"<* c #D1CAAC",
+"[* c #CCC5A9",
+"}* c #CBC4AD",
+"|* c #BEC9BE",
+"1* c #57C0E6",
+"2* c #215384",
+"3* c #30262D",
+"4* c #53352B",
+"5* c #663C2B",
+"6* c #5F2A16",
+"7* c #85400E",
+"8* c #DA8518",
+"9* c #F6A51B",
+"0* c #F9A317",
+"a* c #F8A01A",
+"b* c #EE9320",
+"c* c #E18826",
+"d* c #B35916",
+"e* c #884729",
+"f* c #4E565A",
+"g* c #6298B4",
+"h* c #639BBB",
+"i* c #639CBB",
+"j* c #D4C290",
+"k* c #D3C59A",
+"l* c #D2C8A4",
+"m* c #D2C8A8",
+"n* c #BDCBB9",
+"o* c #2B82BB",
+"p* c #3D414F",
+"q* c #432924",
+"r* c #733C1F",
+"s* c #7A360F",
+"t* c #95490F",
+"u* c #713511",
+"v* c #A26022",
+"w* c #CE8E31",
+"x* c #E49224",
+"y* c #CD7C20",
+"z* c #B46922",
+"A* c #93501C",
+"B* c #87411B",
+"C* c #EBAF57",
+"D* c #C17641",
+"E* c #975A3B",
+"F* c #7F6050",
+"G* c #607481",
+"H* c #5B8FAE",
+"I* c #BA9D6E",
+"J* c #C4A673",
+"K* c #C6AE7E",
+"L* c #CBB98C",
+"M* c #8DB2BB",
+"N* c #3076A0",
+"O* c #CAAC63",
+"P* c #CA832D",
+"Q* c #A2510F",
+"R* c #9F4E0D",
+"S* c #854111",
+"T* c #472F34",
+"U* c #4D332A",
+"V* c #663F26",
+"W* c #89552D",
+"X* c #A17142",
+"Y* c #8C5A33",
+"Z* c #B17648",
+"`* c #D68D50",
+" = c #C08C5B",
+".= c #BA875F",
+"+= c #B08765",
+"@= c #9F7354",
+"#= c #996F59",
+"$= c #605E61",
+"%= c #567E99",
+"&= c #5382A2",
+"*= c #5382A1",
+"== c #906D51",
+"-= c #906E4E",
+";= c #B09066",
+">= c #B49467",
+",= c #61A9C9",
+"'= c #8A9E91",
+")= c #E8A840",
+"!= c #C07424",
+"~= c #7A3D11",
+"{= c #8A4F24",
+"]= c #4E383A",
+"^= c #524249",
+"/= c #64473D",
+"(= c #74513C",
+"_= c #BB9A66",
+":= c #CFB17A",
+"<= c #D0AD76",
+"[= c #CFAF7E",
+"}= c #CCAE85",
+"|= c #88624A",
+"1= c #A9704F",
+"2= c #AC6E4C",
+"3= c #B17858",
+"4= c #B78968",
+"5= c #AE927D",
+"6= c #937A70",
+"7= c #75767A",
+"8= c #55748B",
+"9= c #4C7796",
+"0= c #516A74",
+"a= c #516C7D",
+"b= c #5E7682",
+"c= c #678580",
+"d= c #59A1C1",
+"e= c #C18B44",
+"f= c #B67029",
+"g= c #693B1D",
+"h= c #80583A",
+"i= c #907051",
+"j= c #4A3A3B",
+"k= c #5F4840",
+"l= c #725644",
+"m= c #BA9A67",
+"n= c #D5BB7E",
+"o= c #D9C289",
+"p= c #D3B986",
+"q= c #CFB487",
+"r= c #B0916F",
+"s= c #AE7C5A",
+"t= c #BD8A6C",
+"u= c #B37D63",
+"v= c #B48A73",
+"w= c #B9A692",
+"x= c #BAA590",
+"y= c #B29A88",
+"z= c #A39082",
+"A= c #877876",
+"B= c #797C82",
+"C= c #617889",
+"D= c #4F738E",
+"E= c #48708F",
+"F= c #47708F",
+"G= c #436887",
+"H= c #518BA4",
+"I= c #4D4B47",
+"J= c #834B1E",
+"K= c #54473A",
+"L= c #4B626F",
+"M= c #50616B",
+"N= c #5B5E5C",
+"O= c #58504A",
+"P= c #47352C",
+"Q= c #654E3B",
+"R= c #C29C60",
+"S= c #CEB074",
+"T= c #D1BB84",
+"U= c #D5C28F",
+"V= c #D8C79A",
+"W= c #C9AF8E",
+"X= c #CAB195",
+"Y= c #C49779",
+"Z= c #BE8C72",
+"`= c #CBBEA9",
+" - c #C3B29F",
+".- c #C1AC94",
+"+- c #C3B4A4",
+"@- c #B6A79B",
+"#- c #A8968C",
+"$- c #A28E85",
+"%- c #9B887F",
+"&- c #988A83",
+"*- c #858783",
+"=- c #6E7C83",
+"-- c #607685",
+";- c #567284",
+">- c #476C86",
+",- c #436888",
+"'- c #436987",
+")- c #3E6180",
+"!- c #41667F",
+"~- c #49656F",
+"{- c #4A3121",
+"]- c #484A4D",
+"^- c #41627A",
+"/- c #415666",
+"(- c #5C5F5A",
+"_- c #8F7857",
+":- c #AD895A",
+"<- c #BB9D6D",
+"[- c #CEBB8A",
+"}- c #D4C198",
+"|- c #D8CBA6",
+"1- c #D4C8A9",
+"2- c #D1C7AC",
+"3- c #D0C4A9",
+"4- c #CDC2A9",
+"5- c #D5C6AC",
+"6- c #CFC3AC",
+"7- c #CBC6B7",
+"8- c #C4BAAC",
+"9- c #B7A595",
+"0- c #B7A291",
+"a- c #AF9585",
+"b- c #A8937C",
+"c- c #A28E7E",
+"d- c #A6958B",
+"e- c #9B8D88",
+"f- c #87817E",
+"g- c #6F777A",
+"h- c #586E7C",
+"i- c #43637F",
+"j- c #406280",
+"k- c #3B5B78",
+"l- c #3A5979",
+"m- c #3A5977",
+"n- c #3C5872",
+"o- c #3A5A79",
+"p- c #3A5A78",
+"q- c #3A5978",
+"r- c #395A78",
+"s- c #3B5B79",
+"t- c #4A6478",
+"u- c #54626D",
+"v- c #6D665B",
+"w- c #937654",
+"x- c #BCA67B",
+"y- c #C9B689",
+"z- c #CBBC91",
+"A- c #CEC19C",
+"B- c #D1C7A8",
+"C- c #D3CAAD",
+"D- c #D2C3A1",
+"E- c #CBB89A",
+"F- c #D0C6AE",
+"G- c #CBC1AB",
+"H- c #CBC1AF",
+"I- c #C6B7A3",
+"J- c #C1AC96",
+"K- c #C3B399",
+"L- c #BDAB96",
+"M- c #B3A296",
+"N- c #AE9A8E",
+"O- c #A58D81",
+"P- c #A58E82",
+"Q- c #A38E82",
+"R- c #9A8C84",
+"S- c #928D87",
+"T- c #7F8180",
+"U- c #6A7780",
+"V- c #5F707B",
+"W- c #566B78",
+"X- c #506878",
+"Y- c #3C5B78",
+"Z- c #355271",
+"`- c #365371",
+" ; c #4C6271",
+".; c #858679",
+"+; c #AC956D",
+"@; c #A3845D",
+"#; c #A48864",
+"$; c #C4B48F",
+"%; c #D6C9A0",
+"&; c #D6CBA3",
+"*; c #DAD1AE",
+"=; c #D3C6A6",
+"-; c #D7D0B3",
+";; c #D7D2B7",
+">; c #D4CFB8",
+",; c #CFC2A7",
+"'; c #D6CEB3",
+"); c #D0C4AD",
+"!; c #C6BDAC",
+"~; c #C4BDB2",
+"{; c #C0B3A8",
+"]; c #C0B09F",
+"^; c #C4B49F",
+"/; c #BBAA9A",
+"(; c #B39A88",
+"_; c #B19E90",
+":; c #AD9B90",
+"<; c #AD9D90",
+"[; c #AB9A8D",
+"}; c #AA9A8B",
+"|; c #9E9386",
+"1; c #8E8475",
+"2; c #897B6D",
+"3; c #304B6A",
+"4; c #304B69",
+"5; c #3A536D",
+"6; c #5A6A6D",
+"7; c #787567",
+"8; c #9F8C6D",
+"9; c #A28061",
+"0; c #C6A673",
+"a; c #CBB080",
+"b; c #D1BD8C",
+"c; c #D7C89D",
+"d; c #D9CEA8",
+"e; c #DDD8B5",
+"f; c #E1DAB7",
+"g; c #E0DAB7",
+"h; c #DBD5B8",
+"i; c #D9D4B8",
+"j; c #D8D1B7",
+"k; c #CFC1A6",
+"l; c #D2CAB5",
+"m; c #D1C5AB",
+"n; c #CBBEA6",
+"o; c #C2AC94",
+"p; c #B8A18E",
+"q; c #C2B3A0",
+"r; c #BCAD9C",
+"s; c #B4A295",
+"t; c #AF9D8F",
+"u; c #AC998B",
+"v; c #2C4362",
+"w; c #2C4462",
+"x; c #2E4563",
+"y; c #4B5E69",
+"z; c #917962",
+"A; c #9C7758",
+"B; c #956B4A",
+"C; c #B28B5E",
+"D; c #BB9E71",
+"E; c #C7AD7E",
+"F; c #D6C494",
+"G; c #DFD3A9",
+"H; c #D9CFA6",
+"I; c #DCD5B2",
+"J; c #E1DCB7",
+"K; c #DBD1AB",
+"L; c #DFD8B5",
+"M; c #DACDA6",
+"N; c #D9D0B2",
+"O; c #D4C8AA",
+"P; c #D2C7A9",
+"Q; c #D1CAB3",
+"R; c #CAC1AC",
+"S; c #C0B09E",
+"T; c #273C5B",
+"U; c #334761",
+"V; c #293D5B",
+"W; c #887862",
+"X; c #696453",
+"Y; c #494E4D",
+"Z; c #48494F",
+"`; c #5E544F",
+" > c #866D51",
+".> c #A38560",
+"+> c #C7AE7D",
+"@> c #CFAF78",
+"#> c #D0B784",
+"$> c #D6C595",
+"%> c #D7C99D",
+"&> c #D2C293",
+"*> c #D8CA9B",
+"=> c #D9C99B",
+"-> c #D7C89F",
+";> c #D9CEA9",
+">> c #DED5AE",
+",> c #D7CEAE",
+"'> c #D7D1B5",
+")> c #D1C7AD",
+"!> c #B5A398",
+"~> c #A69388",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . + + . + . + + + + + . + . + + + . + . . . . . . + . . . . + + + . + . . + . + . + . . . ",
+"@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # @ @ @ @ @ @ # @ @ ",
+"@ @ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ ",
+"% % % % % & % % % & % % % % % % % % % % % % % % % % % & & % % % % & % % % % % % % % % % % % % & ",
+"* * * * * * * * * * * * * * * * * * * * * = - ; > , ' ) ! ~ { * * * * * * * * * * * * * * * * * ",
+"] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ^ / ( _ : < [ } | 1 2 3 4 5 ] ] ] 6 7 8 9 0 a b c d ] ] ] ",
+"e e e e e e e e e e e e e e f e e e g h i j k l m n o p q r s t u v w x y z A B C D E e e e e e ",
+"F F F F F F F F F F F F F F F F F G H I J K L M N O P Q R S T U V W X Y Z ` ...+.F F F F F F @.",
+"#.$.%.#.$.%.%.&.%.%.%.%.&.#.$.#.*.=.-.;.>.,.'.).!.~.{.].^./.(._.:.<.[.}.|.1.&.%.$.%.%.#.&.%.&.&.",
+"2.3.2.3.3.3.2.3.3.3.2.3.3.3.3.4.5.6.7.8.9.0.a.b.c.d.e.f.g.h.i.j.k.l.m.3.3.2.n.3.3.3.3.3.n.3.3.n.",
+"o.o.o.p.o.o.o.o.o.o.o.o.p.o.q.r.s.t.u.v.w.x.y.z.A.B.C.D.E.F.G.H.I.J.o.p.o.o.o.o.o.K.L.o.o.o.o.o.",
+"M.M.M.M.N.N.N.M.M.N.N.N.M.M.O.P.Q.R.S.T.U.V.W.X.Y.Z.`. +.+++@+#+$+N.N.M.M.M.M.M.M.M.N.M.N.N.N.N.",
+"%+%+%+%+&+%+%+%+&+%+&+%+%+%+*+=+-+;+>+,+'+)+!+~+{+]+^+/+(+_+:+<+%+&+&+%+&+%+&+%+%+&+%+%+%+%+%+%+",
+"[+[+}+}+[+[+[+[+[+[+[+[+[+[+|+1+2+3+4+5+6+7+8+9+0+a+b+c+d+e+f+g+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+",
+"h+h+h+h+h+h+h+h+h+h+h+h+h+i+j+k+l+m+n+o+9+p+q+r+s+t+u+v+w+x+y+z+A+h+h+h+h+h+h+h+h+h+h+h+h+h+h+h+",
+"B+C+B+D+B+E+D+D+C+B+B+B+F+G+H+I+J+K+L+M+N+O+P+Q+R+S+T+U+V+W+X+Y+Z+B+B+B+D+B+D+B+B+B+D+B+D+B+B+C+",
+"`+`+ @`+`+`+`+`+ @ @ @.@+@@@#@$@%@&@*@=@-@;@>@,@'@)@!@~@{@]@^@/@(@ @ @`+`+ @`+`+`+`+ @`+ @ @`+`+",
+"_@_@_@_@_@_@_@_@_@_@:@<@[@}@|@1@2@3@4@5@6@7@8@9@0@a@b@c@d@e@f@g@h@i@_@_@_@_@_@_@_@_@_@_@_@_@_@_@",
+"j@j@j@j@k@k@j@k@k@l@m@n@o@p@q@r@s@t@u@v@w@x@y@z@A@B@C@D@E@F@G@H@I@J@j@j@j@k@k@k@k@k@j@k@k@j@k@k@",
+"K@K@K@K@K@K@K@K@K@L@M@N@O@P@Q@R@S@T@U@V@W@X@Y@Z@`@ #.#+#@###$#%#&#*#K@K@K@K@K@=#=#K@K@K@K@K@K@K@",
+"-#-#-#-#-#-#-#-#;#>#,#'#)#!#~#{#]#^#/#(#_#:#<#[#}#|#1#2#3#4#5#6#7#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#",
+"8#8#8#8#8#8#8#9#0#a#b#c#d#e#f#g#h#i#j#k#l#m#n#o#p#q#r#s#t#u#v#w#x#8#8#8#8#8#y#8#8#8#8#8#8#8#8#8#",
+"z#z#z#A#z#z#A#B#C#D#E#F#G#H#I#J#K#L#M#N#O#P#Q#R#S#T#U#V#W#X#Y#Z#`#z#z#z#z#z# $z#z#z#z#z#A#A#z#A#",
+".$+$@$.$@$.$#$$$%$&$*$=$-$;$>$,$'$)$!$~${$]$^$/$($_$:$<$[$}$|$1$2$.$@$.$.$.$.$.$@$.$@$.$.$2$.$.$",
+"3$3$4$3$3$3$5$6$7$8$9$0$a$b$c$d$e$f$g$h$i$j$k$l$m$n$o$p$q$r$s$t$3$3$3$3$3$3$3$3$3$3$u$3$3$3$3$3$",
+"v$v$v$v$w$x$y$z$A$B$C$D$E$F$G$H$I$J$K$L$M$N$O$P$Q$R$S$T$U$V$W$w$v$v$v$w$v$v$v$v$v$w$v$v$v$v$v$v$",
+"X$X$X$X$X$Y$Z$`$ %.%+%@%#%$%%%&%*%=%-%;%>%,%'%)%!%~%{%]%^%/%(%X$X$X$X$X$X$X$X$X$X$X$X$X$X$X$X$X$",
+"_%_%_%_%_%:%<%[%}%|%1%2%3%4%5%6%7%8%9%0%a%b%c%d%e%f%g%h%i%j%_%_%_%_%_%_%_%_%_%_%_%_%_%_%_%_%_%_%",
+"k%l%k%k%m%n%o%p%q%r%s%t%u%v%w%x%y%z%A%B%C%D%E%F%G%H%I%J%K%l%k%l%k%k%k%l%k%k%l%k%k%k%k%k%k%k%l%k%",
+"L%M%M%M%N%O%P%Q%R%S%T%U%V%W%X%Y%Z%`% &.&+&@&#&$&%&&&*&=&-&L%L%-&-&-&L%-&-&;&L%M%L%;&M%-&M%;&-&M%",
+">&,&'&)&!&~&{&]&^&/&(&_&:&<&[&}&|&1&2&3&4&5&6&7&8&9&0&)&)&a&)&a&a&a&)&)&a&)&a&)&a&)&a&)&)&a&a&a&",
+"b&c&d&e&f&g&h&i&j&k&l&m&n&o&p&q&r&s&t&u&v&w&x&y&z&A&A&A&A&A&A&A&A&A&A&A&A&A&A&A&A&A&A&A&A&A&A&A&",
+"B&C&D&E&F&G&H&I&J&K&L&M&N&O&P&Q&R&S&T&U&V&W&X&Y&Z&Z&Z&Z&Z&Z&Z&Z&Z&Z&Z&Z&Z&Z&Z&Z&Z&Z&Z&Z&Z&Z&Z&Z&",
+"`& *.*+*@*#*$*%*&***=*-*;*>*,*'*)*!*~*{*]*^*/*(*_*(*(*(*(*(*_*(*(*(*(*_*(*_*(*(*(*_*(*(*(*_*(*(*",
+":*<*[*}*|*1*2*3*4*5*6*7*8*9*0*a*b*c*d*e*f*g*h*h*i*h*i*i*i*i*i*i*i*i*i*i*i*h*i*h*i*i*i*i*i*i*i*i*",
+"j*k*l*m*n*o*p*q*r*s*t*u*v*w*x*y*z*A*B*C*D*E*F*G*H*H*H*H*H*H*H*H*H*H*H*H*H*H*H*H*H*H*H*H*H*H*H*H*",
+"I*J*K*L*M*N*O*P*Q*R*S*T*U*V*W*X*Y*Z*`* =.=+=@=#=$=%=&=&=*=*=*=*=*=&=*=&=&=&=&=*=*=&=*=&=*=*=&=*=",
+"==-=;=>=,='=)=!=~={=]=^=/=(=_=:=<=[=}=|=1=2=3=4=5=6=7=8=9=9=9=9=9=9=9=9=9=9=9=9=9=9=9=9=9=9=9=9=",
+"0=a=b=c=d=e=f=g=h=i=j=k=l=m=n=o=p=q=r=s=t=u=v=w=x=y=z=A=B=C=D=E=E=E=E=E=E=E=F=F=E=F=E=F=E=F=F=E=",
+"G=G=G=H=I=J=K=L=M=N=O=P=Q=R=S=T=U=V=W=X=Y=Z=`= -.-+-@-#-$-%-&-*-=---;->-G=G=G=G=G=G=,-,-,-G=G='-",
+")-)-!-~-{-]-)-)-)-)-)-^-/-(-_-:-<-[-}-|-1-2-3-4-5-6-7-8-9-0-a-b-c-d-e-f-g-h-i-j-)-)-)-)-)-)-)-)-",
+"k-l-k-m-n-o-p-q-o-o-o-p-r-s-t-u-v-w-x-y-z-A-B-C-D-E-F-G-H-I-J-K-L-M-N-O-P-Q-R-S-T-U-V-W-X-Y-l-Y-",
+"Z-Z-Z-Z-Z-Z-Z-Z-Z-Z-Z-Z-Z-Z-Z-Z-`- ;.;+;@;#;$;%;&;*;=;-;;;>;,;';);!;~;{;];^;/;(;_;:;<;[;};|;1;2;",
+"3;3;3;3;4;3;3;3;3;3;3;3;3;3;4;3;3;3;3;5;6;7;8;9;0;a;b;c;d;e;f;g;h;i;j;k;l;m;n;o;p;q;r;s;t;u;|;|;",
+"v;v;v;v;v;v;v;v;v;v;v;v;v;v;v;v;v;v;v;v;w;x;y;z;A;B;C;D;E;F;c;G;H;I;J;K;L;M;N;O;P;Q;R;S;|;|;u;|;",
+"T;T;T;T;T;T;T;T;T;T;T;T;T;T;T;T;U;T;T;T;T;T;V;W;X;Y;Z;`; >.>+>@>#>$>%>&>*>=>->;>>>,>'>)>'>!>~>|;"};
diff --git a/support/highlight/src/gui-qt/highlight_de_DE.ts b/support/highlight/src/gui-qt/highlight_de_DE.ts
new file mode 100644
index 0000000000..11f6722383
--- /dev/null
+++ b/support/highlight/src/gui-qt/highlight_de_DE.ts
@@ -0,0 +1,1159 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="de_DE" sourcelanguage="en_US">
+<context>
+ <name>MainWindow</name>
+ <message>
+ <source>Themes or indent schemes not found.
+Check installation.</source>
+ <translation type="obsolete">Farb- oder Formatierungsvorlagen nicht gefunden.
+Installation prüfen.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="82"/>
+ <source>Initialization error</source>
+ <translation>Initialisierungsfehler</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="83"/>
+ <source>Could not find syntax definitions. Check installation.</source>
+ <translation>Syntaxdefinitionen nicht gefunden.
+Installation prüfen.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="610"/>
+ <source>Tags file error</source>
+ <translation>Tags Dateifehler</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="611"/>
+ <source>Could not read tags information in &quot;%1&quot;</source>
+ <translation>Konnte Tags-Informationen in %1 nicht lesen</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="628"/>
+ <location filename="mainwindow.cpp" line="659"/>
+ <source>Output error</source>
+ <translation>Ausgabefehler</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="628"/>
+ <source>Output directory does not exist!</source>
+ <translation>Zielverzeichnis existert nicht!</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="659"/>
+ <source>You must define a style output file!</source>
+ <translation>Sie müssen ein Stylesheet zur Ausgabe angeben!</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="694"/>
+ <source>Language definition error</source>
+ <translation>Fehler in Sprachdefinition</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="695"/>
+ <source>Invalid regular expression in %1:
+%2</source>
+ <translation>Ungültiger regulärer Ausdruck in %1: %2</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="699"/>
+ <source>Unknown syntax</source>
+ <translation>Unbekannte Syntax</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="699"/>
+ <source>Could not convert %1</source>
+ <translation>Konnte %1 nicht konvertieren</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="759"/>
+ <source>Converted %1 files in %2 ms</source>
+ <translation>%1 Dateien in %2 ms konvertiert</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="851"/>
+ <source>Conversion of &quot;%1&quot; not possible.</source>
+ <translation>Konnte &quot;%1&quot; nicht konvertieren.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="851"/>
+ <location filename="mainwindow.cpp" line="951"/>
+ <location filename="mainwindow.cpp" line="962"/>
+ <source>clipboard data</source>
+ <translation>Daten der Zwischenablage</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="950"/>
+ <source>Preview (%1):</source>
+ <translation>Vorschau (%1):</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="953"/>
+ <source>Current syntax: %1</source>
+ <translation>Aktuelle Syntax: %1</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="962"/>
+ <source>Preview of &quot;%1&quot; not possible.</source>
+ <translation>Vorschau von &quot;%1&quot; nicht möglich.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="973"/>
+ <source>Choose a ctags file</source>
+ <translation>Wählen Sie eine ctags Datei</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="999"/>
+ <location filename="mainwindow.cpp" line="1003"/>
+ <location filename="mainwindow.cpp" line="1007"/>
+ <location filename="mainwindow.cpp" line="1012"/>
+ <source>Choose a style include file</source>
+ <translation>Wählen Sie ein Eingabe-Stylesheet</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="1018"/>
+ <source>About providing translations</source>
+ <translation>Ãœbersetzungen bereitstellen</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="1019"/>
+ <source>The GUI was developed using the Qt toolkit, and translations may be provided using the tools Qt Linguist and lrelease.
+The highlight.ts file for Linguist resides in the src/gui-qt subdirectory.
+The qm file generated by lrelease has to be saved in gui-files/l10n.
+
+Please send a note to as (at) andre-simon (dot) de if you have issues during translating or if you have finished or updated a translation.</source>
+ <translation>Diese GUI wurde mit dem Qt Toolkit entwickelt, daher werden Ãœbersetzungsdateien mit den Werkzeugen Qt Linguist und lrelease erstellt.
+Die highlight.ts Datei für Linguist befindet sich im src/gui-qt Unterverzeichnis.
+Die von lrelease ausgegebene qm-Datei wird in gui-files/l10n gespeichert.
+
+Bitte senden Sie eine Nachricht an as (at) andre-simon (dot) de, wenn Sie Probleme bei der Ãœbersetzung haben oder wenn Sie eine Ãœbersetzung fertiggestellt bzw. aktualisiert haben.</translation>
+ </message>
+</context>
+<context>
+ <name>MainWindowClass</name>
+ <message>
+ <location filename="mainwindow.ui" line="55"/>
+ <source>Choose the source code files you want to convert.</source>
+ <translation>Wähle Sourcecode-Dateien zur Konvertierung aus.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="61"/>
+ <source>Choose input files</source>
+ <translation>Dateien wählen</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="83"/>
+ <source>List of input files.</source>
+ <translation>Liste der Eingabedateien.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="104"/>
+ <source>Remove the selected input files.</source>
+ <translation>Lösche die markierten Dateien aus der Eingabeliste.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="107"/>
+ <source>Clear selection</source>
+ <translation>Auswahl entfernen</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="114"/>
+ <source>Remove all input files.</source>
+ <translation>Lösche die Eingabeliste.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="117"/>
+ <source>Clear all</source>
+ <translation>Alle entfernen</translation>
+ </message>
+ <message>
+ <source>Output destination</source>
+ <translation type="obsolete">Zielverzeichnis</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="156"/>
+ <source>Output directory</source>
+ <translation>Zielverzeichnis</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="175"/>
+ <source>Select the output directory.</source>
+ <translation>Wähle das Ausgabeverzeichnis.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="178"/>
+ <location filename="mainwindow.ui" line="808"/>
+ <location filename="mainwindow.ui" line="919"/>
+ <location filename="mainwindow.ui" line="1158"/>
+ <location filename="mainwindow.ui" line="1280"/>
+ <location filename="mainwindow.ui" line="1562"/>
+ <source>...</source>
+ <translation>...</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="187"/>
+ <source>Save output in the input file directories.</source>
+ <translation>Speichere Ausgabe in den Verzeichnissen der Eingabedateien.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="190"/>
+ <source>Write to source directories</source>
+ <translation>In Quellverzeichnisse schreiben</translation>
+ </message>
+ <message>
+ <source>Output options</source>
+ <translation type="obsolete">Ausgabeoptionen</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="356"/>
+ <source>General</source>
+ <translation>Allgemein</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="376"/>
+ <source>Output format:</source>
+ <translation>Ausgabeformat:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="398"/>
+ <source>Choose an output format.</source>
+ <translation>Wähle ein Ausgabeformat.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="402"/>
+ <source>HTML</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="407"/>
+ <source>XHTML</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="412"/>
+ <source>LaTeX</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="417"/>
+ <source>TeX</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="422"/>
+ <source>RTF</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="427"/>
+ <source>SVG</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="432"/>
+ <source>XML</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="456"/>
+ <source>Add line numbers to the output.</source>
+ <translation>Füge Zeilennummern zur Ausgabe hinzu.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="459"/>
+ <source>Add line numbers</source>
+ <translation>Zeilennummerierung</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="479"/>
+ <source>Select the line number width.</source>
+ <translation>Wähle die Stellenanzahl der Nummerierung.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="500"/>
+ <source>Fill leading space of line numbers with zeroes.</source>
+ <translation>Fülle Zeilennummerierung mit Nullen auf.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="503"/>
+ <source>Pad with zeroes</source>
+ <translation>Zeige führende Nullen</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="516"/>
+ <source>Generate output without document header and footer.</source>
+ <translation>Erzeuge Ausgabe ohne Dokumentenkopf und -fußteil.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="519"/>
+ <source>Omit header and footer</source>
+ <translation>Kopf- und Fußteil auslassen</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="526"/>
+ <source>Test if input data is not binary.
+Removes Unicode BOM mark.</source>
+ <translation>Stellt sicher, daß die Eingabe nicht binär ist.
+Entfernt den Unicode BOM.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="530"/>
+ <source>Validate input data</source>
+ <translation>Prüfe Eingabedaten</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="539"/>
+ <source>Set the output file ancoding.</source>
+ <translation>Setzt das Encoding.</translation>
+ </message>
+ <message>
+ <source>Encoding:</source>
+ <translation type="obsolete">Encoding:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="549"/>
+ <source>Select or define the encoding.
+The result has to match the input file encoding.</source>
+ <translation>Wähle oder definiere das Ausgabe-Encoding.
+Das Encoding muss mit den Eingabedateien übereinstimmen.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="560"/>
+ <source>ISO-8859-1</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="565"/>
+ <source>ISO-8859-2</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="570"/>
+ <source>ISO-8859-3</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="575"/>
+ <source>ISO-8859-4</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="580"/>
+ <source>ISO-8859-5</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="585"/>
+ <source>ISO-8859-6</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="590"/>
+ <source>ISO-8859-7</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="595"/>
+ <source>ISO-8859-8</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="600"/>
+ <source>ISO-8859-9</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="605"/>
+ <source>ISO-8859-10</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="610"/>
+ <source>ISO-8859-11</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="615"/>
+ <source>ISO-8859-12</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="620"/>
+ <source>ISO-8859-13</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="625"/>
+ <source>ISO-8859-14</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="630"/>
+ <source>ISO-8859-15</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="635"/>
+ <source>UTF-8</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="659"/>
+ <source>Output specific</source>
+ <translation>Format-Optionen</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="696"/>
+ <source>HTML options</source>
+ <translation>HTML Optionen</translation>
+ </message>
+ <message>
+ <source>Style</source>
+ <translation type="obsolete">Stylesheets</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="734"/>
+ <location filename="mainwindow.ui" line="1088"/>
+ <location filename="mainwindow.ui" line="1210"/>
+ <location filename="mainwindow.ui" line="1492"/>
+ <source>Include the style information in each output file.</source>
+ <translation>Füge die Stylesheets in jede Ausgabedatei ein.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="737"/>
+ <location filename="mainwindow.ui" line="1495"/>
+ <source>Embed style (CSS)</source>
+ <translation>CSS einbetten</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="747"/>
+ <source>Add CSS information to each tag (do not use CSS class definitions).</source>
+ <translation>Füge Stylesheets in jeden Tag ein (benutze keine CSS Klassen).</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="750"/>
+ <source>Inline CSS</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>Style file:</source>
+ <translation type="obsolete">Stylesheet-Datei:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="777"/>
+ <location filename="mainwindow.ui" line="1232"/>
+ <location filename="mainwindow.ui" line="1514"/>
+ <source>Name of the referenced style file.</source>
+ <translation>Name des referenzierten Stylesheets.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="780"/>
+ <location filename="mainwindow.ui" line="1517"/>
+ <source>highlight.css</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>Style include file:</source>
+ <translation type="obsolete">Eingabe-Stylesheet:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="798"/>
+ <location filename="mainwindow.ui" line="1552"/>
+ <source>Path of the CSS include file.</source>
+ <translation>Pfad zur CSS-Datei, die ins Stylesheet eingefügt werden soll.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="805"/>
+ <source>Select a CSS include file.</source>
+ <translation>Wähle eine Stylesheet-Eingabedatei.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="819"/>
+ <source>CSS class prefix:</source>
+ <translation>CSS Präfix:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="826"/>
+ <source>Add a CSS class name prefix to avoid namespace clashes.</source>
+ <translation>Definiere einen CSS-Klassennamen, um Kollisionen mit anderen Stylesheets zu vermeiden.</translation>
+ </message>
+ <message>
+ <source>Tags and index files</source>
+ <translation type="obsolete">Tags- und Indexdateien</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="861"/>
+ <source>Generate an index file with hyperlinks to all outputted files.</source>
+ <translation>Erzeuge eine Indexdatei mit Links zu allen Ausgabedateien.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="864"/>
+ <source>Generate index file</source>
+ <translation>Indexdatei erzeugen</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="884"/>
+ <source>Read a ctags file and add the included metainformation as tooltips.
+See ctags.sf.net for details.</source>
+ <translation>Lese eine ctags-Datei und füge die Metainformationen als Tooltips hinzu.
+Siehe ctags.sf.net um mehr darüber zu erfahren.</translation>
+ </message>
+ <message>
+ <source>Ctags file:</source>
+ <translation type="obsolete">Ctags Datei:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="903"/>
+ <source>Path of the ctags file.</source>
+ <translation>Pfad der ctags-Datei.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="916"/>
+ <source>Choose a ctags file.</source>
+ <translation>Wähle eine ctags Datei.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="945"/>
+ <source>Misc</source>
+ <translation>Verschiedenes</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="964"/>
+ <source>Add an achor to each line.</source>
+ <translation>Füge Anker zu jeder Zeile hinzu.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="967"/>
+ <source>Add line anchors</source>
+ <translation>Anker einfügen</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="974"/>
+ <source>Add the filename as prefix to the anchors.</source>
+ <translation>Füge Dateinamen als Präfix zum Anker hinzu.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="977"/>
+ <source>Include file name in anchor</source>
+ <translation>Dateiname im Anker</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="984"/>
+ <source>Output the lines within an ordered list.</source>
+ <translation>Gib die Zeilen als sortierte Liste aus.</translation>
+ </message>
+ <message>
+ <source>Ordered list</source>
+ <translation type="obsolete">Sortierte Liste</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1001"/>
+ <source>Add &amp;lt;pre&amp;gt; tags to the output, if the flag &quot;No document header and footer&quot; is selected.</source>
+ <translation>Schließe die Ausgabe in &amp;lt;pre&amp;gt;-Tags ein, wenn die Option &quot;Kopf- und Fußteil auslassen&quot; gewählt ist.</translation>
+ </message>
+ <message>
+ <source>Enclose in &lt;pre&gt;</source>
+ <translation type="obsolete">Schließe in &amp;lt;pre&amp;gt; ein</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1044"/>
+ <source>LaTeX options</source>
+ <translation>LaTeX Optionen</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1058"/>
+ <source>Replace quotes by dq sequences.</source>
+ <translation>Ersetze Anführungszeichen mit \dq-Sequenzen.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1061"/>
+ <source>Escape quotes</source>
+ <translation>Ersetze Anführungszeichen</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1068"/>
+ <source>Make output Babel compatible.</source>
+ <translation>Erzeuge Code, der mit Babel verträglich ist.</translation>
+ </message>
+ <message>
+ <source>Babel compatibility</source>
+ <translation type="obsolete">Babel Kompatibilität</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1078"/>
+ <source>Replace default symbols (brackets, tilde) by nice redefinitions.</source>
+ <translation>Ersetze Standard-Darstellung verschiedener Symbole (Klammern, Tilde) durch schönere Definitionen.</translation>
+ </message>
+ <message>
+ <source>Pretty symbols</source>
+ <translation type="obsolete">Schönere Symbole</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1091"/>
+ <source>Embed style (defs)</source>
+ <translation>Stylesheet einbetten</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1110"/>
+ <source>Name of the referenced style file.</source>
+ <translation>Name des referenzierten Stylesheets.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1113"/>
+ <location filename="mainwindow.ui" line="1235"/>
+ <source>highlight.sty</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>Style include:</source>
+ <translation type="obsolete">Eingabe-Stylesheet:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="542"/>
+ <source>Set encoding:</source>
+ <translation>Encoding:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="888"/>
+ <source>Read ctags file:</source>
+ <translation>Lese ctags-Datei:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="987"/>
+ <source>Output as ordered list</source>
+ <translation>Sortierte Liste</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1004"/>
+ <source>Enclose in pre tags</source>
+ <translation>Schließe in pre-Tags ein</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1071"/>
+ <source>Add Babel compatibility</source>
+ <translation>Babel Kompatibilität</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1081"/>
+ <source>Add pretty symbols</source>
+ <translation>Symbole anpassen</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="764"/>
+ <location filename="mainwindow.ui" line="1100"/>
+ <location filename="mainwindow.ui" line="1222"/>
+ <location filename="mainwindow.ui" line="1504"/>
+ <source>Stylesheet file:</source>
+ <translation>Stylesheet-Datei:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="141"/>
+ <source>Output destination:</source>
+ <translation>Zielverzeichnis:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1124"/>
+ <location filename="mainwindow.ui" line="1246"/>
+ <location filename="mainwindow.ui" line="1528"/>
+ <source>Stylesheet include file:</source>
+ <translation>Eingabe-Stylesheet:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="957"/>
+ <source>Line numbering options:</source>
+ <translation>Optionen der Zeilennummerierung:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="20"/>
+ <source>Highlight</source>
+ <translation>Highlight</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="49"/>
+ <source>Files</source>
+ <translation>Dateien</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="256"/>
+ <source>Paste clipboard content into the preview window.</source>
+ <translation>Füge Inhalt der Zwischenablage in die Vorschau ein.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="259"/>
+ <source>Paste from clipboard</source>
+ <translation>Aus Zwischenablage einfügen</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="297"/>
+ <source>Copy highlighted code into the clipboard.</source>
+ <translation>Kopiere formatierte Ausgabe in die Zwischenablage.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="300"/>
+ <source>Copy preview to clipboard</source>
+ <translation>In Zwischenablage kopieren</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="268"/>
+ <source>Select syntax:</source>
+ <translation>Syntax wählen:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="275"/>
+ <source>Select the correct syntax of the code snippet.</source>
+ <translation>Wähle die zum Text passende Syntax.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="437"/>
+ <source>BBCode</source>
+ <translation>BBCode</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="726"/>
+ <source>Stylesheets</source>
+ <translation>Stylesheets</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="791"/>
+ <source>Include:</source>
+ <translation>Eingabedatei:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="855"/>
+ <source>Index/ctags</source>
+ <translation>Index/ctags</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1148"/>
+ <location filename="mainwindow.ui" line="1270"/>
+ <source>Path of the style include file.</source>
+ <translation>Pfad zur sty-Datei, die ins Stylesheet eingefügt werden soll.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1155"/>
+ <location filename="mainwindow.ui" line="1277"/>
+ <location filename="mainwindow.ui" line="1559"/>
+ <source>Select a style include file.</source>
+ <translation>Wähle eine Stylesheet-Eingabedatei.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1196"/>
+ <source>TeX options</source>
+ <translation>TeX Optionen</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1213"/>
+ <source>Embed style (macros)</source>
+ <translation>Stylesheet einbetten</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1318"/>
+ <source>RTF options</source>
+ <translation>RTF Optionen</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1332"/>
+ <source>Add character stylesheets with formatting information.
+You can select the stylesheets in your word processor to reformat additional text.</source>
+ <translation>Füge Zeichenvorlagen mit Formatierungsinformationen hinzu.
+Diese können in der Textverarbeitung gewählt werden, um zusätzlichen Text zu formatieren.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1336"/>
+ <source>Add character styles</source>
+ <translation>Zeichenvorlagen</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1345"/>
+ <source>Page size:</source>
+ <translation>Papierformat:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1352"/>
+ <source>Select a page size.</source>
+ <translation>Wähle eine Seitengröße aus.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1359"/>
+ <source>A3</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1364"/>
+ <source>A4</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1369"/>
+ <source>A5</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1374"/>
+ <source>B4</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1379"/>
+ <source>B5</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1384"/>
+ <source>B6</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1389"/>
+ <source>Letter</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1394"/>
+ <source>Legal</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1433"/>
+ <source>SVG options</source>
+ <translation>SVG Optionen</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1447"/>
+ <source>Image size:</source>
+ <translation>Bildgröße:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1456"/>
+ <source>Width:</source>
+ <translation>Breite:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1466"/>
+ <source>Enter the SVG width (may contain units).</source>
+ <translation>Gib die Bildbreite ein (kann Größeneinheiten enthalten).</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1473"/>
+ <source>Height:</source>
+ <translation>Höhe:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1483"/>
+ <source>Enter the SVG height (may contain units).</source>
+ <translation>Gib die Bildhöhe ein (kann Größeneinheiten enthalten).</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1588"/>
+ <source>No options defined.</source>
+ <translation>Keine Optionen vorhanden.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1613"/>
+ <source>Formatting</source>
+ <translation>Formatierung</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1627"/>
+ <source>Color theme:</source>
+ <translation>Farbschema:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1643"/>
+ <source>Select a colour theme.</source>
+ <translation>Wähle ein Farbschema.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1654"/>
+ <source>Reformat and indent your code.
+This feature is enabled tor C, C++, C# and Java code.</source>
+ <translation>Formatiere den Eingabecode.
+Diese Funktion kann auf C, C++, C# und Java-Code angewandt werden.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1658"/>
+ <source>Reformat:</source>
+ <translation>Formatieren:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1671"/>
+ <source>Choose a formatting scheme.</source>
+ <translation>Wähle ein Formatierungs-Schema.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1675"/>
+ <source>Allman</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1680"/>
+ <source>Banner</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1685"/>
+ <source>GNU</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1690"/>
+ <source>Java</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1695"/>
+ <source>K&amp;R</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1700"/>
+ <source>Linux</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1705"/>
+ <source>Stroustrup</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1710"/>
+ <source>Whitesmith</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1722"/>
+ <source>Change the keyword case.</source>
+ <translation>Ändere die Groß- und Kleinschreibung, wenn die Eingabesyntax nicht case-sensitive ist.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1725"/>
+ <source>Keyword case:</source>
+ <translation>Schlüsselwort Case:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1738"/>
+ <source>Select a keyword case.</source>
+ <translation>Wähle einen Typ der Groß- und Kleinschreibung.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1742"/>
+ <source>UPPER</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1747"/>
+ <source>lower</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1752"/>
+ <source>Capitalize</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1770"/>
+ <source>Tab width:</source>
+ <translation>Tabulatorbreite:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1780"/>
+ <source>Enter the number of spaces which replace a tab.
+Set the width to 0 to keep tabs.</source>
+ <translation>Gib die Anzahl der Leerzeichen an, die ein Tab ersetzen.
+Setze die Anzahl auf Null, um Tabs auszugeben.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1795"/>
+ <source>Enable line wrapping.</source>
+ <translation>Aktiviere den automatischen Zeilenumbruch.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1798"/>
+ <source>Line wrapping</source>
+ <translation>Zeilenumbruch</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1805"/>
+ <source>Enter the maximum line length.</source>
+ <translation>Gib die maximale Zeilenlänge ein.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1824"/>
+ <source>Indent statements and function parameters after wrapping.</source>
+ <translation>Rücke Kommandos und Funktionsparameter nach dem Umbruch ein.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1827"/>
+ <source>Intelligent wrapping</source>
+ <translation>Intelligenter Umbruch</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1861"/>
+ <source>Font name:</source>
+ <translation>Schriftart:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1871"/>
+ <source>Select or enter the font name.</source>
+ <translation>Wähle oder gib die Schriftart an.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1878"/>
+ <source>Font size:</source>
+ <translation>Schriftgröße:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1894"/>
+ <source>Enter the font size.</source>
+ <translation>Gib die Schriftgröße ein.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1918"/>
+ <source>Preview</source>
+ <translation>Vorschau</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="226"/>
+ <source>Start the conversion of your input files.</source>
+ <translation>Starte die Konvertierung der Eingabedateien.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="229"/>
+ <source>Convert files</source>
+ <translation>Konvertieren</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="239"/>
+ <source>Copy highlighted code of the seleted file into the clipboard.</source>
+ <translation>Kopiere den Inhalt der ausgewählten Datei mit Highlighting in die Zwischenablage.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="250"/>
+ <source>Clipboard</source>
+ <translation>Zwischenablage</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="242"/>
+ <source>Copy file to clipboard</source>
+ <translation>Datei in Zwischenablage</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1943"/>
+ <source>Output progress:</source>
+ <translation>Ausgabefortschritt:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1971"/>
+ <source>&amp;File</source>
+ <translation>&amp;Datei</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1979"/>
+ <source>&amp;Help</source>
+ <translation>&amp;Hilfe</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1996"/>
+ <source>&amp;Open files</source>
+ <translation>Öffne &amp;Dateien</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="2001"/>
+ <source>&amp;Exit</source>
+ <translation>&amp;Beenden</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="2006"/>
+ <source>&amp;Load</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="2011"/>
+ <source>&amp;Save</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="2016"/>
+ <source>Load &amp;default project</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="2021"/>
+ <source>Readme</source>
+ <translation>Handbuch</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="2026"/>
+ <source>&amp;Tips</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="2034"/>
+ <source>&amp;Changelog</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="2039"/>
+ <source>&amp;License</source>
+ <translation>&amp;Lizenz</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="2044"/>
+ <source>&amp;About Highlight</source>
+ <translation>&amp;Ãœber Highlight</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="2049"/>
+ <source>About &amp;translations</source>
+ <translation>&amp;Infos zu Ãœbersetzungen</translation>
+ </message>
+</context>
+<context>
+ <name>ShowTextFile</name>
+ <message>
+ <location filename="showtextfile.ui" line="17"/>
+ <source>Show text</source>
+ <translation>Textanzeige</translation>
+ </message>
+ <message>
+ <location filename="showtextfile.ui" line="37"/>
+ <source>TextLabel</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="showtextfile.ui" line="69"/>
+ <source>OK</source>
+ <translation>OK</translation>
+ </message>
+</context>
+<context>
+ <name>io_report</name>
+ <message>
+ <location filename="io_report.ui" line="14"/>
+ <source>Error summary</source>
+ <translation>Fehlerübersicht</translation>
+ </message>
+ <message>
+ <location filename="io_report.ui" line="24"/>
+ <source>Input errors:</source>
+ <translation>Eingabefehler:</translation>
+ </message>
+ <message>
+ <location filename="io_report.ui" line="34"/>
+ <source>Remove files above from input file list</source>
+ <translation>Obige Dateien aus der Eingabeliste löschen</translation>
+ </message>
+ <message>
+ <location filename="io_report.ui" line="48"/>
+ <source>Output errors:</source>
+ <translation>Ausgabefehler:</translation>
+ </message>
+ <message>
+ <location filename="io_report.ui" line="65"/>
+ <source>Reformatting not possible:</source>
+ <translation>Neuformatierung nicht möglich:</translation>
+ </message>
+</context>
+</TS>
diff --git a/support/highlight/src/gui-qt/highlight_es_ES.ts b/support/highlight/src/gui-qt/highlight_es_ES.ts
new file mode 100644
index 0000000000..6349f0590a
--- /dev/null
+++ b/support/highlight/src/gui-qt/highlight_es_ES.ts
@@ -0,0 +1,1156 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="es_MX">
+<context>
+ <name>MainWindow</name>
+ <message>
+ <source>Themes or indent schemes not found.
+Check installation.</source>
+ <translation type="obsolete">Temas o esquemas de indentación no encontrados
+Revise su instalación.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="82"/>
+ <source>Initialization error</source>
+ <translation>Error de inicialización</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="83"/>
+ <source>Could not find syntax definitions. Check installation.</source>
+ <translation>Definiciones de sintaxis no encontradas.
+Revise su instalacion.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="610"/>
+ <source>Tags file error</source>
+ <translation>Error de archivo de etiquetas</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="611"/>
+ <source>Could not read tags information in &quot;%1&quot;</source>
+ <translation>No se pudieron leer las etiquetas de &quot;%1&quot;</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="628"/>
+ <location filename="mainwindow.cpp" line="659"/>
+ <source>Output error</source>
+ <translation>Error de salida</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="628"/>
+ <source>Output directory does not exist!</source>
+ <translation>¡Directorio de salida no existe!</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="659"/>
+ <source>You must define a style output file!</source>
+ <translation>¡Debe especificar un archivo de estilo de salida!</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="694"/>
+ <source>Language definition error</source>
+ <translation>Error de definición de lenguaje</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="695"/>
+ <source>Invalid regular expression in %1:
+%2</source>
+ <translation>Expresión regular inválida en %1:
+%2</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="699"/>
+ <source>Unknown syntax</source>
+ <translation>Sintaxis desconocida</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="699"/>
+ <source>Could not convert %1</source>
+ <translation>No se pudo convertir %1</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="759"/>
+ <source>Converted %1 files in %2 ms</source>
+ <translation>Se convirtieron%1 archivos en %2 ms</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="851"/>
+ <source>Conversion of &quot;%1&quot; not possible.</source>
+ <translation>No es posible la conversión de &quot;%1&quot;.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="851"/>
+ <location filename="mainwindow.cpp" line="951"/>
+ <location filename="mainwindow.cpp" line="962"/>
+ <source>clipboard data</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="950"/>
+ <source>Preview (%1):</source>
+ <translation>Previsualización (%1):</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="953"/>
+ <source>Current syntax: %1</source>
+ <translation>Sintaxis actual: %1</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="962"/>
+ <source>Preview of &quot;%1&quot; not possible.</source>
+ <translation>No es posible previsualizar &quot;%1&quot;.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="973"/>
+ <source>Choose a ctags file</source>
+ <translation>Elija un archivo de ctags</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="999"/>
+ <location filename="mainwindow.cpp" line="1003"/>
+ <location filename="mainwindow.cpp" line="1007"/>
+ <location filename="mainwindow.cpp" line="1012"/>
+ <source>Choose a style include file</source>
+ <translation>Elija un archivo de inclusión de estilo</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="1018"/>
+ <source>About providing translations</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="1019"/>
+ <source>The GUI was developed using the Qt toolkit, and translations may be provided using the tools Qt Linguist and lrelease.
+The highlight.ts file for Linguist resides in the src/gui-qt subdirectory.
+The qm file generated by lrelease has to be saved in gui-files/l10n.
+
+Please send a note to as (at) andre-simon (dot) de if you have issues during translating or if you have finished or updated a translation.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>MainWindowClass</name>
+ <message>
+ <location filename="mainwindow.ui" line="55"/>
+ <source>Choose the source code files you want to convert.</source>
+ <translation>Elijir los archivos fuente que desea convertir.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="61"/>
+ <source>Choose input files</source>
+ <translation>Elijir archivos de entrada</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="83"/>
+ <source>List of input files.</source>
+ <translation>Lista de archivos de entrada.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="104"/>
+ <source>Remove the selected input files.</source>
+ <translation>Remover los archivos de entrada seleccionados.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="107"/>
+ <source>Clear selection</source>
+ <translation>Remover seleccionados</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="114"/>
+ <source>Remove all input files.</source>
+ <translation>Remover todos los archivos de entrada.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="117"/>
+ <source>Clear all</source>
+ <translation>Remover todos</translation>
+ </message>
+ <message>
+ <source>Output destination</source>
+ <translation type="obsolete">Destino de salida</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="156"/>
+ <source>Output directory</source>
+ <translation>Directorio de salida</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="175"/>
+ <source>Select the output directory.</source>
+ <translation>Elijir el directorio de salida.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="178"/>
+ <location filename="mainwindow.ui" line="808"/>
+ <location filename="mainwindow.ui" line="919"/>
+ <location filename="mainwindow.ui" line="1158"/>
+ <location filename="mainwindow.ui" line="1280"/>
+ <location filename="mainwindow.ui" line="1562"/>
+ <source>...</source>
+ <translation>...</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="187"/>
+ <source>Save output in the input file directories.</source>
+ <translation>Guardar salida en los directorios de entrada de cada archivo.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="190"/>
+ <source>Write to source directories</source>
+ <translation>Guardar a los directorios de origen</translation>
+ </message>
+ <message>
+ <source>Output options</source>
+ <translation type="obsolete">Opciones de salida</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="356"/>
+ <source>General</source>
+ <translation>General</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="376"/>
+ <source>Output format:</source>
+ <translation>Formato de salida:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="398"/>
+ <source>Choose an output format.</source>
+ <translation>Elija un formato de salida.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="402"/>
+ <source>HTML</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="407"/>
+ <source>XHTML</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="412"/>
+ <source>LaTeX</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="417"/>
+ <source>TeX</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="422"/>
+ <source>RTF</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="427"/>
+ <source>SVG</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="432"/>
+ <source>XML</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="456"/>
+ <source>Add line numbers to the output.</source>
+ <translation>Agregar números de linea a la salida.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="459"/>
+ <source>Add line numbers</source>
+ <translation>Agregar números de linea</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="479"/>
+ <source>Select the line number width.</source>
+ <translation>Seleccione el ancho de número de linea.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="500"/>
+ <source>Fill leading space of line numbers with zeroes.</source>
+ <translation>Llenar espacio antes de los números de lineas con ceros.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="503"/>
+ <source>Pad with zeroes</source>
+ <translation>Rellenar con ceros</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="516"/>
+ <source>Generate output without document header and footer.</source>
+ <translation>Generar documento de salida con cabecera y pie de página.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="519"/>
+ <source>Omit header and footer</source>
+ <translation>Omitir cabecera y pie de página</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="526"/>
+ <source>Test if input data is not binary.
+Removes Unicode BOM mark.</source>
+ <translation>Probar si los datos de entrada no son binarios.
+Remueve marca BOM de Unicode.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="530"/>
+ <source>Validate input data</source>
+ <translation>Validar datos de entrada</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="539"/>
+ <source>Set the output file ancoding.</source>
+ <translation>Ajuste la codificación del archivo de salida.</translation>
+ </message>
+ <message>
+ <source>Encoding:</source>
+ <translation type="obsolete">Codificación:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="549"/>
+ <source>Select or define the encoding.
+The result has to match the input file encoding.</source>
+ <translation>Elija o defina la codificación.
+El resultado tiene que corresponder a la codificación del archivo de entrada.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="560"/>
+ <source>ISO-8859-1</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="565"/>
+ <source>ISO-8859-2</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="570"/>
+ <source>ISO-8859-3</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="575"/>
+ <source>ISO-8859-4</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="580"/>
+ <source>ISO-8859-5</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="585"/>
+ <source>ISO-8859-6</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="590"/>
+ <source>ISO-8859-7</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="595"/>
+ <source>ISO-8859-8</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="600"/>
+ <source>ISO-8859-9</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="605"/>
+ <source>ISO-8859-10</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="610"/>
+ <source>ISO-8859-11</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="615"/>
+ <source>ISO-8859-12</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="620"/>
+ <source>ISO-8859-13</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="625"/>
+ <source>ISO-8859-14</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="630"/>
+ <source>ISO-8859-15</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="635"/>
+ <source>UTF-8</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="659"/>
+ <source>Output specific</source>
+ <translation>Esoecificas de salida</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="696"/>
+ <source>HTML options</source>
+ <translation>Opciones de HTML</translation>
+ </message>
+ <message>
+ <source>Style</source>
+ <translation type="obsolete">Hoja de estilo</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="734"/>
+ <location filename="mainwindow.ui" line="1088"/>
+ <location filename="mainwindow.ui" line="1210"/>
+ <location filename="mainwindow.ui" line="1492"/>
+ <source>Include the style information in each output file.</source>
+ <translation>Incluir la información de estilo en cada archivo de salida.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="737"/>
+ <location filename="mainwindow.ui" line="1495"/>
+ <source>Embed style (CSS)</source>
+ <translation>Incrustar estilo (CSS)</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="747"/>
+ <source>Add CSS information to each tag (do not use CSS class definitions).</source>
+ <translation>Agregar información de CSS a cada etiqueta (no utilizar definiciones de clase de CSS).</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="750"/>
+ <source>Inline CSS</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>Style file:</source>
+ <translation type="obsolete">Archivo de estilo:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="777"/>
+ <location filename="mainwindow.ui" line="1232"/>
+ <location filename="mainwindow.ui" line="1514"/>
+ <source>Name of the referenced style file.</source>
+ <translation>Nombre del archivo de estilo citado.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="780"/>
+ <location filename="mainwindow.ui" line="1517"/>
+ <source>highlight.css</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>Style include file:</source>
+ <translation type="obsolete">Archivo de estilo a incluir:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="798"/>
+ <location filename="mainwindow.ui" line="1552"/>
+ <source>Path of the CSS include file.</source>
+ <translation>Ruta del archivo CSS a incluir.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="805"/>
+ <source>Select a CSS include file.</source>
+ <translation>Seleccionar un archivo CSS a incluir.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="819"/>
+ <source>CSS class prefix:</source>
+ <translation>Prefijo de clase de CSS:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="826"/>
+ <source>Add a CSS class name prefix to avoid namespace clashes.</source>
+ <translation>Agregue un prefijo de nombre de clase de CSS para evitar conflictos.</translation>
+ </message>
+ <message>
+ <source>Tags and index files</source>
+ <translation type="obsolete">Archivos de etiquetas e índice</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="861"/>
+ <source>Generate an index file with hyperlinks to all outputted files.</source>
+ <translation>Generar un archivo de indice con enlaces a todos los archivos de salida.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="864"/>
+ <source>Generate index file</source>
+ <translation>Generar archivo de índice</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="884"/>
+ <source>Read a ctags file and add the included metainformation as tooltips.
+See ctags.sf.net for details.</source>
+ <translation>Leer un archivo de ctags y agregar la metainformación incluida como aviso emergente.
+Vea ctags.sf.net para más detalles.</translation>
+ </message>
+ <message>
+ <source>Ctags file:</source>
+ <translation type="obsolete">Archivo de ctags:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="903"/>
+ <source>Path of the ctags file.</source>
+ <translation>Ruta del archivo de ctags.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="916"/>
+ <source>Choose a ctags file.</source>
+ <translation>Elijir un archivo de ctags.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="945"/>
+ <source>Misc</source>
+ <translation>Miscelaneo</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="964"/>
+ <source>Add an achor to each line.</source>
+ <translation>Agregar una ancla a cada linea.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="967"/>
+ <source>Add line anchors</source>
+ <translation>Agregar ancla por linea</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="974"/>
+ <source>Add the filename as prefix to the anchors.</source>
+ <translation>Agregar el nombre de archivo como prefijo a las anclas.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="977"/>
+ <source>Include file name in anchor</source>
+ <translation>Incluir el nombre de archivo en el ancla</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="984"/>
+ <source>Output the lines within an ordered list.</source>
+ <translation>Producir las lineas de salida dentro de una lista ordenada.</translation>
+ </message>
+ <message>
+ <source>Ordered list</source>
+ <translation type="obsolete">Lista ordenada</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1001"/>
+ <source>Add &amp;lt;pre&amp;gt; tags to the output, if the flag &quot;No document header and footer&quot; is selected.</source>
+ <translation>Agregar etiquetas &amp;lt;pre&amp;gt; a la salida, si la opción &quot;Sin cabecera ni pie de página&quot; está seleccionada.</translation>
+ </message>
+ <message>
+ <source>Enclose in &lt;pre&gt;</source>
+ <translation type="obsolete">Meter entre &amp;lt;pre&amp;gt;</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1044"/>
+ <source>LaTeX options</source>
+ <translation>Opciones de LaTeX</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1058"/>
+ <source>Replace quotes by dq sequences.</source>
+ <translation>Reemplazar comillas por sucesiones de dobles comillas.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1061"/>
+ <source>Escape quotes</source>
+ <translation>Sobrepasar comillas</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1068"/>
+ <source>Make output Babel compatible.</source>
+ <translation>Hacer que la salida se compatible con Babel.</translation>
+ </message>
+ <message>
+ <source>Babel compatibility</source>
+ <translation type="obsolete">Compatibilidad con Babel</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1078"/>
+ <source>Replace default symbols (brackets, tilde) by nice redefinitions.</source>
+ <translation>Reemplazar símbolos por defecto (llaves, corchetes, tildes) por redefiniciones apropiadas.</translation>
+ </message>
+ <message>
+ <source>Pretty symbols</source>
+ <translation type="obsolete">Símbolos lindos</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1091"/>
+ <source>Embed style (defs)</source>
+ <translation>Incrustar estilo</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1110"/>
+ <source>Name of the referenced style file.</source>
+ <translation>Nombre del archivo de estilo citado.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1113"/>
+ <location filename="mainwindow.ui" line="1235"/>
+ <source>highlight.sty</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>Style include:</source>
+ <translation type="obsolete">Incluir estilo:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="542"/>
+ <source>Set encoding:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="141"/>
+ <source>Output destination:</source>
+ <translation>Destino de salida</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="764"/>
+ <location filename="mainwindow.ui" line="1100"/>
+ <location filename="mainwindow.ui" line="1222"/>
+ <location filename="mainwindow.ui" line="1504"/>
+ <source>Stylesheet file:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1124"/>
+ <location filename="mainwindow.ui" line="1246"/>
+ <location filename="mainwindow.ui" line="1528"/>
+ <source>Stylesheet include file:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="888"/>
+ <source>Read ctags file:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="20"/>
+ <source>Highlight</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="49"/>
+ <source>Files</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="256"/>
+ <source>Paste clipboard content into the preview window.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="259"/>
+ <source>Paste from clipboard</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="297"/>
+ <source>Copy highlighted code into the clipboard.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="300"/>
+ <source>Copy preview to clipboard</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="268"/>
+ <source>Select syntax:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="275"/>
+ <source>Select the correct syntax of the code snippet.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="437"/>
+ <source>BBCode</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="726"/>
+ <source>Stylesheets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="791"/>
+ <source>Include:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="855"/>
+ <source>Index/ctags</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="957"/>
+ <source>Line numbering options:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="987"/>
+ <source>Output as ordered list</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1004"/>
+ <source>Enclose in pre tags</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1071"/>
+ <source>Add Babel compatibility</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1081"/>
+ <source>Add pretty symbols</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1148"/>
+ <location filename="mainwindow.ui" line="1270"/>
+ <source>Path of the style include file.</source>
+ <translation>Ruta del archivo de estilo a incluir.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1155"/>
+ <location filename="mainwindow.ui" line="1277"/>
+ <location filename="mainwindow.ui" line="1559"/>
+ <source>Select a style include file.</source>
+ <translation>Seleccione un archivo de estilo a incluir.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1196"/>
+ <source>TeX options</source>
+ <translation>Opciones de TeX</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1213"/>
+ <source>Embed style (macros)</source>
+ <translation>Estilo de incrustación (macros)</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1318"/>
+ <source>RTF options</source>
+ <translation>Opciones de RTF</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1332"/>
+ <source>Add character stylesheets with formatting information.
+You can select the stylesheets in your word processor to reformat additional text.</source>
+ <translation>Agregar hojas de estilo de caracteres con informacion de formato.
+Puede selecionar la hoja de estilo en su procesador de textos para dar formato nuevamente a texto adicional.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1336"/>
+ <source>Add character styles</source>
+ <translation>Agregar estilos de caracteres</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1345"/>
+ <source>Page size:</source>
+ <translation>Tamaño de paǵina:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1352"/>
+ <source>Select a page size.</source>
+ <translation>Seleccionar un tamaño de página.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1359"/>
+ <source>A3</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1364"/>
+ <source>A4</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1369"/>
+ <source>A5</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1374"/>
+ <source>B4</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1379"/>
+ <source>B5</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1384"/>
+ <source>B6</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1389"/>
+ <source>Letter</source>
+ <translation>Carta</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1394"/>
+ <source>Legal</source>
+ <translation>Oficio</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1433"/>
+ <source>SVG options</source>
+ <translation>Opciones de SVG</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1447"/>
+ <source>Image size:</source>
+ <translation>Tamaño de la imagen:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1456"/>
+ <source>Width:</source>
+ <translation>Ancho:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1466"/>
+ <source>Enter the SVG width (may contain units).</source>
+ <translation>Introducir el ancho de SVG (puede incluir unidades).</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1473"/>
+ <source>Height:</source>
+ <translation>Alto:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1483"/>
+ <source>Enter the SVG height (may contain units).</source>
+ <translation>Introducir el alto de SVG (puede incluir unidades).</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1588"/>
+ <source>No options defined.</source>
+ <translation>No hay opciones definidas.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1613"/>
+ <source>Formatting</source>
+ <translation>Formato</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1627"/>
+ <source>Color theme:</source>
+ <translation>Tema de color:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1643"/>
+ <source>Select a colour theme.</source>
+ <translation>Seleccionar un tema de color.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1654"/>
+ <source>Reformat and indent your code.
+This feature is enabled tor C, C++, C# and Java code.</source>
+ <translation>Dar formato nuevamente e indentar su código.
+Esta propiedad esta habilitada para código en C, C++, C# y Java.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1658"/>
+ <source>Reformat:</source>
+ <translation>Dar formato nuevamente:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1671"/>
+ <source>Choose a formatting scheme.</source>
+ <translation>Elija un esquema de formato.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1675"/>
+ <source>Allman</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1680"/>
+ <source>Banner</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1685"/>
+ <source>GNU</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1690"/>
+ <source>Java</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1695"/>
+ <source>K&amp;R</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1700"/>
+ <source>Linux</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1705"/>
+ <source>Stroustrup</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1710"/>
+ <source>Whitesmith</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1722"/>
+ <source>Change the keyword case.</source>
+ <translation>Cambiar mayúsculas/minúsculas en palabras reservadas.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1725"/>
+ <source>Keyword case:</source>
+ <translation>Mayúsculas/minúsculas de palabras reservadas:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1738"/>
+ <source>Select a keyword case.</source>
+ <translation>Seleccione un estilo de mayúsculas/minúsculas.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1742"/>
+ <source>UPPER</source>
+ <translation>MAYÚSCULAS</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1747"/>
+ <source>lower</source>
+ <translation>minúsculas</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1752"/>
+ <source>Capitalize</source>
+ <translation>Primera Letra Mayúscula</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1770"/>
+ <source>Tab width:</source>
+ <translation>Ancho de tabulador:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1780"/>
+ <source>Enter the number of spaces which replace a tab.
+Set the width to 0 to keep tabs.</source>
+ <translation>Introducir el número de espacios que reemplazaran un tabulador.
+En caso de ser 0 se mantendrán los tabuladores.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1795"/>
+ <source>Enable line wrapping.</source>
+ <translation>Habilitar romper lineas.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1798"/>
+ <source>Line wrapping</source>
+ <translation>Romper lineas</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1805"/>
+ <source>Enter the maximum line length.</source>
+ <translation>Introducir longitud máxima de linea.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1824"/>
+ <source>Indent statements and function parameters after wrapping.</source>
+ <translation>Indentar instrucciones y parámetros de funciones después de romper la linea.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1827"/>
+ <source>Intelligent wrapping</source>
+ <translation>Rompido inteligente</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1861"/>
+ <source>Font name:</source>
+ <translation>Nombre de la fuente:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1871"/>
+ <source>Select or enter the font name.</source>
+ <translation>Seleccionar o introduzcir el nombre de la fuente.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1878"/>
+ <source>Font size:</source>
+ <translation>Tamaño de la fuente:</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1894"/>
+ <source>Enter the font size.</source>
+ <translation>Introducir el tamaño de la fuente.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1918"/>
+ <source>Preview</source>
+ <translation>Previsualización</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="226"/>
+ <source>Start the conversion of your input files.</source>
+ <translation>Comenzar la conversión de los archivos de entrada.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="229"/>
+ <source>Convert files</source>
+ <translation>Convertir archivos</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="239"/>
+ <source>Copy highlighted code of the seleted file into the clipboard.</source>
+ <translation>Copiar codigo resaltado del archivo seleccionado al portapapeles.</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="250"/>
+ <source>Clipboard</source>
+ <translation>Portapapeles</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="242"/>
+ <source>Copy file to clipboard</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1943"/>
+ <source>Output progress:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1971"/>
+ <source>&amp;File</source>
+ <translation>&amp;Archivo</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1979"/>
+ <source>&amp;Help</source>
+ <translation>Ay&amp;uda</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="1996"/>
+ <source>&amp;Open files</source>
+ <translation>Ab&amp;rir archivos</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="2001"/>
+ <source>&amp;Exit</source>
+ <translation>&amp;Salir</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="2006"/>
+ <source>&amp;Load</source>
+ <translation>&amp;Cargar</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="2011"/>
+ <source>&amp;Save</source>
+ <translation>&amp;Guardar</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="2016"/>
+ <source>Load &amp;default project</source>
+ <translation>Cargar proyecto por &amp;defecto</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="2021"/>
+ <source>Readme</source>
+ <translation>Leeme</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="2026"/>
+ <source>&amp;Tips</source>
+ <translation>A&amp;visos</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="2034"/>
+ <source>&amp;Changelog</source>
+ <translation>&amp;Bitácora de cambios</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="2039"/>
+ <source>&amp;License</source>
+ <translation>&amp;Licencia</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="2044"/>
+ <source>&amp;About Highlight</source>
+ <translation>&amp;Acerca de Highlight</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="2049"/>
+ <source>About &amp;translations</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>ShowTextFile</name>
+ <message>
+ <location filename="showtextfile.ui" line="17"/>
+ <source>Show text</source>
+ <translation>Mostrar texto</translation>
+ </message>
+ <message>
+ <location filename="showtextfile.ui" line="37"/>
+ <source>TextLabel</source>
+ <translation>EtiquetaDeTexto</translation>
+ </message>
+ <message>
+ <location filename="showtextfile.ui" line="69"/>
+ <source>OK</source>
+ <translation>OK</translation>
+ </message>
+</context>
+<context>
+ <name>io_report</name>
+ <message>
+ <location filename="io_report.ui" line="14"/>
+ <source>Error summary</source>
+ <translation>Resumen de Error</translation>
+ </message>
+ <message>
+ <location filename="io_report.ui" line="24"/>
+ <source>Input errors:</source>
+ <translation>Errores de entrada:</translation>
+ </message>
+ <message>
+ <location filename="io_report.ui" line="34"/>
+ <source>Remove files above from input file list</source>
+ <translation>Remover archivos mencionados de la lista de archivos de entrada</translation>
+ </message>
+ <message>
+ <location filename="io_report.ui" line="48"/>
+ <source>Output errors:</source>
+ <translation>Errores de salida:</translation>
+ </message>
+ <message>
+ <location filename="io_report.ui" line="65"/>
+ <source>Reformatting not possible:</source>
+ <translation>No es posible dar formato nuevamente:</translation>
+ </message>
+</context>
+</TS>
diff --git a/support/highlight/src/gui-qt/hl_icon2.png b/support/highlight/src/gui-qt/hl_icon2.png
new file mode 100644
index 0000000000..dd182616ff
--- /dev/null
+++ b/support/highlight/src/gui-qt/hl_icon2.png
Binary files differ
diff --git a/support/highlight/src/gui-qt/hl_icon_exe.ico b/support/highlight/src/gui-qt/hl_icon_exe.ico
new file mode 100644
index 0000000000..9b11e75a07
--- /dev/null
+++ b/support/highlight/src/gui-qt/hl_icon_exe.ico
Binary files differ
diff --git a/support/highlight/src/gui-qt/io_report.cpp b/support/highlight/src/gui-qt/io_report.cpp
new file mode 100644
index 0000000000..a534cb916a
--- /dev/null
+++ b/support/highlight/src/gui-qt/io_report.cpp
@@ -0,0 +1,68 @@
+/***************************************************************************
+ io_report.cpp
+ -------------------
+ begin : Mo 16.03.2009
+ copyright : (C) 2009 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "io_report.h"
+#include "ui_io_report.h"
+
+io_report::io_report(QWidget *parent) :
+ QDialog(parent),
+ m_ui(new Ui::io_report)
+{
+ m_ui->setupUi(this);
+}
+
+io_report::~io_report()
+{
+ delete m_ui;
+}
+
+void io_report::changeEvent(QEvent *e)
+{
+ switch (e->type()) {
+ case QEvent::LanguageChange:
+ m_ui->retranslateUi(this);
+ break;
+ default:
+ break;
+ }
+}
+
+void io_report::addInputErrors(QStringList & list){
+ m_ui->listInputErrors->clear();
+ m_ui->listInputErrors->addItems(list);
+}
+
+ void io_report::addOutputErrors(QStringList & list){
+ m_ui->listOutputErrors->clear();
+ m_ui->listOutputErrors->addItems(list);
+ }
+ void io_report::addReformatErrors(QStringList & list){
+ m_ui->listReformatErrors->clear();
+ m_ui->listReformatErrors->addItems(list);
+ }
+
+bool io_report::removeInputErrorFiles() {
+ return m_ui->cbRemoveFiles->isChecked();
+}
diff --git a/support/highlight/src/gui-qt/io_report.h b/support/highlight/src/gui-qt/io_report.h
new file mode 100644
index 0000000000..369d8fc5cc
--- /dev/null
+++ b/support/highlight/src/gui-qt/io_report.h
@@ -0,0 +1,56 @@
+/***************************************************************************
+ io_report.h
+ -------------------
+ begin : Mo 16.03.2009
+ copyright : (C) 2009 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef IO_REPORT_H
+#define IO_REPORT_H
+
+#include <QtGui/QDialog>
+
+namespace Ui {
+ class io_report;
+}
+
+class io_report : public QDialog {
+ Q_OBJECT
+ Q_DISABLE_COPY(io_report)
+public:
+ explicit io_report(QWidget *parent = 0);
+ virtual ~io_report();
+
+ void addInputErrors(QStringList & list);
+ void addOutputErrors(QStringList & list);
+ void addReformatErrors(QStringList & list);
+
+ bool removeInputErrorFiles();
+
+
+protected:
+ virtual void changeEvent(QEvent *e);
+
+private:
+ Ui::io_report *m_ui;
+};
+
+#endif // IO_REPORT_H
diff --git a/support/highlight/src/gui-qt/io_report.ui b/support/highlight/src/gui-qt/io_report.ui
new file mode 100644
index 0000000000..6b4d96159c
--- /dev/null
+++ b/support/highlight/src/gui-qt/io_report.ui
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>io_report</class>
+ <widget class="QDialog" name="io_report">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>436</width>
+ <height>372</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Error summary</string>
+ </property>
+ <property name="windowIcon">
+ <iconset resource="highlight-gui.qrc">
+ <normaloff>:/hl_icon2.png</normaloff>:/hl_icon2.png</iconset>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Input errors:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QListWidget" name="listInputErrors"/>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="cbRemoveFiles">
+ <property name="text">
+ <string>Remove files above from input file list</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="Line" name="line">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Output errors:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QListWidget" name="listOutputErrors"/>
+ </item>
+ <item>
+ <widget class="Line" name="line_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>Reformatting not possible:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QListWidget" name="listReformatErrors"/>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources>
+ <include location="highlight-gui.qrc"/>
+ </resources>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>io_report</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>io_report</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/support/highlight/src/gui-qt/main.cpp b/support/highlight/src/gui-qt/main.cpp
new file mode 100644
index 0000000000..027f87a2c6
--- /dev/null
+++ b/support/highlight/src/gui-qt/main.cpp
@@ -0,0 +1,54 @@
+/***************************************************************************
+ main.cpp
+ -------------------
+ begin : Mo 16.03.2009
+ copyright : (C) 2009 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#include <QtGui/QApplication>
+#include <QTranslator>
+#include <QLocale>
+#include "mainwindow.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+ QTranslator translator;
+ #ifdef DATA_DIR
+ translator.load(QString("%1/gui_files/l10n/highlight_%2").arg(DATA_DIR).arg(QLocale::system().name()));
+ #else
+ translator.load(QString("%1/gui_files/l10n/highlight_%2").arg(QDir::currentPath()).arg(QLocale::system().name()));
+ #endif
+ app.installTranslator(&translator);
+
+ MainWindow w;
+
+ QStringList args=QCoreApplication::arguments();
+ if (args.count()>1){
+ args.removeFirst(); // drop highlight-gui.exe path
+ w.addInputFiles(args);
+ }
+
+ w.show();
+ return app.exec();
+}
diff --git a/support/highlight/src/gui-qt/mainwindow.cpp b/support/highlight/src/gui-qt/mainwindow.cpp
new file mode 100644
index 0000000000..06abcd29dd
--- /dev/null
+++ b/support/highlight/src/gui-qt/mainwindow.cpp
@@ -0,0 +1,1080 @@
+/***************************************************************************
+ mainwindow.cpp
+ -------------------
+ begin : Mo 16.03.2009
+ copyright : (C) 2009 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <memory>
+#include <algorithm>
+
+#include "mainwindow.h"
+#include "ui_mainwindow.h"
+#include "version.h"
+#include "showtextfile.h"
+#include "io_report.h"
+
+
+MainWindow::MainWindow(QWidget *parent)
+ : QMainWindow(parent), ui(new Ui::MainWindowClass)
+{
+ ui->setupUi(this);
+ this->setWindowTitle(QString("Highlight %1").arg( HIGHLIGHT_VERSION));
+
+ // Read file open filter
+#ifdef DATA_DIR
+ QFile filterDef(QString(DATA_DIR) + "/gui_files/ext/fileopenfilter.conf");
+#else
+ QFile filterDef(QDir::currentPath()+"/gui_files/ext/fileopenfilter.conf");
+#endif
+
+ QRegExp rx("(\\S+)\\s?\\(\\*\\.([\\w\\d]+)");
+
+ if (filterDef.open(QIODevice::ReadOnly | QIODevice::Text)){
+ QTextStream in(&filterDef);
+ QString line;
+
+ QStringList syntaxPair;
+ while (!in.atEnd()) {
+ line = in.readLine();
+ fileOpenFilter+=line;
+ fileOpenFilter+=";;";
+ if( rx.indexIn(line)!=-1){
+ syntaxPair = rx.capturedTexts();
+ ui->comboSelectSyntax->addItem(syntaxPair[1], syntaxPair[2]);
+ }
+ }
+ } else {
+ fileOpenFilter="All files (*)";
+ }
+ // fill themes combo
+#ifdef DATA_DIR
+ QDir themesDir(QString(DATA_DIR) + "/themes");
+#else
+ QDir themesDir(QDir::currentPath()+"/themes");
+#endif
+ QStringList themes = themesDir.entryList(QStringList("*.style"), QDir::Files, QDir::Name);
+ for (QStringList::const_iterator constIterator = themes.constBegin();
+ constIterator != themes.constEnd(); ++constIterator) {
+ ui->comboTheme->addItem(QString(*constIterator).section('.',0, 0));
+ }
+
+ // load syntax mappings
+ if (!loadFileTypeConfig(&extensions, &shebangs)){
+ QMessageBox::warning(this, tr("Initialization error"),
+ tr("Could not find syntax definitions. Check installation."));
+ }
+
+ QObject::connect(ui->pbOpenFiles, SIGNAL(clicked()), this, SLOT(openFiles()));
+ QObject::connect(ui->action_Open_files, SIGNAL(triggered()), this, SLOT(openFiles()));
+
+ QObject::connect(ui->cbWrite2Src, SIGNAL(clicked()), this, SLOT(plausibility()));
+ QObject::connect(ui->cbIncLineNo, SIGNAL(clicked()), this, SLOT(plausibility()));
+ QObject::connect(ui->cbWrapping, SIGNAL(clicked()), this, SLOT(plausibility()));
+ QObject::connect(ui->cbEncoding, SIGNAL(clicked()), this, SLOT(plausibility()));
+
+ QObject::connect(ui->comboFormat, SIGNAL(currentIndexChanged(int)), this, SLOT(plausibility()));
+ QObject::connect(ui->cbReformat, SIGNAL(clicked()), this, SLOT(plausibility()));
+ QObject::connect(ui->cbKwCase, SIGNAL(clicked()), this, SLOT(plausibility()));
+ QObject::connect(ui->cbHTMLEmbedStyle, SIGNAL(clicked()), this, SLOT(plausibility()));
+ QObject::connect(ui->cbHTMLAnchors, SIGNAL(clicked()), this, SLOT(plausibility()));
+ QObject::connect(ui->cbHTMLEmbedStyle, SIGNAL(clicked()), this, SLOT(plausibility()));
+ QObject::connect(ui->cbHTMLInlineCSS, SIGNAL(clicked()), this, SLOT(plausibility()));
+ QObject::connect(ui->cbHTMLCtags, SIGNAL(clicked()), this, SLOT(plausibility()));
+ QObject::connect(ui->cbLATEXEmbedStyle, SIGNAL(clicked()), this, SLOT(plausibility()));
+ QObject::connect(ui->cbTEXEmbedStyle, SIGNAL(clicked()), this, SLOT(plausibility()));
+ QObject::connect(ui->cbSVGEmbedStyle, SIGNAL(clicked()), this, SLOT(plausibility()));
+ QObject::connect(ui->cbFragment, SIGNAL(clicked()), this, SLOT(plausibility()));
+ QObject::connect(ui->tabIOSelection, SIGNAL(currentChanged(int)), this, SLOT(plausibility()));
+
+ QObject::connect(ui->lvInputFiles, SIGNAL(itemSelectionChanged()), this, SLOT(updatePreview()));
+ QObject::connect(ui->cbIncLineNo, SIGNAL(clicked()), this, SLOT(updatePreview()));
+ QObject::connect(ui->cbKwCase, SIGNAL(clicked()), this, SLOT(updatePreview()));
+ QObject::connect(ui->cbPadZeroes, SIGNAL(clicked()), this, SLOT(updatePreview()));
+ QObject::connect(ui->cbReformat, SIGNAL(clicked()), this, SLOT(updatePreview()));
+ QObject::connect(ui->cbWrapping, SIGNAL(clicked()), this, SLOT(updatePreview()));
+ QObject::connect(ui->cbAdvWrapping, SIGNAL(clicked()), this, SLOT(updatePreview()));
+ QObject::connect(ui->cbValidateInput, SIGNAL(clicked()), this, SLOT(updatePreview()));
+ QObject::connect(ui->cbEncoding, SIGNAL(clicked()), this, SLOT(updatePreview()));
+ QObject::connect(ui->comboEncoding, SIGNAL(currentIndexChanged(int)), this, SLOT(updatePreview()));
+
+ QObject::connect(ui->comboFontName, SIGNAL(currentIndexChanged(int)), this, SLOT(updatePreview()));
+ QObject::connect(ui->comboKwCase, SIGNAL(currentIndexChanged(int)), this, SLOT(updatePreview()));
+ QObject::connect(ui->comboReformat, SIGNAL(currentIndexChanged(int)), this, SLOT(updatePreview()));
+ QObject::connect(ui->comboTheme, SIGNAL(currentIndexChanged(int)), this, SLOT(updatePreview()));
+ QObject::connect(ui->comboSelectSyntax, SIGNAL(currentIndexChanged(int)), this, SLOT(updatePreview()));
+
+ QObject::connect(ui->sbLineNoWidth, SIGNAL(valueChanged(int)), this, SLOT(updatePreview()));
+ QObject::connect(ui->leFontSize, SIGNAL(textChanged(QString)), this, SLOT(updatePreview()));
+
+ setAcceptDrops(true);
+
+ readSettings();
+ plausibility();
+}
+
+MainWindow::~MainWindow()
+{
+ writeSettings();
+ delete ui;
+}
+
+void MainWindow::openFiles(){
+ QFileDialog dialog(this, "Select one or more files to open",
+ "",
+ fileOpenFilter);
+ dialog.setFileMode(QFileDialog::ExistingFiles);
+ dialog.setViewMode(QFileDialog::Detail);
+
+ if (dialog.exec()) {
+ addInputFiles(dialog.selectedFiles());
+ }
+}
+
+void MainWindow::selectSingleFile(QLineEdit* edit, const QString& title, const QString& filter){
+ QFileDialog dialog(this, title,
+ "",
+ filter);
+ dialog.setFileMode(QFileDialog::ExistingFile);
+ dialog.setViewMode(QFileDialog::Detail);
+
+ if (dialog.exec()) {
+ edit->setText(dialog.selectedFiles().first());
+ }
+}
+
+void MainWindow::addInputFiles(const QStringList& list){
+ for (QStringList::const_iterator constIterator = list.constBegin();
+ constIterator != list.constEnd(); ++constIterator) {
+ if (ui->lvInputFiles->findItems ( *constIterator, Qt::MatchExactly ).empty()) {
+ ui->lvInputFiles->addItem(*constIterator);
+ }
+ }
+}
+
+void MainWindow::on_pbClearSelection_clicked(){
+ QList<QListWidgetItem *> selectedItems = ui->lvInputFiles->selectedItems();
+ for (int i = 0; i < selectedItems.size(); ++i) {
+ delete selectedItems.at(i);
+ }
+}
+
+void MainWindow::on_pbOutputDest_clicked(){
+ QFileDialog dialog(this, "Select destination directory", "");
+ dialog.setFileMode(QFileDialog::Directory);
+ if (dialog.exec() && !dialog.selectedFiles().empty()) {
+ ui->leOutputDest->setText(dialog.selectedFiles().at(0));
+ }
+}
+
+ void MainWindow::writeSettings()
+ {
+ QSettings settings(QSettings::IniFormat, QSettings::UserScope,
+ "andre-simon.de", "highlight-gui");
+
+ settings.beginGroup("MainWindow");
+ settings.setValue("size", size());
+ settings.setValue("pos", pos());
+ settings.endGroup();
+
+ settings.beginGroup("input");
+ QStringList inFiles;
+ for (int i=0;i<ui->lvInputFiles->count();i++){
+ inFiles<<ui->lvInputFiles->item(i)->text();
+ }
+ const char* name="objectName";
+ settings.setValue(ui->lvInputFiles->property(name).toString(),
+ inFiles);
+ settings.setValue(ui->leOutputDest->property(name).toString(),
+ ui->leOutputDest->text());
+ settings.setValue(ui->cbWrite2Src->property(name).toString(),
+ ui->cbWrite2Src->isChecked());
+ settings.setValue(ui->cbAdvWrapping->property(name).toString(),
+ ui->cbAdvWrapping->isChecked());
+ settings.setValue(ui->cbEncoding->property(name).toString(),
+ ui->cbEncoding->isChecked());
+ settings.setValue(ui->cbFragment->property(name).toString(),
+ ui->cbFragment->isChecked());
+ settings.setValue(ui->cbHTMLAnchors->property(name).toString(),
+ ui->cbHTMLAnchors->isChecked());
+ settings.setValue(ui->cbHTMLCtags->property(name).toString(),
+ ui->cbHTMLCtags->isChecked());
+ settings.setValue(ui->cbHTMLEmbedStyle->property(name).toString(),
+ ui->cbHTMLEmbedStyle->isChecked());
+ settings.setValue(ui->cbHTMLEnclosePreTags->property(name).toString(),
+ ui->cbHTMLEnclosePreTags->isChecked());
+ settings.setValue(ui->cbHTMLFileNameAnchor->property(name).toString(),
+ ui->cbHTMLFileNameAnchor->isChecked());
+ settings.setValue(ui->cbHTMLIndex->property(name).toString(),
+ ui->cbHTMLIndex->isChecked());
+ settings.setValue(ui->cbHTMLInlineCSS->property(name).toString(),
+ ui->cbHTMLInlineCSS->isChecked());
+ settings.setValue(ui->cbHTMLOrderedList->property(name).toString(),
+ ui->cbHTMLOrderedList->isChecked());
+ settings.setValue(ui->cbIncLineNo->property(name).toString(),
+ ui->cbIncLineNo->isChecked());
+ settings.setValue(ui->cbKwCase->property(name).toString(),
+ ui->cbKwCase->isChecked());
+ settings.setValue(ui->cbLATEXBabel->property(name).toString(),
+ ui->cbLATEXBabel->isChecked());
+ settings.setValue(ui->cbLATEXEscQuotes->property(name).toString(),
+ ui->cbLATEXEscQuotes->isChecked());
+ settings.setValue(ui->cbLATEXPrettySymbols->property(name).toString(),
+ ui->cbLATEXPrettySymbols->isChecked());
+ settings.setValue(ui->cbPadZeroes->property(name).toString(),
+ ui->cbPadZeroes->isChecked());
+ settings.setValue(ui->cbReformat->property(name).toString(),
+ ui->cbReformat->isChecked());
+ settings.setValue(ui->cbRTFCharStyles->property(name).toString(),
+ ui->cbRTFCharStyles->isChecked());
+ settings.setValue(ui->cbWrapping->property(name).toString(),
+ ui->cbWrapping->isChecked());
+ settings.setValue(ui->cbValidateInput->property(name).toString(),
+ ui->cbValidateInput->isChecked());
+
+ settings.setValue(ui->comboFormat->property(name).toString(),
+ ui->comboFormat->currentIndex());
+ settings.setValue(ui->comboKwCase->property(name).toString(),
+ ui->comboKwCase->currentIndex());
+ settings.setValue(ui->comboReformat->property(name).toString(),
+ ui->comboReformat->currentIndex());
+ settings.setValue(ui->comboRTFPageSize->property(name).toString(),
+ ui->comboRTFPageSize->currentIndex());
+ settings.setValue(ui->comboTheme->property(name).toString(),
+ ui->comboTheme->currentIndex());
+ settings.setValue(ui->comboEncoding->property(name).toString(),
+ ui->comboEncoding->currentText());
+ settings.setValue(ui->comboFontName->property(name).toString(),
+ ui->comboFontName->currentText());
+ settings.setValue(ui->comboSelectSyntax->property(name).toString(),
+ ui->comboSelectSyntax->currentIndex());
+
+ settings.setValue(ui->leHTMLCtagsFile->property(name).toString(),
+ ui->leHTMLCtagsFile->text());
+ settings.setValue(ui->leHTMLStyleFile->property(name).toString(),
+ ui->leHTMLStyleFile->text());
+ settings.setValue(ui->leHTMLStyleIncFile->property(name).toString(),
+ ui->leHTMLStyleIncFile->text());
+ settings.setValue(ui->leLATEXStyleFile->property(name).toString(),
+ ui->leLATEXStyleFile->text());
+ settings.setValue(ui->leLATEXStyleIncFile->property(name).toString(),
+ ui->leLATEXStyleIncFile->text());
+ settings.setValue(ui->leTEXStyleFile->property(name).toString(),
+ ui->leTEXStyleFile->text());
+ settings.setValue(ui->leTEXStyleIncFile->property(name).toString(),
+ ui->leTEXStyleIncFile->text());
+ settings.setValue(ui->leSVGStyleFile->property(name).toString(),
+ ui->leSVGStyleFile->text());
+ settings.setValue(ui->leSVGStyleIncFile->property(name).toString(),
+ ui->leSVGStyleIncFile->text());
+ settings.setValue(ui->cbSVGEmbedStyle->property(name).toString(),
+ ui->cbSVGEmbedStyle->isChecked());
+ settings.setValue(ui->cbLATEXEmbedStyle->property(name).toString(),
+ ui->cbLATEXEmbedStyle->isChecked());
+ settings.setValue(ui->cbTEXEmbedStyle->property(name).toString(),
+ ui->cbTEXEmbedStyle->isChecked());
+ settings.setValue(ui->leSVGHeight->property(name).toString(),
+ ui->leSVGHeight->text());
+ settings.setValue(ui->leSVGWidth->property(name).toString(),
+ ui->leSVGWidth->text());
+ settings.setValue(ui->leFontSize->property(name).toString(),
+ ui->leFontSize->text());
+ settings.setValue(ui->sbLineLength->property(name).toString(),
+ ui->sbLineLength->value());
+ settings.setValue(ui->sbTabWidth->property(name).toString(),
+ ui->sbTabWidth->value());
+ settings.setValue(ui->tabWidget->property(name).toString(),
+ ui->tabWidget->currentIndex());
+ settings.setValue(ui->leHTMLCssPrefix->property(name).toString(),
+ ui->leHTMLCssPrefix->text());
+ settings.setValue(ui->tabIOSelection->property(name).toString(),
+ ui->tabIOSelection->currentIndex());
+
+
+ settings.endGroup();
+ }
+
+ void MainWindow::readSettings()
+ {
+ QSettings settings(QSettings::IniFormat, QSettings::UserScope,
+ "andre-simon.de", "highlight-gui");
+
+ settings.beginGroup("MainWindow");
+ resize(settings.value("size", QSize(400, 400)).toSize());
+ move(settings.value("pos", QPoint(200, 200)).toPoint());
+ settings.endGroup();
+
+ settings.beginGroup("input");
+ const char* name="objectName";
+ ui->lvInputFiles->addItems( settings.value(ui->lvInputFiles->property(name).toString()).toStringList() );
+ ui->leOutputDest->setText(settings.value(ui->leOutputDest->property(name).toString()).toString());
+ ui->cbWrite2Src->setChecked(settings.value(ui->cbWrite2Src->property(name).toString()).toBool());
+ ui->cbAdvWrapping->setChecked(settings.value(ui->cbAdvWrapping->property(name).toString()).toBool());
+ ui->cbEncoding->setChecked(settings.value(ui->cbEncoding->property(name).toString()).toBool());
+ ui->cbFragment->setChecked(settings.value(ui->cbFragment->property(name).toString()).toBool());
+ ui->cbHTMLAnchors->setChecked(settings.value(ui->cbHTMLAnchors->property(name).toString()).toBool());
+ ui->cbHTMLCtags->setChecked(settings.value(ui->cbHTMLCtags->property(name).toString()).toBool());
+ ui->cbHTMLEmbedStyle->setChecked(settings.value(ui->cbHTMLEmbedStyle->property(name).toString()).toBool());
+ ui->cbHTMLEnclosePreTags->setChecked(settings.value(ui->cbHTMLEnclosePreTags->property(name).toString()).toBool());
+ ui->cbHTMLFileNameAnchor->setChecked(settings.value(ui->cbHTMLFileNameAnchor->property(name).toString()).toBool());
+ ui->cbHTMLIndex->setChecked(settings.value(ui->cbHTMLIndex->property(name).toString()).toBool());
+ ui->cbHTMLInlineCSS->setChecked(settings.value(ui->cbHTMLInlineCSS->property(name).toString()).toBool());
+ ui->cbHTMLOrderedList->setChecked(settings.value(ui->cbHTMLOrderedList->property(name).toString()).toBool());
+ ui->cbIncLineNo->setChecked(settings.value(ui->cbIncLineNo->property(name).toString()).toBool());
+ ui->cbKwCase->setChecked(settings.value(ui->cbKwCase->property(name).toString()).toBool());
+ ui->cbLATEXBabel->setChecked(settings.value(ui->cbLATEXBabel->property(name).toString()).toBool());
+ ui->cbLATEXEscQuotes->setChecked(settings.value(ui->cbLATEXEscQuotes->property(name).toString()).toBool());
+ ui->cbLATEXPrettySymbols->setChecked(settings.value(ui->cbLATEXPrettySymbols->property(name).toString()).toBool());
+
+ ui->cbPadZeroes->setChecked(settings.value(ui->cbPadZeroes->property(name).toString()).toBool());
+ ui->cbReformat->setChecked(settings.value(ui->cbReformat->property(name).toString()).toBool());
+ ui->cbRTFCharStyles->setChecked(settings.value(ui->cbRTFCharStyles->property(name).toString()).toBool());
+ ui->cbWrapping->setChecked(settings.value(ui->cbWrapping->property(name).toString()).toBool());
+ ui->cbValidateInput->setChecked(settings.value(ui->cbValidateInput->property(name).toString()).toBool());
+
+ ui->comboEncoding->insertItem(0, settings.value(ui->comboEncoding->property(name).toString()).toString());
+ ui->comboEncoding->setCurrentIndex(0);
+ ui->comboFontName->insertItem(0, settings.value(ui->comboFontName->property(name).toString()).toString());
+ ui->comboFontName->setCurrentIndex(0);
+ ui->comboFormat->setCurrentIndex(settings.value(ui->comboFormat->property(name).toString()).toInt());
+ ui->comboKwCase->setCurrentIndex(settings.value(ui->comboKwCase->property(name).toString()).toInt());
+ ui->comboReformat->setCurrentIndex(settings.value(ui->comboReformat->property(name).toString()).toInt());
+ ui->comboRTFPageSize->setCurrentIndex(settings.value(ui->comboRTFPageSize->property(name).toString()).toInt());
+ ui->comboTheme->setCurrentIndex(settings.value(ui->comboTheme->property(name).toString()).toInt());
+ ui->comboSelectSyntax->setCurrentIndex(settings.value(ui->comboSelectSyntax->property(name).toString()).toInt());
+
+ ui->leHTMLCtagsFile->setText(settings.value(ui->leHTMLCtagsFile->property(name).toString()).toString());
+ ui->leHTMLStyleFile->setText(settings.value(ui->leHTMLStyleFile->property(name).toString()).toString());
+ ui->leHTMLStyleIncFile->setText(settings.value(ui->leHTMLStyleIncFile->property(name).toString()).toString());
+ ui->leLATEXStyleFile->setText(settings.value(ui->leLATEXStyleFile->property(name).toString()).toString());
+ ui->leTEXStyleFile->setText(settings.value(ui->leTEXStyleFile->property(name).toString()).toString());
+ ui->leLATEXStyleIncFile->setText(settings.value(ui->leLATEXStyleIncFile->property(name).toString()).toString());
+ ui->leTEXStyleIncFile->setText(settings.value(ui->leTEXStyleIncFile->property(name).toString()).toString());
+ ui->leSVGHeight->setText(settings.value(ui->leSVGHeight->property(name).toString()).toString());
+ ui->leSVGWidth->setText(settings.value(ui->leSVGWidth->property(name).toString()).toString());
+ ui->leFontSize->setText(settings.value(ui->leFontSize->property(name).toString()).toString());
+ ui->leHTMLCssPrefix->setText(settings.value(ui->leHTMLCssPrefix->property(name).toString()).toString());
+ ui->sbLineLength->setValue(settings.value(ui->sbLineLength->property(name).toString()).toInt());
+ ui->sbTabWidth->setValue(settings.value(ui->sbTabWidth->property(name).toString()).toInt());
+ ui->cbTEXEmbedStyle->setChecked(settings.value(ui->cbTEXEmbedStyle->property(name).toString()).toBool());
+ ui->cbLATEXEmbedStyle->setChecked(settings.value(ui->cbLATEXEmbedStyle->property(name).toString()).toBool());
+ ui->cbSVGEmbedStyle->setChecked(settings.value(ui->cbSVGEmbedStyle->property(name).toString()).toBool());
+ ui->tabWidget->setCurrentIndex(settings.value(ui->tabWidget->property(name).toString()).toInt());
+ ui->tabIOSelection->setCurrentIndex(settings.value(ui->tabIOSelection->property(name).toString()).toInt());
+
+ settings.endGroup();
+ }
+
+bool MainWindow::loadFileTypeConfig(StringMap* extMap, StringMap* shebangMap) {
+ if (!extMap || !shebangMap) return false;
+
+#ifdef CONFIG_DIR
+ QString filetypesPath = QDir::toNativeSeparators(QString("%1/filetypes.conf").arg(CONFIG_DIR));
+#else
+ QString filetypesPath = QDir::toNativeSeparators(QString("%1/filetypes.conf").arg(QDir::currentPath()));
+#endif
+
+ ConfigurationReader config(filetypesPath.toStdString());
+ if (config.found())
+ {
+ stringstream values;
+ string paramName, paramVal;
+ for (unsigned int i=0;i<config.getParameterNames().size();i++){
+ paramName = config.getParameterNames()[i];
+ if (paramName.find("ext") != string::npos){
+ values.str(StringTools::change_case(config.getParameter(paramName)));
+ paramName = StringTools::getParantheseVal(paramName);
+ while (values >> paramVal) {
+ extMap->insert(make_pair( paramVal, paramName));
+ }
+ values.clear();
+ } else if (paramName.find("shebang") != string::npos){
+ values.str(config.getParameter(paramName)) ;
+ paramName = StringTools::getParantheseVal(paramName);
+ while (values >> paramVal) {
+ shebangMap->insert(make_pair( paramVal, paramName));
+ }
+ values.clear();
+ }
+ }
+ return true;
+ }
+ return false;
+}
+
+ string MainWindow::analyzeFile(const string& file){
+ ifstream inFile(file.c_str());
+ string firstLine;
+ getline (inFile, firstLine);
+ StringMap::iterator it;
+ for (it=shebangs.begin(); it!=shebangs.end();it++){
+ if (Pattern::matches(it->first, firstLine)) return it->second;
+ }
+ return "";
+}
+
+string MainWindow::getFileType(const string& suffix, const string &inputFile)
+{
+ string lcSuffix = StringTools::change_case(suffix);
+ string fileType = (extensions.count(lcSuffix)) ? extensions[lcSuffix] : lcSuffix ;
+ if (!fileType.empty()) return fileType;
+ return analyzeFile(inputFile);
+}
+
+string MainWindow::getFileSuffix(const string& fileName)
+{
+ unsigned int ptPos=fileName.rfind(".");
+ return (ptPos == string::npos) ? "" : fileName.substr(ptPos+1,
+ fileName.length());
+}
+
+void MainWindow::on_action_Exit_triggered()
+{
+ this->close();
+}
+
+void MainWindow::on_action_About_Highlight_triggered()
+{
+ QMessageBox::about( this, "About Highlight",
+ QString("Highlight is a code to formatted text converter.\n\n"
+ "Highlight GUI %1\n"
+ "(C) 2002-2010 Andre Simon <andre.simon1 at gmx.de>\n\n"
+ "Artistic Style Classes\n(C) 1998-2002 Tal Davidson\n"
+ "(C) 2006-2009 Jim Pattee <jimp03 at email.com>\n\n"
+ "Regex library\n(C) 2003-2008 Jeffery Stuart <stuart at cs.unr.edu>\n\n"
+ "Built with Qt version %2\n\n"
+ "Released under the terms of the GNU GPL license.\n\n"
+ "The highlight logo is based on the image \"Alcedo Atthis\" by Lukasz Lukasik.\n"
+ "The original was published under the terms of the GNU FDL in the Wikimedia Commons database.\n\n"
+ "Updates: http://www.andre-simon.de/\n").arg(HIGHLIGHT_VERSION).arg(QString(qVersion ())) );
+}
+
+ highlight::OutputType MainWindow::getOutputType(){
+
+ switch (ui->comboFormat->currentIndex()){
+ case 0: return highlight::HTML;
+ case 1: return highlight::XHTML;
+ case 2: return highlight::LATEX;
+ case 3: return highlight::TEX;
+ case 4: return highlight::RTF;
+ case 5: return highlight::SVG;
+ case 6: return highlight::XML;
+ case 7: return highlight::BBCODE;
+ }
+ return highlight::HTML;
+}
+
+ QString MainWindow::getOutFileSuffix(){
+ switch (ui->comboFormat->currentIndex()) {
+ case 0: return ".html";
+ case 1: return ".xhtml";
+ case 2:
+ case 3: return ".tex";
+ case 4: return ".rtf";
+ case 5: return ".svg";
+ case 6: return ".xml";
+ case 7: return ".bbcode";
+ }
+ return ".html";
+}
+
+
+void MainWindow::applyCtrlValues(highlight::CodeGenerator* generator, bool previewMode){
+ if (!generator) return;
+
+ highlight::OutputType outType=getOutputType();
+
+ if (!previewMode){
+ QLineEdit * styleIncFile=NULL;
+ QLineEdit * styleOutFile=NULL;
+ QCheckBox * embedStyle=NULL;
+
+ switch(outType) {
+ case highlight::HTML:
+ case highlight::XHTML: styleIncFile = ui->leHTMLStyleIncFile;
+ styleOutFile = ui->leHTMLStyleFile;
+ embedStyle = ui->cbHTMLEmbedStyle;
+ break;
+ case highlight::LATEX:
+ styleIncFile = ui->leLATEXStyleIncFile;
+ styleOutFile = ui->leLATEXStyleFile;
+ embedStyle = ui->cbLATEXEmbedStyle;
+ break;
+ case highlight::TEX: styleIncFile = ui->leTEXStyleIncFile;
+ styleOutFile = ui->leTEXStyleFile;
+ embedStyle = ui->cbTEXEmbedStyle;
+ break;
+ case highlight::SVG: styleIncFile = ui->leSVGStyleIncFile;
+ styleOutFile = ui->leSVGStyleFile;
+ embedStyle = ui->cbSVGEmbedStyle;
+ break;
+ default: break;
+ }
+ if (styleIncFile)
+ generator->setStyleInputPath(QDir::toNativeSeparators(styleIncFile->text()).toStdString());
+ if (styleOutFile)
+ generator->setStyleOutputPath(styleOutFile->text().toStdString());
+ if (embedStyle)
+ generator->setIncludeStyle(embedStyle->isChecked());
+
+ generator->setFragmentCode(ui->cbFragment->isChecked());
+
+ generator->setHTMLAttachAnchors(ui->cbHTMLAnchors->isChecked());
+ generator->setHTMLOrderedList(ui->cbHTMLOrderedList->isChecked());
+ generator->setHTMLInlineCSS(ui->cbHTMLInlineCSS->isChecked() && ui->cbHTMLInlineCSS->isEnabled());
+ generator->setHTMLEnclosePreTag(ui->cbHTMLEnclosePreTags->isChecked());
+ if (ui->leHTMLCssPrefix->text().size())
+ generator->setHTMLClassName(ui->leHTMLCssPrefix->text().toStdString());
+
+ generator->setLATEXReplaceQuotes(ui->cbLATEXEscQuotes->isChecked());
+ generator->setLATEXNoShorthands(ui->cbLATEXBabel->isChecked());
+ generator->setLATEXPrettySymbols(ui->cbLATEXPrettySymbols->isChecked());
+
+ generator->setRTFPageSize(ui->comboRTFPageSize->currentText().toLower().toStdString());
+ generator->setRTFCharStyles(ui->cbRTFCharStyles->isChecked());
+
+ generator->setSVGSize(ui->leSVGWidth->text().toStdString(), ui->leSVGHeight->text().toStdString());
+ }
+
+ generator->setPrintLineNumbers( ui->cbIncLineNo->isChecked());
+ generator->setPrintZeroes(ui->cbPadZeroes->isEnabled() && ui->cbPadZeroes->isChecked());
+
+#ifdef DATA_DIR
+ QString themePath = QString("%1/themes/%2.style").arg(
+ DATA_DIR).arg(ui->comboTheme->currentText());
+#else
+ QString themePath = QString("%1/themes/%2.style").arg(
+ QDir::currentPath()).arg(ui->comboTheme->currentText());
+#endif
+
+ generator->initTheme(themePath.toStdString());
+
+ if (ui->cbEncoding->isChecked()) {
+ generator->setEncoding(ui->comboEncoding->currentText().toStdString());
+ } else {
+ generator->setEncoding("none");
+ }
+ generator->setValidateInput(ui->cbValidateInput->isChecked());
+ generator->setLineNumberWidth(ui->sbLineNoWidth->value());
+
+ if (getOutputType()!=highlight::LATEX && getOutputType()!=highlight::TEX){
+ string fntName=ui->comboFontName->currentText().toStdString();
+ if(fntName.size()) generator->setBaseFont(fntName);
+ string fntSize=ui->leFontSize->text().toStdString();
+ if(fntSize.size()) generator->setBaseFontSize(fntSize);
+ }
+
+ int lineLength = 0;
+ if (ui->cbWrapping->isChecked()){
+ lineLength = ( ui->cbIncLineNo->isChecked()
+ && ui->sbLineNoWidth->value() > ui->sbLineLength->value())?
+ ui->sbLineLength->value() - ui->sbLineNoWidth->value()
+ : ui->sbLineLength->value();
+ }
+ generator->setPreformatting(getWrappingStyle(), lineLength, ui->sbTabWidth->value());
+
+ if(ui->cbKwCase->isChecked()){
+ StringTools::KeywordCase kwCase=StringTools::CASE_UNCHANGED;
+ switch (ui->comboKwCase->currentIndex()){
+ case 0: kwCase=StringTools::CASE_UPPER; break;
+ case 1: kwCase=StringTools::CASE_LOWER; break;
+ case 2: kwCase=StringTools::CASE_CAPITALIZE; break;
+ }
+ generator->setKeyWordCase(kwCase);
+ }
+
+ if (ui->cbReformat->isChecked()){
+ generator->initIndentationScheme(ui->comboReformat->currentText().toLower().toStdString());
+
+ }
+
+ if ( ui->cbHTMLCtags->isChecked() && !ui->leHTMLCtagsFile->text().isEmpty()
+ && (outType==highlight::HTML || outType==highlight::XHTML)){
+ if (!generator->initTagInformation(ui->leHTMLCtagsFile->text().toStdString())){
+ QMessageBox::warning(this, tr("Tags file error"),
+ tr("Could not read tags information in \"%1\"").arg(ui->leHTMLCtagsFile->text()));
+ }
+ }
+}
+
+highlight::WrapMode MainWindow::getWrappingStyle(){
+ if (!ui->cbAdvWrapping->isChecked() && ui->cbAdvWrapping->isEnabled())
+ return highlight::WRAP_SIMPLE;
+ return (ui->cbWrapping->isChecked())?highlight::WRAP_DEFAULT:highlight::WRAP_DISABLED;
+}
+
+
+void MainWindow::on_pbStartConversion_clicked(){
+
+ if (!ui->lvInputFiles->count()) return;
+
+ if (!ui->cbWrite2Src->isChecked() && !QDir(ui->leOutputDest->text()).exists()){
+ QMessageBox::warning(this, tr("Output error"), tr("Output directory does not exist!"));
+ ui->leOutputDest->setFocus();
+ return;
+ }
+ highlight::OutputType outType = getOutputType();
+ QCheckBox* cbEmbed=NULL;
+ QLineEdit* leStyleFile=NULL;
+
+ if ( outType==highlight::HTML || outType==highlight::XHTML) {
+ cbEmbed = ui->cbHTMLEmbedStyle;
+ leStyleFile = ui->leHTMLStyleFile;
+ }
+ else if ( outType==highlight::LATEX ) {
+ cbEmbed = ui->cbLATEXEmbedStyle;
+ leStyleFile = ui->leLATEXStyleFile;
+ }
+ else if (outType==highlight::TEX ) {
+ cbEmbed = ui->cbTEXEmbedStyle;
+ leStyleFile = ui->leTEXStyleFile;
+ } else if (outType==highlight::SVG ) {
+ cbEmbed = ui->cbSVGEmbedStyle;
+ leStyleFile = ui->leSVGStyleFile;
+ }
+
+ if (cbEmbed && leStyleFile ) {
+ if ( !cbEmbed->isChecked() && leStyleFile->text().isEmpty()){
+ ui->tabWidget->setCurrentIndex(1);
+ if ( outType==highlight::HTML || outType==highlight::XHTML){
+ ui->tabWidget->setCurrentIndex(0);
+ }
+ leStyleFile->setFocus();
+ QMessageBox::warning(this, tr("Output error"), tr("You must define a style output file!"));
+ return;
+ }
+ }
+ ui->pbStartConversion->setDisabled(true);
+ ui->pbCopyFile2CP->setDisabled(true);
+ this->setCursor(Qt::WaitCursor);
+
+ QTime t;
+ t.start();
+
+ auto_ptr<highlight::CodeGenerator> generator(highlight::CodeGenerator::getInstance(outType));
+
+ applyCtrlValues(generator.get(), false);
+ string currentFile, suffix;
+ string outfileName;
+ string outfileSuffix = getOutFileSuffix().toStdString();
+ QString langDefPath;
+ QString inFileName, inFilePath;
+ highlight::ParseError error;
+ highlight::LoadResult loadRes;
+ QStringList inputErrors, outputErrors, reformatErrors;
+
+ for (int i=0; i<ui->lvInputFiles->count(); i++){
+ inFilePath = ui->lvInputFiles->item(i)->text();
+ currentFile = inFilePath.toStdString();
+ suffix = getFileType(getFileSuffix(currentFile), currentFile);
+#ifdef DATA_DIR
+ langDefPath = QDir::toNativeSeparators(QString("%1/langDefs/%2.lang").arg(DATA_DIR).arg(QString::fromStdString(suffix)));
+#else
+ langDefPath = QDir::toNativeSeparators(QString("%1/langDefs/%2.lang").arg(QDir::currentPath()).arg(QString::fromStdString(suffix)));
+#endif
+
+ loadRes=generator->initLanguage(langDefPath.toStdString());
+ if (loadRes==highlight::LOAD_FAILED_REGEX){
+ QMessageBox::warning(this, tr("Language definition error"),
+ tr("Invalid regular expression in %1:\n%2").arg(langDefPath).arg(
+ QString::fromStdString( generator->getLanguage().getFailedRegex())));
+ break;
+ } else if (loadRes==highlight::LOAD_FAILED) {
+ QMessageBox::warning(this, tr("Unknown syntax"), tr("Could not convert %1").arg(QString::fromStdString(currentFile)));
+ inputErrors.append(inFilePath);
+ } else {
+
+ if (ui->cbReformat->isChecked()&& !generator->formattingIsPossible()){
+ reformatErrors.append(inFilePath);
+ }
+
+ if (ui->cbWrite2Src->isChecked()) {
+ outfileName = currentFile;
+ } else {
+ QFileInfo outFileInfo;
+ outFileInfo.setFile(ui->leOutputDest->text(), QFileInfo(inFilePath).fileName());
+ outfileName = outFileInfo.absoluteFilePath().toStdString();
+ }
+ outfileName += outfileSuffix;
+
+ inFileName = QFileInfo(inFilePath).fileName();
+ if (ui->cbHTMLFileNameAnchor->isChecked()){
+ generator->setHTMLAnchorPrefix(inFileName.toStdString());
+ }
+ generator->setTitle(inFileName.toStdString());
+ error = generator->generateFile(currentFile,
+ outfileName );
+ if (error != highlight::PARSE_OK){
+ if (error == highlight::BAD_INPUT) {
+ inputErrors.append(inFilePath);
+ }
+ else {
+ outputErrors.append(inFilePath);
+ }
+ }
+ ui->progressBar->setValue(100*i / ui->lvInputFiles->count());
+ }
+ }
+
+ // write external Stylesheet
+ if (cbEmbed && leStyleFile && !cbEmbed->isChecked()) {
+ QString stylePath=QFileInfo(ui->leOutputDest->text(), leStyleFile->text()).absoluteFilePath();
+ bool styleFileOK=generator -> printExternalStyle(QDir::toNativeSeparators(stylePath).toStdString());
+ if (!styleFileOK) {
+ outputErrors.append(stylePath);
+ }
+ }
+
+ // write HTML index file
+ if ( (outType==highlight::HTML || outType==highlight::XHTML)
+ && ui->cbHTMLIndex->isChecked() && !ui->cbWrite2Src->isChecked()) {
+ vector <string> fileList;
+ for (int i=0;i<ui->lvInputFiles->count();i++){
+ fileList.push_back(QDir::toNativeSeparators(ui->lvInputFiles->item(i)->text()).toStdString());
+ }
+ QString outPath = QDir::toNativeSeparators(ui->leOutputDest->text());
+ if (!outPath.endsWith(QDir::separator())) outPath.append(QDir::separator());
+ bool indexFileOK=generator->printIndexFile(fileList, outPath.toStdString());
+ if (!indexFileOK) {
+ outputErrors.append(outPath+ ((outType==highlight::HTML)?"index.html":"index.xhtml"));
+ }
+ }
+
+ statusBar()->showMessage(tr("Converted %1 files in %2 ms").arg(ui->lvInputFiles->count()).arg(t.elapsed()));
+ ui->progressBar->reset();
+ this->setCursor(Qt::ArrowCursor);
+ ui->pbStartConversion->setEnabled(true);
+ ui->pbCopyFile2CP->setEnabled(true);
+
+ if (!inputErrors.isEmpty() || !outputErrors.isEmpty() || !reformatErrors.isEmpty()){
+ io_report report;
+ report.addInputErrors(inputErrors);
+ report.addOutputErrors(outputErrors);
+ report.addReformatErrors(reformatErrors);
+ report.exec();
+ if (report.removeInputErrorFiles()){
+ QList<QListWidgetItem*> items;
+ for (int i=0;i<inputErrors.count();i++){
+ items=ui->lvInputFiles->findItems(inputErrors.at(i),Qt::MatchExactly);
+ for (int j=0;j<items.count();j++){
+ delete items.at(j);
+ }
+ }
+ }
+ }
+}
+
+void MainWindow::on_pbCopyFile2CP_clicked(){
+
+ highlight2Clipboard(false);
+}
+
+void MainWindow::highlight2Clipboard(bool getDataFromCP){
+
+ if ((!getDataFromCP &&NULL==ui->lvInputFiles->currentItem())
+ || (getDataFromCP && savedClipboardContent.isEmpty())) return;
+
+ this->setCursor(Qt::WaitCursor);
+
+ auto_ptr<highlight::CodeGenerator> generator(
+ highlight::CodeGenerator::getInstance(getOutputType()));
+
+ applyCtrlValues(generator.get(), false);
+
+ string suffix;
+ if (getDataFromCP){
+ suffix= getFileType((ui->comboSelectSyntax->itemData(ui->comboSelectSyntax->currentIndex())).toString().toStdString(),"");
+ }else {
+ string currentFile = ui->lvInputFiles->currentItem()->text().toStdString();
+ suffix = getFileType(getFileSuffix(currentFile), currentFile);
+
+ QString inFileName = QFileInfo(ui->lvInputFiles->currentItem()->text()).fileName();
+ generator->setTitle(inFileName.toStdString());
+ }
+
+#ifdef DATA_DIR
+ QString langPath = QDir::toNativeSeparators(QString("%1/langDefs/%2.lang").arg(
+ DATA_DIR).arg(QString::fromStdString(suffix)));
+#else
+ QString langPath = QDir::toNativeSeparators(QString("%1/langDefs/%2.lang").arg(
+ QDir::currentPath()).arg(QString::fromStdString(suffix)));
+#endif
+
+ if ( generator->initLanguage(langPath.toStdString()) != highlight::LOAD_FAILED){
+ QString clipBoardData;
+ if (getDataFromCP){
+ clipBoardData= QString::fromStdString( generator->generateString(savedClipboardContent.toStdString()));
+ } else {
+ clipBoardData= QString::fromStdString( generator->generateStringFromFile(ui->lvInputFiles->currentItem()->text().toStdString()));
+ }
+
+ QClipboard *clipboard = QApplication::clipboard();
+ if (clipboard) {
+ highlight::OutputType outputType = getOutputType();
+ if ( outputType==highlight::RTF){
+ QMimeData *mimeData = new QMimeData();
+#ifdef WIN32
+ mimeData->setData("Rich Text Format", clipBoardData.toAscii());
+#else
+ mimeData->setData("text/rtf", clipBoardData.toAscii());
+#endif
+ clipboard->setMimeData(mimeData);
+ } else {
+ clipboard->setText(clipBoardData);
+ }
+ }
+ } else {
+ statusBar()->showMessage(
+ tr("Conversion of \"%1\" not possible.").arg((getDataFromCP)?tr("clipboard data"):ui->lvInputFiles->currentItem()->text()));
+ }
+ this->setCursor(Qt::ArrowCursor);
+}
+
+ void MainWindow::plausibility(){
+ ui->leOutputDest->setEnabled(!ui->cbWrite2Src->isChecked());
+ ui->pbOutputDest->setEnabled(!ui->cbWrite2Src->isChecked());
+ ui->pbOutputDest->setEnabled(!ui->cbWrite2Src->isChecked());
+ ui->leOutputDest->setEnabled(!ui->cbWrite2Src->isChecked());
+ ui->cbPadZeroes->setEnabled(ui->cbIncLineNo->isChecked());
+ ui->cbAdvWrapping->setEnabled(ui->cbWrapping->isChecked());
+ ui->comboEncoding->setEnabled(ui->cbEncoding->isChecked());
+
+ ui->comboReformat->setEnabled(ui->cbReformat->isChecked());
+ ui->comboKwCase->setEnabled(ui->cbKwCase->isChecked());
+ ui->cbHTMLInlineCSS->setEnabled(ui->cbHTMLEmbedStyle->isChecked());
+ ui->cbHTMLFileNameAnchor->setEnabled(ui->cbHTMLAnchors->isChecked());
+ ui->leHTMLStyleFile->setEnabled(!ui->cbHTMLEmbedStyle->isChecked());
+ ui->leHTMLStyleIncFile->setEnabled(ui->cbHTMLEmbedStyle->isChecked() && !ui->cbHTMLInlineCSS->isChecked());
+ ui->pbHTMLChooseStyleIncFile->setEnabled(ui->cbHTMLEmbedStyle->isChecked() &&!ui->cbHTMLInlineCSS->isChecked());
+ ui->leHTMLCssPrefix->setEnabled(!ui->cbHTMLInlineCSS->isChecked());
+ ui->leHTMLCtagsFile->setEnabled(ui->cbHTMLCtags->isChecked());
+ ui->pbHTMLChooseTagsFile->setEnabled(ui->cbHTMLCtags->isChecked());
+ ui->leLATEXStyleFile->setEnabled(!ui->cbLATEXEmbedStyle->isChecked());
+ ui->leTEXStyleFile->setEnabled(!ui->cbTEXEmbedStyle->isChecked());
+ ui->leSVGStyleFile->setEnabled(!ui->cbSVGEmbedStyle->isChecked());
+ ui->cbFragment->setEnabled( getOutputType()!=highlight::RTF && getOutputType()!=highlight::SVG );
+ ui->sbLineNoWidth->setEnabled(ui->cbIncLineNo->isChecked());
+ ui->cbHTMLIndex->setEnabled(!ui->cbWrite2Src->isChecked());
+ ui->cbHTMLEnclosePreTags->setEnabled(ui->cbFragment->isChecked());
+ ui->cbHTMLAnchors->setEnabled(ui->cbIncLineNo->isChecked());
+ ui->cbHTMLFileNameAnchor->setEnabled(ui->cbIncLineNo->isChecked());
+ ui->cbHTMLOrderedList->setEnabled(ui->cbIncLineNo->isChecked());
+
+ ui->pbCopyToCP->setEnabled(!savedClipboardContent.isEmpty());
+
+ switch (ui->comboFormat->currentIndex()) {
+ case 0:
+ case 1:
+ ui->stackedSpecificOptions->setCurrentIndex(0);
+ break;
+ case 2:
+ ui->stackedSpecificOptions->setCurrentIndex(1);
+ break;
+ case 3:
+ ui->stackedSpecificOptions->setCurrentIndex(2);
+ break;
+ case 4:
+ ui->stackedSpecificOptions->setCurrentIndex(3);
+ break;
+ case 5:
+ ui->stackedSpecificOptions->setCurrentIndex(4);
+ break;
+ default:
+ ui->stackedSpecificOptions->setCurrentIndex(5);
+ break;
+ }
+ }
+
+ void MainWindow::updatePreview() {
+
+ // is clipboard tab chosen?
+ bool getDataFromCP = ui->tabIOSelection->currentIndex()==1;
+
+ if ((!getDataFromCP && NULL==ui->lvInputFiles->currentItem())
+ || (getDataFromCP && savedClipboardContent.isEmpty())) return;
+
+ int vScroll = ui->browserPreview->verticalScrollBar()->value();
+ int hScroll = ui->browserPreview->horizontalScrollBar()->value();
+ this->setCursor(Qt::WaitCursor);
+ highlight::HtmlGenerator pwgenerator;
+ pwgenerator.setIncludeStyle(true);
+ pwgenerator.setHTMLInlineCSS(true);
+ if (!getDataFromCP){
+ pwgenerator.setMaxInputLineCnt(500);
+ }
+
+ applyCtrlValues(&pwgenerator, true);
+
+ string suffix;
+
+ if (getDataFromCP){
+ suffix= getFileType((ui->comboSelectSyntax->itemData(ui->comboSelectSyntax->currentIndex())).toString().toStdString(),"");
+ } else {
+ string currentFile = ui->lvInputFiles->currentItem()->text().toStdString();
+ suffix = getFileType(getFileSuffix(currentFile), currentFile);
+ }
+#ifdef DATA_DIR
+ QString langPath = QDir::toNativeSeparators(QString("%1/langDefs/%2.lang").arg(
+ DATA_DIR).arg(QString::fromStdString(suffix)));
+#else
+ QString langPath = QDir::toNativeSeparators(QString("%1/langDefs/%2.lang").arg(
+ QDir::currentPath()).arg(QString::fromStdString(suffix)));
+#endif
+
+
+ if ( pwgenerator.initLanguage(langPath.toStdString()) != highlight::LOAD_FAILED){
+
+ ui->lbPreview->setText(tr("Preview (%1):").arg(
+ (getDataFromCP)?tr("clipboard data"):ui->lvInputFiles->currentItem()->text()) );
+
+ statusBar()->showMessage(tr("Current syntax: %1").arg( QString::fromStdString(pwgenerator.getLanguage().getDescription())));
+ QString previewData;
+
+ // fix utf-8 data preview - to be improved (other encodings??)
+ if (ui->cbEncoding->isChecked() && ui->comboEncoding->currentText().toLower()=="utf-8"){
+ if (getDataFromCP){
+ previewData= QString::fromUtf8( pwgenerator.generateString(savedClipboardContent.toStdString()).c_str());
+ } else {
+ previewData= QString::fromUtf8( pwgenerator.generateStringFromFile(ui->lvInputFiles->currentItem()->text().toStdString()).c_str());
+ }
+ }
+ else {
+ if (getDataFromCP){
+ previewData= QString::fromStdString( pwgenerator.generateString(savedClipboardContent.toStdString()));
+ } else {
+ previewData= QString::fromStdString( pwgenerator.generateStringFromFile(ui->lvInputFiles->currentItem()->text().toStdString()));
+ }
+ }
+
+ ui->browserPreview->setHtml(previewData);
+ } else {
+ statusBar()->showMessage(tr("Preview of \"%1\" not possible.").arg((getDataFromCP)?tr("clipboard data"):ui->lvInputFiles->currentItem()->text()));
+ }
+ ui->browserPreview->verticalScrollBar()->setValue(vScroll);
+ ui->browserPreview->horizontalScrollBar()->setValue(hScroll);
+ this->setCursor(Qt::ArrowCursor);
+ }
+
+
+
+void MainWindow::on_pbHTMLChooseTagsFile_clicked()
+{
+ selectSingleFile(ui->leHTMLCtagsFile, tr("Choose a ctags file"), "*");
+}
+
+void MainWindow::on_action_Manual_triggered()
+{
+ ShowTextFile show;
+ show.setFileName("README");
+ show.exec();
+}
+
+void MainWindow::on_action_Changelog_triggered()
+{
+ ShowTextFile show;
+ show.setFileName("ChangeLog");
+ show.exec();
+}
+
+void MainWindow::on_action_License_triggered()
+{
+ ShowTextFile show;
+ show.setFileName("COPYING");
+ show.exec();
+}
+
+void MainWindow::on_pbHTMLChooseStyleIncFile_clicked()
+{
+ selectSingleFile(ui->leHTMLStyleIncFile, tr("Choose a style include file"), "*.css");
+}
+void MainWindow::on_pbSVGChooseStyleIncFile_clicked()
+{
+ selectSingleFile(ui->leSVGStyleIncFile, tr("Choose a style include file"), "*.css");
+}
+void MainWindow::on_pbLATEXChooseStyleIncFile_clicked()
+{
+ selectSingleFile(ui->leLATEXStyleIncFile, tr("Choose a style include file"), "*.sty");
+}
+
+void MainWindow::on_pbTEXChooseStyleIncFile_clicked()
+{
+ selectSingleFile(ui->leTEXStyleIncFile, tr("Choose a style include file"), "*.sty");
+}
+
+
+void MainWindow::on_actionAbout_translations_triggered()
+{
+ QMessageBox::information(this, tr("About providing translations"),
+ tr("The GUI was developed using the Qt toolkit, and "
+ "translations may be provided using the tools Qt Linguist and lrelease.\n"
+ "The highlight.ts file for Linguist resides in the src/gui-qt subdirectory.\n"
+ "The qm file generated by lrelease has to be saved in gui-files/l10n.\n\n"
+ "Please send a note to as (at) andre-simon (dot) de if you have issues during translating "
+ "or if you have finished or updated a translation."));
+}
+
+ void MainWindow::dropEvent(QDropEvent *event)
+ {
+ const QMimeData *mimeData = event->mimeData();
+
+ if (mimeData && mimeData->hasUrls()) {
+ QList<QUrl> urlList = mimeData->urls();
+ QString url;
+ for (int i = 0; i < urlList.size(); ++i) {
+ url=urlList.at(i).toLocalFile();
+ if (ui->lvInputFiles->findItems ( url, Qt::MatchExactly ).empty()) {
+ ui->lvInputFiles->addItem(url);
+ }
+ }
+ }
+ event->acceptProposedAction();
+ }
+
+ void MainWindow::dragEnterEvent(QDragEnterEvent *event)
+ {
+ event->acceptProposedAction();
+ }
+
+ void MainWindow::dragMoveEvent(QDragMoveEvent *event)
+ {
+ event->acceptProposedAction();
+ }
+
+ void MainWindow::dragLeaveEvent(QDragLeaveEvent *event)
+ {
+ event->accept();
+ }
+
+void MainWindow::on_pbPasteFromCB_clicked()
+{
+ QClipboard *clipboard = QApplication::clipboard();
+ if (clipboard) {
+ savedClipboardContent = clipboard->text();
+ updatePreview();
+ ui->pbCopyToCP->setEnabled(!savedClipboardContent.isEmpty());
+ }
+
+}
+
+void MainWindow::on_pbCopyToCP_clicked()
+{
+ highlight2Clipboard(true);
+}
diff --git a/support/highlight/src/gui-qt/mainwindow.h b/support/highlight/src/gui-qt/mainwindow.h
new file mode 100644
index 0000000000..89c181168a
--- /dev/null
+++ b/support/highlight/src/gui-qt/mainwindow.h
@@ -0,0 +1,123 @@
+/***************************************************************************
+ mainwindow.h
+ -------------------
+ begin : Mo 16.03.2009
+ copyright : (C) 2009 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QtGui/QMainWindow>
+#include <QtGui/QMessageBox>
+#include <QtGui/QFileDialog>
+#include <QSettings>
+#include <QDir>
+#include <QClipboard>
+#include <QMimeData>
+#include <QTime>
+#include <QLineEdit>
+#include <QString>
+#include <QTextStream>
+#include <QScrollBar>
+#include <QDropEvent>
+
+#include "version.h"
+#include "codegenerator.h"
+#include "htmlgenerator.h"
+#include "configurationreader.h"
+
+#include "enums.h"
+
+typedef map<string, string> StringMap;
+
+namespace Ui
+{
+ class MainWindowClass;
+}
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow(QWidget *parent = 0);
+ ~MainWindow();
+
+ void addInputFiles(const QStringList& list);
+
+private:
+ Ui::MainWindowClass *ui;
+ StringMap extensions, shebangs;
+ QString fileOpenFilter;
+ QString savedClipboardContent;
+
+ void readSettings();
+ void writeSettings();
+ highlight::OutputType getOutputType();
+ highlight::WrapMode getWrappingStyle();
+ QString getOutFileSuffix();
+ void applyCtrlValues(highlight::CodeGenerator* generator, bool previewMode);
+ void selectSingleFile(QLineEdit*, const QString&, const QString&);
+ bool loadFileTypeConfig(StringMap* extMap, StringMap* shebangMap);
+ void highlight2Clipboard(bool getDataFromCP);
+
+ string analyzeFile(const string& file);
+ string getFileType(const string& suffix, const string &inputFile);
+ string getFileSuffix(const string& fileName);
+
+ void dragEnterEvent(QDragEnterEvent *event);
+ void dragMoveEvent(QDragMoveEvent *event);
+ void dragLeaveEvent(QDragLeaveEvent *event);
+ void dropEvent(QDropEvent *event);
+
+public slots:
+ //This is a slot like the ones we used in our last tutorial
+ // The difference here that it gets automatically connect
+ // If you use on_objectname_signalname it's like connect(pushButton,SIGNAL(clicked()),this,SLOT(on_pushButton_clicked()))
+
+ void on_pbClearSelection_clicked();
+ void on_pbOutputDest_clicked();
+ void on_pbStartConversion_clicked();
+ void on_pbCopyFile2CP_clicked();
+
+private slots:
+
+ void on_pbCopyToCP_clicked();
+ void on_pbPasteFromCB_clicked();
+ void on_actionAbout_translations_triggered();
+ void on_pbTEXChooseStyleIncFile_clicked();
+ void on_pbLATEXChooseStyleIncFile_clicked();
+ void on_pbHTMLChooseStyleIncFile_clicked();
+ void on_pbSVGChooseStyleIncFile_clicked();
+ void on_action_License_triggered();
+ void on_action_Changelog_triggered();
+ void on_action_Manual_triggered();
+ void on_pbHTMLChooseTagsFile_clicked();
+ void on_action_About_Highlight_triggered();
+ void on_action_Exit_triggered();
+ void plausibility();
+ void updatePreview();
+ void openFiles();
+
+};
+
+#endif // MAINWINDOW_H
diff --git a/support/highlight/src/gui-qt/mainwindow.ui b/support/highlight/src/gui-qt/mainwindow.ui
new file mode 100644
index 0000000000..0bb46f6216
--- /dev/null
+++ b/support/highlight/src/gui-qt/mainwindow.ui
@@ -0,0 +1,2147 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindowClass</class>
+ <widget class="QMainWindow" name="MainWindowClass">
+ <property name="windowModality">
+ <enum>Qt::ApplicationModal</enum>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>645</height>
+ </rect>
+ </property>
+ <property name="acceptDrops">
+ <bool>false</bool>
+ </property>
+ <property name="windowTitle">
+ <string>Highlight</string>
+ </property>
+ <property name="windowIcon">
+ <iconset resource="highlight-gui.qrc">
+ <normaloff>:/hl_icon2.png</normaloff>:/hl_icon2.png</iconset>
+ </property>
+ <widget class="QWidget" name="centralWidget">
+ <layout class="QHBoxLayout" name="horizontalLayout_24">
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_7">
+ <item>
+ <widget class="QTabWidget" name="tabIOSelection">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="currentIndex">
+ <number>1</number>
+ </property>
+ <widget class="QWidget" name="tab_file_io">
+ <attribute name="title">
+ <string>Files</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <item>
+ <widget class="QPushButton" name="pbOpenFiles">
+ <property name="toolTip">
+ <string>Choose the source code files you want to convert.</string>
+ </property>
+ <property name="whatsThis">
+ <string/>
+ </property>
+ <property name="text">
+ <string>Choose input files</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QListWidget" name="lvInputFiles">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>50</height>
+ </size>
+ </property>
+ <property name="acceptDrops">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip">
+ <string>List of input files.</string>
+ </property>
+ <property name="dragDropMode">
+ <enum>QAbstractItemView::DropOnly</enum>
+ </property>
+ <property name="alternatingRowColors">
+ <bool>true</bool>
+ </property>
+ <property name="selectionMode">
+ <enum>QAbstractItemView::ExtendedSelection</enum>
+ </property>
+ <property name="selectionBehavior">
+ <enum>QAbstractItemView::SelectRows</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QPushButton" name="pbClearSelection">
+ <property name="toolTip">
+ <string>Remove the selected input files.</string>
+ </property>
+ <property name="text">
+ <string>Clear selection</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pbClearAll">
+ <property name="toolTip">
+ <string>Remove all input files.</string>
+ </property>
+ <property name="text">
+ <string>Clear all</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="Line" name="line_11">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QLabel" name="label_11">
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Output destination:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_22">
+ <item>
+ <widget class="QLineEdit" name="leOutputDest">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip">
+ <string>Output directory</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pbOutputDest">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>20</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip">
+ <string>Select the output directory.</string>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="cbWrite2Src">
+ <property name="toolTip">
+ <string>Save output in the input file directories.</string>
+ </property>
+ <property name="text">
+ <string>Write to source directories</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="Line" name="line_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pbStartConversion">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>120</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="font">
+ <font>
+ <family>MS Shell Dlg 2</family>
+ <pointsize>10</pointsize>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="toolTip">
+ <string>Start the conversion of your input files.</string>
+ </property>
+ <property name="text">
+ <string>Convert files</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pbCopyFile2CP">
+ <property name="toolTip">
+ <string>Copy highlighted code of the seleted file into the clipboard.</string>
+ </property>
+ <property name="text">
+ <string>Copy file to clipboard</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_clipboard">
+ <attribute name="title">
+ <string>Clipboard</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_15">
+ <item>
+ <widget class="QPushButton" name="pbPasteFromCB">
+ <property name="toolTip">
+ <string>Paste clipboard content into the preview window.</string>
+ </property>
+ <property name="text">
+ <string>Paste from clipboard</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_23">
+ <item>
+ <widget class="QLabel" name="label_13">
+ <property name="text">
+ <string>Select syntax:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboSelectSyntax">
+ <property name="toolTip">
+ <string>Select the correct syntax of the code snippet.</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="Line" name="line_14">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pbCopyToCP">
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="toolTip">
+ <string>Copy highlighted code into the clipboard.</string>
+ </property>
+ <property name="text">
+ <string>Copy preview to clipboard</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_12">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>106</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ <item>
+ <widget class="Line" name="line_7">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="layoutDirection">
+ <enum>Qt::LeftToRight</enum>
+ </property>
+ <property name="tabPosition">
+ <enum>QTabWidget::North</enum>
+ </property>
+ <property name="tabShape">
+ <enum>QTabWidget::Rounded</enum>
+ </property>
+ <property name="currentIndex">
+ <number>2</number>
+ </property>
+ <widget class="QWidget" name="page_general">
+ <attribute name="title">
+ <string>General</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_8">
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Output format:</string>
+ </property>
+ <property name="buddy">
+ <cstring>comboFormat</cstring>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboFormat">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="toolTip">
+ <string>Choose an output format.</string>
+ </property>
+ <item>
+ <property name="text">
+ <string>HTML</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>XHTML</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>LaTeX</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>TeX</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>RTF</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>SVG</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>XML</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>BBCode</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="Line" name="line_9">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_21">
+ <item>
+ <widget class="QCheckBox" name="cbIncLineNo">
+ <property name="toolTip">
+ <string>Add line numbers to the output.</string>
+ </property>
+ <property name="text">
+ <string>Add line numbers</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_4">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>10</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="sbLineNoWidth">
+ <property name="toolTip">
+ <string>Select the line number width.</string>
+ </property>
+ <property name="minimum">
+ <number>1</number>
+ </property>
+ <property name="maximum">
+ <number>6</number>
+ </property>
+ <property name="value">
+ <number>2</number>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="cbPadZeroes">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip">
+ <string>Fill leading space of line numbers with zeroes.</string>
+ </property>
+ <property name="text">
+ <string>Pad with zeroes</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="cbFragment">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip">
+ <string>Generate output without document header and footer.</string>
+ </property>
+ <property name="text">
+ <string>Omit header and footer</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="cbValidateInput">
+ <property name="toolTip">
+ <string>Test if input data is not binary.
+Removes Unicode BOM mark.</string>
+ </property>
+ <property name="text">
+ <string>Validate input data</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QCheckBox" name="cbEncoding">
+ <property name="toolTip">
+ <string>Set the output file ancoding.</string>
+ </property>
+ <property name="text">
+ <string>Set encoding:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboEncoding">
+ <property name="toolTip">
+ <string>Select or define the encoding.
+The result has to match the input file encoding.</string>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ <property name="insertPolicy">
+ <enum>QComboBox::InsertAtBottom</enum>
+ </property>
+ <item>
+ <property name="text">
+ <string>ISO-8859-1</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>ISO-8859-2</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>ISO-8859-3</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>ISO-8859-4</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>ISO-8859-5</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>ISO-8859-6</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>ISO-8859-7</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>ISO-8859-8</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>ISO-8859-9</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>ISO-8859-10</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>ISO-8859-11</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>ISO-8859-12</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>ISO-8859-13</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>ISO-8859-14</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>ISO-8859-15</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>UTF-8</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="page_output_spec">
+ <attribute name="title">
+ <string>Output specific</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QStackedWidget" name="stackedSpecificOptions">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Ignored">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="HTMLOptions">
+ <layout class="QVBoxLayout" name="verticalLayout_5">
+ <item>
+ <widget class="QLabel" name="label_17">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>HTML options</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="Line" name="line_12">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>250</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tabWidgetPage1">
+ <attribute name="title">
+ <string>Stylesheets</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout_4">
+ <item row="0" column="0">
+ <layout class="QHBoxLayout" name="horizontalLayout_10">
+ <item>
+ <widget class="QCheckBox" name="cbHTMLEmbedStyle">
+ <property name="toolTip">
+ <string>Include the style information in each output file.</string>
+ </property>
+ <property name="text">
+ <string>Embed style (CSS)</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="cbHTMLInlineCSS">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip">
+ <string>Add CSS information to each tag (do not use CSS class definitions).</string>
+ </property>
+ <property name="text">
+ <string>Inline CSS</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0">
+ <layout class="QHBoxLayout" name="horizontalLayout_14">
+ <item>
+ <widget class="QLabel" name="label_19">
+ <property name="text">
+ <string>Stylesheet file:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="leHTMLStyleFile">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip">
+ <string>Name of the referenced style file.</string>
+ </property>
+ <property name="text">
+ <string>highlight.css</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="2" column="0">
+ <layout class="QHBoxLayout" name="horizontalLayout_9">
+ <item>
+ <widget class="QLabel" name="label_20">
+ <property name="text">
+ <string>Include:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="leHTMLStyleIncFile">
+ <property name="toolTip">
+ <string>Path of the CSS include file.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pbHTMLChooseStyleIncFile">
+ <property name="toolTip">
+ <string>Select a CSS include file.</string>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="3" column="0">
+ <layout class="QHBoxLayout" name="horizontalLayout_7">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>CSS class prefix:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="leHTMLCssPrefix">
+ <property name="toolTip">
+ <string>Add a CSS class name prefix to avoid namespace clashes.</string>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="4" column="0">
+ <spacer name="verticalSpacer_9">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::MinimumExpanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tabWidgetPage2">
+ <attribute name="title">
+ <string>Index/ctags</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_6">
+ <item>
+ <widget class="QCheckBox" name="cbHTMLIndex">
+ <property name="toolTip">
+ <string>Generate an index file with hyperlinks to all outputted files.</string>
+ </property>
+ <property name="text">
+ <string>Generate index file</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="Line" name="line_13">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="cbHTMLCtags">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip">
+ <string>Read a ctags file and add the included metainformation as tooltips.
+See ctags.sf.net for details.</string>
+ </property>
+ <property name="text">
+ <string>Read ctags file:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_12">
+ <item>
+ <widget class="QLineEdit" name="leHTMLCtagsFile">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip">
+ <string>Path of the ctags file.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pbHTMLChooseTagsFile">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip">
+ <string>Choose a ctags file.</string>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_8">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>72</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tabWidgetPage3">
+ <attribute name="title">
+ <string>Misc</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_4">
+ <item>
+ <widget class="QLabel" name="label_8">
+ <property name="font">
+ <font>
+ <weight>50</weight>
+ <bold>false</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Line numbering options:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="cbHTMLAnchors">
+ <property name="toolTip">
+ <string>Add an achor to each line.</string>
+ </property>
+ <property name="text">
+ <string>Add line anchors</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="cbHTMLFileNameAnchor">
+ <property name="toolTip">
+ <string>Add the filename as prefix to the anchors.</string>
+ </property>
+ <property name="text">
+ <string>Include file name in anchor</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="cbHTMLOrderedList">
+ <property name="toolTip">
+ <string>Output the lines within an ordered list.</string>
+ </property>
+ <property name="text">
+ <string>Output as ordered list</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="Line" name="line_4">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="cbHTMLEnclosePreTags">
+ <property name="toolTip">
+ <string>Add &amp;lt;pre&amp;gt; tags to the output, if the flag &quot;No document header and footer&quot; is selected.</string>
+ </property>
+ <property name="text">
+ <string>Enclose in pre tags</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>24</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="LATEXOptions">
+ <layout class="QVBoxLayout" name="verticalLayout_12">
+ <item>
+ <widget class="QLabel" name="label_18">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>LaTeX options</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="Line" name="line_8">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="cbLATEXEscQuotes">
+ <property name="toolTip">
+ <string>Replace quotes by dq sequences.</string>
+ </property>
+ <property name="text">
+ <string>Escape quotes</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="cbLATEXBabel">
+ <property name="toolTip">
+ <string>Make output Babel compatible.</string>
+ </property>
+ <property name="text">
+ <string>Add Babel compatibility</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="cbLATEXPrettySymbols">
+ <property name="toolTip">
+ <string>Replace default symbols (brackets, tilde) by nice redefinitions.</string>
+ </property>
+ <property name="text">
+ <string>Add pretty symbols</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="cbLATEXEmbedStyle">
+ <property name="toolTip">
+ <string>Include the style information in each output file.</string>
+ </property>
+ <property name="text">
+ <string>Embed style (defs)</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_17">
+ <item>
+ <widget class="QLabel" name="label_21">
+ <property name="text">
+ <string>Stylesheet file:</string>
+ </property>
+ <property name="buddy">
+ <cstring>leLATEXStyleFile</cstring>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="leLATEXStyleFile">
+ <property name="toolTip">
+ <string>Name of the referenced style file.</string>
+ </property>
+ <property name="text">
+ <string>highlight.sty</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_15">
+ <item>
+ <widget class="QLabel" name="label_22">
+ <property name="text">
+ <string>Stylesheet include file:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_16">
+ <item>
+ <widget class="QLineEdit" name="leLATEXStyleIncFile">
+ <property name="toolTip">
+ <string>Path of the style include file.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pbLATEXChooseStyleIncFile">
+ <property name="toolTip">
+ <string>Select a style include file.</string>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_4">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="TEXOptions">
+ <layout class="QVBoxLayout" name="verticalLayout_14">
+ <item>
+ <widget class="QLabel" name="label_26">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>TeX options</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="Line" name="line_10">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="cbTEXEmbedStyle">
+ <property name="toolTip">
+ <string>Include the style information in each output file.</string>
+ </property>
+ <property name="text">
+ <string>Embed style (macros)</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_18">
+ <item>
+ <widget class="QLabel" name="label_24">
+ <property name="text">
+ <string>Stylesheet file:</string>
+ </property>
+ <property name="buddy">
+ <cstring>leTEXStyleFile</cstring>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="leTEXStyleFile">
+ <property name="toolTip">
+ <string>Name of the referenced style file.</string>
+ </property>
+ <property name="text">
+ <string>highlight.sty</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_19">
+ <item>
+ <widget class="QLabel" name="label_25">
+ <property name="text">
+ <string>Stylesheet include file:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_20">
+ <item>
+ <widget class="QLineEdit" name="leTEXStyleIncFile">
+ <property name="toolTip">
+ <string>Path of the style include file.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pbTEXChooseStyleIncFile">
+ <property name="toolTip">
+ <string>Select a style include file.</string>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_5">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="RTFOptions">
+ <layout class="QVBoxLayout" name="verticalLayout_9">
+ <item>
+ <widget class="QLabel" name="label_15">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>RTF options</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="Line" name="line_5">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="cbRTFCharStyles">
+ <property name="toolTip">
+ <string>Add character stylesheets with formatting information.
+You can select the stylesheets in your word processor to reformat additional text.</string>
+ </property>
+ <property name="text">
+ <string>Add character styles</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_11">
+ <item>
+ <widget class="QLabel" name="label_9">
+ <property name="text">
+ <string>Page size:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboRTFPageSize">
+ <property name="toolTip">
+ <string>Select a page size.</string>
+ </property>
+ <property name="currentIndex">
+ <number>1</number>
+ </property>
+ <item>
+ <property name="text">
+ <string>A3</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>A4</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>A5</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>B4</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>B5</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>B6</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Letter</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Legal</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_6">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="SVGOptions">
+ <layout class="QVBoxLayout" name="verticalLayout_10">
+ <item>
+ <widget class="QLabel" name="label_16">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>SVG options</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="Line" name="line_6">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_10">
+ <property name="text">
+ <string>Image size:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QGridLayout" name="gridLayout_8">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>Width:</string>
+ </property>
+ <property name="buddy">
+ <cstring>leSVGWidth</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="leSVGWidth">
+ <property name="toolTip">
+ <string>Enter the SVG width (may contain units).</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_12">
+ <property name="text">
+ <string>Height:</string>
+ </property>
+ <property name="buddy">
+ <cstring>leSVGHeight</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLineEdit" name="leSVGHeight">
+ <property name="toolTip">
+ <string>Enter the SVG height (may contain units).</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="cbSVGEmbedStyle">
+ <property name="toolTip">
+ <string>Include the style information in each output file.</string>
+ </property>
+ <property name="text">
+ <string>Embed style (CSS)</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_26">
+ <item>
+ <widget class="QLabel" name="label_29">
+ <property name="text">
+ <string>Stylesheet file:</string>
+ </property>
+ <property name="buddy">
+ <cstring>leSVGStyleFile</cstring>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="leSVGStyleFile">
+ <property name="toolTip">
+ <string>Name of the referenced style file.</string>
+ </property>
+ <property name="text">
+ <string>highlight.css</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_27">
+ <item>
+ <widget class="QLabel" name="label_30">
+ <property name="text">
+ <string>Stylesheet include file:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_6">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_28">
+ <item>
+ <widget class="QLineEdit" name="leSVGStyleIncFile">
+ <property name="toolTip">
+ <string>Path of the CSS include file.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pbSVGChooseStyleIncFile">
+ <property name="toolTip">
+ <string>Select a style include file.</string>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_10">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="EmptyPage">
+ <layout class="QVBoxLayout" name="verticalLayout_11">
+ <item>
+ <widget class="QLabel" name="label_7">
+ <property name="text">
+ <string>No options defined.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="page_formatting">
+ <attribute name="title">
+ <string>Formatting</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_8">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <widget class="QLabel" name="label_5">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Color theme:</string>
+ </property>
+ <property name="buddy">
+ <cstring>comboTheme</cstring>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboTheme">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip">
+ <string>Select a colour theme.</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_4">
+ <item>
+ <widget class="QCheckBox" name="cbReformat">
+ <property name="toolTip">
+ <string>Reformat and indent your code.
+This feature is enabled tor C, C++, C# and Java code.</string>
+ </property>
+ <property name="text">
+ <string>Reformat:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboReformat">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip">
+ <string>Choose a formatting scheme.</string>
+ </property>
+ <item>
+ <property name="text">
+ <string>Allman</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Banner</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>GNU</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Horstmann</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Java</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>K&amp;R</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Linux</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>OTBS</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Stroustrup</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Whitesmith</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_5">
+ <item>
+ <widget class="QCheckBox" name="cbKwCase">
+ <property name="toolTip">
+ <string>Change the keyword case.</string>
+ </property>
+ <property name="text">
+ <string>Keyword case:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboKwCase">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip">
+ <string>Select a keyword case.</string>
+ </property>
+ <item>
+ <property name="text">
+ <string>UPPER</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>lower</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Capitalize</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_6">
+ <item>
+ <widget class="QLabel" name="label_6">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Tab width:</string>
+ </property>
+ <property name="buddy">
+ <cstring>sbTabWidth</cstring>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="sbTabWidth">
+ <property name="toolTip">
+ <string>Enter the number of spaces which replace a tab.
+Set the width to 0 to keep tabs.</string>
+ </property>
+ <property name="maximum">
+ <number>10</number>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="0" column="0">
+ <widget class="QCheckBox" name="cbWrapping">
+ <property name="toolTip">
+ <string>Enable line wrapping.</string>
+ </property>
+ <property name="text">
+ <string>Line wrapping</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QSpinBox" name="sbLineLength">
+ <property name="toolTip">
+ <string>Enter the maximum line length.</string>
+ </property>
+ <property name="minimum">
+ <number>60</number>
+ </property>
+ <property name="maximum">
+ <number>120</number>
+ </property>
+ <property name="singleStep">
+ <number>2</number>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QCheckBox" name="cbAdvWrapping">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip">
+ <string>Indent statements and function parameters after wrapping.</string>
+ </property>
+ <property name="text">
+ <string>Intelligent wrapping</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <spacer name="verticalSpacer_11">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Minimum</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>13</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="Line" name="line_3">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QGridLayout" name="gridLayout_9">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_23">
+ <property name="text">
+ <string>Font name:</string>
+ </property>
+ <property name="buddy">
+ <cstring>comboFontName</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QFontComboBox" name="comboFontName">
+ <property name="toolTip">
+ <string>Select or enter the font name.</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_4">
+ <property name="text">
+ <string>Font size:</string>
+ </property>
+ <property name="buddy">
+ <cstring>leFontSize</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLineEdit" name="leFontSize">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip">
+ <string>Enter the font size.</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="Line" name="line">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_13">
+ <item>
+ <widget class="QLabel" name="lbPreview">
+ <property name="text">
+ <string>Preview</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QTextBrowser" name="browserPreview">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip">
+ <string/>
+ </property>
+ <property name="whatsThis">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_13">
+ <item>
+ <widget class="QLabel" name="label_14">
+ <property name="text">
+ <string>Output progress:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QProgressBar" name="progressBar">
+ <property name="value">
+ <number>0</number>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QMenuBar" name="menuBar">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>20</height>
+ </rect>
+ </property>
+ <widget class="QMenu" name="menu_File">
+ <property name="title">
+ <string>&amp;File</string>
+ </property>
+ <addaction name="action_Open_files"/>
+ <addaction name="separator"/>
+ <addaction name="action_Exit"/>
+ </widget>
+ <widget class="QMenu" name="menu_Help">
+ <property name="title">
+ <string>&amp;Help</string>
+ </property>
+ <addaction name="action_Tips"/>
+ <addaction name="action_Manual"/>
+ <addaction name="action_Changelog"/>
+ <addaction name="action_License"/>
+ <addaction name="separator"/>
+ <addaction name="actionAbout_translations"/>
+ <addaction name="separator"/>
+ <addaction name="action_About_Highlight"/>
+ </widget>
+ <addaction name="menu_File"/>
+ <addaction name="menu_Help"/>
+ </widget>
+ <widget class="QStatusBar" name="statusBar"/>
+ <action name="action_Open_files">
+ <property name="text">
+ <string>&amp;Open files</string>
+ </property>
+ </action>
+ <action name="action_Exit">
+ <property name="text">
+ <string>&amp;Exit</string>
+ </property>
+ </action>
+ <action name="action_Load">
+ <property name="text">
+ <string>&amp;Load</string>
+ </property>
+ </action>
+ <action name="action_Save">
+ <property name="text">
+ <string>&amp;Save</string>
+ </property>
+ </action>
+ <action name="actionLoad_default_project">
+ <property name="text">
+ <string>Load &amp;default project</string>
+ </property>
+ </action>
+ <action name="action_Manual">
+ <property name="text">
+ <string>Readme</string>
+ </property>
+ </action>
+ <action name="action_Tips">
+ <property name="text">
+ <string>&amp;Tips</string>
+ </property>
+ <property name="visible">
+ <bool>false</bool>
+ </property>
+ </action>
+ <action name="action_Changelog">
+ <property name="text">
+ <string>&amp;Changelog</string>
+ </property>
+ </action>
+ <action name="action_License">
+ <property name="text">
+ <string>&amp;License</string>
+ </property>
+ </action>
+ <action name="action_About_Highlight">
+ <property name="text">
+ <string>&amp;About Highlight</string>
+ </property>
+ </action>
+ <action name="actionAbout_translations">
+ <property name="text">
+ <string>About &amp;translations</string>
+ </property>
+ </action>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <tabstops>
+ <tabstop>pbOpenFiles</tabstop>
+ <tabstop>lvInputFiles</tabstop>
+ <tabstop>pbClearSelection</tabstop>
+ <tabstop>pbClearAll</tabstop>
+ <tabstop>tabWidget</tabstop>
+ <tabstop>comboFormat</tabstop>
+ <tabstop>cbIncLineNo</tabstop>
+ <tabstop>sbLineNoWidth</tabstop>
+ <tabstop>cbPadZeroes</tabstop>
+ <tabstop>cbFragment</tabstop>
+ <tabstop>cbValidateInput</tabstop>
+ <tabstop>cbEncoding</tabstop>
+ <tabstop>comboEncoding</tabstop>
+ <tabstop>cbHTMLEmbedStyle</tabstop>
+ <tabstop>cbHTMLInlineCSS</tabstop>
+ <tabstop>leHTMLStyleFile</tabstop>
+ <tabstop>leHTMLStyleIncFile</tabstop>
+ <tabstop>pbHTMLChooseStyleIncFile</tabstop>
+ <tabstop>leHTMLCssPrefix</tabstop>
+ <tabstop>cbHTMLIndex</tabstop>
+ <tabstop>cbHTMLCtags</tabstop>
+ <tabstop>leHTMLCtagsFile</tabstop>
+ <tabstop>pbHTMLChooseTagsFile</tabstop>
+ <tabstop>cbHTMLAnchors</tabstop>
+ <tabstop>cbHTMLFileNameAnchor</tabstop>
+ <tabstop>cbHTMLOrderedList</tabstop>
+ <tabstop>cbHTMLEnclosePreTags</tabstop>
+ <tabstop>cbLATEXEscQuotes</tabstop>
+ <tabstop>cbLATEXBabel</tabstop>
+ <tabstop>cbLATEXPrettySymbols</tabstop>
+ <tabstop>cbLATEXEmbedStyle</tabstop>
+ <tabstop>leLATEXStyleFile</tabstop>
+ <tabstop>leLATEXStyleIncFile</tabstop>
+ <tabstop>pbLATEXChooseStyleIncFile</tabstop>
+ <tabstop>cbTEXEmbedStyle</tabstop>
+ <tabstop>leTEXStyleFile</tabstop>
+ <tabstop>leTEXStyleIncFile</tabstop>
+ <tabstop>pbTEXChooseStyleIncFile</tabstop>
+ <tabstop>cbRTFCharStyles</tabstop>
+ <tabstop>comboRTFPageSize</tabstop>
+ <tabstop>leSVGWidth</tabstop>
+ <tabstop>leSVGHeight</tabstop>
+ <tabstop>cbSVGEmbedStyle</tabstop>
+ <tabstop>leSVGStyleFile</tabstop>
+ <tabstop>leSVGStyleIncFile</tabstop>
+ <tabstop>pbSVGChooseStyleIncFile</tabstop>
+ <tabstop>comboTheme</tabstop>
+ <tabstop>cbReformat</tabstop>
+ <tabstop>comboReformat</tabstop>
+ <tabstop>cbKwCase</tabstop>
+ <tabstop>comboKwCase</tabstop>
+ <tabstop>sbTabWidth</tabstop>
+ <tabstop>cbWrapping</tabstop>
+ <tabstop>sbLineLength</tabstop>
+ <tabstop>cbAdvWrapping</tabstop>
+ <tabstop>comboFontName</tabstop>
+ <tabstop>leFontSize</tabstop>
+ <tabstop>browserPreview</tabstop>
+ <tabstop>pbStartConversion</tabstop>
+ <tabstop>pbCopyFile2CP</tabstop>
+ </tabstops>
+ <resources>
+ <include location="highlight-gui.qrc"/>
+ </resources>
+ <connections>
+ <connection>
+ <sender>pbClearAll</sender>
+ <signal>clicked()</signal>
+ <receiver>lvInputFiles</receiver>
+ <slot>clear()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>285</x>
+ <y>420</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>218</x>
+ <y>228</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/support/highlight/src/gui-qt/moc_io_report.cpp b/support/highlight/src/gui-qt/moc_io_report.cpp
new file mode 100644
index 0000000000..1b6ef11f60
--- /dev/null
+++ b/support/highlight/src/gui-qt/moc_io_report.cpp
@@ -0,0 +1,69 @@
+/****************************************************************************
+** Meta object code from reading C++ file 'io_report.h'
+**
+** Created: Wed Mar 31 16:43:41 2010
+** by: The Qt Meta Object Compiler version 62 (Qt 4.6.2)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#include "io_report.h"
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#error "The header file 'io_report.h' doesn't include <QObject>."
+#elif Q_MOC_OUTPUT_REVISION != 62
+#error "This file was generated using the moc from 4.6.2. It"
+#error "cannot be used with the include files from this version of Qt."
+#error "(The moc has changed too much.)"
+#endif
+
+QT_BEGIN_MOC_NAMESPACE
+static const uint qt_meta_data_io_report[] = {
+
+ // content:
+ 4, // revision
+ 0, // classname
+ 0, 0, // classinfo
+ 0, 0, // methods
+ 0, 0, // properties
+ 0, 0, // enums/sets
+ 0, 0, // constructors
+ 0, // flags
+ 0, // signalCount
+
+ 0 // eod
+};
+
+static const char qt_meta_stringdata_io_report[] = {
+ "io_report\0"
+};
+
+const QMetaObject io_report::staticMetaObject = {
+ { &QDialog::staticMetaObject, qt_meta_stringdata_io_report,
+ qt_meta_data_io_report, 0 }
+};
+
+#ifdef Q_NO_DATA_RELOCATION
+const QMetaObject &io_report::getStaticMetaObject() { return staticMetaObject; }
+#endif //Q_NO_DATA_RELOCATION
+
+const QMetaObject *io_report::metaObject() const
+{
+ return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
+}
+
+void *io_report::qt_metacast(const char *_clname)
+{
+ if (!_clname) return 0;
+ if (!strcmp(_clname, qt_meta_stringdata_io_report))
+ return static_cast<void*>(const_cast< io_report*>(this));
+ return QDialog::qt_metacast(_clname);
+}
+
+int io_report::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
+{
+ _id = QDialog::qt_metacall(_c, _id, _a);
+ if (_id < 0)
+ return _id;
+ return _id;
+}
+QT_END_MOC_NAMESPACE
diff --git a/support/highlight/src/gui-qt/moc_mainwindow.cpp b/support/highlight/src/gui-qt/moc_mainwindow.cpp
new file mode 100644
index 0000000000..2182a76b07
--- /dev/null
+++ b/support/highlight/src/gui-qt/moc_mainwindow.cpp
@@ -0,0 +1,134 @@
+/****************************************************************************
+** Meta object code from reading C++ file 'mainwindow.h'
+**
+** Created: Wed Mar 31 16:43:41 2010
+** by: The Qt Meta Object Compiler version 62 (Qt 4.6.2)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#include "mainwindow.h"
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#error "The header file 'mainwindow.h' doesn't include <QObject>."
+#elif Q_MOC_OUTPUT_REVISION != 62
+#error "This file was generated using the moc from 4.6.2. It"
+#error "cannot be used with the include files from this version of Qt."
+#error "(The moc has changed too much.)"
+#endif
+
+QT_BEGIN_MOC_NAMESPACE
+static const uint qt_meta_data_MainWindow[] = {
+
+ // content:
+ 4, // revision
+ 0, // classname
+ 0, 0, // classinfo
+ 20, 14, // methods
+ 0, 0, // properties
+ 0, 0, // enums/sets
+ 0, 0, // constructors
+ 0, // flags
+ 0, // signalCount
+
+ // slots: signature, parameters, type, tag, flags
+ 12, 11, 11, 11, 0x0a,
+ 42, 11, 11, 11, 0x0a,
+ 68, 11, 11, 11, 0x0a,
+ 99, 11, 11, 11, 0x0a,
+ 126, 11, 11, 11, 0x08,
+ 150, 11, 11, 11, 0x08,
+ 177, 11, 11, 11, 0x08,
+ 217, 11, 11, 11, 0x08,
+ 254, 11, 11, 11, 0x08,
+ 293, 11, 11, 11, 0x08,
+ 331, 11, 11, 11, 0x08,
+ 368, 11, 11, 11, 0x08,
+ 398, 11, 11, 11, 0x08,
+ 430, 11, 11, 11, 0x08,
+ 459, 11, 11, 11, 0x08,
+ 493, 11, 11, 11, 0x08,
+ 531, 11, 11, 11, 0x08,
+ 558, 11, 11, 11, 0x08,
+ 573, 11, 11, 11, 0x08,
+ 589, 11, 11, 11, 0x08,
+
+ 0 // eod
+};
+
+static const char qt_meta_stringdata_MainWindow[] = {
+ "MainWindow\0\0on_pbClearSelection_clicked()\0"
+ "on_pbOutputDest_clicked()\0"
+ "on_pbStartConversion_clicked()\0"
+ "on_pbCopyFile2CP_clicked()\0"
+ "on_pbCopyToCP_clicked()\0"
+ "on_pbPasteFromCB_clicked()\0"
+ "on_actionAbout_translations_triggered()\0"
+ "on_pbTEXChooseStyleIncFile_clicked()\0"
+ "on_pbLATEXChooseStyleIncFile_clicked()\0"
+ "on_pbHTMLChooseStyleIncFile_clicked()\0"
+ "on_pbSVGChooseStyleIncFile_clicked()\0"
+ "on_action_License_triggered()\0"
+ "on_action_Changelog_triggered()\0"
+ "on_action_Manual_triggered()\0"
+ "on_pbHTMLChooseTagsFile_clicked()\0"
+ "on_action_About_Highlight_triggered()\0"
+ "on_action_Exit_triggered()\0plausibility()\0"
+ "updatePreview()\0openFiles()\0"
+};
+
+const QMetaObject MainWindow::staticMetaObject = {
+ { &QMainWindow::staticMetaObject, qt_meta_stringdata_MainWindow,
+ qt_meta_data_MainWindow, 0 }
+};
+
+#ifdef Q_NO_DATA_RELOCATION
+const QMetaObject &MainWindow::getStaticMetaObject() { return staticMetaObject; }
+#endif //Q_NO_DATA_RELOCATION
+
+const QMetaObject *MainWindow::metaObject() const
+{
+ return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
+}
+
+void *MainWindow::qt_metacast(const char *_clname)
+{
+ if (!_clname) return 0;
+ if (!strcmp(_clname, qt_meta_stringdata_MainWindow))
+ return static_cast<void*>(const_cast< MainWindow*>(this));
+ return QMainWindow::qt_metacast(_clname);
+}
+
+int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
+{
+ _id = QMainWindow::qt_metacall(_c, _id, _a);
+ if (_id < 0)
+ return _id;
+ if (_c == QMetaObject::InvokeMetaMethod) {
+ switch (_id) {
+ case 0: on_pbClearSelection_clicked(); break;
+ case 1: on_pbOutputDest_clicked(); break;
+ case 2: on_pbStartConversion_clicked(); break;
+ case 3: on_pbCopyFile2CP_clicked(); break;
+ case 4: on_pbCopyToCP_clicked(); break;
+ case 5: on_pbPasteFromCB_clicked(); break;
+ case 6: on_actionAbout_translations_triggered(); break;
+ case 7: on_pbTEXChooseStyleIncFile_clicked(); break;
+ case 8: on_pbLATEXChooseStyleIncFile_clicked(); break;
+ case 9: on_pbHTMLChooseStyleIncFile_clicked(); break;
+ case 10: on_pbSVGChooseStyleIncFile_clicked(); break;
+ case 11: on_action_License_triggered(); break;
+ case 12: on_action_Changelog_triggered(); break;
+ case 13: on_action_Manual_triggered(); break;
+ case 14: on_pbHTMLChooseTagsFile_clicked(); break;
+ case 15: on_action_About_Highlight_triggered(); break;
+ case 16: on_action_Exit_triggered(); break;
+ case 17: plausibility(); break;
+ case 18: updatePreview(); break;
+ case 19: openFiles(); break;
+ default: ;
+ }
+ _id -= 20;
+ }
+ return _id;
+}
+QT_END_MOC_NAMESPACE
diff --git a/support/highlight/src/gui-qt/moc_showtextfile.cpp b/support/highlight/src/gui-qt/moc_showtextfile.cpp
new file mode 100644
index 0000000000..dfd8aa34f6
--- /dev/null
+++ b/support/highlight/src/gui-qt/moc_showtextfile.cpp
@@ -0,0 +1,79 @@
+/****************************************************************************
+** Meta object code from reading C++ file 'showtextfile.h'
+**
+** Created: Wed Mar 31 16:43:42 2010
+** by: The Qt Meta Object Compiler version 62 (Qt 4.6.2)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#include "showtextfile.h"
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#error "The header file 'showtextfile.h' doesn't include <QObject>."
+#elif Q_MOC_OUTPUT_REVISION != 62
+#error "This file was generated using the moc from 4.6.2. It"
+#error "cannot be used with the include files from this version of Qt."
+#error "(The moc has changed too much.)"
+#endif
+
+QT_BEGIN_MOC_NAMESPACE
+static const uint qt_meta_data_ShowTextFile[] = {
+
+ // content:
+ 4, // revision
+ 0, // classname
+ 0, 0, // classinfo
+ 1, 14, // methods
+ 0, 0, // properties
+ 0, 0, // enums/sets
+ 0, 0, // constructors
+ 0, // flags
+ 0, // signalCount
+
+ // slots: signature, parameters, type, tag, flags
+ 14, 13, 13, 13, 0x08,
+
+ 0 // eod
+};
+
+static const char qt_meta_stringdata_ShowTextFile[] = {
+ "ShowTextFile\0\0on_pushButton_clicked()\0"
+};
+
+const QMetaObject ShowTextFile::staticMetaObject = {
+ { &QDialog::staticMetaObject, qt_meta_stringdata_ShowTextFile,
+ qt_meta_data_ShowTextFile, 0 }
+};
+
+#ifdef Q_NO_DATA_RELOCATION
+const QMetaObject &ShowTextFile::getStaticMetaObject() { return staticMetaObject; }
+#endif //Q_NO_DATA_RELOCATION
+
+const QMetaObject *ShowTextFile::metaObject() const
+{
+ return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
+}
+
+void *ShowTextFile::qt_metacast(const char *_clname)
+{
+ if (!_clname) return 0;
+ if (!strcmp(_clname, qt_meta_stringdata_ShowTextFile))
+ return static_cast<void*>(const_cast< ShowTextFile*>(this));
+ return QDialog::qt_metacast(_clname);
+}
+
+int ShowTextFile::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
+{
+ _id = QDialog::qt_metacall(_c, _id, _a);
+ if (_id < 0)
+ return _id;
+ if (_c == QMetaObject::InvokeMetaMethod) {
+ switch (_id) {
+ case 0: on_pushButton_clicked(); break;
+ default: ;
+ }
+ _id -= 1;
+ }
+ return _id;
+}
+QT_END_MOC_NAMESPACE
diff --git a/support/highlight/src/gui-qt/precomp.h b/support/highlight/src/gui-qt/precomp.h
new file mode 100644
index 0000000000..28d089ae02
--- /dev/null
+++ b/support/highlight/src/gui-qt/precomp.h
@@ -0,0 +1,26 @@
+#ifndef PRECOMP_H
+#define PRECOMP_H
+
+#if defined __cplusplus
+#include <QtGui/QMainWindow>
+#include <QtGui/QMessageBox>
+#include <QtGui/QFileDialog>
+#include <QSettings>
+#include <QDir>
+#include <QClipboard>
+#include <QMimeData>
+#include <QTime>
+#include <QLineEdit>
+#include <QString>
+#include <QTextStream>
+#include <QDropEvent>
+
+#include "version.h"
+#include "codegenerator.h"
+#include "htmlgenerator.h"
+#include "configurationreader.h"
+
+#include "enums.h"
+#endif
+
+#endif // PRECOMP_H
diff --git a/support/highlight/src/gui-qt/showtextfile.cpp b/support/highlight/src/gui-qt/showtextfile.cpp
new file mode 100644
index 0000000000..dffdd131e8
--- /dev/null
+++ b/support/highlight/src/gui-qt/showtextfile.cpp
@@ -0,0 +1,72 @@
+
+/***************************************************************************
+ showtestfile.cpp
+ -------------------
+ begin : Mo 16.03.2009
+ copyright : (C) 2009 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "showtextfile.h"
+#include "ui_showtextfile.h"
+#include <QTextStream>
+
+ShowTextFile::ShowTextFile(QWidget *parent) :
+ QDialog(parent),
+ m_ui(new Ui::ShowTextFile)
+{
+ m_ui->setupUi(this);
+}
+
+ShowTextFile::~ShowTextFile()
+{
+ delete m_ui;
+}
+
+void ShowTextFile::changeEvent(QEvent *e)
+{
+ switch (e->type()) {
+ case QEvent::LanguageChange:
+ m_ui->retranslateUi(this);
+ break;
+ default:
+ break;
+ }
+}
+
+
+bool ShowTextFile::setFileName(const QString& fileName){
+#ifndef HL_DOC_DIR
+ QFile file( QString("%1/%2").arg(QDir::currentPath()).arg( fileName ));
+#else
+ QFile file( QString("%1/%2").arg(HL_DOC_DIR).arg(fileName ));
+#endif
+ if ( file.open( QIODevice::ReadOnly) ) {
+ QTextStream stream( &file );
+ m_ui->textEdit->setText( stream.readAll() );
+ m_ui->lbTitle->setText(fileName);
+ }
+ return file.exists();
+}
+
+void ShowTextFile::on_pushButton_clicked()
+{
+ this->close();
+}
diff --git a/support/highlight/src/gui-qt/showtextfile.h b/support/highlight/src/gui-qt/showtextfile.h
new file mode 100644
index 0000000000..8840633ec6
--- /dev/null
+++ b/support/highlight/src/gui-qt/showtextfile.h
@@ -0,0 +1,54 @@
+/***************************************************************************
+ showtextfile.h
+ -------------------
+ begin : Mo 16.03.2009
+ copyright : (C) 2009 by Andre Simon
+ email : andre.simon1@gmx.de
+ ***************************************************************************/
+
+/*
+This file is part of Highlight.
+
+Highlight is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Highlight is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Highlight. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef SHOWTEXTFILE_H
+#define SHOWTEXTFILE_H
+
+#include <QtGui/QDialog>
+
+
+namespace Ui {
+ class ShowTextFile;
+}
+
+class ShowTextFile : public QDialog {
+ Q_OBJECT
+ Q_DISABLE_COPY(ShowTextFile)
+public:
+ explicit ShowTextFile(QWidget *parent = 0);
+ virtual ~ShowTextFile();
+ bool setFileName(const QString& fileName);
+
+protected:
+ virtual void changeEvent(QEvent *e);
+
+private:
+ Ui::ShowTextFile *m_ui;
+
+private slots:
+ void on_pushButton_clicked();
+};
+
+#endif // SHOWTEXTFILE_H
diff --git a/support/highlight/src/gui-qt/showtextfile.ui b/support/highlight/src/gui-qt/showtextfile.ui
new file mode 100644
index 0000000000..095ff23729
--- /dev/null
+++ b/support/highlight/src/gui-qt/showtextfile.ui
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>ShowTextFile</class>
+ <widget class="QDialog" name="ShowTextFile">
+ <property name="windowModality">
+ <enum>Qt::WindowModal</enum>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>711</width>
+ <height>442</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Show text</string>
+ </property>
+ <property name="windowIcon">
+ <iconset resource="highlight-gui.qrc">
+ <normaloff>:/hl_icon2.png</normaloff>:/hl_icon2.png</iconset>
+ </property>
+ <property name="modal">
+ <bool>true</bool>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QLabel" name="lbTitle">
+ <property name="font">
+ <font>
+ <pointsize>10</pointsize>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>TextLabel</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QTextEdit" name="textEdit">
+ <property name="font">
+ <font>
+ <family>Courier New</family>
+ <pointsize>8</pointsize>
+ </font>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButton">
+ <property name="text">
+ <string>OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <resources>
+ <include location="highlight-gui.qrc"/>
+ </resources>
+ <connections/>
+</ui>
diff --git a/support/highlight/src/gui-qt/ui_io_report.h b/support/highlight/src/gui-qt/ui_io_report.h
new file mode 100644
index 0000000000..e9eaad349e
--- /dev/null
+++ b/support/highlight/src/gui-qt/ui_io_report.h
@@ -0,0 +1,134 @@
+/********************************************************************************
+** Form generated from reading UI file 'io_report.ui'
+**
+** Created: Wed Mar 31 16:43:25 2010
+** by: Qt User Interface Compiler version 4.6.2
+**
+** WARNING! All changes made in this file will be lost when recompiling UI file!
+********************************************************************************/
+
+#ifndef UI_IO_REPORT_H
+#define UI_IO_REPORT_H
+
+#include <QtCore/QVariant>
+#include <QtGui/QAction>
+#include <QtGui/QApplication>
+#include <QtGui/QButtonGroup>
+#include <QtGui/QCheckBox>
+#include <QtGui/QDialog>
+#include <QtGui/QDialogButtonBox>
+#include <QtGui/QFrame>
+#include <QtGui/QHeaderView>
+#include <QtGui/QLabel>
+#include <QtGui/QListWidget>
+#include <QtGui/QVBoxLayout>
+
+QT_BEGIN_NAMESPACE
+
+class Ui_io_report
+{
+public:
+ QVBoxLayout *verticalLayout;
+ QLabel *label_2;
+ QListWidget *listInputErrors;
+ QCheckBox *cbRemoveFiles;
+ QFrame *line;
+ QLabel *label;
+ QListWidget *listOutputErrors;
+ QFrame *line_2;
+ QLabel *label_3;
+ QListWidget *listReformatErrors;
+ QDialogButtonBox *buttonBox;
+
+ void setupUi(QDialog *io_report)
+ {
+ if (io_report->objectName().isEmpty())
+ io_report->setObjectName(QString::fromUtf8("io_report"));
+ io_report->resize(436, 372);
+ QIcon icon;
+ icon.addFile(QString::fromUtf8(":/hl_icon2.png"), QSize(), QIcon::Normal, QIcon::Off);
+ io_report->setWindowIcon(icon);
+ verticalLayout = new QVBoxLayout(io_report);
+ verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
+ label_2 = new QLabel(io_report);
+ label_2->setObjectName(QString::fromUtf8("label_2"));
+
+ verticalLayout->addWidget(label_2);
+
+ listInputErrors = new QListWidget(io_report);
+ listInputErrors->setObjectName(QString::fromUtf8("listInputErrors"));
+
+ verticalLayout->addWidget(listInputErrors);
+
+ cbRemoveFiles = new QCheckBox(io_report);
+ cbRemoveFiles->setObjectName(QString::fromUtf8("cbRemoveFiles"));
+
+ verticalLayout->addWidget(cbRemoveFiles);
+
+ line = new QFrame(io_report);
+ line->setObjectName(QString::fromUtf8("line"));
+ line->setFrameShape(QFrame::HLine);
+ line->setFrameShadow(QFrame::Sunken);
+
+ verticalLayout->addWidget(line);
+
+ label = new QLabel(io_report);
+ label->setObjectName(QString::fromUtf8("label"));
+
+ verticalLayout->addWidget(label);
+
+ listOutputErrors = new QListWidget(io_report);
+ listOutputErrors->setObjectName(QString::fromUtf8("listOutputErrors"));
+
+ verticalLayout->addWidget(listOutputErrors);
+
+ line_2 = new QFrame(io_report);
+ line_2->setObjectName(QString::fromUtf8("line_2"));
+ line_2->setFrameShape(QFrame::HLine);
+ line_2->setFrameShadow(QFrame::Sunken);
+
+ verticalLayout->addWidget(line_2);
+
+ label_3 = new QLabel(io_report);
+ label_3->setObjectName(QString::fromUtf8("label_3"));
+
+ verticalLayout->addWidget(label_3);
+
+ listReformatErrors = new QListWidget(io_report);
+ listReformatErrors->setObjectName(QString::fromUtf8("listReformatErrors"));
+
+ verticalLayout->addWidget(listReformatErrors);
+
+ buttonBox = new QDialogButtonBox(io_report);
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
+ buttonBox->setOrientation(Qt::Horizontal);
+ buttonBox->setStandardButtons(QDialogButtonBox::Ok);
+
+ verticalLayout->addWidget(buttonBox);
+
+
+ retranslateUi(io_report);
+ QObject::connect(buttonBox, SIGNAL(accepted()), io_report, SLOT(accept()));
+ QObject::connect(buttonBox, SIGNAL(rejected()), io_report, SLOT(reject()));
+
+ QMetaObject::connectSlotsByName(io_report);
+ } // setupUi
+
+ void retranslateUi(QDialog *io_report)
+ {
+ io_report->setWindowTitle(QApplication::translate("io_report", "Error summary", 0, QApplication::UnicodeUTF8));
+ label_2->setText(QApplication::translate("io_report", "Input errors:", 0, QApplication::UnicodeUTF8));
+ cbRemoveFiles->setText(QApplication::translate("io_report", "Remove files above from input file list", 0, QApplication::UnicodeUTF8));
+ label->setText(QApplication::translate("io_report", "Output errors:", 0, QApplication::UnicodeUTF8));
+ label_3->setText(QApplication::translate("io_report", "Reformatting not possible:", 0, QApplication::UnicodeUTF8));
+ } // retranslateUi
+
+};
+
+namespace Ui {
+ class io_report: public Ui_io_report {};
+} // namespace Ui
+
+QT_END_NAMESPACE
+
+#endif // UI_IO_REPORT_H
diff --git a/support/highlight/src/gui-qt/ui_mainwindow.h b/support/highlight/src/gui-qt/ui_mainwindow.h
new file mode 100644
index 0000000000..ca73d3b551
--- /dev/null
+++ b/support/highlight/src/gui-qt/ui_mainwindow.h
@@ -0,0 +1,1860 @@
+/********************************************************************************
+** Form generated from reading UI file 'mainwindow.ui'
+**
+** Created: Wed Mar 31 16:43:25 2010
+** by: Qt User Interface Compiler version 4.6.2
+**
+** WARNING! All changes made in this file will be lost when recompiling UI file!
+********************************************************************************/
+
+#ifndef UI_MAINWINDOW_H
+#define UI_MAINWINDOW_H
+
+#include <QtCore/QVariant>
+#include <QtGui/QAction>
+#include <QtGui/QApplication>
+#include <QtGui/QButtonGroup>
+#include <QtGui/QCheckBox>
+#include <QtGui/QComboBox>
+#include <QtGui/QFontComboBox>
+#include <QtGui/QFrame>
+#include <QtGui/QGridLayout>
+#include <QtGui/QHBoxLayout>
+#include <QtGui/QHeaderView>
+#include <QtGui/QLabel>
+#include <QtGui/QLineEdit>
+#include <QtGui/QListWidget>
+#include <QtGui/QMainWindow>
+#include <QtGui/QMenu>
+#include <QtGui/QMenuBar>
+#include <QtGui/QProgressBar>
+#include <QtGui/QPushButton>
+#include <QtGui/QSpacerItem>
+#include <QtGui/QSpinBox>
+#include <QtGui/QStackedWidget>
+#include <QtGui/QStatusBar>
+#include <QtGui/QTabWidget>
+#include <QtGui/QTextBrowser>
+#include <QtGui/QVBoxLayout>
+#include <QtGui/QWidget>
+
+QT_BEGIN_NAMESPACE
+
+class Ui_MainWindowClass
+{
+public:
+ QAction *action_Open_files;
+ QAction *action_Exit;
+ QAction *action_Load;
+ QAction *action_Save;
+ QAction *actionLoad_default_project;
+ QAction *action_Manual;
+ QAction *action_Tips;
+ QAction *action_Changelog;
+ QAction *action_License;
+ QAction *action_About_Highlight;
+ QAction *actionAbout_translations;
+ QWidget *centralWidget;
+ QHBoxLayout *horizontalLayout_24;
+ QVBoxLayout *verticalLayout_7;
+ QTabWidget *tabIOSelection;
+ QWidget *tab_file_io;
+ QVBoxLayout *verticalLayout_3;
+ QPushButton *pbOpenFiles;
+ QListWidget *lvInputFiles;
+ QHBoxLayout *horizontalLayout;
+ QPushButton *pbClearSelection;
+ QPushButton *pbClearAll;
+ QFrame *line_11;
+ QVBoxLayout *verticalLayout;
+ QLabel *label_11;
+ QHBoxLayout *horizontalLayout_22;
+ QLineEdit *leOutputDest;
+ QPushButton *pbOutputDest;
+ QCheckBox *cbWrite2Src;
+ QFrame *line_2;
+ QPushButton *pbStartConversion;
+ QPushButton *pbCopyFile2CP;
+ QWidget *tab_clipboard;
+ QVBoxLayout *verticalLayout_15;
+ QPushButton *pbPasteFromCB;
+ QHBoxLayout *horizontalLayout_23;
+ QLabel *label_13;
+ QComboBox *comboSelectSyntax;
+ QFrame *line_14;
+ QPushButton *pbCopyToCP;
+ QSpacerItem *verticalSpacer_12;
+ QFrame *line_7;
+ QTabWidget *tabWidget;
+ QWidget *page_general;
+ QVBoxLayout *verticalLayout_2;
+ QHBoxLayout *horizontalLayout_8;
+ QLabel *label_2;
+ QComboBox *comboFormat;
+ QFrame *line_9;
+ QHBoxLayout *horizontalLayout_21;
+ QCheckBox *cbIncLineNo;
+ QSpacerItem *horizontalSpacer_4;
+ QSpinBox *sbLineNoWidth;
+ QCheckBox *cbPadZeroes;
+ QCheckBox *cbFragment;
+ QCheckBox *cbValidateInput;
+ QHBoxLayout *horizontalLayout_2;
+ QCheckBox *cbEncoding;
+ QComboBox *comboEncoding;
+ QSpacerItem *verticalSpacer_2;
+ QWidget *page_output_spec;
+ QGridLayout *gridLayout;
+ QStackedWidget *stackedSpecificOptions;
+ QWidget *HTMLOptions;
+ QVBoxLayout *verticalLayout_5;
+ QLabel *label_17;
+ QFrame *line_12;
+ QTabWidget *tabWidget1;
+ QWidget *tabWidgetPage1;
+ QGridLayout *gridLayout_4;
+ QHBoxLayout *horizontalLayout_10;
+ QCheckBox *cbHTMLEmbedStyle;
+ QCheckBox *cbHTMLInlineCSS;
+ QHBoxLayout *horizontalLayout_14;
+ QLabel *label_19;
+ QLineEdit *leHTMLStyleFile;
+ QHBoxLayout *horizontalLayout_9;
+ QLabel *label_20;
+ QLineEdit *leHTMLStyleIncFile;
+ QPushButton *pbHTMLChooseStyleIncFile;
+ QHBoxLayout *horizontalLayout_7;
+ QLabel *label;
+ QLineEdit *leHTMLCssPrefix;
+ QSpacerItem *verticalSpacer_9;
+ QWidget *tabWidgetPage2;
+ QVBoxLayout *verticalLayout_6;
+ QCheckBox *cbHTMLIndex;
+ QFrame *line_13;
+ QCheckBox *cbHTMLCtags;
+ QHBoxLayout *horizontalLayout_12;
+ QLineEdit *leHTMLCtagsFile;
+ QPushButton *pbHTMLChooseTagsFile;
+ QSpacerItem *verticalSpacer_8;
+ QWidget *tabWidgetPage3;
+ QVBoxLayout *verticalLayout_4;
+ QLabel *label_8;
+ QCheckBox *cbHTMLAnchors;
+ QCheckBox *cbHTMLFileNameAnchor;
+ QCheckBox *cbHTMLOrderedList;
+ QFrame *line_4;
+ QCheckBox *cbHTMLEnclosePreTags;
+ QSpacerItem *verticalSpacer;
+ QWidget *LATEXOptions;
+ QVBoxLayout *verticalLayout_12;
+ QLabel *label_18;
+ QFrame *line_8;
+ QCheckBox *cbLATEXEscQuotes;
+ QCheckBox *cbLATEXBabel;
+ QCheckBox *cbLATEXPrettySymbols;
+ QCheckBox *cbLATEXEmbedStyle;
+ QHBoxLayout *horizontalLayout_17;
+ QLabel *label_21;
+ QLineEdit *leLATEXStyleFile;
+ QHBoxLayout *horizontalLayout_15;
+ QLabel *label_22;
+ QSpacerItem *horizontalSpacer_2;
+ QHBoxLayout *horizontalLayout_16;
+ QLineEdit *leLATEXStyleIncFile;
+ QPushButton *pbLATEXChooseStyleIncFile;
+ QSpacerItem *verticalSpacer_4;
+ QWidget *TEXOptions;
+ QVBoxLayout *verticalLayout_14;
+ QLabel *label_26;
+ QFrame *line_10;
+ QCheckBox *cbTEXEmbedStyle;
+ QHBoxLayout *horizontalLayout_18;
+ QLabel *label_24;
+ QLineEdit *leTEXStyleFile;
+ QHBoxLayout *horizontalLayout_19;
+ QLabel *label_25;
+ QSpacerItem *horizontalSpacer_3;
+ QHBoxLayout *horizontalLayout_20;
+ QLineEdit *leTEXStyleIncFile;
+ QPushButton *pbTEXChooseStyleIncFile;
+ QSpacerItem *verticalSpacer_5;
+ QWidget *RTFOptions;
+ QVBoxLayout *verticalLayout_9;
+ QLabel *label_15;
+ QFrame *line_5;
+ QCheckBox *cbRTFCharStyles;
+ QHBoxLayout *horizontalLayout_11;
+ QLabel *label_9;
+ QComboBox *comboRTFPageSize;
+ QSpacerItem *verticalSpacer_6;
+ QWidget *SVGOptions;
+ QVBoxLayout *verticalLayout_10;
+ QLabel *label_16;
+ QFrame *line_6;
+ QLabel *label_10;
+ QGridLayout *gridLayout_8;
+ QLabel *label_3;
+ QLineEdit *leSVGWidth;
+ QLabel *label_12;
+ QLineEdit *leSVGHeight;
+ QCheckBox *cbSVGEmbedStyle;
+ QHBoxLayout *horizontalLayout_26;
+ QLabel *label_29;
+ QLineEdit *leSVGStyleFile;
+ QHBoxLayout *horizontalLayout_27;
+ QLabel *label_30;
+ QSpacerItem *horizontalSpacer_6;
+ QHBoxLayout *horizontalLayout_28;
+ QLineEdit *leSVGStyleIncFile;
+ QPushButton *pbSVGChooseStyleIncFile;
+ QSpacerItem *verticalSpacer_10;
+ QWidget *EmptyPage;
+ QVBoxLayout *verticalLayout_11;
+ QLabel *label_7;
+ QSpacerItem *verticalSpacer_3;
+ QWidget *page_formatting;
+ QVBoxLayout *verticalLayout_8;
+ QHBoxLayout *horizontalLayout_3;
+ QLabel *label_5;
+ QComboBox *comboTheme;
+ QHBoxLayout *horizontalLayout_4;
+ QCheckBox *cbReformat;
+ QComboBox *comboReformat;
+ QHBoxLayout *horizontalLayout_5;
+ QCheckBox *cbKwCase;
+ QComboBox *comboKwCase;
+ QHBoxLayout *horizontalLayout_6;
+ QLabel *label_6;
+ QSpinBox *sbTabWidth;
+ QGridLayout *gridLayout_2;
+ QCheckBox *cbWrapping;
+ QSpinBox *sbLineLength;
+ QCheckBox *cbAdvWrapping;
+ QSpacerItem *verticalSpacer_11;
+ QFrame *line_3;
+ QGridLayout *gridLayout_9;
+ QLabel *label_23;
+ QFontComboBox *comboFontName;
+ QLabel *label_4;
+ QLineEdit *leFontSize;
+ QFrame *line;
+ QVBoxLayout *verticalLayout_13;
+ QLabel *lbPreview;
+ QTextBrowser *browserPreview;
+ QHBoxLayout *horizontalLayout_13;
+ QLabel *label_14;
+ QProgressBar *progressBar;
+ QMenuBar *menuBar;
+ QMenu *menu_File;
+ QMenu *menu_Help;
+ QStatusBar *statusBar;
+
+ void setupUi(QMainWindow *MainWindowClass)
+ {
+ if (MainWindowClass->objectName().isEmpty())
+ MainWindowClass->setObjectName(QString::fromUtf8("MainWindowClass"));
+ MainWindowClass->setWindowModality(Qt::ApplicationModal);
+ MainWindowClass->resize(600, 645);
+ MainWindowClass->setAcceptDrops(false);
+ QIcon icon;
+ icon.addFile(QString::fromUtf8(":/hl_icon2.png"), QSize(), QIcon::Normal, QIcon::Off);
+ MainWindowClass->setWindowIcon(icon);
+ action_Open_files = new QAction(MainWindowClass);
+ action_Open_files->setObjectName(QString::fromUtf8("action_Open_files"));
+ action_Exit = new QAction(MainWindowClass);
+ action_Exit->setObjectName(QString::fromUtf8("action_Exit"));
+ action_Load = new QAction(MainWindowClass);
+ action_Load->setObjectName(QString::fromUtf8("action_Load"));
+ action_Save = new QAction(MainWindowClass);
+ action_Save->setObjectName(QString::fromUtf8("action_Save"));
+ actionLoad_default_project = new QAction(MainWindowClass);
+ actionLoad_default_project->setObjectName(QString::fromUtf8("actionLoad_default_project"));
+ action_Manual = new QAction(MainWindowClass);
+ action_Manual->setObjectName(QString::fromUtf8("action_Manual"));
+ action_Tips = new QAction(MainWindowClass);
+ action_Tips->setObjectName(QString::fromUtf8("action_Tips"));
+ action_Tips->setVisible(false);
+ action_Changelog = new QAction(MainWindowClass);
+ action_Changelog->setObjectName(QString::fromUtf8("action_Changelog"));
+ action_License = new QAction(MainWindowClass);
+ action_License->setObjectName(QString::fromUtf8("action_License"));
+ action_About_Highlight = new QAction(MainWindowClass);
+ action_About_Highlight->setObjectName(QString::fromUtf8("action_About_Highlight"));
+ actionAbout_translations = new QAction(MainWindowClass);
+ actionAbout_translations->setObjectName(QString::fromUtf8("actionAbout_translations"));
+ centralWidget = new QWidget(MainWindowClass);
+ centralWidget->setObjectName(QString::fromUtf8("centralWidget"));
+ horizontalLayout_24 = new QHBoxLayout(centralWidget);
+ horizontalLayout_24->setSpacing(6);
+ horizontalLayout_24->setContentsMargins(11, 11, 11, 11);
+ horizontalLayout_24->setObjectName(QString::fromUtf8("horizontalLayout_24"));
+ verticalLayout_7 = new QVBoxLayout();
+ verticalLayout_7->setSpacing(6);
+ verticalLayout_7->setObjectName(QString::fromUtf8("verticalLayout_7"));
+ tabIOSelection = new QTabWidget(centralWidget);
+ tabIOSelection->setObjectName(QString::fromUtf8("tabIOSelection"));
+ QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
+ sizePolicy.setHorizontalStretch(0);
+ sizePolicy.setVerticalStretch(0);
+ sizePolicy.setHeightForWidth(tabIOSelection->sizePolicy().hasHeightForWidth());
+ tabIOSelection->setSizePolicy(sizePolicy);
+ tabIOSelection->setMinimumSize(QSize(0, 0));
+ tab_file_io = new QWidget();
+ tab_file_io->setObjectName(QString::fromUtf8("tab_file_io"));
+ verticalLayout_3 = new QVBoxLayout(tab_file_io);
+ verticalLayout_3->setSpacing(6);
+ verticalLayout_3->setContentsMargins(11, 11, 11, 11);
+ verticalLayout_3->setObjectName(QString::fromUtf8("verticalLayout_3"));
+ pbOpenFiles = new QPushButton(tab_file_io);
+ pbOpenFiles->setObjectName(QString::fromUtf8("pbOpenFiles"));
+
+ verticalLayout_3->addWidget(pbOpenFiles);
+
+ lvInputFiles = new QListWidget(tab_file_io);
+ lvInputFiles->setObjectName(QString::fromUtf8("lvInputFiles"));
+ QSizePolicy sizePolicy1(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
+ sizePolicy1.setHorizontalStretch(0);
+ sizePolicy1.setVerticalStretch(0);
+ sizePolicy1.setHeightForWidth(lvInputFiles->sizePolicy().hasHeightForWidth());
+ lvInputFiles->setSizePolicy(sizePolicy1);
+ lvInputFiles->setMinimumSize(QSize(0, 50));
+ lvInputFiles->setAcceptDrops(false);
+ lvInputFiles->setDragDropMode(QAbstractItemView::DropOnly);
+ lvInputFiles->setAlternatingRowColors(true);
+ lvInputFiles->setSelectionMode(QAbstractItemView::ExtendedSelection);
+ lvInputFiles->setSelectionBehavior(QAbstractItemView::SelectRows);
+
+ verticalLayout_3->addWidget(lvInputFiles);
+
+ horizontalLayout = new QHBoxLayout();
+ horizontalLayout->setSpacing(6);
+ horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
+ pbClearSelection = new QPushButton(tab_file_io);
+ pbClearSelection->setObjectName(QString::fromUtf8("pbClearSelection"));
+
+ horizontalLayout->addWidget(pbClearSelection);
+
+ pbClearAll = new QPushButton(tab_file_io);
+ pbClearAll->setObjectName(QString::fromUtf8("pbClearAll"));
+
+ horizontalLayout->addWidget(pbClearAll);
+
+
+ verticalLayout_3->addLayout(horizontalLayout);
+
+ line_11 = new QFrame(tab_file_io);
+ line_11->setObjectName(QString::fromUtf8("line_11"));
+ line_11->setFrameShape(QFrame::HLine);
+ line_11->setFrameShadow(QFrame::Sunken);
+
+ verticalLayout_3->addWidget(line_11);
+
+ verticalLayout = new QVBoxLayout();
+ verticalLayout->setSpacing(6);
+ verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
+ label_11 = new QLabel(tab_file_io);
+ label_11->setObjectName(QString::fromUtf8("label_11"));
+ QFont font;
+ font.setBold(true);
+ font.setWeight(75);
+ label_11->setFont(font);
+
+ verticalLayout->addWidget(label_11);
+
+ horizontalLayout_22 = new QHBoxLayout();
+ horizontalLayout_22->setSpacing(6);
+ horizontalLayout_22->setObjectName(QString::fromUtf8("horizontalLayout_22"));
+ leOutputDest = new QLineEdit(tab_file_io);
+ leOutputDest->setObjectName(QString::fromUtf8("leOutputDest"));
+ QSizePolicy sizePolicy2(QSizePolicy::Minimum, QSizePolicy::Preferred);
+ sizePolicy2.setHorizontalStretch(0);
+ sizePolicy2.setVerticalStretch(0);
+ sizePolicy2.setHeightForWidth(leOutputDest->sizePolicy().hasHeightForWidth());
+ leOutputDest->setSizePolicy(sizePolicy2);
+
+ horizontalLayout_22->addWidget(leOutputDest);
+
+ pbOutputDest = new QPushButton(tab_file_io);
+ pbOutputDest->setObjectName(QString::fromUtf8("pbOutputDest"));
+ QSizePolicy sizePolicy3(QSizePolicy::Fixed, QSizePolicy::Fixed);
+ sizePolicy3.setHorizontalStretch(0);
+ sizePolicy3.setVerticalStretch(0);
+ sizePolicy3.setHeightForWidth(pbOutputDest->sizePolicy().hasHeightForWidth());
+ pbOutputDest->setSizePolicy(sizePolicy3);
+ pbOutputDest->setMinimumSize(QSize(20, 0));
+
+ horizontalLayout_22->addWidget(pbOutputDest);
+
+
+ verticalLayout->addLayout(horizontalLayout_22);
+
+ cbWrite2Src = new QCheckBox(tab_file_io);
+ cbWrite2Src->setObjectName(QString::fromUtf8("cbWrite2Src"));
+
+ verticalLayout->addWidget(cbWrite2Src);
+
+
+ verticalLayout_3->addLayout(verticalLayout);
+
+ line_2 = new QFrame(tab_file_io);
+ line_2->setObjectName(QString::fromUtf8("line_2"));
+ line_2->setFrameShape(QFrame::HLine);
+ line_2->setFrameShadow(QFrame::Sunken);
+
+ verticalLayout_3->addWidget(line_2);
+
+ pbStartConversion = new QPushButton(tab_file_io);
+ pbStartConversion->setObjectName(QString::fromUtf8("pbStartConversion"));
+ QSizePolicy sizePolicy4(QSizePolicy::Preferred, QSizePolicy::Fixed);
+ sizePolicy4.setHorizontalStretch(0);
+ sizePolicy4.setVerticalStretch(0);
+ sizePolicy4.setHeightForWidth(pbStartConversion->sizePolicy().hasHeightForWidth());
+ pbStartConversion->setSizePolicy(sizePolicy4);
+ pbStartConversion->setMinimumSize(QSize(120, 0));
+ QFont font1;
+ font1.setFamily(QString::fromUtf8("MS Shell Dlg 2"));
+ font1.setPointSize(10);
+ font1.setBold(true);
+ font1.setWeight(75);
+ pbStartConversion->setFont(font1);
+ pbStartConversion->setDefault(true);
+
+ verticalLayout_3->addWidget(pbStartConversion);
+
+ pbCopyFile2CP = new QPushButton(tab_file_io);
+ pbCopyFile2CP->setObjectName(QString::fromUtf8("pbCopyFile2CP"));
+
+ verticalLayout_3->addWidget(pbCopyFile2CP);
+
+ tabIOSelection->addTab(tab_file_io, QString());
+ tab_clipboard = new QWidget();
+ tab_clipboard->setObjectName(QString::fromUtf8("tab_clipboard"));
+ verticalLayout_15 = new QVBoxLayout(tab_clipboard);
+ verticalLayout_15->setSpacing(6);
+ verticalLayout_15->setContentsMargins(11, 11, 11, 11);
+ verticalLayout_15->setObjectName(QString::fromUtf8("verticalLayout_15"));
+ pbPasteFromCB = new QPushButton(tab_clipboard);
+ pbPasteFromCB->setObjectName(QString::fromUtf8("pbPasteFromCB"));
+
+ verticalLayout_15->addWidget(pbPasteFromCB);
+
+ horizontalLayout_23 = new QHBoxLayout();
+ horizontalLayout_23->setSpacing(6);
+ horizontalLayout_23->setObjectName(QString::fromUtf8("horizontalLayout_23"));
+ label_13 = new QLabel(tab_clipboard);
+ label_13->setObjectName(QString::fromUtf8("label_13"));
+
+ horizontalLayout_23->addWidget(label_13);
+
+ comboSelectSyntax = new QComboBox(tab_clipboard);
+ comboSelectSyntax->setObjectName(QString::fromUtf8("comboSelectSyntax"));
+
+ horizontalLayout_23->addWidget(comboSelectSyntax);
+
+
+ verticalLayout_15->addLayout(horizontalLayout_23);
+
+ line_14 = new QFrame(tab_clipboard);
+ line_14->setObjectName(QString::fromUtf8("line_14"));
+ line_14->setFrameShape(QFrame::HLine);
+ line_14->setFrameShadow(QFrame::Sunken);
+
+ verticalLayout_15->addWidget(line_14);
+
+ pbCopyToCP = new QPushButton(tab_clipboard);
+ pbCopyToCP->setObjectName(QString::fromUtf8("pbCopyToCP"));
+ pbCopyToCP->setFont(font);
+
+ verticalLayout_15->addWidget(pbCopyToCP);
+
+ verticalSpacer_12 = new QSpacerItem(20, 106, QSizePolicy::Minimum, QSizePolicy::Expanding);
+
+ verticalLayout_15->addItem(verticalSpacer_12);
+
+ tabIOSelection->addTab(tab_clipboard, QString());
+
+ verticalLayout_7->addWidget(tabIOSelection);
+
+ line_7 = new QFrame(centralWidget);
+ line_7->setObjectName(QString::fromUtf8("line_7"));
+ line_7->setFrameShape(QFrame::HLine);
+ line_7->setFrameShadow(QFrame::Sunken);
+
+ verticalLayout_7->addWidget(line_7);
+
+ tabWidget = new QTabWidget(centralWidget);
+ tabWidget->setObjectName(QString::fromUtf8("tabWidget"));
+ QSizePolicy sizePolicy5(QSizePolicy::Preferred, QSizePolicy::Minimum);
+ sizePolicy5.setHorizontalStretch(0);
+ sizePolicy5.setVerticalStretch(0);
+ sizePolicy5.setHeightForWidth(tabWidget->sizePolicy().hasHeightForWidth());
+ tabWidget->setSizePolicy(sizePolicy5);
+ tabWidget->setMinimumSize(QSize(0, 0));
+ tabWidget->setLayoutDirection(Qt::LeftToRight);
+ tabWidget->setTabPosition(QTabWidget::North);
+ tabWidget->setTabShape(QTabWidget::Rounded);
+ page_general = new QWidget();
+ page_general->setObjectName(QString::fromUtf8("page_general"));
+ verticalLayout_2 = new QVBoxLayout(page_general);
+ verticalLayout_2->setSpacing(6);
+ verticalLayout_2->setContentsMargins(11, 11, 11, 11);
+ verticalLayout_2->setObjectName(QString::fromUtf8("verticalLayout_2"));
+ horizontalLayout_8 = new QHBoxLayout();
+ horizontalLayout_8->setSpacing(6);
+ horizontalLayout_8->setObjectName(QString::fromUtf8("horizontalLayout_8"));
+ label_2 = new QLabel(page_general);
+ label_2->setObjectName(QString::fromUtf8("label_2"));
+ QSizePolicy sizePolicy6(QSizePolicy::Minimum, QSizePolicy::Minimum);
+ sizePolicy6.setHorizontalStretch(0);
+ sizePolicy6.setVerticalStretch(0);
+ sizePolicy6.setHeightForWidth(label_2->sizePolicy().hasHeightForWidth());
+ label_2->setSizePolicy(sizePolicy6);
+ label_2->setFont(font);
+
+ horizontalLayout_8->addWidget(label_2);
+
+ comboFormat = new QComboBox(page_general);
+ comboFormat->setObjectName(QString::fromUtf8("comboFormat"));
+ sizePolicy4.setHeightForWidth(comboFormat->sizePolicy().hasHeightForWidth());
+ comboFormat->setSizePolicy(sizePolicy4);
+ comboFormat->setFont(font);
+
+ horizontalLayout_8->addWidget(comboFormat);
+
+
+ verticalLayout_2->addLayout(horizontalLayout_8);
+
+ line_9 = new QFrame(page_general);
+ line_9->setObjectName(QString::fromUtf8("line_9"));
+ line_9->setFrameShape(QFrame::HLine);
+ line_9->setFrameShadow(QFrame::Sunken);
+
+ verticalLayout_2->addWidget(line_9);
+
+ horizontalLayout_21 = new QHBoxLayout();
+ horizontalLayout_21->setSpacing(6);
+ horizontalLayout_21->setObjectName(QString::fromUtf8("horizontalLayout_21"));
+ cbIncLineNo = new QCheckBox(page_general);
+ cbIncLineNo->setObjectName(QString::fromUtf8("cbIncLineNo"));
+
+ horizontalLayout_21->addWidget(cbIncLineNo);
+
+ horizontalSpacer_4 = new QSpacerItem(10, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
+
+ horizontalLayout_21->addItem(horizontalSpacer_4);
+
+ sbLineNoWidth = new QSpinBox(page_general);
+ sbLineNoWidth->setObjectName(QString::fromUtf8("sbLineNoWidth"));
+ sbLineNoWidth->setMinimum(1);
+ sbLineNoWidth->setMaximum(6);
+ sbLineNoWidth->setValue(2);
+
+ horizontalLayout_21->addWidget(sbLineNoWidth);
+
+
+ verticalLayout_2->addLayout(horizontalLayout_21);
+
+ cbPadZeroes = new QCheckBox(page_general);
+ cbPadZeroes->setObjectName(QString::fromUtf8("cbPadZeroes"));
+ cbPadZeroes->setEnabled(false);
+
+ verticalLayout_2->addWidget(cbPadZeroes);
+
+ cbFragment = new QCheckBox(page_general);
+ cbFragment->setObjectName(QString::fromUtf8("cbFragment"));
+ QSizePolicy sizePolicy7(QSizePolicy::Minimum, QSizePolicy::Fixed);
+ sizePolicy7.setHorizontalStretch(0);
+ sizePolicy7.setVerticalStretch(0);
+ sizePolicy7.setHeightForWidth(cbFragment->sizePolicy().hasHeightForWidth());
+ cbFragment->setSizePolicy(sizePolicy7);
+
+ verticalLayout_2->addWidget(cbFragment);
+
+ cbValidateInput = new QCheckBox(page_general);
+ cbValidateInput->setObjectName(QString::fromUtf8("cbValidateInput"));
+
+ verticalLayout_2->addWidget(cbValidateInput);
+
+ horizontalLayout_2 = new QHBoxLayout();
+ horizontalLayout_2->setSpacing(6);
+ horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2"));
+ cbEncoding = new QCheckBox(page_general);
+ cbEncoding->setObjectName(QString::fromUtf8("cbEncoding"));
+
+ horizontalLayout_2->addWidget(cbEncoding);
+
+ comboEncoding = new QComboBox(page_general);
+ comboEncoding->setObjectName(QString::fromUtf8("comboEncoding"));
+ comboEncoding->setEditable(true);
+ comboEncoding->setInsertPolicy(QComboBox::InsertAtBottom);
+
+ horizontalLayout_2->addWidget(comboEncoding);
+
+
+ verticalLayout_2->addLayout(horizontalLayout_2);
+
+ verticalSpacer_2 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
+
+ verticalLayout_2->addItem(verticalSpacer_2);
+
+ tabWidget->addTab(page_general, QString());
+ page_output_spec = new QWidget();
+ page_output_spec->setObjectName(QString::fromUtf8("page_output_spec"));
+ gridLayout = new QGridLayout(page_output_spec);
+ gridLayout->setSpacing(6);
+ gridLayout->setContentsMargins(11, 11, 11, 11);
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
+ stackedSpecificOptions = new QStackedWidget(page_output_spec);
+ stackedSpecificOptions->setObjectName(QString::fromUtf8("stackedSpecificOptions"));
+ QSizePolicy sizePolicy8(QSizePolicy::Preferred, QSizePolicy::Ignored);
+ sizePolicy8.setHorizontalStretch(0);
+ sizePolicy8.setVerticalStretch(0);
+ sizePolicy8.setHeightForWidth(stackedSpecificOptions->sizePolicy().hasHeightForWidth());
+ stackedSpecificOptions->setSizePolicy(sizePolicy8);
+ stackedSpecificOptions->setMinimumSize(QSize(0, 0));
+ HTMLOptions = new QWidget();
+ HTMLOptions->setObjectName(QString::fromUtf8("HTMLOptions"));
+ verticalLayout_5 = new QVBoxLayout(HTMLOptions);
+ verticalLayout_5->setSpacing(6);
+ verticalLayout_5->setContentsMargins(11, 11, 11, 11);
+ verticalLayout_5->setObjectName(QString::fromUtf8("verticalLayout_5"));
+ label_17 = new QLabel(HTMLOptions);
+ label_17->setObjectName(QString::fromUtf8("label_17"));
+ sizePolicy4.setHeightForWidth(label_17->sizePolicy().hasHeightForWidth());
+ label_17->setSizePolicy(sizePolicy4);
+ label_17->setFont(font);
+
+ verticalLayout_5->addWidget(label_17);
+
+ line_12 = new QFrame(HTMLOptions);
+ line_12->setObjectName(QString::fromUtf8("line_12"));
+ line_12->setFrameShape(QFrame::HLine);
+ line_12->setFrameShadow(QFrame::Sunken);
+
+ verticalLayout_5->addWidget(line_12);
+
+ tabWidget1 = new QTabWidget(HTMLOptions);
+ tabWidget1->setObjectName(QString::fromUtf8("tabWidget1"));
+ sizePolicy6.setHeightForWidth(tabWidget1->sizePolicy().hasHeightForWidth());
+ tabWidget1->setSizePolicy(sizePolicy6);
+ tabWidget1->setMinimumSize(QSize(250, 0));
+ tabWidgetPage1 = new QWidget();
+ tabWidgetPage1->setObjectName(QString::fromUtf8("tabWidgetPage1"));
+ gridLayout_4 = new QGridLayout(tabWidgetPage1);
+ gridLayout_4->setSpacing(6);
+ gridLayout_4->setContentsMargins(11, 11, 11, 11);
+ gridLayout_4->setObjectName(QString::fromUtf8("gridLayout_4"));
+ horizontalLayout_10 = new QHBoxLayout();
+ horizontalLayout_10->setSpacing(6);
+ horizontalLayout_10->setObjectName(QString::fromUtf8("horizontalLayout_10"));
+ cbHTMLEmbedStyle = new QCheckBox(tabWidgetPage1);
+ cbHTMLEmbedStyle->setObjectName(QString::fromUtf8("cbHTMLEmbedStyle"));
+
+ horizontalLayout_10->addWidget(cbHTMLEmbedStyle);
+
+ cbHTMLInlineCSS = new QCheckBox(tabWidgetPage1);
+ cbHTMLInlineCSS->setObjectName(QString::fromUtf8("cbHTMLInlineCSS"));
+ cbHTMLInlineCSS->setEnabled(false);
+ cbHTMLInlineCSS->setCheckable(true);
+
+ horizontalLayout_10->addWidget(cbHTMLInlineCSS);
+
+
+ gridLayout_4->addLayout(horizontalLayout_10, 0, 0, 1, 1);
+
+ horizontalLayout_14 = new QHBoxLayout();
+ horizontalLayout_14->setSpacing(6);
+ horizontalLayout_14->setObjectName(QString::fromUtf8("horizontalLayout_14"));
+ label_19 = new QLabel(tabWidgetPage1);
+ label_19->setObjectName(QString::fromUtf8("label_19"));
+
+ horizontalLayout_14->addWidget(label_19);
+
+ leHTMLStyleFile = new QLineEdit(tabWidgetPage1);
+ leHTMLStyleFile->setObjectName(QString::fromUtf8("leHTMLStyleFile"));
+ sizePolicy4.setHeightForWidth(leHTMLStyleFile->sizePolicy().hasHeightForWidth());
+ leHTMLStyleFile->setSizePolicy(sizePolicy4);
+
+ horizontalLayout_14->addWidget(leHTMLStyleFile);
+
+
+ gridLayout_4->addLayout(horizontalLayout_14, 1, 0, 1, 1);
+
+ horizontalLayout_9 = new QHBoxLayout();
+ horizontalLayout_9->setSpacing(6);
+ horizontalLayout_9->setObjectName(QString::fromUtf8("horizontalLayout_9"));
+ label_20 = new QLabel(tabWidgetPage1);
+ label_20->setObjectName(QString::fromUtf8("label_20"));
+
+ horizontalLayout_9->addWidget(label_20);
+
+ leHTMLStyleIncFile = new QLineEdit(tabWidgetPage1);
+ leHTMLStyleIncFile->setObjectName(QString::fromUtf8("leHTMLStyleIncFile"));
+
+ horizontalLayout_9->addWidget(leHTMLStyleIncFile);
+
+ pbHTMLChooseStyleIncFile = new QPushButton(tabWidgetPage1);
+ pbHTMLChooseStyleIncFile->setObjectName(QString::fromUtf8("pbHTMLChooseStyleIncFile"));
+
+ horizontalLayout_9->addWidget(pbHTMLChooseStyleIncFile);
+
+
+ gridLayout_4->addLayout(horizontalLayout_9, 2, 0, 1, 1);
+
+ horizontalLayout_7 = new QHBoxLayout();
+ horizontalLayout_7->setSpacing(6);
+ horizontalLayout_7->setObjectName(QString::fromUtf8("horizontalLayout_7"));
+ label = new QLabel(tabWidgetPage1);
+ label->setObjectName(QString::fromUtf8("label"));
+
+ horizontalLayout_7->addWidget(label);
+
+ leHTMLCssPrefix = new QLineEdit(tabWidgetPage1);
+ leHTMLCssPrefix->setObjectName(QString::fromUtf8("leHTMLCssPrefix"));
+
+ horizontalLayout_7->addWidget(leHTMLCssPrefix);
+
+
+ gridLayout_4->addLayout(horizontalLayout_7, 3, 0, 1, 1);
+
+ verticalSpacer_9 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding);
+
+ gridLayout_4->addItem(verticalSpacer_9, 4, 0, 1, 1);
+
+ tabWidget1->addTab(tabWidgetPage1, QString());
+ tabWidgetPage2 = new QWidget();
+ tabWidgetPage2->setObjectName(QString::fromUtf8("tabWidgetPage2"));
+ verticalLayout_6 = new QVBoxLayout(tabWidgetPage2);
+ verticalLayout_6->setSpacing(6);
+ verticalLayout_6->setContentsMargins(11, 11, 11, 11);
+ verticalLayout_6->setObjectName(QString::fromUtf8("verticalLayout_6"));
+ cbHTMLIndex = new QCheckBox(tabWidgetPage2);
+ cbHTMLIndex->setObjectName(QString::fromUtf8("cbHTMLIndex"));
+
+ verticalLayout_6->addWidget(cbHTMLIndex);
+
+ line_13 = new QFrame(tabWidgetPage2);
+ line_13->setObjectName(QString::fromUtf8("line_13"));
+ line_13->setFrameShape(QFrame::HLine);
+ line_13->setFrameShadow(QFrame::Sunken);
+
+ verticalLayout_6->addWidget(line_13);
+
+ cbHTMLCtags = new QCheckBox(tabWidgetPage2);
+ cbHTMLCtags->setObjectName(QString::fromUtf8("cbHTMLCtags"));
+ sizePolicy7.setHeightForWidth(cbHTMLCtags->sizePolicy().hasHeightForWidth());
+ cbHTMLCtags->setSizePolicy(sizePolicy7);
+
+ verticalLayout_6->addWidget(cbHTMLCtags);
+
+ horizontalLayout_12 = new QHBoxLayout();
+ horizontalLayout_12->setSpacing(6);
+ horizontalLayout_12->setObjectName(QString::fromUtf8("horizontalLayout_12"));
+ leHTMLCtagsFile = new QLineEdit(tabWidgetPage2);
+ leHTMLCtagsFile->setObjectName(QString::fromUtf8("leHTMLCtagsFile"));
+ QSizePolicy sizePolicy9(QSizePolicy::Expanding, QSizePolicy::Fixed);
+ sizePolicy9.setHorizontalStretch(0);
+ sizePolicy9.setVerticalStretch(0);
+ sizePolicy9.setHeightForWidth(leHTMLCtagsFile->sizePolicy().hasHeightForWidth());
+ leHTMLCtagsFile->setSizePolicy(sizePolicy9);
+
+ horizontalLayout_12->addWidget(leHTMLCtagsFile);
+
+ pbHTMLChooseTagsFile = new QPushButton(tabWidgetPage2);
+ pbHTMLChooseTagsFile->setObjectName(QString::fromUtf8("pbHTMLChooseTagsFile"));
+ sizePolicy3.setHeightForWidth(pbHTMLChooseTagsFile->sizePolicy().hasHeightForWidth());
+ pbHTMLChooseTagsFile->setSizePolicy(sizePolicy3);
+
+ horizontalLayout_12->addWidget(pbHTMLChooseTagsFile);
+
+
+ verticalLayout_6->addLayout(horizontalLayout_12);
+
+ verticalSpacer_8 = new QSpacerItem(20, 72, QSizePolicy::Minimum, QSizePolicy::Expanding);
+
+ verticalLayout_6->addItem(verticalSpacer_8);
+
+ tabWidget1->addTab(tabWidgetPage2, QString());
+ tabWidgetPage3 = new QWidget();
+ tabWidgetPage3->setObjectName(QString::fromUtf8("tabWidgetPage3"));
+ verticalLayout_4 = new QVBoxLayout(tabWidgetPage3);
+ verticalLayout_4->setSpacing(6);
+ verticalLayout_4->setContentsMargins(11, 11, 11, 11);
+ verticalLayout_4->setObjectName(QString::fromUtf8("verticalLayout_4"));
+ label_8 = new QLabel(tabWidgetPage3);
+ label_8->setObjectName(QString::fromUtf8("label_8"));
+ QFont font2;
+ font2.setBold(false);
+ font2.setWeight(50);
+ label_8->setFont(font2);
+
+ verticalLayout_4->addWidget(label_8);
+
+ cbHTMLAnchors = new QCheckBox(tabWidgetPage3);
+ cbHTMLAnchors->setObjectName(QString::fromUtf8("cbHTMLAnchors"));
+
+ verticalLayout_4->addWidget(cbHTMLAnchors);
+
+ cbHTMLFileNameAnchor = new QCheckBox(tabWidgetPage3);
+ cbHTMLFileNameAnchor->setObjectName(QString::fromUtf8("cbHTMLFileNameAnchor"));
+
+ verticalLayout_4->addWidget(cbHTMLFileNameAnchor);
+
+ cbHTMLOrderedList = new QCheckBox(tabWidgetPage3);
+ cbHTMLOrderedList->setObjectName(QString::fromUtf8("cbHTMLOrderedList"));
+
+ verticalLayout_4->addWidget(cbHTMLOrderedList);
+
+ line_4 = new QFrame(tabWidgetPage3);
+ line_4->setObjectName(QString::fromUtf8("line_4"));
+ line_4->setFrameShape(QFrame::HLine);
+ line_4->setFrameShadow(QFrame::Sunken);
+
+ verticalLayout_4->addWidget(line_4);
+
+ cbHTMLEnclosePreTags = new QCheckBox(tabWidgetPage3);
+ cbHTMLEnclosePreTags->setObjectName(QString::fromUtf8("cbHTMLEnclosePreTags"));
+
+ verticalLayout_4->addWidget(cbHTMLEnclosePreTags);
+
+ verticalSpacer = new QSpacerItem(20, 24, QSizePolicy::Minimum, QSizePolicy::Expanding);
+
+ verticalLayout_4->addItem(verticalSpacer);
+
+ tabWidget1->addTab(tabWidgetPage3, QString());
+
+ verticalLayout_5->addWidget(tabWidget1);
+
+ stackedSpecificOptions->addWidget(HTMLOptions);
+ LATEXOptions = new QWidget();
+ LATEXOptions->setObjectName(QString::fromUtf8("LATEXOptions"));
+ verticalLayout_12 = new QVBoxLayout(LATEXOptions);
+ verticalLayout_12->setSpacing(6);
+ verticalLayout_12->setContentsMargins(11, 11, 11, 11);
+ verticalLayout_12->setObjectName(QString::fromUtf8("verticalLayout_12"));
+ label_18 = new QLabel(LATEXOptions);
+ label_18->setObjectName(QString::fromUtf8("label_18"));
+ QSizePolicy sizePolicy10(QSizePolicy::Maximum, QSizePolicy::Preferred);
+ sizePolicy10.setHorizontalStretch(0);
+ sizePolicy10.setVerticalStretch(0);
+ sizePolicy10.setHeightForWidth(label_18->sizePolicy().hasHeightForWidth());
+ label_18->setSizePolicy(sizePolicy10);
+ label_18->setFont(font);
+
+ verticalLayout_12->addWidget(label_18);
+
+ line_8 = new QFrame(LATEXOptions);
+ line_8->setObjectName(QString::fromUtf8("line_8"));
+ line_8->setFrameShape(QFrame::HLine);
+ line_8->setFrameShadow(QFrame::Sunken);
+
+ verticalLayout_12->addWidget(line_8);
+
+ cbLATEXEscQuotes = new QCheckBox(LATEXOptions);
+ cbLATEXEscQuotes->setObjectName(QString::fromUtf8("cbLATEXEscQuotes"));
+
+ verticalLayout_12->addWidget(cbLATEXEscQuotes);
+
+ cbLATEXBabel = new QCheckBox(LATEXOptions);
+ cbLATEXBabel->setObjectName(QString::fromUtf8("cbLATEXBabel"));
+
+ verticalLayout_12->addWidget(cbLATEXBabel);
+
+ cbLATEXPrettySymbols = new QCheckBox(LATEXOptions);
+ cbLATEXPrettySymbols->setObjectName(QString::fromUtf8("cbLATEXPrettySymbols"));
+
+ verticalLayout_12->addWidget(cbLATEXPrettySymbols);
+
+ cbLATEXEmbedStyle = new QCheckBox(LATEXOptions);
+ cbLATEXEmbedStyle->setObjectName(QString::fromUtf8("cbLATEXEmbedStyle"));
+
+ verticalLayout_12->addWidget(cbLATEXEmbedStyle);
+
+ horizontalLayout_17 = new QHBoxLayout();
+ horizontalLayout_17->setSpacing(6);
+ horizontalLayout_17->setObjectName(QString::fromUtf8("horizontalLayout_17"));
+ label_21 = new QLabel(LATEXOptions);
+ label_21->setObjectName(QString::fromUtf8("label_21"));
+
+ horizontalLayout_17->addWidget(label_21);
+
+ leLATEXStyleFile = new QLineEdit(LATEXOptions);
+ leLATEXStyleFile->setObjectName(QString::fromUtf8("leLATEXStyleFile"));
+
+ horizontalLayout_17->addWidget(leLATEXStyleFile);
+
+
+ verticalLayout_12->addLayout(horizontalLayout_17);
+
+ horizontalLayout_15 = new QHBoxLayout();
+ horizontalLayout_15->setSpacing(6);
+ horizontalLayout_15->setObjectName(QString::fromUtf8("horizontalLayout_15"));
+ label_22 = new QLabel(LATEXOptions);
+ label_22->setObjectName(QString::fromUtf8("label_22"));
+
+ horizontalLayout_15->addWidget(label_22);
+
+ horizontalSpacer_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
+
+ horizontalLayout_15->addItem(horizontalSpacer_2);
+
+
+ verticalLayout_12->addLayout(horizontalLayout_15);
+
+ horizontalLayout_16 = new QHBoxLayout();
+ horizontalLayout_16->setSpacing(6);
+ horizontalLayout_16->setObjectName(QString::fromUtf8("horizontalLayout_16"));
+ leLATEXStyleIncFile = new QLineEdit(LATEXOptions);
+ leLATEXStyleIncFile->setObjectName(QString::fromUtf8("leLATEXStyleIncFile"));
+
+ horizontalLayout_16->addWidget(leLATEXStyleIncFile);
+
+ pbLATEXChooseStyleIncFile = new QPushButton(LATEXOptions);
+ pbLATEXChooseStyleIncFile->setObjectName(QString::fromUtf8("pbLATEXChooseStyleIncFile"));
+
+ horizontalLayout_16->addWidget(pbLATEXChooseStyleIncFile);
+
+
+ verticalLayout_12->addLayout(horizontalLayout_16);
+
+ verticalSpacer_4 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
+
+ verticalLayout_12->addItem(verticalSpacer_4);
+
+ stackedSpecificOptions->addWidget(LATEXOptions);
+ TEXOptions = new QWidget();
+ TEXOptions->setObjectName(QString::fromUtf8("TEXOptions"));
+ verticalLayout_14 = new QVBoxLayout(TEXOptions);
+ verticalLayout_14->setSpacing(6);
+ verticalLayout_14->setContentsMargins(11, 11, 11, 11);
+ verticalLayout_14->setObjectName(QString::fromUtf8("verticalLayout_14"));
+ label_26 = new QLabel(TEXOptions);
+ label_26->setObjectName(QString::fromUtf8("label_26"));
+ sizePolicy4.setHeightForWidth(label_26->sizePolicy().hasHeightForWidth());
+ label_26->setSizePolicy(sizePolicy4);
+ label_26->setFont(font);
+
+ verticalLayout_14->addWidget(label_26);
+
+ line_10 = new QFrame(TEXOptions);
+ line_10->setObjectName(QString::fromUtf8("line_10"));
+ line_10->setFrameShape(QFrame::HLine);
+ line_10->setFrameShadow(QFrame::Sunken);
+
+ verticalLayout_14->addWidget(line_10);
+
+ cbTEXEmbedStyle = new QCheckBox(TEXOptions);
+ cbTEXEmbedStyle->setObjectName(QString::fromUtf8("cbTEXEmbedStyle"));
+
+ verticalLayout_14->addWidget(cbTEXEmbedStyle);
+
+ horizontalLayout_18 = new QHBoxLayout();
+ horizontalLayout_18->setSpacing(6);
+ horizontalLayout_18->setObjectName(QString::fromUtf8("horizontalLayout_18"));
+ label_24 = new QLabel(TEXOptions);
+ label_24->setObjectName(QString::fromUtf8("label_24"));
+
+ horizontalLayout_18->addWidget(label_24);
+
+ leTEXStyleFile = new QLineEdit(TEXOptions);
+ leTEXStyleFile->setObjectName(QString::fromUtf8("leTEXStyleFile"));
+
+ horizontalLayout_18->addWidget(leTEXStyleFile);
+
+
+ verticalLayout_14->addLayout(horizontalLayout_18);
+
+ horizontalLayout_19 = new QHBoxLayout();
+ horizontalLayout_19->setSpacing(6);
+ horizontalLayout_19->setObjectName(QString::fromUtf8("horizontalLayout_19"));
+ label_25 = new QLabel(TEXOptions);
+ label_25->setObjectName(QString::fromUtf8("label_25"));
+
+ horizontalLayout_19->addWidget(label_25);
+
+ horizontalSpacer_3 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
+
+ horizontalLayout_19->addItem(horizontalSpacer_3);
+
+
+ verticalLayout_14->addLayout(horizontalLayout_19);
+
+ horizontalLayout_20 = new QHBoxLayout();
+ horizontalLayout_20->setSpacing(6);
+ horizontalLayout_20->setObjectName(QString::fromUtf8("horizontalLayout_20"));
+ leTEXStyleIncFile = new QLineEdit(TEXOptions);
+ leTEXStyleIncFile->setObjectName(QString::fromUtf8("leTEXStyleIncFile"));
+
+ horizontalLayout_20->addWidget(leTEXStyleIncFile);
+
+ pbTEXChooseStyleIncFile = new QPushButton(TEXOptions);
+ pbTEXChooseStyleIncFile->setObjectName(QString::fromUtf8("pbTEXChooseStyleIncFile"));
+
+ horizontalLayout_20->addWidget(pbTEXChooseStyleIncFile);
+
+
+ verticalLayout_14->addLayout(horizontalLayout_20);
+
+ verticalSpacer_5 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
+
+ verticalLayout_14->addItem(verticalSpacer_5);
+
+ stackedSpecificOptions->addWidget(TEXOptions);
+ RTFOptions = new QWidget();
+ RTFOptions->setObjectName(QString::fromUtf8("RTFOptions"));
+ verticalLayout_9 = new QVBoxLayout(RTFOptions);
+ verticalLayout_9->setSpacing(6);
+ verticalLayout_9->setContentsMargins(11, 11, 11, 11);
+ verticalLayout_9->setObjectName(QString::fromUtf8("verticalLayout_9"));
+ label_15 = new QLabel(RTFOptions);
+ label_15->setObjectName(QString::fromUtf8("label_15"));
+ sizePolicy4.setHeightForWidth(label_15->sizePolicy().hasHeightForWidth());
+ label_15->setSizePolicy(sizePolicy4);
+ label_15->setFont(font);
+
+ verticalLayout_9->addWidget(label_15);
+
+ line_5 = new QFrame(RTFOptions);
+ line_5->setObjectName(QString::fromUtf8("line_5"));
+ line_5->setFrameShape(QFrame::HLine);
+ line_5->setFrameShadow(QFrame::Sunken);
+
+ verticalLayout_9->addWidget(line_5);
+
+ cbRTFCharStyles = new QCheckBox(RTFOptions);
+ cbRTFCharStyles->setObjectName(QString::fromUtf8("cbRTFCharStyles"));
+
+ verticalLayout_9->addWidget(cbRTFCharStyles);
+
+ horizontalLayout_11 = new QHBoxLayout();
+ horizontalLayout_11->setSpacing(6);
+ horizontalLayout_11->setObjectName(QString::fromUtf8("horizontalLayout_11"));
+ label_9 = new QLabel(RTFOptions);
+ label_9->setObjectName(QString::fromUtf8("label_9"));
+
+ horizontalLayout_11->addWidget(label_9);
+
+ comboRTFPageSize = new QComboBox(RTFOptions);
+ comboRTFPageSize->setObjectName(QString::fromUtf8("comboRTFPageSize"));
+
+ horizontalLayout_11->addWidget(comboRTFPageSize);
+
+
+ verticalLayout_9->addLayout(horizontalLayout_11);
+
+ verticalSpacer_6 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
+
+ verticalLayout_9->addItem(verticalSpacer_6);
+
+ stackedSpecificOptions->addWidget(RTFOptions);
+ SVGOptions = new QWidget();
+ SVGOptions->setObjectName(QString::fromUtf8("SVGOptions"));
+ verticalLayout_10 = new QVBoxLayout(SVGOptions);
+ verticalLayout_10->setSpacing(6);
+ verticalLayout_10->setContentsMargins(11, 11, 11, 11);
+ verticalLayout_10->setObjectName(QString::fromUtf8("verticalLayout_10"));
+ label_16 = new QLabel(SVGOptions);
+ label_16->setObjectName(QString::fromUtf8("label_16"));
+ sizePolicy4.setHeightForWidth(label_16->sizePolicy().hasHeightForWidth());
+ label_16->setSizePolicy(sizePolicy4);
+ label_16->setFont(font);
+
+ verticalLayout_10->addWidget(label_16);
+
+ line_6 = new QFrame(SVGOptions);
+ line_6->setObjectName(QString::fromUtf8("line_6"));
+ line_6->setFrameShape(QFrame::HLine);
+ line_6->setFrameShadow(QFrame::Sunken);
+
+ verticalLayout_10->addWidget(line_6);
+
+ label_10 = new QLabel(SVGOptions);
+ label_10->setObjectName(QString::fromUtf8("label_10"));
+
+ verticalLayout_10->addWidget(label_10);
+
+ gridLayout_8 = new QGridLayout();
+ gridLayout_8->setSpacing(6);
+ gridLayout_8->setObjectName(QString::fromUtf8("gridLayout_8"));
+ label_3 = new QLabel(SVGOptions);
+ label_3->setObjectName(QString::fromUtf8("label_3"));
+
+ gridLayout_8->addWidget(label_3, 0, 0, 1, 1);
+
+ leSVGWidth = new QLineEdit(SVGOptions);
+ leSVGWidth->setObjectName(QString::fromUtf8("leSVGWidth"));
+
+ gridLayout_8->addWidget(leSVGWidth, 0, 1, 1, 1);
+
+ label_12 = new QLabel(SVGOptions);
+ label_12->setObjectName(QString::fromUtf8("label_12"));
+
+ gridLayout_8->addWidget(label_12, 1, 0, 1, 1);
+
+ leSVGHeight = new QLineEdit(SVGOptions);
+ leSVGHeight->setObjectName(QString::fromUtf8("leSVGHeight"));
+
+ gridLayout_8->addWidget(leSVGHeight, 1, 1, 1, 1);
+
+
+ verticalLayout_10->addLayout(gridLayout_8);
+
+ cbSVGEmbedStyle = new QCheckBox(SVGOptions);
+ cbSVGEmbedStyle->setObjectName(QString::fromUtf8("cbSVGEmbedStyle"));
+
+ verticalLayout_10->addWidget(cbSVGEmbedStyle);
+
+ horizontalLayout_26 = new QHBoxLayout();
+ horizontalLayout_26->setSpacing(6);
+ horizontalLayout_26->setObjectName(QString::fromUtf8("horizontalLayout_26"));
+ label_29 = new QLabel(SVGOptions);
+ label_29->setObjectName(QString::fromUtf8("label_29"));
+
+ horizontalLayout_26->addWidget(label_29);
+
+ leSVGStyleFile = new QLineEdit(SVGOptions);
+ leSVGStyleFile->setObjectName(QString::fromUtf8("leSVGStyleFile"));
+
+ horizontalLayout_26->addWidget(leSVGStyleFile);
+
+
+ verticalLayout_10->addLayout(horizontalLayout_26);
+
+ horizontalLayout_27 = new QHBoxLayout();
+ horizontalLayout_27->setSpacing(6);
+ horizontalLayout_27->setObjectName(QString::fromUtf8("horizontalLayout_27"));
+ label_30 = new QLabel(SVGOptions);
+ label_30->setObjectName(QString::fromUtf8("label_30"));
+
+ horizontalLayout_27->addWidget(label_30);
+
+ horizontalSpacer_6 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
+
+ horizontalLayout_27->addItem(horizontalSpacer_6);
+
+
+ verticalLayout_10->addLayout(horizontalLayout_27);
+
+ horizontalLayout_28 = new QHBoxLayout();
+ horizontalLayout_28->setSpacing(6);
+ horizontalLayout_28->setObjectName(QString::fromUtf8("horizontalLayout_28"));
+ leSVGStyleIncFile = new QLineEdit(SVGOptions);
+ leSVGStyleIncFile->setObjectName(QString::fromUtf8("leSVGStyleIncFile"));
+
+ horizontalLayout_28->addWidget(leSVGStyleIncFile);
+
+ pbSVGChooseStyleIncFile = new QPushButton(SVGOptions);
+ pbSVGChooseStyleIncFile->setObjectName(QString::fromUtf8("pbSVGChooseStyleIncFile"));
+
+ horizontalLayout_28->addWidget(pbSVGChooseStyleIncFile);
+
+
+ verticalLayout_10->addLayout(horizontalLayout_28);
+
+ verticalSpacer_10 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
+
+ verticalLayout_10->addItem(verticalSpacer_10);
+
+ stackedSpecificOptions->addWidget(SVGOptions);
+ EmptyPage = new QWidget();
+ EmptyPage->setObjectName(QString::fromUtf8("EmptyPage"));
+ verticalLayout_11 = new QVBoxLayout(EmptyPage);
+ verticalLayout_11->setSpacing(6);
+ verticalLayout_11->setContentsMargins(11, 11, 11, 11);
+ verticalLayout_11->setObjectName(QString::fromUtf8("verticalLayout_11"));
+ label_7 = new QLabel(EmptyPage);
+ label_7->setObjectName(QString::fromUtf8("label_7"));
+
+ verticalLayout_11->addWidget(label_7);
+
+ verticalSpacer_3 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
+
+ verticalLayout_11->addItem(verticalSpacer_3);
+
+ stackedSpecificOptions->addWidget(EmptyPage);
+
+ gridLayout->addWidget(stackedSpecificOptions, 0, 0, 1, 1);
+
+ tabWidget->addTab(page_output_spec, QString());
+ page_formatting = new QWidget();
+ page_formatting->setObjectName(QString::fromUtf8("page_formatting"));
+ verticalLayout_8 = new QVBoxLayout(page_formatting);
+ verticalLayout_8->setSpacing(6);
+ verticalLayout_8->setContentsMargins(11, 11, 11, 11);
+ verticalLayout_8->setObjectName(QString::fromUtf8("verticalLayout_8"));
+ horizontalLayout_3 = new QHBoxLayout();
+ horizontalLayout_3->setSpacing(6);
+ horizontalLayout_3->setObjectName(QString::fromUtf8("horizontalLayout_3"));
+ label_5 = new QLabel(page_formatting);
+ label_5->setObjectName(QString::fromUtf8("label_5"));
+ sizePolicy6.setHeightForWidth(label_5->sizePolicy().hasHeightForWidth());
+ label_5->setSizePolicy(sizePolicy6);
+
+ horizontalLayout_3->addWidget(label_5);
+
+ comboTheme = new QComboBox(page_formatting);
+ comboTheme->setObjectName(QString::fromUtf8("comboTheme"));
+ sizePolicy7.setHeightForWidth(comboTheme->sizePolicy().hasHeightForWidth());
+ comboTheme->setSizePolicy(sizePolicy7);
+
+ horizontalLayout_3->addWidget(comboTheme);
+
+
+ verticalLayout_8->addLayout(horizontalLayout_3);
+
+ horizontalLayout_4 = new QHBoxLayout();
+ horizontalLayout_4->setSpacing(6);
+ horizontalLayout_4->setObjectName(QString::fromUtf8("horizontalLayout_4"));
+ cbReformat = new QCheckBox(page_formatting);
+ cbReformat->setObjectName(QString::fromUtf8("cbReformat"));
+
+ horizontalLayout_4->addWidget(cbReformat);
+
+ comboReformat = new QComboBox(page_formatting);
+ comboReformat->setObjectName(QString::fromUtf8("comboReformat"));
+ sizePolicy7.setHeightForWidth(comboReformat->sizePolicy().hasHeightForWidth());
+ comboReformat->setSizePolicy(sizePolicy7);
+
+ horizontalLayout_4->addWidget(comboReformat);
+
+
+ verticalLayout_8->addLayout(horizontalLayout_4);
+
+ horizontalLayout_5 = new QHBoxLayout();
+ horizontalLayout_5->setSpacing(6);
+ horizontalLayout_5->setObjectName(QString::fromUtf8("horizontalLayout_5"));
+ cbKwCase = new QCheckBox(page_formatting);
+ cbKwCase->setObjectName(QString::fromUtf8("cbKwCase"));
+
+ horizontalLayout_5->addWidget(cbKwCase);
+
+ comboKwCase = new QComboBox(page_formatting);
+ comboKwCase->setObjectName(QString::fromUtf8("comboKwCase"));
+ sizePolicy7.setHeightForWidth(comboKwCase->sizePolicy().hasHeightForWidth());
+ comboKwCase->setSizePolicy(sizePolicy7);
+
+ horizontalLayout_5->addWidget(comboKwCase);
+
+
+ verticalLayout_8->addLayout(horizontalLayout_5);
+
+ horizontalLayout_6 = new QHBoxLayout();
+ horizontalLayout_6->setSpacing(6);
+ horizontalLayout_6->setObjectName(QString::fromUtf8("horizontalLayout_6"));
+ label_6 = new QLabel(page_formatting);
+ label_6->setObjectName(QString::fromUtf8("label_6"));
+ sizePolicy7.setHeightForWidth(label_6->sizePolicy().hasHeightForWidth());
+ label_6->setSizePolicy(sizePolicy7);
+
+ horizontalLayout_6->addWidget(label_6);
+
+ sbTabWidth = new QSpinBox(page_formatting);
+ sbTabWidth->setObjectName(QString::fromUtf8("sbTabWidth"));
+ sbTabWidth->setMaximum(10);
+
+ horizontalLayout_6->addWidget(sbTabWidth);
+
+
+ verticalLayout_8->addLayout(horizontalLayout_6);
+
+ gridLayout_2 = new QGridLayout();
+ gridLayout_2->setSpacing(6);
+ gridLayout_2->setObjectName(QString::fromUtf8("gridLayout_2"));
+ cbWrapping = new QCheckBox(page_formatting);
+ cbWrapping->setObjectName(QString::fromUtf8("cbWrapping"));
+
+ gridLayout_2->addWidget(cbWrapping, 0, 0, 1, 1);
+
+ sbLineLength = new QSpinBox(page_formatting);
+ sbLineLength->setObjectName(QString::fromUtf8("sbLineLength"));
+ sbLineLength->setMinimum(60);
+ sbLineLength->setMaximum(120);
+ sbLineLength->setSingleStep(2);
+
+ gridLayout_2->addWidget(sbLineLength, 0, 1, 1, 1);
+
+ cbAdvWrapping = new QCheckBox(page_formatting);
+ cbAdvWrapping->setObjectName(QString::fromUtf8("cbAdvWrapping"));
+ cbAdvWrapping->setEnabled(false);
+
+ gridLayout_2->addWidget(cbAdvWrapping, 1, 0, 1, 1);
+
+ verticalSpacer_11 = new QSpacerItem(20, 13, QSizePolicy::Minimum, QSizePolicy::Minimum);
+
+ gridLayout_2->addItem(verticalSpacer_11, 1, 1, 1, 1);
+
+
+ verticalLayout_8->addLayout(gridLayout_2);
+
+ line_3 = new QFrame(page_formatting);
+ line_3->setObjectName(QString::fromUtf8("line_3"));
+ line_3->setFrameShape(QFrame::HLine);
+ line_3->setFrameShadow(QFrame::Sunken);
+
+ verticalLayout_8->addWidget(line_3);
+
+ gridLayout_9 = new QGridLayout();
+ gridLayout_9->setSpacing(6);
+ gridLayout_9->setObjectName(QString::fromUtf8("gridLayout_9"));
+ label_23 = new QLabel(page_formatting);
+ label_23->setObjectName(QString::fromUtf8("label_23"));
+
+ gridLayout_9->addWidget(label_23, 0, 0, 1, 1);
+
+ comboFontName = new QFontComboBox(page_formatting);
+ comboFontName->setObjectName(QString::fromUtf8("comboFontName"));
+
+ gridLayout_9->addWidget(comboFontName, 0, 1, 1, 1);
+
+ label_4 = new QLabel(page_formatting);
+ label_4->setObjectName(QString::fromUtf8("label_4"));
+
+ gridLayout_9->addWidget(label_4, 1, 0, 1, 1);
+
+ leFontSize = new QLineEdit(page_formatting);
+ leFontSize->setObjectName(QString::fromUtf8("leFontSize"));
+ sizePolicy4.setHeightForWidth(leFontSize->sizePolicy().hasHeightForWidth());
+ leFontSize->setSizePolicy(sizePolicy4);
+
+ gridLayout_9->addWidget(leFontSize, 1, 1, 1, 1);
+
+
+ verticalLayout_8->addLayout(gridLayout_9);
+
+ tabWidget->addTab(page_formatting, QString());
+
+ verticalLayout_7->addWidget(tabWidget);
+
+
+ horizontalLayout_24->addLayout(verticalLayout_7);
+
+ line = new QFrame(centralWidget);
+ line->setObjectName(QString::fromUtf8("line"));
+ line->setFrameShape(QFrame::VLine);
+ line->setFrameShadow(QFrame::Sunken);
+
+ horizontalLayout_24->addWidget(line);
+
+ verticalLayout_13 = new QVBoxLayout();
+ verticalLayout_13->setSpacing(6);
+ verticalLayout_13->setObjectName(QString::fromUtf8("verticalLayout_13"));
+ lbPreview = new QLabel(centralWidget);
+ lbPreview->setObjectName(QString::fromUtf8("lbPreview"));
+
+ verticalLayout_13->addWidget(lbPreview);
+
+ browserPreview = new QTextBrowser(centralWidget);
+ browserPreview->setObjectName(QString::fromUtf8("browserPreview"));
+ QSizePolicy sizePolicy11(QSizePolicy::Expanding, QSizePolicy::Expanding);
+ sizePolicy11.setHorizontalStretch(0);
+ sizePolicy11.setVerticalStretch(0);
+ sizePolicy11.setHeightForWidth(browserPreview->sizePolicy().hasHeightForWidth());
+ browserPreview->setSizePolicy(sizePolicy11);
+
+ verticalLayout_13->addWidget(browserPreview);
+
+ horizontalLayout_13 = new QHBoxLayout();
+ horizontalLayout_13->setSpacing(6);
+ horizontalLayout_13->setObjectName(QString::fromUtf8("horizontalLayout_13"));
+ label_14 = new QLabel(centralWidget);
+ label_14->setObjectName(QString::fromUtf8("label_14"));
+
+ horizontalLayout_13->addWidget(label_14);
+
+ progressBar = new QProgressBar(centralWidget);
+ progressBar->setObjectName(QString::fromUtf8("progressBar"));
+ progressBar->setValue(0);
+
+ horizontalLayout_13->addWidget(progressBar);
+
+
+ verticalLayout_13->addLayout(horizontalLayout_13);
+
+
+ horizontalLayout_24->addLayout(verticalLayout_13);
+
+ MainWindowClass->setCentralWidget(centralWidget);
+ menuBar = new QMenuBar(MainWindowClass);
+ menuBar->setObjectName(QString::fromUtf8("menuBar"));
+ menuBar->setGeometry(QRect(0, 0, 600, 20));
+ menu_File = new QMenu(menuBar);
+ menu_File->setObjectName(QString::fromUtf8("menu_File"));
+ menu_Help = new QMenu(menuBar);
+ menu_Help->setObjectName(QString::fromUtf8("menu_Help"));
+ MainWindowClass->setMenuBar(menuBar);
+ statusBar = new QStatusBar(MainWindowClass);
+ statusBar->setObjectName(QString::fromUtf8("statusBar"));
+ MainWindowClass->setStatusBar(statusBar);
+#ifndef QT_NO_SHORTCUT
+ label_2->setBuddy(comboFormat);
+ label_21->setBuddy(leLATEXStyleFile);
+ label_24->setBuddy(leTEXStyleFile);
+ label_3->setBuddy(leSVGWidth);
+ label_12->setBuddy(leSVGHeight);
+ label_29->setBuddy(leSVGStyleFile);
+ label_5->setBuddy(comboTheme);
+ label_6->setBuddy(sbTabWidth);
+ label_23->setBuddy(comboFontName);
+ label_4->setBuddy(leFontSize);
+#endif // QT_NO_SHORTCUT
+ QWidget::setTabOrder(pbOpenFiles, lvInputFiles);
+ QWidget::setTabOrder(lvInputFiles, pbClearSelection);
+ QWidget::setTabOrder(pbClearSelection, pbClearAll);
+ QWidget::setTabOrder(pbClearAll, tabWidget);
+ QWidget::setTabOrder(tabWidget, comboFormat);
+ QWidget::setTabOrder(comboFormat, cbIncLineNo);
+ QWidget::setTabOrder(cbIncLineNo, sbLineNoWidth);
+ QWidget::setTabOrder(sbLineNoWidth, cbPadZeroes);
+ QWidget::setTabOrder(cbPadZeroes, cbFragment);
+ QWidget::setTabOrder(cbFragment, cbValidateInput);
+ QWidget::setTabOrder(cbValidateInput, cbEncoding);
+ QWidget::setTabOrder(cbEncoding, comboEncoding);
+ QWidget::setTabOrder(comboEncoding, cbHTMLEmbedStyle);
+ QWidget::setTabOrder(cbHTMLEmbedStyle, cbHTMLInlineCSS);
+ QWidget::setTabOrder(cbHTMLInlineCSS, leHTMLStyleFile);
+ QWidget::setTabOrder(leHTMLStyleFile, leHTMLStyleIncFile);
+ QWidget::setTabOrder(leHTMLStyleIncFile, pbHTMLChooseStyleIncFile);
+ QWidget::setTabOrder(pbHTMLChooseStyleIncFile, leHTMLCssPrefix);
+ QWidget::setTabOrder(leHTMLCssPrefix, cbHTMLIndex);
+ QWidget::setTabOrder(cbHTMLIndex, cbHTMLCtags);
+ QWidget::setTabOrder(cbHTMLCtags, leHTMLCtagsFile);
+ QWidget::setTabOrder(leHTMLCtagsFile, pbHTMLChooseTagsFile);
+ QWidget::setTabOrder(pbHTMLChooseTagsFile, cbHTMLAnchors);
+ QWidget::setTabOrder(cbHTMLAnchors, cbHTMLFileNameAnchor);
+ QWidget::setTabOrder(cbHTMLFileNameAnchor, cbHTMLOrderedList);
+ QWidget::setTabOrder(cbHTMLOrderedList, cbHTMLEnclosePreTags);
+ QWidget::setTabOrder(cbHTMLEnclosePreTags, cbLATEXEscQuotes);
+ QWidget::setTabOrder(cbLATEXEscQuotes, cbLATEXBabel);
+ QWidget::setTabOrder(cbLATEXBabel, cbLATEXPrettySymbols);
+ QWidget::setTabOrder(cbLATEXPrettySymbols, cbLATEXEmbedStyle);
+ QWidget::setTabOrder(cbLATEXEmbedStyle, leLATEXStyleFile);
+ QWidget::setTabOrder(leLATEXStyleFile, leLATEXStyleIncFile);
+ QWidget::setTabOrder(leLATEXStyleIncFile, pbLATEXChooseStyleIncFile);
+ QWidget::setTabOrder(pbLATEXChooseStyleIncFile, cbTEXEmbedStyle);
+ QWidget::setTabOrder(cbTEXEmbedStyle, leTEXStyleFile);
+ QWidget::setTabOrder(leTEXStyleFile, leTEXStyleIncFile);
+ QWidget::setTabOrder(leTEXStyleIncFile, pbTEXChooseStyleIncFile);
+ QWidget::setTabOrder(pbTEXChooseStyleIncFile, cbRTFCharStyles);
+ QWidget::setTabOrder(cbRTFCharStyles, comboRTFPageSize);
+ QWidget::setTabOrder(comboRTFPageSize, leSVGWidth);
+ QWidget::setTabOrder(leSVGWidth, leSVGHeight);
+ QWidget::setTabOrder(leSVGHeight, cbSVGEmbedStyle);
+ QWidget::setTabOrder(cbSVGEmbedStyle, leSVGStyleFile);
+ QWidget::setTabOrder(leSVGStyleFile, leSVGStyleIncFile);
+ QWidget::setTabOrder(leSVGStyleIncFile, pbSVGChooseStyleIncFile);
+ QWidget::setTabOrder(pbSVGChooseStyleIncFile, comboTheme);
+ QWidget::setTabOrder(comboTheme, cbReformat);
+ QWidget::setTabOrder(cbReformat, comboReformat);
+ QWidget::setTabOrder(comboReformat, cbKwCase);
+ QWidget::setTabOrder(cbKwCase, comboKwCase);
+ QWidget::setTabOrder(comboKwCase, sbTabWidth);
+ QWidget::setTabOrder(sbTabWidth, cbWrapping);
+ QWidget::setTabOrder(cbWrapping, sbLineLength);
+ QWidget::setTabOrder(sbLineLength, cbAdvWrapping);
+ QWidget::setTabOrder(cbAdvWrapping, comboFontName);
+ QWidget::setTabOrder(comboFontName, leFontSize);
+ QWidget::setTabOrder(leFontSize, browserPreview);
+ QWidget::setTabOrder(browserPreview, pbStartConversion);
+ QWidget::setTabOrder(pbStartConversion, pbCopyFile2CP);
+
+ menuBar->addAction(menu_File->menuAction());
+ menuBar->addAction(menu_Help->menuAction());
+ menu_File->addAction(action_Open_files);
+ menu_File->addSeparator();
+ menu_File->addAction(action_Exit);
+ menu_Help->addAction(action_Tips);
+ menu_Help->addAction(action_Manual);
+ menu_Help->addAction(action_Changelog);
+ menu_Help->addAction(action_License);
+ menu_Help->addSeparator();
+ menu_Help->addAction(actionAbout_translations);
+ menu_Help->addSeparator();
+ menu_Help->addAction(action_About_Highlight);
+
+ retranslateUi(MainWindowClass);
+ QObject::connect(pbClearAll, SIGNAL(clicked()), lvInputFiles, SLOT(clear()));
+
+ tabIOSelection->setCurrentIndex(1);
+ tabWidget->setCurrentIndex(2);
+ stackedSpecificOptions->setCurrentIndex(0);
+ tabWidget1->setCurrentIndex(0);
+ comboRTFPageSize->setCurrentIndex(1);
+
+
+ QMetaObject::connectSlotsByName(MainWindowClass);
+ } // setupUi
+
+ void retranslateUi(QMainWindow *MainWindowClass)
+ {
+ MainWindowClass->setWindowTitle(QApplication::translate("MainWindowClass", "Highlight", 0, QApplication::UnicodeUTF8));
+ action_Open_files->setText(QApplication::translate("MainWindowClass", "&Open files", 0, QApplication::UnicodeUTF8));
+ action_Exit->setText(QApplication::translate("MainWindowClass", "&Exit", 0, QApplication::UnicodeUTF8));
+ action_Load->setText(QApplication::translate("MainWindowClass", "&Load", 0, QApplication::UnicodeUTF8));
+ action_Save->setText(QApplication::translate("MainWindowClass", "&Save", 0, QApplication::UnicodeUTF8));
+ actionLoad_default_project->setText(QApplication::translate("MainWindowClass", "Load &default project", 0, QApplication::UnicodeUTF8));
+ action_Manual->setText(QApplication::translate("MainWindowClass", "Readme", 0, QApplication::UnicodeUTF8));
+ action_Tips->setText(QApplication::translate("MainWindowClass", "&Tips", 0, QApplication::UnicodeUTF8));
+ action_Changelog->setText(QApplication::translate("MainWindowClass", "&Changelog", 0, QApplication::UnicodeUTF8));
+ action_License->setText(QApplication::translate("MainWindowClass", "&License", 0, QApplication::UnicodeUTF8));
+ action_About_Highlight->setText(QApplication::translate("MainWindowClass", "&About Highlight", 0, QApplication::UnicodeUTF8));
+ actionAbout_translations->setText(QApplication::translate("MainWindowClass", "About &translations", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ pbOpenFiles->setToolTip(QApplication::translate("MainWindowClass", "Choose the source code files you want to convert.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+#ifndef QT_NO_WHATSTHIS
+ pbOpenFiles->setWhatsThis(QString());
+#endif // QT_NO_WHATSTHIS
+ pbOpenFiles->setText(QApplication::translate("MainWindowClass", "Choose input files", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ lvInputFiles->setToolTip(QApplication::translate("MainWindowClass", "List of input files.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+#ifndef QT_NO_TOOLTIP
+ pbClearSelection->setToolTip(QApplication::translate("MainWindowClass", "Remove the selected input files.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ pbClearSelection->setText(QApplication::translate("MainWindowClass", "Clear selection", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ pbClearAll->setToolTip(QApplication::translate("MainWindowClass", "Remove all input files.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ pbClearAll->setText(QApplication::translate("MainWindowClass", "Clear all", 0, QApplication::UnicodeUTF8));
+ label_11->setText(QApplication::translate("MainWindowClass", "Output destination:", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ leOutputDest->setToolTip(QApplication::translate("MainWindowClass", "Output directory", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+#ifndef QT_NO_TOOLTIP
+ pbOutputDest->setToolTip(QApplication::translate("MainWindowClass", "Select the output directory.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ pbOutputDest->setText(QApplication::translate("MainWindowClass", "...", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ cbWrite2Src->setToolTip(QApplication::translate("MainWindowClass", "Save output in the input file directories.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ cbWrite2Src->setText(QApplication::translate("MainWindowClass", "Write to source directories", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ pbStartConversion->setToolTip(QApplication::translate("MainWindowClass", "Start the conversion of your input files.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ pbStartConversion->setText(QApplication::translate("MainWindowClass", "Convert files", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ pbCopyFile2CP->setToolTip(QApplication::translate("MainWindowClass", "Copy highlighted code of the seleted file into the clipboard.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ pbCopyFile2CP->setText(QApplication::translate("MainWindowClass", "Copy file to clipboard", 0, QApplication::UnicodeUTF8));
+ tabIOSelection->setTabText(tabIOSelection->indexOf(tab_file_io), QApplication::translate("MainWindowClass", "Files", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ pbPasteFromCB->setToolTip(QApplication::translate("MainWindowClass", "Paste clipboard content into the preview window.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ pbPasteFromCB->setText(QApplication::translate("MainWindowClass", "Paste from clipboard", 0, QApplication::UnicodeUTF8));
+ label_13->setText(QApplication::translate("MainWindowClass", "Select syntax:", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ comboSelectSyntax->setToolTip(QApplication::translate("MainWindowClass", "Select the correct syntax of the code snippet.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+#ifndef QT_NO_TOOLTIP
+ pbCopyToCP->setToolTip(QApplication::translate("MainWindowClass", "Copy highlighted code into the clipboard.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ pbCopyToCP->setText(QApplication::translate("MainWindowClass", "Copy preview to clipboard", 0, QApplication::UnicodeUTF8));
+ tabIOSelection->setTabText(tabIOSelection->indexOf(tab_clipboard), QApplication::translate("MainWindowClass", "Clipboard", 0, QApplication::UnicodeUTF8));
+ label_2->setText(QApplication::translate("MainWindowClass", "Output format:", 0, QApplication::UnicodeUTF8));
+ comboFormat->clear();
+ comboFormat->insertItems(0, QStringList()
+ << QApplication::translate("MainWindowClass", "HTML", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "XHTML", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "LaTeX", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "TeX", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "RTF", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "SVG", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "XML", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "BBCode", 0, QApplication::UnicodeUTF8)
+ );
+#ifndef QT_NO_TOOLTIP
+ comboFormat->setToolTip(QApplication::translate("MainWindowClass", "Choose an output format.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+#ifndef QT_NO_TOOLTIP
+ cbIncLineNo->setToolTip(QApplication::translate("MainWindowClass", "Add line numbers to the output.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ cbIncLineNo->setText(QApplication::translate("MainWindowClass", "Add line numbers", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ sbLineNoWidth->setToolTip(QApplication::translate("MainWindowClass", "Select the line number width.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+#ifndef QT_NO_TOOLTIP
+ cbPadZeroes->setToolTip(QApplication::translate("MainWindowClass", "Fill leading space of line numbers with zeroes.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ cbPadZeroes->setText(QApplication::translate("MainWindowClass", "Pad with zeroes", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ cbFragment->setToolTip(QApplication::translate("MainWindowClass", "Generate output without document header and footer.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ cbFragment->setText(QApplication::translate("MainWindowClass", "Omit header and footer", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ cbValidateInput->setToolTip(QApplication::translate("MainWindowClass", "Test if input data is not binary.\n"
+"Removes Unicode BOM mark.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ cbValidateInput->setText(QApplication::translate("MainWindowClass", "Validate input data", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ cbEncoding->setToolTip(QApplication::translate("MainWindowClass", "Set the output file ancoding.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ cbEncoding->setText(QApplication::translate("MainWindowClass", "Set encoding:", 0, QApplication::UnicodeUTF8));
+ comboEncoding->clear();
+ comboEncoding->insertItems(0, QStringList()
+ << QApplication::translate("MainWindowClass", "ISO-8859-1", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "ISO-8859-2", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "ISO-8859-3", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "ISO-8859-4", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "ISO-8859-5", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "ISO-8859-6", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "ISO-8859-7", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "ISO-8859-8", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "ISO-8859-9", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "ISO-8859-10", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "ISO-8859-11", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "ISO-8859-12", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "ISO-8859-13", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "ISO-8859-14", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "ISO-8859-15", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "UTF-8", 0, QApplication::UnicodeUTF8)
+ );
+#ifndef QT_NO_TOOLTIP
+ comboEncoding->setToolTip(QApplication::translate("MainWindowClass", "Select or define the encoding.\n"
+"The result has to match the input file encoding.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ tabWidget->setTabText(tabWidget->indexOf(page_general), QApplication::translate("MainWindowClass", "General", 0, QApplication::UnicodeUTF8));
+ label_17->setText(QApplication::translate("MainWindowClass", "HTML options", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ cbHTMLEmbedStyle->setToolTip(QApplication::translate("MainWindowClass", "Include the style information in each output file.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ cbHTMLEmbedStyle->setText(QApplication::translate("MainWindowClass", "Embed style (CSS)", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ cbHTMLInlineCSS->setToolTip(QApplication::translate("MainWindowClass", "Add CSS information to each tag (do not use CSS class definitions).", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ cbHTMLInlineCSS->setText(QApplication::translate("MainWindowClass", "Inline CSS", 0, QApplication::UnicodeUTF8));
+ label_19->setText(QApplication::translate("MainWindowClass", "Stylesheet file:", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ leHTMLStyleFile->setToolTip(QApplication::translate("MainWindowClass", "Name of the referenced style file.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ leHTMLStyleFile->setText(QApplication::translate("MainWindowClass", "highlight.css", 0, QApplication::UnicodeUTF8));
+ label_20->setText(QApplication::translate("MainWindowClass", "Include:", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ leHTMLStyleIncFile->setToolTip(QApplication::translate("MainWindowClass", "Path of the CSS include file.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+#ifndef QT_NO_TOOLTIP
+ pbHTMLChooseStyleIncFile->setToolTip(QApplication::translate("MainWindowClass", "Select a CSS include file.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ pbHTMLChooseStyleIncFile->setText(QApplication::translate("MainWindowClass", "...", 0, QApplication::UnicodeUTF8));
+ label->setText(QApplication::translate("MainWindowClass", "CSS class prefix:", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ leHTMLCssPrefix->setToolTip(QApplication::translate("MainWindowClass", "Add a CSS class name prefix to avoid namespace clashes.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ leHTMLCssPrefix->setText(QString());
+ tabWidget1->setTabText(tabWidget1->indexOf(tabWidgetPage1), QApplication::translate("MainWindowClass", "Stylesheets", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ cbHTMLIndex->setToolTip(QApplication::translate("MainWindowClass", "Generate an index file with hyperlinks to all outputted files.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ cbHTMLIndex->setText(QApplication::translate("MainWindowClass", "Generate index file", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ cbHTMLCtags->setToolTip(QApplication::translate("MainWindowClass", "Read a ctags file and add the included metainformation as tooltips.\n"
+"See ctags.sf.net for details.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ cbHTMLCtags->setText(QApplication::translate("MainWindowClass", "Read ctags file:", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ leHTMLCtagsFile->setToolTip(QApplication::translate("MainWindowClass", "Path of the ctags file.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+#ifndef QT_NO_TOOLTIP
+ pbHTMLChooseTagsFile->setToolTip(QApplication::translate("MainWindowClass", "Choose a ctags file.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ pbHTMLChooseTagsFile->setText(QApplication::translate("MainWindowClass", "...", 0, QApplication::UnicodeUTF8));
+ tabWidget1->setTabText(tabWidget1->indexOf(tabWidgetPage2), QApplication::translate("MainWindowClass", "Index/ctags", 0, QApplication::UnicodeUTF8));
+ label_8->setText(QApplication::translate("MainWindowClass", "Line numbering options:", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ cbHTMLAnchors->setToolTip(QApplication::translate("MainWindowClass", "Add an achor to each line.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ cbHTMLAnchors->setText(QApplication::translate("MainWindowClass", "Add line anchors", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ cbHTMLFileNameAnchor->setToolTip(QApplication::translate("MainWindowClass", "Add the filename as prefix to the anchors.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ cbHTMLFileNameAnchor->setText(QApplication::translate("MainWindowClass", "Include file name in anchor", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ cbHTMLOrderedList->setToolTip(QApplication::translate("MainWindowClass", "Output the lines within an ordered list.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ cbHTMLOrderedList->setText(QApplication::translate("MainWindowClass", "Output as ordered list", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ cbHTMLEnclosePreTags->setToolTip(QApplication::translate("MainWindowClass", "Add &lt;pre&gt; tags to the output, if the flag \"No document header and footer\" is selected.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ cbHTMLEnclosePreTags->setText(QApplication::translate("MainWindowClass", "Enclose in pre tags", 0, QApplication::UnicodeUTF8));
+ tabWidget1->setTabText(tabWidget1->indexOf(tabWidgetPage3), QApplication::translate("MainWindowClass", "Misc", 0, QApplication::UnicodeUTF8));
+ label_18->setText(QApplication::translate("MainWindowClass", "LaTeX options", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ cbLATEXEscQuotes->setToolTip(QApplication::translate("MainWindowClass", "Replace quotes by dq sequences.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ cbLATEXEscQuotes->setText(QApplication::translate("MainWindowClass", "Escape quotes", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ cbLATEXBabel->setToolTip(QApplication::translate("MainWindowClass", "Make output Babel compatible.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ cbLATEXBabel->setText(QApplication::translate("MainWindowClass", "Add Babel compatibility", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ cbLATEXPrettySymbols->setToolTip(QApplication::translate("MainWindowClass", "Replace default symbols (brackets, tilde) by nice redefinitions.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ cbLATEXPrettySymbols->setText(QApplication::translate("MainWindowClass", "Add pretty symbols", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ cbLATEXEmbedStyle->setToolTip(QApplication::translate("MainWindowClass", "Include the style information in each output file.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ cbLATEXEmbedStyle->setText(QApplication::translate("MainWindowClass", "Embed style (defs)", 0, QApplication::UnicodeUTF8));
+ label_21->setText(QApplication::translate("MainWindowClass", "Stylesheet file:", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ leLATEXStyleFile->setToolTip(QApplication::translate("MainWindowClass", "Name of the referenced style file.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ leLATEXStyleFile->setText(QApplication::translate("MainWindowClass", "highlight.sty", 0, QApplication::UnicodeUTF8));
+ label_22->setText(QApplication::translate("MainWindowClass", "Stylesheet include file:", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ leLATEXStyleIncFile->setToolTip(QApplication::translate("MainWindowClass", "Path of the style include file.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+#ifndef QT_NO_TOOLTIP
+ pbLATEXChooseStyleIncFile->setToolTip(QApplication::translate("MainWindowClass", "Select a style include file.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ pbLATEXChooseStyleIncFile->setText(QApplication::translate("MainWindowClass", "...", 0, QApplication::UnicodeUTF8));
+ label_26->setText(QApplication::translate("MainWindowClass", "TeX options", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ cbTEXEmbedStyle->setToolTip(QApplication::translate("MainWindowClass", "Include the style information in each output file.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ cbTEXEmbedStyle->setText(QApplication::translate("MainWindowClass", "Embed style (macros)", 0, QApplication::UnicodeUTF8));
+ label_24->setText(QApplication::translate("MainWindowClass", "Stylesheet file:", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ leTEXStyleFile->setToolTip(QApplication::translate("MainWindowClass", "Name of the referenced style file.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ leTEXStyleFile->setText(QApplication::translate("MainWindowClass", "highlight.sty", 0, QApplication::UnicodeUTF8));
+ label_25->setText(QApplication::translate("MainWindowClass", "Stylesheet include file:", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ leTEXStyleIncFile->setToolTip(QApplication::translate("MainWindowClass", "Path of the style include file.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+#ifndef QT_NO_TOOLTIP
+ pbTEXChooseStyleIncFile->setToolTip(QApplication::translate("MainWindowClass", "Select a style include file.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ pbTEXChooseStyleIncFile->setText(QApplication::translate("MainWindowClass", "...", 0, QApplication::UnicodeUTF8));
+ label_15->setText(QApplication::translate("MainWindowClass", "RTF options", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ cbRTFCharStyles->setToolTip(QApplication::translate("MainWindowClass", "Add character stylesheets with formatting information.\n"
+"You can select the stylesheets in your word processor to reformat additional text.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ cbRTFCharStyles->setText(QApplication::translate("MainWindowClass", "Add character styles", 0, QApplication::UnicodeUTF8));
+ label_9->setText(QApplication::translate("MainWindowClass", "Page size:", 0, QApplication::UnicodeUTF8));
+ comboRTFPageSize->clear();
+ comboRTFPageSize->insertItems(0, QStringList()
+ << QApplication::translate("MainWindowClass", "A3", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "A4", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "A5", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "B4", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "B5", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "B6", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "Letter", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "Legal", 0, QApplication::UnicodeUTF8)
+ );
+#ifndef QT_NO_TOOLTIP
+ comboRTFPageSize->setToolTip(QApplication::translate("MainWindowClass", "Select a page size.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ label_16->setText(QApplication::translate("MainWindowClass", "SVG options", 0, QApplication::UnicodeUTF8));
+ label_10->setText(QApplication::translate("MainWindowClass", "Image size:", 0, QApplication::UnicodeUTF8));
+ label_3->setText(QApplication::translate("MainWindowClass", "Width:", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ leSVGWidth->setToolTip(QApplication::translate("MainWindowClass", "Enter the SVG width (may contain units).", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ label_12->setText(QApplication::translate("MainWindowClass", "Height:", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ leSVGHeight->setToolTip(QApplication::translate("MainWindowClass", "Enter the SVG height (may contain units).", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+#ifndef QT_NO_TOOLTIP
+ cbSVGEmbedStyle->setToolTip(QApplication::translate("MainWindowClass", "Include the style information in each output file.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ cbSVGEmbedStyle->setText(QApplication::translate("MainWindowClass", "Embed style (CSS)", 0, QApplication::UnicodeUTF8));
+ label_29->setText(QApplication::translate("MainWindowClass", "Stylesheet file:", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ leSVGStyleFile->setToolTip(QApplication::translate("MainWindowClass", "Name of the referenced style file.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ leSVGStyleFile->setText(QApplication::translate("MainWindowClass", "highlight.css", 0, QApplication::UnicodeUTF8));
+ label_30->setText(QApplication::translate("MainWindowClass", "Stylesheet include file:", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ leSVGStyleIncFile->setToolTip(QApplication::translate("MainWindowClass", "Path of the CSS include file.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+#ifndef QT_NO_TOOLTIP
+ pbSVGChooseStyleIncFile->setToolTip(QApplication::translate("MainWindowClass", "Select a style include file.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ pbSVGChooseStyleIncFile->setText(QApplication::translate("MainWindowClass", "...", 0, QApplication::UnicodeUTF8));
+ label_7->setText(QApplication::translate("MainWindowClass", "No options defined.", 0, QApplication::UnicodeUTF8));
+ tabWidget->setTabText(tabWidget->indexOf(page_output_spec), QApplication::translate("MainWindowClass", "Output specific", 0, QApplication::UnicodeUTF8));
+ label_5->setText(QApplication::translate("MainWindowClass", "Color theme:", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ comboTheme->setToolTip(QApplication::translate("MainWindowClass", "Select a colour theme.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+#ifndef QT_NO_TOOLTIP
+ cbReformat->setToolTip(QApplication::translate("MainWindowClass", "Reformat and indent your code.\n"
+"This feature is enabled tor C, C++, C# and Java code.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ cbReformat->setText(QApplication::translate("MainWindowClass", "Reformat:", 0, QApplication::UnicodeUTF8));
+ comboReformat->clear();
+ comboReformat->insertItems(0, QStringList()
+ << QApplication::translate("MainWindowClass", "Allman", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "Banner", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "GNU", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "Horstmann", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "Java", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "K&R", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "Linux", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "OTBS", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "Stroustrup", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "Whitesmith", 0, QApplication::UnicodeUTF8)
+ );
+#ifndef QT_NO_TOOLTIP
+ comboReformat->setToolTip(QApplication::translate("MainWindowClass", "Choose a formatting scheme.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+#ifndef QT_NO_TOOLTIP
+ cbKwCase->setToolTip(QApplication::translate("MainWindowClass", "Change the keyword case.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ cbKwCase->setText(QApplication::translate("MainWindowClass", "Keyword case:", 0, QApplication::UnicodeUTF8));
+ comboKwCase->clear();
+ comboKwCase->insertItems(0, QStringList()
+ << QApplication::translate("MainWindowClass", "UPPER", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "lower", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindowClass", "Capitalize", 0, QApplication::UnicodeUTF8)
+ );
+#ifndef QT_NO_TOOLTIP
+ comboKwCase->setToolTip(QApplication::translate("MainWindowClass", "Select a keyword case.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ label_6->setText(QApplication::translate("MainWindowClass", "Tab width:", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ sbTabWidth->setToolTip(QApplication::translate("MainWindowClass", "Enter the number of spaces which replace a tab.\n"
+"Set the width to 0 to keep tabs.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+#ifndef QT_NO_TOOLTIP
+ cbWrapping->setToolTip(QApplication::translate("MainWindowClass", "Enable line wrapping.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ cbWrapping->setText(QApplication::translate("MainWindowClass", "Line wrapping", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ sbLineLength->setToolTip(QApplication::translate("MainWindowClass", "Enter the maximum line length.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+#ifndef QT_NO_TOOLTIP
+ cbAdvWrapping->setToolTip(QApplication::translate("MainWindowClass", "Indent statements and function parameters after wrapping.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ cbAdvWrapping->setText(QApplication::translate("MainWindowClass", "Intelligent wrapping", 0, QApplication::UnicodeUTF8));
+ label_23->setText(QApplication::translate("MainWindowClass", "Font name:", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ comboFontName->setToolTip(QApplication::translate("MainWindowClass", "Select or enter the font name.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ label_4->setText(QApplication::translate("MainWindowClass", "Font size:", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ leFontSize->setToolTip(QApplication::translate("MainWindowClass", "Enter the font size.", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ tabWidget->setTabText(tabWidget->indexOf(page_formatting), QApplication::translate("MainWindowClass", "Formatting", 0, QApplication::UnicodeUTF8));
+ lbPreview->setText(QApplication::translate("MainWindowClass", "Preview", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ browserPreview->setToolTip(QString());
+#endif // QT_NO_TOOLTIP
+#ifndef QT_NO_WHATSTHIS
+ browserPreview->setWhatsThis(QString());
+#endif // QT_NO_WHATSTHIS
+ label_14->setText(QApplication::translate("MainWindowClass", "Output progress:", 0, QApplication::UnicodeUTF8));
+ menu_File->setTitle(QApplication::translate("MainWindowClass", "&File", 0, QApplication::UnicodeUTF8));
+ menu_Help->setTitle(QApplication::translate("MainWindowClass", "&Help", 0, QApplication::UnicodeUTF8));
+ } // retranslateUi
+
+};
+
+namespace Ui {
+ class MainWindowClass: public Ui_MainWindowClass {};
+} // namespace Ui
+
+QT_END_NAMESPACE
+
+#endif // UI_MAINWINDOW_H
diff --git a/support/highlight/src/gui-qt/ui_showtextfile.h b/support/highlight/src/gui-qt/ui_showtextfile.h
new file mode 100644
index 0000000000..d46b490858
--- /dev/null
+++ b/support/highlight/src/gui-qt/ui_showtextfile.h
@@ -0,0 +1,105 @@
+/********************************************************************************
+** Form generated from reading UI file 'showtextfile.ui'
+**
+** Created: Wed Mar 31 16:43:25 2010
+** by: Qt User Interface Compiler version 4.6.2
+**
+** WARNING! All changes made in this file will be lost when recompiling UI file!
+********************************************************************************/
+
+#ifndef UI_SHOWTEXTFILE_H
+#define UI_SHOWTEXTFILE_H
+
+#include <QtCore/QVariant>
+#include <QtGui/QAction>
+#include <QtGui/QApplication>
+#include <QtGui/QButtonGroup>
+#include <QtGui/QDialog>
+#include <QtGui/QHBoxLayout>
+#include <QtGui/QHeaderView>
+#include <QtGui/QLabel>
+#include <QtGui/QPushButton>
+#include <QtGui/QSpacerItem>
+#include <QtGui/QTextEdit>
+#include <QtGui/QVBoxLayout>
+
+QT_BEGIN_NAMESPACE
+
+class Ui_ShowTextFile
+{
+public:
+ QVBoxLayout *verticalLayout;
+ QLabel *lbTitle;
+ QTextEdit *textEdit;
+ QHBoxLayout *horizontalLayout;
+ QSpacerItem *horizontalSpacer;
+ QPushButton *pushButton;
+
+ void setupUi(QDialog *ShowTextFile)
+ {
+ if (ShowTextFile->objectName().isEmpty())
+ ShowTextFile->setObjectName(QString::fromUtf8("ShowTextFile"));
+ ShowTextFile->setWindowModality(Qt::WindowModal);
+ ShowTextFile->resize(711, 442);
+ QIcon icon;
+ icon.addFile(QString::fromUtf8(":/hl_icon2.png"), QSize(), QIcon::Normal, QIcon::Off);
+ ShowTextFile->setWindowIcon(icon);
+ ShowTextFile->setModal(true);
+ verticalLayout = new QVBoxLayout(ShowTextFile);
+ verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
+ lbTitle = new QLabel(ShowTextFile);
+ lbTitle->setObjectName(QString::fromUtf8("lbTitle"));
+ QFont font;
+ font.setPointSize(10);
+ font.setBold(true);
+ font.setWeight(75);
+ lbTitle->setFont(font);
+
+ verticalLayout->addWidget(lbTitle);
+
+ textEdit = new QTextEdit(ShowTextFile);
+ textEdit->setObjectName(QString::fromUtf8("textEdit"));
+ QFont font1;
+ font1.setFamily(QString::fromUtf8("Courier New"));
+ font1.setPointSize(8);
+ textEdit->setFont(font1);
+
+ verticalLayout->addWidget(textEdit);
+
+ horizontalLayout = new QHBoxLayout();
+ horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
+ horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
+
+ horizontalLayout->addItem(horizontalSpacer);
+
+ pushButton = new QPushButton(ShowTextFile);
+ pushButton->setObjectName(QString::fromUtf8("pushButton"));
+ pushButton->setDefault(true);
+
+ horizontalLayout->addWidget(pushButton);
+
+
+ verticalLayout->addLayout(horizontalLayout);
+
+
+ retranslateUi(ShowTextFile);
+
+ QMetaObject::connectSlotsByName(ShowTextFile);
+ } // setupUi
+
+ void retranslateUi(QDialog *ShowTextFile)
+ {
+ ShowTextFile->setWindowTitle(QApplication::translate("ShowTextFile", "Show text", 0, QApplication::UnicodeUTF8));
+ lbTitle->setText(QApplication::translate("ShowTextFile", "TextLabel", 0, QApplication::UnicodeUTF8));
+ pushButton->setText(QApplication::translate("ShowTextFile", "OK", 0, QApplication::UnicodeUTF8));
+ } // retranslateUi
+
+};
+
+namespace Ui {
+ class ShowTextFile: public Ui_ShowTextFile {};
+} // namespace Ui
+
+QT_END_NAMESPACE
+
+#endif // UI_SHOWTEXTFILE_H
diff --git a/support/highlight/src/makefile b/support/highlight/src/makefile
new file mode 100644
index 0000000000..e2dbabf684
--- /dev/null
+++ b/support/highlight/src/makefile
@@ -0,0 +1,218 @@
+# Simple Makefile for Highlight
+# This file will compile the highlight library and binaries.
+# See INSTALL for instructions.
+
+# Add -DHL_DATA_DIR=\"/your/path/\" to CFLAGS if you want to define a
+# custom installation directory not listed in INSTALL.
+# Copy *.conf, ./langDefs, ./themes amd ./indentSchemes to /your/path/.
+# See ../makefile for the definition of ${data_dir}
+
+# Add -DHL_CONFIG_DIR=\"/your/path/\" to define the configuration directory
+# (default: /etc/highlight)
+
+# Add -DCONFIG_FILE_PATH=\"/your/path/.highlightrc\" if you want to define a
+# custom path to the highlight configuration file (default: $HOME/.highlightrc)
+
+# See src/gui-qt/highlight.pro for the Qt GUI compilation options
+
+CXX=c++
+
+QMAKE=qmake
+
+CFLAGS:=-O2 ${CFLAGS}
+#CFLAGS:=-ggdb ${CFLAGS}
+
+SO_VERSION=2.13
+
+# Source paths
+CORE_DIR=./core/
+CLI_DIR=./cli/
+GUI_QT_DIR=./gui-qt/
+
+# Third-Party software paths
+ASTYLE_DIR=${CORE_DIR}astyle/
+REGEX_DIR=${CORE_DIR}re/
+
+ifndef HL_CONFIG_DIR
+ HL_CONFIG_DIR = /etc/highlight/
+endif
+ifndef HL_DATA_DIR
+ HL_DATA_DIR = /usr/share/highlight/
+endif
+ifdef PIC
+ CFLAGS+=-fPIC
+endif
+
+# Do not strip by default (Mac OS X lazy pointer issues)
+# Add -static to avoid linking with shared libs (can cause trouble when highlight
+# is run as service)
+#LDFLAGS =
+#LDFLAGS = ${LDFLAGS} -s
+#LDFLAGS= -Wl,--as-needed
+
+CXX_COMPILE=${CXX} ${CFLAGS} -c -I ${CORE_DIR}
+
+# Data directories (data dir, configuration file dir)
+CXX_DIR=-DHL_DATA_DIR=\"${HL_DATA_DIR}\" -DHL_CONFIG_DIR=\"${HL_CONFIG_DIR}\"
+
+AR=ar
+ARFLAGS=-crs
+
+# objects files to build the library
+CORE_OBJECTS:=configurationreader.o stylecolour.o stringtools.o \
+ xhtmlgenerator.o latexgenerator.o texgenerator.o rtfgenerator.o \
+ htmlgenerator.o ansigenerator.o xmlgenerator.o svggenerator.o codegenerator.o \
+ xterm256generator.o bbcodegenerator.o \
+ languagedefinition.o elementstyle.o documentstyle.o \
+ datadir.o preformatter.o platform_fs.o ctagsreader.o\
+ ASStreamIterator.o ASResource.o ASFormatter.o ASBeautifier.o ASEnhancer.o\
+ Pattern.o Matcher.o
+
+# command line interface
+CLI_OBJECTS:=arg_parser.o cmdlineoptions.o main.o help.o
+
+# Qt user interface
+GUI_OBJECTS:=${GUI_QT_DIR}main.cpp ${GUI_QT_DIR}mainwindow.cpp ${GUI_QT_DIR}io_report.cpp ${GUI_QT_DIR}showtextfile.cpp
+
+
+cli: libhighlight.a ${CLI_OBJECTS}
+ ${CXX} ${LDFLAGS} -o highlight ${CLI_OBJECTS} -L. -lhighlight
+
+lib-static libhighlight.a: ${CORE_OBJECTS}
+ ${AR} ${ARFLAGS} libhighlight.a ${CORE_OBJECTS}
+
+lib-shared libhighlight.so.1.0: ${CORE_OBJECTS}
+ ld -shared -soname libhighlight.so.1 -o libhighlight.so.${SO_VERSION} -lc ${CORE_OBJECTS}
+
+gui-qt: highlight-gui
+
+highlight-gui: libhighlight.a ${GUI_OBJECTS}
+ cd gui-qt && \
+ ${QMAKE} 'DEFINES+=DATA_DIR=\\\"${HL_DATA_DIR}\\\" CONFIG_DIR=\\\"${HL_CONFIG_DIR}\\\" DOC_DIR=\\\"${HL_DOC_DIR}\\\"' && \
+ make
+
+$(OBJECTFILES) : makefile
+
+ansigenerator.o: ${CORE_DIR}ansigenerator.cpp ${CORE_DIR}ansigenerator.h ${CORE_DIR}codegenerator.h
+ ${CXX_COMPILE} ${CORE_DIR}ansigenerator.cpp
+
+ASBeautifier.o: ${ASTYLE_DIR}ASBeautifier.cpp ${ASTYLE_DIR}astyle.h
+ ${CXX_COMPILE} ${ASTYLE_DIR}ASBeautifier.cpp
+
+ASFormatter.o: ${ASTYLE_DIR}ASFormatter.cpp ${ASTYLE_DIR}astyle.h
+ ${CXX_COMPILE} ${ASTYLE_DIR}ASFormatter.cpp
+
+ASResource.o: ${ASTYLE_DIR}ASResource.cpp ${ASTYLE_DIR}astyle.h
+ ${CXX_COMPILE} ${ASTYLE_DIR}ASResource.cpp
+
+ASEnhancer.o: ${ASTYLE_DIR}ASResource.cpp ${ASTYLE_DIR}astyle.h
+ ${CXX_COMPILE} ${ASTYLE_DIR}ASEnhancer.cpp
+
+ASStreamIterator.o: ${ASTYLE_DIR}ASStreamIterator.cpp ${ASTYLE_DIR}astyle.h
+ ${CXX_COMPILE} ${ASTYLE_DIR}ASStreamIterator.cpp
+
+cmdlineoptions.o: ${CLI_DIR}cmdlineoptions.cpp ${CLI_DIR}cmdlineoptions.h
+ ${CXX_COMPILE} ${CLI_DIR}cmdlineoptions.cpp
+
+codegenerator.o: ${CORE_DIR}codegenerator.cpp ${CORE_DIR}codegenerator.h ${CORE_DIR}languagedefinition.h \
+ ${CORE_DIR}configurationreader.h ${CORE_DIR}stringtools.h ${CORE_DIR}enums.h ${CORE_DIR}documentstyle.h \
+ ${CORE_DIR}elementstyle.h ${CORE_DIR}stylecolour.h ${ASTYLE_DIR}astyle.h ${CORE_DIR}preformatter.h \
+ ${CORE_DIR}htmlgenerator.h ${CORE_DIR}version.h ${CORE_DIR}charcodes.h ${CORE_DIR}xhtmlgenerator.h ${CORE_DIR}rtfgenerator.h \
+ ${CORE_DIR}latexgenerator.h ${CORE_DIR}texgenerator.h ${CORE_DIR}ansigenerator.h
+ ${CXX_COMPILE} ${CORE_DIR}codegenerator.cpp
+
+configurationreader.o: ${CORE_DIR}configurationreader.cpp ${CORE_DIR}configurationreader.h \
+ ${CORE_DIR}stringtools.h
+ ${CXX_COMPILE} ${CORE_DIR}configurationreader.cpp
+
+datadir.o: ${CORE_DIR}datadir.cpp ${CORE_DIR}datadir.h ${CORE_DIR}platform_fs.h
+ ${CXX_COMPILE} ${CORE_DIR}datadir.cpp ${CXX_DIR}
+
+platform_fs.o: ${CORE_DIR}platform_fs.cpp ${CORE_DIR}platform_fs.h
+ ${CXX_COMPILE} ${CORE_DIR}platform_fs.cpp
+
+documentstyle.o: ${CORE_DIR}documentstyle.cpp ${CORE_DIR}documentstyle.h ${CORE_DIR}configurationreader.h \
+ ${CORE_DIR}stringtools.h ${CORE_DIR}elementstyle.h ${CORE_DIR}stylecolour.h
+ ${CXX_COMPILE} ${CORE_DIR}documentstyle.cpp
+
+elementstyle.o: ${CORE_DIR}elementstyle.cpp ${CORE_DIR}elementstyle.h ${CORE_DIR}stylecolour.h
+ ${CXX_COMPILE} ${CORE_DIR}elementstyle.cpp
+
+help.o: ${CLI_DIR}help.cpp ${CLI_DIR}help.h
+ ${CXX_COMPILE} ${CLI_DIR}help.cpp
+
+htmlgenerator.o: ${CORE_DIR}htmlgenerator.cpp ${CORE_DIR}htmlgenerator.h ${CORE_DIR}codegenerator.h
+ ${CXX_COMPILE} ${CORE_DIR}htmlgenerator.cpp
+
+languagedefinition.o: ${CORE_DIR}languagedefinition.cpp ${CORE_DIR}languagedefinition.h \
+ ${CORE_DIR}configurationreader.h ${CORE_DIR}platform_fs.h ${CORE_DIR}enums.h ${CORE_DIR}stringtools.h
+ ${CXX_COMPILE} ${CORE_DIR}languagedefinition.cpp
+
+latexgenerator.o: ${CORE_DIR}latexgenerator.cpp ${CORE_DIR}latexgenerator.h ${CORE_DIR}codegenerator.h
+ ${CXX_COMPILE} ${CORE_DIR}latexgenerator.cpp
+
+bbcodegenerator.o: ${CORE_DIR}bbcodegenerator.cpp ${CORE_DIR}bbcodegenerator.h ${CORE_DIR}codegenerator.h
+ ${CXX_COMPILE} ${CORE_DIR}bbcodegenerator.cpp
+
+preformatter.o: ${CORE_DIR}preformatter.cpp ${CORE_DIR}preformatter.h ${CORE_DIR}stringtools.h
+ ${CXX_COMPILE} ${CORE_DIR}preformatter.cpp
+
+main.o: ${CLI_DIR}main.cpp ${CLI_DIR}main.h ${CLI_DIR}cmdlineoptions.h ${CORE_DIR}platform_fs.h \
+ ${CORE_DIR}configurationreader.h ${CORE_DIR}datadir.h ${CORE_DIR}enums.h ${CORE_DIR}codegenerator.h \
+ ${CORE_DIR}languagedefinition.h ${CORE_DIR}documentstyle.h ${CORE_DIR}elementstyle.h \
+ ${CORE_DIR}stylecolour.h ${ASTYLE_DIR}astyle.h ${CORE_DIR}preformatter.h \
+ ${CLI_DIR}help.h ${CORE_DIR}version.h
+ ${CXX_COMPILE} ${CLI_DIR}main.cpp ${CXX_DIR}
+
+rtfgenerator.o: ${CORE_DIR}rtfgenerator.cpp ${CORE_DIR}rtfgenerator.h ${CORE_DIR}codegenerator.h
+ ${CXX_COMPILE} ${CORE_DIR}rtfgenerator.cpp
+
+stringtools.o: ${CORE_DIR}stringtools.cpp ${CORE_DIR}stringtools.h
+ ${CXX_COMPILE} ${CORE_DIR}stringtools.cpp
+
+stylecolour.o: ${CORE_DIR}stylecolour.cpp ${CORE_DIR}stylecolour.h ${CORE_DIR}enums.h ${CORE_DIR}stringtools.h
+ ${CXX_COMPILE} ${CORE_DIR}stylecolour.cpp
+
+texgenerator.o: ${CORE_DIR}texgenerator.cpp ${CORE_DIR}texgenerator.h ${CORE_DIR}codegenerator.h
+ ${CXX_COMPILE} ${CORE_DIR}texgenerator.cpp
+
+xhtmlgenerator.o: ${CORE_DIR}xhtmlgenerator.cpp ${CORE_DIR}xhtmlgenerator.h ${CORE_DIR}htmlgenerator.h \
+ ${CORE_DIR}codegenerator.h
+ ${CXX_COMPILE} ${CORE_DIR}xhtmlgenerator.cpp
+
+xmlgenerator.o: ${CORE_DIR}xmlgenerator.cpp ${CORE_DIR}xmlgenerator.h ${CORE_DIR}codegenerator.h
+ ${CXX_COMPILE} ${CORE_DIR}xmlgenerator.cpp
+
+svggenerator.o: ${CORE_DIR}svggenerator.cpp ${CORE_DIR}svggenerator.h ${CORE_DIR}codegenerator.h
+ ${CXX_COMPILE} ${CORE_DIR}svggenerator.cpp
+
+xterm256generator.o: ${CORE_DIR}xterm256generator.cpp ${CORE_DIR}xterm256generator.h ${CORE_DIR}codegenerator.h
+ ${CXX_COMPILE} ${CORE_DIR}xterm256generator.cpp
+
+Matcher.o: ${REGEX_DIR}Matcher.cpp ${REGEX_DIR}Matcher.h
+ ${CXX_COMPILE} ${REGEX_DIR}Matcher.cpp
+
+Pattern.o: ${REGEX_DIR}Pattern.cpp ${REGEX_DIR}Pattern.h
+ ${CXX_COMPILE} ${REGEX_DIR}Pattern.cpp
+
+arg_parser.o: ${CLI_DIR}arg_parser.cc ${CLI_DIR}arg_parser.h
+ ${CXX_COMPILE} ${CLI_DIR}arg_parser.cc
+
+ctagsreader.o: ${CORE_DIR}ctagsreader.cpp ${CORE_DIR}ctagsreader.h
+ ${CXX_COMPILE} ${CORE_DIR}ctagsreader.cpp
+
+
+.PHONY: ${GUI_OBJECTS}
+
+clean:
+ @rm -f *.o
+ @rm -f ./highlight
+ @rm -f ./highlight-gui
+ @rm -f ./libhighlight.a
+ @rm -f ./libhighlight.so.*
+ @rm -f ./.deps/*
+ @rm -f gui-qt/*.o
+ @rm -f gui-qt/Makefile*
+ @rm -f gui-qt/object_script.*
+ @rm -f gui-qt/ui_*.h gui-qt/qrc_*.cpp gui-qt/moc_*.cpp
+ @rm -rf gui-qt/highlight-gui.gch/
diff --git a/support/highlight/themes/acid.style b/support/highlight/themes/acid.style
new file mode 100644
index 0000000000..a46cc5b738
--- /dev/null
+++ b/support/highlight/themes/acid.style
@@ -0,0 +1,22 @@
+# acid.style - style
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+# This theme was made by AciD <acid@cpm-fr.com>
+
+$DEFAULTCOLOUR=#000000
+$BGCOLOUR=#eeeeee
+$FONTSIZE=10
+$KW-GROUP(kwa)=#bb7977 bold
+$KW-GROUP(kwb)=#8080c0 bold
+$KW-GROUP(kwc)=#0080c0
+$KW-GROUP(kwd)=#004466
+$NUMBER=#800080 bold
+$ESCAPECHAR=#ff00ff bold
+$STRING=#a68500
+$STRING-DIRECTIVE=#0000ff
+$COMMENT=#ff8000
+$SL-COMMENT=#f27900
+$DIRECTIVE=#0080c0 bold
+$LINE=#303030
+$SYMBOL=#ff0080 bold
+$MARK-LINE=#ffffbb
diff --git a/support/highlight/themes/bipolar.style b/support/highlight/themes/bipolar.style
new file mode 100644
index 0000000000..11e02edd42
--- /dev/null
+++ b/support/highlight/themes/bipolar.style
@@ -0,0 +1,21 @@
+# bipolar.style
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#d62b9a
+$BGCOLOUR=#0f020a
+$FONTSIZE=10
+$KW-GROUP(kwa)=#20c79d bold
+$KW-GROUP(kwb)=#1d9617 bold
+$KW-GROUP(kwc)=#72d42c bold
+$KW-GROUP(kwd)=#81e535 bold
+$NUMBER=#0083c9
+$ESCAPECHAR=#2fa4a8
+$STRING=#eba236
+$STRING-DIRECTIVE=#d9eb36
+$COMMENT=#35d6e5 italic
+$SL-COMMENT=#35d6e5 italic
+$DIRECTIVE=#6b5deb
+$LINE=#999999
+$SYMBOL=#e3d922
+$MARK-LINE=#535052 \ No newline at end of file
diff --git a/support/highlight/themes/blacknblue.style b/support/highlight/themes/blacknblue.style
new file mode 100644
index 0000000000..35832cee1d
--- /dev/null
+++ b/support/highlight/themes/blacknblue.style
@@ -0,0 +1,20 @@
+# blacknblue.style
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#22a0d6
+$BGCOLOUR=#000000
+$FONTSIZE=10
+$KW-GROUP(kwa)=#1ededc bold
+$KW-GROUP(kwb)=#c06cf8 bold
+$KW-GROUP(kwc)=#00ff99
+$KW-GROUP(kwd)=#1ceddc
+$NUMBER=#cc3366
+$ESCAPECHAR=#88cf32
+$STRING=#cfc631
+$STRING-DIRECTIVE=#cfc631
+$COMMENT=#c47b6a italic
+$DIRECTIVE=#8080ff
+$SYMBOL=#ccc6c6
+$LINE=#888888
+$MARK-LINE=#404040
diff --git a/support/highlight/themes/bright.style b/support/highlight/themes/bright.style
new file mode 100644
index 0000000000..7ae92dd01d
--- /dev/null
+++ b/support/highlight/themes/bright.style
@@ -0,0 +1,20 @@
+# bright2.style
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#330066
+$BGCOLOUR=#ffffff
+$FONTSIZE=10
+$KW-GROUP(kwa)=#ff3030
+$KW-GROUP(kwb)=#F48C23
+$KW-GROUP(kwc)=#0000ff
+$KW-GROUP(kwd)=#d11ced
+$NUMBER=#32ba06
+$ESCAPECHAR=#a61761
+$STRING=#1861a7
+$STRING-DIRECTIVE=#663300
+$COMMENT=#006633
+$DIRECTIVE=#5374b0
+$LINE=#9a9a9a
+$SYMBOL=#555555
+$MARK-LINE=#ffffbb
diff --git a/support/highlight/themes/contrast.style b/support/highlight/themes/contrast.style
new file mode 100644
index 0000000000..233e30a4e1
--- /dev/null
+++ b/support/highlight/themes/contrast.style
@@ -0,0 +1,21 @@
+# contrast.style
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#ff3366
+$BGCOLOUR=#5c2602
+$FONTSIZE=10
+$KW-GROUP(kwa)=#ffffff
+$KW-GROUP(kwb)=#ffffff bold
+$KW-GROUP(kwc)=#11f80c bold
+$KW-GROUP(kwd)=#fff700 bold
+$NUMBER=#3bd9a1
+$ESCAPECHAR=#11f80c
+$STRING=#11f80c
+$STRING-DIRECTIVE=#11f80c
+$COMMENT=#7f9fff
+$SL-COMMENT=#7f9fff
+$DIRECTIVE=#7b44e0
+$LINE=#adadad
+$SYMBOL=#dedede bold
+$MARK-LINE=#256e11
diff --git a/support/highlight/themes/darkblue.style b/support/highlight/themes/darkblue.style
new file mode 100644
index 0000000000..ac8a660d2f
--- /dev/null
+++ b/support/highlight/themes/darkblue.style
@@ -0,0 +1,21 @@
+# darkblue.style (taken from GVIM)
+# This file is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#ffffff
+$BGCOLOUR=#000040
+$FONTSIZE=10
+$KW-GROUP(kwa)=#e2e825
+$KW-GROUP(kwb)=#60ff60
+$KW-GROUP(kwc)=#26e0e7
+$KW-GROUP(kwd)=#e825e2 bold
+$NUMBER=#42cad9
+$ESCAPECHAR=#a1a1ff
+$STRING=#ffa0a0
+$STRING-DIRECTIVE=#ffa0a0
+$COMMENT=#80a0ff
+$SL-COMMENT=#ff7f9f
+$DIRECTIVE=#ff80ff
+$LINE=#e5d28e
+$SYMBOL=#bababa
+$MARK-LINE=#006600
diff --git a/support/highlight/themes/darkness.style b/support/highlight/themes/darkness.style
new file mode 100644
index 0000000000..1030ec39a3
--- /dev/null
+++ b/support/highlight/themes/darkness.style
@@ -0,0 +1,20 @@
+# darkness.style
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#ffffff
+$BGCOLOUR=#000000
+$FONTSIZE=10
+$KW-GROUP(kwa)=#ffff00 bold
+$KW-GROUP(kwb)=#00ff00
+$KW-GROUP(kwc)=#26e0e7
+$KW-GROUP(kwd)=#f34627
+$NUMBER=#619de7
+$ESCAPECHAR=#00abab
+$STRING=#abab00 bold
+$STRING-DIRECTIVE=#abab00
+$COMMENT=#008888
+$DIRECTIVE=#1da3cf
+$LINE=#888888
+$SYMBOL=#ff00ff
+$MARK-LINE=#444444
diff --git a/support/highlight/themes/desert.style b/support/highlight/themes/desert.style
new file mode 100644
index 0000000000..048f2644e0
--- /dev/null
+++ b/support/highlight/themes/desert.style
@@ -0,0 +1,22 @@
+# desert.style
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#fffdec
+$BGCOLOUR=#868063
+$FONTSIZE=10
+
+$KW-GROUP(kwa)=#004c00 bold
+$KW-GROUP(kwb)=#fef8bc bold
+$KW-GROUP(kwc)=#7b3587 bold
+$KW-GROUP(kwd)=#f3d266 bold
+$NUMBER=#3300cc
+$ESCAPECHAR=#f6f647
+$STRING=#f6f647
+$STRING-DIRECTIVE=#f6f647
+$COMMENT=#500000
+$SL-COMMENT=#00004f
+$DIRECTIVE=#6a2e10
+$LINE=#2b2b2b
+$SYMBOL=#2b2b2b
+$MARK-LINE=#b1625a
diff --git a/support/highlight/themes/easter.style b/support/highlight/themes/easter.style
new file mode 100644
index 0000000000..5dd955efe1
--- /dev/null
+++ b/support/highlight/themes/easter.style
@@ -0,0 +1,20 @@
+# easter.style
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#2C7B34
+$BGCOLOUR=#fff9b9
+$FONTSIZE=10
+$KW-GROUP(kwa)=#1d45d6 bold
+$KW-GROUP(kwb)=#ed0f55 bold
+$KW-GROUP(kwc)=#26aae7 bold
+$KW-GROUP(kwd)=#1d45d6
+$NUMBER=#e11a70
+$ESCAPECHAR=#3ea392
+$STRING=#ca4be3
+$STRING-DIRECTIVE=#ca4be3
+$COMMENT=#1ea411 italic
+$DIRECTIVE=#1583b1
+$LINE=#7717b7
+$SYMBOL=#fa4700
+$MARK-LINE=#ffffff
diff --git a/support/highlight/themes/emacs.style b/support/highlight/themes/emacs.style
new file mode 100644
index 0000000000..00e28fc185
--- /dev/null
+++ b/support/highlight/themes/emacs.style
@@ -0,0 +1,20 @@
+# emacs- style
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#000000
+$BGCOLOUR=#ffffff
+$FONTSIZE=10
+$KW-GROUP(kwa)=#9c20ee bold
+$KW-GROUP(kwb)=#208920
+$KW-GROUP(kwc)=#0000ff
+$KW-GROUP(kwd)=#000000
+$NUMBER=#000000
+$ESCAPECHAR=#bd8d8b
+$STRING=#bd8d8b
+$STRING-DIRECTIVE=#bd8d8b
+$COMMENT=#ac2020 italic
+$DIRECTIVE=#000000
+$LINE=#555555
+$SYMBOL=#000000
+$MARK-LINE=#ffffbb
diff --git a/support/highlight/themes/golden.style b/support/highlight/themes/golden.style
new file mode 100644
index 0000000000..3d2b3462ad
--- /dev/null
+++ b/support/highlight/themes/golden.style
@@ -0,0 +1,21 @@
+# golden.style
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#ddbb00
+$BGCOLOUR=#000000
+$FONTSIZE=10
+
+$KW-GROUP(kwa)=#ffed8a bold
+$KW-GROUP(kwb)=#ffed8a
+$KW-GROUP(kwc)=#dedede bold
+$KW-GROUP(kwd)=#ddbb00 bold
+$NUMBER=#ffffff
+$ESCAPECHAR=#3399cc
+$STRING=#ff0000
+$STRING-DIRECTIVE=#ff0000
+$COMMENT=#978345 italic
+$DIRECTIVE=#ffddaa
+$LINE=#898989
+$SYMBOL=#ababab
+$MARK-LINE=#404040
diff --git a/support/highlight/themes/greenlcd.style b/support/highlight/themes/greenlcd.style
new file mode 100644
index 0000000000..5be75ea1ce
--- /dev/null
+++ b/support/highlight/themes/greenlcd.style
@@ -0,0 +1,21 @@
+# greenlcd.style
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#00bb00
+$BGCOLOUR=#003000
+$FONTSIZE=10
+
+$KW-GROUP(kwa)=#00ed00 bold
+$KW-GROUP(kwb)=#00ed00
+$KW-GROUP(kwc)=#beef13
+$KW-GROUP(kwd)=#c0ff73
+$NUMBER=#3399cc
+$ESCAPECHAR=#3399cc
+$STRING=#dfdfdf
+$STRING-DIRECTIVE=#dfdfdf
+$COMMENT=#888888 italic
+$DIRECTIVE=#bfbfbf
+$LINE=#bcbcbc
+$SYMBOL=#2fe7a9
+$MARK-LINE=#146176
diff --git a/support/highlight/themes/ide-anjuta.style b/support/highlight/themes/ide-anjuta.style
new file mode 100644
index 0000000000..20fd362be9
--- /dev/null
+++ b/support/highlight/themes/ide-anjuta.style
@@ -0,0 +1,20 @@
+# ide-anjuta.style
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#000000
+$BGCOLOUR=#ffffff
+$FONTSIZE=10
+$KW-GROUP(kwa)=#000080 bold
+$KW-GROUP(kwb)=#000080
+$KW-GROUP(kwc)=#0000ff
+$KW-GROUP(kwd)=#000000
+$NUMBER=#008800
+$ESCAPECHAR=#ddbb00
+$STRING=#ddbb00
+$STRING-DIRECTIVE=#ddbb00
+$COMMENT=#ff0000 italic
+$DIRECTIVE=#678000
+$LINE=#ff0000
+$SYMBOL=#000000
+$MARK-LINE=#ffffbb
diff --git a/support/highlight/themes/ide-codewarrior.style b/support/highlight/themes/ide-codewarrior.style
new file mode 100644
index 0000000000..473ef0779a
--- /dev/null
+++ b/support/highlight/themes/ide-codewarrior.style
@@ -0,0 +1,20 @@
+# codewarrior.style
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#000000
+$BGCOLOUR=#ffffff
+$FONTSIZE=10
+$KW-GROUP(kwa)=#0000b3
+$KW-GROUP(kwb)=#4c73a6
+$KW-GROUP(kwc)=#0000b3
+$KW-GROUP(kwd)=#000000
+$NUMBER=#000000
+$ESCAPECHAR=#666666
+$STRING=#666666
+$STRING-DIRECTIVE=#000000
+$COMMENT=#b30000
+$DIRECTIVE=#0000b3
+$LINE=#555555
+$SYMBOL=#000000
+$MARK-LINE=#ffffbb
diff --git a/support/highlight/themes/ide-eclipse.style b/support/highlight/themes/ide-eclipse.style
new file mode 100644
index 0000000000..6b16ca1313
--- /dev/null
+++ b/support/highlight/themes/ide-eclipse.style
@@ -0,0 +1,20 @@
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#000000
+$BGCOLOUR=#ffffff
+$FONTSIZE=10
+$KW-GROUP(kwa)=#7f0055 bold
+$KW-GROUP(kwb)=#7f0055 bold
+$KW-GROUP(kwc)=#7f0055 bold
+$KW-GROUP(kwd)=#000000
+$NUMBER=#000000
+$ESCAPECHAR=#0000ff
+$STRING=#0000ff
+$STRING-DIRECTIVE=#7f9fbf
+$COMMENT=#717ab3
+$DIRECTIVE=#3f5fbf
+$LINE=#000000
+$SL-COMMENT=#2f9956
+$SYMBOL=#000000
+$MARK-LINE=#ffffbb
diff --git a/support/highlight/themes/ide-kdev.style b/support/highlight/themes/ide-kdev.style
new file mode 100644
index 0000000000..f1989dc3b7
--- /dev/null
+++ b/support/highlight/themes/ide-kdev.style
@@ -0,0 +1,20 @@
+# ide-kdev.style
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#000000
+$BGCOLOUR=#ffffff
+$FONTSIZE=10
+$KW-GROUP(kwa)=#600000 bold
+$KW-GROUP(kwb)=#600000
+$KW-GROUP(kwc)=#600000 bold
+$KW-GROUP(kwd)=#000000
+$NUMBER=#0000ff
+$ESCAPECHAR=#ff0000
+$STRING=#ff0000
+$STRING-DIRECTIVE=#ff0000
+$COMMENT=#bfbfbf italic
+$DIRECTIVE=#008000
+$LINE=#bfbfbf
+$SYMBOL=#000000
+$MARK-LINE=#ffffbb
diff --git a/support/highlight/themes/ide-msvs2008.style b/support/highlight/themes/ide-msvs2008.style
new file mode 100644
index 0000000000..0086b24db9
--- /dev/null
+++ b/support/highlight/themes/ide-msvs2008.style
@@ -0,0 +1,20 @@
+# ide-msvs2008.style
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#000000
+$BGCOLOUR=#ffffff
+$FONTSIZE=10
+$KW-GROUP(kwa)=#0000ff
+$KW-GROUP(kwb)=#0000ff
+$KW-GROUP(kwc)=#2b91af
+$KW-GROUP(kwd)=#000000
+$NUMBER=#000000
+$ESCAPECHAR=#a31515
+$STRING=#a31515
+$STRING-DIRECTIVE=#0000ff
+$COMMENT=#008000
+$DIRECTIVE=#0000ff
+$LINE=#2b91af
+$SYMBOL=#000000
+$MARK-LINE=#ffffbb
diff --git a/support/highlight/themes/ide-xcode.style b/support/highlight/themes/ide-xcode.style
new file mode 100644
index 0000000000..cfc2b630ff
--- /dev/null
+++ b/support/highlight/themes/ide-xcode.style
@@ -0,0 +1,19 @@
+# xcode.style
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#000000
+$BGCOLOUR=#ffffff
+$FONTSIZE=10
+$KW-GROUP(kwa)=#8f0055
+$KW-GROUP(kwb)=#8f0055
+$KW-GROUP(kwc)=#8f0055
+$KW-GROUP(kwd)=#000000
+$NUMBER=#2300ff
+$STRING=#c00000
+$STRING-DIRECTIVE=#733710
+$COMMENT=#007f1c
+$DIRECTIVE=#733710
+$LINE=#808080
+$SYMBOL=#000000
+$MARK-LINE=#ffffbb
diff --git a/support/highlight/themes/jedit.style b/support/highlight/themes/jedit.style
new file mode 100644
index 0000000000..078baf956c
--- /dev/null
+++ b/support/highlight/themes/jedit.style
@@ -0,0 +1,20 @@
+# jedit - style
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#000000
+$BGCOLOUR=#ffffff
+$FONTSIZE=10
+$KW-GROUP(kwa)=#009966 bold
+$KW-GROUP(kwb)=#009966 bold
+$KW-GROUP(kwc)=#0099ff
+$KW-GROUP(kwd)=#9966ff
+$NUMBER=#ff0000
+$ESCAPECHAR=#ff00ff
+$STRING=#ff00cc
+$STRING-DIRECTIVE=#818100
+$COMMENT=#cc0000
+$DIRECTIVE=#0000ff
+$LINE=#555555
+$SYMBOL=#000000 bold
+$MARK-LINE=#ffffbb
diff --git a/support/highlight/themes/kwrite.style b/support/highlight/themes/kwrite.style
new file mode 100644
index 0000000000..dcce573456
--- /dev/null
+++ b/support/highlight/themes/kwrite.style
@@ -0,0 +1,20 @@
+# kwrite - style
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#000000
+$BGCOLOUR=#ffffff
+$FONTSIZE=10
+$KW-GROUP(kwa)=#000000 bold
+$KW-GROUP(kwb)=#830000
+$KW-GROUP(kwc)=#000000 bold
+$KW-GROUP(kwd)=#010181
+$NUMBER=#2928ff
+$ESCAPECHAR=#ff00ff
+$STRING=#ff0000
+$STRING-DIRECTIVE=#818100
+$COMMENT=#838183 italic
+$DIRECTIVE=#008200
+$LINE=#555555
+$SYMBOL=#000000
+$MARK-LINE=#ffffbb
diff --git a/support/highlight/themes/lucretia.style b/support/highlight/themes/lucretia.style
new file mode 100644
index 0000000000..add0fe609a
--- /dev/null
+++ b/support/highlight/themes/lucretia.style
@@ -0,0 +1,21 @@
+# megadeth.style (inspired by the Rust In Peace cover)
+# This file is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#de9d7c
+$BGCOLOUR=#001C42
+$FONTSIZE=10
+$KW-GROUP(kwa)=#696093
+$KW-GROUP(kwb)=#29a655
+$KW-GROUP(kwc)=#427142
+$KW-GROUP(kwd)=#A59A39
+$NUMBER=#63759C
+$ESCAPECHAR=#6B924A
+$STRING=#E7F3B5
+$STRING-DIRECTIVE=#E7F3B5
+$COMMENT=#944D39
+$SL-COMMENT=#AD5D31
+$DIRECTIVE=#815d8c
+$LINE=#73758C
+$SYMBOL=#6A7969
+$MARK-LINE=#511168
diff --git a/support/highlight/themes/matlab.style b/support/highlight/themes/matlab.style
new file mode 100644
index 0000000000..99fd1585ac
--- /dev/null
+++ b/support/highlight/themes/matlab.style
@@ -0,0 +1,17 @@
+# matlab.style (done by David)
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#000000
+$BGCOLOUR=#ffffff
+$FONTSIZE=10
+$KW-GROUP(kwa)=#0000ff
+$KW-GROUP(kwb)=#000000
+$KW-GROUP(kwc)=#0000ff
+$KW-GROUP(kwd)=#000000
+$NUMBER=#000000
+$ESCAPECHAR=#000000
+$STRING=#800000
+$STRING-DIRECTIVE=#800000
+$SYMBOL=#000000
+$MARK-LINE=#ffffbb
diff --git a/support/highlight/themes/moe.style b/support/highlight/themes/moe.style
new file mode 100644
index 0000000000..e18597d454
--- /dev/null
+++ b/support/highlight/themes/moe.style
@@ -0,0 +1,21 @@
+# acid.style - style
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#000000
+$BGCOLOUR=#f6f6f6
+$FONTSIZE=10
+$KW-GROUP(kwa)=#661111 bold
+$KW-GROUP(kwb)=#000066 bold
+$KW-GROUP(kwc)=#000066
+$KW-GROUP(kwd)=#004466
+$NUMBER=#880022
+$ESCAPECHAR=#ff00ff bold
+$STRING=#aa4400
+$STRING-DIRECTIVE=#008800
+$COMMENT=#ff8800
+$SL-COMMENT=#ee7700
+$DIRECTIVE=#008844 bold
+$LINE=#333333
+$SYMBOL=#000000 bold
+$MARK-LINE=#ffffbb
diff --git a/support/highlight/themes/navy.style b/support/highlight/themes/navy.style
new file mode 100644
index 0000000000..b51530418f
--- /dev/null
+++ b/support/highlight/themes/navy.style
@@ -0,0 +1,20 @@
+# navy.style
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#008bff
+$BGCOLOUR=#000035
+$FONTSIZE=10
+$KW-GROUP(kwa)=#f8c50b bold
+$KW-GROUP(kwb)=#e1e72f
+$KW-GROUP(kwc)=#13d8ef
+$KW-GROUP(kwd)=#ffffff
+$NUMBER=#f87ff4
+$ESCAPECHAR=#66f5ff
+$STRING=#ff7f66
+$STRING-DIRECTIVE=#ffffff
+$COMMENT=#ffbb00 italic
+$DIRECTIVE=#bb00ff
+$LINE=#888888
+$SYMBOL=#ffffff
+$MARK-LINE=#30445a
diff --git a/support/highlight/themes/nedit.style b/support/highlight/themes/nedit.style
new file mode 100644
index 0000000000..a31a8bccb3
--- /dev/null
+++ b/support/highlight/themes/nedit.style
@@ -0,0 +1,20 @@
+# nedit.style
+# This file is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#000000
+$BGCOLOUR=#ffffff
+$FONTSIZE=10
+$KW-GROUP(kwa)=#000000 bold
+$KW-GROUP(kwb)=#a52a2a bold
+$KW-GROUP(kwc)=#dda0dd bold
+$KW-GROUP(kwd)=#000000
+$NUMBER=#006400
+$ESCAPECHAR=#2e8b57
+$STRING=#006400
+$STRING-DIRECTIVE=#27408b
+$COMMENT=#000000 italic
+$DIRECTIVE=#27408b
+$LINE=#777777
+$SYMBOL=#000000 bold
+$MARK-LINE=#ffffbb
diff --git a/support/highlight/themes/neon.style b/support/highlight/themes/neon.style
new file mode 100644
index 0000000000..dbbfc27f6c
--- /dev/null
+++ b/support/highlight/themes/neon.style
@@ -0,0 +1,20 @@
+# neon.style - style
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#ffffff
+$BGCOLOUR=#000000
+$FONTSIZE=10
+$KW-GROUP(kwa)=#00ffff bold
+$KW-GROUP(kwb)=#ffff00
+$KW-GROUP(kwc)=#ef1347 bold
+$KW-GROUP(kwd)=#ffffff bold
+$NUMBER=#ff00ff
+$ESCAPECHAR=#cd00ff
+$STRING=#cd00ff
+$STRING-DIRECTIVE=#cd00ff
+$COMMENT=#00ff00 italic
+$DIRECTIVE=#ffbb00
+$LINE=#55abff
+$SYMBOL=#ee5896 bold
+$MARK-LINE=#404040
diff --git a/support/highlight/themes/night.style b/support/highlight/themes/night.style
new file mode 100644
index 0000000000..0fdb1236e0
--- /dev/null
+++ b/support/highlight/themes/night.style
@@ -0,0 +1,21 @@
+# night.style
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#cc00ee
+$BGCOLOUR=#000044
+$FONTSIZE=10
+$KW-GROUP(kwa)=#ffffff bold
+$KW-GROUP(kwb)=#f1157c bold
+$KW-GROUP(kwc)=#7aec27 bold
+$KW-GROUP(kwd)=#ff06cd bold
+$NUMBER=#8ee119
+$ESCAPECHAR=#82d66d
+$STRING=#dddddd
+$STRING-DIRECTIVE=#dddddd
+$COMMENT=#59c9f9
+$SL-COMMENT=#59c9f9
+$DIRECTIVE=#00bb00
+$LINE=#e7ee5c
+$SYMBOL=#e7ee5c bold
+$MARK-LINE=#000000
diff --git a/support/highlight/themes/orion.style b/support/highlight/themes/orion.style
new file mode 100644
index 0000000000..7426db41a3
--- /dev/null
+++ b/support/highlight/themes/orion.style
@@ -0,0 +1,21 @@
+# metallica.style (inspired by the Master Of Puppets cover)
+# This file is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#C4B1A8
+$BGCOLOUR=#1E1616
+$FONTSIZE=10
+$KW-GROUP(kwa)=#49d4d6
+$KW-GROUP(kwb)=#BA1919
+$KW-GROUP(kwc)=#7B2421
+$KW-GROUP(kwd)=#AD5139
+$NUMBER=#9C928C
+$ESCAPECHAR=#837D83
+$STRING=#635D63
+$STRING-DIRECTIVE=#635D63
+$COMMENT=#C4674A
+$SL-COMMENT=#C4674A
+$DIRECTIVE=#E7A731
+$LINE=#9C928C
+$SYMBOL=#506070
+$MARK-LINE=#394e62
diff --git a/support/highlight/themes/pablo.style b/support/highlight/themes/pablo.style
new file mode 100644
index 0000000000..7d7dda8d3a
--- /dev/null
+++ b/support/highlight/themes/pablo.style
@@ -0,0 +1,20 @@
+# pablo.style (taken from GVIM)
+# This file is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#ffffff
+$BGCOLOUR=#000000
+$FONTSIZE=10
+$KW-GROUP(kwa)=#c0c000 bold
+$KW-GROUP(kwb)=#00c000 bold
+$KW-GROUP(kwc)=#3939bf bold
+$KW-GROUP(kwd)=#21ffc0
+$NUMBER=#00ffff
+$ESCAPECHAR=#ff6600
+$STRING=#00ffff
+$STRING-DIRECTIVE=#00ffff
+$COMMENT=#808080
+$DIRECTIVE=#66ff66
+$LINE=#808080
+$SYMBOL=#ff0000
+$MARK-LINE=#404040
diff --git a/support/highlight/themes/peachpuff.style b/support/highlight/themes/peachpuff.style
new file mode 100644
index 0000000000..2313ea56a7
--- /dev/null
+++ b/support/highlight/themes/peachpuff.style
@@ -0,0 +1,20 @@
+# peachpuff.style (taken from GVIM)
+# This file is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#000000
+$BGCOLOUR=#ffdab9
+$FONTSIZE=10
+$KW-GROUP(kwa)=#a52a2a bold
+$KW-GROUP(kwb)=#2e8b57 bold
+$KW-GROUP(kwc)=#275fec bold
+$KW-GROUP(kwd)=#521cc7
+$NUMBER=#c00058
+$ESCAPECHAR=#6a5acd
+$STRING=#c00058
+$STRING-DIRECTIVE=#c00058
+$COMMENT=#406090
+$DIRECTIVE=#cd00cd
+$LINE=#406090
+$SYMBOL=#000000
+$MARK-LINE=#ffffbb
diff --git a/support/highlight/themes/print.style b/support/highlight/themes/print.style
new file mode 100644
index 0000000000..ad13910a52
--- /dev/null
+++ b/support/highlight/themes/print.style
@@ -0,0 +1,20 @@
+# Print - style
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#000000
+$BGCOLOUR=#ffffff
+$FONTSIZE=10
+$KW-GROUP(kwa)=#000000 bold
+$KW-GROUP(kwb)=#000000 bold
+$KW-GROUP(kwc)=#000000 bold
+$KW-GROUP(kwd)=#000000 bold
+$NUMBER=#000000
+$ESCAPECHAR=#000000
+$STRING=#000000
+$STRING-DIRECTIVE=#000000
+$COMMENT=#666666 italic
+$DIRECTIVE=#000000 bold
+$LINE=#888888
+$SYMBOL=#000000 bold
+$MARK-LINE=#dddddd
diff --git a/support/highlight/themes/rand01.style b/support/highlight/themes/rand01.style
new file mode 100644
index 0000000000..6d834a5b7b
--- /dev/null
+++ b/support/highlight/themes/rand01.style
@@ -0,0 +1,21 @@
+# rand01.style
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+# This theme was converted from the webcpp rand01.style.scs theme by webcpp2highlight 0.1
+
+$DEFAULTCOLOUR=#121b28
+$BGCOLOUR=#ffffff
+$FONTSIZE=10
+$KW-GROUP(kwa)=#0a7f6d bold
+$KW-GROUP(kwb)=#c42638 bold
+$KW-GROUP(kwc)=#e12f76
+$KW-GROUP(kwd)=#2ac749
+$NUMBER=#0da344
+$ESCAPECHAR=#a764cb
+$STRING=#2b83ba
+$STRING-DIRECTIVE=#2b83ba
+$COMMENT=#ababab italic
+$DIRECTIVE=#620ac6
+$LINE=#90a729
+$SYMBOL=#0000de
+$MARK-LINE=#ffffbb
diff --git a/support/highlight/themes/seashell.style b/support/highlight/themes/seashell.style
new file mode 100644
index 0000000000..5e9536a982
--- /dev/null
+++ b/support/highlight/themes/seashell.style
@@ -0,0 +1,20 @@
+# seashell.style
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#000000
+$BGCOLOUR=#fff5ee
+$FONTSIZE=10
+$KW-GROUP(kwa)=#2e8b57 bold
+$KW-GROUP(kwb)=#2e8b57 bold
+$KW-GROUP(kwc)=#696969 bold
+$KW-GROUP(kwd)=#000069
+$NUMBER=#ff1493
+$ESCAPECHAR=#6a5acd
+$STRING=#ff1493
+$STRING-DIRECTIVE=#ff1493
+$COMMENT=#2929cc
+$DIRECTIVE=#800080
+$LINE=#555555
+$SYMBOL=#676767
+$MARK-LINE=#ffffbb
diff --git a/support/highlight/themes/the.style b/support/highlight/themes/the.style
new file mode 100644
index 0000000000..792610dd4c
--- /dev/null
+++ b/support/highlight/themes/the.style
@@ -0,0 +1,20 @@
+# the.style
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#000000
+$BGCOLOUR=#ffffff
+$FONTSIZE=10
+$KW-GROUP(kwa)=#0000ff
+$KW-GROUP(kwb)=#880088
+$KW-GROUP(kwc)=#0000ff
+$KW-GROUP(kwd)=#ff0000
+$NUMBER=#ff0000
+$ESCAPECHAR=#000000
+$STRING=#00cdcd
+$STRING-DIRECTIVE=#000088
+$COMMENT=#00ff00 italic
+$DIRECTIVE=#ff0000
+$LINE=#008800
+$SYMBOL=#000000
+$MARK-LINE=#ffffbb
diff --git a/support/highlight/themes/typical.style b/support/highlight/themes/typical.style
new file mode 100644
index 0000000000..9ae026ed89
--- /dev/null
+++ b/support/highlight/themes/typical.style
@@ -0,0 +1,20 @@
+# typical.style
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#000000
+$BGCOLOUR=#ffffff
+$FONTSIZE=10
+$KW-GROUP(kwa)=#0000ff bold
+$KW-GROUP(kwb)=#0000ff
+$KW-GROUP(kwc)=#ec7f15
+$KW-GROUP(kwd)=#000000 bold
+$NUMBER=#a900a9
+$ESCAPECHAR=#ff00cc
+$STRING=#ff0000
+$STRING-DIRECTIVE=#ff0000
+$COMMENT=#666666 italic
+$DIRECTIVE=#00b800
+$LINE=#666666
+$SYMBOL=#ff0000
+$MARK-LINE=#ffffbb
diff --git a/support/highlight/themes/vampire.style b/support/highlight/themes/vampire.style
new file mode 100644
index 0000000000..94e1577906
--- /dev/null
+++ b/support/highlight/themes/vampire.style
@@ -0,0 +1,20 @@
+# vampire.style
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#ff0000
+$BGCOLOUR=#000000
+$FONTSIZE=10
+$KW-GROUP(kwa)=#ffffff bold
+$KW-GROUP(kwb)=#F35E1E bold
+$KW-GROUP(kwc)=#ffffff
+$KW-GROUP(kwd)=#ffcc33
+$NUMBER=#aaff00
+$ESCAPECHAR=#ffffff
+$STRING=#bb00ff
+$STRING-DIRECTIVE=#bb00ff
+$COMMENT=#ababab italic
+$DIRECTIVE=#ababab
+$LINE=#F3E651
+$SYMBOL=#F3E651
+$MARK-LINE=#203c51
diff --git a/support/highlight/themes/vim-dark.style b/support/highlight/themes/vim-dark.style
new file mode 100644
index 0000000000..396c78a1b2
--- /dev/null
+++ b/support/highlight/themes/vim-dark.style
@@ -0,0 +1,20 @@
+# vim.style
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#ffffff
+$BGCOLOUR=#000000
+$FONTSIZE=10
+$KW-GROUP(kwa)=#B26818
+$KW-GROUP(kwb)=#00ff00
+$KW-GROUP(kwc)=#B26818
+$KW-GROUP(kwd)=#ffffff
+$NUMBER=#ff0000
+$ESCAPECHAR=#ff22ff
+$STRING=#ff0000
+$STRING-DIRECTIVE=#ff0000
+$COMMENT=#0000ff
+$DIRECTIVE=#ff22ff
+$LINE=#0000ff
+$SYMBOL=#ffffff
+$MARK-LINE=#404040
diff --git a/support/highlight/themes/vim.style b/support/highlight/themes/vim.style
new file mode 100644
index 0000000000..d7e09503ad
--- /dev/null
+++ b/support/highlight/themes/vim.style
@@ -0,0 +1,20 @@
+# vim.style
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#000000
+$BGCOLOUR=#ffffff
+$FONTSIZE=10
+$KW-GROUP(kwa)=#B26818
+$KW-GROUP(kwb)=#00ff00
+$KW-GROUP(kwc)=#B26818
+$KW-GROUP(kwd)=#000000
+$NUMBER=#ff0000
+$ESCAPECHAR=#ff22ff
+$STRING=#ff0000
+$STRING-DIRECTIVE=#ff0000
+$COMMENT=#0000ff
+$DIRECTIVE=#ff22ff
+$LINE=#0000ff
+$SYMBOL=#000000
+$MARK-LINE=#ffffbb
diff --git a/support/highlight/themes/whitengrey.style b/support/highlight/themes/whitengrey.style
new file mode 100644
index 0000000000..56de6248de
--- /dev/null
+++ b/support/highlight/themes/whitengrey.style
@@ -0,0 +1,20 @@
+# whitengrey.style
+# This File is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#696969
+$BGCOLOUR=#ffffff
+$FONTSIZE=10
+$KW-GROUP(kwa)=#696969 bold
+$KW-GROUP(kwb)=#696969
+$KW-GROUP(kwc)=#696969 bold
+$KW-GROUP(kwd)=#000000
+$NUMBER=#bb00ff
+$ESCAPECHAR=#510087
+$STRING=#008800
+$STRING-DIRECTIVE=#008800
+$COMMENT=#1326a2 italic
+$DIRECTIVE=#470000
+$LINE=#555555
+$SYMBOL=#696969
+$MARK-LINE=#ffffbb
diff --git a/support/highlight/themes/zellner.style b/support/highlight/themes/zellner.style
new file mode 100644
index 0000000000..55f0deaf1e
--- /dev/null
+++ b/support/highlight/themes/zellner.style
@@ -0,0 +1,21 @@
+# zellner.style (taken from GVIM)
+# This file is part of highlight, a universal source code converter.
+# See README in the highlight directory for documentation.
+
+$DEFAULTCOLOUR=#000000
+$BGCOLOUR=#ffffff
+$FONTSIZE=10
+$KW-GROUP(kwa)=#a52a2a
+$KW-GROUP(kwb)=#0000ff
+$KW-GROUP(kwc)=#225f2d
+$KW-GROUP(kwd)=#000000 bold
+$NUMBER=#ff0066
+$ESCAPECHAR=#ff00ff
+$STRING=#ff00ff
+$STRING-DIRECTIVE=#ff00ff
+$COMMENT=#ff0000
+$SL-COMMENT=#0b810d
+$DIRECTIVE=#a020f0
+$LINE=#888888
+$SYMBOL=#000000
+$MARK-LINE=#ffffbb