1 /* Generated by re2c */ 2 // re2c $INPUT -o $OUTPUT -i --type-header src/lexer/lexer.h 3 #include <assert.h> 4 #include "src/lexer/lexer.h" // generated by re2c 5 6 7 lex(LexerState * st)8int lex(LexerState *st) 9 { 10 11 { 12 char yych; 13 yych = *st->cur; 14 switch (yych) { 15 case 'x': goto yy4; 16 default: goto yy2; 17 } 18 yy2: 19 ++st->cur; 20 yy3: 21 { return 1; } 22 yy4: 23 yych = *(st->mar = ++st->cur); 24 switch (yych) { 25 case 'x': 26 st->yyt1 = st->cur; 27 goto yy5; 28 default: goto yy3; 29 } 30 yy5: 31 yych = *++st->cur; 32 switch (yych) { 33 case 'x': 34 st->yyt2 = st->cur; 35 goto yy7; 36 default: goto yy6; 37 } 38 yy6: 39 st->cur = st->mar; 40 goto yy3; 41 yy7: 42 yych = *++st->cur; 43 switch (yych) { 44 case 'x': 45 st->yyt3 = st->cur; 46 goto yy8; 47 default: goto yy6; 48 } 49 yy8: 50 yych = *++st->cur; 51 switch (yych) { 52 case 'x': 53 st->yyt1 = st->cur; 54 goto yy10; 55 default: goto yy9; 56 } 57 yy9: 58 st->cur = st->yyt1; 59 { return 0; } 60 yy10: 61 yych = *++st->cur; 62 switch (yych) { 63 case 'x': goto yy11; 64 default: 65 st->yyt1 = st->yyt2; 66 goto yy9; 67 } 68 yy11: 69 yych = *++st->cur; 70 switch (yych) { 71 case 'x': goto yy12; 72 default: 73 st->yyt1 = st->yyt3; 74 goto yy9; 75 } 76 yy12: 77 yych = *++st->cur; 78 switch (yych) { 79 case 'x': goto yy13; 80 default: goto yy9; 81 } 82 yy13: 83 yych = *++st->cur; 84 switch (yych) { 85 case 'x': goto yy14; 86 default: goto yy9; 87 } 88 yy14: 89 ++st->cur; 90 goto yy9; 91 } 92 93 } 94 main()95int main() 96 { 97 LexerState st; 98 st.str = st.cur = "xxxxxxxx"; 99 assert(lex(&st) == 0 && st.cur - st.str == 4); 100 return 0; 101 } 102 /* Generated by re2c */ 103 104 105 typedef struct { 106 const char *str, *cur, *mar; 107 const char *yyt1; const char *yyt2; const char *yyt3; 108 } LexerState; 109 110 c/headers/header.re:25:24: warning: trailing context has 4th degree of nondeterminism [-Wnondeterministic-tags] 111