O'Reilly logo

OpenGL Shading Language, Third Edition by Mike Weiblen, Hugh Malan, Barthold Lichtenbelt, John M. Kessenich, Dan Ginsburg, Bill Licea-Kane, Randi J. Rost

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix A. Language Grammar

The grammar is fed from the output of lexical analysis. The tokens returned from lexical analysis are

image

The following describes the grammar for the OpenGL Shading Language in terms of the preceding tokens:

variable_identifier:

IDENTIFIER

primary_expression:

variable_identifier

INTCONSTANT

UINTCONSTANT

FLOATCONSTANT

BOOLCONSTANT

LEFT_PAREN expression RIGHT_PAREN

postfix_expression:

primary_expression

postfix_expression LEFT_BRACKET integer_expression RIGHT_BRACKET

function_call

postfix_expression DOT FIELD_SELECTION

postfix_expression INC_OP

postfix_expression DEC_OP

integer_expression:

expression

function_call:

function_call_or_method ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required