]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/syntax.h
Split tokenizer and preprocessor out of the GLSL parser
[libs/gl.git] / source / glsl / syntax.h
index a2630ef06b52111b407daa8dd8d1c73ea7583260..deb2c78027c0debcddaeac9eb0b24a4f693ec51e 100644 (file)
@@ -16,6 +16,30 @@ namespace Msp {
 namespace GL {
 namespace SL {
 
+struct Operator
+{
+       enum Type
+       {
+               NO_OPERATOR,
+               BINARY,
+               PREFIX,
+               POSTFIX
+       };
+
+       enum Associativity
+       {
+               LEFT_TO_RIGHT,
+               RIGHT_TO_LEFT
+       };
+
+       char token[4];
+       unsigned precedence;
+       Type type;
+       Associativity assoc;
+
+       static const Operator operators[];
+};
+
 struct NodeVisitor;
 
 struct Node