diff --git a/src/libs/glsl/glsl.g b/src/libs/glsl/glsl.g index 7d09e2433f875f543de48065f77d2c19070bcf60..c35a0eceacf7f89bdc6aaa4ed766fa138320ce14 100644 --- a/src/libs/glsl/glsl.g +++ b/src/libs/glsl/glsl.g @@ -460,7 +460,7 @@ switch(ruleno) { variable_identifier ::= IDENTIFIER ; /. case $rule_number: { - ast(1) = new IdentifierExpression(*sym(1).string); + ast(1) = new IdentifierExpression(sym(1).string); } break; ./ diff --git a/src/libs/glsl/glslast.h b/src/libs/glsl/glslast.h index 8f9b3d614c4f19566b6a6f0b69e8efbd972209e7..4f861533c7571152356e168e7bf0252233bd6618 100644 --- a/src/libs/glsl/glslast.h +++ b/src/libs/glsl/glslast.h @@ -286,7 +286,7 @@ public: class GLSL_EXPORT IdentifierExpression: public Expression { public: - IdentifierExpression(const std::string &_name) + IdentifierExpression(const std::string *_name) : Expression(Kind_Identifier), name(_name) {} ~IdentifierExpression(); @@ -295,13 +295,13 @@ public: virtual void accept0(Visitor *visitor); public: // attributes - std::string name; + const std::string *name; }; class GLSL_EXPORT LiteralExpression: public Expression { public: - LiteralExpression(const std::string &_value) + LiteralExpression(const std::string *_value) : Expression(Kind_Literal), value(_value) {} ~LiteralExpression(); @@ -310,7 +310,7 @@ public: virtual void accept0(Visitor *visitor); public: // attributes - std::string value; + const std::string *value; }; class GLSL_EXPORT BinaryExpression: public Expression @@ -380,7 +380,7 @@ public: // attributes class GLSL_EXPORT MemberAccessExpression: public Expression { public: - MemberAccessExpression(Expression *_expr, const std::string &_field) + MemberAccessExpression(Expression *_expr, const std::string *_field) : Expression(Kind_MemberAccess), expr(_expr), field(_field) {} ~MemberAccessExpression(); @@ -390,15 +390,15 @@ public: public: // attributes Expression *expr; - std::string field; + const std::string *field; }; class GLSL_EXPORT FunctionCallExpression: public Expression { public: - FunctionCallExpression(const std::string &_name) + FunctionCallExpression(const std::string *_name) : Expression(Kind_FunctionCall), expr(0), name(_name) {} - FunctionCallExpression(Expression *_expr, const std::string &_name) + FunctionCallExpression(Expression *_expr, const std::string *_name) : Expression(Kind_MemberFunctionCall), expr(_expr), name(_name) {} ~FunctionCallExpression(); @@ -410,7 +410,7 @@ public: public: // attributes Expression *expr; - std::string name; + const std::string *name; std::vector<Expression *> arguments; }; @@ -632,7 +632,7 @@ public: // attributes class GLSL_EXPORT NamedType: public Type { public: - NamedType(const std::string &_name) : Type(Kind_NamedType), name(_name) {} + NamedType(const std::string *_name) : Type(Kind_NamedType), name(_name) {} ~NamedType(); virtual NamedType *asNamedType() { return this; } @@ -645,7 +645,7 @@ public: virtual Type *clone() const; public: // attributes - std::string name; + const std::string *name; }; class GLSL_EXPORT ArrayType: public Type @@ -675,7 +675,7 @@ class GLSL_EXPORT StructType: public Type { public: StructType() : Type(Kind_AnonymousStructType) {} - StructType(const std::string &_name) + StructType(const std::string *_name) : Type(Kind_StructType), name(_name) {} ~StructType(); @@ -691,13 +691,13 @@ public: class Field: public AST { public: - Field(const std::string &_name) + Field(const std::string *_name) : AST(Kind_StructField), name(_name), type(0) {} // Takes the outer shell of an array type with the innermost // element type set to null. The fixInnerTypes() method will // set the innermost element type to a meaningful value. - Field(const std::string &_name, Type *_type) + Field(const std::string *_name, Type *_type) : AST(Kind_StructField), name(_name), type(_type) {} ~Field(); @@ -706,7 +706,7 @@ public: void setInnerType(Type *innerType); - std::string name; + const std::string *name; Type *type; }; @@ -717,7 +717,7 @@ public: void addFields(const std::vector<Field *> &list); public: // attributes - std::string name; + const std::string *name; std::vector<Field *> fields; }; diff --git a/src/libs/glsl/glslparser.cpp b/src/libs/glsl/glslparser.cpp index fd9fb26d94df7021fa0f67370fd84b9f4e129f57..d3dbd093d79d66af3bd39ee7658c71c7dc0d06a9 100644 --- a/src/libs/glsl/glslparser.cpp +++ b/src/libs/glsl/glslparser.cpp @@ -167,7 +167,7 @@ switch(ruleno) { #line 461 "./glsl.g" case 0: { - ast(1) = new IdentifierExpression(*sym(1).string); + ast(1) = new IdentifierExpression(sym(1).string); } break; #line 468 "./glsl.g"