From: Noah Lavine <noah.b.lavine@gmail.com>
To: guile-devel <guile-devel@gnu.org>
Subject: Names for PEG Functions
Date: Wed, 21 Sep 2011 16:13:32 -0400 [thread overview]
Message-ID: <CA+U71=NuYVJzV8QtYKPaVnvwKH8o8CitB64eKwct0B8JOwXRHg@mail.gmail.com> (raw)
Hello all,
As the PEG module nears some reasonable level of completion, we should
figure out what all of the functions need to be named so everyone can
reasonably understand them.
At first I thought the names should be consistent wtih the LALR and
regexp modules, so all of the parsing modules would agree. But after
looking at those two, I realized that they aren't consistent with each
other, so it would be very difficult to make PEG match them.
At least, however, PEG can be consistent with itself. Therefore I
suggest the following names and meanings:
define-peg-sexp - define a nonterminal from an s-expression
define-peg-string - define a set of nonterminals from a string
compile-peg-sexp - compile an sexp to a nonterminal (an opaque value
to the user, but really just a function)
compile-peg-string - compile a string to a nonterminal
match-peg - match a peg to a string, starting at the beginning
search-peg - match a peg to a string, starting at each index in turn
until we find a match or reach the end
I realize that putting 'peg' in the names isn't really necessary
because the user could use a module renamer, as Ludovic pointed out a
few days ago. I put 'peg' in the define-* syntax because I thought
'define-sexp' and 'define-string' were too general as names, and then
I wanted the compile-* functions to be consistent with them. As for
the others, 'match' and 'search' seemed too general.
The verb comes first in all of these because I think putting 'define'
in the beginning of syntax that defines things is standard, and then I
made the other names to match that one. If anyone has better ideas,
though, I'm not attached to these names.
Looking forward to merging this,
Noah
next reply other threads:[~2011-09-21 20:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-21 20:13 Noah Lavine [this message]
2011-09-21 20:45 ` Names for PEG Functions Andy Wingo
2011-09-22 17:56 ` Noah Lavine
2011-10-04 0:21 ` Noah Lavine
2012-01-04 18:12 ` Andy Wingo
2012-01-19 9:53 ` Andy Wingo
2012-01-19 13:54 ` Noah Lavine
2012-01-20 3:18 ` Noah Lavine
2012-01-22 20:15 ` Noah Lavine
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='CA+U71=NuYVJzV8QtYKPaVnvwKH8o8CitB64eKwct0B8JOwXRHg@mail.gmail.com' \
--to=noah.b.lavine@gmail.com \
--cc=guile-devel@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).