[comp.lang.modula2] Lex and Yacc for Modula-2

zerr@math.wisc.edu (Troy Zerr) (02/19/90)

Has anyone heard of a version of lex, yacc or similar compiler-building
tools?  I'm writing a compiler in Modula-2 and I'd rather keep the
whole thing in Modula-2 rather than linking in a bunch of C code.
 
Thanks a lot.
 
Troy Zerr
Univ. of Wisconsin
Dept. of Math.

reid@CTC.CONTEL.COM (Tom Reid x4505) (02/19/90)

>Has anyone heard of a version of lex, yacc or similar compiler-building
>tools?  I'm writing a compiler in Modula-2 and I'd rather keep the
>whole thing in Modula-2 rather than linking in a bunch of C code.
>
>Thanks a lot.
>
>Troy Zerr
>Univ. of Wisconsin
>Dept. of Math.
>
Please excuse my posting this to the whole net but messages kept bouncing
because the computer "SPEEDY" in the original posting wasn't found.

I have a translator writer system that is usable but still needs lots of
work and documentation.  It is not yacc/lex-like.  It is EBNF, attributed
grammar, recursive descent with the ability to define attributes and imports
so the complete parser module can be generated.  It is written in FST m-2
for the pc.  It is still a month or more (I am doing this at night and
weekends) away from being ready for prime time.  Let me know what you`re
timing is.

Tom.


Thomas F. Reid, Ph. D.                   (703)818-4505 (work)
Contel Technology Center                 (703)742-8720 (home)
15000 Conference Center Blv              Net: reid@ctc.contel.com
P.O. Box 10814
Chantilly, Va.  22021-3038

MARK@UCF1VM.BITNET (Mark Woodruff) (02/20/90)

In article <4314@daffy.cs.wisc.edu>, Troy Zerr
<daffy!rt13.cs.wisc.edu!zerr@SPEEDY.WISC.EDU> says:
>
>Has anyone heard of a version of lex, yacc or similar compiler-building
>tools?  I'm writing a compiler in Modula-2 and I'd rather keep the
>whole thing in Modula-2 rather than linking in a bunch of C code.
>
>Thanks a lot.
>
>Troy Zerr

Well the managerial consultant at the company where I used to work
wrote a version of Yacc in Turbo Prolog...

Seriously, translating the output of Yacc to any language (I've
translated it to both Rexx and 370 Assembly) automatically is quite
easy.  The combination of translated Yacc output and M2 might work
nicely for you.

mark

steve@robobar.co.uk (Steve Bleazard) (02/20/90)

In article <4314@daffy.cs.wisc.edu> zerr@math.wisc.edu (Troy Zerr) writes:
> Has anyone heard of a version of lex, yacc or similar compiler-building
> tools?  I'm writing a compiler in Modula-2 and I'd rather keep the
> whole thing in Modula-2 rather than linking in a bunch of C code.
>  

The Book 'A Compiler Generator For Microcomputers' by P Rechenberg and
H Mossenbock (Prentice Hall 1989, ISBN 0-13-155136) presents Coco an
LL(1) parser generator.  The book includes a complete listing of the
Coco source code.  A machine readable version may be available for the
IBM-PC from the publishers.

I believe that Lee McLoughlin <lmjm@doc.ic.ac.uk> has modified standard
YACC to produce Modula-2, contact him directly for more details.
-- 
Steve.Bleazard@RoboBar.Co.Uk        | Phone:  +44 1 991 1142 x153
Snr Software Engineer, Robobar Ltd. | Fax:    +44 1 998 8343 (G3)
22 Wadsworth Road, Perivale.        |
Middx., UB6 7JD ENGLAND.            |

crocker@UUNET.UU.NET (Bennett Crocker) (02/21/90)

Tom,

I'm always interested in parser generators; yours sounds pretty nifty.
Would you please put me on your list?  Thanks!

Ben Crocker
Multiuflow Computer, Inc.
31 Business Park Drive
Branford, CT 06405
(@03) 488-6090

reid@CTC.CONTEL.COM (Tom Reid x4505) (02/21/90)

Will do.  It will be a while before I want to let people in on my bad coding
habits.  I'll let you know when its ready.

Tom.

UK4H@DKAUNI2.BITNET ("JAE ", Juergen A. Erhard) (02/22/90)

This is to Tom Reid and to all of you...

to Tom: I also am interested in compiler-writing tools. Yours too, of
   course.

to All: Isn't this a topic of general interest. Means that follow-ups
   should *really* go to the list, I think. (I never would have known
   about Tom's tools had he (as intended) written to Troy directly and
   not, as happened, via the list)

So I call on each and every one of you: Who's got compiler-writing
tools/aids (be it yacc,bison or whatever) that create M2 source?
Post to the list, please (see above)

                                          -jae

========================================================================
Juergen A. Erhard
eMail: uk4h@dkauni2.bitnet
phone: (+49) 721/591602
"You know that it's monday when you wake up and it's tuesday."
                                                    Garfield
DISCLAIMER: none, I don't speak legalese.