unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* how to implement mutual recursive parsers in syntax-parse
@ 2012-05-14 19:13 Stefan Israelsson Tampe
  2012-05-15 18:38 ` Andy Wingo
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Israelsson Tampe @ 2012-05-14 19:13 UTC (permalink / raw)
  To: guile-devel

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

I do have a cludgy fix for this but are in search for a better solution.

consider the problem:

(define-syntax-class a (pattern (1 x:b)) (pattern ()))
(define-syntax-class b (pattern (2 x:a)) (pattern ()))

the syntax class definitions above would expand to something like

(begin
   (define parser-a code-a ...)
   (define-syntax a spec-a))

(begin
   (define parser-b code-b ...)
   (define-syntax b spec-b))

In racket they manage to evaluate the define-syntax forms before the
define-forms cause in the expansion
of code-a amd code-b they need the spec's spec-a and spec-b.

Do you have any ideas how solve this. I do have a fix for problem but it is
not easy to use.

/Stefan

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-05-21  9:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-14 19:13 how to implement mutual recursive parsers in syntax-parse Stefan Israelsson Tampe
2012-05-15 18:38 ` Andy Wingo
2012-05-18 21:58   ` Stefan Israelsson Tampe
2012-05-21  8:25     ` Andy Wingo
2012-05-18 22:05   ` Stefan Israelsson Tampe
2012-05-21  8:59     ` Andy Wingo
2012-05-21  9:33       ` Stefan Israelsson Tampe

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