bugnyacc parser generator - Bugs: bug #58749, add source location information to...

 
 

bug #58749: add source location information to parser

Submitter:  Matt Wette <mwette>
Submitted:  Sat 11 Jul 2020 03:12:43 PM UTC
   
 
Category:  None Severity:  2 - Minor
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  mwette
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 20 Oct 2021 01:10:49 PM UTC, comment #2: 

Source tracking has been added using Guile's source properties.
The lexemes fed to the parser are pairs w/ car the token value and cdr the semantic value (e.g., '($float . "1.23")).  The developer should add source properties like (set-source-properties! lexeme '((filename "foo.x") (line . 1) (column . 2))).

Source tracking will first appear in nyacc-1.06.0.

Matt Wette <mwette>
Group administrator
Fri 21 May 2021 07:37:46 PM UTC, comment #1: 

I started working on this but so far my solution is not pretty.
I was toying with adding a location stack to the parser.  The lexer would have to provide source location via explicit handling or with maybe using source properties.  We shall see.

Matt Wette <mwette>
Group administrator
Sat 11 Jul 2020 03:12:43 PM UTC, original submission:  

Users want the capability to associate source location with lexemes and then non-terminals in the parser.

Idea:
In the lexer, cons return (cons (src .xxx) lval sval).
In the parser add another stack for location info.
Maybe implement actions as (lambda (loc-info $2 $1 . $rest) ...)

Matt Wette <mwette>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mwette (Submitted the item)
  • -email is unavailable- added by mwette
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-10-20 mwette StatusPostponed Fixed
        Open/ClosedOpen Closed
    2021-05-21 mwette StatusNone Postponed
    2020-07-11 mwette Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code