[Sbp-users] Getting started

Yang Zhang yanghatespam at gmail.com
Thu Feb 4 19:11:51 EST 2010


Hi, I've been reading the docs (incl. the Javadoc), but I still don't
have a very good sense of how to write and use some simple grammars.
I'm interested in specifying grammars using the metagrammar, but
mostly I've been working my way backwards around the Java source and
tweaking the files in tests/*.g without luck.

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
 expected:

        at edu.berkeley.sbp.ParseFailed.error(ParseFailed.java:232)
        at edu.berkeley.sbp.ParseFailed.error(ParseFailed.java:144)
        at edu.berkeley.sbp.GSS$Phase.shift(GSS.java:158)
        at edu.berkeley.sbp.GSS$Phase.<init>(GSS.java:105)
        at edu.berkeley.sbp.Parser.parse(Parser.java:49)
        at edu.berkeley.sbp.misc.CommandLine.main(CommandLine.java:23)

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

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

All in all, I'm not really sure what's going on. I'm guessing parts of
the system/tests are in flux (this is also hinted at by some large
block comments), which make it harder to explore/self-learn.

I'm interested in using sbp, but unfortunately am no expert at parsing
technology; I precisely chose sbp because it seems to offer one of the
highest level of abstraction I've seen over other parsing systems. Is
there any chance of your adding a tutorial for souls such as myself?

Thanks in advance.
--
Yang Zhang
http://www.mit.edu/~y_z/



More information about the Sbp-users mailing list