X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fsyntax.h;h=86972869f2fe03ed2ebdce4bf47efe4e98d1aa5b;hb=3a1fe83;hp=3976af56aa77c97b2a8f430daa89514004209628;hpb=cc3f4aaaf8d2b34347f69b026c10f82797059aa4;p=libs%2Fgl.git diff --git a/source/glsl/syntax.h b/source/glsl/syntax.h index 3976af56..86972869 100644 --- a/source/glsl/syntax.h +++ b/source/glsl/syntax.h @@ -27,7 +27,8 @@ struct Operator NO_OPERATOR, BINARY, PREFIX, - POSTFIX + POSTFIX, + TERNARY }; enum Associativity @@ -259,6 +260,16 @@ struct Assignment: BinaryExpression virtual void visit(NodeVisitor &); }; +struct TernaryExpression: Expression +{ + NodePtr condition; + NodePtr true_expr; + NodePtr false_expr; + + virtual TernaryExpression *clone() const { return new TernaryExpression(*this); } + virtual void visit(NodeVisitor &); +}; + struct FunctionCall: Expression { std::string name; @@ -449,6 +460,7 @@ struct FunctionDeclaration: Statement NodeArray parameters; Block body; + std::string signature; FunctionDeclaration *definition; TypeDeclaration *return_type_declaration;