xref: /minix3/external/bsd/flex/dist/tests/test-array-r/scanner.l (revision 357f1050293be536ca8309aae20889945ce99fc1)
1*357f1050SThomas Veerman /*	$NetBSD: scanner.l,v 1.1.1.1 2009/10/26 00:29:30 christos Exp $	*/
2*357f1050SThomas Veerman 
3*357f1050SThomas Veerman /*
4*357f1050SThomas Veerman  * This file is part of flex.
5*357f1050SThomas Veerman  *
6*357f1050SThomas Veerman  * Redistribution and use in source and binary forms, with or without
7*357f1050SThomas Veerman  * modification, are permitted provided that the following conditions
8*357f1050SThomas Veerman  * are met:
9*357f1050SThomas Veerman  *
10*357f1050SThomas Veerman  * 1. Redistributions of source code must retain the above copyright
11*357f1050SThomas Veerman  *    notice, this list of conditions and the following disclaimer.
12*357f1050SThomas Veerman  * 2. Redistributions in binary form must reproduce the above copyright
13*357f1050SThomas Veerman  *    notice, this list of conditions and the following disclaimer in the
14*357f1050SThomas Veerman  *    documentation and/or other materials provided with the distribution.
15*357f1050SThomas Veerman  *
16*357f1050SThomas Veerman  * Neither the name of the University nor the names of its contributors
17*357f1050SThomas Veerman  * may be used to endorse or promote products derived from this software
18*357f1050SThomas Veerman  * without specific prior written permission.
19*357f1050SThomas Veerman  *
20*357f1050SThomas Veerman  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
21*357f1050SThomas Veerman  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
22*357f1050SThomas Veerman  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23*357f1050SThomas Veerman  * PURPOSE.
24*357f1050SThomas Veerman  */
25*357f1050SThomas Veerman 
26*357f1050SThomas Veerman %{
27*357f1050SThomas Veerman /* A template scanner file to build "scanner.c". */
28*357f1050SThomas Veerman #include <stdio.h>
29*357f1050SThomas Veerman #include <stdlib.h>
30*357f1050SThomas Veerman #include "config.h"
31*357f1050SThomas Veerman /*#include "parser.h" */
32*357f1050SThomas Veerman 
33*357f1050SThomas Veerman %}
34*357f1050SThomas Veerman 
35*357f1050SThomas Veerman %option 8bit outfile="scanner.c" prefix="test"
36*357f1050SThomas Veerman %option nounput nomain noyywrap
37*357f1050SThomas Veerman %option warn array reentrant
38*357f1050SThomas Veerman 
39*357f1050SThomas Veerman 
40*357f1050SThomas Veerman %%
41*357f1050SThomas Veerman 
42*357f1050SThomas Veerman .|\n    { }
43*357f1050SThomas Veerman 
44*357f1050SThomas Veerman 
45*357f1050SThomas Veerman %%
46*357f1050SThomas Veerman 
47*357f1050SThomas Veerman int main(void);
48*357f1050SThomas Veerman 
49*357f1050SThomas Veerman int
50*357f1050SThomas Veerman main ()
51*357f1050SThomas Veerman {
52*357f1050SThomas Veerman     yyscan_t lexer;
53*357f1050SThomas Veerman 
54*357f1050SThomas Veerman 	yylex_init(&lexer);
55*357f1050SThomas Veerman     yyset_in(stdin, lexer);
56*357f1050SThomas Veerman     yyset_out(stdout, lexer);
57*357f1050SThomas Veerman 
58*357f1050SThomas Veerman     yylex( lexer );
59*357f1050SThomas Veerman 
60*357f1050SThomas Veerman     yylex_destroy( lexer);
61*357f1050SThomas Veerman     printf("TEST RETURNING OK.\n");
62*357f1050SThomas Veerman 
63*357f1050SThomas Veerman     return 0;
64*357f1050SThomas Veerman }
65