X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fsyntax.h;h=da7b0907e37460d5b7041d32e2c921dee9473563;hb=69680f4d284cdf7b16a2966250a88ab1257862f3;hp=e7c642ba4abe0c9f4b2d8b91b065a85e499f0362;hpb=9ec831710f64a62ad5f2e896a55ae82a3519f29e;p=libs%2Fgl.git diff --git a/source/glsl/syntax.h b/source/glsl/syntax.h index e7c642ba..da7b0907 100644 --- a/source/glsl/syntax.h +++ b/source/glsl/syntax.h @@ -8,6 +8,7 @@ #include #include #include "features.h" +#include "glsl_error.h" #include "sourcemap.h" #pragma push_macro("interface") @@ -30,7 +31,8 @@ struct Operator enum Associativity { LEFT_TO_RIGHT, - RIGHT_TO_LEFT + RIGHT_TO_LEFT, + ASSOCIATIVE }; char token[4]; @@ -39,6 +41,8 @@ struct Operator Associativity assoc; static const Operator operators[]; + + static const Operator &get_operator(const std::string &, Type); }; enum @@ -127,6 +131,10 @@ struct Block: Node struct Expression: Node { + const Operator *oper; + + Expression(); + virtual Expression *clone() const = 0; }; @@ -188,11 +196,7 @@ struct MemberAccess: Expression struct UnaryExpression: Expression { - std::string oper; NodePtr expression; - bool prefix; - - UnaryExpression(); virtual UnaryExpression *clone() const { return new UnaryExpression(*this); } virtual void visit(NodeVisitor &); @@ -201,9 +205,7 @@ struct UnaryExpression: Expression struct BinaryExpression: Expression { NodePtr left; - std::string oper; NodePtr right; - std::string after; virtual BinaryExpression *clone() const { return new BinaryExpression(*this); } virtual void visit(NodeVisitor &); @@ -368,7 +370,7 @@ struct Conditional: Statement struct Iteration: Statement { - NodePtr init_statement; + NodePtr init_statement; NodePtr condition; NodePtr loop_expression; Block body; @@ -419,6 +421,7 @@ struct Stage std::map functions; std::map locations; Features required_features; + std::vector diagnostics; Stage(Type);