| |||||||||||
| リストの入力記号で文法規則をコールする。
phrase(+項, +リスト)phrase/2 は、リストにリストされた入力記号で文法規則 項 をコールする。
引数
項 項 リスト 記号のリスト
例
polish(Stack, Result) -->
[X], {integer(X)}, polish([X|Stack], Result).
polish([Y,X|Stack], Result) -->
[(+)], {Z is X+Y}, polish([Z|Stack], Result).
polish([Y,X|Stack], Result) -->
[(-)], {Z is X-Y}, polish([Z|Stack], Result).
polish([Z], Z) -->
[].
標準
この述語は、ISO-Prolog 標準には含まれない。
関連 | |||||||||||
| |||||||||||
| 戻る> |
|