Skip to content

Commit

Permalink
changes prior to release
Browse files Browse the repository at this point in the history
  • Loading branch information
Anniepoo committed May 18, 2013
1 parent e66953b commit 0dc64bd
Show file tree
Hide file tree
Showing 11 changed files with 166 additions and 614 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
swipldcgtut
===========

A tutorial for DCG's in swi-Prolog
A tutorial for DCG's in swi-Prolog

this tutorial is available on the web at

http://www.pathwayslms.com/swipltuts/dcg/index.html

These files contain some examples to accompany the tutorial.


202 changes: 0 additions & 202 deletions carlo/pure_input.pl

This file was deleted.

41 changes: 0 additions & 41 deletions carlo/test_pio.pl

This file was deleted.

2 changes: 1 addition & 1 deletion dcg1_1.pl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
% DCG that recognizes a list of a's
as --> [].
as --> [a], as.

%
% Run by querying
% ?- phrase(as, Ls).

4 changes: 4 additions & 0 deletions dcg1_2.pl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
% double quoted strings are just lists of UTF-8 codes,
% so they're terminals too
cliche -->
thing,
" is a ",
Expand All @@ -9,8 +11,10 @@
type_of_thing --> "Unix OS".
opposite_type_of_thing --> "Windows'".

% query try_literals. to see cliches
try_literals :- phrase(cliche, X),format('~s~n', [X]).

% you can unify arguments, just like normal prolog predicates
fizz_buzz(Msg) --> anything, fizz(Msg), anything, buzz, anything.
anything --> [].
anything --> [_], anything.
Expand Down
Loading

0 comments on commit 0dc64bd

Please sign in to comment.