Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Syntax coloring of new keywords

Hello, List!

My name is Sergey Smolov and I am need your help. My purpose is to make a syntax highlight for our extension of C++ language. This extension just contain about a one hundred of macro directives with different functionality.

For achieving such purpose I've started developing a plugin. Here is my "plugin.xml":

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
   <extension
         id="сppteskkeywords"
         name="CDT Language"
         point="org.eclipse.cdt.core.language">
      <language
            class="cppteskpluginide.Keywords"
            id="CppTESKPluginIDE.language1"
            name="CppTesKLanguage">
      </language>
   </extension>
</plugin>

and here is class, that contains necessary keywords:

import org.eclipse.cdt.core.dom.ast.gnu.c.GCCLanguage;
import org.eclipse.cdt.core.model.ICLanguageKeywords;

public class Keywords extends GCCLanguage implements ICLanguageKeywords
{
   
    public Object getAdapter(Keywords keywords)
    {
        return getAdapter(this);
    }
      
    public String[] getKeywords()
    {
        String[] array = new String[14];
       
       
/ array elements initialization
       
        return array;
    }

  
    public String[] getBuiltinTypes()
    {
        String[] array = new String[4];
       
       
/ array elements initialization
       
        return array;
    }
   
    public String[] getPreprocessorKeywords()
    {
        String[] array = new String[152];

        // array elements initialization
       
        return array;
    }

The main problem is that it didn't work in proper way, so I'd like to ask you the following question: what is the way for adding new keywords and making them  highlighted like C++? May be I miss something?

You will be much obliged if you will help me.
Thanks in advance!
-- 
Sincerely yours,
Sergey Smolov
ISP RAS

Back to the top