| Selection of Language Extension [message #644847] |
Tue, 14 December 2010 08:21  |
A Hoyle Messages: 21 Registered: November 2010 |
Junior Member |
|
|
Hi All
I am trying to improve the SDCC (Small Devices C Compiler) integration with Eclipse CDT. In particular I am trying to add some additional keywords. I have written a class which extends GCCLanguage. I have also written a class that implements ICLanguageKeywords and a class that extends GNUScannerExtensionConfiguration. I have also added an extension point to org.eclipse.cdt.core.language
<extension
id="SDCCLanguageExtension"
name="SDCC Language Extension"
point="org.eclipse.cdt.core.language">
<language
class="net.sourceforge.eclipsesdcc.language.SDCCLanguage"
id="sdcc"
name="SDCC C">
<contentType id="org.eclipse.cdt.core.cSource"/>
<contentType id="org.eclipse.cdt.core.cHeader"/>
</language>
</extension>
By selecting "Properties" from the Project menu and selecting my language from "C/C++ General / Language Mapping" I am now able to use my additional keywords with keyword highlighting and no syntax warnings.
My question is how do I automatically map my language to ".c" and ".h" files for project developed using my tool chain. I have tried adding an extension to org.eclipse.core.contenttype.contentTypes with no success.
I have tried creating to new file extensions "cap" and "hap" just as a test.
<extension point="org.eclipse.core.contenttype.contentTypes">
<!-- declares a content type for C source files -->
<content-type id="cSDCCSource" name="SDCCSourceName"
base-type="org.eclipse.cdt.core.cSource"
file-extensions="cap"
priority="high"/>
<!-- declares a content type for C header files -->
<content-type id="cSDCCHeader" name="SDCCHeaderName"
base-type="org.eclipse.cdt.core.cHeader"
file-extensions="hap"
priority="high"/>
</extension>
and I added
<contentType id="mypluglin.cSDCCSource "/>
<contentType id="mypluglin.cSDCCHeader "/>
to the org.eclipse.cdt.core.language above but this didn't seem to work.
I have tried looking thorough other postings on here and I am sure others have succeed in doing similar language extension, but I just can't figure this bit out.
All help welcome.
|
|
|
| Re: Selection of Language Extension [message #645029 is a reply to message #644847] |
Wed, 15 December 2010 04:48   |
A Hoyle Messages: 21 Registered: November 2010 |
Junior Member |
|
|
Hi All
Worryingly it seems to have started working. I am not sure what I have changed. The lanuage extension xml code looks that same as in the previous post, but it is now correctly highlighting keywords and not generating unwanted syntax errors.
Thanks to looking
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01670 seconds