Thanks for reply! I wonder if Guile master has updated to the latest lalr-scm, since I can't see the expected result. If the answer is no, I have to request for it, it's important for our multi-lang hacking.
Thanks! On Mon, Oct 27, 2014 at 4:11 AM, Jan Nieuwenhuizen <jann...@gnu.org> wrote: > Hi, > > Saw your question on irc. > > Attached is a modification on your `simple' language that demonstrates > transparent source locations. > > The explicit, Bison-like locations work just like they do in Bison...eg > something like: > > ;; helper > (define (note-location ast loc) > (when (supports-source-properties? ast) > (set-source-property! ast 'loc loc)) > ast) > > (define (make-parser) > (lalr-parser > ;; ... > ;; production rules > (variable > (type Identifier = expression semicolon) : `(variable ,$2 ,$1 > ,(note-location `(expression ,$4) @3)) > (Identifier dot Identifier Identifier = expression semicolon) : > `(variable ,$4 (type ,$3 ,$1) ,(note-location `(expression ,$6) @5))) > > Does that answer your question? > > Greetings, Jan > > > > -- > Jan Nieuwenhuizen <jann...@gnu.org> | GNU LilyPond http://lilypond.org > Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.nl >