guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

syntax-case in bootstrap path? -- Re: Mes 0.5 released


From: Jan Nieuwenhuizen
Subject: syntax-case in bootstrap path? -- Re: Mes 0.5 released
Date: Tue, 02 May 2017 07:48:43 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Matt Wette writes

>>  - look into Nyacc
>>  - decide on psyntax
>
> I looked at your setup.  You could look at stripping down nyacc, if
> you trust the lang/c99/mach.scm grammar, then you don’t need lair.scm
> (and hence no psyntax (define-syntax) for lalr.scm.

It would really be a great help for bootstrapping if we could run Nyacc
for Mes without syntax-case.  Mes implements syntax-case using a variant
of the old portable psyntax[1].  I assume you have seen the psyntax.pp
output?  It looks like scheme, but I would classify it as binary, not as
source.

Sadly, I haven't found a way yet to have syntax implemented without
psyntax.  Although `it works', using psyntax currently introduces a
binary into our bootstrapping path, that I'd want to get rid of.  Note
that I do have a full source implementation of define-syntax with
syntax-rules.

> Once you use lalr.scm to convert mach.scm to xxxtab.scm (parse tables)
> and xxxact.acm (parse actions) you create a parser that uses the
> xxxact.scm and xxxtab.scm files only (no lalr.scm or mach.scm)

Thanks for looking into this!  So from this macro

    module/nyacc/lalr.scm (lalr-spec):
    ;; @deffn {Syntax} lalr-spec grammar => spec
    ;; This routine reads a grammar in a scheme-like syntax and returns an 
a-list.
    ;; This spec' can be an input for @item{make-parser-generator} or 
    ;; @item{pp-spec}.

we would only need its result, the a-list?  It could even be that's what
Mes is doing right now; I don't think Mes is generated these tables;
it's tables like these, right?

    module/nyacc/lang/c99/mach.d/c99tab.scm:
    (define c99-pat-v
      #(((103 . 1) (182 . 2) (95 . -281) (-1 . -281)) ((22 . 3) (28 . 4) (29 . 5
        ) (30 . 6) (31 . 7) (32 . 8) (33 . 9) (34 . 10) (35 . 11) (36 . 12) (38 
. 
        13) (37 . 14) (40 . 15) (24 . 16) (25 . 17) (26 . 18) (27 . 19) (138 . 
20)
    ... 
    (define c99-rto-v
      #(#f 177 177 177 177 176 176 176 176 176 176 176 176 176 176 175 175 175 
        175 171 171 168 168 168 168 168 168 167 167 167 167 167 167 166 166 165 
        165 165 165 164 164 164 163 163 163 162 162 162 162 162 161 161 161 160 

Anyway, if we are going to use generated a-lists (jump tables?) to avoid
having to use psyntax because it's too opaque to qualify as source,
aren't we introducing another binary blob into the bootstap path with
this?

Greetings,
janneke

[1] psyntax https://www.cs.indiana.edu/chezscheme/syntax-case/old-psyntax.html

-- 
Jan Nieuwenhuizen <address@hidden> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  



reply via email to

[Prev in Thread] Current Thread [Next in Thread]