1 ! Copyright (C) 2007 Chris Double.
2 ! See http://factorcode.org/license.txt for BSD license.
4 USING: kernel tools.test peg peg.ebnf peg.pl0
5 multiline sequences accessors ;
9 "CONST foo = 1;" "block" \ pl0 rule (parse) remaining>> empty?
13 "VAR foo;" "block" \ pl0 rule (parse) remaining>> empty?
17 "VAR foo,bar , baz;" "block" \ pl0 rule (parse) remaining>> empty?
21 "foo := 5" "statement" \ pl0 rule (parse) remaining>> empty?
25 "BEGIN foo := 5 END" "statement" \ pl0 rule (parse) remaining>> empty?
29 "IF 1=1 THEN foo := 5" "statement" \ pl0 rule (parse) remaining>> empty?
33 "WHILE 1=1 DO foo := 5" "statement" \ pl0 rule (parse) remaining>> empty?
37 "WHILE ODD 1 DO foo := 5" "statement" \ pl0 rule (parse) remaining>> empty?
41 "PROCEDURE square; BEGIN squ:=x*x END" "block" \ pl0 rule (parse) remaining>> empty?
60 END."> main \ pl0 rule (parse) remaining>> empty?
80 IF ODD b THEN z := z + a;
92 WHILE w <= r DO w := 2 * w;
109 IF f < g THEN g := g - f;
110 IF g < f THEN f := f - g;
126 "> main \ pl0 rule (parse) remaining>> empty?