From: Mike Gran <spk121@yahoo.com>
To: guile-user@gnu.org
Subject: Help starting with nyacc
Date: Wed, 1 Jan 2020 10:44:53 -0800 [thread overview]
Message-ID: <20200101184453.GA25268@spikycactus.attlocal.net> (raw)
In-Reply-To: 20200101184453.GA25268.ref@spikycactus.attlocal.net
Hello all-
I sincerely apologize that this is a "please do my work for me" email,
but, I don't know too much about LALR parsing outside of Ragel. I have
the following excerpt of a grammar that I've extracted from an ECMA-48
parser I wrote in Ragel, and I'd like to port it over to Guile via
NYACC. I think if someone could help me get the skeleton right, I
could carry on from there.
The Ragel parser (greatly edited) follows.
Thanks in advance!
Mike Gran
----
%%{
machine ECMA48;
alphtype unsigned char;
action do_lf {
// LF - LINE FEED.
console_move_down(1);
}
action do_osc {
// OSC - OPERATING SYSTEM COMMAND.
do_osc(p);
}
action do_print {
// Print single 8-bit glyph
do_print(p);
}
GLYPH = (0x20..0x7E | 0xA0..0xff) @do_print;
LF = 0x0A @do_lf;
command_string = ('\b' | space | graph)*;
OSC = (ESC 0x5D | 0x9D) command_string ST @do_osc;
main := ( LF | OSC | GLYPH )*;
}%%
%% write data;
---
parent reply other threads:[~2020-01-01 18:44 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20200101184453.GA25268.ref@spikycactus.attlocal.net>]
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=20200101184453.GA25268@spikycactus.attlocal.net \
--to=spk121@yahoo.com \
--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).