-
Notifications
You must be signed in to change notification settings - Fork 1
/
lstsemantic.sty
executable file
·258 lines (240 loc) · 6.61 KB
/
lstsemantic.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{lstsemantic}[2013/01/17]
\RequirePackage{listings}
% listing language definitions for several language of the following kinds:
% * ontology languages
% * markup languages
% * other semantic web languages
% * other languages occurring in the above contexts
%
% for some related languages see also https://svn.kwarc.info/repos/stex/trunk/sty/etc/lstomdoc.sty
%
% compiled by Christoph Lange (Universität Bremen, Jacobs University Bremen, University of Birmingham)
% 2010–2013
%
% https://github.com/clange/latex
%
% For Mizar, see https://raw.github.com/JUrban/mizarmode/master/lstlangmizar.sty by Josef Urban
% Isabelle
% http://isabelle.in.tum.de
% partial specification; poor man's alternative to Isabelle's own LaTeX export
% but see also pmisabelle.sty
\newif\iflst@instring\lst@instringfalse
\newcommand*{\lst@eat}[1]{}%
\newcommand*{\togglelst@instring}{%
\upshape%
\iflst@instring\global\lst@instringfalse''\else\global\lst@instringtrue``\fi%
}
\lstdefinelanguage{Isabelle}[]{ML}%
{morekeywords={%
assume,%
assumes,%
by,%
def,%
fix,%
fixes,%
from,%
have,%
lemma,%
obtain,%
proof,%
qed,%
show,%
shows,%
theorem,%
try,%
unfolding,%
using,%
where,%
},
stringstyle=\togglelst@instring\lst@eat,% eat the "; render our own
basicstyle=\itshape,%
keywordstyle=\upshape\bfseries,%
columns=fullflexible,%
showstringspaces=false,%
mathescape,%
}[keywords,comments]
% Common Logic 1.0 Interchange Format (CLIF)
% http://iso-commonlogic.org/
% partial specification
\lstdefinelanguage{clif}%
{morekeywords={%
and,%
cl-comment,%
cl-imports,%
cl-module,%
cl-text,%
exists,%
forall,%
if,%
iff,%
not,%
or,%
},
morecomment=[l]{//},%
morecomment=[s]{/*}{*/},%
alsoletter=-,%
}[keywords,comments]
% Relax NG Compact
% http://relaxng.org/compact-20021121.html
% partial specification
\lstdefinelanguage{rnc}%
{morekeywords={%
default,namespace,datatypes,%
start,%
element,%
attribute,%
text,%
empty},
morestring=[b]",%
}[keywords,strings]
% Distributed Ontology Language (DOL), text serialization
% ISO WD 17347
% http://ontolog.cim3.net/cgi-bin/wiki.pl?OntoIOp
% partial specification; the whole DOL language is currently experimental
\lstdefinelanguage{dolText}%
{morekeywords={%
keep,extract,remove,without,% new ones; sort properly by subject
end,%
hide,along,reveal,forget,translation,%
extract,%
distributed-ontology,logic,syntax,language,%
ontology,and,then,%
combine,excluding,%
interpretation,view,alignment,module,for,of,to,relation,%
circ,vars,minimize,%
bridge,%
equivalence,%
with,%
prefix},
alsoletter=-,%
morecomment=[l]{\%\%\ },%
morecomment=[n]{\%[}{]\%},%
morecomment=[s]{\%\{}{\}\%},%
}[keywords,comments]
% HetCASL
% http://www.dfki.de/sks/hets/
% partial specification
\lstdefinelanguage{HetCASL}%
{morekeywords={%
end,%
hide,reveal,along,%
library,from,get,%
logic,%
spec,and,then,%
interpretation,view,to,%
with,%
implied},
morecomment=[l]{\%\%\ },%
morecomment=[n]{\%[}{]\%},%
morecomment=[s]{\%\{}{\}\%},%
}[keywords,comments]
% Extended Backus-Naur Form
% http://en.wikipedia.org/wiki/Extended_Backus–Naur_Form
\lstdefinelanguage{ebnf}%
{morestring=[b]',%
morestring=[b]",%
morecomment=[s]{?}{?},%
morecomment=[s]{(*}{*)},%
}
% OWL (Web Ontology Language) 2 Functional-style Syntax
% http://www.w3.org/TR/2009/REC-owl2-syntax-20091027/
% partial specification
\lstdefinelanguage{owl2fun}%
{morekeywords={SubClassOf,%
ObjectIntersectionOf,ObjectUnionOf,ObjectOneOf,%
ObjectAllValuesFrom,ObjectSomeValuesFrom,ObjectHasValue,%
ObjectExactCardinality,%
DataOneOf,%
DataHasValue,%
EquivalentClasses,%
DifferentIndividuals}}[keywords]
% OWL (Web Ontology Language) 2 Manchester Syntax
% http://www.w3.org/TR/2009/NOTE-owl2-manchester-syntax-20091027/
% complete specification
\lstdefinelanguage{owl2Manchester}%
{morekeywords={%
AnnotationProperty,Annotations,Asymmetric,%
Characteristics,Class,%
Datatype,DataProperty,DifferentFrom,DifferentIndividuals,DisjointClasses,DisjointProperties,DisjointUnionOf,DisjointWith,Domain,%
EquivalentClasses,EquivalentProperties,EquivalentTo,%
Facts,Functional,%
HasKey,%
Import,Individual,InverseFunctional,InverseOf,Irreflexive,%
ObjectProperty,%
Ontology,%
Prefix,%
Range,Reflexive,%
SameAs,SameIndividual,Self,SubClassOf,SubPropertyChain,SubPropertyOf,Symmetric,%
Transitive,Types,%
and,%
exactly,%
inverse,%
langPattern,length,%
max,maxLength,min,minLength,%
not,%
only,or,%
pattern,%
some,%
that,%
value},%
morecomment=[l]{\#\ },%
morestring=[b]",%
}[keywords,comments,strings]
% N3 Logic (also usable for Turtle RDF serialization)
% http://www.w3.org/TeamSubmission/n3/
% partial specification
\lstdefinelanguage{N3}%
{morekeywords={@forAll,@forSome,@prefix,a,is,of},%
morecomment=[l]{\#\ },%
morestring=[b]",%
morestring=[b]{"""}}[keywords,comments,strings]
% XQuery 1.0
% http://www.w3.org/TR/2010/REC-xquery-20101214/
% partial specification
\lstdefinelanguage{xquery}%
{morekeywords={for,in,let,return,%
eq,and,not,%
declare,default,function,element,variable,external,%
as,%
copy,modify,replace,with,delete,insert,node,nodes,first,into,%
module,namespace,import,at},%
morestring=[b]',%
morecomment=[n]{(:}{:)}}[keywords,strings]
% Regular XML RDF
% http://www.dajobe.org/papers/xmleurope2004/
% "full" specification (well, it's trivial)
\lstdefinelanguage{rxr}[]{XML}%
{keywordsprefix={rxr:}}[keywords]
% RDF/XML
% http://www.w3.org/TR/2004/REC-rdf-syntax-grammar-20040210/
% "full" specification (well, it's trivial)
\lstdefinelanguage{RDF/XML}[]{XML}%
{keywordsprefix={rdf:}}[keywords]
% XInclude 1.0
% http://www.w3.org/TR/2006/REC-xinclude-20061115/
% "full" specification (well, it's trivial)
\lstdefinelanguage{XInclude}[]{XML}%
{keywordsprefix={xi:}}[keywords]
% XHTML+RDFa 1.0
% http://www.w3.org/TR/2008/REC-rdfa-syntax-20081014
% full specification
\lstdefinelanguage{XHTML+RDFa}[]{HTML}%
{morekeywords={about,content,datatype,href,property,rel,resource,rev,src,typeof}}[keywords]
% MathML notation definitions
% http://www.w3.org/TR/2008/WD-MathML3-20080409/chapter8.html
% full specification (but the language is experimental and has not been admitted as a part of MathML so far)
\lstdefinelanguage{ntn}[]{XML}%
{morekeywords={notation,prototype,expr,rendering,render}}
% HTTP headers
% http://tools.ietf.org/html/rfc2616
% partial specification
\lstdefinelanguage{HTTP}%
{morekeywords={GET,Host,Accept}}
% OpenMath Content Dictionaries with OpenMath objects
% http://www.openmath.org/standard/om20-2004-06-30/
% complete specification
\lstdefinelanguage{omWithCD}[]{XML}%
{morekeywords={OMS,OMV,OMI,OMB,OMSTR,OMF,OMA,OMBIND,OMBVAR,OME,OMATTR,OMATP,OMOBJ,CD,CDBase,CDName,CDURL,CDReviewDate,CDStatus,CDVersion,CDRevision,CDUses,CDDefinition,Name,Description,Role,CMP,FMP},
sensitive=true}