phorward / unicc

LALR parser generator targetting C, C++, Python, JavaScript, JSON and XML
MIT License
58 stars 9 forks source link

Lexer state #6

Closed wwall closed 6 years ago

wwall commented 6 years ago

I need do some lexer state (in flex it declare in ) How i can declare it in UniCC?

phorward commented 6 years ago

Hello @wwall, I'm not sure if I'm able to correctly answer your question, because 'm not sure what you exactly mean with the 'lexer state'.

Generally, the lexer states are generated by UniCC itself, so no lexer states must be declared explicitly. You can intervene into the lexical analysis with custom semantic actions, as described in the user's manual in section 4.4.1.3.1 (page 75).

UniCC does not provides an easy way to connect it to an externally declared lexer, yet. This would be a good point to be featured in UniCCv2.

I hope this helps you a little bit more with your question.