Commit fabf3e40 by John Kessenich

Add arrays of arrays grammar, and adapt existing 1D array semantics to keep working as before.

Also add buffer and shared keywords and grammar, which brings the grammar up to 4.3. N.B. There is a problem for "shared": it is both a keyword (as a storage qualifier) and an identifier (for layouts). git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@19947 e7fa87d3-cd2b-0410-9028-fcbf551c1848
parent e320a185
...@@ -745,17 +745,16 @@ bool TParseContext::arrayQualifierErrorCheck(int line, TPublicType type) ...@@ -745,17 +745,16 @@ bool TParseContext::arrayQualifierErrorCheck(int line, TPublicType type)
} }
// //
// See if this type can be an array. // Require array to have size
// //
// Returns true if there is an error. // Returns true if there is an error.
// //
bool TParseContext::arrayTypeErrorCheck(int line, TPublicType type) bool TParseContext::arraySizeRequiredErrorCheck(int line, int& size)
{ {
// if (size == 0) {
// Can the type be an array? error(line, "array size required", "", "");
// size = 1;
if (type.array) {
error(line, "cannot declare arrays of arrays", TType(type).getCompleteString().c_str(), "");
return true; return true;
} }
......
...@@ -103,7 +103,7 @@ struct TParseContext { ...@@ -103,7 +103,7 @@ struct TParseContext {
bool constructorErrorCheck(int line, TIntermNode*, TFunction&, TOperator, TType*); bool constructorErrorCheck(int line, TIntermNode*, TFunction&, TOperator, TType*);
bool arraySizeErrorCheck(int line, TIntermTyped* expr, int& size); bool arraySizeErrorCheck(int line, TIntermTyped* expr, int& size);
bool arrayQualifierErrorCheck(int line, TPublicType type); bool arrayQualifierErrorCheck(int line, TPublicType type);
bool arrayTypeErrorCheck(int line, TPublicType type); bool arraySizeRequiredErrorCheck(int line, int& size);
bool arrayErrorCheck(int line, TString& identifier, TPublicType type, TVariable*& variable); bool arrayErrorCheck(int line, TString& identifier, TPublicType type, TVariable*& variable);
bool insertBuiltInArrayAtGlobalLevel(); bool insertBuiltInArrayAtGlobalLevel();
bool voidErrorCheck(int, const TString&, const TPublicType&); bool voidErrorCheck(int, const TString&, const TPublicType&);
......
...@@ -100,6 +100,8 @@ TSourceLoc yylineno; ...@@ -100,6 +100,8 @@ TSourceLoc yylineno;
"patch" { pyylval->lex.line = yylineno; return(PATCH); } "patch" { pyylval->lex.line = yylineno; return(PATCH); }
"sample" { pyylval->lex.line = yylineno; return(SAMPLE); } "sample" { pyylval->lex.line = yylineno; return(SAMPLE); }
"uniform" { pyylval->lex.line = yylineno; return(UNIFORM); } "uniform" { pyylval->lex.line = yylineno; return(UNIFORM); }
"buffer" { pyylval->lex.line = yylineno; return(BUFFER); }
"shared" { pyylval->lex.line = yylineno; return(SHARED); }
"coherent" { pyylval->lex.line = yylineno; return(COHERENT); } "coherent" { pyylval->lex.line = yylineno; return(COHERENT); }
"volatile" { pyylval->lex.line = yylineno; return(VOLATILE); } "volatile" { pyylval->lex.line = yylineno; return(VOLATILE); }
"restrict" { pyylval->lex.line = yylineno; return(RESTRICT); } "restrict" { pyylval->lex.line = yylineno; return(RESTRICT); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment