X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fsyntax.h;h=b8d9c1a6e98ab8325569a78a1242a6a4a44cff00;hb=911c6c4acc8218bc40d93917207f9dc32e9f2596;hp=3976af56aa77c97b2a8f430daa89514004209628;hpb=cc3f4aaaf8d2b34347f69b026c10f82797059aa4;p=libs%2Fgl.git diff --git a/source/glsl/syntax.h b/source/glsl/syntax.h index 3976af56..b8d9c1a6 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 @@ -38,7 +39,8 @@ struct Operator }; char token[4]; - unsigned precedence; + char token2[2]; + UInt8 precedence; Type type; Associativity assoc; @@ -259,6 +261,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; @@ -447,8 +459,11 @@ struct FunctionDeclaration: Statement std::string return_type; std::string name; NodeArray parameters; + bool virtua; + bool overrd; Block body; + std::string signature; FunctionDeclaration *definition; TypeDeclaration *return_type_declaration;