Codebase list coco-doc / upstream/20050316
Import Upstream version 20050316 Boyuan Yang 4 years ago
57 changed file(s) with 601 addition(s) and 1334 deletion(s). Raw diff Collapse all Expand all
Binary diff not shown
0 coco-doc (20050316-1) unstable; urgency=low
1
2 * Adapted to version 20050316.
3
4 -- Markus Loeberbauer <Loeberbauer@ssw.jku.at> Fri, 16 Mar 2005 13:00:00 +0100
5
06 coco-doc (20050111-1) unstable; urgency=low
17
28 * First upload to Debian unstable.
+0
-15
debian/coco-doc/DEBIAN/control less more
0 Package: coco-doc
1 Version: 20050111-1
2 Section: devel
3 Priority: optional
4 Architecture: all
5 Installed-Size: 536
6 Maintainer: Loeberbauer Markus <loeberbauer@ssw.jku.at>
7 Description: Documentation for the Coco/R Compiler Generator.
8 Coco/R is a compiler generator, which takes an attributed grammar of a source language
9 and generates a scanner and a parser for this language. The scanner works as a
10 deterministic finite automaton. The parser uses recursive descent. LL(1) conflicts can be
11 resolved by a multi-symbol lookahead or by semantic checks. Thus the class of accepted
12 grammars is LL(k) for an arbitrary k.
13 .
14 See /usr/share/doc/cocosourcesdoc.
+0
-28
debian/coco-doc/DEBIAN/md5sums less more
0 9f8320b22725963ce116087f707a2ee5 usr/share/doc/coco-doc/README.Debian
1 a9c3fbf0ce1e3b771c12f60bfa93ada8 usr/share/doc/coco-doc/copyright
2 74b6c68daac4c182a2306109a62901e7 usr/share/doc/coco-doc/examples/TestAlts.ATG
3 a3238b84ae27b0d91f20d234b932a7e1 usr/share/doc/coco-doc/examples/TestAny1.ATG
4 93e7bf875934d3a2d04b498bad6ad887 usr/share/doc/coco-doc/examples/TestAny.ATG
5 351881ff3314c4ea7c08bbc6219477a6 usr/share/doc/coco-doc/examples/TestCasing.ATG
6 e8ebbf0b4b46eff5dda3914d1daaafd5 usr/share/doc/coco-doc/examples/TestChars.ATG
7 15ca08887dc20187cf98cd0fe76094a8 usr/share/doc/coco-doc/examples/TestCircular.ATG
8 d2ddc9d70265b6d814c9caa3424b7873 usr/share/doc/coco-doc/examples/TestComments.ATG
9 7ad92252081a70bdd0a12df5367896ca usr/share/doc/coco-doc/examples/TestComplete.ATG
10 5301a907d2211150e4bf93839a9dd499 usr/share/doc/coco-doc/examples/TestDel.ATG
11 0fa04d3dcb2ddfa0d608f1fddd0c28ab usr/share/doc/coco-doc/examples/TestEps.ATG
12 d9514a0c2210f91e6bc5bf63df20f3c5 usr/share/doc/coco-doc/examples/TestIters.ATG
13 0293539cd1d0b647c12a77200387c00f usr/share/doc/coco-doc/examples/TestLL1.ATG
14 d7bdc2b0e9003446c9a79cbb3c8a99b0 usr/share/doc/coco-doc/examples/TestOpts1.ATG
15 8b113e3a9dfebc18b331beada2a0d44b usr/share/doc/coco-doc/examples/TestOpts.ATG
16 a18e7c2078c96a1ace6b1e4781af37c0 usr/share/doc/coco-doc/examples/TestReached.ATG
17 3a5eb5a9946b53126f5be44d5b689baf usr/share/doc/coco-doc/examples/TestResIllegal.ATG
18 f13e63acc241c8c7ccbf2cf5c0b0e9da usr/share/doc/coco-doc/examples/TestResOK.ATG
19 2f47a79ed257db5cd88218cac5d8c7ab usr/share/doc/coco-doc/examples/TestSem.ATG
20 fd528e20a157bc0f888d92053d972444 usr/share/doc/coco-doc/examples/TestSync.ATG
21 4d6ac2a727063970642f442a61c6ee75 usr/share/doc/coco-doc/examples/TestTerminalizable.ATG
22 a25fdd1986ce12d1f14cc6ea32ffddb4 usr/share/doc/coco-doc/examples/TestTokens1.ATG
23 ea91d875e2cf127bde8a62843ffd9525 usr/share/doc/coco-doc/examples/TestTokens.ATG
24 a16c97b81cfc6cb271a187c2bf587da0 usr/share/doc/coco-doc/examples/TestWeak.ATG
25 3f61234a6b42d970cf740f3599631ba1 usr/share/doc/coco-doc/changelog.Debian.gz
26 a2e333f2bfb1cedbfb7e4d35532e97be usr/share/doc/coco-doc/UserManual.pdf.gz
27 b87b9773a36c52748a930abe051bbc49 usr/share/doc/coco-doc/DataStructures.pdf.gz
debian/coco-doc/usr/share/doc/coco-doc/DataStructures.pdf.gz less more
Binary diff not shown
+0
-6
debian/coco-doc/usr/share/doc/coco-doc/README.Debian less more
0 coco-doc for Debian
1 -------------------
2
3 <possible notes regarding this package - if none, delete this file>
4
5 -- ml <ml@gast3.ssw.uni-linz.ac.at>, Wed, 12 Jan 2005 10:21:20 +0100
debian/coco-doc/usr/share/doc/coco-doc/UserManual.pdf.gz less more
Binary diff not shown
debian/coco-doc/usr/share/doc/coco-doc/changelog.Debian.gz less more
Binary diff not shown
+0
-24
debian/coco-doc/usr/share/doc/coco-doc/copyright less more
0 Compiler Generator Coco/R,
1 Copyright (c) 1990, 2004 Hanspeter Moessenboeck, University of Linz
2 extended by M. Loeberbauer & A. Woess, Univ. of Linz
3 with improvements by Pat Terry, Rhodes University
4
5 This program is free software; you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published by the
7 Free Software Foundation; either version 2, or (at your option) any
8 later version.
9
10 This program is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 for more details.
14
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19 As an exception, it is allowed to write an extension of Coco/R that is
20 used as a plugin in non-free software.
21
22 If not otherwise stated, any source code generated by Coco/R (other than
23 Coco/R itself) does not fall under the GNU General Public License.
+0
-20
debian/coco-doc/usr/share/doc/coco-doc/examples/TestAlts.ATG less more
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of alternatives in productions.
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = "a".
8 b = "b".
9 c = "c".
10 d = "d".
11 e = "e".
12 f = "f".
13
14 PRODUCTIONS
15
16 Test = a A b.
17 A = (a | (b|c|) | d) e.
18
19 END Test.
+0
-26
debian/coco-doc/usr/share/doc/coco-doc/examples/TestAny.ATG less more
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of ANY symbols
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = "a".
8 b = "b".
9 c = "c".
10 d = "d".
11 e = "e".
12 f = "f".
13 g = "g".
14 h = "h".
15 i = "i".
16
17 PRODUCTIONS
18
19 Test = A B C D.
20 A = {a | ANY | b} c.
21 B = {ANY d} e.
22 C = [ANY f] g.
23 D = {ANY} h | i.
24
25 END Test.
+0
-26
debian/coco-doc/usr/share/doc/coco-doc/examples/TestAny1.ATG less more
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of ANY symbols
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = "a".
8 b = "b".
9 c = "c".
10 d = "d".
11 e = "e".
12 f = "f".
13 g = "g".
14 h = "h".
15 i = "i".
16
17 PRODUCTIONS
18
19 Test = A B C D.
20 A = (ANY |) ANY.
21 B = ANY | ANY.
22 C = {ANY} ANY.
23 D = [ANY] ANY.
24
25 END Test.
+0
-23
debian/coco-doc/usr/share/doc/coco-doc/examples/TestCasing.ATG less more
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of case insensitive scanners.
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5 IGNORECASE
6
7 CHARACTERS
8 letter = 'A'..'Z' + 'a'..'z'.
9 digit = '0'..'9'.
10 suffix = 'F'.
11
12 TOKENS
13 ident = letter {letter}.
14 float1 = digit {digit} suffix.
15 float2 = digit {digit} 'E' digit {digit}.
16 A = "AAA".
17
18 PRODUCTIONS
19
20 Test = A "AAA" "AAa" "AaA" "Aaa" "aAA" "aAa" "aaA" "aaa" "BBb" "bbB".
21
22 END Test.
+0
-25
debian/coco-doc/usr/share/doc/coco-doc/examples/TestChars.ATG less more
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of CHARACTERS definition
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 CHARACTERS
7 lower = "abcdefghijklmnopqrstuvwxyz".
8 upper = 'A' ..'Z'.
9 letter = lower + upper.
10 noquote = ANY - '\''.
11 idchar = letter + '0' .. '9'.
12 LF = '\n'.
13
14 TOKENS
15 ident = letter {idchar}.
16
17 IGNORE
18 '\r' + LF + '\u0009'
19
20 PRODUCTIONS
21
22 Test = ident.
23
24 END Test.
+0
-26
debian/coco-doc/usr/share/doc/coco-doc/examples/TestCircular.ATG less more
0 $01246
1 /*-------------------------------------------------------------------------
2 Test if all nonterminals can be reached.
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = 'a'.
8 b = 'b'.
9 c = 'c'.
10 d = 'd'.
11 e = 'e'.
12 f = 'f'.
13 g = 'g'.
14 h = 'h'.
15 i = 'i'.
16
17 PRODUCTIONS
18
19 Test = A.
20 A = B D | a.
21 B = [b] C { c C}.
22 C = D A [d].
23 D = [e f].
24
25 END Test.
+0
-22
debian/coco-doc/usr/share/doc/coco-doc/examples/TestComments.ATG less more
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of COMMENTS definition
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 CHARACTERS
7 letter = 'A'..'Z' + 'a'..'z'.
8 digit = '0'..'9'.
9
10 TOKENS
11 ident = letter {letter | digit}.
12
13 COMMENTS FROM "//" TO "\r\n"
14 COMMENTS FROM "/*" TO "*/"
15 COMMENTS FROM "(*" TO "*)" NESTED
16
17 PRODUCTIONS
18
19 Test = ident.
20
21 END Test.
+0
-25
debian/coco-doc/usr/share/doc/coco-doc/examples/TestComplete.ATG less more
0 $01246
1 /*-------------------------------------------------------------------------
2 Test if all nonterminals have productions.
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = 'a'.
8 b = 'b'.
9 c = 'c'.
10 d = 'd'.
11 e = 'e'.
12 f = 'f'.
13 g = 'g'.
14 h = 'h'.
15 i = 'i'.
16
17 PRODUCTIONS
18
19 Test = A C D.
20 A = a B a.
21 C = c D c.
22 D = A d.
23
24 END Test.
+0
-26
debian/coco-doc/usr/share/doc/coco-doc/examples/TestDel.ATG less more
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of deletable symbols
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = 'a'.
8 b = 'b'.
9 c = 'c'.
10 d = 'd'.
11 e = 'e'.
12 f = 'f'.
13 g = 'g'.
14 h = 'h'.
15 i = 'i'.
16
17 PRODUCTIONS
18
19 Test = A B g C g D.
20 A = a | {e}[f].
21 B = {b}[c](d|).
22 C = A B.
23 D = C | h.
24
25 END Test.
+0
-20
debian/coco-doc/usr/share/doc/coco-doc/examples/TestEps.ATG less more
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of eps symbols
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = "a".
8 b = "b".
9 c = "c".
10 d = "d".
11 e = "e".
12 f = "f".
13
14 PRODUCTIONS
15
16 Test = (a|) b
17 | (c | (. sem .) | d) e.
18
19 END Test.
+0
-22
debian/coco-doc/usr/share/doc/coco-doc/examples/TestIters.ATG less more
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of iterations in productions.
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = "a".
8 b = "b".
9 c = "c".
10 d = "d".
11 e = "e".
12 f = "f".
13 g = "g".
14 h = "h".
15 i = "i".
16
17 PRODUCTIONS
18
19 Test = (a | {b} c | {{d} e} | {f {g}} h) i.
20
21 END Test.
+0
-41
debian/coco-doc/usr/share/doc/coco-doc/examples/TestLL1.ATG less more
0 $01246
1 /*-------------------------------------------------------------------------
2 Test if LL(1) warnings are reported.
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = 'a'.
8 b = 'b'.
9 c = 'c'.
10 d = 'd'.
11 e = 'e'.
12 f = 'f'.
13 g = 'g'.
14 h = 'h'.
15 i = 'i'.
16
17 PRODUCTIONS
18
19 Test = A E C G H I J.
20 A = (a | B).
21 B = {b}(c|) a.
22 C = {a}[D] B.
23 D = d [b].
24 E = (F|) e.
25 F = [f].
26 G = [ ( IF (eee) (a | b)
27 | b
28 )
29 ] a.
30 H = [a] [IF (hhh) a] [IF (hhh) a] a.
31 I = {a} ( IF (iii) (a | b)
32 | b
33 ).
34 J =
35 { IF (aaa) "a"}
36 { IF (eee) ("a" | "b")
37 | "b"
38 } "a".
39
40 END Test.
+0
-20
debian/coco-doc/usr/share/doc/coco-doc/examples/TestOpts.ATG less more
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of options in productions.
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = "a".
8 b = "b".
9 c = "c".
10 d = "d".
11 e = "e".
12 f = "f".
13
14 PRODUCTIONS
15
16 Test = a | [b] c | [Del] | d [[d][e]f].
17 Del = [e].
18
19 END Test.
+0
-19
debian/coco-doc/usr/share/doc/coco-doc/examples/TestOpts1.ATG less more
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of options in productions.
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = "a".
8 b = "b".
9 c = "c".
10 d = "d".
11 e = "e".
12 f = "f".
13
14 PRODUCTIONS
15
16 Test = [[a]].
17
18 END Test.
+0
-26
debian/coco-doc/usr/share/doc/coco-doc/examples/TestReached.ATG less more
0 $01246
1 /*-------------------------------------------------------------------------
2 Test if all nonterminals can be reached.
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = 'a'.
8 b = 'b'.
9 c = 'c'.
10 d = 'd'.
11 e = 'e'.
12 f = 'f'.
13 g = 'g'.
14 h = 'h'.
15 i = 'i'.
16
17 PRODUCTIONS
18
19 Test = A C D.
20 A = a C a | b.
21 B = b.
22 C = c D c | b.
23 D = A d.
24
25 END Test.
+0
-23
debian/coco-doc/usr/share/doc/coco-doc/examples/TestResIllegal.ATG less more
0 $AFGJSX
1 COMPILER Test
2 PRODUCTIONS
3 Test = A B C D.
4
5 A =
6 "a"
7 ( "b" (IF (aaa) "c") "d" /* misplaced resolver */
8 | IF (bbb) "b" "c" /* resolver not evaluated */
9 | IF (ccc) "c" /* misplaced resolver */
10 ).
11
12 B = IF (ddd) "d". /* misplaced resolver */
13
14 C = {IF (eee) "d"} "e". /* misplaced resolver */
15
16 D =
17 "d"
18 { "d"
19 | IF (fff) "a" "b" /* misplaced resolver */
20 } "a".
21
22 END Test.
+0
-49
debian/coco-doc/usr/share/doc/coco-doc/examples/TestResOK.ATG less more
0 $AFGJSX
1 COMPILER Test
2 PRODUCTIONS
3 Test = A B C D E F G H.
4
5 A = "a" {[IF (true) "b" "c"] "b"} "c".
6
7 B =
8 ( "a"
9 | IF (eee) "b"
10 |
11 ) "b".
12
13 C = (IF(true) "a" "b" | "a").
14
15 D = {
16 IF (true) "a"
17 | "a" "b"
18 } "c".
19
20 E =
21 ( "a"
22 | [ IF(true) "c"
23 | "c" "b"
24 ]
25 | "b"
26 ) "d".
27
28 F =
29 { IF(true) ["a"] "b"
30 | ANY
31 | "a"
32 } "c".
33
34 G =
35 { IF (aaa) "a"}
36 { IF (bbb)
37 (IF (eee) ("a" | "b")
38 | "b"
39 )
40 } "a".
41
42 H =
43 { IF (aaa) "a"}
44 { IF (eee) ("a" | "b")
45 | "b"
46 } "c".
47
48 END Test.
+0
-34
debian/coco-doc/usr/share/doc/coco-doc/examples/TestSem.ATG less more
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of semantic actions
3 ----------------------------------------------------------------------------*/
4 using System.Collections;
5
6 COMPILER Test
7
8 static void Foo() {
9 Console.WriteLine("foo");
10 }
11
12 TOKENS
13 a = "a".
14 b = "b".
15 c = "c".
16 d = "d".
17 e = "e".
18 f = "f".
19 g = "g".
20 h = "h".
21 i = "i".
22
23 PRAGMAS
24 option = '$' ('a' | 'b'). (. Console.WriteLine("pragma"); .)
25
26 PRODUCTIONS
27
28 Test (. decl .) = A B C.
29 A = ( (. aaa .) c | (. bbb .) | d) (. ccc .).
30 B = (. ddd .) { a (. eee .)} (. fff .) b (. !$%&/()=?`+*#'-_.:,;<>^{[]}| .).
31 C = (a | b) (. ggg .) c (..).
32
33 END Test.
+0
-23
debian/coco-doc/usr/share/doc/coco-doc/examples/TestSync.ATG less more
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of SYNC symbols
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = "a".
8 b = "b".
9 c = "c".
10 d = "d".
11 e = "e".
12 f = "f".
13 g = "g".
14 h = "h".
15 i = "i".
16
17 PRODUCTIONS
18
19 Test = a SYNC {b | c} d A.
20 A = SYNC [e f] g.
21
22 END Test.
+0
-26
debian/coco-doc/usr/share/doc/coco-doc/examples/TestTerminalizable.ATG less more
0 $01246
1 /*-------------------------------------------------------------------------
2 Test if nonterminals are terminalizable.
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = 'a'.
8 b = 'b'.
9 c = 'c'.
10 d = 'd'.
11 e = 'e'.
12 f = 'f'.
13 g = 'g'.
14 h = 'h'.
15 i = 'i'.
16
17 PRODUCTIONS
18
19 Test = A B C D.
20 A = a C a.
21 B = b.
22 C = c D c.
23 D = A d.
24
25 END Test.
+0
-26
debian/coco-doc/usr/share/doc/coco-doc/examples/TestTokens.ATG less more
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of TOKENS definition
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 CHARACTERS
7 letter = 'A'..'Z' + 'a'..'z'.
8 digit = '0'..'9'.
9 plus = '+'.
10
11 TOKENS
12 ident = letter {letter | digit}.
13 ident1 = letter {'_'} '*'.
14 ident2 = letter CONTEXT ({'_'} '+').
15 number = digit {digit}
16 | digit {digit} '.' {digit} ['E' ['+'|'-'] digit {digit}]
17 | digit {digit} CONTEXT ("..").
18 nul = '\0'.
19 hasNul = "ab\0c".
20
21 PRODUCTIONS
22
23 Test = ident "abc" "abc+" "a" "a_" "a__**" nul hasNul "\0".
24
25 END Test.
+0
-28
debian/coco-doc/usr/share/doc/coco-doc/examples/TestTokens1.ATG less more
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of TOKENS definition (error case)
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 CHARACTERS
7 letter = 'A'..'Z' + 'a'..'z'.
8 digit = '0'..'9'.
9
10 TOKENS
11 ident = letter {letter | digit}.
12 ident1 = letter {digit} letter. /* tokens ident and ident1 cannot be distinguished */
13 number = digit {digit} | digit {digit} CONTEXT("..").
14 B1 = '\a'.
15 B2 = '\u0007'. /* tokens B1 and B2 cannot be distinguished */
16 C1 = "\u0008".
17 C2 = "\b". /* tokens C1 and C2 cannot be distinguished */
18 S1 = "+" "+".
19 S2 = "++". /* tokens S1 and S2 cannot be distinguished */
20 S3 = '+' '+'. /* tokens S1 and S3 cannot be distinguished */
21 X1 = "123..". /* tokens number and X1 cannot be distinguished */
22
23 PRODUCTIONS
24
25 Test = ident.
26
27 END Test.
+0
-25
debian/coco-doc/usr/share/doc/coco-doc/examples/TestWeak.ATG less more
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of WEAK symbol
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = "a".
8 b = "b".
9 c = "c".
10 d = "d".
11 e = "e".
12 f = "f".
13 g = "g".
14 h = "h".
15 i = "i".
16
17 PRODUCTIONS
18
19 Test = A B C.
20 A = a WEAK b c.
21 B = a {WEAK b c} d.
22 C = a {WEAK b} c.
23
24 END Test.
+0
-1
debian/files less more
0 coco-doc_20050111-1_all.deb devel optional
+0
-64
debian/rules~ less more
0 #!/usr/bin/make -f
1 # -*- makefile -*-
2 # Sample debian/rules that uses debhelper.
3 # This file was originally written by Joey Hess and Craig Small.
4 # As a special exception, when this file is copied by dh-make into a
5 # dh-make output file, you may use that output file without restriction.
6 # This special exception was added by Craig Small in version 0.37 of dh-make.
7
8 # Uncomment this to turn on verbose mode.
9 #export DH_VERBOSE=1
10
11
12
13
14 CFLAGS = -Wall -g
15
16 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
17 CFLAGS += -O0
18 else
19 CFLAGS += -O2
20 endif
21
22 install:
23 dh_testdir
24 dh_testroot
25 dh_clean -k
26 dh_installdirs
27
28 # Add here commands to install the package into debian/coco-doc.
29
30
31 # Build architecture-independent files here.
32 binary-indep: build install
33 dh_testdir
34 dh_testroot
35 dh_installchangelogs
36 dh_installdocs
37 dh_installexamples examples/*
38 # dh_install
39 # dh_installmenu
40 # dh_installdebconf
41 # dh_installlogrotate
42 # dh_installemacsen
43 # dh_installpam
44 # dh_installmime
45 # dh_installinit
46 # dh_installcron
47 # dh_installinfo
48 dh_installman
49 dh_link
50 dh_strip
51 dh_compress
52 dh_fixperms
53 # dh_perl
54 # dh_python
55 # dh_makeshlibs
56 dh_installdeb
57 dh_shlibdeps
58 dh_gencontrol
59 dh_md5sums
60 dh_builddeb
61
62 binary: binary-indep
63 .PHONY: build clean binary-indep binary install configure
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of alternatives in productions.
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = "a".
8 b = "b".
9 c = "c".
10 d = "d".
11 e = "e".
12 f = "f".
13
14 PRODUCTIONS
15
16 Test = a A b.
17 A = (a | (b|c|) | d) e.
18
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of alternatives in productions.
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = "a".
8 b = "b".
9 c = "c".
10 d = "d".
11 e = "e".
12 f = "f".
13
14 PRODUCTIONS
15
16 Test = a A b.
17 A = (a | (b|c|) | d) e.
18
1919 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of ANY symbols
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = "a".
8 b = "b".
9 c = "c".
10 d = "d".
11 e = "e".
12 f = "f".
13 g = "g".
14 h = "h".
15 i = "i".
16
17 PRODUCTIONS
18
19 Test = A B C D.
20 A = {a | ANY | b} c.
21 B = {ANY d} e.
22 C = [ANY f] g.
23 D = {ANY} h | i.
24
25 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of ANY symbols
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = "a".
8 b = "b".
9 c = "c".
10 d = "d".
11 e = "e".
12 f = "f".
13 g = "g".
14 h = "h".
15 i = "i".
16
17 PRODUCTIONS
18
19 Test = A B C D.
20 A = {a | ANY | b} c.
21 B = {ANY d} e.
22 C = [ANY f] g.
23 D = {ANY} h | i.
24
25 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of ANY symbols
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = "a".
8 b = "b".
9 c = "c".
10 d = "d".
11 e = "e".
12 f = "f".
13 g = "g".
14 h = "h".
15 i = "i".
16
17 PRODUCTIONS
18
19 Test = A B C D.
20 A = (ANY |) ANY.
21 B = ANY | ANY.
22 C = {ANY} ANY.
23 D = [ANY] ANY.
24
25 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of ANY symbols
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = "a".
8 b = "b".
9 c = "c".
10 d = "d".
11 e = "e".
12 f = "f".
13 g = "g".
14 h = "h".
15 i = "i".
16
17 PRODUCTIONS
18
19 Test = A B C D.
20 A = (ANY |) ANY.
21 B = ANY | ANY.
22 C = {ANY} ANY.
23 D = [ANY] ANY.
24
25 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of case insensitive scanners.
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5 IGNORECASE
6
7 CHARACTERS
8 letter = 'A'..'Z' + 'a'..'z'.
9 digit = '0'..'9'.
10 suffix = 'F'.
11
12 TOKENS
13 ident = letter {letter}.
14 float1 = digit {digit} suffix.
15 float2 = digit {digit} 'E' digit {digit}.
16 A = "AAA".
17
18 PRODUCTIONS
19
20 Test = A "AAA" "AAa" "AaA" "Aaa" "aAA" "aAa" "aaA" "aaa" "BBb" "bbB".
21
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of case insensitive scanners.
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5 IGNORECASE
6
7 CHARACTERS
8 letter = 'A'..'Z' + 'a'..'z'.
9 digit = '0'..'9'.
10 suffix = 'F'.
11
12 TOKENS
13 ident = letter {letter}.
14 float1 = digit {digit} suffix.
15 float2 = digit {digit} 'E' digit {digit}.
16 A = "AAA".
17
18 PRODUCTIONS
19
20 Test = A "AAA" "AAa" "AaA" "Aaa" "aAA" "aAa" "aaA" "aaa" "BBb" "bbB".
21
2222 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of CHARACTERS definition
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 CHARACTERS
7 lower = "abcdefghijklmnopqrstuvwxyz".
8 upper = 'A' ..'Z'.
9 letter = lower + upper.
10 noquote = ANY - '\''.
11 idchar = letter + '0' .. '9'.
12 LF = '\n'.
13
14 TOKENS
15 ident = letter {idchar}.
16
17 IGNORE
18 '\r' + LF + '\u0009'
19
20 PRODUCTIONS
21
22 Test = ident.
23
24 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of CHARACTERS definition
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 CHARACTERS
7 lower = "abcdefghijklmnopqrstuvwxyz".
8 upper = 'A' ..'Z'.
9 letter = lower + upper.
10 noquote = ANY - '\''.
11 idchar = letter + '0' .. '9'.
12 LF = '\n'.
13
14 TOKENS
15 ident = letter {idchar}.
16
17 IGNORE
18 '\r' + LF + '\u0009'
19
20 PRODUCTIONS
21
22 Test = ident.
23
24 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test if all nonterminals can be reached.
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = 'a'.
8 b = 'b'.
9 c = 'c'.
10 d = 'd'.
11 e = 'e'.
12 f = 'f'.
13 g = 'g'.
14 h = 'h'.
15 i = 'i'.
16
17 PRODUCTIONS
18
19 Test = A.
20 A = B D | a.
21 B = [b] C { c C}.
22 C = D A [d].
23 D = [e f].
24
25 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test if all nonterminals can be reached.
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = 'a'.
8 b = 'b'.
9 c = 'c'.
10 d = 'd'.
11 e = 'e'.
12 f = 'f'.
13 g = 'g'.
14 h = 'h'.
15 i = 'i'.
16
17 PRODUCTIONS
18
19 Test = A.
20 A = B D | a.
21 B = [b] C { c C}.
22 C = D A [d].
23 D = [e f].
24
25 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of COMMENTS definition
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 CHARACTERS
7 letter = 'A'..'Z' + 'a'..'z'.
8 digit = '0'..'9'.
9
10 TOKENS
11 ident = letter {letter | digit}.
12
13 COMMENTS FROM "//" TO "\r\n"
14 COMMENTS FROM "/*" TO "*/"
15 COMMENTS FROM "(*" TO "*)" NESTED
16
17 PRODUCTIONS
18
19 Test = ident.
20
21 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of COMMENTS definition
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 CHARACTERS
7 letter = 'A'..'Z' + 'a'..'z'.
8 digit = '0'..'9'.
9
10 TOKENS
11 ident = letter {letter | digit}.
12
13 COMMENTS FROM "//" TO "\r\n"
14 COMMENTS FROM "/*" TO "*/"
15 COMMENTS FROM "(*" TO "*)" NESTED
16
17 PRODUCTIONS
18
19 Test = ident.
20
21 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test if all nonterminals have productions.
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = 'a'.
8 b = 'b'.
9 c = 'c'.
10 d = 'd'.
11 e = 'e'.
12 f = 'f'.
13 g = 'g'.
14 h = 'h'.
15 i = 'i'.
16
17 PRODUCTIONS
18
19 Test = A C D.
20 A = a B a.
21 C = c D c.
22 D = A d.
23
24 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test if all nonterminals have productions.
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = 'a'.
8 b = 'b'.
9 c = 'c'.
10 d = 'd'.
11 e = 'e'.
12 f = 'f'.
13 g = 'g'.
14 h = 'h'.
15 i = 'i'.
16
17 PRODUCTIONS
18
19 Test = A C D.
20 A = a B a.
21 C = c D c.
22 D = A d.
23
24 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of deletable symbols
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = 'a'.
8 b = 'b'.
9 c = 'c'.
10 d = 'd'.
11 e = 'e'.
12 f = 'f'.
13 g = 'g'.
14 h = 'h'.
15 i = 'i'.
16
17 PRODUCTIONS
18
19 Test = A B g C g D.
20 A = a | {e}[f].
21 B = {b}[c](d|).
22 C = A B.
23 D = C | h.
24
25 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of deletable symbols
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = 'a'.
8 b = 'b'.
9 c = 'c'.
10 d = 'd'.
11 e = 'e'.
12 f = 'f'.
13 g = 'g'.
14 h = 'h'.
15 i = 'i'.
16
17 PRODUCTIONS
18
19 Test = A B g C g D.
20 A = a | {e}[f].
21 B = {b}[c](d|).
22 C = A B.
23 D = C | h.
24
25 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of eps symbols
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = "a".
8 b = "b".
9 c = "c".
10 d = "d".
11 e = "e".
12 f = "f".
13
14 PRODUCTIONS
15
16 Test = (a|) b
17 | (c | (. sem .) | d) e.
18
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of eps symbols
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = "a".
8 b = "b".
9 c = "c".
10 d = "d".
11 e = "e".
12 f = "f".
13
14 PRODUCTIONS
15
16 Test = (a|) b
17 | (c | (. sem .) | d) e.
18
1919 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of iterations in productions.
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = "a".
8 b = "b".
9 c = "c".
10 d = "d".
11 e = "e".
12 f = "f".
13 g = "g".
14 h = "h".
15 i = "i".
16
17 PRODUCTIONS
18
19 Test = (a | {b} c | {{d} e} | {f {g}} h) i.
20
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of iterations in productions.
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = "a".
8 b = "b".
9 c = "c".
10 d = "d".
11 e = "e".
12 f = "f".
13 g = "g".
14 h = "h".
15 i = "i".
16
17 PRODUCTIONS
18
19 Test = (a | {b} c | {{d} e} | {f {g}} h) i.
20
2121 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test if LL(1) warnings are reported.
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = 'a'.
8 b = 'b'.
9 c = 'c'.
10 d = 'd'.
11 e = 'e'.
12 f = 'f'.
13 g = 'g'.
14 h = 'h'.
15 i = 'i'.
16
17 PRODUCTIONS
18
19 Test = A E C G H I J.
20 A = (a | B).
21 B = {b}(c|) a.
22 C = {a}[D] B.
23 D = d [b].
24 E = (F|) e.
25 F = [f].
26 G = [ ( IF (eee) (a | b)
27 | b
28 )
29 ] a.
30 H = [a] [IF (hhh) a] [IF (hhh) a] a.
31 I = {a} ( IF (iii) (a | b)
32 | b
33 ).
34 J =
35 { IF (aaa) "a"}
36 { IF (eee) ("a" | "b")
37 | "b"
38 } "a".
39
40 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test if LL(1) warnings are reported.
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = 'a'.
8 b = 'b'.
9 c = 'c'.
10 d = 'd'.
11 e = 'e'.
12 f = 'f'.
13 g = 'g'.
14 h = 'h'.
15 i = 'i'.
16
17 PRODUCTIONS
18
19 Test = A E C G H I J.
20 A = (a | B).
21 B = {b}(c|) a.
22 C = {a}[D] B.
23 D = d [b].
24 E = (F|) e.
25 F = [f].
26 G = [ ( IF (eee) (a | b)
27 | b
28 )
29 ] a.
30 H = [a] [IF (hhh) a] [IF (hhh) a] a.
31 I = {a} ( IF (iii) (a | b)
32 | b
33 ).
34 J =
35 { IF (aaa) "a"}
36 { IF (eee) ("a" | "b")
37 | "b"
38 } "a".
39
40 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of options in productions.
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = "a".
8 b = "b".
9 c = "c".
10 d = "d".
11 e = "e".
12 f = "f".
13
14 PRODUCTIONS
15
16 Test = a | [b] c | [Del] | d [[d][e]f].
17 Del = [e].
18
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of options in productions.
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = "a".
8 b = "b".
9 c = "c".
10 d = "d".
11 e = "e".
12 f = "f".
13
14 PRODUCTIONS
15
16 Test = a | [b] c | [Del] | d [[d][e]f].
17 Del = [e].
18
1919 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of options in productions.
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = "a".
8 b = "b".
9 c = "c".
10 d = "d".
11 e = "e".
12 f = "f".
13
14 PRODUCTIONS
15
16 Test = [[a]].
17
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of options in productions.
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = "a".
8 b = "b".
9 c = "c".
10 d = "d".
11 e = "e".
12 f = "f".
13
14 PRODUCTIONS
15
16 Test = [[a]].
17
1818 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test if all nonterminals can be reached.
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = 'a'.
8 b = 'b'.
9 c = 'c'.
10 d = 'd'.
11 e = 'e'.
12 f = 'f'.
13 g = 'g'.
14 h = 'h'.
15 i = 'i'.
16
17 PRODUCTIONS
18
19 Test = A C D.
20 A = a C a | b.
21 B = b.
22 C = c D c | b.
23 D = A d.
24
25 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test if all nonterminals can be reached.
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = 'a'.
8 b = 'b'.
9 c = 'c'.
10 d = 'd'.
11 e = 'e'.
12 f = 'f'.
13 g = 'g'.
14 h = 'h'.
15 i = 'i'.
16
17 PRODUCTIONS
18
19 Test = A C D.
20 A = a C a | b.
21 B = b.
22 C = c D c | b.
23 D = A d.
24
25 END Test.
0 $AFGJSX
1 COMPILER Test
2 PRODUCTIONS
3 Test = A B C D.
4
5 A =
6 "a"
7 ( "b" (IF (aaa) "c") "d" /* misplaced resolver */
8 | IF (bbb) "b" "c" /* resolver not evaluated */
9 | IF (ccc) "c" /* misplaced resolver */
10 ).
11
12 B = IF (ddd) "d". /* misplaced resolver */
13
14 C = {IF (eee) "d"} "e". /* misplaced resolver */
15
16 D =
17 "d"
18 { "d"
19 | IF (fff) "a" "b" /* misplaced resolver */
20 } "a".
21
22 END Test.
0 $AFGJSX
1 COMPILER Test
2 PRODUCTIONS
3 Test = A B C D.
4
5 A =
6 "a"
7 ( "b" (IF (aaa) "c") "d" /* misplaced resolver */
8 | IF (bbb) "b" "c" /* resolver not evaluated */
9 | IF (ccc) "c" /* misplaced resolver */
10 ).
11
12 B = IF (ddd) "d". /* misplaced resolver */
13
14 C = {IF (eee) "d"} "e". /* misplaced resolver */
15
16 D =
17 "d"
18 { "d"
19 | IF (fff) "a" "b" /* misplaced resolver */
20 } "a".
21
22 END Test.
0 $AFGJSX
1 COMPILER Test
2 PRODUCTIONS
3 Test = A B C D E F G H.
4
5 A = "a" {[IF (true) "b" "c"] "b"} "c".
6
7 B =
8 ( "a"
9 | IF (eee) "b"
10 |
11 ) "b".
12
13 C = (IF(true) "a" "b" | "a").
14
15 D = {
16 IF (true) "a"
17 | "a" "b"
18 } "c".
19
20 E =
21 ( "a"
22 | [ IF(true) "c"
23 | "c" "b"
24 ]
25 | "b"
26 ) "d".
27
28 F =
29 { IF(true) ["a"] "b"
30 | ANY
31 | "a"
32 } "c".
33
34 G =
35 { IF (aaa) "a"}
36 { IF (bbb)
37 (IF (eee) ("a" | "b")
38 | "b"
39 )
40 } "a".
41
42 H =
43 { IF (aaa) "a"}
44 { IF (eee) ("a" | "b")
45 | "b"
46 } "c".
47
48 END Test.
0 $AFGJSX
1 COMPILER Test
2 PRODUCTIONS
3 Test = A B C D E F G H.
4
5 A = "a" {[IF (true) "b" "c"] "b"} "c".
6
7 B =
8 ( "a"
9 | IF (eee) "b"
10 |
11 ) "b".
12
13 C = (IF(true) "a" "b" | "a").
14
15 D = {
16 IF (true) "a"
17 | "a" "b"
18 } "c".
19
20 E =
21 ( "a"
22 | [ IF(true) "c"
23 | "c" "b"
24 ]
25 | "b"
26 ) "d".
27
28 F =
29 { IF(true) ["a"] "b"
30 | ANY
31 | "a"
32 } "c".
33
34 G =
35 { IF (aaa) "a"}
36 { IF (bbb)
37 (IF (eee) ("a" | "b")
38 | "b"
39 )
40 } "a".
41
42 H =
43 { IF (aaa) "a"}
44 { IF (eee) ("a" | "b")
45 | "b"
46 } "c".
47
48 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of semantic actions
3 ----------------------------------------------------------------------------*/
4 using System.Collections;
5
6 COMPILER Test
7
8 static void Foo() {
9 Console.WriteLine("foo");
10 }
11
12 TOKENS
13 a = "a".
14 b = "b".
15 c = "c".
16 d = "d".
17 e = "e".
18 f = "f".
19 g = "g".
20 h = "h".
21 i = "i".
22
23 PRAGMAS
24 option = '$' ('a' | 'b'). (. Console.WriteLine("pragma"); .)
25
26 PRODUCTIONS
27
28 Test (. decl .) = A B C.
29 A = ( (. aaa .) c | (. bbb .) | d) (. ccc .).
30 B = (. ddd .) { a (. eee .)} (. fff .) b (. !$%&/()=?`+*#'-_.:,;<>^{[]}| .).
31 C = (a | b) (. ggg .) c (..).
32
33 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of semantic actions
3 ----------------------------------------------------------------------------*/
4 using System.Collections;
5
6 COMPILER Test
7
8 static void Foo() {
9 Console.WriteLine("foo");
10 }
11
12 TOKENS
13 a = "a".
14 b = "b".
15 c = "c".
16 d = "d".
17 e = "e".
18 f = "f".
19 g = "g".
20 h = "h".
21 i = "i".
22
23 PRAGMAS
24 option = '$' ('a' | 'b'). (. Console.WriteLine("pragma"); .)
25
26 PRODUCTIONS
27
28 Test (. decl .) = A B C.
29 A = ( (. aaa .) c | (. bbb .) | d) (. ccc .).
30 B = (. ddd .) { a (. eee .)} (. fff .) b (. !$%&/()=?`+*#'-_.:,;<>^{[]}| .).
31 C = (a | b) (. ggg .) c (..).
32
33 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of SYNC symbols
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = "a".
8 b = "b".
9 c = "c".
10 d = "d".
11 e = "e".
12 f = "f".
13 g = "g".
14 h = "h".
15 i = "i".
16
17 PRODUCTIONS
18
19 Test = a SYNC {b | c} d A.
20 A = SYNC [e f] g.
21
22 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of SYNC symbols
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = "a".
8 b = "b".
9 c = "c".
10 d = "d".
11 e = "e".
12 f = "f".
13 g = "g".
14 h = "h".
15 i = "i".
16
17 PRODUCTIONS
18
19 Test = a SYNC {b | c} d A.
20 A = SYNC [e f] g.
21
22 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test if nonterminals are terminalizable.
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = 'a'.
8 b = 'b'.
9 c = 'c'.
10 d = 'd'.
11 e = 'e'.
12 f = 'f'.
13 g = 'g'.
14 h = 'h'.
15 i = 'i'.
16
17 PRODUCTIONS
18
19 Test = A B C D.
20 A = a C a.
21 B = b.
22 C = c D c.
23 D = A d.
24
25 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test if nonterminals are terminalizable.
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = 'a'.
8 b = 'b'.
9 c = 'c'.
10 d = 'd'.
11 e = 'e'.
12 f = 'f'.
13 g = 'g'.
14 h = 'h'.
15 i = 'i'.
16
17 PRODUCTIONS
18
19 Test = A B C D.
20 A = a C a.
21 B = b.
22 C = c D c.
23 D = A d.
24
25 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of TOKENS definition
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 CHARACTERS
7 letter = 'A'..'Z' + 'a'..'z'.
8 digit = '0'..'9'.
9 plus = '+'.
10
11 TOKENS
12 ident = letter {letter | digit}.
13 ident1 = letter {'_'} '*'.
14 ident2 = letter CONTEXT ({'_'} '+').
15 number = digit {digit}
16 | digit {digit} '.' {digit} ['E' ['+'|'-'] digit {digit}]
17 | digit {digit} CONTEXT ("..").
18 nul = '\0'.
19 hasNul = "ab\0c".
20
21 PRODUCTIONS
22
23 Test = ident "abc" "abc+" "a" "a_" "a__**" nul hasNul "\0".
24
25 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of TOKENS definition
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 CHARACTERS
7 letter = 'A'..'Z' + 'a'..'z'.
8 digit = '0'..'9'.
9 plus = '+'.
10
11 TOKENS
12 ident = letter {letter | digit}.
13 ident1 = letter {'_'} '*'.
14 ident2 = letter CONTEXT ({'_'} '+').
15 number = digit {digit}
16 | digit {digit} '.' {digit} ['E' ['+'|'-'] digit {digit}]
17 | digit {digit} CONTEXT ("..").
18 nul = '\0'.
19 hasNul = "ab\0c".
20
21 PRODUCTIONS
22
23 Test = ident "abc" "abc+" "a" "a_" "a__**" nul hasNul "\0".
24
25 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of TOKENS definition (error case)
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 CHARACTERS
7 letter = 'A'..'Z' + 'a'..'z'.
8 digit = '0'..'9'.
9
10 TOKENS
11 ident = letter {letter | digit}.
12 ident1 = letter {digit} letter. /* tokens ident and ident1 cannot be distinguished */
13 number = digit {digit} | digit {digit} CONTEXT("..").
14 B1 = '\a'.
15 B2 = '\u0007'. /* tokens B1 and B2 cannot be distinguished */
16 C1 = "\u0008".
17 C2 = "\b". /* tokens C1 and C2 cannot be distinguished */
18 S1 = "+" "+".
19 S2 = "++". /* tokens S1 and S2 cannot be distinguished */
20 S3 = '+' '+'. /* tokens S1 and S3 cannot be distinguished */
21 X1 = "123..". /* tokens number and X1 cannot be distinguished */
22
23 PRODUCTIONS
24
25 Test = ident.
26
27 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of TOKENS definition (error case)
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 CHARACTERS
7 letter = 'A'..'Z' + 'a'..'z'.
8 digit = '0'..'9'.
9
10 TOKENS
11 ident = letter {letter | digit}.
12 ident1 = letter {digit} letter. /* tokens ident and ident1 cannot be distinguished */
13 number = digit {digit} | digit {digit} CONTEXT("..").
14 B1 = '\a'.
15 B2 = '\u0007'. /* tokens B1 and B2 cannot be distinguished */
16 C1 = "\u0008".
17 C2 = "\b". /* tokens C1 and C2 cannot be distinguished */
18 S1 = "+" "+".
19 S2 = "++". /* tokens S1 and S2 cannot be distinguished */
20 S3 = '+' '+'. /* tokens S1 and S3 cannot be distinguished */
21 X1 = "123..". /* tokens number and X1 cannot be distinguished */
22
23 PRODUCTIONS
24
25 Test = ident.
26
27 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of WEAK symbol
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = "a".
8 b = "b".
9 c = "c".
10 d = "d".
11 e = "e".
12 f = "f".
13 g = "g".
14 h = "h".
15 i = "i".
16
17 PRODUCTIONS
18
19 Test = A B C.
20 A = a WEAK b c.
21 B = a {WEAK b c} d.
22 C = a {WEAK b} c.
23
24 END Test.
0 $01246
1 /*-------------------------------------------------------------------------
2 Test of WEAK symbol
3 ----------------------------------------------------------------------------*/
4 COMPILER Test
5
6 TOKENS
7 a = "a".
8 b = "b".
9 c = "c".
10 d = "d".
11 e = "e".
12 f = "f".
13 g = "g".
14 h = "h".
15 i = "i".
16
17 PRODUCTIONS
18
19 Test = A B C.
20 A = a WEAK b c.
21 B = a {WEAK b c} d.
22 C = a {WEAK b} c.
23
24 END Test.