File: logtalk.xml

package info (click to toggle)
kf6-syntax-highlighting 6.20.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 49,872 kB
  • sloc: xml: 205,656; cpp: 12,882; python: 3,055; sh: 965; perl: 814; ruby: 494; pascal: 393; javascript: 161; php: 150; jsp: 132; lisp: 131; haskell: 124; ada: 119; ansic: 107; makefile: 96; f90: 94; ml: 85; cobol: 81; yacc: 71; csh: 62; exp: 61; erlang: 54; sql: 51; java: 47; sed: 45; objc: 37; tcl: 36; awk: 31; asm: 30; fortran: 18; cs: 10
file content (186 lines) | stat: -rw-r--r-- 12,056 bytes parent folder | download | duplicates (2)
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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language [
  <!ENTITY event_handlers "after|before">
  <!ENTITY message_forwarding_handler "forward">
  <!ENTITY method_execution_context "context|parameter|this|se(lf|nder)">
  <!ENTITY reflection "current_predicate|predicate_property">
  <!ENTITY dcgs "expand_(goal|term)|(goal|term)_expansion|phrase">
  <!ENTITY entity1 "(abolish|c(reate|urrent))_(object|protocol|category)">
  <!ENTITY entity2 "(object|protocol|category)_property">
  <!ENTITY entity_relations "co(mplements_object|nforms_to_protocol)|extends_(object|protocol|category)|imp(lements_protocol|orts_category)|(instantiat|specializ)es_class">
  <!ENTITY events "current_event|(abolish|define)_events">
  <!ENTITY flags "(create|current|set)_logtalk_flag">
  <!ENTITY compiling_loading_and_library_paths "logtalk_(compile|l(ibrary_path|oad|oad_context)|make(_target_action)?)">
  <!ENTITY database "clause|retract(all)?|a(bolish|ssert(a|z))">
  <!ENTITY control "ca(ll|tch)|throw|(type|domain|existence|permission|representation|evaluation|resource|syntax)_error">
  <!ENTITY all_solutions "(bag|set)of|f(ind|or)all">
  <!ENTITY multi_threading_predicates "threaded(_(ca(ll|ncel)|once|ignore|exit|peek|wait|notify))?">
  <!ENTITY engine_predicates "threaded_engine(_(create|destroy|self|next|next_reified|yield|post|fetch))?">
  <!ENTITY term_unification "subsumes_term|unify_with_occurs_check">
  <!ENTITY term_creation_and_decomposition "functor|arg|copy_term|numbervars|term_variables">
  <!ENTITY evaluable_functors "div|rem|m(ax|in|od)|abs|sign|float(_(integer|fractional)_part)?|floor|truncate|round|ceiling">
  <!ENTITY other_arithmetic_functors "cos|a(cos|sin|tan|tan2)|exp|log|s(in|qrt)|tan|xor">
  <!ENTITY term_testing "var|atom(ic)?|integer|float|c(allable|ompound)|n(onvar|umber)|ground|acyclic_term">
  <!ENTITY term_comparison "compare">
  <!ENTITY stream_selection_and_control "(curren|se)t_(in|out)put|open|close|flush_output|stream_property|at_end_of_stream|set_stream_position">
  <!ENTITY character_and_byte_input_output "nl|(get|peek|put)_(byte|c(har|ode))">
  <!ENTITY term_input_output "read(_term)?|write(q|_(canonical|term))?|(current_)?op|(current_)?char_conversion">
  <!ENTITY atomic_term_processing "atom_(length|c(hars|o(ncat|des)))|char_code|sub_atom|number_c(har|ode)s">
  <!ENTITY implementation_defined_hooks_functions "(se|curren)t_prolog_flag|halt">
  <!ENTITY sorting "(key)?sort">
  <!ENTITY logic_and_control "ignore|once">
]>

<language name="Logtalk" version="9" kateversion="5.0" section="Sources" extensions="*.lgt;.logtalk" mimetype="text/x-logtalk" author="Paulo Moura (pmoura@logtalk.org)" license="Apache License 2.0">

	<highlighting>

		<contexts>

			<context name = "normal" attribute = "Normal" lineEndContext = "#stay" >
				<!-- Directives -->
				<RegExpr String = "^\s*:-" attribute = "Normal" context = "directive" column="0" />
				<RegExpr String = "\b(&event_handlers;|&message_forwarding_handler;|&method_execution_context;|&reflection;|&dcgs;|&entity1;|&entity2;|&entity_relations;|&events;|&flags;|&compiling_loading_and_library_paths;|&database;|&control;|&all_solutions;|&multi_threading_predicates;|&engine_predicates;|&term_unification;|&term_creation_and_decomposition;|&evaluable_functors;|&other_arithmetic_functors;|&term_testing;|&term_comparison;|&stream_selection_and_control;|&character_and_byte_input_output;|&term_input_output;|&atomic_term_processing;|&implementation_defined_hooks_functions;|&sorting;|&logic_and_control;)(?=[(])|\b(logtalk_make|fa(il|lse)|true|(instantiation|system)_error|at_end_of_stream|flush_output|nl|halt|repeat)\b" attribute = "Built-in" context = "#stay" />
				<!-- Variables -->
				<RegExpr String = "\b[A-Z_]\w*" attribute = "Variable" context = "#stay" />
				<!-- Comments -->
				<DetectChar char = "%" attribute = "Comment" context = "single line comment" />
				<Detect2Chars char = "/" char1 = "*" attribute = "Comment" context = "multiline comment" beginRegion = "Comment" />
				<!-- Strings and quoted atoms -->
				<DetectChar char = "&quot;" attribute = "String" context = "string" />
				<DetectChar char = "'" attribute = "String" context = "atom" />
				<!-- Numbers -->
				<RegExpr String = "0'\\?.|0b[0-1]+|0o[0-7]+|0x[0-9a-fA-F]+|\d+(\.\d+)?([eE]([-+])?\d+)?" attribute = "Number" context = "#stay" />
				<!-- Message sending operators -->
				<Detect2Chars char = ":" char1 = ":" attribute = "Operator" context = "#stay" />
				<Detect2Chars char = "^" char1 = "^" attribute = "Operator" context = "#stay" />
				<!-- External call -->
				<DetectChar char = "{" attribute = "Operator" context = "#stay" beginRegion="external" />
				<DetectChar char = "}" attribute = "Operator" context = "#stay" endRegion="external" />
				<!-- Bitwise functors -->
				<Detect2Chars char = "&gt;" char1 = "&gt;" attribute = "Operator" context = "#stay" />
				<Detect2Chars char = "&lt;" char1 = "&lt;" attribute = "Operator" context = "#stay" />
				<Detect2Chars char = "/" char1 = "\" attribute = "Operator" context = "#stay" />
				<Detect2Chars char = "\" char1 = "/" attribute = "Operator" context = "#stay" />
				<Detect2Chars char = "\" char1 = "\" attribute = "Operator" context = "#stay" />
				<!-- Predicate aliases -->
				<!-- Arithmetic evaluation -->
				<RegExpr String = "\b[ai]s\b" attribute = "Operator" context = "#stay" />
				<!-- Arithmetic comparison -->
				<StringDetect String = "=:=" attribute = "Operator" context = "#stay" />
				<StringDetect String = "=\=" attribute = "Operator" context = "#stay" />
				<DetectChar char = "&lt;" attribute = "Operator" context = "#stay" />
				<Detect2Chars char = "=" char1 = "&lt;" attribute = "Operator" context = "#stay" />
				<Detect2Chars char = "&gt;" char1 = "=" attribute = "Operator" context = "#stay" />
				<DetectChar char = "&gt;" attribute = "Operator" context = "#stay" />
				<!-- Term creation and decomposition -->
				<StringDetect String = "=.." attribute = "Operator" context = "#stay" />
				<!-- Term comparison -->
				<Detect2Chars char = "=" char1 = "=" attribute = "Operator" context = "#stay" />
				<StringDetect String = "\==" attribute = "Operator" context = "#stay" />
				<StringDetect String = "@=&lt;" attribute = "Operator" context = "#stay" />
				<Detect2Chars char = "@" char1 = "&lt;" attribute = "Operator" context = "#stay" />
				<StringDetect String = "@&gt;=" attribute = "Operator" context = "#stay" />
				<Detect2Chars char = "@" char1 = "&gt;" attribute = "Operator" context = "#stay" />
				<!-- Term unification -->
				<DetectChar char = "=" attribute = "Operator" context = "#stay" />
				<Detect2Chars char = "\" char1 = "=" attribute = "Operator" context = "#stay" />
				<!-- DCG rules -->
				<StringDetect String = "--&gt;" attribute = "Operator" context = "#stay" />
				<!-- Control constructs -->
				<AnyChar String = "!;" attribute = "Operator" context = "#stay" />
				<Detect2Chars char = "-" char1 = "&gt;" attribute = "Operator" context = "#stay" />
				<!-- Other arithemtic functors -->
				<Detect2Chars char = "*" char1 = "*" attribute = "Operator" context = "#stay" />
				<!-- Evaluable functors -->
				<Detect2Chars char = "/" char1 = "/" attribute = "Operator" context = "#stay" />
				<AnyChar String = "+-*/" attribute = "Operator" context = "#stay" />
				<RegExpr String = "\b(e|pi|div|mod|rem)\b" attribute = "Operator" context = "#stay" />
				<!-- Logic and control -->
				<Detect2Chars char = "\" char1 = "+" attribute = "Operator" context = "#stay" />
				<!-- Mode operators -->
				<!-- Category predicate direct call operator -->
				<!-- Existential quantifier -->
				<AnyChar String = "?@:^" attribute = "Operator" context = "#stay" />
				<!-- Atoms -->
				<RegExpr String = "\b[a-z]\w*" attribute = "Normal" context = "#stay" />
			</context>

			<context name = "directive" attribute = "Directive" lineEndContext = "#stay" >
				<!-- Conditional compilation directives -->
				<RegExpr String = "\bif(?=[(])" attribute = "Directive" context = "#pop" beginRegion = "CC" />
				<RegExpr String = "\bendif(?=[.])" attribute = "Directive" context = "#pop" endRegion = "CC" />
				<RegExpr String = "\belif(?=[(])|\belse(?=[.])" attribute = "Directive" context = "#pop" />
				<!-- Entity directives -->
				<RegExpr String = "\b(category|object|protocol)(?=[(])" attribute = "Directive" context = "entityrelations" beginRegion = "Entity" />
				<RegExpr String = "\bend_(category|object|protocol)(?=[.])" attribute = "Directive" context = "#pop" endRegion = "Entity" />
 				<!-- Predicate scope directives -->
				<!-- Other directives -->
				<RegExpr String = "\bmodule(?=[(])|\bp(ublic|r(otected|ivate))(?=[(])|\be(n(coding|sure_loaded)|xport)(?=[(])|\bin(clude|itialization|fo)(?=[(])|\b(built_in|dynamic|synchronized|threaded)(?=[.])|\b(alias|d(ynamic|iscontiguous)|m(eta_(non_terminal|predicate)|ode|ultifile)|s(et_(logtalk|prolog)_flag|ynchronized))(?=[(])|\bop(?=[(])|\b(c(alls|oinductive)|reexport|use(s|_module))(?=[(])" attribute = "Directive" context = "#pop" />
			</context>

			<context name = "entityrelations" attribute = "Normal" lineEndContext = "#stay" >
				<RegExpr String = "\b(complements|extends|i(nstantiates|mp(lements|orts))|specializes)(?=[(])" attribute = "Directive" context = "#stay" />
				<!-- Variables -->
				<RegExpr String = "\b[A-Z_]\w*" attribute = "Variable" context = "#stay" />
				<!-- Comments -->
				<DetectChar char = "%" attribute = "Comment" context = "single line comment" />
				<Detect2Chars char = "/" char1 = "*" attribute = "Comment" context = "multiline comment" beginRegion = "Comment" />
				<!-- Strings and quoted atoms -->
				<DetectChar char = "&quot;" attribute = "String" context = "string" />
				<DetectChar char = "'" attribute = "String" context = "atom" />
				<!-- Numbers -->
				<RegExpr String = "0'\\?.|0b[0-1]+|0o[0-7]+|0x[0-9a-fA-F]+|\d+(\.\d+)?([eE]([-+])?\d+)?" attribute = "Number" context = "#stay" />
				<!-- Scope operator -->
				<Detect2Chars char = ":" char1 = ":" attribute = "Operator" context = "#stay" />
				<!-- End of entity-opening directive -->
				<Detect2Chars attribute = "Normal" context = "#pop#pop" char = ")" char1 = "." />
			</context>

			<context name = "single line comment" attribute = "Comment" lineEndContext = "#pop">
				<DetectSpaces />
				<IncludeRules context="##Comments" />
			</context>

			<context name = "multiline comment" attribute = "Comment" lineEndContext = "#stay" >
				<Detect2Chars char = "*" char1 = "/" attribute = "Comment" context = "#pop" endRegion = "Comment" />
				<DetectSpaces />
				<IncludeRules context="##Comments" />
			</context>

			<context name = "string" attribute = "String" lineEndContext = "#stay" >
				<DetectChar char = "&quot;" attribute = "String" context = "#pop" />
			</context>

			<context name = "atom" attribute = "String" lineEndContext = "#stay" >
				<RegExpr attribute="String Char" context="#stay" String="\\x[a-fA-F0-9]+\\|\\[0-7]+\\"/>
				<HlCStringChar attribute="String Char" context="#stay"/>
				<DetectChar char = "'" attribute = "String" context = "#pop" />
			</context>

		</contexts>

		<itemDatas>
			<itemData name = "Normal" defStyleNum = "dsNormal" />
			<itemData name = "Directive" defStyleNum = "dsKeyword" />
			<itemData name = "Built-in" defStyleNum = "dsFunction" />
			<itemData name = "Operator" defStyleNum = "dsDataType" />
			<itemData name = "Comment" defStyleNum = "dsComment" />
			<itemData name = "Number" defStyleNum = "dsDecVal" />
			<itemData name = "String" defStyleNum = "dsString" />
			<itemData name="String Char" defStyleNum="dsSpecialChar" spellChecking="false"/>
			<itemData name = "Variable" defStyleNum = "dsOthers" />
		</itemDatas>

	</highlighting>

	<general>
		<comments>
			<comment name = "singleLine" start = "%" position = "afterwhitespace" />
			<comment name = "multiLine" start = "/*" end = "*/" region = "Comment" />
		</comments>
		<keywords casesensitive="true" />
	</general>

</language>
<!-- kate: replace-tabs off; -->