XML language API ideas

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.

2 comments
Comment actions Permalink

I mis-spoke, 6,len-6 works, but 4,len-4 doesn't.

0
Comment actions Permalink

Keith Lea wrote:

I mis-spoke, 6,len-6 works, but 4,len-4 doesn't.

I replied to the wrong post. This is a reply to "PsiReference provided by
ReferenceProvider ignored"

0

Please sign in to leave a comment.