possible (library)

Author(s): Göran Smedbäck.

Usage and interface

Documentation on exports

PREDICATE

Usage:continue(RuleName,L,T)

The predicate will check the rule name's possible followers, that is the entrance in the grammar, to see if we have the possibility to contiue the generation in the asked direction. We will by using the DCG look one item ahead to see if we have the proper key name ahead. Then we check the possible alternatives for the rule name from the list and type we receive from the call to possible. As we can see there are different look ahead predicates depending if we have a token or a word, looking on the structure name(token name) or if we should read the first word beyond the structure name.

  • Call and exit should be compatible with:
    (basic_props:atm/1)RuleName is an atom.
    (basic_props:list/1)L is a list.
    (basic_props:list/1)T is a list.
  • The following properties should hold at call time:
    (term_typing:nonvar/1)RuleName is currently a term which is not a free variable.