File: 01_basic_d.d

package info (click to toggle)
re2c 4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 50,052 kB
  • sloc: cpp: 32,477; ml: 8,279; sh: 5,265; makefile: 968; haskell: 612; python: 428; ansic: 227; javascript: 111; java: 3
file content (46 lines) | stat: -rw-r--r-- 1,009 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* Generated by re2d */
#line 1 "codegen/d/01_basic_d.re"
// re2d $INPUT -o $OUTPUT -d
module main;

import core.stdc.stdio;

bool lex(const char *s) {
    size_t cursor;
    
#line 12 "codegen/d/01_basic_d.d"
{
    char yych;
    yych = s[cursor];
    debug{printf("lex1: char '%c' at state %u\n", yych, 0);}
    switch (yych) {
        case '1': .. case '9': goto yy2;
        default: goto yy1;
    }
yy1:
    debug{printf("lex1: char '%c' at state %u\n", yych, 1);}
    ++cursor;
#line 19 "codegen/d/01_basic_d.re"
    { return false; }
#line 26 "codegen/d/01_basic_d.d"
yy2:
    debug{printf("lex1: char '%c' at state %u\n", yych, 2);}
    ++cursor;
    yych = s[cursor];
    switch (yych) {
        case '0': .. case '9': goto yy2;
        default: goto yy3;
    }
yy3:
    debug{printf("lex1: char '%c' at state %u\n", yych, 3);}
#line 18 "codegen/d/01_basic_d.re"
    { return true; }
#line 39 "codegen/d/01_basic_d.d"
}
#line 20 "codegen/d/01_basic_d.re"

}

void main() {
    assert(lex("1234"));
}