Does anyone know where I could review a syntax diagram (also call railroad diagram) for the mumps language?
I know that the yottadb programmers guide will provide syntax information for a particular command. Here is one for "DO"
D[O][:tvexpr] [entryref[(expr|.lvn[,...])][:tvexpr][,...]]
And there is this excellent language reference:
But this doesn't seem to have all the details about allowed syntax.
And the VA's XINDEX code does some analysis, but I don't know the details.
The reason I'm interested is that I've been reading about the Language Server Protocol (LSP), which is a Microsoft solution to abstract how various editors can interact with the LSP to get syntax information. All the good stuff that IntelliSense provides. Here is more information about LSP's
https://microsoft.github.io/language-server-protocol/
I think it would be cool to have this for mumps. It would be a very large project, and I'm not sure I'm willing to launch into it. But one of the first steps, according to chatGPT, is for the LSP code to create an Abstract Syntax Tree (AST). Essentially, the LSP needs to parse the source code such that it can then rapidly provide code insight across large projects etc.
So that leads me finally to the idea of parsing mumps code. I have previously written some code that extracts out functions calls etc to allow tracking code dependencies. But it would be nicer to have a more accurate parser.
Summary: Any formal syntax parsing tools for mumps?
Thanks
Kevin