Mercurial > ~dholland > hg > ag > index.cgi
comparison examples/fc/fc1.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 AnaGram Programming Examples | |
3 FC1: Simple Fahrenheit to Celsius conversion | |
4 | |
5 | |
6 Copyright 1993 Parsifal Software. All Rights Reserved. | |
7 | |
8 This software is provided 'as-is', without any express or implied | |
9 warranty. In no event will the authors be held liable for any damages | |
10 arising from the use of this software. | |
11 | |
12 Permission is granted to anyone to use this software for any purpose, | |
13 including commercial applications, and to alter it and redistribute it | |
14 freely, subject to the following restrictions: | |
15 | |
16 1. The origin of this software must not be misrepresented; you must not | |
17 claim that you wrote the original software. If you use this software | |
18 in a product, an acknowledgment in the product documentation would be | |
19 appreciated but is not required. | |
20 2. Altered source versions must be plainly marked as such, and must not be | |
21 misrepresented as being the original software. | |
22 3. This notice may not be removed or altered from any source distribution. | |
23 */ | |
24 | |
25 grammar | |
26 -> integer:f, '\n' ={ | |
27 printf("%d\370F = %d\370C\n",f,5*(f-32)/9); | |
28 } | |
29 | |
30 (int) integer | |
31 -> '0-9':d =d-'0'; | |
32 -> integer:n, '0-9':d =10*n+d-'0'; | |
33 |