My question was about legal names for non-terminals in general.

The cedet doc says non-terminal names can be anything that is a valid lisp symbol name.

 The question mark is a legal character in a lisp symbol name, so why can't I name my non-terminal "foo_?"?


On Fri, May 24, 2013 at 3:05 AM, Eric M. Ludlam <eric@siege-engine.com> wrote:
Hi Lars,

I don't have enough context to know what you are talking about.  I'm not familiar with any of the syntaxes you are using in your description either.

In wisent, a grammar rule that matches one or fewer 'foo' might look like this:

bar: foo
   | ;; EMPTY
   ;

Perhaps you are defining a lexer?  In which case it is just regular expressions using regular Emacs syntax.

"\\(foo\\)?"

or a token in the grammar:

%token <symbol> bar          "\\(foo\\)?"

but that is probably a bad idea.

Eric


On 05/19/2013 02:37 PM, Lars Petter Mostad wrote:
When translating an EBNF grammar to a wisent grammar, I'd like to make
intermediate rules like "foo_*" for "{foo}", "foo_+" for "foo {foo}",
and "foo_?" for "[foo]". The former two works fine, but when i try the
latter one, i get errors like "wisent-parse-nonterminals: Symbol `bar'
is used, but is not defined as a token and has no rules", where "bar"
has a rule using "foo_?".

According to
http://www.gnu.org/software/emacs/manual/html_node/elisp/Symbol-Type.html,
'?' requires no special punctuation.

What is the problem here?