On 10/05/2012 10:48 AM, kototama kototama wrote:
>> (def () x 42)
>>
>> should be converted lexically into:
>>
>> DEF PAREN_BLOCK SYMBOL
>
> There must be a problem in the lexer definition or usage because even
> if I used the
> wisent-clojure-wy--<block>-block-analyzer
>
> I get LPAREN and RPAREN with semantic-lex-debug instead of getting PAREN_BLOCK.
Is the variable `semantic-lex-depth' set to something larger than 0? I
looked at your code, but I didn't see a setting for it.
That depth variable will cause the lexer to dig into lists instead of
creating blocks.
Alternately, if the lexer for parens shows up in front of the BLOCK
analyzer, it will do that first, and skip the blocks. Your regex
analyzer in particular looks like it might match parens. Unless you
need it right off, I'd comment that one out and see how it goes.
Your best bet is to build up code examples, and use semantic-lex-debug,
and make sure you are getting the right lexical token stream before
worrying much more about the rules in your grammar.
Eric
|