glsl-toolkit

API Reference

glsl-toolkit

A library to parse and modify OpenGL Shader Language (GLSL) source code

GLSL-TOOLKIT

  • Variable *GLSL-KEYWORDS*
    '("writeonly" "while" "volatile" "void" "vec4" "vec3" "vec2" "varying" "uvec4"
      "uvec3" "uvec2" "using" "usamplercubearray" "usamplercube" "usamplerbuffer"
      "usampler3d" "usampler2drect" "usampler2dmsarray" "usampler2dms"
      "usampler2darray" "usampler2d" "usampler1darray" "usampler1d" "unsigned"
      "union" "uniform" "uint" "uimagecubearray" "uimagecube" "uimagebuffer"
      "uimage3d" "uimage2drect" "uimage2dmsarray" "uimage2dms" "uimage2darray"
      "uimage2d" "uimage1darray" "uimage1d" "typedef" "true" "this" "template"
      "switch" "superp" "subroutine" "struct" "static" "smooth"
      "smapler2drectshadow" "sizeof" "short" "shared" "samplercubeshadow"
      "samplercubearrayshadow" "samplercubearray" "samplercube" "samplerbuffer"
      "sampler3drect" "sampler3d" "sampler2dshadow" "sampler2drect"
      "sampler2dmsarray" "sampler2dms" "sampler2darrayshadow" "sampler2darray"
      "sampler2d" "sampler1dshadow" "sampler1darrayshadow" "sampler1darray"
      "sampler1d" "sample" "return" "restrict" "resource" "readonly" "public"
      "precision" "precise" "patch" "partition" "out" "output" "notinline"
      "noperspective" "namespace" "mediump" "mat4x4" "mat4x3" "mat4x2" "mat4"
      "mat3x4" "mat3x3" "mat3x2" "mat3" "mat2x4" "mat2x3" "mat2x2" "mat2" "lowp"
      "long" "layout" "ivec4" "ivec3" "ivec2" "isamplercubearray" "isamplercube"
      "isamplerbuffer" "isampler3d" "isampler2drect" "isampler2dmsarray"
      "isampler2dms" "isampler2darray" "isampler2d" "isampler1darray" "isampler1d"
      "invariant" "interface" "int" "input" "inout" "inline" "in" "imagecubearray"
      "imagecube" "imagebuffer" "image3d" "image2drect" "image2dmsarray"
      "image2dms" "image2darray" "image2d" "image1darray" "image1d"
      "iimagecubearray" "iimagecube" "iimagebuffer" "iimage3d" "iimage2drect"
      "iimage2dmsarray" "iimage2dms" "iimage2darray" "iimage2d" "iimage1darray"
      "iimage1d" "if" "hvec4" "hvec3" "hvec2" "highp" "half" "goto" "fvec4" "fvec3"
      "fvec2" "for" "float" "flat" "fixed" "filter" "false" "external" "extern"
      "enum" "else" "dvec4" "dvec3" "dvec2" "double" "do" "dmat4x4" "dmat4x3"
      "dmat4x2" "dmat4" "dmat3x4" "dmat3x3" "dmat3x2" "dmat3" "dmat2x4" "dmat2x3"
      "dmat2x2" "dmat2" "discard" "default" "continue" "cont" "common" "coherent"
      "class" "centroid" "cast" "case" "bvec4" "bvec3" "bvec2" "buffer" "break"
      "bool" "attribute" "atomic_uint" "asm" "active" "const")
  • Variable *GLSL-KEYWORD-SYMBOLS*
    (loop glsl-toolkit::for glsl-toolkit::item glsl-toolkit::in glsl-toolkit:*glsl-keywords*
          glsl-toolkit::collect (intern (string-upcase glsl-toolkit::item)
                                        :keyword))
  • Function END-OF-TOKENS-P
  • Function ADVANCE (&optional (offset 1))
  • Function BACKTRACK (&optional (offset 1))
  • Function PEEK (&optional (offset 0))
  • Function CONSUME
  • Macro WITH-TOKEN-INPUT (vector &body body)
  • Function RULE (name)
  • Function (setf RULE) (parser name)
  • Function REMOVE-RULE (name)
  • Function CONSUME-WHITESPACE
  • Function CONSUME-STRING (string)
  • Function CONSUME-ANY (choices)
  • Function CONSUME-NOTANY (choices)
  • Function COMPILE-RULE (rule)
  • Macro DEFINE-RULE (name &body body)
  • Macro DEFINE-REFERENCE (name &body rules)
  • Macro DEFINE-OBJECT (name rule &body transform)
  • Function NORMALIZE-SHADER-SOURCE (input)
  • Function LEX (input &optional (toplevel-rule 'tokenize))
  • Function PARSE (input &optional (toplevel-rule 'shader))
  • Function TRACE-PARSE
  • Function UNTRACE-PARSE
  • Function SERIALIZE (part &optional to)
  • Function SFORMAT (string &rest args)
  • Macro WITH-INDENTATION ((&optional (step 2)) &body body)
  • Function INDENT
  • Function SERIALIZER (type)
  • Function (setf SERIALIZER) (function type)
  • Function REMOVE-SERIALIZER (type)
  • Macro DEFINE-SERIALIZER (type (object) &body body)
  • Macro DEFINE-SERIALIZATION (type args &body body)
  • Function SERIALIZE-PART (part)
  • Struct ENVIRONMENT
    ROOT
    BINDINGS
  • Function BINDING (name environment)
  • Function (setf BINDING) (value name environment)
  • Function MAKE-ENVIRONMENT (&optional parent)
  • Function ROOT-ENVIRONMENT-P (environment)
  • Function PREPROCESSOR-P (value environment)
  • Function CONSTANT-P (value environment)
  • Function DECLARATION-P (value environment)
  • Function EXPRESSION-P (value environment)
  • Function CONTROL-FLOW-P (value environment)
  • Function KEYWORD-P (value environment)
  • Function STATEMENT-P (value environment)
  • Function IDENTIFIER-P (value environment)
  • Function GLOBAL-IDENTIFIER-P (value environment)
  • Function LOCAL-IDENTIFIER-P (value environment)
  • Function VARIABLE-IDENTIFIER-P (value environment)
  • Function FUNCTION-IDENTIFIER-P (value environment)
  • Function WALK (ast function &optional (environment (make-environment)))
  • Function WALK-PART (ast context function environment)
  • Function WALKER (type)
  • Function (setf WALKER) (function type)
  • Function REMOVE-WALKER (type)
  • Macro DEFINE-WALKER (type (ast func env) &body body)
  • Macro DEFINE-WALKING-BODY (type args &body body)
  • Macro DEFINE-EMPTY-OP-WALKER (type)
  • Macro DEFINE-UNARY-OP-WALKER (type)
  • Macro DEFINE-BINARY-OP-WALKER (type)
  • Function UNIQUIFY (table &optional name)
  • Function MATCHING-QUALIFIERS-P (a b)
  • Function MATCHING-SPECIFIERS-P (a b)
  • Function MATCHING-DECLARATORS-P (a b)
  • Function MERGE-SHADERS (&rest shaders)
  • Function MERGE-SHADER-SOURCES (sources &optional to)

Also exports

  • COMMON-LISP:DECLARATION
  • COMMON-LISP:EQUAL
  • COMMON-LISP:RETURN
  • COMMON-LISP:CONDITION
  • COMMON-LISP:CONTINUE
  • COMMON-LISP:BREAK

GLSL-PARSER-RULES

  • Function WHITESPACE
  • Function INTEGER-TOKEN
  • Function DECIMAL-TOKEN
  • Function OCTAL-TOKEN
  • Function HEXADECIMAL-TOKEN
  • Function FLOAT-TOKEN
  • Function IDENTIFIER-TOKEN
  • Function KEYWORD-TOKEN
  • Function PREPROCESSOR-TOKEN
  • Function ==
  • Function !=
  • Function =
  • Function +=
  • Function -=
  • Function *=
  • Function /=
  • Function %=
  • Function <<=
  • Function >>=
  • Function &=
  • Function ^=
  • Function |=
  • Function ++
  • Function --
  • Function <<
  • Function >>
  • Function ^^
  • Function ||
  • Function &&
  • Function <=
  • Function >=
  • Function <
  • Function >
  • Function +
  • Function -
  • Function *
  • Function /
  • Function %
  • Function &
  • Function ^
  • Function !
  • Function |
  • Function (
  • Function )
  • Function [
  • Function ]
  • Function {
  • Function }
  • Function ;
  • Function .
  • Function ?
  • Function :
  • Function ,
  • Function OPERATOR
  • Function TOKEN
  • Function TOKENIZE
  • Function INTEGER-CONSTANT
  • Function FLOAT-CONSTANT
  • Function BOOLEAN-CONSTANT
  • Function IDENTIFIER
  • Function PREPROCESSOR-DIRECTIVE
  • Function PRIMARY-EXPRESSION
  • Function POSTFIX-EXPRESSION
  • Function MODIFIED-REFERENCE
  • Function REFERENCE-MODIFIER
  • Function FIELD-MODIFIER
  • Function ARRAY-MODIFIER
  • Function INCREMENT-MODIFIER
  • Function DECREMENT-MODIFIER
  • Function CALL-MODIFIER
  • Function SAME-+
  • Function NEGATION
  • Function INVERSION
  • Function BIT-INVERSION
  • Function PREFIX-INCREMENT
  • Function PREFIX-DECREMENT
  • Function UNARY-EXPRESSION
  • Function MULTIPLICATION
  • Function DIVISION
  • Function MODULUS
  • Function ADDITION
  • Function SUBTRACTION
  • Function LEFT-SHIFT
  • Function RIGHT-SHIFT
  • Function LESS-THAN
  • Function GREATER-THAN
  • Function LESS-EQUAL-THAN
  • Function GREATER-EQUAL-THAN
  • Function EQUAL
  • Function NOT-EQUAL
  • Function BITWISE-AND
  • Function EXCLUSIVE-OR
  • Function INCLUSIVE-OR
  • Function LOGICAL-AND
  • Function LOGICAL-XOR
  • Function LOGICAL-OR
  • Function CONDITIONAL-EXPRESSION
  • Function CONDITIONAL
  • Function ASSIGNMENT-EXPRESSION
  • Function ASSIGNMENT
  • Function EXPRESSION
  • Function MULTIPLE-EXPRESSIONS
  • Function CONSTANT-EXPRESSION
  • Function DECLARATION
  • Function FUNCTION-DECLARATION
  • Function FUNCTION-PROTOTYPE
  • Function PARAMETER-DECLARATION
  • Function PRECISION-DECLARATION
  • Function VARIABLE-DECLARATION
  • Function VARIABLE-INITIALIZER
  • Function INVARIANT-QUALIFIER
  • Function INTERPOLATION-QUALIFIER
  • Function LAYOUT-QUALIFIER
  • Function LAYOUT-QUALIFIER-ID
  • Function PRECISE-QUALIFIER
  • Function STORAGE-QUALIFIER
  • Function SUBROUTINE-QUALIFIER
  • Function PRECISION-QUALIFIER
  • Function TYPE-QUALIFIER
  • Function TYPE-SPECIFIER
  • Function ARRAY-SPECIFIER
  • Function TYPE-SPECIFIER-NONARRAY
  • Function TYPE-NAME
  • Function BASIC-TYPE
  • Function STRUCT-SPECIFIER
  • Function STRUCT-DECLARATION
  • Function STRUCT-DECLARATOR
  • Function STRUCT-FIELD-DECLARATOR
  • Function INTERFACE-DECLARATION
  • Function INSTANCE-NAME
  • Function INITIALIZER
  • Function ARRAY-INITIALIZER
  • Function STATEMENT
  • Function SIMPLE-STATEMENT
  • Function COMPOUND-STATEMENT
  • Function EXPRESSION-STATEMENT
  • Function SELECTION-STATEMENT
  • Function CONDITION
  • Function CONDITION-DECLARATOR
  • Function SWITCH-STATEMENT
  • Function CASE-LABEL
  • Function ITERATION-STATEMENT
  • Function WHILE-STATEMENT
  • Function DO-STATEMENT
  • Function FOR-STATEMENT
  • Function JUMP-STATEMENT
  • Function CONTINUE
  • Function BREAK
  • Function RETURN
  • Function DISCARD
  • Function FUNCTION-DEFINITION
  • Function SHADER