> > > Hmmm. Seems like Logo (like Forth) was specifically designed to not need much in the way of a parser at all (or as a friend used to say, "Forth uses the programmer as its parser!"). Ignoring practicality, if I were going to aim the giant cannon of a parser generator like ANTLR at the gnat of parsing some Logo dialect (what the heck, probably somebody out there is using it to parse Lisp :-), with what little I know of Logo I might maintain my own stack for the trivial task of parsing the part of the language that isn't proc definition or control flow.
Side note: presumably need/count in your proposed solution need to be stackable to work correctly, since you're using them in a recursive rule... For processing the basic actions of LOGO, I might just have the grammar look for any number of operators/operands and in the action code put those on a stack. Seems like it would be very easy (it's all prefix operator syntax AFAICT in a typical LOGO dialect) to just stack'em up, popping whenever the most recent operator has acquired its requisite number of operands. This would likely put you in a position to give better error messages as well, given how little structure is in the grammar of this language. IMHO, which could be completely wrong. :-) List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address -- You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en.
