File: 01_basic_conv.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 (38 lines) | stat: -rw-r--r-- 756 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
/* Generated by re2d */
#line 1 "codegen/d/01_basic_conv.re"
// re2d $INPUT -o $OUTPUT
module main;

bool lex(const(char)* yycursor) {
    
#line 9 "codegen/d/01_basic_conv.d"
{
    byte yych;
    yych = cast(byte)*yycursor;
    switch (yych) {
        case '1': .. case '9': goto yy2;
        default: goto yy1;
    }
yy1:
    ++yycursor;
#line 12 "codegen/d/01_basic_conv.re"
    { return false; }
#line 21 "codegen/d/01_basic_conv.d"
yy2:
    yych = cast(byte)*++yycursor;
    switch (yych) {
        case '0': .. case '9': goto yy2;
        default: goto yy3;
    }
yy3:
#line 11 "codegen/d/01_basic_conv.re"
    { return true; }
#line 31 "codegen/d/01_basic_conv.d"
}
#line 13 "codegen/d/01_basic_conv.re"

}

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