Re: LALR Parser problem

<[email protected]> Fri, 20 Feb 2009 18:21:42 +0000
Newsgroups gmane.comp.java.sisc.user
Message-ID <[email protected]>
Hi Dan,

I took a look at your parser and found a number of problems (and their 
respective solution):

1. There was a colon (:) missing in one rule definition. You'll find the 
fixed parser in attachment.

2. The error message is misleading. The problem is that SISC's error 
function expects as its first argument a string containing the message 
format to write, using the same syntax as the 'format' function. Since none 
of the error messages in LALR contain an escape sequence but they specify 
extra arguments, you get the error "unused arguments....". To prevent this, 
replace the definition of 'lalr-error' in lalr.scm with the following 
definition:

  (def-macro (lalr-error msg obj) `(error (format #f "~a: ~s" ,msg ,obj)))

3. SISC is by default case insensitive wrt symbols. Just evaluate the 
following expression before attempting to load your parser:

(case-sensitive #t)

You should now be able to load your parser.

--Dominique Boucher


>From: "D. O'Keeffe" <[email protected]>
>To: [email protected]
>Subject: [Sisc-users] LALR Parser problem
>Date: 20 Feb 2009 00:39:22 +0000
>
>Hello again all,
>I'm having a small problem porting over my parser from plt's parser tools
>to dominique boucher's LALR(1) parser for Sisc (suggested by Nikita below).
>



------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H