From: Matt Wette <matt.wette@gmail.com>
To: guile-user@gnu.org
Subject: Re: Nyacc patches for Mes to avoid bundling?
Date: Sat, 6 May 2017 08:21:12 -0700 [thread overview]
Message-ID: <C0C20BB5-F591-4944-AE40-653E7A5F270B@gmail.com> (raw)
In-Reply-To: <EF4F2343-89AA-4B2C-BBDF-8FBB8BFD347C@gmail.com>
> On May 5, 2017, at 3:59 PM, Matt Wette <matt.wette@gmail.com> wrote:
>
>
>> On May 5, 2017, at 6:33 AM, Jan Nieuwenhuizen <janneke@gnu.org> wrote:
>>
>> Matt Wette writes:
>>
>>> I see that you have PEG parser. You could use that to implement regexps I believe.
>>
>> That's an interesting suggestion...however PEG is currently terribly
>> slow with Mes. I added it before adding Nyacc to give me the option
>> to write the C parser in.
>
> Fine. The tiny bit of code I use regexp for can be done easily with a finite state machine and charsets.
>
Split-cppdef is now sing just string functions:
(define (split-cppdef defstr)
(let ((x2st (string-index defstr #\()) ; start of args
(x2nd (string-index defstr #\))) ; end of args
(x3 (string-index defstr #\=))) ; start of replacement
(cond
((not x3) #f)
((and x2st x3)
;;(if (not (eq? (1+ x2nd) x3)) (c99-err "bad CPP def: ~S" defstr))
(cons* (substring defstr 0 x2st)
(string-split
(string-delete #\space (substring defstr (1+ x2st) x2nd))
#\,)
(substring defstr (1+ x3))))
(else
(cons (substring defstr 0 x3) (substring defstr (1+ x3)))))))
And with regard to your name clashes I have added prefixes. Here is the call to generate the table and action files:
(write-lalr-actions c99-mach (xtra-dir "c99act.scm.new") #:prefix "c99-")
(write-lalr-tables c99-mach (xtra-dir "c99tab.scm.new") #:prefix "c99-“)
These should show up in the first nyacc release after 0.77.0.
Matt
next prev parent reply other threads:[~2017-05-06 15:21 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-03 17:59 Nyacc patches for Mes to avoid bundling? Jan Nieuwenhuizen
2017-05-04 0:07 ` Matt Wette
2017-05-05 2:09 ` Matt Wette
2017-05-05 6:07 ` Jan Nieuwenhuizen
2017-05-05 12:44 ` Matt Wette
2017-05-05 13:33 ` Jan Nieuwenhuizen
2017-05-05 22:59 ` Matt Wette
2017-05-06 15:21 ` Matt Wette [this message]
2017-05-06 16:00 ` Jan Nieuwenhuizen
2017-05-06 16:21 ` Matt Wette
2017-05-06 16:33 ` Jan Nieuwenhuizen
2017-05-07 7:54 ` Jan Nieuwenhuizen
2017-05-07 14:16 ` Matt Wette
2017-05-08 15:37 ` Jan Nieuwenhuizen
2017-05-10 21:01 ` Jan Nieuwenhuizen
2017-05-11 0:21 ` Matt Wette
2017-05-12 3:52 ` Matt Wette
2017-05-12 6:00 ` Jan Nieuwenhuizen
2017-05-12 15:10 ` Matt Wette
2017-05-05 13:19 ` Ludovic Courtès
2017-05-05 19:56 ` Jan Nieuwenhuizen
2017-05-05 20:22 ` Ludovic Courtès
2017-05-06 15:49 ` Jan Nieuwenhuizen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=C0C20BB5-F591-4944-AE40-653E7A5F270B@gmail.com \
--to=matt.wette@gmail.com \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).