unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Nala Ginrut <nalaginrut@gmail.com>
To: Matt Wette <matthew.wette@verizon.net>
Cc: guile-user@gnu.org
Subject: Re: Fwd: my current project: new lalr module
Date: Thu, 04 Jun 2015 16:41:31 +0800	[thread overview]
Message-ID: <1433407291.5526.14.camel@Renee-desktop.suse> (raw)
In-Reply-To: <FD2FAA57-2BB1-44DD-9F72-95BFBB8D5625@verizon.net>

On Wed, 2015-06-03 at 20:40 -0700, Matt Wette wrote:
> (Accidentally sent to guile-devel.)
> 
> Having fun with all the great code, and documentation, in guile 2. 
> 
> My current project is a lalr module. Last December I wanted to start
> working on an interpreter for modelica in guile.  Guile has a lalr
> parser generator (system base lalr).   When I started looking at it, I
> was not crazy about the input language. I looked to see if a better
> interface could be pasted on, but the code impenetrable for me.  So I
> started coding up my own LALR parser generator.  I was hoping it would
> take a month of nights/weekends but ended up taking me close to four
> months.  For now I am calling my implementation "lalr1".

cool! it'd be a great tool for our multi-lang plan. ;-)
> 
> A major difference between my lalr1 and lalr in guile is that the
> guile
> version is a translation of the C-coded bison tool and mine is a
> from-scratch implementation in Scheme based on algorithms from the
> Dragon Book.  (The bison implementation uses the DeRemer-Pennello
> algorithms, yacc does not.  I'd guess the bison-based implementation
> will generate a parser generator faster, but I think that is a minor
> advantage.)
> 
> Some features of lalr1:
> 0) It's implemented with syntax-rules and syntax-case (versus
> define-macro for lalr).
> 
oh~nice

> 1) There is no specification of terminals.  Terminals are detected in
> rules (via fenders) as quoted symbols or characters.
>     Example of terminals:  'number, #\+

hmm...and strings? Do you have plan to let users choose whether to use
terminals-inference? ;-)
> 

> 6) There is a macro to generate lalr1 input language from a
> lalr-parser specification.
> 
Yes, that would be great!

Happy hacking!

> 
> 
> 
> 
> 





  reply	other threads:[~2015-06-04  8:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E45D6E7C-3864-4CEB-91DE-2560CA145BF1@verizon.net>
2015-06-04  3:40 ` Fwd: my current project: new lalr module Matt Wette
2015-06-04  8:41   ` Nala Ginrut [this message]
2015-06-06 17:19     ` Matt Wette
2015-06-08  3:15       ` Nala Ginrut
2015-06-26 20:43   ` Matt Wette
2015-07-20  0:36     ` Matt Wette

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=1433407291.5526.14.camel@Renee-desktop.suse \
    --to=nalaginrut@gmail.com \
    --cc=guile-user@gnu.org \
    --cc=matthew.wette@verizon.net \
    /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).