Commit 6b577846 by John Kessenich

Use more modern bison %parse-param and %lex-param rather than #defined…

Use more modern bison %parse-param and %lex-param rather than #defined YYPARSE_PARAM and YYLEX_PARAM. This should make it build across a broader range of modern versions of bison, as well as avoid void* and type casting. git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25746 e7fa87d3-cd2b-0410-9028-fcbf551c1848
parent 8922ce73
...@@ -9,5 +9,5 @@ ...@@ -9,5 +9,5 @@
// source have to figure out how to create revision.h just to get a build // source have to figure out how to create revision.h just to get a build
// going. However, if it is not updated, it can be a version behind. // going. However, if it is not updated, it can be a version behind.
#define GLSLANG_REVISION "25511" #define GLSLANG_REVISION "25512"
#define GLSLANG_DATE "2014/02/24 14:16:19" #define GLSLANG_DATE "2014/02/24 14:36:08"
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
#include "preprocessor/PpContext.h" #include "preprocessor/PpContext.h"
extern int yyparse(void*); extern int yyparse(glslang::TParseContext*);
namespace glslang { namespace glslang {
...@@ -143,7 +143,7 @@ bool TParseContext::parseShaderStrings(TPpContext& ppContext, TInputScanner& inp ...@@ -143,7 +143,7 @@ bool TParseContext::parseShaderStrings(TPpContext& ppContext, TInputScanner& inp
{ {
currentScanner = &input; currentScanner = &input;
ppContext.setInput(input, versionWillBeError); ppContext.setInput(input, versionWillBeError);
yyparse((void*)this); yyparse(this);
finalErrorCheck(); finalErrorCheck();
return numErrors == 0; return numErrors == 0;
......
...@@ -42,8 +42,8 @@ ...@@ -42,8 +42,8 @@
#include "../Include/Types.h" #include "../Include/Types.h"
#include "SymbolTable.h" #include "SymbolTable.h"
#include "glslang_tab.cpp.h"
#include "ParseHelper.h" #include "ParseHelper.h"
#include "glslang_tab.cpp.h"
#include "ScanContext.h" #include "ScanContext.h"
#include "Scan.h" #include "Scan.h"
......
...@@ -97,15 +97,15 @@ using namespace glslang; ...@@ -97,15 +97,15 @@ using namespace glslang;
%{ %{
#define YYPARSE_PARAM voidParseContext #define parseContext (*pParseContext)
#define parseContext (*(TParseContext*)voidParseContext) #define yyerror(context, msg) context->parserError(msg)
#define YYLEX_PARAM parseContext
#define yyerror(msg) parseContext.parserError(msg)
extern int yylex(YYSTYPE*, TParseContext&); extern int yylex(YYSTYPE*, TParseContext&);
%} %}
%parse-param {glslang::TParseContext* pParseContext}
%lex-param {parseContext}
%pure_parser // enable thread safety %pure_parser // enable thread safety
%expect 1 // One shift reduce conflict because of if | else %expect 1 // One shift reduce conflict because of if | else
......
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