forked from qt-creator/qt-creator
Use QString instead of std::string in GLSL parser
This commit is contained in:
@@ -253,7 +253,7 @@ class GLSL_EXPORT Parser: public $table
|
|||||||
public:
|
public:
|
||||||
union Value {
|
union Value {
|
||||||
void *ptr;
|
void *ptr;
|
||||||
const std::string *string;
|
const QString *string;
|
||||||
AST *ast;
|
AST *ast;
|
||||||
List<AST *> *ast_list;
|
List<AST *> *ast_list;
|
||||||
Declaration *declaration;
|
Declaration *declaration;
|
||||||
@@ -290,7 +290,7 @@ public:
|
|||||||
} type_qualifier;
|
} type_qualifier;
|
||||||
struct {
|
struct {
|
||||||
Type *type;
|
Type *type;
|
||||||
const std::string *name;
|
const QString *name;
|
||||||
} param_declarator;
|
} param_declarator;
|
||||||
ParameterDeclaration *param_declaration;
|
ParameterDeclaration *param_declaration;
|
||||||
FunctionDeclaration *function_declaration;
|
FunctionDeclaration *function_declaration;
|
||||||
@@ -305,7 +305,7 @@ private:
|
|||||||
// 1-based
|
// 1-based
|
||||||
Value &sym(int n) { return _symStack[_tos + n - 1]; }
|
Value &sym(int n) { return _symStack[_tos + n - 1]; }
|
||||||
AST *&ast(int n) { return _symStack[_tos + n - 1].ast; }
|
AST *&ast(int n) { return _symStack[_tos + n - 1].ast; }
|
||||||
const std::string *&string(int n) { return _symStack[_tos + n - 1].string; }
|
const QString *&string(int n) { return _symStack[_tos + n - 1].string; }
|
||||||
Expression *&expression(int n) { return _symStack[_tos + n - 1].expression; }
|
Expression *&expression(int n) { return _symStack[_tos + n - 1].expression; }
|
||||||
Statement *&statement(int n) { return _symStack[_tos + n - 1].statement; }
|
Statement *&statement(int n) { return _symStack[_tos + n - 1].statement; }
|
||||||
Type *&type(int n) { return _symStack[_tos + n - 1].type; }
|
Type *&type(int n) { return _symStack[_tos + n - 1].type; }
|
||||||
@@ -1312,7 +1312,7 @@ case $rule_number: {
|
|||||||
(makeAstNode<QualifiedType>
|
(makeAstNode<QualifiedType>
|
||||||
(sym(1).qualifier, type(3), (List<LayoutQualifier *> *)0),
|
(sym(1).qualifier, type(3), (List<LayoutQualifier *> *)0),
|
||||||
ParameterDeclaration::Qualifier(sym(2).qualifier),
|
ParameterDeclaration::Qualifier(sym(2).qualifier),
|
||||||
(const std::string *)0);
|
(const QString *)0);
|
||||||
} break;
|
} break;
|
||||||
./
|
./
|
||||||
|
|
||||||
@@ -1321,7 +1321,7 @@ parameter_declaration ::= parameter_qualifier parameter_type_specifier ;
|
|||||||
case $rule_number: {
|
case $rule_number: {
|
||||||
ast(1) = makeAstNode<ParameterDeclaration>
|
ast(1) = makeAstNode<ParameterDeclaration>
|
||||||
(type(2), ParameterDeclaration::Qualifier(sym(1).qualifier),
|
(type(2), ParameterDeclaration::Qualifier(sym(1).qualifier),
|
||||||
(const std::string *)0);
|
(const QString *)0);
|
||||||
} break;
|
} break;
|
||||||
./
|
./
|
||||||
|
|
||||||
@@ -1565,7 +1565,7 @@ case $rule_number: {
|
|||||||
layout_qualifier_id ::= IDENTIFIER ;
|
layout_qualifier_id ::= IDENTIFIER ;
|
||||||
/.
|
/.
|
||||||
case $rule_number: {
|
case $rule_number: {
|
||||||
sym(1).layout = makeAstNode<LayoutQualifier>(string(1), (const std::string *)0);
|
sym(1).layout = makeAstNode<LayoutQualifier>(string(1), (const QString *)0);
|
||||||
} break;
|
} break;
|
||||||
./
|
./
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
#include "glsl.h"
|
#include "glsl.h"
|
||||||
#include "glslmemorypool.h"
|
#include "glslmemorypool.h"
|
||||||
#include <string>
|
#include <QtCore/qstring.h>
|
||||||
|
|
||||||
namespace GLSL {
|
namespace GLSL {
|
||||||
|
|
||||||
@@ -324,7 +324,7 @@ public:
|
|||||||
class GLSL_EXPORT IdentifierExpression: public Expression
|
class GLSL_EXPORT IdentifierExpression: public Expression
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
IdentifierExpression(const std::string *_name)
|
IdentifierExpression(const QString *_name)
|
||||||
: Expression(Kind_Identifier), name(_name) {}
|
: Expression(Kind_Identifier), name(_name) {}
|
||||||
|
|
||||||
virtual IdentifierExpression *asIdentifierExpression() { return this; }
|
virtual IdentifierExpression *asIdentifierExpression() { return this; }
|
||||||
@@ -332,13 +332,13 @@ public:
|
|||||||
virtual void accept0(Visitor *visitor);
|
virtual void accept0(Visitor *visitor);
|
||||||
|
|
||||||
public: // attributes
|
public: // attributes
|
||||||
const std::string *name;
|
const QString *name;
|
||||||
};
|
};
|
||||||
|
|
||||||
class GLSL_EXPORT LiteralExpression: public Expression
|
class GLSL_EXPORT LiteralExpression: public Expression
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LiteralExpression(const std::string *_value)
|
LiteralExpression(const QString *_value)
|
||||||
: Expression(Kind_Literal), value(_value) {}
|
: Expression(Kind_Literal), value(_value) {}
|
||||||
|
|
||||||
virtual LiteralExpression *asLiteralExpression() { return this; }
|
virtual LiteralExpression *asLiteralExpression() { return this; }
|
||||||
@@ -346,7 +346,7 @@ public:
|
|||||||
virtual void accept0(Visitor *visitor);
|
virtual void accept0(Visitor *visitor);
|
||||||
|
|
||||||
public: // attributes
|
public: // attributes
|
||||||
const std::string *value;
|
const QString *value;
|
||||||
};
|
};
|
||||||
|
|
||||||
class GLSL_EXPORT BinaryExpression: public Expression
|
class GLSL_EXPORT BinaryExpression: public Expression
|
||||||
@@ -412,7 +412,7 @@ public: // attributes
|
|||||||
class GLSL_EXPORT MemberAccessExpression: public Expression
|
class GLSL_EXPORT MemberAccessExpression: public Expression
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MemberAccessExpression(Expression *_expr, const std::string *_field)
|
MemberAccessExpression(Expression *_expr, const QString *_field)
|
||||||
: Expression(Kind_MemberAccess), expr(_expr), field(_field) {}
|
: Expression(Kind_MemberAccess), expr(_expr), field(_field) {}
|
||||||
|
|
||||||
virtual MemberAccessExpression *asMemberAccessExpression() { return this; }
|
virtual MemberAccessExpression *asMemberAccessExpression() { return this; }
|
||||||
@@ -421,7 +421,7 @@ public:
|
|||||||
|
|
||||||
public: // attributes
|
public: // attributes
|
||||||
Expression *expr;
|
Expression *expr;
|
||||||
const std::string *field;
|
const QString *field;
|
||||||
};
|
};
|
||||||
|
|
||||||
class GLSL_EXPORT FunctionCallExpression: public Expression
|
class GLSL_EXPORT FunctionCallExpression: public Expression
|
||||||
@@ -449,7 +449,7 @@ public: // attributes
|
|||||||
class GLSL_EXPORT FunctionIdentifier: public AST
|
class GLSL_EXPORT FunctionIdentifier: public AST
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FunctionIdentifier(const std::string *_name)
|
FunctionIdentifier(const QString *_name)
|
||||||
: AST(Kind_FunctionIdentifier), name(_name), type(0) {}
|
: AST(Kind_FunctionIdentifier), name(_name), type(0) {}
|
||||||
FunctionIdentifier(Type *_type)
|
FunctionIdentifier(Type *_type)
|
||||||
: AST(Kind_FunctionIdentifier), name(0), type(_type) {}
|
: AST(Kind_FunctionIdentifier), name(0), type(_type) {}
|
||||||
@@ -459,14 +459,14 @@ public:
|
|||||||
virtual void accept0(Visitor *visitor);
|
virtual void accept0(Visitor *visitor);
|
||||||
|
|
||||||
public: // attributes
|
public: // attributes
|
||||||
const std::string *name;
|
const QString *name;
|
||||||
Type *type;
|
Type *type;
|
||||||
};
|
};
|
||||||
|
|
||||||
class GLSL_EXPORT DeclarationExpression: public Expression
|
class GLSL_EXPORT DeclarationExpression: public Expression
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DeclarationExpression(Type *_type, const std::string *_name,
|
DeclarationExpression(Type *_type, const QString *_name,
|
||||||
Expression *_initializer)
|
Expression *_initializer)
|
||||||
: Expression(Kind_DeclarationExpression), type(_type)
|
: Expression(Kind_DeclarationExpression), type(_type)
|
||||||
, name(_name), initializer(_initializer) {}
|
, name(_name), initializer(_initializer) {}
|
||||||
@@ -477,7 +477,7 @@ public:
|
|||||||
|
|
||||||
public: // attributes
|
public: // attributes
|
||||||
Type *type;
|
Type *type;
|
||||||
const std::string *name;
|
const QString *name;
|
||||||
Expression *initializer;
|
Expression *initializer;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -734,7 +734,7 @@ public: // attributes
|
|||||||
class GLSL_EXPORT NamedType: public Type
|
class GLSL_EXPORT NamedType: public Type
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NamedType(const std::string *_name) : Type(Kind_NamedType), name(_name) {}
|
NamedType(const QString *_name) : Type(Kind_NamedType), name(_name) {}
|
||||||
|
|
||||||
virtual NamedType *asNamedType() { return this; }
|
virtual NamedType *asNamedType() { return this; }
|
||||||
|
|
||||||
@@ -746,7 +746,7 @@ public:
|
|||||||
virtual Category category() const { return Struct; }
|
virtual Category category() const { return Struct; }
|
||||||
|
|
||||||
public: // attributes
|
public: // attributes
|
||||||
const std::string *name;
|
const QString *name;
|
||||||
};
|
};
|
||||||
|
|
||||||
class GLSL_EXPORT ArrayType: public Type
|
class GLSL_EXPORT ArrayType: public Type
|
||||||
@@ -777,26 +777,26 @@ public:
|
|||||||
class Field: public AST
|
class Field: public AST
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Field(const std::string *_name)
|
Field(const QString *_name)
|
||||||
: AST(Kind_StructField), name(_name), type(0) {}
|
: AST(Kind_StructField), name(_name), type(0) {}
|
||||||
|
|
||||||
// Takes the outer shell of an array type with the innermost
|
// Takes the outer shell of an array type with the innermost
|
||||||
// element type set to null. The fixInnerTypes() method will
|
// element type set to null. The fixInnerTypes() method will
|
||||||
// set the innermost element type to a meaningful value.
|
// set the innermost element type to a meaningful value.
|
||||||
Field(const std::string *_name, Type *_type)
|
Field(const QString *_name, Type *_type)
|
||||||
: AST(Kind_StructField), name(_name), type(_type) {}
|
: AST(Kind_StructField), name(_name), type(_type) {}
|
||||||
|
|
||||||
virtual void accept0(Visitor *visitor);
|
virtual void accept0(Visitor *visitor);
|
||||||
|
|
||||||
void setInnerType(Type *innerType);
|
void setInnerType(Type *innerType);
|
||||||
|
|
||||||
const std::string *name;
|
const QString *name;
|
||||||
Type *type;
|
Type *type;
|
||||||
};
|
};
|
||||||
|
|
||||||
StructType(List<Field *> *_fields)
|
StructType(List<Field *> *_fields)
|
||||||
: Type(Kind_AnonymousStructType), fields(finish(_fields)) {}
|
: Type(Kind_AnonymousStructType), fields(finish(_fields)) {}
|
||||||
StructType(const std::string *_name, List<Field *> *_fields)
|
StructType(const QString *_name, List<Field *> *_fields)
|
||||||
: Type(Kind_StructType), name(_name), fields(finish(_fields)) {}
|
: Type(Kind_StructType), name(_name), fields(finish(_fields)) {}
|
||||||
|
|
||||||
virtual StructType *asStructType() { return this; }
|
virtual StructType *asStructType() { return this; }
|
||||||
@@ -813,19 +813,19 @@ public:
|
|||||||
virtual Category category() const { return Struct; }
|
virtual Category category() const { return Struct; }
|
||||||
|
|
||||||
public: // attributes
|
public: // attributes
|
||||||
const std::string *name;
|
const QString *name;
|
||||||
List<Field *> *fields;
|
List<Field *> *fields;
|
||||||
};
|
};
|
||||||
|
|
||||||
class GLSL_EXPORT LayoutQualifier
|
class GLSL_EXPORT LayoutQualifier
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LayoutQualifier(const std::string *_name, const std::string *_number)
|
LayoutQualifier(const QString *_name, const QString *_number)
|
||||||
: name(_name), number(_number), lineno(0) {}
|
: name(_name), number(_number), lineno(0) {}
|
||||||
|
|
||||||
public: // attributes
|
public: // attributes
|
||||||
const std::string *name;
|
const QString *name;
|
||||||
const std::string *number;
|
const QString *number;
|
||||||
int lineno;
|
int lineno;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -911,7 +911,7 @@ public:
|
|||||||
InOut
|
InOut
|
||||||
};
|
};
|
||||||
ParameterDeclaration(Type *_type, Qualifier _qualifier,
|
ParameterDeclaration(Type *_type, Qualifier _qualifier,
|
||||||
const std::string *_name)
|
const QString *_name)
|
||||||
: Declaration(Kind_ParameterDeclaration), type(_type)
|
: Declaration(Kind_ParameterDeclaration), type(_type)
|
||||||
, qualifier(_qualifier), name(_name) {}
|
, qualifier(_qualifier), name(_name) {}
|
||||||
|
|
||||||
@@ -922,13 +922,13 @@ public:
|
|||||||
public: // attributes
|
public: // attributes
|
||||||
Type *type;
|
Type *type;
|
||||||
Qualifier qualifier;
|
Qualifier qualifier;
|
||||||
const std::string *name;
|
const QString *name;
|
||||||
};
|
};
|
||||||
|
|
||||||
class VariableDeclaration: public Declaration
|
class VariableDeclaration: public Declaration
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
VariableDeclaration(Type *_type, const std::string *_name,
|
VariableDeclaration(Type *_type, const QString *_name,
|
||||||
Expression *_initializer = 0)
|
Expression *_initializer = 0)
|
||||||
: Declaration(Kind_VariableDeclaration), type(_type)
|
: Declaration(Kind_VariableDeclaration), type(_type)
|
||||||
, name(_name), initializer(_initializer) {}
|
, name(_name), initializer(_initializer) {}
|
||||||
@@ -941,7 +941,7 @@ public:
|
|||||||
|
|
||||||
public: // attributes
|
public: // attributes
|
||||||
Type *type;
|
Type *type;
|
||||||
const std::string *name;
|
const QString *name;
|
||||||
Expression *initializer;
|
Expression *initializer;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -979,7 +979,7 @@ public: // attributes
|
|||||||
class InvariantDeclaration: public Declaration
|
class InvariantDeclaration: public Declaration
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
InvariantDeclaration(const std::string *_name)
|
InvariantDeclaration(const QString *_name)
|
||||||
: Declaration(Kind_InvariantDeclaration), name(_name) {}
|
: Declaration(Kind_InvariantDeclaration), name(_name) {}
|
||||||
|
|
||||||
virtual InvariantDeclaration *asInvariantDeclaration() { return this; }
|
virtual InvariantDeclaration *asInvariantDeclaration() { return this; }
|
||||||
@@ -987,7 +987,7 @@ public:
|
|||||||
virtual void accept0(Visitor *visitor);
|
virtual void accept0(Visitor *visitor);
|
||||||
|
|
||||||
public: // attributes
|
public: // attributes
|
||||||
const std::string *name;
|
const QString *name;
|
||||||
};
|
};
|
||||||
|
|
||||||
class InitDeclaration: public Declaration
|
class InitDeclaration: public Declaration
|
||||||
@@ -1007,7 +1007,7 @@ public: // attributes
|
|||||||
class FunctionDeclaration : public Declaration
|
class FunctionDeclaration : public Declaration
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FunctionDeclaration(Type *_returnType, const std::string *_name)
|
FunctionDeclaration(Type *_returnType, const QString *_name)
|
||||||
: Declaration(Kind_FunctionDeclaration), returnType(_returnType)
|
: Declaration(Kind_FunctionDeclaration), returnType(_returnType)
|
||||||
, name(_name), params(0), body(0) {}
|
, name(_name), params(0), body(0) {}
|
||||||
|
|
||||||
@@ -1021,7 +1021,7 @@ public:
|
|||||||
|
|
||||||
public: // attributes
|
public: // attributes
|
||||||
Type *returnType;
|
Type *returnType;
|
||||||
const std::string *name;
|
const QString *name;
|
||||||
List<ParameterDeclaration *> *params;
|
List<ParameterDeclaration *> *params;
|
||||||
Statement *body;
|
Statement *body;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -10,14 +10,14 @@ Engine::~Engine()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string *Engine::identifier(const std::string &s)
|
const QString *Engine::identifier(const QString &s)
|
||||||
{
|
{
|
||||||
return &*_identifiers.insert(s).first;
|
return &(*_identifiers.insert(s));
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string *Engine::identifier(const char *s, int n)
|
const QString *Engine::identifier(const char *s, int n)
|
||||||
{
|
{
|
||||||
return &*_identifiers.insert(std::string(s, n)).first;
|
return &(*_identifiers.insert(QString::fromLatin1(s, n)));
|
||||||
}
|
}
|
||||||
|
|
||||||
MemoryPool *Engine::pool()
|
MemoryPool *Engine::pool()
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
#include "glsl.h"
|
#include "glsl.h"
|
||||||
#include "glslmemorypool.h"
|
#include "glslmemorypool.h"
|
||||||
#include <set>
|
#include <QtCore/qstring.h>
|
||||||
#include <string>
|
#include <QtCore/qset.h>
|
||||||
|
|
||||||
namespace GLSL {
|
namespace GLSL {
|
||||||
|
|
||||||
@@ -14,13 +14,13 @@ public:
|
|||||||
Engine();
|
Engine();
|
||||||
~Engine();
|
~Engine();
|
||||||
|
|
||||||
const std::string *identifier(const std::string &s);
|
const QString *identifier(const QString &s);
|
||||||
const std::string *identifier(const char *s, int n);
|
const QString *identifier(const char *s, int n);
|
||||||
|
|
||||||
MemoryPool *pool();
|
MemoryPool *pool();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::set<std::string> _identifiers;
|
QSet<QString> _identifiers;
|
||||||
MemoryPool _pool;
|
MemoryPool _pool;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
#include "glsllexer.h"
|
#include "glsllexer.h"
|
||||||
#include "glslparser.h"
|
#include "glslparser.h"
|
||||||
#include "glslengine.h"
|
#include "glslengine.h"
|
||||||
|
#include <QtCore/qbytearray.h>
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
@@ -393,9 +394,9 @@ int Lexer::findKeyword(const char *word, int length) const
|
|||||||
return t;
|
return t;
|
||||||
if ((_variant & t & Variant_Mask) == 0) {
|
if ((_variant & t & Variant_Mask) == 0) {
|
||||||
// TODO: issue a proper error for the unsupported keyword
|
// TODO: issue a proper error for the unsupported keyword
|
||||||
std::string keyword(word, length);
|
QByteArray keyword(word, length);
|
||||||
fprintf(stderr, "unsupported keyword `%s' at line %d\n",
|
fprintf(stderr, "unsupported keyword `%s' at line %d\n",
|
||||||
keyword.c_str(), _lineno);
|
keyword.constData(), _lineno);
|
||||||
}
|
}
|
||||||
return t & ~Variant_Mask;
|
return t & ~Variant_Mask;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
#define GLSLLEXER_H
|
#define GLSLLEXER_H
|
||||||
|
|
||||||
#include "glsl.h"
|
#include "glsl.h"
|
||||||
#include <string>
|
#include <QtCore/qstring.h>
|
||||||
|
|
||||||
namespace GLSL {
|
namespace GLSL {
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ public:
|
|||||||
union {
|
union {
|
||||||
int matchingBrace;
|
int matchingBrace;
|
||||||
int i; // integer value
|
int i; // integer value
|
||||||
const std::string *string; // string value
|
const QString *string; // string value
|
||||||
void *ptr;
|
void *ptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ public:
|
|||||||
|
|
||||||
union Value {
|
union Value {
|
||||||
int i;
|
int i;
|
||||||
const std::string *string;
|
const QString *string;
|
||||||
void *ptr;
|
void *ptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -831,7 +831,7 @@ case 99: {
|
|||||||
(makeAstNode<QualifiedType>
|
(makeAstNode<QualifiedType>
|
||||||
(sym(1).qualifier, type(3), (List<LayoutQualifier *> *)0),
|
(sym(1).qualifier, type(3), (List<LayoutQualifier *> *)0),
|
||||||
ParameterDeclaration::Qualifier(sym(2).qualifier),
|
ParameterDeclaration::Qualifier(sym(2).qualifier),
|
||||||
(const std::string *)0);
|
(const QString *)0);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
#line 1320 "./glsl.g"
|
#line 1320 "./glsl.g"
|
||||||
@@ -839,7 +839,7 @@ case 99: {
|
|||||||
case 100: {
|
case 100: {
|
||||||
ast(1) = makeAstNode<ParameterDeclaration>
|
ast(1) = makeAstNode<ParameterDeclaration>
|
||||||
(type(2), ParameterDeclaration::Qualifier(sym(1).qualifier),
|
(type(2), ParameterDeclaration::Qualifier(sym(1).qualifier),
|
||||||
(const std::string *)0);
|
(const QString *)0);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
#line 1329 "./glsl.g"
|
#line 1329 "./glsl.g"
|
||||||
@@ -1053,7 +1053,7 @@ case 129: {
|
|||||||
#line 1566 "./glsl.g"
|
#line 1566 "./glsl.g"
|
||||||
|
|
||||||
case 130: {
|
case 130: {
|
||||||
sym(1).layout = makeAstNode<LayoutQualifier>(string(1), (const std::string *)0);
|
sym(1).layout = makeAstNode<LayoutQualifier>(string(1), (const QString *)0);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
#line 1573 "./glsl.g"
|
#line 1573 "./glsl.g"
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class GLSL_EXPORT Parser: public GLSLParserTable
|
|||||||
public:
|
public:
|
||||||
union Value {
|
union Value {
|
||||||
void *ptr;
|
void *ptr;
|
||||||
const std::string *string;
|
const QString *string;
|
||||||
AST *ast;
|
AST *ast;
|
||||||
List<AST *> *ast_list;
|
List<AST *> *ast_list;
|
||||||
Declaration *declaration;
|
Declaration *declaration;
|
||||||
@@ -81,7 +81,7 @@ public:
|
|||||||
} type_qualifier;
|
} type_qualifier;
|
||||||
struct {
|
struct {
|
||||||
Type *type;
|
Type *type;
|
||||||
const std::string *name;
|
const QString *name;
|
||||||
} param_declarator;
|
} param_declarator;
|
||||||
ParameterDeclaration *param_declaration;
|
ParameterDeclaration *param_declaration;
|
||||||
FunctionDeclaration *function_declaration;
|
FunctionDeclaration *function_declaration;
|
||||||
@@ -96,7 +96,7 @@ private:
|
|||||||
// 1-based
|
// 1-based
|
||||||
Value &sym(int n) { return _symStack[_tos + n - 1]; }
|
Value &sym(int n) { return _symStack[_tos + n - 1]; }
|
||||||
AST *&ast(int n) { return _symStack[_tos + n - 1].ast; }
|
AST *&ast(int n) { return _symStack[_tos + n - 1].ast; }
|
||||||
const std::string *&string(int n) { return _symStack[_tos + n - 1].string; }
|
const QString *&string(int n) { return _symStack[_tos + n - 1].string; }
|
||||||
Expression *&expression(int n) { return _symStack[_tos + n - 1].expression; }
|
Expression *&expression(int n) { return _symStack[_tos + n - 1].expression; }
|
||||||
Statement *&statement(int n) { return _symStack[_tos + n - 1].statement; }
|
Statement *&statement(int n) { return _symStack[_tos + n - 1].statement; }
|
||||||
Type *&type(int n) { return _symStack[_tos + n - 1].type; }
|
Type *&type(int n) { return _symStack[_tos + n - 1].type; }
|
||||||
|
|||||||
Reference in New Issue
Block a user