On Mon, May 6, 2013 at 12:46 PM, Juancarlo Añez <apal...@gmail.com> wrote:
> Hello Ter! > > Anyway, just wanted to point out that I find this case rare and like >> having a separate lexer, but of course I want it all in one specification >> as if it were scannerless. > > > Just a note on why I reluctantly had to opt out of ANTLR and seek PEG for > my ongoing projects: > > - Software AG Natural allows relevant language words to be used as > identifiers. In fact, words are keywords or not depending on context. > > Hi! What specific weakness in v3 causes this to be invalid? Is it just a predicate? > > - > - Natural also makes many of the relevant language words optional. The > predictive ANTLR *v3* grammar was inundated with lookaheads to resolve > the ambiguity caused by that. > > I see. Wasn't the PEG during the same thing? Note that if you set k=1 option then ANTLR v3 more or less have to backtrack constantly, leading it to behave exactly like a PEG. > > - Natural has exactly one statement that is not led by a keyword: > assignment. And most statements lack terminators, so ANTLR would consume > the left hand side of an assignment unless a negative lookahead was added > to most rules. > - COBOL programs embed subprograms in CICS and SQL, and those must be > parsed to have a complete translation. > > this sounds like you need a scannerless parser. v4 would handle this no problem, if you're willing to treat each character as a token. > It was time-consuming and difficult to deal with the above with a mandated > tokenizer, and with v3's allergy to apparent ambiguity (I couldn't try v4 > because the Python runtime wasn't ready). > > I know. They are both stupid programming languages... but they are real, > and there are millions of lines of source code written in them and still > alive. PEG deals with both easily. You may be right in that cases like > these are rare, though. > I'm not clear on how a PEG has an advantage here; could you be more specific? Thanks, Ter -- Dictation in use. Please excuse homophones, malapropisms, and nonsense.
_______________________________________________ PEG mailing list PEG@lists.csail.mit.edu https://lists.csail.mit.edu/mailman/listinfo/peg