Handle logical xor.

This commit is contained in:
Roberto Raggi
2010-11-30 15:47:03 +01:00
parent 5aacd95966
commit cf793418c3
5 changed files with 325 additions and 326 deletions

View File

@@ -26,10 +26,6 @@
-- contact the sales department at http://qt.nokia.com/contact. -- contact the sales department at http://qt.nokia.com/contact.
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
--
-- todo:
-- spelling of XOR_OP and CARET
%decl glslparser.h %decl glslparser.h
%impl glslparser.cpp %impl glslparser.cpp
%parser GLSLParserTable %parser GLSLParserTable
@@ -204,7 +200,7 @@
%token VOID "void" %token VOID "void"
%token WHILE "while" %token WHILE "while"
%token XOR_ASSIGN "^=" %token XOR_ASSIGN "^="
%token XOR_OP "^" %token XOR_OP "^^"
%token TRUE "true" %token TRUE "true"
%token FALSE "false" %token FALSE "false"
%token PREPROC "preprocessor directive" %token PREPROC "preprocessor directive"

View File

@@ -331,8 +331,11 @@ int Lexer::yylex_helper(const char **position, int *line)
if (_yychar == '=') { if (_yychar == '=') {
yyinp(); yyinp();
return Parser::T_XOR_ASSIGN; return Parser::T_XOR_ASSIGN;
} } else if (_yychar == '^') {
yyinp();
return Parser::T_XOR_OP; return Parser::T_XOR_OP;
}
return Parser::T_CARET;
// { // {
case '{': case '{':

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
#line 217 "./glsl.g" #line 213 "./glsl.g"
/************************************************************************** /**************************************************************************
** **

View File

@@ -61,7 +61,7 @@ const char *const GLSLParserTable::spell [] = {
"samplerCube", "samplerCubeArray", "samplerCubeArrayShadow", "samplerCubeShadow", ";", "/", "smooth", "*", "struct", "subroutine", "samplerCube", "samplerCubeArray", "samplerCubeArrayShadow", "samplerCubeShadow", ";", "/", "smooth", "*", "struct", "subroutine",
"-=", "switch", "~", "type_name", "uint", "uniform", "usampler1D", "usampler1DArray", "usampler2D", "usampler2DArray", "-=", "switch", "~", "type_name", "uint", "uniform", "usampler1D", "usampler1DArray", "usampler2D", "usampler2DArray",
"usampler2DMS", "usampler2DMSarray", "usampler2DRect", "usampler3D", "usamplerBuffer", "usamplerCube", "usamplerCubeArray", "uvec2", "uvec3", "uvec4", "usampler2DMS", "usampler2DMSarray", "usampler2DRect", "usampler3D", "usamplerBuffer", "usamplerCube", "usamplerCubeArray", "uvec2", "uvec3", "uvec4",
"varying", "vec2", "vec3", "vec4", "|", "void", "while", "^=", "^", "true", "varying", "vec2", "vec3", "vec4", "|", "void", "while", "^=", "^^", "true",
"false", "preprocessor directive", "comment", "error", "reserved word"}; "false", "preprocessor directive", "comment", "error", "reserved word"};
const short GLSLParserTable::lhs [] = { const short GLSLParserTable::lhs [] = {