42aabce1bb
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1973 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
768 lines
24 KiB
HTML
768 lines
24 KiB
HTML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
|
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
|
|
|
<head>
|
|
<meta http-equiv="content-type" content="application/xml+xhtml; charset=utf-8" />
|
|
<title>Logtalk reference manual: grammar</title>
|
|
<link rel="stylesheet" href="../screen.css" type="text/css" media="screen"/>
|
|
<link rel="stylesheet" href="../print.css" type="text/css" media="print"/>
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div class="top-left">Logtalk reference manual</div>
|
|
<div class="top-right">Grammar</div>
|
|
<div class="bottom-left"><span class="page"/></div>
|
|
<div class="bottom-right"><span class="page"/></div>
|
|
<div class="navtop"><a href="../index.html">contents</a> > <a href="index.html">reference manual</a></div>
|
|
|
|
<h1 id="grammar_grammar">Grammar</h1>
|
|
|
|
<p>
|
|
The Logtalk grammar is here described using Backus-Naur Form syntax. Non-terminal symbols in <i>italics</i> have the definition found in the ISO Prolog Standard. Terminal symbols are represented in a <code>fixed width font</code> and between "".
|
|
</p>
|
|
|
|
|
|
<h2 id="grammar_compilation_units">Compilation units</h2>
|
|
|
|
<dl>
|
|
<dt>entity ::=</dt>
|
|
<dd>object |</dd>
|
|
<dd>category |</dd>
|
|
<dd>protocol</dd>
|
|
</dl>
|
|
|
|
<h2 id="grammar_object_definition">Object definition</h2>
|
|
|
|
<dl>
|
|
<dt>object ::=</dt>
|
|
<dd>begin_object_directive [object_directives] [clauses] end_object_directive.</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>begin_object_directive ::=</dt>
|
|
<dd>"<code>:- object(</code>" object_identifier [ "<code>,</code>" object_relations] "<code>).</code>"</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>end_object_directive ::=</dt>
|
|
<dd>"<code>:- end_object.</code>"</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>object_relations ::=</dt>
|
|
<dd>prototype_relations |</dd>
|
|
<dd>non_prototype_relations</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>prototype_relations ::=</dt>
|
|
<dd>prototype_relation |</dd>
|
|
<dd>prototype_relation "<code>,</code>" prototype_relations</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>prototype_relation ::=</dt>
|
|
<dd>implements_protocols |</dd>
|
|
<dd>imports_categories |</dd>
|
|
<dd>extends_objects</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>non_prototype_relations ::=</dt>
|
|
<dd>non_prototype_relation |</dd>
|
|
<dd>non_prototype_relation "<code>,</code>" non_prototype_relations</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>non_prototype_relation ::=</dt>
|
|
<dd>implements_protocols |</dd>
|
|
<dd>imports_categories |</dd>
|
|
<dd>instantiates_classes |</dd>
|
|
<dd>specializes_classes</dd>
|
|
</dl>
|
|
|
|
|
|
<h2 id="grammar_category_definition">Category definition</h2>
|
|
|
|
<dl>
|
|
<dt>category ::=</dt>
|
|
<dd>begin_category_directive [category_directives] [clauses] end_category_directive.</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>begin_category_directive ::=</dt>
|
|
<dd>"<code>:- category(</code>" category_identifier [ "<code>,</code>" category_relations] "<code>).</code>"</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>end_category_directive ::=</dt>
|
|
<dd>"<code>:- end_category.</code>"</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>category_relations ::=</dt>
|
|
<dd>category_relation |</dd>
|
|
<dd>category_relation "<code>,</code>" category_relations</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>category_relation ::=</dt>
|
|
<dd>implements_protocols |</dd>
|
|
<dd>imports_categories</dd>
|
|
</dl>
|
|
|
|
|
|
<h2 id="grammar_protocol_definition">Protocol definition</h2>
|
|
|
|
<dl>
|
|
<dt>protocol ::=</dt>
|
|
<dd>begin_protocol_directive [protocol_directives] end_protocol_directive.</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>begin_protocol_directive ::=</dt>
|
|
<dd>"<code>:- protocol(</code>" protocol_identifier [ "<code>,</code>" extends_protocols] "<code>).</code>"</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>end_protocol_directive ::=</dt>
|
|
<dd>"<code>:- end_protocol.</code>"</dd>
|
|
</dl>
|
|
|
|
|
|
<h2 id="grammar_entity_relations">Entity relations</h2>
|
|
|
|
<dl>
|
|
<dt>implements_protocols ::=</dt>
|
|
<dd>"<code>implements(</code>" implemented_protocols "<code>)</code>"</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>extends_protocols ::=</dt>
|
|
<dd>"<code>extends(</code>" extended_protocols "<code>)</code>"</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>imports_categories ::=</dt>
|
|
<dd>"<code>imports(</code>" imported_categories "<code>)</code>"</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>extends_objects ::=</dt>
|
|
<dd>"<code>extends(</code>" extended_objects "<code>)</code>"</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>instantiates_classes ::=</dt>
|
|
<dd>"<code>instantiates(</code>" instantiated_objects "<code>)</code>"</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>specializes_classes ::=</dt>
|
|
<dd>"<code>specializes(</code>" specialized_objects "<code>)</code>"</dd>
|
|
</dl>
|
|
|
|
<h3 id="grammar_implemented_protocols">Implemented protocols</h3>
|
|
<dl>
|
|
<dt>implemented_protocols ::=</dt>
|
|
<dd>implemented_protocol |</dd>
|
|
<dd>implemented_protocol_sequence |</dd>
|
|
<dd>implemented_protocol_list</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>implemented_protocol ::=</dt>
|
|
<dd>protocol_identifier |</dd>
|
|
<dd>scope "<code>::</code>" protocol_identifier</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>implemented_protocol_sequence ::=</dt>
|
|
<dd>implemented_protocol |</dd>
|
|
<dd>implemented_protocol "<code>,</code>" implemented_protocol_sequence</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>implemented_protocol_list ::=</dt>
|
|
<dd>"<code>[</code>" implemented_protocol_sequence "<code>]</code>"</dd>
|
|
</dl>
|
|
|
|
<h3 id="grammar_extended_protocols">Extended protocols</h3>
|
|
<dl>
|
|
<dt>extended_protocols ::=</dt>
|
|
<dd>extended_protocol |</dd>
|
|
<dd>extended_protocol_sequence |</dd>
|
|
<dd>extended_protocol_list</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>extended_protocol ::=</dt>
|
|
<dd>protocol_identifier |</dd>
|
|
<dd>scope "<code>::</code>" protocol_identifier</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>extended_protocol_sequence ::=</dt>
|
|
<dd>extended_protocol |</dd>
|
|
<dd>extended_protocol "<code>,</code>" extended_protocol_sequence</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>extended_protocol_list ::=</dt>
|
|
<dd>"<code>[</code>" extended_protocol_sequence "<code>]</code>"</dd>
|
|
</dl>
|
|
|
|
<h3 id="grammar_imported_categories">Imported categories</h3>
|
|
<dl>
|
|
<dt>imported_categories ::=</dt>
|
|
<dd>imported_category |</dd>
|
|
<dd>imported_category_sequence |</dd>
|
|
<dd>imported_category_list</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>imported_category ::=</dt>
|
|
<dd>category_identifier |</dd>
|
|
<dd>scope "<code>::</code>" category_identifier</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>imported_category_sequence ::=</dt>
|
|
<dd>imported_category |</dd>
|
|
<dd>imported_category "<code>,</code>" imported_category_sequence</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>imported_category_list ::=</dt>
|
|
<dd>"<code>[</code>" imported_category_sequence "<code>]</code>"</dd>
|
|
</dl>
|
|
|
|
<h3 id="grammar_extended_objects">Extended objects</h3>
|
|
<dl>
|
|
<dt>extended_objects ::=</dt>
|
|
<dd>extended_object |</dd>
|
|
<dd>extended_object_sequence |</dd>
|
|
<dd>extended_object_list</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>extended_object ::=</dt>
|
|
<dd>object_identifier |</dd>
|
|
<dd>scope "<code>::</code>" object_identifier</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>extended_object_sequence ::=</dt>
|
|
<dd>extended_object |</dd>
|
|
<dd>extended_object "<code>,</code>" extended_object_sequence</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>extended_object_list ::=</dt>
|
|
<dd>"<code>[</code>" extended_object_sequence "<code>]</code>"</dd>
|
|
</dl>
|
|
|
|
<h3 id="grammar_instantiated_objects">Instantiated objects</h3>
|
|
<dl>
|
|
<dt>instantiated_objects ::=</dt>
|
|
<dd>instantiated_object |</dd>
|
|
<dd>instantiated_object_sequence |</dd>
|
|
<dd>instantiated_object_list</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>instantiated_object ::=</dt>
|
|
<dd>object_identifier |</dd>
|
|
<dd>scope "<code>::</code>" object_identifier</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>instantiated_object_sequence ::=</dt>
|
|
<dd>instantiated_object</dd>
|
|
<dd>instantiated_object "<code>,</code>" instantiated_object_sequence |</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>instantiated_object_list ::=</dt>
|
|
<dd>"<code>[</code>" instantiated_object_sequence "<code>]</code>"</dd>
|
|
</dl>
|
|
|
|
<h3 id="grammar_specialized_objects">Specialized objects</h3>
|
|
<dl>
|
|
<dt>specialized_objects ::=</dt>
|
|
<dd>specialized_object |</dd>
|
|
<dd>specialized_object_sequence |</dd>
|
|
<dd>specialized_object_list</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>specialized_object ::=</dt>
|
|
<dd>object_identifier |</dd>
|
|
<dd>scope "<code>::</code>" object_identifier</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>specialized_object_sequence ::=</dt>
|
|
<dd>specialized_object |</dd>
|
|
<dd>specialized_object "<code>,</code>" specialized_object_sequence</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>specialized_object_list ::=</dt>
|
|
<dd>"<code>[</code>" specialized_object_sequence "<code>]</code>"</dd>
|
|
</dl>
|
|
|
|
<h3 id="grammar_scope">Entity scope</h3>
|
|
<dl>
|
|
<dt>scope ::=</dt>
|
|
<dd>"<code>public</code>" |</dd>
|
|
<dd>"<code>protected</code>" |</dd>
|
|
<dd>"<code>private</code>"</dd>
|
|
</dl>
|
|
|
|
|
|
<h2 id="grammar_entity_identifiers">Entity identifiers</h2>
|
|
|
|
<dl>
|
|
<dt>entity_identifiers ::=</dt>
|
|
<dd>entity_identifier |</dd>
|
|
<dd>entity_identifier_sequence |</dd>
|
|
<dd>entity_identifier_list</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>entity_identifier ::=</dt>
|
|
<dd>object_identifier |</dd>
|
|
<dd>protocol_identifier |</dd>
|
|
<dd>category_identifier</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>entity_identifier_sequence ::=</dt>
|
|
<dd>entity_identifier |</dd>
|
|
<dd>entity_identifier "<code>,</code>" entity_identifier_sequence</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>entity_identifier_list ::=</dt>
|
|
<dd>"<code>[</code>" entity_identifier_sequence "<code>]</code>"</dd>
|
|
</dl>
|
|
|
|
<h3 id="grammar_object_identifiers">Object identifiers</h3>
|
|
<dl>
|
|
<dt>object_identifiers ::=</dt>
|
|
<dd>object_identifier |</dd>
|
|
<dd>object_identifier_sequence |</dd>
|
|
<dd>object_identifier_list</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>object_identifier ::=</dt>
|
|
<dd><i>atom</i> |</dd>
|
|
<dd><i>compound</i></dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>object_identifier_sequence ::=</dt>
|
|
<dd>object_identifier |</dd>
|
|
<dd>object_identifier "<code>,</code>" object_identifier_sequence</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>object_identifier_list ::=</dt>
|
|
<dd>"<code>[</code>" object_identifier_sequence "<code>]</code>"</dd>
|
|
</dl>
|
|
|
|
<h3 id="grammar_category_identifiers">Category identifiers</h3>
|
|
<dl>
|
|
<dt>category_identifiers ::=</dt>
|
|
<dd>category_identifier |</dd>
|
|
<dd>category_identifier_sequence |</dd>
|
|
<dd>category_identifier_list</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>category_identifier ::=</dt>
|
|
<dd><i>atom</i></dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>category_identifier_sequence ::=</dt>
|
|
<dd>category_identifier |</dd>
|
|
<dd>category_identifier "<code>,</code>" category_identifier_sequence</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>category_identifier_list ::=</dt>
|
|
<dd>"<code>[</code>" category_identifier_sequence "<code>]</code>"</dd>
|
|
</dl>
|
|
|
|
<h3 id="grammar_protocol_identifiers">Protocol identifiers</h3>
|
|
<dl>
|
|
<dt>protocol_identifiers ::=</dt>
|
|
<dd>protocol_identifier |</dd>
|
|
<dd>protocol_identifier_sequence |</dd>
|
|
<dd>protocol_identifier_list</dd>
|
|
</dl>
|
|
<dl>
|
|
|
|
<dt>protocol_identifier ::=</dt>
|
|
<dd><i>atom</i></dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>protocol_identifier_sequence ::=</dt>
|
|
<dd>protocol_identifier |</dd>
|
|
<dd>protocol_identifier "<code>,</code>" protocol_identifier_sequence</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>protocol_identifier_list ::=</dt>
|
|
<dd>"<code>[</code>" protocol_identifier_sequence "<code>]</code>"</dd>
|
|
</dl>
|
|
|
|
|
|
<h2 id="grammar_source_file_names">Source file names</h2>
|
|
|
|
<dl>
|
|
<dt>source_file_names ::=</dt>
|
|
<dd>source_file_name |</dd>
|
|
<dd>source_file_name_list</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>source_file_name ::=</dt>
|
|
<dd><em>atom</em> |</dd>
|
|
<dd>library_source_file_name</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>library_source_file_name ::=</dt>
|
|
<dd>library_name "<code>(</code>" <em>atom</em> "<code>)</code>"</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>library_name ::=</dt>
|
|
<dd><em>atom</em></dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>source_file_name_sequence ::=</dt>
|
|
<dd>source_file_name |</dd>
|
|
<dd>source_file_name "<code>,</code>" source_file_name_sequence</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>source_file_name_list ::=</dt>
|
|
<dd>"<code>[</code>" source_file_name_sequence "<code>]</code>"</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
<h2 id="grammar_directives">Directives</h2>
|
|
|
|
<h3 id="grammar_source_file_directives">Source file directives</h3>
|
|
<dl>
|
|
<dt>source_file_directives ::=</dt>
|
|
<dd>source_file_directive |</dd>
|
|
<dd>source_file_directive source_file_directives</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>source_file_directive ::=</dt>
|
|
<dd>"<code>:- encoding(</code>" <i>atom</i> "<code>).</code>" |</dd>
|
|
<dd><i>initialization_directive</i> |</dd>
|
|
<dd><i>operator_directive</i></dd>
|
|
</dl>
|
|
|
|
<h3 id="grammar_object_directives">Object directives</h3>
|
|
<dl>
|
|
<dt>object_directives ::=</dt>
|
|
<dd>object_directive |</dd>
|
|
<dd>object_directive object_directives</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>object_directive ::=</dt>
|
|
<dd><i>initialization_directive</i> |</dd>
|
|
<dd>"<code>:- threaded.</code>" |</dd>
|
|
<dd>"<code>:- synchronized.</code>" |</dd>
|
|
<dd>"<code>:- dynamic.</code>" |</dd>
|
|
<dd>"<code>:- uses(</code>" object_identifier "<code>).</code>" |</dd>
|
|
<dd>"<code>:- calls(</code>" protocol_identifiers "<code>).</code>" |</dd>
|
|
<dd>"<code>:- info(</code>" info_list "<code>).</code>" |</dd>
|
|
<dd>predicate_directives</dd>
|
|
</dl>
|
|
|
|
<h3 id="grammar_category_directives">Category directives</h3>
|
|
<dl>
|
|
<dt>category_directives ::=</dt>
|
|
<dd>category_directive |</dd>
|
|
<dd>category_directive category_directives</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>category_directive ::=</dt>
|
|
<dd><i>initialization_directive</i> |</dd>
|
|
<dd>"<code>:- synchronized.</code>" |</dd>
|
|
<dd>"<code>:- dynamic.</code>" |</dd>
|
|
<dd>"<code>:- uses(</code>" object_identifier "<code>).</code>" |</dd>
|
|
<dd>"<code>:- calls(</code>" protocol_identifiers "<code>).</code>" |</dd>
|
|
<dd>"<code>:- info(</code>" info_list "<code>).</code>" |</dd>
|
|
<dd>predicate_directives</dd>
|
|
</dl>
|
|
|
|
<h3 id="grammar_protocol_directives">Protocol directives</h3>
|
|
<dl>
|
|
<dt>protocol_directives ::=</dt>
|
|
<dd>protocol_directive |</dd>
|
|
<dd>protocol_directive protocol_directives</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>protocol_directive ::=</dt>
|
|
<dd><i>initialization_directive</i> |</dd>
|
|
<dd>"<code>:- dynamic.</code>" |</dd>
|
|
<dd>"<code>:- info(</code>" info_list "<code>).</code>" |</dd>
|
|
<dd>predicate_directives</dd>
|
|
</dl>
|
|
|
|
<h3 id="grammar_predicate_directives">Predicate directives</h3>
|
|
<dl>
|
|
<dt>predicate_directives ::=</dt>
|
|
<dd>predicate_directive |</dd>
|
|
<dd>predicate_directive predicate_directives</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>predicate_directive ::=</dt>
|
|
<dd>alias_directive |</dd>
|
|
<dd>synchronized_directive |</dd>
|
|
<dd>uses_directive |</dd>
|
|
<dd>scope_directive |</dd>
|
|
<dd>mode_directive |</dd>
|
|
<dd>meta_predicate_directive |</dd>
|
|
<dd>info_directive |</dd>
|
|
<dd>dynamic_directive |</dd>
|
|
<dd>discontiguous_directive |</dd>
|
|
<dd><i>operator_directive</i></dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>alias_directive ::=</dt>
|
|
<dd>"<code>:- alias(</code>" entity_identifier "<code>,</code>" predicate_indicator "<code>,</code>" predicate_indicator "<code>).</code>" |</dd>
|
|
<dd>"<code>:- alias(</code>" entity_identifier "<code>,</code>" non_terminal_indicator "<code>,</code>" non_terminal_indicator "<code>).</code>"</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>synchronized_directive ::=</dt>
|
|
<dd>"<code>:- synchronized(</code>" predicate_indicator "<code>).</code>" |</dd>
|
|
<dd>"<code>:- synchronized(</code>" non_terminal_indicator "<code>).</code>"</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>uses_directive ::=</dt>
|
|
<dd>"<code>:- uses(</code>" object_identifier "<code>,</code>" predicate_indicator_alias_list "<code>).</code>"</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>scope_directive ::=</dt>
|
|
<dd>"<code>:- public(</code>" predicate_indicator_term | non_terminal_indicator_term "<code>).</code>" |</dd>
|
|
<dd>"<code>:- protected(</code>" predicate_indicator_term | non_terminal_indicator_term "<code>).</code>" |</dd>
|
|
<dd>"<code>:- private(</code>" predicate_indicator_term | non_terminal_indicator_term "<code>).</code>"</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>mode_directive ::=</dt>
|
|
<dd>"<code>:- mode(</code>" predicate_mode_term | non_terminal_mode_term "<code>,</code>" number_of_solutions "<code>).</code>"</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>meta_predicate_directive ::=</dt>
|
|
<dd>"<code>:- meta_predicate(</code>" meta_predicate_mode_indicator "<code>).</code>"</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>info_directive ::=</dt>
|
|
<dd>"<code>:- info(</code>" predicate_indicator | non_terminal_indicator "<code>,</code>" info_list "<code>).</code>"</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>dynamic_directive ::=</dt>
|
|
<dd>"<code>:- dynamic(</code>" predicate_indicator_term | non_terminal_indicator_term "<code>).</code>" |</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>discontiguous_directive ::=</dt>
|
|
<dd>"<code>:- discontiguous(</code>" predicate_indicator_term | non_terminal_indicator_term "<code>).</code>" |</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>predicate_indicator_term ::=</dt>
|
|
<dd><i>predicate_indicator</i> |</dd>
|
|
<dd>predicate_indicator_sequence |</dd>
|
|
<dd>predicate_indicator_list</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>predicate_indicator_sequence ::=</dt>
|
|
<dd><i>predicate_indicator</i> |</dd>
|
|
<dd><i>predicate_indicator</i> "<code>,</code>" predicate_indicator_sequence</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>predicate_indicator_list ::=</dt>
|
|
<dd>"<code>[</code>" predicate_indicator_sequence "<code>]</code>"</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>predicate_indicator_alias ::=</dt>
|
|
<dd><i>predicate_indicator</i> |</dd>
|
|
<dd><i>predicate_indicator</i> "<code>::</code>" <i>predicate_indicator</i></dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>predicate_indicator_alias_sequence ::=</dt>
|
|
<dd>predicate_indicator_alias |</dd>
|
|
<dd>predicate_indicator_alias "<code>,</code>" predicate_indicator_alias_sequence</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>predicate_indicator_alias_list ::=</dt>
|
|
<dd>"<code>[</code>" predicate_indicator_alias_sequence "<code>]</code>"</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>non_terminal_indicator_term ::=</dt>
|
|
<dd>non_terminal_indicator |</dd>
|
|
<dd>non_terminal_indicator_sequence |</dd>
|
|
<dd>non_terminal_indicator_list</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>non_terminal_indicator_sequence ::=</dt>
|
|
<dd>non_terminal_indicator |</dd>
|
|
<dd>non_terminal_indicator "<code>,</code>" non_terminal_indicator_sequence</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>non_terminal_indicator_list ::=</dt>
|
|
<dd>"<code>[</code>" non_terminal_indicator_sequence "<code>]</code>"</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>non_terminal_indicator ::=</dt>
|
|
<dd><i>functor</i> "<code>//</code>" <i>arity</i></dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>predicate_mode_term ::=</dt>
|
|
<dd><i>atom</i> "<code>(</code>" mode_terms "<code>)</code>"</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>non_terminal_mode_term ::=</dt>
|
|
<dd><i>atom</i> "<code>(</code>" mode_terms "<code>)</code>"</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>mode_terms ::=</dt>
|
|
<dd>mode_term |</dd>
|
|
<dd>mode_term "<code>,</code>" mode_terms</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>mode_term ::=</dt>
|
|
<dd>"<code>@</code>" [type] | "<code>+</code>" [type] | "<code>-</code>" [type] | "<code>?</code>" [type]</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>type ::=</dt>
|
|
<dd>prolog_type | logtalk_type | user_defined_type</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>prolog_type ::=</dt>
|
|
<dd>"<code>term</code>" | "<code>nonvar</code>" | "<code>var</code>" |</dd>
|
|
<dd>"<code>compound</code>" | "<code>ground</code>" | "<code>callable</code>" | "<code>list</code>" |</dd>
|
|
<dd>"<code>atomic</code>" | "<code>atom</code>" |</dd>
|
|
<dd>"<code>number</code>" | "<code>integer</code>" | "<code>float</code>"</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>logtalk_type ::=</dt>
|
|
<dd>"<code>object</code>" | "<code>category</code>" | "<code>protocol</code>" |</dd>
|
|
<dd>"<code>event</code>"</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>user_defined_type ::=</dt>
|
|
<dd><i>atom</i> |</dd>
|
|
<dd><i>compound</i></dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>number_of_solutions ::=</dt>
|
|
<dd>"<code>zero</code>" | "<code>zero_or_one</code>" | "<code>zero_or_more</code>" | "<code>one</code>" | "<code>one_or_more</code>" | "<code>error</code>"</dd>
|
|
</dl>
|
|
<dl id="grammar_meta_predicate_mode_indicator">
|
|
<dt>meta_predicate_mode_indicator ::=</dt>
|
|
<dd><i>atom</i> "<code>(</code>" meta_predicate_terms "<code>)</code>"</dd>
|
|
</dl>
|
|
<dl id="grammar_meta_predicate_terms">
|
|
<dt>meta_predicate_terms ::=</dt>
|
|
<dd>meta_predicate_term |</dd>
|
|
<dd>meta_predicate_term "<code>,</code>" meta_predicate_terms</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>meta_predicate_term ::=</dt>
|
|
<dd>"<code>::</code>" | "<code>*</code>" | <i>integer</i></dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>info_list ::=</dt>
|
|
<dd>"<code>[]</code>" |</dd>
|
|
<dd>"<code>[</code>" info_item "<code>is</code>" <i>nonvar</i> "<code>|</code>" info_list "<code>]</code>"</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>info_item ::=</dt>
|
|
<dd>"<code>comment</code>" | "<code>remarks</code>" | </dd>
|
|
<dd>"<code>author</code>" | "<code>version</code>" | "<code>date</code>" | </dd>
|
|
<dd>"<code>copyright</code>" | "<code>license</code>" | </dd>
|
|
<dd>"<code>parameters</code>" | "<code>parnames</code>" | </dd>
|
|
<dd>"<code>arguments</code>" | "<code>argnames</code>" | </dd>
|
|
<dd>"<code>definition</code>" | "<code>redefinition</code>" | "<code>allocation</code>" |</dd>
|
|
<dd>"<code>examples</code>" | "<code>exceptions</code>" | </dd>
|
|
<dd><i>atom</i></dd>
|
|
</dl>
|
|
|
|
|
|
<h2 id="grammar_clauses">Clauses and goals</h2>
|
|
|
|
<dl>
|
|
<dt>goal ::=</dt>
|
|
<dd>message_call |</dd>
|
|
<dd>external_call |</dd>
|
|
<dd><i>callable</i></dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>message_call ::=</dt>
|
|
<dd>message_to_object |</dd>
|
|
<dd>message_to_self |</dd>
|
|
<dd>message_to_super</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>message_to_object ::=</dt>
|
|
<dd>receivers "<code>::</code>" messages</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>message_to_self ::=</dt>
|
|
<dd>"<code>::</code>" messages</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>message_to_super ::=</dt>
|
|
<dd>"<code>^^</code>" message</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>messages ::=</dt>
|
|
<dd>message |</dd>
|
|
<dd>"<code>(</code>" message "<code>,</code>" messages "<code>)</code>" |</dd>
|
|
<dd>"<code>(</code>" message "<code>;</code>" messages "<code>)</code>"</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>message ::=</dt>
|
|
<dd><i>callable</i> |</dd>
|
|
<dd><i>variable</i></dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>receivers ::=</dt>
|
|
<dd>receiver |</dd>
|
|
<dd>"<code>(</code>" receiver "<code>,</code>" receivers "<code>)</code>" |</dd>
|
|
<dd>"<code>(</code>" receiver "<code>;</code>" receivers "<code>)</code>"</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>receiver ::=</dt>
|
|
<dd>object_identifier |</dd>
|
|
<dd><i>variable</i></dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>external_call ::=</dt>
|
|
<dd>"<code>{</code>" <i>callable</i> "<code>}</code>"</dd>
|
|
</dl>
|
|
|
|
<h2 id="grammar_entity_properties">Entity properties</h2>
|
|
|
|
<dl>
|
|
<dt id="grammar_category_property">category_property ::=</dt>
|
|
<dd>"<code>static</code>" |</dd>
|
|
<dd>"<code>dynamic</code>" |</dd>
|
|
<dd>"<code>built_in</code>" |</dd>
|
|
<dd>"<code>synchronized</code>"</dd>
|
|
</dl>
|
|
<dl id="grammar_object_property">
|
|
<dt>object_property ::=</dt>
|
|
<dd>"<code>static</code>" |</dd>
|
|
<dd>"<code>dynamic</code>" |</dd>
|
|
<dd>"<code>built_in</code>" |</dd>
|
|
<dd>"<code>synchronized</code>" |</dd>
|
|
<dd>"<code>threaded</code>"</dd>
|
|
</dl>
|
|
<dl id="grammar_protocol_property">
|
|
<dt>protocol_property ::=</dt>
|
|
<dd>"<code>static</code>" |</dd>
|
|
<dd>"<code>dynamic</code>" |</dd>
|
|
<dd>"<code>built_in</code>"</dd>
|
|
</dl>
|
|
|
|
|
|
<h2 id="grammar_predicate_properties">Predicate properties</h2>
|
|
|
|
<dl>
|
|
<dt>predicate_property ::=</dt>
|
|
<dd>"<code>static</code>" |</dd>
|
|
<dd>"<code>dynamic</code>" |</dd>
|
|
<dd>"<code>private</code>" |</dd>
|
|
<dd>"<code>protected</code>" |</dd>
|
|
<dd>"<code>public</code>" |</dd>
|
|
<dd>"<code>synchronized</code>" |</dd>
|
|
<dd>"<code>built_in</code>" |</dd>
|
|
<dd>"<code>declared_in(</code>" entity_identifier "<code>)</code>" |</dd>
|
|
<dd>"<code>defined_in(</code>" object_identifier | category_identifier "<code>)</code>" |</dd>
|
|
<dd>"<code>meta_predicate(</code>" meta_predicate_mode_indicator "<code>)</code>" |</dd>
|
|
<dd>"<code>alias(</code>" callable "<code>)</code>" |</dd>
|
|
<dd>"<code>non_terminal(</code>" non_terminal_indicator "<code>)</code>"</dd>
|
|
</dl>
|
|
|
|
<div class="footer">
|
|
<div class="copyright">
|
|
<span>Copyright © <a href="mailto:pmoura@logtalk.org">Paulo Moura</a> — <a href="http://logtalk.org">Logtalk.org</a></span><br/>
|
|
<span>Last updated on: April 14, 2007</span>
|
|
</div>
|
|
<div class="navbottom">
|
|
<span><a href="index.html">previous</a> | <a href="../glossary.html">glossary</a> | <a href="index.html">next</a></span><br/>
|
|
<span><a href="http://validator.w3.org/check/referer">XHTML</a> + <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a></span>
|
|
</div>
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html>
|