← Back to context

Comment by egberts1

8 days ago

I am working on EBNF to semantic action conversion, notably nftables’ Bison parser in EBNF into Vimscript ‘syntax’ highlighting: full-blown deterministic semantic action pathways LL(1) syntax highlighting here (83% done, extreme alpha stage https://github.com/egberts/vim-syntax-nftables )

ChatGPT got the basic terminology such as Vimscript’s terminology like group name, regex, match, region, and maintaining top-level, first encounter sorted list of ‘contains=‘ group names correctly from largest static pattern down to most wildest regex patterns sorted correctly.

Also got S-notation of operators in correct nested order as well.

AND got Bison”s semantic action (state transition), lexical token …. Cna make EBNF from Bison (although Bison does it better).

But it fails often in form of brevity of which an expert (like me) would prod ChatGPT occasionally of omissions.

Makes assumptions of some keywords having invalid value ranges, invalid syntax arrangement, and provides incorrect terminators.

So, I considered ChatGPT to be more of a intermediate editor’s README that requires occassional consult with EBNF notations and Vimscript man page, and more often Bison’s parser source (parser_bison.y) file to be final arbitrator.

Does it learn? Constant ‘nft’ command outputs set ChatGPT straight. But there are slippage when starting a new ChatGPT session which leads me to believe that it won’t learn for others (as well as me).

EDIT: say “no glazing” cuts down on filler words, nicely.