help-global
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Several parsers at once


From: Shigio YAMAGUCHI
Subject: Re: Several parsers at once
Date: Wed, 12 Apr 2017 10:23:25 +0900

Hello,
> Say in a project I have Cobol files (.cbl), C files (.h.c) and Shell
> files (.sh). What I would like to do is use global's own parser for the
> C files, so that I can have "find references" functionality. But I would
> like to use universal-ctags for the cobol and shell files (since global
> doesn't support those natively). Is this possible?

Of course.

> In this example:
> https://github.com/yoshizow/global-pygments-plugin/blob/master/sample.globalrc
> 'default' is both 'native' and 'pygments'. Does this mean both are used,

":tc=native:tc=pygments:" means:
If native parser exists for the target then it is used, else if pygments
parser exists it is used.

Since 'native' is specified before 'pygments', 'native' takes precedence.
Among langmaps, the first match is adopted.

> or does this line:
>
> :gtags_parser=C\:/usr/local/lib/gtags/pygments-parser.la:\
>
> mean that only the pygments-parser is used, even for the c files?

This means that '/usr/local/lib/gtags/pygments-parser.la' is used for language 'C'.
Built-in parser does not need 'gtags_parser', because language 'c' is parsed
by the built-in parser by default.
I am sorry that the description of the manual is inadequate.

Regards,
Shigio


2017-04-10 23:49 GMT+09:00 Joakim Jalap <address@hidden>:
Hello

I have searched through documentation and... well everything, but I
still haven't found what I'm looking for. What I'm wondering is: is
there a way to have multiple parsers working in the same project?

Say in a project I have Cobol files (.cbl), C files (.h.c) and Shell
files (.sh). What I would like to do is use global's own parser for the
C files, so that I can have "find references" functionality. But I would
like to use universal-ctags for the cobol and shell files (since global
doesn't support those natively). Is this possible?

In almost all the examples of a gtags.conf I have found online, you have
to choose _either_ 'native' or 'universal-ctags'. I would like to have
both at the same time, and which one to use decided on a file by file
basis by the file ending.

In this example:
https://github.com/yoshizow/global-pygments-plugin/blob/master/sample.globalrc

'default' is both 'native' and 'pygments'. Does this mean both are used,
or does this line:

:gtags_parser=C\:/usr/local/lib/gtags/pygments-parser.la:\

mean that only the pygments-parser is used, even for the c files?

Regards,
Joakim

_______________________________________________
Help-global mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-global



--
Shigio YAMAGUCHI <address@hidden>
PGP fingerprint: 
26F6 31B4 3D62 4A92 7E6F  1C33 969C 3BE3 89DD A6EB (Currently in use)
D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3 (Used until 2017/2)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]