Return-Path: megacz@cs.berkeley.edu Received: from 216.237.119.186 (GODEL.MEGACZ.COM) by null (org.ibex.mail.protocol.SMTP) with ESMTP for ; Wed, 19 Jul 2006 23:09:01 -0700 Received: from 127.0.0.1 (GODEL.MEGACZ.COM) by null (org.ibex.mail.protocol.SMTP) with SMTP for ; Wed, 19 Jul 2006 23:08:54 -0700 Received: by godel.megacz.com (sSMTP sendmail emulation); Wed, 19 Jul 2006 23:08:54 -0700 To: Simon Hay Cc: sbp-interest@research.cs.berkeley.edu Subject: [sbp-interest] Re: SBP References: <4DCD5332-BBCF-43F7-AA83-7D0F9FF325D7@lincoln.ox.ac.uk> <8B3BA505-38A3-49A1-A281-02B8C850F374@lincoln.ox.ac.uk> From: Adam Megacz Organization: UC Berkeley X-Home-Page: http://www.megacz.com/ Date: Wed, 19 Jul 2006 23:08:54 -0700 In-Reply-To: (Simon Hay's message of "Wed, 19 Jul 2006 12:37:35 +0100") Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Envelope-To: sbp-interest@research.cs.berkeley.edu List-Id: The Scannerless Boolean Parser Simon Hay writes: > but now it breaks (on the parser.parse() bit), either saying > unexpected character '2' encountered at 1:0 I think you have an extra newline at the end of the input (which is not part of the grammar) -- I get this error when I do that. However, this error message is absolutely wrong for what's happening, so I need to fix it to complain about the "\n", not the "2". > for e.g. > Expr = [0-9]++ > | Plus:: Expra "+" Expr > Expra = ("a" | "b") > trying a+2 I tried pasting your grammar into demo.g, your code into the body of Demo.java and putting "a+2" in a file and passing that filename as the second argument, and it worked.... making sure the input file had no trailing newline. megacz@quine:~/edu.berkeley.sbp$make demo java -Xmx900m -cp edu.berkeley.sbp.jar edu.berkeley.sbp.misc.Demo \ tests/demo.g \ tests/demo.in Plus:{{2}} It takes a while to get accustomed to specifying whitespace in your grammar files (ie lexerless/scannerless style). > Sorry to be wasting so much of your time like this. Not at all. Especially now that this is on a mailing list, it's being archived for future users to learn from. Ask away ;) - a