1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
This directory contains the source code for a simple Eiffel parser.
It uses Gelex to generate class EIFFEL_SCANNER and Geyacc to generate
classes EIFFEL_PARSER and EIFFEL_TOKENS.
Class EIFFEL_PARSER has three creation procedures. `make' just creates
a parser. `execute' creates a parser and parses the files given in the
command line, one by one. `benchmark' expects the command line to be made
up of a number 'nb' followed by a filename. It creates a parser and parses
'nb' times the file given as second argument.
Note: This Eiffel parser is just a simple example. It is not intended
to be perfect or to follow any Eiffel syntax standard. Moreover, it does
not generate any abstract syntax tree and there is no output.
To compile this example:
1. Use the script 'geant scanner' to generate class EIFFEL_SCANNER
if necessary.
2. Use the script 'geant parser' to generate classes EIFFEL_PARSER
and EIFFEL_TOKENS if necessary.
3. Choose either `execute' or `benchmark' as the creation prodecure of
the root class EIFFEL_PARSER in your Ace file (ISE Eiffel: ise.ace,
Halstenbach: hact.ace, SmallEiffel: se.ace) or your ESD file
(Visual Eiffel: ve.esd).
4. Use your favorite Eiffel compiler to compile the Eiffel system using
the provided Ace file (ISE Eiffel: ise.ace, Halstenbach: hact.ace,
SmallEiffel: se.ace) or ESD file (Visual Eiffel: ve.esd). Alternatively
you can use 'geant' to launch the compilation:
geant compile_<compiler>
where <compiler> is either 'ise', 'hact', 've' or 'se'.
5. Execute the Eiffel parser using
eiffel_parser filename1 ...
if you selected `execute' as creation procedure, or
eiffel_parser nb filename
if you selected `benchmark', where `filename', `filename1', etc. are
filenames containing Eiffel classes and `nb' is an integer.
--
Copyright (c) 1997-2001, Eric Bezault and others
|