From: Matt Wette <matt.wette@gmail.com>
To: guile-user@gnu.org, guile-devel@gnu.org
Subject: [ANN] nyacc version 0.86.0 released
Date: Wed, 5 Sep 2018 16:51:41 -0700 [thread overview]
Message-ID: <c881ed79-672b-4f59-8c93-f4fd62af9819@gmail.com> (raw)
I have released nyacc version 0.86.0. This release includes the following:
1) I reworked the parser to behave with interactive use in Guile better.
2) I hacked on the example language compilers to operate at the Guile
command line. (You can run "make install-nx-languages".)
3) I replaced use of (ice-9 regexp) for the bootstrapper team. (you know
who you are)
4) I fixed a bug in in nyacc/lex.scm make-num-reader which broke on certain
integer forms; and now allow .123 as a legal float.
5) I fixed compile-ffi.scm to correctly show help message w/o filename arg.
The nx-languages include javascript, octave and tcl. "nx" stands for both
"nyacc extension" and "not exactly". These are a bit rough right now. But
the parser / compiler design becoming more uniform among them:
1) The nyacc-generated parsers (except for nx-tcl) generate SXMl trees.
2) The 'to Tree-IL" compilers use (Andy Wingo's) foldts*-values to pick
off easy stuff and declarations on the way down and build up Tree-IL
on the way up.
scheme@(guile-user)> ,L nx-javascript
Happy hacking with nx-javascript! To switch back, type `,L scheme'.
nx-javascript@(guile-user)> var a = 1;
nx-javascript@(guile-user)> ,L nx-octave
Happy hacking with nx-octave! To switch back, type `,L nx-javascript'.
nx-octave@(guile-user)> b = 2;
nx-octave@(guile-user)> ,L nx-tcl
Happy hacking with nx-tcl! To switch back, type `,L nx-octave'.
nx-tcl@(guile-user)> set c 3
nx-tcl@(guile-user)> ,L scheme
Happy hacking with Scheme! To switch back, type `,L nx-tcl'.
scheme@(guile-user)> (+ a b (string->number c))
$1 = 6
I will be working on Tcl to do more agressive parsing (e..g, 123 as
integer instead of string) and lazy conversion to strings.
I am thinking about a simple object model that can be used with
multiple extension languages.
And I like my new elisp minor mode that helps make awesome docstrings:
(available athttps://github.com/mwette/guile-contrib)
scheme@(guile-user)> ,use (nyacc parse)
scheme@(guile-user)> ,d make-lalr-parser
- Procedure: make-lalr-parser mach [options] => parser
Generate a procedure for parsing a language, where MACH is a
machine generated by 'make-lalr-machine'. This generates a
procedure that takes one argument, a lexical analyzer:
(parser lexical-analyzer #:debug #t)
and is used as
(define xyz-parse (make-lalr-parser xyz-mach))
(with-input-from-file "sourcefile.xyz"
(lambda () (xyz-parse (gen-lexer))))
The generated parser is reentrant. Options are:
'#:skip-if-unexp'
This is a list of tokens to skip if not expected. It is used
to allow comments to be skipped. The default is ''()'.
'#:interactive'
If '#t', this tells the parserthat this is being called
interactively, so that the token '$end' is not expected. The
default value is '#f'.
NYACC, for Not Yet Another Compiler Compiler, is set of guile modules for
generating parsers and lexical analyzers. It also provides sample parsers
and pretty-printers using SXML trees as an intermediate representation.
It provides a decent C parser and a `FFI Helper' tool to help create
Guile Scheme bindings for C-based libraries.
It provides (partially implemented) compilers based on above mentioned
parsers to allow execution with Guile as extension languages.
NYACC maturity is beta level.
NYACC is free software; the full source distribution is available through
* the tarball repository:
https://download.savannah.gnu.org/releases/nyacc/
* the git repository:
git://git.savannah.nongnu.org/nyacc.git
home page, project page and user's guide:
*http://www.nongnu.org/nyacc
*https://savannah.nongnu.org/projects/nyacc
*http://www.nongnu.org/nyacc/nyacc-ug.html
For support see:
https://savannah.nongnu.org/support/?group=nyacc
next reply other threads:[~2018-09-05 23:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-05 23:51 Matt Wette [this message]
2018-09-08 17:46 ` [ANN] nyacc version 0.86.0 released 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=c881ed79-672b-4f59-8c93-f4fd62af9819@gmail.com \
--to=matt.wette@gmail.com \
--cc=guile-devel@gnu.org \
--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).