glsl: Rework lexer keyword handling in preparation for GLSL 3.00 ES.
glsl: Rework lexer keyword handling in preparation for GLSL 3.00 ES.

This patch expands the lexer KEYWORD macro to take two additional
arguments: the GLSL ES versions in which the given keyword was first
reserved, and supported, respectively.  This will allow us to
trivially add support for GLSL 3.00 ES keywords, even though the set
of GLSL 3.00 ES keywords is neither a subset or a superset of the
keywords corresponding to any desktop GLSL version.

The new KEYWORD macro makes use of the
_mesa_glsl_parse_state::is_version() function, so it accepts 0 as
meaning "unsupported" (rather than 999, which we used previously).

Note that a few keywords ("packed" and "row_major") are supported
*either* when GLSL 1.40 is in use or when ARB_uniform_buffer_obj
support is enabled.  Previously, we handled these by cleverly taking
advantage of the fact that the KEYWORD macro didn't parenthesize its
arguments in the usual way.  Now they are handled more
straightforwardly, with a new macro, KEYWORD_WITH_ALT.

Reviewed-by: Ian Romanick <2b237cafb16dc45038e85df6c85e74e6d899eba9@intel.com>
Reviewed-by: Kenneth Graunke <bd2562f754ec92342f93f61c25d731e290a2ffa8@whitecape.org>
Acked-by: Carl Worth <3966d6ecbaaa47b45708b84fc68464c10c40d492@cworth.org>

mcanthony/glsl-optimizer,zeux/glsl-optimizer,bkaradzic/glsl-optimizer,zeux/glsl-optimizer,tokyovigilante/glsl-optimizer,mapbox/glsl-optimizer,zz85/glsl-optimizer,benaadams/glsl-optimizer,bkaradzic/glsl-optimizer,tokyovigilante/glsl-optimizer,mapbox/glsl-optimizer,bkaradzic/glsl-optimizer,benaadams/glsl-optimizer,zeux/glsl-optimizer,mapbox/glsl-optimizer,jbarczak/glsl-optimizer,djreep81/glsl-optimizer,djreep81/glsl-optimizer,benaadams/glsl-optimizer,bkaradzic/glsl-optimizer,mcanthony/glsl-optimizer,dellis1972/glsl-optimizer,zz85/glsl-optimizer,metora/MesaGLSLCompiler,wolf96/glsl-optimizer,zeux/glsl-optimizer,jbarczak/glsl-optimizer,zeux/glsl-optimizer,benaadams/glsl-optimizer,zz85/glsl-optimizer,wolf96/glsl-optimizer,mcanthony/glsl-optimizer,djreep81/glsl-optimizer,dellis1972/glsl-optimizer,dellis1972/glsl-optimizer,dellis1972/glsl-optimizer,mapbox/glsl-optimizer,bkaradzic/glsl-optimizer,zz85/glsl-optimizer,jbarczak/glsl-optimizer,wolf96/glsl-optimizer,tokyovigilante/glsl-optimizer,tokyovigilante/glsl-optimizer,metora/MesaGLSLCompiler,zz85/glsl-optimizer,mcanthony/glsl-optimizer,wolf96/glsl-optimizer,benaadams/glsl-optimizer,djreep81/glsl-optimizer,mcanthony/glsl-optimizer,djreep81/glsl-optimizer,jbarczak/glsl-optimizer,dellis1972/glsl-optimizer,benaadams/glsl-optimizer,metora/MesaGLSLCompiler,mapbox/glsl-optimizer,wolf96/glsl-optimizer,jbarczak/glsl-optimizer,tokyovigilante/glsl-optimizer,zz85/glsl-optimizer