I know you guys at JB are planning for an XML language API so I thought I'd
share some ideas.
I've been writing custom plugin for completion, error highlighting, etc of
custom XML language which has no schema or DTD. I've started realizing that I'm
implementing many things that a standard parser + lexer would be doing if it
were an actual language of its own, not an XML language.
I think it would be very cool to be able to specify a parser for XML languages,
with custom PsiElement and ParserDefinition. I believe the relationship would be
like , so a
high-level AST would be built on top of the XmlTag/XmlAttribute/etc. AST.
I think maybe MPS would provide some of the answer to this. I'm not so familiar
with MPS but I think it would be cool to be able to edit an XML grammar, so
defining grammar for:
would be just as easy as defining grammar for language structure like:
5 + 10
And the resulting PSI could be MyPlusOperation with 2 children MyNumericOperand.
What do you, other plugin developers, think of this? I think it would simplify
many kinds of XML plugin development.