comparison tests/agcl/parsifal/iaparams.syn @ 0:13d2b8934445

Import AnaGram (near-)release tree into Mercurial.
author David A. Holland
date Sat, 22 Dec 2007 17:52:45 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:13d2b8934445
1 {
2 /* immed.syn */
3 #include <stdio.h>
4 }
5
6 [
7 ~allow macros
8 // header file name = "#.hs" // Output header name
9 // parser file name = "#.cs" // Output c file
10 ]
11
12 grammar
13 -> whole number..., 'x'
14
15 (int)whole number
16 -> number: n, ' ' = n;
17
18 (long) number
19 -> = 0;
20 -> number: n, !printf("(%ld)", n);, digit: i, !printf("(%d)", i); = i + 10*n;
21 /* The printf on the preceding line complains that i is undefined */
22
23 (int)digit
24 -> '0' = 0;
25 -> '1' = 1;
26 -> '2' = 2;
27 -> '3' = 3;
28 -> '4' = 4;
29 -> '5' = 5;
30 -> '6' = 6;
31 -> '7' = 7;
32 -> '8' = 8;
33 -> '9' = 9;
34
35 { void main() { iaparams(); } }