3 ms·
Ok, I'm curious! What might such a tool look like or do? Did you have something specific in mind?
by thedirt0115 7y ago
Ok, I'm curious! What might such a tool look like or do? Did you have something specific in mind?
- cdo256 7y agoI could imagine two tools: 1. A tool that parses the text and draws red underlines on all the errors, this exists but (at least for C++ in VS 2017) it is quite slow. 2. A tool that automatically populates and updates types of variables and functions. Both of these could be achieved by somehow decoupling the front-end (as in before semantic analysis) of compilers and making them output the AST in some standardized tree-structured format like XML.
- dr_baba 7y agoDoesn’t the Language Server Protocol already do this, just via JSON instead of XML? I believe at least some LSP backends (e.g. clangd) just reuse a compiler AST and feed the data to your editor?