Article View: comp.lang.modula2
Article #4423Re: Is there a lex and yacc?
From: Josef Grosch
Date: Wed, 31 Aug 1988 20:33
Date: Wed, 31 Aug 1988 20:33
78 lines
4415 bytes
4415 bytes
In article <3852@okstate.UUCP> klarich@okstate.UUCP (Terry Klarich) writes:
>Does anyone have or know where I might obtain a lex and yacc that
>outputs Modula2.
Rex, Lalr and Ell - Compiler Construction Tools
===============================================
Rex (Regular EXpression tool) is a scanner generator whose
specifications are based on regular expressions and arbitrary
semantic actions written in one of the target languages C or
Modula-2. As scanners sometimes have to consider the context to
unambiguously recognize a token the right context can be speci-
fied by an additional regular expression and the left context can
be handled by so-called start states. The generated scanners
automatically compute the line and column position of the tokens
and offer an efficient mechanism to normalize identifiers and
keywords to upper or lower case letters. The scanners are table-
driven and run at a speed of 180,000 to 195,000 lines per minute
on a MC 68020 processor.
Lalr is a LALR(1) parser generator accepting grammars writ-
ten in extended BNF notation which may be augmented by semantic
actions expressed by statements of the target language. The gen-
erator provides a mechanism for S-attribution, that is syn-
thesized attributes can be computed during parsing. In case of
LR-conflicts unlike other tools Lalr provides not only informa-
tion about an internal state consisting of a set of items but it
prints a derivation tree which is much more useful to analyze the
problem. Conflicts can be resolved by specifying precedence and
associativity of operators and productions. The generated parsers
include automatic error recovery, error messages, and error
repair. The parsers are table-driven and run at a speed of
400,000 lines per minute. Currently parsers can be generated in
the target languages C and Modula-2.
Ell is a LL(1) parser generator accepting the same specifi-
cation language as Lalr except that the grammars must obey the
LL(1) property. The generated parsers include automatic error
recovery, error messages, and error repair like Lalr. The
parsers are implemented following the recursive descent method
and reach a speed of 900,000 lines per minute. The possible tar-
get languages are again C and Modula-2.
All the tools are implemented in Modula-2.
A comparison of the above tools with the corresponding UNIX
tools shows that significant improvements have been achieved:
Rex generated scanners are 4 times faster than those of LEX.
Lalr generated parsers are 3 times faster than those of YACC.
The tools are public domain. They have been developed in 1987.
They have been tested by generating scanners and parsers for
e. g. Pascal, Modula, Oberon, C, Ada and found stable. There
are user manuals and a paper on how Rex works will be published soon.
Everybody interested in the tools can obtain the sources free of charge. The
sources are organized as a UNIX file tree.
The tools have been developed using our own Modula-2 compiler called MOCKA on
a MC 68020 based UNIX workstation. It has been ported to the SUN workstation
and been compiled successfully using the SUN Modula-2 compiler. This should
assure a reasonable level of portability.
I can not send the tools by E-mail. This would be too expensive because of
the size of the sources.
Currently the easiest way of distribution is to send a streamer tape for SUN
workstations which I return with the source code (unix file tree in tar
format). I'm planning to post the sources to some appropriate news
group in the near future.
Josef Grosch
GMD - Forschungsstelle an der Universitaet Karlsruhe
Haid-und-Neu-Str. 7
D-7500 Karlsruhe 1
West Germany
Phone 0721-662226
grosch@gmdka.UUCP
Technical Details
Message-ID:
<326@gmdka.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!mit-eddie!rutgers!ucsd!ucbvax!decwrl!sun!pitstop!sundc!seismo!uunet!mcvax!unido!gmdka!groschReferences:
<3852@okstate.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!mit-eddie!rutgers!ucsd!ucbvax!decwrl!sun!pitstop!sundc!seismo!uunet!mcvax!unido!gmdka!grosch From: grosch@gmdka.UUCP (Josef Grosch) Newsgroups: comp.lang.modula2 Subject: Re: Is there a lex and yacc? Summary: Yes: Rex, Lalr, and Ell Message-ID: <326@gmdka.UUCP> Date: 31 Aug 88 20:33:00 GMT References: <3852@okstate.UUCP> Reply-To: grosch@gmdka.UUCP (Josef Grosch) Organization: GMD Karlsruhe, W-Germany Lines: 78