Open kaby76 opened 3 months ago
My thinking is to have attributes defined in a list of elements.
transformGrammar.py
only works on a file, not the whole set of template files.
<?xml version="1.0" encoding="UTF-8" ?>
<desc xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../_scripts/desc.xsd">
<target>
<name>Cpp</name>
<files>*.g4</files>
<modifiers>
<attr>this.</attr>
<repl>this->.</repl>
</modifiers>
</target>
</desc>
Here, an "attribute" can just be a pattern that is replaced.
<?xml version="1.0" encoding="UTF-8" ?>
<desc xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../_scripts/desc.xsd">
<target>
<name>Java</name>
<modifiers>
<attr>package</attr>
<repl>org.antlr4.python</repl>
</modifiers>
</target>
</desc>
See https://github.com/antlr/grammars-v4/pull/4020.