Hi Eric, David,
That was a clear case of hitting "send" (actually C-c C-c) to early. I
solved the problem -- as you also suggested -- by looking at the
examples.
David PONCE writes:
> For now the "%token <symbol> IDENTIFIER" is not directly used by the
> symbol analyzer, and you must define your own one to handle that
> (probably it is worth reusing the one from wisent-java-lex or
> wisent-python).
>
> I am currently working on a new set of analyzers that would be able
> to take advantage of lexical declarations in grammars ;-)
Once I figured how it works it is actually not too bad in these
cases. But here is an obscure version, I am not sure whether this is
the right thing to do. The lexer seems to know what I mean, though.
I have `import' statements, that expect a list of path names. Since
path names don't fit into any existing token class, I came up with a
parser that creates MODULE_NAME tokens. Now how am I supposed to
express that in the grammar? Currently I use
%token <module-name> MODULE_NAME
, although there is nothing like 'module-name' defined. It was the
token type an early version of my lexer created. So I left it there
since I didn't know better. Semantic doesn't seem to care. What would
be the correct way of specifying that?
> For punctuations you should probably replace the
> `semantic-lex-punctuation' analyzer by the
> `semantic-lex-punctuation-type' one which automatically returns the
> expected tokens based on declarations of the form:
Yes, I found that one as well.
Thanks to both of you,
Marcus
|