1*357f1050SThomas Veerman /*
2*357f1050SThomas Veerman * This file is part of flex.
3*357f1050SThomas Veerman *
4*357f1050SThomas Veerman * Redistribution and use in source and binary forms, with or without
5*357f1050SThomas Veerman * modification, are permitted provided that the following conditions
6*357f1050SThomas Veerman * are met:
7*357f1050SThomas Veerman *
8*357f1050SThomas Veerman * 1. Redistributions of source code must retain the above copyright
9*357f1050SThomas Veerman * notice, this list of conditions and the following disclaimer.
10*357f1050SThomas Veerman * 2. Redistributions in binary form must reproduce the above copyright
11*357f1050SThomas Veerman * notice, this list of conditions and the following disclaimer in the
12*357f1050SThomas Veerman * documentation and/or other materials provided with the distribution.
13*357f1050SThomas Veerman *
14*357f1050SThomas Veerman * Neither the name of the University nor the names of its contributors
15*357f1050SThomas Veerman * may be used to endorse or promote products derived from this software
16*357f1050SThomas Veerman * without specific prior written permission.
17*357f1050SThomas Veerman *
18*357f1050SThomas Veerman * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
19*357f1050SThomas Veerman * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
20*357f1050SThomas Veerman * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21*357f1050SThomas Veerman * PURPOSE.
22*357f1050SThomas Veerman */
23*357f1050SThomas Veerman
24*357f1050SThomas Veerman %{
25*357f1050SThomas Veerman /* Builds "scanner.c". */
26*357f1050SThomas Veerman /* The scanner itself is a no-op. A successful compilation is all we want. */
27*357f1050SThomas Veerman #include <stdio.h>
28*357f1050SThomas Veerman #include <stdlib.h>
29*357f1050SThomas Veerman #include "config.h"
30*357f1050SThomas Veerman
31*357f1050SThomas Veerman %}
32*357f1050SThomas Veerman %option reentrant
33*357f1050SThomas Veerman %option 8bit outfile="scanner.c" prefix="FOO"
34*357f1050SThomas Veerman %option nounput nomain noyywrap
35*357f1050SThomas Veerman %option warn
36*357f1050SThomas Veerman
37*357f1050SThomas Veerman
38*357f1050SThomas Veerman %%
39*357f1050SThomas Veerman
40*357f1050SThomas Veerman
41*357f1050SThomas Veerman .|\n|\r {
42*357f1050SThomas Veerman
43*357f1050SThomas Veerman /* Compile, but do not execute the following code. */
44*357f1050SThomas Veerman if( 0 ) {
45*357f1050SThomas Veerman FOO_create_buffer( (FILE*)0, 0, yyscanner);
46*357f1050SThomas Veerman FOO_delete_buffer( (YY_BUFFER_STATE)0, yyscanner);
47*357f1050SThomas Veerman FOO_flush_buffer( (YY_BUFFER_STATE)0, yyscanner);
48*357f1050SThomas Veerman FOO_init_buffer( (YY_BUFFER_STATE)0, (FILE*)0, yyscanner);
49*357f1050SThomas Veerman FOO_load_buffer_state( yyscanner);
50*357f1050SThomas Veerman FOO_scan_buffer( (char*)0, (yy_size_t)0, yyscanner);
51*357f1050SThomas Veerman FOO_scan_bytes( (yyconst char*)0, 0, yyscanner);
52*357f1050SThomas Veerman FOO_scan_string( (yyconst char*)0, yyscanner);
53*357f1050SThomas Veerman FOO_switch_to_buffer( (YY_BUFFER_STATE)0, yyscanner);
54*357f1050SThomas Veerman FOOrestart( (FILE*)0, (yyscan_t )0);
55*357f1050SThomas Veerman
56*357f1050SThomas Veerman FOOget_extra( (yyscan_t )0 );
57*357f1050SThomas Veerman FOOget_in( (yyscan_t )0 );
58*357f1050SThomas Veerman FOOget_leng( (yyscan_t )0 );
59*357f1050SThomas Veerman FOOget_out( (yyscan_t )0 );
60*357f1050SThomas Veerman FOOget_text( (yyscan_t )0 );
61*357f1050SThomas Veerman FOOlex( (yyscan_t )0 );
62*357f1050SThomas Veerman FOOlex_destroy( (yyscan_t )0 );
63*357f1050SThomas Veerman FOOlex_init( (yyscan_t *)0 );
64*357f1050SThomas Veerman FOOset_extra( (void *)0, (yyscan_t )0 );
65*357f1050SThomas Veerman FOOset_in( (FILE*)0, (yyscan_t )0 );
66*357f1050SThomas Veerman FOOset_out( (FILE*)0, (yyscan_t )0 );
67*357f1050SThomas Veerman }
68*357f1050SThomas Veerman }
69*357f1050SThomas Veerman %%
70*357f1050SThomas Veerman
71*357f1050SThomas Veerman int main(void);
72*357f1050SThomas Veerman
73*357f1050SThomas Veerman int
main()74*357f1050SThomas Veerman main ()
75*357f1050SThomas Veerman {
76*357f1050SThomas Veerman yyscan_t scanner;
77*357f1050SThomas Veerman FOOlex_init( &scanner);
78*357f1050SThomas Veerman FOOlex( scanner);
79*357f1050SThomas Veerman FOOlex_destroy( scanner);
80*357f1050SThomas Veerman printf( "TEST RETURNING OK.\n");
81*357f1050SThomas Veerman return 0;
82*357f1050SThomas Veerman }
83*357f1050SThomas Veerman
84