mojoshader_internal.h
changeset 601 bb1484be4e1b
parent 598 decc32dc03a7
child 603 c7a964b1b0eb
equal deleted inserted replaced
600:f42d58194dc1 601:bb1484be4e1b
   287 // preprocessor stuff.
   287 // preprocessor stuff.
   288 
   288 
   289 typedef enum
   289 typedef enum
   290 {
   290 {
   291     TOKEN_UNKNOWN = 256,  // start past ASCII character values.
   291     TOKEN_UNKNOWN = 256,  // start past ASCII character values.
       
   292 
       
   293     // These are all C-like constructs. Tokens < 256 may be single
       
   294     //  chars (like '+' or whatever). These are just multi-char sequences
       
   295     //  (like "+=" or whatever).
   292     TOKEN_IDENTIFIER,
   296     TOKEN_IDENTIFIER,
   293     TOKEN_INT_LITERAL,
   297     TOKEN_INT_LITERAL,
   294     TOKEN_FLOAT_LITERAL,
   298     TOKEN_FLOAT_LITERAL,
   295     TOKEN_STRING_LITERAL,
   299     TOKEN_STRING_LITERAL,
   296     TOKEN_RSHIFTASSIGN,
   300     TOKEN_RSHIFTASSIGN,
   312     TOKEN_LEQ,
   316     TOKEN_LEQ,
   313     TOKEN_GEQ,
   317     TOKEN_GEQ,
   314     TOKEN_EQL,
   318     TOKEN_EQL,
   315     TOKEN_NEQ,
   319     TOKEN_NEQ,
   316     TOKEN_HASHHASH,
   320     TOKEN_HASHHASH,
       
   321 
       
   322     // This is returned at the end of input...no more to process.
       
   323     TOKEN_EOI,
       
   324 
       
   325     // This is returned for char sequences we think are bogus. You'll have
       
   326     //  to judge for yourself. In most cases, you'll probably just fail with
       
   327     //  bogus syntax without explicitly checking for this token.
       
   328     TOKEN_BAD_CHARS,
       
   329 
       
   330     // This is returned if there's an error condition (the error is returned
       
   331     //  as a NULL-terminated string from preprocessor_nexttoken(), instead
       
   332     //  of actual token data). You can continue getting tokens after this
       
   333     //  is reported. It happens for things like missing #includes, etc.
       
   334     TOKEN_PREPROCESSING_ERROR,
       
   335 
       
   336     TOKEN_INCOMPLETE_COMMENT,  // caught, becomes TOKEN_PREPROCESSING_ERROR
       
   337 
       
   338     // These are all caught by the preprocessor. Caller won't ever see them.
   317     TOKEN_PP_INCLUDE,
   339     TOKEN_PP_INCLUDE,
   318     TOKEN_PP_LINE,
   340     TOKEN_PP_LINE,
   319     TOKEN_PP_DEFINE,
   341     TOKEN_PP_DEFINE,
   320     TOKEN_PP_UNDEF,
   342     TOKEN_PP_UNDEF,
   321     TOKEN_PP_IF,
   343     TOKEN_PP_IF,
   322     TOKEN_PP_IFDEF,
   344     TOKEN_PP_IFDEF,
   323     TOKEN_PP_IFNDEF,
   345     TOKEN_PP_IFNDEF,
   324     TOKEN_PP_ELSE,
   346     TOKEN_PP_ELSE,
   325     TOKEN_PP_ELIF,
   347     TOKEN_PP_ELIF,
   326     TOKEN_PP_ENDIF,
   348     TOKEN_PP_ENDIF,
   327     TOKEN_PP_ERROR,
   349     TOKEN_PP_ERROR,  // caught, becomes TOKEN_PREPROCESSING_ERROR
   328     TOKEN_PP_INCOMPLETE_COMMENT,
       
   329     TOKEN_PP_BAD_CHARS,
       
   330     TOKEN_EOI,
       
   331     TOKEN_PREPROCESSING_ERROR
       
   332 } Token;
   350 } Token;
   333 
   351 
   334 
   352 
   335 // This is opaque.
   353 // This is opaque.
   336 struct Preprocessor;
   354 struct Preprocessor;