unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Help starting with nyacc
       [not found] <20200101184453.GA25268.ref@spikycactus.attlocal.net>
@ 2020-01-01 18:44 ` Mike Gran
  0 siblings, 0 replies; only message in thread
From: Mike Gran @ 2020-01-01 18:44 UTC (permalink / raw)
  To: guile-user

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;
---



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-01-01 18:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200101184453.GA25268.ref@spikycactus.attlocal.net>
2020-01-01 18:44 ` Help starting with nyacc Mike Gran

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).