7 class CodeOutputInterface;
10 /** @brief Wrapper for to let libclang assisted parsing. */
14 /** Returns the one and only instance of the class */
15 static ClangParser *instance();
17 /** Start parsing a file.
18 * @param[in] fileName The name of the file to parse.
19 * @param[in,out] filesInTranslationUnit Other files that are
20 * part of the input and included by the file.
21 * The function will return a subset of the files,
22 * only including the onces that were actually found
25 void start(const char *fileName,QStrList &filesInTranslationUnit);
27 /** Switches to another file within the translation unit started
29 * @param[in] fileName The name of the file to switch to.
31 void switchToFile(const char *fileName);
33 /** Finishes parsing a translation unit. Free any resources that
34 * were needed for parsing.
38 /** Looks for \a symbol which should be found at \a line and
39 * returns a clang unique reference to the symbol.
41 QCString lookup(uint line,const char *symbol);
43 /** writes the syntax highlighted source code for a file
44 * @param[out] ol The output generator list to write to.
45 * @param[in] fd The file to write sources for.
47 void writeSources(CodeOutputInterface &ol,FileDef *fd);
50 void linkIdentifier(CodeOutputInterface &ol,FileDef *fd,
51 uint &line,uint &column,
52 const char *text,int tokenIndex);
53 void linkMacro(CodeOutputInterface &ol,FileDef *fd,
54 uint &line,uint &column,
56 void linkInclude(CodeOutputInterface &ol,FileDef *fd,
57 uint &line,uint &column,
59 void determineInputFilesInSameTu(QStrList &filesInTranslationUnit);
63 virtual ~ClangParser();
64 static ClangParser *s_instance;