General Information
Tutorials
Reference Manuals
Libraries
Translation Tasks
Tools
Administration
|
Tutorial for Name Analysis Using ScopeGraphsName analysis is an important part of understanding text (see Fundamentals of Name Analysis of Name Analysis Reference Manual). Even in its simplest form it involves extensive computations over a tree representing the text to be understood (see Tree computations of LIDO -- Computations in Trees). Eli provides mechanisms to specify these computations in a natural way, simplifying the process of implementing name analysis. This tutorial uses a graded sequence of language design case studies to build an understanding of how to use Eli to specify name analysis. These case studies illustrate many aspects of name analysis that are seen both in standard programming languages and in special purpose languages. They may also be used as a source of hints for language design. We will refer to three actors in this document:
Our explanations of the case studies assume that you are familiar with the use of the Eli system (see Top of Guide for New Eli Users). Each explanation discusses the properties of the case study, the information that must be deduced from an input text, and the techniques by which that information is processed. Cross-references to Eli documentation (such as that attached to the first sentence of this paragraph) direct you to details and background. The cross-references are important for full understanding of the material. We have provided exercises for each case study to help you to understand the material. You can extract specifications from Eli to support these exercises, and if you follow this path we strongly suggest that you transfer to a directory that contains a single empty file named `Solutions.specs' before continuing. If you choose to use and modify specifications from your own language, you should transfer to a directory containing specifications for a scanner and parser producing an abstract syntax tree for that language (see Top of Syntactic Analysis). You can generate a "workbook" -- a FunnelWeb document that you can use to collect and protect your solutions to the exercises (see FunnelWeb of FunnelWeb). At any time, you can extract your specifications or obtain a printable copy of your work to date from this document. If you would like a workbook, execute the following Eli command to create one named `MyWork.fw' (the file name is arbitrary, but it must have a `.fw' suffix):
-> $elipkg/Name/LearnSG%Work > MyWork.fwThe generated file will not have write permission in your directory. You will need to add write permission in order to add your solutions. Personalize your workbook by changing the title and author(s) in order to verify that you can write to it. Put the name of the generated file into your `Solutions.specs' file.
|