Go to the first, previous, next, last section, table of contents.


Extending the syntax

Author(s): Daniel Cabeza.

Version: 1.11#222 (2004/5/24, 13:8:7 CEST)

Version of last change: 1.11#71 (2003/12/19, 16:54:53 CET)

This chapter documents the builtin directives in Ciao for extending the syntax of source files. Note that the ISO-Prolog directive char_conversion/2 is not implemented, since Ciao does not (yet) have a character conversion table.

Usage and interface (syntax_extensions)

Documentation on internals (syntax_extensions)

DECLARATION: op/3:

Usage: :- op(Priority, Op_spec, Operator). * ISO *

DECLARATION: new_declaration/1:

Usage: :- new_declaration(Predicate).

DECLARATION: new_declaration/2:

Usage: :- new_declaration(Predicate, In_Itf).

DECLARATION: load_compilation_module/1:

Usage: :- load_compilation_module(File).

DECLARATION: add_sentence_trans/1:

Usage: :- add_sentence_trans(Predicate).

DECLARATION: add_term_trans/1:

Usage: :- add_term_trans(P).

DECLARATION: add_goal_trans/1:

Usage: :- add_goal_trans(Predicate).

DECLARATION: add_clause_trans/1:

Usage: :- add_clause_trans(Predicate).

REGTYPE: translation_predname/1:

A translation predicate is a predicate of arity 2 or 3 used to make compile-time translations. The compiler invokes a translation predicate instantiating its first argument with the item to be translated, and if the predicate is of arity 3 its third argument with the name of the module where the translation is done. If the call is successful, the second argument is used as if that item were in the place of the original, else the original item is used.

Usage: translation_predname(P)


Go to the first, previous, next, last section, table of contents.