bnfc icon indicating copy to clipboard operation
bnfc copied to clipboard

command line parameter to omit built-in lexical elements?

Open jasper-e opened this issue 2 years ago • 2 comments

Hello,

Let me repeat my old request to have a way to omit some built-in lexical elements. Especially identifier is in my way, as i have an LALR(1) grammar for music notation to be typed quickly, with single characters used as lexical elements at many places (for note pitch or duration etc.)

I had a wworkaround patchfile wich works with 2.8.3, I tried to upgrade to newest bnfc recently as using --functor is appealing. However the generated lexer is in a different format and I get alex syntax errors (at end of file, I dont understand why) when I try to re-do my changes in the new format...

jasper-e avatar Apr 01 '22 07:04 jasper-e

Let me repeat my old request to have a way to omit some built-in lexical elements.

This is https://github.com/BNFC/bnfc/issues/302#issuecomment-720151556, I suppose.

andreasabel avatar Apr 01 '22 08:04 andreasabel

That was not mine... I made the comment just on the mailing list long long ago... I have checked around, and I do not need any reserved words. For quick typing my keywords are single characters anyway and I can easily prevent ambiguity by defining the grammar in the right way. So it could be acceptable to switch off identifier token and keyword handling simultanously, I would highly appreciate a command line option or pragma at start that could allow this.

jasper-e avatar Apr 08 '22 07:04 jasper-e