CDT Language

org.eclipse.cdt.core.language

CDT 3.1

This extension point is used to declare a language or language variant. Languages define how the C model of a file is created (e.g. to populate the outline view). It also provides hooks to override the low level parsing of translation units into an abstract syntax tree. Practically this is limited to C/C++ language variants only. Completely different languages cannot be modelled reasonably using this extension point.

<!ELEMENT extension ((language | pdomLinkageFactory))+>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #IMPLIED

name  CDATA #IMPLIED>


<!ELEMENT language (contentType)*>

<!ATTLIST language

id    CDATA #REQUIRED

name  CDATA #REQUIRED

class CDATA #REQUIRED>


<!ELEMENT contentType EMPTY>

<!ATTLIST contentType

id CDATA #IMPLIED>


<!ELEMENT pdomLinkageFactory EMPTY>

<!ATTLIST pdomLinkageFactory

id    CDATA #REQUIRED

class CDATA #REQUIRED>


<language class=

"org.eclipse.cdt.core.dom.ast.gnu.c.GCCLanguage"

id=

"gcc"

name=

"GNU C"

>

<contentType id=

"org.eclipse.cdt.core.cSource"

/>

<contentType id=

"org.eclipse.cdt.core.cHeader"

/>

</language>

Clients need to extend the abstract class org.eclipse.core.model.AbstractLanguage.

CDT comes with following built-in languages: org.eclipse.cdt.core.language.gcc (GNU C) and org.eclipse.cdt.core.language.g++ (GNU C++).

The respective language implementations are org.eclipse.cdt.core.dom.ast.gnu.c.GCCLanguage and org.eclipse.cdt.core.dom.ast.gnu.cpp.GPPLanguage