322
Hri 318 061 A GENERATOR OF RECURSIVE DESCENT PARSERS FOR LL(K) 1/ LANGUGES(U) AIR FORCE INST OF TECH WRIGHT-PATTERSON AR OH SCHOOL OF ENGINEERING G B PAPROTNY DEC 83 UCAEDhhhhhhhhhhhhI F/ 9/ N EhhhhhhhhhhhhE 0111 EhhhhhhhhhhhhE EhhhhhhhhhhhhE EhhhhhhhhhEmhE EhhhhhhhhhmhhE

Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

Hri 318 061 A GENERATOR OF RECURSIVE DESCENT PARSERS FOR LL(K) 1/LANGUGES(U) AIR FORCE INST OF TECH WRIGHT-PATTERSONAR OH SCHOOL OF ENGINEERING G B PAPROTNY DEC 83

UCAEDhhhhhhhhhhhhI F/ 9/ NEhhhhhhhhhhhhE 0111EhhhhhhhhhhhhEEhhhhhhhhhhhhEEhhhhhhhhhEmhEEhhhhhhhhhmhhE

Page 2: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

I 3-

U- 11112.

I 1 1.25-1*111_L4

5,L -An3

%L

___ 20

Page 3: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

, A..

I..°., '

A

~OF

LL-

A GENERATOR OF RECURSIVE DESCENT

PARSERS FOR LL(K) LANGUAGES

THESIS

George B. PaprotnyCapt USAF

AFIT/GCS/MA/8 3D-6

DTIC

DEPARTMENT OF THE AIR FORCEDa,' AIR UNIVERSITY

J AIR FORCE INSTITUTE OF TECHNOLOGYWright-Patterson Air F -rce Base, Ohio

k 5.- - .... 8 4 1'..

* '"'-*i* p,..,, .-. * t,,,_.' . ^ , , . .4:: ..._.._.L, ... A

Page 4: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

AFIT/GCS/MA/8 3D-6

Accession For-% NTIS G£A&I

- DTIC TAB U]Unannounced UJustification-

Distribution/ ..AvalabilitY Codes0!

IDist Special

LL -

A GENERATOR OF RECURSIVE DESCENT

PARSERS FOR LL(K) LANGUAGES

THESIS

George B. PaprotnyCapt USAF

AFIT/GCS/MA/8 3D-6

DTICS ELECTE

Approved for public release; distribution unlimited

ti

*'j,. , ,- . .- . : , - ., - .. ..... .-.. _. ..S. .. ...S. .-*. .- .- ... . S ....... - . . .. -. .., - .

Page 5: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

F..

. .AFIT/GCS/MA/83D-6

LL -

A GENERATOR OF RECURSIVE DESCENT

PARSERS FOR LL(K) LANGUAGES

THESIS

Presented to the Faculty of the School of Engineering

of the Air Force Institute of Technology

Air University

in Partial Fulfillment of the

Requirements for the Degree of

Master of Science

by

George B. Paprotny, B.S.

Capt USAF

Graduate Computer Science

December 1983

Approved for public release; distribution unlimited

64

U ?" ~. .

[:* *. V U ' ;**

Page 6: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

Preface

This thesis has been the most monumental task that I

have ever undertaken. However, because of that, and because

I completed it and met my objectives, I have learned much

about patience and perseverance. I have to thank my wife,

Jan, for putting up with me through the months of torture

that this thesis has brought. Without her smiling support,°o "

I never would have finished.

-." George B. Paprotny

-.4

4- .4%

4.4 ii

* *' .*.* -*.**.".* -". *-".'-'-" ,

Page 7: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

Table of Contents

Page

iPreface .. .. .. .. . .. .ii ....

List of Figures . . . . . . . . . . . . . . . . . . . vSNotation . .. .. .. .. ............ vi

.Glossary . .. .. .. .. ............ vii

iAbstract . .. .. .. .. ............ ix

I. Introduction ............ . .. . I-iThesis Justification .I............1-2Problem Statement . . .I........... 1-3Sequence of Presentation . . . . . 1-4

II. Compiler Theory Basics , . . . . . . . . . II-1Compiling and Parsing . . ......... . . II-1Language Theory ......... . . . .. .11-2Parsers . . . . . . . . . . . . . . . .. . 11-8LL(k) and LR(k) Grammars . . . . . . . . 11-8Finite StateAutomata....... . . . . . O-10

III. Standard Data Structures and Techniques . . . . III-1Introduction . . .............. III-iRegular Expressions and Extended BNF . . . . III-1ProductionTrees . . . . . . . . . . . . . .111-3First and Follow Sets . . . . . . . . . . . . 111-4Parser Creation Algorithms . . . . . . . . . 111-7

IV. Requirements and Design . . . ........ . IV-IIntroduction . . . . . . . . . . . . . . . IV-lDesign Methodologies . . . . . . . . . . . . IV-ICommenting. . . . . . . . . . . . IV-2Requirements and Design Decisions IV-3

V. Input Format ..................... V-1Introduction . . . . . . . . . . . . . .. V-1Relationship to YACC and LEX . . . . . . . V-1General InputtFormat ........ V-2Lexical Analyzer Definition . . . . . . . . v-3Production Rules Format ........... .. V-5

VI. Data Structures ..................... VI-IIntroduction . ............... VI-1Finite State Automata (FSA) . ..... . VI-2Production Trees ..... . . . . . . . VI-2

iii

Page 8: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

V

Page

Token Definition Structure .......... ... VI-4

VII. Algorithms ..... . . VII-1Introduction ...... . . . . . . . . . . VII-lThe Input Method ....... . . . . . . . VII-lNDFSA to DFSA Conversion ...... . . . . VII-4Decorating the Production Trees . . . . . . VII-7

VIII. Parser and Lexical Analyzer . . . ... . VIII-lIntroduction ................ VIII-1General Structure ..... . . . . . . .VIII-lThe Lexical Analyzer....... . . . . VIII-2The Parser o..P..... . . . . . . . . ..... VIII-4The Values of Productions........ . VIII-6

IX. Test Plan .................. IX-lIntroduction . ......... ....... IX-lGeneral TestPlan............ . IX-2Special Cae......................I-SeilCases ............... IX-3The ADA Test ................ IX-4

X. Conclusions and Recommendations ....... X-1Conclusion . . . . .......... . . . X-1Recommendations ............... x-2

Bibliography ...... ......... . . . .. Bib-i

Appendix A: FIRST 1 and FOLLOW1 Set Calculation . . A-1

Appendix B: LL(l) Parser from Production Trees . . B-I

Appendix C: Data Flow Diagrams .. .......... . C-I

Appendix D: Structure Charts . . . . . . . . ... D-1

Appendix E: Regular Expression Forms Used in LL E-1

Appendix F: Production Rule Format . . . . . . F-i

Appendix G: FSA for Each Regular Expression Form G-1

Appendix H: Maximum Possible K Algorithm . . ... H-1

Appendix I: LL Output for a Partial ADA Grammar I-1

Appendix J: LL User's Manual .. ........... . J-1

Appendix K: Code for LL . . . .............. K-1

!i!Vita . . . . . . . . . . . . . . . . . . . . . . . .Vita-i

iv

Page 9: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

-%76

-List of Figures

Figure Page

1. Example Production Trees . . . . . . . . . . 111-4

2. Finite State Automata Data Structures . . . VI-2

. 3. Production Tree Data Structures . . . . . . VI-3

4. Example FSA Creation ....... ....... VII-3p m

5. Non-Deterministic FSA Example . . . . . VII-5

6. Empty Transition Removal ... .......... .. VII-6

7. Conversion of Multiple Transitions . . . VII-6

8. Last Multiple Transition Conversion . ... VII-7

9. After Deleting Inaccessible Transitions VII-7

10. Decorate Production Tree Algorithm . . . VII-8

11. Structure of the Lexical Analyzer . . . VIII-3

12. Example of First Set Calculation . . . o IX-3

13. Possible Core Use Reductions .. .. .... X-4

-a

"4

.4

'5. - -* °...vs. . . • • . . . " . ,

Page 10: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

Notation

0 - the empty set

Z - the alphabet for a language

*c - the empty string, or 'is a member of'

U - union

n - intersection

-> - x expands to y, in production rules, as in x -> y

=> - x expands to y, in the description of a parse

=>+- x expands to y in 1 or more production rule applica-tions

=>*- x expands to y in 0 or more production rule applica-tions

-xI - the number of tokens in the string x

x+ - the set of all strings drawn from x of length >= 1

x* - the set of all strings drawn from x of length >= 0

* - closure

+ - closure plus

- option

* - concatenation

- alternation

vi":'.

°. ".. .... ....

. . . . . . .. . | . . . . . .. .. . . .. . . , . . . .,.

Page 11: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

Glossary

BNF - (Backus Naur Form) a standard method of describingthe productions in a grammar

Code Generation - the process of creating executable codebased on what tokens the parser has seen

Compiler - a program that accepts a string of charactersand processes them to determine whether the stringexists in the language, and to perform some action(normally produce object code) based upon the string

Deterministic - a process that always knows what to dobased on the input

EBNF - (Extended BNF) BNF with additional rules for de-scribing a grammar more succinctly

Grammar - a set of rules that defines the valid forms ofa language

LL(k) - used to describe a grammar which can be determinis-tically parsed top-down with a lookahead of k symbols

4 Left Recursion - denotes a production which, when it isexpanded, can end up with the production's non-terminalon the left hand side of the sentence created

Lexical Analysis - the process of breaking input down intotokens for use by the parser

4 Non-deterministic - a process that must backtrack when itdiscovers that its actions were incorrect based on theinput

Non-terminal - symbols in a grammar which define acceptablesentential forms, and are expanded to find acceptablestrings of tokens

Parsing - the process of accepting tokens and determiningwhether a string of tokens is acceptable in thelanguage

• Production - one rule in a grammar

Sentence - an acceptable string in a language

. . Sentential Form - a string of terminals and non-terminalsthat occurs during a parse

vii

" " ~° ',o' ' % .'- . ." ,. ". " . . . . , . •.'• .- . . .*- . . . *. . • . " ", - .- ' .... . . ..* * .* % *. . , " "- -

Page 12: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

Start Symbol - the non-terminal a compiler must begin with

to perform a correct parse

String - a sequence of tokens

Strong LL(k) - describes a grammar for which a parser does"* not require knowledge of the complete sentential form

to parse deterministically

Terminal - same as a token, except used in reference to agrammar

Token - one item in a language's alphabet

v.

IG

b.

Page 13: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

AFIT/GCS/MA/83D-6

Abstract

A computer program was designed to generate a recursive-

descent compiler for LL(k) languages. crammar specification

language was designed using Extended E along with a lexical

analyzer specification language using - "lar expressions.

The program uses a well-tested but not formally proven

method for determining the maximum possible k for a grammar.

-It then uses an iterative first and follow set calculation

algorithm to determine the actual k for the grammar.

V

ix

Page 14: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

LL -

A GENERATOR OF RECURSIVE DESCENT

PARSERS FOR LL(K) LANGUAGES

I. Introduction

In some form or another, compilers have been in existence

almost since the very first computer was created. They have

been called assemblers, translators, and interpreters, but

they all have had one purpose, which is to take a high level

representation of a computer's instruction set and convert it

through one or more steps into an executable program. The

purpose of these compilers, along with the languages they

represent, was, and still is, to decrease the programmers'

workload by allowing a program to be created in a language

more like English.

These representations of machine language have slowly

evolved into a complex s-t of languages such as FORTRAN,

COBOL, PASCAL, etc. Each one is different, and each needs

its own compiler. Traditionally, each language has also

needed a separate compiler for each machine, because each

machine's instruction set is different. Thus, a whole new

specialty within computer science has arisen, namely, compiler

writing.

As will be seen in this thesis, most compilers can be

set up in similar ways, and can have almost interchangeable

SI-I

-.9

¢*; ~~. . .... . . . . .... .. .- .. . . . ... . .. ,.. . ... .... . ... . . .-..-..

Page 15: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

NW .7

parts. Thus, as computers and language theory has progressed,

we have been able to define standard techniques for repre-

senting language structures and for creating the compilers

from those structures. In fact, the state of the art has

progressed to the point that some portions of compilers can

be automatically created for many languages.

Unfortunately, we have been unable to automatically

create compilers for languages such as ADA. [DARPA, 1981]

ADA is a highly complex language that has been in development

since 1974, and even though it has been completely specified

since 1981, only three compilers have been written for it so

far. If a compiler generator could be created that would

accept ADA, the compiler writing task would be simplified,

and the cost of creating the compiler considerably reduced.

Thesis Justification

There is a relatively small number of compiler generators

available on the market today; and, every one the author found

in his extensive literature search [Gert, 1981] [Johnson,

1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks,

which are:

a. Each one will create a compiler for those languages

which only require the compiler to examine the next input in

the source program. (ADA requires the compiler to look ahead

two inputs.)

b. The generators universally create compilers which

consist of a small program with a very large array. This

1-2

.* * *. *-.

.. . . . -. - *..\.'.. - .

Page 16: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

array defines e specifics of the language. So, these com-

pilers are almost unintelligible. As will be seen in the

*Q Compiler Theory Basics chapter, it turns out that the class

of languages that the currently available compiler generators

can use is called LR, and that a readable compiler can be

created from the class of languages called LL. (An LL Ian-

*- guage which requires the compiler to look ahead k inputs is

"- normally called an LL(k) language.)

There seems to be a gap in the software available to

compiler writers. If a compiler generator could be created

to examine the specification for a language and make portions

. of a compiler for it, regardless of the required lookahead,

-" and if that compiler could be created in a manner that could

' be easily understood, (and modified if necessary), compiler

writers would be far ahead of where they are now, and could

concentrate on the problems that languages such as ADA create.

Problem StatementC,.

This thesis is concerned with developing software that

will generate recursive-descent parsers for LL(k) grammars.

This generator (called LL throughout this thesis) will accept

a specification for a grammar, determine whether it is LL(k)

for some k, and create the parser. It will also accept a

specification for the lexical analyzer for that grammar, and

create an analyzer that will operate as an integral part of

the parser. Finally, the parser generator will accept user-

.... supplied code fragments as part of the grammar, to allow the

1-3

, 4

- ,V . . . -, , , . . . , ,. . . ., . . ..- . . . . .. . . . . . , - . . .

Page 17: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

.%1

user to process application-unique code during the parse.

(Especially semantic analysis code.)

Sequence of Presentation

The presentation of the material in this thesis (chapter

by chapter) is as follows:

a. Compiler theory basics.

b. Standard data structures and techniques, with algo-

rithms used in parts of the project.

c. Design and requirements decisions, with justification

.-' for choice of design tools, and major project decisions.

d. Input format, with justification for placement and

format of each part of the input.

e. Algorithms, with descriptions of the major algorithms

used in LL.

f. Data structures, with complete descriptions of all

global structures used.

g. Parser and lexical analyzer output, with descriptions

of the data structures, support subroutines, and code used for

each part of the output of LL.

h. Test plan, with philosophy of testing, and general

structure of testing procedures, along with descriptions of

all special cases.

i. The conclusion and recommendations, with a discussion

of the project, and opinions of the author.

1-4I,

[ _ - - .- . . . " . . .. . . .. . - . .. . , . . ...

Page 18: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

" -°

II. Compiler Theory Basics

This chapter will define the terminology and theory

needed in the chapters that follow. It will discuss compiling

and parsing, language theory, parsers, grammars and finite

state automata.

Compiling and Parsing

Traditionally, a compiler is a program that translates

a source program (written in some high-level language) into

object code (some representation of the computer's machine

language). The compilation process is usually considered to

have three phases. These are: [Davie, 1981: 11-14]

1) Lexical Analysis. This first phase accepts the

actual source program, and divides the character stream into

units called tokens. A token may be a single character, but

it is usually some sequence of characters. For example,

"BEGIN", "(" and "PROCEDURE" are all tokens in PASCAL. Lexi-

cal analyzers also remove comments, spaces, and special con-

trol commands from the source input.

2) Parsing. The tokens generated during lexical analy-

sis are passed directly to the parser, which must determine

whether the program is syntactically and semantically correct.

The parser usually follows some well-structured set of rules

to determine correctness, and to structure the program for

the code generator.

II-1

Page 19: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

3) Code Generation. This phase accepts the structural

'. output of the parser, and creates the object program. Gener-

ally, optimization on the object code is performed at various

points in this phase. Some compilers mix the parsing and

code generation to avoid the intermediate representation of

the original program.

Lexical analysis is usually not discussed in compiler

theory textbooks, because it is the easiest of the three

phases to understand. Many compiler generators have some

easy way to specify the rules for token creation.

Parsing, on the other hand, has a large body of theory

devoted to it. Almost all of language theory applies exclu-

sively to the syntactic analysis of programs. The other part

c. of parsing, semantic analysis, has almost no developed theory.

Therefore, existing compiler generators usually take care of

syntax examination automatically, and leave any semantic work

for explicit inclusion by the user.

The last phase of compilation, code generation, is the

only one of the three that is still almost entirely an ad hoc

process. Some work has been done in the specification of

program semantics, but there are still many difficulties.

[Leverett, 1980: 38-40]

Language Theory

*.Z Before beginning any discussion of automatic compiler

* generators, a basic understanding of language theory is neces-

sary.

... I -11-2

°.

Page 20: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

Language Elements. The basic element of a language is

the token. Tokens are analogous to letters in a natural

language (i.e. English) since they are the basic building

blocks of the language. Each language has a finite set of

tokens, called its alphabet. The alphabet is usually desig-

nated E. Every source program is a sequence of tokens drawn

from its language's alphabet. In this thesis, tokens will be

represented by letters drawn from the beginning of the English

alphabet (a,b,c etc.). [Gries, 1971: 151

A string is a sequence of tokens drawn from E. The set

of all possible strings of length 1 or more is E+. The string

of length zero (the empty string) is written e. The closure

of E, or the set of all strings of length 0 or more, is E*,

which is equivalent to (Z+ U e). Strings are usually repre-

* sented by lower case letters drawn from the end of the alpha-

bet (w,x,y, etc.). [Gries, 1971: 15]

Grammars and Languages. A language is some subset of

E*. This subset may be finite or infinite. Most programming

languages have no bound on the length of strings, therefore

they are infinite. A language must also have a structure.

There must be a set of rules that determine the various ways

that tokens from E may be organized to form strings in the

language. This set of rules is called the language's grammar.

A grammar consists of terminals and non-terminals. A

terminal is a member of E, and is the same as a token. A

non-terminal serves as a placeholder in the grammar, and is

11-3

S.............................

Page 21: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

not in E. Each non-terminal stands for some set of strings

in E*. For example, consider the structure of telephone

numbers in the United States. [Barrett, 1979: 18] A tele-

phone number might be:

(212) 438-7021 (1)

This can be represented by the following structure

<area code> <exchange> <party> (2)

* .Each of these three also has its own structure. For example,

the area code might be:

(<digit><digit><digit>) (3)

where a digit is one value from (0,1,2,...,91. In this exam-

ple, <area code>, <office>, <party>, and <digit> are non-

terminals, and 0..9, dash, and parentheses are terminals.

Throughout this thesis, non-terminals will be represented by

a capital letter.

Grammars are represented by production rules, or produc-

tions, of the form x -> y where x and y are strings in a

.5 language's terminal and non-terminal set. (Aho, 1972: 85]

For general productions, y may be any string of terminals and

non-terminals, including e, and x may be any string of non-

terminals and terminals, where there is at least one non-

terminal in x.

These production rules are used to derive strings from

other strings, that is, from

w x z (4)

and applying x -> y, we derive

w y z (5)

.o11-

-""

Page 22: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

In order to specify the language completely, some start-

ing string must be specified. If we could begin with any

string at all, we would end up with Z* as the language. Thus,

*some string w is usually specified as the starting string.

In fact, a single non-terminal is normally designated the

start symbol, with no loss of generality. This is so because

we can always have a production S -> w to begin a grammar.

When strings are derived in the language, the derivation

process ends when no more non-terminals exist in the string.

S. Thus, the terminal and non-terminal sets must be disjoint.S"..

Also, the reason for forcing all productions x -> y to have

at least one non-terminal in x now becomes clear. We are not

supposed to derive a new string from any string that consists

of only terminals.

Now we have all the necessary ingredients for a formal

.'," definition of a grammar. A grammar G is a tuple (N,E,P,S),

where N is the set of non-terminals, E is the set of termi-

- nals, P is the set of productions, and S is the start symbol.

[Barrett, 1979: 20]

Classes of Grammars. There are basically two grammar

classes that take on the form described earlier. These are:

context-sensitive, and context-free. [Barrett, 1979: 21-25]

The most general grammars are the context-sensitive

grammars. These are characterized by productions of the form

X-> y (6)

where x and y are elements of (E U N)*, where x contains at

least one member from N, and the length of x is less than or

11-5

* 5i *4* ... **.- *.. I .I- * 5

Page 23: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

- %

equal to the length of y (lxi <= jyl). Note that this ex-

* '--':" cludes any production of the form x -> e. An example of a

context-sensitive grammar is: [Barrett, 1979: 20-21]

S -> aSBC (7)

S-> abC (8)

CB -> BC (9)

bB -> bb (10)

Cc-> cc (11)

and a possible derivation, with the rule used at each step,

IS

S (12)

aSBC S -> aSBC (13)

aabCBC S-> abC (14)

aabBCC CB -> BC (15)

aabbCC bB -> bb (16)

aabbcC bC - bc (17)

aabbcc cC-> cc (18)

. The other class is the set of context-free grammars.

These are the most common grammars, and the syntax for most

programming languages is specified in some form of a context-

free grammar. These grammars have productions of the form

A-> x (19)

where A is a member of N, and x is an element of (E U N)*.

,. Note that in this case x may be e. A standard example of a

context-free grammar is the following arithmetic expression

grammar:

11-6• .i

** •% *q• * * * % . *. .

Page 24: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

*! ,..- G = ( {E,T,F}, {+,*,(,),a}, P, E ) (20)

where P is the set of productions

E ->E + T (21)

E -> T (22)

T >T *F (23)

T-> F (24)

F-> ( E) (25)

F-> a (26)

An example string, with a derivation starting at E, might be

E (T+T)*F E -> T (27)

T-> T (F+T)*F T F (28)

T*F T> T *F (a+T)*F F ->a (29)

F*F T -> F (a+F)*F T-> F (30)

(E)*F F-> ( E ) (a+a)*F F-> a (31)

(E+T)*F E -> E + T (a+a)*a F -> a (32)

Sentential Forms. Derivations in a language are de-

scribed in a manner similar to the material we have already

discussed. One derivation step in a transformation is denoted

wxz => wyz (33)

(Remember our original example, where x -> y was the produc-

tion used.) In this example, wxz and wyz are sentential

forms, if the derivation began with the start symbol.

[Gries, 1971: 20] One or more derivation steps is =>+, and

zero or more is =>*. A sentential form that consists of only

terminals is called a sentence.

-* .From these definitions, we can define a language L which

11-7

- . *

Page 25: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

* .

d

is described by a grammar G, as [Barrett, 1979: 27]

L(G) = { x x e E* and S =>+ x } (34)

Parsers

As previously mentioned, parsers determine the syntactic

correctness of programs. There are two basic types of

parsers: top-down and bottom-up. [Pyster, 1980: 34-71]

Top-Down Parsing. Top-down parsers attempt to recognize

a sentence by beginning with the start symbol, and using the

production rules to replace the non-terminals in the various

* derivation steps with the right-hand sides of the productions.

A top-down parser uses a leftmost derivation. This means the

non-terminals in the sentential form are replaced by their

productions in a left to right order. Note that the example

0arithmetic expression derivation was leftmost.Bottom-Up Parsing. On the other hand, bottom-up parsers

accept symbols from the source program, and attempt to work

from the sentence up to the start symbcl. Thus, as symbols

are collected, the right hand side of the sentential form is

examined and replaced with a new non-terminal. This corres-

ponds to a rightmost derivation (always replacing the right-

most non-terminal), in reverse order (bottom-up). Note that

the parse is still being performed left to right.

LL(k) and LR(k) Grammars

LL(k) and LR(k) grammars correspond to top-down and

bottom-up parsing, respectively. [Berry, 1982: 17-191 Both

" . °1-

"" II-8

- t -.- '* , S.*. S. *.* . . . . . . . . .

Page 26: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

type of grammars are the largest subset of the context-free

grammars for which a deterministic parser can be constructed

for their parser type (with lookahead of k symbols).

[Aho, 1972: 333,371] A deterministic parser with lookahead

is one that always knows which production to use at any stage

in the parse, based upon the sentential form already created,

and the next k symbols in the input.

It is interesting to note that, traditionally, LR

(bottom-up) parsers have been written as table-driven pro-

grams. That is, the parser program is quite small, and serves

only to manipulate the input and examine tables, which are

generally represented as large arrays of integers. (See Aho

'a [Aho, 1972: 368-3961 for details on table-driven parsers.)

p' LL parsers, on the other hand, are traditionally written as

large groups of recursive procedures, where each procedure

-corresponds to one production in the grammar. Note that these

recursive, top-down parsers are uniformly designated recur-

sive-descent parsers. [Davie, 1981]

Formal LL(k) Definitions and Properties. This thesis is

concerned with parser construction for LL(k) grammars. There-

fore, some definitions of what constitutes an LL(k) grammar

are now in order.

Formally, a grammar G is LL(k) if, for every production

A -> x in G, [Barrett, 1979: 148]

S =>* wAy => wxy =>* wz... (35)

* and

.1I-9

4 q* % "-"% '% , "% "% ,,. "." , . "% . - % " " , " . . " . " . "

Page 27: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

S =>* wAy => wx'y =>* wz... (36)

where Izi = k and z e Z*, then

x = x' (37)

There is an important theorm that involves LL(k) gram-

mars, which is: An LL(k) grammar has no left-recursive non-

terminals. [Barrett, 1979: 149-150] An example of a left-

recursive grammar which fails to be LL(k) follows:

Let G have the productions

A-> Ax (38)

A ->y (39)

Then we have two derivations

k-1 k kS =>* wAz =>+ wAx z => wAx z => wyx z =>* wr... (40)

and

S =>* wAz =>+ wAxk - 1 Z => wyxk- I z =>* ws... (41)

i I iwhere x means xxx...x, with lxxx.. .x = i. It is easy to

k-i k-isee that if Irl = Isl =k, then r yx and s =yx ,so

r = s, but the two derivations are different. This results

in an ambiguity.

Finite State Automata

Definition. A finite state automaton (FSA) is a system

which has states, and transitions between those states.

Based on an input, a FSA will move between its states along

the transitions. A FSA is always considered discrete, that

is, it is always in exactly one state, or is moving through

exactly one transition to another state. [Barrett, 1979: 63]

II-10

* -. - * ,

Page 28: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

A finite state automaton has four parts. These are:

a. A start state

b. A set of intermediate states

c. A set of ending states

d. Transitions between states

This simple apparatus can recognize input defined by regular

expressions, [Barrett, 1979: 104-110] which are defined ex-

tensively in Chapter III. Since regular expressions can

easily define the tokens for a language, this will be impor-

tant to LL.

Non-Deterministic vs Deterministic FSA. A FSA is deter-

ministic when no choices are provided in any of its moves.

Each move is completely specified by the current state andthe next input. A non-deterministic finite state automata

(NDFSA) is one in which arbitrary choices are permitted in

some of its moves. Therefore, a NDFSA is forced to backtrack

if it can not continue its moves, because it may have made an

arbitrary choice, and must go back to take a different choice.

A NDFSA is defined exactly the same as a deterministic

FSA (DFSA) with two additions. A NDFSA may have multiple

transitions on the same input from the same state, and it may

have empty transitions, that is, a transition where no input

qis processed.

FSA Representation. In this thesis, FSA are diagrammed

as follows:

a. States are circles containing state numbers.

i.[- II-11

Page 29: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

b. Directed arcs from one state to another are transi-

tions. Each arc will have a character or £ (empty) marking

.- [ it.

c. The start state will be state 1. Also, no start

state will be an ending state.

d. The ending states will have a double circle. If

some end state has an action that must be performed, there

will also be an action number in parentheses.

.11

im11-12

* - - . .o. . . . . . . . . . .

Page 30: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

.,,V o;W

III. Standard Data Structures and Techniques

Introduction

There have been many tools and techniques relating to

compiler construction described in the literature. This

chapter will describe some of these techniques.

First, regular expressions and extended BNF will be dis-

cussed. Then, production trees and their construction will

be defined, followed closely by First and Follow Set construc-

tion using these trees. And last, an algorithm for automatic

LL(l) parser construction will be described.

Regular Expressions and Extended BNF

Backus-Naur Form. Backus-Naur Form (BNF) is a practical

* method of specifying a grammar. [Davie, 1981: 39] In it,

the symbol -> is replaced by ::=, non-terminals are sur-

rounded by "<" and ">", and two productions such as A -> x

and A -> y can be represented as A ::= x I y. (The symbol I

is used as "or".) For example, the arithmetic expression

grammar specified in the Language Theory Section of Chapter

II might be represented in BNF as

<E> :: <E> + <T> I <T> (42)

<T> :: <T> * <F> j <F> (43)

<F> :: ( <E> ) a (44)

Regular Expressions. A regular expression is a compact

way of representing the grammar of a regular language.

,111-1

c- , ... .... .. ......* *.* ....*....... .. . * - .. ,* ..- .... . .. .. -. .A. -, o

Page 31: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

[Barrett, 1979: 100] Regular languages are a subset of the

context-free languages, and are represented by productions

of the form

A -> aB where B e N, and a E Z (45)

and

A->b where beE (46)

Regular expressions are quite formal, and have three basic

operations. These are concatenation, alternation, and

closure. Parentheses may also be used. In the following

definitions, E and F are regular expressions, x and y are

strings, and X and Y are sets of strings.

4... a. Concatenation is represented by placing two regular

expressions next to each other. EF is the concatenation of

, o 'E and F, and is formally

EF= x x E and y e F} (47)

b. Alternation is represented by I or +. (This thesis

.-. will always use I-) EJ F is the alternation of E and F, and

is formally

El F {x x E or x F (48)

c. Closure is represented by {E}, and is formally

{ E } = { xY x e E and Y e {E} U {e} (49)

d. Parentheses may surround any part of a regular ex-

pression to change the way the expressions are handled. For

example, ablbcd is equivalent to (ab)l(bcd), not a(bjbc)d.

The symbols {, }, (,), and j are all in the regular

111-2

Page 32: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

.

.i.

expressions, and therefore can not be used as part of anylanguage a regular expression represents. A solution to this

might be to surround any occurrences of these characters in

the language by quotes.

Extended BNF. Regular expressions and BNF have been

combined in a relatively straightforward way to come up with

a more concise grammar specification language called Extended

BNF (EBNF). [Gert, 1981: 2-6] Unfortunately, there is no

standard for EBNF, but the methods in use are similar enough

to avoid confusion. A common one is described here.

The symbols [ and I are used in EBNF to show that a

* particular string is optional; i.e. it can occur 0 or 1 times.

Then, the EBNF production

<A> :=a~bc~d (50)

is equivalent to the BNF production

<A> ::= abcdI ad (51)

The symbols { and } are used to show that a string can

occur 0 or more times. Then, the EBNF production

<A> ::= a{bc}d (52)

is equivalent to

<A> :: a<B>d (53)

<B> :: bc<B> re (54)

Production Trees

Barrett [Barrett, 1979: 178-179] has a method of repre-

senting productions that can be useful in parser construction.

111-3,l.

,.. . - . - ... . . . . . . . . . . . . . . . .. . . . . . . . .

Page 33: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

He represents EBNF as production trees.

Each production tree in a set represents one non-terminal

A. The interior nodes are from the set {., , *, ? } ,

where - is concatenation, I is alternation, * is closure, and

? is option. Since - and I are binary operations, each has

two children in a tree. But * and ? are unary operations, and

therefore each has one child. The leaves of the tree are from

the set N U E U {e)

As an example, the grammar G with productions

S -> a{B}d (55)

B ->[bic Ibb (56)

can be represented by the production trees in Figure 1.

First and Follow Sets

S. i When the definition of LL(k) grammars was given earlier

in this thesis, we saw it was: A grammar G is LL(k) if and

only if for every production A -> x in G,

S => wAy => wxy =>* wz... (57)

S -

a

B

and

Figure 1. Example Production Trees

'1 1

" S...III-

Page 34: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

7.7.. . . . . . . .7. .... . . . .. . . . . . ..

and

S =>* wAy => wx'y =>* wz... (58)

where izi = k and z £ then

x = x' (59)

This definition does not appear to be easy to implement

in an algorithm, so it might not be useful for reading a

grammar and determining if the grammar is LL(k). But, first

and follow sets appear to solve this problem.

The FIRSTk set of a string w is defined as [Aho,1972:300]

{ x I w =>* xy and lxi = k or w =>* x and lxi < k 1 (60)

and the FOLLOW set of a string is defined as [Aho, 1972:k

3431

x I S =>* vwy and x e FIRSTk (y) } (61)

With these definitions, we can define an LL(k) grammar as

follows: [Barrett, 1979: 153]

A grammar G is LL(k) if and only if, for every pair of produc-

tions

A-> u and A-> v (62)

and every leftmost sentential form wAx derivable in G,

FIRSTk (ux) n FIRSTk (vx) = 0 (63)

Note that for this sentential form, x is FOLLOW (A). Thisk

means that the definition can be restated as follows:

G is LL(k) if and only if for every pair of productions.'%

A-> u and A-> v (64)

and every leftmost sentential form wAx derivable in G,

FIRST (u FOLLOWk (A)) l FIRST (v FOLLOWk (A)) = (65)

k k k

111-5

Page 35: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

This definition of LL(k) is only valid for each senten-

tial form wAx. It is not true for all forms of that type.

An example of this is the following grammar G with produc-

tions

S-> aBbc I Bc (66)

B-> b I c IC (67)

In this grammar, S derives aBbc and Bc. For aebc, the possi-

ble sentences in G are abbc, abcc, and abc. So, for aBbc,

FIRST2 (b FOLLOW2 (B)) = bb (68)

FIRST2 (c FOLLOW2 (B)) = cb (69)

FIRST 2 (e FOLLOW2 (B)) = bc (70)

which are all pairwise disjoint. For Bc, the possible sen-

* -tences in G are bc, cc, and c. So, for Bc,

FIRST 2 (b FOLLOW2 (B))= bc (71)

FIRST2 (c FOLLOW2 (B)) = cc (72)

FIRST (e FOLLOW (B)) = c (73)2 2

which are also pairwise disjoint. However, if the calcula-

tions were performed without regard to the leftmost sentential

form, the six FIRSTk sets would not be disjoint, because the

db string bc occurs in two different calculations. [Barrett,

- 1979: 155]

A grammar which has disjoint FIRST sets without consid-

ering the leftmost sentential form is defined to be strong

LL(k). The difference between a strong LL(k) grammar and an

LL(k) grammar will become important when generating a parser

for the grammar. Succinctly stated, it is easier to look

111-6

V.-."- I-6.-*. . . . . . . . . . . . ..... * *

Page 36: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

ahead k symbols than it is to look ahead and look behind to

see what the leftmost sentential form is.

Parser Creation Algorithms

. There are two published algorithms that are useful for

creating recursive-descent parsers from EBNF. The first is

FIRST1 and FOLLOW 1 set calculation on production trees, and

the second is construction of recursive-descent LL(l) parsers

from the production trees decorated with first and follow

sets. (In the rest of this chapter, FIRST and FOLLOW is used

instead of FIRST1 and FOLLOW if no ambiguity will result.)

[Barrett, 1979: 180-187]

FIRST and FOLLOW Set Construction. The algorithm for

FIRST and FOLLOW set calculation is a multi-pass process. In

it, the FIRST sets are completely calculated, and then the

FOLLOW sets are calculated. Each set of calculations will

be performed until no changes are observed in the FIRST or

FOLLOW sets for any node on the production trees. Since the

entire algorithm is in Appendix A, only one example is given

here.

To calculate the FIRST set of the node I (alternation),

calculate the FIRST sets for the right and left children of

the node, and then add the FIRST sets of both children to the

FIRST sets of the alternation node. To calculate the FOLLOW

set for the same node, add the FOLLOW set of the node to the

FOLLOW set of both children, and then calculate the FOLLOW

sets of the children.

S111-7

ill..

Page 37: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

Parser Construction for LL(l) Grammars. Parser creation

is the final phase of the compiler construction process. The

complete algorithm is described in Appendix B. This process

assumes an unambiguous LL(l) grammar. The parser is created

using the production trees that have been decorated with

FIRST and FOLLOW sets. There is no error recovery in this

created parser, and, when executed, it will stop as soon as

an input error is discovered. As given, the procedure is

rudimentary, but it is an excellent first step towards creat-

ing a more complex parser.

.1 1

'" III-8

Page 38: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

IV. Requirements and Design

Introduction

In any software development project, the development

process is very important to the success of the project.

This chapter will first describe the software engineering

tools chosen by the author. Then, some philosophies on com-

menting will be discussed, and last, the requirements and

design decisions will be detailed.

Design Methodologies

There are innumerable techniques in use today for de-

signing and developing computer software. Choosing one or

more techniques for a project such as LL, which is designed,

developed and implemented by one person, is a very introspec-

tive decision. The author believes that the technique chosen

must be flexible enough to accept any type of project, be

formal enough to force a good design process, while at the

same time be easy enough to use so that time is not spent on

excessive detail. Also, the technique chosen should create

paperwork that will be very useful as maintenance documents,

and be understandable enough so that another relatively ex-

perienced programmer can learn how the system works.

To satisfy these requirements, the author has chosen

Data Flow Diagrams (DFDs), [Peters, 1981: 139-140,145] and

Structure Charts (SCs). Peters, 1981: 60-62] The DFDs were

IV-li"

p {~ .. . . .. . . . . . . . . . . . . ... . . . . . . .

Page 39: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

--used at the higher levels of the design phase. They assisted

- in breaking down the complex structure of the project into

manageable, understandable pieces. At each stage of the DFDs,

* the author stopped breaking down the pieces when he had a

*sub-system that he could understand completely. At that

point, SCs came into play.

The SCs were used to cut the pieces into multiple, stand-

alone modules. The criteria for breaking a task into modules

were:

a. Does each sub-task stand by itself?

b. Is the interface with the calling routine fairly

small?

c. Is the task large enough to warrant its own module?

The DFDs and SCs in Appendices C and D were developed

with all of the above in mind. It should be noted that the

format is not formal, because each diagram was written to

make the meaning of the diagram as clear as possible, while

at the same time maintaining a high level of accuracy.

Commenting

*DFDs and SCs are extremely valuable in all phases of a

large project. However, nothing can replace in-code comments

and program headers to completely round out the information

available to the reader.

* .. Program headers in LL consist of all pertinent informa-

tion about each module. This includes the module's purpose,

interface, variable list, and basic algorithm, along with

IV-2

--.7*. - -

Page 40: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

other valuable information. Comments are placed in the code

to enhance all the other information that already exists.

The author used the philosophy that having too many comments

is a very poor programming practice, since readers may be-

come just as frustrated with meaningless comments as with no

comments.

Requirements and Design Decisions

The purpose of this thesis is to create an LL(k) parser

generator along with a lexical analyzer. Before progressing

into the design stage, some decisions needed to be made, and

specific requirements determined. This section lists and

justifies these decisions and requirements.

Use of AFIT VAX 11/780 (SSC). The lack of a sponsor to

this thesis severely limited the choice of computers. Ex-

cluding microcomputers, which are not reasonable for a pro-

ject of this type, there are only three; the AFIT VAX 11/780

(Scientific Support Computer), the AFIT VAX 11/780 (database

research), and the ASD CDC 6600. The ASD CDC 6600 is no

longer used by most AFIT students, (because of its poor re-

' sponse and "unfriendly" operating system), and is therefore

unreasonable for this project. Also, the database research

computer has very limited disk space, and is frequently un-

" -available for use. The SSC is the "standard" student com-

..°-. puter, and has enough disk and memory to satisfy any LL's

requirements, therefore it became the computer of choice.

Use of C Programming Language. During the design and

IV-3

*. ,, . . ... . . . .. ... .. . .. . .. . .-- - . -o, -- - - '- " -¢''''',--,-' - .- '--7 -- &i: < : -,2 " , 7 %Z 1, 7,,,...-. -, ..

Page 41: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

.7 .

implementation stage, many data structures were built and

manipulated, and therefore LL will require a pointer-oriented

language to give maximum flexibility to the code. C and

PASCAL were the only two languages available that have

pointers. Each one is a high-level language, but C can also

be used at the bit level to manipulate data, and is the lan-

guage that most of the systems that exist on the SSC are

written in. Even though C is more cryptic than PASCAL, its

advantages far outweigh this single disadvantage.

Use of YACC and LEX. YACC (Yet Another Compiler Com-

piler) [Johnson, 1978] and LEX (LEXical analyzer creator)

[Lesk, 1978] are both resident on the SSC. The use of a

YACC/LEX input processor alleviates the need for a massive

amount of coding for reading in the grammars, processing them,

and recognizing what all the strings mean. It is a standard

tool used by many other systems, and so is proven effective.

Also, as we will see later, the YACC input can be massaged to

create an input to LL as a test case. Therefore, YACC and

LEX were chosen to process the input.

Use of C for Output Parser. C is used in the output for

all the same reasons that was used for LL itself.

Interface Between LL Parser and Lexical Analyzer. The

interface between the parser and lexical analyzer is important

at this point because one of the first tasks in design is to

create the input formats and data structures, and this inter-

face will have an effect on them. Also, since LEX already

IV-4

I.

Page 42: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

exists, it would be wise to allow the use of LEX rather than

the LL lexical analyzer if the user chooses. Therefore, it

is desirable that thL interface between the parser and lexical

analyzer be as close to the YACC/LEX interface as possible.

Other Requirements. The rest of the iequirements are

not directly justified, but are either obvious, or are per-

sonal preferences that have little effect on the objective.

These are:

a. The output parser and lexical analyzer should be as

simple and easy to understand as possible.

b. Both the lexical analyzer and parser should be non-

backtracking. That is, they should be able to make decisions

deterministically.

c. The lexical analyzer should be a deterministic finite

state automata (DFSA). (This is the only method known to the

author for performing this task.) Aho [Aho, 1972: 113-137]

is a valuable reference to understand FSA.

d. The CPU, memory, and disk requirements of LL are not

important, unless they become totally unmanageable. (This

alleviates the need to make very compact and complex data

structures, thereby increasing the project's simplicity.)

e. For practical reasons, there must be a facility to

allow the productions to have a value, and to allow actions

and other elements of a production to have values. The user

should be able to retrieve and store these values, in a manner

similar to that of YACC.

IV-5

Page 43: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

* - .. . . . . ... - ". -- " - .. . .V . °

V. Input Format

Introduction

This chapter discusses the decisions made during the

initial design phase, specifically the reasons for the input

format. First, the general outlines of the format will be

discussed. Then, the specific design decisions for the lexi-

cal analyzer will be given, and finally the format of the

production rules will be discussed.

Relationship to YACC and LEX

As indicated in the previous chapter, the decision to

use YACC and LEX to accept the input to LL was made during

the first days of design. However, this decision was not

made strictly to decrease the programming workload.

Both YACC and LEX are very similar to the products that

are contained within LL. YACC is a parser generator, and LEX

is a lexical analyzer creator. It became easy to see that it

should be possible to take the input definitions written for

YACC, and modify them so they would input easily to LL as a

test case. Thus, the format of the input to LL became impor-

tant, because any similarity to the input format of YACC

would be advantageous in that conversion. (This similarity

would also provide YACC users an easy transition to LL use.)

The input format for the LL lexical analysis portion

became similar to LEX for reasons that were much the same.

V-1

, - : - " , .< J -- ' . " ' > ,- ' . - .. . .. . .4.-. . - .* . . v * .

Page 44: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

Because the purposes of the two lexical analyzers are the

same, namely, to return tokens from the input stream, the

decision was made to keep the two as generally similar as

possible.

General Input Format

At this point, it was necessary to formalize the input

formats, determine where to place variable and subroutine

declarations, and decide whether to force the user to declare

the names of tokens.

Placing the Variables and Subroutines. There were two

considerations as to placing the variables and subroutine

declarations. One, what effect would the placement have on

the user, and two, what effect would it have on the ease of

development. For the user, placing them at the beginning or

N" the end seemed to be best. For the ease of writing the YACC

and LEX input routines, any location was acceptable, but the

end seemed to be the best, because no other types of input

would be expected, and the processing of the declarations

would be merely a copying operation. The deciding factor

was, once again, the format of YACC. It places these types

of inputs at the end, and so LL also places them at the end.

To Declare or Not to Declare Tokens. Whether or not to

force the user to explicitly declare token names was a more

difficult and complex decision. To a sophisticated user,

placing all of the token names in a separate list is an un-

necessary task, since every name in a grammar that is not

V-2

Page 45: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

• - - ,~~~ ~~ ~ .. . ._ ' ..- .- ". .. ' .. - .-- , , . .;- - . - ." -. - . - - . - -.- - " " ' .' . -" .'.' ..

-•defined as a production is automatically a token. However,

it is easier to detect such things as spelling errors and

forgotten production rules when the token names are specified

beforehand, and the less sophisticated user will appreciate

that. After considering these arguments, the decision was

made to force the user to declare tokens specifically. The

time required to key in the token names is not so great as

to outweigh the advantages (to the user) of having extra error

checking capability.

Final Input Format. All the input parts have been dis-

cussed, and now all that is left is to show the order of the

parts. Again, YACC has been used as a model. In it, the

tokens are defined at the beginning. Since the token names

are used throughout the rest of the grammar, this is a good

* *."practice, and was adopted for LL. The lexical analysis output

has been placed second, and the production rules placed third.

All these are followed by the variable and subroutine declara-

tions. The delimiters between the parts are the same as

YACC's, specifically "%%".

Lexical Analyzer Definition

As stated earlier, this part of the input will look very

much like the input to LEX. The Requirements and Design

Chapter defined the necessary parts of this input to be: (1)

the definition of the character sequences that make up tokens,

and (2) the definitions of the actions to be performed when a

specific character sequence is recognized. (Because of the

V-3

• •.

Page 46: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

interface requirements between the LL parser and lexical

analyzer, each character sequence that defines a token must

have, at a minimum, a "return (token-name)", since the lexical

analyzer is a subroutine.)

The following defines the basic structure of the lexical

input:

a. Token definitions begin in column 1.

b. Token definitions are terminated by a space, tab or

newline.

c. Actions consist of a sequence of C statements.

d. Actions begin after the token definition, and can be

continued on subsequent lines.

e. A line beginning with a space, tab, or newline is

part of the action for the immediately preceding token defi-

nition.

f. A token definition need not have an action.

Structure of the Token Definitions. In LEX, tokens are

defined using a modified form of regular expressions. (Regu-

lar expressions are defined in Chapter III.) These regular

expressions are an easy way to represent token definitions,

and actual regular expressions can be converted into a deter-

ministic finite state machine.

The LL lexical analyzer will use the standard regular

expression forms, as described in Appendix E. These do not

include the following LEX forms:

a. 'a' In LEX, this character is used to denote the

V-4

.. ... . . ... *.*% .. .. . ~. .. . . ....... ... ... .

Page 47: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

- .7 .,,-.

* beginning of a line; i.e. the regular expression only suc-

ceeds if a beginning of line is found at the point of the

carat.

b. '$'. This character denotes the end of a line, in

a manner similar to (a).

c. '<...>'. Denotes a start state. [Lesk, 1976: 48]

d. 'x{m,nl' Denotes m through n occurrences of 'x'.

None of these are standard regular expression forms, so they

are not included in the LL lexical analyzer input.

Production Rules Format

The format for the production rules is similar to EBNF,

with one addition, which is "closure plus". Closure plus is

the same as closure, except that the expression inside the

braces will be repeated one or more times, rather than zero

or more times.

The complete definition of the format can be found in

Appendix F, but the following list gives the highlights of

the changes and additions from EBNF, along with the reasons

for each one:

a. The first production rule defines the starting sym-

bol. If the starting non-terminal was generalized by having

it be any of the non-terminals, a new input to LL would be

needed to define that symbol. As it is, no generalization is

lost, since any grammar can be modified to move the starting

production S to the beginning, or to make a new production

NewS -> S.

V-5

-, -. .. . ' : xK..> '. . .,- ... ,-..-,.. . ..... ~~~~~........ ......... ' ..... -,... .... .. . .... .....,.. . • ;.-

Page 48: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

b. Multiple production rules may define the same non-

terminal. This rule allows an extra measure of generality

LL would not otherwise have had.

. c. Non-terminal names may be surrounded by < and >, as

long as all instances of the name are surrounded. This allows

a user to separate terminals and non-terminals with a quick

glance, and also allows grammars that come from technical

*manuals to be copied directly. (Often the non-terminals have

these surrounding characters.)

d. Every production rule ends with a semicolon. This

rule allows LL to perform more accurate error detection, and

provide the user with more accurate feedback if an error is

found.

AM e. Actions begin with '={' and end with '1' These

actions need to be set off by some delimiter, and { } was

already taken, because of closure. They would have been best,

since they also delimit C statement blocks. The character

"*'* '-' was chosen as the prefix to '' because of the proximity

of the two characters on the keyboard of the computer system

that LL was created on.

f. "Closure Plus" is defined by { expression 1+. Note

the + to signify the difference from closure. This is an

extension from regular expressions, where "one or more" is

also represented with a +.

V-6

. . . ."

Page 49: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

VI. Data Structures

S.Introduction

After the initial design decisions have been made, and

what is to be done has been determined, the next step is to

determine how it is to be done. For a project such as LL,

which must maintain a large amount of data, manipulate that

data, and finally create output from the data, the data struc-

tures involved are vital.

For this project, two considerations were used in build-

ing the required data structures. First, they should be easy

to build, to use, and to modify if necessary. These are

* desirable attributes in any project, but especially in one

which is a prototype. And second, these data structures

should correspond as closely as possible to the generalized

data structures as described in Chapter III. This makes them

easy to understand by someone studying LL, and a direct rela-

tionship can be drawn between the theory and the implementa-

tion.

This chapter describes three sets of data structures.

First, those dealing with the lexical analyzer/finite state

automata will be discussed. Second, the structures for the

* •• parser/production trees will be described, and third, the

token definition structure will be detailed.

VI-I

Page 50: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

". - ' :. i - 6 .-

, r v -. -L .. .- ,. .- .; , - . -- . . -.J -. . o ...- ,. .. .

Finite State Automata (FSA)

The data structure for FSA will exactly model the

theoretical FSA as described in the Finite State Automata

K[- Section of Chapter II. Figure 2 shows the format of this

data structure. The reader must remember that for those FSA

which are non-deterministic, a particular character may have

multiple transitions from one state to other states, so the

data structure is not quite as easy to comprehend as it might

otherwise be.

Production Trees

The data structure for the production trees is more com-

plex, but that is because there is more data involved. There

are basically two sets of data. First, the production trees

themselves must be represented. (Chapter III describes pro-

State Data Structure

1. Action-id ( >0 if end state. Points to a particularaction. =0 if not end state)

2. State number3. Pointer to next state (connects states together)4. Pointer to first empty transition5. Array of 128 pointers to first transitions, one for

each of 127 possible characters, and also onefor the character NUL, which = 0. (Since eachletter has its own ASCII code, the code isused to enter the array.)

Transition Data Structure

1. Points to state which the transition is to2. Pointer to the next transition, if there is more

than one transition on this character fromthis transition's state

. . Figure 2. Finite State Automata Data Structures

VI-2

,-" .' ... ,.......-.- ....... '.. " ...-. - , -'. - . " .. -.S %- S,, ,, ,' .. ", •

Page 51: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

duction trees in detail.) It is important to note that the

structure must be flexible enough to allow for nodes with

zero, one, or two children. Second, the first and follow

sets for nodes must be represented. Since these may be of

any length, the data structure must be flexible enough to

handle it. Figure 3 shows the data structures that have been

designed.

Production Tree Head

1. Pointer to next production tree head2. Name of non-terminal3. Pointer to top of tree

Tree Node

1. Node type (closure, alternation, etc.)2. Pointer to first set3. Pointer to follow set4. Pointer to left child if binary node, only child,

if unary node5. Pointer to right child if binary node, or a unique

reference number if the node is a non-terminal6. Action number, if the node is an empty node because

an action is required

First/Follow Node

1. Pointer to next first/follow node2. Pointer to first token node for this first/follow

item

Token Node

1. Pointer to next token node in this first/follow item2. Pointer to a terminal definition node

Figure 3. Production Tree Data Structures

VI-3

Page 52: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

There are two non-trivial parts of the production tree

data structure that should be discussed at this point. First,

a non-terminal node needs a reference number because of the

requirement to remember the leftmost sentential form, which

is shown in the First and Follow Sets Section of Chapter III.

With the reference number, which would be unique for each

reference of a non-terminal, references to the follow set of

a non-terminal can be made distinct based on which production

rule referenced that non-terminal. And second, a method of

placing actions into the production tree is necessary, so

empty nodes are created whenever actions are found, and an

action identification number is placed in the node. Of

course, those empty nodes which are part of a grammar will

not receive an action number.

Token Definition Structure

This final data structure is the simplest one in LL. It

consists of a token name, a token number, and a pointer to

the next terminal in the list. The token number will be used

to identify each token, without resorting to the character

string.

VI-4, . -

Page 53: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

m.

VII. Algorithms

Introduction

The two previous chapters in this thesis define the

input format and the data structures for the LL project.

Once both of these were defined, creating the algorithms for

the project was a relatively straightforward task. Almost

all of these algorithms were either in a book, or were very

similar to other common algorithms. The only major difficulty

occurred in decorating the production trees for a grammar.

The algorithms will be described in the following order:

a. the input method, to include the creation of the

NDFSA and the production trees

b. converting the NDFSA to a DFSA, and outputting the

appropriate C code for the lexical analyzer

c. decorating the production trees

The Input Method

As we saw in the introduction to Chapter V, the input

consist of four parts. These are the token definitions, the

regular expressions, the production rules, and the variable

and subroutine declarations. This section shows how YACC

was used to process these inputs and perform the required

actions. At this time it should be noted that some under-

standing of YACC is necessary to fully understand this

section. [Lesk, 1976] Also, note that each time output is

VII-I

Page 54: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

mentioned, the format and reasons for the output is not clear.

These problems will be cleared up in the next chapter.

The Token Definitions. Two actions were required to

input the token definitions. The first was to create a list

of token names and their corresponding integer values for use

during the production input, and the second was to output a C

"define" statement for each token to be used in the created

parser. This task required only one production rule, and was

straightforward.

The Regular Expressions. Processing the regular expres-

sions and creating the NDFSA required productions very much

like those found in Appendix E. There were essentially two

tasks involved here. The first one involved creating and

linking states at the appropriate places in the production

rules, and the second involved accepting the actions and out-

putting them, along with appropriate surrounding code.

An example of the method used to link the states is

included at this point. This example will show how multiple

alternatives would be linked together to form a sub-automata.

Assume that the following YACC production rule exists:

sub FSA : alternative I sub FSA (74)

and that the input is

ablcdle (75)

Each of 'ab', 'cd', and 'e' are alternatives. Assume that as

each alternative is parsed, the appropriate sub-FSA is re-

turned. The alternative 'ab' returns as in Figure 4(a).

VII-2

Page 55: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

(a) © a b

~a XD b

(b) _

Figure 4. Example FSA Creation

So, the task is to accept the three alternatives and

meld them into one sub-FSA. When the FSA for 'cd' is re-

turned, two empty transitions are added, and the FSA is as

shown in Figure 4(b). When 'e' has been parsed, two empty

transitions are again added, and we have the FSA in Figure

4(c).

These empty transitions are added in the actions for the

regular expression productions. The FSA in Figure 4Cc) will

accept 'ab', 'cd', or 'e' as input. That FSA is non-

deterministic. (See Appendix G for a complete list of all

the structures that are created for each type of regular

expression.)

Ending states have an action number attached to them.

VII-3

-- "-

Page 56: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

When the action is parsed by LL, it is immediately output with

the surrounding code, and the ending state is marked.

The Production Rules. The production rules are parsed

in much the same way as the regular expression, so no example

will be given here. The general scheme, however, is to create

the trees from the bottom up, and for each production rule to

accept one or two subtrees, create a parent node, and then to

pass the new tree up to the next production rule.

When actions are parsed, an empty node is created, and

it is marked with an action number. The actual code is out-

put, along with appropriate surrounding code, which uses the

action number as part of the identification for the action.

The Variable and Subroutine Declarations. These declara-

tions were the easiest to parse. All that was required was

to accept the code and output it with no changes.

NDFSA to DFSA Conversion

One of the requirements of the project is to avoid all

types of backtracking. Therefore, the FSA must be determin-

istic. The following algorithm to convert a NDFSA to a DFSA

has been proven effective. [Barrett, 1979: 75-87] It con-

sists of three steps, which are

a. Remove all empty transitions.

b. Remove all transitions to multiple states on one

character and replace them with a single transition to a new

state. Place the transitions of all the old states into the

new state.

VII-4

..

Page 57: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

c. Remove all inaccessible states.

A series of figures best demonstrates this algorithm.

Figure 5 shows a set of regular expressions and the FSA

created from them. Figure 6 shows the FSA after removing

the empty transitions. Since there are multiple transitions

on 'a' from state 1, a new state must be created. Figure 7

shows this conversion. Then, since there are still two

transitions from state '2,7,9' on 'b', one more conversion

must be performed. Figure 8 is the result. The entire FSA

is now deterministic. However, the last step must still be

performed. States 2, 3, 4, 6, and 8 may be removed. Figure

9 shows the final DFSA. Examination shows that both the

original and the final FSA describe equivalent finite state

machines.

For the regular expressions

abc action 1;a+ action 2;ab*d action 3;

the FSA created would be

a b c

,a d(3I

Figure 5. Non-Deterministic FSA Example

VII-5

................

Page 58: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

le![ a b

i°-a

6... 7 (1 )

(2) a

.~ d8. 9 1 0 ( 3)(3

~~~Figure .CnErsonopMuil Transitions

a IIIII.II., ,1,1,

1

a -d

[,.--.d 9 1 0 ( 3- .) ...- , . , o, .- . , ., .... ..., .. .., . , .-. .- , , .-..-> : ... .

Page 59: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

3,7, 4, 7 (2)~~(2)

Figure 8. Last Multiple Transition Conversion

7<"i (2) 5(1)a c bb~b

Iid dd

10 (3)

Figure 9. After Deleting Inaccessible Transitions

Once the FSA has been defined, all that remains is to

output the appropriate code for each state.

Decorating the Production Trees

As stated earlier, this particular algorithm was the

most difficult to create. The objective is to have the

first sets on the child(ren) of each node for which k isk

greater than 0. The first sets of the children are important

because it is through their first sets that one can determine

VII-7

. . . . . . . . . . . . . . . 4..

Page 60: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

." -.. .. °. m

whether or not to take a particular path through the tree.

The algorithm to accomplish this has four basic parts,

which are organized to accomplish their task as shown in

* -Figure 10. (The Conclusions chapter gives the practical

reason why the algorithm does not merely find the first and

*follow sets for the maximum possible k, and avoid the looping

construct.)

The algorithm to find the first and follow sets follows

the algorithms in Appendix A very closely. Of course, since

k can be greater than i, some parts of the algorithm were

more difficult, but it was a straightforward extension. It

was interesting that these two algorithms were the most

troublesome. (See the Test Plan chapter.) This probably

happened because the first and follow set data structures

are manipulated quite a bit, and therefore the number of

places for possible error increased greatly.

Find maximum possible k (part 1)FOR i = 1 to maximum k do

Find first sets at k =i (part 2)Find follow sets at k = i (part 3)Find k for each node and determine whether

all nodes have k <= i (part 4)If (all nodes have k <= i)THEN stopEND IF

END FOR

Figure 10. Decorate Production Tree Algorithm

VII-8

Page 61: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

0 o -. % 7 .7

.. Determining k for each node was a relatively simple

task. For each node which could have k > 0, there is a

simple test which determines k. These tests are:

a. For closure, closure-plus, and option, compare the

first set of the child to the follow set of the node.

b. For alternation, compare the first sets of the two

children.

It should be noted that before determining k, each node

needs to have its first sets adjusted by concatenating the

follow sets on to them. This takes care of the situation

where the follow set of a particular non-terminal is signifi-

cant when the non-terminal is LL(k) but not strong LL(k).

Determining Maximum Possible k. The method for deter-

mining the maximum possible k is relatively straightforward.

The idea is to count the absolute largest lookahead that

might be possible at the beginning of a parse. Each node

has a particular counting method, and these are described

in the following list:

a. empty node : 0

b. terminal : 1

c. non-terminal : If this non-terminal is recursive,

and it has already been examined, return 1 and a recursion

indicator. If not, count the non-terminal.

d. closure, closure-plus and option: count the child.

e. concatenation : count each child. If the left child

*. .- .has the recursion indicator set, return its value, otherwise

VII-9

I- .0

Page 62: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

*. -" ~ ~ ~ . ..

add the two counts and return.

f. alternation : count each child and return the

larger. (A more detailed description and a non-mathematical

proof of this algorithm is in Appendix H.)

Final Parser Output. Once all of the decorating has

been completed, all that is left is to walk the trees and

output the parser. The format of the parser is described in

the Parser Section of the next chapter, so the code for each

node will not be described here.

VII-lO

Page 63: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

7Z_

-" VIII. Parser and Lexical Analyzer

Introduction

The character of the LL project depended on the output

code at least as much, if not.more, than it depended on the

input. This chapter is devoted to the structure of the out-

put parser and lexical analyzer. It will discuss the general

structure, the data structure and code for the lexical ana-

lyzer, the data structure and code for the parser, and the

method used to remember the values of items in productions.

General Structure

The general structure of LL output is fairly straight-

forward. There are seven divisions, which occur in order

from the beginning to the end of the output as follows:

a. the variables and subroutine declarations specified

by the user

b. statements that define each token as an integer for

. use in all parts of the program

c. the global variables, to include a definition of the

maximum token size, the declarations for the character string

of the "current" token during a parser, and the declarations

Wfor that token's length

- d. the variables, code, and support subroutines for the

"*'. lexical analyzer

e. the variables, code, and support subroutines for the

VIII-'

Page 64: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

parser

f. the variables and subroutines that support remember-

ing the values of items in a production

g. genz.ral support routines.

The Lexical Analyzer

As seen in the Requirements and Design Decisions Section

of Chapter IV, the lexical analyzer must return the integer

value of a token recognized, as well as the string that is

the token. Also, the lexical analyzer must be a deterministic

finite state automaton. To accomplish this, the following

data structures, support subroutines, and code were created.

Data Structures.

a. A stack of characters that have been recognized,

along with the action number that applied to the state that

recognized the character.

b. A character array that an entire input line will be

read into, and characters retrieved from and returned to by

the DFSA.

Support Subroutines. The support subroutines all support

the reading of data from the input, and the maintaining of

that data. All of these manipulations are performed by the

subroutines, and the only interface to the lexical analyzer

is through two routines that get characters from the input,

and put characters back onto the input.

Code. The lexical analyzer itself consists of one rou-

tine. The structure of that routine is in Figure 11.

VIII-2

P , i,; " .-_', -.--'i'i' '. -./ -' .-..- '-' " - v .. - ..'.. -'. .. .-..-. '-. .. .. -. ".- . .. ..5• - -

Page 65: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

while (forever)"Begin a new token"set current state to 1initialize the stackwhile (there was a transition from the previous state)

get a character and place it on the stackcase (current state)

state 1 : "state code"state 2 : "state code"

state n : "state code"end case

end whilewhile (the last state on the stack does not have an

action) pop the stack and put character back on theinput

end whilecase (action number on top of stack)

acticn 1 : "action code supplied by user"action 2 : "action code supplied by user"

action m : "action code supplied by user"end case

end while

Figure 11. Structure of the Lexical Analyzer

The "state code" is what is derived from the DFSA data

structure. For each character that has a transition from

that state, there will be an IF statement. For example, if

a state has transitions on 'a', 'b', and 'c' to states 1, 2,

and 3 respectively, the state code would be

Place state's action number on stackIF (current char = 'a')THEN current state = 1ELSE IF (current char = 'b')THEN current state = 2ELSE IF (current char = 'c')THEN current state = 3

. ELSE there is no transition from this stateEND

VIII-3

Page 66: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

The action code is taken directly from the input. The

while loop that surrounds the entire subroutine exists in

case a "return" does not appear in an action, so that some

sequence of characters is not passed back to the parser as a

token, and the lexical analyzer must find the next token.

The Parser

The parser consists of many subroutines. The technique

is to create a single entry point for the user to call which

begins the parse, and then make each non-terminal and each

action be a separate subroutine. The entry point's only

function is to call the subroutine for the start symbol, and

to test whether the parse read all the input.

Inside each non-terminal subroutine, the code consists

of groups of standard pieces. These pieces are generated by

walking the production trees, and the code generated for eachN-

type of node (without the value manipulation code) is shown

in the following list:

Terminal get a tokenif (token not = terminal-id)

then syntax errorend if

non-terminal call the non-terminal subroutine

concatenation : "code for left child""code for right child"

alternation : if (next k tokens equals a first setof the left child)

then "code for left child"else "code for right child"

end if

VIII-4

. . .• . -4-. . - -. - - -

Page 67: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

closure while (forever)if (next k tokens equals a first set

of the child)then "code for child"else break out of while loop

end ifend while

closure plus : while (forever)"code for child"if (next k tokens equals a first set

of the child)then do nothingelse break out of while loop

end ifend while

option if (next k tokens equals a first setof the child)

then "code for child"end if

empty call the action subroutine{ if there is an action }

There are two major subroutines needed for these rou-

tines. The first is the "get a token" subroutine. Its

purpose is to accept a token, and remove it from the input.

The second is the "lookahead" subroutine. This is used

during the various IF statements to compare the first sets

against what is in the input. To perform these functions, a

table of size k is available, which will contain tokens that

have been accepted from the lexical analyzer. Whenever look-

* ahead is requested, enough tokens will be requested from the

lexical analyzer to do the compare, and whenever a token is

retrieved by the "get a token" routine, one entry will be

removed from the table.

VIII-5

Page 68: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

The Values of Productions

The most important part of the generated parser is its

ability to place a value on each item in a production. This

allows the user to "remember" how many, or what kind, or any

other information desired. These values are all integers,

therefore any type of information that fits into an integer

can be used. In particular, pointers may be used. The fol-

lowing example shows how to use these values. (The $n values

are used as variables in actions.)

S A $1 has the value of production Ab $2 has the value of terminal b

$3 has the value 0, unless the actionused $$ = ... ; in which case $3has that value. This action mayreference $1 and $2.

(a b ) $4 (see note)a b } $5 (see note)

[a b] $6 (see note)I a b }+ $7 (see note)

$8 same as $3, except that $1 through$7 may be referenced.

The value of S is whatever the last item's value was, inthis case, whatever $8 is.

Note: Any group of items surrounded by 0, [], (1, or0{+ is a set on its own. So, each of $4 - $7 has asubset, and in each one, a = $1 and b = $2. $4's valueis whatever b's value is. However, each of $5 - $7 mayhave an unknown number of occurrences. Therefore, eachone is represented as an array. The 0th element hasthe number of occurrences, and the 1st through the nthare the values. So, for { a b 1, with input ababab,$5[0] = 3, and $5[1] = $5[21 = $5[3] = b. This isvaluable if the last item is an action, so that thevarious values may differ. If the last item in a setis one of these multiple occurrences, then the set hasthe value of the last occurrence.

The values are placed on two large stacks. One stack is

* the "normal" stack, and contains the values of all items in a

VI I-6

rp - , - - - . - . - - . -

Page 69: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

set. If any item in a set is a closure of some type, then

the value will point into the second stack, where each

element of a closure will be held, be there 1 or 1000.

To go along with these stacks, there are manipulation

routines. These include:

a. Begin a new set

b. End a set

c. Create a new entry within a set

d. Check the stacks for overflow

The "begin a new set" routine returns a pointer to the new

set, which is placed in local variables in the parsing sub-

routines. This data is used in actions to retrieve the

various $ values. (A limitation on the actions is that only

integers and identifiers may exist between the brackets of a

$n array reference.)

Additional insight into the uses of this value capability

can be found in the YACC reference manual, [Lesk, 1976] from

which LL's was patterned.

VIII-7

Page 70: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

IX. Test Plan

Introduction

An important facet of any good design is a test plan.

Many times this test plan is extremely formal, with bench-

marks, acceptance criteria, etc. The amount, complexity and

completeness of the test plan is dependent on a number of

variables. First, is it possible to test every aspect of a

program? The author has worked on projects that were online

systems, and there was some code that could only be "assumed"

correct until an error occurred. Next, how important is the

program? Code that performs missile targeting is obviously

critical, while code to calculate a batting average might not

receive as much attention if it fails. Finally, how often

will the program be used? A job scheduling algorithm in an

operating system is used constantly, but most student projects

are used only once.

For a project that is relatively large, such as LL,

these same criteria apply to each section of code. There

are also other criteria that are important to large projects.

The most important is the "tightness" of the design. Well-

. designed programs that have straightforward data structures,

and whose interfaces between modules are very small, can be

tested in different ways from "loose" programs. The testing

program for LL reflects these considerations. LL was de-

IX-I

Page 71: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

veloped in a modular manner, and can be tested in the same

* way.

General Test Plan

Testing for LL was done by major submodule. As can be

seen from the Data Flow Diagrams in Appendix C, LL's structure

is very linear. This means that data structures are operated

on in a subsystem, and only the data structure is passed

between subsystems. Also, LL's data structures are extremely

consistent and general. Therefore, there are very few special

cases that need to be tested. (Special cases are the bane of

programmers. Each special case must be tested separately,

and sometimes they can double or triple the testing workload.)

Each subsystem of LL was tested as it was developed. A

set of inputs that exercised every general case was developed

and used for each subsystem as it was developed. Extra rou-

tines were created whose task was to print the data struc-

tures, and these were used extensively during the tests of

each subsystem. Also, a trace facility was set in place from

the very beginning, which can be turned on and off at will.

This trace capability aided testing tremendously, as the loca-

tion of an error could be exactly placed most of the time.

When all the normal tests were made, then the YACC input

was modified, and used as a test case. It succeeded, but

caused some repercussions in the ..L algorithms. (See the

Recommendations Section of Chapter X for an explanation.)4

~IX-2

. . . . . .. , . . . . .. . -. --- .. ... . . . ... . . . . . . . .. . .i 12 •:, ; , .

Page 72: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

-- 07

*-"Special Cases

A special case is essentially some input that causes a

global effect on the program, and must be carefully considered

during some phase(s) of the development. There were three

special cases in LL. These were: recursive productions

* (for first and follow set calculation), closure as the last

item in a set (for remembering the value of a subset of a

production), and no regular expression input (for users who

want to use their own lexical analyzer).

Recursive Productions. Because the algorithm for calcu-

lating first and follow sets requires that each non-terminal

be calculated when encountered, each non-terminal had to be

marked when it was calculated, so that endless loops would

not occur. For example, the production

S : a S I b; (76)

would have the first sets calculated as in Figure 12. If the

algorithm calculated the non-..-rminal S when it saw it without

* . considering recursiveness, it would continue forever.

Begin calculate SBegin calculate alternation

Begin calculate concatenationBegin calculate aEnd calculate aBegin calculate SEnd calculate S

* End calculate concatenationBegin calculate bEnd calculate b

End calculate alternationEnd calculate S

" -' Figure 12. Example of First Set Calculation

IX-3

Page 73: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

Closure as the Last Item in a Set. As specified in the

Values Section of Chapter VIII, each subset of a production

has a value. Whenever closure, closure plus, or option is

the last item in a set, the value of that set is the last

item in the array of closure items. Therefore, an indicator

as to whether or not the last item as a closure was needed.

No Regular Expression Input. The FSA for a grammar is

"hung" from a global variable. If no regular expressions

are found in a grammar specification, then this variable is

set to null, and when the final output is created, no lexical

analyzer code is output.

The ADA Test

As we saw in the introductory chapter, ADA [DARPA, 1981]

is an on-going project to create a new high-level language.

Since it is very complex, and the justification for work such

as this thesis comes from languages such as ADA, the author

decided to create a test case using the ADA EBNF specifica-

tion. [DARPA, 1981: El-ES] The outputs from LL, along with

an explanation of the test, are in Appendix I.

IX-4

,. . -*. . . - . . . . . . . .

Page 74: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

X. Conclusions and Recommendations

Conclusion

Throughout the course of this thesis project, there were

three main questions. There were:

a. Can a generalized LL(k) parser generator be created

that determines what k is?

b. Is the parser generated relatively economically?

c. Is the output product easy to understand?

The answer to question "a" is a qualified yes. It is

qualified because of a flaw that could not be rectified within

the time constraints. This relates to LL(k) grammars that are

not strong LL(k), and is only a problem when the applicable

follow sets must traverse more than one production to reach

the production that is not strong LL(k). For example, if the

productions are

S ->aBbc Bc (77)

B. B-b ci (78)

then all is well. The two references of B will be used to

good effect to separate the follow sets. If, however, the

productions are

S-> aBbc Bc (79)

B -> C (80)

C-> b cI £ (81)

then there is only one reference of C, and the multiple refer-

X-1

Page 75: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

i -, .• ° .. . .. . . ...

ences to B (with their follow sets) are lost because of the

indirect reference.

The second question, is the process economical, is an

unqualified no. As built, the data structures are too large

and use too much memory for any "reasonably" sized grammar

with k larger than two or three. It is, however, excellent

for grammars that are relatively small.

The last question is an unqualified yes. The output pro-

duct is very easy to understand and use. It seems to be

S.- organized well, with data structures that fit the necessary

algorithms very nicely.

Recommendations

There are two problems in LL that make it somewhat less

than practical for many applications. These are: 1) core

usage, and 2) maximum k calculation.

Core Usage. The only area of concern in LL is the amount

of core that is used during a large grammar's processing. The

first and follow set calculation seems to be the root cause of

this problem. During the testing phase, the YACC input was

modified so that it could be read into LL, and it was. All

the phases worked well, until the first sets were to be cal-

culated. This calculation for the maximum k came to be 39,

and at that time the first sets were not calculated in a loop

starting at 1. The algorithm attempted to perform this feat

for k = 39. LL began to request more and more memory, and

x- 2'-"

bm° .~*. .

Page 76: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

S- .. had barely begun the calculation when it finally reached 6

megabytes (MB) and was killed by the system. At that time,

the loop was put in, and the process was restarted. It

happened that k = 2 for the grammar, and LL went to 6 MB

again, but not until the process was almost completed. At

that time, the grammar was modified to be LL(l), and then

everything went smoothly. The YACC -> LL input modification

test showed this failing of LL very well.

Since LL is a prototype, the author decided that simpli-

city of the data structures and ease of programming, (along

with an immovable time constraint), was more important than

"S algorithm efficiency. So, LL constant use of the memory

allocate and deallocate functions in UNIX to build the first

and follow sets. Each first and follow set item requires

one piece of memory, which contains the actual data, along

with a pointer to the "next" item. Unfortunately, the memory

manager also places a header on each piece of memory that is

given to the user. If the data structure was modified so

that the memory manager would only be needed occasionally,

and so that the "next" pointer could be disposed of, a 75%

reduction in core use would occur. (See figure 13(a).)

Then, if the data could be compressed so that four data items

would fit where only one fits now, another 75% reduction

would occur. (See figure 13(b).) If both could be imple-,'.

mented, there would be a 93.75% total reduction in core use,

" i--- and LL could be used on a much larger class of grammars.

X-3

..

Page 77: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

two wordheader

(a) data --- >> data75%

pointer reduction

data 1

'data 2 -"4data 3 75%

reductiondata 4

Figure 13. Possible Core Use Reductions

Maximum k Calculation. The other area of concern in LL

is in the calculation of the maximum possible k for a grammar.

Because this value is LL's limit in its loop to find the

actual k, it is advantageous to have it be as small as pos-

sible. Unfortunately, for any large grammar, the number cal-

culated by the algorithm in Appendix H is relatively large.

This limiting algorithm needs more work to bring the value

down.

In order to solve this problem of practicality, an option

to the program was added to allow the user to insert a value

for the maximum possible k. Thus, if a grammar is known to

,' have k less than or equal to some small value, then this value

can be inserted as an option. However, in that case LL can

not assure the user that the grammar is not LL(k) for any k,

X-4

.f I . . . . . . . .

Page 78: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

but only for k up to the input value.

Final Comments. LL is a prototype that shows that cal-

culation of k is possible for k > 1 in a language with an

LL~k) grammar. With the above mentioned modifications in

place, and possibly rewritten to remove other inefficiencies,

there should be no difficulty in using it as a production

quality compiler writing tool.

.-

S"

x-5

.

Page 79: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

Bibliography

Aho, Alfred and Jeffrey Ullman. The Theory of Parsing,Translation, and Compiling (Volumes I and 117 Engle-wood Cliffs, New Jersey: Prentice-Hall, Inc., 1972.

Baker, Theodore P. "Extending Lookahead for LR Parsers"Journal of Computer and System Sciences, 22: 243-259,1981.

Barrett, William A. and John D. Couch. Compiler Construc-tion: Theory and Practice. Chicago: Science ResearchAssociates, 1979.

Berry, R. E. Programmin Languag Translation. New York:John Wiley and Sons, 1982.

DARPA (Defense Advanced Research Projects Agency). ADAReference Manual. US Government, 1981.

Davie, A. and R. Morrison. Recursive Descent Compiling.New York: John Wiley and Sons, Inc., 1981.

Gert, Florjin and Rolf Geert. PGEN - A General PurposeParser Generator. Amster ai, Netherlands: MathematicalCentre, January 1981 (N81 - 30844).

*. Gries, David. Compiler Construction for Digital Computers.New York: John Wiley and Sons, Inc., 1971.

Johnson, Stephen S. YACC: Yet Another Compiler Compiler.UNIX Programmer's Manual, 7th Ed, Volume 2A, 1978.

Koster, C. H. A. A Compiler Compiler. Amsterdam, Nether-lands: Mathematisch Centrum Amsterdam, November 1971(AD - 900731)

Lesk, M. E. Lex - A Lexical Analyzer Generator. UNIXProgrammer's Manual,7th Ed, Volume 2A, 1978.

Leverett, Bruce W. et al. "An Overview of the ProductionQuality Compiler-Compiler Project". Computer Magazine:38-49, August 1980.

Meertens, L. G. and Vliet, J. C. van. On Top-Down Parsin ofAlgol 68+. Amsterdam, Netherlands: Mathematisch Ce -trum Amsterdam, November 1981 (AD - B064127).

Bib-l

* .. .- *-"-k A U

Page 80: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

-. Peters, Lawrence J. Software Design: Methods and Tech-niques. New York: Yourdan Press, 1981.

Pyster, Arthur. Compiler Design and Construction. New York:Van Nostrand Reinhold Company, 1980.

Wirth, Nicklaus. Algorithms + Data Structures = Programs.

Englewood Cliffs, New Jersey: Prentice-Hall, Inc.,1975.

J.7

.

S

~Bib-2

Page 81: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

* Appendix A

FIRST, and FOLLOW1 Set Calculation

This algorithm operates on production trees as described

in the Production Tree Section of Chapter II. The only non-

obvious part of the algorithm is the symbol ~.This symbol

stands for the end of input, end of string, or end of file.

(Note that the FOLLOW set of the start symbol should include

the end of string, or j.) [Barrett, 1979: 180-184]

Set all FIRST sets for all nodes in all trees to the empty set.REPEAT

* FOR all trees DOECALCULATE-FIRST-SET(root of tree)EDFOR

* UNTIL no change in any FIRST setSet all FOLLOW sets for all nodes in all trees to the empty set.Set FOLLOW(root node of start symbol's tree) toJ

* - REPEATFOR all trees DO

CALCULATE-FOLLOW-SET (root of tree)END FOR

UNTIL no change in any FOLLOW set

CALCULATE-FIRST-SET (tree node)CASE node OF

e add {01 to FIRST(node)terminal x : add {xl to FIRST(node)non-terminal N : add FIRST(root node of tree N) to

FIRST (node)* * :CALCULATE-FIRST-SET(left child)

CALCULATE-FIRST-SET (right child)add FIRST(FIRST(left child) FIRST(right child)) to

FIRST (node)CALCULATE-FIRST-SET(child)add {el to FIRST(node)add FIRST(child) to FIRST(node)

CALCULATE-FIRST-SET(left child)CALCULATE-FIRST-SET (right child)add FIRST(left chil"l) to FIRST(node)add FIRST(right ch.A.) to FIRST(node)

END CASERETURN

A-1

i~ . ... m . . . . . . ?. .-.. :. , ., -, - - .-.... ..- ' .. -' .

Page 82: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

END CALCULATE-FIRST-SET

CALCULATE-FOLLOW-SET (tree node)CASE node OF

terminal x,c :(*no action*)non-terminal N : add FOLLOW(node) to FOLLOW(root of N)*:add FIRST(FIRST(.right child) FOLLOW(node)) to

FOLLOW (left child)add FOLLOW(node) to FOLLOW(right child)CALCULATE-FOLLOW-SET (left child)CALCULATE-FOLLOW-SET (right child)add FOLLOW(node) to FOLLOW(right child)add FOLLOW(node) to FOLLOW(left child)CALCULATE-FOLLOW-SET (left child)CALCULATE-FOLLOW-SET (right child)

? : add FOLLOW(node) to FOLLOW(child)CALCULATE-FOLLOW-SET (child)

*: ADD FIRST(FIRST(child) FOLLOW(node)) toFOLLOW (child)

CALCULATE-FOLLOW-SET (child)END CASERETURN

END CALCULATE-FOLLOW-SET

A-2

Page 83: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

j ' -. - . . .. , . S. . . - . - . - , ., .- . . .. -. .- -.. - .

Appendix B

LL(1) Parser from Production Trees

This Appendix gives an algorithm to generate a parser

for LL(I) grammars by using production trees that have been

decorated with FIRST and FOLLOW sets as in Appendix A. The

algorithm assumes an unambiguous grammar, and performs no

error-correction. It will, however, recognize a syntax error.

[Barrett, 1979: 185-187]

There are two variables. TOKEN is the value of the

current token in the parse, and FLAG is used as a boolean

variable to decide whether some part of the parse was success-

ful or not. There is also a function called NEXT. NEXT gets

" " the next token on the input stream and returns its value. It

should be noted that the symbol , as in Appendix A, is the

end of input symbol. Also, the FIRST and FOLLOW sets will be

taken from the tree and placed in the parser wherever FIRST

and FOLLOW appear in the algorithm. The parser will be

created in pseudo-PASCAL, and is generated by the algorithm

that follows.

Generate: Program header with declaractions of FLAG and TOKEN.FOR each tree DO

Generate:"procedure A; " where A=non-terminal symbol for the tree"begin"

GEN-CODE(tree root)Generate:

"end"*Q END FOR

Generate:

B-I

Page 84: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

-. . ' ' : '. ' , - , -. . , - . - - .. - L - ' . ' - '

. . . r r r ' ' - '- " " ,' . - " " " "

"begin""call G;" where G is the start symbol"if (FLAG = FALSE) or (TOKEN <> 'J') then ERROR;"

"end"

GEN-CODE (tree node)CASE node OF

e : Generate:"FLAG := TOKEN in FOLLOW(node)"

terminal x : Generate:"FLAG := (TOKEN in 'x');""if FLAG then NEXT;"

non-terminal N : Generate:"call N;" (*proc for non-terminal n*)

S: Generate:"if TOKEN in FIRST(child)""then begin"

"repeat"GEN-CODE(child of node)

"until not FLAG;""FLAG := TRUE;""end (*begin*); "

"else FLAG := TOKEN in FOLLOW(node);"* : GEN-CODE(left child)

Generate:"if FLAG"

Si "then begin"GEN-CODE (right child)"if not FLAG then ERROR;""end (*begin*);"

: GEN-CODE(left child)Generate:

"if not FLAG""then begin"

GEN-CODE (right child)"end (*begin*) ;"

?: GEN-CODE(child)Generate:

"if not FLAG""then FLAG := TOKEN in FOLLOW(node);"

END CASEEND GEN-CODE

B-2

Page 85: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

Appendix C

Data Flow Diagrams

System Diagram

Parser-Definition

LLParser

Generator

B0

Completed-Parser

F.

.:::, C-'1

Page 86: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

Diagram 0

Parser-Definition

and-Acions c eoratd

Production

Codei Dtrmn

C-2

Page 87: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

Diagram 1

Parser-Definition

Variable-Subroutine-Declarations

ToknsProduction- Regular-Rules Expressions

InputIptIptInput ariable

Inputs Production Regular andToknsRules ression ubroutine

1.3 l.4-

ProductSubroutlyne-Token-Declarationsn

and-Ation

Vaiale

Suruie

. . .. . . .. . . . . . . . . .

Page 88: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

Diagram 2

NDFSA

RemoveEmptyansitions

2.1

NDFSA-Without-Empty-Transitions

MultipleTransitions

V 2.

DFSA-With--SaeUnreachable-Sae

UnreachableStates

2.3

t

elt

* DFSA

C-4

Page 89: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

. . *

Diagram 3

Production-Trees

Number

References

3.1

Production-Trees-With-References-Numbered

FindErrors

Production-Trees-With-Refe ences-Numbered

.. 3

Decorated-Production-Trees

C-5

...............................

Page 90: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

- Appendix D

Structure Charts

MakeDecoateOupu

55

D- 1

Page 91: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

Inu

1,,

Definitions ExpressionsPrdcinSuotne

D-2

Page 92: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

41t

6i

D-13

*12 1 12 ....

*.13 4. . . . . . . . . . .. . . . .

Page 93: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

14 1

14 15

Z 71D4L5

Page 94: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

4'4

14,23 ~ 21 2,2322

EFin

D-5

Page 95: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

61 5

MakeParser

4

-. 4

;,-;iMake

Definitions Make One-.. and Main Non-Terinal"-""" Procedu el42

4.

19 is1

18i 19118 191.18 19 18 19 o 1, :1 9181 Q1

Make Make Make Make Make Make MakeSubtree Subtree Subtree Subtree Subtree Subtree ubtreeEmpty Terminal Non-term * or *+ ?

4.2.1 4.2. 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7

Note: 4.2.1 to 4.2.7 are 0called from 4.2 19t 418 19 118 1and 4.2.4 to 4.2.7. 191 18 1 18

D-6

.. . . . . . . . . . . . .-

Page 96: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

Numbered Data Items List

1. Non-deterministic FSA

2. Production Trees

3. Complete grammar input. Includes (7) through (10)

4. Lexical analyzer code

5. Decorated production trees

6. Parser code

7. Token definitions

8. Lexical analyzer actions

9. Production actions

10. Variable/subroutine declarations

11. NDFSA without empty transitions

12. DFSA with unreachable states

13. DFSA

14. Production trees with numbered references

15. Maximum possible k

" 16. One production tree

17. Code for one production tree

18. Subtree

19. Code for subtree

20. Production trees with first sets

21. Production trees with first and follow sets

22. Production trees with first set of length k

23. Temporary value of k

24. Main procedure for output code

D-7

:: -,<.,-;;-;--?', -? ? : - ' *: -*-,* -* - ... .. ....-. .- ..-..--. ,.. * . ..

Page 97: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

Appendix E

Regular Expression Forms Used in LL

regular-expression alternate { "j" alternate } ;

alternate : { element I+ ;

element sub-element [ "*" j "+" I "?" ] ;

sub-element "(" regular-expression ")"

I "[" [ "" ] { bracketed-char I+ "1"

I sub-element-character

bracketed-char

Any cAracter defined for C, to include octal numbers for

unprintable characters, any of \t, \n, etc., excluding

'] . Any character, including \ and ], may be preceded

by a to force it into the character set.

quoted-char

Same as for bracketed-char, except that " is the charac-

ter that may not be included in the set unless it is pre-

- ceded by a V

sub-element-char

Any character defined in C except for space, newline,

tab, [ and " unless preceded by a\

8hE- 1

... "-_.:. .. .. ..... .... .. . ..

Page 98: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

.'

Appendix F

Production Rule Format

production-rule non-terminal-IDENTIFIER

alternate-list

If • I

alternate-list alternate { "j" alternate 1 ;

alternate { item I ;

item "C" alternate-list ")"

, "[" alternate-list "1"

I "{" alternate-list "}" [ "+" ]

IDENTIFIER

. "={" action-code "}"

F

-F-i

9-'"

Page 99: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

iD-Ai38 061 A GENERATOR OF RECURSIVE DESCENT PARSERS FOR LLMK 2/4.LANGUAGES(U) AIR FORCE INST OF TECH WRIGHT-PATTERSONAFB OH SCHOOL OF ENGINEERING G B PAPROTNY DEC 83

UNCaRSSIFIED AFIT/GCS/MA 83D-6 F/G 9/2 N

Page 100: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

-.-

1266

0 W.o

_L4

MIROOP REOUTO T ~ EST CHART

• 111- .

. 9

• .' -MICROCOPY RESOLUTION TEST CHART

- 5'-., NATIONAL BUREAU OF STANDARDS-1963-A

6 " Y%- *.. -

'*4 " . ,, N == % " - , ..5. 4 ' # * ~ % % . % ", - ,% % % % ' - - -- . .- . ,,. .. , .

,:.. . , ** . . .. .. . , , ., .. ., - .. . .. .. , . .. . . . . .' . , ... . . . -

Page 101: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

FSA for Each Regular Expression Form

* * In the following structures, n denotes a state, and n

denotes a stop state. The beginning state is always state 1,

* and the ending state is marked with an S. An expression may

be any of the following, or (E).

*El action 1E2 action 2E3 action 3

El-

4 3

1

.j

(S2

6 7 (S3)

Page 102: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

El E1E2

2 (S)

El*

(S)

El+

El?

alo (S)

[ set of chars ]

G-2

-p

-p

Page 103: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

Appendix H

Maximum Possible K Algorithm

This appendix describes and justifies the algorithm for

calculating the maximum possible k. The author has developed

Sthis algorithm through his knowledge of what lookahead is

* possible for each of the nodes, and then had tested on a

number of cases that used differing combinations of nodes.

The algorithm begins at the head node for the start sys-

-bol, and essentially traverses all the production trees during

its calculation. The following list describes the algorithm

* for each production tree node in turn, and gives the justifi-

* 0 cation of the algorithm for that node.

- General Comments

a. Counting is the process of determining what the max-

imum possible lookahead is for a node.

b. The recursion indicator is set in order to remember

whether the counting process for a particular non-terminal

node ended when recursion was encountered.

c. The maximum k value is a variable that is set when-

*ever a node is found that has a value b greater than the

* value that is in the variable. This is done because the max-

* imum value for the start symbol may be smaller than some sub-

* ordinate production's value.

1-1

-p

* 5 . . . . . *..o- . . . . . . . . . .

. . . .

*. . . . .... ,*,.-*.

Page 104: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

..

:.-..:Empty Node

This node is counted as 0, because nothing will be

parsed for it.

V" Terminal Node

The terminals are all counted as 1, because exactly one

token will be parsed.

-4

Closure Node

A closure node defines a sentence that may occur 0 or

more times. The problem in determining the maximum k for

this node is: How many times will the sentence occur in the

input, and how many occurrences of the sentence must be looked

ahead to determine whether to accept it or not. There are two

separate considerations here, which are:

a. When parsing the actual closure node, the maximum k

is the count of the child, since that is the maximum that can

be viewed at that point.

b. If the closure is inside an alternation node, do we

'.5 parse the closure node or not? This problem is more complex.

The following examples show various occurrences of closure

". nodes in grammars:

S ->{a b c Ia b a b d (82)

S-> {a b c I a b c d (83)

S-> a b }c J ab d (84)

Equation 82 is LL(5). This is because the two alternates

can parse "ababc" and "ababd". The concatenation node alqo-

H-2

Page 105: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

rithm will return a count of 5, so the closure node's sentence

may be counted only once, for a total count on the left hand

side of 3. Equation 83 is LL(4), because the alternates may

parse "abcj" and "abcd". Once again, each closure's sentence

only needs to be counted once. The last example, equation 84,

is not LL. This type of closure and alternation problem is

the only closure case where the lookahead is unknown. LL will

not accept grammars with such productions.

Intuitively, we must count a closure node's child once

and only once. If we had to count it twice because of some

case, why wouldn't there be a case where it needed counting

three times? Or four? The algorithm would break down and be

unworkable in this case. Fortunately, such a case does not

6exist.

Closure-Plus

For this node, count the child and return its value, by

the same reasoning as for the closure node.

Option Node

Since an option node is parsed 0 or 1 times, the maximum

possible k is the child's count.

Non-Terminal Node

Normally, the maximum k for a non-terminal node is calcu-

lated by going to the non-terminal's production and counting

it. However, a non-terminal may be recursive, as in

H-3

'* -.- •*..:. .-.' . - - . 7 . ... *.'.*** . I, . -*. - .. . .- .. >. >

Page 106: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

S ->a b S c a b (85)

If the above algorithm were used, it would never terminate on

this example. The same type of intuitive reasoning applies

to this node as applied to the closure node. We should end

the counting process when the non-terminal comes up for

counting the second time, and return 1 as its count. Thus,

- the count for the left hand side of the example would be 3.

Also, the recursion indicator needs to be set, because the

concatenation node will use that to determine whether to use

the subsentence to the right of a non-terminal or not. It

should not in the recursive case, because if the grammar re-

." quires the compiler to look ahead further than the non-

terminal, it would not be LL anyway.

Concatenation Node

The coicatenation node's count is normally the sum of

its two children. However, if the left child has the recur-

sion indicator set, then the sum is no longer appropriate,

as we saw for the non-terminal node. In that case, the count

for the left hand side only will be returned.

Alternation Node

'S Since the alternation node defines the "choose A or B"

construction, the maximum possible k is the larger of the

counts of its children.

H-4

.. ,,-, 'S*. 5 - - - . -.'. V . .'-' . .' ' " -. ' ' . . " .'

Page 107: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

Appendix I

LL Output for a Partial ADA Grammar

This appendix contains the grammar input file and the

output files for a partial ADA grammar processed by LL. Only

a small part of the actual ADA specification was used because

the actual ADA grammar is quite large.

The files in the appendix are:

a. The input grammar.

b. The C program that LL created.

c. The LL.output file. This file contains a summary of

the FSA for the lexical analyzer, a list of those productions

which were not LL(l), and a graphic representation of the

decorated production trees. (This file would have a list of

all those productions which were not LL(i) for all i from 1

to k. The ADA grammar used here is LL(2).)

4°..

a.°

°-

.. . *. .- .

Page 108: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

/-- Ada Grammar Subset

C .

C W9

CL =LL0S CL >;4.U 0 L

4 - I--QC0 0. 0 -

SI- 0 ; 0

41 -0 LW

NU a - 0% 0.0 0S. .0a 0. *0 *- .1

0. 0 c =OC 4uc 0 M LC

%0 S C I L-a-0 00S S4.4 0.- Vi 0 U 0 41CU CL lI-1 01 5 U C0 -05- lo Z 00C oo 0 C 0) LA1. M4E - 0CU LO U C; C1L0 wu0 .- C I o - . U :4.10 x- U- 0 2) 0-) J CL S )0Nfl a 4WI - -U --- Un N4. - 01 c X4.U 0. co ~ IC L 4c' cL 0 O- -

L I-.- L L 0. LU -I me nu 40so w>I OVX U) 2 0. -U M Z- 4j LU Z

0 00 -0 a 0 0L vp 6 U, 0 0.UI 39c 0.1a0I fl0 -' VN U 0 U 4 ' 0 CLC a X - C

UN M CC a. 0"~ - . 0 0- 0V La

ON WUI Z - 020 S - LU) - 8t U .-0. SZ 4 1.41. N0f 00.740. L WW4.I W

4F 44 650 4. 1!L1 .0I e 4 0 owL60 1.C LLL ) NMSE 4 6 0 j 02 - 5 . 44'0

C c- cc 0 LUU -1 3O E - L L 0e 0 <--04

aL W W C IV flU CE1 -(C L 0* Mu<taI--1%--4.-I0 .at 0j 10 UIU 0.. c 0. -6- 4J L m-WOOOW

W-i - .0 30.0 v3 C 1.- 1 0 J JCC 1as ww 41 I -0 S ao 41 OW L z V~~ 003 41 -U) f41 4I 0

C Z Ui. I C U In0 CL CC 0) CU OV suwcnw le -OL L CoI- a 0 0 0 0. >S ) LW - LV

60 .. IOW - 3 -- .. - U - 0- -VM - U- cc 0- .a -. 4 -0

. 0Cf '' W9 S 0 1 01 -1

64-U Ca 1 N xIUUS U U I

N'2 1MW <-U, -) - M 14 U e12 CO (1 )C ft m U. .4& - - 2 C 0) 0 0)

.'Ua - 031 14 < V M EC U U 1- S1sls 5 w Z -U10 CL e 0 0 0 0 0) 0 0 Vg 6V-V Ca0b'" U 4L U U V V0 4- - C C

-2

Page 109: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

.1.

A'

z 0Ldi

* C)

0 0

U- C

6 4C-M 6 jL4 4

vi 0.

aa0C4 'v 4. V

44 Z .( JC

a2 >1"Ca0X . 4

L 0 -1+)004

L* Ce .430aC -f0 ft-)0 - C L

4 -y Vaw 4 4 00 IU4J 4JW m0m0 - 0

06Cl*0m4 - *0 Z - L - LL X U .L, - W C ) 0

a. 4- U 41 4-U-i 0 4-m-a U.0.-a>00-U 4-' U 0ISO OW' >

C404 C- (.U-0 aO .x4-'4) '21> 20- 0. 0C - 0- 0 mc C bI Z m

0 6. 01O C 1JL. 1c0 - z C E90W FA .. CLf - 4-1 0

I 0u -VC 1-U 07Wv.: U) 1Lf- - .4 C*Z oed 4-c> -m- 00 0 mt)~ VIC U;muw 4* jW -4(-- u 41 Oau 0LZU-4 0.0Z U 0.*4 uw' 04 uag 1C Q 4 Mc .a-x M0. 40a CCm>-

-C *uow ac I,9UC .0owwo 1.0 IaL ..0 c a4 0.4 -c A oLa~ z *Z E

A L- W V CC L-- cc- , .'. a .- w mm-D - x -I I I L L LL

*0 W S .4 a) a)-w Lo a) 01 0 0 K. E .*4c A 2 L . L >

U .J L .. 0 .1 a0

06 06 0. 0. a(A vi FA v 4J

Page 110: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

-. w'mrw '--%-~ -. - -. --- I-.

I'

4

a

SU

C -'

Ia S(a U

UC

U~( I-a. -zzz *(o zU K

0'-. U

*U* 0C 2I U

Ia C(a~( I-.~' -

* U Za' a. -

* S -

Ia S~-* U ~ bl-

OC *1~ ~* . U* -..-. U U -

* - ... C - (4* * I 'J I

* I-. I- Sz .~ -

* =

1-4

Page 111: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

Parser for Partial Ada Grammar

0 4.'

0 0

-j 41

u 1c 000

c 4 j1 0

4AU N 01M

61~~ A4"a1*1

c 4' M' -j 4

0~~~ ~~~ c 00jI-< - dcc~~~~~~ 0 L.c0 = LO z w-

es04 01 0 0 a . x=2. L. X J

* aUL1L-00:;c I.1 0L . x - 1M - - X -

&TO- 0Lu f-- vz- o O U- =j 4j IM 4 < .K i I

9 0 410 V-U -I- - 0 44j -. (al IV. M -J --

4- 0- 1U 1. Z01 W 4j

- - U- - - - - - - - -40 - - U.-- - ' - -~ - -U - -. -- 0 -1 - -- j4-4L- O * 4.a. 4I 40 W. W. W.o- W. W. W. 4- 4*0 -1 4- -- 4

z* - 4 j .C C1 -

**g44111144441111444441111444411114444 M44 o u u - 4

Page 112: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

-IW -- 'Z-..- -4 -

- .---. I, - - . '... .4

I=pu

o; o 4.' 0

4J4 4J 0

04Z 041 0J

O- 4.' UN

4 4j - - fifi .

Uo g 0 01 LJ +

0. I. am x c0 4LU -j 4j 3 .

O C . 40 4. -!-1 .

hil -aC<U0 0 UL 00 OJ0 4 a i 40 - 6 - -%1- , U

a0 4 U a c 9 uu )4 4 j4

-0 4 CX4J4 +j 0) IV 11 -a4000 41 X1 4d -a -a. *. -<. -a- ..1 !a-a

40 4141 to U0 -a' 1 UU- . -a10 a-a10 .

- L U 0 C .. fa C IIIJ41UO 0 -x v i 0 OlI = 0to1 4 ~

it1 @4 C n1 . +0 tV ".' U. 0 - VV 0. 0~'. LIcXc +C +) +£ 00 41 - 1 44 ? - 4 41

4J 4. V U 0j to - kv (a +) M1/ 400 410 0

-9C A10 41 X 41 u. 4J ~ -k. 4JN l b: If 1 4* 4

4 10 4J . ~0 0 '~J O 8 0 * ~ 0 '

U 4CW1O-O - 0 0il I-11 1 I c 0 0 m ci m 0 I cCO >.- 4 U 0 4.' .CO U- C UII4J 4 1 + U CJM 4 U" C 4M I). 4

-u )Iv 0 U.C 41 o 04 t" 0N X0 0 0- X4 0 4-00 X -XL0A4 II XLX -

o ie 0 - 41II C 0- 041 . 0. 041 0 041. -. 0

041 UL Ju - C 0 C0 0 I- u- I- C 00 a 0 IC 0 ICQ 4 VIA 41 U' 0414 44 1 LU4 410 N 4104- 10 4104 10 + 4-U4

L .. 0 *x C a 000 4J 114X4 CII 04 vI X 0 XL 0 X

.A-1 0 4 ) cc 0c -.I 041 -'0-.0- -0 1 1-* -) 10 -' 0 10

C =.. 0U 0 do 0 S.UC -L- u0 - 00j4j 4- -41.~ 4A04 0MU 4J 00 4A 00 00 0

U 'ax 4 - - UWX ll - - - --)L C 4I.- - C)1. 'L44XC. -a c4 0- 0 U- 0j 0--- 1- V. 441. C- . -

N awU 1~ g 0'1 m 10 -N a x IA 1-ke = O 0 OCj or 40C L- U 0 0J 0 0

u I4J4 1 444 4- -

40 41L 1.) j0UUc U41C - 0C 4

Page 113: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

4.;4

-Sm

a.

- 0

N. ILL N N e N. II -a NLVvv eLU UI N UU II1N UU UI N UU UI Nt LU 1N UU * N U LNUU

%a *aev.-fl -x - -a en - # U. u U - a ) 1*--g to- a. n- u)0 -a o Co - u o aa -a.. *a u C -a 0 -* a* -5 ae a Lit 414 0 Itn .( a111 R Oni 4 0f -O 11 O4) 4 If

"IU -U N UUU II CUU - U I U ;c u ;c ~ .u U uu -*0 0 *. 0 'D ~ . 0 a .'! 41 1' u 412 N-n1 4- If 442 I 1 U- 12 4L N 41 If #A No o41 04 10 4004Q 40 4J .04, m 1 0 +3 fa 1 to +3 to 41 #a Off1 414J Nu J - .*41Itf 4J U4 " - 1 1N 4. U .e 1 4J)- X-. -1 4U. 0- -. 1 4jNU41 -. 1 1 41 u41 -a6. 0.4 0) 0.II u o 0 04. 0. 0 l +) 0.4 0) . 0. n 0 111) 0. 0 $AJ

C ON 11 . 1 0 I- IC 0 III IN I m -o IC c 0 1- 1 C 0 I- Ic40 J N 4.) U 4J0 4 u vu 0 m~ 4JU U U J 4J M 4- 4 J U4-) M .0 U U V J 4J If 4J UU U J +)N1. 0) X1 W L. xf 0 X 4- XL. 0 X 4- X L. ( 0 X4. XI- a X4- XL. 11 X 4-X L

40 -- Q 4)-- 0 41 410u 4 40 U- 01 410 u 0- 410 U--- 41

41 - - 40 0- - 4 41. 0-- 41 41. - 1 41t. U 0 0 to 41 U 0 - 41 4lu M 0 0

0- 01 A F 0 0) - -0 )0)-

,-4.

4..

'A "

NI to N 4 "" " 0. " '/ ""* " * "" u, .. . v . . .. u " °

Page 114: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

~~.-rr--.--~--. --. - -~ ' .o - 7

Il

Iz

4JU

4J4

ON I .,Q

V! 01. -1

c - u muf u i

402 004 N uCIx C. 0. fA +-U 0 enx.XN4 . t --j x f - L- 0 0L Uc

U ^ ^ Nj (a 4. L. *08. . 1C -4 1 V -i 4J NO.-x

+1 la o1 4142N , x oO . 41 44. m1 0 4 4J 0 0

4.d. 0 4a 02 0a- 0 - L 0 C)L *IQ. C u -mu Cj L x 1

0 0 00.0 W 0- F 0 N -X4. UI UJ -1 au41 0+ 4J C.9 :f 4. - L .3 41 a( >- X 2 0.CL v u4 M 1 0 &~ 41 0.0 to t 0 C LK CL 2J u* C 4 L Vu -C C U9 f-. L.p.j A.. U 4j 41 . Li C( CA. L L =

0 n 0 4 1 J a14 0- 0 '* ~~ +1 U h 0 _j 0 ~ -. -1L -c W. 2 ~ .i a

4.1 NJ!! z i L.X C. Ce C . - .*

*~~~~ 41-i 04 0j im U 41 41.+ 11 .4 14 11 ~ - I40

* ~~~~ ~ ~ ~ ~ ~ ~ c u2. u .- 0 V (. I C I~J u u 31

ii ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 4 _ 410~L ~'-+ U U ( aL 1~0-~40~ ~~~ 1. 1w- -4

* ~ ~ ~ ~ ~ ~ ~ ~ u ul- v. .J4.d 4. ' ~ 1 .~ i ..

Page 115: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

LL

.0

* 0

C La.*a 00

o U - 4e a c

L CJU C. Ng -

U C4J c xa.0

afl C- X C4C.JLI4 0) C La

rS- - - 0 3 QC- N 2.C -.4u C 43 Cj c4

0Y C Q.4 I*i+N4J 44)a cI L .C CJ4 L 4) -all -

c 2 -Nj 160) -J4 J r C I.,' C

(L--i- I- .u00 IM e. L 4 C -- c I- iC N I V I cc4 - + .C 4J I' i

v. 43 - 4 3 C C= L 43 + ) -C toca*1 2 w- -j- - Lo M -C a

24 C L -Aa. LII I X .0 4-CC -

+ 4 a.- N X -J IS L A al 43L3 +-. Ij I u -1 4 C 43 c.J

a +4~3 L L I V C - C -a I 1 4 - L. C-.. C . . . 0 -j.C .- c a-. c 4- I.. - _ .C 0- 6

-C a4- -- C U.C -kV II C C C3 I. Q_IA.U I '.C+ I.1 0IX ~ N- a

*. L. 1-C L L 0. - 430 L . 0..' .. an

L U L.a 4al Ii L3 Cf CI U.-. *C .. 43, At

U - II 4 3 4) . 6 3 - C 44- CI 4 I IU I - . I C CL £ - I-

0j- 4 .a 1 CZ I-C 4 34- f 01.- - I 4-- 43L4C £J L -u LIC _j I'4 m C

OCJ U .CII I -44

oU - I uu.-- aI .

Page 116: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

I..I

00z 01

* a -

= ac "aL

IMu -S 0

a to-i 41. -.1 - a

u 0N 0 U 0)- 41 -I, 1. .. 0 v I in *, 100 - -1'a- fi

- £Ia - 4U JC 5 4.al u ) L. -A 9 9 I-a- IC

w 4J -z _i: - .02 1 c .1 - - L. - .- 00 -

0 4 I 0 4- i Za 00 L 0 I- 3 41J - I V-j- ,0W4_j C 0 n L * 9- 9 1cnc 0 9 0 -0 M. L L.

4 4J Z LL aV-- a c.. - ') 4- 0 L - 6-4 lo C' 6.0in U 1 -- 1 -1 ON 2 N * .J; -0o 10o . 1 3- ) , 49 -jj c W-W 0. .0 'a-zoim19

0.00 - j-- oA-C - .. o -i -- .10 C 0-. L L 0 VI UU- 4 -J -* I..O g . 41 a U - 1- u 4 1 1

CU f m.1 t I m *4..A u6 * .14 E u - 0.- M.. 2 1100I L4

0 x . 0 n C 009 4ZJ g -J - -A 0 .1'0*C i a-n * 4J.0 -4. w

-A ~ 4 0 a 4J W V C. 00 0.61.0 00 N -- a L ~ .4J i * NiJ

-- Q~ U M'49J 4j OIL -ii UJ M.0 4J '9L .1 --- .ag 04- 6I -1 0o 10...J.J. C V. 04- (A -j 0 X 0 c-9 -

a-.~ 1 L 4 0 1. 4 UJ J -. 4J. 4J 4VI .1 L U 4J ' 30o 4-. -11 Iow u. 3 - -u 9OcI OlJ a 4L4 0* O--gI -AC. 09 4JI9 _j-- *0. 1 cc .91 0 31 -l

*4 -O 41 .0 3 .a 41 --- 3 .. " f" 9 JO . 0 3 '.. a 3*c 0VO L c-' L I I I 1 - I 3

0..1 CS 9..I W--..a- .1L I I CO 9..I W.1 1L.

- I 04- 1~ I9a--~i C-a-- *~ ~ l- VI.J o10-

~ -. '4'4.0 -- e-- aC 9 ''44~09 4~%

Page 117: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

.4.O-S...

J4

w Ww6-I44 44

L L

IL 0

LL . -l 4

4J. o 4) 4J L 4JL. L. 4L ma

~4 .2 .26.-.C C . 41 4j L -

A. nIn 3) L ! 6iV-1 as 0 0

16 4 IN It 0a0 a20 --- sa 0 a -11MU -1 0 1 0 j OD. U u -i sm 1 .5 o -j

- - .mv IY 0) 6. ajjJ WI 6 )q - i C- 1 a I 6ia C a 0 4 .. * ~ --- 1 4 1 it 4. a1 L0- -

-'N C~~-L. - tos 6-- ~~- 0U 0) L ) '.L.L6 0 5

a -1 4 -A 46 S- ;. D4 y 1- I 0 I-0 - - 0 I 0001. 0-10 4- 0 -4. o 0 -1z 4-1 L - in L 6-L

0. L.5 V). L La 0 J L 4aI I LS (3 L (63

1' -00 s6 :; 0 .6 C -A.f. Vol n(O [co 1.. 0.e

00- L- 4 .I*N 45 4m -0) toa .5 v.00- 64 0.1 013 US VI. -a lM 0)u 4 0a -J4. . - 4 Lx..IaI

'D 4J 0 .06* I 00 -j j a1 01 vC .0 0 a E C4 C4 4J .'6 4s.

61 01 ~ ~ ~ ~~~-0. -! j ....- -1-..a oi .~ I

_j C L a*4 U-- (0m- a0 * it -) L- - 0CO-) U0 a IA-M 0 IL "l~l0 0. L L go.. Ia.M- C - CI- CI-

U...I 4JJ 4J L) 4J'I.. 0. N5 4- - 0 L 4 0 I ZuJ0 6-j- 0 3)0 66 C0MJ .0) 3,61 L1 6, .0a~ 4IS- 1ti-

-i 6 6 _ c..s- 06-- ; .01 IA - -c6..0 I- 0 - I---

0c C03 C4J C4C4.

Page 118: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

Tot~.-.-..

Iu

IU

Sz

L w

4,0 - 441 ~~L. I .LL

* 14 vW 0 0 Lli z 0

- 4J 0 LS 10= I L 4L* 0 - Ifi 4 2 M L

CI S Ia0 I .. a0

x U *.oxIg -i aw 0 CL a)O-..LW 0 -4 J0 a* Co L 90 -0-S

- 0 4 -4UJC ~ IL I VA aL0aL D4 A4M. uJ 4J xf -1. It ~ In -10 0x w

I- *. A 4J II olU 4j 4.lC- 4) V) C0. SJ;. l .4 C. C ,; I J . 4-1 In WS *J (a C

o ~ ~ .1 01 U - 24 - L4- U S .4 4.. - SI U-109 4 0b .i 0J 4 V coo w ) 0 -Ie -MM 0 )-

*2 I0 SI.Z .- C -. 11 5- 0 ax V' %- Z 0 0 L.a - Ox w Sj

9I C - IL0 1 AWJ 0x- -4, Io- 0~S C -. C C I-- SIj..-SI 5.01"D 4- -JO

-- -j x - - -SS C 10 4 0 . Ca.. it a -L - -A 0 w S.zj a -- 0 -4*o4 . k U1Z oIJL 5'. Lin~C * .M-5 L. 41 a -%PZ L- w.Jo 0 0 0LO 0 z ~ LQ 0I -SI5a S.I.0; " 0zI In LSI 4)21 .a 4 . -~ -ow U- S...2 *i1 j-eCO0446U 0~. 1 u 0 I %- - A 4 .j S W OO 10 0 n C4J -IV)O- C L-

SI. C IL10 91..a aW~ .flI0 * a ) ** _j l00.._S4I-SIC C M:OL10w. 6 z ,OUOI C 4)0. 0 IF..I - - 50- .O..C 0, C 4NU 4 J In In vo.aO - La-. L 0)- LJ

uOi 5:6-4)1. I 5mw Cu 41 In L ) -1 4)ZISU L~ -e'. V 41 013*G10 ( eSI 39C44-1 C-%- zvI -I- a.. 4J 41WO 1 0 0 - X 0C. cn.j C 400C J W- 0 -11.-CIS.0 04 CSI -a 20 C C IAXI .C. 4I.0a - 0C tx- >) CC0

- I n J.- WI S . -- C 1.U,( - I n ~ I S C 0 0 4 1- sa41 .0 0.. W.S5 a - 1. 4 O .e LoC Ie 15.00C of SI 4-. - * * U C a It -j - 4) 4- -J-e - L - J eX VL 0 4 . I -

'.S J 3.a..j SI afl.Je C C O 44 4)0SI S I C4) 44DL

U 40SC

I - 12

Page 119: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

F.7 7-7

w

LL

0 z

C C

00..

z v - 4) 4JI

0C 0 43 S W

S. 0 m - --to0o -1 6 *..a 0 (x

4.) 1. -. 41 41 L41 41

11 4.-I -- I-.J 1 l WI .C I

ac* g I .0 . S. C. a 0 JCx-

'; 00 l C4,-= 1-- 1 C 6 0 a0.) I

o ::4. x *1 0 x41 0 -1.- )- 0 43 0CC 0Is ...- 43 C0

- U .0 0 *l4 1. 0 4. z 43 .L .0a >w.1 C 0

0. -c 5- M. IU 0-C e 1- 0 U 0L. 4 I A NLU 3 -S . I -.JCX-5i-s L- I ZJ-- L-- -05L. 4 L, C 35 NI- V-IlL 0 -1 mu Ig I

_C zl .4J 043. 43 Ol Ui M 5Z 0 0 Q a x ... j..J w 001 0 " 1-j3.

C0 0- x - .- I I I mO-I *I. Ir2 -. x- al- N U U - - 0- C 0 34 3lz LOI i - L- 0L. -z I3* 14-I W4 Qop 1: oe- 440 L -1- 1 1mw u 1

a -C 0I - 04O 0..SC. n.--- J O ICD 40 191 0 0 1 . ' 0103000 0 .0 0I... -1 -14143..0) L> 0 L* L 6L.0g 0 -j X- L IX -- -C- 0U CLJZ>- C 1100 t0 M0C-..JC

-J W W3. 0 4 J UILU -. 0 I aNo4 o IL U-J 1 IL I 0 L UU-- FA. CC

_0-1 - -;!x" 1043 04,-- N* IC 1 C Vi 0m0 IitO 0 .0 1 w I-1444S WI I 4--3.0-1Lu 1La-L 43L-.3~~-I LI LUC~ U I- - WIL V)- WI C-

4J L( 55 4- gc1.IWU L.- LU3 01. e m MO [IT.j 140310.15 0a.. u U I.i 'I- O 10 .0W C4C4333C. WI;- 05-I4IG.-1..JC.0- CO-S- CIX- 000 0 ..- 1 -134C--- C-ZC~CW W. 4W.J -.. 4-.. - C

c 4C 2%C0:11CNN -*0JU aU I 4 .0 -1I ~ I L I- WI -0a- - - -

; a 0>WIS0CWI-I4 me -of 0 I.1 - C- C- -Ou 1 I0 1 is I I 1 0u - 43.4 0 W

S -. 30-J 31 'D.- )t#I) -J3 L - 4-1 -J C - -4. j4- ..Je 4- -

I - 13

Page 120: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

.d.

4-J

0 40 x - 1--

4j 41+4Il = -U-NNL* f 4a II u o a* A

x -S N a 1-0 0 . wem s 41

Al 4 14 -J010 . - OL1 0 z( wi *.ij I--v 0 l

-0 L -1 _. CO 9jL6 L 11 0 -j- -M- A-0 1 .0 wl i QU x i NL o c * L .1 0 S. 0 - - AU

A, 0 - 1 aS i ' . _ji - I *,141 0: - 0 a 1 Im ou 4 00 4- -L. -01 &L -0 I0 j 0 -j L -

1. U : S 0 a' A SI 0 .I o mm 0 - 0 oz 0 040-0 0L L. - , ,L - 0 a. L L. a ;- C C lF lg 41+ )ZJ

01 O.Z SI SI V 0 0 2 1 44- 4*.OLJ IM: lo -i ..JO -1 01 0.1W 41 0 0 * W 0j 0 5 -8.0 1. S1 0_- X - C 0 Z~ - - 41 -j 0- -4.J 0

0, 4-1.4f U - 1 4 -04c 1 4- 0 -aU4 l U - 4j S - )= - 0- SI- I (R4 olI 41 1 -A4 L - S IM OU 4J U4 J .. V) -

_j W C J4 - 10 -J '0 C 4J 4J SC .C0 -04 0 1 i 0-4 - -C

-i 41 01 4J 1 0S L 04 -) S 0 0-" U . 0 I-* 4. -1S 4.J-A -J WI- a.%- (A 0.-i10 41.- wS LL0 -5

-j C a '- M-.a SI - -J j 1a 4- a 41 A . SI..9 4-~OL 9-PI lei-.- #Ji L 41 I~ 4S 4J *Z.4J L.0 ISSu S J 04

41~~~~~~~~~~~~~~ 01 S.. C.- - 1 011 *.~~. L I. ,a C ~ - 0 OI.i g'* 5 ... a 3 0 4Z0I CO 0~aO I 14I' S 4Z49 ... 1 10 .01U~~~~~~~ ~~~~~~~~ .000AU 4 .- S0 I-J S .. C U ~ - 4 J I-~ ~~~~~~ ~~~~~~ c 1 S * O.i. I . 511 U 40

Page 121: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

. - .

014

0 -0

I- em .0 Z 1- aW1 c 0 0 -c 0

*~ 0 xu 1 *I W 0 - 41 0

41 1 0 tX . L 0.0 - Z--

- C4 4- Ix. - - 1 9Ul C-1 0- *. '-41 Wi 0z '-j1 0 .A. C

L; 1 0 00 1 4J -J 0 - 0 1 SM4- 1I'Z L L -6 - 4 -X - -- I - - 4 .x- U 1 64 .. a .U2 -

u .; 0 L 4J L. 4 C 0 0 .4 I 41'11 toN So u -I-S I O 0o 0 0. L. "J 01 us~- o' oJ ~ I

05 - U *0 Ile I L x IM L i L. a- 2 L 0, .j...JLI- 0

L; I S; 0 S 0 L- -J.. 0.1!2 L*iGU-Qs 30 0Z L L O I-gUU 041 0. -z - - -4 J -~ *t.'0US L 4 . . ~ OL(AF Qc a

ajC 0- .X Je x; S U >. u- 0u -4 L 1* 4a - * N -5t . .1- t4L . 91 *. = c - 0~ C'ezae a. V > CW~ 4JONO-J W e -i) i C

C 0 0- 4L 14A 4 ;0- -4 :1 C-Za'0C9 61"4 41~ jLO'LAJ OIc 0NUU -- %-

* U1 1 0 t0 a, 41- .z; Ino X 2 IX- isa~NNO 4.0 1 - 4 C a C 4 .O ~ 61 I I 10 S , U 1 ci-WO L o I- NL.4 4... 00 --a -1 .JL-L.u4L101.. * 04- 11-..- 4

0 ~ ~ ~ - Z 0 414-l0. CeZ -S- OLCZC ~ N .dogJ.0UJ..* U N C z. N...I A, .0 O I -NS.-ag L C NI- C--

S~~ - 1 0 u'..- t" f uu - Iu I I--a 11 I -L*1 41 01 I - - 0 . -C10% .0N LW a S-1 4-. C-i'. -..

.0' S 0 0. c % -1 0 10 * . 410 _..S U.S .jS --- -

N f u 40 0 OILu 41------------ - C ..

'-C . 0 0 1.. -C..J It 4-P .A- IMU - -

0 N L. 41 NL aIs -6 -u 0,~ I, *uo L. .

.. a' -os0 * aO V. C A 4.- -4- -

- *U U 4J NJ L. C-S- 0~~ c- cS 4 .101 2 '-

I 014J aJ4.J 0 C CO

Page 122: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

LUL

ck n

L. S

*i C C L LU

So .C a~ 00

I - I -c 41 LU OL

C 4' 4J I- La. C

S! z S ; 41L 4c4

0 Lm Ia * : L.tI-- 0 4J, X ..6 Ui * O.0 ! - 4 0 L I-

X 1..4ACM - 12 L - L L-1 01 -j _6W Ul. 0 0x 0 - c

4i 4 4c~ 0 t - I.. a4 ) 0 0 I O.r U - l04 . U 41 - 4J

21 Il C -.CI 4- m C CJ 4 1 U U a. LCO 2'i -; C - - L -J -LC- 4 ' 4 ' m :.

0 IS 414 D j _ - MM -A I.. 4 -b U. La. IA

! .U Uf c a 0 .9 -j5 4- -4 0) 0 L5l 0 j* biC X 1 a 4' 0 0 1 64 S0j .- 4 41~'

£ J 1.' - 4 -S L =0~it vX LU O -LU U-j 0 .. IX-S )I vS -.a. 4 I 4 S ) 0 um 1 U) I L 5 4O 0 f '-1 &. C I 0-1..~JC- 4 4 4 4 - -C

1- t ;O C 6 L-U * 4 Z -0.01.10.0 L .J0 -i *I 0 .,4J me -646' .0 0 C..E 4' .- 4.D I-..JC I-.C 4- 4'- 404. l -11 4 ' 1S *U g0 0 0 .0W cc414 0 0 .LO 10 44 U. 4-J-j *x..) .- 40 .06. C :.#I4 .. OU 0.aU LU X-0 Z . WI 0 A.

.ML Mj u(1 1 -'.-.aO 4SJaL..-g .4S LS - ~ -j S -;: I- CS40 V -4: VL2 ~ . 0)8 C' a 4L . 4L .CI 4- 41 L 411 -

as'L I, S_ 0 cIz~u S U 41 W -ow V1 v U c F54 1---. LJ 4' 4IW OI IU C I'4 1(z In I a LU I L U

z 4 i .1 a U-j c 4-- 5 OUja Qi C .. w 8):a.1 m - = 1I4Q I $8 I.J 0u l CI 0J'. ... 84'L-- 4 1 41 0

0 46 .8.- 4 ' C 45 41S . Cl 19. 4 .0

IJ J J IJ 4-%. 0' 4 0 I I -j I- I II I -.. J**...8~-4--A C-1. .J* U.0 LU.) 4' 0 . --- )-014'

I - 0 -CS v CI 4. - , O

I 41 II v U i-4-~~~~~- 414- ... 4 4- VM~ - .J. ' ' 0 C .

*i 4 V 4)S 41L 4J.0m

0 4 L 4' I- 1

1 IL 4U L 4j

r- 16

Page 123: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

* .-. . .

L

3i L LL

-- I 9-x

c I- C f - z

*- 41 im U. SIJ L. - -4 - 4 iL L 0 - 0 L 1 0 -a-X.)0

.0 -v - a 4 (.'4 X 0 - 4) -. 4 K -- U 41 1 SI r-4p = 1 0 j . 0 4 -(4 SI VI- 0 -J a-1

I' o %* a -CO X- I1 0 - 0 4- z u -4J 1 L L .. X 1 91 01 1 -V L 14

U~~~~ U.. r- H.. IU I 4.1 0 SI U S0i L - L ** 1- :I -J SIO.L. 0 j

cxec- 0 0. C 44 ..- i 4- 0) a. 0 c ) 0 4 iSI *X O IS I -1 !0;1.04 01 L) 941 Z V4 4JI LL0 - 141

0.0 L-- 1 - .21* 3O L L1 910E0 LW = -~ 01.- L on..iI .jc4 -i I. 0IJ .s 0 ILK .0 r- o I 4-4 1 In 0I9 0 .0 )0 IL

C. ge Z.SJ L..J X..S - 0 A( 10 I 9 4 4 - ._j _c I - .J -L--..10 .0IQ-O- 0 M;L. Of 3 6; 4J--S I .J X-. a a 0.M L -J M I >%)U - 4-9 I-

* S8.. t.41- 4)L U 1 v~ - LV 0 a 2 4 L EI..1 0 MIl 4M 0 U 4JU J I. .01 61 C.3JJO 0 1 M041- 43 Li1r- +ILauc41m4 4 a 13 04

0 -- o 0c >.cas' .0Qlw 04 -j9 M 0j -. 0-4 -1 U 1.--01I - 41 .1 c a C* 4-1 Q L LL -5.'- i4C 4 4 . 4J - - M 0 1- LLO - -

1. 4 W I- 55.- 41L -'S4E I. 4) 4)41 U .O IW*.-- -J 4)LI -SV i3 It- 14. 4 *5 c 1 4-. a -I GOSp)aVII (J.. 4-4--j C9. 41i . -j~I v 0 .0I4 0.ac . 41 4 i .- IZ0 I .0IJ *

a C1..% ~ +01S Ug L I0I 34 4 .41 LU 105 4 L1 10W 40 4

C.j C09 -c1440 II 44. Z.. L* 41 c .01V fl4- q111 l 4-j u - -.C

a4 4J 4l* 1.C .SII0 4 -I 'O' 1 .41 I0c.~CII0 4 aV'C . c4 '-V*1L I- i-0V .L 41- VI L 1 I

6. .. 4401- ~g.. ~ 41LI 41 1~~oI II -- i-171

Page 124: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

IK

G aa

U. 0) , . LU.m 4 -a 0 - l-

0 J 4 4- 1 a xa -Ljw

In 3 .-(-V

- ul 0u _.a a a 4J 0-u

.3 C. 4 - - C .

.1 (3 v_ 0- a . I. (3 430zj L 0 C.06 C. 1 a - 1 0a1 0 1-1 C. a - 4

6- - .U-J Cso1 4 L J m 1 0 0 1U 4..

In C3 0 0 . . -X - 0 0 4L 4.J L0V_ - 4

- -O 4- j - - C.a aa 4 a) U. 4.14 M U f 14 - L U - 4 ill -3 - z 1

- tj I- U 1X0 I3 N I U NI 4J I -L -j SC g 00M 04C . )M + 4 J~af f MC C q 0 4) -

L 41 C., 441 , L a 1--IL 1 - aa C- )-I - 30 3- 0310 4) al 0) Uj- 4JL

a. 0 a 0 4 a33J 3.i-s a z ) p3 41 afl 03)

4 1 J 01- J V 4J 4J 0 .0 4-1a 4Jq 4S-aD~ _J U - 4 -- C C - 0 4 - -. CO .0.

* ~ ~ ~~~~~ ~~~ 4- 0- J 0. L.- C U.J S.a C.13 4

5, U.3 a. 3 L~ Vi .003 0 (3 j.. a a -~~c 418

Page 125: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

U) U_-3

-C w w

In 43

:: u l (I n

w 4c *- . 0 0

43N IJ 1. WI Ixa 043.8( 41 0 C3 0 x. Z43 11 1- L.= W.

c O. c W'4- - 9L O0 O- V) Wn

a)- a) w 0) U1 if C D 11 1. UFA 4 X -o 43 04)O 0 V) I 0. 4-04 +1I -; 0

In a. 16 a 43c.0_ - -~ C~ '4 4- -- 1

C JV - -~l -3 - 0) 0 (n04 U -~ U ma -

Q _ 0 _ 0 I.- - 4C a-0umM~ 41 - 4 41C 43-c0.v c 4 ( M M 4~ 4- 4 ... 4.0 L' . . -.J

:1 U L :.- -W O V m-' * L0 *. h Il f h <i .4 t-1 C.o 3 0 -p 0 0 - 04 -43 x=CI= +3 I I II I I L LI +J 43 - - 4 0 1X 4

.. l. 23-00 4334 I) I 0 l. _.0 x .* % Yx 4) 0 .0-- I3...L D

00 J 0 0 _j..j _j 0 mv 4J C- 0 03 ~ -0 0C 0- J 4 J % I z 34343- - C 10.J3 4 A4 L 4 4 4 ) -J 4-- - N - C-"a4 C. 4) X -

I low vu 41I 04 1 43 0a 4 3 if ~ UO 43 -43 - 1 10 4) C" 11 4JL'O4J N10: 1_ 4.. c m 0.W C 4- _j *...JCOOOOvOO -i .0 43.0 L 4 1 1..C 1 4 1

vi 0.0 000 a 4- fa 43_ 0-.J444 4 j 0 Io 0U.c 1. 0 CI >%C I41_ CA 000 043 0 . L 4 - -- 4..C..CC. 4) .43 C J - - 0 1434L

110 -4 -- 60%6- 41 i 1-4)Z43000000 M3 043j 43w~ 4 3 43 )1164-0S OI I 4) 4j .0 0.0 M. 04 it * I 41 .0 -*1 - 1 )

*WI 13.J.. 042 b J -~l 1000 U- 43 1-f c M-w01 E0nl... 430 4J 43 L 4I -1 00 0 'I 434 4- 4J .J I.L

-- C~ ~~~~~ 10 c0. .c 43 43. -C4 ----------- 4 '04 43 C -C !: _j -41 3- - 1044 _0 Ln C3 04- 0 - 0 M IJ 4-~ I(l -4 0-J Q.-

1101W EU~ Q4 3 341.......J..J I 41U 405141'4333 W - 3... *04 C.0 4I La.l.- 4' 40 .. C .4In c4 4WIWI.0 C4 0-W 0..- c-.-- 4 4 .O C O .13 IO C I.1I

Page 126: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

-LJ

43 -J W~laW

u 3o - I 43 * () n4

_j 4) .1 .. 0 L.*~w 3 0 3n--

43U . L1. Mn 43 W3~ - IL.- 3 0 L. L 0a 0

2 ".X+ 4J . - L"4 4J)W) *- w -O 0 x u (o (A M . nu0 W3 -4j 0 **W 0 0 = t3 0I 1

4J1 4.) J- 0 L. 4J 41)U 3 11 4.) 1 ~ Cl.; c (A v I) _.j Z -- I+ -4- t n

I~ m i 43..z-l-43 1. 4 C.l U0 4J '.X. LC 0 u0..0 .c* - U Cc U 0-4413 3.4- - :: C I- _j 0 0 ~ c L. ~ - .J0 .) j D .'x 4- L.03 - -. J L O- - 4e114J 43 0) .. 1 Ul of il<c w- ~ 04)

143_ 0- OL.U 4J0) L (x..w 1. Mn4 ... 4 _J M 4nJ I .X 1 In.0 4J -0 L3 1- M4) 4J4VfW 4) 0.0- _ ...I4l +.I..u..j0 141~I 0

An _j m1 .0 it L. 1.0 0 + Z..j 4- - I 4 M _ AM -.J C -UwC 4'JJ *_.j 1.41 1-e)wm 1 o31W 43 <.. 43 _ Z.-- - L ..- 11 f- I- 4 IC< v U_.j s - i IfA '+ -- cz' 4J I I-x'6 L m 01.-- 0-= 0-0011 0 .JL. c

43 4Z a n .Z X -U4 04 4 eJ~* 11 4.i Z~ 441 L. 0 4 Ij - - 43 1.L1 .11 0m 0 4)I .. J-.OC ..J (n._j C 11 .L .0 W L..J.Q _.J- M C 1. in

a 06 0 _J4Jt'D - L I- .J 1 _J_ m4 W 11 Ij Q30 1 - . iIA- 43 L04 0 0 OC 4J1J 11 603-0 - -- = - 0 0 M 3C C ... i< IU 4J 003m 4-

L. 0 -3 C L) , C L 0 -.. 4) C 4J Z 4) 0 L L00 M- O..J: X- 4) 11L. L.4 43 43- 031.! 0 -4 )3I L.0.0 0 04 a0- - 031 00L f a (v >1 M.L.0l u l.. 3 _J ! 14J I z -VI;4I W), I _j+' +In 4J JMMU0 03 11WaJ. 4J 0x0 1 .0 LN -J 43 a 43 X~+ 0 Ci m (a1U 10 010 .0 (n IjC 4J 4J C 14)+ 4 J _ c

- 10 .0 V) _j0E C X_ ~X.4) C. -4._j U- C - 10 cz 1C 4) 0x4 ......_ -

U- 41 - I- c m4) 14 :)4I 1.4 0 - . -1 -U, l I 4J ;0 W 4) W - >1 -430f -m3W 43 u Il IL 1 43 C O.+1 _ m m4 4 3 I _jI10- 4 _j.. I I I %t4+1S- - ...l3Q 4)

11 = n 4A 04- _j iv J L. I c4++ - C .0 3 1. C 4+'J..._J tn 14 0 - :0 M C+ 1 4I4J wC .0*.O C9*4J (A - -10Q..-'- .0- IiC 4) u4 0 .0 0 c o tn 0 0 +J.0U.J3 u 43 c0 .C - 0)LII- In-. 4) M~O 4)1.. 4 I- I LL In 1- C,43, Lto 43in L .4._J - 11 In L 1 0 -1 4 .U 04- 0 - - . 4J L.4) 1 0.11 1 4) 43

-i C4- -: 1.-.) 4- in.._j IV-- 0.4- 4-.- C - 04- - *-.X.J0 1.3:o _4- WnV _-4- 43 -. )4c 1.43 * 4J 0 4J - 1 .-- 4- tn- -. J..J-..4)C 44

V- c C43 431. W In 0C4J+- W3 - C 1(A- Ii +j I 44JL+4 )0 .0 (n 1I1 4- 1 4

4-C ..... 43...- C C - rO0 4- -4- 4- ...i... - _j C41 _....a E----4- tn-E tn- 03- - ..... _j'

6 L41 41+

I-20

Page 127: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

A-- W-7.7 ..

L Z .8 .81 L z F4)4 c4 LU I8 .

Lo - -W0 J 04 - 3 -< - 4-MV 0 dC 0

ul~~~li UN lii 4jXt . . il4 d

.0 L-. a - 8 -

4j x -j 4) 1I- M -)0 < 0 4J 0)Il- m 4J... jUjQ 4 -' ) 1L C 4 .) W. 00

IJJ- W)- . L X- - 8 *. i t- 1

~C0 C4J.';I-I4J U J

I ~1 I -Zi n C 8I .0

.C in L Zn I- j -- -X- 0

-J ~ ~ ~ ~ ~ ~ ~ ~ ' ;.8 0I4. 4-0a1 -4- L -- 4Jt-)c4 1a c00c4 )0cFA o- 84J CIL: Dn Mco zo zW. - VC~ 4 i In LJ C - C4: J> )+ MML0ML

a-1 LI-X84.4.c ... 4. 0. ... ..0. C - 4)-YWe .- Y4X-Y )-YY )X-1 Y

ll -0FAW) 4)z i x 3 I I1 1 J - 00 i-0 4 00 - 04-0 4 00 -

%~ ~ ~ ~~~ ~ ~ ~ ~ ~ p 21L1 0W- 01 '01)' Je000000

0 _ 0 - -1 ou j 0 -1 1 .9 0 -C WJ -- SL- L- L -. . . .- L

Page 128: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

4 wwi W

4a 0 -aa6 *a .8 I

-. * W 00 0- - - -0 L.

.0 UP In 4j 0 1Wrr >.-.. )". - 4.1 )61 4J 0 4 WC L- mA to 14 uA L L-IC In 10 0 I * I I --.

L L 0 L - - L- - 4. 4.. 4-0~ a W 0 S0VI 4- 0 U - . 4J 4- 0A I 4J' +j4 4.)

4 L. +'1 4' 4 ' Z WA * x - M -X W X -X W UOZ 4J 0z 0.0 .'-a ' C - 0- W 0- W 0 0 /) 0

- IwA LO L L . C. *a -. 4.) 4J M 4- 4.) -.1 . - ' .0) oc *.. 0 0. 0 0 o a u 0 I ~ * " C I C

o 0.0 0.0 0.X UZ 0. a z GA .0 11 En WC.) -i W It 0.-1 w. C .1I 0-j I&.a4ao u -a0 4a 0 0.4-4 .0 -1 J 0 .0 Y 4 -j x'L O '-j C

40 -a - * 4 V j C % - C -j. 0- C X - 0- CL

-a - IS o IIU _UL' M .04 0 0 C . oL).01 4 0 o )..a0aNK I- . .J N .M N 00 * IO. I. -) 0 j L. I O Z I+J10.

- )4 0 WA.C C - 0 1 4j ) xC 1 10 4J I- 1 10+' I-i011 v0 1000 V0 4 L 1.OmS) -A I x 4 1X0 m 'U X- .1Xx - .. jX- 4 4J it

U ~U' UU'U:UUU'U U Z -9 0 W -J M-lU . .0 x~ .. 'U'W mJU'.' W >.MW:1A a h0I0C00C00C C 0C0 InwAAu0 4) 3 J 4J l- - j 0 4 L- -J 4JL 4.1L- -L

0LUU'UWLU)' 4-- 0OC 0C W0 0 0.,C 4- 0C.C 0 4-4.0) 0 M u£0 00000 0C0~ 0 0 0'++ 0 41J4 C14JUC4J4' 3 " - 1 :v

- ~ ~ L 41---------------------WW.0 it 4J 0 -. J 0 C 0 0. 0 C - 0 0 i C1 0.a - CIIIIIIIIIIIIIII I LI- - WI- m cO WA - CO - C- CO1 uo 4) 0)

-- 1- -1j- -J -i --j -J.-1. J - Z -J 4J L 4J I I I I I C u 0 )JJJJJ-1- j i- - i- - 1-. 1- 4 - C 0 )4- -.J...J *4 - -.1 4- J 4- ..J -J 0C . 4)

4- M -J J C-- -i j L 0 0 I

Wm I 4J 4- 0..

- - -- - 0 4 I-0

E0

I-22

7-

Page 129: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

~-il

ww 0

U. LAU.CLu

0 4J L- .96-

10 LIJ L6Z 1 JX

41 0 J w 00 -14) 1)c ~ Q-4 0 - 4J -J 4A1 4

1. 0 41 m U U. L 2 .. U C 0 C z

- 4) I0 4) Vi -l 11 .W-J 0-1 010 -( -1 4) EV) I. 4) vj0 04 04)

C j :. - - 41 >- 40 01 Ix L )-)4S, 04) - IF< u Z 0;.-0 - N. -J L CL *n Lz Iz

4 U4) U; IX-J I U- L An - ;- 0 0 .. 0..0

L. . 41 - J: I4-~ C 120 I U 4- 4J 4 J J 0LU.3 z .U 11. IU) uf L 4j 4 . u U.- 41- .. J1. 11x.

0 : 4 -I'D 0..L. fl Iu J3 ). c) -1 4J--- 10110 04141kao c I 4.00 EL00 - - 0 to 0jC ~- V )-I 4 >11.

u 0 L -i-4 O I h0m I <=; .I1 L_ - 4)0 + .; JI

I -m ) I- 040 00101 +j. UJO J Uo 1 1 - ) C- 0 0 C C.4 II.. C 4100J I %)*. 0 m LC Q0.14 x0 - 4C Ix-0 . 4-Z 0 0 1I 4-ZOOS rUO -- (

0 4) U) 0 4- 41 . 0 ~ 141. . 4- 1 U)..I 3 N -i i U 0J IU 1 0....14 4)~ 410 C 4J 1-i MID II J-1 .0 w 0 -j -j w I x

I %- 0 ). .4) J> 01>.) U. U 41 IIII 4~) C ..0 O c .C4)uC4)4)1- .0 M )IA 4-ZO m14 .0. c U) 0 a - - 41 c41...- IC 1C

4. I.. e .O. N -1 0 1 . )U C ... -1 1 I 4) 4 0 m 1 01. I -11U41 1

Z 0 - 41 -1 1 04-_)1.-J0 4- 4J Z 4.. ) 4- 4 1 4JN.0... _4. I -aI.0 -0) 0-..I0 c -- c4 4) 41 0) .0 I- U)-- C .0 4.2 ( 1-

1 4-Z - .)- 1))1C1 1 - 14 41 on N) Itoo -4. UC M.J4.41-..4Ji A 0 0n. I C- -1-1 4- -J- 4J1 U 41 1C- 0.0VA 014 -- 4) C-

0) 1 1c .0 U...a) -- 4) 1 01C4 -- 1 C .0 1 .0 1 4 4- l-L. 4.J C -..i 1- 0 .J1 41 4 4 V-)40 LC I4. (a IJ

3 6 f) uVI 410 91 t- - 41 01 N 100 - 41 0)4)1+ 4aJ .in Is g c- ... 4- %1...) 4 4) U C .0 0 .. I00 C 141 -44

0 C I-P .0 4)0 o - -l- -C -1- 4 4) C.. 04.r- -4-. (4-1. 4 1- 41 W) U) L 414 01- --- IUM 41(1L 4J 14 1 .0 0 1 U )~i.a.I 41

41 A 14 C44- - _j 4) -C 0 4 J. J C4WC 04. -4-V 1 Ci I-44) I0C 4-- 4 l 1 40 11 4 L 410) 4).4 -i I 1.4 - 4.. 4

Ob.0 -4-'- JC J 4 (0 ).

ml 23

Page 130: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

L&

pz

J IL I L.

-5 L

L w6

U)1.

0 .. L -4

I0 ix 6 Ox. 4- 0 CL04JL 0' x J

0 L L 0

3 1 . 0 w.j 0 4 r- I G .

I- _j - a C 0 -x 4. - - -. 4J 4 4 - o - . - '4- ao , -JL 4 4 . ff a- . . 04. fjIL M lw JL _JL - - 4

0 0 -C Xe~ .. w N 0' lmA.' _j INcL - 1 J0.01.. 0 :V 0 ~ ~ ~ ~ IL N* I. - 1 cI 6 R .04 -011w - _ o 4 N1 ) d

- I. 40 4. - oI.Q 1-L .. '-0- z j<4.. L -L .

Uj^ L.. S ~ s40 o 010xIm C L <4 &L. 0. CL L.. 0 I ) 104 - _4j -.j L1419L 0L"0 -0 0- L 1- 41.J S.J . '0

%*z 1 - i 0I _j .J MI. - Lm 0 X_ 0 X U3 a 0 1 0 000L ;41 $1V1Ix 1H 01 J .4hIi)a 4) (';z0- 1 0 4J L 4J L _

.0 IA C0 1 vit C 41 10 04.'L. 1C )> .L. M4 L X- Ix- cX -- i-- Cx +11W :hL .C

11 -5- L.. -i l 0,c I.s AI 0C..' uVX n. I "d X el jL 4@ 44 0 6 IOO L 4O1-' V j 1 4.* 0 0z o' -x _ :o w 1,% 41 00o CL-W L- z C~f 4.JX.OX- -1 C4 J _ j _ j

.1 KX * -_. C *N0 U-JL%4 L C. 0 j L - ...'I i e .u , - l 0 L 4J.C - ~ . IlC il o III* I I

0A.4 C2 0 V C.-IJ - -J+ -J 0 C-0 _ .c j z ) I.'a. Iow C 4+ 00 __ C .J-JL I- 1"L 0 .44414 L( 1 - C- C I C 4)*u'fl -.. 041 11011 o- I .LJJIe'- I -. 1-1131

4_1 4.~. 1- C- _j 4- _j 4. 0L fl 10 -1 4-IQI4W eq' . II 0 o .J - .ls a..I14 Ca I

.4 I 04. .J4. ~~l I.. C.~..' .J 4.. ... 4.. .J5 II.

N~~~~~ ~~ 24 i-~- ~ ~ - I)C .J'~0..0 . .J J.

Page 131: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

00 ~

at +3 - 0 4J

C,0 0 a 00

to 4J 4J J 4 -

La.0 0 0 - L. 04J 0.4 0 ZI.1 U)1 4J 3 ; o

-a u 1 -1 1. - N-U -I. 0 o3 LO c 0+ - +3OQ-j

4a L -- I- ..- C4 710 ~ X

-. m 0) x 0-1 4)1) 0 0 0 0 t OI* 01 0 0 -3. - ) .- a )a . m3+ 9) a

04J 0 04- Im I +-I3x -1 +3 U- 0 0 0 0 ao x I0 U 1x - 0 a 10 6 4 - 1 N 01Oj - C - i lu 1.

01 M4 s IV 1 04 n 0 C 0.=a i X+-a L. X-0o4 i c 0 +3 - u L. 0U - 0 C JL 4-..- . -

1 4,- 0 0 C - < L I &.+3 IV . v 1 U -0 L I z UL GU I * L CL Ui 4) (A Nk j 03j I I I10 00~

10 C 0 '01.. +3. 0 0 3:'o1.0

+3 - zZ . IM. U +30 :1% U1J U ~ IL0L.0 *1 +3) 01+0 0+1 0-IZ..- -.. l Ii0 0I

L. 0J L I.VW +3)C .. 00 ) 3 N 3..L 4J J . J.- lV UII1 1

- . J .*- x -, -.J EL W0... X3 01 0 E:1 19 0I 4.z -J -1X-J

X aX L . -A a";* L.J a. 0 1.. M 3' 4J -- M l 4)L. UC 0 0++

I I~ I< +) 0 4 J 4J41 C4J +AJ~ 4J '6--A)L0W0 M -0--+3 j -+ 40 - - C -OC .JN I~ c 61a f1. 4-001A0)00

0 J C4 J3 - )"a W.- '. t6. 4-* o -10 1. C- W-l. 0 m.J O- o.a)- > c '- C~ 0 Qj +3 0.f1.0 ft~ L O J X-C MfU.O .. O _

FA0 0 C 0 01.l-S10 C,.Z.~ 011 0-a U- 3- - C- C

- 0 1 io - 04- WI.O I -J0 0C3+-a0 -4-*- .~- ..0-i *<-.+3 0C .JXj tx- w -c- 0)E C.0~ 0+ -1 .---- ~f0 * l.-3 .c 0 0, U I+-OOO L J- 1

* 0100010.-l~~~~~I 0 30 L' +3 I 0- 01. 1 a 3L1

.C J I _j --i I + C33++ .+++0. ~-)eo- -lU -X-..X- - -) C0)C 1aC001D +lOO..50 0-l.-

~ ~ 011.0001 -011.1 I'. 01J- -25

Page 132: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

44

cc 40L IV)

0 0 z 3

m. -j10 aiLA

- - I4L.1

xl C , 0CL 1 L

Ds 0- v) v -

a. ~ 4.14.41 4J1 L

N,~U S, 2.14 ~ l.0 0.-. U;

LIi 4 N a .

*~~L 0C. 3 -

*0 40)6 0 43 41 x x 00 04J.s x L Le 0 J0 4 -00 V 0

4. -C I- 4 4J 0 J +- 4U- .4.. 5=000 4 0 - j

4111 0. -0 -j a - aj 0 j - MZ J40. 0 0 14) 6 -j L U U -jL 0

oz;z x N) N L. Xx 1

63- 41-I 3M 1 o< 0 1 0 o A . 00 - 4- Z..I W 0 i L a - L 0 30-0 C- 3M

4k q. 1-U- L a ) 4 L 4JI4 4C U' 1 U11 V1 IAI 4 _

-0 3 4J 51 . j a Ia L. 'oI 0 Ic 0 .J C -j- .... 0a a- IX - 10 .

-- 0 4) 0 0W *C -04J 4 J SM MU 0-

a c3 * a 13.0 0..C<4 :h 43.a4 :h C N 43..43 4 I"- .os C U L.- 4 - -I I 4) 4) C4.IA -- 4) L ** IAs0 .0

10 -0 - -j U lu I I 1 0 1 1;: 4 L..44 O0. 03- 03<- 3. "0.. -1 J. .43: 0 1 .. j - C )4

. c -J- - - ..FA 0 4JAC 4-J 0 .A -J - LA 0. ~a~~~~ 5. 5 C I4Z3.L3LC IL L 5 -

0 0 0 0 1 40 4J LI 4I I) -

CI- C, C3 -1 CS -1-4 - I - -- 10 . C* ~ ~ ~ ~ ~ ~ ~ ~ ~ J 04 S 0L 006i) UJ4)-- 14

I '- I I -~U 0W H MJ6-JL..LI13 O .U I 4

** - ~ 6- .00 LJ4C4 Ca.4))~ 261-

Page 133: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

L6

4J

m V w

L 0

w N 4. 4J 41 -I . FA S i I- I) V )ra< 0 L 0L.>- Si - 414 lU 34 0 0J l

* g NJ -6. x 41 41 me mi 41W JgL 0I-x -4 I-V' S- 0 o - I 0 ..-

0 41.1 Z -J - - U 41 14 1 1% 4. -00 wai j_- M.. -J 4J 4J I. rA Sj 0 wi vi S

-j 41 14 -J 4-Z -M _- -1 4J 0.IN - i V, ::C4 41 UJ. in 4-)! 01 4-

I v-U Si 1 41 X.X 41 = IO U Si 4-.) C -C - . -. 4 I- . .1*O 41-4 0 1 S * C - L -1-L-.- - u -

M- . 0 -C .4)..N 6 .00 09.001 _ - ZD 1.11 0 4- )LL I-- vz )5 > 1.1 Z.J -0-.. 4 141 0 41 x1 01 W U 411 L C 4 4 i

ft j . - 2 3 41 L.)N +.4 V) .0 0 .. M 1 M-1- (l0.0 C v h.-~ .~ S..1 41J II- fA .M. U~ 4C .1 -j M* 00.C..-- 0. _

0 0lo' -Oi N IL O_1 C 0 1 4 %.1 4J 01~ -. w c- 0I- 0 )10 La -~ SiS.L -1 4-4..L>-- -4-- C Aofc 41 - L L 010 - -111 0 41 0 .14 Z43 3 -N. M L. a>, U - j -- 4 0 IM 41S 0 3I 3-.9 0 L .- M M.0 C i *.

0 10 .00I- 4J~ii 01.J. 01 I I .1I- _4 0 ) 1 I IW0010 - C +J -)-50

L - -1 C<-X- 9.MAWC 410 - .ONC-J -. D 41 .1-jO -- ...10 41 I - 4- C 0-1 OIL N-UU -- >-4 N1 S ni _j4 > lO -. OILj - r S) .0 (q l 41 M- L1 .

41 v UO * .I- ):I;: 41U L 1 0 +,-O4Z~ U 1II-1 - I 4 Sf I0 0 1 _j I.C 1 1 1 1 Si! 1 (71-.- L.) .1 lI Wll 4)S 4.1. 010 N1

0 4C - IQC -jC iCi.0 . -. 0N C1 .. JX- 0 4C.4) -1 41o *t 'o'i c 1.

.1.1410.. Si41 A a.)4-4. 1- -4- - 0 C hC 1 .0. Si4-).Q J 0 C a. .J .0 r41, FA0 L I-41 -41 41-0C

_--I 4J ! C- 41- 41 i1I 4-Si- E4 Si 0L . IWO I-. -- i I :;:; _I" - j .1 4J 1 1 *- ..aU01

- 4.--J 4- .-- . - -S

I-27

Page 134: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

'CA

'V.j

uli

CAI LL. wa

Wn 4- L9-L L =~ 3 4j

4j 2 * w1 I. U 0* U) - 0 0 L ~ I

La. 0 L - a 2 4 L 3- -. .. - 2 W= a 0 .

O w * c(A u FA4 I 0 W 4W Lo L - 0L4,. I L -w

- 2 2 0 4 .1 -) - 0 9 4J 0 Uj a 2 * 0 aU m 0 W * J- X o U 0 X 4- XC J4 11 w a . w aY

I 0 0 3 .141. Lj L .1 0 I Q . 4 .- Cj -J 0 j - (n --3 -J -J 0+L : 4-1 L - 1J4.a 4ja- a -- - _jr 1 _ 4 J

Ou U U1 C1 2j 4) 4- I C c w 4 U ) 1 0 .r4 w 0) .1 4) 1 m U ) ) U_ 4jaL- .01 4J I 0 .J W L 0.0 : Ox 4.1X .J4 lf z 0 0

CC C.0 U- 0 _ -.41 _w - j MC _. -14 4C-.1111L' i . - *0 C a)'b. a Ln- La. - _e.$. < 4- u1 L- C- l1." i.. La c _j L 1 ) -* 41 201 _ (7) U 4 4 IM' L6 4- 201 .011 0. ja4 I Z1~ Lwc C J - 4

vn 'a me a II 1..CI In1 1 0 - 41 L al C1.~0 4 --0M 0 _j - 01 La. 4.

LA 1C. 0.0 1.. -~.I.I 0f L 0.0j - WS...I 4 ai In 0 4-r 41 .. 4!I A( 0J =1 -I _j U-- 4J.~ 0 ml I - = I . 9 L.' 1-J -I00l 10 *.0 0 C 4J

4 _. U4. 41 ZZ La-aLL- ~jC - 4 a Ua 41- 4JL .J Z4 'N M W --4 0C0A. 41 Ia t a -==-9 -0 .01 L a . Iah 0 0 ... 09 4>$ 4 1U-10. C) 1) 1 01 ..

4J 4 _.- 0 0i 410 .4-ZCL J4 4 lC_ 0 .I0 CPU LLNC LLO4UJ - 410.J'0 41O C .. W)C INL _j .l.L f C C 0..C ULO.L %C 4 hC W . O4L 4J A .0M

-n L LJ 24;!1 4I- C 4 1 C n0 0 In 4 -L41uw e C In 0 .I W114' I0) u 4mmI 10- -- 0 u~. C ff .3IU. 01 -- 1. uJ0e..LSj 0 1 1-0010 4.L0 4 L. I 3 I

4 00 41 4J. 4-1Z4 LLO -1..0 CX- 41 0 4.1 w _ 4-4JZ1111 I 0X-41 4---- l C U 41 _.".0 u0 41 .0 .X9 W2.0 IL .0 0 C Q 0. 10 .f a..M ~~a0 )- I3 0 0

LI11 .S - 1-I WOU 4 1- C0 qJL- 4 j-- U 0 JO CL- l- II1l 41011 -I ' ' C C IMM0010.00 I C- 1 4. I- i C-i .0 C41C44. (.4a I 4-U .

4.4 -0 itC41 0a.---C - W-C.)), -1 41 C 11 * -C41 -.0,.~, m ._4j.C 41 Io o -I W-L UIn IV 0--o e 0 -41 II-L I1-) 0 1L - f~ 0 U

* ~~ ~ 3 C .0 -4J 4.J 6 4 J 0 leo ar IM IC .410 +J L.fJ 4 .4- O. ' V141 -U4 I.O . U. O4C 41 :% 0.41 IC C .4 .4 0)"'-4-% 4a

C3 ~ . r L _jWj- _j LJ- -- - C - 4-4.l '41 .1U IC- 4J4J I I I 1U02' C ma 141-- -1- aC' 4 m~I - a- a- .- a

*c-x~ ~~~~~~~ -' 284..I--- a- 4)44.l a - 4-a~

Page 135: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

rye~~~~~~~ ~i Vr -:W 71,r ,rra .- r rr~ - '2?.

.41

09k 41 L L L L

L / to CIL1- 0 L) 0. 0

0_ k 4 4

kz W 2 0 0)* I -_% 41 4.1 -4 - L

0 0 Is L 0 4) 0 4111 v In 0- -a I- u -l +3 L 0 L

4 .- 0- U Ia 1 2 *. 4- - - 2 -

. c. -a - L U -. - 0 I 0M I 0m : L-)- a a 1- -Z IM M aa 4 -i 4.6 -1 +3 -l +)f

+3 0+341 010 I U 0 0 - * O. 0 .0 0 OA 0

* j I*-.a . 4 41 Z @ .0 e- SC -4 -Jj . 333 0.- 0. C C 1-- 3 1. k 4- k 4- k C

W,0 a.Sk .la0to L.. - 0I mo 20c 0) 20 * *& to U-. xagLjQ . Q +3 *- 00 -icy 0G a LU 00 a 1*.

Lz 11Z I-+3 -. 2 OIL - OR IJ~ f II.0 C _ cU 0.- C cIV ..- II L = .1 l J: J0W 00 +3 N v-I + - -I +3 - - I _j -L'.LC 2' 0 *uI0 1 I%-I4 0)kM U a0) 4I.. 0) 4 UIJ 0) 4 M a01- 0 X - 0-.- C c me'-+3 01~ 0 .J 0j Z i 1 4 -4J Z La 4) u .-4- 0 IA.

4p 1 L6 -a0 611 ~ ).aN ILO0 ; +3'o 1 +34 +34 -N0 U-> 1> LZ. 0inZ i 4.0 .. L1t C *aC C 0 *.J- .0 0C C 0 *C C

0-0ILL l IVO 100 F3 I~0~ 0) 41 0-L-11 4- M-0 1 0)4-4 ) -0L 012 " 1; 0X4-L J LCeI IOCO 1X4-0) 1 U 4-+) 0) 31 - )U 4-+) 0) U 1 4-+3Z) 0)

X 4) _j CLD - +3 0 -. 0 :Ill 0 LC 40 0£-4 C .04)0.0.01 C tJ f .0m4-+3LU3L--4.. 010% j c-jV> +3i.U 0) 0 *0cu is .0 o c I) IV .0f 0

-. C3 C333)- - IC 4C+3C+3 L 4cl-i - +( - L 4JI- - ("3 L CJ I- -.-- )

I0 0 ) k I 110 .0 1I. 40) 01L uC~ I -0 0 1 LM_ j 0 -) 01k 0jum_* II 1I- +3L0k _-lj I -U 0)%.0- tnU 0)021 -s cmU -4-21 -A_ )ND -#- I-

_4_ .- ~~ '-a 0 0-La.J). kC 4J0 -I LC 400 0 -C LC 0 04J0 C3-l0)..iL L404. .. 0) I . I0 ICL In0C 0) L0 .C

C- C-' 0)-C -n C+0 4jJ L3 +-6 EJI +V I-4. 1.J +3 j E..

~~J- ... J- C -- In0J~ C0 44 . IC1 4- A43.- c0 4 +. -C

- . - k 01IW CL 4J 4J L0 00

* 29

Page 136: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

*~~~7 .. T .*-.

S.,.

9x

L&

L6.-4

LI Xo 3 0

EID H +

so 0G1 .9 11

.X 6 0 4J04

41 E 1w

+41 V4V C 41 11C 41 II

Ig o .- I4.?+ CC 0 .0 40 0 2

41 14m11 0 .-1 0 0fC4a01 0 01+41

m u0C to - A Q - -- - C IC IC.

10 0*0 x 4 1 4 0 -1ac 1 1 0 00 0-J 0

at~ E-+ .. a 44? 01 0 +01 4o1 n--- 0 41 0: i

CL4 C4-'- .0 -, 0. 0 0.0.a. 414 c I to4 C ) 0 1 t Iu 00 0t

* 0 03 C4-- -J1.. 14 41C0 0 C10- -4J-1

U.1. 0.4.1 0 to .04 0 1.l00t J4J 0 04.9-. c1 f .. 41I 0L1

441.4 1 -A 0 0 0+~ C1 01 +1-04 -lo 0 +0 J - 0 -J 4-j II- j 4

z *- 01 6 C4 - 0 0 . 04-) 06 11 0 41 +14 0- FA41 41

* . 41 + 0 ** 4 4 0 00 4 40 00 4- 0M 4 x- U 41 1 1 - -j L. 41 LJ0 0.

41 .u u uC~ lUl 0 - C 0 01 .

V) 0 41 .. 1 410 '-.J ~ -4 ~ - -

a 4 41 41 . 4j 4J1- 0C.0 -1 +.

* 4 ~lE0 IC ~ ~0 ... ~* 0 1 0 ... Ii 0 41 30

Page 137: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

4LL

FA

- 43

9 44.1

< -A 0

II -i -

uua 431

>> a4 4 0 l_

> (c n U

c W 44 U 4J a- J A 4 4*0030+ 1 to ( I) - L

0 w... 40 j 04 ++j 0 L-. t -

aaJ L II . 0V + 4J(L

0 e1 eq c- 0 4) 42 C L 0 0UA >0)i tW 4J .C L4 4)3 z -- - J: JUi a 4 4 1 a4 1 IV 2 43 4J U> t a ( J

- - J 1J 0 1 4J L - I - 0 L- 4 .140 4J 4 4II ) 4i 4J -J -J -J 04. 4.' WI j 114.I4-.0-4 I C4-I -l-a- -- - 2F -) 12 LJ4 4

a Ca a0 43a UJ 0J 1w 4J 43A444 4

312

Page 138: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

- C

4-140

ou +0. 23

03 0L - -A

I 4 LC 0o

00 m 0 J 4

C1 m4 0 4* .44 41 t- * 9x4

- m _._

0 x. 430 L -J 0+

e. a> L f L. LI- V

+S - L 0 ~. 0. .0

0C CL LJ L L 0 -'0 0I1 0. 00- 0 0 L 'ity) 0 43 .43 4

4.3u 0 ml -0 41 u. jiC0 -Mm. J - I I I663 41W3 - 1 ZL 0 4i I lo I -

C ~ I-4 + 0 L. 40 0' -J '.

0 .~ lot -J 0J -1 4J-- 1 L e 4) LW .443* C4 I~ Ca 0C - 14AI ) t68 LX4 13 4-) a FA 4- it

+6u U) ai co0 3. 4- + 4J0 4- ~-0.1 -j --- 143 C inu 43 LW it 4- -0. 0

* 304 00 ~ U 4 Cf 4) 4- L M4) 4140 ,3 +L UO 043 4J X0 :lLa0.0 0 .43 .4J4 - L

-j J 4. I0 43 c I. -i 4J- Ln. X)4 C L3 0* 0 -i- LJ~ 0.0 0-- -J 69 L- U3 0432 + 13 03-C

J.9 41 41 1 03 0 X 0s4 4 4

C~ 0 0.4 '* - 'a 4 243 ai v) C4

* - C 43. a, w4L 4341- CL 0 43t L 43

S ~ ~ ~ 1 m 3 4'L -o m toI 43- 433 44'4..4- -t - I 4*- C 4'C40 C 43 .0 -43 C 0.0 XC

- ~ ~ ~ ~ -43 (n' .4 -i 4i L"'-4 0.33-_..

~ 443 10 .-324

Page 139: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

-L L

LOI Ube-C0 b 0 I

aM S4

J

LS - 64. *O

0 Q.4 . 0. - 0e. 41-J4

4-OL~~~~ L -u 4- -

IJ Q 0 iI 44.. 0 4h * 4

C- * CS~i C- S C.33

Page 140: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

LL Outpu~t File

coI

4.J

4 dI

'I -j N l j * fr i -

L I-

-7=~ ........ .... ----

LLLi

S34

Page 141: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

- ... . . . . . - ... . . .

".- N

• %°.

-.-

I -35

""..t -

Page 142: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

.,.............................. ..........

I -36

.-. .-.- ?* ...

wK x

Page 143: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

T.-.. -

-a-.

fII,-"

litn

-..

aR'°

377

°I -- 37

,4

, .. .- ? . CC 7 ~ . - .

,-F2. . . ... .. . .... . . . . . . . ....... . . . . . . . .

Page 144: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

L' *3 ;l Sw *4 *m 11 !6 0) .cn 's' 0 >'

.m

k3

Page 145: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

.r- -- -- .n- .- . 5 . 5 r . ~ r .% .r - -' ...... ..... ........... .. . . ...

,. .. ... .....

b3. 9

p •.

p..

- - 39

° o.

,, ." ,"". , . - MMM, MMMMM,"(' •• "- r•" , m,,". M"- M,-". M' MM.. " -,M...'n-M '.. M -MMC 1MMC " '".-. MM-." m"" m"" mm-" r, MMC ', ')M

Page 146: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

:7 7-~ ".7-.7-

9-')o nc)o )o nme nC) Y nmo no no r no n mc v no nCSmCS v )CSo l no nmc

11 1 1 0 i I I " S I IS I I.-dI I " f 1 o l f 1 f i 1 1 1 11 1 f 1 f 1 1 1 1 11 1 1 1 f 1 1 1 1o

04

Page 147: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

°t

N-q.

,. a'

" 41

,'..)

Page 148: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

- - * ., .,,% . * -- , - . ,

,

.®Rp

0a.

j.

.9 E • .r 40Z>3

AI I- 42

*a. B.. £.£-

- 1-'

Page 149: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

;aE zi2 o c L c; 6; J ' E1

I -43

Page 150: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

.i. . . . . . . .

"66

'4-L

- 0 0L .

_j L

-0. 41 +' - 0 A 40... 4J 0 IV - W A-

0 34' a)( )V a - -L) 3t) 01 U) V)+ V)-JO0 4

(9 Z 4 4- 4) 4)0 41)f ti 3 3 'mCJu4024 - 00- 4 4J)0 4)4 0 nI-L U.. l4

0~~4 4) -0 CLJ0 n 012 U4J 4J- C V) 4 4 4) 4) Ocfn

4J c )-W O -4)4 4 )0 1 0 4)0 4)0LL - .0

u-l.. Un &n/0 l~o ): c 4 V0. 3: ) 0 m- - 011 -0 0.

- Ia. 0000 1.- 3:4 M-I= 3 IM-0W - if- 0) .N gai .. C E 4JcC CC C 41O0 ML --cCL L- C 4 0 4)L.- L - L.U. .12

0 00 z 0.- tf-- 0 0 aRLW- x 0 11- 0. EW- U C 0 0 l 0 - L- ~ I iL6 - L-OI..L6 U LL,

I-4 I - ) if- 0 0. 4)11 -0 41 .V.0 11 . . .C 0 M .,.L6 E U L6LC 0

*%* ~x)r m - U N - 0 N ~ 0I.9 0 0 I f 0. u 0

0S0a an Is. 0 al Et 0....... NzOL O O 0 S.0 o o NC 0 N 0w u L aC CC ILN U-..------ U-..----..----------------

I-44

Page 151: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

/4-.4)

.44-

II

c L-%--

L L

4w0 0

- U I. II

At 4.)-

I. n )

- 4- 4) 4C" L ). I"

le 3 0 N.

'04J 1-,. 4 . ~ 0 44-14o-c- 4-< 1- J 4 )(A 1 : 3

0" 6916- 0 0. CL -)

" l. - 0 mo0 Z W. 4- 4 -0 In -

6 U.I i .. 040 0 4 W " 4J ) 4 0) W W .- 4- 0 4- 0, - L -

0. 1 UJ 3:W 4J. 0 ): )( / + .n1 V )V : 3:jA-o I

S.4 0(,(n f- w U I -4 0 4J 4) 0 (A 4 0 0 M L .- t,.,W.w U.-V) - 0 ) .J 3 -0 . m 1 E - I 0 11 - 0- -V

0.' U4 .U O-- 0 0A + 0 - 0 11 L- L- M L €

.'.-.""~ ~ .. . .... . : - L . 0 l i . a - .0 3.- L., 111- 111. 0 .......Ll".-" 1 M - .Uo ,, Let. - o% ., -- 1 4J 0 )(W 6ha

O00.0 0 L-~ LWI W M . I - m U. 4 J. 4LJ W 0J a

* 0U~i~a.O~a.IU. g0 0.J0 11J 1 4J4 4Ja (L %n ~ J 4 J

* .#.~ U *~.-.0(fi,0C-0 .0 - ..... ..- 1- -

* 0 .. tfl-S~nS CJ3It 0 n

---- - --- - 0 -. - - -- -0 -- - - -- i - -- - - 0

• -. -I4- 45

Page 152: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

UC

LL

0 I 04J. CR c 1I 1c4 0

4J +) 0 04A'1 1

0 4J .1 )( 4 )( 4'E 4) 41 4 ElCVII %_ -3 -e0V4j 0 4 0zJ 4 J 0 V 01 4JJr1 0 414 1 0 V )

E) 4 '. E l f 0 (oxV 0) 4 3 3: +.1 I C I n -D - 3:f4j 4J4 V 11 Z 1 4JJ0 014 4J0414V)3 ) 4/ 0+51 (,14

4J +1 010/ 0 V) w :0 l x- :. 41 ) l (al Ju- . 3 EI 0 4J10 0 CfLU 0 Z+J 4'L. C - 4.1A4) - L/ -1 ML0 L I W 0

loo 4' 4n 0(1 M X 00f-- 0 -4 0 :HU 0lI En - t-0- 0104- W W1 41 0 L W -L - 01. .I WUI 0/ 1 - L LOWi laIL... L60l : -0-1A 0(1 X~~--O -4 V) -0 i- 0..%I--141C 0 / 410 0W0 L5l 1.0 L6 1 0 L. LA U. 1 L,01 LLL&

in 0 a 3- a x. 1-0 LIJ 4'VL z .L 4tI LL.L C3' . .. .0.

C- K .r; L6 & 4' c- 4)(/cl.U U.. 0-.--- 0 41 4J v W1

3 .9 41 If 0) 4)CfA 3

10) EVL5x 3: V 001 0 0 4j 40 4 0 -Y.

:h 3t i 0 in 1- -O0it

at l L1 0

460

Page 153: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

II 41

tr2 4 L M 4

In 41 Je iIII4-) 4J 4J 4 -V

111 4-)4 14 C L Z4

4.) 41 14 A 0 4 ).' - L- (1 Q 1-4,00 V) 0 ) 0 3 0) 411-n 01 0

41 ) V) 14J(10 4J W-C U- O --.- 4) 4J414 44)414.-C,): In 4)U0-L- W x 4.U.. -

41(D.00 J (1 ( L I.) IA- L OU.L L. ) 41 )w4(

* 4-) 4-)) V(1 In-t A- C- 0 1-0.% x 4 (n 3:I) 4 4)1 In 4)oJ L. - L - 4)I.L U.L w. it -In 4) 0

4)1 4)1(1W 41W 3 tR w- -011 -0~ 3 *Ii vII441 LI 141W W n V 4)0 LCOZ L. £LL 0 4J 0 L -AI 44 M ::-1 0 N 0~4)(A :W In w) L) - L.LA W

X4) 44) 41W 34J n. 0 L-. (4 C441 In In ~4j0 4 0 qL- L U.L6 co 0 -L4112. 3 u I- m- L.-0 if- 0~-W) 41 40 4) 0 N L- M'U. La LLA. 0 .. - - * - - - - - - -- - -- - - - - -.....

4J 04- L- L .LL.- LU.U u- 0 ....

-- 0

I-47

Page 154: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

141

44-

3 (nm- 4- )

4 0 34-0 -410 D

41 0-~l L 6-J0 4tQ 0 CA4 0 3 .0 -

+3 WA 0L. CA 4-4)l c- V 41 4-) (D(#6 X 404- 0 4J 904J

430 0414 -Y 4A... +) 4 L 0 W43V

4- 41 +3 oo 43 +3 0. ) 4 0t0 M31. 4-) 4) 0 V)+ (A0 141 +3) A 0 +J30 -4u V 0n 3: 43 +3 (A - 4 1) cnf 0Cf (n 3 A- )-

e- 44. . M +3 0 +3 0 m i7 L. > 443) V ( )0 A CA L& I

0- v--.- - - - +3- C m A W- M - 0 u 1. .3: +3:0 IA - +-0 11 0 3x0 4 -0 -U L- L- QlCAI- 4) V M4m 43ndcf 0C L. U- -- U n

- - - - --.... : - R +30 - U- 0 11-0 m - - : L3 (nA - A +l- 1-0 4J L. Y.4- HC r-=- 0n : 01 0 0~n x 0I-

CA~ ~~~ L3-.-~ LU3l(. 0 ICE m4O +0 L~.. ...0 ~ ~ ~ ~ ~ ~ ~ ~ ~ -+3 (.4 uI. 3 VL- L 1.40

X.9 IE 0~L.4 I- L L3.I. L.U

* * 0 .0........ N I. I

I -48

Page 155: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

00

40 U 04) 4) 4J

4J 4-) M4) 4 4 )4 itII 4) 4)U414(J 4) V) 1fh

0 +Z 4)4(A 0) +) 4JO 4)4 V) L : ,,

+J 41 04 (n1 W C 4.IU0 4J4 4J4 0' 04)1 M41 +4 0)411- w 3 3: ~ 0m x - 4) 41(/ 41I (A a)41m 4)41 CLaZ z4 0 4 0 - " 0- 4)41 40 M' 4)ILV-Z4) 4) 4 4) V11/ W 30 n-- fA - 4J- 0 41(/3 'n - c- 00

4)04 4 411/ 41 4J ~) 0--- L-4 UII I L,4J 4 -0ILO.

4.04141 4)14-~ o (V 4) 0 L WJ-Oc. Lj.w W L, u 4) 0 L- L U U04) 4J~1u 410 3: 3: -- OW .9 x Ul-0 I0~4

.4)41 J 4) / 1) 14 0 4) 0 U. I .U.U L L - L. W4.) 4) 141it 411/IN 3 0 (" ~ 4 U- w - l - 0. X -a 0 ~ Y

41 (/3 CA - 4J0 4)0 L L1 ... - L - 0 --...-- -Y z

3: 3:4J1l~) -0I1I-0~ M .u

aR41 0 4 00 M ZL U. L.L1 C-*R V) U - U I- &L.

... ..

0 i l :' L- 0LLL w u- u I n 0-t 0O9 - 0- w~u

W 6U U. U ca 00 x 41

I-49

Page 156: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

Za -

44J

.x1/ Go 1 Q4 A )(

J 0 0 0

0oliO0W 0t 1 4y )W 0V M -Wj +.00Lo ? 41 4

(A 10LO L 41.

L 0 1 J0 J L - L.U +IU X -0 + 0 4x. 'Aa4 C %14 M' ::C:0":09 0 z ' tt -

-- .z) ecu (A -s 0v,- 0[cjs. o n- 011-0.

-Z J1 L4. CS ;14 U4 w . .0......1t L t 00.1w-~~~~0(n~ CU +1 <1rc v 3r -o-.

- ~ ~ ~ ~ ~ ~ ~ l .. t.f (f J1J1 12 (1 10 L5 1111

- .M6 aU1 411/ 3 3E '-42I or 0-3*~~4 4t* OA n 140 .Om L - £.u -(, + .0

uit .-0 -.. .. 3. m..rn C. 0..

),.L. U'.1 4 +0.L. L I~L, U..-U 15L0L

Page 157: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

* - -* -*. 4 - - e - ~ - - - - - . - - - -. - - -

41 4

4. 1 4JL4

Go0 1a r I4Jc 04 a jt

4J4 J C 4 4J0-- 1 m 04J1 W

(A +* _ U -+ ). J 4 4 ) 0 1J 0 441 LpM - -0( 1 4 A 4 / 4 . 1V _ Vc _3

0.4 If4 -xv )-3tn ) L - 0-I .( - 0 0Ll. U6 fl4U. C 0 0 a L = D 4 r IIw L-L

>1~ (fl I/ C 01 01 N 14.1 4lf 0-CA 4J 11 N. 0 III~CZ ~

+54II L64 Ufl mIC ' - U '04. an) 4J41(0~~ x1( E30l IIn L~ -549 it 4m 14L0 5%1

C/I~~'I it I- W~+L4.~J 4 '4 V ~ 411Cf- 4+)~I 3In- - ( - 11/ 1Cm41 41 d~l '< 1/0 u ~

.10~ ~ i V5 LuCau.u'a u1 0'~2 f ~ L 411CI +WJ A u5~Orn--rn-n- ~ ~~~~Il OS0 '4(0 - 0 - U 410 )5n01 m C

L L u-A~aS u - n -+5u~rn+5O1 o .0 L V- +OLa0.

0 +W7h,)- I )-n-- 0Ini- 0 0

Page 158: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

aa

z 4- t4)41

0 L-

N j 4- 1

4-1

4J 0 OU1-LJO 04

0- 4- 40 2-0 O L 9 ~ :Z0ZL 410 0 )

4 .1Z g4 J L 4 La4 J4 )V) Q( AA 0 4.' - 4-3L 1 = 0x4 ) 4 0 n4 .- 0 L&t 10 04 4C41 1 02 00 CLO 4J 4 -4 )1 3-U 0- 1- V) 1.-00

0 4 - tQ 4.1 V 0 0L 0 0 U IL L1 . L 0 14 o A(. Z) 14):(Aza4 -t w -i -04 o - )LI %

141-0u -0 41u0W4J0 4 4 . - L. - W 6 u 0 *)-(< ).t 0I- (A * 0- 01,4 '1 - *xVU-A2-

4- WC.C 0 L.I 1 o . -EwLL u. ' 0 (/ 'a 41~ 0 .1Ul - - 0 Im l L-01 0 m.4 Xfl 100L J o14 -C

0- 0111 0 C 5.4 .4 / 1 0.a -J 'Z/- .

L J ~ 4045 4 .'014 u4~ f/S U.' 0U 4J1.~J L-41

-- - -- -- - I-- ~- o4 -- '- .-1 3o

.10~L.aa.a.1L~ 4O~. EL U. IL.. 0 ---..- (J*V .J52i.

Page 159: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

L* z

%n-o

4RU.. c -iC wo 00

- 0 .'WO 0

4 OWLUO4

U41 4lO J 0 4J 0 (A -J DL0.L. 4t0 4 41-V1 4J

41 00 0 0 3 3: 0 v 1- - ) -0-0 a -- 3: ):-0 im LV)hL. V)U - 0J0 4 ; L .IAL. 9*JQ + ( LU~-~4 0 4J 41 4-4-44-

-100i0 ( X6.& LA.&. 0- -.- 4-4 4J 0'4L +) 0A..1&.E

3:0. 4 0 x 0 A 41 L L&. 30 U - - L0. wI c c

0 .9 2L A--0 0 -~ 0.% - 11V* L -4. U. 4J L6 U. U. U.

o4 - 0~ C

0d L- 0)

I -53

Page 160: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

-...-

o .

-. .l=-

IL-% L I vO -- v NO L- L6 I" C.J 9L.

----- --,>, - oil..- -o-

-0 -0 .-

-A.L s- a JU1- J L4

--4a L +

Ls oi "I " c 0 0 a - 4J 44 0 4 43 4A 4)- V e4. V0 1@ I4- ) .-- a al. - 0 0 4 0 to

L. L. C ~ a. - V -0+ W :t 1RVo VL c 4" .

%. 000 00- 0 0 (A 41 0 0 (0 40 1 V) 0,a 0 0

4. , J 4 4J S 0 X 3o 3 0 - t- 0 - S CA y -t 0- E -- 0. 0a- 'I I. I. :. L,&, 3 IR z 4- 4J 1 -- Is

" ' - --4 . ;.! J ( -0- 0) 0 %-. I,-- - - 0 -- 0

'L I LU . ;.2 0-- 0 -A X- -O l-- - 04,S. SO*-' -L 4U 0 L t_. .IU.. -- 0 4 -0 ,L. - L -L U I L

M 0. 0.(Z 0- 9 Z 0 u -l. 0t WN -0~ v. o1 c. L l0 0 0 0 0 I xU I L-00 -I I w L--6 I' 4 0 L-. L L& U. L6L)

... j L

0 0 z 4 fa ' - -A

LUUUUUCL~~~~L L6 CL0 0. 4. U fA41. -ClO1

J44JJ4J~ ~~~~ -f -) -- -- -- - Y U- -1 U) - --- a~

-1 11 - ~ a -iI -IU ----- -----. - - 0 -- Ii0 -- -.

54 4

I VI'

Page 161: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

L )CL4 bC4

001

L) 4) 4))A

4. 4) 4)V) X3:x .) n 0X 41 4 0 0 ) L (13 Z

U- = I04J0 0 ( 4 01 13U 4 )0LA.U.0 4)cc41 0 ) V 4)3: 3 4) 013 1in<-i to

IC 4) (n V ) 040 41)0 (1- 0.Z CL L-(10 Q -) 41 4)CL)z 3 n- 4) 4) 0(1 0(/ Oxf . 0 - I.L4J0 40 V) W .4J 0 4) 0 13 L 13 -) LL. -a.A0...W.

4J~ 4L) (1 040(n 4 V )0 4) 0 if 0. 0.4 0 4)R4 Vw + 4 A ( 41 u 00 1-3Z L - U-~~I- 0 L6 W

V QS0 0V z 4 )W1 -: 40 )(3: tR) CA03L UJ :: IL 0 01--i..

4J0.a4) 0 4 (1 3 4)0 L- L. L. I w . ) 0 03 x(A ' -if WO I aR vi- -0 n -0) x w0 L- L.-1 6 0 L-)4UU. uw0 -

04) 0 -rn-n 00.t VW -1 -04Nw L6 L&I 0 -w -. 0

M LL 0

I -55

Page 162: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

.4J

4J

VV

0- 0l

CM Z

4) 0 -l

a) V) 0T IVLm z I) - I -SCr C

*w 0 C;4 0 JL

01 0 41A -CL En M. L.1 L. .a

+1 O1 o. )E -:h 010. L )) E0-LOC

4) 0n0: u R c 41C 4)IU IU- )41 Ic- V4)Q0

4J 0- 4J. C) .- ~- V 414 +j 4) - .J 44W4 -1 4-4. 0 ( A 0. O+ 1 -10 )4) 4 ) V ) 4 ') W..J 4 Z C . ' 4 1

C 4J a' 4u 01 0+4 MC-O'a l--- 4 0 V1) V~) 4JOW 41 ) U)Jz - O2 J )4'V)00)(A a 3: +1 CLu U): *<.0a)ZZ4 - ( I 4) ) 4) -- C0 k.4 0.) 30)11i -1w - -C - - -0 " X 1 +J< 4 ) W 140 0 ZX C+) 0. i w 4J -c < 0 M ( J0 ()4 0 E 0 +14 « 4 ) / 0 1-

W -< Oa-oJ *a..UZ 3 30 M-< Wt- t) 0.( - 3:1 tm- - VI- -- I- 3) (no -. g- Q..W +14 0C 4J 0 4&4' 4 4LE-0CL' L. 30-0V ) 4I +1- 0 L-4-L- 4l-I- L6&0 LM- UL

OL *--oL 0 )3g0-)4- Ix a-MU - - 0 - - -l--0)O-a-O--ONwO00ww-n11- 0Ui. U3 4J)0 I +U. 0< .L ' -. %- - U.L. 4'lJ - - - LA 0 LC0- LaU-4'tau L0 0.J. LA. - L .-

0-- 301-L- 0H0-O0U N NOOOOWL-fl - 0 a u - 0 ..g4J I--I-LaW.LW 0 L.Ji Iu.Lw L L. L (0 LOOO.-j.J u.- I uL 4) L. I I I I u.0

NY0MWOOOWW.- a ) M 0 - a - O.- 0 0.4-~~~~~ I I1a a 11 4i

I.If

-56

-e ~ -. 0-7~. - 2 --..-

Page 163: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

00

L-. w

0 4J4- 0 4

0 - 4.' t a4J0' 4J

.0 4) 1 i- J 4)0u 4) V

If.'~ 0 4J)dJO40J1O3 Ii-0 L9 In4- ) 4 0 )< 0fL 4J 0

. q% M- U 4)4 I )V) 40 :3 -eI (A O) w :iM~I r4-4J )0 CA ' 4' 0 1- 4Jt -

., 0( LL L6)0 EJ4 U.l 4)04J44)0 nr :1~ 0:~ If( m Wo)~-

4J0. J 4 4 CA 4J L 00 4J L 1 L z (A

4J 4 z z41 )0 4) Z W 4( ) Ww OA M noI -0-If-- -- O 0 o;4.10 UAw -) 4 0.04)1 V) 4J< ) CA 0 L Q. E)0 (A J 4 L- L L,1U 4% 4Z 0

40 0 0 z w 4 4) ) A ) : 4 ) C 4Jnj Z~0 4 - l - . 0 LA.)

OcA ~ ~ ~ ;Ct4 0~a 141l LLI + 1 )fl - -l- 04. C Q JA 0) L.4 -A 4 1 0 t 4. .' La < - L-0 L U. l0

III - 111 FA -C la 04J I I 2- ~- 0 - I 0 1 0-4 -U.1& L0 - W MO I W L)ij -04C L& U. 0.

0- 1- u - if a - 0.- 0~ 1-0 0 - Of. 1U. 4)L. 0 L I LLA 0LLA 1.. IL& 1-.L 0 .

Ox 0 0. x LAg U.I I I U. 0 ' 0 41

40 0 L ) (

(A 4

)0

104

I -57

Page 164: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

-4-

NLSa.1 4

04 4j 4<c+1 4 )Voy Nz = W - C - J0 J4

4"' *) z ; 0 - - --- 0 . 4 1 t ) J 4V ) 30.141 4.1 4 -.1 U wl N - - O4)wVI- O=-- 0 4 J4 J4 ) 4) 4J 0

tPV-CL-L L LZ It0 oW i-j0 - - - 44 4)4 +ju4)w 4)3 W - )- 0zj - QN -< -< -- 4)-0- Z- 4.1~ 4)0 4) 4-)f 0 3f +) R 3-

- m- g -3 L L IU O J -- --0 4-3 -- 0()- / O x 4) / ):-fl 0- $A -0

L~IuA. 4o- uo cx- o.WZ0uo-ZO(J- U C.j 0.Z-WZoC..3-Z 0 - V) 4) 0 4) 0 4- L. - L - .I.U.43 x~ "mzm oD OwWo xvz~c o W 4300 XUJ(') ) cg< 0 u X3 i U-~ tpu--- Ottf -0

* L VW~ Vo#-.(. VO j(-u~ wcoc. tUt( 00 =L-L-U) 43 .0wU L - L- .4)W& L, U~L

4.-

m 9L

I-58

.2, . ..

Page 165: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

'4-

* L

41

Ii 41 -

4J) 41 14 L)m-94 -4cm 0- Jn4 ( )V ~) 4J 4J 41-V

-j ) V A -j u 4) 4J 4.1 ICJ & -42 0 4 1 n 4) _% 1 4 J V) V ) -- 4 4 1E 4 W L a

no 0 41 04 (A3 4J 0 40 LM'- 4J 0) V/3 (/34 4J 41041 L -1(Al 41 0 V) > 3:1 .- -(4-L - 0 0 V ' 3: 3- IAD-41 0 @/3 4 41 0 (A 4-OW L- L- MI& I I L. (3 410 4 04- -

41 90fl --j;3 ow x 3mwz-I--0o0 - 311 En uI---- 0414 (3 4W0 V) 40 L. Lh.~ < LwU 41)0 L L41L4L.

411/3 3 4J" V Al- X - 0- "- 0> _Y 41 tQt-.C- 0 1- 0 C(/3 4100LV 410 L. tLtL4.'- L- I.U. U.W 0 1

3-nt L tR 4JN-0.0 0H3O . '0 c41 0 a40U. I 1 0. L' :JL. w. Ij. 44- 0

fm 0 ~1- 0- 11 - x t 41 41 41- L.1 U w . 0 . w C_ L4-14) 41 410

u- x. 41 41d 4 0 V)

* ~0 3: - 3:4.0 -*-*- U------.--.....--* * * * * *.* - 2 41 0 '0 41 0

0u40

it L)C 4.

I-59

Page 166: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

p 4-

4-4

4- 1

I- U M

w <4- cl +) *a 4. ) ck.41 4 4 0 .14 4) 4 ) (mf

4j 4J 4. 4)C. )+ 41 4) W1 dL4A +1 4) *)4J4 4 10l$ ) -) %4j 4 J41 LA to+La

0, 4j +) 4.p V) 4)/ (A/3 4-3 4) V) 0) 0/ 3o. lw.X 4J0 fO4) 1 J 41 41 1) 0 4.J . 0 4- ? J4) AJ4 IV 3 (3 0 +P0 lL. .i

4- +0 0 *L.wCi -1 J.00 4(CA L. 3: ).1) - Z 4 OV3 00 . 3: 3- 'Af4jJQ .14 0 1/3. w 4 j' (/Z 4)V) W 4J .0 4JOJL..J 0 41(/ 0 0 0.10 40 LOL.41 0 ) 41 ".e 73: z 0 0A X X 3- 0--u7m-- 0 4) - V) t +) M-MMf-iI0 E

0/ V/3 c. O +) c 0 0 (/W IjJ +0 4 0 4- L - L- MWI L Of.- 0 4 0$@ a 1 L ..3; ) 3- 00- a)t (1,' u3: riw- W ?A - - - Oiha- 0 6w ;a- Q(A- :-0 if-o.9 0

x M$ 0 $j0 M . U- 9L0. 4$0 0=) L. L$L- JW. U L A$Z 00 L -i - MW W. L.. L II-L (A-In L 0 X % 3%.A-o-04-0 C J 0 0 ' - 0- %mD !- 4-$u L& 4J 0 . it. - L I- L6a L .4 4- Lu--UU- U-kL.. IA C

a0 it a I0- L

0) U

I-60

Page 167: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

4J.

vi ,bl L

0. 4J 41 4J44, 0 V)0 4)(A~~~ V) *I-SflI

4) 41 0 4)J .0 41 0E In -1 tf) - In

- LJ -4 L n) -1 L w0 in-z-0 E--0

U-0EW c. 4)4 2 . 41 w)I.

~~~~~ m nmn I

4 0 z -0 2 -0 'It MUL. ' iu U L.&

* 2W 4 43 4 61

Page 168: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

Appendix J

LL User's Manual

George B. Paprotny, Capt, USAFDecember, 1983

Introduction

LL provides a tool for creating a parser and lexical

analyzer for any LL~k) grammar. The user provides a parser

specification which includes the tokens used, the rules

describing the lexical analyzer, the grammar rules for the

parser, and a set of code which is user-unique. The lexical

and grammar rules may have actions, which are also user-

specified. LL then determines the value of k, and creates

the output parser.

LL is written in C, and creates a parser/lexical analyzer

also written in C. In addition, many of LL's rules follow the

syntax rules of C.

The terminology used in this manual is standard. Any

textbook on compilers may be referenced if confusion arises,

however, a complete reference to the terminology and theory

behind LL may be found in the author's thesis.

General Format

The general format of an LL input specification is:

token declarations

lexical rules-%%

'" J-1

Page 169: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

production rules

variable and subroutine declarations

The lexical rules section may be empty. Also, the variable

and subroutine declarations section may be omitted, and if it

is, the %% immediately preceding it is optional. If both are

omitted, the format would be

token declarations

production rules

LL has the capability to trace its progress through an

input grammar, and report that progress on the standard out-

put. To turn this on, the token declarations must be preceded

by a line which has "%TRACE" beginning in column 1. No token

63 declarations may be on this line.

*" . Throughout the rules, tokens and non-terminals may be of

arbitrary length. They consist of an alphabetic character,

followed by a sequence of digits, underscores, and alphabetic

characters. In addition, non-terminals may be surrounded by

"<" and ">'"

The Token Declarations

The token declarations section consists of a series of

*g token names. Each token used in any part of the lexical

analyzer and parser must be declared here. Blanks, tabs, and

newlines are ignored in this section.

J-2

.2.- ...

Page 170: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

* - . The Lexical Rules Section

Each rule in the lexical rules section consists of a

regular expression followed by an optional action. The rules

must begin in column 1, and may continue for many lines. The

regular expression is terminated by a blank, tab, or newline,

and the action is a series of C statements. If the action

continues on multiple lines, each successive line must begin

with a blank, tab, or newline. When an action is not present,

the characters recognized by the regular expression are

ignored, and a new rule is begun.

Regular expressions in LL use the following operators:

x - the character "x""- "x, even if x is an operator or space\x - x, even if x is an operator or a space,

unless it is one of the standard Ccodes, such as n, t, etc.

[xy] - x or y[x-z] - any character between x and z, including

x and z•xy] - any character except x or y

- any character except newlinex? - optional xx* - >= 0 instances of xX+ - >= 1 instances of xxly - x or y

i, .(x) - x

Note that parentheses may surround a sub-expression. For

example, (ab) l (cd) is the same as ablcd, but not the same as

a(blc)d.

For a token to be passed to the parser, a "return(token-

name)" must be issued in the action for the regular expression

that recognized the character string. If no return is issued,

the action will be executed, and then the lexical analyzer

J-3

.

Page 171: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

will begin reading the next token.

The lexical rules in a grammar may allow the same token

to be recognized by two different lexical rules. If this is

*- so, then the first rule will be the one whose action will be

performed.

The Production Rules

A production rule in LL has the form:

A : production-set ;

where A is a non-terminal, and production-set is a series of

zero or more terminals, non-terminals, options, closures,

closure-pluses, and actions.

An option is one entry in a production set, and is

designated by [ production-set ]. This defines that the pro-

duction set is optional. A closure is { production-set 1,

and defines zero or more occurrences of the production set.

Finally, closure-plus is { production-set )+, and defines one

or more occurrences of the production set.

.. Actions in a production set are delimited by ={ and 1.

They consist of a sequence of C statements that will be exe-

cuted during the parse.

One last method of defining a production set is by sur-

rounding it with parentheses, as in A : B ( C I D ) E ;

When LL production rules are defined, one of the non-

terminals is the start or goal symbol. By default, the start

symbol is the non-terminal on the left-hand side of the first

production rule.

J-4

'f % ftf. . . . ft . * . . . . . . . . . . . - f

- -.." . . . . ..,

Page 172: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

Errors in Production Rules

There are a host of errors which may occur in production

rules, other than "standard" syntax and spelling errors.

These include the following:

a. Left Recursion. By definition, no LL(kI grammar may

* .ihave a left resursive non-terminal. Thus, grammars of the

form

A: Ba cB:Ab d;

are illegal.

b. Undefined names. Any names that are not declared as

a token or non-terminal are considered undefined.

c. Unused productions. Only the first production rule

may have its non-terminal unused by another production rule.

Also, all non-terminals must be used by some sequence of

references that started at the start symbol.

d. Closure contains empty. Option, closure and

closure-plus production sets may not have the empty string as

a member of their first sets.

Also, a grammar may not be LL(k) for any k. Most gram-

*. mars which do not have one of the above problems are LL(k),

but there are some which are not, and the list of possible

problems is endless. For example:

A: { a I b I a I c

is not LL(k), because determining which alternate to pursue

°- requires an infinite amount of lookahead.

J-5

Page 173: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

Values

LL provides the user with the capability of giving each

item in a production set a "value". For tokens, this value

is a unique integer for each different token, and for non-

terminals, the value is the value of the non-terminal's pro-

duction rule. Actions may also have values.

The values are referenced in the actions by using $1,

$2, etc. For example, in:

A : B C D ={ action I ;

the value of B is $1, C is $2, and D is $3. (The $n values

are used as variables.) The action is $4. The value of A

upon completion of the rule is the value of the last item in

the production set, which in this case is the action. Actions

have an intrinsic value of 0, but the value may be changed by

setting $$. In the previous example, if the user wanted to

preserve the value of C, the statement $$ = $2; would be

inserted in the action.

Each production set within a rule is numbered separately

for the purpose of using values. For example, in

A : B { C D } [ E F ] ( G ( H I )+

{ C D } is $2, [ E F ] is $3, and ( G { H I J+ ) is $4. C

and D are $1 and $2 respectively for the production set within

the braces. Because {} defines a set of zero or more, there

may be many values for $2. Each of these values may be

referenced using the C array construct, i.e. $2[i]. Here,

$2[0] is the number of occurrences, and $2[1] through $2[n]

J-6

.-.-... "£ - ".-.. - .%".-. . "... . . -. . - . -.---. --... . -. -.- . -- - - ---,. • . . - . .-." ,

Page 174: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

: .are the values of the occurrences. (This applied to f] and

0+ as well, except that 1] will only have zero or one

element.)

For the example in the above paragraph, with the input

B E F GH I H I

the values for each nested production set would be

$1 B$2[0] = 0$3[0] = 1$1 = E$2 = F$$ = F

$311] = F$1 =G

$2[0] = 2$1 = H (first)$2 = I (first)$$ = I (first)

$2[I] = I (first)$1 = H (second)$2 = I (second)$$ I (second)

$2[2] = I (second)$$ = I (second)

$4 = I (second)$$ = I (second)

Note that the value of $4 in the outer production set is the

value of the last item in the array for the closure.

The LL Environment

LL has a host of output files, some temporary and some

permanent. All the files have names that begin with "LL.",

so the user is warned not to keep any files that begin with

those characters in the working directory while LL is running.

The output file LL.c is the parser, which must be compiled by

*the user. The file LL.output contains straightforward graph-

.. J-7

.

Page 175: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

. ..

ical descriptions of the finite state machine and production

trees created from the lexical and production rules. The

standard output is not used, unless %TRACE is specified. In

that case, LL's progress is printed there. Also, the standard

error is used only when an error occurs. Any detailed de-

scriptions of the error can be found on the standard output.

The standard input is where the input grammar is taken

from. There is one option for LL. If a grammar is known to

be LL(n), the value of n may be input on the command line.

The output parser in LL.c has the entry point "compile",

which is a subroutine with no arguments. If a syntax error

occurs, the parser will stop, and an error message will print.

Under normal circumstances, the parser will print (on the

standard output) each input line as it receives it from the

standard input.

The use of values in actions has already been discussed,

but LL also provides the string that made up the last parsed

token in the character array "LL text", and that token's

length in "LLlength".

User-Supplied Lexical Analyzer

If no lexical rules are given, no lexical analyzer will

be created. In this case, the interfaces to the parser must

be taken into consideration. LL expects the lexical analyzer

routine to be called "LL lex", for it to have no arguments,

and for it to return an integer defining which tokens are

J-8

Page 176: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

found. It also expects the string of characters that make

up the returned token to be placed in a character array

called "LL-area". This variable must be explicitly declared

in thi variable and subroutined declarations, and the LL lex

function must also be supplied.

LEX is another UNIX-supplied lexical analyzer creator.

LL will interface to LEX if the following statements are

included in the declarations:

# define LL lex yylex# define LL area yytextextern char LL area[ I;

If no lexical analyzer is declared, LL will anticipate

that the user needs a list of defines for the tokens. This

list will be placed in the output file "LL.h", and is suit-

able for inclusion in LEX, or any user-supplied lexical

analyzer. This file will also contain the defined name

ENDOFFILE, which has the value 0 (zero). Zero must be

returned from the lexical analyzer when it finds the end of

file.

Re-Definition of Internal Maximums

There are two limitations within LL that may be changed

by the user. First, a token received may be of any size up

to 200 characters. This maximum size is defined by the de-

fined name LLMAXCIIAR. It may be redefined to any size by

the user. Also, there is a maximum number of $n items that

can be saved during a parse. This value is 10,000. There

J-9

.. . .

Page 177: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

-" There are also 10,000 possible entries for the various values

in closures. If either one of these overflows, LL will abort

with a value stack overflow message. They may be redefined

by defining the name LL VAL STACK.

Bugs

LL has three problems. These are:

a. It uses too much memory for large grammars that have

k > 2 or 3, and may go beyond the 6 MB limit set by UNIX.

Smaller grammars can be almost any k and still be completed.

b. Some grammars which are LL(k) but not strong LLCk)

may not be recognized as LL(k) by LL. For example, the fol-

lowing are two grammars for an LL(2) language:

A : aBbc J. Bc ; A : aCbc ICcB :b I cI; C: B ;

B:b I c;The right grammar is equivalent to the left one, but the right

one will not process correctly. This problem occurs because

- the parser must have the follow set of B to determine which

alternative in B to take. On the left, the two possible fol-

low sets are well defined, and can be used to decide which

path to take. LL can not look back more than one production

to find the appropriate follow sets, so the one on the right

will be an error. (This error occurs very infrequently, but

is difficult to find when it does.)

c. The value processor will accept only variable names

q "or integers between the brackets for a $n[] construction.

J-10

............

4 ."*

a r <, <~. 2 .- .

Page 178: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

077 7W 7"-7-.

Thus, expressions of any sort are not allowed.

Acknowledgement

The material reported herein is based on the author's

thesis: LL - A Generator of Recursive Descent Parsers for

LL(k) Languages, submitted in partial fulfillment of the

requirements for the Master of Science Degree at the Air Force

Institute of Technology, Wright-Patterson Air Force Base,

Ohio, in December 1983.

J-11

Page 179: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

Appendix K

Code for LL

The code for LL was created in many separate files, and

each was compiled separately. Each file begins on a new page

in this listing. The first file is a C "include" file, and

contains the definitions of all data structures, and some

global variables. The second file is the entry point to LL.

The last five files are marked "Standard Code File",

and are used by the "finish write" routine during the final

output.

!-a

K-1

Le.

Page 180: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

-.-

4 J 4

• L ., 0u 0

.- O.- I *

00

.C u

UL .L

I"-- 0, I •

4 ;L0. . - C 2 i

I- -40 4J

4+J t.,.E 10 -

4J U C -) s41 E .ff 0. mc q m x

O>. cc 14 .

0C.L U) c -w 44 4X"

u 0 0 O0".L 0. a.

,a4 u u M L. 0

4'0.- O0 0 ..7-;@ 4.0 0 C C C 1C C C.CC CL .-C C ....

L. c.

---- - - - - - E E - C- E'

0 C 0 0 -000 ,, - +j 4JL .0 "' I It E ' EX E 0) 0 a) = . 4= 14 0 t l O

a0 31 M" 0 . L,, m 0 -V 0 -En .c . u 4j+ U

.1=~~~~I ,le .l.l .J L L 4 [ 00 L- L 4J.. U)-.

If go 4aL - 4) 41

4J 0-.# .m. .. ,-L 0 u En

3- E E Ez 9 E CZ 9 2 2 = 0 c- xS0 Vul- - -I-- = I.- I

- m u u u v u L :h- t

.. .- . . . . . . . 4.) .. .. . . 4J - . :3

Ch c K- j2 i- i- j ( ' n- - 0 r

"" 0. 0 0 ; 4J

U . .€ "- /t -- 1 a 0 I"0 41; 0 3 4,J

0' --. E n 0. 0 c" E -. 4) E I I I I I -D.) 0. 1 1

>s 41 X. c%'

1 4J E c = u m -u c 0 0 C " O- - -) - .- = 0 0

L. .' = ' "

41 vi CW- 0 a L m ) x. m0 we. 0. c -] - -. U- - MI W J C 0 V U

9 :4 4J Jh> > JW W /l-- Q l-

0 UtV ) 0 U- IE J - 0 U - . > 4 CL 4.. - 0 ) 4) 0 ) 0 - ) L U 4) LQ t u

ix W x 4 :,,,-< ,, 0 0. 0 0)E E E E E E 4E 0 0 0 0 0 ,a 3 j .-j 0 41 L..4J .

41. -. 0 I V1 ; 4) 0 0 0 0 ,1 It , M Cn 0 - M)

4J Ve U U U 4-16- 4-, 4. 4. 4- 4-. 4- 4- 4-.4,. 4- 4- 4- 4- 4- 4- 4- 4- 1--- 4q'. -- J C" L, V; W C .L U

K -2

Page 181: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

D,7,

L.

41 c 4J

. c Lo 03.4

i' * O .0 c +)4

44 14 14 4J L)

0 4- 4J

a: W. 4 L 4J3-- %- ( a

- U - t .. -l in4

.E- .L 0 4 40 L. .C 4 u C " M C 4-

41 -4(D0. Im- -04 40 4. 1o- 41 4C 4.4 4-1 -- 4C -1 I C = 1 0 40 1

.'.*. . * . - - CL04 0- u, .v. .

: 00 C.E 41 +,- 4) 41

234.' L.. . C4E L 4n 11~ -0 004 U1 .44 Lji 0L , +0 V3 I, I 4.) I4+ 4- MC. .4 cn EC C - I 04 n4

4J> 4J L-3 4J L3 0 C1 4D &II E3 F31 +3 ) 0L J4 )W41 C 41 C L41 41 C - 41 4 c c 41 Z

9) > im €~ EJ 14- 0 4) • J 4J 4

x -- "o 41 W--.4 J0 - 0 E J(t4

0 CL 0 xi 0 0 0 X L 0 L -4)'0 L LXX 4 X 4-CLX - 410 - L. + - - 00 -0 - 4 41 0 .- 00 41.31 . 1 C 4 C . 4J 4-4.MC 0 4- ,-C 4. C . 1it 44 It 4 it 4N c C a it E3n it 4JW 41

S, 4J01 0 1 F - I-c 0 o - V -i ) E -M 0 41 0 0 0+3- 0 L - -41L. L a1 L aC U- C 41 C C

L. 0. IIm I I 4 iuM0 M0

4 4 I i 00 0oL 4I t 4 0404 IV N 41 N C N - L.L L L 0 -0.0 . 0. 41 0 4 4 0.4J 43 4J 4J>w>w : 00 W1 0 i+33+ 1 0 .0+14-4- 4J3++ 4J '4- -J4

"I I I Cu II u u u + I -1A (A L. I z4 4-. 3 + 3 3 .C C C4J

Cc c ., 4110 0 L L LL 4- L+,.) 5 ) 40 tto 0 0< 1 410 L 4J,4J.4 . 4J +3C - L 0 . L- L.

L. L L /V C . 0 WL (n n i) 0-L- - 0- 4)++ 41 . 4 U- 0 4J . 4( 44- .. -4J - 4 -4- 41

"1 ",, 4 +31+ 43 .+4 0 +J 4") 4 - 4+ 44

u.' u u u c u u u u

I' i 3 1 L 3 2 0 0 = L 3 3 c CL C L L V (0L I4 4J +LL+ 4 4 E U+1L .n LL LL

J 4J+ 10 +3+34 . 0 . 3C - 1 C+3+3CC4 4J C C * L .C c+). L 4J+ 4J X +3I WI Lini-I LVO4I- V L-- n I-- - EV-n- - t.-n M- 0 (An

41 CL 4J 4J 4- +1

41 +1 41 4J +.) 4J

L L LLLL+3.'q .31 +3 33 +

- - . - 3

" *" ,' " L l'o' "r '" ,: ''.". : ' , : - - , ", .- ',4,,-. .. . . • ."" , ,- .. " .,,.i

Page 182: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

C L

0oEI c

*~ X4-

4

C

Page 183: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

7IMn , 7 1

U).0

4- 4)

4J +) 04

4J z4 4 V

6; (n

- 0 M 4-

<U I C_ vi. - -

+) L -

M)4 (D EU ++C

(U M ) u a) -C

L 44 (0C

V(oIC Ux '0 0 4) 4) u c%)- U 4) a ir 4) vi

.- -m 1. 1. S1 4) 4- 1x -

1.C (U E11 0. 1. N V 4

L U 4VI0 4 -4) 4- -C C N

~~~1.~~~ 4i '- 2 24 4C + (0 N 4CC 4.- 00 VE xuo 0)-:) fl044 0 C)a'iA vi ~v (/).4 441 0 - (U 1

4)1 L 4En 0 02E2 4-L.( 14

C V) 0) [A1U -4(UV4) 44 4) 0 M0 4)1. - vz - v 10

0 COIO C L. ( )C.) yU C(

C iv lC C t)) 4.1- 0, rX L1 - - 0 4)

m. o400(4) (D c4 >4( L a

0 0U) 4J 4 4 X ". m1 4 4 t f C U " 0U O 4 3. (0 0~ 4) v U

- L>-.C C - 4) 0 0LCC1.O 41.. 4 I1 d) 4V 0'-444- 0 >4 Z 44-v 0 4 V V. EI ( M LX - LU

1. -- C C O L 0 4- *- 0 E- u00 ) 4 4 4 4(n 0 I 441 or= * 40 0 0 CA . E)44) 4 4 4 4 )4 - . ) 4 4

C >4)43Z . 0) 4 4A0 41. U- VU LU 4-0UC 44)L

.c 1 n4 -) 0 4 J1 Z 0 1 E 4J0 -Cv " VMU 44 lvi 'o- X

4; 1 1. 1. ( . U 0 41( 04 4 i ) 1.- L-o ~ 10 . 1 ( 0 4 . . ( 1

u L 0.440 0. 0</ 0 - < t I 4 ME Ma tn tl ; '4C U - 00 <-

-0 4 C )- Z-V0L 4) *) > 4 C ) ( 4- 0.14- 44 L) 4 4 .

4-) M4 a)>4- f~C4.C U-(0 0 L 4> - V.LO"-LM4JLLVj Vt 0~ C L I-w V)01U j l uuE )VM+ J4 . r:f 1.. La W * < cm.n0) L (0 n

C rC C0 W4 .j U CL < C 1. 1X1 C U

-- (Uv vi0 Lo. J . a).j 44 0 4J C C 0 M -(D -

S44 444cN 4<j< bl (UC0E.C0>.L ov 0i..4 %21U < >. 41 -UM

M AjV) 0 uj ML i

10 3. . . . ..w. . .--.

Page 184: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

4J 00

=11

4-

0

* - 4-

C C C.

441

4. - 4 -

4- 4 x 0

Page 185: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

-.4

41 4

4J 41L£. U) 4) 4

*e' 4. ) 0 4nt ,x3

*"4 4)1 4) )- '- 4*"4 . "3O * - - +) 4

! .4 . 0 4) I - 41Q

4 0. c. U)0 u 1 .- 4

I* , O< LU 4.- . .- 4) : 4 ---.

S0 . . 4) . C 4

v 4.1 (A4 0 U 4c 0

* C - ."C)m U)- V - 0) 4, ,- . m0 -

•4. U -4) .P . ' .m u .D t c

Ju C ) 4 0 > - . -

11 In . U In 4- 44J

a 4) - I 4J0) 0

+ 00 4U) 44 ~~~~ ~ S 4) C- I 4. ) 44 .

44. 4 C 4

43 (/t- 4) 4t '4 -

•" " 4 L O V/ 0) 4.. + 4 Ou0.u. 0 -

S4 , - - .:3 4oz....n 0

4J to It 41 C44 0J 4J '

+ 0 d 01C-

I- 4J L -. - 4J 0 M.4 Z. 4) 4) .J . o) u In . 4 . L

> .9 4) L.- U) 4 mI 4 4) 4 0(4 C m4) 0- 6j 4 -44- 4 J 4 (a

- 41 0 1 0 4) 0 M)> IVm4L) . In . 4J 0) 0 t 4.. 0) 1CL4 4 10 4) 4A 4) m. .C 0)4 4 4) 0

0 4) 4) M4 c0 4- ) m nco In 41+ L-E 4

4 C 04 U.4 0 4 4- It 4) I CC 4 C 4) 0In--1 01 E U) a) 0 V 1.0 = 1 4 0 M CC4)L +J4" C %

44 > 4) 0 C 4) C If U4 C In M044-

m * 40 n 4 -i 0J - 4) j 4) 4)04 0 IV4U) C V) U)< In 0 0 .U. 4 40 4

44 00 .0 4J( C C 4J4J 4A 0C4 0 404)04 . U)L 4)4) L 0 L 03V - Vn 4- 0 M 00 L 4 V U)

L U04) C0 ) > 4) C C 4) +UZ) 4 U ) CU) In 04 4)C4 '4- 4- 4J -W l )4) - In 04 U>U) s - 4) c) .M U n)4 49 - 0 4 J-

4 4-10 IC- Z . > 0 0-1 - 4) - 00> 4- U)>+4c-z 0.- m4 , C '00 0. ) < - C. 4 f 4 0-- L.2 4 -0 0) 40 4)Cj)00-C 4J 4J) In

4J t L0.1EOLAOAM ) 4) 4 4 VL 44 0 0 LJ U) L)-0 00 U0 C > - 0 C4 f 0 4) LOC3 4 3 u V ) u-mm u uc 4JUC 34N 4) E EC >- 4 L 0 L) 0* 4) I -4 ) 0J Q4- C. m4 10'- 4 10m0 C I U V))-~ ) 4CJ n -

* aA 4f >. X Cj L. 4- V C- ) 4c I) lvn C L)4) 4)£4" : f%-)c)4)ZOu 0*E E 4 )- 4)- 4)4C4- 3 4t > 0 4)CZ 00 c

it 4 u . Cc 0.4 4. - 4 ) .0 -3 4 S.4 1 - L- VV 4, 4J)->LCZ < .)4 U 4

UC Z 4 0. = ) -a~ Lai CU GJUC ) c - 4)4 4UC ~4) 04) 4 E4 =>4)0 04)- U) .L 4 4)4)00( -0w ) IVA 4Cn-o ILL LL VLL 4)- 4> (LA4)(nW 4- 41 64) 4o LCE(n.J <C <UnO 4). al)0 14)0 w0 < 4)4)(W

4 ) >u wo ~ o L LV)f 0 4) -u. 4) 0 . 4)

'0 4 1-W ua 4 L 'I E-44S 41 11 41 4 1 W:4 Q~ 4J

C 4 L U u ~ 4 WiuIn0-.J...JD4W4L

K-

Page 186: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

*+) L0- i0,I .. . Om .

t~~~4 4J ,.1 ,oIt4 J4-111 4.J U III

- I • 1 4,) 1- U)i~ 4JI I ~ 4-I- 0 > wn

iv 0 - c M "-m CL M,,. -0 . - ,

0 0 1I 1. I a "

1 4- 0 I 4J U

m 0 in.- 101 x 4 .

0.1 4- -- (Inu

in .. +; 4J v)(/ C- 4J, R 'r 3

- C +L 41 4 + m

0 0 0-0 40 0 V1 . 1 - im I InL 1 L ++ J - N L

O i V +3+O.. -V- E +Z 01 4 0 4-

- It c3 +. ; 4i 0+1 * +31

4.) 0 In c 4J 4- .1 L 1- '0 U -

In0mm 4j 0- " +j .l 0

L I . 1 . i z - ,1 0 Z U 4 -4V .0I

4 -E.-E I0 In c C.z

• I - c I

0 .C.+3 .. W+3 II IIZ C-01 0 0 01 4- ZO LLJ I W x 1.

03 L =+3 WI+- 3 0

40 .)0 0 0 IA V 00 M 0+3 -

0 11 m c3 00 4J r~ r- 4VC414

I+ 3 0 0 (4 0 0 4 )- 0 L C-

60 10 CS 4 . 4 0 L 4C +3 M0 VL L+J

-10 + it < 0 Ic 11 0..M 41 0 IN 0 0 + , c -4-3 M 4 -

4+3 4 0 Co4- 0 M 4J Vn >-+ZO+4 4J

III C J 0. I . ' "0 . C C -I 0t I- C .r 1 14- L L-L4

0 -" C 0J <.: IX a )-.. 1 j30 IIm3m.1X 004J 1- ,, - 0E) 0, . 1 lu 11 0. +3.X W, C L6 -IM . 0 1m i I 0i. L

CO E 0 L +3. 0 0 - E 0+ 0. + Z -

41~ It Z~ 0-- 413 4j W- 4.J 0J

41Q L -) 8)-C4 JM L 4)4 4 - 4

... -.... 4. .... ;:.-..,. .. .. . . . . ., .... .. .. . . . . . .•x. . .. . . . . : , .. -- +3 : -, ? - 0 ., .., . J -- ,,L . 0,. 0 VO* _ , . .. . . . . 00 Z -I -

LI 4) it0 0 C +3 C C 01 ( 3 -JUC4X M 0 WV0j It 40 C MUZ 0 1AC V V 0I 4- (a C

It ) 0 0 V+3+ V)QLI0000 4 6 0VI Z S

V 10 C0 +3 +3 +3 4J +L0 +33 L LX3+ 0) C) L J 4 0 0 00 - 3M CWOC4J4 0 W~O -CC In 04-1 4- 00+

+3--Il 0 >u3 00 -0+0 > +

If0 (n -I- +3+ I4V a. 4J00 f 031 0 V) V0CX ZI i - VV

+3A 0 -lO 00 m0 - 0 .

+3X -i ZV.0 +3+ u 0 +3Y3f-

III it -. +3 ZO VL 1 C11 '-3++3*Z -0V 0 u 4c --C ItV 0to E - 0 0 0l

Page 187: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

V Io

4%1

! Nm

to 4- >) 41)i N4

4- C41 mL. 41 a0 m4 **

N0 -1 4J ) 4it 0.. 4J0)i 00N49 42 2 4- 0 N-Wci 41

0 CO 0 J 01 L 0

N 0- C 41 N Cv u+ 4)0 WC N u 0

N o +'' 4J 4"' M + -

W CA W2 m N + 4-0

N E21 0 2 4) .2C N (4 4)

N 4 WO c2 N u4N 4J Y) . vL '4-' C -1

N 41 1 j 4) Nit

c 04+W 0 t2 412) 41N 4- iI- M 2 N 4- 4 4I

-410 a4J 1 4)Z 41 1 N nU)4 C 41

0 L.C 4- 41W 4)e N, toU ) 4 )4

M 40 U E 4) 4J 41 1 41 Nl 02 4. 0L*to +2 ; % 0 4J1 ,1E 4) 4- E 4J N 41 0) 4t>

N 41. 0 . 4) 02 04-0 0 N 0+' t Lm 4'-41 01 fA c' 02 +' 4) +' N +

@I v. 4J OZ '.0 02).1+ 4- 0 M- i C 4 n mX 0 4 UNJ ;0 W) 0 1. 6 C -024 -It CA v C1

N ) 4-0 a 2 C. 4J 4J ' 022 (n2 m NJ CC 02 nI ul 0 .4)1 41 m (n 06 z. 0 4u i

N 04J 02- 0 4 4 - it14)1 N -. ) 1Nt 0 .4J 4) C4 40 -C 02'0+ L. N 4) Z 0 mM 2

CN LC304 02+ 01 0 02 '.)~ I0 J 4.- 0 0 02 0 0c s 4 tM J 4 02 4 4 J 4)2 41 M-- 4- 02 Nt 04 .C 4) 440(n 1a4N U( 4 - C .0 W2 CO +'2L L0 CJ 41 Chm -0 4)0 I- 02 E 413

m +'- V- . )4 02 4) in0 w2 1 1 02 Nn 021 Cn I 4) 00 U 4-) W 4N 41 0 4J 41 )u 1.4 14X- ol N W M.U 0 4 + J u2 4)

M 024I 06 Q 4) C ' C 41. X'I CO-~24 In UN it. 4- C. Q<cN 41 .. 6C -;;2x 1. 4+' 02 1- -it.- I.. 02 4)20 41 1c -.

( 024 o+ 0 m2+ C'< 06-o C) 0 0 C1 -0 041 41...)IA +44C4 > 'z u. 4-410.2. L -02~ W . - 02 4 - V ) ... 0%4 4)0 L o- -

N ~ c 020 '0 41 41 6 - ' .C.. co II (nN4 C .1 41U

N ) 022 '4. .C 41 W 4J+ 4I It U -N 0 .. ~ *. .4 > I V 4

N CO 4J1 .00 C 4 4J CM < <0 4-) 0 4' 40 100 C 1 04J 2N 021a41. 0 >'.4 -A0 0'1 412.u -02 02 1 uL 4 ) -j tnl 402 ( .

N LU C ~ 41 0. .02 4 N '41C 0 " 0. +0.I +'9

Page 188: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

a a

a aJ

a LL

a . a

a 00 La 1 u v

aJ cat S-. 0 a.0 w4

a 4J W a

a ) L 41 4J an +

a Lu L1 .3 aJM 0a1 c 4.) to iv a .I

4) a1 x 1- M3 cO CL CL a1

iva c 1 I 3 J< 4 -i. 4J A1 a 4Jt.. a c . 3 4L) a0

.3~~~I a M 4JL- + 3 vi

4 x *0 a L - iv. LL W x Wi.0 a -a 1 3 a) aJ 0v L) LJ C Lu0 a 13 3 w-.> 4

41. A, IV a Co 14 m :j 4J .3J a14 L wv 0we ao Wv L 0- I i-a.. C :iv ) z 0 m +

(),3 a a 4t 4.314 o- X1 L' +t a o iv ivz-j a m 0 4-ivi 0 L .0 0Of. vI1 L9 a) iv C C >3Ia + t 3 0

+3- C1 @)I a C3 W @3.J A4JOD

V IL .13 a) C + .3 @ z+ 4J a 0iv 0 iv 0wL L3+ Wv 0 0 iv 41 +3 - a- +3 +3 1 u C.- I

CL+ xu .. aW < (a~ an L. -. L. C 1 at i 4)0w M;0- @+ iv a +3 LEA 43 4N - *+) Cv L a) LA =- .03 'A a > @)3.u L CO N+ +3. Lu- - W - W.u 43 C

ax ~ 4 Q ca a- w .< +31 +33 a @ (N. o +3 <@3 'v aC) Cu..> 4)i iv >43 4 . 3.

li -0 3+ZZ L ii Uv II <O > aj Ms. u Cn LC> iv

0VO .331 z iv -a -* C. a ivC3 t

Page 189: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

0 L'

[ 0

[o.0

m 0

0 W LU

+j to- If4

* .°..'..~

oLC EU 0

111- 4 41.0 9) E 0

+ - .I-

0 - 4' CL. II 4 0 41

X 0 LU 41 m' 0j 210

L w M>4' 0 CM > 0-i L +- + 1-- L1

o 0 to 1 0 4J 10

4J 4- 1 4 M 4' m0+Il

0o L L. X 4'00' 14

C -l 4 0 0 . - .

*%. 4' - 0 A C A *II.

0 * 0 I 41 4)4 -.1 I' L-" 4'x 4- I a +j X M44- 0 U) t 110 4J +' U) Z ^ Il

- 4 j ( tII 0 V- ti 4 -0 4 '

* < 1 0) > " * 0 I I0 1 1I C

X0 I CL ..I -l 0 0 4J 4- <1n1 )0 00 0 -J I I If

U 3 0 LA.V14 ~ 4 4A 4.) n 4I *41 - 41

41 0 -1 C > - M- -- 4' 0I 41 CL.. M x.. I -- - .4- 4 - + X 14 Z 4)

M. 0 C L. =- .C o0* 4- In 0 2J 4- L- 11 I0 z - ( A 4 X .4 ,0 - WN 0.. - - 4'041 . a 4 -0 LU 40 41 C > 0 0 4)

0 . 11 - L x 4 .I--- M4 - N 4 4)4" 0 - 0 - > 3 0 -- 0 0 X 1 0 .. " L.

o ,' VA 0 111 * , A " 1A C 01 x... U -).- 4.41 0 L - - 4-. .4- A 0 C, 4' -

h to 0 . 0 to A - I 4' " - , 4J

C 4- 41 u oC 4c 01A 0 111 V) -

0 * I14-- l 1 4-"4- .'.0 A: -00 C i All - u.Of - 4- 1 U

4jC *U4 (J In * 0 4- L,-0 0.- 411a ) Co4 11 4- 4- "" C i 0 0

0I-0 L, V = 4) U -.1 III4 c4-.0 . 0 4' -.. OI- m.w W 10

44- 1&S 0^- 4 L

I V c U U .j0 . 4

4~ 0 L4JA L 4- t-j+ 4) L4 4'' 00£ 0

L6. III FA' L&.4- C 3 4

4' U

0- L

4* 0 0

I 11

Page 190: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

-- m

m M

L 01

Page 191: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

'51A

5it

.5.-

V 0. 0

4a C aa a a

a a aa1 a - 4JC

* a aa a aa a a m

Q a4 aLaJ a

a1 4a a1 1at aA a)

a a a La a4a

a1 a1 a .0a~~~ a ea a a 'Va 41

a a0 4-Cit at a 3 L 4

a a a) 0aa a a +3W c J .. La a a. U.L m 0 - 4a a) a mm L )U w ( J0

a aJ a. ak < C3 4 0 LC ) maa a a ' - C 4a 0 a. >. a) LAO w- u0 0 4

a w aW>ca .0 a. w < me ca a aX> - a wLa a a w 0 aU W X 1 O M . -a u j a a aj a)0 W +- -

a1 4 1 w C i 4 ) a _ j U < C + 4 ) Ca It x ac u0 ca0wa4 >0 0 aa4-cn~~~ aL * a c ca a- C

.j a 'U V a ~1* 3 0

Page 192: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

~~41

0. 5.

41 a>

4J a

3a 0 aa 0 a 0- .. a

c a1m. .0 4a

a 0 a )it u

0 4J a 0 a 4a 0 cc a .3

at4 C4 0. * c +3

a C .0 a aj 4t c . W W.o44 I- r. (A w. -a I ) 3

*) L. a <) a co a t V a m Q4a CL a --- C CL0!4

it > a 0. 10 > ca)

aa -- a < I o I-ww .. Z a&>a w . c a L

aW 7- -j )- a (A T- wCj Ia It a wai- 1u . t w - 10 - 04 o

<a 0 z * 0 cZ C U j0 ouZC U > aiI

a~~~~ 44

Page 193: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

-40

a 4

9 4.1a t

+a +)U14

wl a.

Ca 0 m1

01. aq .)0 4U

41a +1 41 Lm )4

0 x L .) a) CO t' DIn V L

^). ^ )4 f

m- ;a 0C 4J U

.C. 4J~ M*1 6 t0. L. 2) 1 *- a0 L)0 U. +1

0 c 0) 0 OS 0 4) M4 4-4)- +1 CO u - 11 - < J+1a *e 1

x X 1 C 4 a o Xu+ jm W 14t- +1 C - a 0 C L 6( -4

+122 4J4 +) a 4- 11 1 A.

c ~5 4J 'W W J>4 ( U LuC4 4)a. I-C a 4) 0- R- U 0. M. 4--

01 0J-K 0 4L)4 0. C 4) 4J~ -U .. 2

1-W m, 41O +) 0 0 0 U 1- 4J (I4 O4-4 -1 I 0 14* V1-U 0C- .J 4) U)s In 4-I- 0.. aC;04 J4

c v0 co 1 C--)U c C a - -; 4) .L.J- z C .'4z5 0 c .JC . - - a Z 0 L L04 > 1 ;V- 1

0. -C1- a. 1-- -' 1-1 M 4-) 0. 4 0U. a 41 C. - L 44) , L .- i.. j I- 4 00o+ . - 4.-

do coV) b (4) C0 L-- M a U) C 4) m c -4- . .I.*- 4- Q. aO 00 CU.1-0m - -4- -

-C~~ Lc 01C W----C a CL IM).U M 1 4-C- L-V)4-1

C CL c c c .0 L .Q a9 C *.+-C=<I1 .C 4- - O Q

0) U.. (0 4)U L-~ 0* a. UU W 4+ -W CO L--

>. a.0 0 a --' 04- O--- M 4-0. uAW C _U 0- 0-. --

* £CIO w I.- (.D 0+1 410 a (1 w1II .. 0- U)4 LC(

OZ~ K >~ a1 +0 U.Z> 4- L +Z Ja CE 14 .0-1 -. 0 aU C+-'C0J~ 4J C4 -

o M - 4J V- - ^)- *-4).- a - U J -1.. 4 1*) U).0 ~ -.. m m <CAI. .c4 O-3 04 *0'w a L -j - + ' z)/ z-0<'V0-i - W aiU 0 I-j UL

-. I 4J L. ~ 1a L. 4 -+

4O > 1+1 4. aA ZI7 CL . >+ -j 0

Page 194: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

?o..

4j

414

4.1 41

4j-

C4J

41-4 4

•4 4

4" 4 4

n Ix 4J4

S4 4 4C 4) 4

4 c40 4

x 3 E 0 4J

41 4.)

4 . C- 4J 4.n, .4 4- 4 4

,-. -I .3 4 ,. 4

4I 0l I 4J 4

.4) Z+ .3 4 i 4i

. in 4 , 4

3 j '.C A 4- 0 4 ) 1

n L - _ 4J "o AX ,. 40

4 4- X 4 4 4 J L -4 0 - it 4 0 &

o J < - 0J 4 .1 W- .I L 4 L.3 IJ L .3 - o 3 4j 4 0A w i4 4 C. =3 I 4t

I 41 it c 4 CIl ' - C 4I It -i4 c 4J 0 A1 i'.1 - 4 0

C it . M 0. Ix :

'- 0" N ' - o X 4)- 1 - . 4

" C - ,. I" 4 0 4) 4) 4 .4J 4J M

.30. C t- C "W - cc C 4 4)0- -in 4; : L ' A..- -0 4)

- c ..' C (1* 0. I a. C ) c.

-"• • • 0 (A on'

.. - 0 MD t L 0 'I "0-

It L 4- M- C 0A ) 4 C 4) ig A 4L

49 = O.I Ci. J kno 0,) -4; - + 4- -- 4t 0 .41. 01I 41 Q t. 1- 9 "I.. C) 4JJ (A Wq, .- L (9 I,- it I

:4JL C Z 0O C4 3 M C C C 4 "0

C m :3 .<A w 4 A L C 4J0

'\ C I .A - 0' 4 4)C. 0 1) W4

_- C .'C in> 0 4-- C C 0 t- 4), -' " L- C.'- L

* -" -.. S C I . A . 4. - w .+ ,.I, -1. 4N S-U 0 .4-.C S.4 ,CL0 -W C Z 4I 4.,

C 0 6 4J - 4

L.. . . ,. c, LO , . . . .. 4 C C. .3 M mC 0. 4- . .

IfI' 4 < 0 < <~ WO <. 04 CI a-L L) V 0. (A ~ -C CL.

0. 4 04) 4 .0~h0. 4i

Page 195: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

m to.

.

-.~

*0 0 0m

+3~~~ LLLL L

L

it

U~ 0 L i

CO..0

c

0 +41 1 +j

04.

E+ LL+ it

1 . ) 7. O Ji

41 C1L 41 U1 4-)i

04, 1 0401. 0 .. C it

L C+I L c t u it

* -1 m. .. .

u +-4 4C + ICi01 0 414 01 +- + +30 i

UP L U"q -- '- 4- it

U.-' 0 L LL'C 4 i

ti if If 11 + ~L 4 + .3 3i0Lv gu uu v 4 + C4 + C+z 3) - it

L-"-41 - . - 4 - 4

r,4 -- 4J-", " -

1 C I:4-.L+C X -- EL:I 4- C 4 J 4- itQ-(.0) +3 lil llllilCl L C 4 - L.

4.. C 4j -U- UI + - - ( A 1 it4J 4,J L. 4) 0 L - 4 L ^4) - + L_ .0C. ) > A0': n % I Iit

S - ... X1 44 4J01 ) m 41 - tu41 i

L.4 "a -- - - 0. -- 4 4.. -- - - - -- 4J it

-. 0 £41 t 0 4J " 0 U 4 -

- t- 0 - C- 0 L. .L L - L 4.1o. " ) -) C- 0 O - 4-L L. 4 - 0 .- 0 --- D .0L 4. 1 ) 0 L L 1 0 .0 0 0 C + 0 0 .C -- 0 . 0 i . t

4-" ," 4J 4-0 4.J L 40 - M 0 " l V)I V)( IAl MI (A W v -- - +3 %" . tn (n (nI tn n - +

m 40 +0 ®.1 ,-C-O) ML 0 -4 4 4 m1m 4 1iol 11_ L umm u u u+ u u .x 1) 0. 0.. V . nL u

I L 1- 4)CO.4 4 .J 4) 17-. 1L - 14J. V3 Qi

4- + 3 C L 0 .0 L_ X - 4- L - - - l- I 40 it

,'..C 0. 4j I/) WJ -i U- I- C - - 4J U - 4J 4 -4J4J - 4- ,+J U +- c CL z o 41 1 &_ - - 04' 14- *0.(" c " c4 + C iL. CL+3 I- -< - (D. W+) , L - L .. L-- L- - -

. 13-=- LL, Q-),4C,3-L. +- , C-,C.L4- 0,-C-oCC- 0 it

L 0 , oa- -- - - -C VI % . L. a.. -.--. 4ti

I- - I, , W i J 0.L -0. itk.'+ < < = < 0 " 4, L c

>3 +34 En~ O ' U U UU . ~ I . 0 1 ~- J U 0i

1 7"

L O . 4 1..I .... .4. ..3. -. ..- -. ... . -. .L . +. .. ... . i. . '._t

Page 196: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

Q 4

r- 4

4)L'E

04 0

C0 0 j

UL 00 cC0 Cn +

4) 0 + 04 L + .*

cC 0 4 -4 l * - M0

_j LI IS 0

4 0 0 L +0. LI0

LLIL

0 0.rn a. 4 LIJ C C'C-- E1 U0

4-414

Page 197: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

IRD Hi38 061 R GENERATOR'OF RECURSIVE DESCENT PARSERS FOR LL(K 3/4,LANOUAGES(U) AIR FORCE INST OF TECH IJRIGHT-PATTERSON

HFB OH SCHOOL OF ENGINEERING 0 B PAPROTNY DEC 83

UNCLASSIFIED AFIT/GCS/MA 83D-b F/G 9/,? NEhhhhhhhhhhhhElEhhhhhhhhhhhhE

Page 198: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

II

0&

MICOCPYREOLTIN ES CAR

NATIONA BUEUOFSA 22RS 16-

V...%L *~ -

Page 199: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

.4.1

C44.

4.--

An -s

0~ 'o Q41L05 0z - 04

X 0D1 -) U4 4) 3 V3 - 41

: (A, CC E s- 4Jo. 0. - - U1

4.. 0. 4J 4) .1.. :; .5 IS m L. x

uI- x 0 c 4 0 m4c z... 00 4- E in*-4

0Em 014. 1. L. - 4.

I) OI I- = -2ED 4 1' 0 %q (0 "0 0 n- 7

4- !- 4)~n1 4) C = .0 4 . c U U)10 4-. X 1 41 9) 401 L C - 4) ( 1 4

0 ; El 4) 4 C - 4) 4 - +5 m 1.0 00 0 4- 4) 0 0 U 4) 04 .CL 2 '00 L. 4-fa I.0 L. L. C V . 1 4- 0 . 0. 4-) J C441 u U a'a)+ o' 0 0C 4) - M2 J. C (n U20 IC 4I>4) 0f A0 - 2 U1 - *-+ U5V . 4

0 L.-I C L L. 4J)M 1 L I C T 4 .. V) if4.) A "o 9 -- so 4 go 4 1 4) C - C .C 4) 1 0V 10 . 014.1 L 2 .C X. -0 to 4* - *- - 10xN I - )v. 201 + +5. U -1 IL &. .0 - x 0 a-4 4 - 4 -4

L.1- - -e 0 3 1 0 U C 4)0 C 2 C+5 - Ex 4J4 0J-e Y)' in 0 0 c 1 0.c j z -C - 40 -J C2 I - -=C L.L4- ) 2) V ) IV E L L. 0 1 L " 01. M -4J Z) 0 Vt o 00 V E 0 1- - 01 4-

.0 U 4)5. 0 0 U1 -- 04 le 0 *. 4 . -L1J0

0z 0-+0 +4) ' 5 1 ~0 -) Ll c1+ I 0+5

LC Io L24- c - C. 0 C - 4.- 0 4 - 2 .4)+ 4-0 4 -0+0 01I4J-0 04.a 4 C - 0 01 4) 4) 01 J ) +5 1 4 4- Irr - *) 4 - -. *) 4 -+C E4 )4oIM 2 0 E C 4.0 u4 1. 20 +5 4- 01 w c. 3. Cu c5 C+5 -+5 0 C U C 4J 4 g M- C 5 -C) 4) U C M- 0M -11 01-0 s-5 0. +5 (a C L2 ZL- 2 In L - 4). L.-6 . In .- +

4 0 1 1E IV) +5.0- 0 uC 4J 0 14J 0. 14 0 1 L 01 +51 01 u i ) 1 0L. 0 . 4 V V) V5 V. 4) C 4a C 1 C 2 C 2 M 2 'u-1'u

* 4J C4-+ CC C. C9LC9 XU 4)4- 45 .- +5 c C - 2x C L*4 9 C41.~ 051 C.J 0 4 ) 4 04- -4-1 -4--4- -4- M4- 0

1.*~ L- 0l V+ 4-J 4- 4.C 0 C 2 C - C - I +4 1+4

CL 0 21. 12 O. +5 - ) I

c5 =5 < +'- **C 4-0 UC 0 49+ 4J+ C05 0 9 5 5 +5 -lU 9L )---~ Q Q) 2 . IOC 4U )C 2 C 4U

2 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ N' 4)- O .2tCl 5 -5 XU U U U- 40- 10

Page 200: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

'CL

14 0

CL

* .1

0 0I- CL

0 'V

00

L 01

4-S fo

'.4 'I1 -105 41 0 0 L

-41 1- 44 4- I 0*a~ - a X4 41

4-04 0 41 0 41 M. C2 L*5 -b 41 41 L 4d --A% l

. L 41 Z .0

0 41 0 6- -J44 - a114 1

* C 41X'-_*

~5.. 1 .* ~ 020

Page 201: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

W. P. .F

41 4J c

4z 4 4

40 0 U"4s4 A . 4 4 .a I 4 I0

V .

a.-1 414.

0 C

44 V lb. 4 *4

4~~ 4.41.

4 41' L. 4 41 .94

4 m0 41 4 04

a ~ ~ ~ 4 4 LC 4 .. 14

4 L, -0 4 46 0

2 3 0 ; l.2. 4 L-.L. 0j 0 40 I u

c -U - 0 4 U4 6 404 J -1 N 0 IV 1 4 4

4 4j 0 -41 0 0 L. 4 10 CU e. AJ 4- U J 0 A0

0 - c +) 4 4 on-0-c 414J C

4uS 0 4J A v6 0 c seUc ftzC 104J - 41 4. C ~ 6Z 4.0 4a

4 0 - 9- 0 6.U4 C -3 0. 4N .4u00E40 A . a c- 0 4a 4 A0 i 4 J 0 2 1

4, S I 4J U I I4 A 40 4J3 46 41 -U w - 4J AI 4Co4 0 , 0 U - 4 4 A 0X #u 04 Uu=u g4 J L -C4

4A CI. a .03 0. 4 L .3 0 (wi L 1 0 4 a 4 t - - m 4J . 3 4 J 0- U: C -a 4 A aa 34. S C AL 0c 4c Ulb - 4" 414 L c Qc L 1 4

4A 0 = L .V 1 1 0 l1. 04 mI - ,U X I 4-0 -30 V 80 I.4 o- 41 4aI 41 L >u CA 0 -U t + V 4J 4JS -

a. 1. .C Uc 0- (A C I.- w 4J4

00 0)w- 3w Ow~ o4- Cu 01 a aC I 4-. 0.3 = 0 <IZ 41 L_ 6 =4 6.c 3 1-l.IL -i

Z at034 4.j 0j( ju 4 - Z- 1K 04j 4 .3 u 0i 4 Og _

4 c -6 C 0 , 41 I -403 4W< OU UO 41 .3 C-a 4 -t > -i 4.z~4~ IUS u C 66 -a0

£4 l.CNZ s-3 A .3.3 004CNZO L 6 21

Page 202: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

- 4 1

-. 4- - ..5 - S . . . . . . . . . . . . . .

to0tou

'42

# -S.-

I0IL

41 0 04J 41c 4

411 4t

) t 4aX

0* C 41 5j4 0010i1, 00 a VIC fton 00 I m 41 t

* 01 4a C^ f 4

4j 1- 0f-0 - 94 NL t c v 1

.1 .. - , = 0* ^ -1 41

4) -C 3; 0 C 0t %- 0 o I-V04 0 C4 I In xt c 3 . 104- 1U

S 0 2 4J 0 4A 0ft 4* 0 gM40 ;0 - 4 9 10 0 U ft L. 4

14 a L1 41 .M Mt 0, -j -0 00l- 4 3 ~* -o a.D 3 -.1 -j 4 -44 4a L. 4t 41 l-I - 4

1- 01 4 - j C I* ft O il it-t a040 5414 El.- 4141 t

C 4j0 . 0 9 *o a 0j L ~ st 4.; I ft.- o1- I'i . L - 03 N 0. = 1 C1 00 ; N 41 cg$4a.* 4j :I'D 0 41 0C 4t 4J 45441A 1. ) so 0

M 4 CL 00 4 1 S I -4 414 IS. ft - 0 V I? 4-fL 1 A 01 45- 0 4 0 0s0 .-. -t L. A .

'. 0 -lo I 41 41 415 Lt 0 '41ft. w c. 0 IL 01 00 01 ft0M - M( 17 Z13 ) a4

U41 4L41 a. 0. 0 Ah 6 C) to'4 fA 4134. 41u c a0 L*0 91 0- 44l 4 1 0 S 041 f t 4. a. in.0-

J* t" -0 c41 Z 41 4- E~ ft f 4U aOa..( ;1 - ft N,w4 0 41e.45 .0 u -0 03 f 0 m-4 OW to)WC 0 .0 *1. e .J 0416 41 .4J 1 . ft 0( O 4J11 4-1 4J 0

0A5.41 I1 IN t I i ua Le ft VI A Lw - 1 ft a.Z O ~ 0 CA) 0 1 #j -4 41j. ft 40 <z )4-) 2 .

40 I K M 04 1 014 L.a 254 40 f 4 0 CA. t9 -C vi0 Z- a 0 40 .0 0 i I.s i C t E454 V - L. 4 lmin e 0. 0. -.- mu- ag mi 4- -Cf - -)

00. 0.1 4- 0 11144 .. (A. - 3 2004 L5 4J

j. Z -Zt fc I :03 *U. W10 COL 0j ft 41 0 z <. Q. -f2J - La C46 41 XI -A -j u A' u ft C5 0- L 1

~~~~-0. ~ ~ ~ ~ ~ ~ ~ < << * c. 0 0 M 5 1111 '.41' 1 f u'. . O i

K 2

- ~ 101 413 i..i 1.41 f 0.1 *.1Q.(.0 a i

Page 203: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

4).

2 0

C I4A 0, 41 L -4

ID, La -o I I0*) 4J -m X

xa 0. a 0 0X 0 4- - a - 1

4C 4 a 0'g0. 41 a 1 049a a -u z. 0 -

a 1- 40 a 0 Ca = ; a Lm 0 C1 La tz0 a D.-A a 0.Ia .5 gg. a 3 4Jv - 14

0. 00 a vi4 ^ j404I M .5. S= I2 a. -

.0 aJ 4g 0 C. a. 20

ut a; j ml- )I 4- 0 Ul a)-W -4 4J a. 0 02. ;_V "a 0 0 41 2.

aj1 0 4)4.. 0 al = i . 4L M. aj 1-%L5 0 a .h..5 - >Oc - ;: %a 4) 0. 4( V a'-

* I a L C - 0.0. a6 4 1 vIC5 Lia O '. 0.1 - A a

0 a. ty. A. z L. a mu I am - . L** C .8 a =-r .5 .- .5 2 z

10 41 1. a ' 0 Z :1 4 I C c!Z~~~~~~ U 4) . a g ve

a~I 4a a. a4 40 . a a C.sN J .a.5 0 .0 N. 41 N~. 001

*W .5 . a tu.O .5 - I t 5j 0h L ~01 a -so ZQ .0 a Z 0. a5I 0u. m. a

0- 44-s a- U . i I.I 0 4-* a '-5

4~~L Ciza a SI 2- a 4- -.8 000-.. ~ na a . 0 , 0j 15 W..J A 0( A -a a

~. * l 0 ~ - C 5A .s0 a 07. .

*~~ ~ 09 C ac Ix0 (0 -'a 4J 0 0 Ovi~~~~~~~~ CL U. Q m (WI s u U W i

* - a S .- 0Z~ 55 ~ 0 a 0023

Page 204: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

"~

-W-7

!6,

.44.

.44'

0p 6N 0

0 4J,

U5 ^ . 4 1 L 4. f 1

iN414 J0% N V0 0 . 4 A 4

40 4..4 DL L t c>o0 -

40%0 00 - 0

C 064- 4)c 2 .4

-L 0; It 0 00U'0. IQ .. - -% I

- 4- 4 0. 00+ 0-* 4*&- 40 4- %4..4. .u

(A ta S N4 CY V4 u*V a-A 1 I UWo1 7*-0 ZI, z o4 . 4 2Ide f)- CLC 99 -C* I 0 W n Uu - 4j x +ON 31 0 > 4*. 4. -N 0 4.

0* 0 ca N 4-1.0 01 4

*~~~~~4 0 4J .0 4* 4

* 5. 4.5 X N .- 0-l C 0 V 24

Page 205: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

77v

kba

le

it 4J4

4-P0 La 4; 2

Ia-L

x a

%. ~~ I C 1M au

a 4.)04 4I~ ~ ~ -;9"41+ .0N4

x a 4+go 0 -6) O

4j a U) ^ ) 0O 0 1 - 104

a ~~ 4.4.jI. 4a VI~ 440 - Q 1 4

it 4J- 3 I m4

C u V S o J4 ) 4 1 04*0 - 41 a N14.)4L) .

Oqr - 0 j - 4)

44 u - CI Ci 1 11 0 . L

-. 0 j' x i. a .. 1U 4- 4Cc .. IR C-9 aJ -I 0 -0 -4o z 0 A..- aa 0. - < 0)04-0

a. cu CL~. j i = =. -c in5~~ Ix 4.442 -1 a uu -1 1-

.1 = < <4. =. < 0 04

01 mue .J a 25

Page 206: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

*~~W I- * . - .t . .. -- - - --

a a- a, a

af a. aax a1 a .(a I aJ a .404L1a a a.D 1C~aL a. aLC .Q

a a i0 a5 a5 a6 SEa a4a

(0 a av a0 -U- 4,.a 5 a2 ao - -Ia a a1 a 4o-U-e

a 1s a a: c

- 0

6aU X 0.-- lo L a a - - 0ac z aa a.0- a300000004

aL I-a0 a am 0a 0. -- c> .(...2 a a0 a 0 toco -W a a --a 2 ->-u-> a g>u e> 4 a wa O c ..-4W -I a a 4a. Ua I-4uf04 au a)Xw- o o wj 0w(69 a1 -1 -1 uw, cg a a .- i 0xW

aa z. -Z LU U aC C9 aC L .ca0 11 a.~~a a a

a c - Esfa a a a a26

Page 207: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

* L

V 4C

41 xc S

o- . 4C00.

S 0c

0 - a aa4 a

4J 0 4

4so C .cc

w - . COj- S ~~0-. a.o

* ~~ ~ 027-'.

Page 208: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

444

.0 0

4--

44

c 41

x 44 4-4

4- 4

41 0j 4L440 0 0. 4

to 4-' c 04J 41 L 0 1 0L

vi vi 4i 4 4

10 "000044 -

L 'll 41 U i 0 1I.. V 4J 4t4 1 c l

4 1 x 41J 4-

re V - C).. 4JIj 10 l- 4 -cU6 J . 1 4- 00 4 C 4 J 0J c +

4J~~ C 434)" 3 i q3u :a.

*1 41 c4 v1 c 0U 100t

I _. 4 9 4141I 4 AM 41' 0 C 4

4!4J 4A C L0 4Lc V - )a L L J J0 44 0 VI 4)L 41 44 1 0 0.4 J4 V:) A-

1 a 0 ~ 4- "a-,Vn M C 0. 44) 1 . L M^ .. it - .0 4J --L _

2 -b 0I I 4) IAI I =4 V) 41 .. )"L 0 OCo 0 bc4 0 0 4J 414 UL

414 ODm (A 44 a U -V 41 14 -U V 4) 4W-iL411 uu01 14c .- a 2 43- 0C + LI4

V 4J - VI; J 0 . 1 0 ) 4J CL CC 4- LX : 0 4 L-L .'a" CL do- am 0 41 01 4) M a3 U 4 ) 4J LU 4)a x U .I 1. 4- WV 0 - >4 V )V (A -'... 1- . UC44L)i'

4 -(I 4) to 414 .. 4 U6 1 4- 4) 4 -CV

V CVW~m wj I u IOw m~ w LL. U M1 444

4 0wCL- = -0 43 W CL '4- Ij mm<) 4 J 2OV

A 4 Z1 - 1 -jf C 4 0 X Uz 'U -1 (3 4.1 u'~ O 41))

43 a I.C 41: VIC O'V 0 4J CU0 C O cCm< wS U-+ .. C I. C VI4' UA > -040 L J

£~ ~~ ~~~~~ 28O'I 1 '' - C4 4) U O O.' )) VV

Page 209: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

..

44J

WW9% 444

,...WW,.,.'.

.

ox0 -

4" z

41 -j it 41 0 -- 44 4;

aa 4SC

J . J z . I -

.N..-0 .1

4-1 I, 0 4 J x 4 10 qSx u)

i. I 4It (.3 WW' )I

LL.

*L L

.,~4 0... . -C- - C4 . . X '-.

- --

X. e u I. . .. - /- C -= -- LI

L'." . 4 -, C CA -l- u . e .'e. -" u, l (- . . 4. 1

v 16 0 u L uP 41, O , . ,-

". . L 4J C A

• -0 vfz

- - A01 * .

U1 34. _j 4 4J

WW 4 C C 3 0 4 1Ln -- j-W.41 4)-J £-C1L - C 1. L

*i in Wj L1 3- 4.' 4J'U 10 1 =- JZ4 JC 0 # L 4 X' 4I 9 C 4- 4-

( o , 4'. I Z o ^ C4 ' C C4

44' C U 3. I 4J4

33 0 4) C *- m. Wa I .to a A

:; -" C U7 4.X4) 441 C 4' 4 a""- 44, CA 0' X11 C 3

-4 * W LJ 4' C I C 3o 0 41

A 34 4-. C *- X ~ C 4' A 4J x L LL4-L ' C 4 WJ L) I3 - 40 E 0 o

C 34' U L LA C I C 4'- X 4'* 0- L 21 3 4a L C4) C4-

L. L C a L VI 4J V 4)4'

4 - -- 4) 1 4a "A

0 3 0 ^ ) WW 4' L u 4' ma I I mm1 v. u-. UC If L 4'00 C L- *U V4- ) 4'

4'~~~ -) a0 435W A- WW 3 4 L C CC~~~~~ 4' 0O L . ~ I a 3 1'~ 0 A) 04 LL

L 29

-C4- UC

I.~~ *4A1142) 4) )~43 2 3I 44L L 4)9 24 K - CC %L 0 0 CC I L" O-2 L C 0 3 334 CL 4 4- - C34- C -a -)40u ~~ 4'C uI*- *~3L C C LL II 4- I C - L 4. I -. ~ 43

U~~~~~ ~~ 29C'% ' 43 24 A . 0 0 I'II L 2

Page 210: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

D4,

4 J

i"114

4J -

-4-

I . J

L 4.'

00" -@s

I 1

K L

morn

,%01

~K - 30

Page 211: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

0 04

1.4

14 4J M 4 .

it 4JC 4Ju ,

14 0 OL. -- 0,0 0140 0 0 bit 4- 0 14

14~ ~~~~ 0 +10.

14 0 £- 1 0 -j14 i.4) 1 L 4. LUo I

L. 0 0- 0, ivi 010 01a4 41 c 041+0

-- 14 +1 I L- CI IC C

*- O2 .- 00 .00

14 0 L 00 f .0

14 0.0)0+ 4J 4JC U .C L cU) 14j 0 +120 4 S. j .41

0A 1 -0- - V)O M^ U lIx 04 4J1 >) 0 atW0+ t

(A. c4L I4 -IAUA C, -U Ut

4. 4.. Ow C* 0 U 4CJ 0- UII. 140 U 04 ~ + 00q0 4 14+ .4 0

a vI 02 * 01 0 0. 4 0 N LO4j 4 C: 4. 4J~ 4 1 1 4J 40 +11~ 0 4J 40. 4)

0.~4 14 U 10 + )C 44 I - 4-) .-7. 14C.C a-0U J11+.fl- -4.44U) 1 +1 1 C 0114) g. +1UO l~ 4j .. 0 .'-

14 14 ). 0 4J1 40 i. 01 -A XLS . 4 0J 4d 4* 0 - LC.4 .)) . 04L-~ N - - -10

)~~- t. 0 14) A.2 0i Z0 IU UN-1-1 4 4-s-.~-)0~~~ 14 c- u 0 0) )t. 4J dAl. J ~ *1S*44U

4j z a1 2 0 o- 0 C II 4404L. +1 UC 2 u LC 3

o a UC 0) 0 0 0 *0 4j 4- * 4- WwWUW+1.L e L. L- i.4.. L.41. 4J ++ .- IL 0+4J+4 0 v 1f (f2 0fl--4J 0o 40. 0) 4-) 0. 4J0

*C 1 L4 0 L-.C ~ i. 21 I In 0.0 V--- - = m 3j- U'- 0.) 4J 14 !0+1 0 Li. 0+1J SU 4- 1--.V ^ WL t .0.0.0( -<.* 0 14 1+ 0 - C 0 i 0 L. (n /( )(UA 0 1 4- 00L.. 4 +-i

it 41 " 14 4 0 4j d . M+O 0C c0 4)0~& U- - .45

u * a- U0C Cc .. c 0 0.4- 4J .0 - Q.0. (L u. 0.2 044. ft Z V IW L E (A1+ - 0 - 4j 4 0 WW W UI AX -f. <f 40 4- (A owO0C +11 4.)+~- I 14J 0.I

+1 .84.; 14 4- (A 4J 6W..0M- 00u U -UO) >>> >- In2- 0

0 CA1 ~ ..1.X < I V LLL 4J.0 0..0 0. L L L- 04 i 11 0+4 L 4 C 4="0~ 4 0 - 4 41J 4CG 41 ZZ X O X . -.1 L

S 0 C+1 14 -'a>0.-A I--IZ - Ui) .. p b U-n w Ww ti.. C..x- 1., 0.V '0-1 do - W<* L.0.I1

.. 2 14 .. *z cc> - X- ()4)0 14 .')o U 4- 4JMU - -- 14(A Oww .1 ~ uC 4J 40+4J 14 w 4. .1 .1J .41

a4 14 XO m -j u4

K - 31

NA........................................~. *

Page 212: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

~. .. a..- *A - -7-- - - - * - - -

a 0

N 41 C

1 04.1 ~ 0 v 1

S~1 N. -c0N0 1- C .14 0C 4.1 0 0 41 0

N L1.1 0 M N 0)

N 0 I L .0 4JCC41 1 01 01)

C 0 ).g0

ri I LNU 4) L4 0 >- 4.1A4N U*,0 C I II

N L 02 6- 4

N 0 0 U1 C0 - In0U-

X 3; CJ4 4N 0 . 0. An *- 4

4 - 14) 0m - -*4.1 .0C = -M +j4

4J L ) 03 J z 0 LIz

*. N4 CC C CC a1 Ci 0 -e4-a N N 00) 04-1 4) C

0 3: 0 .N -J 0.4 -I* N L 410 4- N a 4-- c-

a1 " 0 c14 01 LL1 -1J 4.J 114. 4I II+

-1 Nn 4- C 3 ) 4) -) In. ) I I L t-. N 416 10. £4- s to* 4)fl 41

R 4 .CI 0 0 c. a6 Z OW ZJ- .J 4 J 0 4J - 4-41 N C 04- LC CU 0- U 00 0 11 'I- 41

*I a 4J1 CC 41 41 4- -0. a -) E10 41 NC 0 .00 C41 4. 4 4 41 - 4 411 E -. 03 II *

4) 4I NM L 00 ) 0 C. a 0 0 C &-4 4) I_ C 1 - am4J L W C W L- me L (L 0 aU)j ) m ~ * 0 1 00LtD 040 4- N 4-C W3 0 1A410eJ4-OC 41 a *1 -0.. 00 " L4. -It4

Ni N C 4.14 Z 0u 4- C + 4-U m- 4M am mWa 41 W0 L.0~~~~4 I £IIC * N L) 0. 4j L 0 L 4- 1.

-n N- 1 0 4J 0. 0.14 41 444 0 U4 M-% 000

N 2- 411 C- L- IL 04 .. 41 U C Ii 3 10.= 3 L - 4) 0)N . III 41 IZ 00 CL 4)4 00 0 -. 4) 4)0 Ca) 4 0 41.t

U0 N 1 4-C4--V4)0 0 0 4N 4-- OW Cx 0% L L~* LJ 04- ~ * 0C1C N 10 411(A 4)W-J I 0 C M 11 C0 IM 0 L 3 30 L 3 3

a N L C 4C WLn -C C I-4 00 ** Ca 2. I04 0I0 .-404)- f J 4 0.0A. N j U-L C ;C40WC41 410 1 LL MC I 4) 4))4 ML FA 4 L I00

3 I ~0 .m C Z 0 IC 4- 0-0 4 4 C Ol 41 C M 4

Ca - 00"U 4 0£L-V - 41410. v L0 v111- v u 01 0

-j a N U L 4- W L. 33Z3 3 C 41N W ad Z > - 0. L LL 41).0 -N ) w u) W. 04 4N 4J 4141)C CN OwU S w .1 - lU II(Ai -U~ 0U 0 I

N WC..j j 0 <4 41 U3 LN Ix .J.J Ill .u N- LUM

N N<Z<< < 0 %.41 01£z- a. .0. uLC) 4 >..'UN 000

K -32

. .- .t .-. . .. ~ .t .. .- ... .- % .

Page 213: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

\~10

-,0 41 C1L

41 1 U 4J L0 410 I 0. 4

£ EC - L

2 - 41(#

- I0 4Ju I.. 401 10 4) -

4. *. 0 41 4- W 4

01 1 A- 4J I J4

.0 41 4 1 a411 -

6 01. 4U 41I

4. -. ^ 4 - 4 0S 1 41 L4J 4J :L I.C0 0+ L SI 4-04

.3 41ad 403 0 - 4J - 4'S 4 4- 4-1 4 4- c1 4i

Is LA-2 4J 41. 4jCS40 C1 a. -. L 1 V 1 U. L -( 4 1 J0

1 u- 4i 0 .(40( - 1 0 V)41 inV M - L- L -A- S 1 41 I 4- 4J -- 4) 4,) 0 SI 41- c. 41 41 SI1 4

*0 0 4 14J J j<41 4-0 4-- C -- 141 j I L 4- Q - .4 141 -u 0 L 41 SI M1 U. -6 . a II" C -M4-1 SI 41 U. 4 6I- 4 41 SI

-. 41 1 d1.4-. c C 41l 4-L. 41 0 1 41 L1 04 -; In II. --1.- S - - SI 1

- e .0; ,1 UoC v- Lr 41 1~ -04 L 1 .C - L 4U 41 403 4. 0 414V)01.- -'3.. ol ^ 0) -00 0 M F

L. 41 a E -aL' ** s I c -CL a *)aIm0 I 4- 1a a1 c- 41 c. 1411 0 a : 41 A.. c 41 4J, we C~.

U 4.. 34- 0'- 6-*CC 14-UULVIL I ; - .. - 4 !ID- 41 L. Ia)-. a-4 l- 414-v *. -mX 4410 414101.. 4J V L M - 01 0) M . i. L 4-U

41- Ile-.4 41 .0 g4 41 -. 4 41 ) 1... -- 4 41 .L a' W.f 041 4 04- 0 L1 00S 41 4- -IVS 41

'a-L4 -SI. 4L. 1 0 C04 -Ia 4-IA MUM - O £4- SI

4 U 41 4L 4 C - UU 41 I4-L - 4 CU 33

41 4. 1I L-- - - 41 -1I - - 4 -

Page 214: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

41 x

4.1

441

I op 0

c a:,

Ig. 4) 4.-oC 4J

V 0. 1 014 SI zc 4.1 0 4. 1 0

5* ; .41. )X I 4

0 0I 0 1 41 41 S

0 4-105 I Sc 0 0 41 41~

- .I CC 0 4)C V . 4) 4J 4) SIJ I

0. 0. u zC.C

0~4 U. Et- 01- -

1. 4. x 60 .R C 0 - 3.N'.. N C1 S C a a. 0 4 110 % 4J 0J1

41 4) 4J, 0 CO 0:) Z 4J04 I S .' )

" a A1 C oc 4. - j -1 SI NL. SI X 4) 01 'O C U. N 01 N A.-

.4 X) 5- SI0 4) 5 064 4) 404- 4) : t %*,o 4 L: - L. ̂ .. . -t U

* I 0 4) 3 0 1 It I..-4 U. C 46L 0 L. - 66 0 CS 4) 4.)1

7 u -oz C '1 N. C4)4) N--W 4 X* - SI

.40 Z A - 1. SI 0* L J C04( N 4U

*1 040 1) - g .. LU C L A " 0 .- ~a.4 -) A U M '1 -4-- L4u I 0

-- -, C. I N. W6 1~ -'. V1 46 54

-4) (Y - .4 1. 05C C. 0-aS Z aU -6 a 4) *4).'S 0A I4. S 4. - * .. 0

4) SI2. 0 L.. 10)4 .IW '-* e 4

- v C 4.1 '4- 0 4 4 0 . - ~ .J ) Z 44) .0 ) C g. 4S ~ ~ gg...4 U-4X 6 0g

a ~ i. - X ) 01- I a34)C- IN.S0, * Vg*4

Page 215: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

o.- 7% 7%.~j; .v W ~ g . ~ - ~ ; .7 .N* s- - - ~ .

E 2cI o . I

4 L4 .10 0 C

c L .3 C

99 4 J 0C +

01 I IE

_0 0 4J L. LC C L.3 41 w -. 4JOL 0

I.4 J Il 0 a4 L. cI L. * 44 I x %. 0 03 +4- 4H 02+

it -j 0%. x FA 4

1

Z~~ I - C J.. 3L A I41 A .o - L .3 0 0 0I E I

x44. 0 0+ +3 .3 2 '4 -1 OS " L 2

*0 - .3 4. 3 +3 N LJ+ L3 V 4J 0 EcS 1 1 I 1 1 5l C so 42 10 0 41 ++1

I -4 -414 .3 '4- 4j 4L C - C L -,4.11g.~~~*. C. X'e;; 1013 +3A -+ 3 .-... +

e4. +3314 X I 44. 4. 0. a3 4J 0..

-+343 SZ 4- 4J LX3 A I nL S 3- .(A2 2) COOv"I(A 0 2J 0X c I It N - S. 4 0 Jd - L 2-2S 41 ! . -

Of- 46. 014. 5 C.3 U- L- w . L& S L33 4+3 S K -4C U INA S 44. .3 34 4- 10 043 0 4443 C3 43

AU~~~o 431 v. +3 ugI c L4 u-3 r.- a11 . - 0-I~ ~~~~~~~~~~ *- +3 - - 0 to-N ~ 30+ W 1S C . 4 . 4 + ' C 4

c U - 0 CI 01 4 UI.. L m 0C C1 1 ~ 3 *a 01 -c4 a- Ic I- C. *3 L 1 0V4 L= .. C4 -- *. U4J -401& L4 X3 LL+ +34-I- 00 4 U3 CIM- L - Mg 0)4-) '4- IS U- 54 4I.d 0 = to C 3-

0-

353

Page 216: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

.1.C

4J.

.44J

.50

.44.

L4-

-0 4 I

4J - L1.a- 04

0- - 4j04soA 0 1 0 A t

I- 5 4 00 . C 4-4-

0~ g -

o, 0 aw 46 L. I0LD

:0 LL 0 -+j 54 Is 0

.- *~~~ LUL. .

4' ~~4 Im L.4U* .OC~~~ 2'4 z

30 ~ ~ L L.( L 3

IC~~ 36" -0 I

Page 217: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

*44

.40.

a0

* .5*w

0 0-a a 0 4

a 0- E .

4J a a at

a, 4 - 0-'04J. 0 4-.

a J 0 -t 04-C gQ 4- L4a 14 0 00-it 0 u*

0 0 CC

a 0U 1. - o u 0 N 0a C - -1 00 w -;.5

a9 L 141 4j4 E- V jw J4EC

a 05 6 4- mm U N s A 4-a. 4U 0* -. UC.

a 0 0 .5 C. LO C.M-a- - u. C C X0 -%'

0 a 041 0 .5P 0. 0 0a 41 L. C0 * t - -4-4- LiJas 30 C as a a 105 1C-C 1 ; 41'a 0 *C aCL Cm + 0XL a C- 4.9 1 4.51 a~~a 0 : a* U L.4.-

3: a L C -c C0 c .J1* v . 01- a 3aj 4. u 00 - 4 C J Ia a -. u a..- C .

a 2 41. - -U .5 + 4A1 2 Ex ^ 0 0 Co LL. ta L 0 01 4-C C0 au O o N 0 GC.C - 4 .0)a a

a1 0c. 0- aJj0 . 3 0.5 cc 33 cI t ( 1. Ca9 4 J 0 C L.4 ON l 0 4sJ* LC 0l 10 C) 4)VWW ...

ao C1 -4 1C. -ix 0MM' Lx4 40000. ot 5 4c 4- oo. a. it 001.m 0 am CaO V - 1 4-- 000L--4 4 J4 L J4 C

u i 0 C. - C 0-1 u o m Q% 0 .31a1 4- all. 1 4- 4 N +b -a -L

ajLI; 3 CW4 a 'V LI Ia 0- CJ -.5 s- 01000 'CCa n mc w 0 U3 4* -. 5 4 - Ci itC5. CC

a aL -5- 4- C C me- .54- -a)@ffl.. 1iN 1C I LL0- a C66- 4** C 0 a*C u l * u 0 3i .0 C. 1 .50.0110

- W 1 Y10 9 a- UOC N5 C '. %L x~ 0CCC 0N * 30. a c - 3

.5 LM- a_ 00L 0 - 0L' 0 C.J 0 L4 "-'J+50 5 05 L L5S.J. C'U0. aJ -COO I- NU4J - i 0l Q4-V N0 .5-Cot 4-4J 5 .It

V ~ ~~ L1 4. a0 04CU u 00 0. 5J5-U Ol~N I I

'C 0 a- a 1 -. I- LU3 = 0.<a LI *.Z - 0 X

<55. a <a44 m C40 % -. 4Cama -. %1LUU4 >.. a 4

K-37

%-%

-- Z- Z- -.-----.- *-

Page 218: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

.4 4 44

0 -1 LL

I v 41o o 4A

.@ u 4 1

'4. 1 N 0

1 0 4 N

on 10 4 I

aN NC N 410 1106- %.I

*: - %- 4; 4

a- u U 0 0

; W. 41 0 6L

CJ C 4 U 0 x5 a- X ov

00, U 40 4 N L. 0 N

Lm L V4 61 6 1 Z".5V ~ 0 1 4 0U 0 0. 0

c5 0 5 0 0 141 41 x6-6 C 4 C 6 U-1- '

V ON 6 45 0l t

NU N 4J 6-. C I * .

'@1 vU 41 0 00 U I 3: 4.0. 0 4 4. Lg. L I6 6-1 .

LI Li *. 1- I- .2516.2 5450.6 0. Il 0 U 4O S I 1S

*6 4 - -66 4 I ),' 0 N N -45

4L 0 : 41 L 0 I C. L. I C 4)i

-0 - 4J 16-P i vC L L 0 C* 0 0o 0 gONI N C- 4 C* L - 41 m - LL u nLu e

.N 004 Ne 4J 85 C4 =. -- - 4545 lL. 465 L 60 0 .4 0. .0 0- 4506RCO1104 6 4 N. -C 16 4J "4J.9 v-6. 04j-- 4545 -

a- Nn 0- C C l L 4 N 41' -.- I6 CL010 L o1-0 0U SI l4 0 L. 45 0 NI :. - SI 1. - 0.0

S. C 0 4. 0. &- L5 .41. - %- u I 4) 1ut4 0 L 0 4 04 456 NJ 1-'0. *5 fI t- 33 .456 45 *.1 -0 U U L - -6- QL W - 00 0

0E I! Is 04 4 16 - 45 0) 06 -- U41

-I'16-0-1610 I- I I 665 4 1 001 0. .. L C4J1-1-4*45' OA 099-C 4. 1C 6 LU 0; - S E O N

U0U .U- 4 3- +1 OO1 0 S6 '6 51.. -

(.8- U- .. 40 N. IN WI.-Cc U VIM VA51 0!U L~U CC'4~~~~ go * 6C 0 C-)I 4 N610SS0O00

0.6~ C -- A~ -1 40 6 161-04 1E at -C *WL VO0 -5' L. N4N

40U~ 4

K-38

Page 219: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

-~~~~~~~~. W*. w * . * I * ' - ., ** W-%

'T77 717.N -

-AaA14

31 610 41a

0 0

Im4 L. 4- %

I- 4.'LL* 0 a a- a 0:

* 4-+ I * a*-

U 4.1 u 3 1 3 4.13 1 )=IS C I 1 JU4 3 11 Fu - 3 aA 3 +) 311C 4 334 4 -

o Ic 4- 0 *4W 0 3I 00M-, 31 0: -I 0. a, -

C -0 aV o. -. U-~ ~ A 0v *5u4 1o

a0 0 05- 0 O g - 6: a 0g

Li . :~ A 0 4 C U. 4, =A ::^ .SC.0C 104 a ;zC .^ 1C 0 U 4.C i

0 1 lox5 -Q 1 CU 'Ca 14

I IU1a- '0 aUS 1 1 5 -0. 5 CC so

CU U 'va' 4a C *- a ci ul -uj 6--U~+ 1i

Y* +14 U,_ 305 4. 145 LC 1.D 4J0 U46. 1

o64- 4 Lo -. .c 36 05- Q 41 4 W366 0.-UL 4

* '1 4J w o1 cso, I < 4- *i530V6 4 .Ix1ro c-C - -' .U4 C1 CL -o 4--11-I %_ 5

U4I-. CC 514 L- 3& Lw 1.*4uaL a . .2. "4 . 4-LO)4-) 4-I. eg

a.- L6ll 4'I 4-C 0.4N . ' (A I 4 .- 4- 6 4 41.* .0 -C S S- *C I@ >00 55 14S - 1-C

el5-4 0L IQ IC Cgo- a.&- C. 96- 5 - 1 0-- 41'41 a1p CA LPL 0 U 0 45 Cu -- LAL Ct 4C4 'C4. C .

.1C060 r ) C** 0. A I 64-0 1 ii 5_ AA4Ccc 11. . 401 I-t*(n- 4- o,aI 455 tW oc m GOc0v I-I m I CS C6c 3C 6 5 I- C CU C- I0 SOL C- CL C < S a. 60 00 L CCCUC0 - 0 4 0-L C

3U 5.C U S j IL 1C p --- LL 45 C L lLC ; -;-Aa,! L~f 4-)U. L La. 4 -U 1 U. 4 .34 - LU45 4j5 U 5 IC -)

30 35 4- 3 -4 C- CS UC V- 01 a5jS UCC 0

-US ~ I Scf;;f So WL0D :44 06- 33 3 C0ULt C 5 L- ~ ~~~~~~~ CCI0 01- Ulu. CI 3'ZI C. -4 I I mwI1 5

a.-v 4-4 ..' 4 0- 1g5- 055 .1u3 - IH-5-i 4'5

AU4 445L -I. 4- 4-i.4- US OL C W- -445-5-5. 39 a

Page 220: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

4 . 4..

~3:

0 0

0 0

4-p 4 -J~40 .A 4 1

4.' 41 .2 _ .4;.2- 411 01 141X

3 *- 36 -U01 .-4 Io l'0 41 -01.2 a~ 1

S -~ 34 - -- 413 4J -0 0 A 9) IA0Ii. I 4. !- I 4-* 4.1

-o 1 . 40 0 -o '.i4 4.1J- - V S. . -- -.0 ** 1

-- u 0 .. =- ;- - 10 4J 0 L L.4 .C 0 1 4.aU14 .- X0 4j 10 .v 4II 41

4- U 04 4C4 1. --- U 4. £4I CL- *4 4.i X 4 A 04J1. , 0 4- 41. -04 0. o 1 41 3 0.

- 4- 14141 C* 4- a)1 01 0. 3m C c~ 0* 4)- 4- 3 00 41 4 1 41 *4- 00 41 4; 0 4

L. ;- L. 41 0 u 51 . A.1 411 L 41 - X. 11 . 4-I1 A 141 - - 4J 01 - 141 4- - 4 0 1 - 4-. 4- 0 41

a. 0 1 A'- 5-*I. I 4 41A C 4- 10 n 4111 L -0 41 01 OW CS 41 41 14o wj 0 3- 0-11. 0L 1 l.. *u.. = 0- - 0 41 1 44-~ m -v.0- : 41.1

4 .) 41 IA -- . 4 1 I 1A 0. . -- _0 ..J VIU -

- 1 410 4 '00 - 01 441 0 c4- 0 0 -- = - C. L.0c 4.1 41 a- CS0- 04-a1- 4.1 41 1- 0 L.4v- 4- L 0 4JZ 4- 10 041

L ^ * 4 01.Ls 5 4 J M14 ̂. 014J 4-4 It 4- 4J 41 41- =,j 01 2 413 0 1 4 10 01 - 0 4CW 014141 CI. I I 1 1411 10w

41 I 1 01 4 41- 0141 C I C (n v 0-1. -4141 41 a- 4-L. 41 CI0. 3 *-4- o.' 0.1 04.2 0 1.4 0 --. 4J3 6410 01414- 0 ^ 01 04-

*i 40 0; W4 - 041- - 0 W4- - 4- 4J . . 010 *L L b L-V - 411I L C 4-- (lI 4-4- 041 U41 - CA I 4- 4- 01 0 -4411 - 04- -41

~~ _j - 3i IV Ia 4- -- %'1 ~ 11 - 04-- '44- 4 -41 0 4. 4- 30 041 1 0 41 0S 30 C 14J4- 11 L..

%I4 1&. 0 0 I' 0 4- 11&0a 4-) V1 0 0 .c411 41 41 4- 0 1. 0c CC 1.a 0. 01 0l C- -- 0CC 0 0. 4011 C- a001 UO--4- 4- CO.

Uu a0 E a SooC -- 41 0. 1-0 00 I WE u 05 - LC 10. 3 3-GaC-S 0 - 01 aa0' a. .4-.C 1 0 3-4 a~ 41:O4- 0 L.11L '0

U L40 L 4. - J- 1.50 U L1. C- - I4'.-IlU 4 4410. La. - - .1). =U0 lo., V, IM 4 Q) - -001: -'4- L 410-01 I01.9 1014 0014-0-

C- aU0 0~~~ C- 300 c3 mC 3c NA.; 0 A U-S--A-:A 1 A-A OA A.

* 14 44041.1. 00CL11.414 £4%- 0111. C1.-*44-.0 0." 00 A 0 - "o 000 004-

K-40

Page 221: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

__________

C4 0

t44 W.I

-- 40 4.- 9~ 1- M

a - 0 -6 N* 4-6 % 4' 1a -

u -' a 0 a g E4 J L -

L 4A - 41 0 -j 40i 0 0 - 6 4. a o

'a t. L C 6 a 1La *o4 4 el 0- a, 0.00 4

. . bI a0 ^ iv0- - A

4a - 4a 0 it C 0 4- 0 a4- .

o %- c - 4. - .4 c -. d " ; m 4

to I~ to a~ - +p 0- 1' .. v a1t 0 0 6 4

41 0 4J 4JC C 4 -4 J4-Cu 4 . 0 1 FA -- 0414 0 10 0 6 - 0 a ) on L -1L

076 0. E'" a UN V) j 0 c :.C4 CC 02 or ~ 4

I I % i. 4- 4 V C j 4 0 L o a - C t-0* l 0 UO C 0V 0 0 - 060z- 04 -

r. M- 4- 2 C 4-1 4L 0a 4' 41 4... EVL E- 01 a4' 4' 4 0 sV -0 0 J (

4A 0A14 41 Q. 1 4--4 -- c 0 on 0i v on.A 9 0-- 0 V14 Q44 L4 a M 0 - ) C

-- 4i. 00. 0. 1V 100 L 0a 0 4- S. C .

4' ~ 4 41' 01 1- ii* a - 0 04- .10 - U a- 'A 0 V a- I C C C -0. V 4-to Cf X '4

C~~~ 0- 0. 1- CL Li a t-CI..0 C -6 ~faJ~v0 0 -v 00 * .f 51) C

0 .C 4--1.0 c ~ 0-4 C 14' aJ 4) L 4-) 3 0~. 1

A4 L* L0 a.04 V-i (n 4) 0 V aS Von 4- - a4' V4 4'C C 01- W"- 4S vi0 a)U 411 VM 4 C al' Qn

4-41a 01 0 t44S c-a- c- aze V- - 10. z- 4 1

A >A !C4 41to cct 41 1a 0 r 0 . C S6 4- 4- C 4S ~ ~ ~ ~ ~ ~ ~ 4 L.~ 444 ' -4 to a 01Ca V. <3 -

~ -5 6 - g a a U L i Cj = 2-V C 6 v*~~~~~ ~~ %. ccL i.4 04- u** I- aL-0' C3 - 4-i .

'1.~~~~ Sm QU) >04'1 Uj U'0l L V W-V* V S 0 -oa I V -

6 ~~~ ~ ~ o a ~~ 4166o CC 0 6 4C LI

Page 222: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

~~10

'41

00 .I

*: 4X -

0 )a 1 4)04(A I ): # E F - 4

I .. - 04 1 1 4 I 0 x

4I 0 1 41: -0 0 C 0 4J 1003 0 . -I *i., 4 - -0, CXX N c (

a I f - a4 U 4- *4 c- 40, VI 41 -l VI +1 0-14

I x x I -j V-J 0 x) A0

VI C 0 to = ^ C..'.- Cz I = 4 -4J A.J

I~~ > El'- ao 'i- 0 E - 0 Z-

-~ ~ ~ 4 1144' 4. M), Mg0 ~ '.. o lx El * l VI El

'a-~ 4)-~ l I I- V431 ~ V

A~~~~~~~~ 42.. i.- a . - Igle

Page 223: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

It 4a4t

* £

41 a0* 41 V0

a 4.1 a .

N 0 a 0aa - " a = aa 4 4.1 *t- 0 C V- aaI t3 s ,-- o 0 1 a,i

a . 0 -0 a

a 0 L U .c

"- a 0- . . . . , 0J I aA QI V-- ',- . a• -u c - .. . / I " C,- 0 -/ a -

'. e m L . : O e'O -- • P.,J " v1,- . 4"a --. a

a0 04L

a' " ,t . .4w .. *V 0- .4< * -L INa- ,

a 4 41 4- 3 a

a 04 -4. 0 )0 m.~i0 C Ca-C-

a - - - -a L) U" -,-,,0)_

a0 w - W4- V4 4)1-La c 4- LW( 4- C 3 0 1 aIa

a- + .+ o., .a= 0.J a"* - - 4•4V1CL- 441'

a 4J 4 0. c) a -441 C 4u mll Ow 0 41 4-. 41 11 .. v1 a

a2 41 11 C 0 s.) * *-.

a 3 - c 41 a aa . Qu 41 - . I.4 c4. C - '0 10 - 41a L U .or "I x c4 41 L- ItC~ 04a 0 - - 0 X 2 '0 n 0 t-x " C4L a

% o- - m -1 a 41 Mw 0 ) -. me 0, 1 aaNl Ag w 40 l 4 4 4 C 0 4 .A x

C 41. 41 0 1In1 4 41" 4- C 4)aJ 40 4 04J "a 0. L 0 0. .1. CC 0 a; 'a 0 L .. 0 ii 1 C4 c r-4If -L1. 0 a

* a * L C. a 0. .) t1 0 ma. V )4 02. C Ifat 41 . 0 4- 0 u i C V1L L. L V C L. IFA 0 -U- - L . A l4J Q . .041 L La - L 4A z4 .4- 410 J 4J ^4 4- 4- -J 4- .40.4- 0a a4 - U 41W um 4(1 4- -1 0. .., I-j1 4- Na > 4- 3.C m 3 0u LI m *0. 'L a .4D :. .4 I NaI v.' 4 z v L0 .1~ u z I - - IL w II - III vi aItN 4J 0 - 0 L L II* - Q- u4-4 L.

a 0 m LL L Za0. c f 44 4)4.4 +j 4lu C .- f VS 4J 3 0. 0C M. Ua 0C c -- E C v c- o- U C4-VO C N

;J *"N0 f 4-4 *6 -- . 0. 4w C 4- - M0' w I Z 49*" N 04 14 e .4- WC CL L- C L L. J 4-' Nt

U N V4 U SO .4j V 41 u V) . 14 0.4- L 3140. 0-Iaa S 00 .4 0OL 3 C-J L w a0- 1 * m In - 4w w a

9 C- 4 Z -0 L L.4J MV4<L V 0 .0 a4J V .M 4 i t*I= cu I ) 0 40.0 41 0.1 00Iw. 0 -4- 4) -J1 4- 0 4)14- '0--V-0

*. .- V N1 L U L I .4> -. 4 -C L 41 U L0.C 4 -C.JL 0 .4L V- M04-a-C<*U -.J0C N9 0-O0,0 - C A 0 0..0It 0. u c Ca. C u. It

IL1& ItN 4- MUUCW LL Wn it1 2 N II MI* -i a1*L. I- aL Nf IU41 Vw 41cow0o V'0 4J aJ- . -0 L. L Q. -

.1 0N1 N1 11 V'04-W.n4 IW..J 0. 0 U l UI..flu - 0)Z 4 0.- It.*1z * U0 N< rO I4, z ~ ca II 2' - - 3 a 4

L * L0 N J V --. 0 L-;4 94CI IV.4 L. 0 - L . L mL.4J Itt.w. C 4J OC) LO 34 O 0 414- 4- 0 414 N* CSC N vi .041,.'l00 OL 41 VZ U 4- V- - 4- V0L- N

-0 * V U- N 4- W 1, w4 4- 0. LaN w -z Z %> ILN

vU j II .(O.W W.. I Z* - CU NwA Zw.a .JL .4L. N

.4.44 N 9-J- N U44 40 U C4 C NJ*,4 4* 001 < %Z0<U<I=4 0.. N 4- 4 C.

K -43

Page 224: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

E41 . 0

4.41

L I J

41 +) -

0 ( .- . 4

C ." .4 L II o.. ,-41 L 4) - C4

0 .,- S ( '- -.T 0--- l - "- -

4.4 -- - 4.1 4 1 0 .4 (I - I I ,

- 011)

' = I.04- L. -'I 4 4.. 01- I . II5

." -4- ^4 o-l I uI . L 0 .I nLI

410,1Jq- ,i v " £:. O a. 4vi41 -. .CI.

-. 1I^ .. ^ .1 m.. 2 02- - - o.1- 41 4.J C I mCI m-0 0 41 i. - C C E E4J 41

a C., - - 0m D € 1 ow4"-)v1. 0 *- U L 4. m .. 0 . -0 .LUD

. ." I 4 1 0J 4J 0 01 w-L 4j *.. 'A .4) 3. 1 M1 L0 L~ I W .4.)

4--44. 4- - C I 1 0 0.X 0.0- I 4.- 4+ 01 4J 4. - L "41 4

J0

r

U 41(/- Q1 C 4 x 0 4- -. . 41- U1

- z! : - z L . C 4 4 L- . C .4 m 01- :: 11M" 41 . II L 4- 4. I A 3 1 - C Z M I

41 40 " 4)1 41 4 (.X 0) 4ZI L -. 0 .0410 L 414 .4 0 - 4 41 01- 0. : 0 0 L. 4 1

M- $- S. c 7L c LII 0 '0 TZ 4 L L1 0..% ,, 4J 4J . L I M 4. 1 10 4.1 LI-- .4 ) Z41 0 1 I If

4- W)0 010 ** C 4 4. 4.) 4) 4- 010101,4- 4-0 L 01 01 Oi II E1 .. I LI -. -

.29 0.0 - 4)o- M 0 CO 4-II0 1 o4- .~ 1,C c 0.14 If I-

'I l "

-4- IQ) " " "'"." "-" " "'" 00 L M C 0114- 4-~ -)d EIMIY. 4a) 1 -4- -4-4-

014 :h C) ~4) 1IM ML 34) 00~4 2I)I

-0 17C L-' 04- I 01L 2L , j4) 1- L4) LO03-041- 41.0 - 104 U I0 4J M1M.0 42 [0 4.0 40 +)4- 010WOCI cr jo =m.0 0 C 0. LC 4-)

)140 (L *t : 30 0 E2410 -10 1.41 4In)L *4-)C 0

01C4 0 0 1 IA.C %- C L~ > . (DC 4)1 4144141 I- 7-o0 4 J in. 0- 4 V? m M1W In

u N .0 0. 4) 1014) m 00 (a tI *C2m 0S.-U u uL LIu

I cmZ 410 - 0 4- A 4JC U- CW V)12.- 4 IV I- - V, UI4) 410 *4 - =

40 4- z %1-0W JL I L cI< z ca -41 4L34-)

14 -. 0C.C - 1 041 4 .0

01 C 4W4 0)

w *Z M> C**fl U. x1 L4W C i ..m 4LI

444

I -- 44-

Page 225: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

:41

*.'0

0LL

P 1 a.

oa--

- U L7 L )4a -3 M EE

- .u E* 0 NC

K. x ) ) 0 4E 0 E II m4

4I .. c- 0 4J 4) C 0=I .J i .4- 41 0 1 - 4 1

a1 3 .'oe - 00 D a 44)C*

a 40 OW it 4 L 0 A.

:1 L~U~ In 1 I 0 aW I

* K- 4

41" 41 L

NO 0. .1 4 e I

* ut 0 1 4. 0 l. i0=e'41 a

I.- AI 4- * ) C-J L^ IN 4- 1:I -41 0 : L 0E

4-0- 41 -A ) a 4.) - 41 4) 4-) 4% "*1

VIM^ 4J. - 4- 4-9 4J = III - 4J E-

Z I if to- U S4( 41 =.M 4J L i-

'V. - 0' 4o 0 - +- a +4* C- 4-

- 4) 1L1, L A ,* * 4 0 1 U ( m-

a aLQ• .if 41 -- L Ma 41 *.,

4J - 43 =i 4) 4- I- L - N C

4) U L 4 4) N I 4 C .4 ). NL - 4- 4- +G)_4 4- L - 1 Uo 4J 4* GIG Q* U

S1 4 . 411 Aa Q,. * a -a I

4- 4-. I0 U L C 0 4 ; 0o L On 0 . .Ex0 rZI L - f- ) 4 )E CL0 4-) 1 J N

.. a 4 4. -, L" 0 L +I *- a - *1,4U

0= 0 L 0 3o 1.cc+,1 4U A..J" LU --'4 -0. Z'-4 a , a ) C> a o Z I a

% .. I A 4*-U - 4to a 14 i"- 0, 0 - 4* EN-I

-" t. 3II "- * a1 4.1 4 4) 4 * j0 L41... ),, 0,.).)4,.40 .. ... a .r 0 041-4 ,. ,,_ )v D

u - fil - n- - 41 0 0 LU a 4n - l .-Q.-0 ).404 'J- 4 4 * C Ut LN C

*' .-" 4-4-4- 0 a 0 4) t.0 ".a 1 0

*4 a , a .c o 4) .-A -I

.)* LZ 0G L VL '4 0 4) CC 04' -' a 41 * 4

.0utu ' ^*4 It 14 a., - I M .I .

V 4 a . 4) 4I 41 4 0 0. 4

U .0 0) I " .C . a 4.

*.'-4)4 +, 00' o '<z VO *.+ C C -

*•00' aI v- 1 0 -" €I-- UJ - 4*0- -- " x 0)-"I -

Ke - <5u uu '" "" " , "-C . U - T- " , '- " - "'% , ' "jU4-" .'*", ,',' .+" ,' .' ,' . 41 0 , 4" *'' . '.'. , ".'

96j 4) U -- la.. 'V w. >* . -* a du w 4J 0 * 4-~~~ w (A~ cnc 0j 4*4 4*" -

x 40 -1-.1Zj j L M 4 +) L4) a <=<<=0 0-- 4J 0L 4J CI 0 4'V- a 0-~CL fI~* C U V 4

-. U W I-C -05

aP .~

Page 226: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

a a

0, L. La a

a~t 41*1a

U 4; t. 4 a

a~~4 : 41.-.

a 1 4; 40U41 A- aD c4:a 41- ol-4) 4) 41 a9 *

a -~ 0 0C - 1-a .

4j +j 41 41140 4j41 L

4J L.44n1J "4 4 J i -41- 0.-4 a 4

a - I L 4 1- i 01.- aJ 0-a - M C- */J ' 4J J .4A4 a a%.

aJx 1 4 0 0 0.4 1 2.i a M0 a C 4.441 $114 a. C S-* .4

an 41 5. 441)14 44

a -~~ - -i.1 4J4 -

a 41C i.s~s- -.. ~ 4M LC E 411.414 +CIMM 0 .1 - a. 1 0 iva N 41 IV M L1 3 11115 0 33 N m -5 a 0,a441 -. C4 .44JC. -1 -)C 0)C - - C . ) v a -4..

a4 0 Li M41 4) MaLL .- 0- 010- L a is%-4j Ma 41 .4 a 100U 0 .4 M4- 4- .- U"0.4-.0 1 4 V N4

a1 n - I. . L . 41-- 4J 0 - I 41 C I.0 a '-. - 0411144 a a 0 o- 0--

40 a 1 4- c o 41 au ba a 0. a 0.Cf %. 0 L1 I 0 L 222. 41 "-

a. 0 r. - 4 1 -- **0' (n(-(A-9.in( 4 1 41 . - lal aU L- a 041 CU1001 m.- i" m a oomI.

aaci a 3 1- 1A 2- C. U0' uuu lCm - #a4.412- a 4j 'v 41 0*-* --- 1 -41- a1 aX ~10

n a El ai vo -27. 41la-. *.i 1 --'a 0 m col

lm(aI 4 .+(A 141 4.44.99 C1 i .0 4 al a 41 - 4(* ) 40. - I Zl.141.0i41V01.417i.a1 0 V-a0004 4-aOCL-C 041 41M 4040044.0551 . 0 a. !s Ia<0 00 a m C-M CV 0 .. C4 412-

o a L-I - 41*L -o 4141 0- --- 0 a 4-aW

0*.41 -. '-- U3 a , 41 j-se

S2--fa 91 4~ 0 .41 .04 41 a :Doa's'-16 an C6. uw uI 4(*.* a - O

Page 227: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

4)1x 4

41 4

Ux

0 0 4

0 --o 24 4 -) 4 1Z JZZ 4

4) c 0 jL ) - J e 401 0 1 4)z x)41 01 cI1-

V 4'

04 m) x

L 4JC

0) 0 14 j A j4

0 . 0 1..A4 ( 4

3: 41 0

4) C C,4 4- -0 4))

4J ..P 4) 14 . .

_, 1 46 L 4j 4J 4- 4) WCL al44)% 0 . 4) -1 L N ).. ) C.

6 0 * 4 1 1 ) 4 xj j 1 A

4)~ 0L 0.Z I04) -4 . 4 .'1 4) x ) Z-4 4) C

C 4).) .C IQ I - C * . J x - I I 4

0 - 4 m 0- 4)Z 4- *4- 10~ 4) -A 0)) )

*44 1 C L a ,0 L) X. I 4 C4 - I x 4))4 LX

s4 Z

.C 4011 0 Q) 4 ) - L I 4j. M 4. J 4 .J 4.J I.) V)1 1 .

41O W - 4) *. 4- .414 0) 4)4 -o N) L.)44 0

4 - N zI ccI 414 C , Ux ~ V4 1 0 -X C C

1.~W 4) - L L 4J N ) - )' A ) C ) C . 0)

o4 1.11 -b)~ 4 L)4 4AJ* X- 06 ~ ~ ~ ~~4 V 4 41 -444 1 - -))I 4

.C4)6~~~ ~~ 7)4 ) I 41 0* 44 4 .

'D! d L )C 41) 4)) 4 IA. )4- 4 4

Page 228: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

I/-:' - --. . " - - .. ." • -" • ": • ." "-. - '

r,

4o.

hx

LIP

* ao

a, 4 In ,,) aI o I

'.aJ q . 4) xa "

a -L a

"- IJ ,, + a I0 "

a 4Ja

"" in " c a

3 .0 a

a 4 -4 - 0. a

a1 3 , , a

41 4) 4aL in .

-- 1 # + -e I , - a ' l -1 - +. a

ax 4)0

-a x .- ,o 04 1 ,1 U' 4)4 xa . -4J in

a0 4.

a -I U<7 ' I *- = € I C a +-o I 1,,a 0. .Q',, x:' .,, n¢ in.- i aQQQ U~ .Q v, ,) • L .

a ~~ L0 E'-.j )

U i 120 4J C 4 a- , i. -a - - 04 ,4 x--aC 4

4 J .. v > .. ,

0 in 4 "o a 41

,. ) LHL :.inJ

4 4-

4-'

i.

0 a 0.1 .. --

a L 0 4J~ * 4) inaL

€ ,, .J in " m *- a , j ,- i0 4) E- .-- .)Ia .1 . U

a L E. 04 I xaL

toC E a- 4L

a ~ ~~~~ 'o4 C .' Eaan 00 0 +1 a C0 *

.. . ,i , , . .. -E E, • ,, "> 4) 404) 2 L. * - a vi 4)

4J~ 0) 4J -0 4) *in 0 '4J III = I 4- I0 2 +10 0 4) in 0 C4) 4J E +0 4-

a in w 4 )L a L) Ng-)0 i ca2 m L .m 2 0.) 4 - 4iL 04J 1 414 0.E4)4-

a0 4j.0 ) 04 - 1)4I 101-I x 42 01 4a 4 .) . 0 4) C L I i .- a on *41 L

a -a .4 Z+ C -i iL IC +4J O i 0 n ~ a ix 1 ia +11 C i.4J 4)0 4 )- - a -i ZC 4 3

mg 04~- 00 v) M)1 L.94-90- X a~a -

* +1 a U L m0~+ ExC 1-) i+4+ I)1 U O a .M I *-

V X( a - 0*00 4j0 4.0 4) 0.0v) UC 0 3-- a 1-~o - in 4 C.0a - C W (Al -I ) C M- C.- a 0C Cw V)l > 0 L -b

L a i 1114- ) 0w he 4 +- L t 4J - -LL- I-C at CU./ W 40 0 .s, o~ a 4- (A w... v I U (0) 4 1- 4- 4J0. 0 IM0) L a W _j-fl~ L C 41- 01

14 za 10 EZ 2 U! ! 4 1- 3!! a o 4- 0 I<4z c +114J a- .0 CL (K<" L.0Q I 4) L .0 .0.0.0+ aJ 14 0C 9<- - 4) L 4J.0

.1 aCO .- i 2M0 +4 LO 160 z4- 4) 41) at .0 2 :D- 4L%.X4 aC* ) C a ) inCAI-i L ( - 111 4 n-1 0-1L a !..> ol-w- C L - -

U - a 4- W I-W< X06 ao in 41-2 .. V) a w z.~ in a W *Z> C

4 uo oz -a owomu- 4. 2+ .AO w

99 _j aj CO _! a) 4J Iz

K-48

Page 229: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

~THIS PAGE LEFT INTENTIONALLY BLANK

".

S.

S

K- 49

- - . . - . . .. . - . . - t - . - - 7 -.-

Page 230: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

-7. . 77 7777iI i.. . . .. l. . .. -.-.- .

nl , ilUt 1 |p p. ....... . na a

I t q "F ' .

43

411

al A.

040

41 41 4j 4i -5

I L IL

vr 1 "+ 4 "044 mN 1-4

I- a I I LC

60

..J-0. 1. 1~ IC 4xv0- -u a- V)x1.41 +

c . ;9 ., "J4 0 - 04-

4J0, 0 oo - 4 . - 4J 0-1 1 0In- aIo.0 L.4 -L V60 6_ 0 L I

44 00 *4 ID 4) )1L4

a1 1 41

v .A50

I I- . C U

4114 14 C41. 1 "4!LL L. 0 '-..4.414 1)- 14

- -- %%I..41,. g ,I- 4 ~

0.I I -!-.4I 11

o C 4 A.0A I I C .0 .0.0 4 -~ -q - 414

41 u 4 ,3oI - 4 m ~. . 41lI41II

41 4 1 LU . O O L P .. - m4 - L4i

L .O.0 41. . l 4,. ., 41 . 0

* - a i m ,- a , ! ,i. .

-"e,- e -)i'-

v, . ...

il - 50

- I

Page 231: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

*~ I S

*~ *0

I aC

.

IIC* 60-22

% . .% - 1 0 1

* C.51

Page 232: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

- - . % .'~. *. .'. - - - -

p0ib' 7%'

N1 N 1

N .

N ; 0 0

N1 N 4 4

N N L L

N 0 S - 41 ;VN)4 41 0 L. 4.1

N L N0 S

N. 1 -J N- M 41 SIc

N 4 0 0 N 0 X C .0 -41u% z -C N.L1- 41 a0 0t

c 0 0 N. ^ C 0 U L-t6 'N .. N 0 0) 0-03 i .- L0 L-

9 C UI 4J ;l - N -l 0 4J00

N l 41 4Lg 0 0 N L . -4C 0

L 0 It L 1U'0 L it U 0 0 UN 4A J-3 - N 41 C ) c I Lr- 4)1JM0V

*) 4. C 01 N L 0 0 -)

N - 0SI 0 C - i 41 > 1. 0 C0 C. -

N 41 M 41 -CL -04J L 0 N 0N~~~0 4.L141* 1.. 41 91 4_4

41 c L L a a1 l -a N 0. .3 L*.40N 0 .J~ - 41 a 4 Z '0 4J WO a U L -t

N~ ~~ ~ IV- * 4 1...1 0- L .3 -4J00N2 '0 0C 1 41 C1 .2 > 410 .NL t t 0 *1 .

N L 0 L a 41 1C C 41 ^1 0 C JI v

N - a . 3 f. - 4J. LC C a 0O '0#C ' C 41 ISI -C NO 41J 0 0 3 4 -L.-

'a N 0 0 0- 41 X0 L N L Q * '0 0a 0N1 '0 I SI C 41 0 N) L. 41 -. - 4J - L-U 2N Ct 1 va- M CL0 0. M A CC0UL N 41 0L - I U)4 0 4

(A0 w. 0 3 IJ A0-.1 Nm .C L L L 41NJ .0 .3 .34 Iu.4 4 N 2m L -S 0, 0 U;

N 0 Lm 0 =L . IIUtO N 0 L0I4. z 4. -a 41 '0N4 o2 odi 0 I -0 L 1 . 1.3 C j0 N9 14 1 . 1I L aC

N~1 0 41 0 0 LO 4-)LJ414 N, S 41)0a C 4) 1 IN C >. wCC 9a 4 L flV Z5- L2- ' N-049CCCU- V- 1--I02.'0

N 4- 0c 41 a-C C'0 1Z14 ' N1 C O- 41 < - 1 41 S1-.

N 0 -- ma. (Am 0 -- 4 Uu'- N ~ S a ~ 41' ~ 2 0 - a

N LO.-~ L 0 L .14 4.1- I0 4- N SC Ii .. 11 I C UN 2>4 2-41 - a.41 U .14.34-4. N L~ 24 >4 L1S

Z& Nw UCi C CL -L 2 a'N 2 U S > . 4-L C I t"14

SN~ ~~~~ ~~ 52.4Z e1' 0' SI11 .~ 1SSS

* N 1 0LC ) 01 001 ION4 '0 41LL-~ CN2014 00

Page 233: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

0 0

.C .C SU U. L-I 1 4.1 4.1

1 ~ 41 ~4. I I..4- 4-.C c 0 c UC

*C~ *C~ L - rI

*~~~~1 0 L U , I W

a .; 'I-* C-. EC II 4- L

'0: OC. 017E1L* I L CU L 4

4- 41 4 41 0L0 0

aC S ,C 0.0 0. L L 0 . L 4)LLO L 0L A ) - A J 4L4J

.4.~ 4 1.1 .410 4 040.-WI .W U! e 4 L Ec L. c L L C L. 6C 1 I

-u u 4.1 4J, C4 4J, L Lmo meI~ I L 0 o

LL L L S. c . C 4.141 C 4J I-4J'I 3 0 3 0 = 4-4J 0 I13u0 Ua Cu C 0.44 c cu cSC S0 *4 .4J -4) . 0 410L L 4J L 4.) 3 ^ - 4 C 1.C

1. 4-4- 4- 0'1 4. *l I- C01 U U 4 -0. S 4J'" 0 0

C.0 C. - - 4- 0k - 4- C4-

CI- 41 41 5 L- L~

0 a - 41-0 0 0L- CA -0 LI.L

*~ Cl 1 4 414. WI 5~m . 41 -V.414..-4L LU4 - L L : L 4.)4- .4

* 5 .0U 0 0E .0.4-.0 I- --. 0 -0.0 C 0. C4

-. - 0 5 U 0O U 41 41C0

0 0 0 0 0

941 u-

*C.-

.0.041414 41

K-53

Page 234: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

0 -'

C 4-1 41

4 4

L. 4J4x 4J 4J

41 414 4 41C4 u 4 ) )

4 E V V- g 4 ) M4L. 0 00. 4 JLu b

4. t- 0 )c 4

444 c - 4 - 44 if 0 )2

4 to =4X N. -100mL L. LCX4

4j L C -U=L _ 4 : 1 4Q 44 0JM QN Z 1,L 4 j L A0C4..

4 0 4U c .1 .0 M 341*c an -6 Ix c0 ;a- 'A to 0.Z 0 --.

C U) 4J 4- L .) J4) C >1 1 4. 0 4- 4

AO04 41 l f1 0 ;" 4., c )L 1 0 41 41-a a 41 l 0 1 41 0- G 0.00c 4 41 41 41 W -4Wa 0 L-C L 0 1 00 I . c L a) 41 41*4 4 A A

4A 4. C 1 (r LU C L L 41U 4J L FAC i .m 1 ) L4 a1 C-Oa. 1 . 4.) L0C6 41 4141 OD0..-0 0 4

2 4 L. C C 1 ^ .11 4 -it C4141 VL c3i=0 0U IVL4J 4 4) I + L 4 * 4 - L 41 4 V c A - 41 XUa VI.4 4- 31 (A - 4.1 41a

4 0 k. 4z 4.. 41 x j4- IV 41 C .0 l< = ov4 1-A~c C U- U- 41 C 14141 -. CL 4 ) 4..0I

4 2 Lj A CO0 4 L0 .0 Z M- Le 0.-e L 0A 0- L. 4L W . 4 ) 10 U 31 V) (A 1- '0 (

ca 41 L L V QA 4 OC 4- IW 44 000 **. 40 41. 4 ) .4 u 3 41L L

4 41 0 0 VI w -i I 41 0 .0A - C .0.

4 L S 41 1C L C wL -C 41 0 1 M. L % 4 * 0 -Ia a 11 4 . -4 + 10 MK < <0 W <L 0. 4J .1 L4J4C

4 m- C C >I -j 42 4- 41 X .4 CL C u > -*OLw0

4 412 - - 414. CU -I~ 341 54 041 In-.O UKn

4 L ~ 0 0 UI O VL -. fl 4 4E 0.0 0~4 .1

Page 235: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

* ~ .r W- 7W

-N.

4J-4

4)

L

4J 14.°a

CCw

GIa.

Aa

C

4-1

4) 4

C

n55

.b..

.

LI -

C In

•WCI

-- *l C

£4'E l ' .0l I

EC 0 . .

C.' Cm . a1

• I ~ ~ C C. -LI.- .amm a, ,

0014 0

.. 3"- ,- ' *'-: ''-''' :- -'-, , , . - _ -- -- "-"-- -- " -.. . -" "-,,- ,. .- -. -- o-,'" ""', " ,,, . .. ' " " -.04..8.-'--; :-': -*

Page 236: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

44J

.44

41x

CEL L L

4 1 J c J4

V 0 000

C L. 10 U 4

4) .. 01 4) 4

41 C - 1 C- -4*1 0. 9 I4-

c L 6 4'S

-41 -' 41 0- - -0 r

41 c 0 L. '4' ^.* U 11- - 01 L CL m I4

0. U 0 Mi 041 3 0. 0. I '

c. E 04 C- a. L. 0 C1o 0. r- .. 0. ci

0 1. 'U 44 'U 0 c4

C 41 C 0 - 41 (41 410 0 0£ 4- -

* 4C 041 0.41 0ifi 44L6

C I.. 0 wow 1 04 4

214 v . U0 w -l 4' u(

41 C 01 IL w 4 4 z vc- 0 0-- 10. cc -1 0 'U4--

oc 0i (A X. £U -j UwCL 0 -j -i m0

*X of * C 0 -1 U1 C.j '*~ M.C <IU 0 -C -4 1 1

* U CO ~- - CO I.0 LLO. ~ 56

Page 237: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

c c4 4 0

4 44C

X 40 0 X

4~~ LI

44 41 I I- E

* f 9 4 L 104J 0 41 4 4)1

4A ..- C > 4J

0j LI +0 4m +4 ; 4 - e0

01 11 - L i L0 0 ~ 4JL L o+ +3 41c

m - 0. V)0-4c E 41A 44 m -1 4 C C) a

4 0 U I 41 41 < 0 044 *0 +33 4 tn M L 40 t$

04 0 ^ 11 . .0 0 41 .04 1 Ln C3 L .11 w 04) )

a. V3 a 41 L m L c 1 in(D4 ) 0 al.. m 41 % 0 ~ 4 . 04 4

It c L 0 4J E .4 L.- 0 00 41 0 Q3 IV 41 Z0 n3 In 41 m4 4J J

C4 t C. L.. wL IlL . n 0 41U a1 0 03 L + -.. LI In CO 4 ? -0 c

4 2 0L 1 . 0 -) 1 4 J1 z*/ mt 0- H4 I 0 +3 144 30 +L LE L+ E* 11.- L+ 4J 41- 0 41

4 4U CCL La4 W .i V 431 W 410 '4 f3 * ..- L4 4nO .43 LI 41 +j :C "I)41

v 0. ~3 0. LC to ~ 0 _j 4 L ! +3 Z04 V 0 J u0 C' 41 4J 40. 4J t- 41 402 L.

o4. 0 C0 0 .413. vl -I LO 1- IC 04.. .s- In 0 + 3 cM ( 'a.~ 0O 0.1 ;f CL 0- 3

o C04 n0 04)0 4 J ' 4)L 4 4)3 W 2 0* L.- 0 41 - 04 C + 0. E0 0C 0 1. L 0 0 4- >1 4 L 3 +34.. _n' £0 .. 41 c n* L- 4) L.E 3 4J 4.1 09J 4 L->,c

4 i c 0 L So +- IU0 0004 41 0 ) a.3 v Ulu 4 WoL

L ' 03vo 0.Cf 4J 43 -4 4 i 41 it IA L~ -C 03 0 )M 04M w3 -C +3) L U tI 01 E M1. 0l 4-l0~ 10 W -4-

44 M1 tJO M~+ 4 0) <IO L3 -0g -C 4-LC(D 040 40. CL In '-0 L ...I2 0 ~ 4 L m :D,0.04L

> 0U (n l-41 (q + 4-L +1 wI 0I4.- 4c m.> 5441 (4 040 it 3 4- cc0 04 U3 0. a *+3 LO 4 1I - L

.1 41a~I (n+ itO 040 ++ - " II) 4 O O

~ '1 IC 0.0 I 0 0411-~4 0 14 >. 4 o.- 157

Page 238: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

u. 4

-*, . --- .. - - - ~ - - : ~

I

U

L 4;

I 4 - C

.• ..- C

to,

44) ) -)

at0

.. 4 4141

no. 4 4).

1 4-vu u+,I-E i a i

4J I 0 O0

jUL L. 4)4c34) 4) )4

0 L c10 "0 VA 04J

4 JC it I r I I,

+ d0 O0

.. 4- -o < 55 "• - " 34) Ul uu -

,.I - w .3A . *- 0U- 4) c" L0

.. ) 0 t.

'-C.o 0,L 4 ,.,,. o.l f . C.

0- U L 4 < . 0

4 3 M )4) -4j U . 4 , , U

0. L c

C L .J It .

0 C 6a) v L

L . 4j :L7a V V I4)4 41 4j34

4) c ~3I.+ 4)

rx in~

o. k4 L 58

• -~ ..... ) ~ . u ,.-,•- -) •)1 a04 U a -. , .. . '" . -" -- . "- -'''-'""[-. 'i 2" '[ ,.[ .- - -• - - - " '"" " - "" " " .. " -"L" L "-- .- '.'-' ". ", -'C - . . - . " _ ,, m .- -_ -,} - " - ,- - - -J-] r ,, ,

Page 239: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

4J

0.

41

0

0 4

C

4- 4

4. 41

L U

* ".- -042 w

o z.L WC

Nd VI0 44-

4J 42 -aC. 0 4-

4* 41 E 0 a3. a1 tWO U.0 4J CC .. . 1

C 01.4- 0 - 0 ~ 0c v -L )4C . . 34 )4 0) u w4-

W 0 4 44) 0 a-- M- U- M.(-Ct 4- *6" 4-tiu0L-' -4 - -L04 - . J- cWi4 u0 4- aC 0 0-u-%

1 u: 0 co -- I.'u a'' -o w I"D 4 -S

c 4 1 L. 4) II 4WU 4 JU0JU Ai

'n - 40 a5 Z- 0C-L4 Q tf - -4J W -0 41 ) -0 4J>4 - - - - 4 : -- -

- *. C .* )L + 4 0 .M42 W 4J -M 4) 4 444 0- M-6M --- 1110. S 4I) Cow . C -. u. 4. 4J4J4

E2 42 20- 41 - - - - C - f 4JU~ - 40,41 42 CC C0 0z o I 42 42< JO I 9< II- 4J' 4 MJ L. LO 0t --.- N-0O-7- -i -- . L0

U 40 C - V4 . UU 0 4 4 -4- 4- 0. 1- 4-4 44J j- 4 j 4-- 4- - 4-01 0u 42 < 05 53 - * 00112121L4 -:-

4) 5L 4-004 0) z.0 n40 - 4. 0 . -<. .- CIc x . 3i adi C(tE 00144 10 .1C E-I 4 0 Z Ll 0.a~~a~aa/ <= < 40 - A-X 0 CL U > 0 - o j- E 0 2 aoi X 0 I 1 4

-4 S0 )4 1.1 4 00) - 24 UU4 U4 U+ 42U .4259

Page 240: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

I.

u u

0 T" 0

a 4- 4JQ 4- J

a (A

0 0

4.1

xa2 u tou

4- 19

z 4- 4)1 . II >j in 0.

0 - 4r ) 4j A0 u N I 4J X

.1I 4.) c 4.1

0 0 4-0 Z 041J 0 J 44-a 4.1 41 g- -- a Jx z x C

I ;: 41 41 , 4- 0. I.

E u I, 0 0 11 .1

0.-- C 4-*9 x c 4.

0 +.4L) 00 0 C .) 4- 0+a) a0 0 0 1O1 4-- to II pJ4

a J 4J 4- 4,L- a+) it 4V a Ia 0 -- VA I1 AJ 4- U 914-

a0 4- O- e 4J m 41 fl.1 aa 00 C a a X U - 4

r u ci. c 0 4-. 0 in m z 4)" ""0

It 41- ) L- 0-u 0 . a a I a 4.)S .- - a "-4 '4-c cc *- z 0 - J X

a 404 4- 4- O- 41 4. 1 4 4 )a 4-0 1J - aJ La 4J - VII 4J. UU4 4.1 X. in U C.0

a Euu . *. u CIO z u- -- ,0 c , u

L 1 0, A 0 0 J 4 - 4 U L IL ,. V 0 4 -a I UL $. + C- 0"- 41 U ." " .- -, . fLI a.- a 4.1 4J #IIl5

4 0+1 u- 04J1 W.J a I -- - C 41 .i) 44- U U-. 4. 04

al t ~ .a0 I: s C Ca 0 0. a -_0- . V A 14" 1 - .. a

4j • I< c 4J .. cal 1-- 4-- 0 4J 4-4- -J MV 0 - > II,a 6 .4.14.) - - .-* . -n M 4 1 t il 0.

a . , .., J - J. 4- * 0 it 0

*" a ga ccl/I'J

Lt 4.1--. U .1 U n(1! - a. t 4. 1, z x ia,. I 'r.v €. .1 c - 4 c 41t ,- , 1 c.-4-. 1..i 1.5.4

a a 0 oa" -1 a 00MV 41a4- 4

* a a WL .1 - 0.0 = <* 01 if) ci I u I

X a li 0-cL 4 (fbi O.1 Ua .L LA L 4-)

It a 0 =<<Ii <0 4Ia+ 4-4- C.aa ~ ~ ~ ~ ~ ~ I af a..+o--i - ni i

a L 1 0a~--- L +.4~ zc 4-- *60

Page 241: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

41 4) 0~a )4J 01

a 4- 4)

a '4- .14-

4J 0 '0a 41 V0- 1

u N) C

aI ZI 1

a CC 4J* 0a 1 '0 0. "a. 41

au C 0 141 *

it 4J 4- 4J 01 4 41 01a .C 4-. 0 4-C .)

a a) 1* 40 . 0

>t 4)4 01 0 4J. 441 0A 0 4) 00 (' 04 4- 4.C 0 4 1 0

a C 0 01C 01 +j .-a 1 I41 >j it IC C1 J A

a 4J b- W) C '- 4J 4 I -4) +a '0 L- C - M 4-C L LI 4

E uI I1 4 - 0) E4 N -m MJ.4a C)~ 4), 0 0E) 4 4) '0 0

a 0 0 - 0 41-4 41 41 41 -I~4 4)4aC U C 0 4J L >W4 41 >1 4)I'.1

a 0 4J ) '0 VI ) 4) 04.) L4-4 0 -0 44 '0)41 -, m 0 L' V) 4 041 4n 0-~ 0 m

0 0 a in 04 4.1 to 44 410 0 u u 4 14J -J 4J -4 1 4 .P '04 4I 4J M4 41. ) 4)

4J aJ -4-C to. I I c m0 4.I - 0 ** 4 .8 x 0 LZ.Z. a0 41- 4JL4 4 4) C 414. 0) 0J +J - -+'jL 100

a1 -). 910 - 4J CE 04 -4.1 Lai j 04 -. ' 04.- LN-. IM VIM4 4 1 C ) t a 4 * M 0.41 04 r -4 0 11 _j

-a k 141 41J 4 0 C 0. 4)04 L a M4' L ZI L 4.0 - ai a- 4)'. -e 0 .C *. ol 4) 4.1+ 4 01 4) 4

4)11 4 i 4)..4. 4 "01 0 CL 41 N-) -. 11 4 1 04) 411X IX i:- :p 4 vi)44 a L. 4 1 C 41 4.O 4.4in- - 0 .. L .. L L I- R1

m1 CLZ 01. a -'041-- 4 + C 414 04 -J 4-. - 4.1- 0 JCC z '04. a 04-0 IW L ) CL4 00 4-a 4J 4JC 0 41 C CII..M e -

-u U8 . isi 4) D- 0**4C CW4 - CL a- 4J I- 4J 4JL - 4)l M 411 C 4- U '0 4- 0414 V-J 0MN - 4)C I' U1.Uzc

.0 '4 4 - a vI 11 0. 0 . L ~'41 ). (n 4). t- 41 4.. -..- 4-. 4- a C4 )00 . .o 41 041 3. LI 411*J 411. C 4-i4-40

4- 4-o- 4-i' %a 0 00>4MY) 0. > rAL J -'0- -0 M LL- -LL* -f.-'0 ~ ~ 0Z0 .- aao0. I.- O ~f4)4 40 4)4 -4M

- ~ ~ o. 4. QI~ aj .41(/)o 14 ww 4- 4) 4J ))4 4 04

1111144- a '0L a- C~ Z 14) 4)I4 :D m -C 0.

x w -i j ai LI C L. 4-4)'

II-m 4- 414 aC 4Jfl L0 4 )4)4

z % 0. u u >.. a1 0 LI W

K - 61

Page 242: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

4J.

c 4

44-

It t ID

4j 0 0v N

o0 4,C 0C 4 01 C

C 0 1 4.1 ) Cyc 4. 61 16 CJ

o 0 A 0E1 ~ . I 4J 4 .

S416 00 4 0

*A . 4t - 4 t 4 tn4

N01 N 1 0.N c I N4J.&C I f4 4 .M 4 1CC I

V94 A C 1o 41 N4

-a 41 (a -C-

41A 1 C11. 4 I . 4JA

4. Cd - 41M4-(41 CM * 4

41 4. OS 4

* ID (vC .. I

CO (I 4 41 i.C2 m41 C .- C

CC CNJ - 4* 4

41L 41 4I 41 J

* J% *CZ - *AA4UNI I W 4 U 0

-~~~~ NN612 I -N4

Page 243: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

-a1

* 4

44 4

414

0- 03 44a 4J L. 440L

4J 44t o

o.4 41 4l+

4 00 L. 0. 4- 4

40 0. +1

c 41 04 lv

L. C U4 E4 M - .'4 1 VI x4 ;044 ) 0 z+ L. Z

4 0 4J 4J L

4j . 0. U 0 0 11

4 - c 41 - 0. L E- WL2 -

40 CL1 -c 4 go= L <z4 99 4C 141j 4 . LW<L

4 . 0; L 11 01 It J 0s 41 >4 ) 1o -4 0 V= Ii 4

4 Z 49 > Z09)4 .~ w4I 4 I.~ w

4 C -.w- 4 0 w n O -4 a 1. 4.. 4. = m 4.. .w L- C

9 -1 -0 1 CO 4. (a x i n .

= 04c % 4 J I Z it 4Jl C4

e C- CL 1 4iV ZL U j 0.U

-~~~~~ 63 ~41 4U 4I

Page 244: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

z

0

0 L V) 041 3 2

411

.0 41 L-4' 0 Z CL . L L LZ #0LZS 0- L L&..0

> 41V L. 0..Nu 00 -30 .C .C T---I-

CU 0 - tr 4CCO CL COC41 41 z- LU 'SL0 bbi

Si L1 '1 .< Lt4- -=1 )1-0. a 41 I C441e 4.41 4141 .M0 LI

0 --4 M a > L4 LL0zVr OWJ O---E4LO1 At. N0-3EU )a-U .- _ 0 -.

a 01 4C C.0 J C C C < 4 . 0 J C - 2oo (A tu 41 -4-m LC~-M -)V z cw

us *>'4- W j >4 '0M -VQ4 > ILc C 0 Si do01N w _u < -a- X0 41 c -.41 C4J4 P*C- . LL -LLI

In0 -41 01 0 -33 3=2 3L0 410 C J+ J00 4 J4 J04

41c ZC 041< 4 e ) , V044. - 4JTaLL t L t Lt L Lo11 x1 .. (4 '0 .

0O0W cO U* .0 0 0 10 41JL 0 L -U

D' L'Z m0 ),1 U u 0 C.. ..

- ~ ~ 0 0 L, 41 0 C 4 u.= 11 4*~ ~~~. - 1 c I-0 ' aO04 Si u m .: 0 0* ~ ~ 4 CL - 41-. 0 60 0 .0 00A .A A A A A

41~lZ 0JU4- L S 00C0C 00 . LO O 0 0 0 0

-IL14 U4141 0 0OU U L LLL 4LL* 4~4'C~4- > CC -..0W a>..00 0. 0. 0. 0..0 0..0 .00.0.* iVW.UUC> p _JL to tR 33.~d 1. . ol V

0~~~ ~ ~ ~ - 64 n 0 atcI.

..............................................................

Page 245: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

- - ... .77

z 41

E E E

oc -0 c .D u -4

- -z -.. X E4l X W 41 L )w xU. W. Z L .;76U90X -1- 2d 4C El<0 c u 0L<< 3

0 06 0 Z; w L. 'Og ** *. 0- **C 0 .W a 9 L W<UW0 ca O 0*w *-0*-**i xj Z M . ca m x ci CI CL a~ -. -D l. 0 agX

S- W I .W E ZC.- ' E :1% 0C2 , u; , ! -0If ~ ~ 4J C 6 WXC 4 4 (t -XL 4.' L) 4J C I .W Q tJ C< W UJ 4 CXO 4

14 WU - U6OZL -4 I ~*L. L IOZ4U 1-001.- 4 JW OZL. -- W OX El Z NZ EL UJ i=W- 4lIVZ L ElQUQO.4-2 4 IW 34JU-~ M< 0-CO- 3L L J- 3 -L UL W + ZW . 0 aLLCL- -

*-dO 1ri W 4J--O V C 4 0( 0...< )) 041 1-<<< 0 jJ MC-j<X90 ElJ 4-)~ W < < -W -C < <90 40 M*gc go w0+ -LuI wcx+L >g . -- Eulu w 0 l- E u,-~ . -;-I- *-U u i- < -I- Iw q 1-WU-Iw 1 41 + I

*md o o- Q.1 *I + -00.- C J -'I2W ( 0. C L. Z L ( ( .O C.4( ~W Z a.1C49L OO4J L Jc 9C.L C 4.+1(*~~ C~aW.L -0 IZ Z iU EW ZLZQ WW ZL*Wl ow < -IWZZUZLZWWZ WWWUZ t

!* UUUU-DI! -t WI3 0. - ~4 - 3- .. J- 6 -W 4 ) -O 0A.- -4.1 ---- ---

0 0 0 00- .. 0.L -0 NL. 0WCl00Z 4) 0 0 Cf.w 0U 0 0 0WCI 0 n10 0 L..L. LL L L. L- L L>LLL- LLLh L.L1- L L LI&. L

ccc c~ cc coc cccc ccc cLL LLI )LL L LL L L LL L LL LL LLN

S El~ ~.,~, E

0%0

N I be4

14M 44 0% 0 %

0 ~ ~ ~ ~ ~ ~ 4 0% 0 xxxxxx xxxxxxxx

0.&M .Q 06 0 N . -. -..- -- - -3 9 - a. -- --- -ae .' - .-

-~ 0 ev% \ .'. v < Ne v NOA. vA A %A/ N v v %1 v v v IV IV v v .0 vI

~ * C U.\ A .%~ll l~ll~aa aaaaa A,,, AA AAA65A

Page 246: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

.w 4 t

;E~ z u a O- a -L.1

0 L u0 0 .aL . 0 C a c LI41x 0. "Ok axL-+C4 u+:100 l;

VX La + aI+XU C W+ - J S 04

- 4 G 4 G L-JbQ 2- -0 U+a 3 M4(3. 4J 0 C J4 )C( J j )CU JZ -C0( l0 -MU0

o 4. a- - s0 1- I L W+ - L w + j

L. . I- 4cLa33 m 4) 0. *- * )

*L) Z J 4C E 1 C 0 W.- a .4.

XW* 42 X .~ XW a 4 44 41 44.) 4

* 5 05U~ a)0Z - 4J0i-. j.5it4 4- 4

40 it2 0 V)-CC~l CC 0 0 g

155 0 I a- 0)4J4 CJ 0C .

4. 0 4 1 Ia~ 1C a .2

0 aj 0. a 0

0) C a z C a 0 C

a a 4 0. a h 0 0.

It a --j - W 4 C aj W~ CN 1 . . ) w a1 0.,. 0J--IM U-

_ 4 C . a -<5 C ao CS z*t.3-<zCovq N 0 -Xa .4 LW< I )4 0. -0 C O

10 a a : 0C Z C aC ZO

L> L > *

a E- E E< w1 acxo* w x

*~ r N 44 J ( WC a C. 0W

C C c N 0 C1 a 0a.C~ a.) r ao~x - aI.owoxw

x AAd .. 14L Aj -j = m. , C 4( Ci-L ai-

* 0 00410 0000 0 0~ a Z w-J(J0-1u aa a -j- 0-4j 4 4J 4.J 0 M <- <t a a 4 < 0 4J a9 <4<4 0-,

K -66

Page 247: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

-- 4J

Co 415

41 --

GeV-uoo

40 +

K-67

Page 248: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

.4J

0 V. V. -W V .

4J 0 4J 4J 4J 4J 4J

a4 .1 C 30 1

4J 0 le4 0. C C C C C C

.2 0 L --u u* 0 1 4.1 1 1~ 1~ 1~ 1~ 1

L . 41 0 41 4 1 0 0 4J

C 0 4; 4. - 4- 4-. - 4 4- 4

.C4 4J 41 J4 41 41 4

00 01- 4-141 61 a 4- 4- 4- 4- 4- 4-

0.U 0£ 00 40. q- - - -.

%CO t' 41 -1I IC 410 0. a11- 421 042 L 41 41 4) El

441 a 0 1 L LC.

04 I .J U. 1- - .0 -J 4.1 4.1 41 4J1 4. 4.1C- C 41.8 01. -. 41 0 00< -L -. 1 40 2 C *U -O -4) L& VI00g - C 01 &- 1 *l 2 0 C V4J04J uCI 4 0 0 0 4. 1 "-C

C00) -0 4.5 - .4- ^ '-C 0,a Q- .X V1 - U C401 4J .- L 4 JI -

v1 41Qo20IA4 a- I0- 'D .£0.4 41 L-C lI0.21 1- 00L C - ...- C. 4J vi L 4J C 41 C'I10 @o 0 -U - 4.141 - - -+J 3 M 0 *4J - >

xM Ix - bi 0.-C 4- .C tO4- VC 41)410 . I* -U *-- I E.4 4*JL a 0C 0 4.1 41 C + u C4. +j U)C 0 C 4.1 m0C L 0.0 Ex 0 0- 4- C 41 L-.II 0- 1 41 - 0 0. CO 0 1 0 E

4- M- u 0L.- 01) ^ 4 C 41 -o -0 1.. u. u. 0.- C. 4j1 41.0 M4141 41 1m 0 ~ 4J 4- C.1 4JlX I.X ' . I.J X E -. - Ix~

0 C L M 0 CC x 4.1 W- 41'04 0 41 4C0 410 0 4 41 ( 010 L- 41 0 m 410'a 0 .900 0 41 0 C M a0C - C.X 0 t )4.%4 . x0C -Y 4) Y .~4)0Ua 1: w1-4 0£o 41 cg~ lf1- . L. L 311 0 L M t-0OML 4J ML0- >.M -U41-4 L 41 4.£ .04 o 4J I4 .1 4 14 .. f 4J 0 E 1.0 AEau E.0 - E.0 I E.0 E E.04J E.0

Q jCx 41 1-0a): I C 41 - -%- .8 0 C 4) C L 0.CS CO.10 0 4.14J1 1.. -.. 4 4- C 4 - - - 0 0. 0 4) 41Oc u I- E4 r .0 4) -. i E4 -41," 0 u . u 0 C 41 41

* S 4 ) C 400 m0J0 41a 41 M C4 C~ 4144 1 41 1 44j 04a On - 01 C 0 0 - *. *m41 m mm 0 01 1 01 4 4) 4

C .. J L. mZ b- 0- 4)C 1£ 4J' * 1 110141-4) 0 m0m 0 10 0 0 10*4;1 L 0. u 0UV4J j a a .1 L- 4 '0 0 -C 0UL - U U u u

U 41J 0 0JC 0.0 4- *. C £4 0 C CA m m412 12, L1. -0 W%- 0 0 Vfl41 0a m -0- X L-1- 000 4 USOOl4 4JW 1 -0 0L 1- l0 MX

4A8 0111 I1 10fl4J 0 W-J.l+ + - 0. 41 al00.1.10 10 es 0 141<C 2 lz~ 0* I u C 3-4J

0 > 2 2 UEl0 ~- 0. 4 LC---o.00(no~ ~ 4 ( 4J 4.841V

*8U~ z OW >f V 4J I

V- <0 w. 0.

K-68

Page 249: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

°-

44J

4.1 + + + 4+ + + 4.+£4.1 4 4J1 4J 4J 4.1 41 4.)

* C 4J C C C C C CC

4J 4) 0. 41 41 +) 41 41 414- C C C C C z z C

4J 0) 4J. L

"U "U41 4; 4; 4;"U "U

- --- - -°

C£ 4C .£ +r . C .

+ 0 L. L L L L + 4J 4

." 41 .C .C .r -C ." . 4). W• ~ 4 W" - L

41 4 L c3 4. 44 3 3 +3

C - - - - - - .-

, " n 0 .. L L L L L J

.- .*.1. u£ u uC £ uC u .-

. 4JIn 01 0 0 4 0) 01 41 01 01 4 L4J VA -0 4 - 4J- - S + A

*+.l I1 , 1- t L L ) L +4.+3411

C' ,. J 4 +3"4.0 A J A ,. A) €) A) C) "o C -

"-(D 0 c 1 1 IC = II (n 0 C.1 C4 +0) 4 - L Lf 'VU. 4 - L J 41 01 I1 U .-

.'. In L .I + + 4) 4 1 m 4 L- 41 " C . + . C 4 -

I*L0 C- ..- 4J V~Cf 4J c 0 0 0. c0 . I( L 0), CCS-L_ -0 041. "U +3110 v 0 1 4) -j 03 M3 + - 0 --.4)

9-0 - -O4- . 0 44 - X" I - - o- -- .- - - .3 -M.- 04

"U .'0 4"

C L go 41 4) " m1 . v a ) V.J-- C II. .•r . -0 I) C. , . i

!~ .1 ' "U L.C L. L -: C 9 4 .L Z ( -MML0MLJML ML - LC33LLL00 0 00 " 4 IC 4) E M.£ .0 41 WLE0VE0-E0 E066Z4 . 1 W 0 0 IC .0

S - -- 1 a.. . C e e va +1 0 C 4 L .41 10 FA l"W- .L41 L L L 3 U 91 I m 00 d) E m L4 L L L +m

man L. -C + C 04 0 C0mC L O m IoIOLL-+3 +3"U+3 4 0^14IV- 60 0. CO 4) 2 I -

.. . " .. , ,'.-0 " " .. ",- " U .4..J. +.. " 4.. ", -1 (4J4 4 41

1 3-0 0 0 -14* - +3 I C+-. Ls L L. m I. M .~ 0 . 1 34 -i M . 3=- "UJ 0- 04+~ C 0 0 0-~ @1 0 4) '04 ut0- 1+ 0+ 0 0- 0C

I 0~~ 000 ~.' IL L U400 C + 4 I 0 0 .

Cl- 4lJi m.4 + 1 411 1 41 * 4.4 -0 + 3+++ -.-- 1.C1 00 0 00 0 41 +3 0 3 3 - )

0.O0~0+ 0 0 0. 0,0-

K-69

Page 250: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

S..

4L

0 4J0 0 i 4

4 m L 1 4 40 44j Z 1n 91 M L

0 4J~ L- 4 m1

41 44 -4 > [ 4441 - CLm

0 n 4- 0C 0c 0

0n 4 E C.1If- L 41 -- 1 41

41 a~ 00. 4 t - 0 In- ..4 1 c E 14 CC 4J+ 4 J 4

FA >'I ; FA. c m m (-C- C 0 U4- c OC 00 L

- 4 - C - 4J C- -- m 0I x 0,; do 0 4 1n 4..'A 41

> In L L 4J C9 4 4 4L -VEII j

I-4 C4I'I E 40. CC .'L 4-.In aI In C-I In 4- C4- Inx cn~ 0

Cw In 4L C-I.- C 0 V L.. Io In .' 04-C W 0 4 j L'I~ n4 0 ~ 4 14 L4.

0; W L ,' IC 44'J 114-J E- it - :- -( ul~ 0. 0 I

IL ... 0-. 4J - m 4J 42 In. J= LL 4 - -C4

En In4 In 0 (0 .r m ~ lii- - 410 -V.. 4) C L.0L L- 4- 3~ -u 4-. m- C- a

.. 4- 41 4.4 4M L CC -- Cj ^1 . A. 14J In In 0 4oJ- I 6 00 -C W 41 DO I CIn

21I In1.'a-u-- 4 -) )) '41 0) 4 - . m- -I) OA10 ~ 4 N -It0 4 2. 4 '- 04 - 0< NCv 11M

a0. 0. o 0- 'V2 - L . 0 E.m -I .4J

0 11*0 4>7141 4J 4-C .CL C-. .31 C .. 'o 0. V)4 - I 0 In +)4 En m: -L 1I .

.4.E 01 (fl* 4J 41 4-LLn 4 1 I In- In4. 4) -.I .C C 41 Cm 414 r>~ 4L 41 n4-

= < f-' o - 0 - 0 01 4.4 4 41 ) 4J'I~ IA m .JO:00 ae -j I 2 4- -C In0 InC L> 0 C4.- J LWE - V4- -4.'

In4Ln&1 4 .. I'. 00 4- >. W1.-- 4IIn L E Cmo4- L 1 -0. 44m 00 .41 x 2- CIn

4- U 46I 4 IL - JV0 4 4 1. 41W J C- -- M

-Z W (j- 4c In . 0 LL In. C zI -o L 0* ~L 4J Q) O - J 4L 0 C .04 MEI In 4J.0 L

4JI -J-- Z!a4 - L 0.~ 0'' .. Q ml L< + E-I40 4-In L6(.. Iu .. > .3 OC 0 . C44V1t 10 '0 4- --

+C UV)0 41 0) U 14JV)''~J.C-4 Ow ) w 'J- -11 I C Z 4 U

40 44 .. /) 4 U I8 Z OC AE W.. u-41UW E

K -70

Page 251: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

4.+ o

41 1

|C

0 V -'0- C C

0 0 In ;- It

OV c I "4 +. A., ,, c+l

* ~ 4 14)41 4J4 4)

i0 UICL + 4U) C- C

o 4) . 1 4) 4 J4 4 4C - IC O, 4, Z

.- ~0 C to 0~ o . c We 4J m mm m

0 I + 4C4; C C

"" -- 0 C Lmm u1 4- e ,, -- m.,

- E) 4 -) m. C ) CC a-)4

C . C, 41" -. . 4. ) L. C '4 - S 14 4) 1 -

o 41 * C , 0 C .C

0. Q 44) L Z) L

4) --4 1L 0 . V. 04)4) C) - ' 0 - -

L. 0 1j4 4) CL' 4J 4.* .1 4- co .4.2 )1 C4 u~ aC A0 L 4)4 M) 4)+ C

0 Ir C "014 L.4 I c t- -. -j4

0 E 1 (D4)C _j (A - *. 1D4)CU ) 4) (qJU C) -j 0 -4-ZL ) 4 -)*4)

U0 4) -4) 0 . C .4J 0 .7 1 .C .. C 4) 4L0I -4- 60 L, L. 4J III - nItU n( O r I L L1

0 00- 4) Z'' CC IC- a -_ 4 J m) 4x4 I C I 'U 0 CO3 . . . v1-4) I- 4). + II 4) - 'a In U

"L 4)0 0) 0 3 )W 4).. 4.- C4 JI '0 o- o. f LI-IAA 4JC IA *. u 4) = )., C a IAIt -. 'cu

0 .C4 CV1CE '0 41 L..J' to) 0) Oc )1o t 0 CCI 4J_

100 3: 4 4)4)-g n IQ 4 M mL l - I C IV 4 A 0 C C 0) Uj -X - W L -Y ) 4J',U J - 0 U~ -) L. C 4J 0 4J 4)0 'AII- :h 1 4 4) 4)L 4Inr).

II"110) 9 -04) 4J0 104 % Ind-. Ift 4 3'0. 111 In 100t.-4) 2L C Io (LO III V4 .04 14) d 4l a. 1 M)C S. 01 C A 4L 4a40 L. 4 ) 0 0 -. C."C 0 L' .j C1 41 0 10.04)'C O I. L 0L 0 L -s 3: so14 00 C

4)4). ~ ~ 0.1) CI 4)4 0 L~)J)) L4C4 C)1 ' 4 0'0 1 4 Q0 1 4) A ) C. l I x/ 0 - 1 0' *

0 E:! C C-0 .a ) 0 "1-0 - -- -- C0 4 4)0 ' - 0 m In 01_ C2 .4 0 L. C L L [ L.4- L. :' '0 .C P C C L 4) m m III

4-101 -C 4) 4) vu -0J-1) 4 40- C4) 0 1. t L ~ 4 u).vL-Vi4j 0 I C ) 01. '0 C 14 IV' -1 C.0 m)-- III 11 L1 L m InL 4

-1 0 -d .L 0 u- W L.4C)4 41- L L) L)-14> t-4 L0 4) 4)-0.* 144.U 11104MV000 C4 .C -U 4) _~ m.I4- 144 m 01 III C1- 441 v r 104o# '00 -1 4 C' C410 44L 4J .0 1) 1) -. (1 0.004

1L b.10 4 ) 4) C 4) I 2 1 C 4 014 1)4 1 1- 00 Uv* J e4JJ 0. L.W I -) LL 4) -. .. 0 4). I- 4) 4)4

a 30 (k0>~.C M4 -L IJ L ) 34-L A L~ L 4 1 04 1* 4 . 0) a ) a . "'- 0.0 W4 L )04 C)))) 4 -0 0- 04 LL 0J 0U0

* ~ ~~ co LAI404C. .1c 0 44) CC0 1 444444) A )-. O4 UJ 4 V4) -' -4)J LLLLL)4

L4)' It'-. 4))))4 4 14 4( 3

<m< c 1c 0 0 Al ~ 414 C L4

K -71

Page 252: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

*w-~ c u~r-~ u

o - . -

V(7s.

41.

U; 4 (1

- L

- 4- 4-C94

4.' 4. 4.'

%l 41 V) 4) 0 -4)

L L".C C" C C U1 U 4.

- - - L 4 .* 4.' .

0 4J

E 4 +

c U U I ( - in +

0 4J ¢) >1 '0 to 0-- 4 W

4.1~~ +1 4.4)4

4-. m4- x +4 4-3 4 L

. . A. A. C 4)

T:.. j C o o ....

I - I -n 41 . . ¢' q .J . .

El V l1c 1.

. m L .. . L 0 U ' " m '0 ++" c 4= 0-4d 4) c4 I. 4 . V + r- M C.

L.- 0 L 4J M L - M L > L L C I- L L- -- 4) S- c

. - E.0 12. E E.0 4 E.0 - 0- ' -) > z)4J ' L . . 0J n FA M 4J .i M (A m c " ..

CL 0 4) " L L. L X. "W )

C El C in-n mn's VV * .----

0 4- IV to - - 0) 4J 40 "(M,-

fi- I 0. *'4. C C 0 0+. ~ ~ +4.' 4UC 0 0. V l- 1C U -. I E+ .4~

. C " - 4 v ." - - -- - -. ' -

V. 2 I. V L-a M. LJ O L~ L L L L"OVU ElO 0V 041 410 0 El- 0 1 0 0 cC

L~~~~~~~~~ LO L'U LU L~U LCL-~- L C ..

0. El U VL 4J 0. C36 Ci C4 )o~~~~F 4J 41 in 4J 4J 4J'.OU ,'.L-

OO OO M

* El El72

Page 253: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

tI.(~~~~'.j~~t It~ .. 7 .~-- . -- *-

0 E

4 K. 4

40 L ,10

4t U) .0 C L4 0JtI= 4 t

"4. .. U I4VI 4J - in

It 4) 4 0 4J 0 L J C -

M )- 0 4) 0 0

4~ 41j _j 4 0

4 I()0 ' .1* I II * 4I1 ~l 4 0)4L JJ C L 44 0 C 0

4 -a C 0.0 4 . I -o -, M ,

.C *, 0 0 4 M)

- I ii••e e m-I m v • I .-L 0 0 ,4 4J 4- in Oo 4 0 44.. 4j

4-i ...." " U • I O I-u 1. .-. : U. 0 +I- -J

'in 4) - $- ) 4 4) M q14. +. Cj N C -I M 4.1 . J C

V U _ ) -x M 4 0

4 0. _ 0 V) C 1C 4 +

M L 4.) Z 1 4J L 0 044-44 U (A 0) 0 in~I

(n 0C in #A to N N 1 'A 4)- 4

41 -) N . -I N + 4 0 4J I4~~ .C +1 00 40 0 1

L 41 0 0) 0l. 0+ . : o1 I. 41 E L C- 40 N- 4J J 00* IV U) 4 - 0 .C 0 U)

if >O 04 U)00 CW 0 fL- C LM tv U

4) 41 11 M L&M ) I II It J 0 4j 0) 0:It C 4j 4JC 4- 4JN-N 4 +O - C 1+ Ln (I ^ 1jF u 4

4 1 0 .MI I I < to .- ' I I E- -M I

It O L 4) IIIM M14A C L 04 1.0J ( 0 4. L 1 4) Jv 4 0 0a ( C C. - . 0A C4) cu M 4L "" .C-Q x 1

4 4 ON +1 +0 AD V J4 4) 4 +)< 9- C 0 C1 4J M4 4 4) 2.2+4 0 it L- 1- L 0 C L 4- 4J _J I+Ix I ni 4) 'al 4 1

0. 4-0 3 L M 0 .0. M0.00 M - ol:1)+ . 4) 0 (D41 4)- 0 4 0 .00 0- v A f 0 .1 0.. 4 4JL 0 011

4 4 0C Q) Q.0M '0)C)4J+ 4- -j)+1~) CU0 AO 4- 4J Ut C 4.)44 t 000 C C- - -I - ( 0461 - 4I -_ 44 C)0 E 40 v) ) O C L-+C. -. 4-4 '-4- L 44. _Y L LL V

40 It it L E J4 - 0 0 IV C CICC 0-- C 4- - L (A0 40 4 4W13a 'It 10 0.( 0z 4 44J* -0n - 4-0 L A04 4- M< C +)X 1

2 4 .Z 0 0jI<II x4 LL L L 1 I-) L 4 + L)4 4a j19 -.4 , 0 < -4 ... - )).0. )+. ' A 0 C C +1 4 .) M *. 0C4 0=

-0 v E K C, L <- +17l II. 34 0 co I q 10 0* ~~ ..U .+4 ZO W L >~00.C 0 4-OL L . I% >)Z 0

U4 It .X(/- -C .1 41 C +) 640 20 It 0I0 En* 6 4 J L -OU 00 4 1+4 W ' 0.) X LU _j --- n - C41 LL V) X-4 0

*L _. 4j 0 M Cc)+ 00 '3 M- WI 4- 4j _ LUL zLU)r _ _j 41 0fO U) 10 <0 _% L1 4- .*+ 4j (z0 U)4)10

* +14. 4 L 6lU.J1 it4- WOOOM 4 CC C<-" <C at <- -Lf+ ) 041 to 10 u <Z 0. >-1 _j E4 in 4 -a. ><CC 0

IL 4 41+-.41..~I I 4- t.~ .. 73

Page 254: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

41

4.1

0 0

o 0 i

0 400 .

; z -1 41I-. 01 -u A-L- 0- - C

:: ^ 0 I-'x

41 0 1 4) 0

-1 a 41 C 4) -4 C ~ 41L 4.41 -0 L

4 - 0 N. +j -1 -r) U J4- 4- 0 0 m M0-

+ ) to a z to .8 z %1.. 4.1 o 0. n- . 00 0n 4.J 4J -0 1 C U i

I. S4) 0 4.1 m 0 . M M

L 4J *.1 41) E LJ (0) 01 - In 4.1

0 0 4) C 0 41 M I

ICA C 1L 4 .1 ,- 4- 4 A W 4JC4J L 1 1. 0 (n ~ 4 m41 C1 - 4- C - 0 w 8 41C0 4W- .8 0 M-

4-1 0+ 41 E Z I EI4 .m.. 4.1 - -4J .2 x 4. L w - I, 0 L 0 4J

0 4.1 0. 0 4- U) *Z- 08 *Z aC4J 4) 4 4 1 4 1) + I A- 41 I < J E .1

-~ 0 .X 00 0L00 041 0 4) 0. V)C 41 4.' 11 4

40 IA a. z -K at 0.( I-' I-mI0 -6 ca - 0 Z11 1 0 . 4JC 0 414)

0 4- - 4-P ti C 4- (0 <) C4 . I. w 4 J 0 I- 36- 441

E 0 cc W W. X 4 4-2.L4 - L z- -441 C CJ 4-U. 4) 0f 4)- < " 0 - - nC C

z 4 40. 0 fI U. -J 7. V) -I 40- 0 01L 4+ .. 1 a. < v. z4~. a- o

* ~~~ 4)~)+ 4 0 w to )W 4-

* ~ ~ ~ ~ ~ ~ ~ 4 04 - -1 UJ 4W 4 ) O ). A 4ZI ~V 04. 0 tozU 4 £ 14 0.

GOLO) ~0 4Z M ( ~ L I (lO4A A4) 00 . . i .)Z.)x 41

0.0~~ 0 -- U- 4- 1- 4-. 4 40404 4 0

* .2 414)~~~~~1 41 L ) 4 *--. I 04Z 4

* ~ ~ ~ ~ 4 C 4J~-0Z - -4

Is la ) CCwZl

K -74

Page 255: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

*~4 - z z- . - . --

* - L1a to

* L ...

go 4J 11 if -1 1

*. L.

*j 4)

0 40

C 4 -)to L .C .I .I .I .I

*1 4.' ZS - fil 0

0 - z1

C 4J L U N0 L A

.3 >1 to C)0 :,* 0 VII tl

a If3 8

UP 0 .0 3 '33-

41 0.u) u - I00 I4

C Ls - -~. - -. I -

* FA WI >). -

a 01 0 C +)IIII 9 Z- 4

L wa 6 U .. .3 2 h. 3 .40414* a. L C. 4O .0L - . 0 L L

4* .- a .3, LUt oo- -

a, a :I. W3 (AL. . . .. . .I.1If3 fI 1I 11

*~ 4) a L 4 4)1 C-CC C 111 1) ll

.43 aA L 04) 0 .- V)C 4 0I~~9 a: C- I. L L LL 8 -4-

* a 0r - 0 L C 8-----------a C

c a Curn 9 . ; - --.-.-a-aLaI-

a CC W 0 - - - - -~ - -- U

2 al ZL WO- 4- 4-l4-I4-I4-I4-- 0.404- .

a LI 0) Z X111111 II Nil*0Z0L0 L Lj a U CL. Ct<. -A-.- m.3c

- at m I - -1 _j u) a3C

L a Z gL U u > 0-- C ix3. U1.

* - -- a a *(fO a- 4J-4--11II4-44)44)4 -754

Page 256: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

.. 7

1 4

V L

C+ ZO -

- + [4) + o - -

S .,441. 41.. . 41

4J c c+ 4) C I 4J I4)*~4 -404 W JU 4J

U , C. * CS C L 4- Cc :h +- c -- 4) -

04J L, C -- 0.. C0 .- 0

II E (ln - W 0,,Go - 0 - -(A 4-,-c 2 . - C- - ) 4-. ) .

-" .,u *41 . * . ... 4-

aO u c 4).C u u C4U< -u

U f.~ I - . I,

u 0 1 In , I .,1 4 1 Lc0 -a .0 .. I . + . - 4) 14 -)

00 E ,) U . c 41 %- M -i4- %.

..,N- ' o == 9 0 1.. = •4 - - € ) • , --w

V -o " .- - .;- Z - .- -4V .0 * .) t . = .. 41

CO C * 1 4- *u 14-14) %-0' 4)- E 0 J4- C 1- .0

4J L * ) L z . A) I 414

O) 4) 4) 414 q, A I V14 0 3 H 1 0 c cc 2 0 41 4 C.0 V) 14 4) (n O 0 4 1- GIG 4

'- 0 -I O Vl 4)1 0 . 0a 0 4) u " 0440 ". 0 41 V4j- - 0 C41 z L0 cCa,- u C U CO 0 L 41 C 041 - 4S0, 4) M 14: 4, 0 o I. -. -

cL. .-W L it 4.0 - V) *o 4.0 C*-)-.

0 3 to 4) 0 2 (n IC c Ofl I qqEq 1 IvC C00 E 0 . c C. L41 0 - C4)+L 4 I+4J + --

OU2.C - .L le C4lZ. O ; C. 4 ) , ,04j::

UCC .C 1 0. 4,.141 0- L C

0 40.- 1- %- LC L LL L 1-LC LL ML CL C UL 0-Z004) t- 4 0 c -~ 0041)M 0 o- 0 U 0o 05 41 0

0 E C 4J1 0 I L. L L L-L - L.. 1-L 0L. L. L.. L.17 zL I- 4- u 41) 00 fa o MM U* 00 000 0 0m u -Mt

00 1 0 C c- 01 1..0. 0..00.0 0I IV6 C4J 0 0 41 Oto 11 0 41 II I ) '1 11 410o

O C C U - C.' 41 J -V414) 0 L. .9 0 4 4J 4J0 -NC 4 41 41 414 C.%4 4)10 I 40 L 2 3 2 Z O L ~ 00 L. 0 M2 M 2 L OML.4

0 0)1 14 44 40 00 0 02E0.0 L11(02.0 u000 0 02E0 0 00. 2.0 Ec O4) a 41 a 4j m 4 41 0 0 IL C

L 0 a E 4.0 41 . 0 4) E A- 0 0. 0 c0.0 0 00 0 0

41o I0 FO4)C 0) 40) 0 0 0 000.104-C V1 * 4) ~ 00 41 fa

4U 400 4 . 4)4 .41 L Uu

3 c 3.1 . LLWL 41 V)l :) lo Ia0W~g0 4L.0 aQ vOUn) 0cow L. 0 -

41 0001Q6? ( M4J W -J 4J C 0m10 ~ ~ ~ . -@ .6ZO4

0, -J -~ 0-X 4J . - 04)44 1 4) .X) 0>0I2 4 ; I-~ 4 0 a

0 1, 0 a A . u w 9 C -"Cw ix z > 0 v0(A Q *C w 4J C

U Ow o w- I u 1

- ZC...i -AJ zJ z.J < 41w O- 0 4JC

K -76

..................

Page 257: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

Z5 45 o5 4 5 4

C- X C . CC

4 UI I I ot I II~L o C z44 zC . C .

4 - W.0I

J, o5 4 454 .4 C zC a C r* '4- '4- '. * U IC 0) 01 0) 0) 0) 0

A ~ ~ ~ I L . '0 . L 45 A A A

o ), 44 ~ N c I I I I I I4 ) 4 45 C.Q @" , a) 4) 0) 4) 4) 4)

0 00 0c 0 104) 4) ) 4) 4) 4o!. V o. -) -4 0 C I-. L. L L 1. L,

* ~ ~~~ 45 4 5 . 04 U mL. -45 05 4 5 5 4

-~~ C *4 50- *@

0I I C 0E C 4-+45. o C

1- 0. -1 b '- 40 u o m0 c L 00 0 .C4 4 ' 4)1 2c 0 - -0

x o 0 m*)5 O fo I. 0

4) Cm 41 m-- C I 1. m C - 4) C to4 =4

L U L 3C4 L a 0 L 0 a .o .4 - m -LI R E0 0 . Goo I0 0.0)')4)4Li4 *..0 "uE0 - J E. .0 EE0 4

"0 0. 0 4 J 05 V 0 C o5 C L. . 4Y0 ) 0.1 L. 1. - 0 0. CO 4) 2

C 45. 0). 0 0 0 0 0 - U. O C 5* 4.

4) 0 40 L ) 14) 0 4) 40 40 40 1)4 0)0 4)1 0

01 91. 01 C' ~ ~ 01. A4 001 0CA . 45 0 L vi1 I)6. 6. 40 .C 00 100 4 101 02 0 11. 1. 452;04)

4) -- L- U- 0 0. 0 4) u u45 4) ~L o 0 C 4 ) 4

0 0 ''0 v 0 0 0U~ ~ ~~ Uo.L U U

1.45 77

Page 258: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

4)

0

0

'4-0

I

.0

0 0if£

0 - L.a. 44

I- 4-0)w x 4

: a -.. 0. 4, -000V-3 4- Cx-J- -

4JL.0 -* L&J lego j 0 4L - V1 _ 0 -

2 a * .9c -- ulL. 1. 4- Q eCE -Q:: -l, E

-U 41 .0 _ L 0 40; 0 . r I- t..0L . C .J L- LL 0 C

0 4)a 0 0 i J -6 L . 041 0 L 0C 0. z1 z C1 - -0 '.

4j & C A - sC 0 0 0 0 .-- 0 0 4OoU 0-J - o 0 6.0 - V ) 014V-MC C 4 (A

14 0 -u . ( 41 m 41 L, t- L~0~ . 1 -t-t41 I U j 1 10. 0 c JI~~,

-0 0 z go c mC ILI. , 300. 4J 0) CL., -. I - 0 0 Z L4 4 J+ J+

2 a 0 L 4.2 1 o 41 2 ZC~ 3 .. v>.. -V LO 0. *K c .0 A000000000

" ca 1.. 4- 0. -C *

4" 4 i, - =E < Cl 2 -1 £ 0 401* ~ ~~ dc 411140. -i 0p 0 0 X. 441 11144

0 0 - W 0 M C4J C- .* 000

Ifl0.JU~JI 78

Page 259: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

44

'4.j

0)C0

004-

u4 0 .00C

'0@ 41Uc

4J CO LL.0 0o l 0 C4

u xN -iXEu

v' C0 'U to*- 41. LUC4 0) c 0 C

C - - V,0

0 J0 , %-ILI 0

L- 4J .0 1-4a4410 c 0 * ... U 0

4J0 c . -cL~c C CL

4J0 'V V'o j 0 C0CE.03'.0. U. - C -L. 4e(A 4C 0 .a 0 VCLCCwEI

41 .EC -. 3U.0WJ LC 4LU 10 0) < **.3Z 4

s 0 26.. - 9 0 -. 3 E-..a be C 0 -

CC Cr > E C0

2' 0--1 0. -< L

<a *C .30 +) C.CL. 0 Q. >3 -j 0.10

.3Cc -- 3C 03 C '-3 01 0 79

Page 260: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

41U 0

U 1 .N N

4x 0 .C

* 1 .

- 5mu a L6

0Z

o1 - I -

-0 L 4L L4. 4 .. 41 X4W1

04 4- -

o 41-00 Z 0 -;-0 0 C ). 0 3 C

0 . Z I .9 0 j . +

4J 41 z U N' LU 'o- 1. 4- 'g-'0-*-

C 04j 4-C414

1. 40 LWO I0 4414 C 1 0 41i c

4g. 04.1 U< 4J. 0. 4.4 > )- '4 414 -W- MI'g

-00 Wa0 - 4jJ 1041

atC < - c <0 C CU 4J.01.

IL U) >-

UL~~~~~ 8O~ .. 0441 44.

Page 261: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

*144

I

4.

0.

0

LU

4J

"o 4-

6M 61.6 4)

0 .0CU

6 C C

0

C r'.2

o 0.

-01 C

C- 2

- - . *a -

4 u "4J E

C' e 0 CE 4- -0 0 0 L 4C

C U 0 0 . .- 0

"C0C 4) . - 2 4 -U0 E 4J E 6 U

14.' ,a , ,,,,-, - -. -.

6. 0. Li.%4 l 0 ) E 14) " *...

.x 0C L C .C ~L1 . 0

0. L 0 0 4 )02 0 04) , 4J.,

-- ....4)...0 .)C 4J) 0C

*C2~~~ 01C 04lC

0 . 60 - --,6 -U02 6- D . C 6 .%CL *6

"- 01. 1.4)m<.) - I 14 .

U.0 E 4) ,V. 0 6 ".00CC4) .04 66 4 4J.

00I L. K - 81

0 vi 4) . C 1) L.1 C 4J b.L L4 C Z V 0 4) 4A)4

10 4 0 1' C C U it ~ ) 1. ..4) 1 ix IUD +j- *.0 -) 06 06.9 01CV 14J I4'0WI . 1. 0 e 6 . 0 VIVZ-01Mn

L 0 0l~f iU) 9 COW= -0 X 0 44 M-*41 CI 0(4ow-j U C C .. m

a 10 614< Ct. z c L I L.~ 3 Is *4 -. 4J 0. ;L -CI Q * 0. J 4J)L 4J 4).Q

41 03 3 0.4 £6 40 2 0- 0 U) . I -9 IL C- U0 0 0 n0 00

W Ii' *Z cc> 0

U O W (# W.) I UC WOJ C .. ) -i -im m

- 4KZ i -j(-i..J L. 41*9 < ~ =4c<C c0 M f4 C

z CL ~u u4 < .a

K -81

Page 262: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

'4CN,0

L .

E 4

* o 0 c .I

4- c 4 C

01 0 mL U) VA z

0 C~ 04) t004) uC -

0: V0 .. 4C 0 0

a- GI cc c 43 4V Vj 1 4 4J V1

o *E CC.0 0- c 0 0 0 0 0 0

4j s. AM - -0 -C C C C 43 440 141 I0 I6 I IiX~ ; u t Cu 4 e e

4 )3 Cm 4J3 mV C- 01 I * CL L

.0 0lL 01 c~ ML A4 A A0)41 L ZW 0C L IM I- 4I Z4

C -c C 0.0- C 0 0 0).04 0 00- UC O.C 11 0 Ic4 L ) L. L4JL L

C C0UC C C I I-m 0 V L 4J -O 0 4J

me 0E LC M* $1 I L4JA C m 1L 00) c 4J 4 3) 0. - 0)*M3J-a C.'. 0 E

A' 0 -4- A~ 2- *t" 04 --D . 4) 0-

0U CO L 00 L -3Z I C3. M 2 -gM ML MM0M 4C CC 4J C -4 -CC U CC. = mae4 - d JX 1C. X4 C Z 0) %4

c 0- )9 .3 C.1 0-J1 ) I1 C 0)LS L .3 C L C JML- .>V3 -. CJ C) 2-C C ... 4sO ) L . Q (A M E0 0 -E0 *-.3 -mAj o 4

a 5 C Gx 0 % CC -C a 14 CC *4-U 0 - .- c I M- -.L 0 UCOa( M V f L'0 C J CUL I4L AJ L - mC 0 C . 0C L) aoz C.2 cm. f IC 030 0 0-E -1r ,rr-v4 0 a cO 4 2q. j . LI 0 4U 2434 LC V -OV -1 U- U- 0-C. -5- -4--

C 0 C 4 0OL C0 CC V. WL CCL-. i-- IU C O C 4 1 LC00 Cm.CC. 0 41 .34 Ve JU . C0 FCL -C.4xC4xC.ftC(ACI

U . C C0 E- C X 118 IVC. 0) C .5 C100 L 0. 43 u u uLCLX O gm V m0 VJ.l C 0 cLC.L - -- Q 0. 0 C 2 0Cr03 6 --t IS O.C.CCC. 0) 0a U1 0 C o. LLL '.L

*~4 .9 C C 43.5 40.L CCC 4J '' . CJ 436 C0 C1 43 C* ~ ~ ~ ~ ~ ~ ~ ~ 1 t- 0. 0- E m -. Cm----------- 0) mm 0) m) 0) 0

C3 01 LO-t .' IU L LLLL LO 0 00 0D 00 0 30 0N U U.3O12 m.5 - C LO CCMm m m m aSd ~ ~ U 3 Z3~ A ix C > L' L L L L

L w LO U0O1C J I .33 L I- 0 0 00 0<= <,50 Mwa. CUO 0.3)o41 ~ ~ a ua

'aZo uu <j a > ~ C3 111111.

* C.L-..ML 4- V .- fl 3.33.35.3824

Page 263: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

LU4)

L

c

1-

-04) L

4101

mm 0

L

L) 0 C

4J 4

a l0

L Ls

01 01 0

00 0,0-1

K -83

Page 264: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

-I.0

*n -v -4

* 1 +a

4; U) 4J*) 4J1

I xi I m4J+

a C z4

X 0. .1 + 4;4a LO 4J - .. 4- 4- - 4E 41.0 41 C LC0 - 4) t34 4

0 ac C +3 CA -3 w3 + 3

) Li E0 C 4J CCC C4 0- 41 "c - 4134 4 1

4J 03 M C t "C-- -- 4J - 0 "-Ct.41 C 4- V c*- CO C CJ C1 CJ4 4

c3 I., om +3 - 4L<1l x c i 0 1ML' l_'CD, cvz 0m C441 C+ 4J " +3 +30 Sc ff a.C+ +)3 4- 4-

a 1 Lc +' 3 J 1 *C 4~ 41 41 41J

L. 0 4 0CL C W-.a W1C - - ) - -a C. 0- 3 -0 -I4 CW -C C A- A A 4

%. x0 Li I. - V U)" U4a c 10 0t _0 . I V ci- 013 41 4 41 m41

40 E M- 4J41 -a I1't 0 -0 0-C 4) 41 41 410a o + 0

x 0,- 4' Z4 - U4) C O 3L. (3 :3 +3 M+3- Uo 0.41 IC mL 4 . 0 1 Crt -J. -e -. -. 6 -

a .( Di .LJL -' I1 V.C 4414 +3-I-= toa. I m 0IV 4(a 0mt mma9 vi x aE3 =g Z41_ C0 U UL C> Cv o)L _ )4 Y 0cz00-.4a4 2. ci C- *- 0I O K JL- t).1.)-+ L -I M CtLL3 MLMML .4

a 4 . 024 1 +3-+3 - -4 1- 4 4 J -I4J. 1El 0D001( -l E0 UE0-E. .a lf + - .X +c -4j..~ 4-w +33+ M 5-. O 4 J03 c 4a . c- *1 .rC M4 I L VI - C4 a J .0 044 41 0 .

a C. 0+1-t 4a aUU.- 10 C0 V m3 CJ 41-) 4a1 o 0a im 1 c 0 1+0- L t I C c) 0 0+

a J C.g -J -Z 'D + 0*. r" 1C 41J 4)1"" 4J *. *"- -n I n t* c L 0 :- C t.- iC Ut-4 +O; ,1 C+4)) 0m C +3 mOa 0. co U Sc -J.04 10 Ii+4," 0.o4 0 0. CO -* 4 0V .41- 41 .. 41 +3I1A.c - -m to. U- C. O--CM"*M0 4

a . o C2 0 w1 40. Wc. 14"+0. ctc O4 41 41 0410t.4100tom oa1 0 a c C to 4j 0-.j14Ul Ca -41' 4jx411+CL41 0a4.141a41C

a 04 '-.o -4 410 .1 L - 'eJM 0 - I a4a1-114I 41" .aJ. o~ o. 0t+ 0

* x 0132 4 L 41- t."V + 0 Lr 3 3 L3 Z- +3 03 41 ' . . ovmgu n- . 2> E~'-+ 0 .+ E 60 a-U -'4 - ml'. C3 OO C +3 C

a t.C41 lea. +3 < - 4-1 4 il II0V4C4.31 -- . 0 4a .+30 E .0+ 0C CS4J'---C4- U. U 0 C

W oC o. -C1 +3U 414 = c ~-4ia 3 cg .1C 41 ".9 C 41 s " aa 144 4 1 4

<C a <3C-+* 4c < e C0 MI 4J----1 a va t v ia CL0 U 'c- C us -a 1+30 Ltt4LLtc (A0 0

+3 00 1u1u+ +3 *"V+3 - +flK "8441 .C 441 .UU U U U U

Page 265: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

/q,

410

4J. 41

fro

41 C 4

4 41

S1.. 0 0

1 4J m1 44.

• - - 41 C 114 C41 ul 4.

4.)~' 6- +) 4-1 4

C C 4 0 C

u u0 - 41 O-

C 6 L V 41 41

0, 0 4J O-- (4 LJ 4O E a. c -- 41 1 L II

+1- - 41t - 0-- 4) 0 .-

00 "

4J L. -0 4 0+ )i ;:0.4,,' - 1 41 41- ,- +1 +i ) ,, 1 r.C +C 4-*41 10 +

U.) , .1 0 n m04 1 U "n +0 4J

C CU 4c In q)4 E In n

J 4 Q It 4, 4 4 0 c m I 44. U- -, t - 411 - - 4- 1- x f, c I

vi 41 c c u1 - 0410 .t - 1 1 -- 0 t4 XII-

0 . oo . 0 0 -a. 4 ,.

41 41c 41 410 1)d C.1 41 411 C1 1 4) 01 LC _t4)1

41 41 1+1 41 0- 0 01 4J 4JE._j 4j In. t 41 CO- 4J 1 41 41 E1. 4- 4- M I C

. f 4 . ) m 41 C . V c 0 0 o O1 -1 -

. -K) - - In 15

_V ' -- 0m c4J : j +.~ L4 L

- 0C. S.. I- L .J - 0 -. 4 In C 4J 0:D L L0 Ma. 414 4110 0 0I 41 0 (C0 -4J Z CL1 1 -

41 In V -1 W1 -k c+1 4-h I a-C; m it 41 m In 4" 4 - 1 1 ')In I L -L t4m 1 0) C L0 _0iC _ C 11 11 4J 4M ( 0* 0* 41 41 *+1C . 0 0 -4 *19 J LM M M 1

(D c.. 0-~s 0 41 41. *4 II .- .o. 0.+1m-401 m. CO~ CC CJ 1 CL 01 In4J4 4-14) - 4)

41 42 I+'.- 0J 4J 412 'O1-00 Z -I L3t I In . 4-1 If IIII.. 41.. ..+ * - 41 M L .) 41x 44) 4.1 +1 0

4 4- -4 V L. It=.

4.M 0~ .. I0 0 - C1 4 4 ) 41 4 -- 0 1. C 01 (1. - __ -C0.410A m1 o4'' In. 41 +1C 1 C440 4 1) 4) .. 1 -

.M41~! 4J4 L0 - 0 01 00 C 41C.+ 0. . . . . 4.9~0 c m.111 m (n 4)J co 0 .+ 0 C -4J 04 - L 0~ +jI 'A

0.+1. IS 41-414+j 41 4 w - 0 -0 O - u1 ki 0- -4 1 4-1 0. 0

lk 41 0 0 0 = 1 - 4) L~ 01 C . Oil 4.1 Z 015 0 1. >..1 0 41 4-C 0i-x + in-11 C- 0 0 U . 0. 1.I 1. .

41 j 0 000 2 41 0.--O. l- +1 < 1 ~ 4. 44 -) 10 IU

41 C I II 41 141+ 0 1 .L. 0 u1~ 1 4I 4 -- 4

U ~ ~ ~ ~ ~ ~ < L-10 0 0 C 4 1 11 + -1 4 4 0 J0 0 -- 4C 4 4 .C 41~ 4 CO -- >-1 1. - 4 .

* 1 +1~1La1.+1 (~)4 40 850 1

I.. ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ., -%A.C 0 11 C ~ 0 0 4 *11- 14) 4 1

Page 266: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

I

V. °

44

41 i441

0 u

c 0)

jfe- < o",f, o ,

4)4

u4@ @ In,,,

2.., -- - .c "

+44 0041 E

4 0L

Ju 4 .) 41 ) , - - .it .c - n .. - . ,

..- C " "0 M "o " ]- )' " U e

c) c/1 Ef ' i 1 Z c • e J 0c D

4 c

.4. )4 .4.

0. - 4 0-l 4,.o - - c I - +c , + o , ) ,iI%. e a to "1 * . C. 4- Z D <

4J 3. 4c4)o 0 4J L

^ i 4 -n ,1 0 0 " 0 0 3. z .. -I N. 4) C 4 1 2

" ) In 4) . c

" 0

.3--- x -- -. .. Z1 141 L>. n

L L L 0 0) . ML,_1

0 in In 4) C C n 0 ML 1 4J le 41 4Jat

I I It 1 44 C - to

41 4- 4 4) C, ) ,4".'4,-, -( .. ,

q -*i (A 0 1 *. 4) If C- 04)E 4) C 0 1 +n 1 ,>w>L ) IMC 0 Ill II ) I i' t -LM 04 - 0 4J 4J 4L 4L 4-

L. L.C L1 C 4J L L M4 Lwj 1 lu uLM -0 111f m2. 14 111 ) .4. C 4 alI mlI. z AlL011L4 o J4

0 0. 4) 1)*0 Ct 41 c OICO c D~ L U ofc (U4 i 4)CJOr-C ICC it In -4 +0 m *. - OLC00

* 0 . 14 )- 3 . C C 4 L .0 41 m4) ^ *0. in-- 0~V 0 0 .I 0' 0 0 )+4 I )1 1 1 L L 111

4)L InC 14 ... (1 0 0 " 111 u. 14 LOI/ 0 01In I-- 4 fn 4) t- -x t- wn ~ (n I4 LO J 4) ).

4)1 In-n~ -VI4 Z) C 4j 1) 141 CC 4- 400

it In Q 1141 0s :D 1- II11 4.. 44 In04L J I- -0.C0.0> E. -C- W.- +J 4- 1 L)*1 In CO 4III.

4- ~ ~ ~ ~ ~ ~ ~ c w0~ LC L <) In L 41C n 4 1...

L4- LL 4J L L 4 C 4 0.0 01 LO 41 n

41

L.J4J+1Z CL+ L). u+ > 020- U. (A+ L CC1

4- ~~ ~ 4 L 141 u LJ 414 414 4)/t.~186

-~ ~ 0In00 -. ' 1 4.0 *4~ CC 4II

Page 267: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

!,• ,. . _.. . .- .. .. ...- -. -'. -, , I., ... " -''- - -,: .-...b , -. . ...- .-..

Nb"o " .N .L

N, -N N

!1 u . 0 l

". Ll C4dci1 - c 4

4N1 Ll

0 )4 In m c 4)... . -Y u ] u 4 , )

- 4J (0 0 01 a) + ) z L"

Nc +3 N' xi 0 4)4

,i.- 0. 0 - - 4) 4J1- 0 c"NU C .- 4 N L I

N L3 N0

0 0 t L 4) 4- - I / L 1 4 0 N C

N E, 4N L-b ) 4 J 3

N) N- +3 In i X 0 L.

S"41 '0 " LD 3 4)u (AI 4)L -. - ( c .L i L L 4- In 4-)

N j C c- N) L ) LM -.- 0 m+ )c 0 2)m m1 0 4) 1) 4L- 1 I J Md4

-0 L > L- N L n I c ) L .0

InNo 4 C 0 z N 41 0 ) - 4J4)4

4) N- 0 L CO . 0.9 U) IV if u c 0 N . L 0 L C 0 it= ) M . . to L 0 M L M I L 0. 2

N .0 CaO0 0 0) 4N E0 ) 0 f -f 4 I

1 41 N u L. 0. 4 M .. JL CL N -

I L N C 4 C .I I L 4J L 0 L.

11 ~ ~ * , 1-, , ", tv Ll . -- - m" c - "0 4.) to -- .- to-g -

4J . . - v1_

NC 0 L0v-- 1 ) o mN. ).,a4 )1 L CNl 0. 1 I LC C) 1 0 L E- C- i 0 InA4

1 IA N. a C C.0 IX 0 0 J W-4 it 0 0 ."a 0 L- It L. 0 0 f1 0 Lt -Y. N C +3- E- 4

N ,0 i+30 .J +"

3. 4'-.. C -0 +3.J O 0-, E m W -j + U - 0

4.1 ) -020 0 _0 < N 0 m D

Nl 04 &00)< 0 I .- J 0 1 X L..04J- u N C CW 1o +3 4)+1

m 0 0 L * v - N 0

Ni3°-l M+ - C*.: 21

In 2 CQ. "- 0 A C- 4-" - C L - 14

'NN 0-4 LC <- 4-~ -'2 -W 4N 0.

"0 0 2+ 4-- 0 1. JAI HO> 0N ) L 10 1) *- 0 +C1+ 0 n .M C 1

N +3 C 0 0)2i= 0 L0 Sw 0- 0i j =3 = 0 0c C 0+3 -10 0 0 430 -+3g -C 0. N 0 +3 m~ 0 I-

N,, . 0 .. C .0. . . _ . .... . . .II,..CU.. ..N , C. 0 .. - .. . .. .. .

N -L 0 u 3 L L 2C E3C 0n - 0N oL j 4t In L

S N MZC CL + 0 CZO 00 C 0-+87

Page 268: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

Al

ii

. .

40

0a

-'.-

"L

aV

la°a

Ia

Z L

,%. t C

a

iD 0 U 0- 4J

a"a

X) ) 4- .) 0.

it 4J 4) M, M- -- -. M M0% L C3 11 0 J -4-. 4

U oo -0 0) (A--. ,-"0 1 E.4t CL 4) v- C _ I - 0

•0 41) 4)€) € 0 ¢> L MY, tn (A In"l A "0 c

c 49 11O 0 00 a,-' "0 i" v1 ,)',-."Il 4-- IV) W{ - Z 1 0. -- -- - L . . .

I ~ ~ 41 .. c 9 I I -. 4) 4J If!-, ) C:

,) _Y d- 0 y 4- --a- c 4+

m IX >W U In 4.

. >,

'"" IP ~ I < <- < -- 41*- - +)j. -

- 88

v " '....''" .... 'i .i .". . . .. - " i "."''" " . . - ,. _.. .- .-- -." .' - - ' "- - :" ' " " - '

Page 269: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

4-

.0

4A'

10

U - .- .

16 0 - 4

0 40 L 4 .)L

4- 4) , 41

4) 4J C 4) +)

fa 0 0-

c 0

0 ) L +j 4J - 4J )E u- 0 mc0 0) 0. 0 0

4j x 0 LI0.. L.I

L....

o .. *+.

to) 0. E4 4) - 4-) J -

> L4 C .°) UL0 1 . +

0 0 c 0 - j 4) 4

J 0 - €) 1 4)

M))0 0 4 - I "c 2.-0 01 4J M 4) 11 1 . . o, m.

41 .I- +A 4- . -4) -.i 0 u 0.. L 4J 2-3X +)

'40 0 4.'1 4) : 1. 4-

U C Z 'a3 0" 0

1. 40 . I 1 LLL.. L .01/I 4) 0 .4) 00000.0

;w 0 n 0 0 0 0 to1 I A f40

L. 4.AJ- L0. 4 L ~4 '0 =. LLL.L

"-'' COC C 0 C L -

0) mm 2 0 + -" = * 0 E =3m4> E- 0 ) ,-- u W C E L. c. - m 0 0 0 00

-M1 ca) < L *4.04'.C OU. Z >0 0 ) .1

V) C0 Ia.- C 4. 4t 0 LL L L

• CL U u a E tn -.) 589

'- 4).0 0,(,.CLU - C- 0000 -

.-,'- 2 ef. 1OLU...ia - C 0). -- t. .J1 OJ . l' ," '0 10 4) 0 C Z) 0 . I L" • . s =

.. u E~L 0 .0 {nr

, 4 .) E. nV n ln v

.. ... • *..".s*., .. *z-9"9 .9....

Page 270: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

U -

04J, C .QCi -J4 .0 C 0

04 0)~ U

. 0C0. 1-

4- M m u 4

N4 4J +3t

L2 - I 0

No 0 WI j E*4)LM4Z.0 LI

41 0..'-C 0C 0 4 4

-e LX4 M 41 i-I'44) 4) 0 0"000C4 a- L4JW04UWup 0 N

0~ 4) M- 0M4M0)0Ot La W m

4J 0. 4) .. M .*uC4)0- to mz a 4 .

0 4JL M 1 c i .. )C 0 UW+. :1. 4

0L 0 4) WI 4Jc c4) +

4J 41 J 0 - 1. -1 0 -C 0 30 U -40')- 0. L j( . I Iu 1-0 . .L00 0 ~ 1. WIL WI m*n. -j

o 41 L0 C + I z 0. 0 m

E.IC 0. ~ 0.141 - 17 C. - CJ - .. M 04-L. 0 41U V I J 4-'M M 0.0 TZ UCL- C

L0 IU 0 41~ L.f 0.- 0 NLCh 0 0-IM 14 0 SW - .8 C. lICK CLNL - n 0 Iif l 11--

10 .1)0 1.0 ** >u - WI4 cC 4) .. . 4 .C L 41) 0L4m l 0. U L NZ 04 ) I C

0a > a . V9)4) 3 (A U) .. IIIN (nN 1. 0 J- 0.-0 TUZ.so 0 . C- 0. 0- ow .. 4 041 a' * 0 0 .4)-

1-4( 9-~ '> 0 L #A L 1l In 0 I . ::41 U C* 0 4) mLU 9) 4) 0. ~ )** U 01

L ~ ) C- L 0) 4 1 4 4 V) 4J CL . L-\ N A 0-oo V 6.I41 ul .1.4 W' L. W -U 0-0 WW 0 * - U JII- 11 0. 000.4)

E50 414 0.0 0- 4 0) 0- 0I x 00 + )0o +-.W inl- () 11I

1. L~0 L - CO .C z0 WI LW .* WLt' .0 W41 I

~~40. 4)01 . . C -0 0<4 CW-OII t''- --. 0-.4 4)4 _1j 0~ U U UI4 C 04 WWC 34- 0-

00u cI b (fl VI <' '0 - 0LIM x)~ C-II 4 -4-141 10 4) '41 0 WI XJ 4- L0 -1. C

a m 4)1 4J 4 Z 0 00

Za COOt 1 4) 1 'A' LEM

K-90

Page 271: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

6;t

0.

M441

m 41 ~~~o.a t;J 4 4

a 0 - 1 0.0.

V a IL .0- . a 7 a t0N~~~4 4141kDt- 0 +I

L. 0 * L-- - -N 11 H 10 = - . * Q# -0 -

u W CN ac1 *uIL 1-Lfl L sa t. O. z0 -.4J 1 -41

0 1 j. a 0 J:Wlw V In a. L. IAin0. 0.k_j lz L .0. ej 4 N m4 A .4 44. .44

C - . . 2-4) -.c 44 040 a. -amIW A.

w W 4- L 111 0tA *0 ca.A a

*M ,0 w= - L*.=0.4 1441 -A4 II t-S i

44- C L

K - 91

Page 272: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

4a 41

0 0.3 -1

-a 0 0

02-C - 0-204

4J CO4J. c3

0C MxI 3)_rLa. .I, 4 J -

0. 0.3 4J 41

Lj 0) 4J L I 0 ,cc * aC 0 -+j3.

Uj -0 0ac002 1 .4j 0 V. f c zo c0 a 04

0 010 +*III-n0Cc LE 0- Cso . 0 ** 4 - :

I.. U t. C00 L ) W* 0 ( 1 . 0' - C- :

a ,, m-Ato-- - c0 L0 . to 4)

to 1R4 01. -CCCr. 010 U F-0C- 4

do 10 .3 00

z1.m w f

.30+30 . - 0 1 - 00 --1mto 414C 4c1.I =)< x 402

0C, >+ - j 0U U_

+3-1.~~CK 92 01

Page 273: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

4..1

-S -C

a E a 4a a E

a c a 0

a L

a1 j 00J .

a4 41 a +) m -0 * a o ( Q - CL

4C ) -t -- J4 4 JX

a C4J 0 a In .a - c ) 4) 4) 1

X L 0 In 11

0 0 0 a 0 1 Z:- %I.

a 0 0 4)if 4 0 0 C mI 4 0.41)44a Idc04 -o aJ 4 4- = - IC

a. z~. 0) *) to 4) ... a -. 4'4a -1 01 4J W4 a 44- L .(L' -1A4 0 x

a 250. 0 -'.4 . a 4- 0 *-4 £* -.a ' '*-. * c 0 .' -J ..

a 0 M - - e. - - .2 49 0. .41 .- J 4-~ tOa 0 --0 V .) aJ Z. 4J ) 4) 0Em04 0 4J-J 4e- tM ..

4a 4.4 - CJ II 4. 1 ZC cC :' C JC4

C . 4) -(i) 41- c .c U) U4) UJc c J0az C~ -*4V 01 49 Z 0i L 0) C Q0 - J

)C4 - C.i - O ~ c a 4J - C )L04- . 3- 0.4- 04a1 is x 4.) 4) *4 04 ac 0 4.I.£ l ( 0 - *.' ..- ...

0 .0 ow 4. 0 a 4J4 Zc -0 - .> 41..

4J 01 ;:. 4t 44- _ c W 4.' - 4 -:-a c ) W - 4 10. m vici aw M W) 4.' - I 4 .

a O - c c.. w < 4) M ) .' W4J a .- - L 4.' V I 0. a 4J.0 n .L L

a J_>00 - XS C) 5c.0 0 c a 4 U 0 .0 0; M0 <W 0.0 .a c e 0 ' 4-a.- 0 ..0 > (/) - u (A In 0. 4-- ~ 4'

0 4.o4 I- w.*.. <~. aJ 4. 0 044) 0.w *.<WIl 01 . .Z*- '4- > 1 . 0. w >- '4-

* ) - n .1 0 0 4 . i 44' (A0 In 4 04 4 .' 0 4 J.a -. J4) -i 00 u Z c 0 a .c ) ')'. I.. -1 34

w ai I 1 - 1 u 4)4 L 01 - . IX 1 2.1 (3W -.1U Z=C a 4 ZOC .C. 0a' .4J zo Itl <0 m4 < L 34

* 1 aQ 4£ 4 -. 1 0a IA ~ Z.~ CL U4 u- < ) 4 >-0 -1* 0-

* .. ' .~4 4 4) 0-'--0 a oc .4. 4.0) C)4 093-

Page 274: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

* 4

4 4 1

10 z 4 4 4

3C 44 4

4-1 I 4 4 M

in X) 4J 4C

*V 4J4)4 41

'SC A Cj 4' 4

41 A 0 0-14' S 4 2 4

I-- %A4 I1 4 I C C4I 4- 4'j(AuI .

-1 w J 4 1 - 2. 'A4 4V), J C; 34 0 -j L 4 C t

44 3C4 0 C 0U -: z ; z

<4 I C414 3 L04 J3 00 1 45. 4' 4 0 Ng 1. 4

W 4J -1 0 4) 4 L. CC.:- 4J ) 4) W 44 4 J

8 4' 0 UC- M 4-C C- I 4J4Cc 3) *- 0 44 4' 4' 4'.- 4 40

oC 00 C. -3 Cii 4 34 0L 41 a 1 4' *a Z C C 4 t4 MU 4 4 4. - 4

4' 3~ 'a r -4' C~ 4 .0. CC 4- 4 M4' - C- 0C Q. 0 4 C1 4' WI) 4 0 CC 4 00.-0

* 4' 4'CC4 0 4- L 4' 4 4) 04 Cd4 4COC~~ C I Cd) -) 34L 3 .- ' - L 441. I'-. 4 C

A) 0. 44' 4s" 4J 4,7 -1 : 4' 0A "2' 4 U 4I~4 3. 4' W -j 4'I 4- 0.. W- 4W 0 44.4' 0-3 C St 3 4' 0- 4< C CC fl3 4A0

S. CJ 041 Ck 09 C- L 0 '- .04d -- 4' CQ6 -) +1 0 -4D 0 0- 9- ) .4 064 4 4- 4)

4-1 = >. 0- Ln 4- Cf. 4 4' 4' 0 4- 44) -0 4c 3 0 0

'S~~~ Co L L 4J4 40 4) 4'0 4' ) ' 4 4- 4

-~~ CL 0.0 -1 Cm 4 (.. C6L3 C t'0 C3 4a m

N, 4 CO L CC- -C. C. 4 nZCLU

L 4' 4 St~~~4' )C '-4 4L 4

Page 275: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

*11

z' a..

4S 4)L

L. 4 4J4

C 41114100

*1 L 1

In +4 L0 4

0. C1 +- -

0C 4- 4 I

U L I 0 4

L 4) C4) 4J 4-4

'I-. C 411 I +C3) C42

+- L0 L1ct .1 . C1 4)

N S if 4.

0 ) 00 -u' u c -u J 4 -4 J +)4

C U Z 4 4- +1 +) 4J M. 4* I. 4.1. - 01 (-0 -) - )

4- 04 0-4 L 4) -J - 4J41 0, 4. 41 ;I_ a Y . x- 4-. .. .

L- -j -; IS* S S -. C

*0 0.- AtL..- 0- 41 -

5 4 C 4C CI 4- C 4J 4- 4*-C 4, L C 4 I4 i

4j L - 2.. 0 14 LCCV .41t =4-. . 3 0+ 4-0+).J 4 41 V) 5+40-0 1g 41LX>I0H 43 V4JC U Z1 Z4

C~~4 C 40 :u2:4 4 44.1 4CJ#" CL 1 41 U U U U U 41 34 C- 14 4+ + 1 *. 4 X

a u) L 0 --14 0.4J-~4 C 4J 47

1A 0 L 0VC C-- mo--) L LL 4 .4)f

.0 CAOo0 u0u 4 4J C' 411'441'V41- 4C 42 c0 L0 OC UU Z -CZC- a a) 1

0 0 . Ca 412 LXI 1 0La'L& a 041 0

* I- c.11 51 z v 0 N -I W 411 4.Or.0 41 4141 'D 41 ." .4- C~ ".M a0.4 41V LV 0. 0 1 4 C C' 1 AnC CC' in O) m Caa01 4

*410 . 1. u' 4J01l 11. C 2--acow1 41 0 ^14- 4-41L L 0 -a1-4444.0) C O C S .J ,au.sC[ V4 C4 41f..14 1 CJ- u u u ~ - L

2C5~~~~t L 4- 54 J 4C1C-~ ' 0f41 4 L C1Z U1IUIU If1C LV1 141 1 m91 4-4

4, 41 '.0410) - L U U U U U U U U '+014 40 I4 1LJ 11

4.0 Scow I c 1. 0 4Lc 4L "1111 .- Sw..1 41C c +113 C41 -c3-C 13

C LZ - L I41 -- 4 a)a 4-~ ~~~ -. 4 I 55. 041 L L L : L 0LL4 2-44

0 m541 ZCC4-)3 0a.3 0 0ao.3 3 aaul- w1 - OL C-U-- 11 4-4-- ) 4-4- 04-4- 0 W4-

CKI v4

41 0.~ 4

<0 ~ 4 4J 4C4

K-95

Page 276: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

* E.

0-f +,. 0

o1 C 41 E

*Q EU341 C L C . 1

0* L. 3 ) 4 Jf 41 4

L C1 L 41-1 L 1 3CM0 1.0 0 n _jg . 4j Q )0 e44.0 03 0 + 0 4M 3J '01A u0-41 Z 41 C A 0 Co

C c - -7 -141 * I1 CJ 4- !' -'- o- 0LV 4- Of2

L. 41 4 * C JE 10 C L41 0 C1 -i L * L to141

1. 1 1 36 Ct6 if01 *. 111 L t+4Y-+Im L . 4 .o ) 4 1 C 1 -%01 El0 0.0.0 'N 3 41 4-

4* C . 4 - - -04. 4 - If0 04 ., to 4 . 4 14(. 41A

% 0 .0 3 c. 4 01 .5 0410 V104 0. D E!, - +JuV ~

1 - Z CC 0C. 0bJ' - L +L o i 1A& 0 C eL. 4-i z .4.+ 0-- WCC

o J 4 L. % .2 *0 it %4 NI 0 4. I L -lE aI+ -

v +A 0. 0C L1 -%.1 4 EE) 1L C 10 41 cC C 1 C '01 mV 341*414)1cE 0 )C a. L. - C U- 0.

4441Z 0. 0 O § 0- *0 6+- LCL 04Z L IIL34 014 0 14 . V1 0- U.9Q 3 C 0.L.(1-010 1 .o 4 a) 01.04- O x -4.. 04 44--4--Q 1

14 0 0 0.41 41 Ca I u3 J WL -J 3 ) 4 C C 4104 4CL 4-E+

o 6 04- WJ 0 1 A 44E 41.4 41* 04- -o C)E L CZC CO C 41 31at

M J- 6C - o3 I- a l E- -) ul a- 4

*0 40 41 .4 N fAC 1-4 a. a -. 3-2 T A .414 3111 -r- I-r4--i0 1 L+ 0-C O 4-4 a 401400 a .C 416 V 410 4*. C. - S

CW ) wbC 1 1. C *. ,* ~ ~~ 41g1 Z -S 0 1600 41) *1 r L.C

1Cm4C0 0C *. 0 401 - 0.1 4-

30 -4L U U 4 11 31.

0.41La.-.UC cii CUE. 41C96

Page 277: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

-S1

41 4

N 0 N 0

* N -

N 41 it

V It

N~4 0.N-0 +N C x

0, L 0

N 4). N i

N1 U m1N I

L 0 N 4

1 4) 4N 41(A - 441 N) EN "0 VI 1 41 4 J C) C

NL 0 1 I+NI ). 0 0N 01 0. 41 Nh 1:.

N 0 43 C1 > Cq -- 00 0. 0 4c NA6 4 0 0 0 4) C

N40 4 4J L. 41 41-043 3 - J 4- 4t z 41 4-- I. -

L I- (U 04 - 1~ 4- 4.NtL 4) 4. -- 3E 41 -X 4JN 0f 'o 0. I CL I L N I. 4341 43m

to +0 +) 0\ 4J1 N Z 0 43 0 4J Q .

N 1 3 0. c 0 C 0 N 4 0 V) I-1 )Q 00 4.. VI 0. +) 4J N0 0. L C C3 4

N. -1 0.4 0. W1 41 N1 it 4) inil -E 0 )04 0 0 - L 4- ) 0 .00 C. 4) C41 44. c3 43 b L. 3 C A 4 4 41 C 0 L c (nV

N 4144 0.. m.' V4 N1 M 4 M1 lz0c4 4 J (**4)(41naN 2 0 - C. I. 0 I 1 4 0 .a) 0 44 - 4 - -L. 0 -4-Y A 4 ) M -2 1- M 40N C41 401 o L 0 L C 0. 3 > 4 4 4.) 4- ~ L LuN - 0 4 430. C 04 1 a.Zo 0 41 >N 0 01 (- 4 4144J 4.44

N 43 E V - - 0 t V E 0 j V 43in dI L14) 4- 4 100UL L. 0 N 04 - 0 4J 4N 0.4 0 .034 0 0.L En(n^

.F N o 4 . 0. 0z -4 4.t 1 0 i 0 . ca 4-4 3 11 0-40 41 CLL 41 I. N O' - . z o 4114 .. 41 <n -3 1 41)3 UU0

N VI0I -41 4) 0-4 U1 it N 04-1*1 41 0 0 00 0 FN Ix 41 C . VI- L C M ) 'D N- *i CO- > . C- Li L 4 1 4 41M-0 L go14 ZOJ 0 4 0. it .0 w in I <ZO 03-+144 )in

N ~ ~ 4 4101.. 00 CI 00 0) + 44- N 0 4.4-n 0 0 0* ~ ~ ~ 0 43j o I0L " ** LC w4 Li)- N 41!4 - 41 U44-LUU

UN -4 -410 0. 00 0.. 0. 41 Ni Du10 4 1.4t ac N 44- 14 (fl4 u E- x 4= -j Np 044 1 L) M.0 L 114-

N 1L0414fl 41 114J3 D.) <. W < EL U 0 ' 410 -4Jn..* ~ ~~ 9L N 41 CAfl..4 z3 Ua- Q u1 Nt (1 (nfW.. (A 1

SI N ~ 0 ~Z ~ 4)~~ ~ N LO 41~m 41 ~414974

Page 278: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

II

L 4LI

e~ Um

L L. ) -. 4

I I - I t >

3 L L 0 02L

*0 0. .

0 00 00GE u 2

* 414.. -1.98

Page 279: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

4

4 4

4 - L0 4 40

It 4 4 00

1 41 4 4

4i C0 0 44 c t

L4 41 IC a 4

0 v 4 C

go C 0. 4 4 4- 0a 0 4 4) 4 - U 4 U

V 0. c 04 . 0. a U C 4 0 4 41 0cQxc z0c4 I 0 - 4.r - 4

- * 4 4 I I

4 W 41 tq (j 4 W4. -6 Ve 44 L. W VL3u

in 4I )O 41 m< WO 0JIc< o

ON c - <) 4 comc <z a- 4 L -< Z CC .9 0 L 4 .L w4 C z(

40 m;4 0 0 :D- (L - ='

> C W41 CV - w v > C ) 0-e 00 4

4 .o 4 4 U4 'A In Ua W 0

a. 4 C . Z CZ > w .. 4) wL.J

V 0) a 4 U 0 0 4it

U W 4w x~ 0 0 4.) x C m . x 0

S - w 0 U1 41 M) 0 L-i- I * w C (L- iXwiiu J ;4 4- 0 1 a C X 4 4) U u

41 Q0 4 'A) 41 41 4 4) 414 U

IA 4 0. u O w < >O CO .0 Z C. CO j LWu > i4

I- CO ZO 0.4 4C ZC 0 4 C ZC99

Page 280: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

-* 4J

) 4 )* 4 1

4 4

it 44 4

44 -J 0 0

0 C. 41 44c L- Z! 4 0--'

4 01 41 Q.444 41- 40 4 .(

4 C ..J 4 L

0 0 0 4,+ 444

* 1 4l 3 41 4 0 L40

m U 4 41 U 4 0

CL M C CC 4 1441 4 0 . I I 4J+ 4it 4 5 D .. j 4) CO 3 4 U C I4 VJJ )C 7 0

z 41 41 CL c 0j44 0 -0. c 41 u 0 0 0

a * U E1 43 - C 4E4J it +1 +j A 4 (AuC c 4

L) * 4 4 0 c - U Ct 4J* m. 0 LJ( 'C4 L 3J u .0 0 - 4- 4c 3 +)3 4- ( 4

41 4 I 4) < au3 . ) < z c 0 ..- a mC ( 0 . C L W. 0 41 -w , 4 C L I= L <N im 0 41 ; '0 .. >- 0 aD u3 a.0. N;

W. Z t d .> ) 4-'4- 2: 4) L - m - 4 01 >- )F

m * 4 0 2o 4- 0U L it L) c -u 0 A Q cm i.. t 41 .. CC 4 >- C. 4 0 L C.Z

C ol 4j V C 00 4icc0 0 4- 41 0.0u ) "O 0w 00 1- t WCL-i= )< Iu CL 4j 41 M 4 <1 D t-

- 4% 41 U 1 C +31 u C. 4-) 4 ex. - j 0= j1 U o m<3 m < 0 w U 00 4 0. 41 41=< = ' u

U I- 4 U < -J .0 414 4 U u41 41 UO 1.~u <> J . 4

41~ ~~~~ ~~ Z100 + I 4 3 CI 4 U 4

Page 281: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

- b - -. - - . . - - - - . - - . - . -

4x C4-4

-X 4444 4J44

4J 4JC L

44 44

v 410.Q

4)4 0 IA C4V 4-

4 u 4 C 41104) 4l 0 C4--16 z

0 0 4 ) 4-u-

4 4 LLII

4 4 0 0xCc

4 - 4) 5-44 044 L -04-4. L

4 +. 4 4) 0+3+3504 . D 4 4 -+3 +)CCL

w 3 L4 0 c LL+31

4 1 0 4 t4-4-44 L- 4 0o ) .

it M 440 2 i 4J 40 0 0) C ~l

'- 4 . c4 0 a. ) 4 03 C 401 -O1C*2 40 4 J C 4 4 C 4 X +3e

4c?-~ D 4 43 0 0 D 4) 00)4 0 - 4 +

4 u C3 C- 4 0L 0 0 5EVV- U W En A 4- +3 M W (A 41Hto 4f V) 4a Uj 0 1 +j M 0o< CC:4 4

(a04 a 40 .< C Zl 4 -I-4.- 4 CQ 4) 4Z...- 4) 4J)L 0E4. )

0 .0 (n 4) _ 0 4 C ' .>.. L 0.4L4 L-jf .. 04 UL U "V 4- (V) 4_ 4) 4 40Wa 4 eni L- U 0 4 4 C C w" I)4

ZL 4W CO 0 91 UU 4. "0 w > 0-) 4 -% .C *) I.0 w 014J VC

woo-- 4 +3 UU V) .0 w 14 0. C 4

6-j- 0 -A u ~ fu W U U oz *-)C . C

= 4( <l=3C CZ0 to L 4c iAIC ZO C0 "-

o L OU W > t - i 4- 4 4)fl40 >-J WJ W/ 31 4L

Page 282: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

-i - -4

- --. - .

it-Iti

N - L

41 41

a L-4J 4Ja

a a

a a 41a

it 0 aL-

a 4) a C aa 0 L. a0 0a

04)- a 0LJ a 4J 0v

it a 0 0 aa it aj -. 0 in at

a io 0 c1aa u a C ia 3 - U 3 a

-i it a1 CC. 'a au1ai 0t01 3 a it 4J 01 a ma 0 1 - a 41 C )

-- .i. - aE 2r -011 0 Ljau r 4 14. a M 4 4- a1 c. . a

0 a uv 41 a 0 J 0 =- ajE dzJ at O -z . a cW 01049 a . a i. 4J 41L

+~ a a4 4-U 0c- -41 a 41 c, aJ C

41 o J 0 0 J 0. 1 41 aD

1- -aU <1 a2 0 U .3 aL. a z>- 0 a 41 oc N *- 4 4 0 *-- aj- 1 o 4

a) j 3 41 L+ C 4J- - J -J aJ

4J a l ccU 0 a. +3 .=C L 0 01 a:

ii a a 3 a 0 i.. i. -) aW 4)_ja ~ ' 41 I 4- a1 J a4-) 114

01 a .. 0 a it 41 U 0 41 30. a at c) 0. a L 41 xL a L 4

a. a c J tla- a. a 3 +O '0 C .- 0. CC a )mfl0a 0 C- 0. at 04- Wi4-- . L4D 1 1)> 4) LI a 1

*0a . 0 3 a1 0 0+) i.A 0 c L D I 41 -v 4a* a. 0C a( 41U 14) Ui - 0 . 4.0 CU - I 00a

3 a 43)- 41. aL i.+ C V) 3 L3 410c .3 U Qi< ao a 0 41 0 ; .L 0V a 0 0 X L- M.o -

t4 U j c -0a In.3 0W a C ZU ao --0-4 3 0 C4-)C C - 4 1 a- n-4 a -c e ' 44i.U. 43d 41 a +3- L3 40 . -C 0 - i D tic a04L3 a 1 "- . 0 0 41 a 4-* +3 41 U ) 01 1ci a-U aj I 94J>. -0 L. L- a> 41F- 4 LU -r= i. i. -0. 4. 0W 4J aJ+ J-

£3 cU c ZOC .3< a. 0C Z 0 .<- -a ~ o lta 4

v3 a V4.3- 0 C 41 -- CE Qi4 .3 4.3 L+ C-UL a cmi V)ox- 041 .3 a IO 0 a 00 an uS 14+) 41+)7- a

4a a 14L u Li C6-- - -i -w m = E -C L n i4.44

< < a I 414m-<C< w < - o1 0ai.U a >3 0£ 0l '- mi 41 a >0 i.0. (AA'r c f

-A ~ ~ ~ ~ ~ ~ ~ 02 ~ 0C +t 1114

41. a 41-E.)-~n-~ a-.- a 4---Efl-~+ i S IUV 4.4J+34 4 0.

Page 283: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

L 0-

I 0n'0 - C 1-4C )4CO0 C Em4)4 -- 4

4) L) 5 f 4 t 1I-2 4) L- *" "j

*0 - .C4 o 03 L.3 ' "4 J 0 .

C U 3 C 1W 41 _W )L - #A4 4 J 4

4- -LO .0- L .3 4) 43 21- 4)' c _ M! a 4,-0 C 0) 0-- "4- u V 4-L V2 -.03

1.C V ) - m1 It4 *-- - C)4L 4) u 4.) )4R1t 41 It-I it4 Qli

0 0.0) 0- LIV I. -c. I V 0 4J L0C C) C4- C.. 43 I- 4104 414 +) -l "-4 W.3 a)3

- 0 4) L- :.. 43V 04. (4LV 34 >L4 '- 414 - V-"-) -) -- L- 0. >,.- 1

0 " L 4 ) 4. 0vj 4Z e0 +) 0. u -4) u 0 CJ U SI.1. * ) C 4- C i 0 - ):.CI 1I - I .+I Ii L

0J 4 0 il 4 c4) 4 41- 4I-: 0p I+C V CCa C) 41. C 40 4- 01 VS- -. 0 4- 'D4- '04-3W 4- 4 "C-0 in C L t3 ic 4 1 4 0)- -% 0.'- 0.-) 0. - - )_ .X 43"

4) S IC L. L. (C .3 - 0 0 >C-L M C )C_ )4-)L M C- >M C M4) L 0 +1 0 4 4-*'1 L J4 .3-. .3^ 0 .3 0 ^ 0.3 .30 .3 4 3

L V) - 0 -. J c 0 ) t O 4J C III I L I IL" I L. I I" I L -.3 ~ 4 L3 -0 43 .3 0 - j 31: 40 433C 4. 4* )3C

I 1 C J VC *. L- 4)0 -!4W" V40 V41)4W- 4"40 -- - Ll 43 4- 43)4 C- 04-- +j.~ 04. C4-a L4..03 0 4-- C VJ * -L14 CO C-LW C-r C-I CCI C-r C

4) 4)V-. L 3 - C 4 13 J- 04-o 4 %)N A 4 A. 4 A ~ 4) AN4) 4

0C W .301 0 m ' 4) 0 ) C*'o -+) V- -0 (A In I*AC+- - 0 IA CC.0C (U 0- L V ' 1 4 ) 0 m m m. 4)C 34 III -CL4-W* C .'0 LL 0' Lul 3 1 - - u

4) 0. 4* L L E v- Co i31 4 'V in C 2 3 C ) 4VC NZ 1 0 < V VE 3) V 4) 4) 41 41 4) 01 04J+-J nI 4 t-

4J0"' " 000 L C C0 COL 041 .- " IC mC jC z I IC 4J4C4C 41 L4-~. "" 011 1 31 0C-C 1- 0. L 0 Vt

CU 0w 04)CZw 0 C-0 43..3 41L.4JI.LD >0(00) 0J3. J.3 CL C) L 00Mn0W 4J- 4 04 J(.'0 -4L CCZ 4V" I) '03 4-0

.1 .. "Z ~> CO

w O. .1 j.m.=D 3 fiL3

* Z0.t3Qu< . 0 4C0410

K-103

Page 284: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

LL

-~ N 0* N 4- 41

o 0 0 14 .C 49 41

0 .4 4 4- -

0 N - 41C 0 N 41

-~~ 00 .1 4

01 0 041 -

0S 1a C -j a

N' 4- L

N 0 1 L120 4- 0 '4 0- N

0- R N 41

0 EC N 0 CE41. N) c 0 44.

24. 1.; No 41C 14.1. c 1 0 0 ~

41 04.. 4.. C 0414 N1 4E L 4

SIC 0 4C14- 0 t4J 4 N 0 0 *. -C

V41N 41 0. 41 - 412414- mm N U1 U 404.' a N1 c4 I+)4 4

* 44 0 z :. C. 0 - 41 rL. CL 4 0 1- x C06 N 4- 0. ;;v 4-m Xs4

%4144 -0 at - 1Q c+ C 00 it 41. 4 0 NtC A. 4J C

S N - V. 4- 41 . -4 II N 0U so0 010 4JV - C M0'A 4JC 4,)C 4- 40 44"0 a) L. 0

NI~ 4- SN 4-41 C14. 3.0 *- 01

414 it N- +1-4 41 o -4ve-E-.4N~ ~~~ C41. -14 0E C ~

41 N - 0 U 0 0. C - - L4C N. 0.C 444 4-g 44 4.

I 41 1 - C ., x 1 4. -.44N 0 4141 - L4 L 3- ~ C .

Nt 0a 4114 ZO 4104a 4.14 .0~-L N 4 0. 4-C 10 0 010.- "0j~C N ) 4X 4J -00 CO 4-L4 0-

4141 N .C1 0- 0. 0cC 0..0 41 4) z0-. N 0 Lo w1n2 -- 4~.-. NA 4-440f0 4 z4 41z 41 -

M44 N O4 C C21W-J 4J u0 V u ) - 0)4L

A04J Nt - L .4O..< 1 '0 C - L. .0 L4- .4J14) N C9 4 n- 0 1414J4) 0 4141

-04L. N (n CC 4J L m~4 4)0-- Vi~ 'o . 'oLN 4- ~ 44JJ<0.00

N *ZW> L CIt QU OW 41

N W VO.- uL"C i- m~ <.C. 310

K 1 103a

Page 285: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

4) zC

4 41 0 d0 4c c4 >. 6

OM ul 0 aL 0 41 4JCaO

%0 2 .- c 4J41 -) ; +) .4.

to 1 In. 41 4J In 4-1a 41 a C1 L f1

4.) 1 14 m 4 ao, 0 ~ a)4J 41 C 4

aJ 41 4 41 -c .4. In +)4 Wk + - N 4 04( C in L Ca9 c 4m 0 4. C 4j C> 0)

a Cc . .4./ Of + 41 44 .)

0 0 U 40 U 41o 4 L 0 0 U -4

4J 3 4C 4JL0 41 -4- 3 - C 4

a1 U4J V 4 1 C: -1 4 1 a - 0 LIt L 4 4 J L. 1 .4 a) If14 U1. c LL ; r

4~~4 .04 UC- I4 10 *C : 1 414 4C Z ID 'A = a 414 441 411 .24l 41 0 )EZL II 41 .1 it - .> C &.0 +j v 11 4

- C441 . 41 3: 0 V+ C<=t+) 4

- .4J l

-CC. 0141 41 .4 **+ aI- .. c2 00 &- 41 - - M. + u 4t 041 4.m20 0

c 1 0.')4 J 0X- + - C 4-41 )'C 4 .L4L jL. 4 - 41 0u. 0.. In If (AWm 4J 4J- 4CO-)

0 04+ 45 4J1 4J 4 ,41 tIII I.. a, 042-( 0) 4 4 1) > 2 .4 I L4 441 0 ;. m *m X4J J m w 0 L- .4 In In

QaZ Lc 4- 410 a 4J * X j LC ZC /t - C 41 Cca j m1 C a C- m Of V MC 44J - 44't 1jm 0 411 c 0 0 0.0

m 4J 01 0.4 *. 4 -n Ir C-- - .4 )L- 0. L - L4) L4) 0.4 00) 04 t 41 *- 04 fl 1 14 41414 4 r0 4J 4

* a O L 011- .4+ 4 M 4 +J .(1 M Mii L C A m V ) 4) C ..-. 41 4)ut 0 C 41 4)

l la f 0 -z 414 4t 2 - In0M41EC 4 4 044 4)1 102 L Z 4O- 1A 4)

. 41 +) c11 Z LL +44..4 ~ 1 a Z= -C .4 41244 .40> EO - 4141 V 00-1 0- 4 4 14J -4 4 0- ' .4 )100. C L- 04 41 in4=Il

* .4 I4w 41141 .40 4 W d 41 m Ia .. m < CU )) 44 *0u ~ ~ 41 a 444 .. 24 W1+ >a m.4 40- . 4t Ill)..4 41w 0> m- I

* ~ t W4 a .4L. 4J Id. )4J +441 .4-I. L +OL cWL4 C

41 1 -1 -.1 ~ 441 -. -) 4141 C: L X4 eg j 4CCLZWU 0 4J ~441 4 11 41 <- 4- .4C 44104) 44 <0 41 V02 441. 4

4K 1 04.44

Page 286: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

44

4 C44 0

L 4J4 - C

4. 44) 4.. 4.))

4j >. 4 1 0 4)v. - 4 CI L 0 4 0 X

4) C. 04) 0

4- 4E E. L4)40 0 0 c>

4J 0 4J*L 1. 0. 44 I .L

4- to "a 4)" +4 4)- +0 0c - 44 .CD c ;c cz ._ m 1 ._

) 0-. O(A 4 0) 10 ) > 4-) j00 4J--L. 14 it IT O - 4-) C 4J M C L 0J^4

0. IM 44V - C4 4J il4 4J11 C 0 0 IUZM0m I-

4) W 0) C L0 + 0 -4)) 4) C 0.2 00 >~\ 1C 4 OC .1 -. 1. 0 wt 4 - -00o

-. IC 40 I 4 0 0 . 0 M 04 1 M 0 4) --4- E- I.. L. C l - E C 41 e = +)

4, L 04) 4C 0 4)) 40 4)0f- > 0. if4) L^ in0 a) 4) L..l1 1 - -LI C

4) 1- '4-1 1 Ne E 0 4Ji0- 4 JI 0)C 4- 4J 4 oC Et C E 4)'V C- C .C =0 c c 41 - L*

0.0 00 4 00 0 0 0J 4)l >4)4 .... it 4) 41.~~~i L LC -. )~4 ~ C4 N)

0' I C- L4 00 L 4- 4 +) E-4- L44-j 0> 010 4,40 1 4 C- 4C.J 0 W..a 04)1 4J0 -

.1. LI LC 4 .1 C 4) CJ 4... >1 +L I 40 4)0-~~~ 4) J 0 0C 1.. 0 I0444-- I04

* IfL 4) CU 0 40 M)4 L)49 4)4 41 - +J0 n ) Z LC 0 ) Z u 0i)~

4)I. 4) U F4 IC 24J 0 ) 0 4-4)4) M 4-4 )4) CE mC 4 ,0 0 0C C C 4) C)

4j >9- 1 IL1 > 4)4 4-) 0 L . C- U -- Lv 4. 0 -)- 4)-. 4 ) 0 0 0. 0 E 4 m -)- 03 ll +)+ E. W* L 4 J + ) 00 0j .

4 .- 4) 4 C4) ) 4) 0 u~ a) 1 4) 4

4J 09 U4 ) L 4) V) 44) 0 .' I 1.0 . 4LV) ) 4J4 4.1 ) < OC 1. 1. 0 oZ -C 4J

4)4)Ui 0 -4 0 IZ 40 0 4 C 4- 0x W4

4J 41W 4) > 4 CO A 0 0. u '-4VZ 0 M 04

4 L ..4) ZL 4 >/4 I )* ~ ~ ~ ~ I 0.. 0 14)4 Q/44) 41 C ) .

a 4t .4 0--(0 C . 1NI)~~~ 4 - o u 0C -> ~ ) 4

* ~ ~ ~~~~~~~ 05)) ).>-fO0U-4) Lf.11

Page 287: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

.71

N L

41 %- L

L -)0 0L0)cm 4

z 0 0 441

Nc a -0 to .0N

0 0 0 L +

C1 4N z. 01 V-4 I

0 InFAi 0 04 L C 4JL 0 +3 CL0 0V)~~ +310 ) 0

-J 4 I cN 0 C c c0 L 0^ + m 4.'A 4C4U 0 EC E 3 4- -

N I X N +30 L4 0 0 .. v .z 1 0+ N1 V) C ) 4 -I L MIX

+3 C9 N ) O 0 +3+ X n440 0 M Nn 0.) C) + I1- 1 40 +L + I X C 0 LO 0C 0 . . U

C 3 CJ N1 ^ 01 -0 Z 404 x OI 0 H L 00 +30 QL Lnm-M L C N) 4-C C -1 4- 0 0 J U

L J a3 IC Z N 00 C CO -j

4) I XL Ni (n0 L+ 00 0 IZ4I4Z 0 i+3 +3 N VC C z+ +3 <L w

0 +1 0 0+~ 4 0 0 C E 3i 4J 43 L+3. Z 441 -. 0L mX 0 +3 LC 4- U LW L) 0

43 in -30 AJ N1 - 0 +3LC 0 4-En W4- - + 44- 40 0 CO I Ni m0 0 03.

0 J C 03 II) +3 NL + ~IC9 0 X I N C 0 U -) j >- L (n N4-

0 09 L L~+4- 43 4N M- L 0C 4 ) I-

I- IJ N 00 - -4) 4J 0 413 .I I

+43 NI 0C C > .3 4JC+3<W'In 141 VA Z +3N CO) M 3+ C L OE Z c-

0 .C 1C 4J Cm - 0 0 0 E 4- C.) W 003:D3 CJ 0. N -43+ L 0)4) 0 N w FA 44-I

L A 4- -) N +3 * 4- 0 L X -I 00P- 44-M U0 IW L- L (A NJ 00 C 0 110 < < ~

it < N) CO - O C3I L 0 -J 4J -4J Ji N OL ++ 00 0W CJ 4+3 L - I.

0 it L++ -'3 0 +3. 0 < uz i

-~ c I 0CC OM LO +3+3 C 0- <**u .. m >C30. O V2 MN 0 0. M.a 0)--- 4

N ) I+3 L In+ 4-) 0 *L Zb 04

LZN 0 W 0 3 *.. -j CE DD+ mW 4

N~~~~ 06~..- < < - 33

Page 288: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

7- 7

0 0

c. .,' -4-

4.1

0tot

+- - -

; oI

t'-00.

* LG

K 107

* C *3"4

4.5* I

,. K - 10

* -"C

Page 289: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

0 L 0.C L.+5 C 0 5 0)oi1 m 0) - I

x 5 0l - CC 4J 0: m*0 u i-i-VM

'a mi 0 c 0 0l L)-e X 4)41 040J. 0 4) 4JV -0 4J5. C+5 x u I1uI- C 0.0 E L % e w- i- 0 4J i+010 1 L- 3 00 m -4 0 C to Ci-.CL 51 c 50 4JMC w .J - 0 IL - L-r W mU4.J 4 s CL v5 14 1 4 0*0)4i 0 CO 010 - 0C 0 )0 <U.UOW ca u)0)+ i-C CJ 0 4. 0 c C U<Wf i-i 0- caL

0 3 041 0 wcaca< .C 10CO . 0 i- 0-1- uC > 4-0 -1 MI +51 Z u +J 490C *0 0. 1 -0 lt M CO 4J~~ . 0.0.u OC0 IV) 5C i W . - I1- 00 O 00 00- 0 0+ LJZo..O m) CX0 - i0-0C 9 .C L +) 4J+5 0 -CinCx <4 . i- 0IV001-0+)50 0 30 c 0 0-05+0 3 .UO9-O 0- -1-.0x

-OC: 0 I L_) - X00 4- CJ 4 m0- - WW< 1 0 0 fL+5

0 J0 0 : u 044 +50 41 >.-. - .L)~ 0-- ul m CO -0 c. . O + 4J 4J 4J 10 i- 1-

*'0 1-1 .0 -J4 A JC 0+ 00 44-0+ > i- +5 IL -0. Oo 0 10 0M -0 00W 00 Z5 00 - 0 *1 m. + .0 m 0.)E 0- Z-50 0 +5 C +5 4J4 0i C 0 _j0 C00 E 0-0 )M. 0,0 >Ou i-C 0+5 i 4-iX-=LU- 0 W IW 00 m w- 1+

v) 3:u3 a 3ICi 00-+m+ 0i-o 00- Aj w. w.a- - aii0 i-4Jo>5 0 0 C e . i--.C C - .CO--2 0 0 00. Wg W ZC0 Ii U LxI>50 +5.c 0' 0.0 004J+ 4- - >00 00) - 00 I- ck - 0 0 m xo+5 +5V 00 Cii>C5 0.+)5 Ef .M-JL 4 0 5 W < ~ - C 4J'0 4. M-L- .0 0 4J- 0 0i--- 04 i-1 >. U0 Ls. 0)i 4J Ci.C-0. m1C ) 0 M oii -0 U5 M +5IA.4-0 0 : - 0 m-- a ) +5+5 J . C C-+54f-4- ' 4 -IC -O O i-C L c~+ 0 C W W u 0 00 000)L. u >0 COa LC 0+ 0) L 0 CI - 50 MW4- LJC 000 i--rni-0 -4 '-+ 40- 0 0 C 0 L0M 02<-i- i- - _j5O 1 i- 0 i--5 0.00 r+5- - 1--1) m >U -++ O.5A00~.-Z5 0 M0 + M 4J - 0 M oo xmi-CO 10 a 5> 0 LC = Li. -++~ - 0 4)C w < (D L 0 L 14 L..0 000.U>f0 CO C C -0-0 hM- II 4 +1 I0>0+5-1 i- 4) w~ <o . - r o 0 i-x t4+5 1 0 z L. 1 0 .-4J0 0 C0 00.0 0J *. .0 Z = 0 CL C 4 - lox c J I0L4. . 2E C 01 0l0 5 S.)i 0i- C, -i 0 0o W -- -Ei- ox L I

4j0+ -0 -o. 0I- 000 Qi-5u 0j >+ +0 MOW ~ o- o. I0.00.4 4j+ 0,+ W0 4.Ii C3 4-5+ zf+-0- Ilo 02 M5 +5fZ5 0-.- Z0 Z5> O 4 10(i OW%5 1m : L L - C W+ L 1 0 0 C++++ L Z 0 W IO 1C00 0000 00 I--uvu Zm i 0 0. 4 )4 01-++ 4- 1 0. 4J5 IU-M< 50.W + 4 100u 0 v 10

%_ 4- c 0 4 I0O.~(+ C 0)0 L C C 1 1 M 45--ii c .UOu 4L 5+5CO0 im- 0 = 4c x 0+ 0000 0 0 L++++ 0 <W-C 00W L LJ-+O-004J 0. Ei-4j 0 il 4A 4J 0 Cl. 4J (A .0- +5.+5-CXO 0 - 0.0- m xt L0m > - O 'o + . ~ o . . .

M 0 ' C C VI c )4)M1 4 1J iLL-0) 0 - Q 0 O L 04JC 04J09 0M4 00 0M-0MLMC 1EnLL0-uF 0. 4- 0 .0 .= U~ U j -0L -E'. L 4 . 05 +5 W5 +5 I5 +5: 1 )^4)C ;to '% a 4 C4( I. 4 1)m 04 4 C4 J4 4J z .J 'a) e 0 )4 )t

0 Lu 1--0< O0 4 ) - j0 .- 04 4 D . 3 3 u- = 1Q.g441 1m j uZ 4* C( )L M-0> 4m41 000mmz0 4 0 C4J44J4 <WW 0. In 4-0.)L

Page 290: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

0 *

w~4J

41 3

CC

-u4-

4- 341 3

3 -

4- - +c4- 04-

* 44-1 L00 m -l 4

10 ct L IL iC- 0 .L 2C

u in aC 0* 4) -1 4J0450 +5 4- +5(4 - ) 0NC -l ) -+5 *) L)* U 3 nM - C1 C in LO 4

14) 41 IC * L. 10 inJ45 C5 - ~- x x 0 cL .0

0U 3 I0 0)4- II 4) 4) 11 L 00, m iU 3 u L .0 +1 -V 4) -1 0. - 4

1-0 C 1 0 V L H 4 J L -CO0 0 C in 0) 45 z m u 0 mU .0

at. u 0 c C 'C W C 45 - Va C43 > NM0 -J L +5 U -4) 3 Uv I -

45 4) IA frigi. ~ . ~ 0 i 0) ex..: '0 0+45 0) LuC 4J U ~ O w. N I 4) w- N L4 c N

IV5 N 4-) 4) -+5 CL. 4) C L CL 4) >. )0 c V i I 09 1c 0 V0 (A

U3 L 0 4) * C0 4J' - - V.0 4; II 4)474 0 L C - )40 C X- - in ) CX- - 4 4) C 4+5 41 a5 . C X4 .C 3 41-4- in C 3 0 -- 4- C4)--o - C a

C - +1 0 0 +5 in 0 0 0+5-. 4)J 0 0+4).'J 0). 4J 0 VI)10 N in 3 - UC c +5VO 4. >.4)C 1-. 4-A- U C (n V0tLU- 3 V z

C- 4) 0 45 M- 0 Is t ) U - 0. M ') S - Al 4)+L04- 0 ' 00 4J +5 - L - LLF - +5 - M--N L X L --- tL - It-+ t-

I -U inW 3 .0 C 4J0.L +0 30) 0) IM0))L-(1 4) 0 o) 001+0. 3 0) C+51C .0 0) H.IC+0 - L- 3 - - - 0.3 3 33+) 1 3 3 3 3 L 3--3 3 -

- U M j i 4- C +5.z .0.0.0- L- .0 M0.0.0 1.00) L- in .0t NC c 4) 4- - m4) 4)4) 4- N 4) 4)4)404- C d) 4) 4-0. 140

0' Ot 0 inV- -4-- Ov- Vmv- -V-M VVV- -0-V.- - in-V- U. mw-uinttMn-4J .A^4) J) 3 - 4) L C -

.3+4 Nt^+5.- M V 0 +) - O..VN-Ut-C4I5 . 4) 4) a Um 4) 0

>)0 3J4 ) 03 N in C t- L a 3 N z +5HOC535+Ot N .V 0 t-4J L CWL QW -

0 t-in0 34 -. '0 C , 0 aa -V w 4t- W 0 -od c0~ 0 0 ."N/0to f> 4 J a- 0 a- 0. ) ~ --

*p -0. 0..0. 0. La 4

45 45 +5 4J 40 a 0

K -109

Page 291: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

41

4J)

aL

- 0

aS N 4) ) -L41 >- >- V

0 4J-I . 4W 0+ x x + 3 +

-u 41 -W1 E1 NN1

m~ 4-) '-3 C v+EL +0, *4-

4J3 >1 +)1I4)0 -a5 0 1 44

*4 03 >1 )I 4J -'-+

4- 00) +3 L -J 0 o4N3 4 J - 4J + 3 U . EnC

;4 .. 4 0Lw. - +3 - -

1 Inz 10Z~ **I 40 ) 0 0.430. -11 16 64 41 03.0.

0-E E+ L4 223Z 41- 0 0 0-n--2ELj E32 L E. L. L - 0 n

* - 10 410 oZ 0 0 ii 41 I 4J4J CC +3 0M3C33 .C C - CC 1 C 01

- Eg2+4 C J CE++4 C 4J 0) I- * - C-- OLLX 0 L XU I * I 1%- 0 0- 0 0 0 0 0 0 +304

C +33C L3 L++3 C X 0 C0 4- 1i 4 -C A 41 +3 414 + + IC-41 I4t t)t.41 - 41 4ANd) 4) 4) - 0 L 61 LL t- mr L0.

.x 4JI. C 4 uh I. w. 01 41 0. o 41 04J0.. 0

x. 41.-.l L L -. 1 II. Ll 0 . v L..CL0

0.- 40 0 Xn 0. 0 0000

4JC ( b94 -W. 4J> - 410 0) 0 . - 4)-it

Ci L 001 0010 00 X

00 I- 02 41 1 414 XE

4) .. 014Jt L L

*l . .o. 0. ol Mol -.

4J 2 0. 4) 41L

N. 4101.

m -10.

-) 0 -L

Page 292: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

U)

4J m ;+j4) - m J 4

'-p L i

4J 4- 41o(L A

4J 4J 0 v1 I.

4J CC 69 + L

41 00 L1 E

41 '0' 69+33In.

*0 0 0 0 I. (11 fo . IA 0

41 41 41 IV 0) Q w1 +3) 4)34

x x 10. - xx 41 0. 4) o

Page 293: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

+) W - I

41 -

-L 4.) 0 4J

W-a 4-' 4J 4.

I 4J 4) 4

0. U) 4J - +) +)-

4' .u) 0

*0 : 14J

41 4J 41

44 <n I U in0 0 3 4.41)0IV (LI1. m )+ -

04J 2 41+1< m.4J (n 41)X 1'A6E ~IL) 19

4. 4J 1- 4) 4J04 0' 0 mi.i (fljm. 0

0m .2(4J0 ' 0 ( Al NM1 4J 41 0 N1 iMC. 4J U) m (L 44) zm~ 4J4 -

41 + 4J 4'l CL I- - 14-10 L. 'q10 t L I c o

''D 0~ *. 4 0.. Lv L 0uil1I1 I 44 1 69+ 0 M (44 L 6

c w z cz mz 14T .1 4)1'U.0 0 -) U41wu

1 - 4. E1x w 000<u -4J-0 -. 4 <x<w =-0 w0 -w -000

L. 0:C -4 0-C O2

4.) )

0

K 12

Page 294: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

-. m. - .. o - ,, -

i.

4.'

IIn4141 0. 4.

+3 4'

E <,-) V) 4J In

410 0 LL4+,, -

1) - + c0 - 0 "C

0++ b) 0 4). Cv C 4 4.)

4J 4J.-

4. I I -

40 AI I- 0 4

1" In .) -- o 0

+1 m 4 I LI

11 . 1. L L to ) - L )

0) 4. o.J L)t4J 0 L-d) 41 Q. III) ) .' "440 M , u u u.X m m m, .C

0. 0. Z of u C0. ILI L Q u

+4. 41 1. 1A 11 0 4).M'

S4 0 00 . G) 0f i" I 4. l.') ". .. . . . .

mi L La L L I.- I 4

x 1 4 1- 4 41 f: 4 u+ u u

41 CL w u. m 00 mC II 41

a 0 . L E ~ <3 la - *L I- I- 4-

C 0 . 4 (1) 0 .0.0 40 0 94o~t d00L.) 0 4) I -

4J 0441 411 J

41 L4J0+3 ++3 011. 04)L41 441 LL

Page 295: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

ilHD-fii S 061 A bENERFIJOR'OF RECURSIVE DESCENT PRERS FOR LLMK 4/4,LANGUAGES(U) AIR FORCE INST OF TECH WRIGHT-PATTERSONA FB OH SCHOOL OF ENGINEERING G B PAPROTNY DEC 83

UNCLASSIFIED AFIT/GCS/MA/83D6 F/G 9/2 NLIlllmmllllllll1EIIIIIIIIIIIIE

Page 296: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

142.

*11

w11 W' 12.

1.2

MICROCOPY RESOLUTION TEST CHART

NATIONAL BUREAU OF S-IANDARDS-1963-A

I- J. .,I_

Page 297: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

444441

-41

L~a- 4 ,,41'41 +)

U -.4J0fL9 vi (a C L 0 -

41 1 .* 0 .

u .c -. x 141411411

L U L 41H 41 U.0 11 **4 . U U U

41 4a 4. 1 'U1 14 U I. a ~ 4a. 41 4 -

a I- I I w 0 x 41x wLwC . CL CL U XL 4L U UL CL CL ILu. 41x 4 u 44 ac4I 44

10 .0 j4- Q<! u-l4- MU> -4- Q (A .4-*1. C 41 UC Y) v) 4 4.1v4 4(

c 1oo -41 _u .O-W -4- - 2 w4 -ww -wo -w

u M1

.0

4.'~ 41

Page 298: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

W: T *- P- W- d ,-.9rk wz- . -. -

N 41

"9..:

to - - --,

2. x IN.

;- I- L 4) 1

*X 0 L (A4

),~ 5-C V a) 0U

*)0.b CL U .** S6 u. S S U

a c*CI -C I *I ";4)*44 u a V) V) 0-

so c-. 0- OU -W * *

-- 0 SM USM UV

U ~ US. - I- I 4 U U I1154

Page 299: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

4.J

' 4-I..4.

40 J,.4

4-.J

4''1

441

441

4J--

040

I r

49 .4.1V

at at w c. : -C; C<c4

.1 -C*4w 4 uu

oft ul A.09 ( 9W LWw0LU i cc U (iLAJ 3LU I LL4L" (

Page 300: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

L L. L.LL

44

44

C .)LA.. o

~~4*~41,

a 6 0 11 NI S

ON 41 4JL

0'- -- -- 3

-,0 04' 044 C4 C4JL.0'4- 4J L, j-

.. 4'. C;...2 LC

40 4 0

mha 41' 0 aU0-Q0 "0. 2vC

* I- 04' 0 0

4OW w 4'.41-4,~ 4- 0 0 050

- '4 .. 0 1 a-U O I4 003L 0 E 0" 4J 9 ZL C 0 L @4 *

41 *54 w uI w - W 0 v4A 41 U 0 L. V m

0U 4'l .j u U 2 1024 0)2 'L ao u A( V L 2C L 2

* ~ ~~~ 0-w-,U4- Uw OU,' .44..A.4 4.5 0% 00.' --

34, L2 4,

Page 301: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

.11

AA-. 41

.- 1.4

4%1 0

>)) aS

4.1 00

41 4. O 4' U

2 tLu4 ) , 24

IL- 0 A - o- 5 -4 4.IL)i4' J ; 0 . U1

0 .05 - I- 4,a) 4V 4.% 0 ZZ 4j 0 A

-u3 u cc 20 2)S 04 ,U 4 5 4j IX L. -. -L.

. v 5 )c - U 'U '- ;00 o 4 0 0 4 .4aU 7,0 U 5 a. - 8S 0. Q. C

L. - ' 4.' 0.6.6 V61'2' 01)M0: 0 Q.a0 0 m 0 ";*i 0 PU -N ;4-

Z4 41 10 04 V0 0 .. i iIO

i.1 0 1&-i 0 4. A A A .J4

0 U -j 4.LJO z~0 0 fI I I. 00 4.)L. A.i 0 w0J 4I i .'~9L 0 U .' - i0 U..4' 4, U l 4 .

0- C-44. 5. .. O S C ~ 5- CS 6 S~ 0 U1

CU 9- S -I 5u C 5 5 ''

00 .1. a S~J'U O"C 'U Os- i. .6C118

Page 302: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

op . .14

C

4 1

VJ. C

I.1 -

00 '.A U- I46I- 9L7C -I

41 64. cc ot1

4. 40 01. 410 4

0 AL 1- 41./1

n, 0+ so U Lc. 6C 6 aX0c 4

I ,UcL.I 9504 c go-I 4.1JV +

41 U C..J .C.L (L 0 c

41 NC 4.C. 15I4 10 1- 004A V-1 t 0 CL L 41 4.I .1 -

Js c aC V s aaa uy - 014.1 c 2 3 C-010.13 4 0 - W. 41 c U - 4c I a c-* * .01- C. V

C 1 4 0W 40 'A -Uu 4) 0 0 01 I U 40 0 . 4e1W- 0 II c Imu 0

3 51 1 5. 1- 0 c) I 4; 3, 9 U&* A 66 in 6- 0 . .0 .

30 5. #5 afs 5L 65 0 ON Co smCLIL N -V 4,1 116+ C .

9 0 q. U U I - 0 U 04. 0. u 0 941f 4-1 c 'Cl 41 U CW 5''6c

010 0,- -0 0 0 6 WaI- -W- 0* 94 WI ) 0) 0)90 -"- .. W'-, 0) 0)u 09

0a 4 41

-~~~ -l - W

Page 303: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

4.1.

v Is

0-41C1- 0 -

O4JL c*1C 0

4) a 0 1 _L 041 - :C 0 U 01c

J~~ ^1- C - 0.U of *. 02

U0 U4 01 i14.) I-'U u +

U; *. * d.C 0- c .... 0 .C so a 00

o 4 .41U A4 u 1 -J A j4U * L l CO -. N0.CZC

41: U L4.) -U - ~ . M. *

.1** 41JC c) 0

-II~j 1 0

*0041 4,E - 1 .4. '3 C4A c 41 4L% 1 -2)z - 0 a 0

N 41COC1 l II C - $) I w >,U 0 c s C

-, .1U 41 4 41P0 41 -41 4J1 IS,0 -0 . .-J4-4N 04d 41 M1114 U . . 41

4.1 0L +1.1. "0 41 Z -01Vl 10 4.1 11. 1 0 I)o) L W)U4C4 C uI

20. 0 00 0 c U L. 0 ~0 0 0 441V 0 L. V C a C40 111411 44-00L 0. 0 4L.041. c 01 41Loz4 O4 014 4144141 0 4-4-) 0 "aC4 04 mi3:4 4

HA 0- 1 -. ! -l g-, I.1~1 + r-0, o, -S1 im u 41 I* c 0 mc0 )

vU. 41' £. z - CUO 41 C O L) C -jv3u

L. 0L 0 .Ii Z 0 0 L 0 4C 0 OC0 C 04 LC( 4-'aS (AU 90 4)S 'U-S 10 ) fi-

EN 'D C CMUa a U1

4) 0) ooeU, 10 0 C9 4)OWE 0

*~ ~ - a 4f U fU 01- 0 - -C 41) .

.V 4.1 Z C

00 "p %,.

Page 304: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

09 ~ -w'--':

cL 4a c z z

4 41inL

*0 0 x

41 0 w0 04a z+ 0 I. I I0

u 0 c c 0 L0. 0

'DC -C .n Zo I 1 31 a 164-1A2 0- 6 L. 6 -:wE0 0

- -0 L p g .L.c . Z 41 03 uca .10 .c3 * @ 4j to 0 a c c

c cE V3 a3 0 ZEL*.4 1 I3 13 4.4. 43 43 4.L.

0 0~' --0L C L. 0 440 .J

4. t,4 V0 4I 0 4I 4 ,

A uSC .00 a flC A3 43 ILCGo* (A1 v^3 a3 401 I0 I -04 o4*4

A ^ A A U 0 -'4430 .3a .0 .U - w .00OU4 0-V 9-6 4

* m~ CmL -C zL 43 43J C

0 0O u.lJ 0i E0 C I0l- " 4 30 I '-L- 4

~ 0.33 *03~' l ft ~ )~4121 ~

Page 305: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

*11

0*1

° xU

0

-. ,. . . - x x

do -- 4J 4J1 4.)

0-0 41 0 . v 0

v vC ;; - 3 0 -

00 0 0 0 0 0 0 0 0

Lo4 u u V 4 u u

10 0 A 0 v 0 0 0 0 0

go* V 0 0vVL," - L 1 -

Co c c 4J U£ c UA u

0 00 U U U C U U U

v VU a , ' v o u o o. o o

0 s- 0 0_"--, Z 0 S -- :1, 0 - I .. O , . L "C L I.. I" ..

i--V -0 ,v- *- IP- 00 . O- -C -0- -a ..- ' -- < -a -- - --

,.U UU UI II I 4

EU 41 6.41 4 410 00I

K 122oJ-

Page 306: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

*4U

.cc

.4L

41 L

L. 0. -.

0 U. -

at0 -014 I 0 xI

-c dc 0 R0 . a Is 0 0c

0 a 0

0 m 9 4- 0 _ 4 -2 U

< Lu _ . lo--1 0 Is 4 C *- 0 - 0 - L

-j - *. 0 - 02 M. 0 4- 0 141 L.1 U 4 L.C U 0 0 - u X

;:* .s -C uX 4) Vt L -- 1401r .1L ;- c c IDJ 1 4 J . C C I4. I. c 4.1

In0 0 >% 8 4 C -~ 0 -

X. 4- US I4 0 -64 4 1 L14,O C , r -. a at-. 0~ u0 U 0

4. 0 A0 Cco a .. 0v0.. 0,11 0C0 CL 6-0 Z - 0 4o so 0.0a.- L. S 1 -

U a0W - U -*0 .V -a s 0. 0. 04c a,- .- 4.1

0.' 4 . X~ 1.0 10- 1.0 0 0.. CUIO~~ 0.X UL1G .e.1 >1 010 0.I

.n0.~~00 4).~tL 0 -U 0 0.0 M. 0C 0 0 >0 01 z 0 *

.. ~~~~ v~.' 0 C .2 0 - .

L!U2~ ~~~ 0 ~ 2 0 - 02 0 t 0z i0.010.0 0~0.00at .0 0 II 0 0 4

£SO.L0 Z .C~O0'6- '..4 -123 I C ~ -I

Page 307: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

o..

•. "7. 7

.4.4

N

oJ

Itl

4J aa

atI 1 0 t

. " 0 41

1. u I

1 I434 4.3 M0 0 V -.

a . I"'.

o la Wa

L - 0 a t

I c. 41 x E l i

00 . 0 0 a

0. 4.3 4J 4jS lI"

-I. u' 'C~ ~ C. 5-

41, U

0. -. _

-- ~~~r --,- I,- II lI~.

. . .. .. .- > , . , . , , , .. I m , ,° + a' I "= ^ € • • •4.3U * 2 a aZ I

_jx 0 L .- a a

I, -L ,, 4- 0 . in

A ca 4 W'. 41 -0 r. w (A wn (Az[leW-I~u ~ ~ 2 I 0 I m c = I .-- uu -- z m .= =-

0 N3 a A Cr 04J0 M0 (AaC c-

0 3 t U U L - 4c z m .- = 3 ;de c M u u .> . C ad3<O Lt v u au a0 u 6 LL -a .' .. U ", 0I aL . -a L. XXr

4J 0a 0 C a t> ( AC -:4o L& 4U 01 C.A aI WN *-1 c -wI 1 .o

L 4.3 0 0~ a :hcvuuwv0 A0 1410u u L :h L . - U u

2. 2 3 ~ L R wa O -jOj w

4j a 0 04X X 4J 4J a M< M <j0 M j4

.0 *-. w.U mr ai09 iv a iu<>0 -1 01 9)

K 1 0a

*pW -8 L 3 ' *.O -C a i'%"" . " " " C CZ.""""% ."""""%,% Lt - . £"% . + "'C W a " . " • 0 a Z """. " " ".". " "" " + " " "• ""

Page 308: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

~wv~(1 - -b - - - . - - - . -1

Nr N

x aa a 4

a a CC

a1a 3 4 +

a a. 4t 02 .

a m 0 a ) LX + LaJ In 0 a0 a L-1; a "a a. 0

a aC 41 t 41 ua . a 00 01 x

3 L .5 .* a 0 0 .5 4-

a 0 41 W) a L1. QO

a La-2 *a 4u 2 ne t-a0 L) a3 aGIl -

a C 41 aj 4o L. 1 .)5 CLa I- 41 .5' L. a410 ~-)

a. L c I I 4) a 4)0 a l Ma a m 2 x 4- *-1a4 -L, 41, L - 5 -aC541. CJ L - a C41

aE 4- 4J-r- C * a )01 S

a L L E :) au3 0aJ 41 ) it4 01.- U +) L) C

a. >. C .5 -1 .5t 4- C- a) L L a1a 41 - -a 4 i -a4 .rc -- L.5

a f0? L C - (t~j - L4 ) mL I0 ** C SXLa6 45C U.O 5 41 a 41 4) 01- 4-Z v )a 0i 01u u C toL - C au E4 I ~ EL >. X

a -U 1 41 0 Z.5 10 2 a-I >%n 0LC5- a U 46 U5 LL' L LU 4 )141 4)

"; *) a c< . E1 Zi M 0- .5. c O *.

- 40 a C U .C 0 tI. a -1.5 41 Z0 0) 4)..-0 3S0.0. ao - . 4 . - u L0 a L *.S 0 --' 4j a S 4 )L C C3J4 M L

01.4 a E 4 4- 1 4J)4) 4 - U L - a LL-0 0 IV rL C* L-5 a. c~ 4C C44 .5 0 .5 jA az -W 0, -. C3 J44 41

CCI .C 4 0C a0 .0 0 CCs45 04m0 a 4141 0 V0 Ic CE '- 4- a L 4 - C I

04 a a)C I Q L4 )ui- . 41 9- 414 fl. .j . 0 1Z 4141v w- LLU

4- .0c a -ccL .-<f CID ac LW3 3~ =11-t a .04. 1C C.Q U50 Sn<Z00M4 4

*MI a. LW.CC I E- C- L5 .0 L50 -0 aJ Oo a- * 4j> u-iL J .

-a 001 ) 4) 01 ) 0) a- a .O;UCC4-LLJ U)4- a .51 > nw .5A .5. LC aa VIM13 W.'-C -

014101i a./) IL 0f~..a o 4 0 - 1 I 4UL~ L1 .4-413xw~ It 01 1Z ICn 3 33 a x. V n4W n 4)1 C*Vf a - -CCM.=<I E3- L . f. .0. a L L.-C0 4 M.m Llt-

C.541~~ a 0 Xm-. L0d .54 0) 41) a 4 . .mnx

a - U I-a C54) a >, u 'W

* -.a La *.Z~ .5Ca La *.Z~ 25

Page 309: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

vA.

00

L

4 J 4

.4

0 MV

6beJ

'12

Page 310: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

44

*4I

4.

4.-4

.4

*44,44

P4

4.-a

C

* .. L

U

C6

* 4. -~

0* . 4)

p44)

*4~~ C6L

'3

6-C4)

UC

U4)C0Va.4.

9-.N -

4

z- U

-I I.)U II&.I XX ..1

I W fl ~.1 W(fl -lUI ~-i ii 4)01 ~( ..a.a xLII I-La. ..11 S

I 4)Ui 00 "-0 ILi CC Ocee. .~l*.--: a. -- *u-- -~

.4 -- 51 te-'4. Cq-~ci 00 le-OC a.SI *U*~ -u0 a4), CU,, ~S ~ U

K - 127

~ *~ .'V~J' ~ *4*. 4.. 4 . ... 4-. *4* 4- .4 ~ *~44*4~4

4 - . *4 44.~.*~

Page 311: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

C 4J

c. -

00 LA.

C, 4. 0N N u a 04.'40 04.0

1 0 1 00 EuOEu - LE41 L"IU

41 LU 0 -a

C~O 4J~ 41 4J J~

L 4-!LeC U4J 4 + 0

5C.C L.C C 0 .-j 4.u CR 0 J 4 4-1 So u j .. In

*- 0 4J .O - fl0.C a u U41 041C .. a. 1

4' -4 UXVL UC u a~U

0 C =C.4J 4J 4JE 0 11 11 -C L. I 4J 4C 4j X .'

-0 .0 CO.! C 0 IL.9

41 Lu 4! a 0 CL;u 0 LI .C a

c 0 4- 01'~ v I 41-* CV 4) C1. V U aaS UA O + c a .u*

C4' U0 0. *L.Eu UUN-m 0 4J~' La 4. 01 41

C3 -E CL 0a

- E u a 0 M li Eu-- -wO ~4J -C 31 X U - a4 Eu 0.L

'a m J. 4' L -40.;I 0 ul xS- 4~~ Eu co u.E ZU 4'1.. 44 Ia

z -I 54 N L X 4' 0U -.J - 04J 4'U' U 000 U0 0 a VU-0.5 > vu 0 - I 10 COa- 4 - a- E uL. U.-4'

U.. 40.- -J ~4J4 4' -4 ' 0 VILL - 4 4-P Eu2 £ C 4a f. u v CL; 41 0' M 0U - -- +

e 4' 0- Z -J -J 4' Eu UUCO'UC4' c 11- M fV 1 CI L. VU A I. .a- u41 C

0 c l C 1 4 LU aI~ Eu UCOUEx .- a x aLU. 0 L -J Eu U C.C 414 4 L6* U 0 0SL.

I u C C - Ul' U- 4C- 0- 0C4J%--*~~ -. 0*~ U U 4

LCI US C 1 C ' a41')41

SI 4 Eu Eu 3

p ~~ a1 C -4.44

K-128

% -

Page 312: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

SU.

z

0

C0 C

0l, L.Un41.1 o

00-v. id C -1

* .. 4..,.5u

4.1 CL-R a a--

oA u .U

os I Ea53 L. .41 60 C1

* .0- 0- -4

w w. Uj *.

140 ~ 4 -

U~~ 129*W

Page 313: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

.9C=

V.0

a

YL 43.

0.0

CY c ap- -ii L C )c10xM -lw - -

c- I 6. X*i x1 41;.7 -,

XC2 42 VI

>4' -ILa I-u I 41 N 1o£ - J0 CCL C.z A ) u .-j8 1 Lj C -C .C 4

Uj -6C X J4 1J 2WL. - .CL j (iL ua M ) aL 4c m 1 4 i .2 -1 4p -l20

is a& c 3L J -. a.. 6 ... -1.4I W X 0. + I I-

-j~~~'-- -.: 1 -

2 I.41 UL4111 + vC I 4 II. 0 4.1J - --'£ **. -0.JL U 0110 1 0.L- 4. 1 .-.. U C0 ILL L 0£ 2 aw _- - Ui a' *i - C LJIA. L. IU *. L 1 z -i -L 0. I 6 0

X -. L. a. CI. -j L .J - L L 06C Ij -j -hi 1L L L *. - C1 L*~ ZJJ 4 C C- j *1 IU - 2 -Ue U- u L C ~ - e

01 0~U0 41L * 0..I£ 14 41 1- 0 J . L C.IC '- *0-a c~ cL -

I - 0 .- 'III Oil_ OU.J .J.J -

OC4 44141 V 4 . 4j.~ 01L.j. .

40 4I0 --- .1 0

to a . 'I sea* a - u

K -130

Page 314: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

I.L

*14I1

2 C

tooc 01

.j

9. C .

A, C %. -

LC .-10 41 Z*L. %

- ~ c 0. C

Ct. a.j

* ~ - I. .. j- ~* 0 4Jb1 'S

* ~~ ~ 131W,-..

Page 315: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

4x 4

*00

o w 41

c -a

00

.94 80 c-

41 1s.0x .0 x 'a

r941 0- w 1

u Xc at a= 4.0 -C. c. 11 0 C 0 04

V 40 0-0 . - C -VI, L. .

A. *0P a". 04 0J-. r j 009 4 11 0c 0 I. .- '#0 0 41J -i 4 00 * w-O .0 - -I C

4K -NG a -0 1 10- 0 .0 0 0

.0 0.I0l I u 0 -

4 :1 1 .d4, .9 , f-- j j . . xA X .05ooScC,0 C 0 02 c4 -. 10 S1 2 1 C0 U-

-' ic 41 .2 41 41c oe16 J

-IC g0 m CI x IL I .v - X ^

Js. 0 ) 0 1 1 .j0J0- .0 aI A 0 - 1 - JJ- aJ- L -1 4a INN

I .. -1 4oll -a .c W. 04 c

4-1 S 0 N1 S cSi U C - 001 41 0. a I.8 £.8, £ 5 5 c 0 ~ ... ".

i~i 0 -. .O c ~ -..a.a a. . ...a132-

Page 316: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

CI0IL L

C 48.a r

lS -> 4A

o~4 -c

48 _j -i -

u- 0 0al

VC 044 go 0lu So -cI- 41 AU 43 0--4

* A 69 6L U i 0-1 0 IIo . A - 0

3*jI A, U.. -+ -d1i+i2. 6 L~ ILO U-a '

C 41 W ..i -1 2 000C - SOCI I 1 41 a0 a*U Z -J-J 0 V2 4 JU2 AU4

4j -j -j 1) 0 1 4 I -c - 4*0 41 U-1 40 1.9 41Uj 4 10 1 - ij J j I

0. . C ii 1- I V US S-

0 Clo I- le C0:-U VV U 6u 48 V a- V-

-r 4a C -0~~~ .aS

0 0. 0 J 0I 48141- C-

4,, !JJ~~- 22Z133

Page 317: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

.40

4,.4

I0

* 0o" L. 0

-41CO t =L

a V 4 ) _

*5 0i L.L 4 x

IL 0 -L -' -

.0 t6vjf e4 -le C. - 6

* -,I 00 L 06-A .0 C _I j .

41 _j _6 aI .M .a(w5l u 0M -101 1 1

10 u z ;4 0 "aI j 0 . . U5 L5 It~ J-

- =0W LC - 41 h L 4'A -) 4j 6 Z - 0C .I= 110 . 1'41.j 0 C.0 cx i . C A-

oc L- 0 0^*. U .- 41 - L%.-, L. FA 456 u c I. .

z 0 v af U L 4 91

0. 0J L. . In L.

J..s I-a -0 0 M0 u _j

~i~ii 4501 O~l-L £4134

Page 318: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

"67-* .... *. .

z z

mc 2 0

Ma -- 6 0 o

4' Al 6 16l %. L u

Kj 0'

CL- - ~ 'VIa- CL

41 C-a. gc -* -

4 .D 4' '~s. I. I'-U I. . '-

I~~~~~ 135. a ' .~.a . ,

Page 319: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

VITA

George Bernard Paprotny was born on 25 June 1957 in

St. Paul, Minnesota. lie graduated from high school in Bowie,

Maryland in 1974 and attended the University of Maryland in

College Park, Maryland, from which he received the degree of

Bachelor of Science in Computer Science in June 1978. Upon

graduation he was commissioned in the United States Air Force.

In October, 1978, he was assigned as a Computer Systems

Analyst to the Directorate of Data Automation, Deputy Chief

of Staff/Comptroller, Headquarters Air Training Command,

" Randolph Air Force Base, Texas. He entered the School of

Engineering, Air Force Institute of Technology, in June 1982.

He is married to the former Janice Gail Hobbs of Minot,

North Dakota.

Permanent Address: 2706 Keyport Lane

Bowie, Maryland 20715

Vita-l

k" ' .***. ." o"" " "" - ° , , . """""" , ." ° "° . "" . - "- " - " . . ... "; - , ° " "-

Page 320: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

SECURITY CLASSIFICATION OF THIS PAGE

REPORT DOCUMENTATION PAGE.a REPORT SECURITY CLASSIFICATION lb. RESTRICTIVE MARKINGS

UNCIASi3IFIED2& SECURITY CLASSIFICATION AUTHORITY 3. DISTRIBUTION/AVAILABILITY OF REPORT

2b. OECLASSIFICATION/OWNGRAOING SCHEDULE Approved for public, release;distribution unlimited.

4, PERFORMING ORGANIZATION REPORT NUMBERIS) 5. MONITORING ORGANIZATION REPORT NUMBER(S)

AFIT/GCS/MA/83D-6

NAME OF PERFORMING ORGANIZATION b. OFFICE SYMBOL 7a. NAME OF MONITORING ORGANIZATION

School of Engineering lfapp;cebl

Air Force Institute of Tech.[ AFIT/ENke. ADDRESS lCily. State and ZIP Code) 7b. ADDRESS (City. State and ZIP Code)

Wright-Patterson AFB, Ohio 45433

Ur. NAME OF FUNDING/SPONSORING Sb. OFFICE SYMBOL 9. PROCUREMENT INSTRUMENT IDENTIFICATION NUMBERORGANIZATION (If applicable)

Sc. ADDRESS ICIty. State and ZIP Code) 10. SOURCE OF FUNDING NOS.

PROGRAM PROJECT TASK WORK UNITELEMENT NO. NO. NO.

1 1 TITLE (include Security Classification)

See Box 19.12. PERSONAL AUTHORISI

George B. Paprotnv Captain USAF3& TYPE OF REPORT 13b. TIME COVERED 14. DATE OF REPORT (Yr., Mo., Day) 15. PAGE COUNT

MS Thesis FROM TO December 1983 31016. SUPPLEMENTARY NOTATION Ar L%71 AFlR 190-17.

LYjr.I

17. COSATI CODES 18. SUBJECT TERMS fContinue on reverse if b

FIELD GROUP SUB. GR.

* 09 02 ccpilersranr~ing languages

1. ABSTRACT Continue on reverse if necessary and identify by block number)

Titi. LL - A GENERATOR OF RECURSIVE DESCENT PARSERS FUR IL(K) LANGUAGES

Thesis Advisor: Captain Patricia K. Lawlis

2(k OISTRISUTION4AVAILABILITY OF ABSTRACT 21. ABSTRACT SECURITY CLASSIFICATION

'NCLASSIFIEDIUNLMITED SAME AS RPT. 0 OTIC USERS C UNCLASSIFIED22 AEO RSOSBE1NIIUL22b. TELEPHONE NUMBEF " 22c

". OFFICE SYMBOL

I (include A-rea Code)Patricia K. Lawlis, Instructor in Mathemati s (513)255-4185 I AFI T /ENC

00 FORM 1473, 83 APR EDITION OF I JAN 73 IS OBSOLETE. UNCLASSIFIEDSECURITY CLASSIFICATION OF THIS PAGO

*... . . . ... . ..... . .. . .... . . - .. ..... ,.. ... ,. -- -. ,..., ,.,. -','. -. ,- . ft--k ,. ,A, ,:

Page 321: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

UNL-AS IFIEfl

SECURITY CLASSIFICATION OF THIS PAGE

A computer program was designed to generate a recursive-descent compiler

for LL(k) languages. A grammar specification language was designed using

Extended BNF, along with a lexical specification language using regular expressions.

The program uses a well-tested but not formally proven method for determining

the maximum possible k for a grammar. It then uses an iterative first and follow set

calculation algorithm to determine the actual k for the grammar.

S4 -.

i UNCILASSTF[i<'.[SECURiTY CLASSIFICATION OF ,,'

Page 322: Hri 318 GENERATOR OF RECURSIVE DESCENT PARSERS FOR … · 1978] [Koster, 19711 [Leverett, 1980] has two major drawbacks, which are: a. Each one will create a compiler for those languages

-1