Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] changes in grammar


Thanks Mike,

Seems that I have lousily defined my question.

Following is all I have done:

1)      Removed keywords to the c99 grammar in org.eclipse.cdt\lrparser\org.eclipse.cdt.core.lrparser\grammar\c99\C99Grammar.g

2)      Generated parser (org.eclipse.cdt\lrparser\org.eclipse.cdt.core.lrparser\src\org\eclipse\cdt\internal\core\dom\lrparser\c99\*.java)

3)      Commented the cases corresponding to removed keywords in org.eclipse.cdt\lrparser\org.eclipse.cdt.core.lrparser\src\org\eclipse\cdt\core\dom\lrparser\c99\

4)      Also changed the org.eclipse.cdt\lrparser\org.eclipse.cdt.core.lrparser\src\org\eclipse\cdt\core\dom\lrparser\action\c99\

5)      Rebuilt the CDT.


Since during the build process (org.eclipse.cdt\all\org.eclipse.cdt.releng\ CDT sources are checked out from the CVS and copied to org.eclipse.cdt\all\org.eclipse.cdt.releng\results\plugin for compilation, jarUpping, etc, I have done the following in order to be sure to compile the new grammar :

1)      Checked out the sources once

2)      Commented the fetch target in org.eclipse.cdt\all\org.eclipse.cdt.releng\tools\org.eclipse.releng.basebuilder\plugins\org.eclipse.pde.build_3.5.0.v20090521-1730\scripts\build.xml .

3)      Copied the newly generated parser to the org.eclipse.cdt\all\org.eclipse.cdt.releng\results\plugins\org.eclipse.cdt.core.lrparser\src\org\eclipse\cdt\internal\core\dom\lrparser\c99

4)      Copied updated to  org.eclipse.cdt\all\org.eclipse.cdt.releng\results\plugins\org.eclipse.cdt.core.lrparser\src\org\eclipse\cdt\core\dom\lrparser\c99\

5)      Also copied the updated to the org.eclipse.cdt\all\org.eclipse.cdt.releng\results\plugins\org.eclipse.cdt.core.lrparser\src\org\eclipse\cdt\core\dom\lrparser\action\c99

6)      and rebuild once again.


In comile.log I have seen that the updated files were indeed compiled.


Since I have only changed the c99 grammar in lrparser, I think have no need to provide a new implementation of ICLanguageKeywords or to override the getKeywords() method (neither to extend BaseExtensibleLanguage or override the getAdapter() method).


After these changes I thought that old keywords will not be highlighted anymore. But despite all above they are still highlighted. What's wrong in what I'm doing?



I know that this is no a correct way of doing thing, but first I wanted to change the grammar to "prove the concept" of the new grammar in the fastest way possible. Of course that in the next stage I will make something in the manner that done with upc.


And the second question is: is there an easy way to build only the lrparser feature (getting only org.eclipse.cdt.core.lrparser_ver.timestamp.jar at the end) without the rebuild of the whole CDT?




On Wed, Jul 8, 2009 at 6:41 PM, Mike Kucera<mkucera@xxxxxxxxxx> wrote:
> You still need to inform the editor syntax highlighting of which identifiers
> to treat as keywords, this is separate from how the parser recognizes
> keywords.
> To make this work you need to provide an implementation of
> ICLanguageKeywords. The easiest way to do this is to extend the
> CLanguageKeywords class and override the getKeywords() method. You will also
> need to extend BaseExtensibleLanguage and override the getAdapter() method
> to return your implementation of ICLanguageKeywords.
> Mike Kucera
> Software Developer
> IBM Eclipse CDT Team
> mkucera@xxxxxxxxxx
> David Sariel ---07/08/2009 11:27:03 AM---Hello,
> From:
> David Sariel <datosar@xxxxxxxxx>
> To:
> cdt-dev@xxxxxxxxxxx
> Date:
> 07/08/2009 11:27 AM
> Subject:
> [cdt-dev] changes in grammar
> ________________________________
> Hello,
> I have checked out the org.eclipse.cdt from CVS and:
> 1) Added several keyword  and added several new ones to the C99
> grammar (in
> I:\cdt-org.eclipse.cdt\lrparser\org.eclipse.cdt.core.lrparser\grammar)
> 2) Generated new parser
> 3) Rebuilt the CDT with the new parser
> While rebuilding I found that the build process compiles the files
> that are located in
> org.eclipse.cdt\all\org.eclipse.cdt.releng\Copy of results\plugins and
> I made sure that
> newly generated parser files were compiled (according to the compile.log) .
> But, while running the rebuilt IDE, the keyword that were supposed to
> be gone are still
> Highlighted by the IDE and newly added keywords are not highlighted at all.
> Any thoughts will be appreciated,
> David
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx

Back to the top