File: scan3.rl

package info (click to toggle)
ragel 6.8-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 4,760 kB
  • ctags: 5,054
  • sloc: cpp: 46,722; ansic: 5,143; sh: 1,628; makefile: 225; ruby: 189
file content (32 lines) | stat: -rw-r--r-- 435 bytes parent folder | download | duplicates (9)
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
/*
 * @LANG: indep
 */
ptr ts;
ptr te;
int act;
int token;
%%
%%{
	machine scanner;

	# Warning: changing the patterns or the input string will affect the
	# coverage of the scanner action types.
	main := |*
		'a' => {
			prints "pat1\n";
		};
		'b' => {
			prints "pat2\n";
		};
        [ab] any*  => {
			prints "pat3\n";
		};
	*|;
}%%
/* _____INPUT_____
"ab89"
_____INPUT_____ */
/* _____OUTPUT_____
pat3
ACCEPT
_____OUTPUT_____ */