Note that there are some explanatory texts on larger screens.

plurals
  1. POC source analysis
    primarykey
    data
    text
    <p>Its time to ask: I need a C preprocessor library.</p> <p>There's an identical <a href="https://stackoverflow.com/questions/6835699/c-preprocessor-library">question</a> on this, but I don't think that relying on an external application like <em>cpp</em> will solve my needs.</p> <p>I'm trying to analyse a C-style language which supports C preprocessor. The information I need to produce is the list of preprocessor symbols that the underlying source code depends on. Optionally, I need to solve <em>conditional</em> preprocessor directives, given a set of defined preprocessor symbols and include paths.</p> <p>My initial solution was my own regex-based implementation, but (as you can imagine) it cannot work in all cases. Macro substitutions, multiple parenthesis, string concatenation, macro arguments are examples on what I shall face to get it right. You can find my (partial) implementation <a href="https://codereview.stackexchange.com/questions/6714/c-preprocessor-regular-expression">here</a>.</p> <p>So, I'm looking a library (preferably on .NET, but it is not required) which allow me to get information about all preprocessor symbols declared (or supposed to be declared) in source code and their definition (hence their inter-dependencies).</p> <p>Are there any solution?</p> <hr> <p>The main goal would be the management of OpenGL Shading Language sources. One of the used techiques to manage those source is the preprocessor conditional (using standard C preprocessor): one single source for getting many shader programs without using run-time conditionals (improve performances).</p> <p>The preprocessor information is used for source analysis, source editing (especially syntax grayout functionality), and (more important) compiled shader object caching.</p> <p>Compiled shader object caching allow faster program linkage by caching objects composing future programs (avoid repeated compilation of the same sources). Caching is based on the source text and the compilation parameters (indeed the defined preprocessor symbols). Indeed the application shall analyse the source code for getting a list of symbols used in the conditional: this list is used for computing cache hash values.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload