4#ifndef QSSG_GLSLPARSER_H
5#define QSSG_GLSLPARSER_H
18#include <QtQuick3DGlslParser/private/glsllexer_p.h>
19#include <QtQuick3DGlslParser/private/glslast_p.h>
20#include <QtQuick3DGlslParser/private/glslengine_p.h>
21#include <QtQuick3DGlslParser/private/glslparsertable_p.h>
81 if (
AST *u = parse(T_FEED_GLSL))
87 if (
AST *u = parse(T_FEED_EXPRESSION))
92 AST *parse(
int startToken);
96 int &
location(
int n) {
return _locationStack[_tos +
n - 1]; }
97 Value &sym(
int n) {
return _symStack[_tos +
n - 1]; }
98 AST *&ast(
int n) {
return _symStack[_tos +
n - 1].ast; }
99 const QString *&
string(
int n) {
return _symStack[_tos +
n - 1].string; }
100 ExpressionAST *&expression(
int n) {
return _symStack[_tos +
n - 1].expression; }
101 StatementAST *&statement(
int n) {
return _symStack[_tos +
n - 1].statement; }
102 TypeAST *&
type(
int n) {
return _symStack[_tos +
n - 1].type; }
103 FunctionDeclarationAST *&
function(
int n) {
return _symStack[_tos +
n - 1].function_declaration; }
105 inline int consumeToken() {
106 if (_index <
int(_tokens.size()))
108 return static_cast<int>(_tokens.size()) - 1;
110 inline const Token &tokenAt(
int index)
const {
113 return _tokens.at(
index);
115 inline int tokenKind(
int index)
const {
117 return _startToken.kind;
118 return _tokens.at(
index).kind;
120 void reduce(
int ruleno);
132 template <
typename T>
135 T *node =
new (_engine->pool()) T ();
136 node->lineno = yyloc >= 0 ? (_tokens[yyloc].line + 1) : 0;
140 template <
typename T,
typename A1>
141 T *makeAstNode(A1
a1)
143 T *node =
new (_engine->pool()) T (
a1);
144 node->lineno = yyloc >= 0 ? (_tokens[yyloc].line + 1) : 0;
148 template <
typename T,
typename A1,
typename A2>
149 T *makeAstNode(A1
a1, A2
a2)
151 T *node =
new (_engine->pool()) T (
a1,
a2);
152 node->lineno = yyloc >= 0 ? (_tokens[yyloc].line + 1) : 0;
156 template <
typename T,
typename A1,
typename A2,
typename A3>
157 T *makeAstNode(A1
a1, A2
a2, A3
a3)
159 T *node =
new (_engine->pool()) T (
a1,
a2,
a3);
160 node->lineno = yyloc >= 0 ? (_tokens[yyloc].line + 1) : 0;
164 template <
typename T,
typename A1,
typename A2,
typename A3,
typename A4>
165 T *makeAstNode(A1
a1, A2
a2, A3
a3, A4 a4)
167 T *node =
new (_engine->pool()) T (
a1,
a2,
a3, a4);
168 node->lineno = yyloc >= 0 ? (_tokens[yyloc].line + 1) : 0;
172 TypeAST *makeBasicType(
int token)
174 TypeAST *
type =
new (_engine->pool()) BasicTypeAST(
token, spell[
token]);
175 type->lineno = yyloc >= 0 ? (_tokens[yyloc].line + 1) : 0;
188 std::vector<int> _stateStack;
189 std::vector<int> _locationStack;
190 std::vector<Value> _symStack;
191 std::vector<Token> _tokens;
ExpressionAST * asExpression() override
ExpressionAST * parseExpression()
TranslationUnitAST * parse()
TranslationUnitAST * asTranslationUnit() override
\macro QT_RESTRICTED_CAST_FROM_ASCII
Combined button and popup list for selecting options.
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction function
DBusConnection const char DBusError * error
#define Q_DECLARE_MIXED_ENUM_OPERATORS_SYMMETRIC(Ret, Flags, Enum)
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint GLsizei const GLchar * message
GLsizei GLsizei GLchar * source
GLsizei const GLchar *const * string
[0]
FunctionDeclarationAST * function_declaration
List< ExpressionAST * > * arguments
List< ExpressionAST * > * expression_list
ExpressionAST * expression
FunctionIdentifierAST * function_identifier
StatementAST * thenClause
List< DeclarationAST * > * declaration_list
FunctionIdentifierAST * id
StatementAST * elseClause
ParameterDeclarationAST * param_declaration
ExpressionAST * increment
List< StructTypeAST::Field * > * field_list
List< StatementAST * > * statement_list
TranslationUnitAST * translation_unit
ExpressionAST * condition
List< LayoutQualifierAST * > * layout_list
DeclarationAST * declaration
LayoutQualifierAST * layout
TypeAST::Precision precision
StructTypeAST::Field * field