mojoshader_preprocessor.c
changeset 684 aadf9aad508a
parent 683 54b8cf85b9b9
child 685 687e9def5cc6
equal deleted inserted replaced
683:54b8cf85b9b9 684:aadf9aad508a
  1255 static int find_precedence(const Token token)
  1255 static int find_precedence(const Token token)
  1256 {
  1256 {
  1257     // operator precedence, left and right associative...
  1257     // operator precedence, left and right associative...
  1258     typedef struct { int precedence; Token token; } Precedence;
  1258     typedef struct { int precedence; Token token; } Precedence;
  1259     static const Precedence ops[] = {
  1259     static const Precedence ops[] = {
  1260         { 0, TOKEN_OROR }, { 1, TOKEN_ANDAND }, { 2, TOKEN_ANDAND },
  1260         { 0, TOKEN_OROR }, { 1, TOKEN_ANDAND }, { 2, ((Token) '|') },
  1261         { 3, ((Token) '|') }, { 4, ((Token) '^') }, { 5, ((Token) '&') },
  1261         { 3, ((Token) '^') }, { 4, ((Token) '&') }, { 5, TOKEN_NEQ },
  1262         { 6, TOKEN_NEQ }, { 6, TOKEN_EQL }, { 7, ((Token) '<') },
  1262         { 6, TOKEN_EQL }, { 7, ((Token) '<') }, { 7, ((Token) '>') },
  1263         { 7, ((Token) '>') }, { 7, TOKEN_LEQ }, { 7, TOKEN_GEQ },
  1263         { 7, TOKEN_LEQ }, { 7, TOKEN_GEQ }, { 8, TOKEN_LSHIFT },
  1264         { 8, TOKEN_LSHIFT }, { 8, TOKEN_RSHIFT }, { 9, ((Token) '-') },
  1264         { 8, TOKEN_RSHIFT }, { 9, ((Token) '-') }, { 9, ((Token) '+') },
  1265         { 9, ((Token) '+') }, { 10, ((Token) '%') }, { 10, ((Token) '/') },
  1265         { 10, ((Token) '%') }, { 10, ((Token) '/') }, { 10, ((Token) '*') },
  1266         { 10, ((Token) '*') }, { 11, TOKEN_PP_UNARY_PLUS },
  1266         { 11, TOKEN_PP_UNARY_PLUS }, { 11, TOKEN_PP_UNARY_MINUS },
  1267         { 11, TOKEN_PP_UNARY_MINUS }, { 11, ((Token) '!') },
  1267         { 11, ((Token) '!') }, { 11, ((Token) '~') },
  1268         { 11, ((Token) '~') },
       
  1269     };
  1268     };
  1270 
  1269 
  1271     int i;
  1270     int i;
  1272     for (i = 0; i < STATICARRAYLEN(ops); i++)
  1271     for (i = 0; i < STATICARRAYLEN(ops); i++)
  1273     {
  1272     {