| OLD | NEW |
| 1 // Portions of this code based on re2c: | 1 // Portions of this code based on re2c: |
| 2 // (re2c/examples/push.re) | 2 // (re2c/examples/push.re) |
| 3 // Copyright 2013 the V8 project authors. All rights reserved. | 3 // Copyright 2013 the V8 project authors. All rights reserved. |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
| 9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
| 10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 limit_ += input_size; | 210 limit_ += input_size; |
| 211 | 211 |
| 212 #define SKIP() { start_ = cursor_; YYSETCONDITION(kConditionNorma
l); goto yyc_Normal; } | 212 #define SKIP() { start_ = cursor_; YYSETCONDITION(kConditionNorma
l); goto yyc_Normal; } |
| 213 #define YYFILL(n) { goto fill; } | 213 #define YYFILL(n) { goto fill; } |
| 214 | 214 |
| 215 #define YYGETSTATE() state_ | 215 #define YYGETSTATE() state_ |
| 216 #define YYSETSTATE(x) { state_ = (x); } | 216 #define YYSETSTATE(x) { state_ = (x); } |
| 217 | 217 |
| 218 #define YYGETCONDITION() condition_ | 218 #define YYGETCONDITION() condition_ |
| 219 #define YYSETCONDITION(x) { condition_ = (x); } | 219 #define YYSETCONDITION(x) { condition_ = (x); } |
| 220 #define YYDEBUG(state, current) {printf("%d: |%c| (%d)\n", state, current, (int)
(current));} |
| 220 | 221 |
| 221 start_: | 222 start_: |
| 222 if (FLAG_trace_lexer) { | 223 if (FLAG_trace_lexer) { |
| 223 printf("Starting a round; state_: %d, condition_: %d\n", state_, condition_)
; | 224 printf("Starting a round; state_: %d, condition_: %d\n", state_, condition_)
; |
| 224 } | 225 } |
| 225 | 226 |
| 226 /*!re2c | 227 /*!re2c |
| 227 re2c:indent:top = 1; | 228 re2c:indent:top = 1; |
| 228 re2c:yych:conversion = 0; | 229 re2c:yych:conversion = 0; |
| 229 re2c:condenumprefix = kCondition; | 230 re2c:condenumprefix = kCondition; |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 size_t start_offset = start_ - buffer_; | 432 size_t start_offset = start_ - buffer_; |
| 432 memmove(buffer_, start_, limit_ - start_); | 433 memmove(buffer_, start_, limit_ - start_); |
| 433 marker_ -= start_offset; | 434 marker_ -= start_offset; |
| 434 cursor_ -= start_offset; | 435 cursor_ -= start_offset; |
| 435 limit_ -= start_offset; | 436 limit_ -= start_offset; |
| 436 start_ -= start_offset; | 437 start_ -= start_offset; |
| 437 real_start_ += start_offset; | 438 real_start_ += start_offset; |
| 438 } | 439 } |
| 439 return 0; | 440 return 0; |
| 440 } | 441 } |
| OLD | NEW |