Author Topic: C++ tagging with custom keywords  (Read 4992 times)

mzel

  • Community Member
  • Posts: 29
  • Hero Points: 0
C++ tagging with custom keywords
« on: March 01, 2011, 10:54:16 pm »
I am sorry if this question has been asked. I have a problem with tagging.
Our company added custom build preprocessor.  Right now everything else after that keyword is not tagged. All I am trying to do is to ignore the whole line starting with that keyword.
I already added that in C/C++ -> Color Coding-> comments as a line comment to no effect. The color highlighting has picked it up just fine, but the tags are still missing.
Thanks in advance!

hs2

  • Senior Community Member
  • Posts: 2757
  • Hero Points: 291
Re: C++ tagging with custom keywords
« Reply #1 on: March 01, 2011, 11:05:15 pm »
Try to undefine / hide it from the tagging engine using 'C/C++ Preprocessing' and rebuild your tagfile.
FYI. Color Coding is using the results of the tagging engine (when using symbol colors) and is not controlling it.
Good luck, HS2

mzel

  • Community Member
  • Posts: 29
  • Hero Points: 0
Re: C++ tagging with custom keywords
« Reply #2 on: March 01, 2011, 11:43:44 pm »
Nope, this did not work. My words do not start with "#" . Modifying the lexer file .vlx directly did not help either. It did change the color of the words accordingly, but no effect o tagging.

what I have is

SYSUTIL_IDENT_RCSID(foxpv_priceclasstiermapper_h,"$Id$ $CSID$ $CCId: $")
SYSUTIL_PRAGMA_ONCE

/* normal CPP */

And I am trying to ignore those 2 lines

hs2

  • Senior Community Member
  • Posts: 2757
  • Hero Points: 291
Re: C++ tagging with custom keywords
« Reply #3 on: March 02, 2011, 12:34:43 am »
As mentioned the colorizer is a separate thing. Indirectly associated with tagging by using symbol based colorizing and in that case it's (kind of) a read-only client of the tag database built by the tagging engine.
How do you get your non-C/C++ sources compiled ? Every standard C/C++ compiler will throw an error when stumbling over you custom build  preprocessor 'macros'. I'm guessing the compiler gets the preprocessed sources as input, right ?
However, adding
#define SYSUTIL_IDENT_RCSID(f,s)
#define SYSUTIL_PRAGMA_ONCE
to the C/C++ Preprocessor configuration should hide these macros from the tagging engine successfully.
This SE feature is quite similar to your build preprocessor mechanism to tweak/assist the SE tagging engine to parse even exotic/incomplete codebases. It's applied internally by the SE C/C++ parser before deeply analyzing the code and maintain it's symbol ie. tag database.
HS2

mzel

  • Community Member
  • Posts: 29
  • Hero Points: 0
Re: C++ tagging with custom keywords
« Reply #4 on: March 02, 2011, 07:20:01 pm »
Thanks hs2!
That worked just fine. You should have told me to apply the brain towards the config change. Unfortunately that resource was in the dead-lock state last night.
Thanks  again!