Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!texsun!texbell!ficc!peter From: peter@ficc.uu.net (Peter da Silva) Newsgroups: comp.lang.forth Subject: Re: writing a C interpreter in Forth? Message-ID: <2F._Fxds13@ficc.uu.net> Date: 8 Jan 90 22:41:12 GMT References: <9001070938.AA07304@jade.berkeley.edu> <1017@acf5.NYU.EDU> Reply-To: peter@ficc.uu.net (Peter da Silva) Organization: Xenix Support, FICC Lines: 17 > >easiest way to do a C parser in Forth would be to take a yacc grammar > >of C and run it through yacc to get the state tables. Then duplicate > Why not implement it as recursive descent?... I'll second this, from experience. I was involved in a project about 6 years ago that involved a language parser in Forth. I wrote the parser, language-dependent editor, and file system in about 2 months. Then the guy managing the project took exception to the technique I used, which was recursive-descent, and spent the next 6 months redoing what I'd done using the yacc/lex method. The project was subsequently canned, because it went way over schedule. His biggest problem seemed to be all the time it took him to incorporate a change in the language, since he'd lost the tight forth test/execute loop... -- _--_|\ Peter da Silva. +1 713 274 5180. . / \ Also or \_.--._/ v "Have you hugged your wolf today?" `-_-'