Mercurial > ~dholland > hg > ag > index.cgi
comparison doc/misc/html/examples/index.html @ 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 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> | |
2 <HTML> | |
3 <HEAD> | |
4 <TITLE>AnaGram Examples</TITLE> | |
5 </HEAD> | |
6 | |
7 | |
8 <BODY BGCOLOR="#ffffff" BACKGROUND="tilbl6h.gif" | |
9 TEXT="#000000" LINK="#0033CC" | |
10 VLINK="#CC0033" ALINK="#CC0099"> | |
11 | |
12 <P> | |
13 | |
14 <IMG ALIGN="right" SRC="../images/agrsl6c.gif" ALT="AnaGram" | |
15 WIDTH=124 HEIGHT=30 > | |
16 <BR CLEAR="all"> | |
17 Back to <A HREF="../index.html">Index</A> | |
18 <P> | |
19 <IMG ALIGN="bottom" SRC="../images/rbline6j.gif" ALT="----------------------" | |
20 WIDTH=1010 HEIGHT=2 > | |
21 | |
22 <BR CLEAR="all"> | |
23 | |
24 <H1>AnaGram Examples</H1> | |
25 | |
26 <IMG ALIGN="bottom" SRC="../images/rbline6j.gif" ALT="----------------------" | |
27 WIDTH=1010 HEIGHT=2 > | |
28 <P> | |
29 <BR> | |
30 | |
31 <H2>Introduction</H2> | |
32 <P> | |
33 The <tt>examples</tt> directory contains a number of subdirectories, | |
34 each of which contains one or more examples of the use of | |
35 AnaGram. These examples vary from trivial to moderately | |
36 complex. | |
37 <P> | |
38 The purpose of these examples is twofold: to provide a quick | |
39 introduction to AnaGram, and to suggest methods of using | |
40 AnaGram to solve problems. The examples are open source, with a | |
41 zlib-type license, and thus provided as is, | |
42 with no guarantees of any sort. You may freely copy | |
43 portions of these examples for your own use. However, in | |
44 doing so, you take on the responsibility of verifying their | |
45 performance and reliability. | |
46 <P> | |
47 Some of the examples provided use C; others use C++. Some | |
48 of the C++ examples make use of an old | |
49 <A HREF="../oldclasslib/index.html">class library</A>, found | |
50 in the <tt>oldclasslib</tt> directory of the AnaGram | |
51 distribution. This class library is deprecated and is | |
52 expected to be removed in a future release of AnaGram, once | |
53 the examples have been migrated away from it. It too is open | |
54 source; however, using it is not recommended. | |
55 <P> | |
56 The <tt>examples</tt> directory also contains the file | |
57 <tt>sbb-doc.txt</tt>. | |
58 This file contains productions and explanations for a number of | |
59 <A HREF="sbb-doc.html">syntactic building blocks</A>. These | |
60 are commonly used | |
61 syntactic constructs which appear over and over in AnaGram | |
62 programs. You may prefer to read this material in its HTML | |
63 form or as the | |
64 Syntactic Building Blocks appendix of the AnaGram User's Guide, but | |
65 <tt>sbb-doc.txt</tt> is easier to use if you wish to copy | |
66 parts of it | |
67 into your own grammars. | |
68 <P> | |
69 <BR> | |
70 | |
71 <H2>Getting Started with the Examples</H2> | |
72 To get started with AnaGram examples, you should begin by looking | |
73 at <tt>ffcalc</tt>, <A HREF=ffcex.html>annotated</A> in the | |
74 <A HREF=../start.html>Getting Started</A> document. The | |
75 source file is found in the <tt>examples/ffcalc</tt> directory. | |
76 <P> | |
77 If you are already quite familiar with syntax directed | |
78 parsing, you may need to do little more than glance at | |
79 <tt>ffcalc</tt> to begin using AnaGram effectively. | |
80 <P> | |
81 Otherwise, you should look at the examples in <tt>hw</tt> | |
82 and <tt>fc</tt>, and | |
83 read their documentation. These examples provide a tutorial | |
84 introduction to AnaGram through a graded sequence of | |
85 examples. | |
86 <P> | |
87 The remaining examples are provided largely as illustrations | |
88 of how to use AnaGram to deal with particular, practical | |
89 problems. | |
90 <P> | |
91 You can use this page as a starting point to navigate through | |
92 the hypertext documentation for the examples and class | |
93 libraries. | |
94 <P> | |
95 These examples only begin to illustrate the power of | |
96 AnaGram. Do not overlook the AnaGram User's Guide. It will | |
97 show you even more things you can do with AnaGram. | |
98 <P> | |
99 <BR> | |
100 | |
101 | |
102 <H2><A HREF="hw.html">HW</A></H2> | |
103 | |
104 The <tt>hw</tt> directory contains two versions of the traditional | |
105 "Hello, world!" program. One version, <tt>hw1.syn</tt>, uses C for | |
106 its reduction procedure. The other, <tt>hw2.syn</tt>, uses C++. | |
107 Both programs print "Hello, world!" These programs are | |
108 utterly trivial, but useful for getting started with the | |
109 mechanics of using AnaGram. | |
110 <P> | |
111 <BR> | |
112 | |
113 <H2><A HREF="ffcalc.html">FFCALC</A> | |
114 or <A HREF=ffcex.html>annotated version</A></H2> | |
115 A four function calculator is a traditional example | |
116 for parser generators. The <tt>ffcalc</tt> directory contains two | |
117 four function calculator examples, <tt>ffcalc.syn</tt> and | |
118 <tt>ffcalcx.syn</tt>. <tt>ffcalc.syn</tt> implements | |
119 expression syntax | |
120 using the conventional approach. <tt>ffcalcx.syn</tt> is | |
121 functionally equivalent, but uses a | |
122 deliberately ambiguous grammar with precedence declarations | |
123 to resolve the conflicts. | |
124 <P> | |
125 <BR> | |
126 | |
127 <H2><A HREF="fc.html">FC</A></H2> | |
128 | |
129 <!-- "graded"? --> | |
130 The <tt>fc</tt> directory contains six graded Fahrenheit to Celsius | |
131 conversion programs. These programs introduce a number of | |
132 the most important features of AnaGram. The document is | |
133 designed to be a tutorial, to lead you into using AnaGram by | |
134 simple steps. It includes an example of how to find and | |
135 fix the conflicts in an ambiguous grammar. All of the <tt>fc</tt> | |
136 examples use C. | |
137 <P> | |
138 <BR> | |
139 | |
140 <H2><A HREF="rcalc.html">RCALC</A></H2> | |
141 <tt>rcalc.syn</tt> is a simple four function desk calculator that | |
142 takes its input and displays its output using Roman | |
143 numerals. <tt>rcalc</tt> uses C. | |
144 <P> | |
145 <BR> | |
146 | |
147 <H2><A HREF="dsl.html">DSL</A></H2> | |
148 <tt>dsl.syn</tt> is a DOS script language, used in the past to | |
149 create an install program for AnaGram. It is now quite obsolete | |
150 but does illustrate some features of AnaGram. <tt>dsl</tt> is | |
151 largely composed of grammar elements copied from other | |
152 programs. <tt>dsl</tt> uses C++. | |
153 <P> | |
154 <BR> | |
155 | |
156 <H2><A HREF="mpp/index.html">MPP</A></H2> | |
157 The <tt>mpp</tt> directory contains a complete, working C macro | |
158 preprocessor together with your choice of two C grammars. | |
159 The preprocessor uses four distinct AnaGram grammars and | |
160 illustrates many of the ways you can interface parsers to | |
161 other modules. <tt>mpp</tt> uses C++. | |
162 <!-- | |
163 For an overview of the macro | |
164 preprocessor and how it works, read the <tt>README</tt> file | |
165 in <tt>mpp</tt>. | |
166 --> | |
167 Each grammar and each support module is separately described | |
168 in its own documentation file. | |
169 </P> | |
170 | |
171 <BR> | |
172 | |
173 <IMG ALIGN="bottom" SRC="../images/rbline6j.gif" ALT="----------------------" | |
174 WIDTH=1010 HEIGHT=2 > | |
175 <P> | |
176 <IMG ALIGN="right" SRC="../images/pslrb6d.gif" ALT="Parsifal Software" | |
177 WIDTH=181 HEIGHT=25> | |
178 <BR CLEAR="right"> | |
179 <P> | |
180 | |
181 Back to <A HREF="../index.html">Index</A> | |
182 <P> | |
183 <ADDRESS><FONT SIZE="-1"> | |
184 AnaGram parser generator - examples<BR> | |
185 AnaGram Examples<BR> | |
186 Copyright © 1993-1999, Parsifal Software. <BR> | |
187 All Rights Reserved.<BR> | |
188 </FONT></ADDRESS> | |
189 | |
190 </BODY> | |
191 </HTML> | |
192 |