Commit 407813b4 by Alexis Hetu Committed by Alexis Hétu

Parser cleanup

Ported some changes from Angle. Added 4 new functions to ParserHelper to remove some code from glslang.y. Added some extra checks regarding qualifiers and precision. Change-Id: I2856a764749bef0df500891eb4c003211e634673 Reviewed-on: https://swiftshader-review.googlesource.com/4900Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent 555f7e1a
......@@ -1751,6 +1751,237 @@ void TParseContext::parseGlobalLayoutQualifier(const TPublicType &typeQualifier)
}
}
TIntermAggregate *TParseContext::addFunctionPrototypeDeclaration(const TFunction &function, const TSourceLoc &location)
{
// Note: symbolTableFunction could be the same as function if this is the first declaration.
// Either way the instance in the symbol table is used to track whether the function is declared
// multiple times.
TFunction *symbolTableFunction =
static_cast<TFunction *>(symbolTable.find(function.getMangledName(), getShaderVersion()));
if(symbolTableFunction->hasPrototypeDeclaration() && mShaderVersion == 100)
{
// ESSL 1.00.17 section 4.2.7.
// Doesn't apply to ESSL 3.00.4: see section 4.2.3.
error(location, "duplicate function prototype declarations are not allowed", "function");
recover();
}
symbolTableFunction->setHasPrototypeDeclaration();
TIntermAggregate *prototype = new TIntermAggregate;
prototype->setType(function.getReturnType());
prototype->setName(function.getMangledName());
for(size_t i = 0; i < function.getParamCount(); i++)
{
const TParameter &param = function.getParam(i);
if(param.name != 0)
{
TVariable variable(param.name, *param.type);
TIntermSymbol *paramSymbol = intermediate.addSymbol(
variable.getUniqueId(), variable.getName(), variable.getType(), location);
prototype = intermediate.growAggregate(prototype, paramSymbol, location);
}
else
{
TIntermSymbol *paramSymbol = intermediate.addSymbol(0, "", *param.type, location);
prototype = intermediate.growAggregate(prototype, paramSymbol, location);
}
}
prototype->setOp(EOpPrototype);
symbolTable.pop();
if(!symbolTable.atGlobalLevel())
{
// ESSL 3.00.4 section 4.2.4.
error(location, "local function prototype declarations are not allowed", "function");
recover();
}
return prototype;
}
TIntermAggregate *TParseContext::addFunctionDefinition(const TFunction &function, TIntermAggregate *functionPrototype, TIntermAggregate *functionBody, const TSourceLoc &location)
{
//?? Check that all paths return a value if return type != void ?
// May be best done as post process phase on intermediate code
if(mCurrentFunctionType->getBasicType() != EbtVoid && !mFunctionReturnsValue)
{
error(location, "function does not return a value:", "", function.getName().c_str());
recover();
}
TIntermAggregate *aggregate = intermediate.growAggregate(functionPrototype, functionBody, location);
intermediate.setAggregateOperator(aggregate, EOpFunction, location);
aggregate->setName(function.getMangledName().c_str());
aggregate->setType(function.getReturnType());
// store the pragma information for debug and optimize and other vendor specific
// information. This information can be queried from the parse tree
aggregate->setOptimize(pragma().optimize);
aggregate->setDebug(pragma().debug);
if(functionBody && functionBody->getAsAggregate())
aggregate->setEndLine(functionBody->getAsAggregate()->getEndLine());
symbolTable.pop();
return aggregate;
}
void TParseContext::parseFunctionPrototype(const TSourceLoc &location, TFunction *function, TIntermAggregate **aggregateOut)
{
const TSymbol *builtIn = symbolTable.findBuiltIn(function->getMangledName(), getShaderVersion());
if(builtIn)
{
error(location, "built-in functions cannot be redefined", function->getName().c_str());
recover();
}
TFunction *prevDec = static_cast<TFunction *>(symbolTable.find(function->getMangledName(), getShaderVersion()));
//
// Note: 'prevDec' could be 'function' if this is the first time we've seen function
// as it would have just been put in the symbol table. Otherwise, we're looking up
// an earlier occurance.
//
if(prevDec->isDefined())
{
// Then this function already has a body.
error(location, "function already has a body", function->getName().c_str());
recover();
}
prevDec->setDefined();
//
// Overload the unique ID of the definition to be the same unique ID as the declaration.
// Eventually we will probably want to have only a single definition and just swap the
// arguments to be the definition's arguments.
//
function->setUniqueId(prevDec->getUniqueId());
// Raise error message if main function takes any parameters or return anything other than void
if(function->getName() == "main")
{
if(function->getParamCount() > 0)
{
error(location, "function cannot take any parameter(s)", function->getName().c_str());
recover();
}
if(function->getReturnType().getBasicType() != EbtVoid)
{
error(location, "", function->getReturnType().getBasicString(), "main function cannot return a value");
recover();
}
}
//
// Remember the return type for later checking for RETURN statements.
//
mCurrentFunctionType = &(prevDec->getReturnType());
mFunctionReturnsValue = false;
//
// Insert parameters into the symbol table.
// If the parameter has no name, it's not an error, just don't insert it
// (could be used for unused args).
//
// Also, accumulate the list of parameters into the HIL, so lower level code
// knows where to find parameters.
//
TIntermAggregate *paramNodes = new TIntermAggregate;
for(size_t i = 0; i < function->getParamCount(); i++)
{
const TParameter &param = function->getParam(i);
if(param.name != 0)
{
TVariable *variable = new TVariable(param.name, *param.type);
//
// Insert the parameters with name in the symbol table.
//
if(!symbolTable.declare(*variable))
{
error(location, "redefinition", variable->getName().c_str());
recover();
paramNodes = intermediate.growAggregate(
paramNodes, intermediate.addSymbol(0, "", *param.type, location), location);
continue;
}
//
// Add the parameter to the HIL
//
TIntermSymbol *symbol = intermediate.addSymbol(
variable->getUniqueId(), variable->getName(), variable->getType(), location);
paramNodes = intermediate.growAggregate(paramNodes, symbol, location);
}
else
{
paramNodes = intermediate.growAggregate(
paramNodes, intermediate.addSymbol(0, "", *param.type, location), location);
}
}
intermediate.setAggregateOperator(paramNodes, EOpParameters, location);
*aggregateOut = paramNodes;
setLoopNestingLevel(0);
}
TFunction *TParseContext::parseFunctionDeclarator(const TSourceLoc &location, TFunction *function)
{
//
// We don't know at this point whether this is a function definition or a prototype.
// The definition production code will check for redefinitions.
// In the case of ESSL 1.00 the prototype production code will also check for redeclarations.
//
// Return types and parameter qualifiers must match in all redeclarations, so those are checked
// here.
//
TFunction *prevDec = static_cast<TFunction *>(symbolTable.find(function->getMangledName(), getShaderVersion()));
if(prevDec)
{
if(prevDec->getReturnType() != function->getReturnType())
{
error(location, "overloaded functions must have the same return type",
function->getReturnType().getBasicString());
recover();
}
for(size_t i = 0; i < prevDec->getParamCount(); ++i)
{
if(prevDec->getParam(i).type->getQualifier() != function->getParam(i).type->getQualifier())
{
error(location, "overloaded functions must have the same parameter qualifiers",
function->getParam(i).type->getQualifierString());
recover();
}
}
}
//
// Check for previously declared variables using the same name.
//
TSymbol *prevSym = symbolTable.find(function->getName(), getShaderVersion());
if(prevSym)
{
if(!prevSym->isFunction())
{
error(location, "redefinition", function->getName().c_str(), "function");
recover();
}
}
// We're at the inner scope level of the function's arguments and body statement.
// Add the function prototype to the surrounding scope instead.
symbolTable.getOuterLevel()->insert(*function);
//
// If this is a redeclaration, it could also be a definition, in which case, we want to use the
// variable names from this one, and not the one that's
// being redeclared. So, pass back up this declaration, not the one in the symbol table.
//
return function;
}
TFunction *TParseContext::addConstructorFunc(const TPublicType &publicTypeIn)
{
TPublicType publicType = publicTypeIn;
......
......@@ -34,7 +34,7 @@ public:
lexAfterType(false),
inTypeParen(false),
AfterEOF(false),
mDeferredSingleDeclarationErrorCheck(false),
mDeferredSingleDeclarationErrorCheck(false),
mShaderType(type),
mShaderVersion(100),
mTreeRoot(0),
......@@ -43,13 +43,13 @@ public:
mStructNestingLevel(0),
mCurrentFunctionType(NULL),
mFunctionReturnsValue(false),
mChecksPrecisionErrors(checksPrecErrors),
mChecksPrecisionErrors(checksPrecErrors),
mDefaultMatrixPacking(EmpColumnMajor),
mDefaultBlockStorage(EbsShared),
mDefaultBlockStorage(EbsShared),
mDiagnostics(is),
mDirectiveHandler(ext, mDiagnostics, mShaderVersion),
mPreprocessor(&mDiagnostics, &mDirectiveHandler),
mScanner(NULL),
mScanner(NULL),
mUsesFragData(false),
mUsesFragColor(false) { }
TIntermediate& intermediate; // to hold and build a parse tree
......@@ -60,13 +60,13 @@ public:
bool inTypeParen; // true if in parentheses, looking only for an identifier
bool AfterEOF;
const pp::Preprocessor &getPreprocessor() const { return mPreprocessor; }
pp::Preprocessor &getPreprocessor() { return mPreprocessor; }
void *getScanner() const { return mScanner; }
void setScanner(void *scanner) { mScanner = scanner; }
int getShaderVersion() const { return mShaderVersion; }
GLenum getShaderType() const { return mShaderType; }
int numErrors() const { return mDiagnostics.numErrors(); }
const pp::Preprocessor &getPreprocessor() const { return mPreprocessor; }
pp::Preprocessor &getPreprocessor() { return mPreprocessor; }
void *getScanner() const { return mScanner; }
void setScanner(void *scanner) { mScanner = scanner; }
int getShaderVersion() const { return mShaderVersion; }
GLenum getShaderType() const { return mShaderType; }
int numErrors() const { return mDiagnostics.numErrors(); }
TInfoSink &infoSink() { return mDiagnostics.infoSink(); }
void error(const TSourceLoc &loc, const char *reason, const char* token,
const char* extraInfo="");
......@@ -74,30 +74,30 @@ public:
const char* extraInfo="");
void trace(const char* str);
void recover();
TIntermNode *getTreeRoot() const { return mTreeRoot; }
void setTreeRoot(TIntermNode *treeRoot) { mTreeRoot = treeRoot; }
bool getFunctionReturnsValue() const { return mFunctionReturnsValue; }
void setFunctionReturnsValue(bool functionReturnsValue)
{
mFunctionReturnsValue = functionReturnsValue;
}
void setLoopNestingLevel(int loopNestintLevel)
{
mLoopNestingLevel = loopNestintLevel;
}
const TType *getCurrentFunctionType() const { return mCurrentFunctionType; }
void setCurrentFunctionType(const TType *currentFunctionType)
{
mCurrentFunctionType = currentFunctionType;
}
void incrLoopNestingLevel() { ++mLoopNestingLevel; }
void decrLoopNestingLevel() { --mLoopNestingLevel; }
void incrSwitchNestingLevel() { ++mSwitchNestingLevel; }
TIntermNode *getTreeRoot() const { return mTreeRoot; }
void setTreeRoot(TIntermNode *treeRoot) { mTreeRoot = treeRoot; }
bool getFunctionReturnsValue() const { return mFunctionReturnsValue; }
void setFunctionReturnsValue(bool functionReturnsValue)
{
mFunctionReturnsValue = functionReturnsValue;
}
void setLoopNestingLevel(int loopNestintLevel)
{
mLoopNestingLevel = loopNestintLevel;
}
const TType *getCurrentFunctionType() const { return mCurrentFunctionType; }
void setCurrentFunctionType(const TType *currentFunctionType)
{
mCurrentFunctionType = currentFunctionType;
}
void incrLoopNestingLevel() { ++mLoopNestingLevel; }
void decrLoopNestingLevel() { --mLoopNestingLevel; }
void incrSwitchNestingLevel() { ++mSwitchNestingLevel; }
void decrSwitchNestingLevel() { --mSwitchNestingLevel; }
// This method is guaranteed to succeed, even if no variable with 'name' exists.
......@@ -179,6 +179,10 @@ public:
const TSourceLoc &initLocation, TIntermTyped *initializer);
void parseGlobalLayoutQualifier(const TPublicType &typeQualifier);
TIntermAggregate *addFunctionPrototypeDeclaration(const TFunction &function, const TSourceLoc &location);
TIntermAggregate *addFunctionDefinition(const TFunction &function, TIntermAggregate *functionPrototype, TIntermAggregate *functionBody, const TSourceLoc &location);
void parseFunctionPrototype(const TSourceLoc &location, TFunction *function, TIntermAggregate **aggregateOut);
TFunction *parseFunctionDeclarator(const TSourceLoc &location, TFunction *function);
TFunction *addConstructorFunc(const TPublicType &publicType);
TIntermTyped* addConstructor(TIntermNode*, const TType*, TOperator, TFunction*, const TSourceLoc&);
TIntermTyped* foldConstConstructor(TIntermAggregate* aggrNode, const TType& type);
......@@ -239,26 +243,26 @@ private:
// Return true if the checks pass
bool binaryOpCommonCheck(TOperator op, TIntermTyped *left, TIntermTyped *right, const TSourceLoc &loc);
// Set to true when the last/current declarator list was started with an empty declaration.
bool mDeferredSingleDeclarationErrorCheck;
GLenum mShaderType; // vertex or fragment language (future: pack or unpack)
int mShaderVersion;
TIntermNode *mTreeRoot; // root of parse tree being created
int mLoopNestingLevel; // 0 if outside all loops
int mSwitchNestingLevel; // 0 if outside all switch statements
int mStructNestingLevel; // incremented while parsing a struct declaration
const TType *mCurrentFunctionType; // the return type of the function that's currently being parsed
bool mFunctionReturnsValue; // true if a non-void function has a return
bool mChecksPrecisionErrors; // true if an error will be generated when a variable is declared without precision, explicit or implicit.
TLayoutMatrixPacking mDefaultMatrixPacking;
TLayoutBlockStorage mDefaultBlockStorage;
TDiagnostics mDiagnostics;
TDirectiveHandler mDirectiveHandler;
pp::Preprocessor mPreprocessor;
void *mScanner;
bool mUsesFragData; // track if we are using both gl_FragData and gl_FragColor
// Set to true when the last/current declarator list was started with an empty declaration.
bool mDeferredSingleDeclarationErrorCheck;
GLenum mShaderType; // vertex or fragment language (future: pack or unpack)
int mShaderVersion;
TIntermNode *mTreeRoot; // root of parse tree being created
int mLoopNestingLevel; // 0 if outside all loops
int mSwitchNestingLevel; // 0 if outside all switch statements
int mStructNestingLevel; // incremented while parsing a struct declaration
const TType *mCurrentFunctionType; // the return type of the function that's currently being parsed
bool mFunctionReturnsValue; // true if a non-void function has a return
bool mChecksPrecisionErrors; // true if an error will be generated when a variable is declared without precision, explicit or implicit.
TLayoutMatrixPacking mDefaultMatrixPacking;
TLayoutBlockStorage mDefaultBlockStorage;
TDiagnostics mDiagnostics;
TDirectiveHandler mDirectiveHandler;
pp::Preprocessor mPreprocessor;
void *mScanner;
bool mUsesFragData; // track if we are using both gl_FragData and gl_FragColor
bool mUsesFragColor;
};
......
......@@ -134,14 +134,16 @@ public:
TSymbol(0),
returnType(TType(EbtVoid, EbpUndefined)),
op(o),
defined(false) { }
TFunction(const TString *name, TType& retType, TOperator tOp = EOpNull, const char *ext = "") :
defined(false),
prototypeDeclaration(false) { }
TFunction(const TString *name, const TType& retType, TOperator tOp = EOpNull, const char *ext = "") :
TSymbol(name),
returnType(retType),
mangledName(TFunction::mangleName(*name)),
op(tOp),
extension(ext),
defined(false) { }
defined(false),
prototypeDeclaration(false) { }
virtual ~TFunction();
virtual bool isFunction() const { return true; }
......@@ -165,6 +167,8 @@ public:
void setDefined() { defined = true; }
bool isDefined() { return defined; }
void setHasPrototypeDeclaration() { prototypeDeclaration = true; }
bool hasPrototypeDeclaration() const { return prototypeDeclaration; }
size_t getParamCount() const { return parameters.size(); }
const TParameter& getParam(int i) const { return parameters[i]; }
......@@ -177,6 +181,7 @@ protected:
TOperator op;
TString extension;
bool defined;
bool prototypeDeclaration;
};
......
......@@ -88,21 +88,21 @@ WHICH GENERATES THE GLSL ES PARSER (glslang_tab.cpp AND glslang_tab.h).
extern int yylex(YYSTYPE* yylval, YYLTYPE* yylloc, void* yyscanner);
extern void yyerror(YYLTYPE* lloc, TParseContext* context, void* scanner, const char* reason);
#define YYLLOC_DEFAULT(Current, Rhs, N) \
do { \
if (N) { \
(Current).first_file = YYRHSLOC(Rhs, 1).first_file; \
(Current).first_line = YYRHSLOC(Rhs, 1).first_line; \
(Current).last_file = YYRHSLOC(Rhs, N).last_file; \
(Current).last_line = YYRHSLOC(Rhs, N).last_line; \
} \
else { \
(Current).first_file = YYRHSLOC(Rhs, 0).last_file; \
(Current).first_line = YYRHSLOC(Rhs, 0).last_line; \
(Current).last_file = YYRHSLOC(Rhs, 0).last_file; \
(Current).last_line = YYRHSLOC(Rhs, 0).last_line; \
} \
} while (0)
#define YYLLOC_DEFAULT(Current, Rhs, N) \
do { \
if (N) { \
(Current).first_file = YYRHSLOC(Rhs, 1).first_file; \
(Current).first_line = YYRHSLOC(Rhs, 1).first_line; \
(Current).last_file = YYRHSLOC(Rhs, N).last_file; \
(Current).last_line = YYRHSLOC(Rhs, N).last_line; \
} \
else { \
(Current).first_file = YYRHSLOC(Rhs, 0).last_file; \
(Current).first_line = YYRHSLOC(Rhs, 0).last_line; \
(Current).last_file = YYRHSLOC(Rhs, 0).last_file; \
(Current).last_line = YYRHSLOC(Rhs, 0).last_line; \
} \
} while (0)
#define FRAG_VERT_ONLY(S, L) { \
if (context->getShaderType() != GL_FRAGMENT_SHADER && \
......@@ -179,10 +179,10 @@ extern void yyerror(YYLTYPE* lloc, TParseContext* context, void* scanner, const
%type <interm.intermNode> translation_unit function_definition
%type <interm.intermNode> statement simple_statement
%type <interm.intermAggregate> statement_list compound_statement
%type <interm.intermAggregate> statement_list compound_statement compound_statement_no_new_scope
%type <interm.intermNode> declaration_statement selection_statement expression_statement
%type <interm.intermNode> declaration external_declaration
%type <interm.intermNode> for_init_statement compound_statement_no_new_scope
%type <interm.intermNode> for_init_statement
%type <interm.nodePair> selection_rest_statement for_rest_statement
%type <interm.intermSwitch> switch_statement
%type <interm.intermCase> case_label
......@@ -212,7 +212,7 @@ extern void yyerror(YYLTYPE* lloc, TParseContext* context, void* scanner, const
variable_identifier
: IDENTIFIER {
// The symbol table search was done in the lexical phase
const TVariable *variable = context->getNamedVariable(@1, $1.string, $1.symbol);
const TVariable *variable = context->getNamedVariable(@1, $1.string, $1.symbol);
// don't delete $1.string, it's used by error recovery, and the pool
// pop will reclaim the memory
......@@ -380,14 +380,14 @@ unary_expression
$$ = $1;
}
| INC_OP unary_expression {
$$ = context->addUnaryMathLValue(EOpPreIncrement, $2, @1);
$$ = context->addUnaryMathLValue(EOpPreIncrement, $2, @1);
}
| DEC_OP unary_expression {
$$ = context->addUnaryMathLValue(EOpPreDecrement, $2, @1);
$$ = context->addUnaryMathLValue(EOpPreDecrement, $2, @1);
}
| unary_operator unary_expression {
if ($1.op != EOpNull) {
$$ = context->addUnaryMath($1.op, $2, @1);
$$ = context->addUnaryMath($1.op, $2, @1);
} else
$$ = $2;
}
......@@ -395,12 +395,12 @@ unary_expression
// Grammar Note: No traditional style type casts.
unary_operator
: PLUS { $$.op = EOpNull; }
| DASH { $$.op = EOpNegative; }
| BANG { $$.op = EOpLogicalNot; }
: PLUS { $$.op = EOpNull; }
| DASH { $$.op = EOpNegative; }
| BANG { $$.op = EOpLogicalNot; }
| TILDE {
ES3_ONLY("~", @1, "bit-wise operator");
$$.op = EOpBitwiseNot;
$$.op = EOpBitwiseNot;
}
;
// Grammar Note: No '*' or '&' unary ops. Pointers are not supported.
......@@ -532,28 +532,28 @@ assignment_expression
;
assignment_operator
: EQUAL { $$.op = EOpAssign; }
| MUL_ASSIGN { FRAG_VERT_ONLY("*=", @1); $$.op = EOpMulAssign; }
| DIV_ASSIGN { FRAG_VERT_ONLY("/=", @1); $$.op = EOpDivAssign; }
: EQUAL { $$.op = EOpAssign; }
| MUL_ASSIGN { FRAG_VERT_ONLY("*=", @1); $$.op = EOpMulAssign; }
| DIV_ASSIGN { FRAG_VERT_ONLY("/=", @1); $$.op = EOpDivAssign; }
| MOD_ASSIGN { ES3_ONLY("%=", @1, "integer modulus operator");
FRAG_VERT_ONLY("%=", @1); $$.op = EOpIModAssign; }
| ADD_ASSIGN { $$.op = EOpAddAssign; }
| SUB_ASSIGN { $$.op = EOpSubAssign; }
FRAG_VERT_ONLY("%=", @1); $$.op = EOpIModAssign; }
| ADD_ASSIGN { $$.op = EOpAddAssign; }
| SUB_ASSIGN { $$.op = EOpSubAssign; }
| LEFT_ASSIGN { ES3_ONLY("<<=", @1, "bit-wise operator");
FRAG_VERT_ONLY("<<=", @1);
$$.op = EOpBitShiftLeftAssign; }
FRAG_VERT_ONLY("<<=", @1);
$$.op = EOpBitShiftLeftAssign; }
| RIGHT_ASSIGN { ES3_ONLY(">>=", @1, "bit-wise operator");
FRAG_VERT_ONLY(">>=", @1);
$$.op = EOpBitShiftRightAssign; }
FRAG_VERT_ONLY(">>=", @1);
$$.op = EOpBitShiftRightAssign; }
| AND_ASSIGN { ES3_ONLY("&=", @1, "bit-wise operator");
FRAG_VERT_ONLY("&=", @1);
$$.op = EOpBitwiseAndAssign; }
FRAG_VERT_ONLY("&=", @1);
$$.op = EOpBitwiseAndAssign; }
| XOR_ASSIGN { ES3_ONLY("^=", @1, "bit-wise operator");
FRAG_VERT_ONLY("^=", @1);
$$.op = EOpBitwiseXorAssign; }
FRAG_VERT_ONLY("^=", @1);
$$.op = EOpBitwiseXorAssign; }
| OR_ASSIGN { ES3_ONLY("|=", @1, "bit-wise operator");
FRAG_VERT_ONLY("|=", @1);
$$.op = EOpBitwiseOrAssign; }
FRAG_VERT_ONLY("|=", @1);
$$.op = EOpBitwiseOrAssign; }
;
expression
......@@ -587,32 +587,8 @@ enter_struct
;
declaration
: function_prototype SEMICOLON {
TFunction &function = *($1.function);
TIntermAggregate *prototype = new TIntermAggregate;
prototype->setType(function.getReturnType());
prototype->setName(function.getName());
for (size_t i = 0; i < function.getParamCount(); i++)
{
const TParameter &param = function.getParam(i);
if (param.name != 0)
{
TVariable variable(param.name, *param.type);
prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(variable.getUniqueId(), variable.getName(), variable.getType(), @1), @1);
}
else
{
prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(0, "", *param.type, @1), @1);
}
}
prototype->setOp(EOpPrototype);
$$ = prototype;
context->symbolTable.pop();
: function_prototype SEMICOLON {
$$ = context->addFunctionPrototypeDeclaration(*($1.function), @1);
}
| init_declarator_list SEMICOLON {
TIntermAggregate *aggNode = $1.intermAggregate;
......@@ -647,38 +623,7 @@ declaration
function_prototype
: function_declarator RIGHT_PAREN {
//
// Multiple declarations of the same function are allowed.
//
// If this is a definition, the definition production code will check for redefinitions
// (we don't know at this point if it's a definition or not).
//
// Redeclarations are allowed. But, return types and parameter qualifiers must match.
//
TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find($1->getMangledName(), context->getShaderVersion()));
if (prevDec) {
if (prevDec->getReturnType() != $1->getReturnType()) {
context->error(@2, "overloaded functions must have the same return type", $1->getReturnType().getBasicString());
context->recover();
}
for (size_t i = 0; i < prevDec->getParamCount(); ++i) {
if (prevDec->getParam(i).type->getQualifier() != $1->getParam(i).type->getQualifier()) {
context->error(@2, "overloaded functions must have the same parameter qualifiers", $1->getParam(i).type->getQualifierString());
context->recover();
}
}
}
//
// If this is a redeclaration, it could also be a definition,
// in which case, we want to use the variable names from this one, and not the one that's
// being redeclared. So, pass back up this declaration, not the one in the symbol table.
//
$$.function = $1;
// We're at the inner scope level of the function's arguments and body statement.
// Add the function prototype to the surrounding scope instead.
context->symbolTable.getOuterLevel()->insert(*$$.function);
$$.function = context->parseFunctionDeclarator(@2, $1);
}
;
......@@ -727,8 +672,13 @@ function_header
context->error(@2, "no qualifiers allowed for function return", getQualifierString($1.qualifier));
context->recover();
}
if (!$1.layoutQualifier.isEmpty())
{
context->error(@2, "no qualifiers allowed for function return", "layout");
context->recover();
}
// make sure a sampler is not involved as well...
if (context->structQualifierErrorCheck(@2, $1))
if (context->samplerErrorCheck(@2, $1, "samplers can't be function return values"))
context->recover();
// Add the function as a prototype after parsing it (we do not support recursion)
......@@ -950,7 +900,12 @@ type_qualifier
else
$$.setBasic(EbtVoid, EvqInvariantVaryingIn, @1);
}
| storage_qualifier {
| storage_qualifier {
if ($1.qualifier != EvqConstExpr && !context->symbolTable.atGlobalLevel())
{
context->error(@1, "Local variables can only use the const storage qualifier.", getQualifierString($1.qualifier));
context->recover();
}
$$.setBasic(EbtVoid, $1.qualifier, @1);
}
| interpolation_qualifier storage_qualifier {
......@@ -1013,7 +968,7 @@ storage_qualifier
}
$$.qualifier = (context->getShaderType() == GL_FRAGMENT_SHADER) ? EvqFragmentOut : EvqCentroidOut;
}
| UNIFORM {
| UNIFORM {
if (context->globalErrorCheck(@1, context->symbolTable.atGlobalLevel(), "uniform"))
context->recover();
$$.qualifier = EvqUniform;
......@@ -1034,6 +989,11 @@ type_specifier
| precision_qualifier type_specifier_no_prec {
$$ = $2;
$$.precision = $1;
if (!SupportsPrecision($2.type)) {
context->error(@1, "illegal type for precision qualifier", getBasicString($2.type));
context->recover();
}
}
;
......@@ -1421,7 +1381,7 @@ statement
| simple_statement { $$ = $1; }
;
// Grammar Note: No labeled statements; 'goto' is not supported.
// Grammar Note: Labeled statements for SWITCH only; 'goto' is not supported.
simple_statement
: declaration_statement { $$ = $1; }
......@@ -1470,10 +1430,10 @@ compound_statement_no_new_scope
statement_list
: statement {
$$ = context->intermediate.makeAggregate($1, @$);
$$ = context->intermediate.makeAggregate($1, @$);
}
| statement_list statement {
$$ = context->intermediate.growAggregate($1, $2, @$);
$$ = context->intermediate.growAggregate($1, $2, @$);
}
;
......@@ -1517,8 +1477,6 @@ case_label
}
;
// Grammar Note: Labeled statements for SWITCH only; 'goto' is not supported.
condition
// In 1996 c++ draft, conditions can include single declarations
: expression {
......@@ -1527,9 +1485,7 @@ condition
context->recover();
}
| fully_specified_type IDENTIFIER EQUAL initializer {
TIntermNode* intermNode;
if (context->structQualifierErrorCheck(@2, $1))
context->recover();
TIntermNode *intermNode;
if (context->boolErrorCheck(@2, $1))
context->recover();
......@@ -1618,7 +1574,7 @@ translation_unit
context->setTreeRoot($$);
}
| translation_unit external_declaration {
$$ = context->intermediate.growAggregate($1, $2, @$);
$$ = context->intermediate.growAggregate($1, $2, @$);
context->setTreeRoot($$);
}
;
......@@ -1634,112 +1590,10 @@ external_declaration
function_definition
: function_prototype {
TFunction* function = $1.function;
const TSymbol *builtIn = context->symbolTable.findBuiltIn(function->getMangledName(), context->getShaderVersion());
if (builtIn)
{
context->error(@1, "built-in functions cannot be redefined", function->getName().c_str());
context->recover();
}
TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find(function->getMangledName(), context->getShaderVersion()));
//
// Note: 'prevDec' could be 'function' if this is the first time we've seen function
// as it would have just been put in the symbol table. Otherwise, we're looking up
// an earlier occurance.
//
if (prevDec->isDefined()) {
//
// Then this function already has a body.
//
context->error(@1, "function already has a body", function->getName().c_str());
context->recover();
}
prevDec->setDefined();
//
// Raise error message if main function takes any parameters or return anything other than void
//
if (function->getName() == "main") {
if (function->getParamCount() > 0) {
context->error(@1, "function cannot take any parameter(s)", function->getName().c_str());
context->recover();
}
if (function->getReturnType().getBasicType() != EbtVoid) {
context->error(@1, "", function->getReturnType().getBasicString(), "main function cannot return a value");
context->recover();
}
}
//
// Remember the return type for later checking for RETURN statements.
//
context->setCurrentFunctionType(&(prevDec->getReturnType()));
context->setFunctionReturnsValue(false);
//
// Insert parameters into the symbol table.
// If the parameter has no name, it's not an error, just don't insert it
// (could be used for unused args).
//
// Also, accumulate the list of parameters into the HIL, so lower level code
// knows where to find parameters.
//
TIntermAggregate* paramNodes = new TIntermAggregate;
for (size_t i = 0; i < function->getParamCount(); i++) {
const TParameter& param = function->getParam(i);
if (param.name != 0) {
TVariable *variable = new TVariable(param.name, *param.type);
//
// Insert the parameters with name in the symbol table.
//
if (! context->symbolTable.declare(*variable)) {
context->error(@1, "redefinition", variable->getName().c_str());
context->recover();
delete variable;
}
//
// Add the parameter to the HIL
//
paramNodes = context->intermediate.growAggregate(
paramNodes,
context->intermediate.addSymbol(variable->getUniqueId(),
variable->getName(),
variable->getType(), @1),
@1);
} else {
paramNodes = context->intermediate.growAggregate(paramNodes, context->intermediate.addSymbol(0, "", *param.type, @1), @1);
}
}
context->intermediate.setAggregateOperator(paramNodes, EOpParameters, @1);
$1.intermAggregate = paramNodes;
context->setLoopNestingLevel(0);
}
compound_statement {
//?? Check that all paths return a value if return type != void ?
// May be best done as post process phase on intermediate code
if (context->getCurrentFunctionType()->getBasicType() != EbtVoid && ! context->getFunctionReturnsValue()) {
context->error(@1, "function does not return a value:", "", $1.function->getName().c_str());
context->recover();
}
$$ = context->intermediate.growAggregate($1.intermAggregate, $3, @$);
context->intermediate.setAggregateOperator($$, EOpFunction, @1);
$$->getAsAggregate()->setName($1.function->getMangledName().c_str());
$$->getAsAggregate()->setType($1.function->getReturnType());
// store the pragma information for debug and optimize and other vendor specific
// information. This information can be queried from the parse tree
$$->getAsAggregate()->setOptimize(context->pragma().optimize);
$$->getAsAggregate()->setDebug(context->pragma().debug);
if ($3 && $3->getAsAggregate())
$$->getAsAggregate()->setEndLine($3->getAsAggregate()->getEndLine());
context->symbolTable.pop();
context->parseFunctionPrototype(@1, $1.function, &$1.intermAggregate);
}
compound_statement_no_new_scope {
$$ = context->addFunctionDefinition(*($1.function), $1.intermAggregate, $3, @1);
}
;
......
......@@ -628,7 +628,7 @@ union yyalloc
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 112
/* YYLAST -- Last index in YYTABLE. */
#define YYLAST 2513
#define YYLAST 2525
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 128
......@@ -704,26 +704,26 @@ static const yytype_uint16 yyrline[] =
455, 458, 464, 465, 468, 474, 475, 482, 483, 490,
491, 498, 499, 505, 506, 512, 513, 519, 520, 526,
527, 535, 536, 537, 538, 540, 541, 542, 545, 548,
551, 554, 560, 563, 574, 582, 590, 617, 623, 630,
634, 638, 642, 649, 686, 689, 696, 704, 725, 746,
756, 784, 789, 799, 804, 814, 817, 820, 823, 829,
836, 839, 843, 847, 852, 857, 864, 868, 872, 876,
881, 886, 890, 897, 907, 913, 916, 922, 928, 935,
944, 953, 956, 959, 966, 970, 974, 979, 987, 990,
994, 998, 1007, 1016, 1024, 1034, 1041, 1044, 1047, 1053,
1060, 1063, 1069, 1072, 1075, 1081, 1084, 1089, 1104, 1108,
1112, 1116, 1120, 1124, 1129, 1134, 1139, 1144, 1149, 1154,
1159, 1164, 1169, 1174, 1179, 1184, 1190, 1196, 1202, 1208,
1214, 1220, 1226, 1232, 1238, 1243, 1248, 1257, 1262, 1267,
1272, 1277, 1282, 1287, 1292, 1297, 1302, 1307, 1312, 1317,
1322, 1327, 1340, 1340, 1343, 1343, 1349, 1352, 1368, 1371,
1380, 1384, 1390, 1397, 1412, 1416, 1420, 1421, 1427, 1428,
1429, 1430, 1431, 1432, 1433, 1437, 1438, 1438, 1438, 1448,
1449, 1453, 1453, 1454, 1454, 1459, 1462, 1472, 1475, 1481,
1482, 1486, 1494, 1498, 1505, 1505, 1512, 1515, 1524, 1529,
1546, 1546, 1551, 1551, 1558, 1558, 1566, 1569, 1575, 1578,
1584, 1588, 1595, 1598, 1601, 1604, 1607, 1616, 1620, 1627,
1630, 1636, 1636
551, 554, 560, 563, 574, 582, 590, 593, 599, 606,
610, 614, 618, 625, 631, 634, 641, 649, 670, 696,
706, 734, 739, 749, 754, 764, 767, 770, 773, 779,
786, 789, 793, 797, 802, 807, 814, 818, 822, 826,
831, 836, 840, 847, 857, 863, 866, 872, 878, 885,
894, 903, 911, 914, 921, 925, 929, 934, 942, 945,
949, 953, 962, 971, 979, 989, 1001, 1004, 1007, 1013,
1020, 1023, 1029, 1032, 1035, 1041, 1044, 1049, 1064, 1068,
1072, 1076, 1080, 1084, 1089, 1094, 1099, 1104, 1109, 1114,
1119, 1124, 1129, 1134, 1139, 1144, 1150, 1156, 1162, 1168,
1174, 1180, 1186, 1192, 1198, 1203, 1208, 1217, 1222, 1227,
1232, 1237, 1242, 1247, 1252, 1257, 1262, 1267, 1272, 1277,
1282, 1287, 1300, 1300, 1303, 1303, 1309, 1312, 1328, 1331,
1340, 1344, 1350, 1357, 1372, 1376, 1380, 1381, 1387, 1388,
1389, 1390, 1391, 1392, 1393, 1397, 1398, 1398, 1398, 1408,
1409, 1413, 1413, 1414, 1414, 1419, 1422, 1432, 1435, 1441,
1442, 1446, 1454, 1458, 1465, 1465, 1472, 1475, 1482, 1487,
1502, 1502, 1507, 1507, 1514, 1514, 1522, 1525, 1531, 1534,
1540, 1544, 1551, 1554, 1557, 1560, 1563, 1572, 1576, 1583,
1586, 1592, 1592
};
#endif
......@@ -812,10 +812,10 @@ static const yytype_uint16 yytoknum[] =
};
# endif
#define YYPACT_NINF -355
#define YYPACT_NINF -334
#define yypact_value_is_default(Yystate) \
(!!((Yystate) == (-355)))
(!!((Yystate) == (-334)))
#define YYTABLE_NINF -232
......@@ -826,48 +826,48 @@ static const yytype_uint16 yytoknum[] =
STATE-NUM. */
static const yytype_int16 yypact[] =
{
2151, 207, -355, -355, -355, 168, -355, -355, -355, -355,
-355, -355, -355, -355, -355, -355, -355, -355, -355, -355,
-355, -355, -355, -355, -355, -355, -355, -355, -355, -355,
-355, -355, -355, -355, -355, -355, -355, -3, -355, -355,
-56, -355, -355, -355, -355, -355, -355, -355, -355, -355,
-355, -355, -355, -355, -355, -355, -355, -355, -61, -355,
-355, -39, -18, -5, 4, -57, -355, 37, 10, 1170,
-355, -355, 2436, 10, -355, 22, -355, 2076, -355, -355,
-355, -355, 10, -355, 2436, -355, -355, 27, -355, 69,
-355, 41, -355, 61, -355, -355, -355, -355, -355, 2300,
136, 76, -355, -78, -355, 47, -355, 2226, -355, -355,
-355, 1240, -355, -355, -355, 1, -355, 2226, 44, -63,
-355, 50, -355, -355, -355, -355, 137, 2300, -79, -355,
1338, 1629, -355, 226, 2300, 138, 1821, -355, 113, -355,
-355, -355, -355, -355, 1629, 1629, 1629, -355, -355, -355,
-355, -355, -355, -355, 38, -355, -355, -355, 115, -23,
1724, 114, -355, 1629, 68, -45, 13, -58, 36, 96,
98, 101, 135, 139, -71, -355, 121, -355, -355, 2226,
1906, 83, -355, 69, -355, 630, 123, -355, -355, 1436,
1629, 117, 124, 190, -355, -355, -355, 138, 130, 7,
-355, -54, -355, -355, -355, -355, -13, -355, -355, 1629,
2368, -355, -355, 1629, 133, -355, -355, -355, 1629, 1629,
1629, 1629, 1629, 1629, 1629, 1629, 1629, 1629, 1629, 1629,
1629, 1629, 1629, 1629, 1629, 1629, 1629, 1629, -355, 1991,
-355, -355, -355, -355, 126, 127, -355, 140, 141, 142,
1534, 145, 1629, 143, 148, -355, 29, -355, -39, 149,
-355, -355, -355, -355, 630, -355, -355, -355, -355, -355,
-355, 1629, 150, 147, -355, 1629, 155, -355, -355, -355,
-355, -355, -355, -355, -355, -355, -355, -355, 1629, 39,
1629, 138, -355, -73, -355, -355, 1629, 164, 151, -355,
169, -355, -355, -355, -355, -355, 68, 68, -45, -45,
13, 13, 13, 13, -58, -58, 36, 96, 98, 101,
135, 139, 55, -355, -355, -355, 166, -355, 1629, -355,
-355, 40, 1629, 160, -355, -355, -355, -355, 171, 174,
1629, 181, -355, 1629, -355, -355, 175, -355, 1629, -355,
-355, -355, 1629, 239, 188, 862, 978, -11, -355, -1,
-355, 1075, -355, -355, -355, 1629, -355, -355, 191, -355,
193, 398, -355, -355, -355, -355, 1075, 166, -355, 151,
223, 2300, 195, -355, 187, 1629, -355, 514, -355, 192,
197, 288, -355, 41, 194, 746, -355, 11, -355, 1629,
746, 166, -355, 1629, -355, -355, -355, 196, 151, -355,
-355, -355, -355
2163, 10, -334, -334, -334, 169, -334, -334, -334, -334,
-334, -334, -334, -334, -334, -334, -334, -334, -334, -334,
-334, -334, -334, -334, -334, -334, -334, -334, -334, -334,
-334, -334, -334, -334, -334, -334, -334, 69, -334, -334,
-48, -334, -334, -334, -334, -334, -334, -334, -334, -334,
-334, -334, -334, -334, -334, -334, -334, -334, -82, -334,
-334, -78, -73, -71, 1, -59, -334, -32, 113, 1182,
-334, -334, 2448, 113, -334, -23, -334, 2088, -334, -334,
-334, -334, 113, -334, 2448, -334, -334, 11, -334, 9,
-334, 20, -334, 121, -334, -334, -334, -334, -334, 2312,
150, 22, -334, -79, -334, 37, -334, 2238, -334, -334,
-334, 1252, -334, -334, -334, 62, -334, 2238, 44, -41,
-334, 410, -334, -334, -334, -334, 105, 2312, -76, -334,
1350, 1641, -334, 107, 2312, 117, 1833, -334, 91, -334,
-334, -334, -334, -334, 1641, 1641, 1641, -334, -334, -334,
-334, -334, -334, -334, 19, -334, -334, -334, 103, -24,
1736, 120, -334, 1641, 80, -42, -36, 15, 43, 99,
108, 104, 141, 142, -69, -334, 127, -334, -334, 2238,
1918, 87, -334, 9, 122, 124, -334, 135, 136, 129,
1448, 140, 1641, 133, 143, 137, -334, -334, 118, -334,
-334, 12, -334, -78, 145, -334, -334, -334, -334, 526,
-334, -334, -334, -334, -334, -334, 144, -334, -334, 1543,
1641, 138, 148, -334, -334, 117, 146, 28, -334, -58,
-334, -334, -334, -15, -334, -334, 1641, 2380, -334, -334,
1641, 154, -334, -334, -334, 1641, 1641, 1641, 1641, 1641,
1641, 1641, 1641, 1641, 1641, 1641, 1641, 1641, 1641, 1641,
1641, 1641, 1641, 1641, 1641, -334, 2003, -334, -334, -334,
-334, -334, -334, 152, -334, 1641, -334, -334, 41, 1641,
149, -334, -334, -334, 642, -334, -334, -334, -334, -334,
-334, -334, -334, -334, -334, -334, 1641, 1641, -334, -334,
-334, 1641, 151, 155, -334, 1641, 157, 57, 1641, 117,
-334, -85, -334, -334, 156, 160, -334, 161, -334, -334,
-334, -334, -334, 80, 80, -42, -42, -36, -36, -36,
-36, 15, 15, 43, 99, 108, 104, 141, 142, 72,
-334, 211, 20, 874, 990, -10, -334, 3, -334, 1087,
642, -334, -334, 165, 1641, 163, -334, 1641, -334, 166,
-334, 1641, -334, -334, 1641, 164, -334, -334, -334, -334,
1087, 152, -334, 160, 198, 2312, 172, 170, -334, -334,
1641, -334, -334, 171, -334, 1641, -334, 167, 175, 265,
-334, 178, 174, 758, -334, -334, 176, 13, 1641, 758,
152, -334, 1641, -334, -334, -334, -334, 177, 160, -334,
-334, -334, -334
};
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
......@@ -887,65 +887,65 @@ static const yytype_uint16 yydefact[] =
86, 0, 93, 105, 127, 106, 107, 108, 96, 0,
105, 0, 87, 117, 132, 0, 92, 0, 124, 145,
135, 0, 1, 268, 137, 0, 202, 0, 152, 0,
150, 226, 272, 97, 102, 104, 109, 0, 111, 98,
150, 0, 272, 97, 102, 104, 109, 0, 111, 98,
0, 0, 85, 0, 0, 0, 0, 206, 2, 6,
4, 5, 7, 28, 0, 0, 0, 156, 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, 88, 0,
0, 0, 149, 0, 225, 0, 99, 101, 103, 0,
0, 0, 0, 37, 69, 214, 121, 0, 212, 0,
210, 0, 207, 30, 31, 82, 0, 13, 14, 0,
0, 20, 19, 0, 158, 23, 25, 32, 0, 0,
0, 0, 149, 0, 0, 0, 252, 0, 0, 0,
0, 0, 0, 0, 0, 226, 235, 239, 37, 69,
82, 0, 215, 0, 144, 218, 237, 217, 216, 0,
219, 220, 221, 222, 223, 224, 99, 101, 103, 0,
0, 0, 0, 214, 121, 0, 212, 0, 210, 0,
207, 30, 31, 0, 13, 14, 0, 0, 20, 19,
0, 158, 23, 25, 32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 157, 0,
205, 153, 154, 151, 0, 0, 252, 0, 0, 0,
0, 0, 0, 0, 0, 239, 0, 215, 0, 144,
218, 237, 217, 216, 227, 219, 220, 221, 222, 223,
224, 0, 0, 0, 115, 0, 118, 72, 73, 75,
74, 77, 78, 79, 80, 81, 76, 71, 0, 0,
0, 0, 208, 0, 89, 8, 0, 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, 203, 263, 262, 233, 254, 0, 266,
264, 0, 0, 0, 247, 250, 240, 238, 0, 0,
0, 112, 119, 0, 70, 209, 0, 211, 0, 90,
83, 10, 0, 0, 0, 0, 0, 0, 265, 0,
246, 0, 228, 100, 113, 0, 120, 213, 0, 68,
0, 0, 232, 234, 257, 256, 259, 233, 244, 248,
0, 0, 0, 114, 0, 0, 235, 0, 258, 0,
0, 243, 241, 0, 0, 0, 91, 0, 236, 260,
0, 233, 245, 0, 230, 251, 229, 0, 261, 255,
0, 0, 0, 0, 0, 157, 0, 205, 153, 154,
151, 263, 262, 233, 254, 0, 266, 264, 0, 0,
0, 247, 250, 225, 0, 72, 73, 75, 74, 77,
78, 79, 80, 81, 76, 71, 0, 0, 240, 236,
238, 0, 0, 0, 115, 0, 118, 0, 0, 0,
208, 0, 89, 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,
203, 0, 0, 0, 0, 0, 265, 0, 246, 0,
227, 70, 83, 0, 0, 112, 119, 0, 209, 0,
211, 0, 90, 10, 0, 0, 232, 234, 257, 256,
259, 233, 244, 248, 0, 0, 0, 0, 100, 113,
0, 120, 213, 0, 68, 0, 258, 0, 0, 243,
241, 0, 0, 0, 228, 114, 0, 0, 260, 0,
233, 245, 0, 230, 251, 229, 91, 0, 261, 255,
242, 249, 253
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int16 yypgoto[] =
{
-355, -355, -355, -355, -355, -355, -355, 99, -355, -355,
-355, -355, -25, -355, -52, -42, -95, -38, 77, 79,
81, 78, 80, 82, -355, -106, -128, -355, -142, -115,
-355, 12, 14, -355, -355, -355, 189, 224, 219, 198,
-355, -355, -336, 9, -355, -100, 8, -68, 315, -355,
-355, 144, 0, -355, -355, -355, -355, -101, -125, 125,
30, -182, -32, -258, -337, -89, -355, -355, -74, -354,
-355, -355, -26, -41, -27, -355, -355, -355, -355, -355,
-44, -355, -355, -355, -355, -355, -355, -355, -355, -355,
254, -355, -355
-334, -334, -334, -334, -334, -334, -334, 46, -334, -334,
-334, -334, 66, -334, -46, -44, -67, -34, 30, 33,
29, 32, 34, 31, -334, -104, -127, -334, -144, -119,
-334, 14, 17, -334, -334, -334, 168, 204, 199, 173,
-334, -334, -325, 8, -334, -101, 7, -68, 293, -334,
-334, 119, 0, -334, -334, -334, -334, -97, -123, 76,
-6, -208, -40, -206, -328, -83, -334, -334, -94, -333,
-334, -334, -86, 25, -38, -334, -334, -334, -334, -334,
-60, -334, -334, -334, -334, -334, -334, -334, -334, -334,
253, -334, -334
};
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int16 yydefgoto[] =
{
-1, 152, 153, 154, 297, 155, 156, 157, 158, 159,
160, 161, 193, 163, 164, 165, 166, 167, 168, 169,
170, 171, 172, 173, 174, 194, 205, 288, 256, 176,
107, 257, 258, 62, 63, 64, 124, 98, 99, 125,
-1, 152, 153, 154, 314, 155, 156, 157, 158, 159,
160, 161, 198, 163, 164, 165, 166, 167, 168, 169,
170, 171, 172, 173, 174, 199, 200, 296, 201, 176,
107, 202, 203, 62, 63, 64, 124, 98, 99, 125,
65, 66, 67, 68, 100, 69, 70, 71, 72, 73,
119, 120, 177, 75, 76, 179, 117, 136, 137, 199,
200, 196, 260, 261, 262, 263, 185, 338, 405, 353,
354, 355, 406, 264, 265, 266, 392, 267, 393, 268,
382, 269, 361, 326, 356, 376, 389, 390, 270, 77,
119, 120, 177, 75, 76, 179, 117, 136, 137, 227,
228, 224, 205, 206, 207, 208, 284, 377, 404, 341,
342, 343, 405, 209, 210, 211, 390, 212, 391, 213,
376, 214, 349, 273, 344, 370, 387, 388, 215, 77,
78, 79, 91
};
......@@ -954,141 +954,152 @@ static const yytype_int16 yydefgoto[] =
number is the opposite. If YYTABLE_NINF, syntax error. */
static const yytype_int16 yytable[] =
{
74, 108, 122, 195, 206, 175, 337, 134, 274, 83,
82, 202, 60, 94, 61, 192, 180, 134, 373, 7,
87, 236, 293, 391, 175, 380, 129, 189, 130, 225,
226, 126, 215, 348, 190, 131, 134, 85, 86, 135,
380, 349, 182, 89, 95, 96, 97, 410, 183, 135,
27, 28, 88, 29, 101, 202, 237, 102, 404, 126,
294, 37, 195, 404, 227, 228, 197, 298, 135, 74,
94, 221, 109, 222, 273, 90, 104, 74, 239, 134,
134, 110, 212, 175, 115, 302, 162, 92, 213, 60,
114, 61, 295, 342, 377, 322, 223, 224, 296, 74,
296, 95, 96, 97, 378, 162, 93, 74, 331, -94,
296, 135, 135, 103, 202, 178, 407, 74, 291, 203,
204, 292, 296, 207, 208, 229, 230, 74, 111, 337,
310, 311, 312, 313, 74, 116, 74, 333, 217, 134,
296, 83, 82, 336, 209, 118, 175, 195, 210, 121,
291, 296, 128, 345, 358, 132, 339, 181, 364, 184,
344, 366, 241, 242, 162, 175, 296, 352, 350, 306,
307, 135, 2, 3, 4, 346, 95, 96, 97, 74,
74, 308, 309, 383, 175, 259, 357, 218, 219, 220,
359, 314, 315, 303, 304, 305, 162, 162, 162, 162,
74, 108, 233, 300, 223, 122, 134, 175, 83, 82,
94, 222, 304, 230, 60, 367, 134, 61, 311, 7,
180, 361, 89, 263, 374, 129, 175, 130, 87, 362,
219, 126, 92, 242, 131, 134, 90, 220, 389, 135,
93, 95, 96, 97, 103, 374, 278, 250, 251, 135,
27, 28, 101, 29, 80, 102, 312, 230, 264, 126,
88, 37, 38, 39, 182, 403, 225, 410, 135, 74,
183, 403, 109, 280, 248, 104, 249, 74, 134, 134,
110, 239, 266, 111, 115, 118, 81, 240, 175, 114,
313, 60, 315, 223, 61, 371, 297, 356, 128, 74,
303, 297, 252, 253, 234, 235, -94, 74, 372, 85,
86, 135, 135, 319, 297, 175, 7, 74, 407, 116,
339, 204, 7, 297, 297, 236, 298, 74, 121, 237,
94, 345, 256, 257, 74, 347, 74, 254, 255, 309,
83, 82, 310, 230, 300, 132, 379, 27, 28, 381,
29, 80, 297, 27, 28, 346, 29, 181, 37, 38,
39, 95, 96, 97, 37, 134, 268, 269, 309, 351,
352, 358, 395, 2, 3, 4, 178, 162, 223, 74,
74, 216, 353, 297, 364, 327, 328, 329, 330, 359,
95, 96, 97, 226, 411, -27, 162, 175, 135, 245,
246, 247, 323, 324, 175, 373, 325, 326, 238, 204,
231, 232, 285, 286, 287, 288, 289, 290, 291, 292,
293, 294, 331, 332, 243, 258, 373, 223, 260, 244,
223, 295, 261, 259, 265, 262, 271, 384, 272, 274,
275, 397, 383, 276, 279, 281, 283, 282, 375, -26,
301, 305, 308, 223, 408, 306, 366, 175, 162, -21,
-231, 348, 355, 363, 354, -28, 74, 365, 385, 375,
357, 297, 378, 382, 392, 223, 380, 393, 396, 394,
399, 398, 400, 318, 204, 162, 195, 402, 333, 335,
406, 412, 334, 336, 338, 217, 337, 123, 84, 127,
218, 307, 270, 360, 368, 409, 369, 108, 401, 350,
386, 320, 321, 322, 162, 162, 162, 162, 162, 162,
162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
162, 162, 195, 186, 198, 195, 7, -27, 216, 379,
211, 411, 231, 232, 369, 233, 234, 162, 238, 271,
275, 276, 235, 368, 379, 7, 290, 195, -21, 74,
324, 325, 175, 397, 327, 328, 162, 27, 28, 332,
29, 80, 335, -26, 341, 334, 329, 408, 37, 38,
39, 381, 296, 340, 259, 162, 27, 28, 343, 29,
80, 351, 360, -28, -231, 195, 381, 37, 38, 39,
362, 363, 367, 81, 277, 278, 279, 280, 281, 282,
283, 284, 285, 286, 365, 370, 371, 385, 384, 394,
395, 396, 400, 287, 402, 401, 399, 403, 316, 301,
412, 317, 319, 108, 318, 320, 187, 123, 321, 127,
84, 347, 289, 162, 374, 188, 409, 243, 372, 375,
387, 113, 388, 0, 0, 0, 0, 0, 0, 0,
113, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 204, 204, 0, 0, 0, 0, 204,
204, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 162, 0, 0,
204, 0, 0, 0, 162, 74, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 259, 259, 0, 0, 0,
0, 259, 0, 0, 0, 0, 0, 0, 0, 0,
0, 259, 0, 0, 0, 0, 259, 0, 0, 0,
0, 74, 0, 0, 0, 0, 0, 259, 0, 0,
0, 0, 0, 0, 0, 259, 0, 0, 0, 0,
259, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 244, 245, 246, 0, 247, 248, 249, 250,
251, 252, 253, 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, 254, 42, 43, 44, 0, 45,
46, 47, 48, 49, 50, 51, 52, 53, 54, 0,
55, 56, 57, 58, 138, 59, 139, 140, 141, 142,
143, 0, 0, 144, 145, 0, 0, 0, 0, 0,
0, 0, 0, 204, 0, 0, 0, 0, 0, 204,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 146, 0, 0, 0, 121, 386, 0, 0,
0, 0, 255, 148, 149, 150, 151, 1, 2, 3,
4, 5, 6, 7, 8, 9, 10, 11, 244, 245,
246, 0, 247, 248, 249, 250, 251, 252, 253, 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,
254, 42, 43, 44, 0, 45, 46, 47, 48, 49,
50, 51, 52, 53, 54, 0, 55, 56, 57, 58,
138, 59, 139, 140, 141, 142, 143, 0, 0, 144,
145, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 146, 0,
0, 0, 121, 398, 0, 0, 0, 0, 255, 148,
149, 150, 151, 1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 244, 245, 246, 0, 247, 248,
249, 250, 251, 252, 253, 12, 13, 14, 15, 16,
0, 0, 0, 1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 184, 185, 186, 162, 187, 188,
189, 190, 191, 192, 193, 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, 254, 42, 43, 44,
36, 37, 38, 39, 40, 41, 194, 42, 43, 44,
0, 45, 46, 47, 48, 49, 50, 51, 52, 53,
54, 0, 55, 56, 57, 58, 138, 59, 139, 140,
141, 142, 143, 0, 0, 144, 145, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 146, 0, 0, 0, 121, 0,
0, 0, 0, 0, 255, 148, 149, 150, 151, 1,
0, 0, 0, 0, 146, 0, 0, 0, 195, 196,
0, 0, 0, 0, 197, 148, 149, 150, 151, 1,
2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
244, 245, 246, 0, 247, 248, 249, 250, 251, 252,
253, 12, 13, 14, 15, 16, 17, 18, 19, 20,
184, 185, 186, 0, 187, 188, 189, 190, 191, 192,
193, 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, 254, 42, 43, 44, 0, 45, 46, 47,
40, 41, 194, 42, 43, 44, 0, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 0, 55, 56,
57, 58, 138, 59, 139, 140, 141, 142, 143, 0,
0, 144, 145, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
146, 0, 0, 0, 371, 0, 0, 0, 0, 0,
255, 148, 149, 150, 151, 1, 2, 3, 4, 5,
6, 7, 8, 9, 10, 11, 244, 245, 246, 0,
247, 248, 249, 250, 251, 252, 253, 12, 13, 14,
146, 0, 0, 0, 195, 299, 0, 0, 0, 0,
197, 148, 149, 150, 151, 1, 2, 3, 4, 5,
6, 7, 8, 9, 10, 11, 184, 185, 186, 0,
187, 188, 189, 190, 191, 192, 193, 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, 254, 42,
34, 35, 36, 37, 38, 39, 40, 41, 194, 42,
43, 44, 0, 45, 46, 47, 48, 49, 50, 51,
52, 53, 54, 0, 55, 56, 57, 58, 138, 59,
139, 140, 141, 142, 143, 0, 0, 144, 145, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 146, 0, 0, 0,
0, 0, 0, 0, 0, 0, 255, 148, 149, 150,
195, 0, 0, 0, 0, 0, 197, 148, 149, 150,
151, 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,
10, 11, 184, 185, 186, 0, 187, 188, 189, 190,
191, 192, 193, 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,
38, 39, 40, 41, 194, 42, 43, 44, 0, 45,
46, 47, 48, 49, 50, 51, 52, 53, 54, 0,
55, 56, 57, 58, 138, 59, 139, 140, 141, 142,
143, 0, 0, 144, 145, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 133, 2,
3, 4, 146, 6, 7, 8, 9, 10, 11, 0,
0, 0, 255, 148, 149, 150, 151, 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, 138, 59, 139, 140, 141, 142, 143, 0, 0,
144, 145, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 2, 3, 4, 0, 0, 146,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 146, 0, 0, 0, 121, 0, 0, 0,
0, 0, 197, 148, 149, 150, 151, 1, 2, 3,
4, 5, 6, 7, 8, 9, 10, 11, 184, 185,
186, 0, 187, 188, 189, 190, 191, 192, 193, 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,
194, 42, 43, 44, 0, 45, 46, 47, 48, 49,
50, 51, 52, 53, 54, 0, 55, 56, 57, 58,
138, 59, 139, 140, 141, 142, 143, 0, 0, 144,
145, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 146, 0,
0, 0, 0, 0, 0, 0, 0, 0, 197, 148,
149, 150, 151, 1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 0, 0, 0, 0, 0, 0,
148, 149, 150, 151, 0, 12, 13, 14, 15, 16,
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,
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, 0, 105, 59, 0, 0,
8, 9, 10, 11, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 12, 13, 14, 15, 16,
54, 0, 55, 56, 57, 58, 138, 59, 139, 140,
141, 142, 143, 0, 0, 144, 145, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
133, 2, 3, 4, 146, 6, 7, 8, 9, 10,
11, 0, 0, 0, 197, 148, 149, 150, 151, 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, 138, 59, 139, 140, 141, 142, 143,
0, 0, 144, 145, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 2, 3, 4, 0,
0, 146, 8, 9, 10, 11, 0, 0, 0, 0,
0, 0, 148, 149, 150, 151, 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, 105, 59,
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, 106, 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, 138, 59,
139, 140, 141, 142, 143, 0, 0, 144, 145, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 146, 0, 0, 147,
8, 9, 10, 11, 0, 0, 0, 148, 149, 150,
151, 0, 0, 0, 0, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
0, 0, 0, 0, 106, 31, 32, 33, 34, 35,
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, 138, 59, 139, 140,
141, 142, 143, 0, 0, 144, 145, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 146, 0, 0, 147, 8, 9,
0, 0, 0, 0, 146, 0, 0, 221, 8, 9,
10, 11, 0, 0, 0, 148, 149, 150, 151, 0,
0, 0, 0, 12, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24, 25, 26, 0, 0,
......@@ -1098,183 +1109,151 @@ static const yytype_int16 yytable[] =
55, 56, 57, 0, 138, 59, 139, 140, 141, 142,
143, 0, 0, 144, 145, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 146, 0, 0, 191, 8, 9, 10, 11,
0, 0, 0, 148, 149, 150, 151, 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, 138, 59, 139, 140, 141, 142, 143, 0,
0, 144, 145, 0, 0, 0, 0, 0, 0, 0,
0, 0, 146, 8, 9, 10, 11, 0, 0, 0,
0, 0, 277, 148, 149, 150, 151, 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, 138,
59, 139, 140, 141, 142, 143, 0, 0, 144, 145,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
146, 0, 0, 272, 8, 9, 10, 11, 0, 0,
0, 148, 149, 150, 151, 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,
138, 59, 139, 140, 141, 142, 143, 0, 0, 144,
145, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 146, 8,
9, 10, 11, 0, 0, 0, 0, 0, 330, 148,
149, 150, 151, 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, 138, 59, 139, 140, 141,
142, 143, 0, 0, 144, 145, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 146, 8, 9, 10, 11, 0, 0,
0, 0, 0, 0, 148, 149, 150, 151, 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, 214,
0, 42, 43, 44, 0, 45, 46, 47, 48, 49,
50, 51, 52, 53, 54, 0, 55, 56, 57, 0,
138, 59, 139, 140, 141, 142, 143, 0, 0, 144,
145, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 133, 2, 3, 4, 146, 6,
7, 8, 9, 10, 11, 0, 0, 0, 0, 148,
149, 150, 151, 0, 0, 0, 12, 13, 14, 15,
0, 0, 0, 0, 0, 0, 0, 146, 0, 0,
302, 8, 9, 10, 11, 0, 0, 0, 148, 149,
150, 151, 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,
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, 58, 0, 59, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 133,
2, 3, 4, 0, 6, 7, 8, 9, 10, 11,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
201, 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, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 133, 2, 3, 4, 0, 6,
7, 8, 9, 10, 11, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 240, 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, 0,
0, 0, 0, 0, 0, 0, 112, 0, 0, 1,
2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
323, 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, 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, 133,
2, 3, 4, 0, 6, 7, 8, 9, 10, 11,
53, 54, 0, 55, 56, 57, 0, 138, 59, 139,
140, 141, 142, 143, 0, 0, 144, 145, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 146, 8, 9, 10, 11,
0, 0, 0, 0, 0, 0, 148, 149, 150, 151,
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,
21, 22, 23, 24, 25, 26, 0, 0, 0, 0,
0, 31, 32, 33, 34, 35, 36, 0, 0, 0,
40, 241, 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,
57, 0, 138, 59, 139, 140, 141, 142, 143, 0,
0, 144, 145, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 133, 2, 3, 4,
146, 6, 7, 8, 9, 10, 11, 0, 0, 0,
0, 148, 149, 150, 151, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 133, 2, 3, 4, 0, 6, 7, 8, 9,
10, 11, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 229, 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, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 133, 2, 3, 4,
0, 6, 7, 8, 9, 10, 11, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 267, 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, 0, 0, 0, 0, 0, 0, 0, 112, 0,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 340, 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, 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, 133, 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, 0, 59, 8, 9,
10, 11, 0, 0, 0, 0, 0, 0, 0, 0,
54, 0, 55, 56, 57, 0, 316, 59, 8, 9,
10, 11, 317, 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, 299, 59, 8, 9, 10, 11,
300, 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
55, 56, 57, 0, 0, 59
};
static const yytype_int16 yycheck[] =
{
0, 69, 91, 131, 146, 111, 264, 107, 190, 1,
1, 136, 0, 9, 0, 130, 117, 117, 355, 9,
76, 92, 76, 377, 130, 361, 104, 106, 106, 87,
88, 99, 160, 106, 113, 113, 136, 40, 41, 107,
376, 114, 105, 104, 40, 41, 42, 401, 111, 117,
40, 41, 108, 43, 111, 180, 127, 114, 395, 127,
114, 51, 190, 400, 122, 123, 134, 209, 136, 69,
9, 116, 72, 118, 189, 114, 68, 77, 179, 179,
180, 73, 105, 189, 84, 213, 111, 105, 111, 77,
82, 77, 105, 275, 105, 237, 83, 84, 111, 99,
111, 40, 41, 42, 105, 130, 111, 107, 250, 105,
111, 179, 180, 76, 239, 114, 105, 117, 111, 144,
145, 114, 111, 85, 86, 89, 90, 127, 106, 387,
225, 226, 227, 228, 134, 108, 136, 252, 163, 239,
111, 133, 133, 114, 106, 76, 252, 275, 110, 108,
111, 111, 76, 114, 114, 108, 271, 113, 340, 109,
288, 343, 79, 80, 189, 271, 111, 112, 296, 221,
222, 239, 4, 5, 6, 290, 40, 41, 42, 179,
180, 223, 224, 365, 290, 185, 328, 119, 120, 121,
332, 229, 230, 218, 219, 220, 221, 222, 223, 224,
225, 226, 227, 228, 229, 230, 231, 232, 233, 234,
235, 236, 340, 76, 76, 343, 9, 104, 104, 361,
105, 403, 126, 125, 352, 124, 91, 252, 107, 106,
113, 107, 93, 348, 376, 9, 106, 365, 105, 239,
114, 114, 348, 385, 104, 104, 271, 40, 41, 104,
43, 44, 104, 104, 107, 112, 114, 399, 51, 52,
53, 361, 111, 113, 264, 290, 40, 41, 113, 43,
44, 107, 112, 104, 108, 403, 376, 51, 52, 53,
109, 107, 107, 76, 94, 95, 96, 97, 98, 99,
100, 101, 102, 103, 113, 56, 108, 104, 107, 76,
105, 114, 105, 113, 393, 17, 114, 113, 231, 210,
114, 232, 234, 381, 233, 235, 127, 93, 236, 100,
5, 291, 197, 348, 356, 127, 400, 183, 354, 356,
371, 77, 376, -1, -1, -1, -1, -1, -1, -1,
0, 69, 146, 209, 131, 91, 107, 111, 1, 1,
9, 130, 220, 136, 0, 343, 117, 0, 76, 9,
117, 106, 104, 92, 349, 104, 130, 106, 76, 114,
106, 99, 105, 160, 113, 136, 114, 113, 371, 107,
111, 40, 41, 42, 76, 370, 190, 83, 84, 117,
40, 41, 111, 43, 44, 114, 114, 180, 127, 127,
108, 51, 52, 53, 105, 393, 134, 400, 136, 69,
111, 399, 72, 192, 116, 68, 118, 77, 179, 180,
73, 105, 179, 106, 84, 76, 76, 111, 192, 82,
105, 77, 236, 220, 77, 105, 111, 305, 76, 99,
219, 111, 87, 88, 85, 86, 105, 107, 105, 40,
41, 179, 180, 240, 111, 219, 9, 117, 105, 108,
264, 121, 9, 111, 111, 106, 114, 127, 108, 110,
9, 275, 89, 90, 134, 279, 136, 122, 123, 111,
133, 133, 114, 266, 350, 108, 354, 40, 41, 357,
43, 44, 111, 40, 41, 114, 43, 113, 51, 52,
53, 40, 41, 42, 51, 266, 79, 80, 111, 296,
297, 114, 380, 4, 5, 6, 114, 111, 305, 179,
180, 76, 301, 111, 112, 252, 253, 254, 255, 308,
40, 41, 42, 76, 402, 104, 130, 301, 266, 119,
120, 121, 248, 249, 308, 349, 250, 251, 105, 209,
144, 145, 94, 95, 96, 97, 98, 99, 100, 101,
102, 103, 256, 257, 104, 126, 370, 354, 124, 163,
357, 113, 91, 125, 107, 93, 114, 364, 114, 104,
104, 385, 361, 114, 104, 112, 109, 104, 349, 104,
106, 113, 106, 380, 398, 107, 342, 361, 192, 105,
108, 112, 107, 107, 113, 104, 266, 56, 104, 370,
113, 111, 107, 107, 76, 402, 113, 105, 107, 109,
105, 114, 17, 237, 284, 219, 108, 113, 258, 260,
114, 114, 259, 261, 263, 127, 262, 93, 5, 100,
127, 225, 183, 309, 344, 399, 344, 375, 391, 284,
370, 245, 246, 247, 248, 249, 250, 251, 252, 253,
254, 255, 256, 257, 258, 259, 260, 261, 262, 263,
77, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, 343, 344, -1, -1, -1, -1, 349,
350, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 301, -1, -1,
370, -1, -1, -1, 308, 375, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 355, 356, -1, -1, -1,
-1, 361, -1, -1, -1, -1, -1, -1, -1, -1,
-1, 371, -1, -1, -1, -1, 376, -1, -1, -1,
-1, 381, -1, -1, -1, -1, -1, 387, -1, -1,
-1, -1, -1, -1, -1, 395, -1, -1, -1, -1,
400, 3, 4, 5, 6, 7, 8, 9, 10, 11,
12, 13, 14, 15, 16, -1, 18, 19, 20, 21,
22, 23, 24, 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, 393, -1, -1, -1, -1, -1, 399,
-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, 22, 23, 24, 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,
-1, -1, -1, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, 361, 18, 19,
20, 21, 22, 23, 24, 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,
......@@ -1283,7 +1262,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, -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, 22, 23,
......@@ -1295,7 +1274,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, -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, 22, 23, 24, 25, 26, 27,
......@@ -1307,38 +1286,71 @@ 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,
-1, -1, -1, -1, -1, -1, 114, 115, 116, 117,
108, -1, -1, -1, -1, -1, 114, 115, 116, 117,
118, 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,
12, 13, 14, 15, 16, -1, 18, 19, 20, 21,
22, 23, 24, 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,
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, 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, 4, 5, 6, -1, -1, 104,
-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, 22, 23, 24, 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,
10, 11, 12, 13, -1, -1, -1, -1, -1, -1,
115, 116, 117, 118, -1, 25, 26, 27, 28, 29,
-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,
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, -1, 76, 77, -1, -1,
10, 11, 12, 13, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 25, 26, 27, 28, 29,
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, 4, 5, 6, -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,
-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, 114, 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,
30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
-1, -1, -1, -1, 114, 45, 46, 47, 48, 49,
-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,
......@@ -1354,114 +1366,104 @@ static const yytype_int16 yycheck[] =
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, 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, 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, 10,
11, 12, 13, -1, -1, -1, -1, -1, 114, 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, 104, 10, 11, 12, 13, -1, -1, -1,
-1, -1, 114, 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, 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, 3, 4, 5, 6, 104, 8,
9, 10, 11, 12, 13, -1, -1, -1, -1, 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, -1, 77, -1,
-1, -1, -1, -1, -1, -1, -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, -1, -1, -1, -1, -1, -1,
-1, -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, -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,
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, 7, 8,
9, 10, 11, 12, 13, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 25, 26, 27, 28,
-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, 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,
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, 75, -1, 77, 3,
4, 5, 6, -1, 8, 9, 10, 11, 12, 13,
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, 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, 40, 41, -1, 43,
44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
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, 75, -1, 77, 4, 5, 6, -1, -1, -1,
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, 3, 4, 5, 6,
104, 8, 9, 10, 11, 12, 13, -1, -1, -1,
-1, 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, -1,
77, -1, -1, -1, -1, -1, -1, -1, -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, -1, -1, -1, -1,
-1, -1, -1, -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, -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, 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,
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, 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, -1, 77, 10, 11,
12, 13, -1, -1, -1, -1, -1, -1, -1, -1,
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, 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
72, 73, 74, -1, -1, 77
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
......@@ -1480,35 +1482,35 @@ static const yytype_uint8 yystos[] =
114, 220, 105, 111, 9, 40, 41, 42, 165, 166,
172, 111, 114, 76, 174, 76, 114, 158, 175, 180,
174, 106, 0, 218, 174, 180, 108, 184, 76, 178,
179, 108, 193, 165, 164, 167, 175, 166, 76, 104,
179, 108, 200, 165, 164, 167, 175, 166, 76, 104,
106, 113, 108, 3, 173, 175, 185, 186, 76, 78,
79, 80, 81, 82, 85, 86, 104, 107, 115, 116,
117, 118, 129, 130, 131, 133, 134, 135, 136, 137,
138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
148, 149, 150, 151, 152, 153, 157, 180, 114, 183,
185, 113, 105, 111, 109, 194, 76, 164, 167, 106,
113, 107, 157, 140, 153, 154, 189, 175, 76, 187,
188, 109, 186, 140, 140, 154, 156, 85, 86, 106,
110, 105, 105, 111, 55, 154, 104, 140, 119, 120,
121, 116, 118, 83, 84, 87, 88, 122, 123, 89,
90, 126, 125, 124, 91, 93, 92, 127, 107, 185,
109, 79, 80, 179, 14, 15, 16, 18, 19, 20,
21, 22, 23, 24, 56, 114, 156, 159, 160, 180,
190, 191, 192, 193, 201, 202, 203, 205, 207, 209,
216, 106, 107, 157, 189, 113, 107, 94, 95, 96,
97, 98, 99, 100, 101, 102, 103, 113, 155, 187,
106, 111, 114, 76, 114, 105, 111, 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, 114, 114, 211, 104, 104, 114,
114, 156, 104, 157, 112, 104, 114, 191, 195, 157,
113, 107, 189, 113, 154, 114, 157, 188, 106, 114,
154, 107, 112, 197, 198, 199, 212, 156, 114, 156,
112, 210, 109, 107, 189, 113, 189, 107, 157, 154,
56, 108, 200, 192, 190, 202, 213, 105, 105, 156,
170, 173, 208, 189, 107, 104, 109, 201, 208, 214,
215, 197, 204, 206, 76, 105, 114, 156, 109, 114,
105, 17, 193, 113, 192, 196, 200, 105, 156, 196,
185, 113, 105, 111, 14, 15, 16, 18, 19, 20,
21, 22, 23, 24, 56, 108, 109, 114, 140, 153,
154, 156, 159, 160, 180, 190, 191, 192, 193, 201,
202, 203, 205, 207, 209, 216, 76, 164, 167, 106,
113, 107, 157, 154, 189, 175, 76, 187, 188, 109,
186, 140, 140, 156, 85, 86, 106, 110, 105, 105,
111, 55, 154, 104, 140, 119, 120, 121, 116, 118,
83, 84, 87, 88, 122, 123, 89, 90, 126, 125,
124, 91, 93, 92, 127, 107, 185, 109, 79, 80,
179, 114, 114, 211, 104, 104, 114, 114, 156, 104,
157, 112, 104, 109, 194, 94, 95, 96, 97, 98,
99, 100, 101, 102, 103, 113, 155, 111, 114, 109,
191, 106, 107, 157, 189, 113, 107, 187, 106, 111,
114, 76, 114, 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, 197, 198, 199, 212, 156, 114, 156, 112, 210,
201, 154, 154, 157, 113, 107, 189, 113, 114, 157,
188, 106, 114, 107, 112, 56, 200, 192, 190, 202,
213, 105, 105, 156, 170, 173, 208, 195, 107, 189,
113, 189, 107, 157, 154, 104, 208, 214, 215, 197,
204, 206, 76, 105, 109, 189, 107, 156, 114, 105,
17, 193, 113, 192, 196, 200, 114, 105, 156, 196,
197, 189, 114
};
......@@ -3060,31 +3062,7 @@ yyreduce:
case 86:
{
TFunction &function = *((yyvsp[-1].interm).function);
TIntermAggregate *prototype = new TIntermAggregate;
prototype->setType(function.getReturnType());
prototype->setName(function.getName());
for (size_t i = 0; i < function.getParamCount(); i++)
{
const TParameter &param = function.getParam(i);
if (param.name != 0)
{
TVariable variable(param.name, *param.type);
prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(variable.getUniqueId(), variable.getName(), variable.getType(), (yylsp[-1])), (yylsp[-1]));
}
else
{
prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(0, "", *param.type, (yylsp[-1])), (yylsp[-1]));
}
}
prototype->setOp(EOpPrototype);
(yyval.interm.intermNode) = prototype;
context->symbolTable.pop();
(yyval.interm.intermNode) = context->addFunctionPrototypeDeclaration(*((yyvsp[-1].interm).function), (yylsp[-1]));
}
break;
......@@ -3151,38 +3129,7 @@ yyreduce:
case 93:
{
//
// Multiple declarations of the same function are allowed.
//
// If this is a definition, the definition production code will check for redefinitions
// (we don't know at this point if it's a definition or not).
//
// Redeclarations are allowed. But, return types and parameter qualifiers must match.
//
TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find((yyvsp[-1].interm.function)->getMangledName(), context->getShaderVersion()));
if (prevDec) {
if (prevDec->getReturnType() != (yyvsp[-1].interm.function)->getReturnType()) {
context->error((yylsp[0]), "overloaded functions must have the same return type", (yyvsp[-1].interm.function)->getReturnType().getBasicString());
context->recover();
}
for (size_t i = 0; i < prevDec->getParamCount(); ++i) {
if (prevDec->getParam(i).type->getQualifier() != (yyvsp[-1].interm.function)->getParam(i).type->getQualifier()) {
context->error((yylsp[0]), "overloaded functions must have the same parameter qualifiers", (yyvsp[-1].interm.function)->getParam(i).type->getQualifierString());
context->recover();
}
}
}
//
// If this is a redeclaration, it could also be a definition,
// in which case, we want to use the variable names from this one, and not the one that's
// being redeclared. So, pass back up this declaration, not the one in the symbol table.
//
(yyval.interm).function = (yyvsp[-1].interm.function);
// We're at the inner scope level of the function's arguments and body statement.
// Add the function prototype to the surrounding scope instead.
context->symbolTable.getOuterLevel()->insert(*(yyval.interm).function);
(yyval.interm).function = context->parseFunctionDeclarator((yylsp[0]), (yyvsp[-1].interm.function));
}
break;
......@@ -3246,8 +3193,13 @@ yyreduce:
context->error((yylsp[-1]), "no qualifiers allowed for function return", getQualifierString((yyvsp[-2].interm.type).qualifier));
context->recover();
}
if (!(yyvsp[-2].interm.type).layoutQualifier.isEmpty())
{
context->error((yylsp[-1]), "no qualifiers allowed for function return", "layout");
context->recover();
}
// make sure a sampler is not involved as well...
if (context->structQualifierErrorCheck((yylsp[-1]), (yyvsp[-2].interm.type)))
if (context->samplerErrorCheck((yylsp[-1]), (yyvsp[-2].interm.type), "samplers can't be function return values"))
context->recover();
// Add the function as a prototype after parsing it (we do not support recursion)
......@@ -3593,6 +3545,11 @@ yyreduce:
case 131:
{
if ((yyvsp[0].interm.type).qualifier != EvqConstExpr && !context->symbolTable.atGlobalLevel())
{
context->error((yylsp[0]), "Local variables can only use the const storage qualifier.", getQualifierString((yyvsp[0].interm.type).qualifier));
context->recover();
}
(yyval.interm.type).setBasic(EbtVoid, (yyvsp[0].interm.type).qualifier, (yylsp[0]));
}
......@@ -3740,6 +3697,11 @@ yyreduce:
{
(yyval.interm.type) = (yyvsp[0].interm.type);
(yyval.interm.type).precision = (yyvsp[-1].interm.precision);
if (!SupportsPrecision((yyvsp[0].interm.type).type)) {
context->error((yylsp[-1]), "illegal type for precision qualifier", getBasicString((yyvsp[0].interm.type).type));
context->recover();
}
}
break;
......@@ -4522,7 +4484,7 @@ yyreduce:
case 229:
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermAggregate); }
break;
......@@ -4540,7 +4502,7 @@ yyreduce:
case 232:
{ context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
{ context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[0].interm.intermAggregate); }
break;
......@@ -4559,7 +4521,7 @@ yyreduce:
case 235:
{
(yyval.interm.intermNode) = 0;
(yyval.interm.intermAggregate) = 0;
}
break;
......@@ -4571,7 +4533,7 @@ yyreduce:
(yyvsp[-1].interm.intermAggregate)->setOp(EOpSequence);
(yyvsp[-1].interm.intermAggregate)->setEndLine((yylsp[0]));
}
(yyval.interm.intermNode) = (yyvsp[-1].interm.intermAggregate);
(yyval.interm.intermAggregate) = (yyvsp[-1].interm.intermAggregate);
}
break;
......@@ -4676,9 +4638,7 @@ yyreduce:
case 249:
{
TIntermNode* intermNode;
if (context->structQualifierErrorCheck((yylsp[-2]), (yyvsp[-3].interm.type)))
context->recover();
TIntermNode *intermNode;
if (context->boolErrorCheck((yylsp[-2]), (yyvsp[-3].interm.type)))
context->recover();
......@@ -4870,89 +4830,7 @@ yyreduce:
case 271:
{
TFunction* function = (yyvsp[0].interm).function;
const TSymbol *builtIn = context->symbolTable.findBuiltIn(function->getMangledName(), context->getShaderVersion());
if (builtIn)
{
context->error((yylsp[0]), "built-in functions cannot be redefined", function->getName().c_str());
context->recover();
}
TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find(function->getMangledName(), context->getShaderVersion()));
//
// Note: 'prevDec' could be 'function' if this is the first time we've seen function
// as it would have just been put in the symbol table. Otherwise, we're looking up
// an earlier occurance.
//
if (prevDec->isDefined()) {
//
// Then this function already has a body.
//
context->error((yylsp[0]), "function already has a body", function->getName().c_str());
context->recover();
}
prevDec->setDefined();
//
// Raise error message if main function takes any parameters or return anything other than void
//
if (function->getName() == "main") {
if (function->getParamCount() > 0) {
context->error((yylsp[0]), "function cannot take any parameter(s)", function->getName().c_str());
context->recover();
}
if (function->getReturnType().getBasicType() != EbtVoid) {
context->error((yylsp[0]), "", function->getReturnType().getBasicString(), "main function cannot return a value");
context->recover();
}
}
//
// Remember the return type for later checking for RETURN statements.
//
context->setCurrentFunctionType(&(prevDec->getReturnType()));
context->setFunctionReturnsValue(false);
//
// Insert parameters into the symbol table.
// If the parameter has no name, it's not an error, just don't insert it
// (could be used for unused args).
//
// Also, accumulate the list of parameters into the HIL, so lower level code
// knows where to find parameters.
//
TIntermAggregate* paramNodes = new TIntermAggregate;
for (size_t i = 0; i < function->getParamCount(); i++) {
const TParameter& param = function->getParam(i);
if (param.name != 0) {
TVariable *variable = new TVariable(param.name, *param.type);
//
// Insert the parameters with name in the symbol table.
//
if (! context->symbolTable.declare(*variable)) {
context->error((yylsp[0]), "redefinition", variable->getName().c_str());
context->recover();
delete variable;
}
//
// Add the parameter to the HIL
//
paramNodes = context->intermediate.growAggregate(
paramNodes,
context->intermediate.addSymbol(variable->getUniqueId(),
variable->getName(),
variable->getType(), (yylsp[0])),
(yylsp[0]));
} else {
paramNodes = context->intermediate.growAggregate(paramNodes, context->intermediate.addSymbol(0, "", *param.type, (yylsp[0])), (yylsp[0]));
}
}
context->intermediate.setAggregateOperator(paramNodes, EOpParameters, (yylsp[0]));
(yyvsp[0].interm).intermAggregate = paramNodes;
context->setLoopNestingLevel(0);
context->parseFunctionPrototype((yylsp[0]), (yyvsp[0].interm).function, &(yyvsp[0].interm).intermAggregate);
}
break;
......@@ -4960,27 +4838,7 @@ yyreduce:
case 272:
{
//?? Check that all paths return a value if return type != void ?
// May be best done as post process phase on intermediate code
if (context->getCurrentFunctionType()->getBasicType() != EbtVoid && ! context->getFunctionReturnsValue()) {
context->error((yylsp[-2]), "function does not return a value:", "", (yyvsp[-2].interm).function->getName().c_str());
context->recover();
}
(yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[-2].interm).intermAggregate, (yyvsp[0].interm.intermAggregate), (yyloc));
context->intermediate.setAggregateOperator((yyval.interm.intermNode), EOpFunction, (yylsp[-2]));
(yyval.interm.intermNode)->getAsAggregate()->setName((yyvsp[-2].interm).function->getMangledName().c_str());
(yyval.interm.intermNode)->getAsAggregate()->setType((yyvsp[-2].interm).function->getReturnType());
// store the pragma information for debug and optimize and other vendor specific
// information. This information can be queried from the parse tree
(yyval.interm.intermNode)->getAsAggregate()->setOptimize(context->pragma().optimize);
(yyval.interm.intermNode)->getAsAggregate()->setDebug(context->pragma().debug);
if ((yyvsp[0].interm.intermAggregate) && (yyvsp[0].interm.intermAggregate)->getAsAggregate())
(yyval.interm.intermNode)->getAsAggregate()->setEndLine((yyvsp[0].interm.intermAggregate)->getAsAggregate()->getEndLine());
context->symbolTable.pop();
(yyval.interm.intermNode) = context->addFunctionDefinition(*((yyvsp[-2].interm).function), (yyvsp[-2].interm).intermAggregate, (yyvsp[0].interm.intermAggregate), (yylsp[-2]));
}
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment