I try to make a lexer / parser with cedet, but i am jam with lexer.
I use the (wisent-test-lexer (point-min) (point-max)) to test my lexer.
I set up the parser than when i press C-, , it parse to %start, now all
I toggle the 2 wisent--flag to see error in *Message*.
with an example like this:
type <test-type> syntax "some regexp"
type <test-type> matchdatatype string
%token <test-type> TERMINAL "my-terminal"
when i run the parser my token are recognize as "test-type".
when i start the lexer i get token of type TERMINAL as expected,
but when i run the parser they are recognise of type <test-type>.
My other problem with lexer is with my another example:
%type <scala-symbol> syntax
%type <scala-symbol> matchdatatype regexp
%token <scala-symbol> VARID "[a-z].*"
%token <scala-symbol> PLAINID "[A-Z].*"
%token <scala-symbol> SYMBOL "'.+"
Here scala-symbol recognise a string like:
So it should give me a lexer VARID, it does but the lexer is just "abc_"
missing the "::".
if i try:
The lexer is SYMBOL and it is complete ("'abc_::").
Maybe there is more convenient way to test lexer/parser?
Forget the first part i wasn't setting semantic-lex-analyzer variable.
for the second part i just test again and notice that
dont produce a SYMBOL token bounding "'abc_::" but "'abc_" like the others.
From: Eric M. Ludlam <ericludlam@gm...> - 2012-02-22 05:22:23
On 02/19/2012 04:29 PM, antoine no wrote:
> Forget the first part i wasn't setting semantic-lex-analyzer variable.
> for the second part i just test again and notice that
> dont produce a SYMBOL token bounding "'abc_::" but "'abc_" like the others.
I'm not too sure about your example code without the full .wy file to
examine. I often have to look at the generated code to remember how
By inspecting your regexp, however, it looks like the entire last
sub-expression is optional (the ?) so is it just skipping it due to an
error in the regexp? I think the:
part is getting the _, and then the
part can't read the _, and thus it skips finding the ::.
Does that make sense?