unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Michael Lucy <MichaelGLucy@Gmail.com>
To: Noah Lavine <noah.b.lavine@gmail.com>
Cc: "Ludovic Courtès" <ludo@gnu.org>, guile-devel@gnu.org
Subject: Re: PEG Parser
Date: Thu, 27 Jan 2011 23:13:39 -0600	[thread overview]
Message-ID: <AANLkTimERFor0r5RhRrVyKOmt6Yzye=A+h-moUTEfZO=@mail.gmail.com> (raw)
In-Reply-To: <AANLkTimmybbh+DURFNDQ3hr-+9N1NQqm6spvfWRD=noh@mail.gmail.com>

Putting it in single quotes should work.  E.g. " '[' ".  Similarly,
you can add a literal single quote by making it part of a character
class.  E.g. " ['] ".

You're right, I should definitely add something about that to the documentation.

Any other weak parts you've noticed while perusing?

On Thu, Jan 27, 2011 at 9:25 PM, Noah Lavine <noah.b.lavine@gmail.com> wrote:
> Hello again,
>
> I've run into another issue with the parser that should be addressed
> in the documentation (or the code?).
>
> How do you match a character that is used in the PEG grammar, like
> "["? Can you only define such matchers via s-expressions?
>
> Noah
>
> On Thu, Jan 27, 2011 at 12:17 AM, Noah Lavine <noah.b.lavine@gmail.com> wrote:
>> Hi,
>>
>>> It flattens until you have a list where each element either:
>>> 1. Is an atom.
>>> or 2. Is a list whose first element is in the list of keywords.
>>>
>>> So the car of the argument will change if it's a list that doesn't
>>> start with the right keyword.  E.g.:
>>> (keyword-flatten '(a) '((c (a b)) (a b) (b a))) ->
>>> (c (a b) (a b) b a)
>>
>> I see.
>>
>>> That's odd.  Could you paste in the lambda expression it generates?
>>
>> Wait, actually, I realized it was my own error. My test function was
>> using nonterminals, but I had only done (define grammar-string ....),
>> not (define-grammar grammar-string). I think the generated code tried
>> to call the nonterminals that should have been there, and threw an
>> error when it didn't find them.
>>
>> The peg matcher is really awesome. I am glad to be able to use it soon.
>>
>> Noah
>>
>



  reply	other threads:[~2011-01-28  5:13 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-13 21:29 PEG Parser Noah Lavine
2011-01-17 21:32 ` Ludovic Courtès
2011-01-21 15:23   ` Noah Lavine
2011-01-22 21:02     ` Ludovic Courtès
2011-01-24  1:29       ` Noah Lavine
2011-01-24 20:55         ` Ludovic Courtès
2011-01-27  1:40         ` Noah Lavine
2011-01-27  2:23           ` Michael Lucy
2011-01-27  2:38             ` Noah Lavine
2011-01-27  3:02               ` Michael Lucy
2011-01-27  5:17                 ` Noah Lavine
2011-01-28  3:25                   ` Noah Lavine
2011-01-28  5:13                     ` Michael Lucy [this message]
2011-01-28 15:48                   ` Andy Wingo
2011-01-29  3:07                     ` Noah Lavine
2011-01-29  4:15                       ` Michael Lucy
2011-01-29 11:34                         ` Andy Wingo
2011-01-29 19:37                           ` Noah Lavine
2011-01-30 11:43                             ` Andy Wingo
2011-02-02  0:26                               ` Noah Lavine
2011-02-06 15:31                                 ` Noah Lavine
2011-02-18 22:03                                 ` Andy Wingo
2011-02-23 15:10                                   ` Noah Lavine
2011-03-04 10:52                                     ` Andy Wingo
2011-03-04 13:09                                       ` Noah Lavine
2011-01-29 11:33                       ` Andy Wingo
  -- strict thread matches above, loose matches on Subject: below --
2010-05-27  5:19 Michael Lucy

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='AANLkTimERFor0r5RhRrVyKOmt6Yzye=A+h-moUTEfZO=@mail.gmail.com' \
    --to=michaelglucy@gmail.com \
    --cc=guile-devel@gnu.org \
    --cc=ludo@gnu.org \
    --cc=noah.b.lavine@gmail.com \
    /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).