Re: Alternatives to Regexps

Torben Mogensen <torbenm@diku.dk>
10 Jul 1998 20:53:01 -0400

          From comp.compilers

Related articles
Alternatives to Regexps john@dwaf-hri.pwv.gov.za (John Carter) (1998-07-08)
Re: Alternatives to Regexps ak@muc.de (1998-07-10)
Re: Alternatives to Regexps torbenm@diku.dk (Torben Mogensen) (1998-07-10)
Re: Alternatives to Regexps jamz@cdsnet.net (1998-07-10)
Re: Alternatives to Regexps d.rourke@arpc.com (Daniel Rourke) (1998-07-10)
Re: Alternatives to Regexps bear@sonic.net (Ray Dillinger) (1998-07-10)
Re: Alternatives to Regexps bpr@best.com (Brian Rogoff) (1998-07-10)
Re: Alternatives to Regexps mav@naxos.esat.kuleuven.ac.be (Maurizio Vitale) (1998-07-10)
Re: Alternatives to Regexps lord@emf.emf.net (1998-07-11)
[4 later articles]
| List of all articles for this month |

From: Torben Mogensen <torbenm@diku.dk>
Newsgroups: comp.compilers
Date: 10 Jul 1998 20:53:01 -0400
Organization: Compilers Central
References: 98-07-057
Keywords: DFA, design

John Carter (ece@dwaf-hri.pwv.gov.za) wrote:


>I'm seeking pointers to alternatives to standard regular expression
>languages.


You can use context free grammars also at the lexical level. Sometimes
LR parsetables for grammars that actually represent regular languages
can be smaller than the DFA's generated from the regular expressions.
Furthermore, parsing actions gives you a natural way of obtaining the
attributes of lexical tokens, for example the values of number
constants.


For example, if you represent the set of floating point constants by a
regexp, you will basically have to parse the token once again to find
its value. If you use a parser as a lexer, you can naturally build the
value using parsing actions.


Torben Mogensen (torbenm@diku.dk)




--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.