qorelanguage / qore

Qore Programming Language
GNU General Public License v2.0
58 stars 10 forks source link

Introduce proper doxygen support for Qore #3034

Open sejvlond opened 5 years ago

sejvlond commented 5 years ago

Instead of using qdx which does some hacking and preprocessing of qore files so they can be used with doxygen, investigate the possibility of proper support. See https://www.stack.nl/~dimitri/doxygen/manual/faq.html

My favorite programming language is X. Can I still use doxygen?

No, not as such; doxygen needs to understand the structure of what it reads. If you don't mind spending some time on it, there are several options:

  • If the grammar of X is close to C or C++, then it is probably not too hard to tweak src/scanner.l a bit so the language is supported. This is done for all other languages directly supported by doxygen (i.e. Java, IDL, C#, PHP).
  • If the grammar of X is somewhat different than you can write an input filter that translates X into something similar enough to C/C++ for doxygen to understand (this approach is taken for VB, Object Pascal, and Javascript, see http://www.stack.nl/~dimitri/doxygen/download.html#helpers).
  • If the grammar is completely different one could write a parser for X and write a backend that produces a similar syntax tree as is done by src/scanner.l (and also by src/tagreader.cpp while reading tag files).
davidnich commented 5 years ago

@sejvlond qdx's approach is the 2nd one, but the implementation is a mess