]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/preprocessor.h
Split tokenizer and preprocessor out of the GLSL parser
[libs/gl.git] / source / glsl / preprocessor.h
diff --git a/source/glsl/preprocessor.h b/source/glsl/preprocessor.h
new file mode 100644 (file)
index 0000000..9697030
--- /dev/null
@@ -0,0 +1,37 @@
+#ifndef MSP_GL_SL_PREPROCESSOR_H_
+#define MSP_GL_SL_PREPROCESSOR_H_
+
+#include <sigc++/signal.h>
+#include "syntax.h"
+
+namespace Msp {
+namespace GL {
+namespace SL {
+
+class Tokenizer;
+
+class Preprocessor
+{
+public:
+       sigc::signal<void, const Version &> signal_version;
+       sigc::signal<void, StageType> signal_stage_change;
+
+private:
+       Tokenizer &tokenizer;
+
+public:
+       Preprocessor(Tokenizer &);
+
+       void preprocess();
+private:
+       void preprocess_version();
+       void preprocess_pragma();
+       void preprocess_pragma_msp();
+       void preprocess_stage();
+};
+
+} // namespace SL
+} // namespace GL
+} // namespace Msp
+
+#endif