• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

source-highlight


Commit MetaInfo

Revision6e877162642954dae192b2e9544622ba2f4f0651 (tree)
Time2011-04-06 20:15:37
Authorakngw <akngw@user...>
Commiterakngw

Log Message

バージョン 3.1.4

Change Summary

Incremental Difference

--- a/Makefile.in
+++ b/Makefile.in
@@ -1,4 +1,4 @@
1-# Makefile.in generated by automake 1.11 from Makefile.am.
1+# Makefile.in generated by automake 1.11.1 from Makefile.am.
22 # @configure_input@
33
44 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
--- a/c_comment.lang.texinfo
+++ b/c_comment.lang.texinfo
@@ -5,7 +5,7 @@
55 @r{@i{# comments with documentation tags}}
66 @b{environment} @t{@i{comment}} @b{start} @t{"///"} @b{begin}
77 @b{include} @t{"url.lang"}
8- @b{include} @t{"html.lang"}
8+ @b{include} @t{"html_simple.lang"}
99 @t{@i{type}} = @t{'@@[[:alpha:]]+'}
1010 @b{include} @t{"todo.lang"}
1111 @b{end}
@@ -15,7 +15,7 @@
1515 @r{@i{# comments with documentation tags}}
1616 @b{environment} @t{@i{comment}} @b{delim} @t{"/**"} @t{"*/"} @b{multiline} @b{begin}
1717 @b{include} @t{"url.lang"}
18- @b{include} @t{"html.lang"}
18+ @b{include} @t{"html_simple.lang"}
1919 @t{@i{type}} = @t{'@@[[:alpha:]]+'}
2020 @b{include} @t{"todo.lang"}
2121 @b{end}
--- a/default.style.texinfo
+++ b/default.style.texinfo
@@ -16,6 +16,7 @@
1616 @t{@i{function}} @b{black} @b{b}; @r{@i{// for function calls and declarations}}
1717 @t{@i{cbracket}} @b{red}; @r{@i{// for block brackets (e.g. @{, @})}}
1818 @t{@i{todo}} @b{bg:cyan} @b{b}; @r{@i{// for TODO and FIXME}}
19+@t{@i{code}} @b{bg:brightgreen} @b{b}; @r{@i{// for code snippets}}
1920
2021 @r{@i{//Predefined variables and functions (for instance glsl)}}
2122 @t{@i{predef_var}} @b{darkblue} ;
--- a/index.html
+++ b/index.html
@@ -4,7 +4,7 @@
44 <meta name="Author" content="Lorenzo Bettini"><title>GNU Source-highlight - GNU Project - Free Software Foundation (FSF)</title></head>
55 <body style="background-color: rgb(255, 255, 255);">
66 <h1><a class="mozTocH1" name="mozTocId593827"></a>
7-GNU Source-highlight 3.1.3</h1>
7+GNU Source-highlight 3.1.4</h1>
88 <p>by <a href="http://www.lorenzobettini.it">Lorenzo
99 Bettini</a> </p>
1010 <p>This program, <i>given a source file, produces a
@@ -51,29 +51,31 @@ supported
5151 </p>
5252 <ul>
5353 <li> <i>Ada</i></li>
54-<li> <i>Asm</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
55-<li> <i>Applescript</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
56-<li> <i>Awk</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
54+<li> <i>Asm</i></li>
55+<li> <i>Applescript</i></li>
56+<li> <i>Awk</i></li>
5757 <li> <i>Autoconf files</i></li>
58-<li> <i>Bat</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
58+<li> <i>Bat</i></li>
5959 <li> <i>Bib</i></li>
6060 <li> <i>Bison</i></li>
6161 <li> <i>C/C++</i></li>
6262 <li> <i>C#</i></li>
63-<li> <i>Clipper</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
64-<li> <i>Cobol</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
63+<li> <i>CakePhp templates</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
64+<li> <i>Clipper</i></li>
65+<li> <i>Cobol</i></li>
6566 <li> <i>Configuration files (generic)</i></li>
6667 <li> <i>Caml</i></li>
6768 <li> <i>Changelog</i></li>
6869 <li> <i>Css</i></li>
69-<li> <i>D</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
70+<li> <i>D</i></li>
7071 <li> <i>Diff</i></li>
71-<li> <i>Erlang</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
72-<li> <i>errors (compiler output)</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
72+<li> <i>Erlang</i></li>
73+<li> <i>errors (compiler output)</i></li>
7374 <li> <i>Flex</i></li>
7475 <li> <i>Fortran</i></li>
7576 <li> <i>GLSL</i></li>
7677 <li> <i>Haskell</i></li>
78+<li> <i>Haskell literate programming</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
7779 <li> <i>Haxe</i></li>
7880 <li> <i>Html</i></li>
7981 <li> <i>ini files</i></li>
@@ -82,12 +84,13 @@ supported
8284 <li> <i>KDE desktop files</i></li>
8385 <li> <i>Latex</i></li>
8486 <li> <i>Ldap files</i></li>
87+<li> <i>Lisp</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
8588 <li> <i>Logtalk</i></li>
8689 <li> <i>Log files</i></li>
8790 <li> <i>lsm files (Linux Software Map)</i></li>
8891 <li> <i>Lua</i></li>
8992 <li> <i>Makefile</i></li>
90-<li> <i>Manifest</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
93+<li> <i>Manifest</i></li>
9194 <li> <i>M4</i></li>
9295 <li> <i>ML</i></li>
9396 <li> <i>Oz</i></li>
@@ -98,6 +101,7 @@ supported
98101 <li> <i>Postscript</i></li>
99102 <li> <i>Prolog</i></li>
100103 <li> <i>Properties files</i></li>
104+<li> <i>Protobuf (Google's Protocol Buffers)</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
101105 <li> <i>Python</i></li>
102106 <li> <i>RPM Spec files</i></li>
103107 <li> <i>Ruby</i></li>
@@ -107,7 +111,8 @@ supported
107111 <li> <i>Sql</i></li>
108112 <li> <i>Tcl</i></li>
109113 <li> <i>Texinfo</i></li>
110-<li> <i>VBscript</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
114+<li> <i>Vala</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
115+<li> <i>VBscript</i></li>
111116 <li> <i>XML</i></li>
112117 <li> <i>XOrg conf files</i></li>
113118 </ul>
@@ -370,6 +375,27 @@ using the source-highlight CGI.
370375 <p><a href="http://code.google.com/p/php-source-highlight/">http://code.google.com/p/php-source-highlight/</a>
371376 </p>
372377 </li>
378+<li>
379+Roberto Alsina made a partial python binding using SIP so
380+that you can use Source-Highlight-Qt in PyQt programs.
381+
382+ <p><a href="http://marave.googlecode.com/svn/trunk/marave/highlight/">http://marave.googlecode.com/svn/trunk/marave/highlight/</a>
383+</p>
384+</li>
385+
386+<li>A perl binding for source-highlight is available at CPAN:
387+
388+ <p><a href="http://search.cpan.org/perldoc?Syntax::SourceHighlight">http://search.cpan.org/perldoc?Syntax::SourceHighlight</a>
389+</p>
390+</li>
391+
392+ <li><a name="index-Pastebin-36"></a>Danijel Tasov wrote a pastebin service based on
393+perl source-highlight binding:
394+
395+ <p><a href="http://pb.rbfh.de">http://pb.rbfh.de</a>
396+</p>
397+</li>
398+
373399 </ul>
374400 <h2><a class="mozTocH2" name="mozTocId477197"></a>Credits</h2>
375401 See CREDITS for detailed contributions and THANKS&nbsp; for a
--- a/lang-list.texinfo
+++ b/lang-list.texinfo
@@ -27,6 +27,7 @@ cs = csharp.lang
2727 csh = sh.lang
2828 csharp = csharp.lang
2929 css = css.lang
30+ctp = php.lang
3031 d = d.lang
3132 desktop = desktop.lang
3233 diff = diff.lang
@@ -68,6 +69,8 @@ ldap = ldap.lang
6869 ldif = ldap.lang
6970 lex = flex.lang
7071 lgt = logtalk.lang
72+lhs = haskell_literate.lang
73+lisp = lisp.lang
7174 ll = flex.lang
7275 log = log.lang
7376 logtalk = logtalk.lang
@@ -98,6 +101,8 @@ postscript = postscript.lang
98101 prg = clipper.lang
99102 prolog = prolog.lang
100103 properties = properties.lang
104+proto = proto.lang
105+protobuf = proto.lang
101106 ps = postscript.lang
102107 py = python.lang
103108 python = python.lang
@@ -127,6 +132,7 @@ texinfo = texinfo.lang
127132 tk = tcl.lang
128133 txt = nohilite.lang
129134 ui = xml.lang
135+vala = vala.lang
130136 vbs = vbscript.lang
131137 vbscript = vbscript.lang
132138 xhtml = xml.lang
--- a/original/Makefile.in
+++ b/original/Makefile.in
@@ -1,4 +1,4 @@
1-# Makefile.in generated by automake 1.11 from Makefile.am.
1+# Makefile.in generated by automake 1.11.1 from Makefile.am.
22 # @configure_input@
33
44 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
--- a/original/c_comment.lang.texinfo
+++ b/original/c_comment.lang.texinfo
@@ -5,7 +5,7 @@
55 @r{@i{# comments with documentation tags}}
66 @b{environment} @t{@i{comment}} @b{start} @t{"///"} @b{begin}
77 @b{include} @t{"url.lang"}
8- @b{include} @t{"html.lang"}
8+ @b{include} @t{"html_simple.lang"}
99 @t{@i{type}} = @t{'@@[[:alpha:]]+'}
1010 @b{include} @t{"todo.lang"}
1111 @b{end}
@@ -15,7 +15,7 @@
1515 @r{@i{# comments with documentation tags}}
1616 @b{environment} @t{@i{comment}} @b{delim} @t{"/**"} @t{"*/"} @b{multiline} @b{begin}
1717 @b{include} @t{"url.lang"}
18- @b{include} @t{"html.lang"}
18+ @b{include} @t{"html_simple.lang"}
1919 @t{@i{type}} = @t{'@@[[:alpha:]]+'}
2020 @b{include} @t{"todo.lang"}
2121 @b{end}
--- a/original/default.style.texinfo
+++ b/original/default.style.texinfo
@@ -16,6 +16,7 @@
1616 @t{@i{function}} @b{black} @b{b}; @r{@i{// for function calls and declarations}}
1717 @t{@i{cbracket}} @b{red}; @r{@i{// for block brackets (e.g. @{, @})}}
1818 @t{@i{todo}} @b{bg:cyan} @b{b}; @r{@i{// for TODO and FIXME}}
19+@t{@i{code}} @b{bg:brightgreen} @b{b}; @r{@i{// for code snippets}}
1920
2021 @r{@i{//Predefined variables and functions (for instance glsl)}}
2122 @t{@i{predef_var}} @b{darkblue} ;
--- a/original/index.html
+++ b/original/index.html
@@ -4,7 +4,7 @@
44 <meta name="Author" content="Lorenzo Bettini"><title>GNU Source-highlight - GNU Project - Free Software Foundation (FSF)</title></head>
55 <body style="background-color: rgb(255, 255, 255);">
66 <h1><a class="mozTocH1" name="mozTocId593827"></a>
7-GNU Source-highlight 3.1.3</h1>
7+GNU Source-highlight 3.1.4</h1>
88 <p>by <a href="http://www.lorenzobettini.it">Lorenzo
99 Bettini</a> </p>
1010 <p>This program, <i>given a source file, produces a
@@ -51,29 +51,31 @@ supported
5151 </p>
5252 <ul>
5353 <li> <i>Ada</i></li>
54-<li> <i>Asm</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
55-<li> <i>Applescript</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
56-<li> <i>Awk</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
54+<li> <i>Asm</i></li>
55+<li> <i>Applescript</i></li>
56+<li> <i>Awk</i></li>
5757 <li> <i>Autoconf files</i></li>
58-<li> <i>Bat</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
58+<li> <i>Bat</i></li>
5959 <li> <i>Bib</i></li>
6060 <li> <i>Bison</i></li>
6161 <li> <i>C/C++</i></li>
6262 <li> <i>C#</i></li>
63-<li> <i>Clipper</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
64-<li> <i>Cobol</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
63+<li> <i>CakePhp templates</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
64+<li> <i>Clipper</i></li>
65+<li> <i>Cobol</i></li>
6566 <li> <i>Configuration files (generic)</i></li>
6667 <li> <i>Caml</i></li>
6768 <li> <i>Changelog</i></li>
6869 <li> <i>Css</i></li>
69-<li> <i>D</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
70+<li> <i>D</i></li>
7071 <li> <i>Diff</i></li>
71-<li> <i>Erlang</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
72-<li> <i>errors (compiler output)</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
72+<li> <i>Erlang</i></li>
73+<li> <i>errors (compiler output)</i></li>
7374 <li> <i>Flex</i></li>
7475 <li> <i>Fortran</i></li>
7576 <li> <i>GLSL</i></li>
7677 <li> <i>Haskell</i></li>
78+<li> <i>Haskell literate programming</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
7779 <li> <i>Haxe</i></li>
7880 <li> <i>Html</i></li>
7981 <li> <i>ini files</i></li>
@@ -82,12 +84,13 @@ supported
8284 <li> <i>KDE desktop files</i></li>
8385 <li> <i>Latex</i></li>
8486 <li> <i>Ldap files</i></li>
87+<li> <i>Lisp</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
8588 <li> <i>Logtalk</i></li>
8689 <li> <i>Log files</i></li>
8790 <li> <i>lsm files (Linux Software Map)</i></li>
8891 <li> <i>Lua</i></li>
8992 <li> <i>Makefile</i></li>
90-<li> <i>Manifest</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
93+<li> <i>Manifest</i></li>
9194 <li> <i>M4</i></li>
9295 <li> <i>ML</i></li>
9396 <li> <i>Oz</i></li>
@@ -98,6 +101,7 @@ supported
98101 <li> <i>Postscript</i></li>
99102 <li> <i>Prolog</i></li>
100103 <li> <i>Properties files</i></li>
104+<li> <i>Protobuf (Google's Protocol Buffers)</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
101105 <li> <i>Python</i></li>
102106 <li> <i>RPM Spec files</i></li>
103107 <li> <i>Ruby</i></li>
@@ -107,7 +111,8 @@ supported
107111 <li> <i>Sql</i></li>
108112 <li> <i>Tcl</i></li>
109113 <li> <i>Texinfo</i></li>
110-<li> <i>VBscript</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
114+<li> <i>Vala</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
115+<li> <i>VBscript</i></li>
111116 <li> <i>XML</i></li>
112117 <li> <i>XOrg conf files</i></li>
113118 </ul>
@@ -370,6 +375,27 @@ using the source-highlight CGI.
370375 <p><a href="http://code.google.com/p/php-source-highlight/">http://code.google.com/p/php-source-highlight/</a>
371376 </p>
372377 </li>
378+<li>
379+Roberto Alsina made a partial python binding using SIP so
380+that you can use Source-Highlight-Qt in PyQt programs.
381+
382+ <p><a href="http://marave.googlecode.com/svn/trunk/marave/highlight/">http://marave.googlecode.com/svn/trunk/marave/highlight/</a>
383+</p>
384+</li>
385+
386+<li>A perl binding for source-highlight is available at CPAN:
387+
388+ <p><a href="http://search.cpan.org/perldoc?Syntax::SourceHighlight">http://search.cpan.org/perldoc?Syntax::SourceHighlight</a>
389+</p>
390+</li>
391+
392+ <li><a name="index-Pastebin-36"></a>Danijel Tasov wrote a pastebin service based on
393+perl source-highlight binding:
394+
395+ <p><a href="http://pb.rbfh.de">http://pb.rbfh.de</a>
396+</p>
397+</li>
398+
373399 </ul>
374400 <h2><a class="mozTocH2" name="mozTocId477197"></a>Credits</h2>
375401 See CREDITS for detailed contributions and THANKS&nbsp; for a
--- a/original/lang-list.texinfo
+++ b/original/lang-list.texinfo
@@ -27,6 +27,7 @@ cs = csharp.lang
2727 csh = sh.lang
2828 csharp = csharp.lang
2929 css = css.lang
30+ctp = php.lang
3031 d = d.lang
3132 desktop = desktop.lang
3233 diff = diff.lang
@@ -68,6 +69,8 @@ ldap = ldap.lang
6869 ldif = ldap.lang
6970 lex = flex.lang
7071 lgt = logtalk.lang
72+lhs = haskell_literate.lang
73+lisp = lisp.lang
7174 ll = flex.lang
7275 log = log.lang
7376 logtalk = logtalk.lang
@@ -98,6 +101,8 @@ postscript = postscript.lang
98101 prg = clipper.lang
99102 prolog = prolog.lang
100103 properties = properties.lang
104+proto = proto.lang
105+protobuf = proto.lang
101106 ps = postscript.lang
102107 py = python.lang
103108 python = python.lang
@@ -127,6 +132,7 @@ texinfo = texinfo.lang
127132 tk = tcl.lang
128133 txt = nohilite.lang
129134 ui = xml.lang
135+vala = vala.lang
130136 vbs = vbscript.lang
131137 vbscript = vbscript.lang
132138 xhtml = xml.lang
--- a/original/source-highlight-lib.html
+++ b/original/source-highlight-lib.html
@@ -1,14 +1,14 @@
11 <html lang="en">
22 <head>
3-<title>GNU Source-highlight Library 3.1.3</title>
3+<title>GNU Source-highlight Library 3.1.4</title>
44 <meta http-equiv="Content-Type" content="text/html">
5-<meta name="description" content="GNU Source-highlight Library 3.1.3">
5+<meta name="description" content="GNU Source-highlight Library 3.1.4">
66 <meta name="generator" content="makeinfo 4.13">
77 <link title="Top" rel="top" href="#Top">
88 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
99 <!--
1010 This manual is for GNU Source-highlight Library
11-(version 3.1.3, 7 December 2009),
11+(version 3.1.4, 14 May 2010),
1212 which given a source file, produces a document with syntax highlighting.
1313
1414 Copyright (C) 2005-2008 Lorenzo Bettini, `http://www.lorenzobettini.it'.
@@ -39,7 +39,7 @@ Copyright (C) 2005-2008 Lorenzo Bettini, `http://www.lorenzobettini.it'.
3939 --></style>
4040 </head>
4141 <body>
42-<h1 class="settitle">GNU Source-highlight Library 3.1.3</h1>
42+<h1 class="settitle">GNU Source-highlight Library 3.1.4</h1>
4343 <div class="contents">
4444 <h2>Table of Contents</h2>
4545 <ul>
@@ -85,12 +85,12 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
8585 <p>GNU Source-highlight, given a source file, produces a document with
8686 syntax highlighting.
8787
88- <p>This is Edition 3.1.3 of the Source-highlight Library manual.
88+ <p>This is Edition 3.1.4 of the Source-highlight Library manual.
8989
90- <p>This file documents GNU Source-highlight Library version 3.1.3.
90+ <p>This file documents GNU Source-highlight Library version 3.1.4.
9191
9292 <p>This manual is for GNU Source-highlight Library
93-(version 3.1.3, 7 December 2009),
93+(version 3.1.4, 14 May 2010),
9494 which given a source file, produces a document with syntax highlighting.
9595
9696 <p>Copyright &copy; 2005-2008 Lorenzo Bettini, <a href="http://www.lorenzobettini.it">http://www.lorenzobettini.it</a>.
--- a/original/source-highlight-lib.info
+++ b/original/source-highlight-lib.info
@@ -1,9 +1,9 @@
11 This is ../../doc/source-highlight-lib.info, produced by makeinfo
22 version 4.13 from ../../doc/source-highlight-lib.texinfo.
33
4-This manual is for GNU Source-highlight Library (version 3.1.3, 7
5-December 2009), which given a source file, produces a document with
6-syntax highlighting.
4+This manual is for GNU Source-highlight Library (version 3.1.4, 14 May
5+2010), which given a source file, produces a document with syntax
6+highlighting.
77
88 Copyright (C) 2005-2008 Lorenzo Bettini,
99 `http://www.lorenzobettini.it'.
@@ -34,12 +34,12 @@ GNU Source-highlight Library
3434 GNU Source-highlight, given a source file, produces a document with
3535 syntax highlighting.
3636
37- This is Edition 3.1.3 of the Source-highlight Library manual.
37+ This is Edition 3.1.4 of the Source-highlight Library manual.
3838
39- This file documents GNU Source-highlight Library version 3.1.3.
39+ This file documents GNU Source-highlight Library version 3.1.4.
4040
41- This manual is for GNU Source-highlight Library (version 3.1.3,
42-7 December 2009), which given a source file, produces a document with
41+ This manual is for GNU Source-highlight Library (version 3.1.4,
42+14 May 2010), which given a source file, produces a document with
4343 syntax highlighting.
4444
4545 Copyright (C) 2005-2008 Lorenzo Bettini,
@@ -997,24 +997,24 @@ Concept Index
997997
998998 
999999 Tag Table:
1000-Node: Top1160
1001-Node: Introduction2703
1002-Node: Installation3565
1003-Node: Use of GNU Source-highlight Library4522
1004-Ref: Use of GNU Source-highlight Library-Footnote-15084
1005-Node: Using Automake and Autotools5207
1006-Ref: Using Automake and Autotools-Footnote-17193
1007-Node: Main Classes7238
1008-Node: SourceHighlight class8760
1009-Node: Customizing Formatting11821
1010-Node: Completely Customized Formatting13495
1011-Node: Style-based Customized Formatting19422
1012-Node: Events and Listeners27797
1013-Node: Settings30182
1014-Node: Utility functions32292
1015-Node: Global instances32725
1016-Node: Problems34116
1017-Node: Mailing Lists34829
1018-Node: Concept Index35691
1000+Node: Top1156
1001+Node: Introduction2695
1002+Node: Installation3557
1003+Node: Use of GNU Source-highlight Library4514
1004+Ref: Use of GNU Source-highlight Library-Footnote-15076
1005+Node: Using Automake and Autotools5199
1006+Ref: Using Automake and Autotools-Footnote-17185
1007+Node: Main Classes7230
1008+Node: SourceHighlight class8752
1009+Node: Customizing Formatting11813
1010+Node: Completely Customized Formatting13487
1011+Node: Style-based Customized Formatting19414
1012+Node: Events and Listeners27789
1013+Node: Settings30174
1014+Node: Utility functions32284
1015+Node: Global instances32717
1016+Node: Problems34108
1017+Node: Mailing Lists34821
1018+Node: Concept Index35683
10191019 
10201020 End Tag Table
--- a/original/source-highlight.1
+++ b/original/source-highlight.1
@@ -1,12 +1,12 @@
1-.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36.
2-.TH SOURCE-HIGHLIGHT "1" "January 2010" "Source-highlight 3.1.3 (library: 3:1:0)" "User Commands"
1+.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1.
2+.TH SOURCE-HIGHLIGHT "1" "May 2010" "Source-highlight 3.1.4 (library: 3:1:0)" "User Commands"
33 .SH NAME
44 Source-highlight \- convert source code to syntax highlighted document
55 .SH SYNOPSIS
66 .B source-highlight
77 [\fIOPTIONS\fR]... \fI< input_file > output_file\fR
88 .SH DESCRIPTION
9-GNU source\-highlight 3.1.3
9+GNU source\-highlight 3.1.4
1010 .PP
1111 Highlight the syntax of a source file (e.g. Java) into a specific format (e.g.
1212 HTML)
@@ -218,7 +218,7 @@ Maintained by Lorenzo Bettini <http://www.lorenzobettini.it>
218218 .SH "REPORTING BUGS"
219219 Report bugs to <bug\-source\-highlight at gnu.org>
220220 .SH COPYRIGHT
221-Copyright \(co 1999-2008 Lorenzo Bettini <http://www.lorenzobettini.it>
221+Copyright \(co 1999\-2008 Lorenzo Bettini <http://www.lorenzobettini.it>
222222 This program comes with ABSOLUTELY NO WARRANTY.
223223 .br
224224 This is free software; you may redistribute copies of the program
--- a/original/source-highlight.html
+++ b/original/source-highlight.html
@@ -1,14 +1,14 @@
11 <html lang="en">
22 <head>
3-<title>GNU Source-highlight 3.1.3</title>
3+<title>GNU Source-highlight 3.1.4</title>
44 <meta http-equiv="Content-Type" content="text/html">
5-<meta name="description" content="GNU Source-highlight 3.1.3">
5+<meta name="description" content="GNU Source-highlight 3.1.4">
66 <meta name="generator" content="makeinfo 4.13">
77 <link title="Top" rel="top" href="#Top">
88 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
99 <!--
1010 This manual is for GNU Source-highlight
11-(version 3.1.3, 17 December 2009),
11+(version 3.1.4, 14 May 2010),
1212 which given a source file, produces a document with syntax highlighting.
1313
1414 Copyright (C) 2005-2008 Lorenzo Bettini, `http://www.lorenzobettini.it'.
@@ -39,7 +39,7 @@ Copyright (C) 2005-2008 Lorenzo Bettini, `http://www.lorenzobettini.it'.
3939 --></style>
4040 </head>
4141 <body>
42-<h1 class="settitle">GNU Source-highlight 3.1.3</h1>
42+<h1 class="settitle">GNU Source-highlight 3.1.4</h1>
4343 <div class="contents">
4444 <h2>Table of Contents</h2>
4545 <ul>
@@ -162,12 +162,12 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
162162 <p>GNU Source-highlight, given a source file, produces a document with
163163 syntax highlighting.
164164
165- <p>This is Edition 3.1.3 of the Source-highlight manual.
165+ <p>This is Edition 3.1.4 of the Source-highlight manual.
166166
167- <p>This file documents GNU Source-highlight version 3.1.3.
167+ <p>This file documents GNU Source-highlight version 3.1.4.
168168
169169 <p>This manual is for GNU Source-highlight
170-(version 3.1.3, 17 December 2009),
170+(version 3.1.4, 14 May 2010),
171171 which given a source file, produces a document with syntax highlighting.
172172
173173 <p>Copyright &copy; 2005-2008 Lorenzo Bettini, <a href="http://www.lorenzobettini.it">http://www.lorenzobettini.it</a>.
@@ -261,7 +261,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>
261261 <h3 class="section">1.1 Supported languages</h3>
262262
263263 <p>The complete list of languages (indeed, file extensions) natively
264-supported by this version of Source-highlight (3.1.3), as
264+supported by this version of Source-highlight (3.1.4), as
265265 reported by <code>--lang-list</code>, is the following:
266266
267267 <pre class="example"> C = cpp.lang
@@ -293,6 +293,7 @@ reported by <code>--lang-list</code>, is the following:
293293 csh = sh.lang
294294 csharp = csharp.lang
295295 css = css.lang
296+ ctp = php.lang
296297 d = d.lang
297298 desktop = desktop.lang
298299 diff = diff.lang
@@ -334,6 +335,8 @@ reported by <code>--lang-list</code>, is the following:
334335 ldif = ldap.lang
335336 lex = flex.lang
336337 lgt = logtalk.lang
338+ lhs = haskell_literate.lang
339+ lisp = lisp.lang
337340 ll = flex.lang
338341 log = log.lang
339342 logtalk = logtalk.lang
@@ -364,6 +367,8 @@ reported by <code>--lang-list</code>, is the following:
364367 prg = clipper.lang
365368 prolog = prolog.lang
366369 properties = properties.lang
370+ proto = proto.lang
371+ protobuf = proto.lang
367372 ps = postscript.lang
368373 py = python.lang
369374 python = python.lang
@@ -393,6 +398,7 @@ reported by <code>--lang-list</code>, is the following:
393398 tk = tcl.lang
394399 txt = nohilite.lang
395400 ui = xml.lang
401+ vala = vala.lang
396402 vbs = vbscript.lang
397403 vbscript = vbscript.lang
398404 xhtml = xml.lang
@@ -403,7 +409,7 @@ reported by <code>--lang-list</code>, is the following:
403409 yy = bison.lang
404410 </pre>
405411 <p>The complete list of output formats natively supported by this version
406-of Source-highlight (3.1.3), as reported by
412+of Source-highlight (3.1.4), as reported by
407413 <code>--outlang-list</code>, is the following:
408414
409415 <pre class="example"> docbook = docbook.outlang
@@ -645,7 +651,8 @@ formats (e.g., HTML, XHTML, etc.).
645651
646652 <p><a href="http://qsrchilite.sourceforge.net">http://qsrchilite.sourceforge.net</a>.
647653
648- <li><a name="index-SourceHighlightIDE-18"></a><a name="index-KDE-19"></a>SourceHighlightIDE is a small IDE (for KDE) I wrote for developing
654+ <li><a name="index-SourceHighlightIDE-18"></a><a name="index-KDE-19"></a>SourceHighlightIDE is a small IDE (based on Qt4 and
655+Source-highlight-qt) I wrote for developing
649656 and debugging new language definitions for source-highlight:
650657
651658 <p><a href="http://srchighliteide.sourceforge.net">http://srchighliteide.sourceforge.net</a>.
@@ -705,6 +712,20 @@ using the source-highlight CGI.
705712
706713 <p><a href="http://code.google.com/p/php-source-highlight/">http://code.google.com/p/php-source-highlight/</a>
707714
715+ <li><a name="index-SIP-32"></a><a name="index-Python-33"></a><a name="index-PyQt-34"></a>Roberto Alsina made a partial python binding using SIP so
716+that you can use Source-Highlight-Qt in PyQt programs.
717+
718+ <p><a href="http://marave.googlecode.com/svn/trunk/marave/highlight/">http://marave.googlecode.com/svn/trunk/marave/highlight/</a>
719+
720+ <li><a name="index-Perl-35"></a>A perl binding for source-highlight is available at CPAN:
721+
722+ <p><a href="http://search.cpan.org/perldoc?Syntax::SourceHighlight">http://search.cpan.org/perldoc?Syntax::SourceHighlight</a>
723+
724+ <li><a name="index-Pastebin-36"></a>Danijel Tasov wrote a pastebin service based on
725+perl source-highlight binding:
726+
727+ <p><a href="http://pb.rbfh.de">http://pb.rbfh.de</a>
728+
708729 </ul>
709730
710731 <div class="node">
@@ -718,7 +739,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
718739
719740 <h2 class="chapter">2 Installation</h2>
720741
721-<p><a name="index-installation-32"></a>
742+<p><a name="index-installation-37"></a>
722743 See the file <samp><span class="file">INSTALL</span></samp> for detailed building and installation
723744 instructions; anyway if you're used to compiling Linux software that
724745 comes with sources you may simply follow the usual procedure, i.e., untar
@@ -740,7 +761,7 @@ you must be root to run <code>make install</code>.
740761 <p>You may want to run <code>./configure --help</code> to see all the possible
741762 options that can be passed to the configuration script.
742763
743- <p><a name="index-directories-33"></a>Files will be installed in the following directories:
764+ <p><a name="index-directories-38"></a>Files will be installed in the following directories:
744765
745766 <dl>
746767 <dt><code>Executables</code><dd> <code>prefix/bin</code>
@@ -755,7 +776,7 @@ but you may change it with <code>--prefix</code>
755776 option to configure. For further <code>configure</code> options, you
756777 can run <code>configure --help</code>.
757778
758- <p><a name="index-bash-completion-34"></a>Tiziano Muller wrote a bash completion configuration file for
779+ <p><a name="index-bash-completion-39"></a>Tiziano Muller wrote a bash completion configuration file for
759780 source-highlight; this will be installed by default in the directory
760781 <code>sysconfdir/bash_completion.d</code>, where <code>sysconfdir</code> defaults to
761782 <code>prefix/etc</code>; however, typically, the directory where the bash
@@ -764,7 +785,7 @@ completion script searches for configuration file is
764785 this directory with the configuration script command line option
765786 <code>--with-bash-completion</code>.
766787
767- <p><a name="index-library-35"></a><a name="index-g_t_0040code_007b_002d_002dwith_002ddoxygen_007d-36"></a><a name="index-doxygen-37"></a>If you want to build and install the API documentation of
788+ <p><a name="index-library-40"></a><a name="index-g_t_0040code_007b_002d_002dwith_002ddoxygen_007d-41"></a><a name="index-doxygen-42"></a>If you want to build and install the API documentation of
768789 Source-highlight library, you need to run <code>configure</code> with the
769790 option <code>--with-doxygen</code>, but you need the program <em>Doxygen</em>,
770791 <a href="http://www.doxygen.org">http://www.doxygen.org</a>, to build the documentation.
@@ -774,7 +795,7 @@ The documentation will be installed in the following directory:
774795 <dt><code>Library API documentation</code><dd> <code>prefix/share/doc/source-highlight/api</code>
775796 </dl>
776797
777- <p><a name="index-java2html-38"></a><a name="index-cpp2html-39"></a>NOTE: Originally, instead of Source-highlight, there were two
798+ <p><a name="index-java2html-43"></a><a name="index-cpp2html-44"></a>NOTE: Originally, instead of Source-highlight, there were two
778799 separate programs, namely <em>GNU java2html</em> and <em>GNU cpp2html</em>.
779800 There are two shell scripts with the same name that will be installed
780801 together with Source-highlight in order to facilitate the migration
@@ -803,25 +824,25 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Installation">Installation</a>
803824
804825 <h3 class="section">2.1 Building with qmake</h3>
805826
806-<p><a name="index-qmake-40"></a>
827+<p><a name="index-qmake-45"></a>
807828 Since version 3.1.2, Source-highlight can be built also using
808829 <code>qmake</code>, the build tool from Qt libraries (<a href="http://qt.nokia.com">http://qt.nokia.com</a>).
809830 This was made available to build Source-highlight on Windows based systems
810831 without using a Unix shell, and in particular to build Source-highlight
811-<a name="index-MSVC-41"></a>with Microsoft MSVC compiler. You should use this method only if you
832+<a name="index-MSVC-46"></a>with Microsoft MSVC compiler. You should use this method only if you
812833 don't have a Unix shell or if you really need to use the MSVC compiler
813834 (e.g., if you want to build Source-highlight library to be used in MSVC
814-based programs.
815-<a name="index-boost-42"></a>You still need the boost regex library, and if you
835+based programs).
836+<a name="index-boost-47"></a>You still need the boost regex library, and if you
816837 use MSVC, you can find installation packages for this library at
817838 <a href="http://www.boostpro.com">http://www.boostpro.com</a>.
818839
819840 <p>This build mechanism is still experimental, and, when using MSVC, only
820841 a static version of Source-highlight library can be built (not a .dll).
821-<a name="index-MinGW-43"></a>You can also use this method if you have the MinGW compiler,
842+<a name="index-MinGW-48"></a>You can also use this method if you have the MinGW compiler,
822843 <a href="http://www.mingw.org">http://www.mingw.org</a>, (e.g.,
823844 the one that comes with Qt Windows distribution) and you don't have
824-<a name="index-msys-44"></a>Msys (<a href="http://www.mingw.org/wiki/MSYS">http://www.mingw.org/wiki/MSYS</a>). Otherwise, you should
845+<a name="index-msys-49"></a>Msys (<a href="http://www.mingw.org/wiki/MSYS">http://www.mingw.org/wiki/MSYS</a>). Otherwise, you should
825846 still use the <code>configure</code> based mechanims.
826847
827848 <p>Using <code>qmake</code>, only a few options can be specified during the building
@@ -862,7 +883,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Installation">Installation</a>
862883
863884 <h3 class="section">2.2 Download</h3>
864885
865-<p><a name="index-download-45"></a>
886+<p><a name="index-download-50"></a>
866887 You can download it from GNU's ftp site:
867888 <a href="ftp://ftp.gnu.org/gnu/src-highlite">ftp://ftp.gnu.org/gnu/src-highlite</a> or from one of its mirrors (see
868889 <a href="http://www.gnu.org/prep/ftp.html">http://www.gnu.org/prep/ftp.html</a>).
@@ -899,7 +920,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Installation">Installation</a>
899920
900921 <h3 class="section">2.3 Anonymous Git Checkout</h3>
901922
902-<p><a name="index-Git-46"></a>This project's git repository can be checked out through the following
923+<p><a name="index-Git-51"></a>This project's git repository can be checked out through the following
903924 clone instruction<a rel="footnote" href="#fn-3" name="fnd-3"><sup>3</sup></a>:
904925
905926 <pre class="example"> git clone git://git.savannah.gnu.org/src-highlite.git
@@ -929,7 +950,7 @@ first time, you must run the command:
929950 </pre>
930951 <p class="noindent">This will run the autotools commands in the correct order, and also copy
931952 possibly missing files. You should have installed recent versions of
932-<a name="index-automake-47"></a><a name="index-autoconf-48"></a><a name="index-libtool-49"></a><code>automake</code>, <code>autoconf</code> and <code>libtool</code> in order for this to
953+<a name="index-automake-52"></a><a name="index-autoconf-53"></a><a name="index-libtool-54"></a><code>automake</code>, <code>autoconf</code> and <code>libtool</code> in order for this to
933954 succeed.
934955
935956 <div class="node">
@@ -944,8 +965,8 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Installation">Installation</a>
944965
945966 <h3 class="section">2.4 What you need to build source-highlight</h3>
946967
947-<p><a name="index-compilation-requirements-50"></a><a name="index-building-requirements-51"></a>
948-<a name="index-boost-52"></a>Since version 2.0 Source-highlight relies on regular expressions as
968+<p><a name="index-compilation-requirements-55"></a><a name="index-building-requirements-56"></a>
969+<a name="index-boost-57"></a>Since version 2.0 Source-highlight relies on regular expressions as
949970 provided by boost (<a href="http://www.boost.org">http://www.boost.org</a>), so you need to install at
950971 least the regex library from boost.
951972
@@ -968,10 +989,10 @@ and bison (yacc) and flex (lex), and ported under Win32 with Cygwin
968989 C/C++compiler, available at <a href="http://www.cygwin.com">http://www.cygwin.com</a>.
969990
970991 <p>I use the excellent
971-<a name="index-automake-53"></a><a name="index-autoconf-54"></a><a name="index-libtool-55"></a>GNU Autoconf<a rel="footnote" href="#fn-4" name="fnd-4"><sup>4</sup></a>,
992+<a name="index-automake-58"></a><a name="index-autoconf-59"></a><a name="index-libtool-60"></a>GNU Autoconf<a rel="footnote" href="#fn-4" name="fnd-4"><sup>4</sup></a>,
972993 GNU Automake<a rel="footnote" href="#fn-5" name="fnd-5"><sup>5</sup></a> and
973994 GNU Libtool<a rel="footnote" href="#fn-6" name="fnd-6"><sup>6</sup></a>.
974-<a name="index-gnulib-56"></a>Since version 2.6 I also started to use Gnulib - The GNU Portability
995+<a name="index-gnulib-61"></a>Since version 2.6 I also started to use Gnulib - The GNU Portability
975996 Library<a rel="footnote" href="#fn-7" name="fnd-7"><sup>7</sup></a>, &ldquo;a central
976997 location for common GNU code, intended to be shared among GNU packages&rdquo;
977998 (for instance, I rely on Gnulib for checking for the presence and
@@ -1003,7 +1024,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Installation">Installation</a>
10031024
10041025 <h3 class="section">2.5 Tips on installing Boost Regex library</h3>
10051026
1006-<p><a name="index-Boost-regex-57"></a>
1027+<p><a name="index-Boost-regex-62"></a>
10071028 If you experience no problem in compiling source-highlight, you can
10081029 happily skip this section<a rel="footnote" href="#fn-8" name="fnd-8"><sup>8</sup></a> :-)
10091030
@@ -1106,7 +1127,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Installation">Installation</a>
11061127
11071128 <h3 class="section">2.6 Patching from a previous version</h3>
11081129
1109-<p><a name="index-patching-58"></a>
1130+<p><a name="index-patching-63"></a>
11101131 If you downloaded a patch, say
11111132 <samp><span class="file">source-highlight-1.3-1.3.1-patch.gz</span></samp> (i.e., the patch to go from version
11121133 1.3 to version 1.3.1), cd to the directory with sources from the
@@ -1151,7 +1172,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Installation">Installation</a>
11511172
11521173 <h3 class="section">2.8 Using source-highlight as a CGI</h3>
11531174
1154-<p><a name="index-CGI-59"></a>CGI support was enabled thanks to Robert Wetzel; I haven't tested it
1175+<p><a name="index-CGI-64"></a>CGI support was enabled thanks to Robert Wetzel; I haven't tested it
11551176 personally. If you want to use source-highlight as a CGI program, you
11561177 have to use the executable source-highlight-cgi. You can build such
11571178 executable by issuing
@@ -1171,15 +1192,15 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Installation">Installation</a>
11711192
11721193 <h3 class="section">2.9 Building .rpm</h3>
11731194
1174-<p><a name="index-rpm-60"></a>
1195+<p><a name="index-rpm-65"></a>
11751196 Christian W. Zuckschwerdt added support for building an .rpm and an
11761197 .rpm.src. You can issue the following command
11771198
1178-<pre class="example"> rpmbuild -tb source-highlight-3.1.3.tar.gz
1199+<pre class="example"> rpmbuild -tb source-highlight-3.1.4.tar.gz
11791200 </pre>
11801201 <p>for building an .rpm with binaries and
11811202
1182-<pre class="example"> rpmbuild -ts source-highlight-3.1.3.tar.gz
1203+<pre class="example"> rpmbuild -ts source-highlight-3.1.4.tar.gz
11831204 </pre>
11841205 <p>for building an .rpm.src with sources.
11851206
@@ -1194,7 +1215,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
11941215
11951216 <h2 class="chapter">3 Copying Conditions</h2>
11961217
1197-<p><a name="index-Copying-conditions-61"></a>
1218+<p><a name="index-Copying-conditions-66"></a>
11981219 GNU Source-highlight is free software; you are free to use, share and modify it
11991220 under the terms of the GNU General Public License that accompanies this software
12001221 (see <samp><span class="file">COPYING</span></samp>).
@@ -1213,7 +1234,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
12131234
12141235 <h2 class="chapter">4 Simple Usage</h2>
12151236
1216-<p><a name="index-sample-62"></a>
1237+<p><a name="index-sample-67"></a>
12171238 Here are some realistic examples of running
12181239 <samp><span class="command">source-highlight</span></samp><a rel="footnote" href="#fn-10" name="fnd-10"><sup>10</sup></a>.
12191240
@@ -1286,7 +1307,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Simple-Usage">Simple Usage</a>
12861307
12871308 <h3 class="section">4.1 HTML and XHTML output</h3>
12881309
1289-<p><a name="index-HTML-63"></a><a name="index-XHTML-64"></a>
1310+<p><a name="index-HTML-68"></a><a name="index-XHTML-69"></a>
12901311 The default output format for HTML and XHTML uses fixed width fonts by
12911312 inserting all the formatted output between <code>&lt;tt&gt;</code> and <code>&lt;/tt&gt;</code>.
12921313 Thus, for instance, specification for fixed width and not fixed width
@@ -1313,7 +1334,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Simple-Usage">Simple Usage</a>
13131334
13141335 <h3 class="section">4.2 LaTeX output</h3>
13151336
1316-<p><a name="index-g_t_0040LaTeX_007b_007d-65"></a>
1337+<p><a name="index-g_t_0040LaTeX_007b_007d-70"></a>
13171338 When using LaTeX output format you can choose between monochromatic
13181339 output (by using <code>-f latex</code>) or colored output (by using <code>-f
13191340 latexcolor</code>). When using colored output, you need the
@@ -1332,7 +1353,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Simple-Usage">Simple Usage</a>
13321353
13331354 <h3 class="section">4.3 Texinfo output</h3>
13341355
1335-<p><a name="index-Texinfo-66"></a>
1356+<p><a name="index-Texinfo-71"></a>
13361357 When using the Texinfo output format, you may want to use a dedicated
13371358 style file, <samp><span class="file">texinfo.style</span></samp>, which comes with the source-highlight
13381359 distribution, with the option <code>--style-file</code>. For instance, the
@@ -1349,7 +1370,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Simple-Usage">Simple Usage</a>
13491370
13501371 <h3 class="section">4.4 DocBook output</h3>
13511372
1352-<p><a name="index-DocBook-67"></a>
1373+<p><a name="index-DocBook-72"></a>
13531374 DocBook output is generated using the <code>&lt;programlisting&gt;</code> tag. If
13541375 the <code>--doc</code> command line option is given, an <code>&lt;article&gt;</code>
13551376 document is generated.
@@ -1364,7 +1385,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Simple-Usage">Simple Usage</a>
13641385
13651386 <h3 class="section">4.5 ANSI color escape sequences</h3>
13661387
1367-<p><a name="index-ANSI-color-68"></a>
1388+<p><a name="index-ANSI-color-73"></a>
13681389 If you're using this output format, for instance together with
13691390 <code>less</code> (see <a href="#Using-source_002dhighlight-with-less">Using source-highlight with less</a>), you may
13701391 want to use the <samp><span class="file">esc.style</span></samp>, which comes with the source-highlight
@@ -1382,7 +1403,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
13821403
13831404 <h2 class="chapter">5 Configuration files</h2>
13841405
1385-<p><a name="index-configuration-files-69"></a>
1406+<p><a name="index-configuration-files-74"></a>
13861407 During execution, source-highlight needs some files where it finds
13871408 directives on how to recognize the source language (if not specified
13881409 explicitly with <code>--src-lang</code> or <code>--lang-def</code>), on which output
@@ -1391,7 +1412,7 @@ format to use (if not specified explicitly with <code>--out-format</code> or
13911412 keywords, comments, etc.), and source and output language definitions.
13921413 These files will be explained in the next sections.
13931414
1394- <p><a name="index-g_t_0040code_007b_002d_002ddata_002ddir_007d-70"></a>If the directory for such files is not explicitly specified with the
1415+ <p><a name="index-g_t_0040code_007b_002d_002ddata_002ddir_007d-75"></a>If the directory for such files is not explicitly specified with the
13951416 command line option <code>--data-dir</code>, these files are searched for in
13961417 the following order:
13971418
@@ -1407,7 +1428,7 @@ still used, but relative to the explicit path name.
14071428
14081429 <p>In particular, the user can set the value also with the environment
14091430 variable
1410-<a name="index-g_t_0040code_007bSOURCE_005fHIGHLIGHT_005fDATADIR_007d-71"></a><code>SOURCE_HIGHLIGHT_DATADIR</code> (see also <a href="#The-program-source_002dhighlight_002dsettings">The program source-highlight-settings</a>).
1431+<a name="index-g_t_0040code_007bSOURCE_005fHIGHLIGHT_005fDATADIR_007d-76"></a><code>SOURCE_HIGHLIGHT_DATADIR</code> (see also <a href="#The-program-source_002dhighlight_002dsettings">The program source-highlight-settings</a>).
14111432
14121433 <p>If you want to be sure about which file is used during the
14131434 execution, you can use the command line option <code>--verbose</code>.
@@ -1434,14 +1455,14 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-files">Configuration fil
14341455
14351456 <h3 class="section">5.1 Output format style</h3>
14361457
1437-<p><a name="index-output-style-72"></a><a name="index-default_002estyle-73"></a>
1458+<p><a name="index-output-style-77"></a><a name="index-default_002estyle-78"></a>
14381459 You must specify your options for syntax highlighting in the file
14391460 <samp><span class="file">default.style</span></samp><a rel="footnote" href="#fn-11" name="fnd-11"><sup>11</sup></a>.
14401461 You can specify formatting options for each element defined
14411462 by a language definition file (you can get the list of such elements,
1442-<a name="index-g_t_0040code_007b_002d_002dshow_002dlang_002delements_007d-74"></a>by using <code>--show-lang-elements</code>, see <a href="#Listing-Language-Elements">Listing Language Elements</a>).
1463+<a name="index-g_t_0040code_007b_002d_002dshow_002dlang_002delements_007d-79"></a>by using <code>--show-lang-elements</code>, see <a href="#Listing-Language-Elements">Listing Language Elements</a>).
14431464
1444- <p><a name="index-g_t_0040code_007bbgcolor_007d-75"></a><a name="index-background-color-76"></a>Since version 2.6, you can also specify the background color for the
1465+ <p><a name="index-g_t_0040code_007bbgcolor_007d-80"></a><a name="index-background-color-81"></a>Since version 2.6, you can also specify the background color for the
14451466 output document, using the keyword <code>bgcolor</code> (this might be visible
14461467 only when the <code>--doc</code> command line option is used).
14471468
@@ -1469,6 +1490,7 @@ is formatted by using the <samp><span class="file">style.lang</span></samp> that
14691490 <i>function</i> <b>black</b> <b>b</b>; <i>// for function calls and declarations</i>
14701491 <i>cbracket</i> <b>red</b>; <i>// for block brackets (e.g. {, })</i>
14711492 <i>todo</i> <b>bg:cyan</b> <b>b</b>; <i>// for TODO and FIXME</i>
1493+ <i>code</i> <b>bg:brightgreen</b> <b>b</b>; <i>// for code snippets</i>
14721494
14731495 <i>//Predefined variables and functions (for instance glsl)</i>
14741496 <i>predef_var</i> <b>darkblue</b> ;
@@ -1529,7 +1551,7 @@ is formatted by using the <samp><span class="file">style.lang</span></samp> that
15291551 language definition files that comes with Source-highlight
15301552 distribution.
15311553
1532- <p><a name="index-g_t_0040code_007b_002d_002dstyle_002dfile_007d-77"></a>You can specify your own file (it doesn't have to be named
1554+ <p><a name="index-g_t_0040code_007b_002d_002dstyle_002dfile_007d-82"></a>You can specify your own file (it doesn't have to be named
15331555 <samp><span class="file">default.style</span></samp>) with the command line option
15341556 <code>--style-file</code><a rel="footnote" href="#fn-13" name="fnd-13"><sup>13</sup></a>, see
15351557 <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a>.
@@ -1538,7 +1560,7 @@ distribution.
15381560
15391561 <pre class="example"> normal darkblue ;
15401562 </pre>
1541- <p><a name="index-color-78"></a><a name="index-background-color-79"></a>As you might see the syntax of this file is quite straightforward: after
1563+ <p><a name="index-color-83"></a><a name="index-background-color-84"></a>As you might see the syntax of this file is quite straightforward: after
15421564 the element (or elements, separated by commas) you can specify the
15431565 color, and the background color<a rel="footnote" href="#fn-14" name="fnd-14"><sup>14</sup></a> by using
15441566 the prefix <code>bg:</code> (for instance, in the <samp><span class="file">default.style</span></samp> above
@@ -1548,7 +1570,7 @@ the background color is specified for the <code>todo</code> element).
15481570 formats: it is available for XHTML and LaTeX but not for
15491571 HTML<a rel="footnote" href="#fn-15" name="fnd-15"><sup>15</sup></a>.
15501572
1551- <p><a name="index-bold-80"></a><a name="index-italics-81"></a><a name="index-underline-82"></a><a name="index-fixed-83"></a><a name="index-notfixed-84"></a>Then, you can specify further formatting options such as bold, italics,
1573+ <p><a name="index-bold-85"></a><a name="index-italics-86"></a><a name="index-underline-87"></a><a name="index-fixed-88"></a><a name="index-notfixed-89"></a>Then, you can specify further formatting options such as bold, italics,
15521574 etc.; these are the keywords that can be used:
15531575
15541576 <pre class="example"> b = bold
@@ -1558,7 +1580,7 @@ etc.; these are the keywords that can be used:
15581580 nf = not fixed
15591581 noref = no reference information is generated for these elements
15601582 </pre>
1561- <p><a name="index-color-85"></a>Since version 2.2, the color specification is not required. For
1583+ <p><a name="index-color-90"></a>Since version 2.2, the color specification is not required. For
15621584 instance, the <samp><span class="file">texinfo.style</span></samp> is as follows (we avoid colors for
15631585 Texinfo outputs):
15641586
@@ -1597,7 +1619,7 @@ that comes first is used after the ones that follow. For instance, in
15971619 the case of HTML, the sequence <code>u, b</code> will lead to the following
15981620 formatting: <code>&lt;u&gt;&lt;b&gt;...&lt;/b&gt;&lt;/u&gt;</code>.
15991621
1600- <p><a name="index-noref-86"></a>The <code>noref</code> option specifies that for this element reference
1622+ <p><a name="index-noref-91"></a>The <code>noref</code> option specifies that for this element reference
16011623 information are not generated (see <a href="#Generating-References">Generating References</a>). For
16021624 instance, this is used for the <code>comment</code> element, since we do not
16031625 want that elements in a comment are searched for cross-references.
@@ -1624,7 +1646,7 @@ source-highlight<a rel="footnote" href="#fn-16" name="fnd-16"><sup>16</sup></a>:
16241646 darkblue
16251647 white
16261648 </pre>
1627- <p><a name="index-direct-color-scheme-87"></a>You can also use the direct color scheme for the specific output format,
1649+ <p><a name="index-direct-color-scheme-92"></a>You can also use the direct color scheme for the specific output format,
16281650 by using double quotes, such as, e.g., <code>"#00FF00"</code> in
16291651 HTML<a rel="footnote" href="#fn-17" name="fnd-17"><sup>17</sup></a> or even string colors in double quotes<a rel="footnote" href="#fn-18" name="fnd-18"><sup>18</sup></a>, such as <code>"lightblue"</code>. Of course, the double quotes will be
16301652 discarded during the generation.
@@ -1677,11 +1699,11 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-files">Configuration fil
16771699
16781700 <h3 class="section">5.2 Output format style using CSS</h3>
16791701
1680-<p><a name="index-CSS-88"></a>Since version 2.6 you can specify the output format style also using
1702+<p><a name="index-CSS-93"></a>Since version 2.6 you can specify the output format style also using
16811703 a limited CSS syntax. Please, note that this has nothing to do
16821704 with output produced by source-highlight using the <code>--css</code> option.
16831705
1684- <p><a name="index-g_t_0040code_007b_002d_002dstyle_002dcss_002dfile_007d-89"></a>By using a CSS file as the style file (i.e., passing it to the
1706+ <p><a name="index-g_t_0040code_007b_002d_002dstyle_002dcss_002dfile_007d-94"></a>By using a CSS file as the style file (i.e., passing it to the
16851707 <code>--style-css-file</code> command line option) you will only specify the
16861708 output format style using the same syntax of CSS. This means that you
16871709 can use a css syntax for specifying the output format style
@@ -1811,7 +1833,7 @@ following line (comment lines start with <code>#</code>):
18111833 <p class="noindent">tells that, if the style for an element, say elem1, is not specified in
18121834 the style file, then elem1 will have the same style of elem2.
18131835
1814- <p><a name="index-style_002edefaults-90"></a>For instance, this is the <samp><span class="file">style.defaults</span></samp> that comes with
1836+ <p><a name="index-style_002edefaults-95"></a>For instance, this is the <samp><span class="file">style.defaults</span></samp> that comes with
18151837 Source-highlight:
18161838
18171839 <!-- Generator: GNU source-highlight, by Lorenzo Bettini, http://www.gnu.org/software/src-highlite -->
@@ -1836,6 +1858,7 @@ Source-highlight:
18361858 label = preproc
18371859 error = string
18381860 warning = type
1861+ code = preproc
18391862 </pre>
18401863 <p class="noindent">In this case the style for the element <code>preproc</code> will default to
18411864 the style of the element <code>keyword</code>.
@@ -1858,7 +1881,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-files">Configuration fil
18581881
18591882 <h3 class="section">5.4 Language map</h3>
18601883
1861-<p><a name="index-language-map-91"></a>
1884+<p><a name="index-language-map-96"></a>
18621885 This configuration file associates a file extension to a specific
18631886 language definition file. You can also use such file extension to
18641887 specify the <code>--src-lang</code> option (see <a href="#Simple-Usage">Simple Usage</a>).
@@ -1902,7 +1925,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-files">Configuration fil
19021925
19031926 <h3 class="section">5.6 Output Language map</h3>
19041927
1905-<p><a name="index-output-language-map-92"></a>
1928+<p><a name="index-output-language-map-97"></a>
19061929 This configuration file associates an output format to a specific output
19071930 language definition file. You can use the name of that output format to
19081931 specify the <code>--out-format</code> option (see <a href="#Simple-Usage">Simple Usage</a>).
@@ -1979,7 +2002,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
19792002
19802003 <h2 class="chapter">6 Invoking <samp><span class="command">source-highlight</span></samp></h2>
19812004
1982-<p><a name="index-invoking-93"></a><a name="index-version-94"></a><a name="index-options-95"></a><a name="index-usage-96"></a><a name="index-help-97"></a><a name="index-getting-help-98"></a>
2005+<p><a name="index-invoking-98"></a><a name="index-version-99"></a><a name="index-options-100"></a><a name="index-usage-101"></a><a name="index-help-102"></a><a name="index-getting-help-103"></a>
19832006 The format for running the <samp><span class="command">source-highlight</span></samp> program is:
19842007
19852008 <pre class="example"> source-highlight <var>option</var> ...
@@ -1994,7 +2017,7 @@ in <a href="#Simple-Usage">Simple Usage</a>).
19942017
19952018 <!-- Formatting copied from the Texinfo 4.0 manual. -->
19962019 <dl>
1997-<dt><code>--data-dir</code><dd><a name="index-g_t_0040code_007b_002d_002ddata_002ddir_007d-99"></a>Source-highlight, during the execution, will need some files, such as,
2020+<dt><code>--data-dir</code><dd><a name="index-g_t_0040code_007b_002d_002ddata_002ddir_007d-104"></a>Source-highlight, during the execution, will need some files, such as,
19982021 e.g., language definition files, output format definition files, etc.
19992022 These files are installed in <code>prefix/share/source-highlight</code> where
20002023 <code>prefix</code> is chosen at compilation time (see See <a href="#Installation">Installation</a>).
@@ -2041,7 +2064,7 @@ into the directory where you invoked the command from; if you want the
20412064 output files to be generated into a different directory you can use this
20422065 option.
20432066
2044- <br><dt><code>--infer-lang</code><dd><a name="index-language-inference-100"></a><a name="index-g_t_0040code_007b_002d_002dinfer_002dlang_007d-101"></a>Force the inference mechanism for detecting the input language. This is
2067+ <br><dt><code>--infer-lang</code><dd><a name="index-language-inference-105"></a><a name="index-g_t_0040code_007b_002d_002dinfer_002dlang_007d-106"></a>Force the inference mechanism for detecting the input language. This is
20452068 detailed in <a href="#How-the-input-language-is-discovered">How the input language is discovered</a>.
20462069
20472070 <br><dt><code>--line-number</code><dd>Line numbers will be generated in the output, using the (optional)
@@ -2056,7 +2079,7 @@ support this feature (e.g., <code>esc</code>, since it makes no sense in such
20562079 case). See <a href="#Anchors-and-References">Anchors and References</a> for defining how to generate an
20572080 anchor in a specific output language.
20582081
2059- <p><a name="index-line-ranges-102"></a><a name="index-range-context-103"></a><a name="index-range-separator-104"></a><br><dt><code>--line-range</code><dt><code>--range-context</code><dt><code>--range-separator</code><dd>Since version 2.11, you can specify multiple line ranges: only the lines
2082+ <p><a name="index-line-ranges-107"></a><a name="index-range-context-108"></a><a name="index-range-separator-109"></a><br><dt><code>--line-range</code><dt><code>--range-context</code><dt><code>--range-separator</code><dd>Since version 2.11, you can specify multiple line ranges: only the lines
20602083 in the source that are in these ranges will be output. For instance, by
20612084 specifying
20622085
@@ -2084,7 +2107,7 @@ the examples in <a href="#Line-ranges-_0028with-context_0029">Line ranges (with
20842107 is preformatted automatically, so, e.g., you don't have to escape
20852108 special output characters, such as the { } in texinfo output.
20862109
2087- <p><a name="index-regex-ranges-105"></a><br><dt><code>--regex-range</code><dd>
2110+ <p><a name="index-regex-ranges-110"></a><br><dt><code>--regex-range</code><dd>
20882111 Ranges can be expressed also using regular expressions, with the command
20892112 line option <code>--regex-range</code>. In this case the beginning of the
20902113 range will be detected by a line containing (in any point) a string
@@ -2103,7 +2126,7 @@ accordingly), otherwise you will get an error.
21032126 <p>Furthermore, <code>--line-range</code> and <code>--regex-range</code> cannot coexist
21042127 in the same command line.
21052128
2106- <br><dt><code>--failsafe</code><dd><a name="index-failsafe-106"></a>If no language specification is found, an error will be printed and the
2129+ <br><dt><code>--failsafe</code><dd><a name="index-failsafe-111"></a>If no language specification is found, an error will be printed and the
21072130 program exits. With this option, instead, in such situations, the input
21082131 is simply formatted in the output format. This is useful when
21092132 <samp><span class="command">source-highlight</span></samp> is used with many input files, and it is also
@@ -2113,7 +2136,7 @@ suggestion is to always use it when you run source-highlight (and
21132136 indeed, in the future, this option might become the default one). See
21142137 also <a href="#Using-source_002dhighlight-with-less">Using source-highlight with less</a>, <a href="#Using-source_002dhighlight-as-a-simple-formatter">Using source-highlight as a simple formatter</a>.
21152138
2116- <p><a name="index-default_002elang-107"></a>When using <code>--failsafe</code>, if no input language can be established,
2139+ <p><a name="index-default_002elang-112"></a>When using <code>--failsafe</code>, if no input language can be established,
21172140 source-highlight will use the input language definition file
21182141 <samp><span class="file">default.lang</span></samp>, which is an empty file. You might want to
21192142 customize such file, though.
@@ -2177,7 +2200,7 @@ also the lowercase version (the input file may also have no extension at
21772200 all, but, for instance, a <samp><span class="file">ChangeLog</span></samp> input file will be
21782201 highlighted using <samp><span class="file">changelog.lang</span></samp>).
21792202
2180- <p><a name="index-g_t_0040code_007b_002d_002dinfer_002dlang_007d-108"></a>Furthermore, this mechanism can be given priority with the command line
2203+ <p><a name="index-g_t_0040code_007b_002d_002dinfer_002dlang_007d-113"></a>Furthermore, this mechanism can be given priority with the command line
21812204 option <code>--infer-lang</code>. For instance, this is used in the script
21822205 <samp><span class="file">src-hilite-lesspipe.sh</span></samp> (<a href="#Using-source_002dhighlight-with-less">Using source-highlight with less</a>)
21832206 when running source-highlight, in order to avoid the problem of
@@ -2196,7 +2219,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
21962219
21972220 <h2 class="chapter">7 Language Definitions</h2>
21982221
2199-<p><a name="index-language-definition-109"></a>
2222+<p><a name="index-language-definition-114"></a>
22002223 Since version 2.0 source-highlight uses a specific syntax
22012224 to specify source language elements (e.g., keywords, strings,
22022225 comments, etc.). Before version 2.0, language elements were scanned
@@ -2291,7 +2314,7 @@ where you're forced to use only one mechanism, since the other ones
22912314 cannot accomplish the required goal.
22922315
22932316
2294-<a name="index-g_t_0040code_007b_0022expression_0022_007d-110"></a>
2317+<a name="index-g_t_0040code_007b_0022expression_0022_007d-115"></a>
22952318 <dl><dt><code>"expression"</code><dd>
22962319 If you use double quotes (note, <code>"</code> and not <code>``</code> or
22972320 <code>''</code>) to specify a regular expression, then basically all the
@@ -2311,7 +2334,7 @@ alternatives (<a href="#Simple-definitions">Simple definitions</a>), must be esc
23112334 character <code>\</code>, e.g., <code>\|</code>. Also the character <code>\</code>,
23122335 if it is intended literally, must be escaped, e.g., <code>\\</code>.
23132336
2314- <p><a name="index-g_t_0040code_007b_0027expression_0027_007d-111"></a><br><dt><code>'expression'</code><dd>
2337+ <p><a name="index-g_t_0040code_007b_0027expression_0027_007d-116"></a><br><dt><code>'expression'</code><dd>
23152338 If you want to enjoy (almost) the full power of regular expressions, you
23162339 need to use single quoted strings (<code>'</code>), instead of double quoted
23172340 strings. This way, you can specify special characters with their
@@ -2336,8 +2359,8 @@ sub-expression).
23362359 <em>backreferences</em> (see <a href="#Notes-on-regular-expressions">Notes on regular expressions</a>) are not
23372360 allowed.
23382361
2339- <p><a name="index-g_t_0040code_007b_0060expression_0060_007d-112"></a><br><dt><code>`expression`</code><dd>
2340-<a name="index-marked-subexpressions-113"></a><a name="index-backreference-114"></a><a name="index-backtick-115"></a>This syntax<a rel="footnote" href="#fn-26" name="fnd-26"><sup>26</sup></a> (note the difference, this
2362+ <p><a name="index-g_t_0040code_007b_0060expression_0060_007d-117"></a><br><dt><code>`expression`</code><dd>
2363+<a name="index-marked-subexpressions-118"></a><a name="index-backreference-119"></a><a name="index-backtick-120"></a>This syntax<a rel="footnote" href="#fn-26" name="fnd-26"><sup>26</sup></a> (note the difference, this
23412364 one uses the <em>backtick</em> <code>`</code> while the previous one uses
23422365 <code>'</code>) for specifying a regular expression was introduced to overcome
23432366 the limitations of the other two syntaxes. With this syntax, the marked
@@ -2415,7 +2438,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Language-Definitions">Language Definit
24152438
24162439 <h3 class="section">7.2 Simple definitions</h3>
24172440
2418-<p><a name="index-simple-language-definition-116"></a>
2441+<p><a name="index-simple-language-definition-121"></a>
24192442 The simplest way to specify language elements is to list the possible
24202443 alternatives. This is the case, for instance, for keywords. For
24212444 instance, in <samp><span class="file">java.lang</span></samp> you have:
@@ -2487,7 +2510,7 @@ definitions. Thus, for instance, the following definition is wrong:
24872510 <pre class="example"> preproc = "#define"
24882511 preproc = '^[[:blank:]]*#([[:blank:]]*[[:word:]]*)'
24892512 </pre>
2490- <p><a name="index-nonsensitive-117"></a>Finally, at the end of a list of definitions, one can specify the
2513+ <p><a name="index-nonsensitive-122"></a>Finally, at the end of a list of definitions, one can specify the
24912514 keyword <code>nonsensitive</code>; in that case, the specified strings will be
24922515 interpreted in a non case sensitive way. For instance, we use this
24932516 feature in Pascal language definition, <samp><span class="file">pascal.lang</span></samp> where keywords
@@ -2511,7 +2534,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Language-Definitions">Language Definit
25112534
25122535 <h3 class="section">7.3 Line wide definitions</h3>
25132536
2514-<p><a name="index-lines-118"></a>
2537+<p><a name="index-lines-123"></a>
25152538 It is often useful to define a language element that affects all the
25162539 remaining characters up to the end of the line. For such definitions,
25172540 instead of the <code>=</code> you must use the keyword <code>start</code>. For
@@ -2535,7 +2558,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Language-Definitions">Language Definit
25352558
25362559 <h3 class="section">7.4 Order of definitions</h3>
25372560
2538-<p><a name="index-definition-order-119"></a>
2561+<p><a name="index-definition-order-124"></a>
25392562 It is important to observe that the order of language definitions is
25402563 important since it will be used during regular expression matching (this
25412564 will be detailed in <a href="#How-source_002dhighlight-works">How source-highlight works</a>). You then have to
@@ -2563,7 +2586,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Language-Definitions">Language Definit
25632586
25642587 <h3 class="section">7.5 Delimited definitions</h3>
25652588
2566-<p><a name="index-delimited-definitions-120"></a>
2589+<p><a name="index-delimited-definitions-125"></a>
25672590 Many elements are delimited by specific character sequences.
25682591 For instance, strings and multiline comments. The syntax for
25692592 such an element definition is
@@ -2632,7 +2655,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Language-Definitions">Language Definit
26322655
26332656 <h3 class="section">7.6 Variable definitions</h3>
26342657
2635-<p><a name="index-variables-121"></a>
2658+<p><a name="index-variables-126"></a>
26362659 It is possible to define variables to be re-used in
26372660 many parts in a language definition file.
26382661 A variable is defined by using
@@ -2664,7 +2687,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Language-Definitions">Language Definit
26642687
26652688 <h3 class="section">7.7 Dynamic Backreferences</h3>
26662689
2667-<p><a name="index-dynamic-backreference-122"></a>
2690+<p><a name="index-dynamic-backreference-127"></a>
26682691 With <em>dynamic backreferences</em> you can refer to a string matched by
26692692 the regular expression of the first element of a <code>delim</code>
26702693 specification<a rel="footnote" href="#fn-29" name="fnd-29"><sup>29</sup></a>. I called these
@@ -2739,7 +2762,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Language-Definitions">Language Definit
27392762
27402763 <h3 class="section">7.8 File inclusion</h3>
27412764
2742-<p><a name="index-file-inclusion-123"></a>
2765+<p><a name="index-file-inclusion-128"></a>
27432766 It is possible to include other language definition files into another
27442767 file. This is inclusion actually physically includes the contents of
27452768 the included file into the current file during parsing, at the exact
@@ -2776,7 +2799,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Language-Definitions">Language Definit
27762799
27772800 <h3 class="section">7.9 State/Environment Definitions</h3>
27782801
2779-<p><a name="index-states-124"></a><a name="index-environments-125"></a>
2802+<p><a name="index-states-129"></a><a name="index-environments-130"></a>
27802803 Sometimes you want some source element to be highlighted only if they
27812804 are surrounded by other elements. Source-highlight language definitions
27822805 provides also this feature.
@@ -3007,7 +3030,7 @@ with some changes. Typically you <code>include</code> another
30073030 language definition file and you redefine/substitute some
30083031 elements.
30093032
3010- <p><a name="index-redef-126"></a>When you use <code>redef</code> you erase all the previous
3033+ <p><a name="index-redef-131"></a>When you use <code>redef</code> you erase all the previous
30113034 definitions of that language elements with the new one.
30123035 The new language element definition will be placed exactly
30133036 in the point of the new definition.
@@ -3040,7 +3063,7 @@ In other words the following code
30403063 <pre class="example"> type = "int"
30413064 keyword = "myfoo"
30423065 </pre>
3043- <p><a name="index-subst-127"></a>If this is not what you want, you can use <code>subst</code>,
3066+ <p><a name="index-subst-132"></a>If this is not what you want, you can use <code>subst</code>,
30443067 which is similar to <code>redef</code> apart from that it
30453068 replaces the previous first definition of that language
30463069 element in the exact point of that first definition
@@ -3102,7 +3125,7 @@ matched, since there might be another rule that matches &ldquo;better&rdquo;.
31023125 Now, everything basically reduces to the semantics of that <em>better
31033126 match</em>.
31043127
3105- <p><a name="index-matching-strategy-128"></a>The strategy used by source-highlight is to select the first matching rule
3128+ <p><a name="index-matching-strategy-133"></a>The strategy used by source-highlight is to select the first matching rule
31063129
31073130 <ul>
31083131 <li>with empty prefix (or prefix containing only space characters, i.e.,
@@ -3112,13 +3135,13 @@ spaces or tabs) or
31123135
31133136 </ul>
31143137
3115- <p><a name="index-prefix-129"></a>where the <em>prefix</em> of a matched rule is the part of the examined
3138+ <p><a name="index-prefix-134"></a>where the <em>prefix</em> of a matched rule is the part of the examined
31163139 string that did not match<a rel="footnote" href="#fn-33" name="fnd-33"><sup>33</sup></a>. Thus, for instance, if we try to match
31173140 the simple regular expression <code>=</code> against the string
31183141
31193142 <pre class="example"> i = 10;
31203143 </pre>
3121- <p><a name="index-suffix-130"></a>then the prefix is <code>i </code>, including the space. Following the
3144+ <p><a name="index-suffix-135"></a>then the prefix is <code>i </code>, including the space. Following the
31223145 terminology of regular expression, the remaining part that did not
31233146 match, i.e., <code> 10;</code>, is the <em>suffix</em>. When source-highlight
31243147 finds a matching rule, according to the above strategy, it formats the
@@ -3198,28 +3221,28 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Language-Definitions">Language Definit
31983221
31993222 <h3 class="section">7.13 Notes on regular expressions</h3>
32003223
3201-<p><a name="index-regular-expressions-131"></a>
3224+<p><a name="index-regular-expressions-136"></a>
32023225 Although we refer to Boost documentation for such
32033226 syntax<a rel="footnote" href="#fn-34" name="fnd-34"><sup>34</sup></a>,
32043227 we want to provide here some explanations of some forms of regular
32053228 expressions that might be unknown but that are pretty useful in language
32063229 definitions.
32073230
3208- <p><a name="index-non_002dmarking-parenthesis-132"></a>Typically, when you need to group sub-expressions with parenthesis, but
3231+ <p><a name="index-non_002dmarking-parenthesis-137"></a>Typically, when you need to group sub-expressions with parenthesis, but
32093232 you don't want the parenthesis to spit out another marked
32103233 sub-expression, you can use a <em>non-marking parenthesis</em>
32113234 <code>(?:expression)</code>. This is not necessary in the language definition
32123235 syntax: even though you use standard parenthesis, source-highlight will
32133236 transform it into a non-marking parenthesis.
32143237
3215- <p><a name="index-marked-subexpressions-133"></a>Source-highlight translates possible <em>marked subexpressions</em>, i.e.,
3238+ <p><a name="index-marked-subexpressions-138"></a>Source-highlight translates possible <em>marked subexpressions</em>, i.e.,
32163239 those enclosed in <code>(</code> and <code>)</code>, into non-marked subexpressions
32173240 (i.e., those explained above). Since version 2.7, if you specify the
32183241 expression inside <code>`</code> the marked subexpressions are left as such
32193242 (see also <a href="#Ways-of-specifying-regular-expressions">Ways of specifying regular expressions</a>). This is useful
32203243 for <em>backreferences</em> and <em>conditionals</em>.
32213244
3222- <p><a name="index-backreference-134"></a>An escape character followed by a digit n, where n is in the range 1-9,
3245+ <p><a name="index-backreference-139"></a>An escape character followed by a digit n, where n is in the range 1-9,
32233246 is a <em>backreference</em> matches the same string that was matched by
32243247 sub-expression n. For example the expression <code>^(a*).*\1$</code> will
32253248 match the string: <code>aaabbaaa</code> but not the string <code>aaabba</code>.
@@ -3235,7 +3258,7 @@ as in the case of Perl's substitution modifiers; thus
32353258 s#foo#bar#g
32363259 s@foo@bar@g
32373260 </pre>
3238- <p><a name="index-lookahead-asserts-135"></a>A useful regular expression form is the <em>Forward Lookahead Asserts</em>
3261+ <p><a name="index-lookahead-asserts-140"></a>A useful regular expression form is the <em>Forward Lookahead Asserts</em>
32393262 that come in two forms, one for positive forward lookahead asserts, and
32403263 one for negative lookahead asserts:
32413264
@@ -3285,7 +3308,7 @@ language definition:
32853308 </pre>
32863309 <p class="noindent">but a cut-and-paste error had its way ;-)
32873310
3288- <p><a name="index-lookbehind-asserts-136"></a>You can also use <em>Lookbehind Asserts</em>:
3311+ <p><a name="index-lookbehind-asserts-141"></a>You can also use <em>Lookbehind Asserts</em>:
32893312
32903313 <dl>
32913314 <dt><code>(?&lt;=pattern)</code><dd> consumes zero characters, only if pattern could be matched against the
@@ -3296,7 +3319,7 @@ language definition:
32963319 length).
32973320 </dl>
32983321
3299- <p><a name="index-conditional-expressions-137"></a>Another advanced regular expression mechanism is the one of
3322+ <p><a name="index-conditional-expressions-142"></a>Another advanced regular expression mechanism is the one of
33003323 <em>conditional expressions</em>
33013324
33023325 <dl>
@@ -3340,7 +3363,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Language-Definitions">Language Definit
33403363
33413364 <h3 class="section">7.14 The program <samp><span class="command">check-regexp</span></samp></h3>
33423365
3343-<p><a name="index-g_t_0040command_007bcheck_002dregexp_007d-138"></a>Since version 2.7, the source-highlight package comes with a
3366+<p><a name="index-g_t_0040command_007bcheck_002dregexp_007d-143"></a>Since version 2.7, the source-highlight package comes with a
33443367 small additional program, <samp><span class="command">check-regexp</span></samp>, that permits
33453368 testing regular expressions on the command line.
33463369
@@ -3422,7 +3445,7 @@ these. In order to define good output formatting style files you should
34223445 be aware of each language element defined by a language definition file.
34233446 Instead of having to look inside the language definition file itself
34243447 (and recursively in each included file) you can use the command line
3425-<a name="index-g_t_0040code_007b_002d_002dshow_002dlang_002delements_007d-139"></a>option <code>--show-lang-elements</code><a rel="footnote" href="#fn-37" name="fnd-37"><sup>37</sup></a>, that
3448+<a name="index-g_t_0040code_007b_002d_002dshow_002dlang_002delements_007d-144"></a>option <code>--show-lang-elements</code><a rel="footnote" href="#fn-37" name="fnd-37"><sup>37</sup></a>, that
34263449 simply prints to the standard output all the language elements that
34273450 can be highlighted with a specific language definition file.
34283451
@@ -3505,7 +3528,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Language-Definitions">Language Definit
35053528
35063529 <h3 class="section">7.17 Debugging</h3>
35073530
3508-<p><a name="index-debug-140"></a>
3531+<p><a name="index-debug-145"></a>
35093532 When writing a language definition file, it is quite useful to be able
35103533 to debug it (by using complex regular expressions one may experience
35113534 unwanted behaviors). Since version 2.1 the command line option
@@ -3894,7 +3917,7 @@ files). In particular the comments definitions:
38943917 <i># comments with documentation tags</i>
38953918 <b>environment</b> <i>comment</i> <b>start</b> <tt>"///"</tt> <b>begin</b>
38963919 <b>include</b> <tt>"url.lang"</tt>
3897- <b>include</b> <tt>"html.lang"</tt>
3920+ <b>include</b> <tt>"html_simple.lang"</tt>
38983921 <i>type</i> = <tt>'@[[:alpha:]]+'</tt>
38993922 <b>include</b> <tt>"todo.lang"</tt>
39003923 <b>end</b>
@@ -3904,7 +3927,7 @@ files). In particular the comments definitions:
39043927 <i># comments with documentation tags</i>
39053928 <b>environment</b> <i>comment</i> <b>delim</b> <tt>"/**"</tt> <tt>"*/"</tt> <b>multiline</b> <b>begin</b>
39063929 <b>include</b> <tt>"url.lang"</tt>
3907- <b>include</b> <tt>"html.lang"</tt>
3930+ <b>include</b> <tt>"html_simple.lang"</tt>
39083931 <i>type</i> = <tt>'@[[:alpha:]]+'</tt>
39093932 <b>include</b> <tt>"todo.lang"</tt>
39103933 <b>end</b>
@@ -4492,7 +4515,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
44924515
44934516 <h2 class="chapter">8 Output Language Definitions</h2>
44944517
4495-<p><a name="index-output-language-definition-141"></a>
4518+<p><a name="index-output-language-definition-146"></a>
44964519 Since version 2.1 source-highlight uses a specific syntax to specify
44974520 output formats (e.g., how to format in HTML, LaTeX, etc.). Before
44984521 version 2.1, in order to add a new output format, many C++ classes had
@@ -4580,7 +4603,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Output-Language-Definitions">Output La
45804603
45814604 <h3 class="section">8.2 Text styles</h3>
45824605
4583-<p><a name="index-bold-142"></a><a name="index-italics-143"></a><a name="index-underline-144"></a><a name="index-fixed-145"></a><a name="index-notfixed-146"></a>
4606+<p><a name="index-bold-147"></a><a name="index-italics-148"></a><a name="index-underline-149"></a><a name="index-fixed-150"></a><a name="index-notfixed-151"></a>
45844607 These are the text styles that one can define:
45854608
45864609 <pre class="example"> bold
@@ -4598,7 +4621,7 @@ format style, <a href="#Output-format-style">Output format style</a>.
45984621 italics "&lt;i&gt;$text&lt;/i&gt;"
45994622 underline "&lt;u&gt;$text&lt;/u&gt;"
46004623 </pre>
4601- <p><a name="index-g_t_0024text-147"></a>Inside a definition you use the special variable <code>$text</code> to specify
4624+ <p><a name="index-g_t_0024text-152"></a>Inside a definition you use the special variable <code>$text</code> to specify
46024625 where the actual text to be formatted has to be inserted. For instance,
46034626 the definition of <code>bold</code> above says that if you need to format the
46044627 keyword <code>class</code> in bold in HTML, the following text will be
@@ -4623,13 +4646,13 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Output-Language-Definitions">Output La
46234646
46244647 <h3 class="section">8.3 Colors</h3>
46254648
4626-<p><a name="index-colors-148"></a><a name="index-g_t_0024style-149"></a>
4649+<p><a name="index-colors-153"></a><a name="index-g_t_0024style-154"></a>
46274650 The definition for using colors during formatting requires
46284651 the definition for the <code>color</code> style
46294652
46304653 <pre class="example"> color "..."
46314654 </pre>
4632- <p><a name="index-background-color-150"></a>and for the <code>bgcolor</code> style<a rel="footnote" href="#fn-44" name="fnd-44"><sup>44</sup></a>:
4655+ <p><a name="index-background-color-155"></a>and for the <code>bgcolor</code> style<a rel="footnote" href="#fn-44" name="fnd-44"><sup>44</sup></a>:
46334656
46344657 <pre class="example"> bgcolor "..."
46354658 </pre>
@@ -4730,7 +4753,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Output-Language-Definitions">Output La
47304753
47314754 <h3 class="section">8.4 Anchors and References</h3>
47324755
4733-<p><a name="index-g_t_0024linenum-151"></a>
4756+<p><a name="index-g_t_0024linenum-156"></a>
47344757 When using the command line option <code>--line-number-ref</code>
47354758 (<a href="#Invoking-source_002dhighlight">Invoking source-highlight</a>) an anchor is generated in the output
47364759 file for each line numbering. The style of the anchor is defined by the
@@ -4743,7 +4766,7 @@ with the actual text.
47434766
47444767 <pre class="example"> anchor "&lt;a name=\"$linenum\"&gt;$text&lt;/a&gt;"
47454768 </pre>
4746- <p><a name="index-g_t_0024infile-152"></a><a name="index-g_t_0024infilename-153"></a><a name="index-g_t_0024outfile-154"></a>Since version 2.2 source-highlight can also generate references to
4769+ <p><a name="index-g_t_0024infile-157"></a><a name="index-g_t_0024infilename-158"></a><a name="index-g_t_0024outfile-159"></a>Since version 2.2 source-highlight can also generate references to
47474770 several elements (e.g., variables, class definitions, etc.),
47484771 <a href="#Generating-References">Generating References</a>. Also in this case the definition
47494772 <code>anchor</code> is used; furthermore, the definition of <code>reference</code>
@@ -4801,7 +4824,7 @@ definitions of <code>anchor</code> and <code>reference</code> as you see fit. S
48014824 examples of outputs with references in Texinfo are shown in
48024825 <a href="#Examples">Examples</a>.
48034826
4804- <p><a name="index-inline_005freference-155"></a><a name="index-postline_005freference-156"></a><a name="index-postdoc_005freference-157"></a>Indeed, one can use three more definitions for <code>reference</code> that
4827+ <p><a name="index-inline_005freference-160"></a><a name="index-postline_005freference-161"></a><a name="index-postdoc_005freference-162"></a>Indeed, one can use three more definitions for <code>reference</code> that
48054828 corresponds to the three arguments that can be passed to
48064829 <code>--gen-references</code> command line option (<a href="#Generating-References">Generating References</a>): <code>inline_reference</code>, <code>postline_reference</code> and
48074830 <code>postdoc_reference</code>. If one of this not defined, then the same
@@ -4825,7 +4848,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Output-Language-Definitions">Output La
48254848
48264849 <h3 class="section">8.5 One style</h3>
48274850
4828-<p><a name="index-one-style-158"></a>
4851+<p><a name="index-one-style-163"></a>
48294852 If the output format you are defining does not have a specific style
48304853 for bold, italics, ... and for colors you can simply use the definition
48314854 <code>onestyle</code>, where you can use both <code>$style</code> and <code>$text</code>.
@@ -4862,7 +4885,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Output-Language-Definitions">Output La
48624885
48634886 <h3 class="section">8.6 Style template</h3>
48644887
4865-<p><a name="index-style-template-159"></a><a name="index-style-separator-160"></a>
4888+<p><a name="index-style-template-164"></a><a name="index-style-separator-165"></a>
48664889 Some output formats are based on a unique template that where the other
48674890 styles are composed; during composition the styles can be separated with
48684891 a specific separator:
@@ -4996,13 +5019,13 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Output-Language-Definitions">Output La
49965019
49975020 <p>You can define the beginning and the end of an output file, with
49985021
4999- <p><a name="index-doctemplate-161"></a>
5022+ <p><a name="index-doctemplate-166"></a>
50005023 <pre class="example"> doctemplate
50015024 "...beginning..."
50025025 "...end..."
50035026 end
50045027 </pre>
5005- <p><a name="index-nodoctemplate-162"></a>
5028+ <p><a name="index-nodoctemplate-167"></a>
50065029 <pre class="example"> nodoctemplate
50075030 "...beginning..."
50085031 "...end..."
@@ -5215,7 +5238,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
52155238
52165239 <h2 class="chapter">9 Generating References</h2>
52175240
5218-<p><a name="index-reference-163"></a><a name="index-anchor-164"></a><a name="index-ctags-165"></a>
5241+<p><a name="index-reference-168"></a><a name="index-anchor-169"></a><a name="index-ctags-170"></a>
52195242 Since version 2.2 Source-highlight also produces references to fields,
52205243 variables, etc. In order to do this it relies on the program
52215244 <em>Exuberant Ctags</em>, by Darren Hiebert, available at
@@ -5583,7 +5606,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Examples">Examples</a>
55835606
55845607 <h3 class="section">10.3 Line ranges</h3>
55855608
5586-<p><a name="index-line-ranges-166"></a>This is an example that uses <code>--line-range</code> command line
5609+<p><a name="index-line-ranges-171"></a>This is an example that uses <code>--line-range</code> command line
55875610 option on the input file shown in See <a href="#Simple-example">Simple example</a>:
55885611
55895612 <pre class="example"> source-highlight -f texinfo -i test.java -n \
@@ -5624,7 +5647,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Examples">Examples</a>
56245647
56255648 <h3 class="section">10.4 Line ranges (with context)</h3>
56265649
5627-<p><a name="index-line-ranges-167"></a><a name="index-range-context-168"></a><a name="index-range-separator-169"></a>This is an example that uses the command line option <code>--line-range</code>
5650+<p><a name="index-line-ranges-172"></a><a name="index-range-context-173"></a><a name="index-range-separator-174"></a>This is an example that uses the command line option <code>--line-range</code>
56285651 together with the <code>--range-context</code> and <code>--range-separator</code>:
56295652
56305653 <pre class="example"> source-highlight -f texinfo -i test.java -n \
@@ -5679,7 +5702,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Examples">Examples</a>
56795702
56805703 <h3 class="section">10.5 Regex ranges</h3>
56815704
5682-<p><a name="index-regex-ranges-170"></a>Ranges can be expressed also using regular expressions, with the command
5705+<p><a name="index-regex-ranges-175"></a>Ranges can be expressed also using regular expressions, with the command
56835706 line option <code>--regex-range</code>. In this case the beginning of the
56845707 range will be detected by a line containing (in any point) a string
56855708 matching the specified regular expression; the end will be detected by a
@@ -5790,7 +5813,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
57905813
57915814 <h2 class="chapter">11 Reporting Bugs</h2>
57925815
5793-<p><a name="index-bugs-171"></a><a name="index-problems-172"></a>
5816+<p><a name="index-bugs-176"></a><a name="index-problems-177"></a>
57945817 If you find a bug in <samp><span class="command">source-highlight</span></samp>, please send electronic
57955818 mail to
57965819
@@ -5816,7 +5839,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
58165839
58175840 <h2 class="chapter">12 Mailing Lists</h2>
58185841
5819-<p><a name="index-mailing-list-173"></a>
5842+<p><a name="index-mailing-list-178"></a>
58205843 The following mailing lists are available:
58215844
58225845 <p><code>help-source-highlight at gnu dot org</code>
@@ -5849,178 +5872,183 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
58495872
58505873 <h2 class="unnumbered">Concept Index</h2>
58515874
5852-<p><a name="index-tail-recursion-174"></a>
5875+<p><a name="index-tail-recursion-179"></a>
58535876
58545877 <ul class="index-cp" compact>
5855-<li><a href="#index-g_t_0040code_007b_0022expression_0022_007d-110"><code>"expression"</code></a>: <a href="#Ways-of-specifying-regular-expressions">Ways of specifying regular expressions</a></li>
5856-<li><a href="#index-g_t_0024infile-152">$infile</a>: <a href="#Anchors-and-References">Anchors and References</a></li>
5857-<li><a href="#index-g_t_0024infilename-153">$infilename</a>: <a href="#Anchors-and-References">Anchors and References</a></li>
5858-<li><a href="#index-g_t_0024linenum-151">$linenum</a>: <a href="#Anchors-and-References">Anchors and References</a></li>
5859-<li><a href="#index-g_t_0024outfile-154">$outfile</a>: <a href="#Anchors-and-References">Anchors and References</a></li>
5860-<li><a href="#index-g_t_0024style-149">$style</a>: <a href="#Colors">Colors</a></li>
5861-<li><a href="#index-g_t_0024text-147">$text</a>: <a href="#Text-styles">Text styles</a></li>
5862-<li><a href="#index-g_t_0040code_007b_0027expression_0027_007d-111"><code>'expression'</code></a>: <a href="#Ways-of-specifying-regular-expressions">Ways of specifying regular expressions</a></li>
5863-<li><a href="#index-g_t_0040code_007b_002d_002ddata_002ddir_007d-99"><code>--data-dir</code></a>: <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a></li>
5864-<li><a href="#index-g_t_0040code_007b_002d_002ddata_002ddir_007d-70"><code>--data-dir</code></a>: <a href="#Configuration-files">Configuration files</a></li>
5878+<li><a href="#index-g_t_0040code_007b_0022expression_0022_007d-115"><code>"expression"</code></a>: <a href="#Ways-of-specifying-regular-expressions">Ways of specifying regular expressions</a></li>
5879+<li><a href="#index-g_t_0024infile-157">$infile</a>: <a href="#Anchors-and-References">Anchors and References</a></li>
5880+<li><a href="#index-g_t_0024infilename-158">$infilename</a>: <a href="#Anchors-and-References">Anchors and References</a></li>
5881+<li><a href="#index-g_t_0024linenum-156">$linenum</a>: <a href="#Anchors-and-References">Anchors and References</a></li>
5882+<li><a href="#index-g_t_0024outfile-159">$outfile</a>: <a href="#Anchors-and-References">Anchors and References</a></li>
5883+<li><a href="#index-g_t_0024style-154">$style</a>: <a href="#Colors">Colors</a></li>
5884+<li><a href="#index-g_t_0024text-152">$text</a>: <a href="#Text-styles">Text styles</a></li>
5885+<li><a href="#index-g_t_0040code_007b_0027expression_0027_007d-116"><code>'expression'</code></a>: <a href="#Ways-of-specifying-regular-expressions">Ways of specifying regular expressions</a></li>
5886+<li><a href="#index-g_t_0040code_007b_002d_002ddata_002ddir_007d-104"><code>--data-dir</code></a>: <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a></li>
5887+<li><a href="#index-g_t_0040code_007b_002d_002ddata_002ddir_007d-75"><code>--data-dir</code></a>: <a href="#Configuration-files">Configuration files</a></li>
58655888 <li><a href="#index-g_t_0040code_007b_002d_002ddata_002ddir_007d-6"><code>--data-dir</code></a>: <a href="#The-program-source_002dhighlight_002dsettings">The program source-highlight-settings</a></li>
5866-<li><a href="#index-g_t_0040code_007b_002d_002dinfer_002dlang_007d-108"><code>--infer-lang</code></a>: <a href="#How-the-input-language-is-discovered">How the input language is discovered</a></li>
5867-<li><a href="#index-g_t_0040code_007b_002d_002dinfer_002dlang_007d-101"><code>--infer-lang</code></a>: <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a></li>
5889+<li><a href="#index-g_t_0040code_007b_002d_002dinfer_002dlang_007d-113"><code>--infer-lang</code></a>: <a href="#How-the-input-language-is-discovered">How the input language is discovered</a></li>
5890+<li><a href="#index-g_t_0040code_007b_002d_002dinfer_002dlang_007d-106"><code>--infer-lang</code></a>: <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a></li>
58685891 <li><a href="#index-g_t_0040code_007b_002d_002dinfer_002dlang_007d-10"><code>--infer-lang</code></a>: <a href="#Perl">Perl</a></li>
5869-<li><a href="#index-g_t_0040code_007b_002d_002dshow_002dlang_002delements_007d-139"><code>--show-lang-elements</code></a>: <a href="#Listing-Language-Elements">Listing Language Elements</a></li>
5870-<li><a href="#index-g_t_0040code_007b_002d_002dshow_002dlang_002delements_007d-74"><code>--show-lang-elements</code></a>: <a href="#Output-format-style">Output format style</a></li>
5871-<li><a href="#index-g_t_0040code_007b_002d_002dstyle_002dcss_002dfile_007d-89"><code>--style-css-file</code></a>: <a href="#Output-format-style-using-CSS">Output format style using CSS</a></li>
5872-<li><a href="#index-g_t_0040code_007b_002d_002dstyle_002dfile_007d-77"><code>--style-file</code></a>: <a href="#Output-format-style">Output format style</a></li>
5873-<li><a href="#index-g_t_0040code_007b_002d_002dwith_002ddoxygen_007d-36"><code>--with-doxygen</code></a>: <a href="#Installation">Installation</a></li>
5874-<li><a href="#index-g_t_0040code_007b_0060expression_0060_007d-112"><code>`expression`</code></a>: <a href="#Ways-of-specifying-regular-expressions">Ways of specifying regular expressions</a></li>
5875-<li><a href="#index-anchor-164">anchor</a>: <a href="#Generating-References">Generating References</a></li>
5876-<li><a href="#index-ANSI-color-68">ANSI color</a>: <a href="#ANSI-color-escape-sequences">ANSI color escape sequences</a></li>
5892+<li><a href="#index-g_t_0040code_007b_002d_002dshow_002dlang_002delements_007d-144"><code>--show-lang-elements</code></a>: <a href="#Listing-Language-Elements">Listing Language Elements</a></li>
5893+<li><a href="#index-g_t_0040code_007b_002d_002dshow_002dlang_002delements_007d-79"><code>--show-lang-elements</code></a>: <a href="#Output-format-style">Output format style</a></li>
5894+<li><a href="#index-g_t_0040code_007b_002d_002dstyle_002dcss_002dfile_007d-94"><code>--style-css-file</code></a>: <a href="#Output-format-style-using-CSS">Output format style using CSS</a></li>
5895+<li><a href="#index-g_t_0040code_007b_002d_002dstyle_002dfile_007d-82"><code>--style-file</code></a>: <a href="#Output-format-style">Output format style</a></li>
5896+<li><a href="#index-g_t_0040code_007b_002d_002dwith_002ddoxygen_007d-41"><code>--with-doxygen</code></a>: <a href="#Installation">Installation</a></li>
5897+<li><a href="#index-g_t_0040code_007b_0060expression_0060_007d-117"><code>`expression`</code></a>: <a href="#Ways-of-specifying-regular-expressions">Ways of specifying regular expressions</a></li>
5898+<li><a href="#index-anchor-169">anchor</a>: <a href="#Generating-References">Generating References</a></li>
5899+<li><a href="#index-ANSI-color-73">ANSI color</a>: <a href="#ANSI-color-escape-sequences">ANSI color escape sequences</a></li>
58775900 <li><a href="#index-Apache-25">Apache</a>: <a href="#Related-Software-and-Links">Related Software and Links</a></li>
5878-<li><a href="#index-autoconf-54">autoconf</a>: <a href="#What-you-need-to-build-source_002dhighlight">What you need to build source-highlight</a></li>
5879-<li><a href="#index-autoconf-48">autoconf</a>: <a href="#Anonymous-Git-Checkout">Anonymous Git Checkout</a></li>
5880-<li><a href="#index-automake-53">automake</a>: <a href="#What-you-need-to-build-source_002dhighlight">What you need to build source-highlight</a></li>
5881-<li><a href="#index-automake-47">automake</a>: <a href="#Anonymous-Git-Checkout">Anonymous Git Checkout</a></li>
5882-<li><a href="#index-background-color-150">background color</a>: <a href="#Colors">Colors</a></li>
5883-<li><a href="#index-background-color-76">background color</a>: <a href="#Output-format-style">Output format style</a></li>
5884-<li><a href="#index-backreference-134">backreference</a>: <a href="#Notes-on-regular-expressions">Notes on regular expressions</a></li>
5885-<li><a href="#index-backreference-114">backreference</a>: <a href="#Ways-of-specifying-regular-expressions">Ways of specifying regular expressions</a></li>
5886-<li><a href="#index-backtick-115">backtick</a>: <a href="#Ways-of-specifying-regular-expressions">Ways of specifying regular expressions</a></li>
5887-<li><a href="#index-bash-completion-34">bash completion</a>: <a href="#Installation">Installation</a></li>
5888-<li><a href="#index-g_t_0040code_007bbgcolor_007d-75"><code>bgcolor</code></a>: <a href="#Output-format-style">Output format style</a></li>
5889-<li><a href="#index-bold-142">bold</a>: <a href="#Text-styles">Text styles</a></li>
5890-<li><a href="#index-bold-80">bold</a>: <a href="#Output-format-style">Output format style</a></li>
5891-<li><a href="#index-boost-52">boost</a>: <a href="#What-you-need-to-build-source_002dhighlight">What you need to build source-highlight</a></li>
5892-<li><a href="#index-boost-42">boost</a>: <a href="#Building-with-qmake">Building with qmake</a></li>
5893-<li><a href="#index-Boost-regex-57">Boost regex</a>: <a href="#Tips-on-installing-Boost-Regex-library">Tips on installing Boost Regex library</a></li>
5894-<li><a href="#index-bugs-171">bugs</a>: <a href="#Problems">Problems</a></li>
5895-<li><a href="#index-building-requirements-51">building requirements</a>: <a href="#What-you-need-to-build-source_002dhighlight">What you need to build source-highlight</a></li>
5896-<li><a href="#index-CGI-59">CGI</a>: <a href="#Using-source_002dhighlight-as-a-CGI">Using source-highlight as a CGI</a></li>
5897-<li><a href="#index-g_t_0040command_007bcheck_002dregexp_007d-138"><samp><span class="command">check-regexp</span></samp></a>: <a href="#The-program-check_002dregexp">The program check-regexp</a></li>
5901+<li><a href="#index-autoconf-59">autoconf</a>: <a href="#What-you-need-to-build-source_002dhighlight">What you need to build source-highlight</a></li>
5902+<li><a href="#index-autoconf-53">autoconf</a>: <a href="#Anonymous-Git-Checkout">Anonymous Git Checkout</a></li>
5903+<li><a href="#index-automake-58">automake</a>: <a href="#What-you-need-to-build-source_002dhighlight">What you need to build source-highlight</a></li>
5904+<li><a href="#index-automake-52">automake</a>: <a href="#Anonymous-Git-Checkout">Anonymous Git Checkout</a></li>
5905+<li><a href="#index-background-color-155">background color</a>: <a href="#Colors">Colors</a></li>
5906+<li><a href="#index-background-color-81">background color</a>: <a href="#Output-format-style">Output format style</a></li>
5907+<li><a href="#index-backreference-139">backreference</a>: <a href="#Notes-on-regular-expressions">Notes on regular expressions</a></li>
5908+<li><a href="#index-backreference-119">backreference</a>: <a href="#Ways-of-specifying-regular-expressions">Ways of specifying regular expressions</a></li>
5909+<li><a href="#index-backtick-120">backtick</a>: <a href="#Ways-of-specifying-regular-expressions">Ways of specifying regular expressions</a></li>
5910+<li><a href="#index-bash-completion-39">bash completion</a>: <a href="#Installation">Installation</a></li>
5911+<li><a href="#index-g_t_0040code_007bbgcolor_007d-80"><code>bgcolor</code></a>: <a href="#Output-format-style">Output format style</a></li>
5912+<li><a href="#index-bold-147">bold</a>: <a href="#Text-styles">Text styles</a></li>
5913+<li><a href="#index-bold-85">bold</a>: <a href="#Output-format-style">Output format style</a></li>
5914+<li><a href="#index-boost-57">boost</a>: <a href="#What-you-need-to-build-source_002dhighlight">What you need to build source-highlight</a></li>
5915+<li><a href="#index-boost-47">boost</a>: <a href="#Building-with-qmake">Building with qmake</a></li>
5916+<li><a href="#index-Boost-regex-62">Boost regex</a>: <a href="#Tips-on-installing-Boost-Regex-library">Tips on installing Boost Regex library</a></li>
5917+<li><a href="#index-bugs-176">bugs</a>: <a href="#Problems">Problems</a></li>
5918+<li><a href="#index-building-requirements-56">building requirements</a>: <a href="#What-you-need-to-build-source_002dhighlight">What you need to build source-highlight</a></li>
5919+<li><a href="#index-CGI-64">CGI</a>: <a href="#Using-source_002dhighlight-as-a-CGI">Using source-highlight as a CGI</a></li>
5920+<li><a href="#index-g_t_0040command_007bcheck_002dregexp_007d-143"><samp><span class="command">check-regexp</span></samp></a>: <a href="#The-program-check_002dregexp">The program check-regexp</a></li>
58985921 <li><a href="#index-code2blog-24">code2blog</a>: <a href="#Related-Software-and-Links">Related Software and Links</a></li>
5899-<li><a href="#index-color-78">color</a>: <a href="#Output-format-style">Output format style</a></li>
5900-<li><a href="#index-colors-148">colors</a>: <a href="#Colors">Colors</a></li>
5901-<li><a href="#index-compilation-requirements-50">compilation requirements</a>: <a href="#What-you-need-to-build-source_002dhighlight">What you need to build source-highlight</a></li>
5902-<li><a href="#index-conditional-expressions-137">conditional expressions</a>: <a href="#Notes-on-regular-expressions">Notes on regular expressions</a></li>
5903-<li><a href="#index-configuration-files-69">configuration files</a>: <a href="#Configuration-files">Configuration files</a></li>
5904-<li><a href="#index-Copying-conditions-61">Copying conditions</a>: <a href="#Copying">Copying</a></li>
5905-<li><a href="#index-cpp2html-39">cpp2html</a>: <a href="#Installation">Installation</a></li>
5906-<li><a href="#index-CSS-88">CSS</a>: <a href="#Output-format-style-using-CSS">Output format style using CSS</a></li>
5907-<li><a href="#index-ctags-165">ctags</a>: <a href="#Generating-References">Generating References</a></li>
5908-<li><a href="#index-debug-140">debug</a>: <a href="#Debugging">Debugging</a></li>
5909-<li><a href="#index-default_002elang-107">default.lang</a>: <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a></li>
5922+<li><a href="#index-color-83">color</a>: <a href="#Output-format-style">Output format style</a></li>
5923+<li><a href="#index-colors-153">colors</a>: <a href="#Colors">Colors</a></li>
5924+<li><a href="#index-compilation-requirements-55">compilation requirements</a>: <a href="#What-you-need-to-build-source_002dhighlight">What you need to build source-highlight</a></li>
5925+<li><a href="#index-conditional-expressions-142">conditional expressions</a>: <a href="#Notes-on-regular-expressions">Notes on regular expressions</a></li>
5926+<li><a href="#index-configuration-files-74">configuration files</a>: <a href="#Configuration-files">Configuration files</a></li>
5927+<li><a href="#index-Copying-conditions-66">Copying conditions</a>: <a href="#Copying">Copying</a></li>
5928+<li><a href="#index-cpp2html-44">cpp2html</a>: <a href="#Installation">Installation</a></li>
5929+<li><a href="#index-CSS-93">CSS</a>: <a href="#Output-format-style-using-CSS">Output format style using CSS</a></li>
5930+<li><a href="#index-ctags-170">ctags</a>: <a href="#Generating-References">Generating References</a></li>
5931+<li><a href="#index-debug-145">debug</a>: <a href="#Debugging">Debugging</a></li>
5932+<li><a href="#index-default_002elang-112">default.lang</a>: <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a></li>
59105933 <li><a href="#index-default_002elang-13">default.lang</a>: <a href="#Using-source_002dhighlight-as-a-simple-formatter">Using source-highlight as a simple formatter</a></li>
5911-<li><a href="#index-default_002estyle-73">default.style</a>: <a href="#Output-format-style">Output format style</a></li>
5912-<li><a href="#index-definition-order-119">definition order</a>: <a href="#Order-of-definitions">Order of definitions</a></li>
5913-<li><a href="#index-delimited-definitions-120">delimited definitions</a>: <a href="#Delimited-definitions">Delimited definitions</a></li>
5914-<li><a href="#index-direct-color-scheme-87">direct color scheme</a>: <a href="#Output-format-style">Output format style</a></li>
5915-<li><a href="#index-directories-33">directories</a>: <a href="#Installation">Installation</a></li>
5916-<li><a href="#index-DocBook-67">DocBook</a>: <a href="#DocBook-output">DocBook output</a></li>
5917-<li><a href="#index-doctemplate-161">doctemplate</a>: <a href="#Document-template">Document template</a></li>
5918-<li><a href="#index-download-45">download</a>: <a href="#Download">Download</a></li>
5919-<li><a href="#index-doxygen-37">doxygen</a>: <a href="#Installation">Installation</a></li>
5920-<li><a href="#index-dynamic-backreference-122">dynamic backreference</a>: <a href="#Dynamic-Backreferences">Dynamic Backreferences</a></li>
5921-<li><a href="#index-environments-125">environments</a>: <a href="#State_002fEnvironment-Definitions">State/Environment Definitions</a></li>
5922-<li><a href="#index-failsafe-106">failsafe</a>: <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a></li>
5934+<li><a href="#index-default_002estyle-78">default.style</a>: <a href="#Output-format-style">Output format style</a></li>
5935+<li><a href="#index-definition-order-124">definition order</a>: <a href="#Order-of-definitions">Order of definitions</a></li>
5936+<li><a href="#index-delimited-definitions-125">delimited definitions</a>: <a href="#Delimited-definitions">Delimited definitions</a></li>
5937+<li><a href="#index-direct-color-scheme-92">direct color scheme</a>: <a href="#Output-format-style">Output format style</a></li>
5938+<li><a href="#index-directories-38">directories</a>: <a href="#Installation">Installation</a></li>
5939+<li><a href="#index-DocBook-72">DocBook</a>: <a href="#DocBook-output">DocBook output</a></li>
5940+<li><a href="#index-doctemplate-166">doctemplate</a>: <a href="#Document-template">Document template</a></li>
5941+<li><a href="#index-download-50">download</a>: <a href="#Download">Download</a></li>
5942+<li><a href="#index-doxygen-42">doxygen</a>: <a href="#Installation">Installation</a></li>
5943+<li><a href="#index-dynamic-backreference-127">dynamic backreference</a>: <a href="#Dynamic-Backreferences">Dynamic Backreferences</a></li>
5944+<li><a href="#index-environments-130">environments</a>: <a href="#State_002fEnvironment-Definitions">State/Environment Definitions</a></li>
5945+<li><a href="#index-failsafe-111">failsafe</a>: <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a></li>
59235946 <li><a href="#index-failsafe-12">failsafe</a>: <a href="#Using-source_002dhighlight-as-a-simple-formatter">Using source-highlight as a simple formatter</a></li>
59245947 <li><a href="#index-features-2">features</a>: <a href="#Introduction">Introduction</a></li>
5925-<li><a href="#index-file-inclusion-123">file inclusion</a>: <a href="#File-inclusion">File inclusion</a></li>
5948+<li><a href="#index-file-inclusion-128">file inclusion</a>: <a href="#File-inclusion">File inclusion</a></li>
59265949 <li><a href="#index-Firefox-27">Firefox</a>: <a href="#Related-Software-and-Links">Related Software and Links</a></li>
5927-<li><a href="#index-fixed-145">fixed</a>: <a href="#Text-styles">Text styles</a></li>
5928-<li><a href="#index-fixed-83">fixed</a>: <a href="#Output-format-style">Output format style</a></li>
5950+<li><a href="#index-fixed-150">fixed</a>: <a href="#Text-styles">Text styles</a></li>
5951+<li><a href="#index-fixed-88">fixed</a>: <a href="#Output-format-style">Output format style</a></li>
59295952 <li><a href="#index-Fortran-8">Fortran</a>: <a href="#Fortran">Fortran</a></li>
5930-<li><a href="#index-getting-help-98">getting help</a>: <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a></li>
5931-<li><a href="#index-Git-46">Git</a>: <a href="#Anonymous-Git-Checkout">Anonymous Git Checkout</a></li>
5932-<li><a href="#index-gnulib-56">gnulib</a>: <a href="#What-you-need-to-build-source_002dhighlight">What you need to build source-highlight</a></li>
5933-<li><a href="#index-help-97">help</a>: <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a></li>
5934-<li><a href="#index-HTML-63">HTML</a>: <a href="#HTML-and-XHTML-output">HTML and XHTML output</a></li>
5953+<li><a href="#index-getting-help-103">getting help</a>: <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a></li>
5954+<li><a href="#index-Git-51">Git</a>: <a href="#Anonymous-Git-Checkout">Anonymous Git Checkout</a></li>
5955+<li><a href="#index-gnulib-61">gnulib</a>: <a href="#What-you-need-to-build-source_002dhighlight">What you need to build source-highlight</a></li>
5956+<li><a href="#index-help-102">help</a>: <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a></li>
5957+<li><a href="#index-HTML-68">HTML</a>: <a href="#HTML-and-XHTML-output">HTML and XHTML output</a></li>
59355958 <li><a href="#index-Ikiwiki-29">Ikiwiki</a>: <a href="#Related-Software-and-Links">Related Software and Links</a></li>
5936-<li><a href="#index-inline_005freference-155">inline_reference</a>: <a href="#Anchors-and-References">Anchors and References</a></li>
5937-<li><a href="#index-installation-32">installation</a>: <a href="#Installation">Installation</a></li>
5959+<li><a href="#index-inline_005freference-160">inline_reference</a>: <a href="#Anchors-and-References">Anchors and References</a></li>
5960+<li><a href="#index-installation-37">installation</a>: <a href="#Installation">Installation</a></li>
59385961 <li><a href="#index-introduction-1">introduction</a>: <a href="#Introduction">Introduction</a></li>
5939-<li><a href="#index-invoking-93">invoking</a>: <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a></li>
5940-<li><a href="#index-italics-143">italics</a>: <a href="#Text-styles">Text styles</a></li>
5941-<li><a href="#index-italics-81">italics</a>: <a href="#Output-format-style">Output format style</a></li>
5942-<li><a href="#index-java2html-38">java2html</a>: <a href="#Installation">Installation</a></li>
5962+<li><a href="#index-invoking-98">invoking</a>: <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a></li>
5963+<li><a href="#index-italics-148">italics</a>: <a href="#Text-styles">Text styles</a></li>
5964+<li><a href="#index-italics-86">italics</a>: <a href="#Output-format-style">Output format style</a></li>
5965+<li><a href="#index-java2html-43">java2html</a>: <a href="#Installation">Installation</a></li>
59435966 <li><a href="#index-java2html-22">java2html</a>: <a href="#Related-Software-and-Links">Related Software and Links</a></li>
59445967 <li><a href="#index-KDE-19">KDE</a>: <a href="#Related-Software-and-Links">Related Software and Links</a></li>
59455968 <li><a href="#index-Ksrc2highlight-20">Ksrc2highlight</a>: <a href="#Related-Software-and-Links">Related Software and Links</a></li>
5946-<li><a href="#index-language-definition-109">language definition</a>: <a href="#Language-Definitions">Language Definitions</a></li>
5947-<li><a href="#index-language-inference-100">language inference</a>: <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a></li>
5948-<li><a href="#index-language-map-91">language map</a>: <a href="#Language-map">Language map</a></li>
5949-<li><a href="#index-g_t_0040LaTeX_007b_007d-65">LaTeX</a>: <a href="#LaTeX-output">LaTeX output</a></li>
5950-<li><a href="#index-library-35">library</a>: <a href="#Installation">Installation</a></li>
5969+<li><a href="#index-language-definition-114">language definition</a>: <a href="#Language-Definitions">Language Definitions</a></li>
5970+<li><a href="#index-language-inference-105">language inference</a>: <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a></li>
5971+<li><a href="#index-language-map-96">language map</a>: <a href="#Language-map">Language map</a></li>
5972+<li><a href="#index-g_t_0040LaTeX_007b_007d-70">LaTeX</a>: <a href="#LaTeX-output">LaTeX output</a></li>
5973+<li><a href="#index-library-40">library</a>: <a href="#Installation">Installation</a></li>
59515974 <li><a href="#index-library-3">library</a>: <a href="#Introduction">Introduction</a></li>
5952-<li><a href="#index-libtool-55">libtool</a>: <a href="#What-you-need-to-build-source_002dhighlight">What you need to build source-highlight</a></li>
5953-<li><a href="#index-libtool-49">libtool</a>: <a href="#Anonymous-Git-Checkout">Anonymous Git Checkout</a></li>
5954-<li><a href="#index-line-ranges-167">line ranges</a>: <a href="#Line-ranges-_0028with-context_0029">Line ranges (with context)</a></li>
5955-<li><a href="#index-line-ranges-166">line ranges</a>: <a href="#Line-ranges">Line ranges</a></li>
5956-<li><a href="#index-line-ranges-102">line ranges</a>: <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a></li>
5957-<li><a href="#index-lines-118">lines</a>: <a href="#Line-wide-definitions">Line wide definitions</a></li>
5958-<li><a href="#index-lookahead-asserts-135">lookahead asserts</a>: <a href="#Notes-on-regular-expressions">Notes on regular expressions</a></li>
5959-<li><a href="#index-lookbehind-asserts-136">lookbehind asserts</a>: <a href="#Notes-on-regular-expressions">Notes on regular expressions</a></li>
5960-<li><a href="#index-mailing-list-173">mailing list</a>: <a href="#Mailing-Lists">Mailing Lists</a></li>
5961-<li><a href="#index-marked-subexpressions-133">marked subexpressions</a>: <a href="#Notes-on-regular-expressions">Notes on regular expressions</a></li>
5962-<li><a href="#index-marked-subexpressions-113">marked subexpressions</a>: <a href="#Ways-of-specifying-regular-expressions">Ways of specifying regular expressions</a></li>
5963-<li><a href="#index-matching-strategy-128">matching strategy</a>: <a href="#How-source_002dhighlight-works">How source-highlight works</a></li>
5964-<li><a href="#index-MinGW-43">MinGW</a>: <a href="#Building-with-qmake">Building with qmake</a></li>
5965-<li><a href="#index-MSVC-41">MSVC</a>: <a href="#Building-with-qmake">Building with qmake</a></li>
5966-<li><a href="#index-msys-44">msys</a>: <a href="#Building-with-qmake">Building with qmake</a></li>
5967-<li><a href="#index-nodoctemplate-162">nodoctemplate</a>: <a href="#Document-template">Document template</a></li>
5975+<li><a href="#index-libtool-60">libtool</a>: <a href="#What-you-need-to-build-source_002dhighlight">What you need to build source-highlight</a></li>
5976+<li><a href="#index-libtool-54">libtool</a>: <a href="#Anonymous-Git-Checkout">Anonymous Git Checkout</a></li>
5977+<li><a href="#index-line-ranges-172">line ranges</a>: <a href="#Line-ranges-_0028with-context_0029">Line ranges (with context)</a></li>
5978+<li><a href="#index-line-ranges-171">line ranges</a>: <a href="#Line-ranges">Line ranges</a></li>
5979+<li><a href="#index-line-ranges-107">line ranges</a>: <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a></li>
5980+<li><a href="#index-lines-123">lines</a>: <a href="#Line-wide-definitions">Line wide definitions</a></li>
5981+<li><a href="#index-lookahead-asserts-140">lookahead asserts</a>: <a href="#Notes-on-regular-expressions">Notes on regular expressions</a></li>
5982+<li><a href="#index-lookbehind-asserts-141">lookbehind asserts</a>: <a href="#Notes-on-regular-expressions">Notes on regular expressions</a></li>
5983+<li><a href="#index-mailing-list-178">mailing list</a>: <a href="#Mailing-Lists">Mailing Lists</a></li>
5984+<li><a href="#index-marked-subexpressions-138">marked subexpressions</a>: <a href="#Notes-on-regular-expressions">Notes on regular expressions</a></li>
5985+<li><a href="#index-marked-subexpressions-118">marked subexpressions</a>: <a href="#Ways-of-specifying-regular-expressions">Ways of specifying regular expressions</a></li>
5986+<li><a href="#index-matching-strategy-133">matching strategy</a>: <a href="#How-source_002dhighlight-works">How source-highlight works</a></li>
5987+<li><a href="#index-MinGW-48">MinGW</a>: <a href="#Building-with-qmake">Building with qmake</a></li>
5988+<li><a href="#index-MSVC-46">MSVC</a>: <a href="#Building-with-qmake">Building with qmake</a></li>
5989+<li><a href="#index-msys-49">msys</a>: <a href="#Building-with-qmake">Building with qmake</a></li>
5990+<li><a href="#index-nodoctemplate-167">nodoctemplate</a>: <a href="#Document-template">Document template</a></li>
59685991 <li><a href="#index-nohilite_002elang-11">nohilite.lang</a>: <a href="#Using-source_002dhighlight-as-a-simple-formatter">Using source-highlight as a simple formatter</a></li>
5969-<li><a href="#index-non_002dmarking-parenthesis-132">non-marking parenthesis</a>: <a href="#Notes-on-regular-expressions">Notes on regular expressions</a></li>
5970-<li><a href="#index-nonsensitive-117">nonsensitive</a>: <a href="#Simple-definitions">Simple definitions</a></li>
5971-<li><a href="#index-noref-86">noref</a>: <a href="#Output-format-style">Output format style</a></li>
5972-<li><a href="#index-notfixed-146">notfixed</a>: <a href="#Text-styles">Text styles</a></li>
5973-<li><a href="#index-notfixed-84">notfixed</a>: <a href="#Output-format-style">Output format style</a></li>
5974-<li><a href="#index-one-style-158">one style</a>: <a href="#One-style">One style</a></li>
5975-<li><a href="#index-options-95">options</a>: <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a></li>
5976-<li><a href="#index-output-language-definition-141">output language definition</a>: <a href="#Output-Language-Definitions">Output Language Definitions</a></li>
5977-<li><a href="#index-output-language-map-92">output language map</a>: <a href="#Output-Language-map">Output Language map</a></li>
5978-<li><a href="#index-output-style-72">output style</a>: <a href="#Output-format-style">Output format style</a></li>
5979-<li><a href="#index-patching-58">patching</a>: <a href="#Patching-from-a-previous-version">Patching from a previous version</a></li>
5992+<li><a href="#index-non_002dmarking-parenthesis-137">non-marking parenthesis</a>: <a href="#Notes-on-regular-expressions">Notes on regular expressions</a></li>
5993+<li><a href="#index-nonsensitive-122">nonsensitive</a>: <a href="#Simple-definitions">Simple definitions</a></li>
5994+<li><a href="#index-noref-91">noref</a>: <a href="#Output-format-style">Output format style</a></li>
5995+<li><a href="#index-notfixed-151">notfixed</a>: <a href="#Text-styles">Text styles</a></li>
5996+<li><a href="#index-notfixed-89">notfixed</a>: <a href="#Output-format-style">Output format style</a></li>
5997+<li><a href="#index-one-style-163">one style</a>: <a href="#One-style">One style</a></li>
5998+<li><a href="#index-options-100">options</a>: <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a></li>
5999+<li><a href="#index-output-language-definition-146">output language definition</a>: <a href="#Output-Language-Definitions">Output Language Definitions</a></li>
6000+<li><a href="#index-output-language-map-97">output language map</a>: <a href="#Output-Language-map">Output Language map</a></li>
6001+<li><a href="#index-output-style-77">output style</a>: <a href="#Output-format-style">Output format style</a></li>
6002+<li><a href="#index-Pastebin-36">Pastebin</a>: <a href="#Related-Software-and-Links">Related Software and Links</a></li>
6003+<li><a href="#index-patching-63">patching</a>: <a href="#Patching-from-a-previous-version">Patching from a previous version</a></li>
6004+<li><a href="#index-Perl-35">Perl</a>: <a href="#Related-Software-and-Links">Related Software and Links</a></li>
59806005 <li><a href="#index-Perl-9">Perl</a>: <a href="#Perl">Perl</a></li>
59816006 <li><a href="#index-Php-31">Php</a>: <a href="#Related-Software-and-Links">Related Software and Links</a></li>
5982-<li><a href="#index-postdoc_005freference-157">postdoc_reference</a>: <a href="#Anchors-and-References">Anchors and References</a></li>
5983-<li><a href="#index-postline_005freference-156">postline_reference</a>: <a href="#Anchors-and-References">Anchors and References</a></li>
5984-<li><a href="#index-prefix-129">prefix</a>: <a href="#How-source_002dhighlight-works">How source-highlight works</a></li>
5985-<li><a href="#index-problems-172">problems</a>: <a href="#Problems">Problems</a></li>
5986-<li><a href="#index-qmake-40">qmake</a>: <a href="#Building-with-qmake">Building with qmake</a></li>
6007+<li><a href="#index-postdoc_005freference-162">postdoc_reference</a>: <a href="#Anchors-and-References">Anchors and References</a></li>
6008+<li><a href="#index-postline_005freference-161">postline_reference</a>: <a href="#Anchors-and-References">Anchors and References</a></li>
6009+<li><a href="#index-prefix-134">prefix</a>: <a href="#How-source_002dhighlight-works">How source-highlight works</a></li>
6010+<li><a href="#index-problems-177">problems</a>: <a href="#Problems">Problems</a></li>
6011+<li><a href="#index-PyQt-34">PyQt</a>: <a href="#Related-Software-and-Links">Related Software and Links</a></li>
6012+<li><a href="#index-Python-33">Python</a>: <a href="#Related-Software-and-Links">Related Software and Links</a></li>
6013+<li><a href="#index-qmake-45">qmake</a>: <a href="#Building-with-qmake">Building with qmake</a></li>
59876014 <li><a href="#index-QSource_002dHighlight-16">QSource-Highlight</a>: <a href="#Related-Software-and-Links">Related Software and Links</a></li>
59886015 <li><a href="#index-Qt-15">Qt</a>: <a href="#Related-Software-and-Links">Related Software and Links</a></li>
5989-<li><a href="#index-range-context-168">range context</a>: <a href="#Line-ranges-_0028with-context_0029">Line ranges (with context)</a></li>
5990-<li><a href="#index-range-context-103">range context</a>: <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a></li>
5991-<li><a href="#index-range-separator-169">range separator</a>: <a href="#Line-ranges-_0028with-context_0029">Line ranges (with context)</a></li>
5992-<li><a href="#index-range-separator-104">range separator</a>: <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a></li>
6016+<li><a href="#index-range-context-173">range context</a>: <a href="#Line-ranges-_0028with-context_0029">Line ranges (with context)</a></li>
6017+<li><a href="#index-range-context-108">range context</a>: <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a></li>
6018+<li><a href="#index-range-separator-174">range separator</a>: <a href="#Line-ranges-_0028with-context_0029">Line ranges (with context)</a></li>
6019+<li><a href="#index-range-separator-109">range separator</a>: <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a></li>
59936020 <li><a href="#index-RapidWeaver-26">RapidWeaver</a>: <a href="#Related-Software-and-Links">Related Software and Links</a></li>
5994-<li><a href="#index-redef-126">redef</a>: <a href="#Redefinitions-and-Substitutions">Redefinitions and Substitutions</a></li>
5995-<li><a href="#index-reference-163">reference</a>: <a href="#Generating-References">Generating References</a></li>
5996-<li><a href="#index-regex-ranges-170">regex ranges</a>: <a href="#Regex-ranges">Regex ranges</a></li>
5997-<li><a href="#index-regex-ranges-105">regex ranges</a>: <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a></li>
5998-<li><a href="#index-regular-expressions-131">regular expressions</a>: <a href="#Notes-on-regular-expressions">Notes on regular expressions</a></li>
5999-<li><a href="#index-rpm-60">rpm</a>: <a href="#Building-_002erpm">Building .rpm</a></li>
6000-<li><a href="#index-sample-62">sample</a>: <a href="#Simple-Usage">Simple Usage</a></li>
6021+<li><a href="#index-redef-131">redef</a>: <a href="#Redefinitions-and-Substitutions">Redefinitions and Substitutions</a></li>
6022+<li><a href="#index-reference-168">reference</a>: <a href="#Generating-References">Generating References</a></li>
6023+<li><a href="#index-regex-ranges-175">regex ranges</a>: <a href="#Regex-ranges">Regex ranges</a></li>
6024+<li><a href="#index-regex-ranges-110">regex ranges</a>: <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a></li>
6025+<li><a href="#index-regular-expressions-136">regular expressions</a>: <a href="#Notes-on-regular-expressions">Notes on regular expressions</a></li>
6026+<li><a href="#index-rpm-65">rpm</a>: <a href="#Building-_002erpm">Building .rpm</a></li>
6027+<li><a href="#index-sample-67">sample</a>: <a href="#Simple-Usage">Simple Usage</a></li>
60016028 <li><a href="#index-SHJS-23">SHJS</a>: <a href="#Related-Software-and-Links">Related Software and Links</a></li>
6002-<li><a href="#index-simple-language-definition-116">simple language definition</a>: <a href="#Simple-definitions">Simple definitions</a></li>
6029+<li><a href="#index-simple-language-definition-121">simple language definition</a>: <a href="#Simple-definitions">Simple definitions</a></li>
6030+<li><a href="#index-SIP-32">SIP</a>: <a href="#Related-Software-and-Links">Related Software and Links</a></li>
60036031 <li><a href="#index-Source_002dHighlight_002dQt-14">Source-Highlight-Qt</a>: <a href="#Related-Software-and-Links">Related Software and Links</a></li>
60046032 <li><a href="#index-source_002dhighlight_002dsettings-4">source-highlight-settings</a>: <a href="#The-program-source_002dhighlight_002dsettings">The program source-highlight-settings</a></li>
60056033 <li><a href="#index-source_002dhighlight_002econf-5">source-highlight.conf</a>: <a href="#The-program-source_002dhighlight_002dsettings">The program source-highlight-settings</a></li>
6006-<li><a href="#index-g_t_0040code_007bSOURCE_005fHIGHLIGHT_005fDATADIR_007d-71"><code>SOURCE_HIGHLIGHT_DATADIR</code></a>: <a href="#Configuration-files">Configuration files</a></li>
6034+<li><a href="#index-g_t_0040code_007bSOURCE_005fHIGHLIGHT_005fDATADIR_007d-76"><code>SOURCE_HIGHLIGHT_DATADIR</code></a>: <a href="#Configuration-files">Configuration files</a></li>
60076035 <li><a href="#index-g_t_0040code_007bSOURCE_005fHIGHLIGHT_005fDATADIR_007d-7"><code>SOURCE_HIGHLIGHT_DATADIR</code></a>: <a href="#The-program-source_002dhighlight_002dsettings">The program source-highlight-settings</a></li>
60086036 <li><a href="#index-SourceHighlightIDE-18">SourceHighlightIDE</a>: <a href="#Related-Software-and-Links">Related Software and Links</a></li>
6009-<li><a href="#index-states-124">states</a>: <a href="#State_002fEnvironment-Definitions">State/Environment Definitions</a></li>
6010-<li><a href="#index-style-separator-160">style separator</a>: <a href="#Style-template">Style template</a></li>
6011-<li><a href="#index-style-template-159">style template</a>: <a href="#Style-template">Style template</a></li>
6012-<li><a href="#index-style_002edefaults-90">style.defaults</a>: <a href="#Default-Styles">Default Styles</a></li>
6013-<li><a href="#index-subst-127">subst</a>: <a href="#Redefinitions-and-Substitutions">Redefinitions and Substitutions</a></li>
6014-<li><a href="#index-suffix-130">suffix</a>: <a href="#How-source_002dhighlight-works">How source-highlight works</a></li>
6015-<li><a href="#index-tail-recursion-174">tail recursion</a>: <a href="#Concept-Index">Concept Index</a></li>
6016-<li><a href="#index-Texinfo-66">Texinfo</a>: <a href="#Texinfo-output">Texinfo output</a></li>
6017-<li><a href="#index-underline-144">underline</a>: <a href="#Text-styles">Text styles</a></li>
6018-<li><a href="#index-underline-82">underline</a>: <a href="#Output-format-style">Output format style</a></li>
6019-<li><a href="#index-usage-96">usage</a>: <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a></li>
6020-<li><a href="#index-variables-121">variables</a>: <a href="#Variable-definitions">Variable definitions</a></li>
6021-<li><a href="#index-version-94">version</a>: <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a></li>
6037+<li><a href="#index-states-129">states</a>: <a href="#State_002fEnvironment-Definitions">State/Environment Definitions</a></li>
6038+<li><a href="#index-style-separator-165">style separator</a>: <a href="#Style-template">Style template</a></li>
6039+<li><a href="#index-style-template-164">style template</a>: <a href="#Style-template">Style template</a></li>
6040+<li><a href="#index-style_002edefaults-95">style.defaults</a>: <a href="#Default-Styles">Default Styles</a></li>
6041+<li><a href="#index-subst-132">subst</a>: <a href="#Redefinitions-and-Substitutions">Redefinitions and Substitutions</a></li>
6042+<li><a href="#index-suffix-135">suffix</a>: <a href="#How-source_002dhighlight-works">How source-highlight works</a></li>
6043+<li><a href="#index-tail-recursion-179">tail recursion</a>: <a href="#Concept-Index">Concept Index</a></li>
6044+<li><a href="#index-Texinfo-71">Texinfo</a>: <a href="#Texinfo-output">Texinfo output</a></li>
6045+<li><a href="#index-underline-149">underline</a>: <a href="#Text-styles">Text styles</a></li>
6046+<li><a href="#index-underline-87">underline</a>: <a href="#Output-format-style">Output format style</a></li>
6047+<li><a href="#index-usage-101">usage</a>: <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a></li>
6048+<li><a href="#index-variables-126">variables</a>: <a href="#Variable-definitions">Variable definitions</a></li>
6049+<li><a href="#index-version-99">version</a>: <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a></li>
60226050 <li><a href="#index-Wiki-28">Wiki</a>: <a href="#Related-Software-and-Links">Related Software and Links</a></li>
6023-<li><a href="#index-XHTML-64">XHTML</a>: <a href="#HTML-and-XHTML-output">HTML and XHTML output</a></li>
6051+<li><a href="#index-XHTML-69">XHTML</a>: <a href="#HTML-and-XHTML-output">HTML and XHTML output</a></li>
60246052 </ul>
60256053 <div class="shortcontents">
60266054 <h2>Short Contents</h2>
--- a/original/source-highlight.info
+++ b/original/source-highlight.info
@@ -1,9 +1,8 @@
11 This is ../../doc/source-highlight.info, produced by makeinfo version
22 4.13 from ../../doc/source-highlight.texinfo.
33
4-This manual is for GNU Source-highlight (version 3.1.3, 17 December
5-2009), which given a source file, produces a document with syntax
6-highlighting.
4+This manual is for GNU Source-highlight (version 3.1.4, 14 May 2010),
5+which given a source file, produces a document with syntax highlighting.
76
87 Copyright (C) 2005-2008 Lorenzo Bettini,
98 `http://www.lorenzobettini.it'.
@@ -34,13 +33,12 @@ GNU Source-highlight
3433 GNU Source-highlight, given a source file, produces a document with
3534 syntax highlighting.
3635
37- This is Edition 3.1.3 of the Source-highlight manual.
36+ This is Edition 3.1.4 of the Source-highlight manual.
3837
39- This file documents GNU Source-highlight version 3.1.3.
38+ This file documents GNU Source-highlight version 3.1.4.
4039
41- This manual is for GNU Source-highlight (version 3.1.3, 17 December
42-2009), which given a source file, produces a document with syntax
43-highlighting.
40+ This manual is for GNU Source-highlight (version 3.1.4, 14 May 2010),
41+which given a source file, produces a document with syntax highlighting.
4442
4543 Copyright (C) 2005-2008 Lorenzo Bettini,
4644 `http://www.lorenzobettini.it'.
@@ -116,7 +114,7 @@ File: source-highlight.info, Node: Supported languages, Next: The program sour
116114 =======================
117115
118116 The complete list of languages (indeed, file extensions) natively
119-supported by this version of Source-highlight (3.1.3), as reported by
117+supported by this version of Source-highlight (3.1.4), as reported by
120118 `--lang-list', is the following:
121119
122120 C = cpp.lang
@@ -148,6 +146,7 @@ supported by this version of Source-highlight (3.1.3), as reported by
148146 csh = sh.lang
149147 csharp = csharp.lang
150148 css = css.lang
149+ ctp = php.lang
151150 d = d.lang
152151 desktop = desktop.lang
153152 diff = diff.lang
@@ -189,6 +188,8 @@ supported by this version of Source-highlight (3.1.3), as reported by
189188 ldif = ldap.lang
190189 lex = flex.lang
191190 lgt = logtalk.lang
191+ lhs = haskell_literate.lang
192+ lisp = lisp.lang
192193 ll = flex.lang
193194 log = log.lang
194195 logtalk = logtalk.lang
@@ -219,6 +220,8 @@ supported by this version of Source-highlight (3.1.3), as reported by
219220 prg = clipper.lang
220221 prolog = prolog.lang
221222 properties = properties.lang
223+ proto = proto.lang
224+ protobuf = proto.lang
222225 ps = postscript.lang
223226 py = python.lang
224227 python = python.lang
@@ -248,6 +251,7 @@ supported by this version of Source-highlight (3.1.3), as reported by
248251 tk = tcl.lang
249252 txt = nohilite.lang
250253 ui = xml.lang
254+ vala = vala.lang
251255 vbs = vbscript.lang
252256 vbscript = vbscript.lang
253257 xhtml = xml.lang
@@ -258,7 +262,7 @@ supported by this version of Source-highlight (3.1.3), as reported by
258262 yy = bison.lang
259263
260264 The complete list of output formats natively supported by this
261-version of Source-highlight (3.1.3), as reported by `--outlang-list',
265+version of Source-highlight (3.1.4), as reported by `--outlang-list',
262266 is the following:
263267
264268 docbook = docbook.outlang
@@ -478,8 +482,9 @@ files):
478482
479483 `http://qsrchilite.sourceforge.net'.
480484
481- * SourceHighlightIDE is a small IDE (for KDE) I wrote for developing
482- and debugging new language definitions for source-highlight:
485+ * SourceHighlightIDE is a small IDE (based on Qt4 and
486+ Source-highlight-qt) I wrote for developing and debugging new
487+ language definitions for source-highlight:
483488
484489 `http://srchighliteide.sourceforge.net'.
485490
@@ -540,6 +545,20 @@ files):
540545
541546 `http://code.google.com/p/php-source-highlight/'
542547
548+ * Roberto Alsina made a partial python binding using SIP so that you
549+ can use Source-Highlight-Qt in PyQt programs.
550+
551+ `http://marave.googlecode.com/svn/trunk/marave/highlight/'
552+
553+ * A perl binding for source-highlight is available at CPAN:
554+
555+ `http://search.cpan.org/perldoc?Syntax::SourceHighlight'
556+
557+ * Danijel Tasov wrote a pastebin service based on perl
558+ source-highlight binding:
559+
560+ `http://pb.rbfh.de'
561+
543562
544563 
545564 File: source-highlight.info, Node: Installation, Next: Copying, Prev: Introduction, Up: Top
@@ -638,8 +657,8 @@ without using a Unix shell, and in particular to build Source-highlight with
638657 Microsoft MSVC compiler. You should use this method only if you don't
639658 have a Unix shell or if you really need to use the MSVC compiler (e.g.,
640659 if you want to build Source-highlight library to be used in MSVC based
641-programs. You still need the boost regex library, and if you use MSVC,
642-you can find installation packages for this library at
660+programs). You still need the boost regex library, and if you use
661+MSVC, you can find installation packages for this library at
643662 `http://www.boostpro.com'.
644663
645664 This build mechanism is still experimental, and, when using MSVC,
@@ -975,11 +994,11 @@ File: source-highlight.info, Node: Building .rpm, Prev: Using source-highlight
975994 Christian W. Zuckschwerdt added support for building an .rpm and an
976995 .rpm.src. You can issue the following command
977996
978- rpmbuild -tb source-highlight-3.1.3.tar.gz
997+ rpmbuild -tb source-highlight-3.1.4.tar.gz
979998
980999 for building an .rpm with binaries and
9811000
982- rpmbuild -ts source-highlight-3.1.3.tar.gz
1001+ rpmbuild -ts source-highlight-3.1.4.tar.gz
9831002
9841003 for building an .rpm.src with sources.
9851004
@@ -1220,6 +1239,7 @@ on Language Definitions::):
12201239 function black b; // for function calls and declarations
12211240 cbracket red; // for block brackets (e.g. {, })
12221241 todo bg:cyan b; // for TODO and FIXME
1242+ code bg:brightgreen b; // for code snippets
12231243
12241244 //Predefined variables and functions (for instance glsl)
12251245 predef_var darkblue ;
@@ -1588,6 +1608,7 @@ Source-highlight:
15881608 label = preproc
15891609 error = string
15901610 warning = type
1611+ code = preproc
15911612
15921613 In this case the style for the element `preproc' will default to the
15931614 style of the element `keyword'.
@@ -3586,7 +3607,7 @@ In particular the comments definitions:
35863607 # comments with documentation tags
35873608 environment comment start "///" begin
35883609 include "url.lang"
3589- include "html.lang"
3610+ include "html_simple.lang"
35903611 type = '@[[:alpha:]]+'
35913612 include "todo.lang"
35923613 end
@@ -3596,7 +3617,7 @@ In particular the comments definitions:
35963617 # comments with documentation tags
35973618 environment comment delim "/**" "*/" multiline begin
35983619 include "url.lang"
3599- include "html.lang"
3620+ include "html_simple.lang"
36003621 type = '@[[:alpha:]]+'
36013622 include "todo.lang"
36023623 end
@@ -5408,7 +5429,7 @@ Concept Index
54085429 * --show-lang-elements: Output format style. (line 9)
54095430 * --style-css-file: Output format style using CSS.
54105431 (line 10)
5411-* --style-file: Output format style. (line 98)
5432+* --style-file: Output format style. (line 99)
54125433 * --with-doxygen: Installation. (line 57)
54135434 * `expression`: Ways of specifying regular expressions.
54145435 (line 59)
@@ -5417,7 +5438,7 @@ Concept Index
54175438 * ANSI color: ANSI color escape sequences.
54185439 (line 6)
54195440 * Apache: Related Software and Links.
5420- (line 62)
5441+ (line 63)
54215442 * autoconf <1>: What you need to build source-highlight.
54225443 (line 28)
54235444 * autoconf: Anonymous Git Checkout.
@@ -5437,7 +5458,7 @@ Concept Index
54375458 * bash completion: Installation. (line 48)
54385459 * bgcolor: Output format style. (line 12)
54395460 * bold <1>: Text styles. (line 6)
5440-* bold: Output format style. (line 115)
5461+* bold: Output format style. (line 116)
54415462 * boost <1>: What you need to build source-highlight.
54425463 (line 6)
54435464 * boost: Building with qmake. (line 13)
@@ -5451,8 +5472,8 @@ Concept Index
54515472 * check-regexp: The program check-regexp.
54525473 (line 6)
54535474 * code2blog: Related Software and Links.
5454- (line 57)
5455-* color: Output format style. (line 106)
5475+ (line 58)
5476+* color: Output format style. (line 107)
54565477 * colors: Colors. (line 6)
54575478 * compilation requirements: What you need to build source-highlight.
54585479 (line 6)
@@ -5475,7 +5496,7 @@ Concept Index
54755496 (line 6)
54765497 * delimited definitions: Delimited definitions.
54775498 (line 6)
5478-* direct color scheme: Output format style. (line 190)
5499+* direct color scheme: Output format style. (line 191)
54795500 * directories: Installation. (line 27)
54805501 * DocBook: DocBook output. (line 6)
54815502 * doctemplate: Document template. (line 8)
@@ -5492,9 +5513,9 @@ Concept Index
54925513 * features: Introduction. (line 6)
54935514 * file inclusion: File inclusion. (line 6)
54945515 * Firefox: Related Software and Links.
5495- (line 75)
5516+ (line 76)
54965517 * fixed <1>: Text styles. (line 6)
5497-* fixed: Output format style. (line 115)
5518+* fixed: Output format style. (line 116)
54985519 * Fortran: Fortran. (line 6)
54995520 * getting help: Invoking source-highlight.
55005521 (line 6)
@@ -5507,7 +5528,7 @@ Concept Index
55075528 * HTML: HTML and XHTML output.
55085529 (line 6)
55095530 * Ikiwiki: Related Software and Links.
5510- (line 80)
5531+ (line 81)
55115532 * inline_reference: Anchors and References.
55125533 (line 72)
55135534 * installation: Installation. (line 6)
@@ -5515,14 +5536,14 @@ Concept Index
55155536 * invoking: Invoking source-highlight.
55165537 (line 6)
55175538 * italics <1>: Text styles. (line 6)
5518-* italics: Output format style. (line 115)
5539+* italics: Output format style. (line 116)
55195540 * java2html <1>: Installation. (line 66)
55205541 * java2html: Related Software and Links.
5521- (line 41)
5542+ (line 42)
55225543 * KDE: Related Software and Links.
55235544 (line 30)
55245545 * Ksrc2highlight: Related Software and Links.
5525- (line 35)
5546+ (line 36)
55265547 * language definition: Language Definitions.
55275548 (line 6)
55285549 * language inference: Invoking source-highlight.
@@ -5562,9 +5583,9 @@ Concept Index
55625583 * non-marking parenthesis: Notes on regular expressions.
55635584 (line 11)
55645585 * nonsensitive: Simple definitions. (line 76)
5565-* noref: Output format style. (line 163)
5586+* noref: Output format style. (line 164)
55665587 * notfixed <1>: Text styles. (line 6)
5567-* notfixed: Output format style. (line 115)
5588+* notfixed: Output format style. (line 116)
55685589 * one style: One style. (line 6)
55695590 * options: Invoking source-highlight.
55705591 (line 6)
@@ -5572,11 +5593,15 @@ Concept Index
55725593 (line 6)
55735594 * output language map: Output Language map. (line 6)
55745595 * output style: Output format style. (line 6)
5596+* Pastebin: Related Software and Links.
5597+ (line 102)
55755598 * patching: Patching from a previous version.
55765599 (line 6)
5600+* Perl <1>: Related Software and Links.
5601+ (line 98)
55775602 * Perl: Perl. (line 6)
55785603 * Php: Related Software and Links.
5579- (line 86)
5604+ (line 87)
55805605 * postdoc_reference: Anchors and References.
55815606 (line 72)
55825607 * postline_reference: Anchors and References.
@@ -5584,6 +5609,10 @@ Concept Index
55845609 * prefix: How source-highlight works.
55855610 (line 32)
55865611 * problems: Problems. (line 6)
5612+* PyQt: Related Software and Links.
5613+ (line 93)
5614+* Python: Related Software and Links.
5615+ (line 93)
55875616 * qmake: Building with qmake. (line 6)
55885617 * QSource-Highlight: Related Software and Links.
55895618 (line 19)
@@ -5598,7 +5627,7 @@ Concept Index
55985627 * range separator: Invoking source-highlight.
55995628 (line 102)
56005629 * RapidWeaver: Related Software and Links.
5601- (line 68)
5630+ (line 69)
56025631 * redef: Redefinitions and Substitutions.
56035632 (line 11)
56045633 * reference: Generating References.
@@ -5611,8 +5640,10 @@ Concept Index
56115640 * rpm: Building .rpm. (line 6)
56125641 * sample: Simple Usage. (line 6)
56135642 * SHJS: Related Software and Links.
5614- (line 50)
5643+ (line 51)
56155644 * simple language definition: Simple definitions. (line 6)
5645+* SIP: Related Software and Links.
5646+ (line 93)
56165647 * Source-Highlight-Qt: Related Software and Links.
56175648 (line 11)
56185649 * source-highlight-settings: The program source-highlight-settings.
@@ -5636,7 +5667,7 @@ Concept Index
56365667 * tail recursion: Concept Index. (line 6)
56375668 * Texinfo: Texinfo output. (line 6)
56385669 * underline <1>: Text styles. (line 6)
5639-* underline: Output format style. (line 115)
5670+* underline: Output format style. (line 116)
56405671 * usage: Invoking source-highlight.
56415672 (line 6)
56425673 * variables: Variable definitions.
@@ -5644,160 +5675,160 @@ Concept Index
56445675 * version: Invoking source-highlight.
56455676 (line 6)
56465677 * Wiki: Related Software and Links.
5647- (line 80)
5678+ (line 81)
56485679 * XHTML: HTML and XHTML output.
56495680 (line 6)
56505681
56515682
56525683 
56535684 Tag Table:
5654-Node: Top1133
5655-Node: Introduction3056
5656-Node: Supported languages4630
5657-Ref: Supported languages-Footnote-19499
5658-Node: The program source-highlight-settings9672
5659-Node: Notes on some languages10629
5660-Node: Fortran11186
5661-Node: Perl11907
5662-Node: Using source-highlight as a simple formatter12979
5663-Ref: Using source-highlight as a simple formatter-Footnote-116275
5664-Node: Related Software and Links16400
5665-Node: Installation19988
5666-Node: Building with qmake22910
5667-Node: Download25252
5668-Node: Anonymous Git Checkout26715
5669-Ref: Anonymous Git Checkout-Footnote-128141
5670-Node: What you need to build source-highlight28263
5671-Ref: What you need to build source-highlight-Footnote-130517
5672-Ref: What you need to build source-highlight-Footnote-230564
5673-Ref: What you need to build source-highlight-Footnote-330611
5674-Ref: What you need to build source-highlight-Footnote-430657
5675-Node: Tips on installing Boost Regex library30702
5676-Ref: Tips on installing Boost Regex library-Footnote-135103
5677-Ref: Tips on installing Boost Regex library-Footnote-235250
5678-Node: Patching from a previous version35417
5679-Node: Using source-highlight with less36060
5680-Node: Using source-highlight as a CGI36717
5681-Node: Building .rpm37232
5682-Node: Copying37681
5683-Node: Simple Usage38107
5684-Ref: Simple Usage-Footnote-140693
5685-Node: HTML and XHTML output40860
5686-Node: LaTeX output41879
5687-Node: Texinfo output42392
5688-Node: DocBook output42814
5689-Node: ANSI color escape sequences43132
5690-Node: Configuration files43602
5691-Node: Output format style45300
5692-Ref: Output format style-Footnote-152318
5693-Ref: Output format style-Footnote-252466
5694-Ref: Output format style-Footnote-352493
5695-Ref: Output format style-Footnote-452659
5696-Ref: Output format style-Footnote-552686
5697-Ref: Output format style-Footnote-652780
5698-Ref: Output format style-Footnote-752848
5699-Ref: Output format style-Footnote-852914
5700-Node: Output format style using CSS52941
5701-Node: Default Styles57457
5702-Ref: Default Styles-Footnote-159112
5703-Node: Language map59139
5704-Node: Language definition files60032
5705-Ref: Language definition files-Footnote-160600
5706-Node: Output Language map60697
5707-Node: Output Language definition files61819
5708-Ref: Output Language definition files-Footnote-162622
5709-Node: Developing your own definition files62723
5710-Node: Invoking source-highlight63555
5711-Ref: Invoking source-highlight-Footnote-171627
5712-Ref: Invoking source-highlight-Footnote-271784
5713-Node: How the input language is discovered71846
5714-Ref: How the input language is discovered-Footnote-173892
5715-Ref: How the input language is discovered-Footnote-273919
5716-Node: Language Definitions73948
5717-Node: Ways of specifying regular expressions77678
5718-Ref: Ways of specifying regular expressions-Footnote-182479
5719-Ref: Ways of specifying regular expressions-Footnote-282506
5720-Node: Simple definitions82871
5721-Node: Line wide definitions87212
5722-Node: Order of definitions87913
5723-Node: Delimited definitions88695
5724-Ref: Delimited definitions-Footnote-191119
5725-Node: Variable definitions91450
5726-Node: Dynamic Backreferences92331
5727-Ref: Dynamic Backreferences-Footnote-195037
5728-Ref: Dynamic Backreferences-Footnote-295063
5729-Node: File inclusion95192
5730-Node: State/Environment Definitions96385
5731-Node: Explicit subexpressions with names101933
5732-Node: Redefinitions and Substitutions105632
5733-Ref: Redefinitions and Substitutions-Footnote-1108290
5734-Node: How source-highlight works108340
5735-Ref: How source-highlight works-Footnote-1112318
5736-Ref: How source-highlight works-Footnote-2112534
5737-Node: Notes on regular expressions112595
5738-Ref: Notes on regular expressions-Footnote-1117371
5739-Ref: Notes on regular expressions-Footnote-2117429
5740-Ref: Notes on regular expressions-Footnote-3117483
5741-Node: The program check-regexp117705
5742-Node: Listing Language Elements120033
5743-Ref: Listing Language Elements-Footnote-1121449
5744-Node: Concluding Remarks121476
5745-Node: Debugging122554
5746-Ref: Debugging-Footnote-1132581
5747-Ref: Debugging-Footnote-2132708
5748-Node: Tutorials on Language Definitions132813
5749-Node: Highlighting C/C++ and C#135178
5750-Ref: Highlighting C/C++ and C#-Footnote-1143940
5751-Ref: Highlighting C/C++ and C#-Footnote-2144130
5752-Ref: Highlighting C/C++ and C#-Footnote-3144218
5753-Ref: Highlighting C/C++ and C#-Footnote-4144343
5754-Node: Highlighting Diff files144640
5755-Node: Pseudo semantic analysis151238
5756-Node: Output Language Definitions156413
5757-Node: File extension158763
5758-Node: Text styles159384
5759-Node: Colors160701
5760-Ref: Colors-Footnote-1163942
5761-Node: Anchors and References163969
5762-Node: One style168166
5763-Node: Style template169454
5764-Node: Line prefix170236
5765-Ref: Line prefix-Footnote-1170956
5766-Node: String translation171222
5767-Ref: String translation-Footnote-1173536
5768-Ref: String translation-Footnote-2173563
5769-Node: Document template173612
5770-Ref: Document template-Footnote-1176722
5771-Ref: Document template-Footnote-2176904
5772-Node: Generating HTML output176931
5773-Ref: Generating HTML output-Footnote-1179551
5774-Node: Generating References179639
5775-Ref: Generating References-Footnote-1183074
5776-Node: Examples183132
5777-Node: Simple example183680
5778-Node: References186012
5779-Ref: test.h:16187202
5780-Ref: test.h:18187239
5781-Ref: test.h:20187280
5782-Ref: test.h:26187441
5783-Ref: test.h:28187503
5784-Ref: test.h:29187580
5785-Ref: test.h:35187825
5786-Ref: test.h:40188144
5787-Ref: test.h:46188804
5788-Ref: test.h:47188861
5789-Ref: test.h:48188916
5790-Ref: test.h:54189419
5791-Ref: test.h:63189951
5792-Ref: test.h:65190113
5793-Ref: test.h:68190239
5794-Ref: test.h:70190473
5795-Ref: test.h:76190972
5796-Node: Line ranges191751
5797-Node: Line ranges (with context)192752
5798-Node: Regex ranges194422
5799-Node: Problems198250
5800-Node: Mailing Lists198953
5801-Node: Concept Index199813
5685+Node: Top1128
5686+Node: Introduction3046
5687+Node: Supported languages4620
5688+Ref: Supported languages-Footnote-19637
5689+Node: The program source-highlight-settings9810
5690+Node: Notes on some languages10767
5691+Node: Fortran11324
5692+Node: Perl12045
5693+Node: Using source-highlight as a simple formatter13117
5694+Ref: Using source-highlight as a simple formatter-Footnote-116413
5695+Node: Related Software and Links16538
5696+Node: Installation20592
5697+Node: Building with qmake23514
5698+Node: Download25857
5699+Node: Anonymous Git Checkout27320
5700+Ref: Anonymous Git Checkout-Footnote-128746
5701+Node: What you need to build source-highlight28868
5702+Ref: What you need to build source-highlight-Footnote-131122
5703+Ref: What you need to build source-highlight-Footnote-231169
5704+Ref: What you need to build source-highlight-Footnote-331216
5705+Ref: What you need to build source-highlight-Footnote-431262
5706+Node: Tips on installing Boost Regex library31307
5707+Ref: Tips on installing Boost Regex library-Footnote-135708
5708+Ref: Tips on installing Boost Regex library-Footnote-235855
5709+Node: Patching from a previous version36022
5710+Node: Using source-highlight with less36665
5711+Node: Using source-highlight as a CGI37322
5712+Node: Building .rpm37837
5713+Node: Copying38286
5714+Node: Simple Usage38712
5715+Ref: Simple Usage-Footnote-141298
5716+Node: HTML and XHTML output41465
5717+Node: LaTeX output42484
5718+Node: Texinfo output42997
5719+Node: DocBook output43419
5720+Node: ANSI color escape sequences43737
5721+Node: Configuration files44207
5722+Node: Output format style45905
5723+Ref: Output format style-Footnote-152972
5724+Ref: Output format style-Footnote-253120
5725+Ref: Output format style-Footnote-353147
5726+Ref: Output format style-Footnote-453313
5727+Ref: Output format style-Footnote-553340
5728+Ref: Output format style-Footnote-653434
5729+Ref: Output format style-Footnote-753502
5730+Ref: Output format style-Footnote-853568
5731+Node: Output format style using CSS53595
5732+Node: Default Styles58111
5733+Ref: Default Styles-Footnote-159786
5734+Node: Language map59813
5735+Node: Language definition files60706
5736+Ref: Language definition files-Footnote-161274
5737+Node: Output Language map61371
5738+Node: Output Language definition files62493
5739+Ref: Output Language definition files-Footnote-163296
5740+Node: Developing your own definition files63397
5741+Node: Invoking source-highlight64229
5742+Ref: Invoking source-highlight-Footnote-172301
5743+Ref: Invoking source-highlight-Footnote-272458
5744+Node: How the input language is discovered72520
5745+Ref: How the input language is discovered-Footnote-174566
5746+Ref: How the input language is discovered-Footnote-274593
5747+Node: Language Definitions74622
5748+Node: Ways of specifying regular expressions78352
5749+Ref: Ways of specifying regular expressions-Footnote-183153
5750+Ref: Ways of specifying regular expressions-Footnote-283180
5751+Node: Simple definitions83545
5752+Node: Line wide definitions87886
5753+Node: Order of definitions88587
5754+Node: Delimited definitions89369
5755+Ref: Delimited definitions-Footnote-191793
5756+Node: Variable definitions92124
5757+Node: Dynamic Backreferences93005
5758+Ref: Dynamic Backreferences-Footnote-195711
5759+Ref: Dynamic Backreferences-Footnote-295737
5760+Node: File inclusion95866
5761+Node: State/Environment Definitions97059
5762+Node: Explicit subexpressions with names102607
5763+Node: Redefinitions and Substitutions106306
5764+Ref: Redefinitions and Substitutions-Footnote-1108964
5765+Node: How source-highlight works109014
5766+Ref: How source-highlight works-Footnote-1112992
5767+Ref: How source-highlight works-Footnote-2113208
5768+Node: Notes on regular expressions113269
5769+Ref: Notes on regular expressions-Footnote-1118045
5770+Ref: Notes on regular expressions-Footnote-2118103
5771+Ref: Notes on regular expressions-Footnote-3118157
5772+Node: The program check-regexp118379
5773+Node: Listing Language Elements120707
5774+Ref: Listing Language Elements-Footnote-1122123
5775+Node: Concluding Remarks122150
5776+Node: Debugging123228
5777+Ref: Debugging-Footnote-1133255
5778+Ref: Debugging-Footnote-2133382
5779+Node: Tutorials on Language Definitions133487
5780+Node: Highlighting C/C++ and C#135852
5781+Ref: Highlighting C/C++ and C#-Footnote-1144628
5782+Ref: Highlighting C/C++ and C#-Footnote-2144818
5783+Ref: Highlighting C/C++ and C#-Footnote-3144906
5784+Ref: Highlighting C/C++ and C#-Footnote-4145031
5785+Node: Highlighting Diff files145328
5786+Node: Pseudo semantic analysis151926
5787+Node: Output Language Definitions157101
5788+Node: File extension159451
5789+Node: Text styles160072
5790+Node: Colors161389
5791+Ref: Colors-Footnote-1164630
5792+Node: Anchors and References164657
5793+Node: One style168854
5794+Node: Style template170142
5795+Node: Line prefix170924
5796+Ref: Line prefix-Footnote-1171644
5797+Node: String translation171910
5798+Ref: String translation-Footnote-1174224
5799+Ref: String translation-Footnote-2174251
5800+Node: Document template174300
5801+Ref: Document template-Footnote-1177410
5802+Ref: Document template-Footnote-2177592
5803+Node: Generating HTML output177619
5804+Ref: Generating HTML output-Footnote-1180239
5805+Node: Generating References180327
5806+Ref: Generating References-Footnote-1183762
5807+Node: Examples183820
5808+Node: Simple example184368
5809+Node: References186700
5810+Ref: test.h:16187890
5811+Ref: test.h:18187927
5812+Ref: test.h:20187968
5813+Ref: test.h:26188129
5814+Ref: test.h:28188191
5815+Ref: test.h:29188268
5816+Ref: test.h:35188513
5817+Ref: test.h:40188832
5818+Ref: test.h:46189492
5819+Ref: test.h:47189549
5820+Ref: test.h:48189604
5821+Ref: test.h:54190107
5822+Ref: test.h:63190639
5823+Ref: test.h:65190801
5824+Ref: test.h:68190927
5825+Ref: test.h:70191161
5826+Ref: test.h:76191660
5827+Node: Line ranges192439
5828+Node: Line ranges (with context)193440
5829+Node: Regex ranges195110
5830+Node: Problems198938
5831+Node: Mailing Lists199641
5832+Node: Concept Index200501
58025833 
58035834 End Tag Table
--- a/original/source-highlight.texinfo
+++ b/original/source-highlight.texinfo
@@ -330,7 +330,8 @@ formats (e.g., HTML, XHTML, etc.).
330330 @item
331331 @cindex SourceHighlightIDE
332332 @cindex KDE
333-SourceHighlightIDE is a small IDE (for KDE) I wrote for developing
333+SourceHighlightIDE is a small IDE (based on Qt4 and
334+Source-highlight-qt) I wrote for developing
334335 and debugging new language definitions for source-highlight:
335336
336337 @uref{http://srchighliteide.sourceforge.net}.
@@ -412,6 +413,27 @@ using the source-highlight CGI.
412413
413414 @uref{http://code.google.com/p/php-source-highlight/}
414415
416+@item
417+@cindex SIP
418+@cindex Python
419+@cindex PyQt
420+Roberto Alsina made a partial python binding using SIP so
421+that you can use Source-Highlight-Qt in PyQt programs.
422+
423+@uref{http://marave.googlecode.com/svn/trunk/marave/highlight/}
424+
425+@item
426+@cindex Perl
427+A perl binding for source-highlight is available at CPAN:
428+
429+@uref{http://search.cpan.org/perldoc?Syntax::SourceHighlight}
430+
431+@item
432+@cindex Pastebin
433+Danijel Tasov wrote a pastebin service based on
434+perl source-highlight binding:
435+
436+@uref{http://pb.rbfh.de}
415437
416438 @end itemize
417439
@@ -522,7 +544,7 @@ without using a Unix shell, and in particular to build @value{srchilite}
522544 with Microsoft MSVC compiler. You should use this method only if you
523545 don't have a Unix shell or if you really need to use the MSVC compiler
524546 (e.g., if you want to build @value{srchilitelib} to be used in MSVC
525-based programs.
547+based programs).
526548 @cindex boost
527549 You still need the boost regex library, and if you
528550 use MSVC, you can find installation packages for this library at
--- a/original/stamp-1
+++ b/original/stamp-1
@@ -1,4 +1,4 @@
1-@set UPDATED 7 December 2009
2-@set UPDATED-MONTH December 2009
3-@set EDITION 3.1.3
4-@set VERSION 3.1.3
1+@set UPDATED 14 May 2010
2+@set UPDATED-MONTH May 2010
3+@set EDITION 3.1.4
4+@set VERSION 3.1.4
--- a/original/stamp-vti
+++ b/original/stamp-vti
@@ -1,4 +1,4 @@
1-@set UPDATED 17 December 2009
2-@set UPDATED-MONTH December 2009
3-@set EDITION 3.1.3
4-@set VERSION 3.1.3
1+@set UPDATED 14 May 2010
2+@set UPDATED-MONTH May 2010
3+@set EDITION 3.1.4
4+@set VERSION 3.1.4
--- a/original/style.defaults.texinfo
+++ b/original/style.defaults.texinfo
@@ -21,4 +21,5 @@ path = regexp
2121 label = preproc
2222 error = string
2323 warning = type
24+code = preproc
2425 @end example
\ No newline at end of file
--- a/original/version-lib.texi
+++ b/original/version-lib.texi
@@ -1,4 +1,4 @@
1-@set UPDATED 7 December 2009
2-@set UPDATED-MONTH December 2009
3-@set EDITION 3.1.3
4-@set VERSION 3.1.3
1+@set UPDATED 14 May 2010
2+@set UPDATED-MONTH May 2010
3+@set EDITION 3.1.4
4+@set VERSION 3.1.4
--- a/original/version.texi
+++ b/original/version.texi
@@ -1,4 +1,4 @@
1-@set UPDATED 17 December 2009
2-@set UPDATED-MONTH December 2009
3-@set EDITION 3.1.3
4-@set VERSION 3.1.3
1+@set UPDATED 14 May 2010
2+@set UPDATED-MONTH May 2010
3+@set EDITION 3.1.4
4+@set VERSION 3.1.4
--- a/source-highlight-lib.html
+++ b/source-highlight-lib.html
@@ -1,14 +1,14 @@
11 <html lang="en">
22 <head>
3-<title>GNU Source-highlight Library 3.1.3</title>
3+<title>GNU Source-highlight Library 3.1.4</title>
44 <meta http-equiv="Content-Type" content="text/html">
5-<meta name="description" content="GNU Source-highlight Library 3.1.3">
5+<meta name="description" content="GNU Source-highlight Library 3.1.4">
66 <meta name="generator" content="makeinfo 4.13">
77 <link title="Top" rel="top" href="#Top">
88 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
99 <!--
1010 This manual is for GNU Source-highlight Library
11-(version 3.1.3, 7 December 2009),
11+(version 3.1.4, 14 May 2010),
1212 which given a source file, produces a document with syntax highlighting.
1313
1414 Copyright (C) 2005-2008 Lorenzo Bettini, `http://www.lorenzobettini.it'.
@@ -39,7 +39,7 @@ Copyright (C) 2005-2008 Lorenzo Bettini, `http://www.lorenzobettini.it'.
3939 --></style>
4040 </head>
4141 <body>
42-<h1 class="settitle">GNU Source-highlight Library 3.1.3</h1>
42+<h1 class="settitle">GNU Source-highlight Library 3.1.4</h1>
4343 <div class="contents">
4444 <h2>Table of Contents</h2>
4545 <ul>
@@ -85,12 +85,12 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
8585 <p>GNU Source-highlight, given a source file, produces a document with
8686 syntax highlighting.
8787
88- <p>This is Edition 3.1.3 of the Source-highlight Library manual.
88+ <p>This is Edition 3.1.4 of the Source-highlight Library manual.
8989
90- <p>This file documents GNU Source-highlight Library version 3.1.3.
90+ <p>This file documents GNU Source-highlight Library version 3.1.4.
9191
9292 <p>This manual is for GNU Source-highlight Library
93-(version 3.1.3, 7 December 2009),
93+(version 3.1.4, 14 May 2010),
9494 which given a source file, produces a document with syntax highlighting.
9595
9696 <p>Copyright &copy; 2005-2008 Lorenzo Bettini, <a href="http://www.lorenzobettini.it">http://www.lorenzobettini.it</a>.
--- a/source-highlight-lib.info
+++ b/source-highlight-lib.info
@@ -1,9 +1,9 @@
11 This is ../../doc/source-highlight-lib.info, produced by makeinfo
22 version 4.13 from ../../doc/source-highlight-lib.texinfo.
33
4-This manual is for GNU Source-highlight Library (version 3.1.3, 7
5-December 2009), which given a source file, produces a document with
6-syntax highlighting.
4+This manual is for GNU Source-highlight Library (version 3.1.4, 14 May
5+2010), which given a source file, produces a document with syntax
6+highlighting.
77
88 Copyright (C) 2005-2008 Lorenzo Bettini,
99 `http://www.lorenzobettini.it'.
@@ -34,12 +34,12 @@ GNU Source-highlight Library
3434 GNU Source-highlight, given a source file, produces a document with
3535 syntax highlighting.
3636
37- This is Edition 3.1.3 of the Source-highlight Library manual.
37+ This is Edition 3.1.4 of the Source-highlight Library manual.
3838
39- This file documents GNU Source-highlight Library version 3.1.3.
39+ This file documents GNU Source-highlight Library version 3.1.4.
4040
41- This manual is for GNU Source-highlight Library (version 3.1.3,
42-7 December 2009), which given a source file, produces a document with
41+ This manual is for GNU Source-highlight Library (version 3.1.4,
42+14 May 2010), which given a source file, produces a document with
4343 syntax highlighting.
4444
4545 Copyright (C) 2005-2008 Lorenzo Bettini,
@@ -997,24 +997,24 @@ Concept Index
997997
998998 
999999 Tag Table:
1000-Node: Top1160
1001-Node: Introduction2703
1002-Node: Installation3565
1003-Node: Use of GNU Source-highlight Library4522
1004-Ref: Use of GNU Source-highlight Library-Footnote-15084
1005-Node: Using Automake and Autotools5207
1006-Ref: Using Automake and Autotools-Footnote-17193
1007-Node: Main Classes7238
1008-Node: SourceHighlight class8760
1009-Node: Customizing Formatting11821
1010-Node: Completely Customized Formatting13495
1011-Node: Style-based Customized Formatting19422
1012-Node: Events and Listeners27797
1013-Node: Settings30182
1014-Node: Utility functions32292
1015-Node: Global instances32725
1016-Node: Problems34116
1017-Node: Mailing Lists34829
1018-Node: Concept Index35691
1000+Node: Top1156
1001+Node: Introduction2695
1002+Node: Installation3557
1003+Node: Use of GNU Source-highlight Library4514
1004+Ref: Use of GNU Source-highlight Library-Footnote-15076
1005+Node: Using Automake and Autotools5199
1006+Ref: Using Automake and Autotools-Footnote-17185
1007+Node: Main Classes7230
1008+Node: SourceHighlight class8752
1009+Node: Customizing Formatting11813
1010+Node: Completely Customized Formatting13487
1011+Node: Style-based Customized Formatting19414
1012+Node: Events and Listeners27789
1013+Node: Settings30174
1014+Node: Utility functions32284
1015+Node: Global instances32717
1016+Node: Problems34108
1017+Node: Mailing Lists34821
1018+Node: Concept Index35683
10191019 
10201020 End Tag Table
--- a/source-highlight.1
+++ b/source-highlight.1
@@ -1,12 +1,12 @@
1-.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36.
2-.TH SOURCE-HIGHLIGHT "1" "January 2010" "Source-highlight 3.1.3 (library: 3:1:0)" "User Commands"
1+.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1.
2+.TH SOURCE-HIGHLIGHT "1" "May 2010" "Source-highlight 3.1.4 (library: 3:1:0)" "User Commands"
33 .SH NAME
44 Source-highlight \- convert source code to syntax highlighted document
55 .SH SYNOPSIS
66 .B source-highlight
77 [\fIOPTIONS\fR]... \fI< input_file > output_file\fR
88 .SH DESCRIPTION
9-GNU source\-highlight 3.1.3
9+GNU source\-highlight 3.1.4
1010 .PP
1111 Highlight the syntax of a source file (e.g. Java) into a specific format (e.g.
1212 HTML)
@@ -218,7 +218,7 @@ Maintained by Lorenzo Bettini <http://www.lorenzobettini.it>
218218 .SH "REPORTING BUGS"
219219 Report bugs to <bug\-source\-highlight at gnu.org>
220220 .SH COPYRIGHT
221-Copyright \(co 1999-2008 Lorenzo Bettini <http://www.lorenzobettini.it>
221+Copyright \(co 1999\-2008 Lorenzo Bettini <http://www.lorenzobettini.it>
222222 This program comes with ABSOLUTELY NO WARRANTY.
223223 .br
224224 This is free software; you may redistribute copies of the program
--- a/source-highlight.html
+++ b/source-highlight.html
@@ -1,6738 +1,6253 @@
1-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
2-<html>
3-<!-- This manual is for GNU Source-highlight
4-(version 3.1.3, 17 December 2009),
1+<html lang="en">
2+<head>
3+<title>GNU Source-highlight 3.1.4</title>
4+<meta http-equiv="Content-Type" content="text/html">
5+<meta name="description" content="GNU Source-highlight 3.1.4">
6+<meta name="generator" content="makeinfo 4.13">
7+<link title="Top" rel="top" href="#Top">
8+<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
9+<!--
10+This manual is for GNU Source-highlight
11+(version 3.1.4, 14 May 2010),
512 which given a source file, produces a document with syntax highlighting.
613
14+Copyright (C) 2005-2008 Lorenzo Bettini, `http://www.lorenzobettini.it'.
15+
16+ Permission is granted to copy, distribute and/or modify this
17+ document under the terms of the GNU Free Documentation License,
18+ Version 1.1 or any later version published by the Free Software
19+ Foundation; with no Invariant Sections, with the Front-Cover Texts
20+ being "A GNU Manual," and with the Back-Cover Texts as in (a)
21+ below. A copy of the license is included in the section entitled
22+ "GNU Free Documentation License."
23+
24+ (a) The FSF's Back-Cover Text is: "You have freedom to copy and
25+ modify this GNU Manual, like GNU software. Copies published by
26+ the Free Software Foundation raise funds for GNU development."
27+ -->
28+<meta http-equiv="Content-Style-Type" content="text/css">
29+<style type="text/css"><!--
30+ pre.display { font-family:inherit }
31+ pre.format { font-family:inherit }
32+ pre.smalldisplay { font-family:inherit; font-size:smaller }
33+ pre.smallformat { font-family:inherit; font-size:smaller }
34+ pre.smallexample { font-size:smaller }
35+ pre.smalllisp { font-size:smaller }
36+ span.sc { font-variant:small-caps }
37+ span.roman { font-family:serif; font-weight:normal; }
38+ span.sansserif { font-family:sans-serif; font-weight:normal; }
39+--></style>
40+</head>
41+<body>
42+<h1 class="settitle">GNU Source-highlight 3.1.4</h1>
43+ <div class="contents">
44+<h2>Table of Contents</h2>
45+<ul>
46+<li><a name="toc_Top" href="#Top">GNU Source-highlight</a>
47+<li><a name="toc_Introduction" href="#Introduction">1 Introduction</a>
48+<ul>
49+<li><a href="#Supported-languages">1.1 Supported languages</a>
50+<li><a href="#The-program-source_002dhighlight_002dsettings">1.2 The program <code>source-highlight-settings</code></a>
51+<li><a href="#Notes-on-some-languages">1.3 Notes on some languages</a>
52+<ul>
53+<li><a href="#Fortran">1.3.1 Fortran</a>
54+<li><a href="#Perl">1.3.2 Perl</a>
55+</li></ul>
56+<li><a href="#Using-source_002dhighlight-as-a-simple-formatter">1.4 Using source-highlight as a simple formatter</a>
57+<li><a href="#Related-Software-and-Links">1.5 Related Software and Links</a>
58+</li></ul>
59+<li><a name="toc_Installation" href="#Installation">2 Installation</a>
60+<ul>
61+<li><a href="#Building-with-qmake">2.1 Building with qmake</a>
62+<li><a href="#Download">2.2 Download</a>
63+<li><a href="#Anonymous-Git-Checkout">2.3 Anonymous Git Checkout</a>
64+<li><a href="#What-you-need-to-build-source_002dhighlight">2.4 What you need to build source-highlight</a>
65+<li><a href="#Tips-on-installing-Boost-Regex-library">2.5 Tips on installing Boost Regex library</a>
66+<li><a href="#Patching-from-a-previous-version">2.6 Patching from a previous version</a>
67+<li><a href="#Using-source_002dhighlight-with-less">2.7 Using source-highlight with less</a>
68+<li><a href="#Using-source_002dhighlight-as-a-CGI">2.8 Using source-highlight as a CGI</a>
69+<li><a href="#Building-_002erpm">2.9 Building .rpm</a>
70+</li></ul>
71+<li><a name="toc_Copying" href="#Copying">3 Copying Conditions</a>
72+<li><a name="toc_Simple-Usage" href="#Simple-Usage">4 Simple Usage</a>
73+<ul>
74+<li><a href="#HTML-and-XHTML-output">4.1 HTML and XHTML output</a>
75+<li><a href="#LaTeX-output">4.2 LaTeX output</a>
76+<li><a href="#Texinfo-output">4.3 Texinfo output</a>
77+<li><a href="#DocBook-output">4.4 DocBook output</a>
78+<li><a href="#ANSI-color-escape-sequences">4.5 ANSI color escape sequences</a>
79+</li></ul>
80+<li><a name="toc_Configuration-files" href="#Configuration-files">5 Configuration files</a>
81+<ul>
82+<li><a href="#Output-format-style">5.1 Output format style</a>
83+<li><a href="#Output-format-style-using-CSS">5.2 Output format style using CSS</a>
84+<li><a href="#Default-Styles">5.3 Default Styles</a>
85+<li><a href="#Language-map">5.4 Language map</a>
86+<li><a href="#Language-definition-files">5.5 Language definition files</a>
87+<li><a href="#Output-Language-map">5.6 Output Language map</a>
88+<li><a href="#Output-Language-definition-files">5.7 Output Language definition files</a>
89+<li><a href="#Developing-your-own-definition-files">5.8 Developing your own definition files</a>
90+</li></ul>
91+<li><a name="toc_Invoking-source_002dhighlight" href="#Invoking-source_002dhighlight">6 Invoking <samp><span class="command">source-highlight</span></samp></a>
92+<ul>
93+<li><a href="#How-the-input-language-is-discovered">6.1 How the input language is discovered</a>
94+</li></ul>
95+<li><a name="toc_Language-Definitions" href="#Language-Definitions">7 Language Definitions</a>
96+<ul>
97+<li><a href="#Ways-of-specifying-regular-expressions">7.1 Ways of specifying regular expressions</a>
98+<li><a href="#Simple-definitions">7.2 Simple definitions</a>
99+<li><a href="#Line-wide-definitions">7.3 Line wide definitions</a>
100+<li><a href="#Order-of-definitions">7.4 Order of definitions</a>
101+<li><a href="#Delimited-definitions">7.5 Delimited definitions</a>
102+<li><a href="#Variable-definitions">7.6 Variable definitions</a>
103+<li><a href="#Dynamic-Backreferences">7.7 Dynamic Backreferences</a>
104+<li><a href="#File-inclusion">7.8 File inclusion</a>
105+<li><a href="#State_002fEnvironment-Definitions">7.9 State/Environment Definitions</a>
106+<li><a href="#Explicit-subexpressions-with-names">7.10 Explicit subexpressions with names</a>
107+<li><a href="#Redefinitions-and-Substitutions">7.11 Redefinitions and Substitutions</a>
108+<li><a href="#How-source_002dhighlight-works">7.12 How source-highlight works</a>
109+<li><a href="#Notes-on-regular-expressions">7.13 Notes on regular expressions</a>
110+<li><a href="#The-program-check_002dregexp">7.14 The program <samp><span class="command">check-regexp</span></samp></a>
111+<li><a href="#Listing-Language-Elements">7.15 Listing Language Elements</a>
112+<li><a href="#Concluding-Remarks">7.16 Concluding Remarks</a>
113+<li><a href="#Debugging">7.17 Debugging</a>
114+<li><a href="#Tutorials-on-Language-Definitions">7.18 Tutorials on Language Definitions</a>
115+<ul>
116+<li><a href="#Highlighting-C_002fC_002b_002b-and-C_0023">7.18.1 Highlighting C/C++ and C#</a>
117+<li><a href="#Highlighting-Diff-files">7.18.2 Highlighting Diff files</a>
118+<li><a href="#Pseudo-semantic-analysis">7.18.3 Pseudo semantic analysis</a>
119+</li></ul>
120+</li></ul>
121+<li><a name="toc_Output-Language-Definitions" href="#Output-Language-Definitions">8 Output Language Definitions</a>
122+<ul>
123+<li><a href="#File-extension">8.1 File extension</a>
124+<li><a href="#Text-styles">8.2 Text styles</a>
125+<li><a href="#Colors">8.3 Colors</a>
126+<li><a href="#Anchors-and-References">8.4 Anchors and References</a>
127+<li><a href="#One-style">8.5 One style</a>
128+<li><a href="#Style-template">8.6 Style template</a>
129+<li><a href="#Line-prefix">8.7 Line prefix</a>
130+<li><a href="#String-translation">8.8 String translation</a>
131+<li><a href="#Document-template">8.9 Document template</a>
132+<li><a href="#Generating-HTML-output">8.10 Generating HTML output</a>
133+</li></ul>
134+<li><a name="toc_Generating-References" href="#Generating-References">9 Generating References</a>
135+<li><a name="toc_Examples" href="#Examples">10 Examples</a>
136+<ul>
137+<li><a href="#Simple-example">10.1 Simple example</a>
138+<li><a href="#References">10.2 References</a>
139+<li><a href="#Line-ranges">10.3 Line ranges</a>
140+<li><a href="#Line-ranges-_0028with-context_0029">10.4 Line ranges (with context)</a>
141+<li><a href="#Regex-ranges">10.5 Regex ranges</a>
142+</li></ul>
143+<li><a name="toc_Problems" href="#Problems">11 Reporting Bugs</a>
144+<li><a name="toc_Mailing-Lists" href="#Mailing-Lists">12 Mailing Lists</a>
145+<li><a name="toc_Concept-Index" href="#Concept-Index">Concept Index</a>
146+</li></ul>
147+</div>
7148
8-Copyright C 2005-2008 Lorenzo Bettini, http://www.lorenzobettini.it.
9-
10-Copyright C 2010 KINUGAWA Akihito (Japanese translation).
11149
12150
13-Permission is granted to copy, distribute and/or modify this document
14-under the terms of the GNU Free Documentation License, Version 1.1 or
15-any later version published by the Free Software Foundation; with no
16-Invariant Sections, with the Front-Cover Texts being "A GNU Manual,"
17-and with the Back-Cover Texts as in (a) below. A copy of the
18-license is included in the section entitled "GNU Free Documentation
19-License."
151+<div class="node">
152+<a name="Top"></a>
153+<p><hr>
154+Next:&nbsp;<a rel="next" accesskey="n" href="#Introduction">Introduction</a>,
155+Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
156+Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
20157
21-(a) The FSF's Back-Cover Text is: "You have freedom to copy and modify
22-this GNU Manual, like GNU software. Copies published by the Free
23-Software Foundation raise funds for GNU development."
158+</div>
24159
25- -->
26-<!-- Created on March, 13 2010 by texi2html 1.78 -->
27-<!--
28-Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
29- Karl Berry <karl@freefriends.org>
30- Olaf Bachmann <obachman@mathematik.uni-kl.de>
31- and many others.
32-Maintained by: Many creative people.
33-Send bugs and suggestions to <texi2html-bug@nongnu.org>
34-
35--->
36-<head>
37-<title>GNU Source-highlight 3.1.3</title>
38-
39-<meta name="description" content="GNU Source-highlight 3.1.3">
40-<meta name="keywords" content="GNU Source-highlight 3.1.3">
41-<meta name="resource-type" content="document">
42-<meta name="distribution" content="global">
43-<meta name="Generator" content="texi2html 1.78">
44-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
45-<style type="text/css">
46-<!--
47-a.summary-letter {text-decoration: none}
48-pre.display {font-family: serif}
49-pre.format {font-family: serif}
50-pre.menu-comment {font-family: serif}
51-pre.menu-preformatted {font-family: serif}
52-pre.smalldisplay {font-family: serif; font-size: smaller}
53-pre.smallexample {font-size: smaller}
54-pre.smallformat {font-family: serif; font-size: smaller}
55-pre.smalllisp {font-size: smaller}
56-span.roman {font-family:serif; font-weight:normal;}
57-span.sansserif {font-family:sans-serif; font-weight:normal;}
58-ul.toc {list-style: none}
59--->
60-</style>
160+<h2 class="unnumbered">GNU Source-highlight</h2>
61161
162+<p>GNU Source-highlight, given a source file, produces a document with
163+syntax highlighting.
62164
63-</head>
165+ <p>This is Edition 3.1.4 of the Source-highlight manual.
64166
65-<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
167+ <p>This file documents GNU Source-highlight version 3.1.4.
66168
67-<a name="Top"></a>
68-<a name="SEC_Top"></a>
69-<table cellpadding="1" cellspacing="1" border="0">
70-<tr><td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
71-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
72-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
73-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
74-</tr></table>
75-<h1 class="settitle">GNU Source-highlight</h1>
76-
77-<p>GNU Source-highlightは、入力したソースファイルからシンタックスを強調したドキュメントを生成する。
78-</p>
79-<p>このドキュメントは、Source-highlightマニュアルの3.1.3エディションである。
80-</p>
81-<p>このファイルは、GNU Source-highlightバージョン3.1.3について記述している。
82-</p>
83-<p>This manual is for GNU Source-highlight
84-(version 3.1.3, 17 December 2009),
169+ <p>This manual is for GNU Source-highlight
170+(version 3.1.4, 14 May 2010),
85171 which given a source file, produces a document with syntax highlighting.
86-</p>
87-<ul class="toc">
88-<li>
89-Copyright &copy; 2005-2008 Lorenzo Bettini, <a href="http://www.lorenzobettini.it">http://www.lorenzobettini.it</a>.
90-</li><li>
91-Copyright &copy; 2010 KINUGAWA Akihito (Japanese translation).
92-</li></ul>
93172
94-<blockquote><p>Permission is granted to copy, distribute and/or modify this document
173+ <p>Copyright &copy; 2005-2008 Lorenzo Bettini, <a href="http://www.lorenzobettini.it">http://www.lorenzobettini.it</a>.
174+
175+ <blockquote>
176+Permission is granted to copy, distribute and/or modify this document
95177 under the terms of the GNU Free Documentation License, Version 1.1 or
96178 any later version published by the Free Software Foundation; with no
97179 Invariant Sections, with the Front-Cover Texts being &ldquo;A GNU Manual,&rdquo;
98180 and with the Back-Cover Texts as in (a) below. A copy of the
99181 license is included in the section entitled &ldquo;GNU Free Documentation
100182 License.&rdquo;
101-</p>
102-<p>(a) The FSF's Back-Cover Text is: &ldquo;You have freedom to copy and modify
183+
184+ <p>(a) The FSF's Back-Cover Text is: &ldquo;You have freedom to copy and modify
103185 this GNU Manual, like GNU software. Copies published by the Free
104186 Software Foundation raise funds for GNU development.&rdquo;
105-</p></blockquote>
106-
107-
108-<table class="menu" border="0" cellspacing="0">
109-<tr><td align="left" valign="top"><a href="#SEC1">1. 導入</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"> 目的
110-</td></tr>
111-<tr><td align="left" valign="top"><a href="#SEC9">2. インストール</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"> ダウンロードとインストール
112-</td></tr>
113-<tr><td align="left" valign="top"><a href="#SEC19">3. Copying Conditions</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"> ライセンスについて
114-</td></tr>
115-<tr><td align="left" valign="top"><a href="#SEC20">4. 簡単な使い方</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"> 非常に基本的な使い方
116-</td></tr>
117-<tr><td align="left" valign="top"><a href="#SEC26">5. 設定ファイル</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"> 実行に必要なファイル
118-</td></tr>
119-<tr><td align="left" valign="top"><a href="#SEC35">6. <code>source-highlight</code>の起動</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"> <code>source-highlight</code>の実行方法
120-</td></tr>
121-<tr><td align="left" valign="top"><a href="#SEC37">7. 言語の定義</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"> 入力言語の定義方法
122-</td></tr>
123-<tr><td align="left" valign="top"><a href="#SEC59">8. 出力言語の定義</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"> 出力フォーマットの定義方法
124-</td></tr>
125-<tr><td align="left" valign="top"><a href="#SEC70">9. リファレンスの生成</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"> アンカーとクロスリファレンス
126-</td></tr>
127-<tr><td align="left" valign="top"><a href="#SEC71">10. 例</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"> 出力例
128-</td></tr>
129-<tr><td align="left" valign="top"><a href="#SEC77">11. バグ報告</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"></td></tr>
130-<tr><td align="left" valign="top"><a href="#SEC78">12. メーリングリスト</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
131-</td></tr>
132-<tr><td align="left" valign="top"><a href="#SEC79">Concept Index</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"> Index of concepts.
133-</td></tr>
134-</table>
135-
136-<hr size="1">
137-<a name="g_t_5c0e_5165"></a>
138-<a name="SEC1"></a>
139-<table cellpadding="1" cellspacing="1" border="0">
140-<tr><td valign="middle" align="left">[<a href="#SEC_Top" title="Previous section in reading order"> &lt; </a>]</td>
141-<td valign="middle" align="left">[<a href="#SEC2" title="Next section in reading order"> &gt; </a>]</td>
142-<td valign="middle" align="left"> &nbsp; </td>
143-<td valign="middle" align="left">[ &lt;&lt; ]</td>
144-<td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td>
145-<td valign="middle" align="left">[<a href="#SEC9" title="Next chapter"> &gt;&gt; </a>]</td>
146-<td valign="middle" align="left"> &nbsp; </td>
147-<td valign="middle" align="left"> &nbsp; </td>
148-<td valign="middle" align="left"> &nbsp; </td>
149-<td valign="middle" align="left"> &nbsp; </td>
150-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
151-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
152-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
153-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
154-</tr></table>
155-<h1 class="chapter"> 1. 導入 </h1>
156-
157-
158-<p>GNU Source-highlightは、入力したソースファイルからシンタックスが強調されたドキュメントを生成する。
159-色やスタイルについては、設定ファイルを使ったり、コマンドラインで指定する何らかのオプションを使うことで指定することができる(ボールド、イタリック、下線)。
160-</p>
161-<p>このプログラムはすでに多数の言語(たとえば、C++、Java、Perlなど)と多数のファイルフォーマット(たとえば、ログファイル、ChangeLogなど)、そして、複数の出力フォーマット(たとえば、HTML、ANSIカラーエスケープシーケンス、LaTeXなど)を認識している。
162-バージョン2.0からは、後でこのマニュアルで説明する簡単なシンタックスを使って自分自身で入力ソースとなる言語を記述することができる(<a href="#SEC37">言語の定義</a>)。
163-バージョン2.1からは、後でこのマニュアルで説明する簡単なシンタックスを使って自分自身で出力フォーマットの言語を記述することができる(<a href="#SEC59">出力言語の定義</a>)。
164-バージョン2.2からは、<em>ctags</em>プログラム(<a href="http://ctags.sourceforge.net">http://ctags.sourceforge.net</a>)に頼る形ではあるが、クロスリファレンス(たとえば、変数名やフィールド名になどに対するもの)を生成することができるようになった(<a href="#SEC70">リファレンスの生成</a>)。
165-</p>
166-<a name="IDX1"></a>
167-<p>バージョン3.0からは、GNU Source-highlightがC++ライブラリも提供するようになった。
168-これは、C++プログラマが自分のプログラムにハイライトの機能を追加できるようにするためのものだ。
169-See <a href="source-highlight-info.html#g_t_5c0e_5165">(source-highlight-info)導入</a>
170-</p>
171-<table class="menu" border="0" cellspacing="0">
172-<tr><td align="left" valign="top"><a href="#SEC2">1.1 サポートしている言語</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
173-</td></tr>
174-<tr><td align="left" valign="top"><a href="#SEC3">1.2 <code>source-highlight-settings</code>プログラム</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
175-</td></tr>
176-<tr><td align="left" valign="top"><a href="#SEC4">1.3 いくつかの言語についての注意</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
177-</td></tr>
178-<tr><td align="left" valign="top"><a href="#SEC7">1.4 簡単なフォーマッタとしてのsource-highlightの使用</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
179-</td></tr>
180-<tr><td align="left" valign="top"><a href="#SEC8">1.5 関連するソフトウェアとリンク</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
181-</td></tr>
182-</table>
183-
184-<hr size="6">
185-<a name="g_t_30b5_30dd_30fc_30c8_3057_3066_3044_308b_8a00_8a9e"></a>
186-<a name="SEC2"></a>
187-<table cellpadding="1" cellspacing="1" border="0">
188-<tr><td valign="middle" align="left">[<a href="#SEC1" title="Previous section in reading order"> &lt; </a>]</td>
189-<td valign="middle" align="left">[<a href="#SEC3" title="Next section in reading order"> &gt; </a>]</td>
190-<td valign="middle" align="left"> &nbsp; </td>
191-<td valign="middle" align="left">[<a href="#SEC1" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
192-<td valign="middle" align="left">[<a href="#SEC1" title="Up section"> Up </a>]</td>
193-<td valign="middle" align="left">[<a href="#SEC9" title="Next chapter"> &gt;&gt; </a>]</td>
194-<td valign="middle" align="left"> &nbsp; </td>
195-<td valign="middle" align="left"> &nbsp; </td>
196-<td valign="middle" align="left"> &nbsp; </td>
197-<td valign="middle" align="left"> &nbsp; </td>
198-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
199-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
200-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
201-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
202-</tr></table>
203-<h2 class="section"> 1.1 サポートしている言語 </h2>
204-
205-<p>Source-highlight(3.1.3)で本来サポートされている言語(要するにファイルの拡張子)の完全なリストは、<code>--lang-list</code>で報告されるものと同じであるが、以下のものである。
206-</p>
207-<table><tr><td>&nbsp;</td><td><pre class="example">C = cpp.lang
208-H = cpp.lang
209-ac = m4.lang
210-ada = ada.lang
211-adb = ada.lang
212-am = makefile.lang
213-applescript = applescript.lang
214-asm = asm.lang
215-autoconf = m4.lang
216-awk = awk.lang
217-bash = sh.lang
218-bat = bat.lang
219-batch = bat.lang
220-bib = bib.lang
221-bison = bison.lang
222-c = c.lang
223-caml = caml.lang
224-cbl = cobol.lang
225-cc = cpp.lang
226-changelog = changelog.lang
227-clipper = clipper.lang
228-cls = latex.lang
229-cobol = cobol.lang
230-conf = conf.lang
231-cpp = cpp.lang
232-cs = csharp.lang
233-csh = sh.lang
234-csharp = csharp.lang
235-css = css.lang
236-d = d.lang
237-desktop = desktop.lang
238-diff = diff.lang
239-dmd = d.lang
240-docbook = xml.lang
241-dtx = latex.lang
242-eps = postscript.lang
243-erl = erlang.lang
244-erlang = erlang.lang
245-errors = errors.lang
246-fixed-fortran = fixed-fortran.lang
247-flex = flex.lang
248-fortran = fortran.lang
249-free-fortran = fortran.lang
250-glsl = glsl.lang
251-h = cpp.lang
252-haskell = haskell.lang
253-haxe = haxe.lang
254-hh = cpp.lang
255-hpp = cpp.lang
256-hs = haskell.lang
257-htm = html.lang
258-html = html.lang
259-hx = haxe.lang
260-in = makefile.lang
261-ini = desktop.lang
262-java = java.lang
263-javascript = javascript.lang
264-js = javascript.lang
265-kcfg = xml.lang
266-kdevelop = xml.lang
267-kidl = xml.lang
268-ksh = sh.lang
269-l = flex.lang
270-lang = langdef.lang
271-langdef = langdef.lang
272-latex = latex.lang
273-ldap = ldap.lang
274-ldif = ldap.lang
275-lex = flex.lang
276-lgt = logtalk.lang
277-ll = flex.lang
278-log = log.lang
279-logtalk = logtalk.lang
280-lsm = lsm.lang
281-lua = lua.lang
282-m4 = m4.lang
283-makefile = makefile.lang
284-manifest = manifest.lang
285-mf = manifest.lang
286-ml = caml.lang
287-mli = caml.lang
288-moc = cpp.lang
289-outlang = outlang.lang
290-oz = oz.lang
291-pas = pascal.lang
292-pascal = pascal.lang
293-patch = diff.lang
294-pc = pc.lang
295-perl = perl.lang
296-php = php.lang
297-php3 = php.lang
298-php4 = php.lang
299-php5 = php.lang
300-pkgconfig = pc.lang
301-pl = prolog.lang
302-pm = perl.lang
303-postscript = postscript.lang
304-prg = clipper.lang
305-prolog = prolog.lang
306-properties = properties.lang
307-ps = postscript.lang
308-py = python.lang
309-python = python.lang
310-rb = ruby.lang
311-rc = xml.lang
312-ruby = ruby.lang
313-s = asm.lang
314-scala = scala.lang
315-scpt = applescript.lang
316-sh = sh.lang
317-shell = sh.lang
318-sig = sml.lang
319-sl = slang.lang
320-slang = slang.lang
321-slsh = slang.lang
322-sml = sml.lang
323-spec = spec.lang
324-sql = sql.lang
325-sty = latex.lang
326-style = style.lang
327-syslog = log.lang
328-tcl = tcl.lang
329-tcsh = sh.lang
330-tex = latex.lang
331-texi = texinfo.lang
332-texinfo = texinfo.lang
333-tk = tcl.lang
334-txt = nohilite.lang
335-ui = xml.lang
336-vbs = vbscript.lang
337-vbscript = vbscript.lang
338-xhtml = xml.lang
339-xml = xml.lang
340-xorg = xorg.lang
341-y = bison.lang
342-yacc = bison.lang
343-yy = bison.lang
344-</pre></td></tr></table>
345-
346-<p>Source-highlight(3.1.3)で本来サポートされている出力フォーマットの完全なリストは、<code>--outlang-list</code>で報告されるものと同じであるが、以下のものである。
347-</p>
348-<table><tr><td>&nbsp;</td><td><pre class="example">docbook = docbook.outlang
349-esc = esc.outlang
350-html = html.outlang
351-html-css = htmlcss.outlang
352-htmltable = htmltable.outlang
353-javadoc = javadoc.outlang
354-latex = latex.outlang
355-latexcolor = latexcolor.outlang
356-texinfo = texinfo.outlang
357-xhtml = xhtml.outlang
358-xhtml-css = xhtmlcss.outlang
359-xhtmltable = xhtmltable.outlang
360-</pre></td></tr></table>
361-
362-<p><code>-css</code>と後ろに付いているものについては、<a href="#SEC32">出力言語マップ</a>で説明する<a name="DOCF1" href="#FOOT1">(1)</a>。
363-</p>
364-<p>留意しおいてほしいのだが、私は、個人的には、こういった言語の定義を全てテストしているわけではない。
365-実のところ、定義ファイルが文法的に正しいことは(コマンドラインオプションの<code>--check-lang</code>と<code>--check-outlang</code>を使って <a href="#SEC35"><code>source-highlight</code>の起動</a>)チェックしているが、それらの定義がその言語のシンタックスを本当に遵守しているかは確かめてはいない(たとえば、インターネットで情報を探して言語の定義を作り上げたものがあるが、私がその言語でプログラムを書いた経験はなかったりする)。
366-なので、的確ではない言語の定義があったならば教えてほしい。
367-そしてまた、&lsquo;<tt>test</tt>&rsquo;ディレクトリに入っていない言語のプログラム例を持っている場合は、それを私に送ってほしい。
368-そうすれば、そのテストスイートに入れることができる。
369-</p>
370-<hr size="6">
371-<a name="source_002dhighlight_002dsettings_30d7_30ed_30b0_30e9_30e0"></a>
372-<a name="SEC3"></a>
373-<table cellpadding="1" cellspacing="1" border="0">
374-<tr><td valign="middle" align="left">[<a href="#SEC2" title="Previous section in reading order"> &lt; </a>]</td>
375-<td valign="middle" align="left">[<a href="#SEC4" title="Next section in reading order"> &gt; </a>]</td>
376-<td valign="middle" align="left"> &nbsp; </td>
377-<td valign="middle" align="left">[<a href="#SEC1" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
378-<td valign="middle" align="left">[<a href="#SEC1" title="Up section"> Up </a>]</td>
379-<td valign="middle" align="left">[<a href="#SEC9" title="Next chapter"> &gt;&gt; </a>]</td>
380-<td valign="middle" align="left"> &nbsp; </td>
381-<td valign="middle" align="left"> &nbsp; </td>
382-<td valign="middle" align="left"> &nbsp; </td>
383-<td valign="middle" align="left"> &nbsp; </td>
384-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
385-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
386-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
387-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
388-</tr></table>
389-<h2 class="section"> 1.2 <code>source-highlight-settings</code>プログラム </h2>
390-
391-<p>バージョン3.0から、GNU Source-highlightには、<code>source-highlight-settings</code>というプログラムも入っている。
392-これは、source-highlightがその言語の定義ファイルやその他の設定ファイルが見つけられるかどうかをチェックして、念の為、ユーザのホームディレクトリの中の設定ファイルに正しい設定を格納するのに使われる。
393-</p>
394-<a name="IDX2"></a>
395-<p>特に、この格納された設定ファイルは&lsquo;<tt>source-highlight.conf</tt>&rsquo;というもので、&lsquo;<tt>$HOME/.source-highlight/</tt>&rsquo;の中に収められる。
396-</p>
397-<a name="IDX3"></a>
398-<p>差し当たり、このファイルには<code>--data-dir</code>のためのデフォルト値が格納される。
399-</p>
400-<p>ユーザは、
401-<a name="IDX4"></a>
402-<code>SOURCE_HIGHLIGHT_DATADIR</code>環境変数を使って、いつでもこの設定ファイルの内容と、ハードコードされているデフォルト値をオーバーライドしてよい。
403-</p>
404-<hr size="6">
405-<a name="g_t_3044_304f_3064_304b_306e_8a00_8a9e_306b_3064_3044_3066_306e_6ce8_610f"></a>
406-<a name="SEC4"></a>
407-<table cellpadding="1" cellspacing="1" border="0">
408-<tr><td valign="middle" align="left">[<a href="#SEC3" title="Previous section in reading order"> &lt; </a>]</td>
409-<td valign="middle" align="left">[<a href="#SEC5" title="Next section in reading order"> &gt; </a>]</td>
410-<td valign="middle" align="left"> &nbsp; </td>
411-<td valign="middle" align="left">[<a href="#SEC1" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
412-<td valign="middle" align="left">[<a href="#SEC1" title="Up section"> Up </a>]</td>
413-<td valign="middle" align="left">[<a href="#SEC9" title="Next chapter"> &gt;&gt; </a>]</td>
414-<td valign="middle" align="left"> &nbsp; </td>
415-<td valign="middle" align="left"> &nbsp; </td>
416-<td valign="middle" align="left"> &nbsp; </td>
417-<td valign="middle" align="left"> &nbsp; </td>
418-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
419-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
420-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
421-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
422-</tr></table>
423-<h2 class="section"> 1.3 いくつかの言語についての注意 </h2>
424-
425-<p>このセクションでは、特定の言語のハイライティングについて細部に触れるつもりだ。
426-これらのノートは、ハイライティングされる言語が、コマンドラインでのさらなる指定が必要な「方言」を持つような場合に役に立つかもしれない(たとえば、特定の方言を選択するためなど)。
427-</p>
428-<table class="menu" border="0" cellspacing="0">
429-<tr><td align="left" valign="top"><a href="#SEC5">1.3.1 Fortran</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
430-</td></tr>
431-<tr><td align="left" valign="top"><a href="#SEC6">1.3.2 Perl</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
432-</td></tr>
433-</table>
434-
435-<hr size="6">
187+</blockquote>
188+
189+<!-- All the nodes can be updated using the EMACS command -->
190+<!-- texinfo-every-node-update, which is normally bound to C-c C-u C-e. -->
191+<!-- @node Top, Introduction, (dir), (dir) -->
192+<!-- All the menus can be updated with the EMACS command -->
193+<!-- texinfo-all-menus-update, which is normally bound to C-c C-u C-a. -->
194+<ul class="menu">
195+<li><a accesskey="1" href="#Introduction">Introduction</a>: What's it for?
196+<li><a accesskey="2" href="#Installation">Installation</a>: Download and installation
197+<li><a accesskey="3" href="#Copying">Copying</a>: Licence issues
198+<li><a accesskey="4" href="#Simple-Usage">Simple Usage</a>: Very basic usage
199+<li><a accesskey="5" href="#Configuration-files">Configuration files</a>: Files needed for execution
200+<li><a accesskey="6" href="#Invoking-source_002dhighlight">Invoking source-highlight</a>: How to run <samp><span class="command">source-highlight</span></samp>.
201+<li><a accesskey="7" href="#Language-Definitions">Language Definitions</a>: How to define an input language
202+<li><a accesskey="8" href="#Output-Language-Definitions">Output Language Definitions</a>: How to define an output format
203+<li><a accesskey="9" href="#Generating-References">Generating References</a>: Anchors and cross references
204+<li><a href="#Examples">Examples</a>: Some output examples
205+<li><a href="#Problems">Problems</a>: Reporting bugs.
206+<li><a href="#Mailing-Lists">Mailing Lists</a>
207+<li><a href="#Concept-Index">Concept Index</a>: Index of concepts.
208+</ul>
209+
210+<div class="node">
211+<a name="Introduction"></a>
212+<p><hr>
213+Next:&nbsp;<a rel="next" accesskey="n" href="#Installation">Installation</a>,
214+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Top">Top</a>,
215+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
216+
217+</div>
218+
219+<h2 class="chapter">1 Introduction</h2>
220+
221+<p><a name="index-introduction-1"></a><a name="index-features-2"></a>
222+GNU Source-highlight, given a source file, produces a document with
223+syntax highlighting. The colors and the styles can be specified (bold,
224+italics, underline) by means of a configuration file, and some other
225+options can be specified at the command line.
226+
227+ <p>The program already recognizes many programming languages (e.g., C++,
228+Java, Perl, etc.) and file formats (e.g., log files, ChangeLog, etc.),
229+and some output formats (e.g., HTML, ANSI color escape sequences,
230+LaTeX, etc.). Since version 2.0, it allows you to specify your own
231+input source language via a simple syntax described later in this manual
232+(<a href="#Language-Definitions">Language Definitions</a>). Since version 2.1, it allows you to
233+specify your own output format language via a simple syntax described
234+later in this manual (<a href="#Output-Language-Definitions">Output Language Definitions</a>). Since version
235+2.2, it is able to generate cross references (e.g., to variable names,
236+field names, etc.) by relying on the program <em>ctags</em>,
237+<a href="http://ctags.sourceforge.net">http://ctags.sourceforge.net</a> (<a href="#Generating-References">Generating References</a>).
238+
239+ <p><a name="index-library-3"></a>Since version 3.0, GNU Source-highlight also provides a C++ library
240+(which is used by the main program itself), that can be used
241+by C++ programmers to add highlighting functionalities to their
242+programs. see <a href="source-highlight-info.html#Introduction">Introduction</a>.
243+
244+<ul class="menu">
245+<li><a accesskey="1" href="#Supported-languages">Supported languages</a>
246+<li><a accesskey="2" href="#The-program-source_002dhighlight_002dsettings">The program source-highlight-settings</a>
247+<li><a accesskey="3" href="#Notes-on-some-languages">Notes on some languages</a>
248+<li><a accesskey="4" href="#Using-source_002dhighlight-as-a-simple-formatter">Using source-highlight as a simple formatter</a>
249+<li><a accesskey="5" href="#Related-Software-and-Links">Related Software and Links</a>
250+</ul>
251+
252+<div class="node">
253+<a name="Supported-languages"></a>
254+<p><hr>
255+Next:&nbsp;<a rel="next" accesskey="n" href="#The-program-source_002dhighlight_002dsettings">The program source-highlight-settings</a>,
256+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Introduction">Introduction</a>,
257+Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>
258+
259+</div>
260+
261+<h3 class="section">1.1 Supported languages</h3>
262+
263+<p>The complete list of languages (indeed, file extensions) natively
264+supported by this version of Source-highlight (3.1.4), as
265+reported by <code>--lang-list</code>, is the following:
266+
267+<pre class="example"> C = cpp.lang
268+ H = cpp.lang
269+ ac = m4.lang
270+ ada = ada.lang
271+ adb = ada.lang
272+ am = makefile.lang
273+ applescript = applescript.lang
274+ asm = asm.lang
275+ autoconf = m4.lang
276+ awk = awk.lang
277+ bash = sh.lang
278+ bat = bat.lang
279+ batch = bat.lang
280+ bib = bib.lang
281+ bison = bison.lang
282+ c = c.lang
283+ caml = caml.lang
284+ cbl = cobol.lang
285+ cc = cpp.lang
286+ changelog = changelog.lang
287+ clipper = clipper.lang
288+ cls = latex.lang
289+ cobol = cobol.lang
290+ conf = conf.lang
291+ cpp = cpp.lang
292+ cs = csharp.lang
293+ csh = sh.lang
294+ csharp = csharp.lang
295+ css = css.lang
296+ ctp = php.lang
297+ d = d.lang
298+ desktop = desktop.lang
299+ diff = diff.lang
300+ dmd = d.lang
301+ docbook = xml.lang
302+ dtx = latex.lang
303+ eps = postscript.lang
304+ erl = erlang.lang
305+ erlang = erlang.lang
306+ errors = errors.lang
307+ fixed-fortran = fixed-fortran.lang
308+ flex = flex.lang
309+ fortran = fortran.lang
310+ free-fortran = fortran.lang
311+ glsl = glsl.lang
312+ h = cpp.lang
313+ haskell = haskell.lang
314+ haxe = haxe.lang
315+ hh = cpp.lang
316+ hpp = cpp.lang
317+ hs = haskell.lang
318+ htm = html.lang
319+ html = html.lang
320+ hx = haxe.lang
321+ in = makefile.lang
322+ ini = desktop.lang
323+ java = java.lang
324+ javascript = javascript.lang
325+ js = javascript.lang
326+ kcfg = xml.lang
327+ kdevelop = xml.lang
328+ kidl = xml.lang
329+ ksh = sh.lang
330+ l = flex.lang
331+ lang = langdef.lang
332+ langdef = langdef.lang
333+ latex = latex.lang
334+ ldap = ldap.lang
335+ ldif = ldap.lang
336+ lex = flex.lang
337+ lgt = logtalk.lang
338+ lhs = haskell_literate.lang
339+ lisp = lisp.lang
340+ ll = flex.lang
341+ log = log.lang
342+ logtalk = logtalk.lang
343+ lsm = lsm.lang
344+ lua = lua.lang
345+ m4 = m4.lang
346+ makefile = makefile.lang
347+ manifest = manifest.lang
348+ mf = manifest.lang
349+ ml = caml.lang
350+ mli = caml.lang
351+ moc = cpp.lang
352+ outlang = outlang.lang
353+ oz = oz.lang
354+ pas = pascal.lang
355+ pascal = pascal.lang
356+ patch = diff.lang
357+ pc = pc.lang
358+ perl = perl.lang
359+ php = php.lang
360+ php3 = php.lang
361+ php4 = php.lang
362+ php5 = php.lang
363+ pkgconfig = pc.lang
364+ pl = prolog.lang
365+ pm = perl.lang
366+ postscript = postscript.lang
367+ prg = clipper.lang
368+ prolog = prolog.lang
369+ properties = properties.lang
370+ proto = proto.lang
371+ protobuf = proto.lang
372+ ps = postscript.lang
373+ py = python.lang
374+ python = python.lang
375+ rb = ruby.lang
376+ rc = xml.lang
377+ ruby = ruby.lang
378+ s = asm.lang
379+ scala = scala.lang
380+ scpt = applescript.lang
381+ sh = sh.lang
382+ shell = sh.lang
383+ sig = sml.lang
384+ sl = slang.lang
385+ slang = slang.lang
386+ slsh = slang.lang
387+ sml = sml.lang
388+ spec = spec.lang
389+ sql = sql.lang
390+ sty = latex.lang
391+ style = style.lang
392+ syslog = log.lang
393+ tcl = tcl.lang
394+ tcsh = sh.lang
395+ tex = latex.lang
396+ texi = texinfo.lang
397+ texinfo = texinfo.lang
398+ tk = tcl.lang
399+ txt = nohilite.lang
400+ ui = xml.lang
401+ vala = vala.lang
402+ vbs = vbscript.lang
403+ vbscript = vbscript.lang
404+ xhtml = xml.lang
405+ xml = xml.lang
406+ xorg = xorg.lang
407+ y = bison.lang
408+ yacc = bison.lang
409+ yy = bison.lang
410+</pre>
411+ <p>The complete list of output formats natively supported by this version
412+of Source-highlight (3.1.4), as reported by
413+<code>--outlang-list</code>, is the following:
414+
415+<pre class="example"> docbook = docbook.outlang
416+ esc = esc.outlang
417+ html = html.outlang
418+ html-css = htmlcss.outlang
419+ htmltable = htmltable.outlang
420+ javadoc = javadoc.outlang
421+ latex = latex.outlang
422+ latexcolor = latexcolor.outlang
423+ texinfo = texinfo.outlang
424+ xhtml = xhtml.outlang
425+ xhtml-css = xhtmlcss.outlang
426+ xhtmltable = xhtmltable.outlang
427+</pre>
428+ <p class="noindent">The meaning of the suffix <code>-css</code> is explained in <a href="#Output-Language-map">Output Language map</a><a rel="footnote" href="#fn-1" name="fnd-1"><sup>1</sup></a>.
429+
430+ <p>Please, keep in mind, that I haven't tested personally all these
431+language definitions: I actually checked that the definition files are
432+syntactically correct (with the command line option <code>--check-lang</code>
433+and <code>--check-outlang</code>, <a href="#Invoking-source_002dhighlight">Invoking source-highlight</a>), but I'm
434+not sure their definition actually respects that language syntax (e.g.,
435+I've put up together some language definitions by searching for
436+information in the Internet, but I've never programmed in that
437+language). So, if you find that a language definition is not precise,
438+please let me know. Moreover, if you have a program example in a
439+language that's not included in the <samp><span class="file">tests</span></samp> directory, please send
440+it to me so that I can include it in the test suite.
441+
442+<div class="node">
443+<a name="The-program-source-highlight-settings"></a>
444+<a name="The-program-source_002dhighlight_002dsettings"></a>
445+<p><hr>
446+Next:&nbsp;<a rel="next" accesskey="n" href="#Notes-on-some-languages">Notes on some languages</a>,
447+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Supported-languages">Supported languages</a>,
448+Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>
449+
450+</div>
451+
452+<h3 class="section">1.2 The program <code>source-highlight-settings</code></h3>
453+
454+<p><a name="index-source_002dhighlight_002dsettings-4"></a>Since version 3.0, GNU Source-highlight includes also the program
455+<code>source-highlight-settings</code>, which can be used to check whether
456+source-highlight will be able find its language definition files, and
457+other configuration files, and in case, to store the correct settings in
458+a configuration file, in the user home directory.
459+
460+ <p><a name="index-source_002dhighlight_002econf-5"></a>In particular, the stored configuration file will be called
461+<samp><span class="file">source-highlight.conf</span></samp> and stored in
462+<samp><span class="file">$HOME/.source-highlight/</span></samp>.
463+
464+ <p><a name="index-g_t_0040code_007b_002d_002ddata_002ddir_007d-6"></a>For the moment, this file only stores the default value for
465+the <code>--data-dir</code> option.
466+
467+ <p>The user can always override the contents of this configuration file,
468+and the default hardcoded value, by using the environment variable
469+<a name="index-g_t_0040code_007bSOURCE_005fHIGHLIGHT_005fDATADIR_007d-7"></a><code>SOURCE_HIGHLIGHT_DATADIR</code>.
470+
471+<div class="node">
472+<a name="Notes-on-some-languages"></a>
473+<p><hr>
474+Next:&nbsp;<a rel="next" accesskey="n" href="#Using-source_002dhighlight-as-a-simple-formatter">Using source-highlight as a simple formatter</a>,
475+Previous:&nbsp;<a rel="previous" accesskey="p" href="#The-program-source_002dhighlight_002dsettings">The program source-highlight-settings</a>,
476+Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>
477+
478+</div>
479+
480+<h3 class="section">1.3 Notes on some languages</h3>
481+
482+<p>In this section I'd like to go into details on the highlighting of some
483+specific programming languages. These notes might be useful when the
484+highlighted language has some &ldquo;dialects&rdquo; that might require some
485+further specification at the command line (e.g., to select a specific
486+dialect).
487+
488+<ul class="menu">
489+<li><a accesskey="1" href="#Fortran">Fortran</a>
490+<li><a accesskey="2" href="#Perl">Perl</a>
491+</ul>
492+
493+<div class="node">
436494 <a name="Fortran"></a>
437-<a name="SEC5"></a>
438-<table cellpadding="1" cellspacing="1" border="0">
439-<tr><td valign="middle" align="left">[<a href="#SEC4" title="Previous section in reading order"> &lt; </a>]</td>
440-<td valign="middle" align="left">[<a href="#SEC6" title="Next section in reading order"> &gt; </a>]</td>
441-<td valign="middle" align="left"> &nbsp; </td>
442-<td valign="middle" align="left">[<a href="#SEC1" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
443-<td valign="middle" align="left">[<a href="#SEC4" title="Up section"> Up </a>]</td>
444-<td valign="middle" align="left">[<a href="#SEC9" title="Next chapter"> &gt;&gt; </a>]</td>
445-<td valign="middle" align="left"> &nbsp; </td>
446-<td valign="middle" align="left"> &nbsp; </td>
447-<td valign="middle" align="left"> &nbsp; </td>
448-<td valign="middle" align="left"> &nbsp; </td>
449-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
450-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
451-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
452-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
453-</tr></table>
454-<h3 class="subsection"> 1.3.1 Fortran </h3>
455-
456-<p>Toby Whiteが私に説明したように、Fortranは別々の「フレイバー」に分かれた状態になっている。
457-ソースファイル内でのカラムの位置によって意味が変わってしまう文字がある固定フォーマットと、そういうことの無いフリーフォーマットである。
458-たとえば、前者は、<code>*</code>と<code>c</code>によってコマンドライン(訳注:コメント行の間違い?)が開始されるが、それはその文字が最初のカラムで指定されたときだけだ(一方、フリーフォーマットではこういうことは無い)。
459-</p>
460-<p>デフォルトでは、Fortranファイルはフリーフォマットを想定している。
461-固定フォーマットが使いたい場合には、<code>--src-lang</code>というコマンドラインオプションで<code>fortran-fixed</code>を指定する必要がある。
462-</p>
463-<hr size="6">
495+<p><hr>
496+Next:&nbsp;<a rel="next" accesskey="n" href="#Perl">Perl</a>,
497+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Notes-on-some-languages">Notes on some languages</a>,
498+Up:&nbsp;<a rel="up" accesskey="u" href="#Notes-on-some-languages">Notes on some languages</a>
499+
500+</div>
501+
502+<h4 class="subsection">1.3.1 Fortran</h4>
503+
504+<p><a name="index-Fortran-8"></a>As Toby White explained to me, Fortran comes into different &ldquo;flavors&rdquo;:
505+a fixed-format, where some characters have a different semantics
506+depending on their column position in the source file, and a free-format
507+where this is not true. For instance, in the former, <code>*</code> and
508+<code>c</code> start a command line, but only if they are specified in the
509+first column (while this is not true in the free-format).
510+
511+ <p>By default, the free-format is assumed for Fortran files; if you want to
512+use the fixed-format, you need to specify <code>fortran-fixed</code> at
513+the <code>--src-lang</code> command line option.
514+
515+<div class="node">
464516 <a name="Perl"></a>
465-<a name="SEC6"></a>
466-<table cellpadding="1" cellspacing="1" border="0">
467-<tr><td valign="middle" align="left">[<a href="#SEC5" title="Previous section in reading order"> &lt; </a>]</td>
468-<td valign="middle" align="left">[<a href="#SEC7" title="Next section in reading order"> &gt; </a>]</td>
469-<td valign="middle" align="left"> &nbsp; </td>
470-<td valign="middle" align="left">[<a href="#SEC1" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
471-<td valign="middle" align="left">[<a href="#SEC4" title="Up section"> Up </a>]</td>
472-<td valign="middle" align="left">[<a href="#SEC9" title="Next chapter"> &gt;&gt; </a>]</td>
473-<td valign="middle" align="left"> &nbsp; </td>
474-<td valign="middle" align="left"> &nbsp; </td>
475-<td valign="middle" align="left"> &nbsp; </td>
476-<td valign="middle" align="left"> &nbsp; </td>
477-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
478-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
479-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
480-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
481-</tr></table>
482-<h3 class="subsection"> 1.3.2 Perl </h3>
483-
484-<p>Perlの文法形式、特にその正規表現の仕様は、かなり悪夢だ;-)
485-&lsquo;<tt>perl.lang</tt>&rsquo;の中で可能な限り記述してみたが、特定の正規表現で正しくハイライトされないものがあるかもしれない。
486-実は私はPerlでプログラムを書いたことがないので、あなたのPerlプログラムで正しくハイライトされていない部分があるのならば、Perlのハイライトを改善できるように私に連絡するのを躊躇わないでほしい。
487-</p>
488-<a name="IDX5"></a>
489-<p>そしてまた、Perlファイルの標準的な拡張子は<code>.pl</code>だけれども、Prologの言語定義がsource-highlightに実装されたのがPerlよりも早かったために、デフォルトでは、この拡張子はPrologファイルに割り当てられている。
490-しかし、<code>--infer-lang</code>というコマンドラインオプションを使えば、source-highlightに、入力ファイルの最初の行を調べて言語を検出させるようにすることができる(<a href="#SEC36">入力言語の検出方法</a>)。
491-Perlのハイライティングであることを明示的に指定するのに、<code>--src-lang=perl</code>というコマンドライン指定を使ってもよい。
492-</p>
493-<hr size="6">
494-<a name="g_t_7c21_5358_306a_30d5_30a9_30fc_30de_30c3_30bf_3068_3057_3066_306esource_002dhighlight_306e_4f7f_7528"></a>
495-<a name="SEC7"></a>
496-<table cellpadding="1" cellspacing="1" border="0">
497-<tr><td valign="middle" align="left">[<a href="#SEC6" title="Previous section in reading order"> &lt; </a>]</td>
498-<td valign="middle" align="left">[<a href="#SEC8" title="Next section in reading order"> &gt; </a>]</td>
499-<td valign="middle" align="left"> &nbsp; </td>
500-<td valign="middle" align="left">[<a href="#SEC1" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
501-<td valign="middle" align="left">[<a href="#SEC1" title="Up section"> Up </a>]</td>
502-<td valign="middle" align="left">[<a href="#SEC9" title="Next chapter"> &gt;&gt; </a>]</td>
503-<td valign="middle" align="left"> &nbsp; </td>
504-<td valign="middle" align="left"> &nbsp; </td>
505-<td valign="middle" align="left"> &nbsp; </td>
506-<td valign="middle" align="left"> &nbsp; </td>
507-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
508-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
509-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
510-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
511-</tr></table>
512-<h2 class="section"> 1.4 簡単なフォーマッタとしてのsource-highlightの使用 </h2>
513-
514-<p>source-highlightを入力ファイルの簡単なフォーマッタとして使うこともできる。
515-すなわち、ハイライティングをさせずに使うこともできる<a name="DOCF2" href="#FOOT2">(2)</a>。
516-</p>
517-<a name="IDX6"></a>
518-<p>これを実現するには、コマンドラインオプションの<code>--lang-def</code>を使って、入力ソースに対する言語定義ファイルとして、&lsquo;<tt>nohilite.lang</tt>&rsquo;を指定する(<a href="#SEC35"><code>source-highlight</code>の起動</a>)。
519-その言語定義は空なので、ハイライティングは実行されない。
520-だが、source-highlightは入力ファイルを指定された出力フォーマットに変換する。
521-<a href="#SEC2">サポートしている言語</a>にある入力言語の関連付けにおいて、&lsquo;<tt>nohilite.lang</tt>&rsquo;がtxtファイルと関連付けられていることに注意してほしい。
522-</p>
523-<p>たとえば、これによって、テキストファイルをHTMLやLaTeXに変換したいような場合にsource-highlightが使えるようになる。
524-出力の際、事実、source-highlightは、出力フォーマットにおいて特別な意味を持つ文字があっても正しくそれらの文字を生成するだろう。
525-</p>
526-<p>For instance, in this Texinfo manual,
517+<p><hr>
518+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Fortran">Fortran</a>,
519+Up:&nbsp;<a rel="up" accesskey="u" href="#Notes-on-some-languages">Notes on some languages</a>
520+
521+</div>
522+
523+<h4 class="subsection">1.3.2 Perl</h4>
524+
525+<p><a name="index-Perl-9"></a>Perl syntax forms, especially its regular expression specifications, are
526+quite a nightmare ;-) I tried to specify as much as possible in the
527+<samp><span class="file">perl.lang</span></samp> but some particular regular expressions might not be
528+highlighted correctly. Actually, I never programmed in Perl, so, if you
529+see that some parts of your Perl programs are not highlighted correctly,
530+please do not hesitate to contact me, so that I can improve Perl
531+highlighting.
532+
533+ <p><a name="index-g_t_0040code_007b_002d_002dinfer_002dlang_007d-10"></a>Moreover, although the standard extension for Perl files is <code>.pl</code>,
534+since the Prolog language definition was implemented in source-highlight
535+before Perl, this extension is assigned, by default, to Prolog files.
536+However, you can use <code>--infer-lang</code> command line option, so that
537+source-highlight can try to detect the language by inspecting the first
538+lines of the input file (<a href="#How-the-input-language-is-discovered">How the input language is discovered</a>);
539+you can also use <code>--src-lang=perl</code> command line specification to
540+explicitly require Perl highlighting.
541+
542+<div class="node">
543+<a name="Using-source-highlight-as-a-simple-formatter"></a>
544+<a name="Using-source_002dhighlight-as-a-simple-formatter"></a>
545+<p><hr>
546+Next:&nbsp;<a rel="next" accesskey="n" href="#Related-Software-and-Links">Related Software and Links</a>,
547+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Notes-on-some-languages">Notes on some languages</a>,
548+Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>
549+
550+</div>
551+
552+<h3 class="section">1.4 Using source-highlight as a simple formatter</h3>
553+
554+<p>You can also use source-highlight as a simple formatter of input file,
555+i.e., without performing any highlighting<a rel="footnote" href="#fn-2" name="fnd-2"><sup>2</sup></a>.
556+
557+ <p><a name="index-nohilite_002elang-11"></a>You can achieve this by using, as the language definition file for input
558+sources the file <samp><span class="file">nohilite.lang</span></samp>, using the command line option
559+<code>--lang-def</code> (<a href="#Invoking-source_002dhighlight">Invoking source-highlight</a>). Since that
560+language definition is empty, no highlighting will be performed;
561+however, source-highlight will transform the input file in the output
562+format. Note, in the input language associations in <a href="#Supported-languages">Supported languages</a>, that <samp><span class="file">nohilite.lang</span></samp> is also associated to txt files.
563+
564+ <p>This, for instance, makes source-highlight useful in cases you want to
565+transform a text file into HTML or LaTeX. During the output, in
566+fact, source-highlight will correctly generate characters that have a
567+specific meanings in the output format.
568+
569+ <p>For instance, in this Texinfo manual,
527570 if I want to insert a @ or a {
528571 I have to &ldquo;escape&rdquo; them to make them appear literally
529-since they have a special meaning in Texinfo.
530-The same holds, e.g.,
531-for <code>&lt;</code>, <code>&gt;</code> or <code>&amp;</code> in HTML.
532-If you use source-highlight,
533-it will take care of this, automatically for you.
534-これが上のセンテンスのTexinfoソースだ:
535-</p>
536-<table><tr><td>&nbsp;</td><td><pre class="example">For instance, in this Texinfo manual,
537-if I want to insert a @@ or a @{
538-I have to ``escape'' them to make them appear literally
539-since they have a special meaning in Texinfo.
540-The same holds, e.g.,
541-for @code{&lt;}, @code{&gt;} or @code{&amp;} in HTML.
542-If you use source-highlight,
543-it will take care of this, automatically for you.
544-</pre></td></tr></table>
545-<p>これは、source-highlightによってハイライト無しの単純なテキストファイルとして処理されたものだ。
546-しかし、Texinfoでフォーマットされていたので、必要なエスケープ処理が自動的に実行された。
547-このように、コードとその結果を同じドキュメントの中に簡単に挿入できる(ここでの例のように)。
548-</p>
549-<p>これは実際にsource-highlightが実行したフォーマットだ。
550-コメントを除いて、これが、手作業でやる場合に基本的に自分で書かなければならないことである:
551-</p>
552-<table><tr><td>&nbsp;</td><td><pre class="example">@c Generator: GNU source-highlight, by Lorenzo Bettini, http://www.gnu.org/software/src-highlite
553-@example
554-For instance, in this Texinfo manual,
555-if I want to insert a @@@@ or a @@@{
556-I have to ``escape'' them to make them appear literally
557-since they have a special meaning in Texinfo.
558-The same holds, e.g.,
559-for @@code@{&lt;@}, @@code@{&gt;@} or @@code@{&amp;@} in HTML.
572+since they have a special meaning in Texinfo.
573+The same holds, e.g.,
574+for <code>&lt;</code>, <code>&gt;</code> or <code>&amp;</code> in HTML.
560575 If you use source-highlight,
561-it will take care of this, automatically for you.
562-@end example
563-</pre></td></tr></table>
564-<a name="IDX7"></a>
565-<p>特定の入力言語をsource-highlightが処理しない場合に、さらに<code>--failsafe</code>オプションを使うことができ(<a href="#SEC35"><code>source-highlight</code>の起動</a>)、そしてその場合はハイライトは実行されないが、source-highlightは入力ファイルを出力フォーマットに変換する。
566-</p>
567-<a name="IDX8"></a>
568-<p>だが、入力言語が確認できなかった場合には、&lsquo;<tt>default.lang</tt>&rsquo;が使われる。
569-これは空の言語定義ファイルだが、これをカスタマイズしたいと考えることもあるかもしれない。
570-</p>
571-<hr size="6">
572-<a name="g_t_95a2_9023_3059_308b_30bd_30d5_30c8_30a6_30a7_30a2_3068_30ea_30f3_30af"></a>
573-<a name="SEC8"></a>
574-<table cellpadding="1" cellspacing="1" border="0">
575-<tr><td valign="middle" align="left">[<a href="#SEC7" title="Previous section in reading order"> &lt; </a>]</td>
576-<td valign="middle" align="left">[<a href="#SEC9" title="Next section in reading order"> &gt; </a>]</td>
577-<td valign="middle" align="left"> &nbsp; </td>
578-<td valign="middle" align="left">[<a href="#SEC1" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
579-<td valign="middle" align="left">[<a href="#SEC1" title="Up section"> Up </a>]</td>
580-<td valign="middle" align="left">[<a href="#SEC9" title="Next chapter"> &gt;&gt; </a>]</td>
581-<td valign="middle" align="left"> &nbsp; </td>
582-<td valign="middle" align="left"> &nbsp; </td>
583-<td valign="middle" align="left"> &nbsp; </td>
584-<td valign="middle" align="left"> &nbsp; </td>
585-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
586-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
587-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
588-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
589-</tr></table>
590-<h2 class="section"> 1.5 関連するソフトウェアとリンク </h2>
591-
592-<p>ここに、バックエンドとして使ったり(つまりsource-highlightへのインターフェイスを用意している)、その特徴の一部を使ったり(たとえば、定義ファイル)という意味において、source-highlightと関連しているソフトウェアを挙げていく:
593-</p>
594-<ul class="toc">
595-<li>
596-<a name="IDX9"></a>
597-<a name="IDX10"></a>
598-Source-highlight-qtは、GNU Source-Highlightライブラリに依存して、Qtドキュメントの中でシンタックスのハイライティングを実行するためのライブラリである。
599-このライブラリは、qtの抽象クラスのQSyntaxHighlighterの実装を提供していて、Qt3とQt4の両方に対応している。
600-
601-<p><a href="http://srchiliteqt.sourceforge.net">http://srchiliteqt.sourceforge.net</a>.
602-</p>
603-</li><li>
604-<a name="IDX11"></a>
605-<a name="IDX12"></a>
606-QSource-Highlightは、GNU Source-HighlightのQt4フロントエンドだ(Source-Highlight-Qtライブラリに依存している)。
607-コードをオンザフライでハイライトすることができ、source-highlightがサポートしている全てのフォーマットでハイライトされた出力を得ることができる(たとえば、HTML、LaTeX、Texinfoなど)。
608-それから、フォーマットされた出力をコピーし、それをペーストできる(たとえば、ブログなどに)。
609-またファイルに保存することもできる。
610-いくつかの出力フォーマット(たとえば、HTML、XHTMLなど)については、ハイライトされた出力のプレビューを見ることができる。
611-
612-<p><a href="http://qsrchilite.sourceforge.net">http://qsrchilite.sourceforge.net</a>.
613-</p>
614-</li><li>
615-<a name="IDX13"></a>
616-<a name="IDX14"></a>
617-SourceHighlightIDEは、新たなsource-highlight用の言語定義を開発したりデバッグしたりするために私が書いた小さなIDE(KDE用)だ。
618-
619-<p><a href="http://srchighliteide.sourceforge.net">http://srchighliteide.sourceforge.net</a>.
620-</p>
621-</li><li>
622-<a name="IDX15"></a>
623-<a name="IDX16"></a>
624-Martin Gebertがsource-highlightプログラムのKDEインターフェイスを実装した(彼は素晴しい仕事をしてくれた)。
625-<em>Ksrc2highlight</em>というものだ。
626-試してみたい場合は以下:
627-
628-<p><a href="http://www.mgebert.de/Ksrc2highlight">http://www.mgebert.de/Ksrc2highlight</a>.
629-</p>
630-</li><li>
631-<a name="IDX17"></a>
632-java2htmlのJavaバージョンもある。
633-以下のところにある。
634-
635-<p><a href="http://www.generationjava.com/projects/Java2Html.shtml">http://www.generationjava.com/projects/Java2Html.shtml</a>.
636-</p>
637-</li><li>
638-このウェブサイトはオンラインでハイライティングをするためのsource-highlightのインターフェイスを提供している。
639-
640-<p><a href="http://www.alaide.com/outils_colorsyntaxe.php">http://www.alaide.com/outils_colorsyntaxe.php</a>
641-</p>
642-</li><li>
643-<a name="IDX18"></a>
644-SHJSは、HTMLドキュメントの中でソースコード片をハイライトするJavaScriptプログラムだ。
645-SHJSを使ったドキュメントはウェブブラウザによってクライアントサイドでハイライトされる。
646-SHJSはSource-highlightの言語定義を使用している。
647-
648-<p><a href="http://shjs.sourceforge.net">http://shjs.sourceforge.net</a>
649-</p>
650-</li><li>
651-<a name="IDX19"></a>
652-Code2blogは、source-highlightのpyGTKフロントエンドで、ソースコードをHTMLへ簡単に変換するためのものだ。
653-
654-<p><a href="http://code.google.com/p/code2blog">http://code.google.com/p/code2blog</a>
655-</p>
656-</li><li>
657-<a name="IDX20"></a>
658-Andy Buckleyは、source-highlightのラッパを書いた。
659-これは、ウェブページの中でソースコードをオンザフライにハイライティングするApacheフィルタとして使うことができる。
660-
661-<p><a href="http://www.insectnation.org/projects/filter-src-highlight">http://www.insectnation.org/projects/filter-src-highlight</a>
662-</p>
663-</li><li>
664-<a name="IDX21"></a>
665-Roger Nilssonは、RapidWeaverというOSX用のポピュラーなウェブデザインアプリケーションで使えるsource-highlightのフロントエンドを書いた。
666-このフロントエンドはHigh-Lightと言うもので、RapidWeaverの内部で、ユーザが簡単にシンタックスが色付けされたコードを追加することができるようにするものだ。
667-
668-<p><a href="http://nilrogsplace.se/webdesign/rapidweaver/plugins/high-light/index_en.html">http://nilrogsplace.se/webdesign/rapidweaver/plugins/high-light/index_en.html</a>
669-</p>
670-</li><li>
671-<a name="IDX22"></a>
672-Mauricio Zepedaは、自動的にファイルをハイライトしてFirefoxでそれを表示するスクリプトについて、彼のブログに記事を書いた。
673-
674-<p><a href="http://chillorb.com/?p=122">http://chillorb.com/?p=122</a>
675-</p>
676-</li><li>
677-<a name="IDX23"></a>
678-<a name="IDX24"></a>
679-Jason Blevinsは、ソースコード片やファイル全体のシンタックスハイライティングを有効にするIkiwiki用のプラグインを作成した。
680-
681-<p><a href="http://jblevins.org/projects/ikiwiki/code">http://jblevins.org/projects/ikiwiki/code</a>
682-</p>
683-</li><li>
684-<a name="IDX25"></a>
685-<a name="IDX26"></a>
686-Pascal Bleserは、プロセスを生成したり、source-highlightのCGIを使うのではなく、PHPから直接GNU source-highlightライブラリを使うPHP拡張を作成した。
687-
688-<p><a href="http://code.google.com/p/php-source-highlight/">http://code.google.com/p/php-source-highlight/</a>
689-</p>
576+it will take care of this, automatically for you.
577+This is the Texinfo source of the above sentence:
578+
579+<!-- Generator: GNU source-highlight, by Lorenzo Bettini, http://www.gnu.org/software/src-highlite -->
580+<pre class="example"> For instance, in this Texinfo manual,
581+ if I want to insert a @@ or a @{
582+ I have to ``escape'' them to make them appear literally
583+ since they have a special meaning in Texinfo.
584+ The same holds, e.g.,
585+ for @code{&lt;}, @code{&gt;} or @code{&amp;} in HTML.
586+ If you use source-highlight,
587+ it will take care of this, automatically for you.
588+</pre>
589+ <p class="noindent">This was processed by source-highlight as a simple text file, without no
590+highlighting; however since it was formatted in Texinfo, all the
591+necessary escaping was automatically performed. This way, it is very
592+easy to insert, in the same document, a code, and its result (as in this
593+example).
594+
595+ <p>This is actually the formatting performed by source-highlight; except
596+for the comment, this is basically what you should have written yourself
597+to do all the escaping stuff manually:
598+
599+<!-- Generator: GNU source-highlight, by Lorenzo Bettini, http://www.gnu.org/software/src-highlite -->
600+<pre class="example"> @c Generator: GNU source-highlight, by Lorenzo Bettini, http://www.gnu.org/software/src-highlite
601+ @example
602+ For instance, in this Texinfo manual,
603+ if I want to insert a @@@@ or a @@@{
604+ I have to ``escape'' them to make them appear literally
605+ since they have a special meaning in Texinfo.
606+ The same holds, e.g.,
607+ for @@code@{&lt;@}, @@code@{&gt;@} or @@code@{&amp;@} in HTML.
608+ If you use source-highlight,
609+ it will take care of this, automatically for you.
610+ @end example
611+</pre>
612+ <p><a name="index-failsafe-12"></a>In case source-highlight does not handle a specific input language, you
613+can still use the option <code>--failsafe</code> (<a href="#Invoking-source_002dhighlight">Invoking source-highlight</a>) and also in that case no highlighting will be
614+performed, but source-highlight will transform the input file in the
615+output format.
616+
617+ <p><a name="index-default_002elang-13"></a>Note, however, that if the input language cannot be established, the
618+<samp><span class="file">default.lang</span></samp> will be used: an empty language definition file
619+which you might want to customize.
620+
621+<div class="node">
622+<a name="Related-Software-and-Links"></a>
623+<p><hr>
624+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Using-source_002dhighlight-as-a-simple-formatter">Using source-highlight as a simple formatter</a>,
625+Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>
690626
691-</li></ul>
627+</div>
628+
629+<h3 class="section">1.5 Related Software and Links</h3>
630+
631+<p>Here we list some software related to source-highlight in the sense that
632+it uses it as a backend (i.e., provides an interface to
633+source-highlight) or it uses some of its features (e.g., definition
634+files):
635+
636+ <ul>
637+<li><a name="index-Source_002dHighlight_002dQt-14"></a><a name="index-Qt-15"></a>Source-highlight-qt is a library for performing syntax highlighting in
638+Qt documents by relying on GNU Source-Highlight library. This library
639+provides an implementation of the qt abstract class QSyntaxHighlighter
640+class, and it deals both with Qt3 and Qt4.
641+
642+ <p><a href="http://srchiliteqt.sourceforge.net">http://srchiliteqt.sourceforge.net</a>.
643+
644+ <li><a name="index-QSource_002dHighlight-16"></a><a name="index-Qt-17"></a>QSource-Highlight is a Qt4 front-end for GNU Source-Highlight (it relies
645+on the library Source-Highlight-Qt). You can highlight your code on the
646+fly, and have the highlighted output in all the formats supported by
647+source-highlight (e.g., HTML, LaTeX, Texinfo, etc.). You can then copy
648+the formatted output and paste it (e.g., in your blog), or save it to a
649+file. A preview of the highlighted output is available for some output
650+formats (e.g., HTML, XHTML, etc.).
651+
652+ <p><a href="http://qsrchilite.sourceforge.net">http://qsrchilite.sourceforge.net</a>.
653+
654+ <li><a name="index-SourceHighlightIDE-18"></a><a name="index-KDE-19"></a>SourceHighlightIDE is a small IDE (based on Qt4 and
655+Source-highlight-qt) I wrote for developing
656+and debugging new language definitions for source-highlight:
657+
658+ <p><a href="http://srchighliteide.sourceforge.net">http://srchighliteide.sourceforge.net</a>.
659+
660+ <li><a name="index-Ksrc2highlight-20"></a><a name="index-KDE-21"></a>Martin Gebert implemented a KDE interface to source-highlight programs
661+(and he did a wonderful job!), and it is called <em>Ksrc2highlight</em>;
662+if you want to test it:
663+
664+ <p><a href="http://www.mgebert.de/Ksrc2highlight">http://www.mgebert.de/Ksrc2highlight</a>.
665+
666+ <li><a name="index-java2html-22"></a>There's also a Java version of java2html, you can find it at
667+
668+ <p><a href="http://www.generationjava.com/projects/Java2Html.shtml">http://www.generationjava.com/projects/Java2Html.shtml</a>.
669+
670+ <li>This web site provides a web interface to source-highlight
671+so that you can highlight your code on-line:
672+
673+ <p><a href="http://www.alaide.com/outils_colorsyntaxe.php">http://www.alaide.com/outils_colorsyntaxe.php</a>
674+
675+ <li><a name="index-SHJS-23"></a>SHJS is a JavaScript program that highlights source code passages in
676+HTML documents. Documents using SHJS are highlighted on the client side
677+by the web browser. SHJS uses language definitions from
678+Source-highlight.
679+
680+ <p><a href="http://shjs.sourceforge.net">http://shjs.sourceforge.net</a>
681+
682+ <li><a name="index-code2blog-24"></a>Code2blog is a pyGTK front-end to source-highlight for easy conversion
683+from source code to HTML.
684+
685+ <p><a href="http://code.google.com/p/code2blog">http://code.google.com/p/code2blog</a>
686+
687+ <li><a name="index-Apache-25"></a>Andy Buckley wrote a wrapper around source-highlight, which can be used
688+as an Apache filter to highlight source code in Web pages on the fly.
689+
690+ <p><a href="http://www.insectnation.org/projects/filter-src-highlight">http://www.insectnation.org/projects/filter-src-highlight</a>
691+
692+ <li><a name="index-RapidWeaver-26"></a>Roger Nilsson wrote a frontend for source-highlight that is used in a
693+popular webdesign app for OSX called RapidWeaver. The frontend is called
694+High-Light and allows users to easily add syntax-colored code inside
695+RapidWeaver.
696+
697+ <p><a href="http://nilrogsplace.se/webdesign/rapidweaver/plugins/high-light/index_en.html">http://nilrogsplace.se/webdesign/rapidweaver/plugins/high-light/index_en.html</a>
698+
699+ <li><a name="index-Firefox-27"></a>Mauricio Zepeda published in his blog an article with a script
700+to automatically highlight a file and show it in Firefox:
701+
702+ <p><a href="http://chillorb.com/?p=122">http://chillorb.com/?p=122</a>
703+
704+ <li><a name="index-Wiki-28"></a><a name="index-Ikiwiki-29"></a>Jason Blevins made a plugin for Ikiwiki that enables syntax highlighting
705+of source code fragments and whole files via source-highlight.
706+
707+ <p><a href="http://jblevins.org/projects/ikiwiki/code">http://jblevins.org/projects/ikiwiki/code</a>
708+
709+ <li><a name="index-Wiki-30"></a><a name="index-Php-31"></a>Pascal Bleser created a PHP extension that uses the GNU source-highlight
710+library directly from PHP, instead of relying on spawning a process or
711+using the source-highlight CGI.
712+
713+ <p><a href="http://code.google.com/p/php-source-highlight/">http://code.google.com/p/php-source-highlight/</a>
714+
715+ <li><a name="index-SIP-32"></a><a name="index-Python-33"></a><a name="index-PyQt-34"></a>Roberto Alsina made a partial python binding using SIP so
716+that you can use Source-Highlight-Qt in PyQt programs.
717+
718+ <p><a href="http://marave.googlecode.com/svn/trunk/marave/highlight/">http://marave.googlecode.com/svn/trunk/marave/highlight/</a>
719+
720+ <li><a name="index-Perl-35"></a>A perl binding for source-highlight is available at CPAN:
721+
722+ <p><a href="http://search.cpan.org/perldoc?Syntax::SourceHighlight">http://search.cpan.org/perldoc?Syntax::SourceHighlight</a>
723+
724+ <li><a name="index-Pastebin-36"></a>Danijel Tasov wrote a pastebin service based on
725+perl source-highlight binding:
726+
727+ <p><a href="http://pb.rbfh.de">http://pb.rbfh.de</a>
728+
729+ </ul>
730+
731+<div class="node">
732+<a name="Installation"></a>
733+<p><hr>
734+Next:&nbsp;<a rel="next" accesskey="n" href="#Copying">Copying</a>,
735+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Introduction">Introduction</a>,
736+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
692737
738+</div>
693739
694-<hr size="6">
695-<a name="g_t_30a4_30f3_30b9_30c8_30fc_30eb"></a>
696-<a name="SEC9"></a>
697-<table cellpadding="1" cellspacing="1" border="0">
698-<tr><td valign="middle" align="left">[<a href="#SEC8" title="Previous section in reading order"> &lt; </a>]</td>
699-<td valign="middle" align="left">[<a href="#SEC10" title="Next section in reading order"> &gt; </a>]</td>
700-<td valign="middle" align="left"> &nbsp; </td>
701-<td valign="middle" align="left">[<a href="#SEC1" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
702-<td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td>
703-<td valign="middle" align="left">[<a href="#SEC19" title="Next chapter"> &gt;&gt; </a>]</td>
704-<td valign="middle" align="left"> &nbsp; </td>
705-<td valign="middle" align="left"> &nbsp; </td>
706-<td valign="middle" align="left"> &nbsp; </td>
707-<td valign="middle" align="left"> &nbsp; </td>
708-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
709-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
710-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
711-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
712-</tr></table>
713-<h1 class="chapter"> 2. インストール </h1>
714-
715-<p>ビルドやインストールの詳細については&lsquo;<tt>INSTALL</tt>&rsquo;を見てほしい。
716-そもそも、ソースで入手したLinuxソフトウェアをコンパイルするのに慣れているのであれば、いつもの手順を単に辿ればよい。
717-すなわち、ディレクトリにダウンロードしたファイルをuntarして、それから以下のようにする:
718-</p>
719-<table><tr><td>&nbsp;</td><td><pre class="example">cd &lt;source code main directory&gt;
720-./configure
721-make
722-make install
723-</pre></td></tr></table>
724-
725-<p>しかし、これを実行する前には、source-highlightをビルドするのに必要なものが全てそろっているかチェックしてほしい。
726-<a href="#SEC13">source-highlightのビルドに必要なもの</a>
727-</p>
728-<p>注意:./configureの<code>--prefix</code>オプションで違うインストールディレクトリを指定した(たとえば、<code>./configure --prefix=&lt;your home&gt;</code>)のでない限り、<code>make install</code>の実行にはrootになっている必要がある。
729-</p>
730-<p>configureスクリプトに渡すことのできるオプションが全て見るのには、<code>./configure --help</code>を実行してほしい。
731-</p>
732-<a name="IDX27"></a>
733-
734-<p>各ファイルは以下のディレクトリへインストールされる:
735-</p>
736-<dl compact="compact">
737-<dt> <code>実行ファイル</code></dt>
738-<dd><p> <code>prefix/bin</code>
739-</p></dd>
740-<dt> <code>ドキュメントと出力例</code></dt>
741-<dd><p> <code>prefix/share/doc/source-highlight</code>
742-</p></dd>
743-<dt> <code>ライブラリの例</code></dt>
744-<dd><p> <code>prefix/share/doc/source-highlight/examples</code>
745-</p></dd>
746-<dt> <code>ライブラリAPIのドキュメンテーション</code></dt>
747-<dd><p> <code>prefix/share/doc/source-highlight/api</code>
748-</p></dd>
749-<dt> <code>設定ファイル</code></dt>
750-<dd><p> <code>prefix/share/source-highlight</code>
751-</p></dd>
740+<h2 class="chapter">2 Installation</h2>
741+
742+<p><a name="index-installation-37"></a>
743+See the file <samp><span class="file">INSTALL</span></samp> for detailed building and installation
744+instructions; anyway if you're used to compiling Linux software that
745+comes with sources you may simply follow the usual procedure, i.e., untar
746+the file you downloaded in a directory and then:
747+
748+<pre class="example"> cd &lt;source code main directory&gt;
749+ ./configure
750+ make
751+ make install
752+</pre>
753+ <p>However, before you do this, please check that you have everything that
754+is needed to build source-highlight, <a href="#What-you-need-to-build-source_002dhighlight">What you need to build source-highlight</a>.
755+
756+ <p>Note: unless you specify a different install directory by
757+<code>--prefix</code> option of
758+configure (e.g. <code>./configure --prefix=&lt;your home&gt;</code>),
759+you must be root to run <code>make install</code>.
760+
761+ <p>You may want to run <code>./configure --help</code> to see all the possible
762+options that can be passed to the configuration script.
763+
764+ <p><a name="index-directories-38"></a>Files will be installed in the following directories:
765+
766+ <dl>
767+<dt><code>Executables</code><dd> <code>prefix/bin</code>
768+<br><dt><code>docs and output examples</code><dd> <code>prefix/share/doc/source-highlight</code>
769+<br><dt><code>library examples</code><dd> <code>prefix/share/doc/source-highlight/examples</code>
770+<br><dt><code>library API documentation</code><dd> <code>prefix/share/doc/source-highlight/api</code>
771+<br><dt><code>conf files</code><dd> <code>prefix/share/source-highlight</code>
752772 </dl>
753773
754-<p>prefixのデフォルト値は<code>/usr/local</code>だが、configureの<code>--prefix</code>オプションで変更してもよい。
755-<code>configure</code>のオプションについてさらに詳しくは、<code>configure --help</code>を実行してほしい。
756-</p>
757-<a name="IDX28"></a>
758-<p>Tiziano Mullerは、source-highlight用のbashの補完用の設定ファイルを書いた。
759-これは<code>sysconfdir/bash_completion.d</code>というディレクトリにデフォルトでインストールされる。
760-<code>sysconfdir</code>はデフォルトで<code>prefix/etc</code>になっている。
761-しかし通常、bashの補完スクリプトが設定ファイルを探すディレクトリは、<code>/etc/bash_completion.d</code>だ。
762-なので、configureスクリプトのコマンドラインオプションの<code>--with-bash-completion</code>を使うことで、このディレクトリを明示的に指定することをお勧めする。
763-</p>
764-<a name="IDX29"></a>
765-<a name="IDX30"></a>
766-<a name="IDX31"></a>
767-<p>Source-highlightライブラリのAPIドキュメンテーションをビルドしてインストールしたい場合には、<code>--with-doxygen</code>というオプションを付けて<code>configure</code>を実行する必要があるが、このドキュメンテーションをビルドするのに<em>Doxygen</em> <a href="http://www.doxygen.org">http://www.doxygen.org</a>というプログラムが必要となる。
768-ドキュメンテーションは次のディレクトリにインストールされる。
769-</p>
770-<dl compact="compact">
771-<dt> <code>ライブラリAPIドキュメンテーション</code></dt>
772-<dd><p> <code>prefix/share/doc/source-highlight/api</code>
773-</p></dd>
774+ <p>Default value for prefix is <code>/usr/local</code>
775+but you may change it with <code>--prefix</code>
776+option to configure. For further <code>configure</code> options, you
777+can run <code>configure --help</code>.
778+
779+ <p><a name="index-bash-completion-39"></a>Tiziano Muller wrote a bash completion configuration file for
780+source-highlight; this will be installed by default in the directory
781+<code>sysconfdir/bash_completion.d</code>, where <code>sysconfdir</code> defaults to
782+<code>prefix/etc</code>; however, typically, the directory where the bash
783+completion script searches for configuration file is
784+<code>/etc/bash_completion.d</code>. Thus, we suggest you explicitly specify
785+this directory with the configuration script command line option
786+<code>--with-bash-completion</code>.
787+
788+ <p><a name="index-library-40"></a><a name="index-g_t_0040code_007b_002d_002dwith_002ddoxygen_007d-41"></a><a name="index-doxygen-42"></a>If you want to build and install the API documentation of
789+Source-highlight library, you need to run <code>configure</code> with the
790+option <code>--with-doxygen</code>, but you need the program <em>Doxygen</em>,
791+<a href="http://www.doxygen.org">http://www.doxygen.org</a>, to build the documentation.
792+The documentation will be installed in the following directory:
793+
794+ <dl>
795+<dt><code>Library API documentation</code><dd> <code>prefix/share/doc/source-highlight/api</code>
774796 </dl>
775797
798+ <p><a name="index-java2html-43"></a><a name="index-cpp2html-44"></a>NOTE: Originally, instead of Source-highlight, there were two
799+separate programs, namely <em>GNU java2html</em> and <em>GNU cpp2html</em>.
800+There are two shell scripts with the same name that will be installed
801+together with Source-highlight in order to facilitate the migration
802+(however their use is not advised and it is deprecated).
803+
804+<ul class="menu">
805+<li><a accesskey="1" href="#Building-with-qmake">Building with qmake</a>
806+<li><a accesskey="2" href="#Download">Download</a>
807+<li><a accesskey="3" href="#Anonymous-Git-Checkout">Anonymous Git Checkout</a>
808+<li><a accesskey="4" href="#What-you-need-to-build-source_002dhighlight">What you need to build source-highlight</a>
809+<li><a accesskey="5" href="#Tips-on-installing-Boost-Regex-library">Tips on installing Boost Regex library</a>
810+<li><a accesskey="6" href="#Patching-from-a-previous-version">Patching from a previous version</a>
811+<li><a accesskey="7" href="#Using-source_002dhighlight-with-less">Using source-highlight with less</a>
812+<li><a accesskey="8" href="#Using-source_002dhighlight-as-a-CGI">Using source-highlight as a CGI</a>
813+<li><a accesskey="9" href="#Building-_002erpm">Building .rpm</a>
814+</ul>
815+
816+<div class="node">
817+<a name="Building-with-qmake"></a>
818+<p><hr>
819+Next:&nbsp;<a rel="next" accesskey="n" href="#Download">Download</a>,
820+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Installation">Installation</a>,
821+Up:&nbsp;<a rel="up" accesskey="u" href="#Installation">Installation</a>
822+
823+</div>
776824
777-<a name="IDX32"></a>
778-<a name="IDX33"></a>
779-<p>注意:もともとは、Source-highlightではなく、<em>GNU java2html</em>と<em>GNU cpp2html</em>という名前の、二つの別個のプログラムであった。
780-移行を容易にするために、Source-highlightと一緒に同名のシェルスクリプトが二つインストールされる(しかし、それを使うのはお勧めしない。deprecatedだ)。
781-</p>
782-<table class="menu" border="0" cellspacing="0">
783-<tr><td align="left" valign="top"><a href="#SEC10">2.1 qmakeでのビルド</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
784-</td></tr>
785-<tr><td align="left" valign="top"><a href="#SEC11">2.2 ダウンロード</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
786-</td></tr>
787-<tr><td align="left" valign="top"><a href="#SEC12">2.3 Anonymous Git Checkout</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
788-</td></tr>
789-<tr><td align="left" valign="top"><a href="#SEC13">2.4 source-highlightのビルドに必要なもの</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
790-</td></tr>
791-<tr><td align="left" valign="top"><a href="#SEC14">2.5 Boost Regexライブラリのインストールに関するTips</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
792-</td></tr>
793-<tr><td align="left" valign="top"><a href="#SEC15">2.6 前のバージョンからのパッチ</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
794-</td></tr>
795-<tr><td align="left" valign="top"><a href="#SEC16">2.7 lessでのsource-highlightの使用</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
796-</td></tr>
797-<tr><td align="left" valign="top"><a href="#SEC17">2.8 source-highlightのCGIとして使用</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
798-</td></tr>
799-<tr><td align="left" valign="top"><a href="#SEC18">2.9 .rpmのビルド</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
800-</td></tr>
801-</table>
802-
803-<hr size="6">
804-<a name="qmake_3067_306e_30d3_30eb_30c9"></a>
805-<a name="SEC10"></a>
806-<table cellpadding="1" cellspacing="1" border="0">
807-<tr><td valign="middle" align="left">[<a href="#SEC9" title="Previous section in reading order"> &lt; </a>]</td>
808-<td valign="middle" align="left">[<a href="#SEC11" title="Next section in reading order"> &gt; </a>]</td>
809-<td valign="middle" align="left"> &nbsp; </td>
810-<td valign="middle" align="left">[<a href="#SEC9" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
811-<td valign="middle" align="left">[<a href="#SEC9" title="Up section"> Up </a>]</td>
812-<td valign="middle" align="left">[<a href="#SEC19" title="Next chapter"> &gt;&gt; </a>]</td>
813-<td valign="middle" align="left"> &nbsp; </td>
814-<td valign="middle" align="left"> &nbsp; </td>
815-<td valign="middle" align="left"> &nbsp; </td>
816-<td valign="middle" align="left"> &nbsp; </td>
817-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
818-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
819-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
820-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
821-</tr></table>
822-<h2 class="section"> 2.1 qmakeでのビルド </h2>
823-
824-<p>バージョン3.1.2からは、Qtライブラリ(<a href="http://qt.nokia.com">http://qt.nokia.com</a>)のビルドツールである<code>qmake</code>を使ってもSource-highlightをビルドすることができるようになった。
825-これにより、Unixシェルを持たないWindowsベースのシステム上でもSource-highlightをビルドできるようになり、特に、
826-<a name="IDX34"></a>
827-Microsoft MSVCコンパイラでもSource-highlightがビルドできるようになった。
828-このやり方はUnixシェルが無かったり、あるいは、MSVCコンパイラを本当に使う必要がある場合にだけ使うべきだ(たとえば、MSVCベースのプログラムで使うのにSource-highlight libraryをビルドしたい場合)。(訳注:原文に閉じカッコが見当たらないのでここに入れてみた)
829-<a name="IDX35"></a>
830-さらにboost regexライブラリも必要で、MSVCを使う場合は、このライブラリのインストールパッケージが<a href="http://www.boostpro.com">http://www.boostpro.com</a>で手に入る。
831-</p>
832-<p>このビルドメカニズムはまだ実験的なもので、MSVCを使うときには、Source-highlight libraryの静的バージョンだけをビルドできる(.dllではない)。
833-<a name="IDX36"></a>
834-また、MinGWコンパイラ(<a href="http://www.mingw.org">http://www.mingw.org</a>)があって(たとえば、QtのWindowsディストリビューションと一緒に来るものがある)、
835-<a name="IDX37"></a>
836-Msys(<a href="http://www.mingw.org/wiki/MSYS">http://www.mingw.org/wiki/MSYS</a>)が無いような場合には、この方法を使うこともできる。
837-そうなければ、やはり<code>configure</code>ベースのメカニズムを使うべきだ。
838-</p>
839-<p><code>qmake</code>を使うとき、ビルドの際に指定できるオプション(おまけにqmakeを使うときには普通使うもの)が少しあって、これらのオプションは環境変数を使ってだけ指定することができる:
840-</p>
841-<dl compact="compact">
842-<dt> <code>BOOST_REGEX</code></dt>
843-<dd><p>デフォルトでは、<code>boost_regex</code>がboostライブラリをリンクするのに使われる(つまり<code>-lboost_regex</code>))。
844-boost regexライブラリが違う名前になっている場合は、この環境変数を使って名前を指定しなければならない。
845-たとえば、<code>libboost_regex-mt.lib</code>や<code>boost_regex-mt.dll</code>という名前のライブラリファイルの場合は、この変数を<code>boost_regex-mt</code>にセットしなければならない。
846-</p></dd>
847-<dt> <code>INCPATH</code></dt>
848-<dd><p>boostヘッダファイルのパスを指定する。
849-</p></dd>
850-<dt> <code>LIBS</code></dt>
851-<dd><p>boost libファイルのパスを指定する。
852-</p></dd>
825+<h3 class="section">2.1 Building with qmake</h3>
826+
827+<p><a name="index-qmake-45"></a>
828+Since version 3.1.2, Source-highlight can be built also using
829+<code>qmake</code>, the build tool from Qt libraries (<a href="http://qt.nokia.com">http://qt.nokia.com</a>).
830+This was made available to build Source-highlight on Windows based systems
831+without using a Unix shell, and in particular to build Source-highlight
832+<a name="index-MSVC-46"></a>with Microsoft MSVC compiler. You should use this method only if you
833+don't have a Unix shell or if you really need to use the MSVC compiler
834+(e.g., if you want to build Source-highlight library to be used in MSVC
835+based programs).
836+<a name="index-boost-47"></a>You still need the boost regex library, and if you
837+use MSVC, you can find installation packages for this library at
838+<a href="http://www.boostpro.com">http://www.boostpro.com</a>.
839+
840+ <p>This build mechanism is still experimental, and, when using MSVC, only
841+a static version of Source-highlight library can be built (not a .dll).
842+<a name="index-MinGW-48"></a>You can also use this method if you have the MinGW compiler,
843+<a href="http://www.mingw.org">http://www.mingw.org</a>, (e.g.,
844+the one that comes with Qt Windows distribution) and you don't have
845+<a name="index-msys-49"></a>Msys (<a href="http://www.mingw.org/wiki/MSYS">http://www.mingw.org/wiki/MSYS</a>). Otherwise, you should
846+still use the <code>configure</code> based mechanims.
847+
848+ <p>Using <code>qmake</code>, only a few options can be specified during the building
849+(besides the ones you usually use with qmake), and these options can
850+be specified only using environment variables:
851+
852+ <dl>
853+<dt><code>BOOST_REGEX</code><dd>By default, <code>boost_regex</code> will be used to link the boost library
854+(i.e., <code>-lboost_regex</code>); if your boost regex library has a different
855+name you must specify this name using this environment variable; e.g.,
856+if the library file is called <code>libboost_regex-mt.lib</code> or
857+<code>boost_regex-mt.dll</code> you must set this variable to
858+<code>boost_regex-mt</code>.
859+<br><dt><code>INCPATH</code><dd>Specify the path of the boost header files.
860+<br><dt><code>LIBS</code><dd>Specify the path of the boost lib files.
853861 </dl>
854862
855-<p>boostライブラリのインクルードパスとライブラリパスの指定は、システムパスディクレトリにそれらが無いのであれば、完全にあなたが<code>INCPATH</code>と<code>LIBS</code>を使って決めることだいうことを考慮に入れておいてほしい。
856-</p>
857-<p>また、qmakeを実行するときには、<code>-recursive</code>というオプションを常に使うということを覚えていてほしい。
858-</p>
859-<p>次に、<code>make install</code>を実行したい場合には、<code>INSTALL_ROOT</code>変数を使って、インストールするパスのプリフィックスを指定することができる。
860-そうしない場合はパスはルートディレクトリである。
861-</p>
862-<hr size="6">
863-<a name="g_t_30c0_30a6_30f3_30ed_30fc_30c9"></a>
864-<a name="SEC11"></a>
865-<table cellpadding="1" cellspacing="1" border="0">
866-<tr><td valign="middle" align="left">[<a href="#SEC10" title="Previous section in reading order"> &lt; </a>]</td>
867-<td valign="middle" align="left">[<a href="#SEC12" title="Next section in reading order"> &gt; </a>]</td>
868-<td valign="middle" align="left"> &nbsp; </td>
869-<td valign="middle" align="left">[<a href="#SEC9" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
870-<td valign="middle" align="left">[<a href="#SEC9" title="Up section"> Up </a>]</td>
871-<td valign="middle" align="left">[<a href="#SEC19" title="Next chapter"> &gt;&gt; </a>]</td>
872-<td valign="middle" align="left"> &nbsp; </td>
873-<td valign="middle" align="left"> &nbsp; </td>
874-<td valign="middle" align="left"> &nbsp; </td>
875-<td valign="middle" align="left"> &nbsp; </td>
876-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
877-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
878-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
879-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
880-</tr></table>
881-<h2 class="section"> 2.2 ダウンロード </h2>
882-
883-<p>GNUのftpサイト:<a href="ftp://ftp.gnu.org/gnu/src-highlite">ftp://ftp.gnu.org/gnu/src-highlite</a>や、そのミラーサイト(<a href="http://www.gnu.org/prep/ftp.html">http://www.gnu.org/prep/ftp.html</a>を見よ)のいずれかからダウンロードすることができる。
884-</p>
885-<p>私はWindowsバイナリをもう配布しない。
886-<a href="http://www.cygwin.com">http://www.cygwin.com</a>から入手できるCygnus C/C++コンパイラでビルドが可能だからだ。
887-しかし、そういったコンパイラをダウンロードしたくなかったり、Boost Regexライブラリについて問題を感じているような場合には(<a href="#SEC14">Boost Regexライブラリのインストールに関するTips</a>を参照のこと。留意してほしいのだが、これらのライブラリがインストールされていなくて、使用しているC/C++コンパイラのディストリビューションにビルド済みのパッケージが用意されていなければ、ソースからBoostライブラリをビルドするのにいくらか時間がかかるかもしれない。数時間かかることも考えられる)、メールで直接そういったバイナリを私にリクエストしてもよい(メールアドレスは私のホームページを見てほしい)。
888-喜んでお送りするつもりだ。
889-Source-highlightのMS-Windowsポートの一つが<a href="http://gnuwin32.sourceforge.net">http://gnuwin32.sourceforge.net</a>から入手できる。
890-しかし、私はそれらのバイナリを個人的にメンテナンスしていないし、古くなっているかもしれない。
891-</p>
892-<p>アーカイブはGNU gpg(<a href="http://www.gnupg.org">http://www.gnupg.org</a>)を使って私がデジタル署名している。
893-私のGPGのパブリックキーは私のホームページ(<a href="http://www.lorenzobettini.it">http://www.lorenzobettini.it</a>)で見つけられる。
894-</p>
895-<p>個別のリリースのもが利用可能であれば、パッチも入手できる(以前のバージョンからのパッチについては後述)。
896-</p>
897-<hr size="6">
898-<a name="Git_306e_533f_540d_30c1_30a7_30c3_30af_30a2_30a6_30c8"></a>
899-<a name="SEC12"></a>
900-<table cellpadding="1" cellspacing="1" border="0">
901-<tr><td valign="middle" align="left">[<a href="#SEC11" title="Previous section in reading order"> &lt; </a>]</td>
902-<td valign="middle" align="left">[<a href="#SEC13" title="Next section in reading order"> &gt; </a>]</td>
903-<td valign="middle" align="left"> &nbsp; </td>
904-<td valign="middle" align="left">[<a href="#SEC9" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
905-<td valign="middle" align="left">[<a href="#SEC9" title="Up section"> Up </a>]</td>
906-<td valign="middle" align="left">[<a href="#SEC19" title="Next chapter"> &gt;&gt; </a>]</td>
907-<td valign="middle" align="left"> &nbsp; </td>
908-<td valign="middle" align="left"> &nbsp; </td>
909-<td valign="middle" align="left"> &nbsp; </td>
910-<td valign="middle" align="left"> &nbsp; </td>
911-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
912-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
913-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
914-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
915-</tr></table>
916-<h2 class="section"> 2.3 Anonymous Git Checkout </h2>
917-
918-<p>このプロジェクトのgitリポジトリは、以下のクローン化の手順を通してチェックアウトすることができる<a name="DOCF3" href="#FOOT3">(3)</a>:
919-</p>
920-<table><tr><td>&nbsp;</td><td><pre class="example">git clone git://git.savannah.gnu.org/src-highlite.git
921-</pre></td></tr></table>
922-
923-<p>詳しい手順については次のアドレスで見つけられる:
924-</p>
925-<p><a href="http://savannah.gnu.org/projects/src-highlite">http://savannah.gnu.org/projects/src-highlite</a>.
926-</p>
927-<p>そして、gitリポジトリは次のアドレスでオンラインで見ることもできる:
928-</p>
929-<p><a href="http://git.savannah.gnu.org/cgit/src-highlite.git">http://git.savannah.gnu.org/cgit/src-highlite.git</a>.
930-</p>
931-<p>このように、Source-highlightの最新の開発ソースを手に入れられるが、それは不安定なものかもしれないことに注意してほしい。
932-このプログラムを修正したり拡張したりする場合には、この方法がベストである。
933-パッチを私に送るのに、そのパッチは、Gitリポジトリの最新のソースに対するものであるべきだ。
934-</p>
935-<p>反対に、指定したリリースのソースをgitを通して入手したい場合、たとえばバージョンX.Y.Zならば、rel_X_Y_Zというタグを指定しなければならない。
936-</p>
937-<p>Gitリポジトリから手に入れたソースをコンパイルするとき、<code>configure</code>や<code>make</code>コマンドを初めて実行する前に次のコマンドを実行しなければならない:
938-</p>
939-<table><tr><td>&nbsp;</td><td><pre class="example">autoreconf -i
940-</pre></td></tr></table>
941-
942-<p>これによってautotoolsのコマンドが正しい順番に実行され、ひょっとしたら欠けているかもしれないファイルもコピーしてくれるだろう。
943-これを成功させるためには、
944-<a name="IDX38"></a>
945-<a name="IDX39"></a>
946-<a name="IDX40"></a>
947-<code>automake</code>と<code>autoconf</code>、<code>libtool</code>の最近のバージョンがインストールされていたほうがよい。
948-</p>
949-<hr size="6">
950-<a name="source_002dhighlight_306e_30d3_30eb_30c9_306b_5fc5_8981_306a_3082_306e"></a>
951-<a name="SEC13"></a>
952-<table cellpadding="1" cellspacing="1" border="0">
953-<tr><td valign="middle" align="left">[<a href="#SEC12" title="Previous section in reading order"> &lt; </a>]</td>
954-<td valign="middle" align="left">[<a href="#SEC14" title="Next section in reading order"> &gt; </a>]</td>
955-<td valign="middle" align="left"> &nbsp; </td>
956-<td valign="middle" align="left">[<a href="#SEC9" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
957-<td valign="middle" align="left">[<a href="#SEC9" title="Up section"> Up </a>]</td>
958-<td valign="middle" align="left">[<a href="#SEC19" title="Next chapter"> &gt;&gt; </a>]</td>
959-<td valign="middle" align="left"> &nbsp; </td>
960-<td valign="middle" align="left"> &nbsp; </td>
961-<td valign="middle" align="left"> &nbsp; </td>
962-<td valign="middle" align="left"> &nbsp; </td>
963-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
964-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
965-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
966-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
967-</tr></table>
968-<h2 class="section"> 2.4 source-highlightのビルドに必要なもの </h2>
969-
970-
971-<p>バージョン2.0から、Source-highlightは、boost (<a href="http://www.boost.org">http://www.boost.org</a>)が提供している正規表現に依存しているので、最低でもboostのregexライブラリをインストールする必要がある。
972-</p>
973-<p>ほとんどのGNU/Linuxディストリビューションでは、コンパイルされた状態ですでにこのライブラリが用意されている。
974-使用しているディストリビューションのパッケージを使うならば、boostライブラリの開発パッケージも必ずインストールしてほしい。
975-</p>
976-<p>Boost Regexライブラリのインストールに問題がある場合や、このライブラリのためにsource-highlightのコンパイルに問題がある場合には、<a href="#SEC14">Boost Regexライブラリのインストールに関するTips</a>を見てほしい。
977-</p>
978-<p>(たくさん違うバージョンを使っているため)特定のバージョンのBoost regexライブラリを使いたい場合には、configureの<code>--with-boost-regex</code>オプションを使って特定のサフィックスを指定することができる。
979-たとえば次のようになる。
980-</p>
981-<table><tr><td>&nbsp;</td><td><pre class="example">./configure --with-boost-regex=boost_regex-gcc-1_31
982-</pre></td></tr></table>
983-
984-<p>Source-highlightはGNU/Linuxのもとで、gcc (C++)とbison (yacc)、flex (lex)を利用して開発され、<a href="http://www.cygwin.com">http://www.cygwin.com</a>から入手できるCygwin C/C++コンパイラでWin32に移植された。
985-</p>
986-<p>私は
987-<a name="IDX41"></a>
988-<a name="IDX42"></a>
989-<a name="IDX43"></a>
990-GNU Autoconf<a name="DOCF4" href="#FOOT4">(4)</a>とGNU Automake<a name="DOCF5" href="#FOOT5">(5)</a>、そしてGNU Libtool<a name="DOCF6" href="#FOOT6">(6)</a>という素晴しいソフトウェアを使っている。
991-<a name="IDX44"></a>
992-バージョン2.6から、Gnulib - GNU Portablility Library<a name="DOCF7" href="#FOOT7">(7)</a>も使い初めた。
993-これは「GNUのパッケージ間で共有するための、GNUの共通コードの中心の位置」だ(例を挙げると、<code>getopt_long</code>関数の存在と正しさのチェックをするのにGnulibに頼っている)。
994-</p>
995-<p>最後に、私はコマンドラインの解析のため、<em>GNU gengetopt</em>(<a href="http://www.gnu.org/software/gengetopt">http://www.gnu.org/software/gengetopt</a>)を使った。
996-</p>
997-<p>動的オーバーロードを許す<em>doublecpp</em>(<a href="http://doublecpp.sourceforge.net">http://doublecpp.sourceforge.net</a>)も使い始めた。
998-</p>
999-<p>実際、boost regexライブラリは別にすると、source-highlightの開発をしたいと思わないかぎり、source-highlightをビルドするのに上に挙げたその他のツールは必要ではない(確かに私は前述したツールを使って生成した出力ソースを提供している)。
1000-</p>
1001-<p>しかし、Gitからソースを取得したのならば、他のツールがいくつか必要となる。
1002-<a href="#SEC12">Anonymous Git Checkout</a>を参照してほしい。
1003-</p>
1004-<hr size="6">
1005-<a name="Boost-Regex_30e9_30a4_30d6_30e9_30ea_306e_30a4_30f3_30b9_30c8_30fc_30eb_306b_95a2_3059_308bTips"></a>
1006-<a name="SEC14"></a>
1007-<table cellpadding="1" cellspacing="1" border="0">
1008-<tr><td valign="middle" align="left">[<a href="#SEC13" title="Previous section in reading order"> &lt; </a>]</td>
1009-<td valign="middle" align="left">[<a href="#SEC15" title="Next section in reading order"> &gt; </a>]</td>
1010-<td valign="middle" align="left"> &nbsp; </td>
1011-<td valign="middle" align="left">[<a href="#SEC9" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
1012-<td valign="middle" align="left">[<a href="#SEC9" title="Up section"> Up </a>]</td>
1013-<td valign="middle" align="left">[<a href="#SEC19" title="Next chapter"> &gt;&gt; </a>]</td>
1014-<td valign="middle" align="left"> &nbsp; </td>
1015-<td valign="middle" align="left"> &nbsp; </td>
1016-<td valign="middle" align="left"> &nbsp; </td>
1017-<td valign="middle" align="left"> &nbsp; </td>
1018-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1019-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1020-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
1021-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1022-</tr></table>
1023-<h2 class="section"> 2.5 Boost Regexライブラリのインストールに関するTips </h2>
1024-
1025-
1026-<p>source-highlightのコンパイルに何の問題もなければ、幸運にもこのセクションは飛ばしてかまわない<a name="DOCF8" href="#FOOT8">(8)</a>。:-)
1027-</p>
1028-<p>このセクションを書いたのは、Boost Regexライブラリをソースからインストールした後の問題を報告してくるユーザが多数いるからだ。
1029-このライブラリが既に正しくインストールされている場合ですら、source-highlightのコンパイルで問題が起きるユーザも他にいる(特にcygwinを使っているwindowsユーザ)。
1030-Boost Regexライブラリのインストールや使用に対して、このセクションがいくらかの光を照らしてくれることを期待している。
1031-このセクションは、Boostライブラリのコンパイルの仕方を説明するものではないことに注意してほしい(<a href="http://www.boost.org">http://www.boost.org</a>で見つけられるドキュメンテーションはよく出来ている)。
1032-このセクションは、Boostライブラリのインストールが成功した後でさえ、source-highlightのコンパイルに問題が発生する場合に、事態をどのように調整するかを説明する。
1033-</p>
1034-<p>まず最初、使用しているディストリビューションがBoost regexライブラリのパッケージを用意している場合、boostライブラリの開発パッケージも必ずインストールしてほしい。
1035-つまり、それらのパッケージが、ライブラリを使ってプログラムをコンパイルするのに必要なヘッダファイルも提供しているからだ。
1036-たとえば、私のDebianシステムの場合、<code>libboost-regex</code>パッケージのほかに、<code>libboost-regex-dev</code>パッケージをインストールしなければならなかった。
1037-</p>
1038-<p>使用しているディストリビューションがこういったパッケージを提供していない場合、そのときは、<a href="http://www.boost.org">http://www.boost.org</a>からBoostライブラリのソースをダウンロードして、コンパイルとインストールの手順を辿らなければならない。
1039-しかし、(C++コンパイラのインクルードパスに&lsquo;<tt>/usr/local/include</tt>&rsquo;が既に含まれていなければ)インストールのプリフィックスを、デフォルトのプリフィックス&lsquo;<tt>/usr/local</tt>&rsquo;に頼るのではなく、&lsquo;<tt>/usr</tt>&rsquo;に指定しておくことをお勧めする。
1040-これによって、source-highlightをコンパイルするのが簡単になるからだ。
1041-&lsquo;<tt>/usr/include</tt>&rsquo;は普通、コンパイル時にC++がヘッダファイルを探索する場所になっているのでこれをお勧めする。
1042-</p>
1043-<p>Boost Regexライブラリをコンパイルしてインストールするのに成功したり、あるいはディストリビューションのパッケージをインストールても、まだsource-highlightのコンパイルに問題が起きる場合には、次に説明する事柄を簡単に調整する必要がある。
1044-</p>
1045-<p>まず、source-highlightの<code>./configure</code>コマンドが次のように報告する場合だ:
1046-</p>
1047-<table><tr><td>&nbsp;</td><td><pre class="example">ERROR! Boost::regex library not installed.
1048-</pre></td></tr></table>
1049-
1050-<p>このとき、コンパイラがこのライブラリのヘッダファイルを見つけられないでいる。
1051-こういう場合は、&lsquo;<tt>/usr/include/boost</tt>&rsquo;ディレクトリが実際に存在するかどうかを確認してほしい。
1052-もし無ければ、インストールしたライブラリのバージョンに応じて、恐らく似たような名前のディレクトリが見つかるだろう(たとえば&lsquo;<tt>/usr/include/boost-1_33/boost)。
1053-そのときは、次のようにシンボリックリンクを作成するだけでよい:
1054-</tt></p>
1055-<table><tr><td>&nbsp;</td><td><pre class="example"><tt>ln -s /usr/include/boost-1_33/boost /usr/include/boost
1056-</tt></pre></td></tr></table>
1057-
1058-<p><tt>代わりに、source-highlightのconfigureを次のように実行してもよい:
1059-</tt></p>
1060-<table><tr><td>&nbsp;</td><td><pre class="example"><tt>./configure CXXFLAGS=-I/usr/include/boost-1_33/
1061-</tt></pre></td></tr></table>
1062-
1063-<p><tt>さらに、source-highlightの<code>./configure</code>が次のような別のエラーを出す場合だ:
1064-</tt></p>
1065-<table><tr><td>&nbsp;</td><td><pre class="example"><tt>ERROR! Boost::regex library is installed, but you
1066-must specify the suffix with --with-boost-regex at configure
1067-for instance, --with-boost-regex=boost_regex-gcc-1_31
1068-</tt></pre></td></tr></table>
1069-
1070-<p><tt>このとき、修正しなければならないことが他にまだある。
1071-インストールしたBoost Regexライブラリの正確なファイル名を調べなければならない。
1072-これは次のコマンドを使えばよい:
1073-</tt></p>
1074-<table><tr><td>&nbsp;</td><td><pre class="example"><tt>$ ls -l /usr/lib/libboost_regex*
1075-</tt></pre></td></tr></table>
1076-
1077-<p><tt>例えば、私のcygwinをインストールした環境の一つでは次のように報告される:
1078-</tt></p>
1079-<table><tr><td>&nbsp;</td><td><pre class="example"><tt>-rwxr-x---+ Nov 9 23:29 /usr/lib/libboost_regex-gcc-mt-s-1_33.a
1080--rwxr-x---+ Nov 22 09:22 /usr/lib/libboost_regex-gcc-mt-s.a
1081--rwxr-x---+ Nov 9 23:29 /usr/lib/libboost_regex-gcc-mt-s-1_33.so
1082--rwxr-x---+ Nov 22 09:22 /usr/lib/libboost_regex-gcc-mt-s.so
1083-</tt></pre></td></tr></table>
1084-
1085-<p><tt>これで、source-highlightの次のようにconfigureコマンドを正しく実行する情報が揃った:
1086-</tt></p>
1087-<table><tr><td>&nbsp;</td><td><pre class="example"><tt>./configure --with-boost-regex=boost_regex-gcc-mt-s-1_33
1088-</tt></pre></td></tr></table>
1089-
1090-<p><tt>あるいは、1番目の問題を2番目の方法<a name="DOCF9" href="#FOOT9">(9)</a>で解決した場合には次のようになる:
1091-</tt></p>
1092-<table><tr><td>&nbsp;</td><td><pre class="example"><tt>./configure CXXFLAGS=-I/usr/include/boost-1_33/ \
1093- --with-boost-regex=boost_regex-gcc-mt-s-1_33
1094-</tt></pre></td></tr></table>
1095-
1096-<p><tt>もちろん、ファイルをインストールしたBoost Regexライブラリの名前に応じてこのコマンドを修正しなければならない。
1097-</tt></p>
1098-<p><tt>問題が起きていた多数のユーザが、この手順でsource-highlightをなんとかコンパイルできるようになった。
1099-依然問題を抱えているならば私にメールを送ってほしい。
1100-</tt></p>
1101-<hr size="6">
1102-<a name="g_t_524d_306e_30d0_30fc_30b8_30e7_30f3_304b_3089_306e_30d1_30c3_30c1"></a>
1103-<a name="SEC15"></a>
1104-<table cellpadding="1" cellspacing="1" border="0">
1105-<tr><td valign="middle" align="left">[<a href="#SEC14" title="Previous section in reading order"> &lt; </a>]</td>
1106-<td valign="middle" align="left">[<a href="#SEC16" title="Next section in reading order"> &gt; </a>]</td>
1107-<td valign="middle" align="left"> &nbsp; </td>
1108-<td valign="middle" align="left">[<a href="#SEC9" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
1109-<td valign="middle" align="left">[<a href="#SEC9" title="Up section"> Up </a>]</td>
1110-<td valign="middle" align="left">[<a href="#SEC19" title="Next chapter"> &gt;&gt; </a>]</td>
1111-<td valign="middle" align="left"> &nbsp; </td>
1112-<td valign="middle" align="left"> &nbsp; </td>
1113-<td valign="middle" align="left"> &nbsp; </td>
1114-<td valign="middle" align="left"> &nbsp; </td>
1115-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1116-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1117-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
1118-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1119-</tr></table>
1120-<h2 class="section"> 2.6 前のバージョンからのパッチ </h2>
1121-
1122-<p><tt>パッチを一つ、たとえば&lsquo;<tt>source-highlight-1.3-1.3.1-patch.gz</tt>&rsquo;(すなわち、バージョン1.3からバージョン1.3.1へのパッチ)をダウンロードした場合、前のバージョン(source-highlight-1.3)のソースのディレクトリへcdして、次のようにタイプする:
1123-</tt></p>
1124-<table><tr><td>&nbsp;</td><td><pre class="example"><tt>gunzip -cd ../source-highlight-1.3-1.3.1.patch.gz | patch -p1
1125-</tt></pre></td></tr></table>
1126-
1127-<p><tt>そして、コンパイルの手順をリスタートする(既にconfigureを実行しているならば、ただmakeをすればいいはずだ)。
1128-</tt></p>
1129-<hr size="6">
1130-<a name="less_3067_306esource_002dhighlight_306e_4f7f_7528"></a>
1131-<a name="SEC16"></a>
1132-<table cellpadding="1" cellspacing="1" border="0">
1133-<tr><td valign="middle" align="left">[<a href="#SEC15" title="Previous section in reading order"> &lt; </a>]</td>
1134-<td valign="middle" align="left">[<a href="#SEC17" title="Next section in reading order"> &gt; </a>]</td>
1135-<td valign="middle" align="left"> &nbsp; </td>
1136-<td valign="middle" align="left">[<a href="#SEC9" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
1137-<td valign="middle" align="left">[<a href="#SEC9" title="Up section"> Up </a>]</td>
1138-<td valign="middle" align="left">[<a href="#SEC19" title="Next chapter"> &gt;&gt; </a>]</td>
1139-<td valign="middle" align="left"> &nbsp; </td>
1140-<td valign="middle" align="left"> &nbsp; </td>
1141-<td valign="middle" align="left"> &nbsp; </td>
1142-<td valign="middle" align="left"> &nbsp; </td>
1143-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1144-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1145-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
1146-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1147-</tr></table>
1148-<h2 class="section"> 2.7 lessでのsource-highlightの使用 </h2>
1149-
1150-<p><tt>これはKonstantine Serebrianyが提案したことだ。
1151-&lsquo;<tt>src-hilite-lesspipe.sh</tt>&rsquo;というスクリプトがsource-highlightと一緒にインストールされるだろう。
1152-次に挙げる環境変数を使うことができる。
1153-</tt></p>
1154-<table><tr><td>&nbsp;</td><td><pre class="example"><tt>export LESSOPEN=&quot;| /path/to/src-hilite-lesspipe.sh %s&quot;
1155-export LESS=' -R '
1156-</tt></pre></td></tr></table>
1157-
1158-<p><tt>このようにすれば、ファイルをlessを使ってブラウズするとき、それがsource-highlightによって処理されるソースファイルであれば、自動的にハイライトされる。
1159-</tt></p>
1160-<hr size="6">
1161-<a name="source_002dhighlight_306eCGI_3068_3057_3066_4f7f_7528"></a>
1162-<a name="SEC17"></a>
1163-<table cellpadding="1" cellspacing="1" border="0">
1164-<tr><td valign="middle" align="left">[<a href="#SEC16" title="Previous section in reading order"> &lt; </a>]</td>
1165-<td valign="middle" align="left">[<a href="#SEC18" title="Next section in reading order"> &gt; </a>]</td>
1166-<td valign="middle" align="left"> &nbsp; </td>
1167-<td valign="middle" align="left">[<a href="#SEC9" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
1168-<td valign="middle" align="left">[<a href="#SEC9" title="Up section"> Up </a>]</td>
1169-<td valign="middle" align="left">[<a href="#SEC19" title="Next chapter"> &gt;&gt; </a>]</td>
1170-<td valign="middle" align="left"> &nbsp; </td>
1171-<td valign="middle" align="left"> &nbsp; </td>
1172-<td valign="middle" align="left"> &nbsp; </td>
1173-<td valign="middle" align="left"> &nbsp; </td>
1174-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1175-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1176-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
1177-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1178-</tr></table>
1179-<h2 class="section"> 2.8 source-highlightのCGIとして使用 </h2>
1180-
1181-<p><tt>Robert WetzelのおかげでCGIサポートが可能になった。
1182-私は個人的にはこれをテストしていない。
1183-source-highlightをCGIプログラムのように使いたい場合には、source-highlight-cgiという実行ファイルを使わなければならない。
1184-このような実行ファイルは次のコマンドを実行すればビルドできる。
1185-</tt></p>
1186-<table><tr><td>&nbsp;</td><td><pre class="example"><tt>make source-highlight-cgi
1187-</tt></pre></td></tr></table>
1188-
1189-<p><tt>これは&lsquo;<tt>src</tt>&rsquo;ディレクトリで実行する。
1190-</tt></p>
1191-
1192-<hr size="6">
1193-<a name="g_t_002erpm_306e_30d3_30eb_30c9"></a>
1194-<a name="SEC18"></a>
1195-<table cellpadding="1" cellspacing="1" border="0">
1196-<tr><td valign="middle" align="left">[<a href="#SEC17" title="Previous section in reading order"> &lt; </a>]</td>
1197-<td valign="middle" align="left">[<a href="#SEC19" title="Next section in reading order"> &gt; </a>]</td>
1198-<td valign="middle" align="left"> &nbsp; </td>
1199-<td valign="middle" align="left">[<a href="#SEC9" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
1200-<td valign="middle" align="left">[<a href="#SEC9" title="Up section"> Up </a>]</td>
1201-<td valign="middle" align="left">[<a href="#SEC19" title="Next chapter"> &gt;&gt; </a>]</td>
1202-<td valign="middle" align="left"> &nbsp; </td>
1203-<td valign="middle" align="left"> &nbsp; </td>
1204-<td valign="middle" align="left"> &nbsp; </td>
1205-<td valign="middle" align="left"> &nbsp; </td>
1206-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1207-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1208-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
1209-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1210-</tr></table>
1211-<h2 class="section"> 2.9 .rpmのビルド </h2>
1212-
1213-<p><tt>Christian W. Zuckschwerdtが.rpmと.rpm.srcをビルドするサポートを追加した。
1214-バイナリの入った.rpmをビルドするには次のコマンドを実行すればよい:
1215-</tt></p>
1216-<table><tr><td>&nbsp;</td><td><pre class="example"><tt>rpmbuild -tb source-highlight-3.1.3.tar.gz
1217-</tt></pre></td></tr></table>
1218-
1219-<p><tt>そしてソースの入った.rpm.srcをビルドするには次のようにする:
1220-</tt></p>
1221-<table><tr><td>&nbsp;</td><td><pre class="example"><tt>rpmbuild -ts source-highlight-3.1.3.tar.gz
1222-</tt></pre></td></tr></table>
1223-
1224-
1225-<hr size="6">
863+ <p>Please, take into consideration that specifying the boost library
864+include and library paths is completely up to you, using
865+<code>INCPATH</code> and <code>LIBS</code>, if they're not in the system
866+path directories.
867+
868+ <p>Also remember to always use the option <code>-recursive</code> when running
869+qmake.
870+
871+ <p>If you then want to run <code>make install</code>, you can use the
872+variable <code>INSTALL_ROOT</code> to prefix the installation path, which,
873+otherwise, is the root directory.
874+
875+<div class="node">
876+<a name="Download"></a>
877+<p><hr>
878+Next:&nbsp;<a rel="next" accesskey="n" href="#Anonymous-Git-Checkout">Anonymous Git Checkout</a>,
879+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Building-with-qmake">Building with qmake</a>,
880+Up:&nbsp;<a rel="up" accesskey="u" href="#Installation">Installation</a>
881+
882+</div>
883+
884+<h3 class="section">2.2 Download</h3>
885+
886+<p><a name="index-download-50"></a>
887+You can download it from GNU's ftp site:
888+<a href="ftp://ftp.gnu.org/gnu/src-highlite">ftp://ftp.gnu.org/gnu/src-highlite</a> or from one of its mirrors (see
889+<a href="http://www.gnu.org/prep/ftp.html">http://www.gnu.org/prep/ftp.html</a>).
890+
891+ <p>I do not distribute Windows binaries anymore; since, they can be built
892+by using Cygnus C/C++ compiler, available at
893+<a href="http://www.cygwin.com">http://www.cygwin.com</a>. However, if you don't feel like
894+downloading such compiler or you experience problems with the Boost
895+Regex library (see also <a href="#Tips-on-installing-Boost-Regex-library">Tips on installing Boost Regex library</a>;
896+please also keep in mind that if you don't have these libraries
897+installed, and your C/C++ compiler distribution does not provide a
898+prebuilt package, it might take some time, even hours, to build the
899+Boost libraries from sources), you can request such binaries directly to
900+me, by e-mail (find my e-mail at my home page) and I'll be happy to send
901+them to you. An MS-Windows port of Source-highlight is available from
902+<a href="http://gnuwin32.sourceforge.net">http://gnuwin32.sourceforge.net</a>; however, I don't maintain those
903+binaries personally, and they might be out of date.
904+
905+ <p>Archives are digitally signed by me (Lorenzo Bettini) with GNU gpg
906+(<a href="http://www.gnupg.org">http://www.gnupg.org</a>). My GPG public key can be found at my home
907+page (<a href="http://www.lorenzobettini.it">http://www.lorenzobettini.it</a>).
908+
909+ <p>You can also get the patches, if they are available for a particular
910+release (see below for patching from a previous version).
911+
912+<div class="node">
913+<a name="Anonymous-Git-Checkout"></a>
914+<p><hr>
915+Next:&nbsp;<a rel="next" accesskey="n" href="#What-you-need-to-build-source_002dhighlight">What you need to build source-highlight</a>,
916+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Download">Download</a>,
917+Up:&nbsp;<a rel="up" accesskey="u" href="#Installation">Installation</a>
918+
919+</div>
920+
921+<h3 class="section">2.3 Anonymous Git Checkout</h3>
922+
923+<p><a name="index-Git-51"></a>This project's git repository can be checked out through the following
924+clone instruction<a rel="footnote" href="#fn-3" name="fnd-3"><sup>3</sup></a>:
925+
926+<pre class="example"> git clone git://git.savannah.gnu.org/src-highlite.git
927+</pre>
928+ <p>Further instructions can be found at the address:
929+
930+ <p><a href="http://savannah.gnu.org/projects/src-highlite">http://savannah.gnu.org/projects/src-highlite</a>.
931+
932+ <p>And the git repository can also browsed on-line at
933+
934+ <p><a href="http://git.savannah.gnu.org/cgit/src-highlite.git">http://git.savannah.gnu.org/cgit/src-highlite.git</a>.
935+
936+ <p>Please note that this way you will get the latest development sources
937+of Source-highlight, which may also be unstable. This solution is the
938+best if you intend to correct/extend this program: you should send me
939+patches against the latest git repository sources.
940+
941+ <p>If, on the contrary, you want to get the sources of a given release,
942+through git, say, e.g., version X.Y.Z, you must specify the tag
943+<code>rel_X_Y_Z</code>.
944+
945+ <p>When you compile the sources that you get from the git repository,
946+before running the <code>configure</code> and <code>make</code> commands, for the
947+first time, you must run the command:
948+
949+<pre class="example"> autoreconf -i
950+</pre>
951+ <p class="noindent">This will run the autotools commands in the correct order, and also copy
952+possibly missing files. You should have installed recent versions of
953+<a name="index-automake-52"></a><a name="index-autoconf-53"></a><a name="index-libtool-54"></a><code>automake</code>, <code>autoconf</code> and <code>libtool</code> in order for this to
954+succeed.
955+
956+<div class="node">
957+<a name="What-you-need-to-build-source-highlight"></a>
958+<a name="What-you-need-to-build-source_002dhighlight"></a>
959+<p><hr>
960+Next:&nbsp;<a rel="next" accesskey="n" href="#Tips-on-installing-Boost-Regex-library">Tips on installing Boost Regex library</a>,
961+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Anonymous-Git-Checkout">Anonymous Git Checkout</a>,
962+Up:&nbsp;<a rel="up" accesskey="u" href="#Installation">Installation</a>
963+
964+</div>
965+
966+<h3 class="section">2.4 What you need to build source-highlight</h3>
967+
968+<p><a name="index-compilation-requirements-55"></a><a name="index-building-requirements-56"></a>
969+<a name="index-boost-57"></a>Since version 2.0 Source-highlight relies on regular expressions as
970+provided by boost (<a href="http://www.boost.org">http://www.boost.org</a>), so you need to install at
971+least the regex library from boost.
972+
973+ <p>Most GNU/Linux distributions provide this library already in a compiled
974+form. If you use your distribution packages, please be sure to install
975+also the development package of the boost libraries.
976+
977+ <p>If you experience problems in installing Boost Regex library, or in
978+compiling source-highlight because of this library, please take a look
979+at <a href="#Tips-on-installing-Boost-Regex-library">Tips on installing Boost Regex library</a>.
980+
981+ <p>If you want to use a specific version of the Boost regex library
982+(because you have many versions of it), you can use the configure option
983+<code>--with-boost-regex</code> to specify a particular suffix. For instance,
984+
985+<pre class="example"> ./configure --with-boost-regex=boost_regex-gcc-1_31
986+</pre>
987+ <p>Source-highlight has been developed under GNU/Linux, using gcc (C++),
988+and bison (yacc) and flex (lex), and ported under Win32 with Cygwin
989+C/C++compiler, available at <a href="http://www.cygwin.com">http://www.cygwin.com</a>.
990+
991+ <p>I use the excellent
992+<a name="index-automake-58"></a><a name="index-autoconf-59"></a><a name="index-libtool-60"></a>GNU Autoconf<a rel="footnote" href="#fn-4" name="fnd-4"><sup>4</sup></a>,
993+GNU Automake<a rel="footnote" href="#fn-5" name="fnd-5"><sup>5</sup></a> and
994+GNU Libtool<a rel="footnote" href="#fn-6" name="fnd-6"><sup>6</sup></a>.
995+<a name="index-gnulib-61"></a>Since version 2.6 I also started to use Gnulib - The GNU Portability
996+Library<a rel="footnote" href="#fn-7" name="fnd-7"><sup>7</sup></a>, &ldquo;a central
997+location for common GNU code, intended to be shared among GNU packages&rdquo;
998+(for instance, I rely on Gnulib for checking for the presence and
999+correctness of <code>getopt_long</code> function).
1000+
1001+ <p>Finally I used <em>GNU gengetopt</em>
1002+(<a href="http://www.gnu.org/software/gengetopt">http://www.gnu.org/software/gengetopt</a>), for command line parsing.
1003+
1004+ <p>I started to use also <em>doublecpp</em>
1005+(<a href="http://doublecpp.sourceforge.net">http://doublecpp.sourceforge.net</a>) that permits achieving dynamic
1006+overloading.
1007+
1008+ <p>Actually, apart from the boost regex library, you don't need the other
1009+tools above to build source-highlight (indeed I provide the output
1010+sources generated by the above mentioned tools), unless you want to
1011+develop source-highlight.
1012+
1013+ <p>However, if you obtained sources through Git, you need some other tools,
1014+see <a href="#Anonymous-Git-Checkout">Anonymous Git Checkout</a>.
1015+
1016+<div class="node">
1017+<a name="Tips-on-installing-Boost-Regex-library"></a>
1018+<p><hr>
1019+Next:&nbsp;<a rel="next" accesskey="n" href="#Patching-from-a-previous-version">Patching from a previous version</a>,
1020+Previous:&nbsp;<a rel="previous" accesskey="p" href="#What-you-need-to-build-source_002dhighlight">What you need to build source-highlight</a>,
1021+Up:&nbsp;<a rel="up" accesskey="u" href="#Installation">Installation</a>
1022+
1023+</div>
1024+
1025+<h3 class="section">2.5 Tips on installing Boost Regex library</h3>
1026+
1027+<p><a name="index-Boost-regex-62"></a>
1028+If you experience no problem in compiling source-highlight, you can
1029+happily skip this section<a rel="footnote" href="#fn-8" name="fnd-8"><sup>8</sup></a> :-)
1030+
1031+ <p>I created this section because many users reported some problems after
1032+installing Boost Regex library from sources; other users had problems in
1033+compiling source-highlight even if this library was already correctly
1034+installed (especially windows users, using cygwin). I hope this section
1035+sheds some light in installing/using the Boost Regex library. Please,
1036+note that this section does not explain how to compile the Boost
1037+libraries (the documentation you'll find on <a href="http://www.boost.org">http://www.boost.org</a>
1038+is well done); it explains how to tweak things if you have problems in
1039+compiling source-highlight even after a successful installation of Boost
1040+libraries.
1041+
1042+ <p>First of all, if your distribution provides packages for the Boost regex
1043+library, please be sure to install also the development package of the
1044+boost libraries, i.e., those providing also the header files needed to
1045+compile a program using these libraries. For instance, on my Debian
1046+system I had to install the package <code>libboost-regex-dev</code>, besides
1047+the package <code>libboost-regex</code>.
1048+
1049+ <p>If your distribution does not provide these packages then you have to
1050+download the sources of Boost libraries from <a href="http://www.boost.org">http://www.boost.org</a>
1051+and follow the instructions for compilation and installation. However,
1052+I suggest you specify <samp><span class="file">/usr</span></samp> as prefix for installation, instead of
1053+relying on the default prefix <samp><span class="file">/usr/local</span></samp> (unless
1054+<samp><span class="file">/usr/local/include</span></samp> is already in the inclusion path of your C++
1055+compiler), since this will make things easier when compiling
1056+source-highlight. I suggest this, since <samp><span class="file">/usr/include</span></samp> is usually
1057+the place where C++ searches for header files during compilation.
1058+
1059+ <p>If you successfully compiled and installed the Boost Regex library, or
1060+you installed the package from your distribution, but you STILL
1061+experience problems in compiling source-highlight, then you simply have
1062+to adjust some things as described in the following.
1063+
1064+ <p>If the <code>./configure</code> command of source-highlight reports this
1065+error:
1066+
1067+<pre class="example"> ERROR! Boost::regex library not installed.
1068+</pre>
1069+ <p class="noindent">then, the compiler cannot find the header files for this library. In
1070+this case, check that the directory <samp><span class="file">/usr/include/boost</span></samp> actually
1071+exists; if it does not, then probably you'll find a similar directory,
1072+e.g., <samp><span class="file">/usr/include/boost-1_33/boost</span></samp>, depending on the version of
1073+the library you have installed. Then, all you have to do is to create a
1074+symbolic link as follows:
1075+
1076+<pre class="example"> ln -s /usr/include/boost-1_33/boost /usr/include/boost
1077+</pre>
1078+ <p class="noindent">Alternatively, you might run source-highlight's configure as follows:
1079+
1080+<pre class="example"> ./configure CXXFLAGS=-I/usr/include/boost-1_33/
1081+</pre>
1082+ <p>If then <code>./configure</code> command of source-highlight reports this
1083+other error:
1084+
1085+<pre class="example"> ERROR! Boost::regex library is installed, but you
1086+ must specify the suffix with --with-boost-regex at configure
1087+ for instance, --with-boost-regex=boost_regex-gcc-1_31
1088+</pre>
1089+ <p class="noindent">then, there's still another thing to fix: you must find out the exact
1090+names of the files of your installed Boost Regex libraries; you can do
1091+this by using the command:
1092+
1093+<pre class="example"> $ ls -l /usr/lib/libboost_regex*
1094+</pre>
1095+ <p class="noindent">that, for instance, on one of my cygwin installation reports:
1096+
1097+<pre class="example"> -rwxr-x---+ Nov 9 23:29 /usr/lib/libboost_regex-gcc-mt-s-1_33.a
1098+ -rwxr-x---+ Nov 22 09:22 /usr/lib/libboost_regex-gcc-mt-s.a
1099+ -rwxr-x---+ Nov 9 23:29 /usr/lib/libboost_regex-gcc-mt-s-1_33.so
1100+ -rwxr-x---+ Nov 22 09:22 /usr/lib/libboost_regex-gcc-mt-s.so
1101+</pre>
1102+ <p class="noindent">Now, you have all the information to correctly run the
1103+source-highlight's configure command:
1104+
1105+<pre class="example"> ./configure --with-boost-regex=boost_regex-gcc-mt-s-1_33
1106+</pre>
1107+ <p class="noindent">or, if you solved the first problem in the second way<a rel="footnote" href="#fn-9" name="fnd-9"><sup>9</sup></a>,
1108+
1109+<pre class="example"> ./configure CXXFLAGS=-I/usr/include/boost-1_33/ \
1110+ --with-boost-regex=boost_regex-gcc-mt-s-1_33
1111+</pre>
1112+ <p>Of course, you have to modify this command according to the names of
1113+your Boost Regex library installed files.
1114+
1115+ <p>These instructions managed to let many users, who were experiencing
1116+problems, to compile source-highlight If you still have problems, please
1117+send me an e-mail.
1118+
1119+<div class="node">
1120+<a name="Patching-from-a-previous-version"></a>
1121+<p><hr>
1122+Next:&nbsp;<a rel="next" accesskey="n" href="#Using-source_002dhighlight-with-less">Using source-highlight with less</a>,
1123+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Tips-on-installing-Boost-Regex-library">Tips on installing Boost Regex library</a>,
1124+Up:&nbsp;<a rel="up" accesskey="u" href="#Installation">Installation</a>
1125+
1126+</div>
1127+
1128+<h3 class="section">2.6 Patching from a previous version</h3>
1129+
1130+<p><a name="index-patching-63"></a>
1131+If you downloaded a patch, say
1132+<samp><span class="file">source-highlight-1.3-1.3.1-patch.gz</span></samp> (i.e., the patch to go from version
1133+1.3 to version 1.3.1), cd to the directory with sources from the
1134+previous version (source-highlight-1.3) and type:
1135+
1136+<pre class="example"> gunzip -cd ../source-highlight-1.3-1.3.1.patch.gz | patch -p1
1137+</pre>
1138+ <p>and restart the compilation process (if you had already run configure a
1139+simple make should do).
1140+
1141+<div class="node">
1142+<a name="Using-source-highlight-with-less"></a>
1143+<a name="Using-source_002dhighlight-with-less"></a>
1144+<p><hr>
1145+Next:&nbsp;<a rel="next" accesskey="n" href="#Using-source_002dhighlight-as-a-CGI">Using source-highlight as a CGI</a>,
1146+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Patching-from-a-previous-version">Patching from a previous version</a>,
1147+Up:&nbsp;<a rel="up" accesskey="u" href="#Installation">Installation</a>
1148+
1149+</div>
1150+
1151+<h3 class="section">2.7 Using source-highlight with less</h3>
1152+
1153+<p>This was suggested by Konstantine Serebriany. The script
1154+<samp><span class="file">src-hilite-lesspipe.sh</span></samp> will be installed together with
1155+source-highlight. You can use the following environment variables:
1156+
1157+<pre class="example"> export LESSOPEN="| /path/to/src-hilite-lesspipe.sh %s"
1158+ export LESS=' -R '
1159+</pre>
1160+ <p>This way, when you use less to browse a file, if it is a source file
1161+handled by source-highlight, it will be automatically highlighted.
1162+
1163+<div class="node">
1164+<a name="Using-source-highlight-as-a-CGI"></a>
1165+<a name="Using-source_002dhighlight-as-a-CGI"></a>
1166+<p><hr>
1167+Next:&nbsp;<a rel="next" accesskey="n" href="#Building-_002erpm">Building .rpm</a>,
1168+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Using-source_002dhighlight-with-less">Using source-highlight with less</a>,
1169+Up:&nbsp;<a rel="up" accesskey="u" href="#Installation">Installation</a>
1170+
1171+</div>
1172+
1173+<h3 class="section">2.8 Using source-highlight as a CGI</h3>
1174+
1175+<p><a name="index-CGI-64"></a>CGI support was enabled thanks to Robert Wetzel; I haven't tested it
1176+personally. If you want to use source-highlight as a CGI program, you
1177+have to use the executable source-highlight-cgi. You can build such
1178+executable by issuing
1179+
1180+<pre class="example"> make source-highlight-cgi
1181+</pre>
1182+ <p class="noindent">in the <samp><span class="file">src</span></samp> directory.
1183+
1184+<div class="node">
1185+<a name="Building-.rpm"></a>
1186+<a name="Building-_002erpm"></a>
1187+<p><hr>
1188+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Using-source_002dhighlight-as-a-CGI">Using source-highlight as a CGI</a>,
1189+Up:&nbsp;<a rel="up" accesskey="u" href="#Installation">Installation</a>
1190+
1191+</div>
1192+
1193+<h3 class="section">2.9 Building .rpm</h3>
1194+
1195+<p><a name="index-rpm-65"></a>
1196+Christian W. Zuckschwerdt added support for building an .rpm and an
1197+.rpm.src. You can issue the following command
1198+
1199+<pre class="example"> rpmbuild -tb source-highlight-3.1.4.tar.gz
1200+</pre>
1201+ <p>for building an .rpm with binaries and
1202+
1203+<pre class="example"> rpmbuild -ts source-highlight-3.1.4.tar.gz
1204+</pre>
1205+ <p>for building an .rpm.src with sources.
1206+
1207+<div class="node">
12261208 <a name="Copying"></a>
1227-<a name="SEC19"></a>
1228-<table cellpadding="1" cellspacing="1" border="0">
1229-<tr><td valign="middle" align="left">[<a href="#SEC18" title="Previous section in reading order"> &lt; </a>]</td>
1230-<td valign="middle" align="left">[<a href="#SEC20" title="Next section in reading order"> &gt; </a>]</td>
1231-<td valign="middle" align="left"> &nbsp; </td>
1232-<td valign="middle" align="left">[<a href="#SEC9" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
1233-<td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td>
1234-<td valign="middle" align="left">[<a href="#SEC20" title="Next chapter"> &gt;&gt; </a>]</td>
1235-<td valign="middle" align="left"> &nbsp; </td>
1236-<td valign="middle" align="left"> &nbsp; </td>
1237-<td valign="middle" align="left"> &nbsp; </td>
1238-<td valign="middle" align="left"> &nbsp; </td>
1239-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1240-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1241-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
1242-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1243-</tr></table>
1244-<h1 class="chapter"> 3. Copying Conditions </h1>
1245-
1246-<p><tt>GNU Source-highlight is free software; you are free to use, share and modify it
1209+<p><hr>
1210+Next:&nbsp;<a rel="next" accesskey="n" href="#Simple-Usage">Simple Usage</a>,
1211+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Installation">Installation</a>,
1212+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
1213+
1214+</div>
1215+
1216+<h2 class="chapter">3 Copying Conditions</h2>
1217+
1218+<p><a name="index-Copying-conditions-66"></a>
1219+GNU Source-highlight is free software; you are free to use, share and modify it
12471220 under the terms of the GNU General Public License that accompanies this software
1248-(see &lsquo;<tt>COPYING</tt>&rsquo;).
1249-</tt></p>
1250-<p><tt>GNU <code>source-highlight</code> was written and
1221+(see <samp><span class="file">COPYING</span></samp>).
1222+
1223+ <p>GNU <samp><span class="command">source-highlight</span></samp> was written and
12511224 maintained by Lorenzo Bettini <a href="http://www.lorenzobettini.it">http://www.lorenzobettini.it</a>.
1252-</tt></p>
1253-<hr size="6">
1254-<a name="g_t_7c21_5358_306a_4f7f_3044_65b9"></a>
1255-<a name="SEC20"></a>
1256-<table cellpadding="1" cellspacing="1" border="0">
1257-<tr><td valign="middle" align="left">[<a href="#SEC19" title="Previous section in reading order"> &lt; </a>]</td>
1258-<td valign="middle" align="left">[<a href="#SEC21" title="Next section in reading order"> &gt; </a>]</td>
1259-<td valign="middle" align="left"> &nbsp; </td>
1260-<td valign="middle" align="left">[<a href="#SEC19" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
1261-<td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td>
1262-<td valign="middle" align="left">[<a href="#SEC26" title="Next chapter"> &gt;&gt; </a>]</td>
1263-<td valign="middle" align="left"> &nbsp; </td>
1264-<td valign="middle" align="left"> &nbsp; </td>
1265-<td valign="middle" align="left"> &nbsp; </td>
1266-<td valign="middle" align="left"> &nbsp; </td>
1267-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1268-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1269-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
1270-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1271-</tr></table>
1272-<h1 class="chapter"> 4. 簡単な使い方 </h1>
1273-
1274-<p><tt>ここで、<code>source-highlight</code>実行する実際的な例を示す<a name="DOCF10" href="#FOOT10">(10)</a>。
1275-</tt></p>
1276-<p><tt>Source-highlightは、ソースコードの字面だけを解析するので、そのプログラムソースが正しく書かれていることが前提となっている。
1277-</tt></p>
1278-<p><tt>source-highlightの実行方法を示す(この例ではC/C++の入力ファイルを使うが、それ以外のsource-highlightの入力言語に対しても有効である):
1279-</tt></p>
1280-<table><tr><td>&nbsp;</td><td><pre class="example"><tt>source-highlight --src-lang cpp --out-format html \
1281- --input <var>&lt;C++ file&gt;</var> \
1282- --output <var>&lt;html file&gt;</var> \
1283- --style-file <var>&lt;style file&gt;</var> \
1284- <var>options</var>
1285-</tt></pre></td></tr></table>
1286-
1287-<p><tt>入力ファイルについては、<code>-i (--input)</code>オプションと標準入力のリダイレクトとは別に、単にコマンドラインに複数のファイルを指定することができ、正規表現を使ってもよい(たとえば、&lsquo;<tt>*.java</tt>&rsquo;)。
1288-この場合には、出力ファイルの名前は、ソースファイルの名前に.&lt;ext&gt;を追加して作られる。
1289-この&lt;ext&gt;の部分は、指定された出力フォーマットに応じて選択される拡張しだ(この例では.htmlになる)。
1290-style file(<a href="#SEC27">出力フォーマットスタイル</a>)には、指定言語の各部のフォーマット方法についての情報を入れる(キーワードを青のボールドで、など)。
1291-</tt></p>
1292-<p><tt>重要:上述の二つの起動モード、<code>-i (--input)</code>と<code>-o (--output)</code>を使う(標準入出力のリダイレクトに置き換えることも可能)か、あるいは<code>-i (--input)</code>を使わずに一つ以上のファイル名を指定するか、どちらか一つを選ばなければならない。
1293-これらを混ぜて使うとエラーとなるだろう:
1294-</tt></p>
1295-<table><tr><td>&nbsp;</td><td><pre class="example"><tt>source-highlight -o main.html main.cpp
1296-Please, use one of the two syntaxes for invocation:
1297-source-highlight [OPTIONS]... -i input_file -o output_file
1298-source-highlight [OPTIONS]... [FILES]...
1299-</tt></pre></td></tr></table>
1300-
1301-<p><tt><code>STDOUT</code>という文字列が<code>-o (--output)</code>オプションとして渡された場合、出力は標準出力に強制される。
1302-</tt></p>
1303-<p><tt><code>-s (--src-lang)</code>が指定されていなければ、ソース言語は、入力ファイルの拡張子もしくはファイル名自体から推定される(小文字のバージョンを使うかもしれない(訳注:えーと?後でも出てくるが、どういう意味だろう。ファイル名を小文字にした名前の言語定義ファイルを使うこともあるとか...そういう意味かな?))。
1304-これは、もちろん、標準入力のリダイレクトでは働かない。
1305-詳細については、<a href="#SEC36">入力言語の検出方法</a>を参照してほしい。
1306-</tt></p>
1307-<p><tt><code>-f (--out-format)</code>が指定されていない場合、出力はHTMLで生成される。
1308-</tt></p>
1309-<p><tt><code>--style-file</code>が指定されていなければ、配布物に含まれている&lsquo;<tt>default.style</tt>&rsquo;が使われる(詳細は<a href="#SEC27">出力フォーマットスタイル</a>を参照していほしい)。
1310-</tt></p>
1311-<table class="menu" border="0" cellspacing="0">
1312-<tr><td align="left" valign="top"><a href="#SEC21">4.1 HTMLの出力とXHTMLの出力</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
1313-</td></tr>
1314-<tr><td align="left" valign="top"><a href="#SEC22">4.2 LaTeXの出力</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
1315-</td></tr>
1316-<tr><td align="left" valign="top"><a href="#SEC23">4.3 Texinfoの出力</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
1317-</td></tr>
1318-<tr><td align="left" valign="top"><a href="#SEC24">4.4 DocBookの出力</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
1319-</td></tr>
1320-<tr><td align="left" valign="top"><a href="#SEC25">4.5 ANSIカラーエスケープシーケンス</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
1321-</td></tr>
1322-</table>
1323-
1324-<hr size="6">
1325-<a name="HTML_306e_51fa_529b_3068XHTML_306e_51fa_529b"></a>
1326-<a name="SEC21"></a>
1327-<table cellpadding="1" cellspacing="1" border="0">
1328-<tr><td valign="middle" align="left">[<a href="#SEC20" title="Previous section in reading order"> &lt; </a>]</td>
1329-<td valign="middle" align="left">[<a href="#SEC22" title="Next section in reading order"> &gt; </a>]</td>
1330-<td valign="middle" align="left"> &nbsp; </td>
1331-<td valign="middle" align="left">[<a href="#SEC20" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
1332-<td valign="middle" align="left">[<a href="#SEC20" title="Up section"> Up </a>]</td>
1333-<td valign="middle" align="left">[<a href="#SEC26" title="Next chapter"> &gt;&gt; </a>]</td>
1334-<td valign="middle" align="left"> &nbsp; </td>
1335-<td valign="middle" align="left"> &nbsp; </td>
1336-<td valign="middle" align="left"> &nbsp; </td>
1337-<td valign="middle" align="left"> &nbsp; </td>
1338-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1339-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1340-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
1341-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1342-</tr></table>
1343-<h2 class="section"> 4.1 HTMLの出力とXHTMLの出力 </h2>
1344-
1345-<p><tt>HTMLとXHTMLのデフォルトの出力フォーマットでは、フォーマットされた出力全部が<code>&lt;tt&gt;</code>と<code>&lt;/tt&gt;</code>の間に挟まれて、等幅フォントが使われるようになる。
1346-なので、たとえば、等幅あるいは非等幅の指定(<a href="#SEC27">出力フォーマットスタイル</a>を参照)というのは効果が無い。
1347-文字は全て等幅になる。
1348-このデフォルトの動作が相応わしくなくて、デフォルトで等幅フォントにしたくない場合には(そのままということ。たとえばLaTeX出力)、コマンドラインの引数<code>--outlang-def</code>で、&lsquo;<tt>html_notfixed.outlang</tt>&rsquo;というファイルを使うことができる。
1349-XHTMLの出力については、それに対応して、&lsquo;<tt>xhtml_notfixed.outlang</tt>&rsquo;というファイルがある。
1350-</tt></p>
1351-<p><tt>さらに、&lsquo;<tt>htmltable.outlang</tt>&rsquo;というファイルが、HTMLテーブルに括られたHTMLを出力するのに使われる(スタイルファイルで指定すれば背景色も使用する)。
1352-&lsquo;<tt>xhtmltable.outlang</tt>&rsquo;というファイルがXHTMLの出力に対して同じことをするものだ。
1353-</tt></p>
1354-<hr size="6">
1355-<a name="LaTeX_306e_51fa_529b"></a>
1356-<a name="SEC22"></a>
1357-<table cellpadding="1" cellspacing="1" border="0">
1358-<tr><td valign="middle" align="left">[<a href="#SEC21" title="Previous section in reading order"> &lt; </a>]</td>
1359-<td valign="middle" align="left">[<a href="#SEC23" title="Next section in reading order"> &gt; </a>]</td>
1360-<td valign="middle" align="left"> &nbsp; </td>
1361-<td valign="middle" align="left">[<a href="#SEC20" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
1362-<td valign="middle" align="left">[<a href="#SEC20" title="Up section"> Up </a>]</td>
1363-<td valign="middle" align="left">[<a href="#SEC26" title="Next chapter"> &gt;&gt; </a>]</td>
1364-<td valign="middle" align="left"> &nbsp; </td>
1365-<td valign="middle" align="left"> &nbsp; </td>
1366-<td valign="middle" align="left"> &nbsp; </td>
1367-<td valign="middle" align="left"> &nbsp; </td>
1368-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1369-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1370-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
1371-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1372-</tr></table>
1373-<h2 class="section"> 4.2 LaTeXの出力 </h2>
1374-
1375-<p><tt>LaTeXの出力フォーマットを使うときには、単色の出力(<code>-f latex</code>を使う)と色付きの出力(<code>-f latexcolor</code>を使う)とを選択することができる。
1376-色付きの出力の場合には、{color</tt>&rsquo;パッケージが必要だ(さらに、使用しているシステムになければならない)。
1377-もちろん、自分自身のLaTeX出力フォーマットを自由に定義できる。
1378-<a href="#SEC59">出力言語の定義</a>を参照してほしい。
1379-</p>
1380-<hr size="6">
1381-<a name="Texinfo_306e_51fa_529b"></a>
1382-<a name="SEC23"></a>
1383-<table cellpadding="1" cellspacing="1" border="0">
1384-<tr><td valign="middle" align="left">[<a href="#SEC22" title="Previous section in reading order"> &lt; </a>]</td>
1385-<td valign="middle" align="left">[<a href="#SEC24" title="Next section in reading order"> &gt; </a>]</td>
1386-<td valign="middle" align="left"> &nbsp; </td>
1387-<td valign="middle" align="left">[<a href="#SEC20" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
1388-<td valign="middle" align="left">[<a href="#SEC20" title="Up section"> Up </a>]</td>
1389-<td valign="middle" align="left">[<a href="#SEC26" title="Next chapter"> &gt;&gt; </a>]</td>
1390-<td valign="middle" align="left"> &nbsp; </td>
1391-<td valign="middle" align="left"> &nbsp; </td>
1392-<td valign="middle" align="left"> &nbsp; </td>
1393-<td valign="middle" align="left"> &nbsp; </td>
1394-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1395-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1396-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
1397-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1398-</tr></table>
1399-<h2 class="section"> 4.3 Texinfoの出力 </h2>
1400-
1401-<p>Texinfoの出力フォーマットを使うときには、<code>--style-file</code>オプションを使って、source-highlightの配布物に入って献呈されているスタイルファイル、&lsquo;<tt>texinfo.style</tt>&rsquo;を使ってもよい。
1402-たとえば、<a href="#SEC71">例</a>にある例はこのスタイルファイルでフォーマットされている。
1403-</p>
1404-<hr size="6">
1405-<a name="DocBook_306e_51fa_529b"></a>
1406-<a name="SEC24"></a>
1407-<table cellpadding="1" cellspacing="1" border="0">
1408-<tr><td valign="middle" align="left">[<a href="#SEC23" title="Previous section in reading order"> &lt; </a>]</td>
1409-<td valign="middle" align="left">[<a href="#SEC25" title="Next section in reading order"> &gt; </a>]</td>
1410-<td valign="middle" align="left"> &nbsp; </td>
1411-<td valign="middle" align="left">[<a href="#SEC20" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
1412-<td valign="middle" align="left">[<a href="#SEC20" title="Up section"> Up </a>]</td>
1413-<td valign="middle" align="left">[<a href="#SEC26" title="Next chapter"> &gt;&gt; </a>]</td>
1414-<td valign="middle" align="left"> &nbsp; </td>
1415-<td valign="middle" align="left"> &nbsp; </td>
1416-<td valign="middle" align="left"> &nbsp; </td>
1417-<td valign="middle" align="left"> &nbsp; </td>
1418-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1419-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1420-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
1421-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1422-</tr></table>
1423-<h2 class="section"> 4.4 DocBookの出力 </h2>
1424-
1425-<p>DocBookの出力は<code>&lt;programlisting&gt;</code>タグを使って生成される。
1426-もし、<code>--doc</code>というコマンドラインオプションが指定されれば、<code>&lt;article&gt;</code>ドキュメントが生成される。
1427-</p>
1428-<hr size="6">
1429-<a name="ANSI_30ab_30e9_30fc_30a8_30b9_30b1_30fc_30d7_30b7_30fc_30b1_30f3_30b9"></a>
1430-<a name="SEC25"></a>
1431-<table cellpadding="1" cellspacing="1" border="0">
1432-<tr><td valign="middle" align="left">[<a href="#SEC24" title="Previous section in reading order"> &lt; </a>]</td>
1433-<td valign="middle" align="left">[<a href="#SEC26" title="Next section in reading order"> &gt; </a>]</td>
1434-<td valign="middle" align="left"> &nbsp; </td>
1435-<td valign="middle" align="left">[<a href="#SEC20" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
1436-<td valign="middle" align="left">[<a href="#SEC20" title="Up section"> Up </a>]</td>
1437-<td valign="middle" align="left">[<a href="#SEC26" title="Next chapter"> &gt;&gt; </a>]</td>
1438-<td valign="middle" align="left"> &nbsp; </td>
1439-<td valign="middle" align="left"> &nbsp; </td>
1440-<td valign="middle" align="left"> &nbsp; </td>
1441-<td valign="middle" align="left"> &nbsp; </td>
1442-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1443-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1444-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
1445-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1446-</tr></table>
1447-<h2 class="section"> 4.5 ANSIカラーエスケープシーケンス </h2>
1448-
1449-<p>この出力フォーマットを、たとえば、<code>less</code>と一緒に使っているならば(<a href="#SEC16">lessでのsource-highlightの使用</a>)、<code>--style-file</code>オプションで、source-highlightの配布物に入れられている&lsquo;<tt>esc.style</tt>&rsquo;を使ってもよい。
1450-これにより、楽しい色付きの出力が得られる。
1451-</p>
1452-<hr size="6">
1453-<a name="g_t_8a2d_5b9a_30d5_30a1_30a4_30eb"></a>
1454-<a name="SEC26"></a>
1455-<table cellpadding="1" cellspacing="1" border="0">
1456-<tr><td valign="middle" align="left">[<a href="#SEC25" title="Previous section in reading order"> &lt; </a>]</td>
1457-<td valign="middle" align="left">[<a href="#SEC27" title="Next section in reading order"> &gt; </a>]</td>
1458-<td valign="middle" align="left"> &nbsp; </td>
1459-<td valign="middle" align="left">[<a href="#SEC20" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
1460-<td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td>
1461-<td valign="middle" align="left">[<a href="#SEC35" title="Next chapter"> &gt;&gt; </a>]</td>
1462-<td valign="middle" align="left"> &nbsp; </td>
1463-<td valign="middle" align="left"> &nbsp; </td>
1464-<td valign="middle" align="left"> &nbsp; </td>
1465-<td valign="middle" align="left"> &nbsp; </td>
1466-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1467-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1468-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
1469-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1470-</tr></table>
1471-<h1 class="chapter"> 5. 設定ファイル </h1>
1472-
1473-<p>実行の際、source-highlightはいくつかのファイルを必要としていて、そのようなファイルで、ソース言語を認識する方法(<code>--src-lang</code>や<code>--lang-def</code>で明示的に指定されていない場合)、あるいは、使用する出力フォーマットをどれにするか(<code>--out-format</code>や<code>--outlang-def</code>で明示的に指定されていない場合)、ソースの各要素をフォーマットする方法(たとえば、キーワードとかコメントとか)、そして、ソース言語の定義や出力言語の定義といったことの指示を見つけることになる。
1474-これらのファイルについては次のセクションで説明する。
1475-</p>
1476-<a name="IDX45"></a>
1477-<p>もし、そういったファイルのディレクトリが<code>--data-dir</code>というコマンドラインオプションで明示されていなければ、次の順でこれらのファイルを探す:
1478-</p>
1479-<ul class="toc">
1480-<li>
1481-カレントディレクトリ
1482-</li><li>
1483-設定ファイルのインストールディレクトリ。
1484-<a href="#SEC9">インストール</a>を参照(このディレクトリは、コンパイル時にsource-highlightにハードコードされていることを覚えていてほしい)。
1485-</li><li>
1486-source-highlightコマンドが明示的なパス名を付けて指定された場合、インストールディレクトリが依然使用されるが、その明示したパス名に対して相対的である(訳注:イマイチ理解していない)。
1487-</li></ul>
14881225
1489-<p>とくに、ユーザは、環境変数
1490-<a name="IDX46"></a>
1491-<code>SOURCE_HIGHLIGHT_DATADIR</code>でも値をセットすることができる(<a href="#SEC3"><code>source-highlight-settings</code>プログラム</a>も参照)。
1492-</p>
1493-<p>実行の際にどのファイルが使われているかを確認したいときは、<code>--verbose</code>オプションを使うことができる。
1494-</p>
1495-<table class="menu" border="0" cellspacing="0">
1496-<tr><td align="left" valign="top"><a href="#SEC27">5.1 出力フォーマットスタイル</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
1497-</td></tr>
1498-<tr><td align="left" valign="top"><a href="#SEC28">5.2 CSSを使用した出力フォーマットスタイル</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
1499-</td></tr>
1500-<tr><td align="left" valign="top"><a href="#SEC29">5.3 デフォルトのスタイル</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
1501-</td></tr>
1502-<tr><td align="left" valign="top"><a href="#SEC30">5.4 言語マップ</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
1503-</td></tr>
1504-<tr><td align="left" valign="top"><a href="#SEC31">5.5 言語の定義ファイル</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
1505-</td></tr>
1506-<tr><td align="left" valign="top"><a href="#SEC32">5.6 出力言語マップ</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
1507-</td></tr>
1508-<tr><td align="left" valign="top"><a href="#SEC33">5.7 出力言語の定義ファイル</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
1509-</td></tr>
1510-<tr><td align="left" valign="top"><a href="#SEC34">5.8 独自定義ファイルの開発</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
1511-</td></tr>
1512-</table>
1513-
1514-<hr size="6">
1515-<a name="g_t_51fa_529b_30d5_30a9_30fc_30de_30c3_30c8_30b9_30bf_30a4_30eb"></a>
1516-<a name="SEC27"></a>
1517-<table cellpadding="1" cellspacing="1" border="0">
1518-<tr><td valign="middle" align="left">[<a href="#SEC26" title="Previous section in reading order"> &lt; </a>]</td>
1519-<td valign="middle" align="left">[<a href="#SEC28" title="Next section in reading order"> &gt; </a>]</td>
1520-<td valign="middle" align="left"> &nbsp; </td>
1521-<td valign="middle" align="left">[<a href="#SEC26" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
1522-<td valign="middle" align="left">[<a href="#SEC26" title="Up section"> Up </a>]</td>
1523-<td valign="middle" align="left">[<a href="#SEC35" title="Next chapter"> &gt;&gt; </a>]</td>
1524-<td valign="middle" align="left"> &nbsp; </td>
1525-<td valign="middle" align="left"> &nbsp; </td>
1526-<td valign="middle" align="left"> &nbsp; </td>
1527-<td valign="middle" align="left"> &nbsp; </td>
1528-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1529-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1530-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
1531-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1532-</tr></table>
1533-<h2 class="section"> 5.1 出力フォーマットスタイル </h2>
1534-
1535-<p>&lsquo;<tt>default.style</tt>&rsquo;というファイルにシンタックスハイライティングのオプションを指定しなければならない<a name="DOCF11" href="#FOOT11">(11)</a>。
1536-言語定義のファイルで定義された各要素について、フォーマッティングのオプションを指定することができる(その要素のリストは、
1537-<a name="IDX47"></a>
1538-<code>--show-lang-elements</code>を使うと得られる)。
1539-<a href="#SEC52">言語エレメントの一覧</a>を参照してほしい。
1540-</p>
1541-<a name="IDX48"></a>
1542-<a name="IDX49"></a>
1543-<p>バージョン2.6から、出力ドキュメントの背景色も指定できる。
1544-これには<code>bgcolor</code>というキーワードを使う(<code>--doc</code>というコマンドラインオプションが使われたときだけ目にできるかもしれない)。
1545-</p>
1546-<p>多数のエレメントが、同じフォーマッティングオプションを共有している場合、同じ行に、これらのエレメントをカンマで分割して指定することができる<a name="DOCF12" href="#FOOT12">(12)</a>。
1547-</p>
1548-<p>ここに、この配布物と一緒に入っている&lsquo;<tt>default.style</tt>&rsquo;がある(これは、<a href="#SEC55">言語定義のチュートリアル</a>で示されている&lsquo;<tt>style.lang</tt>&rsquo;を使ってフォーマットされている):
1549-</p>
1550-<table><tr><td>&nbsp;</td><td><pre class="example"><b>bgcolor</b> <tt>&quot;white&quot;</tt>; <span class="roman"><i>// the background color for documents</i></span>
1551-<tt><i>context</i></tt> <b>gray</b>; <span class="roman"><i>// the color for context lines (when specified with line ranges)</i></span>
1552-
1553-<tt><i>keyword</i></tt> <b>blue</b> <b>b</b> ; <span class="roman"><i>// for language keywords</i></span>
1554-<tt><i>type</i></tt> <b>darkgreen</b> ; <span class="roman"><i>// for basic types</i></span>
1555-<tt><i>usertype</i></tt> <b>teal</b> ; <span class="roman"><i>// for user defined types</i></span>
1556-<tt><i>string</i></tt> <b>red</b> <b>f</b> ; <span class="roman"><i>// for strings and chars</i></span>
1557-<tt><i>regexp</i></tt> <b>orange</b> <b>f</b> ; <span class="roman"><i>// for strings and chars</i></span>
1558-<tt><i>specialchar</i></tt> <b>pink</b> <b>f</b> ; <span class="roman"><i>// for special chars, e.g., \n, \t, \\</i></span>
1559-<tt><i>comment</i></tt> <b>brown</b> <b>i</b>, <b>noref</b>; <span class="roman"><i>// for comments</i></span>
1560-<tt><i>number</i></tt> <b>purple</b> ; <span class="roman"><i>// for literal numbers</i></span>
1561-<tt><i>preproc</i></tt> <b>darkblue</b> <b>b</b> ; <span class="roman"><i>// for preproc directives (e.g. #include, import)</i></span>
1562-<tt><i>symbol</i></tt> <b>darkred</b> ; <span class="roman"><i>// for simbols (e.g. &lt;, &gt;, +)</i></span>
1563-<tt><i>function</i></tt> <b>black</b> <b>b</b>; <span class="roman"><i>// for function calls and declarations</i></span>
1564-<tt><i>cbracket</i></tt> <b>red</b>; <span class="roman"><i>// for block brackets (e.g. {, })</i></span>
1565-<tt><i>todo</i></tt> <b>bg:cyan</b> <b>b</b>; <span class="roman"><i>// for TODO and FIXME</i></span>
1566-
1567-<span class="roman"><i>//Predefined variables and functions (for instance glsl)</i></span>
1568-<tt><i>predef_var</i></tt> <b>darkblue</b> ;
1569-<tt><i>predef_func</i></tt> <b>darkblue</b> <b>b</b> ;
1570-
1571-<span class="roman"><i>// for OOP</i></span>
1572-<tt><i>classname</i></tt> <b>teal</b> ; <span class="roman"><i>// for class names, e.g., in Java and C++</i></span>
1573-
1574-<span class="roman"><i>// line numbers</i></span>
1575-<b>linenum</b> <b>black</b> <b>f</b>;
1576-
1577-<span class="roman"><i>// Internet related</i></span>
1578-<tt><i>url</i></tt> <b>blue</b> <b>u</b>, <b>f</b>;
1579-
1580-<span class="roman"><i>// other elements for ChangeLog and Log files</i></span>
1581-<tt><i>date</i></tt> <b>blue</b> <b>b</b> ;
1582-<tt><i>time</i></tt>, <tt><i>file</i></tt> <b>darkblue</b> <b>b</b> ;
1583-<tt><i>ip</i></tt>, <tt><i>name</i></tt> <b>darkgreen</b> ;
1584-
1585-<span class="roman"><i>// for Prolog, Perl...</i></span>
1586-<tt><i>variable</i></tt> <b>darkgreen</b> ;
1587-
1588-<span class="roman"><i>// explicit for Latex</i></span>
1589-<tt><i>italics</i></tt> <b>darkgreen</b> <b>i</b>;
1590-<tt><i>bold</i></tt> <b>darkgreen</b> <b>b</b>;
1591-<tt><i>underline</i></tt> <b>darkgreen</b> <b>u</b>;
1592-<tt><i>fixed</i></tt> <b>green</b> <b>f</b>;
1593-<tt><i>argument</i></tt> <b>darkgreen</b>;
1594-<tt><i>optionalargument</i></tt> <b>purple</b>;
1595-<tt><i>math</i></tt> <b>orange</b>;
1596-<tt><i>bibtex</i></tt> <b>blue</b>;
1597-
1598-<span class="roman"><i>// for diffs</i></span>
1599-<tt><i>oldfile</i></tt> <b>orange</b>;
1600-<tt><i>newfile</i></tt> <b>darkgreen</b>;
1601-<tt><i>difflines</i></tt> <b>blue</b>;
1602-
1603-<span class="roman"><i>// for css</i></span>
1604-<tt><i>selector</i></tt> <b>purple</b>;
1605-<tt><i>property</i></tt> <b>blue</b>;
1606-<tt><i>value</i></tt> <b>darkgreen</b> <b>i</b>;
1607-
1608-<span class="roman"><i>// for oz</i></span>
1609-<tt><i>atom</i></tt> <b>orange</b>;
1610-<tt><i>meta</i></tt> <b>i</b>;
1611-
1612-<span class="roman"><i>// for file system</i></span>
1613-<tt><i>path</i></tt> <b>orange</b>;
1614-
1615-<span class="roman"><i>// for C (or other language) labels</i></span>
1616-<tt><i>label</i></tt> <b>teal</b> <b>b</b>;
1617-
1618-<span class="roman"><i>// for errors</i></span>
1619-<tt><i>error</i></tt> <b>purple</b>;
1620-<tt><i>warning</i></tt> <b>darkgreen</b>;
1621-</pre></td></tr></table>
1622-<p>このファイルは、Source-highlightの配布物に一緒に入っている言語定義で定義されているほとんどのエレメントについてスタイル定義を試みている。
1623-</p>
1624-<a name="IDX50"></a>
1625-<p>コマンドラインオプションの<code>--style-file</code>で、独自のファイルを指定することもできる(&lsquo;<tt>default.style</tt>&rsquo;という名前である必要はない)<a name="DOCF13" href="#FOOT13">(13)</a>。
1626-<a href="#SEC35"><code>source-highlight</code>の起動</a>を参照してほしい。
1627-</p>
1628-<p>次の行を追加するとノーマルテキストの色を指定することもできる。
1629-</p>
1630-<table><tr><td>&nbsp;</td><td><pre class="example">normal darkblue ;
1631-</pre></td></tr></table>
1632-
1633-<a name="IDX51"></a>
1634-<a name="IDX52"></a>
1635-<p>ご覧のように、このファイルのシンタックスはかなり素直だ。
1636-エレメント(あるいはカンマで区切られた複数のエレメント)の後に色を指定できる。
1637-<code>bg:</code>というプリフィックスを使えば背景色<a name="DOCF14" href="#FOOT14">(14)</a>も指定できる(一例として、前述の&lsquo;<tt>default.style</tt>&rsquo;では<code>todo</code>エレメントに背景色が指定されている)。
1638-</p>
1639-<p>背景色は出力フォーマットの全てで利用できるわけではないことに注意してほしい。
1640-XHTMLやLaTeXでは利用できるが、HTML<a name="DOCF15" href="#FOOT15">(15)</a>ではそうではない。
1641-</p>
1642-<a name="IDX53"></a>
1643-<a name="IDX54"></a>
1644-<a name="IDX55"></a>
1645-<a name="IDX56"></a>
1646-<a name="IDX57"></a>
1647-<p>それから、ボールドやイタリックなどのような、それ以上のフォーマティングオプションを指定することができる。
1648-以下が使用できるキーワードだ:
1649-</p>
1650-<table><tr><td>&nbsp;</td><td><pre class="example">b = bold
1651-i = italics
1652-u = underline
1653-f = fixed
1654-nf = not fixed
1655-noref = no reference information is generated for these elements
1656-</pre></td></tr></table>
1657-
1658-<a name="IDX58"></a>
1659-<p>バージョン2.2からは、色の指定が不要になった。
1660-たとえば、&lsquo;<tt>texinfo.style</tt>&rsquo;を次に示す(Texinfoの出力に対して色を使っていない):
1661-</p>
1662-<table><tr><td>&nbsp;</td><td><pre class="example"><tt><i>keyword</i></tt>, <tt><i>type</i></tt> <b>b</b> ;
1663-<tt><i>variable</i></tt> <b>f</b>, <b>i</b> ;
1664-<tt><i>string</i></tt> <b>f</b> ;
1665-<tt><i>regexp</i></tt> <b>f</b> ;
1666-<tt><i>comment</i></tt> <b>nf</b>, <b>i</b>, <b>noref</b> ;
1667-<tt><i>preproc</i></tt> <b>b</b> ;
1668-
1669-<span class="roman"><i>// line numbers</i></span>
1670-<b>linenum</b> <b>f</b>;
1671-
1672-<span class="roman"><i>// Internet related</i></span>
1673-<tt><i>url</i></tt> <b>f</b>;
1674-
1675-<span class="roman"><i>// for diffs</i></span>
1676-<tt><i>oldfile</i></tt>, <tt><i>newfile</i></tt> <b>i</b>;
1677-<tt><i>difflines</i></tt> <b>b</b>;
1678-
1679-<span class="roman"><i>// for css</i></span>
1680-<tt><i>selector</i></tt>, <tt><i>property</i></tt> <b>b</b>;
1681-<tt><i>value</i></tt> <b>i</b>;
1682-</pre></td></tr></table>
1683-<p>これらのオプションはカンマ区切りで複数指定してもよい。
1684-たとえば次のようになる。
1685-</p>
1686-<table><tr><td>&nbsp;</td><td><pre class="example">keyword blue u, b ;
1687-</pre></td></tr></table>
1688-
1689-<p>覚えていてほしいのだが、この場合では、指定されたオプションの順序は、その出力が生成されるときにも保持される。
1690-たとえば、指定された出力フォーマットによって、<code>u, b</code>いう並びと、<code>b, u</code>という並びとでは、異なった結果をもたらすかもしれないということだ。
1691-とくに、1番目に指定されたスタイルは、その後に指定されたスタイルの後に使われる。
1692-たとえば、HTMLの場合、<code>u, b</code>という並びは、<code>&lt;u&gt;&lt;b&gt;...&lt;/b&gt;&lt;/u&gt;</code>というフォーマット結果を生む。
1693-</p>
1694-<a name="IDX59"></a>
1695-<p><code>noref</code>オプションは、このエレメントについて、リファレンス情報が生成されないというとを指定する(<a href="#SEC70">リファレンスの生成</a>を参照)。
1696-たとえば、これは<code>comment</code>エレメントに対して使われる。
1697-コメント内のエレメントについてクロスリファレンスを探索したいとは思わないからだ。
1698-</p>
1699-<p>以下は、source-highlightが処理可能な色の論理名である<a name="DOCF16" href="#FOOT16">(16)</a>:
1700-</p>
1701-<table><tr><td>&nbsp;</td><td><pre class="example">black
1702-red
1703-darkred
1704-brown
1705-yellow
1706-cyan
1707-blue
1708-pink
1709-purple
1710-orange
1711-brightorange
1712-green
1713-brightgreen
1714-darkgreen
1715-teal
1716-gray
1717-darkblue
1718-white
1719-</pre></td></tr></table>
1720-
1721-<a name="IDX60"></a>
1722-<p>二重引用符を用いれば、指定した出力フォーマットのカラースキームを直接使うこともできる。
1723-たとえばHTMLにおける<code>&quot;#00FF00&quot;</code><a name="DOCF17" href="#FOOT17">(17)</a>、あるいは、<code>&quot;lightblue&quot;</code>のように、二重引用符で括られた文字列の色名すら使うことができる<a name="DOCF18" href="#FOOT18">(18)</a>。
1724-もちろん、生成の際、二重引用符は取り除かれる。
1725-</p>
1726-<p>たとえば、次のものは&lsquo;<tt>tests</tt>&rsquo;ディレクトリで使われている&lsquo;<tt>syslog.style</tt>&rsquo;である。
1727-これは、カラースキームを直接使用している。
1728-</p>
1729-<table><tr><td>&nbsp;</td><td><pre class="example"><tt><i>date</i></tt>, <tt><i>keyword</i></tt> <b>yellow</b> <b>b</b> ;
1730-<tt><i>time</i></tt> <tt>&quot;#9999FF&quot;</tt> ;
1731-<tt><i>ip</i></tt> <tt>&quot;lightblue&quot;</tt> <b>b</b> ;
1732-
1733-<tt><i>type</i></tt> <b>cyan</b> <b>b</b> ;
1734-<tt><i>string</i></tt> <tt>&quot;brown&quot;</tt> <b>b</b> ;
1735-<tt><i>comment</i></tt> <b>teal</b> ;
1736-<tt><i>number</i></tt> <b>red</b> ;
1737-<tt><i>preproc</i></tt> <b>cyan</b> ;
1738-<tt><i>symbol</i></tt> <b>green</b> ;
1739-<tt><i>function</i></tt> <tt>&quot;#CC66CC&quot;</tt> <b>b</b> ;
1740-<tt><i>cbracket</i></tt> <b>green</b> <b>b</b> ;
1741-<tt><i>twonumbers</i></tt> <b>green</b> <b>b</b> ;
1742-<tt><i>port</i></tt> <b>green</b> <b>b</b> ;
1743-<tt><i>webmethod</i></tt> <b>teal</b> ;
1744-
1745-<span class="roman"><i>// foo option</i></span>
1746-<tt><i>foo</i></tt> <b>red</b> <b>b</b> ; <span class="roman"><i>// foo entry</i></span>
1747-
1748-
1749-</pre></td></tr></table>
1750-<p>カラースキームを直接使用する場合には、source-highlightは変換を何も実行せず、指定されたカラースキームをそのまま出力することに注意してほしい。
1751-たとえば、<code>&quot;brown&quot;</code>という指定は、<code>brown</code>とは違う。
1752-前者はそのまま出力されるだろうが、後者は、出力フォーマットの対応する色へと変換される(HTMLについては見た目の結果は同じになりそうだ)。
1753-</p>
1754-<p>指定された出力フォーマットによって処理されるカラースキームの文字列の指定はあなた次第である。
1755-ゆえに、別々の出力フォーマットの間では、直接カラースキームを指定することはポータブルではないかもしれない。
1756-たとえば、<code>&quot;#00FF00&quot;</code>はHTMLでは有効だが、LaTeXではそうではない。
1757-</p>
1758-<hr size="6">
1759-<a name="CSS_3092_4f7f_7528_3057_305f_51fa_529b_30d5_30a9_30fc_30de_30c3_30c8_30b9_30bf_30a4_30eb"></a>
1760-<a name="SEC28"></a>
1761-<table cellpadding="1" cellspacing="1" border="0">
1762-<tr><td valign="middle" align="left">[<a href="#SEC27" title="Previous section in reading order"> &lt; </a>]</td>
1763-<td valign="middle" align="left">[<a href="#SEC29" title="Next section in reading order"> &gt; </a>]</td>
1764-<td valign="middle" align="left"> &nbsp; </td>
1765-<td valign="middle" align="left">[<a href="#SEC26" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
1766-<td valign="middle" align="left">[<a href="#SEC26" title="Up section"> Up </a>]</td>
1767-<td valign="middle" align="left">[<a href="#SEC35" title="Next chapter"> &gt;&gt; </a>]</td>
1768-<td valign="middle" align="left"> &nbsp; </td>
1769-<td valign="middle" align="left"> &nbsp; </td>
1770-<td valign="middle" align="left"> &nbsp; </td>
1771-<td valign="middle" align="left"> &nbsp; </td>
1772-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1773-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1774-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
1775-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1776-</tr></table>
1777-<h2 class="section"> 5.2 CSSを使用した出力フォーマットスタイル </h2>
1778-
1779-<p>バージョン2.6からは、制限されたCSSのシンタックスを使って出力フォーマットスタイルを指定できるようになった。
1780-これは、<code>--css</code>オプションを使ってsource-highlightが生成する出力とは無関係であることに注意してほしい。
1781-</p>
1782-<a name="IDX61"></a>
1783-<p>CSSファイルをスタイルファイルとして使うことで(すなわち、<code>--style-css-file</code>というコマンドラインオプションをへ渡すことで)、CSSと同じシンタックスを使って出力フォーマットスタイルだけを指定する。
1784-これはつまり、実際の出力とは関係無く出力フォーマットスタイルに対してCSSのシンタックスを使えるということだ(これが出力フォーマットスタイルの目的)。
1785-なので、LaTeXの場合についても出力フォーマットスタイルとしてCSSファイルを使うことができる(ちょうどsource-highlightの出力フォーマットスタイルで行なうように。<a href="#SEC27">出力フォーマットスタイル</a>)。
1786-</p>
1787-<p>この機能は基本的にコードの再利用のために用意されている。
1788-CSSファイルを使って出力フォーマットスタイルを指定してから、同じCSSファイルを他のHTMLページの実際のスタイルシートとして使うことができる(あるいは、<code>-css</code>オプションを指定してsource-highlightで生成した出力ファイルでさえも使える)。
1789-</p>
1790-<p>この機能はかなり原始的なものなので、CSSのシンタックスを制限したサブセットしか認識しない。
1791-とくに、セレクタは常にCSSのクラスセレクタとして扱うので、必ずドットから始めなければならない。
1792-<code>/* */</code>のコメントは処理される。
1793-source-highlightが処理しないプロパティ(と、その値)は単に(そして静かに)取り除かれる。
1794-</p>
1795-<p>次のものは、スタイルフォーマットの指定としてsource-highlightが正しく処理するCSSの指定の例である:
1796-</p>
1797-<table><tr><td>&nbsp;</td><td><pre class="example">body {
1798- <b>background-color:</b> &lt;<i>color</i> <i>specification</i>&gt;;
1799- }
1800-
1801-<b>.selector</b> {
1802- <b>color:</b> &lt;<i>color</i> <i>specification</i>&gt;;
1803- <b>background-color:</b> &lt;<i>color</i> <i>specification</i>&gt;;
1804- <b>font-weight:</b> <i>bold</i>; <span class="roman"><i>/* this is a comment */</i></span>
1805- <b>font-family:</b> <i>monospace</i>;
1806- <b>font-style:</b> <i>italic</i>;
1807- <b>text-decoration:</b> <i>underline</i>;
1808- }
1809-</pre></td></tr></table>
1810-<p>最後に、次のものが、<a href="#SEC27">出力フォーマットスタイル</a>で提示された&lsquo;<tt>default.style</tt>&rsquo;に対応する&lsquo;<tt>default.css</tt>&rsquo;である:
1811-</p>
1812-<table><tr><td>&nbsp;</td><td><pre class="example">body { <b>background-color:</b> <i>white</i>; }
1813-
1814-<span class="roman"><i>/* the color for context lines (when specified with line ranges) */</i></span>
1815-<b>.context</b> { <b>color:</b> <i>gray</i>; }
1816-
1817-<b>.keyword</b> { <b>color:</b> <i>blue</i>; <b>font-weight:</b> <i>bold</i>; }
1818-<b>.type</b> { <b>color:</b> <i>darkgreen</i>; }
1819-<b>.usertype</b>, <b>.classname</b> { <b>color:</b> <i>teal</i>; }
1820-<b>.string</b> { <b>color:</b> <i>red</i>; <b>font-family:</b> <i>monospace</i>; }
1821-<b>.regexp</b> { <b>color:</b> <i>orange</i>; }
1822-<b>.specialchar</b> { <b>color:</b> <i>pink</i>; <b>font-family:</b> <i>monospace</i>; }
1823-<b>.comment</b> { <b>color:</b> <i>brown</i>; <b>font-style:</b> <i>italic</i>; }
1824-<b>.number</b> { <b>color:</b> <i>purple</i>; }
1825-<b>.preproc</b> { <b>color:</b> <i>darkblue</i>; <b>font-weight:</b> <i>bold</i>; }
1826-<b>.symbol</b> { <b>color:</b> <i>darkred</i>; }
1827-<b>.function</b> { <b>color:</b> <i>black</i>; <b>font-weight:</b> <i>bold</i>; }
1828-<b>.cbracket</b> { <b>color:</b> <i>red</i>; }
1829-<b>.todo</b> { <b>font-weight:</b> <i>bold</i>; <b>background-color:</b> <i>cyan</i>; }
1830-
1831-<span class="roman"><i>/* line numbers */</i></span>
1832-<b>.linenum</b> { <b>color:</b> <i>black</i>; <b>font-family:</b> <i>monospace</i>; }
1833-
1834-<span class="roman"><i>/* Internet related */</i></span>
1835-<b>.url</b> { <b>color:</b> <i>blue</i>; <b>text-decoration:</b> <i>underline</i>; <b>font-family:</b> <i>monospace</i>; }
1836-
1837-<span class="roman"><i>/* other elements for ChangeLog and Log files */</i></span>
1838-<b>.date</b> { <b>color:</b> <i>blue</i>; <b>font-weight:</b> <i>bold</i>; }
1839-<b>.time</b>, <b>.file</b> { <b>color:</b> <i>darkblue</i>; <b>font-weight:</b> <i>bold</i>; }
1840-<b>.ip</b>, <b>.name</b> { <b>color:</b> <i>darkgreen</i>; }
1841-
1842-<span class="roman"><i>/* for Prolog, Perl */</i></span>
1843-<b>.variable</b> { <b>color:</b> <i>darkgreen</i>; }
1844-<b>.italics</b> { <b>color:</b> <i>darkgreen</i>; <b>font-style:</b> <i>italic</i>; }
1845-<b>.bold</b> { <b>color:</b> <i>darkgreen</i>; <b>font-weight:</b> <i>bold</i>; }
1846-
1847-<span class="roman"><i>/* for LaTeX */</i></span>
1848-<b>.underline</b> { <b>color:</b> <i>darkgreen</i>; <b>text-decoration:</b> <i>underline</i>; }
1849-<b>.fixed</b> { <b>color:</b> <i>green</i>; <b>font-family:</b> <i>monospace</i>; }
1850-<b>.argument</b>, <b>.optionalargument</b> { <b>color:</b> <i>darkgreen</i>; }
1851-<b>.math</b> { <b>color:</b> <i>orange</i>; }
1852-<b>.bibtex</b> { <b>color:</b> <i>blue</i>; }
1853-
1854-<span class="roman"><i>/* for diffs */</i></span>
1855-<b>.oldfile</b> { <b>color:</b> <i>orange</i>; }
1856-<b>.newfile</b> { <b>color:</b> <i>darkgreen</i>; }
1857-<b>.difflines</b> { <b>color:</b> <i>blue</i>; }
1858-
1859-<span class="roman"><i>/* for css */</i></span>
1860-<b>.selector</b> { <b>color:</b> <i>purple</i>; }
1861-<b>.property</b> { <b>color:</b> <i>blue</i>; }
1862-<b>.value</b> { <b>color:</b> <i>darkgreen</i>; <b>font-style:</b> <i>italic</i>; }
1863-
1864-<span class="roman"><i>/* for Oz */</i></span>
1865-<b>.atom</b> { <b>color:</b> <i>orange</i>; }
1866-<b>.meta</b> { <b>font-style:</b> <i>italic</i>; }
1867-
1868-</pre></td></tr></table>
1869-<p>このファイルを<code>--style-css-file</code>というコマンドラインオプションに渡して、出力ファイルを生成すれば、&lsquo;<tt>default.style</tt>&rsquo;を使った場合と同じ結果が得られるだろう。
1870-</p>
1871-<p>source-highlightには、HTMLドキュメントの標準的なCSSファイルとしても、あるいは、<code>--style-css-file</code>へ渡すスタイルファイルとしても使える沢山のCSSファイルが付属している。
1872-ドキュメンテーションのインストールディレクトリの中に&lsquo;<tt>style_examples.html</tt>&rsquo;というファイルがある。
1873-これは多数の出力例を示すもので、それぞれ別々のCSSスタイルを使ったものだ。
1874-</p>
1875-<hr size="6">
1876-<a name="g_t_30c7_30d5_30a9_30eb_30c8_306e_30b9_30bf_30a4_30eb"></a>
1877-<a name="SEC29"></a>
1878-<table cellpadding="1" cellspacing="1" border="0">
1879-<tr><td valign="middle" align="left">[<a href="#SEC28" title="Previous section in reading order"> &lt; </a>]</td>
1880-<td valign="middle" align="left">[<a href="#SEC30" title="Next section in reading order"> &gt; </a>]</td>
1881-<td valign="middle" align="left"> &nbsp; </td>
1882-<td valign="middle" align="left">[<a href="#SEC26" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
1883-<td valign="middle" align="left">[<a href="#SEC26" title="Up section"> Up </a>]</td>
1884-<td valign="middle" align="left">[<a href="#SEC35" title="Next chapter"> &gt;&gt; </a>]</td>
1885-<td valign="middle" align="left"> &nbsp; </td>
1886-<td valign="middle" align="left"> &nbsp; </td>
1887-<td valign="middle" align="left"> &nbsp; </td>
1888-<td valign="middle" align="left"> &nbsp; </td>
1889-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1890-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1891-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
1892-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1893-</tr></table>
1894-<h2 class="section"> 5.3 デフォルトのスタイル </h2>
1895-
1896-<p>次のファイル<a name="DOCF19" href="#FOOT19">(19)</a>(デフォルトファイルは&lsquo;<tt>style.defaults</tt>&rsquo;)は、スタイルファイルの中で、出力スタイルが指定されていない言語エレメントのデフォルトスタイルのリストだ。
1897-特に次の行を見てほしい(コメント行は<code>#</code>で始まる):
1898-</p>
1899-<table><tr><td>&nbsp;</td><td><pre class="example">elem1 = elem2
1900-</pre></td></tr></table>
1901-
1902-<p>この行は、エレメント、ここではelem1に対するスタイルが、スタイルファイルで指定されていない場合、elem1がelem2と同じスタイルを持つということを示している。
1903-</p>
1904-<a name="IDX62"></a>
1905-<p>たとえば、次のものはsource-highlightに付いている&lsquo;<tt>style.defaults</tt>&rsquo;だ:
1906-</p>
1907-<table><tr><td>&nbsp;</td><td><pre class="example"># defaults for styles
1908-# the format is:
1909-# elem1 = elem2
1910-# meaning that if the style for elem1 is not specified,
1911-# then it will have the same style as elem2
1912-
1913-classname = normal
1914-usertype = normal
1915-preproc = keyword
1916-section = function
1917-paren = cbracket
1918-attribute = type
1919-value = string
1920-predef_var = type
1921-predef_func = function
1922-atom = regexp
1923-meta = function
1924-path = regexp
1925-label = preproc
1926-error = string
1927-warning = type
1928-</pre></td></tr></table>
1929-<p>この場合、<code>preproc</code>エレメントのスタイルが<code>keyword</code>エレメントのスタイルをデフォルトとする。
1930-</p>
1931-<p>このファイルは、独自のスタイルファイルを作成して、そのスタイルの中で、同じ出力スタイルを持つエレメントのスタイルを全て指定したくないような場合に便利だ(たとえば、デフォルトのスタイルでは、<code>preproc</code>エレメントはkeywordとは違うフォーマットがされるが、独自にスタイルを指定するのに、そのスタイルを指定していなければ、<code>preproc</code>エレメントは<code>keyword</code>と同じようにフォーマットされる)。
1932-</p>
1933-<hr size="6">
1934-<a name="g_t_8a00_8a9e_30de_30c3_30d7"></a>
1935-<a name="SEC30"></a>
1936-<table cellpadding="1" cellspacing="1" border="0">
1937-<tr><td valign="middle" align="left">[<a href="#SEC29" title="Previous section in reading order"> &lt; </a>]</td>
1938-<td valign="middle" align="left">[<a href="#SEC31" title="Next section in reading order"> &gt; </a>]</td>
1939-<td valign="middle" align="left"> &nbsp; </td>
1940-<td valign="middle" align="left">[<a href="#SEC26" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
1941-<td valign="middle" align="left">[<a href="#SEC26" title="Up section"> Up </a>]</td>
1942-<td valign="middle" align="left">[<a href="#SEC35" title="Next chapter"> &gt;&gt; </a>]</td>
1943-<td valign="middle" align="left"> &nbsp; </td>
1944-<td valign="middle" align="left"> &nbsp; </td>
1945-<td valign="middle" align="left"> &nbsp; </td>
1946-<td valign="middle" align="left"> &nbsp; </td>
1947-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1948-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1949-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
1950-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1951-</tr></table>
1952-<h2 class="section"> 5.4 言語マップ </h2>
1953-
1954-<p>この設定ファイルは、特定の言語定義ファイルに拡張子を関連付けている。
1955-そのようなファイルの拡張子を使って、<code>--src-lang</code>オプションを指定することもできる(<a href="#SEC20">簡単な使い方</a>を参照)。
1956-source-highlightは、&lsquo;<tt>lang.map</tt>&rsquo;と呼ばれる、そういったファイルが付属している。
1957-</p>
1958-<p>もちろん、このファイルの設定は、独自の言語マップファイルを書いて、コマンドラインオプションの<code>--lang-map</code>でそのファイルを指定すれば、オーバーライドすることもできる。
1959-さらに、上で説明したように、カレントディレクトリに&lsquo;<tt>lang.map</tt>&rsquo;が存在すれば、そのバージョンが使用される。
1960-そのファイルのフォーマットは極めてシンプルだ(コメント行は<code>#</code>で始まる):
1961-</p>
1962-<table><tr><td>&nbsp;</td><td><pre class="example">extension = language definition file
1963-</pre></td></tr></table>
1964-
1965-<p>デフォルトの言語定義ファイルは<a href="#SEC1">導入</a>の中で示されている。
1966-</p>
1967-<hr size="6">
1968-<a name="g_t_8a00_8a9e_306e_5b9a_7fa9_30d5_30a1_30a4_30eb"></a>
1969-<a name="SEC31"></a>
1970-<table cellpadding="1" cellspacing="1" border="0">
1971-<tr><td valign="middle" align="left">[<a href="#SEC30" title="Previous section in reading order"> &lt; </a>]</td>
1972-<td valign="middle" align="left">[<a href="#SEC32" title="Next section in reading order"> &gt; </a>]</td>
1973-<td valign="middle" align="left"> &nbsp; </td>
1974-<td valign="middle" align="left">[<a href="#SEC26" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
1975-<td valign="middle" align="left">[<a href="#SEC26" title="Up section"> Up </a>]</td>
1976-<td valign="middle" align="left">[<a href="#SEC35" title="Next chapter"> &gt;&gt; </a>]</td>
1977-<td valign="middle" align="left"> &nbsp; </td>
1978-<td valign="middle" align="left"> &nbsp; </td>
1979-<td valign="middle" align="left"> &nbsp; </td>
1980-<td valign="middle" align="left"> &nbsp; </td>
1981-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1982-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1983-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
1984-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1985-</tr></table>
1986-<h2 class="section"> 5.5 言語の定義ファイル </h2>
1987-
1988-<p>これらのファイルは、ソースのハイライトされるべきエレメントを指定するものなので、source-highlightにとって極めて重要なものだ。
1989-これらのファイルはまた、source-highlightが扱わない言語を処理するために独自の言語定義ファイルを指定できるようにもする<a name="DOCF20" href="#FOOT20">(20)</a>。
1990-これらのファイルのシンタックスは<a href="#SEC37">言語の定義</a>で説明されている。
1991-</p>
1992-<hr size="6">
1993-<a name="g_t_51fa_529b_8a00_8a9e_30de_30c3_30d7"></a>
1994-<a name="SEC32"></a>
1995-<table cellpadding="1" cellspacing="1" border="0">
1996-<tr><td valign="middle" align="left">[<a href="#SEC31" title="Previous section in reading order"> &lt; </a>]</td>
1997-<td valign="middle" align="left">[<a href="#SEC33" title="Next section in reading order"> &gt; </a>]</td>
1998-<td valign="middle" align="left"> &nbsp; </td>
1999-<td valign="middle" align="left">[<a href="#SEC26" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
2000-<td valign="middle" align="left">[<a href="#SEC26" title="Up section"> Up </a>]</td>
2001-<td valign="middle" align="left">[<a href="#SEC35" title="Next chapter"> &gt;&gt; </a>]</td>
2002-<td valign="middle" align="left"> &nbsp; </td>
2003-<td valign="middle" align="left"> &nbsp; </td>
2004-<td valign="middle" align="left"> &nbsp; </td>
2005-<td valign="middle" align="left"> &nbsp; </td>
2006-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2007-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2008-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
2009-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2010-</tr></table>
2011-<h2 class="section"> 5.6 出力言語マップ </h2>
2012-
2013-<p>この設定ファイルは出力フォーマットを特定の出力言語の定義ファイルと関連付けるものだ。
2014-出力フォーマットの名前を使って、<code>--out-format</code>オプションを指定することができる(<a href="#SEC20">簡単な使い方</a>を参照)。
2015-Source-highlightには、そのような&lsquo;<tt>outlang.map</tt>&rsquo;と呼ばれるファイルが付属している。
2016-</p>
2017-<p>もちろん、このファイルの設定は、独自の言語マップを書いて、そういったファイルをコマンドラインオプションの<code>--outlang-map</code>で指定すれば、オーバーライドすることができる。
2018-さらに、上で述べたように、&lsquo;<tt>outlang.map</tt>&rsquo;というファイルがカレントディレクトリに存在すれば、そのバージョンが使われる。
2019-そういったファイルのフォーマットは極めてシンプルだ:
2020-</p>
2021-<table><tr><td>&nbsp;</td><td><pre class="example">output format name = language definition file
2022-</pre></td></tr></table>
2023-
2024-<p>デフォルトの言語定義ファイルは<a href="#SEC1">導入</a>で示されている。
2025-</p>
2026-<p>とくに、出力言語マップの出力フォーマットの名前には、付け方がある。
2027-<code>-css</code>サフィックスが付いているものは、<code>--css</code>というコマンドラインオプションが指定されたときに使われるものだ。
2028-</p>
2029-<hr size="6">
2030-<a name="g_t_51fa_529b_8a00_8a9e_306e_5b9a_7fa9_30d5_30a1_30a4_30eb"></a>
2031-<a name="SEC33"></a>
2032-<table cellpadding="1" cellspacing="1" border="0">
2033-<tr><td valign="middle" align="left">[<a href="#SEC32" title="Previous section in reading order"> &lt; </a>]</td>
2034-<td valign="middle" align="left">[<a href="#SEC34" title="Next section in reading order"> &gt; </a>]</td>
2035-<td valign="middle" align="left"> &nbsp; </td>
2036-<td valign="middle" align="left">[<a href="#SEC26" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
2037-<td valign="middle" align="left">[<a href="#SEC26" title="Up section"> Up </a>]</td>
2038-<td valign="middle" align="left">[<a href="#SEC35" title="Next chapter"> &gt;&gt; </a>]</td>
2039-<td valign="middle" align="left"> &nbsp; </td>
2040-<td valign="middle" align="left"> &nbsp; </td>
2041-<td valign="middle" align="left"> &nbsp; </td>
2042-<td valign="middle" align="left"> &nbsp; </td>
2043-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2044-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2045-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
2046-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2047-</tr></table>
2048-<h2 class="section"> 5.7 出力言語の定義ファイル </h2>
2049-
2050-<p>これらのファイルは、ソースのエレメントがどのようにハイライトされるかを指定するものなので、source-highlightにとって極めて重要だ。
2051-これらのファイルはまた、source-highlightが扱わない出力フォーマットを処理するための独自の出力フォーマットの定義を指定することもできるようにする<a name="DOCF21" href="#FOOT21">(21)</a>。
2052-こういったファイルのシンタックスは<a href="#SEC59">出力言語の定義</a>で説明されている。
2053-</p>
2054-<p>これらのファイルはsource-highlightの配布物の一部であるが、次の場所から自由にダウンロードすることもできる:
2055-</p>
2056-<p><a href="http://www.gnu.org/software/src-highlite/outlang_files/">http://www.gnu.org/software/src-highlite/outlang_files/</a>
2057-</p>
2058-<hr size="6">
2059-<a name="g_t_72ec_81ea_5b9a_7fa9_30d5_30a1_30a4_30eb_306e_958b_767a"></a>
2060-<a name="SEC34"></a>
2061-<table cellpadding="1" cellspacing="1" border="0">
2062-<tr><td valign="middle" align="left">[<a href="#SEC33" title="Previous section in reading order"> &lt; </a>]</td>
2063-<td valign="middle" align="left">[<a href="#SEC35" title="Next section in reading order"> &gt; </a>]</td>
2064-<td valign="middle" align="left"> &nbsp; </td>
2065-<td valign="middle" align="left">[<a href="#SEC26" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
2066-<td valign="middle" align="left">[<a href="#SEC26" title="Up section"> Up </a>]</td>
2067-<td valign="middle" align="left">[<a href="#SEC35" title="Next chapter"> &gt;&gt; </a>]</td>
2068-<td valign="middle" align="left"> &nbsp; </td>
2069-<td valign="middle" align="left"> &nbsp; </td>
2070-<td valign="middle" align="left"> &nbsp; </td>
2071-<td valign="middle" align="left"> &nbsp; </td>
2072-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2073-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2074-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
2075-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2076-</tr></table>
2077-<h2 class="section"> 5.8 独自定義ファイルの開発 </h2>
2078-
2079-<p>新しい言語定義を書いたり、既存の言語定義を訂正修正して、それを私に送ってくれるようにお勧めしたい。
2080-そうすれば、source-highlightの配布物にそれらを追加することができる。
2081-</p>
2082-<p>これらのファイルにはさらなる説明が必要なので(しかし、source-highlightの通常の使用には必要ではない)、複数のパート<a href="#SEC37">言語の定義</a>と<a href="#SEC59">出力言語の定義</a>で丁寧に説明する。
2083-</p>
2084-<p>これらのファイルはsource-highlightの配布物の一部であるが、次の場所から自由にダウンロードすることもできる:
2085-</p>
2086-<p><a href="http://www.gnu.org/software/src-highlite/lang_files/">http://www.gnu.org/software/src-highlite/lang_files/</a>
2087-</p>
2088-
2089-<hr size="6">
2090-<a name="source_002dhighlight_306e_8d77_52d5"></a>
2091-<a name="SEC35"></a>
2092-<table cellpadding="1" cellspacing="1" border="0">
2093-<tr><td valign="middle" align="left">[<a href="#SEC34" title="Previous section in reading order"> &lt; </a>]</td>
2094-<td valign="middle" align="left">[<a href="#SEC36" title="Next section in reading order"> &gt; </a>]</td>
2095-<td valign="middle" align="left"> &nbsp; </td>
2096-<td valign="middle" align="left">[<a href="#SEC26" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
2097-<td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td>
2098-<td valign="middle" align="left">[<a href="#SEC37" title="Next chapter"> &gt;&gt; </a>]</td>
2099-<td valign="middle" align="left"> &nbsp; </td>
2100-<td valign="middle" align="left"> &nbsp; </td>
2101-<td valign="middle" align="left"> &nbsp; </td>
2102-<td valign="middle" align="left"> &nbsp; </td>
2103-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2104-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2105-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
2106-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2107-</tr></table>
2108-<h1 class="chapter"> 6. <code>source-highlight</code>の起動 </h1>
2109-
2110-<p><code>source-highlight</code>プログラムを実行する形式は次のようになる:
2111-</p>
2112-<table><tr><td>&nbsp;</td><td><pre class="example">source-highlight <var>option</var> &hellip;
2113-</pre></td></tr></table>
2114-
2115-<p><code>source-highlight</code>は、<code>source-highlight --detailed-help</code>の出力で表示されるが、次のようなオプションをサポートしている:
2116-</p>
2117-
2118-<p>いくつかのオプションについて詳細に説明しよう(<code>--help</code>の出力自体から明らかなはずなものや、<a href="#SEC20">簡単な使い方</a>で既に説明済みのものは除く)。
2119-</p>
2120-<dl compact="compact">
2121-<dt> <code>--data-dir</code></dt>
2122-<dd><a name="IDX63"></a>
2123-
2124-<p>Source-highlightは、その実行の際、いくつかのファイル、たとえば、言語定義ファイル、出力フォーマットの定義ファイルなどを必要とする。
2125-これらのファイルは<code>prefix/share/source-highlight</code>にインストールされる(<code>prefix</code>はコンパイル時に選択される。See section <a href="#SEC9">インストール</a>参照)。
2126-なので、source-highlightは必要とするファイルを全て自由に見つけられるはずだ。
2127-しかし、この設定をオーバーライドしたい、たとえば、独自の言語定義ファイルがあるとか、単に、コンパイル時に使用したディレクトリとは違う場所に、使うsource-highlightのバイナリがあるなどの場合、コマンドラインオプションの<code>--data-dir</code>を使うことができる。
2128-</p>
2129-</dd>
2130-<dt> <code>--doc</code></dt>
2131-<dt> <code>-d</code></dt>
2132-<dd>
2133-<p>スタンドアロンの出力ドキュメント(すなわち、他のドキュメントにインクルードされるとは考えられていない出力ドキュメント)が欲しい場合には、このオプションを指定する(そうでない場合には、他のドキュメントにペーストできるテキストが得られるだけだ)。
2134-このオプションを選択して、<code>--title</code>を指定しない場合には、タイトルとしてソースファイル名が使用される。
2135-</p>
2136-</dd>
2137-<dt> <code>--no-doc</code></dt>
2138-<dd><p>前述の<code>--doc</code>オプションは、実際には他のコマンドラインオプション(たとえば<code>--css</code>)で暗黙のうちに指定される。
2139-これをしたくない場合には(たとえば、グローバルなスタイルシートを持っている既存のドキュメントに出力をインクルードしたいなどの場合)、<code>--no-doc</code>を使うことでこれを無効にできる。
2140-</p>
2141-</dd>
2142-<dt> <code>--css</code></dt>
2143-<dt> <code>-c</code></dt>
2144-<dd><p>出力ドキュメントに対してスタイルシートファイルを指定する(たとえばHTMLに対する&lsquo;<tt>.css</tt>&rsquo;<a name="DOCF22" href="#FOOT22">(22)</a>)。
2145-source-highlightはこのファイルは使わないことに注意してほしい。
2146-出力ファイルが生成されるときにこのファイルの名前を単に使って、出力ファイルがこのファイルをスタイルシートとして使うということを指定する(たとえば、生成されたHTMLがCSSファイルとしてこのファイルに依存する場合)。
2147-</p>
2148-</dd>
2149-<dt> <code>--tab</code></dt>
2150-<dt> <code>-t</code></dt>
2151-<dd><p>このオプションを使えば、タブ文字が指定された数の空白文字に変換される(タブ位置は保存される)。
2152-このオプションは、行番号を生成するときには自動的に選択される。
2153-</p>
2154-</dd>
2155-<dt> <code>--style-file</code></dt>
2156-<dt> <code>--style-css-file</code></dt>
2157-<dd><p>source-highlightが出力を生成する(たとえば、フォーマットする)のに使用するファイルを指定する(たとえば、言語の各エレメントの色やスタイル)。
2158-これらのファイルの形式については<a href="#SEC27">出力フォーマットスタイル</a>と<a href="#SEC28">CSSを使用した出力フォーマットスタイル</a>にそれぞれ詳しく述べられている。
2159-</p>
2160-</dd>
2161-<dt> <code>--style-defaults</code></dt>
2162-<dd><p>スタイルファイルにスタイルの指定が無いエレメントのデフォルトのスタイルが入ったファイルを指定する(さらに詳しくは<a href="#SEC29">デフォルトのスタイル</a>を参照)。
2163-</p>
2164-</dd>
2165-<dt> <code>--output-dir</code></dt>
2166-<dd><p>source-highlightには複数の入力ファイルを渡すことができる(<a href="#SEC20">簡単な使い方</a>を参照)。
2167-この場合出力ファイルの名前は指定できない。
2168-そういう場合には、コマンドを起動したディレクトリの中に出力ファイルが自動的に生成される。
2169-異なるディレクトリに出力ファイルを生成したい場合に、このオプションを使うことができる。
2170-</p>
2171-</dd>
2172-<dt> <code>--infer-lang</code></dt>
2173-<dd><a name="IDX64"></a>
2174-<a name="IDX65"></a>
2175-<p>入力言語を検出する推定メカニズムを強制する。
2176-これは<a href="#SEC36">入力言語の検出方法</a>に詳述する。
2177-</p>
2178-</dd>
2179-<dt> <code>--line-number</code></dt>
2180-<dd><p>指定されたパディング文字を使って(オプショナル)、出力に行番号を生成する<a name="DOCF23" href="#FOOT23">(23)</a>(デフォルトのパディング文字は<code>0</code>)。
2181-</p>
2182-</dd>
2183-<dt> <code>--line-number-ref</code></dt>
2184-<dd><p><code>--line-number</code>と同様このオプションは出力行全てに番号を振り、それに加えて各行にアンカーを生成する。
2185-アンカーは指定されたプリフィックス(デフォルトは<code>line</code>)と行番号からなる(たとえば<code>line25</code>)。
2186-例えば、多数のファイルを処理する場合、プリフィックスとしてファイル名を使ってもよい。
2187-出力言語によってはこの機能がサポートされないものもあることに注意してほしい(たとえば<code>esc</code>だ。そういう場合には意味を成さない)。
2188-指定された出力言語でアンカーをどのように生成するかを定義することについては<a href="#SEC63">アンカーとリファレンス</a>を参照してほしい。
2189-</p>
2190-<a name="IDX66"></a>
2191-<a name="IDX67"></a>
2192-<a name="IDX68"></a>
2193-</dd>
2194-<dt> <code>--line-range</code></dt>
2195-<dt> <code>--range-context</code></dt>
2196-<dt> <code>--range-separator</code></dt>
2197-<dd><p>バージョン2.11から、複数行の範囲を指定できるようになった。
2198-ソースのうち、この範囲に収まる行だけが出力される。
2199-たとえば、次のように指定された場合だ。
2200-</p>
2201-<table><tr><td>&nbsp;</td><td><pre class="example">--line-range=&quot;-5&quot;,&quot;10&quot;,&quot;20-25&quot;,&quot;50-&quot;
2202-</pre></td></tr></table>
2203-
2204-<p>この場合は、最初の5行、10行目、20行目から25行目まで、50行目から入力の最後まで、の各行が出力される(<a href="#SEC74">行による範囲指定</a>にある例も見てほしい)。
2205-</p>
2206-<p><code>--line-range</code>とともに、<code>--range-context</code>も指定できる。
2207-これは、範囲に入っている行の前後に追加して表示される行数である(すなわち挟んでいる&ldquo;context&rdquo;)。
2208-これらの行はハイライトされず、<code>context</code>のスタイルに応じて表示される。
2209-例として、前の例を広げる。
2210-</p>
2211-<table><tr><td>&nbsp;</td><td><pre class="example">--line-range=&quot;-5&quot;,&quot;10&quot;,&quot;20-25&quot;,&quot;50-&quot; --range-context=1
2212-</pre></td></tr></table>
2213-
2214-<p>これによって、6行目、9行目、11行目、19行目、26行目、49行目の各行も出力される(<a href="#SEC75">行による範囲指定(コンテキスト付き)</a>の例も参照)。
2215-</p>
2216-<p>最後に、<code>--range-separator</code>を使って、範囲と範囲の間に表示される、範囲セパレータ行の文字列を指定することができる(<a href="#SEC75">行による範囲指定(コンテキスト付き)</a>の例も参照)。
2217-セパレータの文字列は自動的に実行されるので、たとえば、texinfo出力における{ }のような特殊な出力文字をエスケープする必要はない。
2218-</p>
2219-<a name="IDX69"></a>
2220-</dd>
2221-<dt> <code>--regex-range</code></dt>
2222-<dd>
2223-<p>範囲は、正規表現を使って表わすこともできる。
2224-これにはコマンドラインオプション<code>--regex-range</code>を使う。
2225-この場合、範囲の開始は、指定された正規表現とマッチする文字列(任意の位置で)含む行で検出される。
2226-範囲の終了は、その範囲を開始したのと同じ正規表現のマッチする文字列を含む行で検出される。
2227-この機能は、(たとえば、まさにこのマニュアルのように)ソースコードの中でアドホックなやり方で(たとえば、コメントのパターンを指定する)、範囲を区切られた指定した場所だけを見せるようにして、コードをドキュメントにしたい場合に非常に便利だ
2228-See section <a href="#SEC76">正規表現による範囲指定</a>
2229-。
2230-指定された文字列(このオプションは複数回指定してもよい)は、有効な正規表現でなければならい(なので、特殊な文字はそれなりにエスケープしなければならない)。
2231-そうでなければ、エラーとなる。
2232-</p>
2233-<p>また、<code>--line-range</code>と<code>--regex-range</code>は同じコマンドラインに共存することはできない。
2234-</p>
2235-</dd>
2236-<dt> <code>--failsafe</code></dt>
2237-<dd><a name="IDX70"></a>
2238-<p>言語の指定が見つからない場合、エラーが表示されプログラムは終了する。
2239-このオプションを使えば、その代わりに、そういう状況では、入力が出力フォーマットに単にフォーマットされる。
2240-これは、<code>source-highlight</code>が多数の入力ファイルでもって使われるときに便利である。
2241-また、&lsquo;<tt>src-hilite-lesspipe.sh</tt>&rsquo;スクリプトでも使用される。
2242-実のところ、このオプションを常には使うべきではないということに対する良い理由を私は見つけられなかった。
2243-なので、source-highlightを実行するときにはいつもこれを使うことをお勧めする(そして確かに、将来このオプションはデフォルトになるかもしれない)。
2244-<a href="#SEC16">lessでのsource-highlightの使用</a>と<a href="#SEC7">簡単なフォーマッタとしてのsource-highlightの使用</a>も見てほしい。
2245-</p>
2246-<a name="IDX71"></a>
2247-<p><code>--failsafe</code>を使うとき、入力言語がはっきりしない場合には、source-highlightは&lsquo;<tt>default.lang</tt>&rsquo;という入力言語の定義ファイルを使う。
2248-これは空のファイルである。
2249-そういったファイルはカスタマイズしてもかまわない。
2250-</p>
2251-</dd>
2252-<dt> <code>--debug-lang</code></dt>
2253-<dt> <code>--show-regex</code></dt>
2254-<dd><p>言語定義ファイルをデバッグできるようにする。
2255-<a href="#SEC54">デバッギング</a>
2256-</p>
2257-</dd>
2258-</dl>
1226+<div class="node">
1227+<a name="Simple-Usage"></a>
1228+<p><hr>
1229+Next:&nbsp;<a rel="next" accesskey="n" href="#Configuration-files">Configuration files</a>,
1230+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Copying">Copying</a>,
1231+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
22591232
2260-<p>リファレンスを処理するコマンドラインオプションは、<a href="#SEC70">リファレンスの生成</a>の中でさらに詳しく説明されている。
2261-</p>
2262-<table class="menu" border="0" cellspacing="0">
2263-<tr><td align="left" valign="top"><a href="#SEC36">6.1 入力言語の検出方法</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
2264-</td></tr>
2265-</table>
2266-
2267-<hr size="6">
2268-<a name="g_t_5165_529b_8a00_8a9e_306e_691c_51fa_65b9_6cd5"></a>
2269-<a name="SEC36"></a>
2270-<table cellpadding="1" cellspacing="1" border="0">
2271-<tr><td valign="middle" align="left">[<a href="#SEC35" title="Previous section in reading order"> &lt; </a>]</td>
2272-<td valign="middle" align="left">[<a href="#SEC37" title="Next section in reading order"> &gt; </a>]</td>
2273-<td valign="middle" align="left"> &nbsp; </td>
2274-<td valign="middle" align="left">[<a href="#SEC35" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
2275-<td valign="middle" align="left">[<a href="#SEC35" title="Up section"> Up </a>]</td>
2276-<td valign="middle" align="left">[<a href="#SEC37" title="Next chapter"> &gt;&gt; </a>]</td>
2277-<td valign="middle" align="left"> &nbsp; </td>
2278-<td valign="middle" align="left"> &nbsp; </td>
2279-<td valign="middle" align="left"> &nbsp; </td>
2280-<td valign="middle" align="left"> &nbsp; </td>
2281-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2282-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2283-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
2284-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2285-</tr></table>
2286-<h2 class="section"> 6.1 入力言語の検出方法 </h2>
2287-
2288-<p>既に述べたように(<a href="#SEC20">簡単な使い方</a>)、source-highlightは、<code>--src-lang</code>オプションや<code>--lang-def</code>オプションで指定された言語に応じて、あるいは入力ファイルの拡張子を使うことによって、言語定義ファイルを使用する。
2289-</p>
2290-<p>バージョン2.5からは、source-highlightは、入力言語を推定するための推定メカニズムを使うことができる。
2291-今のところ、&ldquo;sha-bang&rdquo;メカニズムに基づくスクリプト言語の検出ができる。
2292-すなわち、スクリプトの最初の行に、たとえば次のような行を含んでいる場合だ。
2293-</p>
2294-<table><tr><td>&nbsp;</td><td><pre class="example">#!/bin/sh
2295-</pre></td></tr></table>
2296-
2297-<p><code>env</code>プログラムを使って指定されたスクリプト言語を検出する<a name="DOCF24" href="#FOOT24">(24)</a>:
2298-</p>
2299-<table><tr><td>&nbsp;</td><td><pre class="example">#!/usr/bin/env perl
2300-</pre></td></tr></table>
2301-
2302-<p><code>-*- lang -*-</code>という形式を使ったEmacsのメジャーモードの宣言する、Emacsの慣習を認識する。
2303-</p>
2304-<p>また一例として、以下のように始まるスクリプトの場合だ:
2305-</p>
2306-<table><tr><td>&nbsp;</td><td><pre class="example">#!/bin/bash
2307-# -*- Tcl -*-
2308-</pre></td></tr></table>
2309-
2310-<p>この場合は、bashスクリプトではなく、Tclスクリプトとして解釈される。
2311-</p>
2312-<p>最後に、<code>&lt;?</code>という記述(たとえば、<code>&lt;?php</code>や<code>&lt;?xml</code>)と<code>&lt;!doctype</code>(この場合xmlファイルだと推定される)を認識する<a name="DOCF25" href="#FOOT25">(25)</a>。
2313-</p>
2314-<p>この推定メカニズムは、デフォルトで、入力言語が明示的に指定されていないか、あるいは、入力ファイルの拡張子やファイル名そのもの(小文字の場合もあるかもしれない)を使って言語マップで見つけられない場合に実行される(入力ファイルが拡張子を全く持たない場合もあるかもしれないが、たとえば、&lsquo;<tt>ChangeLog</tt>&rsquo;という入力ファイルは&lsquo;<tt>changelog.lang</tt>&rsquo;を使ってハイライトされる)。
2315-</p>
2316-<a name="IDX72"></a>
2317-<p>加えて、このメカニズムは、<code>--infer-lang</code>というコマンドラインオプションで優先されるようになる。
2318-たとえば、source-hiliteを実行するときに、PerlスクリプトをPrologスクリプトとしてフォーマットするという問題を避けるために(&lsquo;<tt>.pl</tt>&rsquo;という拡張子が言語マップファイルでPrologプログラムに関連付けられているため)、&lsquo;<tt>src-hilite-lesspipe.sh</tt>&rsquo;スクリプトで使われている。
2319-</p>
2320-<hr size="6">
2321-<a name="g_t_8a00_8a9e_306e_5b9a_7fa9"></a>
2322-<a name="SEC37"></a>
2323-<table cellpadding="1" cellspacing="1" border="0">
2324-<tr><td valign="middle" align="left">[<a href="#SEC36" title="Previous section in reading order"> &lt; </a>]</td>
2325-<td valign="middle" align="left">[<a href="#SEC38" title="Next section in reading order"> &gt; </a>]</td>
2326-<td valign="middle" align="left"> &nbsp; </td>
2327-<td valign="middle" align="left">[<a href="#SEC35" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
2328-<td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td>
2329-<td valign="middle" align="left">[<a href="#SEC59" title="Next chapter"> &gt;&gt; </a>]</td>
2330-<td valign="middle" align="left"> &nbsp; </td>
2331-<td valign="middle" align="left"> &nbsp; </td>
2332-<td valign="middle" align="left"> &nbsp; </td>
2333-<td valign="middle" align="left"> &nbsp; </td>
2334-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2335-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2336-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
2337-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2338-</tr></table>
2339-<h1 class="chapter"> 7. 言語の定義 </h1>
2340-
2341-<p>バージョン2.0から、source-highlightはソース言語のエレメント(たとえば、キーワード、文字列、コメントなど)を指定するのに固有のシンタックスを使用する。
2342-バージョン2.0以前では、言語のエレメントはFlexを通してスキャンされていた。
2343-このため、新たな言語を処理するのに新しくflexファイルを書かなければならないことが障害となっていた。
2344-さらに悪いことに、新しい言語は「動的」に追加することができず、source-highlightプログラム全部を再度コンパイルしなければならなかった。
2345-</p>
2346-<p>今はそれに代わり、言語のエレメントは(願わくば)簡単なシンタックスを使って、ファイルに記述され、動的にロードされる。
2347-そして、これらの定義は、内部的には、エレメントをハイライトするのに使うための正規表現をオンザフライに生成するのに使われる(<a href="#SEC49">source-highlightの仕組み</a>も参照してほしい)。
2348-詳しく言うと、使用している正規表現は、Boostライブラリが提供しているものだ(<a href="#SEC9">インストール</a>を見よ)。
2349-なので、言語の定義ファイルを書く場合には、正規表現を確実に使う必要がある。
2350-しかし、怖がる必要はない。
2351-言語のほとんどでは、難しい正規表現を扱う必要は決して無いだろうし、言語のキーワード(たとえば、&ldquo;if&rdquo;とか&ldquo;while&rdquo;など。<a href="#SEC39">簡単な定義</a>)を指定することもできる。
2352-さらに、区切られた言語エレメントの場合、デリミタを除いて正規表現を書く必要は無いだろう(<a href="#SEC42">delim定義</a>)。
2353-しかし、もっとややこしい正規表現を多用する必要のある言語の定義もあるかもしれない(たとえば一つ挙げるとPerlである)。
2354-</p>
2355-<p>もちろん、Boost regexライブラリの正規表現を使う。
2356-そのシンタックスについてはBoostのドキュメンテーション(<a href="http://www.boost.org/libs/regex/doc/syntax.html">http://www.boost.org/libs/regex/doc/syntax.html</a>)を参照するが、<a href="#SEC50">正規表現に関する注意</a>の中で、正規表現を扱ったことの無い人にとって助けとなるかもしれない、正規表現に関する注意を用意した。
2357-デフォルトでは、Boost regexライブラリはPerlの正規表現シンタックスを使う。
2358-現状、これがsource-highlightのサポートしている唯一のシンタックスである。
2359-</p>
2360-<p>ここで、そのシンタックスを多くの例に依りながら詳細に見ていく。
2361-これにより、既存の言語定義を簡単に修正して、新しいものを作ることができるようになる。
2362-これらのファイルは通常&lsquo;<tt>.lang</tt>&rsquo;という拡張子を持つ。
2363-</p>
2364-<p>各定義は基本的に、一つの正規表現を一つの言語エレメントに関連付け、その言語エレメントに対して名前を定義している。
2365-その名前は、そのエレメントをハイライトするときに、特定のスタイル(ボールド、色など)と関連付けるのに使われる。
2366-言語定義のシンタックスで使われているキーワードと同じ名前を使うことはできない(たとえば、後で出てくる<code>start</code>は、予約語である)。
2367-</p>
2368-<p><code>#</code>を使ってコメントを書くこともできる。
2369-その行のその文字以降の部分はコメントとして解釈される。
2370-</p>
2371-<p>Source-highlightは、入力ファイルの各行を別々にスキャンする。
2372-なので、new line文字にマッチしようとする正規表現は失敗する運命にある。
2373-しかし、言語定義のシンタックスは、複数行を処理するための手段を用意している(<a href="#SEC42">delim定義</a>と<a href="#SEC46">state/environment定義</a>を見よ)。
2374-</p>
2375-<table class="menu" border="0" cellspacing="0">
2376-<tr><td align="left" valign="top"><a href="#SEC38">7.1 正規表現の指定方法</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
2377-</td></tr>
2378-<tr><td align="left" valign="top"><a href="#SEC39">7.2 簡単な定義</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
2379-</td></tr>
2380-<tr><td align="left" valign="top"><a href="#SEC40">7.3 ラインワイド定義</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
2381-</td></tr>
2382-<tr><td align="left" valign="top"><a href="#SEC41">7.4 定義の順序</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
2383-</td></tr>
2384-<tr><td align="left" valign="top"><a href="#SEC42">7.5 delim定義</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
2385-</td></tr>
2386-<tr><td align="left" valign="top"><a href="#SEC43">7.6 変数定義</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
2387-</td></tr>
2388-<tr><td align="left" valign="top"><a href="#SEC44">7.7 動的後方参照</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
2389-</td></tr>
2390-<tr><td align="left" valign="top"><a href="#SEC45">7.8 ファイルのインクルード</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"> Include the contents of another file
2391-</td></tr>
2392-<tr><td align="left" valign="top"><a href="#SEC46">7.9 state/environment定義</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
2393-</td></tr>
2394-<tr><td align="left" valign="top"><a href="#SEC47">7.10 名前を使った明示的な部分表現</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
2395-</td></tr>
2396-<tr><td align="left" valign="top"><a href="#SEC48">7.11 再定義と置換</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
2397-</td></tr>
2398-<tr><td align="left" valign="top"><a href="#SEC49">7.12 source-highlightの仕組み</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
2399-</td></tr>
2400-<tr><td align="left" valign="top"><a href="#SEC50">7.13 正規表現に関する注意</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
2401-</td></tr>
2402-<tr><td align="left" valign="top"><a href="#SEC51">7.14 The program <code>check-regexp</code></a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
2403-</td></tr>
2404-<tr><td align="left" valign="top"><a href="#SEC52">7.15 言語エレメントの一覧</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
2405-</td></tr>
2406-<tr><td align="left" valign="top"><a href="#SEC53">7.16 まとめの所見</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
2407-</td></tr>
2408-<tr><td align="left" valign="top"><a href="#SEC54">7.17 デバッギング</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"> Debug a language definition file
2409-</td></tr>
2410-<tr><td align="left" valign="top"><a href="#SEC55">7.18 言語定義のチュートリアル</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
2411-</td></tr>
2412-</table>
2413-
2414-<hr size="6">
2415-<a name="g_t_6b63_898f_8868_73fe_306e_6307_5b9a_65b9_6cd5"></a>
2416-<a name="SEC38"></a>
2417-<table cellpadding="1" cellspacing="1" border="0">
2418-<tr><td valign="middle" align="left">[<a href="#SEC37" title="Previous section in reading order"> &lt; </a>]</td>
2419-<td valign="middle" align="left">[<a href="#SEC39" title="Next section in reading order"> &gt; </a>]</td>
2420-<td valign="middle" align="left"> &nbsp; </td>
2421-<td valign="middle" align="left">[<a href="#SEC37" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
2422-<td valign="middle" align="left">[<a href="#SEC37" title="Up section"> Up </a>]</td>
2423-<td valign="middle" align="left">[<a href="#SEC59" title="Next chapter"> &gt;&gt; </a>]</td>
2424-<td valign="middle" align="left"> &nbsp; </td>
2425-<td valign="middle" align="left"> &nbsp; </td>
2426-<td valign="middle" align="left"> &nbsp; </td>
2427-<td valign="middle" align="left"> &nbsp; </td>
2428-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2429-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2430-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
2431-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2432-</tr></table>
2433-<h2 class="section"> 7.1 正規表現の指定方法 </h2>
2434-
2435-<p>言語定義のシンタックスの詳細に入る前に、正規表現の文字列を指定する三つの方法について説明することは極めて大切なことだ。
2436-この三つの方法は、基本的に正規表現の特殊文字を扱う方法の違いである。
2437-たとえばカッコとかがそうである。
2438-このため、一つの仕組みが他のものよりもパワフルな場合があるのだが、これについてはもう少し注意も必要だろう。
2439-加えて、他のものが要求されるゴールへ至ることができないために、一つの仕組みだけしか使えないような状況も起こりうる。
2440-</p>
2441-<dl compact="compact">
2442-<dd><a name="IDX73"></a>
2443-</dd>
2444-<dt> <code>&quot;expression&quot;</code></dt>
2445-<dd>
2446-<p>二重引用符(<code>&quot;</code>である。<code>``</code>でも<code>''</code>でもないことに注意)を使って正規表現を指定する場合、基本的に、オルターネーションシンボルつまりパイプシンボル<code>|</code>以外の全ての文字がそのまま字面通り解釈されので、自動的にエスケープされる(たとえば、ドット<code>.</code>は、正規表現のワイルドカードではなく、文字<code>.</code>として解釈される)。
2447-例として次のように指定した場合を考える。
2448-</p>
2449-<table><tr><td>&nbsp;</td><td><pre class="example">&quot;my(regular)ex.pre$$ion{*}&quot;
2450-</pre></td></tr></table>
2451-
2452-<p>この場合、source-highlightは自動的に次のように変換する。
2453-</p>
2454-<table><tr><td>&nbsp;</td><td><pre class="example">my\(regular\)ex\.pre\$\$ion\{\*\}
2455-</pre></td></tr></table>
2456-
2457-
2458-<p>二つの選択肢を分けるという意味を持たせない限り、<code>|</code>という特殊文字は、<code>\</code>文字でエスケープしなければならない。
2459-たとえば、<code>\|</code>のようになる。
2460-また、文字<code>\</code>も文字通りの意味を持たせるためには、<code>\\</code>のようにエスケープしなければならない。
2461-</p>
2462-<a name="IDX74"></a>
2463-</dd>
2464-<dt> <code>'expression'</code></dt>
2465-<dd>
2466-<p>正規表現のフルパワーを享受したいのならば、二重引用符の代わりに、一重引用符(<code>'</code>)の文字列を使う必要がある。
2467-これを使えば、特殊な文字を、その特殊な意味として指定することができるようになる。
2468-</p>
2469-<p>しかし、マークされた部分表現は、自動的にマークされていない部分表現に変換される。
2470-すなわち、まとまりの<code>(...)</code>という表現の部分は、<code>(?:...)</code>というように変形される(<a href="#SEC50">正規表現に関する注意</a>で説明しているように、<code>(?:...)</code>は、正規表現の一部をその字面通りにグループ化する。
2471-その際、マークされた部分表現は生成されない)。(訳注:いわゆる正規表現メモリのことを言っているのだと思う)
2472-</p>
2473-<p>なので、例えば、次のように指定した場合を考える:
2474-</p>
2475-<table><tr><td>&nbsp;</td><td><pre class="example">'my(regular)ex.pre$ion*'
2476-</pre></td></tr></table>
2477-
2478-<p>この場合、source-highlightは自動的にこれを次のように変形する:
2479-</p>
2480-<table><tr><td>&nbsp;</td><td><pre class="example">my(?:regular)ex.pre$ion*
2481-</pre></td></tr></table>
2482-
2483-<p>マークされた部分表現はこのシンタックスでは指定することができないので、<em>後方参照</em>は許されていない(<a href="#SEC50">正規表現に関する注意</a>を参照)。
2484-</p>
2485-<a name="IDX75"></a>
2486-</dd>
2487-<dt> <code>`expression`</code></dt>
2488-<dd>
2489-<a name="IDX76"></a>
2490-<a name="IDX77"></a>
2491-<a name="IDX78"></a>
2492-<p>正規表現を指定するための、このシンタックス<a name="DOCF26" href="#FOOT26">(26)</a>(このシンタックスではバッククォート<code>`</code>を使っている。前のシンタックスは<code>'</code>を使っている。その違いに注意)は、他の二つのシンタックスの制限を克服するために導入された。
2493-このシンタックスを使うと、マークされた部分表現は変形されないので、<em>後方参照</em>や<em>条件</em>のような、マークされた部分表現に依存した正規表現の仕組みを利用することができる(<a href="#SEC50">正規表現に関する注意</a>を参照)。
2494-</p>
2495-<p>このシンタックスは、例えば、Perlの正規表現のように、あるプログラミング言語の特定のプログラム部分をハイライトすることに対しても極めて重要だ。
2496-Perlの正規表現は、(たとえば、置換の式において)多くの形式で表現されうる。
2497-具体的に言うと、置換される部分と置換する部分を分ける、英数字以外の任意の文字が可能なセパレータである<a name="DOCF27" href="#FOOT27">(27)</a>。
2498-例を挙げる:
2499-</p>
2500-<table><tr><td>&nbsp;</td><td><pre class="example">s/foo/bar/g
2501-s|foo|bar|g
2502-s#foo#bar#g
2503-s@foo@bar@g
2504-</pre></td></tr></table>
2505-
2506-<p>このシンタックスと後方参照を使うと、一つの言語エレメントを定義して、これらの複数の表現を処理することが簡単にできるようになる(可能性のある非英数字を全て列挙することはない):
2507-</p>
2508-<table><tr><td>&nbsp;</td><td><pre class="example">regexp = `s([^[:alnum:][:blank:]]).*\1.*\1[ixsmogce]*`
2509-</pre></td></tr></table>
2510-
2511-</dd>
2512-</dl>
1233+</div>
25131234
2514-<p>バージョン2.11からは、正規表現の指定全てで、改行文字を入れられるようになった。
2515-改行は単に無視される。
2516-なので、たとえば、次のファイルを見てほしい:
2517-</p>
2518-<table><tr><td>&nbsp;</td><td><pre class="example"><span class="roman"><i># test_newlines.lang</i></span>
2519-<span class="roman"><i># test that newlines in expressions are simply discarded</i></span>
2520-
2521-<tt><i>keyword</i></tt> = <tt>&quot;foo</tt>
2522-<tt>|</tt>
2523-<tt>lang&quot;</tt>
2524-
2525-(<tt><i>keyword</i></tt>,<tt><i>normal</i></tt>,<tt><i>classname</i></tt>) =
2526- <tt>`(\&lt;struct)</tt>
2527-<tt>([[:blank:]]+)</tt>
2528-<tt>([[:alnum:]_]+)`</tt>
2529-
2530-<tt><i>preproc</i></tt> = <tt>'^[[:blank:]]*</tt>
2531-<tt>#([[:blank:]]*</tt>
2532-<tt>[[:word:]]*)'</tt>
2533-</pre></td></tr></table>
2534-<p>このファイルは次のファイルと同等だ。
2535-and the file:
2536-</p>
2537-<table><tr><td>&nbsp;</td><td><pre class="example"><span class="roman"><i># test_nonewlines.lang</i></span>
2538-<span class="roman"><i># test that newlines in expressions are simply discarded</i></span>
2539-<span class="roman"><i># see the corresponding test_newlines.lang</i></span>
2540-
2541-<tt><i>keyword</i></tt> = <tt>&quot;foo|lang&quot;</tt>
2542-
2543-(<tt><i>keyword</i></tt>,<tt><i>normal</i></tt>,<tt><i>classname</i></tt>) = <tt>`(\&lt;struct)([[:blank:]]+)([[:alnum:]_]+)`</tt>
2544-
2545-<tt><i>preproc</i></tt> = <tt>'^[[:blank:]]*#([[:blank:]]*[[:word:]]*)'</tt>
2546-</pre></td></tr></table>
2547-<p>しかし、前者が間違い無く読み易い。
2548-</p>
2549-<p>だが注意してほしいのだが、正規表現中の空白文字は無視されない。
2550-</p>
2551-<hr size="6">
2552-<a name="g_t_7c21_5358_306a_5b9a_7fa9"></a>
2553-<a name="SEC39"></a>
2554-<table cellpadding="1" cellspacing="1" border="0">
2555-<tr><td valign="middle" align="left">[<a href="#SEC38" title="Previous section in reading order"> &lt; </a>]</td>
2556-<td valign="middle" align="left">[<a href="#SEC40" title="Next section in reading order"> &gt; </a>]</td>
2557-<td valign="middle" align="left"> &nbsp; </td>
2558-<td valign="middle" align="left">[<a href="#SEC37" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
2559-<td valign="middle" align="left">[<a href="#SEC37" title="Up section"> Up </a>]</td>
2560-<td valign="middle" align="left">[<a href="#SEC59" title="Next chapter"> &gt;&gt; </a>]</td>
2561-<td valign="middle" align="left"> &nbsp; </td>
2562-<td valign="middle" align="left"> &nbsp; </td>
2563-<td valign="middle" align="left"> &nbsp; </td>
2564-<td valign="middle" align="left"> &nbsp; </td>
2565-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2566-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2567-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
2568-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2569-</tr></table>
2570-<h2 class="section"> 7.2 簡単な定義 </h2>
2571-
2572-<p>言語のエレメントを記述する最も簡単な方法は、可能性のあるものをリストにすることだ。
2573-たとえば、これはキーワードの場合だ。
2574-例を挙げると、&lsquo;<tt>java.lang</tt>&rsquo;は次のようになっている:
2575-</p>
2576-<table><tr><td>&nbsp;</td><td><pre class="example">keyword = &quot;abstract|assert|break|case|catch|class|const&quot;,
2577- &quot;continue|default|do|else|extends|false|final&quot;,
2578- &quot;finally|for|goto|if|implements|instanceof|interface&quot;
2579-keyword = &quot;native|new|null|private|protected|public|return&quot;,
2580- &quot;static|strictfp|super|switch|synchronized|throw&quot;,
2581- &quot;throws|true|this|transient|try|volatile|while&quot;
2582-</pre></td></tr></table>
2583-
2584-
2585-<p>引用された定義はカンマで分けることができる。
2586-代わりに、引用された定義の内部では、選択肢はパイプシンボル<code>|</code>で分けられる。
2587-上の定義は、keywordという言語エレメントを定義するものだ。
2588-ソースファイルの中でエレメントが一つ見つかるごとに、そのエレメントは、出力フォーマットスタイルファイルにある同名の、そのエレメントに対するスタイルでハイライトされる(例で示されているエレメントは全て、source-highlightedと一緒に配布されている言語定義ファイルから取られたもので、その各エレメントにはスタイルが存在していることに注意してほしい)。
2589-出力フォーマットスタイルファイルで、そのようなエレメントが指定されていない場合には、単にハイライトされない(実際は、<code>normal</code>というスタイルでハイライトされる。<a href="#SEC26">設定ファイル</a>を参照)(なのでタイポには注意を払ってほしい :-))。
2590-</p>
2591-<p>上の例から、言語の定義が累積的であることにお気付きかもしれない。
2592-つまり、2番目の<code>keyword</code>の定義は最初のものを置き換えるものではない。
2593-(実際には、場合によって、言語のエレメントを再定義したいと思うこともあるだろう。
2594-これは<a href="#SEC48">再定義と置換</a>で説明するように可能だ。)
2595-</p>
2596-<p>二重引用符に括られて指定されたワードは、ソースファイルにおいて正確にマッチしなければならず、また独立して存在しなければならない(空白以外のもので挟まれていてはいけない)。
2597-なので、たとえば<code>class</code>という文字列は、キーワードとしてマッチするが、<code>my_class</code>の部分文字列<code>class</code>にはキーワードとしてはマッチしない。
2598-正規表現の点から言うと、二重引用符に括られた単純な定義における<code>class</code>というような文字列は、<code>\&lt;(class)\&gt;</code>というようなものを意図している。
2599-</p>
2600-<p>特殊な文字は<code>\</code>という文字でエスケープしなければならない。
2601-なので例えば、<code>|</code>という文字を指定したい場合、これは通常、二重引用符で括られた文字列の中で選択肢を分割するものとして使われるのだが、これは<code>\|</code>というように指定しなければならない。
2602-</p>
2603-<p><a href="#SEC38">正規表現の指定方法</a>で述べているように、二重引用符で括られた定義は、字面のまま解釈される(ゆえに、たとえばドット<code>.</code>は、正規表現におけるワイルドカードとしてではなく、文字<code>.</code>として解釈される)。
2604-言語のあるオルタナティブを記述するのに(訳注:to specify a language alternative)正規表現のフルパワーを享受したい場合には、二重引用符の文字列の代わりに、一重引用符(<code>'</code>)の文字列か、あるいはバッククォート(<code>`</code>)で括られた文字列を使わなければならない。
2605-</p>
2606-<p>たとえば、次のものは、C/C++におけるプリプロセッサの定義だ:
2607-</p>
2608-<table><tr><td>&nbsp;</td><td><pre class="example">preproc = '^[[:blank:]]*#([[:blank:]]*[[:word:]]*)'
2609-</pre></td></tr></table>
2610-
2611-<p>上で説明されているように、<code>'class'</code>という定義は、<code>&quot;class&quot;</code>とは違うということに注意してほしい。
2612-なので、たとえば、<code>'class'</code>は、<code>my_class</code>の中の<code>class</code>という部分表現にもマッチする。
2613-</p>
2614-<p>加えて、二重引用符の文字列と一重引用符の文字列を同じリストに記述することは許されていない。
2615-そういうリストの定義は分割する必要がある。
2616-ゆえに、たとえば、以下の定義は間違いだ:
2617-</p>
2618-<table><tr><td>&nbsp;</td><td><pre class="example">preproc = &quot;#define&quot;,'^[[:blank:]]*#([[:blank:]]*[[:word:]]*)'
2619-</pre></td></tr></table>
2620-
2621-<p>一方で、次のものは正しい:
2622-</p>
2623-<table><tr><td>&nbsp;</td><td><pre class="example">preproc = &quot;#define&quot;
2624-preproc = '^[[:blank:]]*#([[:blank:]]*[[:word:]]*)'
2625-</pre></td></tr></table>
2626-
2627-<a name="IDX79"></a>
2628-<p>最後に、定義のリストの最後において、<code>nonsensitive</code>というキーワードを記述してもよい。
2629-その場合、記述された文字列は大文字小文字を区別しないものとして解釈される。
2630-たとえば、この機能はPascal言語の定義で使用している。
2631-&lsquo;<tt>pascal.lang</tt>&rsquo;では、キーワードは大文字小文字を区別せずに解析される:
2632-</p>
2633-<table><tr><td>&nbsp;</td><td><pre class="example">keyword = &quot;alfa|and|array|begin|case|const|div&quot;,
2634- &quot;do|downto|else|end|false|file|for|function|get|goto|if|in&quot;,
2635- &quot;label|mod|new|not|of|or|pack|packed|page|program&quot;,
2636- &quot;put|procedure|read|readln|record|repeat|reset|rewrite|set&quot;,
2637- &quot;text|then|to|true|type|unpack|until|var|while|with|writeln|write&quot;
2638- nonsensitive
2639-</pre></td></tr></table>
2640-
2641-<hr size="6">
2642-<a name="g_t_30e9_30a4_30f3_30ef_30a4_30c9_5b9a_7fa9"></a>
2643-<a name="SEC40"></a>
2644-<table cellpadding="1" cellspacing="1" border="0">
2645-<tr><td valign="middle" align="left">[<a href="#SEC39" title="Previous section in reading order"> &lt; </a>]</td>
2646-<td valign="middle" align="left">[<a href="#SEC41" title="Next section in reading order"> &gt; </a>]</td>
2647-<td valign="middle" align="left"> &nbsp; </td>
2648-<td valign="middle" align="left">[<a href="#SEC37" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
2649-<td valign="middle" align="left">[<a href="#SEC37" title="Up section"> Up </a>]</td>
2650-<td valign="middle" align="left">[<a href="#SEC59" title="Next chapter"> &gt;&gt; </a>]</td>
2651-<td valign="middle" align="left"> &nbsp; </td>
2652-<td valign="middle" align="left"> &nbsp; </td>
2653-<td valign="middle" align="left"> &nbsp; </td>
2654-<td valign="middle" align="left"> &nbsp; </td>
2655-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2656-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2657-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
2658-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2659-</tr></table>
2660-<h2 class="section"> 7.3 ラインワイド定義 </h2>
2661-
2662-<p>行末に至るまで残りの文字全てに影響する言語のエレメントを定義するのは、大変便利だ。
2663-そういう定義には、<code>=</code>の代わりに、<code>start</code>というキーワードを使わなければならない。
2664-たとえば、次のものは、C++における一行コメントの定義である:
2665-</p>
2666-<table><tr><td>&nbsp;</td><td><pre class="example">comment start &quot;//&quot;
2667-</pre></td></tr></table>
2668-
2669-<p>これは、ソースファイルの中で二つの文字<code>//</code>に遭遇すると、これらの文字から行末までの全てが<code>comment</code>というスタイルによってハイライトされるということを意味している。
2670-</p>
2671-<hr size="6">
2672-<a name="g_t_5b9a_7fa9_306e_9806_5e8f"></a>
2673-<a name="SEC41"></a>
2674-<table cellpadding="1" cellspacing="1" border="0">
2675-<tr><td valign="middle" align="left">[<a href="#SEC40" title="Previous section in reading order"> &lt; </a>]</td>
2676-<td valign="middle" align="left">[<a href="#SEC42" title="Next section in reading order"> &gt; </a>]</td>
2677-<td valign="middle" align="left"> &nbsp; </td>
2678-<td valign="middle" align="left">[<a href="#SEC37" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
2679-<td valign="middle" align="left">[<a href="#SEC37" title="Up section"> Up </a>]</td>
2680-<td valign="middle" align="left">[<a href="#SEC59" title="Next chapter"> &gt;&gt; </a>]</td>
2681-<td valign="middle" align="left"> &nbsp; </td>
2682-<td valign="middle" align="left"> &nbsp; </td>
2683-<td valign="middle" align="left"> &nbsp; </td>
2684-<td valign="middle" align="left"> &nbsp; </td>
2685-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2686-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2687-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
2688-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2689-</tr></table>
2690-<h2 class="section"> 7.4 定義の順序 </h2>
2691-
2692-<p>言語の定義の順序が重要であるということを知るのは重要だ。
2693-その順序が正規表現のマッチングの間に使用されるからだ(このことは<a href="#SEC49">source-highlightの仕組み</a>に詳述するつもりだ)。
2694-それから、同じ文字で始まる定義があるならば、最も長い式をまずそのファイルの中で記述しなければならないということを確認しなければならない。
2695-たとえば、次のように書いたとする:
2696-</p>
2697-<table><tr><td>&nbsp;</td><td><pre class="example">symbol = &quot;/&quot;
2698-comment start &quot;//&quot;
2699-</pre></td></tr></table>
2700-
2701-<p>最初の式は、常に最初にマッチさせられる。
2702-そして2番目の式は決してマッチしない。
2703-正しい順序は次のようになる:
2704-</p>
2705-<table><tr><td>&nbsp;</td><td><pre class="example">comment start &quot;//&quot;
2706-symbol = &quot;/&quot;
2707-</pre></td></tr></table>
2708-
2709-<hr size="6">
2710-<a name="delim_5b9a_7fa9"></a>
2711-<a name="SEC42"></a>
2712-<table cellpadding="1" cellspacing="1" border="0">
2713-<tr><td valign="middle" align="left">[<a href="#SEC41" title="Previous section in reading order"> &lt; </a>]</td>
2714-<td valign="middle" align="left">[<a href="#SEC43" title="Next section in reading order"> &gt; </a>]</td>
2715-<td valign="middle" align="left"> &nbsp; </td>
2716-<td valign="middle" align="left">[<a href="#SEC37" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
2717-<td valign="middle" align="left">[<a href="#SEC37" title="Up section"> Up </a>]</td>
2718-<td valign="middle" align="left">[<a href="#SEC59" title="Next chapter"> &gt;&gt; </a>]</td>
2719-<td valign="middle" align="left"> &nbsp; </td>
2720-<td valign="middle" align="left"> &nbsp; </td>
2721-<td valign="middle" align="left"> &nbsp; </td>
2722-<td valign="middle" align="left"> &nbsp; </td>
2723-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2724-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2725-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
2726-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2727-</tr></table>
2728-<h2 class="section"> 7.5 delim定義 </h2>
2729-
2730-<p>多くのエレメントは特定の文字の並びで区切られている。
2731-たとえば文字列や複数行のコメントである。
2732-こういうエレメントの定義のシンタックスは次のようになる:
2733-</p>
2734-<table><tr><td>&nbsp;</td><td><pre class="example">&lt;name&gt; delim &lt;left delimited&gt; &lt;right delimiter&gt; \
2735- {escape &lt;escape character&gt;} \
2736- {multiline} {nested}
2737-</pre></td></tr></table>
2738-
2739-<p><code>escape</code>ステートメントは、そのエレメントの内部にある区切り子の一つに前置させるエスケープ用の文字を指定するものだ。
2740-これはオプショナルである。
2741-</p>
2742-<p>たとえば、Cライクな文字列の定義は次のようになる:
2743-</p>
2744-<table><tr><td>&nbsp;</td><td><pre class="example">string delim &quot;\&quot;&quot; &quot;\&quot;&quot; escape &quot;\\&quot;
2745-</pre></td></tr></table>
2746-
2747-<p><code>\</code>は定義における特殊文字なので、エスケープしなければならないことに注意してほしい。
2748-<code>escape</code>の指定が省略されると、Cの文字列<code>&quot;write \&quot;hello\&quot; string&quot;</code>は間違ってハイライトされてしまっていただろう(<code>&quot;write \&quot;</code>という文字列と、通常の文字並びの<code>hello\</code>、そして文字列の<code>&quot; string&quot;</code>というようにハイライトされてしまっていた)。
2749-</p>
2750-<p><code>multiline</code>というオプションは、そのエレメントが複数行に渡ることがあるというとを記述するものだ。
2751-たとえば、PHPの文字列の定義は次のようになる:
2752-</p>
2753-<table><tr><td>&nbsp;</td><td><pre class="example">string delim &quot;\&quot;&quot; &quot;\&quot;&quot; escape &quot;\\&quot; multiline
2754-</pre></td></tr></table>
2755-
2756-<p><code>nested</code>というオプションは、区切りの文字が複数あった可能性をカウントして、(スタックを使って)対応する複数の(区切り文字の)出現をマッチさせるように指示するものだ。
2757-たとえば、ネストしているCライクな複数行コメントをハイライトしたいのならば(Ed Kellyが正しく指摘したように、Cスタイルのコメントはネストしない。数年間C++とJavaを使っていて、コメントというのはネストするとずっと思っていたことを遺憾に思う :-) そういう理由で、source-highlightの前のバージョンの配布物では、Cスタイルのコメントは(間違って)ネストされるように定義されていた。フィードバックをくれたEdに感謝する)、次のような定義が使えるだろう。
2758-</p>
2759-<table><tr><td>&nbsp;</td><td><pre class="example">comment delim &quot;/*&quot; &quot;*/&quot; multiline nested
2760-</pre></td></tr></table>
2761-
2762-<p><code>nested</code>が使われなかったとしたら、以下に示すネストされたコメントの閉じる<code>*/</code>がこのコメントを終了させてしまうだろう(そして2番目の<code>*</code>はコメントとしてはハイライトされないだろう):
2763-</p>
2764-<table><tr><td>&nbsp;</td><td><pre class="example">/*
2765- This is a /* nested comment */
2766-*/
2767-</pre></td></tr></table>
2768-
2769-<p>区切り子で区切られた言語のエレメントがネストできるようにするには、その開始と終了のエレメントが異なっていなければならない。
2770-なので、例えば以下の定義は正しくない:
2771-</p>
2772-<table><tr><td>&nbsp;</td><td><pre class="example">string delim &quot;\&quot;&quot; &quot;\&quot;&quot; nested # WRONG!
2773-</pre></td></tr></table>
2774-
2775-<p>上で述べたように、定義は累積的であり、そして文法的に異なった形式を使ったときですら累積的だ。
2776-従って、例えば、C++スタイルのコメントの完全な定義は次のようになる(実際、Cスタイルのコメントの定義はもっとややこしい。&lsquo;<tt>c_comment.lang</tt>&rsquo;というファイルを見てほしい):
2777-</p>
2778-<table><tr><td>&nbsp;</td><td><pre class="example">comment start &quot;//&quot;
2779-comment delim &quot;/*&quot; &quot;*/&quot; multiline
2780-</pre></td></tr></table>
2781-
2782-<hr size="6">
2783-<a name="g_t_5909_6570_5b9a_7fa9"></a>
2784-<a name="SEC43"></a>
2785-<table cellpadding="1" cellspacing="1" border="0">
2786-<tr><td valign="middle" align="left">[<a href="#SEC42" title="Previous section in reading order"> &lt; </a>]</td>
2787-<td valign="middle" align="left">[<a href="#SEC44" title="Next section in reading order"> &gt; </a>]</td>
2788-<td valign="middle" align="left"> &nbsp; </td>
2789-<td valign="middle" align="left">[<a href="#SEC37" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
2790-<td valign="middle" align="left">[<a href="#SEC37" title="Up section"> Up </a>]</td>
2791-<td valign="middle" align="left">[<a href="#SEC59" title="Next chapter"> &gt;&gt; </a>]</td>
2792-<td valign="middle" align="left"> &nbsp; </td>
2793-<td valign="middle" align="left"> &nbsp; </td>
2794-<td valign="middle" align="left"> &nbsp; </td>
2795-<td valign="middle" align="left"> &nbsp; </td>
2796-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2797-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2798-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
2799-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2800-</tr></table>
2801-<h2 class="section"> 7.6 変数定義 </h2>
2802-
2803-<p>言語定義ファイルの中の多くの場所で再利用されるように変数を定義することが可能だ。
2804-変数は次のように定義される。
2805-</p>
2806-<p><code>vardef</code> &lt;name of the variable&gt; <code>=</code> &lt;list of definitions&gt;
2807-</p>
2808-<p>一度定義すると、その変数名の前に<code>$</code>というシンボルを付けることで使うことができる。
2809-例えば次のようになる。
2810-</p>
2811-<table><tr><td>&nbsp;</td><td><pre class="example">vardef FUNCTION = '(?:[[:alpha:]]|_)[[:word:]]*(?=[[:blank:]]*\()'
2812-function = $FUNCTION
2813-</pre></td></tr></table>
2814-
2815-<p>大文字にしたのは単に読み易さの為だけだ。
2816-</p>
2817-<p>変数と式を連結することも可能で、さらなる変数の定義の内部で変数を再利用することもできる:
2818-</p>
2819-<table><tr><td>&nbsp;</td><td><pre class="example">vardef basic_time = '[[:digit:]]{2}:[[:digit:]]{2}:[[:digit:]]{2}'
2820-vardef time = '\&lt;' + $basic_time + '\&gt;'
2821-</pre></td></tr></table>
2822-
2823-<hr size="6">
2824-<a name="g_t_52d5_7684_5f8c_65b9_53c2_7167"></a>
2825-<a name="SEC44"></a>
2826-<table cellpadding="1" cellspacing="1" border="0">
2827-<tr><td valign="middle" align="left">[<a href="#SEC43" title="Previous section in reading order"> &lt; </a>]</td>
2828-<td valign="middle" align="left">[<a href="#SEC45" title="Next section in reading order"> &gt; </a>]</td>
2829-<td valign="middle" align="left"> &nbsp; </td>
2830-<td valign="middle" align="left">[<a href="#SEC37" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
2831-<td valign="middle" align="left">[<a href="#SEC37" title="Up section"> Up </a>]</td>
2832-<td valign="middle" align="left">[<a href="#SEC59" title="Next chapter"> &gt;&gt; </a>]</td>
2833-<td valign="middle" align="left"> &nbsp; </td>
2834-<td valign="middle" align="left"> &nbsp; </td>
2835-<td valign="middle" align="left"> &nbsp; </td>
2836-<td valign="middle" align="left"> &nbsp; </td>
2837-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2838-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2839-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
2840-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2841-</tr></table>
2842-<h2 class="section"> 7.7 動的後方参照 </h2>
2843-
2844-<p><em>動的後方参照</em>を使うと、<code>delim</code>指定の最初のエレメントの正規表現によってマッチした文字列を参照することができる(バージョン2.8から)。
2845-私はこの後方参照のことを、正規表現シンタックスの後方参照によってそれらを区別するために、ダイナミックと呼んだ(<a href="#SEC38">正規表現の指定方法</a>を参照)。
2846-右側のデリミタ(区切り子)が左側のデリミタによってマッチした部分表現に依存しているような場合にこれは極めて重要である。
2847-たとえば、Luaのコメントは<code>--[[ comment ]]</code>や<code>--[=[ comment ]=]</code>の形になるが、<code>--[=[ comment ]]</code>や<code>--[[ comment ]=]</code>のどちらでもない(さらに言えば、ネストしてもよい)<a name="DOCF28" href="#FOOT28">(28)</a>。
2848-従って、右側のエレメントの正規表現は、左側のエレメントのものに依存している。
2849-</p>
2850-<p>動的後方参照は変数に似ている(<a href="#SEC43">変数定義</a>)が、宣言は無く、次のような形をしている。
2851-</p>
2852-<table><tr><td>&nbsp;</td><td><pre class="example">@{number}
2853-</pre></td></tr></table>
2854-
2855-<p>ここで、<code>number</code>は左側のデリミタにおけるマークされた部分表現の番号だ(source-highlightは、そういったマークされた部分表現が左側のデリミタに存在することを実際に確認する)。
2856-</p>
2857-<p>たとえば、これがLuaのコメントの定義だ(&lsquo;<tt>lua.lang</tt>&rsquo;も見よ):
2858-</p>
2859-<table><tr><td>&nbsp;</td><td><pre class="example">environment comment delim `--\[(=*)\[` &quot;]&quot; + @{1} + &quot;]&quot;
2860- multiline nested begin
2861- include &quot;url.lang&quot;
2862- ...
2863-end
2864-</pre></td></tr></table>
2865-
2866-<p>左側のデリミタが、マークされた部分表現としてオプショナルな<code>=</code>とどのようにマッチして、右側のデリミタが@{1}によってそれをどのように参照するかを注意してほしい。
2867-</p>
2868-<p>source-highlightは、動的後方参照の置き換えの際に、起こりうる特殊文字のエスケープの面倒を見る。
2869-たとえば、次に示すようなdelimエレメントで、<code>[^[:alnum:]]</code>という部分表現が<code>|</code>とマッチしたために、@{1}を<code>|</code>に置き換えなければならないとしよう:
2870-</p>
2871-<table><tr><td>&nbsp;</td><td><pre class="example">comment delim `([^[:alnum:]])` @{1}
2872-</pre></td></tr></table>
2873-
2874-<p><code>|</code>は正規表現のシンタックスにおいて特別な文字なので、source-highlightは、<code>@{1}</code>を実際には<code>\|</code>と置き換える。
2875-</p>
2876-<p>重要:右側のデリミタは、その左側のデリミタの部分表現を参照できるだけである。
2877-そのため、ネストされたdelimエレメントの定義の場合(たとえばstateやenvironmentで。<a href="#SEC46">state/environment定義</a>を参照)、左側のデリミタはバインダとして振舞い、外側のdelimエレメントで定義されている起こりうる部分表現を隠す。
2878-</p>
2879-<p>後方参照でネストしている区切り子で区切られたエレメントに正しくマッチすることは大変重要なことだ。
2880-source-highlightはこのLuaのネストした(そして文法上は正しい)コメントを正しく認識する:
2881-</p>
2882-<table><tr><td>&nbsp;</td><td><pre class="example">--[[
2883- first level comment
2884- --[=[
2885- second level
2886- --[[
2887- third level
2888- ]]
2889- ]=]
2890-]]
2891-</pre></td></tr></table>
2892-
2893-<hr size="6">
2894-<a name="g_t_30d5_30a1_30a4_30eb_306e_30a4_30f3_30af_30eb_30fc_30c9"></a>
2895-<a name="SEC45"></a>
2896-<table cellpadding="1" cellspacing="1" border="0">
2897-<tr><td valign="middle" align="left">[<a href="#SEC44" title="Previous section in reading order"> &lt; </a>]</td>
2898-<td valign="middle" align="left">[<a href="#SEC46" title="Next section in reading order"> &gt; </a>]</td>
2899-<td valign="middle" align="left"> &nbsp; </td>
2900-<td valign="middle" align="left">[<a href="#SEC37" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
2901-<td valign="middle" align="left">[<a href="#SEC37" title="Up section"> Up </a>]</td>
2902-<td valign="middle" align="left">[<a href="#SEC59" title="Next chapter"> &gt;&gt; </a>]</td>
2903-<td valign="middle" align="left"> &nbsp; </td>
2904-<td valign="middle" align="left"> &nbsp; </td>
2905-<td valign="middle" align="left"> &nbsp; </td>
2906-<td valign="middle" align="left"> &nbsp; </td>
2907-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2908-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2909-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
2910-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2911-</tr></table>
2912-<h2 class="section"> 7.8 ファイルのインクルード </h2>
2913-
2914-<p>言語定義ファイルを、別のファイルにインクルードすることができる。
2915-これは、インクルードが起きたちょうどその場所で、解析中の現在のファイルの中にインクルードされるファイルの内容を実際に物理的にインクルードする(ちょうどC/C++における<code>#include</code>のようなもの)。
2916-これは、多数のファイルで定義を再利用するのに役に立つ。
2917-たとえば、c++のコメントの定義は&lsquo;<tt>c_comment.lang</tt>&rsquo;というファイルで記述されていて、このファイルはJavaやC++の定義ファイルでインクルードされている。
2918-同じことは、numberやfunctionでも行われている。
2919-例を挙げると、&lsquo;<tt>java.lang</tt>&rsquo;ファイルには以下に示すincludeの指示が含まれている:
2920-</p>
2921-<table><tr><td>&nbsp;</td><td><pre class="example">include &quot;c_comment.lang&quot;
2922-
2923-include &quot;number.lang&quot;
2924-
2925-keywords ...
2926-
2927-include &quot;function.lang&quot;
2928-</pre></td></tr></table>
2929-
2930-<p>定義の順序が重要であるので、インクルードの順序が重要であることに注意してほしい。
2931-たとえば、キーワードの定義よりも前に関数の定義がインクルードされると、<code>if (exp)</code>というセンテンスは関数呼び出しとしてハイライトされるだろう(<a href="#SEC41">定義の順序</a>と<a href="#SEC49">source-highlightの仕組み</a>を参照)。
2932-</p>
2933-<hr size="6">
2934-<a name="state_002fenvironment_5b9a_7fa9"></a>
2935-<a name="SEC46"></a>
2936-<table cellpadding="1" cellspacing="1" border="0">
2937-<tr><td valign="middle" align="left">[<a href="#SEC45" title="Previous section in reading order"> &lt; </a>]</td>
2938-<td valign="middle" align="left">[<a href="#SEC47" title="Next section in reading order"> &gt; </a>]</td>
2939-<td valign="middle" align="left"> &nbsp; </td>
2940-<td valign="middle" align="left">[<a href="#SEC37" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
2941-<td valign="middle" align="left">[<a href="#SEC37" title="Up section"> Up </a>]</td>
2942-<td valign="middle" align="left">[<a href="#SEC59" title="Next chapter"> &gt;&gt; </a>]</td>
2943-<td valign="middle" align="left"> &nbsp; </td>
2944-<td valign="middle" align="left"> &nbsp; </td>
2945-<td valign="middle" align="left"> &nbsp; </td>
2946-<td valign="middle" align="left"> &nbsp; </td>
2947-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2948-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2949-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
2950-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2951-</tr></table>
2952-<h2 class="section"> 7.9 state/environment定義 </h2>
2953-
2954-<p>他のエレメントに挟まれている場合にだけ、あるソースエレメントをハイライトしたいということが時折ある。
2955-source-highlightedの言語定義では、この機能も用意している。
2956-</p>
2957-<table><tr><td>&nbsp;</td><td><pre class="example">state|environment &lt;standard definition&gt; begin
2958- &lt;other definitions&gt;
2959-end
2960-</pre></td></tr></table>
2961-
2962-<p>この構造は再帰的だ(なので、state/environmentの定義は別のstate/environmentの内部で使うことができる)。
2963-state/environmentの意味は、state/environmentを定義している定義がマッチした場合にだけ、<code>begin ... end</code>の内部の定義がマッチするということである。
2964-しかし、state/environmentに入ったとき、そのstate/environmentの外側で指定されている定義はマッチしない。
2965-<code>state</code>と<code>environment</code>の違いは、後者においては、ソース言語の通常の部分(つまり、どの定義にもマッチしない部分)は、そのenvironmentを定義している定義のスタイルに応じてハイライトされるということだ。
2966-</p>
2967-<p>例として次に示すのは、複数行のネスト可能なCのコメントで、コメントの内側にURLやメールアドレスが表われたときだけ、それらをハイライトする(ファイルのインクルードを使っているので注意してほしい):
2968-</p>
2969-<table><tr><td>&nbsp;</td><td><pre class="example">environment comment delim &quot;/*&quot; &quot;*/&quot; multiline nested begin
2970- include &quot;url.lang&quot;
2971-end
2972-</pre></td></tr></table>
2973-
2974-<p>コメントの内側の他の部分は全部commentのスタイルでフォーマットされなければならないため<code>environment</code>を使用しているので留意してほしい。
2975-</p>
2976-<p>プログラミング言語の定義については、state/environmentを避けられるが(コメント内のURLとか、Javasocのコメント内のドキュメンテーションタグのように、特定の環境の内部だけでその一部分をハイライトできるようになるが)、ログやChangeLogファイルのようなファイルをハイライトするのにはかなり重要である。
2977-エレメントが特定の位置に表われたときにハイライトしなければならないからだ。
2978-たとえば、ChangeLogの場合(&lsquo;<tt>changelog.lang</tt>&rsquo;を参照)、日付や名前、メール、URL(&lsquo;<tt>url.lang</tt>&rsquo;から取った)をハイライトするのにstateを使っている:
2979-</p>
2980-<table><tr><td>&nbsp;</td><td><pre class="example">state date start '[[:digit:]]{2,4}-?[[:digit:]]{2}-?[[:digit:]]{2}' begin
2981- include &quot;url.lang&quot;
2982- name = '([[:word:]]|[[:punct:]])+'
2983-end
2984-</pre></td></tr></table>
2985-
2986-<p>(訳注:ぐだぐだです)
2987-state/environmentの内部に現われる定義は、その環境で定義される式と同じスコープを持つ。
2988-これによって、<code>start</code>と<code>delim</code>の定義にとっては意味がある一方で、簡単な定義にとっては合理的でないかもしれない(つまり、取り得る式を単にリストするものなど)。
2989-事実、こういう場合そのような式はスコープを定義しない。
2990-そのような定義にとって、state/environmentの意味は、その選択肢の一つとマッチングしたあとにstate/environmentが開始するということだ。
2991-そしてそれはどこで終わるのだろうか。
2992-この場合環境を明示的に終了しなければならない。
2993-たとえば、state/environmentの内部にいる場合、ある言語定義がキーワード<code>exit</code>にぶつかったときにも、その環境を抜け出す(脱出するstateの数を指定することもできる)。
2994-<code>exitall</code>を使えば環境を全部抜けることもできる。
2995-たとえば、以下に示す定義は、ウェブメソッドが後に続く空でない文字列をハイライトにする:
2996-</p>
2997-<table><tr><td>&nbsp;</td><td><pre class="example">vardef non_empty = '[^[:blank:]]+'
2998-
2999-state webmethod = &quot;OPTIONS|GET|HEAD|POST|PUT|DELETE&quot;,
3000- &quot;TRACE|CONNECT|PROPFIND|MKCOL|COPY|MOVE|LOCK|UNLOCK&quot; begin
3001- string = $non_empty exit
3002-end
3003-</pre></td></tr></table>
3004-
3005-<p>このような進んだ機能が必要な場合にはいつでも、いくつかのログファイル(アクセスログ、Apacheのログなど)のハイライトを定義している&lsquo;<tt>log.lang</tt>&rsquo;定義ファイルを見てもらったらよい。
3006-さらに、明示的な名前付きの部分式で十分なような場合、上述の例がその一つなのだが、そういう場合があるかもしれない。
3007-</p>
3008-<p>このセクションを面白い例で締め括ろう。
3009-M4ファイルにおけるコメントは、<code>dnl</code>というキーワードで始まる(行末まで)。
3010-たとえば、次のようになる。
3011-</p>
3012-<table><tr><td>&nbsp;</td><td><pre class="example">dnl @synopsis AC_CTAGS_FLAGS
3013-</pre></td></tr></table>
3014-
3015-<p>さて、<code>dnl</code>をキーワードとしてハイライトし、残りの部分をコメントとしてハイライトしたい場合、environmentに簡単に頼ることはできない。
3016-その行全体を同じスタイルでハイライトしてしまうからだ。
3017-加えて、<code>@</code>で始まるエレメントを違うようにハイライトしたいので、実はstateが必要となる(これは前述の例にあるC++のコメントの場合のようにコメントの内部でURLをハイライトすることもできる)。
3018-なので、stateでenvironmentをシミュレートする必要がある。
3019-M4の例の場合次のようにする(&lsquo;<tt>m4.lang</tt>&rsquo;ファイルを見よ)。
3020-</p>
3021-<table><tr><td>&nbsp;</td><td><pre class="example">state keyword start &quot;dnl&quot; begin
3022- # avoid spaces in front of urls or @[[:alpha:]]+ be captured as prefixes
3023- comment = '[[:blank:]]+'
3024- include &quot;url.lang&quot;
3025- include &quot;html.lang&quot;
3026- type = '@[[:alpha:]]+'
3027- # everything else is a comment
3028- comment = '.+'
3029-end
3030-</pre></td></tr></table>
3031-
3032-<p>一度このstateに入ると、単独の空白文字が全てコメントとしてハイライトされる。
3033-次に、URLと@エレメントに対するルールがあって、それから、他の全てがコメントとしてハイライトされる(<code>.+</code> )。
3034-</p>
3035-<p>単に次に示す定義をするのが、よりスマートな方法ではないかと考える人もいるかもしれない(after all, why bothering highlighting spaces as comments)。
3036-</p>
3037-<table><tr><td>&nbsp;</td><td><pre class="example">state keyword start &quot;dnl&quot; begin
3038- include &quot;url.lang&quot;
3039- include &quot;html.lang&quot;
3040- type = '@[[:alpha:]]+'
3041- comment = '.+'
3042-end
3043-</pre></td></tr></table>
3044-
3045-<p>さて、この定義によって、マッチしたURLや@エレメントの前にある空白は、プリフィックスであると考えられて、normalとしてハイライトされるだろう。
3046-これは、source-highlightがマッチするルールを探す方法に原因がある。
3047-詳細については、<a href="#SEC49">source-highlightの仕組み</a>を参照する。
3048-</p>
3049-<hr size="6">
3050-<a name="g_t_540d_524d_3092_4f7f_3063_305f_660e_793a_7684_306a_90e8_5206_8868_73fe"></a>
3051-<a name="SEC47"></a>
3052-<table cellpadding="1" cellspacing="1" border="0">
3053-<tr><td valign="middle" align="left">[<a href="#SEC46" title="Previous section in reading order"> &lt; </a>]</td>
3054-<td valign="middle" align="left">[<a href="#SEC48" title="Next section in reading order"> &gt; </a>]</td>
3055-<td valign="middle" align="left"> &nbsp; </td>
3056-<td valign="middle" align="left">[<a href="#SEC37" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
3057-<td valign="middle" align="left">[<a href="#SEC37" title="Up section"> Up </a>]</td>
3058-<td valign="middle" align="left">[<a href="#SEC59" title="Next chapter"> &gt;&gt; </a>]</td>
3059-<td valign="middle" align="left"> &nbsp; </td>
3060-<td valign="middle" align="left"> &nbsp; </td>
3061-<td valign="middle" align="left"> &nbsp; </td>
3062-<td valign="middle" align="left"> &nbsp; </td>
3063-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3064-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3065-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
3066-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3067-</tr></table>
3068-<h2 class="section"> 7.10 名前を使った明示的な部分表現 </h2>
3069-
3070-<p>よく、同じ正規表現の中でプログラムの二つのエレメントを記述する必要がある。
3071-それらが密接な関係があるからだが、それらを違うようにハイライトする必要がある場合もある。
3072-</p>
3073-<p>たとえば、クラス(あるいはインターフェイス)の定義中のクラス名(あるいはインターフェイス名)をハイライトしたいことがあるかもしれない(たとえばJavaなど)。
3074-従って、<code>class</code>キーワードが前置きされて、識別子がその後に続くことを利用することができる。
3075-</p>
3076-<p>一つ定義を示す。
3077-</p>
3078-<table><tr><td>&nbsp;</td><td><pre class="example">keyword = '(\&lt;(?:class|interface))([[:blank:]]+)([$[:alnum:]]+)'
3079-</pre></td></tr></table>
3080-
3081-<p>このような定義は、良い結果をもたらさない。
3082-というのも、クラスの名前がキーワードとしてハイライトされてしまうからだ。
3083-これは望んでいたことではないかもしれない。
3084-たとえば、クラス名は<code>type</code>としてハイライトされるべきなど。
3085-</p>
3086-<p>バージョン2.6までは、これを行なう方法はstateかenvironmentを使うことだけだった(<a href="#SEC46">state/environment定義</a>)が、これを書くのはかなり難しくなりがちである。
3087-</p>
3088-<p>バージョン2.7から、マークされた部分表現を使って正規表現を記述し、それらをそれぞれ特定の言語エレメントにバインドすることができるようになった(正規表現は<code>`</code>で括られる必要がある。<a href="#SEC38">正規表現の指定方法</a>を参照)。
3089-</p>
3090-<table><tr><td>&nbsp;</td><td><pre class="example">(elem1,...,elemn) = `(subexp1)(...)(subexpn)`
3091-</pre></td></tr></table>
3092-
3093-<p>さあ、このシンタックスを使えば、前出のゴールに辿り着ける。
3094-</p>
3095-<table><tr><td>&nbsp;</td><td><pre class="example">(keyword,normal,type) =
3096- `(\&lt;(?:class|interface))([[:blank:]]+)([$[:alnum:]]+)`
3097-</pre></td></tr></table>
3098-
3099-<p>このようにすれば、<code>class</code>(あるいは<code>interface</code>)はキーワードとしてハイライトされ、間を分けるブランクの文字は<code>normal</code>としてフォーマットされ、そして、クラス名は<code>type</code>としてフォーマットされる。
3100-</p>
3101-<p>エレメントの名前の数は、正規表現中の部分表現の数と等しくなければならない。
3102-さらに、少なくとも現在のバージョンでは、その正規表現の中にはマークされた部分表現だけしか入れられず(部分表現の外には文字が無い)、部分表現をネストすることもできない。
3103-</p>
3104-<p>従って次のような記述は正しくない。
3105-</p>
3106-<table><tr><td>&nbsp;</td><td><pre class="example">(keyword,symbol) = `(...)(...)(...)` # number of elements doesn't match
3107-(keyword,symbol) = `(...(...)...)(...)` # contains nested subexpressions
3108-(keyword,symbol) = `...(...)...(...)` # outside characters
3109-</pre></td></tr></table>
3110-
3111-<p>このメカニズムでは、ある状況において、正規表現をもっとコンパクトに、そして恐らくもっと読み易いやり方で表記することを許している。
3112-たとえば、次に示すようなChangeLogの各部をハイライトする場合を考える(オプショナルな<code>*</code>はシンボルとして、オプショナルなファイル名とカッコ内に記述されたエレメントは<code>file</code>エレメントとして、そして残りの部分は<code>normal</code>でハイライトする)。
3113-</p>
3114-<table><tr><td>&nbsp;</td><td><pre class="example"> * src/Makefile.am (source_highlight_SOURCES): correctly include
3115- changelog_scanner.ll
3116-
3117- * this is a comment without a file name
3118-</pre></td></tr></table>
3119-
3120-<p>バージョン2.6以前は、次の二つの言語定義を使っていた。
3121-</p>
3122-<table><tr><td>&nbsp;</td><td><pre class="example">state symbol start '^(?:[[:blank:]]+)\*[[:blank:]]+' begin
3123- state file start '[^:]+\:' begin
3124- normal start '.'
3125- end
3126-end
3127-
3128-state normal start '^(?:[[:blank:]]+)' begin
3129- state file start '[^:]+\:' begin
3130- normal start '.'
3131- end
3132-end
3133-</pre></td></tr></table>
3134-
3135-<p>これを書いてしまった後に読むのは大変だ。
3136-さて今は、もっと簡単に書くことができる(&lsquo;<tt>changelog.lang</tt>&rsquo;を見よ)。
3137-</p>
3138-<table><tr><td>&nbsp;</td><td><pre class="example">(normal,symbol,normal,file)=
3139- `(^[[:blank:]]+)(\*)([[:blank:]]+)((?:[^:]+\:)?)`
3140-(normal,file)= `(^[[:blank:]]+)((?:[^:]+\:)?)`
3141-</pre></td></tr></table>
3142-
3143-<p>名前の付きの明示的な部分表現を使った言語エレメントの定義は複数のエレメントからできていて、それゆえ複数のフォーマットスタイルから成っているので、environmentを開始するのに使うことはできない(デフォルトのエレメントは何なのだろう?)。
3144-一方、上で見たように、stateを開始するのには使うことができる。
3145-</p>
3146-<hr size="6">
3147-<a name="g_t_518d_5b9a_7fa9_3068_7f6e_63db"></a>
3148-<a name="SEC48"></a>
3149-<table cellpadding="1" cellspacing="1" border="0">
3150-<tr><td valign="middle" align="left">[<a href="#SEC47" title="Previous section in reading order"> &lt; </a>]</td>
3151-<td valign="middle" align="left">[<a href="#SEC49" title="Next section in reading order"> &gt; </a>]</td>
3152-<td valign="middle" align="left"> &nbsp; </td>
3153-<td valign="middle" align="left">[<a href="#SEC37" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
3154-<td valign="middle" align="left">[<a href="#SEC37" title="Up section"> Up </a>]</td>
3155-<td valign="middle" align="left">[<a href="#SEC59" title="Next chapter"> &gt;&gt; </a>]</td>
3156-<td valign="middle" align="left"> &nbsp; </td>
3157-<td valign="middle" align="left"> &nbsp; </td>
3158-<td valign="middle" align="left"> &nbsp; </td>
3159-<td valign="middle" align="left"> &nbsp; </td>
3160-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3161-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3162-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
3163-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3164-</tr></table>
3165-<h2 class="section"> 7.11 再定義と置換 </h2>
3166-
3167-<p>この二つの機能は、既存の言語定義にいくらかの変更加えて再利用することによって言語を定義したい場合に便利だ。
3168-通常だと、他の言語定義ファイルを<code>include</code>して、いくつかの要素について再定義と置き換えを行なう。
3169-</p>
3170-<a name="IDX80"></a>
3171-<p><code>redef</code>を使うと、その言語エレメントの元の定義を新しい定義で消してしまう。
3172-その新しい言語定義は、まさにその定義の位置に配置される。
3173-たとえば、<code>caml</code>言語の定義を再利用することで<code>sml</code>言語を定義するようなときにこの機能を使う。
3174-この二つの言語はキーワードだけが違う<a name="DOCF29" href="#FOOT29">(29)</a>。
3175-事実、&lsquo;<tt>sml.lang</tt>&rsquo;の中身は次のように要約できる。
3176-</p>
3177-<table><tr><td>&nbsp;</td><td><pre class="example">include &quot;caml.lang&quot;
3178-
3179-redef keyword = &quot;abstraction|abstype|and|andalso...&quot;
3180-
3181-redef type = &quot;int|byte|boolean|char|long|float|double|short|void&quot;
3182-</pre></td></tr></table>
3183-
3184-<p>この新しい言語エレメントの定義は、再定義されたちょうどその位置に現われるので、そのような正規表現は、それよりも前のもの(インクルードされるファイルにあるもの)がマッチしなかったときだけマッチするということを意味している。
3185-これによって、望まない結果が生じるケースもある(<code>sml</code>のケースは違うけれども)。
3186-言い換えてみよう。次のコードを見てほしい。
3187-</p>
3188-<table><tr><td>&nbsp;</td><td><pre class="example">keyword = &quot;foo&quot;
3189-keyword = &quot;bar&quot;
3190-type = &quot;int&quot;
3191-redef keyword = &quot;myfoo&quot;
3192-</pre></td></tr></table>
3193-
3194-<p>このコードはさらに次のコードと等価である。
3195-</p>
3196-<table><tr><td>&nbsp;</td><td><pre class="example">type = &quot;int&quot;
3197-keyword = &quot;myfoo&quot;
3198-</pre></td></tr></table>
3199-
3200-<a name="IDX81"></a>
3201-<p>これが必要なものではないのなら、<code>subst</code>を使うことができる。
3202-これは<code>redef</code>と似ているが、言語エレメントの前の最初の定義を、その最初の定義のちょうどその位置で置き換えてしまうということが異なる(他の可能な限りの定義は単に消去される)。
3203-次のコードを見てほしい。
3204-</p>
3205-<table><tr><td>&nbsp;</td><td><pre class="example">keyword = &quot;foo&quot;
3206-keyword = &quot;bar&quot;
3207-type = &quot;int&quot;
3208-subst keyword = &quot;myfoo&quot;
3209-</pre></td></tr></table>
3210-
3211-<p>これはすなわち、さらに次のコードと等価である。
3212-</p>
3213-<table><tr><td>&nbsp;</td><td><pre class="example">keyword = &quot;myfoo&quot;
3214-type = &quot;int&quot;
3215-</pre></td></tr></table>
3216-
3217-<p>要求にぴったりと合うのがどちらなのかを決めるのはあなた次第だ。
3218-この機能で、<code>java</code>を元にして<code>javascript</code>を定義してもよい。
3219-</p>
3220-<table><tr><td>&nbsp;</td><td><pre class="example">include &quot;java.lang&quot;
3221-
3222-subst keyword = &quot;abstract|break|case|catch|class|if...&quot;
3223-</pre></td></tr></table>
3224-
3225-<p>ここで、<code>redef</code>は、<code>if (exp)</code>が関数呼び出しとしてハイライトされてしまうという望まない振舞いをしてしまう。
3226-これはfunctionエレメントの定義が<code>if</code>をキーワードとして再定義するものより先に来て(そして先にマッチして)しまうからだ。
3227-もう一つ別の例を挙げると、C/C++の言語定義を再利用したC#の言語定義である(<a href="#SEC56">C/C++とC#のハイライティング</a>)。
3228-</p>
3229-<hr size="6">
3230-<a name="source_002dhighlight_306e_4ed5_7d44_307f"></a>
3231-<a name="SEC49"></a>
3232-<table cellpadding="1" cellspacing="1" border="0">
3233-<tr><td valign="middle" align="left">[<a href="#SEC48" title="Previous section in reading order"> &lt; </a>]</td>
3234-<td valign="middle" align="left">[<a href="#SEC50" title="Next section in reading order"> &gt; </a>]</td>
3235-<td valign="middle" align="left"> &nbsp; </td>
3236-<td valign="middle" align="left">[<a href="#SEC37" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
3237-<td valign="middle" align="left">[<a href="#SEC37" title="Up section"> Up </a>]</td>
3238-<td valign="middle" align="left">[<a href="#SEC59" title="Next chapter"> &gt;&gt; </a>]</td>
3239-<td valign="middle" align="left"> &nbsp; </td>
3240-<td valign="middle" align="left"> &nbsp; </td>
3241-<td valign="middle" align="left"> &nbsp; </td>
3242-<td valign="middle" align="left"> &nbsp; </td>
3243-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3244-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3245-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
3246-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3247-</tr></table>
3248-<h2 class="section"> 7.12 source-highlightの仕組み </h2>
3249-
3250-<p><a href="#SEC37">言語の定義</a>の冒頭で少し書いたように、source-highlightは言語の定義ファイルにある定義を使って、入力ファイルのトークンをハイライトするのに使う正規表現を内部的にオンザフライに生成する。
3251-ここで、言語定義ファイルを正しく書く方法を理解するのに重要となる内部の詳細について述べる<a name="DOCF30" href="#FOOT30">(30)</a>。
3252-</p>
3253-<p>まず、各エレメントの定義ごとに、source-highlightがハイライトのためのルールを作る(同じ言語エレメントに該当するものでもそのようにする)。
3254-従って、各言語エレメントのファイルはハイライトのためのルールのリストに対応する。
3255-source-highlightは、入力ファイルの各行について、その行全体を(もっと正しく言うと、その行のまだハイライトされていない部分を)これらのルール全てに対してマッチしてみる。
3256-ハイライトのためのルールが一つマッチしたらすぐに止めるわけではない。
3257-「ベター」にマッチする別のルールがあるかもしれないからだ。
3258-ここで、全てというのは基本的に<em>ベターマッチ</em>という意味に帰着する。
3259-</p>
3260-<a name="IDX82"></a>
3261-<p>source-highlightが使う戦略は、次の状態の最初にマッチしたルールを選択するということだ。
3262-</p>
3263-<ul class="toc">
3264-<li>
3265-空のプリフィックス(あるいは空白の文字、すなわちスペースやタブだけを含むプリフィックス)を伴う
3266-
3267-</li><li>
3268-最小のプリフィックスを伴う
1235+<h2 class="chapter">4 Simple Usage</h2>
1236+
1237+<p><a name="index-sample-67"></a>
1238+Here are some realistic examples of running
1239+<samp><span class="command">source-highlight</span></samp><a rel="footnote" href="#fn-10" name="fnd-10"><sup>10</sup></a>.
1240+
1241+ <p>Source-highlight only does a lexical analysis of the source code, so the
1242+program source is assumed to be correct!
1243+
1244+ <p>Here's how to run source-highlight (for this example we will use
1245+C/C++ input files, but this is valid also for other source-highlight
1246+input languages):
1247+
1248+<pre class="example"> source-highlight --src-lang cpp --out-format html \
1249+ --input <var>&lt;C++ file&gt;</var> \
1250+ --output <var>&lt;html file&gt;</var> \
1251+ --style-file <var>&lt;style file&gt;</var> \
1252+ <var>options</var>
1253+</pre>
1254+ <p>For input files, apart from the <code>-i (--input)</code> option and the
1255+standard input redirection, you can simply specify some files at the
1256+command line and also use regular expressions (for instance
1257+<samp><span class="file">*.java</span></samp>). In this case the name for the output files will be
1258+formed using the name of the source file with a .&lt;ext&gt; appended, where
1259+&lt;ext&gt; is the extension chosen according to the output format specified
1260+(in this example it would be .html). The style file
1261+(<a href="#Output-format-style">Output format style</a>)
1262+contains information on how to format specific language parts
1263+(e.g., keywords in blue and boldface, etc.).
1264+
1265+ <p>IMPORTANT: you must choose one of the above two invocation modes: either
1266+you use <code>-i (--input)</code>, <code>-o (--output)</code> (possibly replacing
1267+them with standard input/output redirection), or you specify one or many
1268+files without <code>-i (--input)</code>; if you try to mix them you'll get an
1269+error:
1270+
1271+<pre class="example"> source-highlight -o main.html main.cpp
1272+ Please, use one of the two syntaxes for invocation:
1273+ source-highlight [OPTIONS]... -i input_file -o output_file
1274+ source-highlight [OPTIONS]... [FILES]...
1275+</pre>
1276+ <p>If <code>STDOUT</code> string is passed as <code>-o (--output)</code> option, then
1277+the output is forced to the standard output anyway.
1278+
1279+ <p>If <code>-s (--src-lang)</code> is not specified, the source language is
1280+inferred by the extension of the input file or from the file name itself
1281+(possibly using also lower case versions); this, of course, does not
1282+work with standard input redirection. For further details, see <a href="#How-the-input-language-is-discovered">How the input language is discovered</a>.
1283+
1284+ <p>If <code>-f (--out-format)</code> is not specified, the output will be
1285+produced in HTML.
1286+
1287+ <p>If <code>--style-file</code> is not specified, the <samp><span class="file">default.style</span></samp>, which
1288+is included in the distribution, will be used (see <a href="#Output-format-style">Output format style</a>
1289+for further information).
1290+
1291+<ul class="menu">
1292+<li><a accesskey="1" href="#HTML-and-XHTML-output">HTML and XHTML output</a>
1293+<li><a accesskey="2" href="#LaTeX-output">LaTeX output</a>
1294+<li><a accesskey="3" href="#Texinfo-output">Texinfo output</a>
1295+<li><a accesskey="4" href="#DocBook-output">DocBook output</a>
1296+<li><a accesskey="5" href="#ANSI-color-escape-sequences">ANSI color escape sequences</a>
1297+</ul>
32691298
3270-</li></ul>
1299+<div class="node">
1300+<a name="HTML-and-XHTML-output"></a>
1301+<p><hr>
1302+Next:&nbsp;<a rel="next" accesskey="n" href="#LaTeX-output">LaTeX output</a>,
1303+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Simple-Usage">Simple Usage</a>,
1304+Up:&nbsp;<a rel="up" accesskey="u" href="#Simple-Usage">Simple Usage</a>
1305+
1306+</div>
1307+
1308+<h3 class="section">4.1 HTML and XHTML output</h3>
1309+
1310+<p><a name="index-HTML-68"></a><a name="index-XHTML-69"></a>
1311+The default output format for HTML and XHTML uses fixed width fonts by
1312+inserting all the formatted output between <code>&lt;tt&gt;</code> and <code>&lt;/tt&gt;</code>.
1313+Thus, for instance, specification for fixed width and not fixed width
1314+(see <a href="#Output-format-style">Output format style</a>) will have no effect: every character
1315+will have fixed width. If you don't like this default behavior and
1316+would like to have not fixed fonts by default (as it happens, e.g., with
1317+LaTeX output) you can use the file <samp><span class="file">html_notfixed.outlang</span></samp> with
1318+the command line argument <code>--outlang-def</code>. For XHTML output, the
1319+corresponding file is <samp><span class="file">xhtml_notfixed.outlang</span></samp>
1320+
1321+ <p>Furthermore, the file <samp><span class="file">htmltable.outlang</span></samp> can be used to generate
1322+HTML output enclosed in an HTML table (which will use also a background
1323+color if specified in the style file). The file
1324+<samp><span class="file">xhtmltable.outlang</span></samp> does the same but for XHTML output.
1325+
1326+<div class="node">
1327+<a name="LaTeX-output"></a>
1328+<p><hr>
1329+Next:&nbsp;<a rel="next" accesskey="n" href="#Texinfo-output">Texinfo output</a>,
1330+Previous:&nbsp;<a rel="previous" accesskey="p" href="#HTML-and-XHTML-output">HTML and XHTML output</a>,
1331+Up:&nbsp;<a rel="up" accesskey="u" href="#Simple-Usage">Simple Usage</a>
1332+
1333+</div>
1334+
1335+<h3 class="section">4.2 LaTeX output</h3>
1336+
1337+<p><a name="index-g_t_0040LaTeX_007b_007d-70"></a>
1338+When using LaTeX output format you can choose between monochromatic
1339+output (by using <code>-f latex</code>) or colored output (by using <code>-f
1340+latexcolor</code>). When using colored output, you need the
1341+<code>color</code> package (again this should be present in your system).
1342+Of course, you are free to define your own LaTeX output format,
1343+see <a href="#Output-Language-Definitions">Output Language Definitions</a>.
1344+
1345+<div class="node">
1346+<a name="Texinfo-output"></a>
1347+<p><hr>
1348+Next:&nbsp;<a rel="next" accesskey="n" href="#DocBook-output">DocBook output</a>,
1349+Previous:&nbsp;<a rel="previous" accesskey="p" href="#LaTeX-output">LaTeX output</a>,
1350+Up:&nbsp;<a rel="up" accesskey="u" href="#Simple-Usage">Simple Usage</a>
1351+
1352+</div>
1353+
1354+<h3 class="section">4.3 Texinfo output</h3>
1355+
1356+<p><a name="index-Texinfo-71"></a>
1357+When using the Texinfo output format, you may want to use a dedicated
1358+style file, <samp><span class="file">texinfo.style</span></samp>, which comes with the source-highlight
1359+distribution, with the option <code>--style-file</code>. For instance, the
1360+example in <a href="#Examples">Examples</a> is formatted with this style file.
1361+
1362+<div class="node">
1363+<a name="DocBook-output"></a>
1364+<p><hr>
1365+Next:&nbsp;<a rel="next" accesskey="n" href="#ANSI-color-escape-sequences">ANSI color escape sequences</a>,
1366+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Texinfo-output">Texinfo output</a>,
1367+Up:&nbsp;<a rel="up" accesskey="u" href="#Simple-Usage">Simple Usage</a>
1368+
1369+</div>
1370+
1371+<h3 class="section">4.4 DocBook output</h3>
1372+
1373+<p><a name="index-DocBook-72"></a>
1374+DocBook output is generated using the <code>&lt;programlisting&gt;</code> tag. If
1375+the <code>--doc</code> command line option is given, an <code>&lt;article&gt;</code>
1376+document is generated.
1377+
1378+<div class="node">
1379+<a name="ANSI-color-escape-sequences"></a>
1380+<p><hr>
1381+Previous:&nbsp;<a rel="previous" accesskey="p" href="#DocBook-output">DocBook output</a>,
1382+Up:&nbsp;<a rel="up" accesskey="u" href="#Simple-Usage">Simple Usage</a>
1383+
1384+</div>
1385+
1386+<h3 class="section">4.5 ANSI color escape sequences</h3>
1387+
1388+<p><a name="index-ANSI-color-73"></a>
1389+If you're using this output format, for instance together with
1390+<code>less</code> (see <a href="#Using-source_002dhighlight-with-less">Using source-highlight with less</a>), you may
1391+want to use the <samp><span class="file">esc.style</span></samp>, which comes with the source-highlight
1392+distribution, with the option <code>--style-file</code>. This should
1393+result in a more pleasant coloring output.
1394+
1395+<div class="node">
1396+<a name="Configuration-files"></a>
1397+<p><hr>
1398+Next:&nbsp;<a rel="next" accesskey="n" href="#Invoking-source_002dhighlight">Invoking source-highlight</a>,
1399+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Simple-Usage">Simple Usage</a>,
1400+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
1401+
1402+</div>
1403+
1404+<h2 class="chapter">5 Configuration files</h2>
1405+
1406+<p><a name="index-configuration-files-74"></a>
1407+During execution, source-highlight needs some files where it finds
1408+directives on how to recognize the source language (if not specified
1409+explicitly with <code>--src-lang</code> or <code>--lang-def</code>), on which output
1410+format to use (if not specified explicitly with <code>--out-format</code> or
1411+<code>--outlang-def</code>), on how to format specific source elements (e.g.,
1412+keywords, comments, etc.), and source and output language definitions.
1413+These files will be explained in the next sections.
1414+
1415+ <p><a name="index-g_t_0040code_007b_002d_002ddata_002ddir_007d-75"></a>If the directory for such files is not explicitly specified with the
1416+command line option <code>--data-dir</code>, these files are searched for in
1417+the following order:
1418+
1419+ <ul>
1420+<li>the current directory;
1421+<li>the installation directory for conf files, see <a href="#Installation">Installation</a>
1422+(please keep in mind that this directory is hard-coded into
1423+source-highlight during compilation).
1424+<li>if the source-highlight command is specified with an
1425+explicit path name, the installation directory name is
1426+still used, but relative to the explicit path name.
1427+</ul>
1428+
1429+ <p>In particular, the user can set the value also with the environment
1430+variable
1431+<a name="index-g_t_0040code_007bSOURCE_005fHIGHLIGHT_005fDATADIR_007d-76"></a><code>SOURCE_HIGHLIGHT_DATADIR</code> (see also <a href="#The-program-source_002dhighlight_002dsettings">The program source-highlight-settings</a>).
1432+
1433+ <p>If you want to be sure about which file is used during the
1434+execution, you can use the command line option <code>--verbose</code>.
1435+
1436+<ul class="menu">
1437+<li><a accesskey="1" href="#Output-format-style">Output format style</a>
1438+<li><a accesskey="2" href="#Output-format-style-using-CSS">Output format style using CSS</a>
1439+<li><a accesskey="3" href="#Default-Styles">Default Styles</a>
1440+<li><a accesskey="4" href="#Language-map">Language map</a>
1441+<li><a accesskey="5" href="#Language-definition-files">Language definition files</a>
1442+<li><a accesskey="6" href="#Output-Language-map">Output Language map</a>
1443+<li><a accesskey="7" href="#Output-Language-definition-files">Output Language definition files</a>
1444+<li><a accesskey="8" href="#Developing-your-own-definition-files">Developing your own definition files</a>
1445+</ul>
1446+
1447+<div class="node">
1448+<a name="Output-format-style"></a>
1449+<p><hr>
1450+Next:&nbsp;<a rel="next" accesskey="n" href="#Output-format-style-using-CSS">Output format style using CSS</a>,
1451+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Configuration-files">Configuration files</a>,
1452+Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-files">Configuration files</a>
1453+
1454+</div>
1455+
1456+<h3 class="section">5.1 Output format style</h3>
1457+
1458+<p><a name="index-output-style-77"></a><a name="index-default_002estyle-78"></a>
1459+You must specify your options for syntax highlighting in the file
1460+<samp><span class="file">default.style</span></samp><a rel="footnote" href="#fn-11" name="fnd-11"><sup>11</sup></a>.
1461+You can specify formatting options for each element defined
1462+by a language definition file (you can get the list of such elements,
1463+<a name="index-g_t_0040code_007b_002d_002dshow_002dlang_002delements_007d-79"></a>by using <code>--show-lang-elements</code>, see <a href="#Listing-Language-Elements">Listing Language Elements</a>).
1464+
1465+ <p><a name="index-g_t_0040code_007bbgcolor_007d-80"></a><a name="index-background-color-81"></a>Since version 2.6, you can also specify the background color for the
1466+output document, using the keyword <code>bgcolor</code> (this might be visible
1467+only when the <code>--doc</code> command line option is used).
1468+
1469+ <p>If many elements share the same formatting options, you can specify
1470+these elements in the same line, separated by a comma<a rel="footnote" href="#fn-12" name="fnd-12"><sup>12</sup></a>.
1471+
1472+ <p>Here's the <samp><span class="file">default.style</span></samp> that comes with this distribution (this
1473+is formatted by using the <samp><span class="file">style.lang</span></samp> that is shown in
1474+<a href="#Tutorials-on-Language-Definitions">Tutorials on Language Definitions</a>):
1475+
1476+<!-- Generator: GNU source-highlight, by Lorenzo Bettini, http://www.gnu.org/software/src-highlite -->
1477+<pre class="example"> <b>bgcolor</b> <tt>"white"</tt>; <i>// the background color for documents</i>
1478+ <i>context</i> <b>gray</b>; <i>// the color for context lines (when specified with line ranges)</i>
1479+
1480+ <i>keyword</i> <b>blue</b> <b>b</b> ; <i>// for language keywords</i>
1481+ <i>type</i> <b>darkgreen</b> ; <i>// for basic types</i>
1482+ <i>usertype</i> <b>teal</b> ; <i>// for user defined types</i>
1483+ <i>string</i> <b>red</b> <b>f</b> ; <i>// for strings and chars</i>
1484+ <i>regexp</i> <b>orange</b> <b>f</b> ; <i>// for strings and chars</i>
1485+ <i>specialchar</i> <b>pink</b> <b>f</b> ; <i>// for special chars, e.g., \n, \t, \\</i>
1486+ <i>comment</i> <b>brown</b> <b>i</b>, <b>noref</b>; <i>// for comments</i>
1487+ <i>number</i> <b>purple</b> ; <i>// for literal numbers</i>
1488+ <i>preproc</i> <b>darkblue</b> <b>b</b> ; <i>// for preproc directives (e.g. #include, import)</i>
1489+ <i>symbol</i> <b>darkred</b> ; <i>// for simbols (e.g. &lt;, &gt;, +)</i>
1490+ <i>function</i> <b>black</b> <b>b</b>; <i>// for function calls and declarations</i>
1491+ <i>cbracket</i> <b>red</b>; <i>// for block brackets (e.g. {, })</i>
1492+ <i>todo</i> <b>bg:cyan</b> <b>b</b>; <i>// for TODO and FIXME</i>
1493+ <i>code</i> <b>bg:brightgreen</b> <b>b</b>; <i>// for code snippets</i>
1494+
1495+ <i>//Predefined variables and functions (for instance glsl)</i>
1496+ <i>predef_var</i> <b>darkblue</b> ;
1497+ <i>predef_func</i> <b>darkblue</b> <b>b</b> ;
1498+
1499+ <i>// for OOP</i>
1500+ <i>classname</i> <b>teal</b> ; <i>// for class names, e.g., in Java and C++</i>
1501+
1502+ <i>// line numbers</i>
1503+ <b>linenum</b> <b>black</b> <b>f</b>;
1504+
1505+ <i>// Internet related</i>
1506+ <i>url</i> <b>blue</b> <b>u</b>, <b>f</b>;
1507+
1508+ <i>// other elements for ChangeLog and Log files</i>
1509+ <i>date</i> <b>blue</b> <b>b</b> ;
1510+ <i>time</i>, <i>file</i> <b>darkblue</b> <b>b</b> ;
1511+ <i>ip</i>, <i>name</i> <b>darkgreen</b> ;
1512+
1513+ <i>// for Prolog, Perl...</i>
1514+ <i>variable</i> <b>darkgreen</b> ;
1515+
1516+ <i>// explicit for Latex</i>
1517+ <i>italics</i> <b>darkgreen</b> <b>i</b>;
1518+ <i>bold</i> <b>darkgreen</b> <b>b</b>;
1519+ <i>underline</i> <b>darkgreen</b> <b>u</b>;
1520+ <i>fixed</i> <b>green</b> <b>f</b>;
1521+ <i>argument</i> <b>darkgreen</b>;
1522+ <i>optionalargument</i> <b>purple</b>;
1523+ <i>math</i> <b>orange</b>;
1524+ <i>bibtex</i> <b>blue</b>;
1525+
1526+ <i>// for diffs</i>
1527+ <i>oldfile</i> <b>orange</b>;
1528+ <i>newfile</i> <b>darkgreen</b>;
1529+ <i>difflines</i> <b>blue</b>;
1530+
1531+ <i>// for css</i>
1532+ <i>selector</i> <b>purple</b>;
1533+ <i>property</i> <b>blue</b>;
1534+ <i>value</i> <b>darkgreen</b> <b>i</b>;
1535+
1536+ <i>// for oz</i>
1537+ <i>atom</i> <b>orange</b>;
1538+ <i>meta</i> <b>i</b>;
1539+
1540+ <i>// for file system</i>
1541+ <i>path</i> <b>orange</b>;
1542+
1543+ <i>// for C (or other language) labels</i>
1544+ <i>label</i> <b>teal</b> <b>b</b>;
1545+
1546+ <i>// for errors</i>
1547+ <i>error</i> <b>purple</b>;
1548+ <i>warning</i> <b>darkgreen</b>;
1549+</pre>
1550+ <p>This file tries to define a style for most elements defined in the
1551+language definition files that comes with Source-highlight
1552+distribution.
1553+
1554+ <p><a name="index-g_t_0040code_007b_002d_002dstyle_002dfile_007d-82"></a>You can specify your own file (it doesn't have to be named
1555+<samp><span class="file">default.style</span></samp>) with the command line option
1556+<code>--style-file</code><a rel="footnote" href="#fn-13" name="fnd-13"><sup>13</sup></a>, see
1557+<a href="#Invoking-source_002dhighlight">Invoking source-highlight</a>.
1558+
1559+ <p>You can also specify the color of normal text by adding this line
1560+
1561+<pre class="example"> normal darkblue ;
1562+</pre>
1563+ <p><a name="index-color-83"></a><a name="index-background-color-84"></a>As you might see the syntax of this file is quite straightforward: after
1564+the element (or elements, separated by commas) you can specify the
1565+color, and the background color<a rel="footnote" href="#fn-14" name="fnd-14"><sup>14</sup></a> by using
1566+the prefix <code>bg:</code> (for instance, in the <samp><span class="file">default.style</span></samp> above
1567+the background color is specified for the <code>todo</code> element).
1568+
1569+ <p>Note that the background color might not be available for all output
1570+formats: it is available for XHTML and LaTeX but not for
1571+HTML<a rel="footnote" href="#fn-15" name="fnd-15"><sup>15</sup></a>.
1572+
1573+ <p><a name="index-bold-85"></a><a name="index-italics-86"></a><a name="index-underline-87"></a><a name="index-fixed-88"></a><a name="index-notfixed-89"></a>Then, you can specify further formatting options such as bold, italics,
1574+etc.; these are the keywords that can be used:
1575+
1576+<pre class="example"> b = bold
1577+ i = italics
1578+ u = underline
1579+ f = fixed
1580+ nf = not fixed
1581+ noref = no reference information is generated for these elements
1582+</pre>
1583+ <p><a name="index-color-90"></a>Since version 2.2, the color specification is not required. For
1584+instance, the <samp><span class="file">texinfo.style</span></samp> is as follows (we avoid colors for
1585+Texinfo outputs):
1586+
1587+<!-- Generator: GNU source-highlight, by Lorenzo Bettini, http://www.gnu.org/software/src-highlite -->
1588+<pre class="example"> <i>keyword</i>, <i>type</i> <b>b</b> ;
1589+ <i>variable</i> <b>f</b>, <b>i</b> ;
1590+ <i>string</i> <b>f</b> ;
1591+ <i>regexp</i> <b>f</b> ;
1592+ <i>comment</i> <b>nf</b>, <b>i</b>, <b>noref</b> ;
1593+ <i>preproc</i> <b>b</b> ;
1594+
1595+ <i>// line numbers</i>
1596+ <b>linenum</b> <b>f</b>;
1597+
1598+ <i>// Internet related</i>
1599+ <i>url</i> <b>f</b>;
1600+
1601+ <i>// for diffs</i>
1602+ <i>oldfile</i>, <i>newfile</i> <b>i</b>;
1603+ <i>difflines</i> <b>b</b>;
1604+
1605+ <i>// for css</i>
1606+ <i>selector</i>, <i>property</i> <b>b</b>;
1607+ <i>value</i> <b>i</b>;
1608+</pre>
1609+ <p>You may also specify more than on of these options separated by commas,
1610+e.g.
1611+
1612+<pre class="example"> keyword blue u, b ;
1613+</pre>
1614+ <p class="noindent">Please keep in mind that in this case the order of these specified
1615+options is kept during the generation of the output; for instance,
1616+depending on the specific output format, the sequences <code>u, b</code> and
1617+<code>b, u</code> may lead to different results. In particular, the style
1618+that comes first is used after the ones that follow. For instance, in
1619+the case of HTML, the sequence <code>u, b</code> will lead to the following
1620+formatting: <code>&lt;u&gt;&lt;b&gt;...&lt;/b&gt;&lt;/u&gt;</code>.
1621+
1622+ <p><a name="index-noref-91"></a>The <code>noref</code> option specifies that for this element reference
1623+information are not generated (see <a href="#Generating-References">Generating References</a>). For
1624+instance, this is used for the <code>comment</code> element, since we do not
1625+want that elements in a comment are searched for cross-references.
1626+
1627+ <p>These are all possible color logical names handled by
1628+source-highlight<a rel="footnote" href="#fn-16" name="fnd-16"><sup>16</sup></a>:
1629+
1630+<pre class="example"> black
1631+ red
1632+ darkred
1633+ brown
1634+ yellow
1635+ cyan
1636+ blue
1637+ pink
1638+ purple
1639+ orange
1640+ brightorange
1641+ green
1642+ brightgreen
1643+ darkgreen
1644+ teal
1645+ gray
1646+ darkblue
1647+ white
1648+</pre>
1649+ <p><a name="index-direct-color-scheme-92"></a>You can also use the direct color scheme for the specific output format,
1650+by using double quotes, such as, e.g., <code>"#00FF00"</code> in
1651+HTML<a rel="footnote" href="#fn-17" name="fnd-17"><sup>17</sup></a> or even string colors in double quotes<a rel="footnote" href="#fn-18" name="fnd-18"><sup>18</sup></a>, such as <code>"lightblue"</code>. Of course, the double quotes will be
1652+discarded during the generation.
1653+
1654+ <p>For instance, this is the <samp><span class="file">syslog.style</span></samp> used in the <samp><span class="file">tests</span></samp>
1655+directory. This uses direct color schemes.
1656+
1657+<!-- Generator: GNU source-highlight, by Lorenzo Bettini, http://www.gnu.org/software/src-highlite -->
1658+<pre class="example"> <i>date</i>, <i>keyword</i> <b>yellow</b> <b>b</b> ;
1659+ <i>time</i> <tt>"#9999FF"</tt> ;
1660+ <i>ip</i> <tt>"lightblue"</tt> <b>b</b> ;
1661+
1662+ <i>type</i> <b>cyan</b> <b>b</b> ;
1663+ <i>string</i> <tt>"brown"</tt> <b>b</b> ;
1664+ <i>comment</i> <b>teal</b> ;
1665+ <i>number</i> <b>red</b> ;
1666+ <i>preproc</i> <b>cyan</b> ;
1667+ <i>symbol</i> <b>green</b> ;
1668+ <i>function</i> <tt>"#CC66CC"</tt> <b>b</b> ;
1669+ <i>cbracket</i> <b>green</b> <b>b</b> ;
1670+ <i>twonumbers</i> <b>green</b> <b>b</b> ;
1671+ <i>port</i> <b>green</b> <b>b</b> ;
1672+ <i>webmethod</i> <b>teal</b> ;
1673+
1674+ <i>// foo option</i>
1675+ <i>foo</i> <b>red</b> <b>b</b> ; <i>// foo entry</i>
1676+
1677+
1678+</pre>
1679+ <p>Note that, if you use direct color schemes, source-highlight will
1680+perform no transformation, and will output exactly the color scheme you
1681+specified. For instance, the specification <code>"brown"</code> is different
1682+from <code>brown</code>: the former will be output as it is, while the latter
1683+will be translated in the corresponding color of the output format (for
1684+HTML the visible result is likely to be the same).
1685+
1686+ <p>It is up to you to specify a color scheme string that is handled by the
1687+specific output format. Thus, direct color schemes might not be
1688+portable in different output formats; for instance, <code>"#00FF00"</code> is
1689+valid in HTML but not in LaTeX.
1690+
1691+<div class="node">
1692+<a name="Output-format-style-using-CSS"></a>
1693+<p><hr>
1694+Next:&nbsp;<a rel="next" accesskey="n" href="#Default-Styles">Default Styles</a>,
1695+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Output-format-style">Output format style</a>,
1696+Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-files">Configuration files</a>
1697+
1698+</div>
1699+
1700+<h3 class="section">5.2 Output format style using CSS</h3>
1701+
1702+<p><a name="index-CSS-93"></a>Since version 2.6 you can specify the output format style also using
1703+a limited CSS syntax. Please, note that this has nothing to do
1704+with output produced by source-highlight using the <code>--css</code> option.
1705+
1706+ <p><a name="index-g_t_0040code_007b_002d_002dstyle_002dcss_002dfile_007d-94"></a>By using a CSS file as the style file (i.e., passing it to the
1707+<code>--style-css-file</code> command line option) you will only specify the
1708+output format style using the same syntax of CSS. This means that you
1709+can use a css syntax for specifying the output format style
1710+independently from the actual output (this is what the output format
1711+style is for). Thus, you can use a css file as the output format style
1712+also for LaTeX output (just like you would do with a source-highlight
1713+output format style, <a href="#Output-format-style">Output format style</a>).
1714+
1715+ <p>This feature is provided basically for code re-use: you can specify the
1716+output format style using a css file, and then re-use the same css file
1717+as the actual style sheet of other HTML pages (or even output files
1718+produced by source-highlight using the <code>--css</code> option).
1719+
1720+ <p>Note that this feature is quite primordial, so only a limited subset
1721+of CSS syntax is recognized. In particular, selectors are always
1722+intended as CSS class selectors, so they must start with a dot.
1723+<code>/* */</code> comments are handled. Properties (and their values) not
1724+handled by source-highlight are simply (and silently) discarded).
1725+
1726+ <p>This is an example of CSS specification handled correctly by
1727+source-highlight as a style format specification:
1728+
1729+<!-- Generator: GNU source-highlight, by Lorenzo Bettini, http://www.gnu.org/software/src-highlite -->
1730+<pre class="example"> body {
1731+ <b>background-color:</b> &lt;<i>color</i> <i>specification</i>&gt;;
1732+ }
1733+
1734+ <b>.selector</b> {
1735+ <b>color:</b> &lt;<i>color</i> <i>specification</i>&gt;;
1736+ <b>background-color:</b> &lt;<i>color</i> <i>specification</i>&gt;;
1737+ <b>font-weight:</b> <i>bold</i>; <i>/* this is a comment */</i>
1738+ <b>font-family:</b> <i>monospace</i>;
1739+ <b>font-style:</b> <i>italic</i>;
1740+ <b>text-decoration:</b> <i>underline</i>;
1741+ }
1742+</pre>
1743+ <p>Finally, this is the <samp><span class="file">default.css</span></samp> that corresponds to
1744+<samp><span class="file">default.style</span></samp> presented in <a href="#Output-format-style">Output format style</a>:
1745+
1746+<!-- Generator: GNU source-highlight, by Lorenzo Bettini, http://www.gnu.org/software/src-highlite -->
1747+<pre class="example"> body { <b>background-color:</b> <i>white</i>; }
1748+
1749+ <i>/* the color for context lines (when specified with line ranges) */</i>
1750+ <b>.context</b> { <b>color:</b> <i>gray</i>; }
1751+
1752+ <b>.keyword</b> { <b>color:</b> <i>blue</i>; <b>font-weight:</b> <i>bold</i>; }
1753+ <b>.type</b> { <b>color:</b> <i>darkgreen</i>; }
1754+ <b>.usertype</b>, <b>.classname</b> { <b>color:</b> <i>teal</i>; }
1755+ <b>.string</b> { <b>color:</b> <i>red</i>; <b>font-family:</b> <i>monospace</i>; }
1756+ <b>.regexp</b> { <b>color:</b> <i>orange</i>; }
1757+ <b>.specialchar</b> { <b>color:</b> <i>pink</i>; <b>font-family:</b> <i>monospace</i>; }
1758+ <b>.comment</b> { <b>color:</b> <i>brown</i>; <b>font-style:</b> <i>italic</i>; }
1759+ <b>.number</b> { <b>color:</b> <i>purple</i>; }
1760+ <b>.preproc</b> { <b>color:</b> <i>darkblue</i>; <b>font-weight:</b> <i>bold</i>; }
1761+ <b>.symbol</b> { <b>color:</b> <i>darkred</i>; }
1762+ <b>.function</b> { <b>color:</b> <i>black</i>; <b>font-weight:</b> <i>bold</i>; }
1763+ <b>.cbracket</b> { <b>color:</b> <i>red</i>; }
1764+ <b>.todo</b> { <b>font-weight:</b> <i>bold</i>; <b>background-color:</b> <i>cyan</i>; }
1765+
1766+ <i>/* line numbers */</i>
1767+ <b>.linenum</b> { <b>color:</b> <i>black</i>; <b>font-family:</b> <i>monospace</i>; }
1768+
1769+ <i>/* Internet related */</i>
1770+ <b>.url</b> { <b>color:</b> <i>blue</i>; <b>text-decoration:</b> <i>underline</i>; <b>font-family:</b> <i>monospace</i>; }
1771+
1772+ <i>/* other elements for ChangeLog and Log files */</i>
1773+ <b>.date</b> { <b>color:</b> <i>blue</i>; <b>font-weight:</b> <i>bold</i>; }
1774+ <b>.time</b>, <b>.file</b> { <b>color:</b> <i>darkblue</i>; <b>font-weight:</b> <i>bold</i>; }
1775+ <b>.ip</b>, <b>.name</b> { <b>color:</b> <i>darkgreen</i>; }
1776+
1777+ <i>/* for Prolog, Perl */</i>
1778+ <b>.variable</b> { <b>color:</b> <i>darkgreen</i>; }
1779+ <b>.italics</b> { <b>color:</b> <i>darkgreen</i>; <b>font-style:</b> <i>italic</i>; }
1780+ <b>.bold</b> { <b>color:</b> <i>darkgreen</i>; <b>font-weight:</b> <i>bold</i>; }
1781+
1782+ <i>/* for LaTeX */</i>
1783+ <b>.underline</b> { <b>color:</b> <i>darkgreen</i>; <b>text-decoration:</b> <i>underline</i>; }
1784+ <b>.fixed</b> { <b>color:</b> <i>green</i>; <b>font-family:</b> <i>monospace</i>; }
1785+ <b>.argument</b>, <b>.optionalargument</b> { <b>color:</b> <i>darkgreen</i>; }
1786+ <b>.math</b> { <b>color:</b> <i>orange</i>; }
1787+ <b>.bibtex</b> { <b>color:</b> <i>blue</i>; }
1788+
1789+ <i>/* for diffs */</i>
1790+ <b>.oldfile</b> { <b>color:</b> <i>orange</i>; }
1791+ <b>.newfile</b> { <b>color:</b> <i>darkgreen</i>; }
1792+ <b>.difflines</b> { <b>color:</b> <i>blue</i>; }
1793+
1794+ <i>/* for css */</i>
1795+ <b>.selector</b> { <b>color:</b> <i>purple</i>; }
1796+ <b>.property</b> { <b>color:</b> <i>blue</i>; }
1797+ <b>.value</b> { <b>color:</b> <i>darkgreen</i>; <b>font-style:</b> <i>italic</i>; }
1798+
1799+ <i>/* for Oz */</i>
1800+ <b>.atom</b> { <b>color:</b> <i>orange</i>; }
1801+ <b>.meta</b> { <b>font-style:</b> <i>italic</i>; }
1802+
1803+</pre>
1804+ <p>If you pass this file to the <code>--style-css-file</code> command line option
1805+and you produce an output file, you will get the same result of using
1806+<samp><span class="file">default.style</span></samp>.
1807+
1808+ <p>Source-highlight comes with a lot of CSS files that can be used either
1809+as standard CSS files for HTML documents, or as style files to pass to
1810+<code>--style-css-file</code>. In the documentation installation directory
1811+(see <a href="#Installation">Installation</a>) you will find the file
1812+<samp><span class="file">style_examples.html</span></samp> which shows many output examples, each one
1813+with a different CSS style.
1814+
1815+<div class="node">
1816+<a name="Default-Styles"></a>
1817+<p><hr>
1818+Next:&nbsp;<a rel="next" accesskey="n" href="#Language-map">Language map</a>,
1819+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Output-format-style-using-CSS">Output format style using CSS</a>,
1820+Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-files">Configuration files</a>
1821+
1822+</div>
1823+
1824+<h3 class="section">5.3 Default Styles</h3>
1825+
1826+<p>This file<a rel="footnote" href="#fn-19" name="fnd-19"><sup>19</sup></a> (the default file is
1827+<samp><span class="file">style.defaults</span></samp>) lists the default style for a language element
1828+whose output style is not specified in the style file; in particular the
1829+following line (comment lines start with <code>#</code>):
1830+
1831+<pre class="example"> elem1 = elem2
1832+</pre>
1833+ <p class="noindent">tells that, if the style for an element, say elem1, is not specified in
1834+the style file, then elem1 will have the same style of elem2.
1835+
1836+ <p><a name="index-style_002edefaults-95"></a>For instance, this is the <samp><span class="file">style.defaults</span></samp> that comes with
1837+Source-highlight:
1838+
1839+<!-- Generator: GNU source-highlight, by Lorenzo Bettini, http://www.gnu.org/software/src-highlite -->
1840+<pre class="example"> # defaults for styles
1841+ # the format is:
1842+ # elem1 = elem2
1843+ # meaning that if the style for elem1 is not specified,
1844+ # then it will have the same style as elem2
1845+
1846+ classname = normal
1847+ usertype = normal
1848+ preproc = keyword
1849+ section = function
1850+ paren = cbracket
1851+ attribute = type
1852+ value = string
1853+ predef_var = type
1854+ predef_func = function
1855+ atom = regexp
1856+ meta = function
1857+ path = regexp
1858+ label = preproc
1859+ error = string
1860+ warning = type
1861+ code = preproc
1862+</pre>
1863+ <p class="noindent">In this case the style for the element <code>preproc</code> will default to
1864+the style of the element <code>keyword</code>.
1865+
1866+ <p>This file is useful when you want to create your own style file and you
1867+don't want to specify styles for all the elements that will have the
1868+same output style in your style (e.g., the default style formats
1869+<code>preproc</code> elements differently from keywords, but if in your style
1870+you don't specify a style for it, a <code>preproc</code> element will still be
1871+formatted as a <code>keyword</code>).
1872+
1873+<div class="node">
1874+<a name="Language-map"></a>
1875+<p><hr>
1876+Next:&nbsp;<a rel="next" accesskey="n" href="#Language-definition-files">Language definition files</a>,
1877+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Default-Styles">Default Styles</a>,
1878+Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-files">Configuration files</a>
1879+
1880+</div>
1881+
1882+<h3 class="section">5.4 Language map</h3>
1883+
1884+<p><a name="index-language-map-96"></a>
1885+This configuration file associates a file extension to a specific
1886+language definition file. You can also use such file extension to
1887+specify the <code>--src-lang</code> option (see <a href="#Simple-Usage">Simple Usage</a>).
1888+Source-highlight comes with such a file, called <samp><span class="file">lang.map</span></samp>.
1889+
1890+ <p>Of course, you can override the settings of this file by writing your
1891+own language map file and specify such file with the command line option
1892+<code>--lang-map</code>). Moreover, as explained above, if a file
1893+<samp><span class="file">lang.map</span></samp> is present in the current directory, such version will
1894+be used. The format of such file is quite simple (comment lines start
1895+with <code>#</code>):
1896+
1897+<pre class="example"> extension = language definition file
1898+</pre>
1899+ <p>The default language definition file is shown in <a href="#Introduction">Introduction</a>.
1900+
1901+<div class="node">
1902+<a name="Language-definition-files"></a>
1903+<p><hr>
1904+Next:&nbsp;<a rel="next" accesskey="n" href="#Output-Language-map">Output Language map</a>,
1905+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Language-map">Language map</a>,
1906+Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-files">Configuration files</a>
1907+
1908+</div>
1909+
1910+<h3 class="section">5.5 Language definition files</h3>
1911+
1912+<p>These files are crucial for source-highlight since they specify the
1913+source elements that have to be highlighted. These files also allow to
1914+specify your own language definitions in order to deal with a language
1915+that is not handled by source-highlight<a rel="footnote" href="#fn-20" name="fnd-20"><sup>20</sup></a>. The syntax for these files is explained in <a href="#Language-Definitions">Language Definitions</a>.
1916+
1917+<div class="node">
1918+<a name="Output-Language-map"></a>
1919+<p><hr>
1920+Next:&nbsp;<a rel="next" accesskey="n" href="#Output-Language-definition-files">Output Language definition files</a>,
1921+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Language-definition-files">Language definition files</a>,
1922+Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-files">Configuration files</a>
1923+
1924+</div>
1925+
1926+<h3 class="section">5.6 Output Language map</h3>
1927+
1928+<p><a name="index-output-language-map-97"></a>
1929+This configuration file associates an output format to a specific output
1930+language definition file. You can use the name of that output format to
1931+specify the <code>--out-format</code> option (see <a href="#Simple-Usage">Simple Usage</a>).
1932+Source-highlight comes with such a file, called <samp><span class="file">outlang.map</span></samp>.
1933+
1934+ <p>Of course, you can override the settings of this file by
1935+writing your own output language map file and specify such file
1936+with the command line option <code>--outlang-map</code>).
1937+Moreover, as explained above, if a file <samp><span class="file">outlang.map</span></samp>
1938+is present in the current directory, such version will be used.
1939+The format of such file is quite simple:
1940+
1941+<pre class="example"> output format name = language definition file
1942+</pre>
1943+ <p>The default language definition file is shown in <a href="#Introduction">Introduction</a>.
1944+
1945+ <p>In particular, there is a convention for the output format name in the
1946+output language map: the one with <code>-css</code> suffix is the one used
1947+when <code>--css</code> command line option is given
32711948
3272-<a name="IDX83"></a>
3273-<p>ここでマッチしたルールにおける<em>プリフィックス</em>というのは、検査済みの文字列の、マッチしなかった部分である<a name="DOCF31" href="#FOOT31">(31)</a>。
3274-従って、たとえば、次の文字列に対して<code>=</code>という簡単な正規表現をマッチさせてみる。
3275-</p>
3276-<table><tr><td>&nbsp;</td><td><pre class="example">i = 10;
3277-</pre></td></tr></table>
3278-
3279-<a name="IDX84"></a>
3280-<p>このとき、プリフィックスはスペースを含んだ<code>i </code>となる。
3281-正規表現の用語に従えば、残りのマッチしなかった部分、すなわち<code> 10;</code>は<em>サフィックス</em>という。
3282-source-highlightが、上で述べた戦略でマッチするルールを見つけると、マッチされた部分をフォーマットし(プリフィックスは<code>normal</code>でフォーマットし)、サフィックスの部分からマッチするルールの探索を再開する。
3283-そしてこれがその行全体を処理するまで続く。
3284-</p>
3285-<p>例を用いて、もう少し詳しくこの戦略を説明したい。
3286-次に示す言語定義ファイルを考えてみよう。
3287-</p>
3288-<table><tr><td>&nbsp;</td><td><pre class="example"><span class="roman"><i># an example for explaining the strategy of source-highlight</i></span>
3289-<tt><i>type</i></tt> = <tt>&quot;int&quot;</tt>
3290-<tt><i>keyword</i></tt> = <tt>&quot;null&quot;</tt>
3291-<tt><i>symbol</i></tt> = <tt>&quot;=&quot;</tt>
3292-</pre></td></tr></table>
3293-<p>そして、次の行をハイライトさせる。
3294-</p>
3295-<table><tr><td>&nbsp;</td><td><pre class="example">int i = null
3296-</pre></td></tr></table>
3297-
3298-<p>source-highlightは以下のステップを実行する。
3299-</p>
3300-<ol>
3301-<li>
3302-最初のマッチするルールは<code>type</code>のためのものだ。
3303-空のプリフィックスなのでこれ以上見る必要はない。
3304-<code>int</code>は<code>type</code>としてハイライトされる。
3305-処理すべき残りの部分は<code> i = null</code>となっている。
3306-
3307-</li><li>
3308-最初にマッチするルールは<code>keyword</code>に対するものだ。
3309-プリフィックスは<code> i = </code>である。
3310-このプリフィックスは空でない(あるいはスペースだけを含むわけではない)ので他のルールを検査する。
3311-
3312-</li><li>
3313-次にマッチするルールは<code>symbol</code>に対するものだ。
3314-プリフィックスは<code> i </code>である。
3315-このプリフィックスは<code>keyword</code>のときよりも小さい。
3316-他にもうマッチするルールはないので、<code>symbol</code>に対するものがベターだ。
3317-<code>=</code>がsymbolとしてハイライトされる。
3318-処理すべき残りの部分は<code> null</code>となっている。
3319-
3320-</li><li>
3321-最初にマッチするルールは<code>keyword</code>に対するものだ。
3322-プリフィックスは空白だけなので、これ以上見る必要はない。
3323-<code>null</code>が<code>keyword</code>としてハイライトされる。
3324-
3325-</li></ol>
3326-
3327-<p>以下の言語定義を示してこのセクションを終える。
3328-この言語定義は、ハイライトの戦略について述べたことをまとめたものだ。
3329-</p>
3330-<table><tr><td>&nbsp;</td><td><pre class="example"><tt><i>keyword</i></tt> = <tt>&quot;if|class&quot;</tt>
3331-
3332-<tt><i>type</i></tt> = <tt>'int'</tt>
3333-
3334-<tt><i>comment</i></tt> <b>delim</b> <tt>&quot;/*&quot;</tt> <tt>&quot;*/&quot;</tt>
3335-
3336-<span class="roman"><i># thus this won't catch &quot;/* */ /&quot; as a regexp,</i></span>
3337-<span class="roman"><i># since comment elem definition comes first</i></span>
3338-<tt><i>regexp</i></tt> = <tt>'/.*/.*/'</tt>
3339-
3340-<span class="roman"><i># this won't match if ( ) as a function,</i></span>
3341-<span class="roman"><i># since keyword elem definition comes first</i></span>
3342-<tt><i>function</i></tt> = <tt>'([[:alpha:]]|_)[[:word:]]*[[:blank:]]*\(*[[:blank:]]*\)'</tt>
3343-
3344-<span class="roman"><i># the following order is conceptually wrong,</i></span>
3345-<span class="roman"><i># since &quot;//&quot; won't be highlighted as a comment, but as two symbols</i></span>
3346-<tt><i>symbol</i></tt> = <tt>&quot;/&quot;</tt>
3347-<tt><i>comment</i></tt> <b>start</b> <tt>&quot;//&quot;</tt>
3348-</pre></td></tr></table>
3349-
3350-<hr size="6">
3351-<a name="g_t_6b63_898f_8868_73fe_306b_95a2_3059_308b_6ce8_610f"></a>
3352-<a name="SEC50"></a>
3353-<table cellpadding="1" cellspacing="1" border="0">
3354-<tr><td valign="middle" align="left">[<a href="#SEC49" title="Previous section in reading order"> &lt; </a>]</td>
3355-<td valign="middle" align="left">[<a href="#SEC51" title="Next section in reading order"> &gt; </a>]</td>
3356-<td valign="middle" align="left"> &nbsp; </td>
3357-<td valign="middle" align="left">[<a href="#SEC37" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
3358-<td valign="middle" align="left">[<a href="#SEC37" title="Up section"> Up </a>]</td>
3359-<td valign="middle" align="left">[<a href="#SEC59" title="Next chapter"> &gt;&gt; </a>]</td>
3360-<td valign="middle" align="left"> &nbsp; </td>
3361-<td valign="middle" align="left"> &nbsp; </td>
3362-<td valign="middle" align="left"> &nbsp; </td>
3363-<td valign="middle" align="left"> &nbsp; </td>
3364-<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3365-<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3366-<td valign="middle" align="left">[<a href="#SEC79" title="Index">Index</a>]</td>
3367-<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3368-</tr></table>
3369-<h2 class="section"> 7.13 正規表現に関する注意 </h2>
3370-
3371-<p>Boostのシンタックスを知るのにはBoostのドキュメンテーション(<a href="http://www.boost.org/libs/regex/doc/syntax.html">http://www.boost.org/libs/regex/doc/syntax.html</a>)を見るわけですが、ここで、あまり知られていないかもしれないが言語の定義に非常に便利な正規表現の形式についていくらか説明をしようと思う。
3372-</p>
3373-<a name="IDX85"></a>
3374-<p>カッコを使って正規表現の一部をグループ化する必要はあるが、マークされた部分表現を余分に吐き出させたくないようなときは、通常、<em>マークしないカッコ</em><code>(?:expression)</code>を使うことができる。
3375-これは、言語定義のシンタックスには必要ではない。
3376-たとえ普通のカッコを使ったとしても、source-highlightはマークしないカッコへそれを変形してしまう。
3377-</p>
3378-<a name="IDX86"></a>
3379-<p>source-highlightは、<em>マークされた部分表現</em>、すなわち<code>(</code>と<code>)</code>に括られたものを、マークしない部分表現(つまり上で説明したもの)に変換する。
3380-バージョン2.7から、<code>`</code>の内側に正規表現を書いた場合には、そのマークされた部分表現はそのまま残される(<a href="#SEC38">正規表現の指定方法</a>も参照してほしい)。
3381-これは、<em>後方参照</em>や<em>条件</em>のときに便利だ。
3382-</p>
3383-<a name="IDX87"></a>
3384-<p>エスケープ文字の後ろに1から9の範囲の数字nが付いたものは<em>後方参照</em>で、n番目の部分表現にマッチしたのと同じ文字列にマッチするものだ。
3385-たとえば、<code>^(a*).*\1$</code>という表記は、<code>aaabbaaa</code>という文字列にはマッチするが、<code>aaabba</code>にはマッチしない。
3386-後方参照は、Perlの置換指示子のような場合に、コンパクトな言語エレメントを書くのに役立つ。
3387-なので、次のような場合を考える。
3388-</p>
3389-<table><tr><td>&nbsp;</td><td><pre class="example">regexp = `s([^[:alnum:][:blank:]]).*\1.*\1[ixsmogce]*`
3390-</pre></td></tr></table>
3391-
3392-<p>これは次の形式の全てにマッチする。
3393-</p>
3394-<table><tr><td>&nbsp;</td><td><pre class="example">s/foo/bar/g
3395-s|foo|bar|g
3396-s#foo#bar#g
3397-s@foo@bar@g
3398-</pre></td></tr></table>
3399-
3400-<a name="IDX88"></a>
3401-<p>正規表現の形式で便利なのが、<em>前方先読み表明(Forward Lookahead Asserts)</em>だ。
3402-これには二つの形式があって、一つは肯定的先読み表明そしてもう一つが否定的先読み表明である。
3403-</p>
3404-<dl compact="compact">
3405-<dt> <code>(?=abc)</code> </dt>
3406-<dd><p>&ldquo;abc&rdquo;という表現が後に続く場合にだけゼロ文字にマッチする。(訳注:ゼロ文字にマッチするというのは、要するに、この表現自体何らかの個別の文字にマッチしたり文字を捕捉したりすることはなく、ゼロの幅であるということです)
3407-</p></dd>
3408-<dt> <code>(?!abc)</code> </dt>
3409-<dd><p>&ldquo;abc&rdquo;という表現が後に続かない場合にだけゼロ文字にマッチする。
3410-</p></dd>
1949+<div class="node">
1950+<a name="Output-Language-definition-files"></a>
1951+<p><hr>
1952+Next:&nbsp;<a rel="next" accesskey="n" href="#Developing-your-own-definition-files">Developing your own definition files</a>,
1953+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Output-Language-map">Output Language map</a>,
1954+Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-files">Configuration files</a>
1955+
1956+</div>
1957+
1958+<h3 class="section">5.7 Output Language definition files</h3>
1959+
1960+<p>These files are crucial for source-highlight since they specify how the
1961+source elements are highlighted. These files also allow to specify
1962+your own output format definitions in order to deal with an output
1963+format that is not handled by source-highlight<a rel="footnote" href="#fn-21" name="fnd-21"><sup>21</sup></a>. The syntax for these files is explained in <a href="#Output-Language-Definitions">Output Language Definitions</a>.
1964+
1965+ <p>These files are part of source-highlight distribution, but they can
1966+also be downloaded, independently, from here:
1967+
1968+ <p><a href="http://www.gnu.org/software/src-highlite/outlang_files/">http://www.gnu.org/software/src-highlite/outlang_files/</a>
1969+
1970+<div class="node">
1971+<a name="Developing-your-own-definition-files"></a>
1972+<p><hr>
1973+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Output-Language-definition-files">Output Language definition files</a>,
1974+Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-files">Configuration files</a>
1975+
1976+</div>
1977+
1978+<h3 class="section">5.8 Developing your own definition files</h3>
1979+
1980+<p>I encourage those who write new language definitions or correct/modify
1981+existing language definitions to send them to me so that they can be
1982+added to the source-highlight distribution!
1983+
1984+ <p>Since these files require more explanations (that, however, are not
1985+necessary to the standard usage of source-highlight), they are carefully
1986+explained in separate parts: <a href="#Language-Definitions">Language Definitions</a> and <a href="#Output-Language-Definitions">Output Language Definitions</a>.
1987+
1988+ <p>These files are part of source-highlight distribution, but they can
1989+also be downloaded, independently, from here:
1990+
1991+ <p><a href="http://www.gnu.org/software/src-highlite/lang_files/">http://www.gnu.org/software/src-highlite/lang_files/</a>
1992+
1993+<div class="node">
1994+<a name="Invoking-source-highlight"></a>
1995+<a name="Invoking-source_002dhighlight"></a>
1996+<p><hr>
1997+Next:&nbsp;<a rel="next" accesskey="n" href="#Language-Definitions">Language Definitions</a>,
1998+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Configuration-files">Configuration files</a>,
1999+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
2000+
2001+</div>
2002+
2003+<h2 class="chapter">6 Invoking <samp><span class="command">source-highlight</span></samp></h2>
2004+
2005+<p><a name="index-invoking-98"></a><a name="index-version-99"></a><a name="index-options-100"></a><a name="index-usage-101"></a><a name="index-help-102"></a><a name="index-getting-help-103"></a>
2006+The format for running the <samp><span class="command">source-highlight</span></samp> program is:
2007+
2008+<pre class="example"> source-highlight <var>option</var> ...
2009+</pre>
2010+ <p><code>source-highlight</code> supports the following options, shown by
2011+the output of <code>source-highlight --detailed-help</code>:
2012+
2013+<pre class="smallexample"></pre>
2014+ <p>Let us explain some options in details (apart from those that should be
2015+clear from the <code>--help</code> output itself, and those already explained
2016+in <a href="#Simple-Usage">Simple Usage</a>).
2017+
2018+<!-- Formatting copied from the Texinfo 4.0 manual. -->
2019+ <dl>
2020+<dt><code>--data-dir</code><dd><a name="index-g_t_0040code_007b_002d_002ddata_002ddir_007d-104"></a>Source-highlight, during the execution, will need some files, such as,
2021+e.g., language definition files, output format definition files, etc.
2022+These files are installed in <code>prefix/share/source-highlight</code> where
2023+<code>prefix</code> is chosen at compilation time (see See <a href="#Installation">Installation</a>).
2024+Thus, source-highlight should be able to find all the files it needs
2025+independently. However, if you want to override this setting, e.g.,
2026+because you have your own language definition files, or simply because
2027+you installed a possible source-highlight binary in a different
2028+directory from the one used during the compilation, you can use the
2029+command line option <code>--data-dir</code>.
2030+
2031+ <br><dt><code>--doc</code><dt><code>-d</code><dd>If you want a stand alone output document (i.e., an output file that is
2032+not thought to be included in another document), specify this option
2033+(otherwise you just get some text that you can paste into another
2034+document). If you choose this option and do not provide a
2035+<code>--title</code>, the your source file name will be used as the title.
2036+
2037+ <br><dt><code>--no-doc</code><dd>The <code>--doc</code> option above is actually implied by other command line
2038+options (e.g., <code>--css</code>). If you do not want this (e.g., you want
2039+to include the output in an existing document containing the global
2040+style sheet), you can disable this by using <code>--no-doc</code>.
2041+
2042+ <br><dt><code>--css</code><dt><code>-c</code><dd>Specify the style sheet file (e.g., a <samp><span class="file">.css</span></samp> for HTML<a rel="footnote" href="#fn-22" name="fnd-22"><sup>22</sup></a>) for the output document. Note that source-highlight
2043+will not use this file: it will simply use this file name when
2044+generating the output file, so to specify that the output file uses this
2045+file as the style sheet (e.g., if the generated HTML relies on this file
2046+as the CSS file).
2047+
2048+ <br><dt><code>--tab</code><dt><code>-t</code><dd>With this options, tab characters will be converted into specified
2049+number of space characters (tabulation points will be preserved). This
2050+option is automatically selected when generating line numbers.
2051+
2052+ <br><dt><code>--style-file</code><dt><code>--style-css-file</code><dd>Specify the file that source-highlight will use to produce (i.e.,
2053+format) the output (e.g., colors and other styles for each language
2054+element). The formats of these files are detailed in <a href="#Output-format-style">Output format style</a> and in <a href="#Output-format-style-using-CSS">Output format style using CSS</a>, respectively.
2055+
2056+ <br><dt><code>--style-defaults</code><dd>Specify the file that contains the default styles for elements
2057+whose styles are not found in the style file (see <a href="#Default-Styles">Default Styles</a> for
2058+further details).
2059+
2060+ <br><dt><code>--output-dir</code><dd>You can pass to source-highlight more than one input file (see
2061+<a href="#Simple-Usage">Simple Usage</a>). In this case you cannot specify the output file
2062+name. In such cases the output files will be automatically generated
2063+into the directory where you invoked the command from; if you want the
2064+output files to be generated into a different directory you can use this
2065+option.
2066+
2067+ <br><dt><code>--infer-lang</code><dd><a name="index-language-inference-105"></a><a name="index-g_t_0040code_007b_002d_002dinfer_002dlang_007d-106"></a>Force the inference mechanism for detecting the input language. This is
2068+detailed in <a href="#How-the-input-language-is-discovered">How the input language is discovered</a>.
2069+
2070+ <br><dt><code>--line-number</code><dd>Line numbers will be generated in the output, using the (optional)
2071+specified padding character<a rel="footnote" href="#fn-23" name="fnd-23"><sup>23</sup></a> (the default padding character is <code>0</code>).
2072+
2073+ <br><dt><code>--line-number-ref</code><dd>As <code>--line-number</code>, this option numbers all the output lines, and,
2074+additionally, generates an anchor for each line. The anchor consists of
2075+the specified prefix (default is <code>line</code>) and the line number (e.g.,
2076+<code>line25</code>). For instance, as prefix, if you deal with many files,
2077+you can use the file name. Note that some output languages might not
2078+support this feature (e.g., <code>esc</code>, since it makes no sense in such
2079+case). See <a href="#Anchors-and-References">Anchors and References</a> for defining how to generate an
2080+anchor in a specific output language.
2081+
2082+ <p><a name="index-line-ranges-107"></a><a name="index-range-context-108"></a><a name="index-range-separator-109"></a><br><dt><code>--line-range</code><dt><code>--range-context</code><dt><code>--range-separator</code><dd>Since version 2.11, you can specify multiple line ranges: only the lines
2083+in the source that are in these ranges will be output. For instance, by
2084+specifying
2085+
2086+ <pre class="example"> --line-range="-5","10","20-25","50-"
2087+</pre>
2088+ <p>Only the following lines will be output: the first 5 lines, line 10,
2089+lines 20 to 25 and from line 50 to the end of input. (See also the
2090+examples in <a href="#Line-ranges">Line ranges</a>).
2091+
2092+ <p>Together with <code>--line-range</code>, you can also specify
2093+<code>--range-context</code>: this is the number of lines that will be printed
2094+before and after the lines of a range (i.e., the surrounding
2095+&ldquo;context&rdquo;). These lines will not be highlighted: they will be printed
2096+according to the style <code>context</code>. For instance, extending the
2097+previous example,
2098+
2099+ <pre class="example"> --line-range="-5","10","20-25","50-" --range-context=1
2100+</pre>
2101+ <p>Also the following lines will be output: 6, 9, 11, 19, 26, 49. (See
2102+also the examples in <a href="#Line-ranges-_0028with-context_0029">Line ranges (with context)</a>).
2103+
2104+ <p>Finally, you can specify a range separator line string with
2105+<code>--range-separator</code> that will be printed between ranges (See also
2106+the examples in <a href="#Line-ranges-_0028with-context_0029">Line ranges (with context)</a>). The separator string
2107+is preformatted automatically, so, e.g., you don't have to escape
2108+special output characters, such as the { } in texinfo output.
2109+
2110+ <p><a name="index-regex-ranges-110"></a><br><dt><code>--regex-range</code><dd>
2111+Ranges can be expressed also using regular expressions, with the command
2112+line option <code>--regex-range</code>. In this case the beginning of the
2113+range will be detected by a line containing (in any point) a string
2114+matching the specified regular expression; the end will be detected by a
2115+line containing a string matching the same regular expression that
2116+started the range. This feature is very useful when we want to document
2117+some code (e.g., in this very manual) by showing only specific parts,
2118+that are delimited in a ad-hoc way in the source code (e.g., with
2119+specific comment patterns). You can see some usage examples
2120+in See <a href="#Regex-ranges">Regex ranges</a>.
2121+
2122+ <p>The specified strings (this option accepts multiple occurrences) must be
2123+valid regular expressions (thus you must escape special characters
2124+accordingly), otherwise you will get an error.
2125+
2126+ <p>Furthermore, <code>--line-range</code> and <code>--regex-range</code> cannot coexist
2127+in the same command line.
2128+
2129+ <br><dt><code>--failsafe</code><dd><a name="index-failsafe-111"></a>If no language specification is found, an error will be printed and the
2130+program exits. With this option, instead, in such situations, the input
2131+is simply formatted in the output format. This is useful when
2132+<samp><span class="command">source-highlight</span></samp> is used with many input files, and it is also
2133+used in the <samp><span class="file">src-hilite-lesspipe.sh</span></samp> script. Actually I failed to
2134+find a good reason why one should not always use this option. So my
2135+suggestion is to always use it when you run source-highlight (and
2136+indeed, in the future, this option might become the default one). See
2137+also <a href="#Using-source_002dhighlight-with-less">Using source-highlight with less</a>, <a href="#Using-source_002dhighlight-as-a-simple-formatter">Using source-highlight as a simple formatter</a>.
2138+
2139+ <p><a name="index-default_002elang-112"></a>When using <code>--failsafe</code>, if no input language can be established,
2140+source-highlight will use the input language definition file
2141+<samp><span class="file">default.lang</span></samp>, which is an empty file. You might want to
2142+customize such file, though.
2143+
2144+ <br><dt><code>--debug-lang</code><br><dt><code>--show-regex</code><dd>Allows to debug a language definition file, <a href="#Debugging">Debugging</a>.
2145+
2146+ </dl>
2147+
2148+ <p>The other command line options dealing with references are explained in
2149+more details in <a href="#Generating-References">Generating References</a>.
2150+
2151+<ul class="menu">
2152+<li><a accesskey="1" href="#How-the-input-language-is-discovered">How the input language is discovered</a>
2153+</ul>
2154+
2155+<div class="node">
2156+<a name="How-the-input-language-is-discovered"></a>
2157+<p><hr>
2158+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Invoking-source_002dhighlight">Invoking source-highlight</a>,
2159+Up:&nbsp;<a rel="up" accesskey="u" href="#Invoking-source_002dhighlight">Invoking source-highlight</a>
2160+
2161+</div>
2162+
2163+<h3 class="section">6.1 How the input language is discovered</h3>
2164+
2165+<p>As already explained, <a href="#Simple-Usage">Simple Usage</a>, source-highlight uses a
2166+language definition file according the language specified with the
2167+option <code>--src-lang</code>, or <code>--lang-def</code>, or by using the input
2168+file extension.
2169+
2170+ <p>Since version 2.5, source-highlight can use an inference mechanism to
2171+deduce the input language. For the moment, it can detect script
2172+languages based on the &ldquo;sha-bang&rdquo; mechanism, i.e., when the first line
2173+of a script contains a line such as, e.g.,
2174+
2175+<pre class="example"> #!/bin/sh
2176+</pre>
2177+ <p>It detects script languages specified by using the <code>env</code>
2178+program<a rel="footnote" href="#fn-24" name="fnd-24"><sup>24</sup></a>:
2179+
2180+<pre class="example"> #!/usr/bin/env perl
2181+</pre>
2182+ <p>It recognizes the Emacs convention, of declaring the Emacs
2183+major mode using the format <code>-*- lang -*-</code>.
2184+
2185+ <p>For instance, a script starting as the following one:
2186+
2187+<pre class="example"> #!/bin/bash
2188+ # -*- Tcl -*-
2189+</pre>
2190+ <p class="noindent">will be interpreted as a Tcl script, and not as bash script.
2191+
2192+ <p>Finally, it recognizes <code>&lt;?</code> specifications (e.g.,
2193+<code>&lt;?php</code> and <code>&lt;?xml</code>) and <code>&lt;!doctype</code> (in that case,
2194+it infers it is an xml file)<a rel="footnote" href="#fn-25" name="fnd-25"><sup>25</sup></a>.
2195+
2196+ <p>This inference mechanism is performed, by default, in case the input
2197+language is neither explicitly specified nor found in the language map
2198+file by using the input file extension or the filename itself, possibly
2199+also the lowercase version (the input file may also have no extension at
2200+all, but, for instance, a <samp><span class="file">ChangeLog</span></samp> input file will be
2201+highlighted using <samp><span class="file">changelog.lang</span></samp>).
2202+
2203+ <p><a name="index-g_t_0040code_007b_002d_002dinfer_002dlang_007d-113"></a>Furthermore, this mechanism can be given priority with the command line
2204+option <code>--infer-lang</code>. For instance, this is used in the script
2205+<samp><span class="file">src-hilite-lesspipe.sh</span></samp> (<a href="#Using-source_002dhighlight-with-less">Using source-highlight with less</a>)
2206+when running source-highlight, in order to avoid the problem of
2207+formatting a Perl script as a Prolog program (since the extension
2208+<samp><span class="file">.pl</span></samp> is associated to Prolog programs in the language map file,
2209+<a href="#Perl">Perl</a>).
2210+
2211+<div class="node">
2212+<a name="Language-Definitions"></a>
2213+<p><hr>
2214+Next:&nbsp;<a rel="next" accesskey="n" href="#Output-Language-Definitions">Output Language Definitions</a>,
2215+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Invoking-source_002dhighlight">Invoking source-highlight</a>,
2216+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
2217+
2218+</div>
2219+
2220+<h2 class="chapter">7 Language Definitions</h2>
2221+
2222+<p><a name="index-language-definition-114"></a>
2223+Since version 2.0 source-highlight uses a specific syntax
2224+to specify source language elements (e.g., keywords, strings,
2225+comments, etc.). Before version 2.0, language elements were scanned
2226+through Flex. This had the drawback of writing a new flex file
2227+to deal with a new language; even worse, a new language could
2228+not be added &ldquo;dynamically&rdquo;: you had to recompile the whole
2229+source-highlight program.
2230+
2231+ <p>Instead, now, language elements are specified in a file, loaded
2232+dynamically, through a (hopefully) simple syntax. Then, these
2233+definitions are used internally to create, on-the-fly, regular
2234+expressions that are used to highlight the elements (see also <a href="#How-source_002dhighlight-works">How source-highlight works</a>). In particular, we use the regular expressions
2235+provided by the Boost library (see <a href="#Installation">Installation</a>). Thus, when
2236+writing a language definition file you will surely have to deal with
2237+regular expressions. Don't be scared: for most of the languages you may
2238+never have to deal with difficult regular expressions, and you can also
2239+specify language keywords (such as, e.g., &ldquo;if&rdquo;, &ldquo;while&rdquo;, etc., see
2240+<a href="#Simple-definitions">Simple definitions</a>); moreover, for defining delimited language
2241+elements you will not have to write a regular expression, but just the
2242+delimiters (see <a href="#Delimited-definitions">Delimited definitions</a>). However, there might be
2243+some language definitions that may require heavy use of more involved
2244+regular expressions (e.g., Perl, just to mention one).
2245+
2246+ <p>Of course, we use the Boost regex library regular expression syntax. We
2247+refer to Boost documentation for such syntax,
2248+<a href="http://www.boost.org/libs/regex/doc/syntax.html">http://www.boost.org/libs/regex/doc/syntax.html</a>, however, in
2249+<a href="#Notes-on-regular-expressions">Notes on regular expressions</a>, we provide some notes on regular
2250+expressions that might be helpful for those who never dealt with them.
2251+By default, Boost regex library uses Perl regular expression syntax,
2252+and, at the moment, this is the only syntax supported by
2253+source-highlight.
2254+
2255+ <p>Here, we see such syntax in details, by relying on many examples. This
2256+allows a user to easily modify an existing language definition and
2257+create a new one. These files have, typically, extension <samp><span class="file">.lang</span></samp>.
2258+
2259+ <p>Each definition basically associates a regular expression to a language
2260+element and defines a name for the language element. Such name will be
2261+used to associate a particular style (e.g., bold face, color, etc.) when
2262+highlighting such elements. You cannot use names that are the same
2263+of keywords used in the language definition syntax (e.g., <code>start</code>,
2264+as shown later, is a reserved word).
2265+
2266+ <p>Comments can be given by using <code>#</code>; the rest of the line is
2267+considered as a comment.
2268+
2269+ <p>Source-highlight will scan each line of the input file separately. So a
2270+regular expression that tries to match new line characters is destined
2271+to fail. However, the language definition syntax provides means to deal
2272+with multiple lines (see <a href="#Delimited-definitions">Delimited definitions</a> and
2273+<a href="#State_002fEnvironment-Definitions">State/Environment Definitions</a>).
2274+
2275+<ul class="menu">
2276+<li><a accesskey="1" href="#Ways-of-specifying-regular-expressions">Ways of specifying regular expressions</a>
2277+<li><a accesskey="2" href="#Simple-definitions">Simple definitions</a>
2278+<li><a accesskey="3" href="#Line-wide-definitions">Line wide definitions</a>
2279+<li><a accesskey="4" href="#Order-of-definitions">Order of definitions</a>
2280+<li><a accesskey="5" href="#Delimited-definitions">Delimited definitions</a>
2281+<li><a accesskey="6" href="#Variable-definitions">Variable definitions</a>
2282+<li><a accesskey="7" href="#Dynamic-Backreferences">Dynamic Backreferences</a>
2283+<li><a accesskey="8" href="#File-inclusion">File inclusion</a>: Include the contents of another file
2284+<li><a accesskey="9" href="#State_002fEnvironment-Definitions">State/Environment Definitions</a>
2285+<li><a href="#Explicit-subexpressions-with-names">Explicit subexpressions with names</a>
2286+<li><a href="#Redefinitions-and-Substitutions">Redefinitions and Substitutions</a>
2287+<li><a href="#How-source_002dhighlight-works">How source-highlight works</a>
2288+<li><a href="#Notes-on-regular-expressions">Notes on regular expressions</a>
2289+<li><a href="#The-program-check_002dregexp">The program check-regexp</a>
2290+<li><a href="#Listing-Language-Elements">Listing Language Elements</a>
2291+<li><a href="#Concluding-Remarks">Concluding Remarks</a>
2292+<li><a href="#Debugging">Debugging</a>: Debug a language definition file
2293+<li><a href="#Tutorials-on-Language-Definitions">Tutorials on Language Definitions</a>
2294+</ul>
2295+
2296+<div class="node">
2297+<a name="Ways-of-specifying-regular-expressions"></a>
2298+<p><hr>
2299+Next:&nbsp;<a rel="next" accesskey="n" href="#Simple-definitions">Simple definitions</a>,
2300+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Language-Definitions">Language Definitions</a>,
2301+Up:&nbsp;<a rel="up" accesskey="u" href="#Language-Definitions">Language Definitions</a>
2302+
2303+</div>
2304+
2305+<h3 class="section">7.1 Ways of specifying regular expressions</h3>
2306+
2307+<p>Before getting into details of language definition syntax, it is crucial
2308+to describe the 3 possible ways of specifying a regular expression
2309+string. These 3 different ways, basically differ in the way they handle
2310+regular expression special characters, such, e.g., parenthesis. For
2311+this reason, one mechanism can be more powerful than another one, but it
2312+could also require more attention; furthermore, there can be situations
2313+where you're forced to use only one mechanism, since the other ones
2314+cannot accomplish the required goal.
2315+
2316+
2317+<a name="index-g_t_0040code_007b_0022expression_0022_007d-115"></a>
2318+<dl><dt><code>"expression"</code><dd>
2319+If you use double quotes (note, <code>"</code> and not <code>``</code> or
2320+<code>''</code>) to specify a regular expression, then basically all the
2321+characters, but the alternation symbol, i.e., the pipe symbol <code>|</code>,
2322+are considered literally, and thus will be automatically escaped (e.g.,
2323+a dot <code>.</code> is interpreted as the character <code>.</code> not as the
2324+regular expression wild card). Thus, for instance, if you specify
2325+
2326+ <pre class="example"> "my(regular)ex.pre$$ion{*}"
2327+</pre>
2328+ <p class="noindent">source-highlight will automatically transform it into
2329+
2330+ <pre class="example"> my\(regular\)ex\.pre\$\$ion\{\*\}
2331+</pre>
2332+ <p>The special character <code>|</code>, unless it is meant to separate two
2333+alternatives (<a href="#Simple-definitions">Simple definitions</a>), must be escaped with the
2334+character <code>\</code>, e.g., <code>\|</code>. Also the character <code>\</code>,
2335+if it is intended literally, must be escaped, e.g., <code>\\</code>.
2336+
2337+ <p><a name="index-g_t_0040code_007b_0027expression_0027_007d-116"></a><br><dt><code>'expression'</code><dd>
2338+If you want to enjoy (almost) the full power of regular expressions, you
2339+need to use single quoted strings (<code>'</code>), instead of double quoted
2340+strings. This way, you can specify special characters with their
2341+intended meaning.
2342+
2343+ <p>However, marked subexpressions are automatically transformed in non
2344+marked subexpressions, i.e., the parts in the expression of the shape
2345+<code>(...)</code> will be transformed into <code>(?:...)</code> (as explained in
2346+<a href="#Notes-on-regular-expressions">Notes on regular expressions</a>, <code>(?:...)</code> lexically groups
2347+part of a regular expression, without generating a marked
2348+sub-expression).
2349+
2350+ <p>Thus, for instance, if you specify
2351+
2352+ <pre class="example"> 'my(regular)ex.pre$ion*'
2353+</pre>
2354+ <p class="noindent">source-highlight will automatically transform it into
2355+
2356+ <pre class="example"> my(?:regular)ex.pre$ion*
2357+</pre>
2358+ <p>Since marked subexpressions cannot be specified with this syntax, then
2359+<em>backreferences</em> (see <a href="#Notes-on-regular-expressions">Notes on regular expressions</a>) are not
2360+allowed.
2361+
2362+ <p><a name="index-g_t_0040code_007b_0060expression_0060_007d-117"></a><br><dt><code>`expression`</code><dd>
2363+<a name="index-marked-subexpressions-118"></a><a name="index-backreference-119"></a><a name="index-backtick-120"></a>This syntax<a rel="footnote" href="#fn-26" name="fnd-26"><sup>26</sup></a> (note the difference, this
2364+one uses the <em>backtick</em> <code>`</code> while the previous one uses
2365+<code>'</code>) for specifying a regular expression was introduced to overcome
2366+the limitations of the other two syntaxes. With this syntax, the marked
2367+subexpressions are not transformed, and so you can use regular
2368+expressions mechanisms that rely on marked subexpressions, such as
2369+<em>backreferences</em> and <em>conditionals</em> (see <a href="#Notes-on-regular-expressions">Notes on regular expressions</a>).
2370+
2371+ <p>This syntax is also crucial for highlighting specific program parts of
2372+some programming languages, such as, e.g., Perl regular expressions
2373+(e.g., in substitution expressions) that can be expressed in many forms,
2374+in particular, separators for the part to be replaced and the part to
2375+replace which can be any non alphanumerical characters<a rel="footnote" href="#fn-27" name="fnd-27"><sup>27</sup></a>,
2376+for instance,
2377+
2378+ <pre class="example"> s/foo/bar/g
2379+ s|foo|bar|g
2380+ s#foo#bar#g
2381+ s@foo@bar@g
2382+</pre>
2383+ <p>Using this syntax, and backreferences, we can easily define a single
2384+language element to deal with these expressions (without specifying all
2385+the cases for each possible non alphanumerical character):
2386+
2387+ <pre class="example"> regexp = `s([^[:alnum:][:blank:]]).*\1.*\1[ixsmogce]*`
2388+</pre>
2389+ </dl>
2390+
2391+ <p>Since version 2.11, in all kinds of regular expression specification, you
2392+can insert newline characters, which will simply be ignored. Thus,
2393+e.g., the file:
2394+
2395+<!-- Generator: GNU source-highlight, by Lorenzo Bettini, http://www.gnu.org/software/src-highlite -->
2396+<pre class="example"> <i># test_newlines.lang</i>
2397+ <i># test that newlines in expressions are simply discarded</i>
2398+
2399+ <i>keyword</i> = <tt>"foo</tt>
2400+ <tt>|</tt>
2401+ <tt>lang"</tt>
2402+
2403+ (<i>keyword</i>,<i>normal</i>,<i>classname</i>) =
2404+ <tt>`(\&lt;struct)</tt>
2405+ <tt>([[:blank:]]+)</tt>
2406+ <tt>([[:alnum:]_]+)`</tt>
2407+
2408+ <i>preproc</i> = <tt>'^[[:blank:]]*</tt>
2409+ <tt>#([[:blank:]]*</tt>
2410+ <tt>[[:word:]]*)'</tt>
2411+</pre>
2412+ <p class="noindent">and the file:
2413+
2414+<!-- Generator: GNU source-highlight, by Lorenzo Bettini, http://www.gnu.org/software/src-highlite -->
2415+<pre class="example"> <i># test_nonewlines.lang</i>
2416+ <i># test that newlines in expressions are simply discarded</i>
2417+ <i># see the corresponding test_newlines.lang</i>
2418+
2419+ <i>keyword</i> = <tt>"foo|lang"</tt>
2420+
2421+ (<i>keyword</i>,<i>normal</i>,<i>classname</i>) = <tt>`(\&lt;struct)([[:blank:]]+)([[:alnum:]_]+)`</tt>
2422+
2423+ <i>preproc</i> = <tt>'^[[:blank:]]*#([[:blank:]]*[[:word:]]*)'</tt>
2424+</pre>
2425+ <p class="noindent">are equivalent. However, the former is surely more readable.
2426+
2427+ <p>Note however, that space characters are NOT ignored in regular expression
2428+definitions.
2429+
2430+<div class="node">
2431+<a name="Simple-definitions"></a>
2432+<p><hr>
2433+Next:&nbsp;<a rel="next" accesskey="n" href="#Line-wide-definitions">Line wide definitions</a>,
2434+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Ways-of-specifying-regular-expressions">Ways of specifying regular expressions</a>,
2435+Up:&nbsp;<a rel="up" accesskey="u" href="#Language-Definitions">Language Definitions</a>
2436+
2437+</div>
2438+
2439+<h3 class="section">7.2 Simple definitions</h3>
2440+
2441+<p><a name="index-simple-language-definition-121"></a>
2442+The simplest way to specify language elements is to list the possible
2443+alternatives. This is the case, for instance, for keywords. For
2444+instance, in <samp><span class="file">java.lang</span></samp> you have:
2445+
2446+<pre class="example"> keyword = "abstract|assert|break|case|catch|class|const",
2447+ "continue|default|do|else|extends|false|final",
2448+ "finally|for|goto|if|implements|instanceof|interface"
2449+ keyword = "native|new|null|private|protected|public|return",
2450+ "static|strictfp|super|switch|synchronized|throw",
2451+ "throws|true|this|transient|try|volatile|while"
2452+</pre>
2453+ <p>You can separate quoted definitions with commas. Alternatively, within
2454+a quoted definition, alternatives can be separated with the pipe symbol
2455+<code>|</code>. The above definition defines the language element
2456+<code>keyword</code>. Each time an element is found in the source file, it is
2457+highlighted with the style for the element with the same name in the
2458+output format style file (note that all elements shown in the example
2459+are taken from the language definition files that come with
2460+source-highlight and there is a style for each of such elements, see
2461+<a href="#Configuration-files">Configuration files</a>). If such an element is not specified in the
2462+output format style file, it is simply not highlighted (actually, it is
2463+highlighted with style <code>normal</code>, <a href="#Configuration-files">Configuration files</a>) (so pay
2464+attention to typos :-).
2465+
2466+ <p>From the above example you may have noted that language element
2467+definitions are cumulative, so the second <code>keyword</code> definition does
2468+not replace the first one. (Indeed, in some cases you may want to
2469+actually redefine a language element; this is possible as explained in
2470+<a href="#Redefinitions-and-Substitutions">Redefinitions and Substitutions</a>).
2471+
2472+ <p>Note that words specified in double quotes have to match exactly in a
2473+source file, and they must be isolated (not surrounded by anything but
2474+spaces). Thus for instance <code>class</code> is matched as a keyword, but in
2475+<code>my_class</code> the substring <code>class</code> is not matched as keyword.
2476+From the point of view of regular expressions a string such as
2477+<code>class</code> in a double quote simple definition is intended as
2478+<code>\&lt;(class)\&gt;</code>.
2479+
2480+ <p>Special characters have to be escaped with the character <code>\</code>. So
2481+for instance if you want to specify the character <code>|</code>, which is
2482+normally used to separate alternatives in double quoted strings, you
2483+have to specify <code>\|</code>.
2484+
2485+ <p>As explained in <a href="#Ways-of-specifying-regular-expressions">Ways of specifying regular expressions</a>,
2486+definitions in double quotes are interpreted literally (thus, e.g., a
2487+dot <code>.</code> is interpreted as the character <code>.</code> not as the regular
2488+expression wild card). If you want to enjoy the full power of regular
2489+expressions to specify a language alternative, you have to use single
2490+quoted strings (<code>'</code>), instead of double quoted strings, or strings
2491+quoted with backticks (<code>`</code>).
2492+
2493+ <p>For instance, the following is the definition for a preprocessor
2494+directive in C/C++:
2495+
2496+<pre class="example"> preproc = '^[[:blank:]]*#([[:blank:]]*[[:word:]]*)'
2497+</pre>
2498+ <p>Note that the definition <code>'class'</code> is different from
2499+<code>"class"</code>, as explained above. Thus, for instance <code>'class'</code>
2500+matches also the sub-expression <code>class</code> inside <code>my_class</code>.
2501+
2502+ <p>Furthermore, you are not allowed to specify, in the same list, double
2503+quoted strings and single quoted strings: you need to split such list
2504+definitions. Thus, for instance, the following definition is wrong:
2505+
2506+<pre class="example"> preproc = "#define",'^[[:blank:]]*#([[:blank:]]*[[:word:]]*)'
2507+</pre>
2508+ <p>while the following one is correct:
2509+
2510+<pre class="example"> preproc = "#define"
2511+ preproc = '^[[:blank:]]*#([[:blank:]]*[[:word:]]*)'
2512+</pre>
2513+ <p><a name="index-nonsensitive-122"></a>Finally, at the end of a list of definitions, one can specify the
2514+keyword <code>nonsensitive</code>; in that case, the specified strings will be
2515+interpreted in a non case sensitive way. For instance, we use this
2516+feature in Pascal language definition, <samp><span class="file">pascal.lang</span></samp> where keywords
2517+are parsed in a non sensitive way:
2518+
2519+<pre class="example"> keyword = "alfa|and|array|begin|case|const|div",
2520+ "do|downto|else|end|false|file|for|function|get|goto|if|in",
2521+ "label|mod|new|not|of|or|pack|packed|page|program",
2522+ "put|procedure|read|readln|record|repeat|reset|rewrite|set",
2523+ "text|then|to|true|type|unpack|until|var|while|with|writeln|write"
2524+ nonsensitive
2525+</pre>
2526+ <div class="node">
2527+<a name="Line-wide-definitions"></a>
2528+<p><hr>
2529+Next:&nbsp;<a rel="next" accesskey="n" href="#Order-of-definitions">Order of definitions</a>,
2530+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Simple-definitions">Simple definitions</a>,
2531+Up:&nbsp;<a rel="up" accesskey="u" href="#Language-Definitions">Language Definitions</a>
2532+
2533+</div>
2534+
2535+<h3 class="section">7.3 Line wide definitions</h3>
2536+
2537+<p><a name="index-lines-123"></a>
2538+It is often useful to define a language element that affects all the
2539+remaining characters up to the end of the line. For such definitions,
2540+instead of the <code>=</code> you must use the keyword <code>start</code>. For
2541+instance, the following is the definition of a single line comment in
2542+C++:
2543+
2544+<pre class="example"> comment start "//"
2545+</pre>
2546+ <p>This means that when the two characters <code>//</code> are encountered in the
2547+source file, everything from these characters on, up to the end of
2548+the line, will be highlighted according to the style <code>comment</code>.
2549+
2550+<div class="node">
2551+<a name="Order-of-definitions"></a>
2552+<p><hr>
2553+Next:&nbsp;<a rel="next" accesskey="n" href="#Delimited-definitions">Delimited definitions</a>,
2554+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Line-wide-definitions">Line wide definitions</a>,
2555+Up:&nbsp;<a rel="up" accesskey="u" href="#Language-Definitions">Language Definitions</a>
2556+
2557+</div>
2558+
2559+<h3 class="section">7.4 Order of definitions</h3>
2560+
2561+<p><a name="index-definition-order-124"></a>
2562+It is important to observe that the order of language definitions is
2563+important since it will be used during regular expression matching (this
2564+will be detailed in <a href="#How-source_002dhighlight-works">How source-highlight works</a>). You then have to
2565+make sure that, if there are definitions that start with same
2566+characters, the longest expression is specified first in the file. For
2567+instance if you write
2568+
2569+<pre class="example"> symbol = "/"
2570+ comment start "//"
2571+</pre>
2572+ <p>The first expression will always be matched first, and the
2573+second expression will never be matched. The right order is
2574+
2575+<pre class="example"> comment start "//"
2576+ symbol = "/"
2577+</pre>
2578+ <div class="node">
2579+<a name="Delimited-definitions"></a>
2580+<p><hr>
2581+Next:&nbsp;<a rel="next" accesskey="n" href="#Variable-definitions">Variable definitions</a>,
2582+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Order-of-definitions">Order of definitions</a>,
2583+Up:&nbsp;<a rel="up" accesskey="u" href="#Language-Definitions">Language Definitions</a>
2584+
2585+</div>
2586+
2587+<h3 class="section">7.5 Delimited definitions</h3>
2588+
2589+<p><a name="index-delimited-definitions-125"></a>
2590+Many elements are delimited by specific character sequences.
2591+For instance, strings and multiline comments. The syntax for
2592+such an element definition is
2593+
2594+<pre class="example"> &lt;name&gt; delim &lt;left delimited&gt; &lt;right delimiter&gt; \
2595+ {escape &lt;escape character&gt;} \
2596+ {multiline} {nested}
2597+</pre>
2598+ <p>The <code>escape</code> statement specifies the escape character that may
2599+precede one of the

Part of diff was cut off due to size limit. Use your local client to view the full diff.