Replies: 4 comments 7 replies
-
|
Beta Was this translation helpful? Give feedback.
-
I do not know the format or form,
|
Beta Was this translation helpful? Give feedback.
-
Following up on this in the context of #1031: Without rewriting the grammar, are there any blockers right now to mechanically generate PEG grammar from the I'll ask the same question on the sister issues. Thanks! |
Beta Was this translation helpful? Give feedback.
-
@DyXel Have you managed to get highlighting and clangd working on Qt Creator for cpp2? I've been trying for a long time, but no luck. Thank you in advance! |
Beta Was this translation helpful? Give feedback.
-
I started reading into Kate Editor's documentation for syntax highlighting (KSyntaxHighlighting, which is also used by Qt Creator) since I wanted to write one for cpp2.
After a while of reading said docs I noticed that the way the context switching works in this syntax highlighter is pretty much how a PEG behaves, which in turn are usually written formally with a grammar syntax, for which there seems to be a lot of tooling available today.
The main idea was to see if I could generate all (or most of) the highlighter definition from the grammar, and then continue from there, so I wrote a small Python script to fetch the grammar from cppfront's source code but then... I couldn't find any tool that would parse that grammar syntax? even without obvious stuff like the
Any ...
placeholders, and I can't figure out which format is this grammar supposed to follow.I checked BNF, EBNF, ABNF, CDL, but none look like the one.. I also checked some python libraries to see which one look similar, but none of them do (or maybe I am just tired). At the moment I am contemplating if I should write my own parser in lieu of an existing solution or just do the highlighter manually but that seems very tedious.
Thoughts on this? I looked into using what was proposed at #910 but it seems to be out of date already...
Script used to extract the grammar (in case anybody is interested)
Beta Was this translation helpful? Give feedback.
All reactions