Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % BNF description include operator <term>+ TO mark zero OR more replacements.
- % This DCG extension TO overcome this.
- oneOrMore(W, [R|Rs], A, C) :- call(W, R, A, B), (
- oneOrMore(W, Rs, B, C)
- ;
- (Rs = [] , C = B)
- ).
- % BNF operator <term>*
- zeroOrMore(W, R) --> oneOrMore(W, R).
- zeroOrMore(_, []) --> [].
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement