jzimmerman / langcc

langcc: A Next-Generation Compiler Compiler
https://langcc.io
Apache License 2.0
1.73k stars 57 forks source link

Add support for semantic labelling of grammar #9

Open flip111 opened 2 years ago

flip111 commented 2 years ago

Would be cool if the grammar supported semantic labels, there is quite a few things you can do with that. Such as

https://microsoft.github.io/language-server-protocol/specifications/specification-3-16/#textDocument_semanticTokens

Additionally labels for entry/exit and open/closed for variables can be useful to do something with data flow. See paper for more details

https://www.microsoft.com/en-us/research/wp-content/uploads/2016/07/hoopl-haskell10.pdf

jzimmerman commented 2 years ago

Agree, this would be a cool feature - assigning lower priority for now, as I want to make sure people can get the basic functionality running successfully.