X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fsyntax.cpp;h=71e5c39a948aabc7db12e701a80bcca32cfef3dc;hb=cc3f4aaaf8d2b34347f69b026c10f82797059aa4;hp=cb77419763645be5987842b9bd7d654eb30e13c5;hpb=041ba4b1acd55337239c5ce24cc310118c621206;p=libs%2Fgl.git diff --git a/source/glsl/syntax.cpp b/source/glsl/syntax.cpp index cb774197..71e5c39a 100644 --- a/source/glsl/syntax.cpp +++ b/source/glsl/syntax.cpp @@ -161,6 +161,18 @@ void MemberAccess::visit(NodeVisitor &visitor) } +Swizzle::Swizzle(): + count(0) +{ + fill(components, components+4, 0); +} + +void Swizzle::visit(NodeVisitor &visitor) +{ + visitor.visit(*this); +} + + void UnaryExpression::visit(NodeVisitor &visitor) { visitor.visit(*this); @@ -174,14 +186,12 @@ void BinaryExpression::visit(NodeVisitor &visitor) Assignment::Assignment(): - self_referencing(false), - target_declaration(0) + self_referencing(false) { } Assignment::Assignment(const Assignment &other): BinaryExpression(other), - self_referencing(other.self_referencing), - target_declaration(0) + self_referencing(other.self_referencing) { } void Assignment::visit(NodeVisitor &visitor) @@ -190,6 +200,24 @@ void Assignment::visit(NodeVisitor &visitor) } +Assignment::Target::Target(Statement *d): + declaration(d), + chain_len(0) +{ + fill(chain, chain+7, 0); +} + +bool Assignment::Target::operator<(const Target &other) const +{ + if(declaration!=other.declaration) + return declaration