X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2Fpackage.html;h=e8863d0057dca99ce02165dc605cdc21e9388914;hp=c55b5cbba98f7bf2dfd6d9dc8cfdb82c1444a75b;hb=HEAD;hpb=2c1c0293545f3d12c23220fd05c663e6aa3f3de1 diff --git a/src/edu/berkeley/sbp/package.html b/src/edu/berkeley/sbp/package.html index c55b5cb..e8863d0 100644 --- a/src/edu/berkeley/sbp/package.html +++ b/src/edu/berkeley/sbp/package.html @@ -5,7 +5,8 @@ APIs and all other packages are subject to change in future releases.

Be sure to read doc/jargon.txt and the description below. + href=#package_description>description below; there is also a + faq a the end of this document.

@@ -79,6 +80,7 @@ If the parse was not ambiguous, you can call

+

Guide to the API

Example

@@ -165,4 +167,82 @@ Expr            =&nb output: add:{8 + mult:{add:{1 + 3} * 7}}
+ +

FAQs

+ +
+

+I get the error java.lang.Error: multiple non-dropped elements + in sequence, what does this mean? +

+ +

+Note: this question deals with the +package edu.berkeley.sbp.meta, which is not considered +stable. +

+ +

+When using the class edu.berkeley.sbp.meta.Grammar, you must +supply an instance of Grammar.Bindings; this instance tells +SBP how to create a parse tree for an expression using the parse trees +of its subexpressions. +

+ +

+SBP has no trouble determining what to do when parsing an expression +that drops all of its subexpressions, or all but one -- for example: +

+ +
+A = B! C D! E! +
+ +

+... in this example, only C is "non-dropped". In this case, +the result of parsing A is simply the result of parsing +C. +

+ +

+However, if we were to leave more than one element un-dropped, SBP +needs to know how to form a single tree out of the two non-dropped +subtrees. There are two ways to do this. The simplest is to provide +a tag -- a string which becomes the common parent of the two subtrees: +

+ +
+Expr = Mult:: Expr "*" Expr +
+ +

+If you are using AnnotationGrammarBindings, you can also deal +with this situation by declaring a method/inner-class whose name +matches the nonterminal (Expr) and has appropriate +annotations. This is fairly advanced stuff, and the code it uses +isn't quite as mature as the rest of the code. +

+ + +

Reporting Bugs

+ +

+ +Bug reports are especially appreciated when you submit them as a test +case (here's the +grammar and some +examples). + +This way we can add your bug report as part of the regression suite, +and be sure we never release a new version in which the bug has crept +back in! + +

+ +

+For now, please send bug reports to the mailing +list. +

+