[Sbp-users] Getting started

Adam Megacz megacz at cs.berkeley.edu
Tue Mar 2 19:02:40 EST 2010


Yang Zhang <yanghatespam at gmail.com> writes:
> For instance, after adding "s=Expr" to math.g, running `java -jar
> edu.berkeley.sbp.jar tests/math.g testme` (where `testme` just has
> `1+1`) gives me:
>
> unexpected end of file at 2:1
>      text: 1+1\n

See the "\n" there at the end of "text"?  Your grammar probably doesn't
include any provisions for whitespace.  Try adding this line to math.g
instead:

  s = Expr [\n ]!*

> `demo.g` fails to parse using the metagrammar -- I had to add `blah::`
> in front of certain things to get to the same place as I'm at with the
> above example.

Ok, fixed.

> `make ast` was my only hint at how the original math.g file was to be
> used, but that fails to run (using the latest git).

Ah, unfortunately GrammarAST.emitCode() does not work yet.  I've checked
in a comment mentioning this fact.

> Is there any chance of your adding a tutorial for souls such as
> myself?

I wish I had time to... probably not until the end of the semester.
Keep pestering me!

  - a




More information about the Sbp-users mailing list