mojoshader_lexer.re
changeset 631 5045dcc9fdaf
parent 616 9f087be64555
child 635 be3b428802a1
equal deleted inserted replaced
630:e6bd53dd1f91 631:5045dcc9fdaf
    67     NEWLINE = ("\r\n" | "\r" | "\n");
    67     NEWLINE = ("\r\n" | "\r" | "\n");
    68     WHITESPACE = [ \t\v\f]+;
    68     WHITESPACE = [ \t\v\f]+;
    69 */
    69 */
    70 
    70 
    71 /*!re2c
    71 /*!re2c
       
    72     "\\" [ \t\v\f]* NEWLINE  { s->line++; goto scanner_loop; }
       
    73 
    72     "/*"            { goto multilinecomment; }
    74     "/*"            { goto multilinecomment; }
    73     "//"            { goto singlelinecomment; }
    75     "//"            { goto singlelinecomment; }
    74 
    76 
    75     L (L|D)*        { RET(TOKEN_IDENTIFIER); }
    77     L (L|D)*        { RET(TOKEN_IDENTIFIER); }
    76     
    78     
    81     (D+ E FS?) | (D* "." D+ E? FS?) | (D+ "." D* E? FS?)
    83     (D+ E FS?) | (D* "." D+ E? FS?) | (D+ "." D* E? FS?)
    82                     { RET(TOKEN_FLOAT_LITERAL); }
    84                     { RET(TOKEN_FLOAT_LITERAL); }
    83     
    85     
    84     (["] (ESC|ANY\[\r\n\\"])* ["])
    86     (["] (ESC|ANY\[\r\n\\"])* ["])
    85                     { RET(TOKEN_STRING_LITERAL); }
    87                     { RET(TOKEN_STRING_LITERAL); }
    86     
    88 
    87     ">>="           { RET(TOKEN_RSHIFTASSIGN); }
    89     ">>="           { RET(TOKEN_RSHIFTASSIGN); }
    88     "<<="           { RET(TOKEN_LSHIFTASSIGN); }
    90     "<<="           { RET(TOKEN_LSHIFTASSIGN); }
    89     "+="            { RET(TOKEN_ADDASSIGN); }
    91     "+="            { RET(TOKEN_ADDASSIGN); }
    90     "-="            { RET(TOKEN_SUBASSIGN); }
    92     "-="            { RET(TOKEN_SUBASSIGN); }
    91     "*="            { RET(TOKEN_MULTASSIGN); }
    93     "*="            { RET(TOKEN_MULTASSIGN); }
   127     ";"             { RET(';'); }
   129     ";"             { RET(';'); }
   128     "{"             { RET('{'); }
   130     "{"             { RET('{'); }
   129     "}"             { RET('}'); }
   131     "}"             { RET('}'); }
   130     "="             { RET('='); }
   132     "="             { RET('='); }
   131     "?"             { RET('?'); }
   133     "?"             { RET('?'); }
   132     "\\"            { RET('\\'); }
       
   133 
   134 
   134     PP "include"    { RET(TOKEN_PP_INCLUDE); }
   135     PP "include"    { RET(TOKEN_PP_INCLUDE); }
   135     PP "line"       { RET(TOKEN_PP_LINE); }
   136     PP "line"       { RET(TOKEN_PP_LINE); }
   136     PP "define"     { RET(TOKEN_PP_DEFINE); }
   137     PP "define"     { RET(TOKEN_PP_DEFINE); }
   137     PP "undef"      { RET(TOKEN_PP_UNDEF); }
   138     PP "undef"      { RET(TOKEN_PP_UNDEF); }