guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Help starting with nyacc


From: Mike Gran
Subject: Help starting with nyacc
Date: Wed, 1 Jan 2020 10:44:53 -0800
User-agent: Mutt/1.11.3 (2019-02-01)

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]