OSDN Git Service

Initializer cleanup
authorAlexis Hetu <sugoi@google.com>
Thu, 11 Jun 2015 12:25:30 +0000 (08:25 -0400)
committerAlexis Hétu <sugoi@google.com>
Fri, 12 Jun 2015 13:59:16 +0000 (13:59 +0000)
Cleaned up the initialer methods in the parser
and added first-class array initializers.

Passes all WebGL tests.

Change-Id: Ia73db8bfd461f36b717444a8ba4c9ec77d1cee36
Reviewed-on: https://swiftshader-review.googlesource.com/3473
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
src/OpenGL/compiler/ParseHelper.cpp
src/OpenGL/compiler/ParseHelper.h
src/OpenGL/compiler/SymbolTable.h
src/OpenGL/compiler/glslang.y
src/OpenGL/compiler/glslang_tab.cpp
src/OpenGL/compiler/intermediate.h

index 8088cbe..a9dbef6 100644 (file)
@@ -556,9 +556,9 @@ bool TParseContext::constructorErrorCheck(int line, TIntermNode* node, TFunction
 //
 // returns true in case of an error
 //
-bool TParseContext::voidErrorCheck(int line, const TString& identifier, const TPublicType& pubType)
+bool TParseContext::voidErrorCheck(int line, const TString& identifier, const TBasicType& type)
 {
-    if (pubType.type == EbtVoid) {
+    if(type == EbtVoid) {
         error(line, "illegal use of type 'void'", identifier.c_str());
         return true;
     }
@@ -654,6 +654,60 @@ bool TParseContext::structQualifierErrorCheck(int line, const TPublicType& pType
     return false;
 }
 
+// These checks are common for all declarations starting a declarator list, and declarators that follow an empty
+// declaration.
+//
+bool TParseContext::singleDeclarationErrorCheck(const TPublicType &publicType, const TSourceLoc &identifierLocation)
+{
+       switch(publicType.qualifier)
+       {
+       case EvqVaryingIn:
+       case EvqVaryingOut:
+       case EvqAttribute:
+       case EvqVertexIn:
+       case EvqFragmentOut:
+               if(publicType.type == EbtStruct)
+               {
+                       error(identifierLocation, "cannot be used with a structure",
+                               getQualifierString(publicType.qualifier));
+                       return true;
+               }
+
+       default: break;
+       }
+
+       if(publicType.qualifier != EvqUniform && samplerErrorCheck(identifierLocation, publicType,
+               "samplers must be uniform"))
+       {
+               return true;
+       }
+
+       // check for layout qualifier issues
+       const TLayoutQualifier layoutQualifier = publicType.layoutQualifier;
+
+       if(layoutQualifier.matrixPacking != EmpUnspecified)
+       {
+               error(identifierLocation, "layout qualifier", getMatrixPackingString(layoutQualifier.matrixPacking),
+                       "only valid for interface blocks");
+               return true;
+       }
+
+       if(layoutQualifier.blockStorage != EbsUnspecified)
+       {
+               error(identifierLocation, "layout qualifier", getBlockStorageString(layoutQualifier.blockStorage),
+                       "only valid for interface blocks");
+               return true;
+       }
+
+       if(publicType.qualifier != EvqVertexIn && publicType.qualifier != EvqFragmentOut &&
+               layoutLocationErrorCheck(identifierLocation, publicType.layoutQualifier))
+       {
+               return true;
+       }
+
+       return false;
+}
+
 bool TParseContext::layoutLocationErrorCheck(const TSourceLoc &location, const TLayoutQualifier &layoutQualifier)\r
 {\r
        if(layoutQualifier.location != -1)\r
@@ -665,6 +719,17 @@ bool TParseContext::layoutLocationErrorCheck(const TSourceLoc &location, const T
        return false;\r
 }\r
 
+bool TParseContext::locationDeclaratorListCheck(const TSourceLoc& line, const TPublicType &pType)
+{
+       if(pType.layoutQualifier.location != -1)
+       {
+               error(line, "location must only be specified for a single input or output variable", "location");
+               return true;
+       }
+
+       return false;
+}
+
 bool TParseContext::parameterSamplerErrorCheck(int line, TQualifier qualifier, const TType& type)
 {
     if ((qualifier == EvqOut || qualifier == EvqInOut) &&
@@ -834,7 +899,7 @@ bool TParseContext::arrayErrorCheck(int line, TString& identifier, TPublicType t
             variable->getType().setArraySize(type.arraySize);
     }
 
-    if (voidErrorCheck(line, identifier, type))
+    if (voidErrorCheck(line, identifier, type.type))
         return true;
 
     return false;
@@ -921,24 +986,74 @@ bool TParseContext::nonInitConstErrorCheck(int line, TString& identifier, TPubli
 //
 // Returns true if there was an error.
 //
-bool TParseContext::nonInitErrorCheck(int line, TString& identifier, TPublicType& type, TVariable*& variable)
+bool TParseContext::nonInitErrorCheck(int line, const TString& identifier, TPublicType& type)
 {
-    if (reservedErrorCheck(line, identifier))
-        recover();
+       if(type.qualifier == EvqConstExpr)
+       {
+               // Make the qualifier make sense.
+               type.qualifier = EvqTemporary;
 
-    variable = new TVariable(&identifier, TType(type));
+               // Generate informative error messages for ESSL1.
+               // In ESSL3 arrays and structures containing arrays can be constant.
+               if(shaderVersion < 300 && type.isStructureContainingArrays())
+               {
+                       error(line,
+                               "structures containing arrays may not be declared constant since they cannot be initialized",
+                               identifier.c_str());
+               }
+               else
+               {
+                       error(line, "variables with qualifier 'const' must be initialized", identifier.c_str());
+               }
 
-    if (! symbolTable.declare(*variable)) {
-        error(line, "redefinition", variable->getName().c_str());
-        delete variable;
-        variable = 0;
-        return true;
-    }
+               return true;
+       }
+       if(type.isUnsizedArray())
+       {
+               error(line, "implicitly sized arrays need to be initialized", identifier.c_str());
+               return true;
+       }
+       return false;
+}
 
-    if (voidErrorCheck(line, identifier, type))
-        return true;
+// Do some simple checks that are shared between all variable declarations,
+// and update the symbol table.
+//
+// Returns true if declaring the variable succeeded.
+//
+bool TParseContext::declareVariable(const TSourceLoc &line, const TString &identifier, const TType &type,
+       TVariable **variable)
+{
+       ASSERT((*variable) == nullptr);
 
-    return false;
+       // gl_LastFragData may be redeclared with a new precision qualifier
+       if(type.isArray() && identifier.compare(0, 15, "gl_LastFragData") == 0)
+       {
+               const TVariable *maxDrawBuffers =
+                       static_cast<const TVariable *>(symbolTable.findBuiltIn("gl_MaxDrawBuffers", shaderVersion));
+               if(type.getArraySize() != maxDrawBuffers->getConstPointer()->getIConst())
+               {
+                       error(line, "redeclaration of gl_LastFragData with size != gl_MaxDrawBuffers", identifier.c_str());
+                       return false;
+               }
+       }
+
+       if(reservedErrorCheck(line, identifier))
+               return false;
+
+       (*variable) = new TVariable(&identifier, type);
+       if(!symbolTable.declare(**variable))
+       {
+               error(line, "redefinition", identifier.c_str());
+               delete (*variable);
+               (*variable) = nullptr;
+               return false;
+       }
+
+       if(voidErrorCheck(line, identifier, type.getBasicType()))
+               return false;
+
+       return true;
 }
 
 bool TParseContext::paramErrorCheck(int line, TQualifier qualifier, TQualifier paramQualifier, TType* type)
@@ -1028,6 +1143,64 @@ void TParseContext::handlePragmaDirective(int line, const char* name, const char
 //
 /////////////////////////////////////////////////////////////////////////////////
 
+const TVariable *TParseContext::getNamedVariable(const TSourceLoc &location,
+       const TString *name,
+       const TSymbol *symbol)
+{
+       const TVariable *variable = NULL;
+
+       if(!symbol)
+       {
+               error(location, "undeclared identifier", name->c_str());
+               recover();
+       }
+       else if(!symbol->isVariable())
+       {
+               error(location, "variable expected", name->c_str());
+               recover();
+       }
+       else
+       {
+               variable = static_cast<const TVariable*>(symbol);
+
+               if(symbolTable.findBuiltIn(variable->getName(), shaderVersion))
+               {
+                       recover();
+               }
+
+               // Reject shaders using both gl_FragData and gl_FragColor
+               TQualifier qualifier = variable->getType().getQualifier();
+               if(qualifier == EvqFragData)
+               {
+                       mUsesFragData = true;
+               }
+               else if(qualifier == EvqFragColor)
+               {
+                       mUsesFragColor = true;
+               }
+
+               // This validation is not quite correct - it's only an error to write to
+               // both FragData and FragColor. For simplicity, and because users shouldn't
+               // be rewarded for reading from undefined varaibles, return an error
+               // if they are both referenced, rather than assigned.
+               if(mUsesFragData && mUsesFragColor)
+               {
+                       error(location, "cannot use both gl_FragData and gl_FragColor", name->c_str());
+                       recover();
+               }
+       }
+
+       if(!variable)
+       {
+               TType type(EbtFloat, EbpUndefined);
+               TVariable *fakeVariable = new TVariable(name, type);
+               symbolTable.declare(*fakeVariable);
+               variable = fakeVariable;
+       }
+
+       return variable;
+}
+
 //
 // Look up a function name in the symbol table, and make sure it is a function.
 //
@@ -1059,7 +1232,7 @@ const TFunction* TParseContext::findFunction(int line, TFunction* call, bool *bu
 // Initializers show up in several places in the grammar.  Have one set of
 // code to handle them here.
 //
-bool TParseContext::executeInitializer(TSourceLoc line, TString& identifier, TPublicType& pType,
+bool TParseContext::executeInitializer(TSourceLoc line, const TString& identifier, const TPublicType& pType,
                                        TIntermTyped* initializer, TIntermNode*& intermNode, TVariable* variable)
 {
     TType type = TType(pType);
@@ -1068,7 +1241,7 @@ bool TParseContext::executeInitializer(TSourceLoc line, TString& identifier, TPu
         if (reservedErrorCheck(line, identifier))
             return true;
 
-        if (voidErrorCheck(line, identifier, pType))
+        if (voidErrorCheck(line, identifier, pType.type))
             return true;
 
         //
@@ -1235,6 +1408,360 @@ TPublicType TParseContext::addFullySpecifiedType(TQualifier qualifier, bool inva
        return returnType;
 }
 
+TIntermAggregate *TParseContext::parseSingleDeclaration(TPublicType &publicType,
+       const TSourceLoc &identifierOrTypeLocation,
+       const TString &identifier)
+{
+       TIntermSymbol *symbol = intermediate.addSymbol(0, identifier, TType(publicType), identifierOrTypeLocation);
+
+       bool emptyDeclaration = (identifier == "");
+
+       mDeferredSingleDeclarationErrorCheck = emptyDeclaration;
+
+       if(emptyDeclaration)
+       {
+               if(publicType.isUnsizedArray())
+               {
+                       // ESSL3 spec section 4.1.9: Array declaration which leaves the size unspecified is an error.
+                       // It is assumed that this applies to empty declarations as well.
+                       error(identifierOrTypeLocation, "empty array declaration needs to specify a size", identifier.c_str());
+               }
+       }
+       else
+       {
+               if(singleDeclarationErrorCheck(publicType, identifierOrTypeLocation))
+                       recover();
+
+               if(nonInitErrorCheck(identifierOrTypeLocation, identifier, publicType))
+                       recover();
+
+               TVariable *variable = nullptr;
+               if(!declareVariable(identifierOrTypeLocation, identifier, TType(publicType), &variable))
+                       recover();
+
+               if(variable && symbol)
+                       symbol->setId(variable->getUniqueId());
+       }
+
+       return intermediate.makeAggregate(symbol, identifierOrTypeLocation);
+}
+
+TIntermAggregate *TParseContext::parseSingleArrayDeclaration(TPublicType &publicType,
+       const TSourceLoc &identifierLocation,
+       const TString &identifier,
+       const TSourceLoc &indexLocation,
+       TIntermTyped *indexExpression)
+{
+       mDeferredSingleDeclarationErrorCheck = false;
+
+       if(singleDeclarationErrorCheck(publicType, identifierLocation))
+               recover();
+
+       if(nonInitErrorCheck(identifierLocation, identifier, publicType))
+               recover();
+
+       if(arrayTypeErrorCheck(indexLocation, publicType) || arrayQualifierErrorCheck(indexLocation, publicType))
+       {
+               recover();
+       }
+
+       TType arrayType(publicType);
+
+       int size;
+       if(arraySizeErrorCheck(identifierLocation, indexExpression, size))
+       {
+               recover();
+       }
+       // Make the type an array even if size check failed.
+       // This ensures useless error messages regarding the variable's non-arrayness won't follow.
+       arrayType.setArraySize(size);
+
+       TVariable *variable = nullptr;
+       if(!declareVariable(identifierLocation, identifier, arrayType, &variable))
+               recover();
+
+       TIntermSymbol *symbol = intermediate.addSymbol(0, identifier, arrayType, identifierLocation);
+       if(variable && symbol)
+               symbol->setId(variable->getUniqueId());
+
+       return intermediate.makeAggregate(symbol, identifierLocation);
+}
+
+TIntermAggregate *TParseContext::parseSingleInitDeclaration(const TPublicType &publicType,
+       const TSourceLoc &identifierLocation,
+       const TString &identifier,
+       const TSourceLoc &initLocation,
+       TIntermTyped *initializer)
+{
+       mDeferredSingleDeclarationErrorCheck = false;
+
+       if(singleDeclarationErrorCheck(publicType, identifierLocation))
+               recover();
+
+       TIntermNode *intermNode = nullptr;
+       if(!executeInitializer(identifierLocation, identifier, publicType, initializer, intermNode))
+       {
+               //
+               // Build intermediate representation
+               //
+               return intermNode ? intermediate.makeAggregate(intermNode, initLocation) : nullptr;
+       }
+       else
+       {
+               recover();
+               return nullptr;
+       }
+}
+
+TIntermAggregate *TParseContext::parseSingleArrayInitDeclaration(TPublicType &publicType,
+       const TSourceLoc &identifierLocation,
+       const TString &identifier,
+       const TSourceLoc &indexLocation,
+       TIntermTyped *indexExpression,
+       const TSourceLoc &initLocation,
+       TIntermTyped *initializer)
+{
+       mDeferredSingleDeclarationErrorCheck = false;
+
+       if(singleDeclarationErrorCheck(publicType, identifierLocation))
+               recover();
+
+       if(arrayTypeErrorCheck(indexLocation, publicType) || arrayQualifierErrorCheck(indexLocation, publicType))
+       {
+               recover();
+       }
+
+       TPublicType arrayType(publicType);
+
+       int size = 0;
+       // If indexExpression is nullptr, then the array will eventually get its size implicitly from the initializer.
+       if(indexExpression != nullptr && arraySizeErrorCheck(identifierLocation, indexExpression, size))
+       {
+               recover();
+       }
+       // Make the type an array even if size check failed.
+       // This ensures useless error messages regarding the variable's non-arrayness won't follow.
+       arrayType.setArray(true, size);
+
+       // initNode will correspond to the whole of "type b[n] = initializer".
+       TIntermNode *initNode = nullptr;
+       if(!executeInitializer(identifierLocation, identifier, arrayType, initializer, initNode))
+       {
+               return initNode ? intermediate.makeAggregate(initNode, initLocation) : nullptr;
+       }
+       else
+       {
+               recover();
+               return nullptr;
+       }
+}
+
+TIntermAggregate *TParseContext::parseInvariantDeclaration(const TSourceLoc &invariantLoc,
+       const TSourceLoc &identifierLoc,
+       const TString *identifier,
+       const TSymbol *symbol)
+{
+       // invariant declaration
+       if(globalErrorCheck(invariantLoc, symbolTable.atGlobalLevel(), "invariant varying"))
+       {
+               recover();
+       }
+
+       if(!symbol)
+       {
+               error(identifierLoc, "undeclared identifier declared as invariant", identifier->c_str());
+               recover();
+               return nullptr;
+       }
+       else
+       {
+               const TString kGlFrontFacing("gl_FrontFacing");
+               if(*identifier == kGlFrontFacing)
+               {
+                       error(identifierLoc, "identifier should not be declared as invariant", identifier->c_str());
+                       recover();
+                       return nullptr;
+               }
+               symbolTable.addInvariantVarying(std::string(identifier->c_str()));
+               const TVariable *variable = getNamedVariable(identifierLoc, identifier, symbol);
+               ASSERT(variable);
+               const TType &type = variable->getType();
+               TIntermSymbol *intermSymbol = intermediate.addSymbol(variable->getUniqueId(),
+                       *identifier, type, identifierLoc);
+
+               TIntermAggregate *aggregate = intermediate.makeAggregate(intermSymbol, identifierLoc);
+               aggregate->setOp(EOpInvariantDeclaration);
+               return aggregate;
+       }
+}
+
+TIntermAggregate *TParseContext::parseDeclarator(TPublicType &publicType, TIntermAggregate *aggregateDeclaration,
+       const TSourceLoc &identifierLocation, const TString &identifier)
+{
+       // If the declaration starting this declarator list was empty (example: int,), some checks were not performed.
+       if(mDeferredSingleDeclarationErrorCheck)
+       {
+               if(singleDeclarationErrorCheck(publicType, identifierLocation))
+                       recover();
+               mDeferredSingleDeclarationErrorCheck = false;
+       }
+
+       if(locationDeclaratorListCheck(identifierLocation, publicType))
+               recover();
+
+       if(nonInitErrorCheck(identifierLocation, identifier, publicType))
+               recover();
+
+       TVariable *variable = nullptr;
+       if(!declareVariable(identifierLocation, identifier, TType(publicType), &variable))
+               recover();
+
+       TIntermSymbol *symbol = intermediate.addSymbol(0, identifier, TType(publicType), identifierLocation);
+       if(variable && symbol)
+               symbol->setId(variable->getUniqueId());
+
+       return intermediate.growAggregate(aggregateDeclaration, symbol, identifierLocation);
+}
+
+TIntermAggregate *TParseContext::parseArrayDeclarator(TPublicType &publicType, TIntermAggregate *aggregateDeclaration,
+       const TSourceLoc &identifierLocation, const TString &identifier,
+       const TSourceLoc &arrayLocation, TIntermTyped *indexExpression)
+{
+       // If the declaration starting this declarator list was empty (example: int,), some checks were not performed.
+       if(mDeferredSingleDeclarationErrorCheck)
+       {
+               if(singleDeclarationErrorCheck(publicType, identifierLocation))
+                       recover();
+               mDeferredSingleDeclarationErrorCheck = false;
+       }
+
+       if(locationDeclaratorListCheck(identifierLocation, publicType))
+               recover();
+
+       if(nonInitErrorCheck(identifierLocation, identifier, publicType))
+               recover();
+
+       if(arrayTypeErrorCheck(arrayLocation, publicType) || arrayQualifierErrorCheck(arrayLocation, publicType))
+       {
+               recover();
+       }
+       else
+       {
+               TType arrayType = TType(publicType);
+               int size;
+               if(arraySizeErrorCheck(arrayLocation, indexExpression, size))
+               {
+                       recover();
+               }
+               arrayType.setArraySize(size);
+
+               TVariable *variable = nullptr;
+               if(!declareVariable(identifierLocation, identifier, arrayType, &variable))
+                       recover();
+
+               TIntermSymbol *symbol = intermediate.addSymbol(0, identifier, arrayType, identifierLocation);
+               if(variable && symbol)
+                       symbol->setId(variable->getUniqueId());
+
+               return intermediate.growAggregate(aggregateDeclaration, symbol, identifierLocation);
+       }
+
+       return nullptr;
+}
+
+TIntermAggregate *TParseContext::parseInitDeclarator(const TPublicType &publicType, TIntermAggregate *aggregateDeclaration,
+       const TSourceLoc &identifierLocation, const TString &identifier,
+       const TSourceLoc &initLocation, TIntermTyped *initializer)
+{
+       // If the declaration starting this declarator list was empty (example: int,), some checks were not performed.
+       if(mDeferredSingleDeclarationErrorCheck)
+       {
+               if(singleDeclarationErrorCheck(publicType, identifierLocation))
+                       recover();
+               mDeferredSingleDeclarationErrorCheck = false;
+       }
+
+       if(locationDeclaratorListCheck(identifierLocation, publicType))
+               recover();
+
+       TIntermNode *intermNode = nullptr;
+       if(!executeInitializer(identifierLocation, identifier, publicType, initializer, intermNode))
+       {
+               //
+               // build the intermediate representation
+               //
+               if(intermNode)
+               {
+                       return intermediate.growAggregate(aggregateDeclaration, intermNode, initLocation);
+               }
+               else
+               {
+                       return aggregateDeclaration;
+               }
+       }
+       else
+       {
+               recover();
+               return nullptr;
+       }
+}
+
+TIntermAggregate *TParseContext::parseArrayInitDeclarator(const TPublicType &publicType,
+       TIntermAggregate *aggregateDeclaration,
+       const TSourceLoc &identifierLocation,
+       const TString &identifier,
+       const TSourceLoc &indexLocation,
+       TIntermTyped *indexExpression,
+       const TSourceLoc &initLocation, TIntermTyped *initializer)
+{
+       // If the declaration starting this declarator list was empty (example: int,), some checks were not performed.
+       if(mDeferredSingleDeclarationErrorCheck)
+       {
+               if(singleDeclarationErrorCheck(publicType, identifierLocation))
+                       recover();
+               mDeferredSingleDeclarationErrorCheck = false;
+       }
+
+       if(locationDeclaratorListCheck(identifierLocation, publicType))
+               recover();
+
+       if(arrayTypeErrorCheck(indexLocation, publicType) || arrayQualifierErrorCheck(indexLocation, publicType))
+       {
+               recover();
+       }
+
+       TPublicType arrayType(publicType);
+
+       int size = 0;
+       // If indexExpression is nullptr, then the array will eventually get its size implicitly from the initializer.
+       if(indexExpression != nullptr && arraySizeErrorCheck(identifierLocation, indexExpression, size))
+       {
+               recover();
+       }
+       // Make the type an array even if size check failed.
+       // This ensures useless error messages regarding the variable's non-arrayness won't follow.
+       arrayType.setArray(true, size);
+
+       // initNode will correspond to the whole of "b[n] = initializer".
+       TIntermNode *initNode = nullptr;
+       if(!executeInitializer(identifierLocation, identifier, arrayType, initializer, initNode))
+       {
+               if(initNode)
+               {
+                       return intermediate.growAggregate(aggregateDeclaration, initNode, initLocation);
+               }
+               else
+               {
+                       return aggregateDeclaration;
+               }
+       }
+       else
+       {
+               recover();
+               return nullptr;
+       }
+}
+
 // This function is used to test for the correctness of the parameters passed to various constructor functions
 // and also convert them to the right datatype if it is allowed and required.
 //
@@ -1952,7 +2479,7 @@ TPublicType TParseContext::joinInterpolationQualifiers(const TSourceLoc &interpo
 
 TFieldList *TParseContext::addStructDeclaratorList(const TPublicType &typeSpecifier, TFieldList *fieldList)
 {
-       if(voidErrorCheck(typeSpecifier.line, (*fieldList)[0]->name(), typeSpecifier))
+       if(voidErrorCheck(typeSpecifier.line, (*fieldList)[0]->name(), typeSpecifier.type))
        {
                recover();
        }
index 72f5a48..cac1647 100644 (file)
@@ -45,7 +45,10 @@ struct TParseContext {
             shaderVersion(100),
             directiveHandler(ext, diagnostics, shaderVersion),
             preprocessor(&diagnostics, &directiveHandler),
-            scanner(NULL) {  }
+            scanner(NULL),
+            mDeferredSingleDeclarationErrorCheck(false),
+            mUsesFragData(false),
+            mUsesFragColor(false) {  }
     TIntermediate& intermediate; // to hold and build a parse tree
     TSymbolTable& symbolTable;   // symbol table that goes with the language currently being parsed
     GLenum shaderType;              // vertex or fragment language (future: pack or unpack)
@@ -79,6 +82,9 @@ struct TParseContext {
     void trace(const char* str);
     void recover();
 
+       // This method is guaranteed to succeed, even if no variable with 'name' exists.
+       const TVariable *getNamedVariable(const TSourceLoc &location, const TString *name, const TSymbol *symbol);
+
     bool parseVectorFields(const TString&, int vecSize, TVectorFields&, int line);
     bool parseMatrixFields(const TString&, int matCols, int matRows, TMatrixFields&, int line);
 
@@ -96,16 +102,18 @@ struct TParseContext {
     bool arrayQualifierErrorCheck(int line, TPublicType type);
     bool arrayTypeErrorCheck(int line, TPublicType type);
     bool arrayErrorCheck(int line, TString& identifier, TPublicType type, TVariable*& variable);
-    bool voidErrorCheck(int, const TString&, const TPublicType&);
+    bool voidErrorCheck(int, const TString&, const TBasicType&);
     bool boolErrorCheck(int, const TIntermTyped*);
     bool boolErrorCheck(int, const TPublicType&);
     bool samplerErrorCheck(int line, const TPublicType& pType, const char* reason);
+       bool locationDeclaratorListCheck(const TSourceLoc &line, const TPublicType &pType);
     bool structQualifierErrorCheck(int line, const TPublicType& pType);
     bool parameterSamplerErrorCheck(int line, TQualifier qualifier, const TType& type);
     bool nonInitConstErrorCheck(int line, TString& identifier, TPublicType& type, bool array);
-    bool nonInitErrorCheck(int line, TString& identifier, TPublicType& type, TVariable*& variable);
+    bool nonInitErrorCheck(int line, const TString& identifier, TPublicType& type);
     bool paramErrorCheck(int line, TQualifier qualifier, TQualifier paramQualifier, TType* type);
     bool extensionErrorCheck(int line, const TString&);
+       bool singleDeclarationErrorCheck(const TPublicType &publicType, const TSourceLoc &identifierLocation);
     bool layoutLocationErrorCheck(const TSourceLoc& location, const TLayoutQualifier &layoutQualifier);
     bool functionCallLValueErrorCheck(const TFunction *fnCandidate, TIntermAggregate *);
 
@@ -119,12 +127,39 @@ struct TParseContext {
     bool containsSampler(TType& type);
     bool areAllChildConst(TIntermAggregate* aggrNode);
     const TFunction* findFunction(int line, TFunction* pfnCall, bool *builtIn = 0);
-    bool executeInitializer(TSourceLoc line, TString& identifier, TPublicType& pType,
+    bool executeInitializer(TSourceLoc line, const TString& identifier, const TPublicType& pType,
                             TIntermTyped* initializer, TIntermNode*& intermNode, TVariable* variable = 0);
 
     TPublicType addFullySpecifiedType(TQualifier qualifier, bool invariant, TLayoutQualifier layoutQualifier, const TPublicType &typeSpecifier);
     bool arraySetMaxSize(TIntermSymbol*, TType*, int, bool, TSourceLoc);
 
+       TIntermAggregate *parseSingleDeclaration(TPublicType &publicType, const TSourceLoc &identifierOrTypeLocation, const TString &identifier);
+       TIntermAggregate *parseSingleArrayDeclaration(TPublicType &publicType, const TSourceLoc &identifierLocation, const TString &identifier,
+                                                     const TSourceLoc &indexLocation, TIntermTyped *indexExpression);
+       TIntermAggregate *parseSingleInitDeclaration(const TPublicType &publicType, const TSourceLoc &identifierLocation, const TString &identifier,
+                                                    const TSourceLoc &initLocation, TIntermTyped *initializer);
+
+       // Parse a declaration like "type a[n] = initializer"
+       // Note that this does not apply to declarations like "type[n] a = initializer"
+       TIntermAggregate *parseSingleArrayInitDeclaration(TPublicType &publicType, const TSourceLoc &identifierLocation, const TString &identifier,
+                                                         const TSourceLoc &indexLocation, TIntermTyped *indexExpression,
+                                                         const TSourceLoc &initLocation, TIntermTyped *initializer);
+
+       TIntermAggregate *parseInvariantDeclaration(const TSourceLoc &invariantLoc, const TSourceLoc &identifierLoc, const TString *identifier,
+                                                   const TSymbol *symbol);
+
+       TIntermAggregate *parseDeclarator(TPublicType &publicType, TIntermAggregate *aggregateDeclaration, const TSourceLoc &identifierLocation,
+                                         const TString &identifier);
+       TIntermAggregate *parseArrayDeclarator(TPublicType &publicType, TIntermAggregate *aggregateDeclaration, const TSourceLoc &identifierLocation,
+                                              const TString &identifier, const TSourceLoc &arrayLocation, TIntermTyped *indexExpression);
+       TIntermAggregate *parseInitDeclarator(const TPublicType &publicType, TIntermAggregate *aggregateDeclaration, const TSourceLoc &identifierLocation,
+                                             const TString &identifier, const TSourceLoc &initLocation, TIntermTyped *initializer);
+
+       // Parse a declarator like "a[n] = initializer"
+       TIntermAggregate *parseArrayInitDeclarator(const TPublicType &publicType, TIntermAggregate *aggregateDeclaration, const TSourceLoc &identifierLocation,
+                                                  const TString &identifier, const TSourceLoc &indexLocation, TIntermTyped *indexExpression,
+                                               const TSourceLoc &initLocation, TIntermTyped *initializer);
+
     TIntermTyped* addConstructor(TIntermNode*, const TType*, TOperator, TFunction*, TSourceLoc);
     TIntermTyped* foldConstConstructor(TIntermAggregate* aggrNode, const TType& type);
     TIntermTyped* addConstVectorNode(TVectorFields&, TIntermTyped*, TSourceLoc);
@@ -154,12 +189,18 @@ struct TParseContext {
        TIntermTyped *addUnaryMathLValue(TOperator op, TIntermTyped *child, const TSourceLoc &loc);
 
 private:
+       bool declareVariable(const TSourceLoc &line, const TString &identifier, const TType &type, TVariable **variable);
+
        // The funcReturnType parameter is expected to be non-null when the operation is a built-in function.
        // It is expected to be null for other unary operators.
        TIntermTyped *createUnaryMath(TOperator op, TIntermTyped *child, const TSourceLoc &loc, const TType *funcReturnType);
 
        // Return true if the checks pass
        bool binaryOpCommonCheck(TOperator op, TIntermTyped *left, TIntermTyped *right, const TSourceLoc &loc);
+
+       bool mDeferredSingleDeclarationErrorCheck;
+       bool mUsesFragData; // track if we are using both gl_FragData and gl_FragColor
+       bool mUsesFragColor;
 };
 
 int PaParseStrings(int count, const char* const string[], const int length[],
index 398597c..cf6f150 100644 (file)
@@ -38,6 +38,7 @@
 
 #include "InfoSink.h"
 #include "intermediate.h"
+#include <set>
 
 //
 // Symbol base class.  (Can build functions or variables out of these...)
@@ -300,6 +301,7 @@ class TSymbolTable
 {
 public:
     TSymbolTable()
+        : mGlobalInvariant(false)
     {
         //
         // The symbol table cannot be used until push() is called, but
@@ -483,12 +485,34 @@ public:
         return prec;
     }
 
+       // This records invariant varyings declared through
+       // "invariant varying_name;".
+       void addInvariantVarying(const std::string &originalName)
+       {
+               mInvariantVaryings.insert(originalName);
+       }
+       // If this returns false, the varying could still be invariant
+       // if it is set as invariant during the varying variable
+       // declaration - this piece of information is stored in the
+       // variable's type, not here.
+       bool isVaryingInvariant(const std::string &originalName) const
+       {
+               return (mGlobalInvariant ||
+                       mInvariantVaryings.count(originalName) > 0);
+       }
+
+       void setGlobalInvariant() { mGlobalInvariant = true; }
+       bool getGlobalInvariant() const { return mGlobalInvariant; }
+
 protected:
     ESymbolLevel currentLevel() const { return static_cast<ESymbolLevel>(table.size() - 1); }
 
     std::vector<TSymbolTableLevel*> table;
     typedef std::map< TBasicType, TPrecision > PrecisionStackLevel;
     std::vector< PrecisionStackLevel > precisionStack;
+
+       std::set<std::string> mInvariantVaryings;
+       bool mGlobalInvariant;
 };
 
 #endif // _SYMBOL_TABLE_INCLUDED_
index 3b9124d..3cb9fa8 100644 (file)
@@ -917,9 +917,10 @@ declaration
         context->symbolTable.pop();
     }
     | init_declarator_list SEMICOLON {
-        if ($1.intermAggregate)
-            $1.intermAggregate->setOp(EOpDeclaration);
-        $$ = $1.intermAggregate;
+        TIntermAggregate *aggNode = $1.intermAggregate;
+        if (aggNode && aggNode->getOp() == EOpNull)
+            aggNode->setOp(EOpDeclaration);
+        $$ = aggNode;
     }
     | PRECISION precision_qualifier type_specifier_no_prec SEMICOLON {
         if (!context->symbolTable.setDefaultPrecision( $3, $2 )) {
@@ -1125,191 +1126,61 @@ init_declarator_list
         $$ = $1;
     }
     | init_declarator_list COMMA IDENTIFIER {
-        if ($1.type.type == EbtInvariant && !$3.symbol)
-        {
-            context->error($3.line, "undeclared identifier declared as invariant", $3.string->c_str());
-            context->recover();
-        }
-
-        TIntermSymbol* symbol = context->intermediate.addSymbol(0, *$3.string, TType($1.type), $3.line);
-        $$.intermAggregate = context->intermediate.growAggregate($1.intermNode, symbol, $3.line);
-        
-        if (context->structQualifierErrorCheck($3.line, $$.type))
-            context->recover();
-
-        if (context->nonInitConstErrorCheck($3.line, *$3.string, $$.type, false))
-            context->recover();
-
-        TVariable* variable = 0;
-        if (context->nonInitErrorCheck($3.line, *$3.string, $$.type, variable))
-            context->recover();
-        if (symbol && variable)
-            symbol->setId(variable->getUniqueId());
-    }
-    | init_declarator_list COMMA IDENTIFIER LEFT_BRACKET RIGHT_BRACKET {
-        if (context->structQualifierErrorCheck($3.line, $1.type))
-            context->recover();
-
-        if (context->nonInitConstErrorCheck($3.line, *$3.string, $1.type, true))
-            context->recover();
-
         $$ = $1;
-
-        if (context->arrayTypeErrorCheck($4.line, $1.type) || context->arrayQualifierErrorCheck($4.line, $1.type))
-            context->recover();
-        else {
-            $1.type.setArray(true);
-            TVariable* variable;
-            if (context->arrayErrorCheck($4.line, *$3.string, $1.type, variable))
-                context->recover();
-        }
+        $$.intermAggregate = context->parseDeclarator($$.type, $1.intermAggregate, $3.line, *$3.string);
     }
     | init_declarator_list COMMA IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET {
-        if (context->structQualifierErrorCheck($3.line, $1.type))
-            context->recover();
-
-        if (context->nonInitConstErrorCheck($3.line, *$3.string, $1.type, true))
-            context->recover();
-
         $$ = $1;
-
-        if (context->arrayTypeErrorCheck($4.line, $1.type) || context->arrayQualifierErrorCheck($4.line, $1.type))
-            context->recover();
-        else {
-            int size;
-            if (context->arraySizeErrorCheck($4.line, $5, size))
-                context->recover();
-            $1.type.setArray(true, size);
-            TVariable* variable = 0;
-            if (context->arrayErrorCheck($4.line, *$3.string, $1.type, variable))
-                context->recover();
-            TType type = TType($1.type);
-            type.setArraySize(size);
-            $$.intermAggregate = context->intermediate.growAggregate($1.intermNode, context->intermediate.addSymbol(variable ? variable->getUniqueId() : 0, *$3.string, type, $3.line), $3.line);
-        }
+        $$.intermAggregate = context->parseArrayDeclarator($$.type, $1.intermAggregate, $3.line, *$3.string, $4.line, $5);
+    }
+    | init_declarator_list COMMA IDENTIFIER LEFT_BRACKET RIGHT_BRACKET EQUAL initializer {
+        ES3_ONLY("[]", $3.line);
+        $$ = $1;
+        $$.intermAggregate = context->parseArrayInitDeclarator($$.type, $1.intermAggregate, $3.line, *$3.string, $4.line, nullptr, $6.line, $7);
+    }
+    | init_declarator_list COMMA IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET EQUAL initializer {
+        ES3_ONLY("=", $7.line);
+        $$ = $1;
+        $$.intermAggregate = context->parseArrayInitDeclarator($$.type, $1.intermAggregate, $3.line, *$3.string, $4.line, $5, $7.line, $8);
     }
     | init_declarator_list COMMA IDENTIFIER EQUAL initializer {
-        if (context->structQualifierErrorCheck($3.line, $1.type))
-            context->recover();
-
         $$ = $1;
-
-        TIntermNode* intermNode;
-        if (!context->executeInitializer($3.line, *$3.string, $1.type, $5, intermNode)) {
-            //
-            // build the intermediate representation
-            //
-            if (intermNode)
-        $$.intermAggregate = context->intermediate.growAggregate($1.intermNode, intermNode, $4.line);
-            else
-                $$.intermAggregate = $1.intermAggregate;
-        } else {
-            context->recover();
-            $$.intermAggregate = 0;
-        }
+        $$.intermAggregate = context->parseInitDeclarator($$.type, $1.intermAggregate, $3.line, *$3.string, $4.line, $5);
     }
     ;
 
 single_declaration
     : fully_specified_type {
         $$.type = $1;
-        $$.intermAggregate = context->intermediate.makeAggregate(context->intermediate.addSymbol(0, "", TType($1), $1.line), $1.line);
+        $$.intermAggregate = context->parseSingleDeclaration($$.type, $1.line, "");
     }
     | fully_specified_type IDENTIFIER {
-        TIntermSymbol* symbol = context->intermediate.addSymbol(0, *$2.string, TType($1), $2.line);
-        $$.intermAggregate = context->intermediate.makeAggregate(symbol, $2.line);
-        
-        if (context->structQualifierErrorCheck($2.line, $$.type))
-            context->recover();
-
-        if (context->nonInitConstErrorCheck($2.line, *$2.string, $$.type, false))
-            context->recover();
-            
-            $$.type = $1;
-
-        TVariable* variable = 0;
-        if (context->nonInitErrorCheck($2.line, *$2.string, $$.type, variable))
-            context->recover();
-        if (variable && symbol)
-            symbol->setId(variable->getUniqueId());
-    }
-    | fully_specified_type IDENTIFIER LEFT_BRACKET RIGHT_BRACKET {
-        context->error($2.line, "unsized array declarations not supported", $2.string->c_str());
-        context->recover();
-
-        TIntermSymbol* symbol = context->intermediate.addSymbol(0, *$2.string, TType($1), $2.line);
-        $$.intermAggregate = context->intermediate.makeAggregate(symbol, $2.line);
         $$.type = $1;
+        $$.intermAggregate = context->parseSingleDeclaration($$.type, $2.line, *$2.string);
     }
     | fully_specified_type IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET {
-        TType type = TType($1);
-        int size;
-        if (context->arraySizeErrorCheck($2.line, $4, size))
-            context->recover();
-        type.setArraySize(size);
-        TIntermSymbol* symbol = context->intermediate.addSymbol(0, *$2.string, type, $2.line);
-        $$.intermAggregate = context->intermediate.makeAggregate(symbol, $2.line);
-        
-        if (context->structQualifierErrorCheck($2.line, $1))
-            context->recover();
-
-        if (context->nonInitConstErrorCheck($2.line, *$2.string, $1, true))
-            context->recover();
-
         $$.type = $1;
-
-        if (context->arrayTypeErrorCheck($3.line, $1) || context->arrayQualifierErrorCheck($3.line, $1))
-            context->recover();
-        else {
-            int size;
-            if (context->arraySizeErrorCheck($3.line, $4, size))
-                context->recover();
-
-            $1.setArray(true, size);
-            TVariable* variable = 0;
-            if (context->arrayErrorCheck($3.line, *$2.string, $1, variable))
-                context->recover();
-            if (variable && symbol)
-                symbol->setId(variable->getUniqueId());
-        }
+        $$.intermAggregate = context->parseSingleArrayDeclaration($$.type, $2.line, *$2.string, $3.line, $4);
+    }
+    | fully_specified_type IDENTIFIER LEFT_BRACKET RIGHT_BRACKET EQUAL initializer {
+        ES3_ONLY("[]", $3.line);
+        $$.type = $1;
+        $$.intermAggregate = context->parseSingleArrayInitDeclaration($$.type, $2.line, *$2.string, $3.line, nullptr, $5.line, $6);
+    }
+    | fully_specified_type IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET EQUAL initializer {
+        ES3_ONLY("=", $6.line);
+        $$.type = $1;
+        $$.intermAggregate = context->parseSingleArrayInitDeclaration($$.type, $2.line, *$2.string, $3.line, $4, $6.line, $7);
     }
     | fully_specified_type IDENTIFIER EQUAL initializer {
-        if (context->structQualifierErrorCheck($2.line, $1))
-            context->recover();
-
         $$.type = $1;
-
-        TIntermNode* intermNode;
-        if (!context->executeInitializer($2.line, *$2.string, $1, $4, intermNode)) {
-        //
-        // Build intermediate representation
-        //
-            if(intermNode)
-                $$.intermAggregate = context->intermediate.makeAggregate(intermNode, $3.line);
-            else
-                $$.intermAggregate = 0;
-        } else {
-            context->recover();
-            $$.intermAggregate = 0;
-        }
+        $$.intermAggregate = context->parseSingleInitDeclaration($$.type, $2.line, *$2.string, $3.line, $4);
     }
     | INVARIANT IDENTIFIER {
-        if (context->globalErrorCheck($1.line, context->symbolTable.atGlobalLevel(), "invariant varying"))
-            context->recover();
-        $$.type.setBasic(EbtInvariant, EvqInvariantVaryingOut, $2.line);
-        if (!$2.symbol)
-        {
-            context->error($2.line, "undeclared identifier declared as invariant", $2.string->c_str());
-            context->recover();
-            
-            $$.intermAggregate = 0;
-        }
-        else
-        {
-            TIntermSymbol *symbol = context->intermediate.addSymbol(0, *$2.string, TType($$.type), $2.line);
-            $$.intermAggregate = context->intermediate.makeAggregate(symbol, $2.line);
-        }
+        // $$.type is not used in invariant declarations.
+        $$.intermAggregate = context->parseInvariantDeclaration($1.line, $2.line, $2.string, $2.symbol);
     }
+    ;
 
 //
 // Place holder for the pack/unpack languages.
index 7f601e7..9e919de 100644 (file)
@@ -556,16 +556,16 @@ union yyalloc
 /* YYFINAL -- State number of the termination state.  */
 #define YYFINAL  107
 /* YYLAST -- Last index in YYTABLE.  */
-#define YYLAST   2137
+#define YYLAST   2112
 
 /* YYNTOKENS -- Number of terminals.  */
 #define YYNTOKENS  128
 /* YYNNTS -- Number of nonterminals.  */
 #define YYNNTS  89
 /* YYNRULES -- Number of rules.  */
-#define YYNRULES  256
+#define YYNRULES  258
 /* YYNRULES -- Number of states.  */
-#define YYNSTATES  374
+#define YYNSTATES  382
 
 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
 #define YYUNDEFTOK  2
@@ -633,22 +633,22 @@ static const yytype_uint16 yyprhs[] =
      202,   206,   208,   210,   212,   214,   216,   218,   220,   222,
      224,   226,   228,   230,   234,   236,   239,   242,   247,   250,
      252,   254,   257,   261,   265,   268,   274,   278,   281,   285,
-     288,   289,   291,   293,   295,   297,   299,   303,   309,   316,
-     322,   324,   327,   332,   338,   343,   346,   348,   351,   353,
-     355,   357,   359,   361,   364,   366,   369,   371,   373,   376,
-     378,   380,   382,   385,   388,   390,   392,   395,   397,   399,
-     401,   406,   408,   412,   414,   418,   422,   424,   429,   431,
-     433,   435,   437,   439,   441,   443,   445,   447,   449,   451,
-     453,   455,   457,   459,   461,   463,   465,   467,   469,   471,
-     473,   475,   477,   479,   481,   483,   485,   487,   489,   491,
-     493,   495,   497,   499,   501,   503,   505,   507,   509,   511,
-     513,   515,   517,   518,   525,   526,   532,   534,   537,   541,
-     546,   548,   552,   554,   559,   561,   563,   565,   567,   569,
-     571,   573,   575,   577,   580,   581,   582,   588,   590,   592,
-     593,   596,   597,   600,   603,   607,   609,   612,   614,   617,
-     623,   627,   629,   631,   636,   637,   644,   645,   654,   655,
-     663,   665,   667,   669,   670,   673,   677,   680,   683,   686,
-     690,   693,   695,   698,   700,   702,   703
+     288,   289,   291,   293,   295,   297,   299,   303,   310,   318,
+     327,   333,   335,   338,   344,   351,   359,   364,   367,   369,
+     372,   374,   376,   378,   380,   382,   385,   387,   390,   392,
+     394,   397,   399,   401,   403,   406,   409,   411,   413,   416,
+     418,   420,   422,   427,   429,   433,   435,   439,   443,   445,
+     450,   452,   454,   456,   458,   460,   462,   464,   466,   468,
+     470,   472,   474,   476,   478,   480,   482,   484,   486,   488,
+     490,   492,   494,   496,   498,   500,   502,   504,   506,   508,
+     510,   512,   514,   516,   518,   520,   522,   524,   526,   528,
+     530,   532,   534,   536,   538,   539,   546,   547,   553,   555,
+     558,   562,   567,   569,   573,   575,   580,   582,   584,   586,
+     588,   590,   592,   594,   596,   598,   601,   602,   603,   609,
+     611,   613,   614,   617,   618,   621,   624,   628,   630,   633,
+     635,   638,   644,   648,   650,   652,   657,   658,   665,   666,
+     675,   676,   684,   686,   688,   690,   691,   694,   698,   701,
+     704,   707,   711,   714,   716,   719,   721,   723,   724
 };
 
 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
@@ -684,47 +684,49 @@ static const yytype_int16 yyrhs[] =
      106,   157,   107,    -1,   171,   165,   163,    -1,   165,   163,
       -1,   171,   165,   166,    -1,   165,   166,    -1,    -1,    40,
       -1,    41,    -1,    42,    -1,   174,    -1,   168,    -1,   167,
-     111,    76,    -1,   167,   111,    76,   106,   107,    -1,   167,
-     111,    76,   106,   157,   107,    -1,   167,   111,    76,   113,
-     188,    -1,   169,    -1,   169,    76,    -1,   169,    76,   106,
-     107,    -1,   169,    76,   106,   157,   107,    -1,   169,    76,
-     113,   188,    -1,     3,    76,    -1,   174,    -1,   172,   174,
-      -1,    53,    -1,    52,    -1,     9,    -1,     8,    -1,    44,
-      -1,     3,    44,    -1,   173,    -1,   170,   173,    -1,   170,
-      -1,   176,    -1,   176,   173,    -1,     9,    -1,    40,    -1,
-      41,    -1,    51,    40,    -1,    51,    41,    -1,    43,    -1,
-     179,    -1,   175,   179,    -1,     4,    -1,     5,    -1,     6,
-      -1,    75,   104,   177,   105,    -1,   178,    -1,   177,   111,
-     178,    -1,    76,    -1,    76,   113,    79,    -1,    76,   113,
-      80,    -1,   180,    -1,   180,   106,   157,   107,    -1,    55,
-      -1,    11,    -1,    12,    -1,    13,    -1,    10,    -1,    31,
-      -1,    32,    -1,    33,    -1,    25,    -1,    26,    -1,    27,
-      -1,    28,    -1,    29,    -1,    30,    -1,    34,    -1,    35,
-      -1,    36,    -1,    37,    -1,    38,    -1,    39,    -1,    45,
-      -1,    46,    -1,    47,    -1,    48,    -1,    49,    -1,    50,
-      -1,    57,    -1,    58,    -1,    59,    -1,    70,    -1,    61,
-      -1,    62,    -1,    63,    -1,    64,    -1,    65,    -1,    66,
-      -1,    67,    -1,    68,    -1,    69,    -1,    72,    -1,    73,
-      -1,    74,    -1,   181,    -1,    77,    -1,    -1,    54,    76,
-     108,   182,   184,   109,    -1,    -1,    54,   108,   183,   184,
-     109,    -1,   185,    -1,   184,   185,    -1,   174,   186,   114,
-      -1,   172,   174,   186,   114,    -1,   187,    -1,   186,   111,
-     187,    -1,    76,    -1,    76,   106,   157,   107,    -1,   154,
-      -1,   158,    -1,   192,    -1,   191,    -1,   189,    -1,   201,
-      -1,   202,    -1,   205,    -1,   212,    -1,   108,   109,    -1,
-      -1,    -1,   108,   193,   200,   194,   109,    -1,   199,    -1,
-     191,    -1,    -1,   197,   199,    -1,    -1,   198,   191,    -1,
-     108,   109,    -1,   108,   200,   109,    -1,   190,    -1,   200,
-     190,    -1,   114,    -1,   156,   114,    -1,    19,   104,   156,
-     105,   203,    -1,   196,    17,   196,    -1,   196,    -1,   156,
-      -1,   169,    76,   113,   188,    -1,    -1,    56,   104,   206,
-     204,   105,   195,    -1,    -1,    16,   207,   196,    56,   104,
-     156,   105,   114,    -1,    -1,    18,   104,   208,   209,   211,
-     105,   195,    -1,   201,    -1,   189,    -1,   204,    -1,    -1,
-     210,   114,    -1,   210,   114,   156,    -1,    15,   114,    -1,
-      14,   114,    -1,    21,   114,    -1,    21,   156,   114,    -1,
-      20,   114,    -1,   214,    -1,   213,   214,    -1,   215,    -1,
-     158,    -1,    -1,   159,   216,   199,    -1
+     111,    76,    -1,   167,   111,    76,   106,   157,   107,    -1,
+     167,   111,    76,   106,   107,   113,   188,    -1,   167,   111,
+      76,   106,   157,   107,   113,   188,    -1,   167,   111,    76,
+     113,   188,    -1,   169,    -1,   169,    76,    -1,   169,    76,
+     106,   157,   107,    -1,   169,    76,   106,   107,   113,   188,
+      -1,   169,    76,   106,   157,   107,   113,   188,    -1,   169,
+      76,   113,   188,    -1,     3,    76,    -1,   174,    -1,   172,
+     174,    -1,    53,    -1,    52,    -1,     9,    -1,     8,    -1,
+      44,    -1,     3,    44,    -1,   173,    -1,   170,   173,    -1,
+     170,    -1,   176,    -1,   176,   173,    -1,     9,    -1,    40,
+      -1,    41,    -1,    51,    40,    -1,    51,    41,    -1,    43,
+      -1,   179,    -1,   175,   179,    -1,     4,    -1,     5,    -1,
+       6,    -1,    75,   104,   177,   105,    -1,   178,    -1,   177,
+     111,   178,    -1,    76,    -1,    76,   113,    79,    -1,    76,
+     113,    80,    -1,   180,    -1,   180,   106,   157,   107,    -1,
+      55,    -1,    11,    -1,    12,    -1,    13,    -1,    10,    -1,
+      31,    -1,    32,    -1,    33,    -1,    25,    -1,    26,    -1,
+      27,    -1,    28,    -1,    29,    -1,    30,    -1,    34,    -1,
+      35,    -1,    36,    -1,    37,    -1,    38,    -1,    39,    -1,
+      45,    -1,    46,    -1,    47,    -1,    48,    -1,    49,    -1,
+      50,    -1,    57,    -1,    58,    -1,    59,    -1,    70,    -1,
+      61,    -1,    62,    -1,    63,    -1,    64,    -1,    65,    -1,
+      66,    -1,    67,    -1,    68,    -1,    69,    -1,    72,    -1,
+      73,    -1,    74,    -1,   181,    -1,    77,    -1,    -1,    54,
+      76,   108,   182,   184,   109,    -1,    -1,    54,   108,   183,
+     184,   109,    -1,   185,    -1,   184,   185,    -1,   174,   186,
+     114,    -1,   172,   174,   186,   114,    -1,   187,    -1,   186,
+     111,   187,    -1,    76,    -1,    76,   106,   157,   107,    -1,
+     154,    -1,   158,    -1,   192,    -1,   191,    -1,   189,    -1,
+     201,    -1,   202,    -1,   205,    -1,   212,    -1,   108,   109,
+      -1,    -1,    -1,   108,   193,   200,   194,   109,    -1,   199,
+      -1,   191,    -1,    -1,   197,   199,    -1,    -1,   198,   191,
+      -1,   108,   109,    -1,   108,   200,   109,    -1,   190,    -1,
+     200,   190,    -1,   114,    -1,   156,   114,    -1,    19,   104,
+     156,   105,   203,    -1,   196,    17,   196,    -1,   196,    -1,
+     156,    -1,   169,    76,   113,   188,    -1,    -1,    56,   104,
+     206,   204,   105,   195,    -1,    -1,    16,   207,   196,    56,
+     104,   156,   105,   114,    -1,    -1,    18,   104,   208,   209,
+     211,   105,   195,    -1,   201,    -1,   189,    -1,   204,    -1,
+      -1,   210,   114,    -1,   210,   114,   156,    -1,    15,   114,
+      -1,    14,   114,    -1,    21,   114,    -1,    21,   156,   114,
+      -1,    20,   114,    -1,   214,    -1,   213,   214,    -1,   215,
+      -1,   158,    -1,    -1,   159,   216,   199,    -1
 };
 
 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
@@ -738,24 +740,24 @@ static const yytype_uint16 yyrline[] =
      684,   694,   707,   708,   718,   731,   732,   746,   747,   761,
      762,   776,   777,   790,   791,   804,   805,   818,   819,   836,
      837,   850,   851,   852,   853,   855,   856,   857,   859,   861,
-     863,   865,   870,   873,   884,   892,   919,   924,   934,   972,
-     975,   982,   990,  1011,  1032,  1043,  1072,  1077,  1087,  1092,
-    1102,  1105,  1108,  1111,  1117,  1124,  1127,  1149,  1167,  1191,
-    1214,  1218,  1236,  1244,  1276,  1296,  1384,  1394,  1400,  1403,
-    1409,  1415,  1422,  1431,  1440,  1443,  1446,  1453,  1457,  1464,
-    1468,  1473,  1478,  1488,  1498,  1507,  1517,  1524,  1527,  1530,
-    1536,  1543,  1546,  1552,  1555,  1558,  1564,  1567,  1582,  1586,
-    1590,  1594,  1598,  1602,  1607,  1612,  1617,  1622,  1627,  1632,
-    1637,  1642,  1647,  1652,  1657,  1662,  1668,  1674,  1680,  1686,
-    1692,  1698,  1704,  1710,  1716,  1721,  1726,  1735,  1740,  1745,
-    1750,  1755,  1760,  1765,  1770,  1775,  1780,  1785,  1790,  1795,
-    1800,  1805,  1818,  1818,  1821,  1821,  1827,  1830,  1846,  1849,
-    1858,  1862,  1868,  1875,  1890,  1894,  1898,  1899,  1905,  1906,
-    1907,  1908,  1909,  1913,  1914,  1914,  1914,  1924,  1925,  1929,
-    1929,  1930,  1930,  1935,  1938,  1948,  1951,  1957,  1958,  1962,
-    1970,  1974,  1984,  1989,  2006,  2006,  2011,  2011,  2018,  2018,
-    2026,  2029,  2035,  2038,  2044,  2048,  2055,  2062,  2069,  2076,
-    2087,  2096,  2100,  2107,  2110,  2116,  2116
+     863,   865,   870,   873,   884,   892,   919,   925,   935,   973,
+     976,   983,   991,  1012,  1033,  1044,  1073,  1078,  1088,  1093,
+    1103,  1106,  1109,  1112,  1118,  1125,  1128,  1132,  1136,  1141,
+    1146,  1153,  1157,  1161,  1165,  1170,  1175,  1179,  1255,  1265,
+    1271,  1274,  1280,  1286,  1293,  1302,  1311,  1314,  1317,  1324,
+    1328,  1335,  1339,  1344,  1349,  1359,  1369,  1378,  1388,  1395,
+    1398,  1401,  1407,  1414,  1417,  1423,  1426,  1429,  1435,  1438,
+    1453,  1457,  1461,  1465,  1469,  1473,  1478,  1483,  1488,  1493,
+    1498,  1503,  1508,  1513,  1518,  1523,  1528,  1533,  1539,  1545,
+    1551,  1557,  1563,  1569,  1575,  1581,  1587,  1592,  1597,  1606,
+    1611,  1616,  1621,  1626,  1631,  1636,  1641,  1646,  1651,  1656,
+    1661,  1666,  1671,  1676,  1689,  1689,  1692,  1692,  1698,  1701,
+    1717,  1720,  1729,  1733,  1739,  1746,  1761,  1765,  1769,  1770,
+    1776,  1777,  1778,  1779,  1780,  1784,  1785,  1785,  1785,  1795,
+    1796,  1800,  1800,  1801,  1801,  1806,  1809,  1819,  1822,  1828,
+    1829,  1833,  1841,  1845,  1855,  1860,  1877,  1877,  1882,  1882,
+    1889,  1889,  1897,  1900,  1906,  1909,  1915,  1919,  1926,  1933,
+    1940,  1947,  1958,  1967,  1971,  1978,  1981,  1987,  1987
 };
 #endif
 
@@ -856,21 +858,21 @@ static const yytype_uint8 yyr1[] =
      155,   155,   156,   156,   157,   158,   158,   158,   159,   160,
      160,   161,   161,   162,   163,   163,   164,   164,   164,   164,
      165,   165,   165,   165,   166,   167,   167,   167,   167,   167,
-     168,   168,   168,   168,   168,   168,   169,   169,   170,   170,
-     171,   172,   172,   172,   172,   172,   172,   172,   172,   173,
-     173,   173,   173,   173,   173,   174,   174,   175,   175,   175,
-     176,   177,   177,   178,   178,   178,   179,   179,   180,   180,
+     167,   168,   168,   168,   168,   168,   168,   168,   169,   169,
+     170,   170,   171,   172,   172,   172,   172,   172,   172,   172,
+     172,   173,   173,   173,   173,   173,   173,   174,   174,   175,
+     175,   175,   176,   177,   177,   178,   178,   178,   179,   179,
      180,   180,   180,   180,   180,   180,   180,   180,   180,   180,
      180,   180,   180,   180,   180,   180,   180,   180,   180,   180,
      180,   180,   180,   180,   180,   180,   180,   180,   180,   180,
      180,   180,   180,   180,   180,   180,   180,   180,   180,   180,
-     180,   180,   182,   181,   183,   181,   184,   184,   185,   185,
-     186,   186,   187,   187,   188,   189,   190,   190,   191,   191,
-     191,   191,   191,   192,   193,   194,   192,   195,   195,   197,
-     196,   198,   196,   199,   199,   200,   200,   201,   201,   202,
-     203,   203,   204,   204,   206,   205,   207,   205,   208,   205,
-     209,   209,   210,   210,   211,   211,   212,   212,   212,   212,
-     212,   213,   213,   214,   214,   216,   215
+     180,   180,   180,   180,   182,   181,   183,   181,   184,   184,
+     185,   185,   186,   186,   187,   187,   188,   189,   190,   190,
+     191,   191,   191,   191,   191,   192,   193,   194,   192,   195,
+     195,   197,   196,   198,   196,   199,   199,   200,   200,   201,
+     201,   202,   203,   203,   204,   204,   206,   205,   207,   205,
+     208,   205,   209,   209,   210,   210,   211,   211,   212,   212,
+     212,   212,   212,   213,   213,   214,   214,   216,   215
 };
 
 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
@@ -886,22 +888,22 @@ static const yytype_uint8 yyr2[] =
        3,     1,     1,     1,     1,     1,     1,     1,     1,     1,
        1,     1,     1,     3,     1,     2,     2,     4,     2,     1,
        1,     2,     3,     3,     2,     5,     3,     2,     3,     2,
-       0,     1,     1,     1,     1,     1,     3,     5,     6,     5,
-       1,     2,     4,     5,     4,     2,     1,     2,     1,     1,
-       1,     1,     1,     2,     1,     2,     1,     1,     2,     1,
-       1,     1,     2,     2,     1,     1,     2,     1,     1,     1,
-       4,     1,     3,     1,     3,     3,     1,     4,     1,     1,
+       0,     1,     1,     1,     1,     1,     3,     6,     7,     8,
+       5,     1,     2,     5,     6,     7,     4,     2,     1,     2,
+       1,     1,     1,     1,     1,     2,     1,     2,     1,     1,
+       2,     1,     1,     1,     2,     2,     1,     1,     2,     1,
+       1,     1,     4,     1,     3,     1,     3,     3,     1,     4,
        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     0,     6,     0,     5,     1,     2,     3,     4,
-       1,     3,     1,     4,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     2,     0,     0,     5,     1,     1,     0,
-       2,     0,     2,     2,     3,     1,     2,     1,     2,     5,
-       3,     1,     1,     4,     0,     6,     0,     8,     0,     7,
-       1,     1,     1,     0,     2,     3,     2,     2,     2,     3,
-       2,     1,     2,     1,     1,     0,     3
+       1,     1,     1,     1,     0,     6,     0,     5,     1,     2,
+       3,     4,     1,     3,     1,     4,     1,     1,     1,     1,
+       1,     1,     1,     1,     1,     2,     0,     0,     5,     1,
+       1,     0,     2,     0,     2,     2,     3,     1,     2,     1,
+       2,     5,     3,     1,     1,     4,     0,     6,     0,     8,
+       0,     7,     1,     1,     1,     0,     2,     3,     2,     2,
+       2,     3,     2,     1,     2,     1,     1,     0,     3
 };
 
 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
@@ -909,163 +911,187 @@ static const yytype_uint8 yyr2[] =
    means the default is an error.  */
 static const yytype_uint16 yydefact[] =
 {
-       0,     0,   137,   138,   139,     0,   121,   129,   152,   149,
-     150,   151,   156,   157,   158,   159,   160,   161,   153,   154,
-     155,   162,   163,   164,   165,   166,   167,   130,   131,   134,
-     122,   168,   169,   170,   171,   172,   173,     0,   119,   118,
-       0,   148,   174,   175,   176,   178,   179,   180,   181,   182,
-     183,   184,   185,   186,   177,   187,   188,   189,     0,   191,
-     254,   255,     0,    90,   100,     0,   105,   110,   126,     0,
-     124,   116,     0,   127,   135,   146,   190,     0,   251,   253,
-     123,   115,     0,   132,   133,     0,   194,     0,    85,     0,
-      88,   100,   120,   101,   102,   103,    91,     0,   100,     0,
-      86,   111,   125,   117,   136,   128,     0,     1,   252,     0,
-     192,     0,   143,     0,   141,     0,   256,    92,    97,    99,
+       0,     0,   139,   140,   141,     0,   123,   131,   154,   151,
+     152,   153,   158,   159,   160,   161,   162,   163,   155,   156,
+     157,   164,   165,   166,   167,   168,   169,   132,   133,   136,
+     124,   170,   171,   172,   173,   174,   175,     0,   121,   120,
+       0,   150,   176,   177,   178,   180,   181,   182,   183,   184,
+     185,   186,   187,   188,   179,   189,   190,   191,     0,   193,
+     256,   257,     0,    90,   100,     0,   105,   111,   128,     0,
+     126,   118,     0,   129,   137,   148,   192,     0,   253,   255,
+     125,   117,     0,   134,   135,     0,   196,     0,    85,     0,
+      88,   100,   122,   101,   102,   103,    91,     0,   100,     0,
+      86,   112,   127,   119,   138,   130,     0,     1,   254,     0,
+     194,     0,   145,     0,   143,     0,   258,    92,    97,    99,
      104,     0,   106,    93,     0,     0,     2,     6,     4,     5,
        7,    28,     0,     0,     0,    35,    34,    36,    33,     3,
        9,    29,    11,    16,    17,     0,     0,    22,     0,    37,
        0,    41,    44,    47,    52,    55,    57,    59,    61,    63,
       65,    67,    84,     0,    26,    87,     0,     0,     0,     0,
-       0,   196,     0,   140,     0,     0,     0,   236,     0,     0,
-       0,     0,     0,   214,   223,   227,    37,    69,    82,     0,
-     205,     0,   146,   208,   225,   207,   206,     0,   209,   210,
-     211,   212,    94,    96,    98,     0,     0,   112,     0,   204,
-     114,    30,    31,     0,    13,    14,     0,     0,    20,    19,
+       0,   198,     0,   142,     0,     0,     0,   238,     0,     0,
+       0,     0,     0,   216,   225,   229,    37,    69,    82,     0,
+     207,     0,   148,   210,   227,   209,   208,     0,   211,   212,
+     213,   214,    94,    96,    98,     0,     0,     0,     0,   206,
+     116,    30,    31,     0,    13,    14,     0,     0,    20,    19,
        0,    21,    23,    25,    32,     0,     0,     0,     0,     0,
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,   147,     0,     0,   202,     0,
-     200,   195,   197,   144,   145,   142,   247,   246,   221,   238,
-       0,   250,   248,     0,   234,   213,     0,    72,    73,    75,
+       0,     0,     0,     0,     0,   149,     0,     0,   204,     0,
+     202,   197,   199,   146,   147,   144,   249,   248,   223,   240,
+       0,   252,   250,     0,   236,   215,     0,    72,    73,    75,
       74,    77,    78,    79,    80,    81,    76,    71,     0,     0,
-     228,   224,   226,     0,   107,     0,   109,   113,     8,     0,
-      15,    27,    12,    18,    24,    38,    39,    40,    43,    42,
-      45,    46,    50,    51,    48,    49,    53,    54,    56,    58,
-      60,    62,    64,    66,     0,   193,     0,     0,     0,   198,
-       0,     0,     0,     0,     0,   249,     0,   215,    70,    83,
-       0,   108,    10,     0,   199,     0,   201,     0,   220,   222,
-     241,   240,   243,   221,   232,     0,     0,     0,    95,    68,
-     203,     0,   242,     0,     0,   231,   229,     0,     0,   216,
-       0,   244,     0,   221,     0,   218,   235,   217,     0,   245,
-     239,   230,   233,   237
+     230,   226,   228,     0,     0,     0,   110,     0,   113,     8,
+       0,    15,    27,    12,    18,    24,    38,    39,    40,    43,
+      42,    45,    46,    50,    51,    48,    49,    53,    54,    56,
+      58,    60,    62,    64,    66,     0,   195,     0,     0,     0,
+     200,     0,     0,     0,     0,     0,   251,     0,   217,    70,
+      83,     0,     0,   107,   114,     0,    10,     0,   201,     0,
+     203,     0,   222,   224,   243,   242,   245,   223,   234,     0,
+       0,     0,    95,   108,     0,   115,    68,   205,     0,   244,
+       0,     0,   233,   231,     0,     0,   218,   109,     0,   246,
+       0,   223,     0,   220,   237,   219,     0,   247,   241,   232,
+     235,   239
 };
 
 /* YYDEFGOTO[NTERM-NUM].  */
 static const yytype_int16 yydefgoto[] =
 {
-      -1,   139,   140,   141,   289,   142,   143,   144,   145,   146,
+      -1,   139,   140,   141,   290,   142,   143,   144,   145,   146,
      147,   148,   186,   150,   151,   152,   153,   154,   155,   156,
      157,   158,   159,   160,   161,   187,   188,   278,   189,   163,
      190,   191,    62,    63,    64,   118,    96,    97,   119,    65,
       66,    67,    68,    98,    69,    70,    71,    72,    73,   113,
      114,    74,   164,    76,   166,   111,   170,   171,   249,   250,
-     210,   193,   194,   195,   196,   266,   347,   366,   320,   321,
-     322,   367,   197,   198,   199,   356,   346,   200,   326,   258,
-     323,   342,   353,   354,   201,    77,    78,    79,    89
+     210,   193,   194,   195,   196,   266,   351,   374,   321,   322,
+     323,   375,   197,   198,   199,   363,   350,   200,   327,   258,
+     324,   346,   360,   361,   201,    77,    78,    79,    89
 };
 
 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
    STATE-NUM.  */
-#define YYPACT_NINF -316
+#define YYPACT_NINF -320
 static const yytype_int16 yypact[] =
 {
-    1775,   -35,  -316,  -316,  -316,   149,  -316,  -316,  -316,  -316,
-    -316,  -316,  -316,  -316,  -316,  -316,  -316,  -316,  -316,  -316,
-    -316,  -316,  -316,  -316,  -316,  -316,  -316,  -316,  -316,  -316,
-    -316,  -316,  -316,  -316,  -316,  -316,  -316,    55,  -316,  -316,
-     -61,  -316,  -316,  -316,  -316,  -316,  -316,  -316,  -316,  -316,
-    -316,  -316,  -316,  -316,  -316,  -316,  -316,  -316,   -78,  -316,
-    -316,   -51,   -40,   -30,     2,    -9,  -316,    27,    15,  1924,
-    -316,  -316,  2060,    15,  -316,   -15,  -316,  1700,  -316,  -316,
-    -316,  -316,  2060,  -316,  -316,     1,  -316,    53,  -316,    23,
-    -316,    20,  -316,  -316,  -316,  -316,  -316,  1924,   118,    88,
-    -316,   -68,  -316,  -316,  -316,  -316,  1423,  -316,  -316,   -38,
-    -316,  1850,    54,   -41,  -316,   360,  -316,  -316,  -316,  -316,
-      93,  1924,   -79,  -316,  1132,  1423,    74,  -316,  -316,  -316,
-    -316,  -316,  1423,  1423,  1423,  -316,  -316,  -316,  -316,  -316,
-    -316,   -18,  -316,  -316,  -316,    82,   -32,  1518,    87,  -316,
-    1423,    52,   -86,    78,   -70,    85,    66,    68,    70,   104,
-     105,   -73,  -316,   103,  -316,  -316,  1850,   170,  1924,   139,
-     244,  -316,    97,  -316,    53,   102,   108,  -316,   113,   114,
-     109,  1230,   116,   117,  -316,  -316,   106,  -316,  -316,    -1,
-    -316,   -51,    22,  -316,  -316,  -316,  -316,   476,  -316,  -316,
-    -316,  -316,   119,  -316,  -316,  1325,  1423,  -316,   120,  -316,
-    -316,  -316,  -316,   -31,  -316,  -316,  1423,  1992,  -316,  -316,
-    1423,   124,  -316,  -316,  -316,  1423,  1423,  1423,  1423,  1423,
-    1423,  1423,  1423,  1423,  1423,  1423,  1423,  1423,  1423,  1423,
-    1423,  1423,  1423,  1423,  1423,  -316,  1615,   139,   123,     9,
-    -316,  -316,  -316,  -316,  -316,  -316,  -316,  -316,   122,  -316,
-    1423,  -316,  -316,    11,  -316,  -316,   592,  -316,  -316,  -316,
-    -316,  -316,  -316,  -316,  -316,  -316,  -316,  -316,  1423,  1423,
-    -316,  -316,  -316,  1423,  -316,   125,  -316,  -316,  -316,   127,
-     126,  -316,   131,  -316,  -316,  -316,  -316,  -316,    52,    52,
-     -86,   -86,    78,    78,    78,    78,   -70,   -70,    85,    66,
-      68,    70,   104,   105,    69,  -316,    13,  1423,   139,  -316,
-     180,    23,   824,   940,   -12,  -316,  1037,   592,  -316,  -316,
-     132,  -316,  -316,  1423,  -316,   133,  -316,   134,  -316,  -316,
-    -316,  -316,  1037,   122,   126,   165,   138,   135,  -316,  -316,
-    -316,  1423,  -316,   137,   140,   241,  -316,   146,   708,  -316,
-     -11,  1423,   708,   122,  1423,  -316,  -316,  -316,   147,   126,
-    -316,  -316,  -316,  -316
+    1750,   -21,  -320,  -320,  -320,   124,  -320,  -320,  -320,  -320,
+    -320,  -320,  -320,  -320,  -320,  -320,  -320,  -320,  -320,  -320,
+    -320,  -320,  -320,  -320,  -320,  -320,  -320,  -320,  -320,  -320,
+    -320,  -320,  -320,  -320,  -320,  -320,  -320,    -5,  -320,  -320,
+     -47,  -320,  -320,  -320,  -320,  -320,  -320,  -320,  -320,  -320,
+    -320,  -320,  -320,  -320,  -320,  -320,  -320,  -320,   -85,  -320,
+    -320,   -66,   -53,   -55,     3,   -19,  -320,    15,    19,  1899,
+    -320,  -320,  2035,    19,  -320,    -3,  -320,  1675,  -320,  -320,
+    -320,  -320,  2035,  -320,  -320,   -44,  -320,    38,  -320,    23,
+    -320,    25,  -320,  -320,  -320,  -320,  -320,  1899,   120,    78,
+    -320,   -33,  -320,  -320,  -320,  -320,  1313,  -320,  -320,    44,
+    -320,  1825,    51,   -37,  -320,   348,  -320,  -320,  -320,  -320,
+     111,  1899,   -76,  -320,   226,  1313,    86,  -320,  -320,  -320,
+    -320,  -320,  1313,  1313,  1313,  -320,  -320,  -320,  -320,  -320,
+    -320,   -68,  -320,  -320,  -320,    89,   -30,  1408,   107,  -320,
+    1313,    52,   -40,    92,   -72,    88,    67,    87,    93,   125,
+     127,   -81,  -320,   114,  -320,  -320,  1825,   178,  1899,   147,
+    1505,  -320,   101,  -320,    38,   110,   113,  -320,   121,   129,
+     115,  1120,   131,   119,  -320,  -320,   106,  -320,  -320,    -2,
+    -320,   -66,    63,  -320,  -320,  -320,  -320,   464,  -320,  -320,
+    -320,  -320,   134,  -320,  -320,  1215,  1313,   118,   135,  -320,
+    -320,  -320,  -320,   -15,  -320,  -320,  1313,  1967,  -320,  -320,
+    1313,   139,  -320,  -320,  -320,  1313,  1313,  1313,  1313,  1313,
+    1313,  1313,  1313,  1313,  1313,  1313,  1313,  1313,  1313,  1313,
+    1313,  1313,  1313,  1313,  1313,  -320,  1590,   147,   138,    11,
+    -320,  -320,  -320,  -320,  -320,  -320,  -320,  -320,   137,  -320,
+    1313,  -320,  -320,    12,  -320,  -320,   580,  -320,  -320,  -320,
+    -320,  -320,  -320,  -320,  -320,  -320,  -320,  -320,  1313,  1313,
+    -320,  -320,  -320,  1313,   136,   140,  -320,  1313,   154,  -320,
+     141,   157,  -320,   165,  -320,  -320,  -320,  -320,  -320,    52,
+      52,   -40,   -40,    92,    92,    92,    92,   -72,   -72,    88,
+      67,    87,    93,   125,   127,    72,  -320,    13,  1313,   147,
+    -320,   214,    23,   812,   928,   -12,  -320,  1025,   580,  -320,
+    -320,   170,  1313,   166,  -320,  1313,  -320,  1313,  -320,   171,
+    -320,   182,  -320,  -320,  -320,  -320,  1025,   137,   157,   206,
+     192,   200,  -320,  -320,  1313,  -320,  -320,  -320,  1313,  -320,
+     187,   205,   296,  -320,   201,   696,  -320,  -320,   -11,  1313,
+     696,   137,  1313,  -320,  -320,  -320,   202,   157,  -320,  -320,
+    -320,  -320
 };
 
 /* YYPGOTO[NTERM-NUM].  */
 static const yytype_int16 yypgoto[] =
 {
-    -316,  -316,  -316,  -316,  -316,  -316,  -316,    43,  -316,  -316,
-    -316,  -316,   -93,  -316,   -46,   -45,  -116,   -48,    24,    25,
-      28,    26,    21,    57,  -316,  -104,  -122,  -316,  -130,  -118,
-       8,    12,  -316,  -316,  -316,   144,   195,   206,   194,  -316,
-    -316,  -305,  -316,  -316,   -95,    10,   -62,   315,  -316,  -316,
-     150,   -49,     0,  -316,  -316,  -316,   159,  -156,    81,    14,
-    -201,     6,  -175,  -312,  -316,  -316,  -316,   -29,  -315,  -316,
-    -316,   -88,    64,    16,  -316,  -316,    -8,  -316,  -316,  -316,
-    -316,  -316,  -316,  -316,  -316,  -316,   254,  -316,  -316
+    -320,  -320,  -320,  -320,  -320,  -320,  -320,    98,  -320,  -320,
+    -320,  -320,   -92,  -320,   -43,   -42,  -115,   -41,    79,    80,
+      81,    77,    83,    91,  -320,  -104,  -122,  -320,  -128,  -120,
+       9,    10,  -320,  -320,  -320,   199,   231,   228,   208,  -320,
+    -320,  -319,  -320,  -320,   -87,    37,   -64,   326,  -320,  -320,
+     158,   -51,     0,  -320,  -320,  -320,   169,  -157,    90,    17,
+    -180,    14,  -175,  -316,  -320,  -320,  -320,   -31,  -308,  -320,
+    -320,   -88,    74,    21,  -320,  -320,     1,  -320,  -320,  -320,
+    -320,  -320,  -320,  -320,  -320,  -320,   271,  -320,  -320
 };
 
 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
    positive, shift that token.  If negative, reduce the rule which
    number is the opposite.  If zero, do what YYDEFACT says.
    If YYTABLE_NINF, syntax error.  */
-#define YYTABLE_NINF -220
+#define YYTABLE_NINF -222
 static const yytype_int16 yytable[] =
 {
-      75,   116,   162,   209,   213,   286,   208,   103,    60,    80,
-     339,    92,    61,   149,   252,    85,   168,   232,   233,   243,
-     162,   345,   282,   104,     7,   222,    87,   205,   355,    92,
-     228,   149,   229,   109,   206,   120,   123,   345,   124,   211,
-     212,    81,    93,    94,    95,   125,   365,    86,   371,   169,
-     365,   263,   234,   235,   244,    27,    28,   224,    29,   120,
-      93,    94,    95,    88,   173,    90,    37,   214,   215,    75,
-     174,   168,    75,   219,   288,   168,   165,    75,   102,   220,
-     279,    91,    75,   105,   209,    60,   290,   285,   216,    61,
-     252,   106,   217,   343,   368,    83,    84,    75,   294,   279,
-     279,   162,    99,   101,   169,   100,   247,   -89,   169,   110,
-     279,    75,   149,   280,   314,   192,   302,   303,   304,   305,
-     318,    75,   279,   319,   318,   325,   -26,   334,   106,   112,
-     324,   115,   295,   296,   297,   149,   149,   149,   149,   149,
+      75,   116,   162,   209,   208,   103,   213,   343,   349,    60,
+      61,   243,    92,   252,   149,   232,   233,   214,   215,    87,
+     162,   104,   282,    80,   168,   222,   286,   349,     7,    85,
+     205,   109,   149,   120,    92,    83,    84,   206,   216,   362,
+     211,   212,   217,    93,    94,    95,   244,   169,    88,   373,
+     234,   235,    90,   263,   373,    81,    91,   120,   224,    27,
+      28,    86,    29,   379,   110,    93,    94,    95,   173,    75,
+      37,   123,    75,   124,   174,   219,   228,    75,   229,   168,
+     125,   220,    75,   168,   209,   285,    60,    61,   291,   252,
+     289,   101,    99,   347,   376,   100,   279,    75,   295,   279,
+     279,   162,   169,   106,   247,   102,   169,   334,   -89,   279,
+     105,    75,   280,   149,   112,   192,   315,   303,   304,   305,
+     306,    75,   319,   279,   319,   320,   326,   338,     2,     3,
+       4,   115,   325,   296,   297,   298,   149,   149,   149,   149,
      149,   149,   149,   149,   149,   149,   149,   149,   149,   149,
-     149,   168,   282,     2,     3,     4,   328,   329,    93,    94,
-      95,   230,   231,   372,   122,   330,    75,   172,    75,   202,
-      75,   225,   226,   227,   236,   237,   253,   254,   -27,   162,
-     279,   333,   298,   299,   169,   300,   301,   218,   306,   307,
-     149,   223,   238,   239,   240,   241,   344,   192,   242,   335,
+     149,   149,   353,   282,   122,   355,   329,   330,   165,   168,
+      93,    94,    95,   331,   172,   209,    75,   -26,    75,   106,
+      75,   225,   226,   227,   367,   230,   231,   236,   237,   162,
+     253,   254,   169,   279,   337,   299,   300,   202,   301,   302,
+     -27,   149,   380,   238,   218,   307,   308,   192,   339,   348,
      267,   268,   269,   270,   271,   272,   273,   274,   275,   276,
-     245,   349,   344,   162,    80,   248,   256,   259,   260,   277,
-     264,   360,   257,   261,   149,   283,   265,   287,  -148,   317,
-    -219,   369,   331,   338,   332,   -28,   337,   279,   351,   348,
-     350,   357,   209,   358,   359,   362,    75,   167,     2,     3,
-       4,   361,     6,     7,     8,     9,    10,    11,   363,   364,
-     293,   373,   308,   312,   309,   203,   192,   311,   310,    12,
+     209,   223,   239,   209,   162,   356,   241,   240,   348,   277,
+     242,   245,    80,   248,   256,   259,   149,   257,   265,   261,
+     368,   287,   209,   260,   342,   264,     8,     9,    10,    11,
+     283,   377,   288,  -150,   318,  -221,    75,   333,   336,   332,
+     209,    12,    13,    14,    15,    16,    17,    18,    19,    20,
+      21,    22,    23,    24,    25,    26,   192,   335,   279,   -28,
+     341,    31,    32,    33,    34,    35,    36,   352,   357,   354,
+      40,    41,   364,    42,    43,    44,   358,    45,    46,    47,
+      48,    49,    50,    51,    52,    53,    54,   365,    55,    56,
+      57,   369,   126,    59,   127,   128,   129,   130,   131,   366,
+     370,   132,   133,   371,   372,   294,   381,   309,   312,   310,
+     203,   311,   117,   192,   192,   313,   121,   192,   192,   204,
+     134,    82,   255,   207,   314,   246,   340,   317,   344,   378,
+     328,   135,   136,   137,   138,   345,   192,   359,   108,     0,
+       0,     1,     2,     3,     4,     5,     6,     7,     8,     9,
+      10,    11,   175,   176,   177,   192,   178,   179,   180,   181,
+     192,     0,     0,    12,    13,    14,    15,    16,    17,    18,
+      19,    20,    21,    22,    23,    24,    25,    26,    27,    28,
+       0,    29,    30,    31,    32,    33,    34,    35,    36,    37,
+      38,    39,    40,    41,   182,    42,    43,    44,     0,    45,
+      46,    47,    48,    49,    50,    51,    52,    53,    54,     0,
+      55,    56,    57,    58,   126,    59,   127,   128,   129,   130,
+     131,     0,     0,   132,   133,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,   134,     0,     0,     0,   183,   184,     0,     0,
+       0,     0,   185,   135,   136,   137,   138,     1,     2,     3,
+       4,     5,     6,     7,     8,     9,    10,    11,   175,   176,
+     177,     0,   178,   179,   180,   181,     0,     0,     0,    12,
       13,    14,    15,    16,    17,    18,    19,    20,    21,    22,
-      23,    24,    25,    26,    27,    28,   117,    29,    30,    31,
+      23,    24,    25,    26,    27,    28,     0,    29,    30,    31,
       32,    33,    34,    35,    36,    37,    38,    39,    40,    41,
-     313,    42,    43,    44,   121,    45,    46,    47,    48,    49,
-      50,    51,    52,    53,    54,   204,    55,    56,    57,    58,
-      82,    59,   192,   192,   255,   246,   192,   192,   316,   340,
-     327,   108,   336,   370,   352,     0,     0,     0,     0,   341,
-       0,     0,   192,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,   251,     0,     0,     0,     0,   192,     0,
-       0,     0,   192,     1,     2,     3,     4,     5,     6,     7,
+     182,    42,    43,    44,     0,    45,    46,    47,    48,    49,
+      50,    51,    52,    53,    54,     0,    55,    56,    57,    58,
+     126,    59,   127,   128,   129,   130,   131,     0,     0,   132,
+     133,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,   134,     0,
+       0,     0,   183,   281,     0,     0,     0,     0,   185,   135,
+     136,   137,   138,     1,     2,     3,     4,     5,     6,     7,
        8,     9,    10,    11,   175,   176,   177,     0,   178,   179,
      180,   181,     0,     0,     0,    12,    13,    14,    15,    16,
       17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
@@ -1075,7 +1101,7 @@ static const yytype_int16 yytable[] =
       54,     0,    55,    56,    57,    58,   126,    59,   127,   128,
      129,   130,   131,     0,     0,   132,   133,     0,     0,     0,
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,   134,     0,     0,     0,   183,   184,
+       0,     0,     0,     0,   134,     0,     0,     0,   183,     0,
        0,     0,     0,     0,   185,   135,   136,   137,   138,     1,
        2,     3,     4,     5,     6,     7,     8,     9,    10,    11,
      175,   176,   177,     0,   178,   179,   180,   181,     0,     0,
@@ -1087,7 +1113,7 @@ static const yytype_int16 yytable[] =
       57,    58,   126,    59,   127,   128,   129,   130,   131,     0,
        0,   132,   133,     0,     0,     0,     0,     0,     0,     0,
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     134,     0,     0,     0,   183,   281,     0,     0,     0,     0,
+     134,     0,     0,     0,   115,     0,     0,     0,     0,     0,
      185,   135,   136,   137,   138,     1,     2,     3,     4,     5,
        6,     7,     8,     9,    10,    11,   175,   176,   177,     0,
      178,   179,   180,   181,     0,     0,     0,    12,    13,    14,
@@ -1099,62 +1125,29 @@ static const yytype_int16 yytable[] =
      127,   128,   129,   130,   131,     0,     0,   132,   133,     0,
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
        0,     0,     0,     0,     0,     0,   134,     0,     0,     0,
-     183,     0,     0,     0,     0,     0,   185,   135,   136,   137,
+       0,     0,     0,     0,     0,     0,   185,   135,   136,   137,
      138,     1,     2,     3,     4,     5,     6,     7,     8,     9,
-      10,    11,   175,   176,   177,     0,   178,   179,   180,   181,
+      10,    11,     0,     0,     0,     0,     0,     0,     0,     0,
        0,     0,     0,    12,    13,    14,    15,    16,    17,    18,
       19,    20,    21,    22,    23,    24,    25,    26,    27,    28,
        0,    29,    30,    31,    32,    33,    34,    35,    36,    37,
-      38,    39,    40,    41,   182,    42,    43,    44,     0,    45,
+      38,    39,    40,    41,     0,    42,    43,    44,     0,    45,
       46,    47,    48,    49,    50,    51,    52,    53,    54,     0,
       55,    56,    57,    58,   126,    59,   127,   128,   129,   130,
      131,     0,     0,   132,   133,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,   134,     0,     0,     0,   115,     0,     0,     0,
-       0,     0,   185,   135,   136,   137,   138,     1,     2,     3,
-       4,     5,     6,     7,     8,     9,    10,    11,   175,   176,
-     177,     0,   178,   179,   180,   181,     0,     0,     0,    12,
-      13,    14,    15,    16,    17,    18,    19,    20,    21,    22,
-      23,    24,    25,    26,    27,    28,     0,    29,    30,    31,
-      32,    33,    34,    35,    36,    37,    38,    39,    40,    41,
-     182,    42,    43,    44,     0,    45,    46,    47,    48,    49,
-      50,    51,    52,    53,    54,     0,    55,    56,    57,    58,
-     126,    59,   127,   128,   129,   130,   131,     0,     0,   132,
-     133,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,   134,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,   185,   135,
-     136,   137,   138,     1,     2,     3,     4,     5,     6,     7,
+       0,     0,     0,     0,     0,     0,     0,     0,   167,     2,
+       3,     4,   134,     6,     7,     8,     9,    10,    11,     0,
+       0,     0,   185,   135,   136,   137,   138,     0,     0,     0,
+      12,    13,    14,    15,    16,    17,    18,    19,    20,    21,
+      22,    23,    24,    25,    26,    27,    28,     0,    29,    30,
+      31,    32,    33,    34,    35,    36,    37,    38,    39,    40,
+      41,     0,    42,    43,    44,     0,    45,    46,    47,    48,
+      49,    50,    51,    52,    53,    54,     0,    55,    56,    57,
+      58,   126,    59,   127,   128,   129,   130,   131,     0,     0,
+     132,   133,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,   134,
        8,     9,    10,    11,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,    12,    13,    14,    15,    16,
-      17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
-      27,    28,     0,    29,    30,    31,    32,    33,    34,    35,
-      36,    37,    38,    39,    40,    41,     0,    42,    43,    44,
-       0,    45,    46,    47,    48,    49,    50,    51,    52,    53,
-      54,     0,    55,    56,    57,    58,   126,    59,   127,   128,
-     129,   130,   131,     0,     0,   132,   133,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     167,     2,     3,     4,   134,     6,     7,     8,     9,    10,
-      11,     0,     0,     0,   185,   135,   136,   137,   138,     0,
-       0,     0,    12,    13,    14,    15,    16,    17,    18,    19,
-      20,    21,    22,    23,    24,    25,    26,    27,    28,     0,
-      29,    30,    31,    32,    33,    34,    35,    36,    37,    38,
-      39,    40,    41,     0,    42,    43,    44,     0,    45,    46,
-      47,    48,    49,    50,    51,    52,    53,    54,     0,    55,
-      56,    57,    58,   126,    59,   127,   128,   129,   130,   131,
-       0,     0,   132,   133,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,   134,     8,     9,    10,    11,     0,     0,     0,     0,
-       0,     0,   135,   136,   137,   138,     0,    12,    13,    14,
-      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
-      25,    26,     0,     0,     0,     0,     0,    31,    32,    33,
-      34,    35,    36,     0,     0,     0,    40,    41,     0,    42,
-      43,    44,     0,    45,    46,    47,    48,    49,    50,    51,
-      52,    53,    54,     0,    55,    56,    57,     0,   126,    59,
-     127,   128,   129,   130,   131,     0,     0,   132,   133,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,   134,     0,     0,   207,
-       8,     9,    10,    11,     0,     0,     0,   135,   136,   137,
-     138,     0,     0,     0,     0,    12,    13,    14,    15,    16,
+     135,   136,   137,   138,     0,    12,    13,    14,    15,    16,
       17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
        0,     0,     0,     0,     0,    31,    32,    33,    34,    35,
       36,     0,     0,     0,    40,    41,     0,    42,    43,    44,
@@ -1199,91 +1192,122 @@ static const yytype_int16 yytable[] =
       41,     0,    42,    43,    44,     0,    45,    46,    47,    48,
       49,    50,    51,    52,    53,    54,     0,    55,    56,    57,
       58,     0,    59,     0,     0,     0,     0,     0,     0,     0,
-     107,     0,     0,     1,     2,     3,     4,     5,     6,     7,
+       0,     0,     0,   167,     2,     3,     4,     0,     6,     7,
        8,     9,    10,    11,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,   315,    12,    13,    14,    15,    16,
+       0,     0,     0,     0,   251,    12,    13,    14,    15,    16,
       17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
       27,    28,     0,    29,    30,    31,    32,    33,    34,    35,
       36,    37,    38,    39,    40,    41,     0,    42,    43,    44,
        0,    45,    46,    47,    48,    49,    50,    51,    52,    53,
-      54,     0,    55,    56,    57,    58,     0,    59,     1,     2,
+      54,     0,    55,    56,    57,    58,     0,    59,     0,     0,
+       0,     0,     0,     0,     0,   107,     0,     0,     1,     2,
        3,     4,     5,     6,     7,     8,     9,    10,    11,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,   316,
       12,    13,    14,    15,    16,    17,    18,    19,    20,    21,
       22,    23,    24,    25,    26,    27,    28,     0,    29,    30,
       31,    32,    33,    34,    35,    36,    37,    38,    39,    40,
       41,     0,    42,    43,    44,     0,    45,    46,    47,    48,
       49,    50,    51,    52,    53,    54,     0,    55,    56,    57,
-      58,     0,    59,   167,     2,     3,     4,     0,     6,     7,
+      58,     0,    59,     1,     2,     3,     4,     5,     6,     7,
        8,     9,    10,    11,     0,     0,     0,     0,     0,     0,
        0,     0,     0,     0,     0,    12,    13,    14,    15,    16,
       17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
       27,    28,     0,    29,    30,    31,    32,    33,    34,    35,
       36,    37,    38,    39,    40,    41,     0,    42,    43,    44,
        0,    45,    46,    47,    48,    49,    50,    51,    52,    53,
-      54,     0,    55,    56,    57,    58,     0,    59,     2,     3,
-       4,     0,     0,     0,     8,     9,    10,    11,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,    12,
-      13,    14,    15,    16,    17,    18,    19,    20,    21,    22,
-      23,    24,    25,    26,     0,     0,     0,     0,     0,    31,
-      32,    33,    34,    35,    36,     0,     0,     0,    40,    41,
-       0,    42,    43,    44,     0,    45,    46,    47,    48,    49,
-      50,    51,    52,    53,    54,     0,    55,    56,    57,     0,
-       0,    59,     8,     9,    10,    11,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,    12,    13,    14,
-      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
-      25,    26,     0,     0,     0,     0,     0,    31,    32,    33,
-      34,    35,    36,     0,     0,     0,    40,    41,     0,    42,
-      43,    44,     0,    45,    46,    47,    48,    49,    50,    51,
-      52,    53,    54,     0,    55,    56,    57,     0,   291,    59,
-       8,     9,    10,    11,   292,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,    12,    13,    14,    15,    16,
-      17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
-       0,     0,     0,     0,     0,    31,    32,    33,    34,    35,
-      36,     0,     0,     0,    40,    41,     0,    42,    43,    44,
-       0,    45,    46,    47,    48,    49,    50,    51,    52,    53,
-      54,     0,    55,    56,    57,     0,     0,    59
+      54,     0,    55,    56,    57,    58,     0,    59,   167,     2,
+       3,     4,     0,     6,     7,     8,     9,    10,    11,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+      12,    13,    14,    15,    16,    17,    18,    19,    20,    21,
+      22,    23,    24,    25,    26,    27,    28,     0,    29,    30,
+      31,    32,    33,    34,    35,    36,    37,    38,    39,    40,
+      41,     0,    42,    43,    44,     0,    45,    46,    47,    48,
+      49,    50,    51,    52,    53,    54,     0,    55,    56,    57,
+      58,     0,    59,     2,     3,     4,     0,     0,     0,     8,
+       9,    10,    11,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,    12,    13,    14,    15,    16,    17,
+      18,    19,    20,    21,    22,    23,    24,    25,    26,     0,
+       0,     0,     0,     0,    31,    32,    33,    34,    35,    36,
+       0,     0,     0,    40,    41,     0,    42,    43,    44,     0,
+      45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
+       0,    55,    56,    57,     0,     0,    59,     8,     9,    10,
+      11,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,    12,    13,    14,    15,    16,    17,    18,    19,
+      20,    21,    22,    23,    24,    25,    26,     0,     0,     0,
+       0,     0,    31,    32,    33,    34,    35,    36,     0,     0,
+       0,    40,    41,     0,    42,    43,    44,     0,    45,    46,
+      47,    48,    49,    50,    51,    52,    53,    54,     0,    55,
+      56,    57,     0,   292,    59,     8,     9,    10,    11,   293,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+      12,    13,    14,    15,    16,    17,    18,    19,    20,    21,
+      22,    23,    24,    25,    26,     0,     0,     0,     0,     0,
+      31,    32,    33,    34,    35,    36,     0,     0,     0,    40,
+      41,     0,    42,    43,    44,     0,    45,    46,    47,    48,
+      49,    50,    51,    52,    53,    54,     0,    55,    56,    57,
+       0,     0,    59
 };
 
 static const yytype_int16 yycheck[] =
 {
-       0,    89,   106,   125,   134,   206,   124,    69,     0,    44,
-     322,     9,     0,   106,   170,    76,   111,    87,    88,    92,
-     124,   326,   197,    72,     9,   147,   104,   106,   343,     9,
-     116,   124,   118,    82,   113,    97,   104,   342,   106,   132,
-     133,    76,    40,    41,    42,   113,   358,   108,   363,   111,
-     362,   181,   122,   123,   127,    40,    41,   150,    43,   121,
-      40,    41,    42,   114,   105,   105,    51,    85,    86,    69,
-     111,   166,    72,   105,   105,   170,   114,    77,    68,   111,
-     111,   111,    82,    73,   206,    77,   216,   205,   106,    77,
-     246,   106,   110,   105,   105,    40,    41,    97,   220,   111,
-     111,   205,   111,    76,   166,   114,   168,   105,   170,   108,
-     111,   111,   205,   114,   244,   115,   232,   233,   234,   235,
-     111,   121,   111,   114,   111,   114,   104,   114,   106,    76,
-     260,   108,   225,   226,   227,   228,   229,   230,   231,   232,
-     233,   234,   235,   236,   237,   238,   239,   240,   241,   242,
-     243,   246,   327,     4,     5,     6,   278,   279,    40,    41,
-      42,    83,    84,   364,    76,   283,   166,   113,   168,    76,
-     170,   119,   120,   121,    89,    90,    79,    80,   104,   283,
-     111,   112,   228,   229,   246,   230,   231,   105,   236,   237,
-     283,   104,   126,   125,   124,    91,   326,   197,    93,   317,
+       0,    89,   106,   125,   124,    69,   134,   323,   327,     0,
+       0,    92,     9,   170,   106,    87,    88,    85,    86,   104,
+     124,    72,   197,    44,   111,   147,   206,   346,     9,    76,
+     106,    82,   124,    97,     9,    40,    41,   113,   106,   347,
+     132,   133,   110,    40,    41,    42,   127,   111,   114,   365,
+     122,   123,   105,   181,   370,    76,   111,   121,   150,    40,
+      41,   108,    43,   371,   108,    40,    41,    42,   105,    69,
+      51,   104,    72,   106,   111,   105,   116,    77,   118,   166,
+     113,   111,    82,   170,   206,   205,    77,    77,   216,   246,
+     105,    76,   111,   105,   105,   114,   111,    97,   220,   111,
+     111,   205,   166,   106,   168,    68,   170,   287,   105,   111,
+      73,   111,   114,   205,    76,   115,   244,   232,   233,   234,
+     235,   121,   111,   111,   111,   114,   114,   114,     4,     5,
+       6,   108,   260,   225,   226,   227,   228,   229,   230,   231,
+     232,   233,   234,   235,   236,   237,   238,   239,   240,   241,
+     242,   243,   332,   328,    76,   335,   278,   279,   114,   246,
+      40,    41,    42,   283,   113,   287,   166,   104,   168,   106,
+     170,   119,   120,   121,   354,    83,    84,    89,    90,   283,
+      79,    80,   246,   111,   112,   228,   229,    76,   230,   231,
+     104,   283,   372,   126,   105,   236,   237,   197,   318,   327,
       94,    95,    96,    97,    98,    99,   100,   101,   102,   103,
-     107,   333,   342,   317,    44,    76,   114,   104,   104,   113,
-     104,   351,   114,   114,   317,   106,   109,   107,   104,   106,
-     108,   361,   107,   321,   107,   104,    56,   111,   104,   107,
-     107,    76,   364,   105,   109,   105,   246,     3,     4,     5,
-       6,   114,     8,     9,    10,    11,    12,    13,    17,   113,
-     217,   114,   238,   242,   239,   121,   266,   241,   240,    25,
+     332,   104,   125,   335,   318,   337,    91,   124,   346,   113,
+      93,   107,    44,    76,   114,   104,   318,   114,   109,   114,
+     358,   113,   354,   104,   322,   104,    10,    11,    12,    13,
+     106,   369,   107,   104,   106,   108,   246,   107,   107,   113,
+     372,    25,    26,    27,    28,    29,    30,    31,    32,    33,
+      34,    35,    36,    37,    38,    39,   266,   113,   111,   104,
+      56,    45,    46,    47,    48,    49,    50,   107,   107,   113,
+      54,    55,    76,    57,    58,    59,   104,    61,    62,    63,
+      64,    65,    66,    67,    68,    69,    70,   105,    72,    73,
+      74,   114,    76,    77,    78,    79,    80,    81,    82,   109,
+     105,    85,    86,    17,   113,   217,   114,   238,   241,   239,
+     121,   240,    91,   323,   324,   242,    98,   327,   328,   121,
+     104,     5,   174,   107,   243,   166,   319,   247,   324,   370,
+     266,   115,   116,   117,   118,   324,   346,   346,    77,    -1,
+      -1,     3,     4,     5,     6,     7,     8,     9,    10,    11,
+      12,    13,    14,    15,    16,   365,    18,    19,    20,    21,
+     370,    -1,    -1,    25,    26,    27,    28,    29,    30,    31,
+      32,    33,    34,    35,    36,    37,    38,    39,    40,    41,
+      -1,    43,    44,    45,    46,    47,    48,    49,    50,    51,
+      52,    53,    54,    55,    56,    57,    58,    59,    -1,    61,
+      62,    63,    64,    65,    66,    67,    68,    69,    70,    -1,
+      72,    73,    74,    75,    76,    77,    78,    79,    80,    81,
+      82,    -1,    -1,    85,    86,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,   104,    -1,    -1,    -1,   108,   109,    -1,    -1,
+      -1,    -1,   114,   115,   116,   117,   118,     3,     4,     5,
+       6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
+      16,    -1,    18,    19,    20,    21,    -1,    -1,    -1,    25,
       26,    27,    28,    29,    30,    31,    32,    33,    34,    35,
-      36,    37,    38,    39,    40,    41,    91,    43,    44,    45,
+      36,    37,    38,    39,    40,    41,    -1,    43,    44,    45,
       46,    47,    48,    49,    50,    51,    52,    53,    54,    55,
-     243,    57,    58,    59,    98,    61,    62,    63,    64,    65,
-      66,    67,    68,    69,    70,   121,    72,    73,    74,    75,
-       5,    77,   322,   323,   174,   166,   326,   327,   247,   323,
-     266,    77,   318,   362,   342,    -1,    -1,    -1,    -1,   323,
-      -1,    -1,   342,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,   109,    -1,    -1,    -1,    -1,   358,    -1,
-      -1,    -1,   362,     3,     4,     5,     6,     7,     8,     9,
+      56,    57,    58,    59,    -1,    61,    62,    63,    64,    65,
+      66,    67,    68,    69,    70,    -1,    72,    73,    74,    75,
+      76,    77,    78,    79,    80,    81,    82,    -1,    -1,    85,
+      86,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   104,    -1,
+      -1,    -1,   108,   109,    -1,    -1,    -1,    -1,   114,   115,
+     116,   117,   118,     3,     4,     5,     6,     7,     8,     9,
       10,    11,    12,    13,    14,    15,    16,    -1,    18,    19,
       20,    21,    -1,    -1,    -1,    25,    26,    27,    28,    29,
       30,    31,    32,    33,    34,    35,    36,    37,    38,    39,
@@ -1293,7 +1317,7 @@ static const yytype_int16 yycheck[] =
       70,    -1,    72,    73,    74,    75,    76,    77,    78,    79,
       80,    81,    82,    -1,    -1,    85,    86,    -1,    -1,    -1,
       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,   104,    -1,    -1,    -1,   108,   109,
+      -1,    -1,    -1,    -1,   104,    -1,    -1,    -1,   108,    -1,
       -1,    -1,    -1,    -1,   114,   115,   116,   117,   118,     3,
        4,     5,     6,     7,     8,     9,    10,    11,    12,    13,
       14,    15,    16,    -1,    18,    19,    20,    21,    -1,    -1,
@@ -1305,7 +1329,7 @@ static const yytype_int16 yycheck[] =
       74,    75,    76,    77,    78,    79,    80,    81,    82,    -1,
       -1,    85,    86,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-     104,    -1,    -1,    -1,   108,   109,    -1,    -1,    -1,    -1,
+     104,    -1,    -1,    -1,   108,    -1,    -1,    -1,    -1,    -1,
      114,   115,   116,   117,   118,     3,     4,     5,     6,     7,
        8,     9,    10,    11,    12,    13,    14,    15,    16,    -1,
       18,    19,    20,    21,    -1,    -1,    -1,    25,    26,    27,
@@ -1317,62 +1341,29 @@ static const yytype_int16 yycheck[] =
       78,    79,    80,    81,    82,    -1,    -1,    85,    86,    -1,
       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
       -1,    -1,    -1,    -1,    -1,    -1,   104,    -1,    -1,    -1,
-     108,    -1,    -1,    -1,    -1,    -1,   114,   115,   116,   117,
+      -1,    -1,    -1,    -1,    -1,    -1,   114,   115,   116,   117,
      118,     3,     4,     5,     6,     7,     8,     9,    10,    11,
-      12,    13,    14,    15,    16,    -1,    18,    19,    20,    21,
+      12,    13,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
       -1,    -1,    -1,    25,    26,    27,    28,    29,    30,    31,
       32,    33,    34,    35,    36,    37,    38,    39,    40,    41,
       -1,    43,    44,    45,    46,    47,    48,    49,    50,    51,
-      52,    53,    54,    55,    56,    57,    58,    59,    -1,    61,
+      52,    53,    54,    55,    -1,    57,    58,    59,    -1,    61,
       62,    63,    64,    65,    66,    67,    68,    69,    70,    -1,
       72,    73,    74,    75,    76,    77,    78,    79,    80,    81,
       82,    -1,    -1,    85,    86,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,   104,    -1,    -1,    -1,   108,    -1,    -1,    -1,
-      -1,    -1,   114,   115,   116,   117,   118,     3,     4,     5,
-       6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
-      16,    -1,    18,    19,    20,    21,    -1,    -1,    -1,    25,
-      26,    27,    28,    29,    30,    31,    32,    33,    34,    35,
-      36,    37,    38,    39,    40,    41,    -1,    43,    44,    45,
-      46,    47,    48,    49,    50,    51,    52,    53,    54,    55,
-      56,    57,    58,    59,    -1,    61,    62,    63,    64,    65,
-      66,    67,    68,    69,    70,    -1,    72,    73,    74,    75,
-      76,    77,    78,    79,    80,    81,    82,    -1,    -1,    85,
-      86,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   104,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   114,   115,
-     116,   117,   118,     3,     4,     5,     6,     7,     8,     9,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,     3,     4,
+       5,     6,   104,     8,     9,    10,    11,    12,    13,    -1,
+      -1,    -1,   114,   115,   116,   117,   118,    -1,    -1,    -1,
+      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
+      35,    36,    37,    38,    39,    40,    41,    -1,    43,    44,
+      45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
+      55,    -1,    57,    58,    59,    -1,    61,    62,    63,    64,
+      65,    66,    67,    68,    69,    70,    -1,    72,    73,    74,
+      75,    76,    77,    78,    79,    80,    81,    82,    -1,    -1,
+      85,    86,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   104,
       10,    11,    12,    13,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    25,    26,    27,    28,    29,
-      30,    31,    32,    33,    34,    35,    36,    37,    38,    39,
-      40,    41,    -1,    43,    44,    45,    46,    47,    48,    49,
-      50,    51,    52,    53,    54,    55,    -1,    57,    58,    59,
-      -1,    61,    62,    63,    64,    65,    66,    67,    68,    69,
-      70,    -1,    72,    73,    74,    75,    76,    77,    78,    79,
-      80,    81,    82,    -1,    -1,    85,    86,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-       3,     4,     5,     6,   104,     8,     9,    10,    11,    12,
-      13,    -1,    -1,    -1,   114,   115,   116,   117,   118,    -1,
-      -1,    -1,    25,    26,    27,    28,    29,    30,    31,    32,
-      33,    34,    35,    36,    37,    38,    39,    40,    41,    -1,
-      43,    44,    45,    46,    47,    48,    49,    50,    51,    52,
-      53,    54,    55,    -1,    57,    58,    59,    -1,    61,    62,
-      63,    64,    65,    66,    67,    68,    69,    70,    -1,    72,
-      73,    74,    75,    76,    77,    78,    79,    80,    81,    82,
-      -1,    -1,    85,    86,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,   104,    10,    11,    12,    13,    -1,    -1,    -1,    -1,
-      -1,    -1,   115,   116,   117,   118,    -1,    25,    26,    27,
-      28,    29,    30,    31,    32,    33,    34,    35,    36,    37,
-      38,    39,    -1,    -1,    -1,    -1,    -1,    45,    46,    47,
-      48,    49,    50,    -1,    -1,    -1,    54,    55,    -1,    57,
-      58,    59,    -1,    61,    62,    63,    64,    65,    66,    67,
-      68,    69,    70,    -1,    72,    73,    74,    -1,    76,    77,
-      78,    79,    80,    81,    82,    -1,    -1,    85,    86,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,   104,    -1,    -1,   107,
-      10,    11,    12,    13,    -1,    -1,    -1,   115,   116,   117,
-     118,    -1,    -1,    -1,    -1,    25,    26,    27,    28,    29,
+     115,   116,   117,   118,    -1,    25,    26,    27,    28,    29,
       30,    31,    32,    33,    34,    35,    36,    37,    38,    39,
       -1,    -1,    -1,    -1,    -1,    45,    46,    47,    48,    49,
       50,    -1,    -1,    -1,    54,    55,    -1,    57,    58,    59,
@@ -1417,50 +1408,59 @@ static const yytype_int16 yycheck[] =
       55,    -1,    57,    58,    59,    -1,    61,    62,    63,    64,
       65,    66,    67,    68,    69,    70,    -1,    72,    73,    74,
       75,    -1,    77,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-       0,    -1,    -1,     3,     4,     5,     6,     7,     8,     9,
+      -1,    -1,    -1,     3,     4,     5,     6,    -1,     8,     9,
       10,    11,    12,    13,    -1,    -1,    -1,    -1,    -1,    -1,
       -1,    -1,    -1,    -1,   109,    25,    26,    27,    28,    29,
       30,    31,    32,    33,    34,    35,    36,    37,    38,    39,
       40,    41,    -1,    43,    44,    45,    46,    47,    48,    49,
       50,    51,    52,    53,    54,    55,    -1,    57,    58,    59,
       -1,    61,    62,    63,    64,    65,    66,    67,    68,    69,
-      70,    -1,    72,    73,    74,    75,    -1,    77,     3,     4,
+      70,    -1,    72,    73,    74,    75,    -1,    77,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,     0,    -1,    -1,     3,     4,
        5,     6,     7,     8,     9,    10,    11,    12,    13,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   109,
       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
       35,    36,    37,    38,    39,    40,    41,    -1,    43,    44,
       45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
       55,    -1,    57,    58,    59,    -1,    61,    62,    63,    64,
       65,    66,    67,    68,    69,    70,    -1,    72,    73,    74,
-      75,    -1,    77,     3,     4,     5,     6,    -1,     8,     9,
+      75,    -1,    77,     3,     4,     5,     6,     7,     8,     9,
       10,    11,    12,    13,    -1,    -1,    -1,    -1,    -1,    -1,
       -1,    -1,    -1,    -1,    -1,    25,    26,    27,    28,    29,
       30,    31,    32,    33,    34,    35,    36,    37,    38,    39,
       40,    41,    -1,    43,    44,    45,    46,    47,    48,    49,
       50,    51,    52,    53,    54,    55,    -1,    57,    58,    59,
       -1,    61,    62,    63,    64,    65,    66,    67,    68,    69,
-      70,    -1,    72,    73,    74,    75,    -1,    77,     4,     5,
-       6,    -1,    -1,    -1,    10,    11,    12,    13,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    25,
-      26,    27,    28,    29,    30,    31,    32,    33,    34,    35,
-      36,    37,    38,    39,    -1,    -1,    -1,    -1,    -1,    45,
-      46,    47,    48,    49,    50,    -1,    -1,    -1,    54,    55,
-      -1,    57,    58,    59,    -1,    61,    62,    63,    64,    65,
-      66,    67,    68,    69,    70,    -1,    72,    73,    74,    -1,
-      -1,    77,    10,    11,    12,    13,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    25,    26,    27,
-      28,    29,    30,    31,    32,    33,    34,    35,    36,    37,
-      38,    39,    -1,    -1,    -1,    -1,    -1,    45,    46,    47,
-      48,    49,    50,    -1,    -1,    -1,    54,    55,    -1,    57,
-      58,    59,    -1,    61,    62,    63,    64,    65,    66,    67,
-      68,    69,    70,    -1,    72,    73,    74,    -1,    76,    77,
-      10,    11,    12,    13,    82,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    25,    26,    27,    28,    29,
-      30,    31,    32,    33,    34,    35,    36,    37,    38,    39,
-      -1,    -1,    -1,    -1,    -1,    45,    46,    47,    48,    49,
-      50,    -1,    -1,    -1,    54,    55,    -1,    57,    58,    59,
-      -1,    61,    62,    63,    64,    65,    66,    67,    68,    69,
-      70,    -1,    72,    73,    74,    -1,    -1,    77
+      70,    -1,    72,    73,    74,    75,    -1,    77,     3,     4,
+       5,     6,    -1,     8,     9,    10,    11,    12,    13,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
+      35,    36,    37,    38,    39,    40,    41,    -1,    43,    44,
+      45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
+      55,    -1,    57,    58,    59,    -1,    61,    62,    63,    64,
+      65,    66,    67,    68,    69,    70,    -1,    72,    73,    74,
+      75,    -1,    77,     4,     5,     6,    -1,    -1,    -1,    10,
+      11,    12,    13,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    25,    26,    27,    28,    29,    30,
+      31,    32,    33,    34,    35,    36,    37,    38,    39,    -1,
+      -1,    -1,    -1,    -1,    45,    46,    47,    48,    49,    50,
+      -1,    -1,    -1,    54,    55,    -1,    57,    58,    59,    -1,
+      61,    62,    63,    64,    65,    66,    67,    68,    69,    70,
+      -1,    72,    73,    74,    -1,    -1,    77,    10,    11,    12,
+      13,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    25,    26,    27,    28,    29,    30,    31,    32,
+      33,    34,    35,    36,    37,    38,    39,    -1,    -1,    -1,
+      -1,    -1,    45,    46,    47,    48,    49,    50,    -1,    -1,
+      -1,    54,    55,    -1,    57,    58,    59,    -1,    61,    62,
+      63,    64,    65,    66,    67,    68,    69,    70,    -1,    72,
+      73,    74,    -1,    76,    77,    10,    11,    12,    13,    82,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
+      35,    36,    37,    38,    39,    -1,    -1,    -1,    -1,    -1,
+      45,    46,    47,    48,    49,    50,    -1,    -1,    -1,    54,
+      55,    -1,    57,    58,    59,    -1,    61,    62,    63,    64,
+      65,    66,    67,    68,    69,    70,    -1,    72,    73,    74,
+      -1,    -1,    77
 };
 
 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
@@ -1495,16 +1495,17 @@ static const yytype_uint8 yystos[] =
      187,   109,   185,    79,    80,   178,   114,   114,   207,   104,
      104,   114,   114,   156,   104,   109,   193,    94,    95,    96,
       97,    98,    99,   100,   101,   102,   103,   113,   155,   111,
-     114,   109,   190,   106,   107,   157,   188,   107,   105,   132,
-     156,    76,    82,   135,   154,   140,   140,   140,   142,   142,
-     143,   143,   144,   144,   144,   144,   145,   145,   146,   147,
-     148,   149,   150,   151,   156,   109,   186,   106,   111,   114,
-     196,   197,   198,   208,   156,   114,   206,   200,   154,   154,
-     157,   107,   107,   112,   114,   157,   187,    56,   199,   191,
-     189,   201,   209,   105,   156,   169,   204,   194,   107,   154,
-     107,   104,   204,   210,   211,   196,   203,    76,   105,   109,
-     156,   114,   105,    17,   113,   191,   195,   199,   105,   156,
-     195,   196,   188,   114
+     114,   109,   190,   106,   107,   157,   188,   113,   107,   105,
+     132,   156,    76,    82,   135,   154,   140,   140,   140,   142,
+     142,   143,   143,   144,   144,   144,   144,   145,   145,   146,
+     147,   148,   149,   150,   151,   156,   109,   186,   106,   111,
+     114,   196,   197,   198,   208,   156,   114,   206,   200,   154,
+     154,   157,   113,   107,   188,   113,   107,   112,   114,   157,
+     187,    56,   199,   191,   189,   201,   209,   105,   156,   169,
+     204,   194,   107,   188,   113,   188,   154,   107,   104,   204,
+     210,   211,   196,   203,    76,   105,   109,   188,   156,   114,
+     105,    17,   113,   191,   195,   199,   105,   156,   195,   196,
+     188,   114
 };
 
 #define yyerrok                (yyerrstatus = 0)
@@ -3297,9 +3298,10 @@ yyreduce:
   case 86:
 
     {
-        if ((yyvsp[(1) - (2)].interm).intermAggregate)
-            (yyvsp[(1) - (2)].interm).intermAggregate->setOp(EOpDeclaration);
-        (yyval.interm.intermNode) = (yyvsp[(1) - (2)].interm).intermAggregate;
+        TIntermAggregate *aggNode = (yyvsp[(1) - (2)].interm).intermAggregate;
+        if (aggNode && aggNode->getOp() == EOpNull)
+            aggNode->setOp(EOpDeclaration);
+        (yyval.interm.intermNode) = aggNode;
     }
     break;
 
@@ -3545,233 +3547,110 @@ yyreduce:
   case 106:
 
     {
-        if ((yyvsp[(1) - (3)].interm).type.type == EbtInvariant && !(yyvsp[(3) - (3)].lex).symbol)
-        {
-            context->error((yyvsp[(3) - (3)].lex).line, "undeclared identifier declared as invariant", (yyvsp[(3) - (3)].lex).string->c_str());
-            context->recover();
-        }
-
-        TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(3) - (3)].lex).string, TType((yyvsp[(1) - (3)].interm).type), (yyvsp[(3) - (3)].lex).line);
-        (yyval.interm).intermAggregate = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermNode, symbol, (yyvsp[(3) - (3)].lex).line);
-        
-        if (context->structQualifierErrorCheck((yyvsp[(3) - (3)].lex).line, (yyval.interm).type))
-            context->recover();
-
-        if (context->nonInitConstErrorCheck((yyvsp[(3) - (3)].lex).line, *(yyvsp[(3) - (3)].lex).string, (yyval.interm).type, false))
-            context->recover();
-
-        TVariable* variable = 0;
-        if (context->nonInitErrorCheck((yyvsp[(3) - (3)].lex).line, *(yyvsp[(3) - (3)].lex).string, (yyval.interm).type, variable))
-            context->recover();
-        if (symbol && variable)
-            symbol->setId(variable->getUniqueId());
+        (yyval.interm) = (yyvsp[(1) - (3)].interm);
+        (yyval.interm).intermAggregate = context->parseDeclarator((yyval.interm).type, (yyvsp[(1) - (3)].interm).intermAggregate, (yyvsp[(3) - (3)].lex).line, *(yyvsp[(3) - (3)].lex).string);
     }
     break;
 
   case 107:
 
     {
-        if (context->structQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type))
-            context->recover();
-
-        if (context->nonInitConstErrorCheck((yyvsp[(3) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, true))
-            context->recover();
-
-        (yyval.interm) = (yyvsp[(1) - (5)].interm);
-
-        if (context->arrayTypeErrorCheck((yyvsp[(4) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type) || context->arrayQualifierErrorCheck((yyvsp[(4) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type))
-            context->recover();
-        else {
-            (yyvsp[(1) - (5)].interm).type.setArray(true);
-            TVariable* variable;
-            if (context->arrayErrorCheck((yyvsp[(4) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, variable))
-                context->recover();
-        }
+        (yyval.interm) = (yyvsp[(1) - (6)].interm);
+        (yyval.interm).intermAggregate = context->parseArrayDeclarator((yyval.interm).type, (yyvsp[(1) - (6)].interm).intermAggregate, (yyvsp[(3) - (6)].lex).line, *(yyvsp[(3) - (6)].lex).string, (yyvsp[(4) - (6)].lex).line, (yyvsp[(5) - (6)].interm.intermTypedNode));
     }
     break;
 
   case 108:
 
     {
-        if (context->structQualifierErrorCheck((yyvsp[(3) - (6)].lex).line, (yyvsp[(1) - (6)].interm).type))
-            context->recover();
-
-        if (context->nonInitConstErrorCheck((yyvsp[(3) - (6)].lex).line, *(yyvsp[(3) - (6)].lex).string, (yyvsp[(1) - (6)].interm).type, true))
-            context->recover();
-
-        (yyval.interm) = (yyvsp[(1) - (6)].interm);
-
-        if (context->arrayTypeErrorCheck((yyvsp[(4) - (6)].lex).line, (yyvsp[(1) - (6)].interm).type) || context->arrayQualifierErrorCheck((yyvsp[(4) - (6)].lex).line, (yyvsp[(1) - (6)].interm).type))
-            context->recover();
-        else {
-            int size;
-            if (context->arraySizeErrorCheck((yyvsp[(4) - (6)].lex).line, (yyvsp[(5) - (6)].interm.intermTypedNode), size))
-                context->recover();
-            (yyvsp[(1) - (6)].interm).type.setArray(true, size);
-            TVariable* variable = 0;
-            if (context->arrayErrorCheck((yyvsp[(4) - (6)].lex).line, *(yyvsp[(3) - (6)].lex).string, (yyvsp[(1) - (6)].interm).type, variable))
-                context->recover();
-            TType type = TType((yyvsp[(1) - (6)].interm).type);
-            type.setArraySize(size);
-            (yyval.interm).intermAggregate = context->intermediate.growAggregate((yyvsp[(1) - (6)].interm).intermNode, context->intermediate.addSymbol(variable ? variable->getUniqueId() : 0, *(yyvsp[(3) - (6)].lex).string, type, (yyvsp[(3) - (6)].lex).line), (yyvsp[(3) - (6)].lex).line);
-        }
+        ES3_ONLY("[]", (yyvsp[(3) - (7)].lex).line);
+        (yyval.interm) = (yyvsp[(1) - (7)].interm);
+        (yyval.interm).intermAggregate = context->parseArrayInitDeclarator((yyval.interm).type, (yyvsp[(1) - (7)].interm).intermAggregate, (yyvsp[(3) - (7)].lex).line, *(yyvsp[(3) - (7)].lex).string, (yyvsp[(4) - (7)].lex).line, nullptr, (yyvsp[(6) - (7)].lex).line, (yyvsp[(7) - (7)].interm.intermTypedNode));
     }
     break;
 
   case 109:
 
     {
-        if (context->structQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type))
-            context->recover();
-
-        (yyval.interm) = (yyvsp[(1) - (5)].interm);
-
-        TIntermNode* intermNode;
-        if (!context->executeInitializer((yyvsp[(3) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, (yyvsp[(5) - (5)].interm.intermTypedNode), intermNode)) {
-            //
-            // build the intermediate representation
-            //
-            if (intermNode)
-        (yyval.interm).intermAggregate = context->intermediate.growAggregate((yyvsp[(1) - (5)].interm).intermNode, intermNode, (yyvsp[(4) - (5)].lex).line);
-            else
-                (yyval.interm).intermAggregate = (yyvsp[(1) - (5)].interm).intermAggregate;
-        } else {
-            context->recover();
-            (yyval.interm).intermAggregate = 0;
-        }
+        ES3_ONLY("=", (yyvsp[(7) - (8)].lex).line);
+        (yyval.interm) = (yyvsp[(1) - (8)].interm);
+        (yyval.interm).intermAggregate = context->parseArrayInitDeclarator((yyval.interm).type, (yyvsp[(1) - (8)].interm).intermAggregate, (yyvsp[(3) - (8)].lex).line, *(yyvsp[(3) - (8)].lex).string, (yyvsp[(4) - (8)].lex).line, (yyvsp[(5) - (8)].interm.intermTypedNode), (yyvsp[(7) - (8)].lex).line, (yyvsp[(8) - (8)].interm.intermTypedNode));
     }
     break;
 
   case 110:
 
     {
-        (yyval.interm).type = (yyvsp[(1) - (1)].interm.type);
-        (yyval.interm).intermAggregate = context->intermediate.makeAggregate(context->intermediate.addSymbol(0, "", TType((yyvsp[(1) - (1)].interm.type)), (yyvsp[(1) - (1)].interm.type).line), (yyvsp[(1) - (1)].interm.type).line);
+        (yyval.interm) = (yyvsp[(1) - (5)].interm);
+        (yyval.interm).intermAggregate = context->parseInitDeclarator((yyval.interm).type, (yyvsp[(1) - (5)].interm).intermAggregate, (yyvsp[(3) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(4) - (5)].lex).line, (yyvsp[(5) - (5)].interm.intermTypedNode));
     }
     break;
 
   case 111:
 
     {
-        TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (2)].lex).string, TType((yyvsp[(1) - (2)].interm.type)), (yyvsp[(2) - (2)].lex).line);
-        (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (2)].lex).line);
-        
-        if (context->structQualifierErrorCheck((yyvsp[(2) - (2)].lex).line, (yyval.interm).type))
-            context->recover();
-
-        if (context->nonInitConstErrorCheck((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string, (yyval.interm).type, false))
-            context->recover();
-            
-            (yyval.interm).type = (yyvsp[(1) - (2)].interm.type);
-
-        TVariable* variable = 0;
-        if (context->nonInitErrorCheck((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string, (yyval.interm).type, variable))
-            context->recover();
-        if (variable && symbol)
-            symbol->setId(variable->getUniqueId());
+        (yyval.interm).type = (yyvsp[(1) - (1)].interm.type);
+        (yyval.interm).intermAggregate = context->parseSingleDeclaration((yyval.interm).type, (yyvsp[(1) - (1)].interm.type).line, "");
     }
     break;
 
   case 112:
 
     {
-        context->error((yyvsp[(2) - (4)].lex).line, "unsized array declarations not supported", (yyvsp[(2) - (4)].lex).string->c_str());
-        context->recover();
-
-        TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (4)].lex).string, TType((yyvsp[(1) - (4)].interm.type)), (yyvsp[(2) - (4)].lex).line);
-        (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (4)].lex).line);
-        (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
+        (yyval.interm).type = (yyvsp[(1) - (2)].interm.type);
+        (yyval.interm).intermAggregate = context->parseSingleDeclaration((yyval.interm).type, (yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string);
     }
     break;
 
   case 113:
 
     {
-        TType type = TType((yyvsp[(1) - (5)].interm.type));
-        int size;
-        if (context->arraySizeErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
-            context->recover();
-        type.setArraySize(size);
-        TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (5)].lex).string, type, (yyvsp[(2) - (5)].lex).line);
-        (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (5)].lex).line);
-        
-        if (context->structQualifierErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type)))
-            context->recover();
-
-        if (context->nonInitConstErrorCheck((yyvsp[(2) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string, (yyvsp[(1) - (5)].interm.type), true))
-            context->recover();
-
         (yyval.interm).type = (yyvsp[(1) - (5)].interm.type);
-
-        if (context->arrayTypeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type)) || context->arrayQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type)))
-            context->recover();
-        else {
-            int size;
-            if (context->arraySizeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
-                context->recover();
-
-            (yyvsp[(1) - (5)].interm.type).setArray(true, size);
-            TVariable* variable = 0;
-            if (context->arrayErrorCheck((yyvsp[(3) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string, (yyvsp[(1) - (5)].interm.type), variable))
-                context->recover();
-            if (variable && symbol)
-                symbol->setId(variable->getUniqueId());
-        }
+        (yyval.interm).intermAggregate = context->parseSingleArrayDeclaration((yyval.interm).type, (yyvsp[(2) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string, (yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode));
     }
     break;
 
   case 114:
 
     {
-        if (context->structQualifierErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
-            context->recover();
-
-        (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
-
-        TIntermNode* intermNode;
-        if (!context->executeInitializer((yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode)) {
-        //
-        // Build intermediate representation
-        //
-            if(intermNode)
-                (yyval.interm).intermAggregate = context->intermediate.makeAggregate(intermNode, (yyvsp[(3) - (4)].lex).line);
-            else
-                (yyval.interm).intermAggregate = 0;
-        } else {
-            context->recover();
-            (yyval.interm).intermAggregate = 0;
-        }
+        ES3_ONLY("[]", (yyvsp[(3) - (6)].lex).line);
+        (yyval.interm).type = (yyvsp[(1) - (6)].interm.type);
+        (yyval.interm).intermAggregate = context->parseSingleArrayInitDeclaration((yyval.interm).type, (yyvsp[(2) - (6)].lex).line, *(yyvsp[(2) - (6)].lex).string, (yyvsp[(3) - (6)].lex).line, nullptr, (yyvsp[(5) - (6)].lex).line, (yyvsp[(6) - (6)].interm.intermTypedNode));
     }
     break;
 
   case 115:
 
     {
-        if (context->globalErrorCheck((yyvsp[(1) - (2)].lex).line, context->symbolTable.atGlobalLevel(), "invariant varying"))
-            context->recover();
-        (yyval.interm).type.setBasic(EbtInvariant, EvqInvariantVaryingOut, (yyvsp[(2) - (2)].lex).line);
-        if (!(yyvsp[(2) - (2)].lex).symbol)
-        {
-            context->error((yyvsp[(2) - (2)].lex).line, "undeclared identifier declared as invariant", (yyvsp[(2) - (2)].lex).string->c_str());
-            context->recover();
-            
-            (yyval.interm).intermAggregate = 0;
-        }
-        else
-        {
-            TIntermSymbol *symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (2)].lex).string, TType((yyval.interm).type), (yyvsp[(2) - (2)].lex).line);
-            (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (2)].lex).line);
-        }
+        ES3_ONLY("=", (yyvsp[(6) - (7)].lex).line);
+        (yyval.interm).type = (yyvsp[(1) - (7)].interm.type);
+        (yyval.interm).intermAggregate = context->parseSingleArrayInitDeclaration((yyval.interm).type, (yyvsp[(2) - (7)].lex).line, *(yyvsp[(2) - (7)].lex).string, (yyvsp[(3) - (7)].lex).line, (yyvsp[(4) - (7)].interm.intermTypedNode), (yyvsp[(6) - (7)].lex).line, (yyvsp[(7) - (7)].interm.intermTypedNode));
     }
     break;
 
   case 116:
 
     {
-        (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
+        (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
+        (yyval.interm).intermAggregate = context->parseSingleInitDeclaration((yyval.interm).type, (yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(3) - (4)].lex).line, (yyvsp[(4) - (4)].interm.intermTypedNode));
+    }
+    break;
 
-        if ((yyvsp[(1) - (1)].interm.type).array) {
-            ES3_ONLY("[]", (yyvsp[(1) - (1)].interm.type).line);
+  case 117:
+
+    {
+        // $$.type is not used in invariant declarations.
+        (yyval.interm).intermAggregate = context->parseInvariantDeclaration((yyvsp[(1) - (2)].lex).line, (yyvsp[(2) - (2)].lex).line, (yyvsp[(2) - (2)].lex).string, (yyvsp[(2) - (2)].lex).symbol);
+    }
+    break;
+
+  case 118:
+
+    {
+        (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
+
+        if ((yyvsp[(1) - (1)].interm.type).array) {
+            ES3_ONLY("[]", (yyvsp[(1) - (1)].interm.type).line);
             if (context->getShaderVersion() != 300) {
                 (yyvsp[(1) - (1)].interm.type).clearArrayness();
             }
@@ -3779,35 +3658,35 @@ yyreduce:
     }
     break;
 
-  case 117:
+  case 119:
 
     {
         (yyval.interm.type) = context->addFullySpecifiedType((yyvsp[(1) - (2)].interm.type).qualifier, (yyvsp[(1) - (2)].interm.type).invariant, (yyvsp[(1) - (2)].interm.type).layoutQualifier, (yyvsp[(2) - (2)].interm.type));
     }
     break;
 
-  case 118:
+  case 120:
 
     {
         (yyval.interm.type).qualifier = EvqSmooth;
     }
     break;
 
-  case 119:
+  case 121:
 
     {
         (yyval.interm.type).qualifier = EvqFlat;
     }
     break;
 
-  case 120:
+  case 122:
 
     {
         (yyval.interm.qualifier) = EvqConstReadOnly;
     }
     break;
 
-  case 121:
+  case 123:
 
     {
         VERTEX_ONLY("attribute", (yyvsp[(1) - (1)].lex).line);
@@ -3818,7 +3697,7 @@ yyreduce:
     }
     break;
 
-  case 122:
+  case 124:
 
     {
         ES2_ONLY("varying", (yyvsp[(1) - (1)].lex).line);
@@ -3831,7 +3710,7 @@ yyreduce:
     }
     break;
 
-  case 123:
+  case 125:
 
     {
         ES2_ONLY("varying", (yyvsp[(1) - (2)].lex).line);
@@ -3844,21 +3723,21 @@ yyreduce:
     }
     break;
 
-  case 124:
+  case 126:
 
     {
         (yyval.interm.type).setBasic(EbtVoid, (yyvsp[(1) - (1)].interm.type).qualifier, (yyvsp[(1) - (1)].interm.type).line);
     }
     break;
 
-  case 125:
+  case 127:
 
     {
         (yyval.interm.type) = context->joinInterpolationQualifiers((yyvsp[(1) - (2)].interm.type).line, (yyvsp[(1) - (2)].interm.type).qualifier, (yyvsp[(2) - (2)].interm.type).line, (yyvsp[(2) - (2)].interm.type).qualifier);
     }
     break;
 
-  case 126:
+  case 128:
 
     {
         context->error((yyvsp[(1) - (1)].interm.type).line, "interpolation qualifier requires a fragment 'in' or vertex 'out' storage qualifier", getQualifierString((yyvsp[(1) - (1)].interm.type).qualifier));
@@ -3869,7 +3748,7 @@ yyreduce:
     }
     break;
 
-  case 127:
+  case 129:
 
     {
         (yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
@@ -3877,7 +3756,7 @@ yyreduce:
     }
     break;
 
-  case 128:
+  case 130:
 
     {
         (yyval.interm.type).setBasic(EbtVoid, (yyvsp[(2) - (2)].interm.type).qualifier, (yyvsp[(2) - (2)].interm.type).line);
@@ -3885,7 +3764,7 @@ yyreduce:
     }
     break;
 
-  case 129:
+  case 131:
 
     {
         (yyval.interm.type).qualifier = EvqConstExpr;
@@ -3893,7 +3772,7 @@ yyreduce:
     }
     break;
 
-  case 130:
+  case 132:
 
     {
                ES3_ONLY("in", (yyvsp[(1) - (1)].lex).line);
@@ -3902,7 +3781,7 @@ yyreduce:
     }
     break;
 
-  case 131:
+  case 133:
 
     {
                ES3_ONLY("out", (yyvsp[(1) - (1)].lex).line);
@@ -3911,7 +3790,7 @@ yyreduce:
     }
     break;
 
-  case 132:
+  case 134:
 
     {
                ES3_ONLY("centroid in", (yyvsp[(1) - (2)].lex).line);
@@ -3925,7 +3804,7 @@ yyreduce:
     }
     break;
 
-  case 133:
+  case 135:
 
     {
                ES3_ONLY("centroid out", (yyvsp[(1) - (2)].lex).line);
@@ -3939,7 +3818,7 @@ yyreduce:
     }
     break;
 
-  case 134:
+  case 136:
 
     {
         if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "uniform"))
@@ -3949,7 +3828,7 @@ yyreduce:
     }
     break;
 
-  case 135:
+  case 137:
 
     {
         (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
@@ -3963,7 +3842,7 @@ yyreduce:
     }
     break;
 
-  case 136:
+  case 138:
 
     {
         (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type);
@@ -3971,28 +3850,28 @@ yyreduce:
     }
     break;
 
-  case 137:
+  case 139:
 
     {
         (yyval.interm.precision) = EbpHigh;
     }
     break;
 
-  case 138:
+  case 140:
 
     {
         (yyval.interm.precision) = EbpMedium;
     }
     break;
 
-  case 139:
+  case 141:
 
     {
         (yyval.interm.precision) = EbpLow;
     }
     break;
 
-  case 140:
+  case 142:
 
     {
         ES3_ONLY("layout", (yyvsp[(1) - (4)].lex).line);
@@ -4000,49 +3879,49 @@ yyreduce:
     }
     break;
 
-  case 141:
+  case 143:
 
     {
         (yyval.interm.layoutQualifier) = (yyvsp[(1) - (1)].interm.layoutQualifier);
     }
     break;
 
-  case 142:
+  case 144:
 
     {
         (yyval.interm.layoutQualifier) = context->joinLayoutQualifiers((yyvsp[(1) - (3)].interm.layoutQualifier), (yyvsp[(3) - (3)].interm.layoutQualifier));
     }
     break;
 
-  case 143:
+  case 145:
 
     {
         (yyval.interm.layoutQualifier) = context->parseLayoutQualifier(*(yyvsp[(1) - (1)].lex).string, (yyvsp[(1) - (1)].lex).line);
     }
     break;
 
-  case 144:
+  case 146:
 
     {
         (yyval.interm.layoutQualifier) = context->parseLayoutQualifier(*(yyvsp[(1) - (3)].lex).string, (yyvsp[(1) - (3)].lex).line, *(yyvsp[(3) - (3)].lex).string, (yyvsp[(3) - (3)].lex).i, (yyvsp[(3) - (3)].lex).line);
     }
     break;
 
-  case 145:
+  case 147:
 
     {
         (yyval.interm.layoutQualifier) = context->parseLayoutQualifier(*(yyvsp[(1) - (3)].lex).string, (yyvsp[(1) - (3)].lex).line, *(yyvsp[(3) - (3)].lex).string, (yyvsp[(3) - (3)].lex).i, (yyvsp[(3) - (3)].lex).line);
     }
     break;
 
-  case 146:
+  case 148:
 
     {
         (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
     }
     break;
 
-  case 147:
+  case 149:
 
     {
         (yyval.interm.type) = (yyvsp[(1) - (4)].interm.type);
@@ -4058,7 +3937,7 @@ yyreduce:
     }
     break;
 
-  case 148:
+  case 150:
 
     {
         TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
@@ -4066,7 +3945,7 @@ yyreduce:
     }
     break;
 
-  case 149:
+  case 151:
 
     {
         TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
@@ -4074,7 +3953,7 @@ yyreduce:
     }
     break;
 
-  case 150:
+  case 152:
 
     {
         TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
@@ -4082,7 +3961,7 @@ yyreduce:
     }
     break;
 
-  case 151:
+  case 153:
 
     {
         TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
@@ -4090,7 +3969,7 @@ yyreduce:
     }
     break;
 
-  case 152:
+  case 154:
 
     {
         TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
@@ -4098,7 +3977,7 @@ yyreduce:
     }
     break;
 
-  case 153:
+  case 155:
 
     {
         TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
@@ -4107,7 +3986,7 @@ yyreduce:
     }
     break;
 
-  case 154:
+  case 156:
 
     {
         TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
@@ -4116,7 +3995,7 @@ yyreduce:
     }
     break;
 
-  case 155:
+  case 157:
 
     {
         TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
@@ -4125,7 +4004,7 @@ yyreduce:
     }
     break;
 
-  case 156:
+  case 158:
 
     {
         TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
@@ -4134,7 +4013,7 @@ yyreduce:
     }
     break;
 
-  case 157:
+  case 159:
 
     {
         TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
@@ -4143,7 +4022,7 @@ yyreduce:
     }
     break;
 
-  case 158:
+  case 160:
 
     {
         TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
@@ -4152,7 +4031,7 @@ yyreduce:
     }
     break;
 
-  case 159:
+  case 161:
 
     {
         TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
@@ -4161,7 +4040,7 @@ yyreduce:
     }
     break;
 
-  case 160:
+  case 162:
 
     {
         TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
@@ -4170,7 +4049,7 @@ yyreduce:
     }
     break;
 
-  case 161:
+  case 163:
 
     {
         TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
@@ -4179,7 +4058,7 @@ yyreduce:
     }
     break;
 
-  case 162:
+  case 164:
 
     {
         TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
@@ -4188,7 +4067,7 @@ yyreduce:
     }
     break;
 
-  case 163:
+  case 165:
 
     {
         TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
@@ -4197,7 +4076,7 @@ yyreduce:
     }
     break;
 
-  case 164:
+  case 166:
 
     {
         TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
@@ -4206,7 +4085,7 @@ yyreduce:
     }
     break;
 
-  case 165:
+  case 167:
 
     {
         FRAG_VERT_ONLY("mat2", (yyvsp[(1) - (1)].lex).line);
@@ -4216,7 +4095,7 @@ yyreduce:
     }
     break;
 
-  case 166:
+  case 168:
 
     {
         FRAG_VERT_ONLY("mat3", (yyvsp[(1) - (1)].lex).line);
@@ -4226,7 +4105,7 @@ yyreduce:
     }
     break;
 
-  case 167:
+  case 169:
 
     {
         FRAG_VERT_ONLY("mat4", (yyvsp[(1) - (1)].lex).line);
@@ -4236,7 +4115,7 @@ yyreduce:
     }
     break;
 
-  case 168:
+  case 170:
 
     {
         FRAG_VERT_ONLY("mat2x3", (yyvsp[(1) - (1)].lex).line);
@@ -4246,7 +4125,7 @@ yyreduce:
     }
     break;
 
-  case 169:
+  case 171:
 
     {
         FRAG_VERT_ONLY("mat3x2", (yyvsp[(1) - (1)].lex).line);
@@ -4256,7 +4135,7 @@ yyreduce:
     }
     break;
 
-  case 170:
+  case 172:
 
     {
         FRAG_VERT_ONLY("mat2x4", (yyvsp[(1) - (1)].lex).line);
@@ -4266,7 +4145,7 @@ yyreduce:
     }
     break;
 
-  case 171:
+  case 173:
 
     {
         FRAG_VERT_ONLY("mat4x2", (yyvsp[(1) - (1)].lex).line);
@@ -4276,7 +4155,7 @@ yyreduce:
     }
     break;
 
-  case 172:
+  case 174:
 
     {
         FRAG_VERT_ONLY("mat3x4", (yyvsp[(1) - (1)].lex).line);
@@ -4286,7 +4165,7 @@ yyreduce:
     }
     break;
 
-  case 173:
+  case 175:
 
     {
         FRAG_VERT_ONLY("mat4x3", (yyvsp[(1) - (1)].lex).line);
@@ -4296,7 +4175,7 @@ yyreduce:
     }
     break;
 
-  case 174:
+  case 176:
 
     {
         FRAG_VERT_ONLY("sampler2D", (yyvsp[(1) - (1)].lex).line);
@@ -4305,7 +4184,7 @@ yyreduce:
     }
     break;
 
-  case 175:
+  case 177:
 
     {
         FRAG_VERT_ONLY("samplerCube", (yyvsp[(1) - (1)].lex).line);
@@ -4314,7 +4193,7 @@ yyreduce:
     }
     break;
 
-  case 176:
+  case 178:
 
     {
         if (!context->supportsExtension("GL_OES_EGL_image_external")) {
@@ -4327,7 +4206,7 @@ yyreduce:
     }
     break;
 
-  case 177:
+  case 179:
 
     {
         FRAG_VERT_ONLY("sampler3D", (yyvsp[(1) - (1)].lex).line);
@@ -4336,7 +4215,7 @@ yyreduce:
     }
     break;
 
-  case 178:
+  case 180:
 
     {
         FRAG_VERT_ONLY("sampler2DArray", (yyvsp[(1) - (1)].lex).line);
@@ -4345,7 +4224,7 @@ yyreduce:
     }
     break;
 
-  case 179:
+  case 181:
 
     {
         FRAG_VERT_ONLY("isampler2D", (yyvsp[(1) - (1)].lex).line);
@@ -4354,7 +4233,7 @@ yyreduce:
     }
     break;
 
-  case 180:
+  case 182:
 
     {
         FRAG_VERT_ONLY("isampler3D", (yyvsp[(1) - (1)].lex).line);
@@ -4363,7 +4242,7 @@ yyreduce:
     }
     break;
 
-  case 181:
+  case 183:
 
     {
         FRAG_VERT_ONLY("isamplerCube", (yyvsp[(1) - (1)].lex).line);
@@ -4372,7 +4251,7 @@ yyreduce:
     }
     break;
 
-  case 182:
+  case 184:
 
     {
         FRAG_VERT_ONLY("isampler2DArray", (yyvsp[(1) - (1)].lex).line);
@@ -4381,7 +4260,7 @@ yyreduce:
     }
     break;
 
-  case 183:
+  case 185:
 
     {
         FRAG_VERT_ONLY("usampler2D", (yyvsp[(1) - (1)].lex).line);
@@ -4390,7 +4269,7 @@ yyreduce:
     }
     break;
 
-  case 184:
+  case 186:
 
     {
         FRAG_VERT_ONLY("usampler3D", (yyvsp[(1) - (1)].lex).line);
@@ -4399,7 +4278,7 @@ yyreduce:
     }
     break;
 
-  case 185:
+  case 187:
 
     {
         FRAG_VERT_ONLY("usamplerCube", (yyvsp[(1) - (1)].lex).line);
@@ -4408,7 +4287,7 @@ yyreduce:
     }
     break;
 
-  case 186:
+  case 188:
 
     {
         FRAG_VERT_ONLY("usampler2DArray", (yyvsp[(1) - (1)].lex).line);
@@ -4417,7 +4296,7 @@ yyreduce:
     }
     break;
 
-  case 187:
+  case 189:
 
     {
         FRAG_VERT_ONLY("sampler2DShadow", (yyvsp[(1) - (1)].lex).line);
@@ -4426,7 +4305,7 @@ yyreduce:
     }
     break;
 
-  case 188:
+  case 190:
 
     {
         FRAG_VERT_ONLY("samplerCubeShadow", (yyvsp[(1) - (1)].lex).line);
@@ -4435,7 +4314,7 @@ yyreduce:
     }
     break;
 
-  case 189:
+  case 191:
 
     {
         FRAG_VERT_ONLY("sampler2DArrayShadow", (yyvsp[(1) - (1)].lex).line);
@@ -4444,7 +4323,7 @@ yyreduce:
     }
     break;
 
-  case 190:
+  case 192:
 
     {
         FRAG_VERT_ONLY("struct", (yyvsp[(1) - (1)].interm.type).line);
@@ -4453,7 +4332,7 @@ yyreduce:
     }
     break;
 
-  case 191:
+  case 193:
 
     {
         //
@@ -4467,38 +4346,38 @@ yyreduce:
     }
     break;
 
-  case 192:
+  case 194:
 
     { if (context->enterStructDeclaration((yyvsp[(2) - (3)].lex).line, *(yyvsp[(2) - (3)].lex).string)) context->recover(); }
     break;
 
-  case 193:
+  case 195:
 
     {
         (yyval.interm.type) = context->addStructure((yyvsp[(1) - (6)].lex).line, (yyvsp[(2) - (6)].lex).line, (yyvsp[(2) - (6)].lex).string, (yyvsp[(5) - (6)].interm.fieldList));
     }
     break;
 
-  case 194:
+  case 196:
 
     { if (context->enterStructDeclaration((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string)) context->recover(); }
     break;
 
-  case 195:
+  case 197:
 
     {
         (yyval.interm.type) = context->addStructure((yyvsp[(1) - (5)].lex).line, (yyvsp[(1) - (5)].lex).line, NewPoolTString(""), (yyvsp[(4) - (5)].interm.fieldList));
     }
     break;
 
-  case 196:
+  case 198:
 
     {
         (yyval.interm.fieldList) = (yyvsp[(1) - (1)].interm.fieldList);
     }
     break;
 
-  case 197:
+  case 199:
 
     {
         (yyval.interm.fieldList) = (yyvsp[(1) - (2)].interm.fieldList);
@@ -4515,14 +4394,14 @@ yyreduce:
     }
     break;
 
-  case 198:
+  case 200:
 
     {
         (yyval.interm.fieldList) = context->addStructDeclaratorList((yyvsp[(1) - (3)].interm.type), (yyvsp[(2) - (3)].interm.fieldList));
     }
     break;
 
-  case 199:
+  case 201:
 
     {
         // ES3 Only, but errors should be handled elsewhere
@@ -4532,7 +4411,7 @@ yyreduce:
     }
     break;
 
-  case 200:
+  case 202:
 
     {
         (yyval.interm.fieldList) = NewPoolTFieldList();
@@ -4540,14 +4419,14 @@ yyreduce:
     }
     break;
 
-  case 201:
+  case 203:
 
     {
         (yyval.interm.fieldList)->push_back((yyvsp[(3) - (3)].interm.field));
     }
     break;
 
-  case 202:
+  case 204:
 
     {
         if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
@@ -4558,7 +4437,7 @@ yyreduce:
     }
     break;
 
-  case 203:
+  case 205:
 
     {
         if (context->reservedErrorCheck((yyvsp[(1) - (4)].lex).line, *(yyvsp[(1) - (4)].lex).string))
@@ -4574,67 +4453,67 @@ yyreduce:
     }
     break;
 
-  case 204:
+  case 206:
 
     { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
     break;
 
-  case 205:
+  case 207:
 
     { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
     break;
 
-  case 206:
+  case 208:
 
     { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermAggregate); }
     break;
 
-  case 207:
+  case 209:
 
     { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
     break;
 
-  case 208:
+  case 210:
 
     { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
     break;
 
-  case 209:
+  case 211:
 
     { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
     break;
 
-  case 210:
+  case 212:
 
     { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
     break;
 
-  case 211:
+  case 213:
 
     { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
     break;
 
-  case 212:
+  case 214:
 
     { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
     break;
 
-  case 213:
+  case 215:
 
     { (yyval.interm.intermAggregate) = 0; }
     break;
 
-  case 214:
+  case 216:
 
     { context->symbolTable.push(); }
     break;
 
-  case 215:
+  case 217:
 
     { context->symbolTable.pop(); }
     break;
 
-  case 216:
+  case 218:
 
     {
         if ((yyvsp[(3) - (5)].interm.intermAggregate) != 0) {
@@ -4645,44 +4524,44 @@ yyreduce:
     }
     break;
 
-  case 217:
+  case 219:
 
     { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
     break;
 
-  case 218:
+  case 220:
 
     { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
     break;
 
-  case 219:
+  case 221:
 
     { context->symbolTable.push(); }
     break;
 
-  case 220:
+  case 222:
 
     { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
     break;
 
-  case 221:
+  case 223:
 
     { context->symbolTable.push(); }
     break;
 
-  case 222:
+  case 224:
 
     { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
     break;
 
-  case 223:
+  case 225:
 
     {
         (yyval.interm.intermNode) = 0;
     }
     break;
 
-  case 224:
+  case 226:
 
     {
         if ((yyvsp[(2) - (3)].interm.intermAggregate)) {
@@ -4693,31 +4572,31 @@ yyreduce:
     }
     break;
 
-  case 225:
+  case 227:
 
     {
         (yyval.interm.intermAggregate) = context->intermediate.makeAggregate((yyvsp[(1) - (1)].interm.intermNode), 0);
     }
     break;
 
-  case 226:
+  case 228:
 
     {
         (yyval.interm.intermAggregate) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermAggregate), (yyvsp[(2) - (2)].interm.intermNode), 0);
     }
     break;
 
-  case 227:
+  case 229:
 
     { (yyval.interm.intermNode) = 0; }
     break;
 
-  case 228:
+  case 230:
 
     { (yyval.interm.intermNode) = static_cast<TIntermNode*>((yyvsp[(1) - (2)].interm.intermTypedNode)); }
     break;
 
-  case 229:
+  case 231:
 
     {
         if (context->boolErrorCheck((yyvsp[(1) - (5)].lex).line, (yyvsp[(3) - (5)].interm.intermTypedNode)))
@@ -4726,7 +4605,7 @@ yyreduce:
     }
     break;
 
-  case 230:
+  case 232:
 
     {
         (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermNode);
@@ -4734,7 +4613,7 @@ yyreduce:
     }
     break;
 
-  case 231:
+  case 233:
 
     {
         (yyval.interm.nodePair).node1 = (yyvsp[(1) - (1)].interm.intermNode);
@@ -4742,7 +4621,7 @@ yyreduce:
     }
     break;
 
-  case 232:
+  case 234:
 
     {
         (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
@@ -4751,7 +4630,7 @@ yyreduce:
     }
     break;
 
-  case 233:
+  case 235:
 
     {
         TIntermNode* intermNode;
@@ -4769,12 +4648,12 @@ yyreduce:
     }
     break;
 
-  case 234:
+  case 236:
 
     { context->symbolTable.push(); ++context->loopNestingLevel; }
     break;
 
-  case 235:
+  case 237:
 
     {
         context->symbolTable.pop();
@@ -4783,12 +4662,12 @@ yyreduce:
     }
     break;
 
-  case 236:
+  case 238:
 
     { ++context->loopNestingLevel; }
     break;
 
-  case 237:
+  case 239:
 
     {
         if (context->boolErrorCheck((yyvsp[(8) - (8)].lex).line, (yyvsp[(6) - (8)].interm.intermTypedNode)))
@@ -4799,12 +4678,12 @@ yyreduce:
     }
     break;
 
-  case 238:
+  case 240:
 
     { context->symbolTable.push(); ++context->loopNestingLevel; }
     break;
 
-  case 239:
+  case 241:
 
     {
         context->symbolTable.pop();
@@ -4813,35 +4692,35 @@ yyreduce:
     }
     break;
 
-  case 240:
+  case 242:
 
     {
         (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
     }
     break;
 
-  case 241:
+  case 243:
 
     {
         (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
     }
     break;
 
-  case 242:
+  case 244:
 
     {
         (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
     }
     break;
 
-  case 243:
+  case 245:
 
     {
         (yyval.interm.intermTypedNode) = 0;
     }
     break;
 
-  case 244:
+  case 246:
 
     {
         (yyval.interm.nodePair).node1 = (yyvsp[(1) - (2)].interm.intermTypedNode);
@@ -4849,7 +4728,7 @@ yyreduce:
     }
     break;
 
-  case 245:
+  case 247:
 
     {
         (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermTypedNode);
@@ -4857,7 +4736,7 @@ yyreduce:
     }
     break;
 
-  case 246:
+  case 248:
 
     {
         if (context->loopNestingLevel <= 0) {
@@ -4868,7 +4747,7 @@ yyreduce:
     }
     break;
 
-  case 247:
+  case 249:
 
     {
         if (context->loopNestingLevel <= 0) {
@@ -4879,7 +4758,7 @@ yyreduce:
     }
     break;
 
-  case 248:
+  case 250:
 
     {
         (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(1) - (2)].lex).line);
@@ -4890,7 +4769,7 @@ yyreduce:
     }
     break;
 
-  case 249:
+  case 251:
 
     {
         (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(2) - (3)].interm.intermTypedNode), (yyvsp[(1) - (3)].lex).line);
@@ -4905,7 +4784,7 @@ yyreduce:
     }
     break;
 
-  case 250:
+  case 252:
 
     {
         FRAG_ONLY("discard", (yyvsp[(1) - (2)].lex).line);
@@ -4913,7 +4792,7 @@ yyreduce:
     }
     break;
 
-  case 251:
+  case 253:
 
     {
         (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
@@ -4921,7 +4800,7 @@ yyreduce:
     }
     break;
 
-  case 252:
+  case 254:
 
     {
         (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermNode), (yyvsp[(2) - (2)].interm.intermNode), 0);
@@ -4929,21 +4808,21 @@ yyreduce:
     }
     break;
 
-  case 253:
+  case 255:
 
     {
         (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
     }
     break;
 
-  case 254:
+  case 256:
 
     {
         (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
     }
     break;
 
-  case 255:
+  case 257:
 
     {
         TFunction* function = (yyvsp[(1) - (1)].interm).function;
@@ -5032,7 +4911,7 @@ yyreduce:
     }
     break;
 
-  case 256:
+  case 258:
 
     {
         //?? Check that all paths return a value if return type != void ?
index 7a38049..de6951f 100644 (file)
@@ -31,6 +31,7 @@ enum TOperator {
     EOpParameters,      // an aggregate listing the parameters to a function
 
     EOpDeclaration,
+    EOpInvariantDeclaration, // Specialized declarations for attributing invariance
     EOpPrototype,
 
     //