| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE language [ |
| 3 |
<!ENTITY event_handlers "after|before"> |
| 4 |
<!ENTITY message_forwarding_handler "forward"> |
| 5 |
<!ENTITY method_execution_context "context|parameter|this|se(lf|nder)"> |
| 6 |
<!ENTITY reflection "current_predicate|predicate_property"> |
| 7 |
<!ENTITY dcgs "expand_(goal|term)|(goal|term)_expansion|phrase"> |
| 8 |
<!ENTITY entity1 "(abolish|c(reate|urrent))_(object|protocol|category)"> |
| 9 |
<!ENTITY entity2 "(object|protocol|category)_property"> |
| 10 |
<!ENTITY entity_relations "co(mplements_object|nforms_to_protocol)|extends_(object|protocol|category)|imp(lements_protocol|orts_category)|(instantiat|specializ)es_class"> |
| 11 |
<!ENTITY events "current_event|(abolish|define)_events"> |
| 12 |
<!ENTITY flags "(create|current|set)_logtalk_flag"> |
| 13 |
<!ENTITY compiling_loading_and_library_paths "logtalk_(compile|l(ibrary_path|oad|oad_context)|make(_target_action)?)"> |
| 14 |
<!ENTITY database "clause|retract(all)?|a(bolish|ssert(a|z))"> |
| 15 |
<!ENTITY control "ca(ll|tch)|throw|(type|domain|existence|permission|representation|evaluation|resource|syntax)_error"> |
| 16 |
<!ENTITY all_solutions "(bag|set)of|f(ind|or)all"> |
| 17 |
<!ENTITY multi_threading_predicates "threaded(_(ca(ll|ncel)|once|ignore|exit|peek|wait|notify))?"> |
| 18 |
<!ENTITY engine_predicates "threaded_engine(_(create|destroy|self|next|next_reified|yield|post|fetch))?"> |
| 19 |
<!ENTITY term_unification "subsumes_term|unify_with_occurs_check"> |
| 20 |
<!ENTITY term_creation_and_decomposition "functor|arg|copy_term|numbervars|term_variables"> |
| 21 |
<!ENTITY evaluable_functors "div|rem|m(ax|in|od)|abs|sign|float(_(integer|fractional)_part)?|floor|truncate|round|ceiling"> |
| 22 |
<!ENTITY other_arithmetic_functors "cos|a(cos|sin|tan|tan2)|exp|log|s(in|qrt)|tan|xor"> |
| 23 |
<!ENTITY term_testing "var|atom(ic)?|integer|float|c(allable|ompound)|n(onvar|umber)|ground|acyclic_term"> |
| 24 |
<!ENTITY term_comparison "compare"> |
| 25 |
<!ENTITY stream_selection_and_control "(curren|se)t_(in|out)put|open|close|flush_output|stream_property|at_end_of_stream|set_stream_position"> |
| 26 |
<!ENTITY character_and_byte_input_output "nl|(get|peek|put)_(byte|c(har|ode))"> |
| 27 |
<!ENTITY term_input_output "read(_term)?|write(q|_(canonical|term))?|(current_)?op|(current_)?char_conversion"> |
| 28 |
<!ENTITY atomic_term_processing "atom_(length|c(hars|o(ncat|des)))|char_code|sub_atom|number_c(har|ode)s"> |
| 29 |
<!ENTITY implementation_defined_hooks_functions "(se|curren)t_prolog_flag|halt"> |
| 30 |
<!ENTITY sorting "(key)?sort"> |
| 31 |
<!ENTITY logic_and_control "ignore|once"> |
| 32 |
]> |
| 33 |
|
| 34 |
<language name="Logtalk" version="8" kateversion="5.0" section="Sources" extensions="*.lgt;.logtalk" mimetype="text/x-logtalk" author="Paulo Moura ([email protected])" license="Apache License 2.0"> |
| 35 |
|
| 36 |
<highlighting> |
| 37 |
|
| 38 |
<contexts> |
| 39 |
|
| 40 |
<context name = "normal" attribute = "Normal" lineEndContext = "#stay" > |
| 41 |
<!-- Directives --> |
| 42 |
<RegExpr String = "^\s*:-" attribute = "Normal" context = "directive" column="0" /> |
| 43 |
<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" /> |
| 44 |
<!-- Variables --> |
| 45 |
<RegExpr String = "\b[A-Z_]\w*" attribute = "Variable" context = "#stay" /> |
| 46 |
<!-- Comments --> |
| 47 |
<DetectChar char = "%" attribute = "Comment" context = "single line comment" /> |
| 48 |
<Detect2Chars char = "/" char1 = "*" attribute = "Comment" context = "multiline comment" beginRegion = "Comment" /> |
| 49 |
<!-- Strings and quoted atoms --> |
| 50 |
<DetectChar char = """ attribute = "String" context = "string" /> |
| 51 |
<DetectChar char = "'" attribute = "String" context = "atom" /> |
| 52 |
<!-- Numbers --> |
| 53 |
<RegExpr String = "0'\\?.|0b[0-1]+|0o[0-7]+|0x[0-9a-fA-F]+|\d+(\.\d+)?([eE]([-+])?\d+)?" attribute = "Number" context = "#stay" /> |
| 54 |
<!-- Message sending operators --> |
| 55 |
<Detect2Chars char = ":" char1 = ":" attribute = "Operator" context = "#stay" /> |
| 56 |
<Detect2Chars char = "^" char1 = "^" attribute = "Operator" context = "#stay" /> |
| 57 |
<!-- External call --> |
| 58 |
<DetectChar char = "{" attribute = "Operator" context = "#stay" beginRegion="external" /> |
| 59 |
<DetectChar char = "}" attribute = "Operator" context = "#stay" endRegion="external" /> |
| 60 |
<!-- Bitwise functors --> |
| 61 |
<Detect2Chars char = ">" char1 = ">" attribute = "Operator" context = "#stay" /> |
| 62 |
<Detect2Chars char = "<" char1 = "<" attribute = "Operator" context = "#stay" /> |
| 63 |
<Detect2Chars char = "/" char1 = "\" attribute = "Operator" context = "#stay" /> |
| 64 |
<Detect2Chars char = "\" char1 = "/" attribute = "Operator" context = "#stay" /> |
| 65 |
<Detect2Chars char = "\" char1 = "\" attribute = "Operator" context = "#stay" /> |
| 66 |
<!-- Predicate aliases --> |
| 67 |
<!-- Arithmetic evaluation --> |
| 68 |
<RegExpr String = "\b[ai]s\b" attribute = "Operator" context = "#stay" /> |
| 69 |
<!-- Arithmetic comparison --> |
| 70 |
<StringDetect String = "=:=" attribute = "Operator" context = "#stay" /> |
| 71 |
<StringDetect String = "=\=" attribute = "Operator" context = "#stay" /> |
| 72 |
<DetectChar char = "<" attribute = "Operator" context = "#stay" /> |
| 73 |
<Detect2Chars char = "=" char1 = "<" attribute = "Operator" context = "#stay" /> |
| 74 |
<Detect2Chars char = ">" char1 = "=" attribute = "Operator" context = "#stay" /> |
| 75 |
<DetectChar char = ">" attribute = "Operator" context = "#stay" /> |
| 76 |
<!-- Term creation and decomposition --> |
| 77 |
<StringDetect String = "=.." attribute = "Operator" context = "#stay" /> |
| 78 |
<!-- Term comparison --> |
| 79 |
<Detect2Chars char = "=" char1 = "=" attribute = "Operator" context = "#stay" /> |
| 80 |
<StringDetect String = "\==" attribute = "Operator" context = "#stay" /> |
| 81 |
<StringDetect String = "@=<" attribute = "Operator" context = "#stay" /> |
| 82 |
<Detect2Chars char = "@" char1 = "<" attribute = "Operator" context = "#stay" /> |
| 83 |
<StringDetect String = "@>=" attribute = "Operator" context = "#stay" /> |
| 84 |
<Detect2Chars char = "@" char1 = ">" attribute = "Operator" context = "#stay" /> |
| 85 |
<!-- Term unification --> |
| 86 |
<DetectChar char = "=" attribute = "Operator" context = "#stay" /> |
| 87 |
<Detect2Chars char = "\" char1 = "=" attribute = "Operator" context = "#stay" /> |
| 88 |
<!-- DCG rules --> |
| 89 |
<StringDetect String = "-->" attribute = "Operator" context = "#stay" /> |
| 90 |
<!-- Control constructs --> |
| 91 |
<AnyChar String = "!;" attribute = "Operator" context = "#stay" /> |
| 92 |
<Detect2Chars char = "-" char1 = ">" attribute = "Operator" context = "#stay" /> |
| 93 |
<!-- Other arithemtic functors --> |
| 94 |
<Detect2Chars char = "*" char1 = "*" attribute = "Operator" context = "#stay" /> |
| 95 |
<!-- Evaluable functors --> |
| 96 |
<Detect2Chars char = "/" char1 = "/" attribute = "Operator" context = "#stay" /> |
| 97 |
<AnyChar String = "+-*/" attribute = "Operator" context = "#stay" /> |
| 98 |
<RegExpr String = "\b(e|pi|div|mod|rem)\b" attribute = "Operator" context = "#stay" /> |
| 99 |
<!-- Logic and control --> |
| 100 |
<Detect2Chars char = "\" char1 = "+" attribute = "Operator" context = "#stay" /> |
| 101 |
<!-- Mode operators --> |
| 102 |
<!-- Category predicate direct call operator --> |
| 103 |
<!-- Existential quantifier --> |
| 104 |
<AnyChar String = "?@:^" attribute = "Operator" context = "#stay" /> |
| 105 |
<!-- Atoms --> |
| 106 |
<RegExpr String = "\b[a-z]\w*" attribute = "Normal" context = "#stay" /> |
| 107 |
</context> |
| 108 |
|
| 109 |
<context name = "directive" attribute = "Directive" lineEndContext = "#stay" > |
| 110 |
<!-- Conditional compilation directives --> |
| 111 |
<RegExpr String = "\bif(?=[(])" attribute = "Directive" context = "#pop" beginRegion = "CC" /> |
| 112 |
<RegExpr String = "\bendif(?=[.])" attribute = "Directive" context = "#pop" endRegion = "CC" /> |
| 113 |
<RegExpr String = "\belif(?=[(])|\belse(?=[.])" attribute = "Directive" context = "#pop" /> |
| 114 |
<!-- Entity directives --> |
| 115 |
<RegExpr String = "\b(category|object|protocol)(?=[(])" attribute = "Directive" context = "entityrelations" beginRegion = "Entity" /> |
| 116 |
<RegExpr String = "\bend_(category|object|protocol)(?=[.])" attribute = "Directive" context = "#pop" endRegion = "Entity" /> |
| 117 |
<!-- Predicate scope directives --> |
| 118 |
<!-- Other directives --> |
| 119 |
<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" /> |
| 120 |
</context> |
| 121 |
|
| 122 |
<context name = "entityrelations" attribute = "Normal" lineEndContext = "#stay" > |
| 123 |
<RegExpr String = "\b(complements|extends|i(nstantiates|mp(lements|orts))|specializes)(?=[(])" attribute = "Directive" context = "#stay" /> |
| 124 |
<!-- Variables --> |
| 125 |
<RegExpr String = "\b[A-Z_]\w*" attribute = "Variable" context = "#stay" /> |
| 126 |
<!-- Comments --> |
| 127 |
<DetectChar char = "%" attribute = "Comment" context = "single line comment" /> |
| 128 |
<Detect2Chars char = "/" char1 = "*" attribute = "Comment" context = "multiline comment" beginRegion = "Comment" /> |
| 129 |
<!-- Strings and quoted atoms --> |
| 130 |
<DetectChar char = """ attribute = "String" context = "string" /> |
| 131 |
<DetectChar char = "'" attribute = "String" context = "atom" /> |
| 132 |
<!-- Numbers --> |
| 133 |
<RegExpr String = "0'\\?.|0b[0-1]+|0o[0-7]+|0x[0-9a-fA-F]+|\d+(\.\d+)?([eE]([-+])?\d+)?" attribute = "Number" context = "#stay" /> |
| 134 |
<!-- Scope operator --> |
| 135 |
<Detect2Chars char = ":" char1 = ":" attribute = "Operator" context = "#stay" /> |
| 136 |
<!-- End of entity-opening directive --> |
| 137 |
<Detect2Chars attribute = "Normal" context = "normal" char = ")" char1 = "." /> |
| 138 |
</context> |
| 139 |
|
| 140 |
<context name = "single line comment" attribute = "Comment" lineEndContext = "#pop"> |
| 141 |
<DetectSpaces /> |
| 142 |
<IncludeRules context="##Comments" /> |
| 143 |
</context> |
| 144 |
|
| 145 |
<context name = "multiline comment" attribute = "Comment" lineEndContext = "#stay" > |
| 146 |
<Detect2Chars char = "*" char1 = "/" attribute = "Comment" context = "#pop" endRegion = "Comment" /> |
| 147 |
<DetectSpaces /> |
| 148 |
<IncludeRules context="##Comments" /> |
| 149 |
</context> |
| 150 |
|
| 151 |
<context name = "string" attribute = "String" lineEndContext = "#stay" > |
| 152 |
<DetectChar char = """ attribute = "String" context = "#pop" /> |
| 153 |
</context> |
| 154 |
|
| 155 |
<context name = "atom" attribute = "String" lineEndContext = "#stay" > |
| 156 |
<RegExpr attribute="String Char" context="#stay" String="\\x[a-fA-F0-9]+\\|\\[0-7]+\\"/> |
| 157 |
<HlCStringChar attribute="String Char" context="#stay"/> |
| 158 |
<DetectChar char = "'" attribute = "String" context = "#pop" /> |
| 159 |
</context> |
| 160 |
|
| 161 |
</contexts> |
| 162 |
|
| 163 |
<itemDatas> |
| 164 |
<itemData name = "Normal" defStyleNum = "dsNormal" /> |
| 165 |
<itemData name = "Directive" defStyleNum = "dsKeyword" /> |
| 166 |
<itemData name = "Built-in" defStyleNum = "dsFunction" /> |
| 167 |
<itemData name = "Operator" defStyleNum = "dsDataType" /> |
| 168 |
<itemData name = "Comment" defStyleNum = "dsComment" /> |
| 169 |
<itemData name = "Number" defStyleNum = "dsDecVal" /> |
| 170 |
<itemData name = "String" defStyleNum = "dsString" /> |
| 171 |
<itemData name="String Char" defStyleNum="dsSpecialChar" spellChecking="false"/> |
| 172 |
<itemData name = "Variable" defStyleNum = "dsOthers" /> |
| 173 |
</itemDatas> |
| 174 |
|
| 175 |
</highlighting> |
| 176 |
|
| 177 |
<general> |
| 178 |
<comments> |
| 179 |
<comment name = "singleLine" start = "%" position = "afterwhitespace" /> |
| 180 |
<comment name = "multiLine" start = "/*" end = "*/" region = "Comment" /> |
| 181 |
</comments> |
| 182 |
<keywords casesensitive="true" /> |
| 183 |
</general> |
| 184 |
|
| 185 |
</language> |
| 186 |
<!-- kate: replace-tabs off; --> |