Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mdt-ocl.dev] Xtext to LPG

Hi

I made a relatively small Xtext grammar change and suddenly got stupid syntax errors, probably because a magic backtracking precedence flipped. I therefore started updating the 'equivalent' LPG grammar to look for a conflict and realized that the time had come to look at automated Xtext to LPG conversion; it's relatively easy.

I've therefore developed/am developing a Tx cascade
QVTo: *.xtext -> *.xtext.XBNF to get a fully referential EBNF model from the Xtext CST QVTo: *.xtext.XBNF -> *.xtext.normal.XBNF to convert to a disjunct of conjuncts BNF QVTo: *.normal.XBNF -> *.inline.XBNF to re-inline non-recursive references that were originally from a single rule
Acceleo: *.inline.XBNF -> *.g, *.gi

(XBNF is Xtext BNF, i.e BNF with model annotations)

Currently plausible KWLexer and Parser grammars are generated, Lexer still todo; the Xtext and LPG styles are very different.

Action code still to do; should be easy with all the model annotations.

Unfortunately there is no QVTo standalone support so I also had to develop that and the corresponding MWE integration.

The build scripts are in the build plugin. The transformations in the examples.xtext2lpg plugin.

Since only the build plugin has QVTo dependencies and neither of the above plugins are in the Tools build, I don';t think that there is any releng impact.

    Regards

        Ed Willink




Back to the top