Overlapping token definitions

Chris Clark · ACM SIGPLAN Notices · 1998

Welcome to a new column about how to get lexer and parser generators to do what you want.The idea for these columns came from the questions appearing on the comp.compilersnewsgroup and questions asked by users of Yacc++.Many of these questions were how-to kind of questions that pointed out a need for collecting some of the techniques (and even hacks) which bridge the gap between the theory of parsing and the world of practice.Each installment of this column will layout and address a typical problem that a grammar writer faces with some solutions.These columns will try to offer alternative solutions that work with a variety of tools, whether they are regular expression, LL, LR, or otherwise based.There are a wide variety of tools out there, each with unique strengths.It would be unfair to penalize users of a certain tool, just because it didn't match this author's prejudices.To present several solutions in a reasonable space, they will be presented in a condensed form rather than as Gang-of-Four [GHJV95] patterns.

Read the paper · More papers on PaperTik