Skip to content

Commit

Permalink
Use more modern bison %parse-param and %lex-param rather than #define…
Browse files Browse the repository at this point in the history
…d 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
  • Loading branch information
johnkslang committed Mar 8, 2014
1 parent 8922ce7 commit 6b57784
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions glslang/Include/revision.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
// 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.

#define GLSLANG_REVISION "25511"
#define GLSLANG_DATE "2014/02/24 14:16:19"
#define GLSLANG_REVISION "25512"
#define GLSLANG_DATE "2014/02/24 14:36:08"
4 changes: 2 additions & 2 deletions glslang/MachineIndependent/ParseHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

#include "preprocessor/PpContext.h"

extern int yyparse(void*);
extern int yyparse(glslang::TParseContext*);

namespace glslang {

Expand Down Expand Up @@ -143,7 +143,7 @@ bool TParseContext::parseShaderStrings(TPpContext& ppContext, TInputScanner& inp
{
currentScanner = &input;
ppContext.setInput(input, versionWillBeError);
yyparse((void*)this);
yyparse(this);
finalErrorCheck();

return numErrors == 0;
Expand Down
2 changes: 1 addition & 1 deletion glslang/MachineIndependent/Scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@

#include "../Include/Types.h"
#include "SymbolTable.h"
#include "glslang_tab.cpp.h"
#include "ParseHelper.h"
#include "glslang_tab.cpp.h"
#include "ScanContext.h"
#include "Scan.h"

Expand Down
8 changes: 4 additions & 4 deletions glslang/MachineIndependent/glslang.y
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ using namespace glslang;

%{

#define YYPARSE_PARAM voidParseContext
#define parseContext (*(TParseContext*)voidParseContext)
#define YYLEX_PARAM parseContext
#define yyerror(msg) parseContext.parserError(msg)
#define parseContext (*pParseContext)
#define yyerror(context, msg) context->parserError(msg)

extern int yylex(YYSTYPE*, TParseContext&);

%}

%parse-param {glslang::TParseContext* pParseContext}
%lex-param {parseContext}
%pure_parser // enable thread safety
%expect 1 // One shift reduce conflict because of if | else

Expand Down

0 comments on commit 6b57784

Please sign in to comment.