Module syntax

For debugging purposes it might be necessary to access syntax operators that are not accessible from the top-level by the module system visibility rules. We provide predicates that allow direct access.

The directly accessible syntax operators can be tested and enumerated by the predicate current_syntax/1. The predicates syntax_property/2, set_syntax_property/2 and reset_syntax_property/2 are responsible are responsible for accessing and modifying properties of directly accessible syntax operators.

The following syntax access predicates are supported:

current_syntax(P):
The predicate succeeds for each directly accessible syntax operator P.
syntax_property(O, Q):
The predicate succeeds for the properties Q of the syntax operator O. The predi-cate will also try to access invisible syntax operators.
set_syntax_property(O, Q):
The predicate assigns the property Q to the syntax operator O. The predicate will also try to access invisible syntax operators.
reset_syntax_property(O, Q):
The predicate deassigns the property Q from the syntax operator O. The predicate will also try to access invisible syntax operators.

The following source properties for the module syntax are provided:

sys_first_location(I, O, L):
The property indicates that the source context has first predicates occurence for the indicator I, file origin O and line number L. The property is multi valued or can be missing. The property cannot directly be changed.
sys_location(I, O, L):
Same as sys_first_location/3 except that not only the first occurrence for each predicate is listed but that all occurences are listed.

Kommentare