[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Wishlist



Here are some wishes:

- Nice error messages (no ClassCastExceptions and the like
please for cases the SableCC does not wish to handle
explicitly) (Like unnecessary parenthesizing, which is
allowed by the grammar).
- When rethrowing exceptions, using something like
"NestedRuntimeException" (which contains the original
exception) would be nice, because else there is no precise
number of the line where the original exception occured
available.
- Ignored tokens should be able to be stored in their
respective objects: For example, there is such a .java-File:

package test;

/**
  This is a javadoc comment
*/
public class Test {
  /* comment here */
}
/* comment there */

Is it possible with current SableCC to write a grammar which
recognizes the JavaDoc-comments and is able to associate it
with the respective grammar Object? You'd have to prepend
every Production with "commentOrWhitespace" (and let
"Ignored Tokens" be empty) in order to make this possible.
While "Ignored Tokens" need to be ignored for reading the
"real" tokens, they should not be ignored when creating the
tree. Ignored tokens are in reality "implicit tokens" (which
can appear anywhere between tokens) (aren't they?), and it
should be possible that they are treated as tokens (and
stored in the tree). (Some months ago, I tried to write a
javadoc replacement which unifies javadoc,syntax
highlighting and cross referencing using SableCC and failed
due to this limitation. Using ignored tokens within
productions like

class_declaration = documentation_comment modifier*
[t_class]:class identifier P.super? interfaces? class_body;

resulted in an error.)

Xuân.