forked from qt-creator/qt-creator
Convert GLSL AST nodes into managed types
This commit is contained in:
@@ -465,7 +465,7 @@ switch(ruleno) {
|
|||||||
variable_identifier ::= IDENTIFIER ;
|
variable_identifier ::= IDENTIFIER ;
|
||||||
/.
|
/.
|
||||||
case $rule_number: {
|
case $rule_number: {
|
||||||
ast(1) = new IdentifierExpression(sym(1).string);
|
ast(1) = new (_engine->pool()) IdentifierExpression(sym(1).string);
|
||||||
} break;
|
} break;
|
||||||
./
|
./
|
||||||
|
|
||||||
@@ -703,7 +703,7 @@ case $rule_number: {
|
|||||||
multiplicative_expression ::= multiplicative_expression STAR unary_expression ;
|
multiplicative_expression ::= multiplicative_expression STAR unary_expression ;
|
||||||
/.
|
/.
|
||||||
case $rule_number: {
|
case $rule_number: {
|
||||||
ast(1) = new BinaryExpression(AST::Kind_Multiply, sym(1).expression, sym(3).expression);
|
ast(1) = new (_engine->pool()) BinaryExpression(AST::Kind_Multiply, sym(1).expression, sym(3).expression);
|
||||||
} break;
|
} break;
|
||||||
./
|
./
|
||||||
|
|
||||||
@@ -2600,7 +2600,7 @@ case $rule_number: {
|
|||||||
translation_unit ::= external_declaration_list ;
|
translation_unit ::= external_declaration_list ;
|
||||||
/.
|
/.
|
||||||
case $rule_number: {
|
case $rule_number: {
|
||||||
ast(1) = new TranslationUnit(sym(1).declaration_list);
|
ast(1) = new (_engine->pool()) TranslationUnit(sym(1).declaration_list);
|
||||||
} break;
|
} break;
|
||||||
./
|
./
|
||||||
|
|
||||||
|
|||||||
@@ -32,10 +32,6 @@
|
|||||||
|
|
||||||
using namespace GLSL;
|
using namespace GLSL;
|
||||||
|
|
||||||
AST::~AST()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void AST::accept(Visitor *visitor)
|
void AST::accept(Visitor *visitor)
|
||||||
{
|
{
|
||||||
if (visitor->preVisit(this))
|
if (visitor->preVisit(this))
|
||||||
@@ -49,23 +45,6 @@ void AST::accept(AST *ast, Visitor *visitor)
|
|||||||
ast->accept(visitor);
|
ast->accept(visitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
Statement *AST::makeCompound(Statement *left, Statement *right)
|
|
||||||
{
|
|
||||||
if (!left)
|
|
||||||
return right;
|
|
||||||
else if (!right)
|
|
||||||
return left;
|
|
||||||
CompoundStatement *compound = left->asCompoundStatement();
|
|
||||||
if (compound) {
|
|
||||||
compound->statements.push_back(right);
|
|
||||||
} else {
|
|
||||||
compound = new CompoundStatement();
|
|
||||||
compound->statements.push_back(left);
|
|
||||||
compound->statements.push_back(right);
|
|
||||||
}
|
|
||||||
return compound;
|
|
||||||
}
|
|
||||||
|
|
||||||
void TranslationUnit::accept0(Visitor *visitor)
|
void TranslationUnit::accept0(Visitor *visitor)
|
||||||
{
|
{
|
||||||
if (visitor->visit(this)) {
|
if (visitor->visit(this)) {
|
||||||
@@ -74,32 +53,18 @@ void TranslationUnit::accept0(Visitor *visitor)
|
|||||||
visitor->endVisit(this);
|
visitor->endVisit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
IdentifierExpression::~IdentifierExpression()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void IdentifierExpression::accept0(Visitor *visitor)
|
void IdentifierExpression::accept0(Visitor *visitor)
|
||||||
{
|
{
|
||||||
visitor->visit(this);
|
visitor->visit(this);
|
||||||
visitor->endVisit(this);
|
visitor->endVisit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
LiteralExpression::~LiteralExpression()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void LiteralExpression::accept0(Visitor *visitor)
|
void LiteralExpression::accept0(Visitor *visitor)
|
||||||
{
|
{
|
||||||
visitor->visit(this);
|
visitor->visit(this);
|
||||||
visitor->endVisit(this);
|
visitor->endVisit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
BinaryExpression::~BinaryExpression()
|
|
||||||
{
|
|
||||||
delete left;
|
|
||||||
delete right;
|
|
||||||
}
|
|
||||||
|
|
||||||
void BinaryExpression::accept0(Visitor *visitor)
|
void BinaryExpression::accept0(Visitor *visitor)
|
||||||
{
|
{
|
||||||
if (visitor->visit(this)) {
|
if (visitor->visit(this)) {
|
||||||
@@ -109,11 +74,6 @@ void BinaryExpression::accept0(Visitor *visitor)
|
|||||||
visitor->endVisit(this);
|
visitor->endVisit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
UnaryExpression::~UnaryExpression()
|
|
||||||
{
|
|
||||||
delete expr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void UnaryExpression::accept0(Visitor *visitor)
|
void UnaryExpression::accept0(Visitor *visitor)
|
||||||
{
|
{
|
||||||
if (visitor->visit(this))
|
if (visitor->visit(this))
|
||||||
@@ -121,13 +81,6 @@ void UnaryExpression::accept0(Visitor *visitor)
|
|||||||
visitor->endVisit(this);
|
visitor->endVisit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
TernaryExpression::~TernaryExpression()
|
|
||||||
{
|
|
||||||
delete first;
|
|
||||||
delete second;
|
|
||||||
delete third;
|
|
||||||
}
|
|
||||||
|
|
||||||
void TernaryExpression::accept0(Visitor *visitor)
|
void TernaryExpression::accept0(Visitor *visitor)
|
||||||
{
|
{
|
||||||
if (visitor->visit(this)) {
|
if (visitor->visit(this)) {
|
||||||
@@ -138,12 +91,6 @@ void TernaryExpression::accept0(Visitor *visitor)
|
|||||||
visitor->endVisit(this);
|
visitor->endVisit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
AssignmentExpression::~AssignmentExpression()
|
|
||||||
{
|
|
||||||
delete variable;
|
|
||||||
delete value;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AssignmentExpression::accept0(Visitor *visitor)
|
void AssignmentExpression::accept0(Visitor *visitor)
|
||||||
{
|
{
|
||||||
if (visitor->visit(this)) {
|
if (visitor->visit(this)) {
|
||||||
@@ -153,11 +100,6 @@ void AssignmentExpression::accept0(Visitor *visitor)
|
|||||||
visitor->endVisit(this);
|
visitor->endVisit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
MemberAccessExpression::~MemberAccessExpression()
|
|
||||||
{
|
|
||||||
delete expr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MemberAccessExpression::accept0(Visitor *visitor)
|
void MemberAccessExpression::accept0(Visitor *visitor)
|
||||||
{
|
{
|
||||||
if (visitor->visit(this))
|
if (visitor->visit(this))
|
||||||
@@ -165,28 +107,15 @@ void MemberAccessExpression::accept0(Visitor *visitor)
|
|||||||
visitor->endVisit(this);
|
visitor->endVisit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
FunctionCallExpression::~FunctionCallExpression()
|
|
||||||
{
|
|
||||||
delete expr;
|
|
||||||
for (std::vector<Expression *>::iterator it = arguments.begin(); it != arguments.end(); ++it)
|
|
||||||
delete *it;
|
|
||||||
}
|
|
||||||
|
|
||||||
void FunctionCallExpression::accept0(Visitor *visitor)
|
void FunctionCallExpression::accept0(Visitor *visitor)
|
||||||
{
|
{
|
||||||
if (visitor->visit(this)) {
|
if (visitor->visit(this)) {
|
||||||
accept(expr, visitor);
|
accept(expr, visitor);
|
||||||
for (std::vector<Expression *>::iterator it = arguments.begin(); it != arguments.end(); ++it)
|
accept(arguments, visitor);
|
||||||
accept(*it, visitor);
|
|
||||||
}
|
}
|
||||||
visitor->endVisit(this);
|
visitor->endVisit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressionStatement::~ExpressionStatement()
|
|
||||||
{
|
|
||||||
delete expr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ExpressionStatement::accept0(Visitor *visitor)
|
void ExpressionStatement::accept0(Visitor *visitor)
|
||||||
{
|
{
|
||||||
if (visitor->visit(this))
|
if (visitor->visit(this))
|
||||||
@@ -194,28 +123,13 @@ void ExpressionStatement::accept0(Visitor *visitor)
|
|||||||
visitor->endVisit(this);
|
visitor->endVisit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
CompoundStatement::~CompoundStatement()
|
|
||||||
{
|
|
||||||
for (std::vector<Statement *>::iterator it = statements.begin(); it != statements.end(); ++it)
|
|
||||||
delete *it;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CompoundStatement::accept0(Visitor *visitor)
|
void CompoundStatement::accept0(Visitor *visitor)
|
||||||
{
|
{
|
||||||
if (visitor->visit(this)) {
|
if (visitor->visit(this))
|
||||||
for (std::vector<Statement *>::iterator it = statements.begin(); it != statements.end(); ++it)
|
accept(statements, visitor);
|
||||||
accept(*it, visitor);
|
|
||||||
}
|
|
||||||
visitor->endVisit(this);
|
visitor->endVisit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
IfStatement::~IfStatement()
|
|
||||||
{
|
|
||||||
delete condition;
|
|
||||||
delete thenClause;
|
|
||||||
delete elseClause;
|
|
||||||
}
|
|
||||||
|
|
||||||
void IfStatement::accept0(Visitor *visitor)
|
void IfStatement::accept0(Visitor *visitor)
|
||||||
{
|
{
|
||||||
if (visitor->visit(this)) {
|
if (visitor->visit(this)) {
|
||||||
@@ -226,12 +140,6 @@ void IfStatement::accept0(Visitor *visitor)
|
|||||||
visitor->endVisit(this);
|
visitor->endVisit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
WhileStatement::~WhileStatement()
|
|
||||||
{
|
|
||||||
delete condition;
|
|
||||||
delete body;
|
|
||||||
}
|
|
||||||
|
|
||||||
void WhileStatement::accept0(Visitor *visitor)
|
void WhileStatement::accept0(Visitor *visitor)
|
||||||
{
|
{
|
||||||
if (visitor->visit(this)) {
|
if (visitor->visit(this)) {
|
||||||
@@ -241,12 +149,6 @@ void WhileStatement::accept0(Visitor *visitor)
|
|||||||
visitor->endVisit(this);
|
visitor->endVisit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
DoStatement::~DoStatement()
|
|
||||||
{
|
|
||||||
delete body;
|
|
||||||
delete condition;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DoStatement::accept0(Visitor *visitor)
|
void DoStatement::accept0(Visitor *visitor)
|
||||||
{
|
{
|
||||||
if (visitor->visit(this)) {
|
if (visitor->visit(this)) {
|
||||||
@@ -256,14 +158,6 @@ void DoStatement::accept0(Visitor *visitor)
|
|||||||
visitor->endVisit(this);
|
visitor->endVisit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
ForStatement::~ForStatement()
|
|
||||||
{
|
|
||||||
delete init;
|
|
||||||
delete condition;
|
|
||||||
delete increment;
|
|
||||||
delete body;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ForStatement::accept0(Visitor *visitor)
|
void ForStatement::accept0(Visitor *visitor)
|
||||||
{
|
{
|
||||||
if (visitor->visit(this)) {
|
if (visitor->visit(this)) {
|
||||||
@@ -275,21 +169,12 @@ void ForStatement::accept0(Visitor *visitor)
|
|||||||
visitor->endVisit(this);
|
visitor->endVisit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
JumpStatement::~JumpStatement()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void JumpStatement::accept0(Visitor *visitor)
|
void JumpStatement::accept0(Visitor *visitor)
|
||||||
{
|
{
|
||||||
visitor->visit(this);
|
visitor->visit(this);
|
||||||
visitor->endVisit(this);
|
visitor->endVisit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnStatement::~ReturnStatement()
|
|
||||||
{
|
|
||||||
delete expr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ReturnStatement::accept0(Visitor *visitor)
|
void ReturnStatement::accept0(Visitor *visitor)
|
||||||
{
|
{
|
||||||
if (visitor->visit(this))
|
if (visitor->visit(this))
|
||||||
@@ -297,12 +182,6 @@ void ReturnStatement::accept0(Visitor *visitor)
|
|||||||
visitor->endVisit(this);
|
visitor->endVisit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
SwitchStatement::~SwitchStatement()
|
|
||||||
{
|
|
||||||
delete expr;
|
|
||||||
delete body;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SwitchStatement::accept0(Visitor *visitor)
|
void SwitchStatement::accept0(Visitor *visitor)
|
||||||
{
|
{
|
||||||
if (visitor->visit(this)) {
|
if (visitor->visit(this)) {
|
||||||
@@ -312,11 +191,6 @@ void SwitchStatement::accept0(Visitor *visitor)
|
|||||||
visitor->endVisit(this);
|
visitor->endVisit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
CaseLabelStatement::~CaseLabelStatement()
|
|
||||||
{
|
|
||||||
delete expr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CaseLabelStatement::accept0(Visitor *visitor)
|
void CaseLabelStatement::accept0(Visitor *visitor)
|
||||||
{
|
{
|
||||||
if (visitor->visit(this))
|
if (visitor->visit(this))
|
||||||
@@ -324,15 +198,6 @@ void CaseLabelStatement::accept0(Visitor *visitor)
|
|||||||
visitor->endVisit(this);
|
visitor->endVisit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
Type *Type::clone(Type *type)
|
|
||||||
{
|
|
||||||
if (!type)
|
|
||||||
return 0;
|
|
||||||
Type *c = type->clone();
|
|
||||||
c->lineno = type->lineno;
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
BasicType::BasicType(int _token)
|
BasicType::BasicType(int _token)
|
||||||
: Type(Kind_BasicType), token(_token)
|
: Type(Kind_BasicType), token(_token)
|
||||||
{
|
{
|
||||||
@@ -350,10 +215,6 @@ BasicType::BasicType(int _token)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BasicType::~BasicType()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void BasicType::accept0(Visitor *visitor)
|
void BasicType::accept0(Visitor *visitor)
|
||||||
{
|
{
|
||||||
visitor->visit(this);
|
visitor->visit(this);
|
||||||
@@ -373,15 +234,6 @@ bool BasicType::setPrecision(Precision precision)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Type *BasicType::clone() const
|
|
||||||
{
|
|
||||||
return new BasicType(token, prec);
|
|
||||||
}
|
|
||||||
|
|
||||||
NamedType::~NamedType()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void NamedType::accept0(Visitor *visitor)
|
void NamedType::accept0(Visitor *visitor)
|
||||||
{
|
{
|
||||||
visitor->visit(this);
|
visitor->visit(this);
|
||||||
@@ -399,17 +251,6 @@ bool NamedType::setPrecision(Precision)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Type *NamedType::clone() const
|
|
||||||
{
|
|
||||||
return new NamedType(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
ArrayType::~ArrayType()
|
|
||||||
{
|
|
||||||
delete elementType;
|
|
||||||
delete size;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ArrayType::accept0(Visitor *visitor)
|
void ArrayType::accept0(Visitor *visitor)
|
||||||
{
|
{
|
||||||
if (visitor->visit(this)) {
|
if (visitor->visit(this)) {
|
||||||
@@ -432,26 +273,10 @@ bool ArrayType::setPrecision(Precision precision)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Type *ArrayType::clone() const
|
|
||||||
{
|
|
||||||
if (kind == Kind_ArrayType)
|
|
||||||
return new ArrayType(Type::clone(elementType), size);
|
|
||||||
else
|
|
||||||
return new ArrayType(Type::clone(elementType));
|
|
||||||
}
|
|
||||||
|
|
||||||
StructType::~StructType()
|
|
||||||
{
|
|
||||||
for (std::vector<Field *>::iterator it = fields.begin(); it != fields.end(); ++it)
|
|
||||||
delete *it;
|
|
||||||
}
|
|
||||||
|
|
||||||
void StructType::accept0(Visitor *visitor)
|
void StructType::accept0(Visitor *visitor)
|
||||||
{
|
{
|
||||||
if (visitor->visit(this)) {
|
if (visitor->visit(this))
|
||||||
for (std::vector<Field *>::iterator it = fields.begin(); it != fields.end(); ++it)
|
accept(fields, visitor);
|
||||||
accept(*it, visitor);
|
|
||||||
}
|
|
||||||
visitor->endVisit(this);
|
visitor->endVisit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -466,25 +291,6 @@ bool StructType::setPrecision(Precision)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Type *StructType::clone() const
|
|
||||||
{
|
|
||||||
StructType *stype;
|
|
||||||
if (kind == Kind_AnonymousStructType)
|
|
||||||
stype = new StructType();
|
|
||||||
else
|
|
||||||
stype = new StructType(name);
|
|
||||||
for (std::vector<Field *>::const_iterator it = fields.begin(); it != fields.end(); ++it) {
|
|
||||||
stype->fields.push_back
|
|
||||||
(new Field((*it)->name, Type::clone((*it)->type)));
|
|
||||||
}
|
|
||||||
return stype;
|
|
||||||
}
|
|
||||||
|
|
||||||
StructType::Field::~Field()
|
|
||||||
{
|
|
||||||
delete type;
|
|
||||||
}
|
|
||||||
|
|
||||||
void StructType::Field::accept0(Visitor *visitor)
|
void StructType::Field::accept0(Visitor *visitor)
|
||||||
{
|
{
|
||||||
if (visitor->visit(this))
|
if (visitor->visit(this))
|
||||||
@@ -505,18 +311,17 @@ void StructType::Field::setInnerType(Type *innerType)
|
|||||||
parent = &(array->elementType);
|
parent = &(array->elementType);
|
||||||
inner = array->elementType;
|
inner = array->elementType;
|
||||||
}
|
}
|
||||||
*parent = Type::clone(innerType);
|
*parent = innerType;
|
||||||
}
|
}
|
||||||
|
|
||||||
void StructType::fixInnerTypes(Type *innerType, std::vector<Field *> &fields)
|
void StructType::fixInnerTypes(Type *innerType, List<Field *> *fields)
|
||||||
{
|
{
|
||||||
for (size_t index = 0; index < fields.size(); ++index)
|
if (!fields)
|
||||||
fields[index]->setInnerType(innerType);
|
return;
|
||||||
delete innerType; // No longer needed - cloned into all fields.
|
List<Field *> *head = fields->next;
|
||||||
}
|
List<Field *> *current = head;
|
||||||
|
do {
|
||||||
void StructType::addFields(const std::vector<Field *> &list)
|
current->value->setInnerType(innerType);
|
||||||
{
|
current = current->next;
|
||||||
for (size_t index = 0; index < list.size(); ++index)
|
} while (current && current != head);
|
||||||
fields.push_back(list[index]);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,6 @@
|
|||||||
|
|
||||||
#include "glsl.h"
|
#include "glsl.h"
|
||||||
#include "glslmemorypool.h"
|
#include "glslmemorypool.h"
|
||||||
#include <vector>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace GLSL {
|
namespace GLSL {
|
||||||
@@ -91,7 +90,22 @@ public:
|
|||||||
List *next;
|
List *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
class GLSL_EXPORT AST // : public Managed
|
// Append two lists, which are assumed to still be circular, pre-finish.
|
||||||
|
template <typename T>
|
||||||
|
List<T> *appendLists(List<T> *first, List<T> *second)
|
||||||
|
{
|
||||||
|
if (!first)
|
||||||
|
return second;
|
||||||
|
else if (!second)
|
||||||
|
return first;
|
||||||
|
List<T> *firstHead = first->next;
|
||||||
|
List<T> *secondHead = second->next;
|
||||||
|
first->next = secondHead;
|
||||||
|
second->next = firstHead;
|
||||||
|
return second;
|
||||||
|
}
|
||||||
|
|
||||||
|
class GLSL_EXPORT AST: public Managed
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum Kind {
|
enum Kind {
|
||||||
@@ -183,9 +197,6 @@ public:
|
|||||||
Kind_StructField
|
Kind_StructField
|
||||||
};
|
};
|
||||||
|
|
||||||
AST() : kind(Kind_Undefined), lineno(0) {}
|
|
||||||
virtual ~AST();
|
|
||||||
|
|
||||||
virtual TranslationUnit *asTranslationUnit() { return 0; }
|
virtual TranslationUnit *asTranslationUnit() { return 0; }
|
||||||
|
|
||||||
virtual Declaration *asDeclaration() { return 0; }
|
virtual Declaration *asDeclaration() { return 0; }
|
||||||
@@ -230,14 +241,9 @@ public:
|
|||||||
|
|
||||||
virtual void accept0(Visitor *visitor) = 0;
|
virtual void accept0(Visitor *visitor) = 0;
|
||||||
|
|
||||||
// Efficiently make a compound statement out of "left" and "right",
|
|
||||||
// removing left-recursion in the process.
|
|
||||||
static Statement *makeCompound(Statement *left, Statement *right);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
AST(Kind _kind) : kind(_kind), lineno(0) {}
|
AST(Kind _kind) : kind(_kind), lineno(0) {}
|
||||||
|
|
||||||
protected:
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static List<T> *finish(List<T> *list)
|
static List<T> *finish(List<T> *list)
|
||||||
{
|
{
|
||||||
@@ -249,14 +255,16 @@ protected:
|
|||||||
public: // attributes
|
public: // attributes
|
||||||
int kind;
|
int kind;
|
||||||
int lineno;
|
int lineno;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~AST() {} // Managed types cannot be deleted.
|
||||||
};
|
};
|
||||||
|
|
||||||
class GLSL_EXPORT TranslationUnit: public AST
|
class GLSL_EXPORT TranslationUnit: public AST
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TranslationUnit(List<Declaration *> *declarations)
|
TranslationUnit(List<Declaration *> *declarations)
|
||||||
: declarations(finish(declarations))
|
: AST(Kind_TranslationUnit), declarations(finish(declarations)) {}
|
||||||
{ kind = Kind_TranslationUnit; }
|
|
||||||
|
|
||||||
virtual TranslationUnit *asTranslationUnit() { return this; }
|
virtual TranslationUnit *asTranslationUnit() { return this; }
|
||||||
|
|
||||||
@@ -269,7 +277,7 @@ public: // attributes
|
|||||||
class GLSL_EXPORT Declaration: public AST
|
class GLSL_EXPORT Declaration: public AST
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
Declaration(Kind _kind) { kind = _kind; }
|
Declaration(Kind _kind) : AST(_kind) {}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual Declaration *asDeclaration() { return this; }
|
virtual Declaration *asDeclaration() { return this; }
|
||||||
@@ -278,7 +286,7 @@ public:
|
|||||||
class GLSL_EXPORT Expression: public AST
|
class GLSL_EXPORT Expression: public AST
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
Expression(Kind _kind) { kind = _kind; }
|
Expression(Kind _kind) : AST(_kind) {}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual Expression *asExpression() { return this; }
|
virtual Expression *asExpression() { return this; }
|
||||||
@@ -289,7 +297,6 @@ class GLSL_EXPORT IdentifierExpression: public Expression
|
|||||||
public:
|
public:
|
||||||
IdentifierExpression(const std::string *_name)
|
IdentifierExpression(const std::string *_name)
|
||||||
: Expression(Kind_Identifier), name(_name) {}
|
: Expression(Kind_Identifier), name(_name) {}
|
||||||
~IdentifierExpression();
|
|
||||||
|
|
||||||
virtual IdentifierExpression *asIdentifierExpression() { return this; }
|
virtual IdentifierExpression *asIdentifierExpression() { return this; }
|
||||||
|
|
||||||
@@ -304,7 +311,6 @@ class GLSL_EXPORT LiteralExpression: public Expression
|
|||||||
public:
|
public:
|
||||||
LiteralExpression(const std::string *_value)
|
LiteralExpression(const std::string *_value)
|
||||||
: Expression(Kind_Literal), value(_value) {}
|
: Expression(Kind_Literal), value(_value) {}
|
||||||
~LiteralExpression();
|
|
||||||
|
|
||||||
virtual LiteralExpression *asLiteralExpression() { return this; }
|
virtual LiteralExpression *asLiteralExpression() { return this; }
|
||||||
|
|
||||||
@@ -319,7 +325,6 @@ class GLSL_EXPORT BinaryExpression: public Expression
|
|||||||
public:
|
public:
|
||||||
BinaryExpression(Kind _kind, Expression *_left, Expression *_right)
|
BinaryExpression(Kind _kind, Expression *_left, Expression *_right)
|
||||||
: Expression(_kind), left(_left), right(_right) {}
|
: Expression(_kind), left(_left), right(_right) {}
|
||||||
~BinaryExpression();
|
|
||||||
|
|
||||||
virtual BinaryExpression *asBinaryExpression() { return this; }
|
virtual BinaryExpression *asBinaryExpression() { return this; }
|
||||||
|
|
||||||
@@ -335,7 +340,6 @@ class GLSL_EXPORT UnaryExpression: public Expression
|
|||||||
public:
|
public:
|
||||||
UnaryExpression(Kind _kind, Expression *_expr)
|
UnaryExpression(Kind _kind, Expression *_expr)
|
||||||
: Expression(_kind), expr(_expr) {}
|
: Expression(_kind), expr(_expr) {}
|
||||||
~UnaryExpression();
|
|
||||||
|
|
||||||
virtual UnaryExpression *asUnaryExpression() { return this; }
|
virtual UnaryExpression *asUnaryExpression() { return this; }
|
||||||
|
|
||||||
@@ -350,7 +354,6 @@ class GLSL_EXPORT TernaryExpression: public Expression
|
|||||||
public:
|
public:
|
||||||
TernaryExpression(Kind _kind, Expression *_first, Expression *_second, Expression *_third)
|
TernaryExpression(Kind _kind, Expression *_first, Expression *_second, Expression *_third)
|
||||||
: Expression(_kind), first(_first), second(_second), third(_third) {}
|
: Expression(_kind), first(_first), second(_second), third(_third) {}
|
||||||
~TernaryExpression();
|
|
||||||
|
|
||||||
virtual TernaryExpression *asTernaryExpression() { return this; }
|
virtual TernaryExpression *asTernaryExpression() { return this; }
|
||||||
|
|
||||||
@@ -367,7 +370,6 @@ class GLSL_EXPORT AssignmentExpression: public Expression
|
|||||||
public:
|
public:
|
||||||
AssignmentExpression(Kind _kind, Expression *_variable, Expression *_value)
|
AssignmentExpression(Kind _kind, Expression *_variable, Expression *_value)
|
||||||
: Expression(_kind), variable(_variable), value(_value) {}
|
: Expression(_kind), variable(_variable), value(_value) {}
|
||||||
~AssignmentExpression();
|
|
||||||
|
|
||||||
virtual AssignmentExpression *asAssignmentExpression() { return this; }
|
virtual AssignmentExpression *asAssignmentExpression() { return this; }
|
||||||
|
|
||||||
@@ -383,7 +385,6 @@ class GLSL_EXPORT MemberAccessExpression: public Expression
|
|||||||
public:
|
public:
|
||||||
MemberAccessExpression(Expression *_expr, const std::string *_field)
|
MemberAccessExpression(Expression *_expr, const std::string *_field)
|
||||||
: Expression(Kind_MemberAccess), expr(_expr), field(_field) {}
|
: Expression(Kind_MemberAccess), expr(_expr), field(_field) {}
|
||||||
~MemberAccessExpression();
|
|
||||||
|
|
||||||
virtual MemberAccessExpression *asMemberAccessExpression() { return this; }
|
virtual MemberAccessExpression *asMemberAccessExpression() { return this; }
|
||||||
|
|
||||||
@@ -397,13 +398,14 @@ public: // attributes
|
|||||||
class GLSL_EXPORT FunctionCallExpression: public Expression
|
class GLSL_EXPORT FunctionCallExpression: public Expression
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FunctionCallExpression(const std::string *_name)
|
FunctionCallExpression(const std::string *_name,
|
||||||
: Expression(Kind_FunctionCall), expr(0), name(_name) {}
|
List<Expression *> *_arguments)
|
||||||
FunctionCallExpression(Expression *_expr, const std::string *_name)
|
: Expression(Kind_FunctionCall), expr(0), name(_name)
|
||||||
: Expression(Kind_MemberFunctionCall), expr(_expr), name(_name) {}
|
, arguments(finish(_arguments)) {}
|
||||||
~FunctionCallExpression();
|
FunctionCallExpression(Expression *_expr, const std::string *_name,
|
||||||
|
List<Expression *> *_arguments)
|
||||||
void addArgument(Expression *expr) { arguments.push_back(expr); }
|
: Expression(Kind_MemberFunctionCall), expr(_expr), name(_name)
|
||||||
|
, arguments(finish(_arguments)) {}
|
||||||
|
|
||||||
virtual FunctionCallExpression *asFunctionCallExpression() { return this; }
|
virtual FunctionCallExpression *asFunctionCallExpression() { return this; }
|
||||||
|
|
||||||
@@ -412,7 +414,7 @@ public:
|
|||||||
public: // attributes
|
public: // attributes
|
||||||
Expression *expr;
|
Expression *expr;
|
||||||
const std::string *name;
|
const std::string *name;
|
||||||
std::vector<Expression *> arguments;
|
List<Expression *> *arguments;
|
||||||
};
|
};
|
||||||
|
|
||||||
class GLSL_EXPORT Statement: public AST
|
class GLSL_EXPORT Statement: public AST
|
||||||
@@ -429,7 +431,6 @@ class GLSL_EXPORT ExpressionStatement: public Statement
|
|||||||
public:
|
public:
|
||||||
ExpressionStatement(Expression *_expr)
|
ExpressionStatement(Expression *_expr)
|
||||||
: Statement(Kind_ExpressionStatement), expr(_expr) {}
|
: Statement(Kind_ExpressionStatement), expr(_expr) {}
|
||||||
~ExpressionStatement();
|
|
||||||
|
|
||||||
virtual ExpressionStatement *asExpressionStatement() { return this; }
|
virtual ExpressionStatement *asExpressionStatement() { return this; }
|
||||||
|
|
||||||
@@ -442,15 +443,15 @@ public: // attributes
|
|||||||
class GLSL_EXPORT CompoundStatement: public Statement
|
class GLSL_EXPORT CompoundStatement: public Statement
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CompoundStatement() : Statement(Kind_CompoundStatement) {}
|
CompoundStatement(List<Statement *> *_statements)
|
||||||
~CompoundStatement();
|
: Statement(Kind_CompoundStatement), statements(finish(_statements)) {}
|
||||||
|
|
||||||
virtual CompoundStatement *asCompoundStatement() { return this; }
|
virtual CompoundStatement *asCompoundStatement() { return this; }
|
||||||
|
|
||||||
virtual void accept0(Visitor *visitor);
|
virtual void accept0(Visitor *visitor);
|
||||||
|
|
||||||
public: // attributes
|
public: // attributes
|
||||||
std::vector<Statement *> statements;
|
List<Statement *> *statements;
|
||||||
};
|
};
|
||||||
|
|
||||||
class GLSL_EXPORT IfStatement: public Statement
|
class GLSL_EXPORT IfStatement: public Statement
|
||||||
@@ -459,7 +460,6 @@ public:
|
|||||||
IfStatement(Expression *_condition, Statement *_thenClause, Statement *_elseClause)
|
IfStatement(Expression *_condition, Statement *_thenClause, Statement *_elseClause)
|
||||||
: Statement(Kind_If), condition(_condition)
|
: Statement(Kind_If), condition(_condition)
|
||||||
, thenClause(_thenClause), elseClause(_elseClause) {}
|
, thenClause(_thenClause), elseClause(_elseClause) {}
|
||||||
~IfStatement();
|
|
||||||
|
|
||||||
virtual IfStatement *asIfStatement() { return this; }
|
virtual IfStatement *asIfStatement() { return this; }
|
||||||
|
|
||||||
@@ -476,7 +476,6 @@ class GLSL_EXPORT WhileStatement: public Statement
|
|||||||
public:
|
public:
|
||||||
WhileStatement(Expression *_condition, Statement *_body)
|
WhileStatement(Expression *_condition, Statement *_body)
|
||||||
: Statement(Kind_While), condition(_condition), body(_body) {}
|
: Statement(Kind_While), condition(_condition), body(_body) {}
|
||||||
~WhileStatement();
|
|
||||||
|
|
||||||
virtual WhileStatement *asWhileStatement() { return this; }
|
virtual WhileStatement *asWhileStatement() { return this; }
|
||||||
|
|
||||||
@@ -492,7 +491,6 @@ class GLSL_EXPORT DoStatement: public Statement
|
|||||||
public:
|
public:
|
||||||
DoStatement(Statement *_body, Expression *_condition)
|
DoStatement(Statement *_body, Expression *_condition)
|
||||||
: Statement(Kind_Do), body(_body), condition(_condition) {}
|
: Statement(Kind_Do), body(_body), condition(_condition) {}
|
||||||
~DoStatement();
|
|
||||||
|
|
||||||
virtual DoStatement *asDoStatement() { return this; }
|
virtual DoStatement *asDoStatement() { return this; }
|
||||||
|
|
||||||
@@ -508,7 +506,6 @@ class GLSL_EXPORT ForStatement: public Statement
|
|||||||
public:
|
public:
|
||||||
ForStatement(Statement *_init, Expression *_condition, Expression *_increment, Statement *_body)
|
ForStatement(Statement *_init, Expression *_condition, Expression *_increment, Statement *_body)
|
||||||
: Statement(Kind_For), init(_init), condition(_condition), increment(_increment), body(_body) {}
|
: Statement(Kind_For), init(_init), condition(_condition), increment(_increment), body(_body) {}
|
||||||
~ForStatement();
|
|
||||||
|
|
||||||
virtual ForStatement *asForStatement() { return this; }
|
virtual ForStatement *asForStatement() { return this; }
|
||||||
|
|
||||||
@@ -525,7 +522,6 @@ class GLSL_EXPORT JumpStatement: public Statement
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
JumpStatement(Kind _kind) : Statement(_kind) {}
|
JumpStatement(Kind _kind) : Statement(_kind) {}
|
||||||
~JumpStatement();
|
|
||||||
|
|
||||||
virtual JumpStatement *asJumpStatement() { return this; }
|
virtual JumpStatement *asJumpStatement() { return this; }
|
||||||
|
|
||||||
@@ -538,7 +534,6 @@ public:
|
|||||||
ReturnStatement() : Statement(Kind_Return), expr(0) {}
|
ReturnStatement() : Statement(Kind_Return), expr(0) {}
|
||||||
ReturnStatement(Expression *_expr)
|
ReturnStatement(Expression *_expr)
|
||||||
: Statement(Kind_ReturnExpression), expr(_expr) {}
|
: Statement(Kind_ReturnExpression), expr(_expr) {}
|
||||||
~ReturnStatement();
|
|
||||||
|
|
||||||
virtual ReturnStatement *asReturnStatement() { return this; }
|
virtual ReturnStatement *asReturnStatement() { return this; }
|
||||||
|
|
||||||
@@ -553,7 +548,6 @@ class GLSL_EXPORT SwitchStatement: public Statement
|
|||||||
public:
|
public:
|
||||||
SwitchStatement(Expression *_expr, Statement *_body)
|
SwitchStatement(Expression *_expr, Statement *_body)
|
||||||
: Statement(Kind_Switch), expr(_expr), body(_body) {}
|
: Statement(Kind_Switch), expr(_expr), body(_body) {}
|
||||||
~SwitchStatement();
|
|
||||||
|
|
||||||
virtual SwitchStatement *asSwitchStatement() { return this; }
|
virtual SwitchStatement *asSwitchStatement() { return this; }
|
||||||
|
|
||||||
@@ -570,7 +564,6 @@ public:
|
|||||||
CaseLabelStatement() : Statement(Kind_DefaultLabel), expr(0) {}
|
CaseLabelStatement() : Statement(Kind_DefaultLabel), expr(0) {}
|
||||||
CaseLabelStatement(Expression *_expr)
|
CaseLabelStatement(Expression *_expr)
|
||||||
: Statement(Kind_CaseLabel), expr(_expr) {}
|
: Statement(Kind_CaseLabel), expr(_expr) {}
|
||||||
~CaseLabelStatement();
|
|
||||||
|
|
||||||
virtual CaseLabelStatement *asCaseLabelStatement() { return this; }
|
virtual CaseLabelStatement *asCaseLabelStatement() { return this; }
|
||||||
|
|
||||||
@@ -602,9 +595,6 @@ public:
|
|||||||
// Set the precision for the innermost basic type. Returns false if it
|
// Set the precision for the innermost basic type. Returns false if it
|
||||||
// is not valid to set a precision (e.g. structs, samplers, etc).
|
// is not valid to set a precision (e.g. structs, samplers, etc).
|
||||||
virtual bool setPrecision(Precision precision) = 0;
|
virtual bool setPrecision(Precision precision) = 0;
|
||||||
|
|
||||||
virtual Type *clone() const = 0;
|
|
||||||
static Type *clone(Type *type);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class GLSL_EXPORT BasicType: public Type
|
class GLSL_EXPORT BasicType: public Type
|
||||||
@@ -614,7 +604,6 @@ public:
|
|||||||
BasicType(int _token);
|
BasicType(int _token);
|
||||||
BasicType(int _token, Precision _prec)
|
BasicType(int _token, Precision _prec)
|
||||||
: Type(Kind_BasicType), prec(_prec), token(_token) {}
|
: Type(Kind_BasicType), prec(_prec), token(_token) {}
|
||||||
~BasicType();
|
|
||||||
|
|
||||||
virtual BasicType *asBasicType() { return this; }
|
virtual BasicType *asBasicType() { return this; }
|
||||||
|
|
||||||
@@ -623,8 +612,6 @@ public:
|
|||||||
virtual Precision precision() const;
|
virtual Precision precision() const;
|
||||||
virtual bool setPrecision(Precision precision);
|
virtual bool setPrecision(Precision precision);
|
||||||
|
|
||||||
virtual Type *clone() const;
|
|
||||||
|
|
||||||
public: // attributes
|
public: // attributes
|
||||||
Precision prec;
|
Precision prec;
|
||||||
int token;
|
int token;
|
||||||
@@ -634,7 +621,6 @@ class GLSL_EXPORT NamedType: public Type
|
|||||||
{
|
{
|
||||||
public:
|
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; }
|
virtual NamedType *asNamedType() { return this; }
|
||||||
|
|
||||||
@@ -643,8 +629,6 @@ public:
|
|||||||
virtual Precision precision() const;
|
virtual Precision precision() const;
|
||||||
virtual bool setPrecision(Precision precision);
|
virtual bool setPrecision(Precision precision);
|
||||||
|
|
||||||
virtual Type *clone() const;
|
|
||||||
|
|
||||||
public: // attributes
|
public: // attributes
|
||||||
const std::string *name;
|
const std::string *name;
|
||||||
};
|
};
|
||||||
@@ -656,7 +640,6 @@ public:
|
|||||||
: Type(Kind_OpenArrayType), elementType(_elementType), size(0) {}
|
: Type(Kind_OpenArrayType), elementType(_elementType), size(0) {}
|
||||||
ArrayType(Type *_elementType, Expression *_size)
|
ArrayType(Type *_elementType, Expression *_size)
|
||||||
: Type(Kind_ArrayType), elementType(_elementType), size(_size) {}
|
: Type(Kind_ArrayType), elementType(_elementType), size(_size) {}
|
||||||
~ArrayType();
|
|
||||||
|
|
||||||
virtual ArrayType *asArrayType() { return this; }
|
virtual ArrayType *asArrayType() { return this; }
|
||||||
|
|
||||||
@@ -665,8 +648,6 @@ public:
|
|||||||
virtual Precision precision() const;
|
virtual Precision precision() const;
|
||||||
virtual bool setPrecision(Precision precision);
|
virtual bool setPrecision(Precision precision);
|
||||||
|
|
||||||
virtual Type *clone() const;
|
|
||||||
|
|
||||||
public: // attributes
|
public: // attributes
|
||||||
Type *elementType;
|
Type *elementType;
|
||||||
Expression *size;
|
Expression *size;
|
||||||
@@ -675,20 +656,6 @@ public: // attributes
|
|||||||
class GLSL_EXPORT StructType: public Type
|
class GLSL_EXPORT StructType: public Type
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
StructType() : Type(Kind_AnonymousStructType) {}
|
|
||||||
StructType(const std::string *_name)
|
|
||||||
: Type(Kind_StructType), name(_name) {}
|
|
||||||
~StructType();
|
|
||||||
|
|
||||||
virtual StructType *asStructType() { return this; }
|
|
||||||
|
|
||||||
virtual void accept0(Visitor *visitor);
|
|
||||||
|
|
||||||
virtual Precision precision() const;
|
|
||||||
virtual bool setPrecision(Precision precision);
|
|
||||||
|
|
||||||
virtual Type *clone() const;
|
|
||||||
|
|
||||||
class Field: public AST
|
class Field: public AST
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -701,8 +668,6 @@ public:
|
|||||||
Field(const std::string *_name, Type *_type)
|
Field(const std::string *_name, Type *_type)
|
||||||
: AST(Kind_StructField), name(_name), type(_type) {}
|
: AST(Kind_StructField), name(_name), type(_type) {}
|
||||||
|
|
||||||
~Field();
|
|
||||||
|
|
||||||
virtual void accept0(Visitor *visitor);
|
virtual void accept0(Visitor *visitor);
|
||||||
|
|
||||||
void setInnerType(Type *innerType);
|
void setInnerType(Type *innerType);
|
||||||
@@ -711,15 +676,31 @@ public:
|
|||||||
Type *type;
|
Type *type;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Fix the inner types of a field list. The "innerType" will
|
StructType(List<Field *> *_fields)
|
||||||
// be cloned into all the fields and then deleted.
|
: Type(Kind_AnonymousStructType), fields(finish(_fields)) {}
|
||||||
static void fixInnerTypes(Type *innerType, std::vector<Field *> &fields);
|
StructType(const std::string *_name, List<Field *> *_fields)
|
||||||
|
: Type(Kind_StructType), name(_name), fields(finish(_fields)) {}
|
||||||
|
|
||||||
void addFields(const std::vector<Field *> &list);
|
virtual StructType *asStructType() { return this; }
|
||||||
|
|
||||||
|
virtual void accept0(Visitor *visitor);
|
||||||
|
|
||||||
|
virtual Precision precision() const;
|
||||||
|
virtual bool setPrecision(Precision precision);
|
||||||
|
|
||||||
|
// Fix the inner types of a field list. The "innerType" will
|
||||||
|
// be copied into the "array holes" of all fields.
|
||||||
|
static void fixInnerTypes(Type *innerType, List<Field *> *fields);
|
||||||
|
|
||||||
|
// Add a new group of fields after having their inner types fixed.
|
||||||
|
void addFields(List<Field *> *list)
|
||||||
|
{
|
||||||
|
fields = appendLists(fields, list);
|
||||||
|
}
|
||||||
|
|
||||||
public: // attributes
|
public: // attributes
|
||||||
const std::string *name;
|
const std::string *name;
|
||||||
std::vector<Field *> fields;
|
List<Field *> *fields;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace GLSL
|
} // namespace GLSL
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ switch(ruleno) {
|
|||||||
#line 466 "./glsl.g"
|
#line 466 "./glsl.g"
|
||||||
|
|
||||||
case 0: {
|
case 0: {
|
||||||
ast(1) = new IdentifierExpression(sym(1).string);
|
ast(1) = new (_engine->pool()) IdentifierExpression(sym(1).string);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
#line 473 "./glsl.g"
|
#line 473 "./glsl.g"
|
||||||
@@ -372,7 +372,7 @@ case 33: {
|
|||||||
#line 704 "./glsl.g"
|
#line 704 "./glsl.g"
|
||||||
|
|
||||||
case 34: {
|
case 34: {
|
||||||
ast(1) = new BinaryExpression(AST::Kind_Multiply, sym(1).expression, sym(3).expression);
|
ast(1) = new (_engine->pool()) BinaryExpression(AST::Kind_Multiply, sym(1).expression, sym(3).expression);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
#line 711 "./glsl.g"
|
#line 711 "./glsl.g"
|
||||||
@@ -1998,7 +1998,7 @@ case 304: {
|
|||||||
#line 2601 "./glsl.g"
|
#line 2601 "./glsl.g"
|
||||||
|
|
||||||
case 305: {
|
case 305: {
|
||||||
ast(1) = new TranslationUnit(sym(1).declaration_list);
|
ast(1) = new (_engine->pool()) TranslationUnit(sym(1).declaration_list);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
#line 2608 "./glsl.g"
|
#line 2608 "./glsl.g"
|
||||||
|
|||||||
Reference in New Issue
Block a user