Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site sdccs7.UUCP Path: utzoo!linus!vaxine!wjh12!genrad!decvax!ittvax!dcdwest!sdcsvax!sdccs7!ee163ahp From: ee163ahp@sdccs7.UUCP Newsgroups: net.lang Subject: Parsers for small micros (8-bits) Message-ID: <1240@sdccs7.UUCP> Date: Sat, 26-May-84 13:13:21 EDT Article-I.D.: sdccs7.1240 Posted: Sat May 26 13:13:21 1984 Date-Received: Mon, 28-May-84 06:13:08 EDT Organization: U.C. San Diego, Computer Center Lines: 102 Most of the people I have talked to recommend I write my PLX compiler (for my micro) using an LR(1) parsing method. I argued that it was to tedious to construct the parse tables by hand, but, there were a lot of people who said otherwise. Anyways, all I have to say is "The principle drawback of the method is that it is too much work to implement an LR parser by hand for a typical programming language grammmar" I still believe that recursive descent is the only feasible parsing technique for small micros, unless a parser generator exists for such -"..but there ain't no such animal" (for the apple that is.) Send flames to Alfred V. Aho and Jeffrey D. Ullman. It is their quote from "Principles of Compiler Design" Oh yes. one more thing. I recieved so many flames on the "ease" of constructing the sets of items for a language, that I am going to go ahead and construct the sets of a small grammar for you all to see how fun it it. E->E+T T->T*F|F F->(E) F->id I0: E->_E E->_E+T E->_T T->_T*F T->_F F->_(E) F->_ID I1: E->E_ E->E_+T I2: E->T_ T->T_*F I3: T->F_ I4: F->(_E) E->_E+T E->_T T->_T*F T->_F F->_(E) F->ID I5: F->ID_ I6: E->E+_T T->_T*F T->_F F->_(E) F->_ID I7: T->T*_F F->_(E) F->_ID I8: F->(E_) E->E_+T I9: E->E+T_ T->T_*F I10: T->T*F_ I11: F->(E)_ (TAKEN FROM AHO & ULMAN PRIN. OF COMP. DESIGN. P. 208) Well there you have it. Maybe, I should post the set of items for a language like C. I'm sorry I sound so sarcastic, but getting burned(by flames) too many times will do that to you. The point is that each unique item corressponds to a state and there are too many, and recursive descent is easier.