summaryrefslogtreecommitdiff
path: root/test/trans.d/case/eofact_julia.rl
blob: 4b3eecd75156c5992ec057b6f75e3fb41c35302c (plain)
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
47
48
49
50
51
52
53
54
55
56
57
58
//
// @LANG: julia
// @GENERATED: true
//




%%{
	machine eofact;

	action a1 {print( "a1\n" );
}
	action a2 {print( "a2\n" );
}
	action a3 {print( "a3\n" );
}
	action a4 {print( "a4\n" );
}


	main := (
		'hello' @eof a1 %eof a2 '\n'? |
		'there' @eof a3 %eof a4
	);

}%%



%% write data;

function m( data::AbstractString )
	p = 0
	pe = length(data)
	eof = length(data)
	cs = 0
	buffer = ""

	%% write init;
	%% write exec;

	if ( cs >= eofact_first_final )
		println( "ACCEPT" );
	else
		println( "FAIL" );
	end
end

	m( "" );
	m( "h" );
	m( "hell" );
	m( "hello" );
	m( "hello\n" );
	m( "t" );
	m( "ther" );
	m( "there" );
	m( "friend" );