Discussion:
[ANN] nyacc version 0.86.0 released
Matt Wette
2018-09-05 23:51:41 UTC
Permalink
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
Jan Nieuwenhuizen
2018-09-08 17:46:09 UTC
Permalink
Congratulations with the release!... and
Post by Matt Wette
3) I replaced use of (ice-9 regexp) for the bootstrapper team. (you know
who you are)
...many thanks!

I tried several times to upgrade Nyacc, tried to create patches and failed.

This release works amazingly ootb for me and I made patches for GuixSD
and the the #bootstrappable effort in wip-bootstrap because I found that
mes.c compiles fine with Nyacc 0.86.0, running on Guile or Mes alike.
Really great!

Trying to create a package, I found this one test (out of 102 tests) to
fail:

--8<---------------cut here---------------start------------->8---
int
main ()
{
int a = 0b11;
}
--8<---------------cut here---------------end--------------->8---

It works fine with 0.80.4*

janneke
--
Jan Nieuwenhuizen <***@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | AvatarĀ® http://AvatarAcademy.com
Loading...