unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Matt Wette <matthew.wette@verizon.net>
To: Nala Ginrut <nalaginrut@gmail.com>
Cc: guile-user@gnu.org
Subject: Re: Q on (language <lang> spec)
Date: Thu, 22 Oct 2015 17:20:57 -0700	[thread overview]
Message-ID: <040AE36A-A8DC-4E37-BB91-EF83C1ADBBDB@verizon.net> (raw)
In-Reply-To: <1445226782.11524.38.camel@Renee-desktop.suse>

[-- Attachment #1: Type: text/plain, Size: 1274 bytes --]


> On Oct 18, 2015, at 8:53 PM, Nala Ginrut <nalaginrut@gmail.com> wrote:
> And I'm grad that you write a new lexer generator (before it I only know
> silex), it's great! Would you like to make the generated tokens
> compatible with scm-lalr? If so, people may rewrite their lexer module
> with your lexer generator, and no need to rewrite the parser. I saw the
> token name is string rather than symbol, so I guess it's not compatible
> with scm-lalr.

Actually, the lexer-generator uses convention of internally turning certain lexemes, like strings, into symbols like ‘$string, or integers into ‘$fixed.  The argument to the lexer-generator is a “match-table” which says how to map the read items quoted items are identifiers (e.g., “while”) or character sequences (e.g., “+=“) to something the parser wants to see.  For example, if you use the symbol WHILE to denote the source text “while” then you would have an entry (“while” . ‘WHILE) in the match table.   So I think the lexer-generator should be adaptable to other parsers.

As as side note, the nyacc parser generator can be “hashified” which means the lexer should return integers.   In that case the match table has entries that look like (“while” . 45).

Matt


[-- Attachment #2: Type: text/html, Size: 6059 bytes --]

  reply	other threads:[~2015-10-23  0:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-17 19:02 Q on (language <lang> spec) Matt Wette
2015-10-18 20:00 ` Matt Wette
2015-10-19  3:53   ` Nala Ginrut
2015-10-23  0:20     ` Matt Wette [this message]
2015-10-23 13:10       ` 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=040AE36A-A8DC-4E37-BB91-EF83C1ADBBDB@verizon.net \
    --to=matthew.wette@verizon.net \
    --cc=guile-user@gnu.org \
    --cc=nalaginrut@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).