#include <vector>
#include <msp/core/refptr.h>
#include "features.h"
+#include "glsl_error.h"
#include "sourcemap.h"
#pragma push_macro("interface")
enum Associativity
{
LEFT_TO_RIGHT,
- RIGHT_TO_LEFT
+ RIGHT_TO_LEFT,
+ ASSOCIATIVE
};
char token[4];
Associativity assoc;
static const Operator operators[];
+
+ static const Operator &get_operator(const std::string &, Type);
};
enum
struct Expression: Node
{
+ const Operator *oper;
+
+ Expression();
+
virtual Expression *clone() const = 0;
};
struct UnaryExpression: Expression
{
- std::string oper;
NodePtr<Expression> expression;
- bool prefix;
-
- UnaryExpression();
virtual UnaryExpression *clone() const { return new UnaryExpression(*this); }
virtual void visit(NodeVisitor &);
struct BinaryExpression: Expression
{
NodePtr<Expression> left;
- std::string oper;
NodePtr<Expression> right;
- std::string after;
virtual BinaryExpression *clone() const { return new BinaryExpression(*this); }
virtual void visit(NodeVisitor &);
struct Iteration: Statement
{
- NodePtr<Node> init_statement;
+ NodePtr<Statement> init_statement;
NodePtr<Expression> condition;
NodePtr<Expression> loop_expression;
Block body;
std::map<std::string, FunctionDeclaration *> functions;
std::map<std::string, unsigned> locations;
Features required_features;
+ std::vector<Diagnostic> diagnostics;
Stage(Type);