doc_modes.pl -- Analyse PlDoc mode declarations
This module analyzes the formal part of the documentation of a predicate. The formal part is processed by read_term/3 using the operator declarations in this module.
- process_modes(+Lines:lines, +Module, +FilePos, -Modes:list, -Args:list(atom), -RestLines:lines) is det
- Process the formal header lines (upto the first blank line), returning the remaining lines and the names of the arguments used in the various header lines.
- compile_mode(+Mode, -Compiled) is det
- Compile a PlDoc mode declararion into a term
mode(Head, Determinism)
. - mode(:Head, ?Det) is nondet
- True if there is a mode-declaration for Head with Det.
- is_mode(@Head) is semidet
- True if Head is a valid mode-term.
- mode_indicator(?Ind:atom) is nondet
- Our defined argument-mode indicators
- modes_to_predicate_indicators(+Modes:list, -PI:list) is det
- Create a list of predicate indicators represented by Modes. Each predicate indicator is of the form atom/integer for normal predicates or atom//integer for DCG rules.
- compile_clause(:Term, +FilePos) is det
- Add a clause to the compiled program. Unlike assert/1, this associates the clause with the given source-location, makes it static code and removes the clause if the file is reloaded. Finally, as we create clauses one-by-one, we define our predicates as discontiguous.