Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] add new keyword recognize by the dom parser

>Are you using different ILanguages for the header and source files?  
yes, by implementing the ICLanguageKeywords (popc header files) are based on the class PopCPP it extends
- source file are the normal .cc form CDT so based on GPPLanguage

Plugin.xml :
 <!-- Pop-C++ language declaration -->
        <!-- associate a content type to the language -->
        <contentType id="ch.eif.popc.popcHeader"/>

PopCPP  file :
public class PopCPP extends GPPLanguage {

        //used to add the parclass{
	protected static final POPCscannerExtensionConfiguration
POPC_SCANNER_EXTENSION = new POPCscannerExtensionConfiguration(); 

        public String[] getKeywords() to add new keywords

	protected IScannerExtensionConfiguration getScannerExtensionConfiguration()


POPCscannerExtensionConfiguration file :
public class POPCscannerExtensionConfiguration extends
GPPScannerExtensionConfiguration {

	public static final String PARCLASS = "parclass";
	public static final char[] popcPARCLASS = "parclass".toCharArray();

	public CharArrayIntMap getAdditionalKeywords() {
		additionalCPPKeywords.put( POPCscannerExtensionConfiguration.popcPARCLASS,
return additionalCPPKeywords;

>How different is POPC++ from regular C++? 
parclass as no extra syntax and use the same format as class, it is intend
for parallel use and so is a real class with some restriction (for example :
There are no methods that return memory address references)

parclass contains a special format for some method : 
for example : sync mutex void getResult(int i, Matrix2Dlc &r, float &t); 
The outline view propaged getResult correctly. 
So this is not actualy an issue.

the special keyword who made us some problems is the following, function can
have some parameters for distributed application :
Bird(float P) @{ od.power(P);
                 od.protocol("socket http"); };
The @ keywords is identified as  a Bad character sequence encountered : @
from the AST
The coloration for this part was implemented using : public final class
FastPopCPartitionScanner implements IPartitionTokenScanner, ICPartitions {

So I hope this give you enough information about the configuration.
I know that I will  probably not have enough time to implement all that
part. But it would be important to us to know if this is a good solution for
the future. If C99 would help us.

Thank you for your help,


View this message in context:
Sent from the Eclipse CDT - Development mailing list archive at

Back to the top