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


Groups > comp.compilers > #1597

Re: lex - how to get current file position of parser file

Path csiph.com!xmission!news.glorb.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED!nerds-end
From federation2005@netzero.com
Newsgroups comp.compilers
Subject Re: lex - how to get current file position of parser file
Date Thu, 3 Sep 2015 15:47:39 -0700 (PDT)
Organization Compilers Central
Lines 17
Sender news@iecc.com
Approved comp.compilers@iecc.com
Message-ID <15-09-002@comp.compilers> (permalink)
References <15-08-019@comp.compilers> <15-09-001@comp.compilers>
NNTP-Posting-Host news.iecc.com
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 8bit
X-Trace miucha.iecc.com 1441338611 71086 2001:470:1f07:1126:0:676f:7373:6970 (4 Sep 2015 03:50:11 GMT)
X-Complaints-To abuse@iecc.com
NNTP-Posting-Date Fri, 4 Sep 2015 03:50:11 +0000 (UTC)
Keywords yacc, parse
Posted-Date 03 Sep 2015 23:50:10 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:1597

Show key headers only | View raw


On Thursday, September 3, 2015 at 10:02:20 AM UTC-5, Kaz Kylheku wrote:
> Another approach (if you can design the language that way) is to specify
> reentrant parser and lexer.

If you can get a clean unambiguous cut this should work. But it bears
to point out that the reason you don't see reentrancy very much is
that the LR framework is not really compatible with it. Lookaheads
have to all be lined up, for a clean descent to a sub-level.

This issue is what underlies the frequent-occurrence of the "advanced
entry point" hack (e.g. starting up a sub-parser for "expressions" in
a typical Algol language), where the sub-level starts up one or more
tokens past the starting point of the thing being parsed. Those are
the very things factored-out up front in an LR table. So you end up
having to compromise on the LR-ness of LR itself, with the hack or
similar means, if you want separate parser levels.

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


Thread

lex - how to get current file position of parser file Jens Kallup <jkallup@web.de> - 2015-09-01 04:20 +0200
  Re: lex - how to get current file position of parser file Kaz Kylheku <kaz@kylheku.com> - 2015-09-01 14:19 +0000
    Re: lex - how to get current file position of parser file federation2005@netzero.com - 2015-09-03 15:47 -0700
      Re: include files, was lex - how to get current file position of parser file Kaz Kylheku <kaz@kylheku.com> - 2015-09-04 05:26 +0000
    Re: lex - how to get current file position of parser file Gene Wirchenko <genew@telus.net> - 2015-09-03 18:19 -0700
      Re: lex - how to get current file position of parser file Jens Kallup <jkallup@web.de> - 2015-09-06 21:53 +0200
        Re: lex - how to get current file position of parser file Kaz Kylheku <kaz@kylheku.com> - 2015-09-07 05:59 +0000
    Re: lex - how to get current file position of parser file Jens Kallup <jkallup@web.de> - 2015-09-07 17:11 +0200

csiph-web