Author Topic: Implementing a parser dylib  (Read 1530 times)

uwe.solter

  • Junior Community Member
  • Posts: 4
  • Hero Points: 0
Implementing a parser dylib
« on: October 06, 2023, 07:26:08 PM »
I tried to implement a macro for SDL/PR context tagging and started with proc_search implementation, which does most of the job but turned out not to be the proper method for adding a list of symbols into the tag file like for

KEYWORD Item1, Item2, ... ItemN;

The definition of Item consists of an identifier optionally followed by a list of attributes enclosed in parenthesis like Item( a1, a2 ... aN );
In addition line and block comments can appear almost everywhere.

From the macro source code I learned that the proper method would be to implement something like a vssdl_list_tags() however found no sample code and assume that implementations are part of language specific DLLs (or shared object libs).
I assume that such DLLs implement full fledged parsers and lexers for a language and call the tag database interface to insert tags. As I do have a bison/flex based implementation for the SDL/PR derivative I would want to support it's probably a low hanging fruit to build this into a DLL and implement the list_tags to search for 'global variables' and add them to the tag file.
Is there any documentation or sample code available that would show how to implement this?