Re: Several parsers at once
Shigio YAMAGUCHI <[email protected]> Wed, 12 Apr 2017 10:23:25 +0900
| Newsgroups | gmane.comp.gnu.global.general |
|---|---|
| Message-ID | <CADJmJYodeUq++xRu2XkrBe5T4A17ZZP7wTGgv74mLpcim_29dQ@mail.gmail.com> |
--===============7615299409724420060== Content-Type: multipart/alternative; boundary=001a113c5910216985054cee0e10 --001a113c5910216985054cee0e10 Content-Type: text/plain; charset=UTF-8 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 <[email protected]>: > 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 > [email protected] > https://lists.gnu.org/mailman/listinfo/help-global > -- Shigio YAMAGUCHI <[email protected]> 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) --001a113c5910216985054cee0e10 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>Hello,</div><div>> Say in a project I have Cobol f= iles (.cbl), C files (.h.c) and Shell</div><div>> files (.sh). What I wo= uld like to do is use global's own parser for the</div><div>> C file= s, so that I can have "find references" functionality. But I woul= d</div><div>> like to use universal-ctags for the cobol and shell files = (since global</div><div>> doesn't support those natively). Is this p= ossible?</div><div><br></div><div>Of course.</div><div><br></div><div>> = In this example:</div><div>> <a href=3D"https://github.com/yoshizow/glob= al-pygments-plugin/blob/master/sample.globalrc">https://github.com/yoshizow= /global-pygments-plugin/blob/master/sample.globalrc</a></div><div>>=C2= =A0</div><div>> 'default' is both 'native' and 'pygm= ents'. Does this mean both are used,</div><div><br></div><div>":tc= =3Dnative:tc=3Dpygments:" means:</div><div><span class=3D"gmail-Apple-= tab-span" style=3D"white-space:pre"> </span>If native parser exists for the= target then it is used, else if pygments</div><div><span class=3D"gmail-Ap= ple-tab-span" style=3D"white-space:pre"> </span>parser exists it is used.</= div><div><br></div><div>Since 'native' is specified before 'pyg= ments', 'native' takes precedence.</div><div>Among langmaps, th= e first match is adopted.</div><div><br></div><div>> or does this line:<= /div><div>></div><div>> :gtags_parser=3DC\:/usr/local/lib/gtags/<a hr= ef=3D"http://pygments-parser.la">pygments-parser.la</a>:\</div><div>></d= iv><div>> mean that only the pygments-parser is used, even for the c fil= es?</div><div><br></div><div>This means that '/usr/local/lib/gtags/<a h= ref=3D"http://pygments-parser.la">pygments-parser.la</a>' is used for l= anguage 'C'.</div><div>Built-in parser does not need 'gtags_par= ser', because language 'c' is parsed</div><div>by the built-in = parser by default.</div><div>I am sorry that the description of the manual = is inadequate.</div><div><br></div><div>Regards,</div><div>Shigio</div><div= ><br></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">2017-0= 4-10 23:49 GMT+09:00 Joakim Jalap <span dir=3D"ltr"><<a href=3D"mailto:j= [email protected]" target=3D"_blank">[email protected]</a>&g= t;</span>:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;= border-left:1px #ccc solid;padding-left:1ex">Hello<br> <br> I have searched through documentation and... well everything, but I<br> still haven't found what I'm looking for. What I'm wondering is= : is<br> there a way to have multiple parsers working in the same project?<br> <br> Say in a project I have Cobol files (.cbl), C files (.h.c) and Shell<br> files (.sh). What I would like to do is use global's own parser for the= <br> C files, so that I can have "find references" functionality. But = I would<br> like to use universal-ctags for the cobol and shell files (since global<br> doesn't support those natively). Is this possible?<br> <br> In almost all the examples of a gtags.conf I have found online, you have<br= > to choose _either_ 'native' or 'universal-ctags'. I would l= ike to have<br> both at the same time, and which one to use decided on a file by file<br> basis by the file ending.<br> <br> In this example:<br> <a href=3D"https://github.com/yoshizow/global-pygments-plugin/blob/master/s= ample.globalrc" rel=3D"noreferrer" target=3D"_blank">https://github.com/yos= hizow/<wbr>global-pygments-plugin/blob/<wbr>master/sample.globalrc</a><br> <br> 'default' is both 'native' and 'pygments'. Does thi= s mean both are used,<br> or does this line:<br> <br> :gtags_parser=3DC\:/usr/local/<wbr>lib/gtags/<a href=3D"http://pygments-par= ser.la" rel=3D"noreferrer" target=3D"_blank">pygments-parser.la</a>:\<br> <br> mean that only the pygments-parser is used, even for the c files?<br> <br> Regards,<br> Joakim<br> <br> ______________________________<wbr>_________________<br> Help-global mailing list<br> <a href=3D"mailto:[email protected]">[email protected]</a><br> <a href=3D"https://lists.gnu.org/mailman/listinfo/help-global" rel=3D"noref= errer" target=3D"_blank">https://lists.gnu.org/mailman/<wbr>listinfo/help-g= lobal</a><br> </blockquote></div><br><br clear=3D"all"><div><br></div>-- <br><div class= =3D"gmail_signature" data-smartmail=3D"gmail_signature"><div dir=3D"ltr"><d= iv><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr">Shig= io YAMAGUCHI <<a href=3D"mailto:[email protected]" target=3D"_blank">shigio= @gnu.org</a>></div><div dir=3D"ltr"><div dir=3D"ltr">PGP fingerprint:=C2= =A0</div><div dir=3D"ltr">26F6 31B4 3D62 4A92 7E6F =C2=A01C33 969C 3BE3 89D= D A6EB (Currently in use)</div><div dir=3D"ltr">D1CB 0B89 B346 4AB6 5663 = =C2=A0C4B6 3CA5 BBB3 57BE DDA3 (Used until 2017/2)</div></div></div></div><= /div></div></div></div> </div></div> --001a113c5910216985054cee0e10-- --===============7615299409724420060== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Help-global mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-global --===============7615299409724420060==--