Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #2996

Re: Flex is the most powerful lexical analysis language in the world. True or False?

Path csiph.com!1.us.feeder.erje.net!3.us.feeder.erje.net!feeder.erje.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end
From George Neuner <gneuner2@comcast.net>
Newsgroups comp.compilers
Subject Re: Flex is the most powerful lexical analysis language in the world. True or False?
Date Fri, 06 May 2022 11:00:16 -0400
Organization A noiseless patient Spider
Lines 36
Sender news@iecc.com
Approved comp.compilers@iecc.com
Message-ID <22-05-011@comp.compilers> (permalink)
References <22-05-003@comp.compilers>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 8bit
Injection-Info gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="93123"; mail-complaints-to="abuse@iecc.com"
Keywords lex
Posted-Date 06 May 2022 12:14:51 EDT
X-submission-address compilers@iecc.com
X-moderator-address compilers-request@iecc.com
X-FAQ-and-archives http://compilers.iecc.com
Xref csiph.com comp.compilers:2996

Show key headers only | View raw


On Wed, 4 May 2022 11:22:34 +0000, Roger L Costello
<costello@mitre.org> wrote:

>Hi Folks,
>1. A lexical analysis language that exclusively provides regular expressions
>for scanning input can only process regular languages.
>2. Flex provides, in addition to regular expressions, states and a pushdown
>stack. This greatly expands the set of languages that can be processed.
>3. Because Flex provides states and a pushdown stack, Flex lexers can process
>context-free languages.
>4. No other lexical analysis language provides states and a pushdown stack.
>5. Flex is the most powerful lexical analysis language in the world.

>[I think that you could easily graft a state stack into any lexer that has start states.
>Also, tools like Antlr combine the lexer and parser generators, so they're at least as
>powerful as flex. -John]

+1 John.

Roger, if you hadn't already asked some more interesting questions, I
would suspect this 'test' was homework.

Flex is powerful, but it certainly is not alone.  As John's response
hinted, there are (plenty of other) tools that more or less are
equivalent.  And not all of them are based on LR.
https://en.wikipedia.org/wiki/Comparison_of_parser_generators

Not to mention that programming languages which tend to actually be
used also tend to be [relatively] easily parsed using LL(k).

LR is useful AS AN IMPLEMENTATION TECHNIQUE, but in general if your
language is complex enough to really /require/ (G)LR or PEG parsing,
it probably is too complicated to be used by average programmers.

YMMV,
George

Back to comp.compilers | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Flex is the most powerful lexical analysis language in the world. True or False? Roger L Costello <costello@mitre.org> - 2022-05-04 11:22 +0000
  Re: Flex is the most powerful lexical analysis language in the world. True or False? Tom Shields <thomas.evans.shields@gmail.com> - 2022-05-04 14:14 -0500
  Flex is the most powerful lexical analysis language in the world. True or False? Christopher F Clark <christopher.f.clark@compiler-resources.com> - 2022-05-05 15:20 +0300
    RE: Flex is the most powerful lexical analysis language in the world. True or False? Roger L Costello <costello@mitre.org> - 2022-05-06 11:16 +0000
      RE: Flex is the most powerful lexical analysis language in the world. True or False? Christopher F Clark <christopher.f.clark@compiler-resources.com> - 2022-05-07 13:15 +0300
        Simple Lexer and Simple Parser [ was RE: Flex is the most powerful lexical analysis language in the world. True or False? ] Roger L Costello <costello@mitre.org> - 2022-05-08 13:34 +0000
  Re: Flex is the most powerful lexical analysis language in the world. True or False? George Neuner <gneuner2@comcast.net> - 2022-05-06 11:00 -0400
    Re: Flex is the most powerful lexical analysis language in the world. True or False? gah4 <gah4@u.washington.edu> - 2022-05-06 14:30 -0700
      Re: fun with Postscript, was Flex is the most powerful lexical analysis language in the world. True or False? gah4 <gah4@u.washington.edu> - 2022-05-07 13:10 -0700

csiph-web