~ubuntu-branches/ubuntu/breezy/malaga/breezy

« back to all changes in this revision

Viewing changes to grammars/formal/formal5.mor

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Bushnell, BSG
  • Date: 2005-01-10 11:52:04 UTC
  • mfrom: (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050110115204-hpgncw5pb0m1t8i6
Tags: 6.13-5
debian/control (malaga-doc Recommends): Suggest gv as a
postscript-viewer instead of ghostview.  (Closes: #289701).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# morphological combination rules for all non-empty palindromes over {"a","b"}
2
 
 
3
 
initial <>, rules left_rule, mid_rule;
4
 
 
5
 
combi_rule left_rule ($list, $element):
6
 
  ? $element in <a,b>;
7
 
  result $list + <$element>, rules left_rule, mid_rule, right_rule;
8
 
end combi_rule;
9
 
 
10
 
combi_rule mid_rule ($list, $element):
11
 
  ? $element in <a,b>;
12
 
  result $list, rules right_rule;
13
 
  if $list = <> then
14
 
    result $list, accept;
15
 
  end;
16
 
end combi_rule;
17
 
 
18
 
combi_rule right_rule ($list, $element):
19
 
  ? $list.(-1) = $element;
20
 
  $list :=- (-1);
21
 
  result $list, rules right_rule, finish;
22
 
  if $list = <> then
23
 
    result $list, accept;
24
 
  end;
25
 
end;
26
 
 
27
 
end_rule finish ($list):
28
 
  ? $list = <>;
29
 
  result $list, accept;
30
 
end finish;
31
 
 
32
 
# end of file =================================================================