Eli   Documents

General Information

 o Eli: Translator Construction Made Easy
 o Global Index
 o Frequently Asked Questions
 o Typical Eli Usage Errors

Tutorials

 o Quick Reference Card
 o Guide For new Eli Users
 o Release Notes of Eli
 o Tutorial on Name Analysis
 o Tutorial on Scope Graphs
 o Tutorial on Type Analysis
 o Typical Eli Usage Errors

Reference Manuals

 o User Interface
 o Eli products and parameters
 o LIDO Reference Manual
 o Typical Eli Usage Errors

Libraries

 o Eli library routines
 o Specification Module Library

Translation Tasks

 o Lexical analysis specification
 o Syntactic Analysis Manual
 o Computation in Trees

Tools

 o LIGA Control Language
 o Debugging Information for LIDO
 o Graphical ORder TOol

 o FunnelWeb User's Manual

 o Pattern-based Text Generator
 o Property Definition Language
 o Operator Identification Language
 o Tree Grammar Specification Language
 o Command Line Processing
 o COLA Options Reference Manual

 o Generating Unparsing Code

 o Monitoring a Processor's Execution

Administration

 o System Administration Guide

Mail Home

FunnelWeb

Next Chapter Table of Contents


Introduction

This chapter contains an example for a first funnelweb specification. The commands used in this example are explained and Eli is used to generate a documentation and to process the specification contained in this example.

@=~
~p maximum_input_line_length = infinity
~p maximum_output_line_length = infinity
~p typesetter = texinfo
~t title titlefont left "A First Funnelweb Specification"

The file ~{helloworld.lido~} contains a minimal Eli-Specification, which
accepts only the empty input file and prints ~{Hello, World~} to the
standard output.

~O~<helloworld.lido~>~{
RULE:   root ::= 
COMPUTE
        printf("Hello, World\n");
END;
~}

Copy this specification file into the file `first.fw'. Now, you can use the following Eli-derivations:

first.fw:exe > first.exe
Generates an executable processor from the specification and copies it as `first.exe' onto the harddisk.

() +cmd=(first.fw:exe) :stdout>
Generates an executable processor from the specification, runs it with an empty input file and shows its output.

first.fw :fwTexinfo :display
Generates the processor documentation and shows it in a window.

first.fw :fwTexinfo :dvi !xdvi
Generates the processor documentation and runs it through texinfo to generate a `.dvi'-file. Then, it executes xdvi to show the documentation.

first.fw :fwTexinfo :pdf !acroread
Generates the processor documentation and runs it through texinfo and pdflatex to generate a `.pdf'-file. Then, it executes acroread to show the documentation.

In the following, the different components of the above specification are explained.

@=~

A FunnelWeb-Specification-file is built up from normal characters and FunnelWeb Commands. Every FunnelWeb-command starts with the macro-character which is @ by default. Some times it would be more convenient to change the macro character to some other, less used character. The above command changes the macro-character to ~.

~p `maximum_input_line_length' = infinity
~p `maximum_output_line_length' = infinity

Normally, a funnelweb-specification file consists of lines with a maximal length of 80 and produces output-files consisting of lines, which are also 80 characters long. The above lines switch off these limitations.

~p `typesetter' =  `texinfo'

FunnelWeb can produce documentation in one of a number of different formats. The above line selects TexInfo and is needed to use the :fwTexinfo-derivation in Eli. See Specifying the Typesetter, for more information.

~t title titlefont left "A First Funnelweb Specification"

This is a special insertion that can be used to typeset a document-title for the generated document. Other possible insertins are a table of contents and a page break. See Formatting, for more information.

The file ~{helloworld.lido~} contains ... standard output.

Any text between Macro-definitions and output-file-definitions contains documentation that is processed when a formatted documentation is requested. You can structure your document (see Structure), change the font for text-parts (see Marking Text) and insert special text parts such as a title or a table of contents (see Formatting).

~O~<helloworld.lido~>~{
...
~}

The specification-parts that should be processed by Eli are marked as Output-files with this command. Any text between the opening and the closing brace goes into the specified file, `helloworld.lido' in this case. Another method of composing output text are macros which can have parameters and are substituted in the output file command.


Next Chapter Table of Contents