Have you ever REALLY used Forth??? I did back in the early 80's and HATED it!! It was fine for small jobs, but larger applications were terrible!! I spent more time trying to get around the order things were on the stack than I did productive work! To me, it had the worst qualities of Assembler and high-level languages! I went to a FUG (Forth Users' Group) meeting once and they had a contest to see who could write code that no one else could figure out what it did! The only rule was that it had to fit on one page and you had to prove it worked and accomplished a specific function. Not only was there a winner - there were several!! Talk about a dubious honor!!! I'll stick with Assembler and C, thank you!! More power to you if you have to use Forth - not my cup of tea! Dennis ----- Original Message ----- From: "Tim Webb" To: Sent: Friday, May 30, 2003 2:02 PM Subject: Re: [PIC]: Parser > I even have forth running on my HP 200lx palm top > > > -----Original Message----- > From: Tal [mailto:tal@ZAPTA.COM] > Sent: Friday, May 30, 2003 9:45 AM > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: [PIC]: Parser > > > If you are implementing a stack oriented interpreter, you may want to > take look at the lagnuage Forth (used to be very hot about 15 ago). Take > a look at the operators they use for expressions, stack manipulation, > flow control, etc. This will give you some ideas. I presume you can also > get a free implementation of Forth and play with it. > > http://www.forth.org/ > > Tal > > > -----Original Message----- > > From: pic microcontroller discussion list > > [mailto:PICLIST@MITVMA.MIT.EDU] On Behalf Of Spehro Pefhany > > Sent: Friday, May 30, 2003 5:57 AM > > To: PICLIST@MITVMA.MIT.EDU > > Subject: Re: [PIC]: Parser > > > > > > At 12:12 PM 5/30/2003 +0200, you wrote: > > > > You can implement what you want as bytecode in the eeprom and a > > > > bytecode interpreter that runs in the pic and executes > > it. Eg. for > > > > the expression above it would be in byte code something > > like (after > > > > correcting the & in the middle to && which is likely what you > > > > wanted): > > > > > > > > !fetch var1 !fetch var2 !and !sgn !fetch var3 !literal > > > > 0x0C !sub !sgn !and !if !literal DoSomething !acall !fi > > > > > > > > where each word would take one EEPROM cell or more (you > > can compress > > > > some of it). > > > > > >Ok, It sounds cool! > > >Instead of coding a complex parser it would be a good idea > > to store in > > >eeprom some commands like you explained. To do 'If ((Var1 & > > >Var2)&(Var3<0x0C))' I will store in eeprom something like: > > > > Yes, the parsing could be done off-line on a PC and a > > simulated stack machine could be coded on the PIC using > > bytecodes/tokens stored in the EEPROM. I've done this (not > > with a PIC, but it's no different). > > > > Best regards, > > > > Spehro Pefhany --"it's the network..." "The > > Journey is the reward" > > speff@interlog.com Info for manufacturers: > http://www.trexon.com > Embedded software/hardware/analog Info for designers: > http://www.speff.com > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! email > listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body