|
IntroductionIn this documentation we will explain you how to use EiffelLex and EiffelParse in you Projects:
EiffelLex provides a set of efficient object-oriented mechanisms for lexical analysis, based on several kinds of finite automata, deterministic and non-deterministic. EiffelParse provides a set of object-oriented mechanisms for parsing, based on simple principles allowing a direct mapping from a BNF-like syntax specification to Eiffel classes - one per syntactic construct. The library and its design principles are described in detail, together with EiffelBase, EiffelLex and EiffelParse in the book Reusable Software: The Base Object-Oriented Component Libraries. A complementary tool, YOOCC, is available from Monash University (Melbourne,
Australia). Technical InformationEiffelLex is located in : $EIFFEL5/library/lex EiffelParse is located in : $EIFFEL5/library/parse Getting StartedYou just need to get the EiffelLex and EiffelParse directories, to work with these libraries. How to configure your Ace fileIn order to use EiffelLex and EiffelParse in an Eiffel Project, you have to include in your project, the right clusters and the right external files. Thus, you need to configure your Ace file. You can get all the information about Ace files here. To include the EiffelLex cluster you just need to include in your ace file : lex: "$EIFFEL5\library\lex"; To include the EiffelParse cluster you just need to include in your ace file: parse: "$EIFFEL5\library\parse"; You can check the examples to see a working Ace file. Some working examplesWe developed two examples that you can try to see how to use EiffelLex and EiffelParse
The example is located in the directory: $EIFFEL5/examples/lex In order to run this example, you need to copy the file eiffel_regular in the directory EIFGEN/W_Code of your project. Usage:
The example is located in the directory: $EIFFEL5/examples/parse In order to run this example, you need to copy the file test_file in the directory EIFGEN/W_Code of your project. Usage:
Example:
|