afe4cb59c2f2cba0332d9e986abc30e77948a33a
[bpt/coccinelle.git] / parsing_cocci / lexer_script.ml
1 # 0 "lexer_script.mll"
2
3 open Parser_cocci_menhir
4 module D = Data
5 module Ast = Ast_cocci
6 exception Lexical of string
7 let tok = Lexing.lexeme
8 let inc_line _ = Lexer_cocci.line := !Lexer_cocci.line + 1
9
10 # 11 "lexer_script.ml"
11 let __ocaml_lex_tables = {
12 Lexing.lex_base =
13 "\000\000\247\255\248\255\249\255\001\000\001\000\254\255\004\000\
14 \253\255\008\000\001\000\254\255\255\255\002\000\254\255\255\255\
15 ";
16 Lexing.lex_backtrk =
17 "\255\255\255\255\255\255\255\255\004\000\003\000\255\255\000\000\
18 \255\255\005\000\255\255\255\255\255\255\255\255\255\255\255\255\
19 ";
20 Lexing.lex_default =
21 "\007\000\000\000\000\000\000\000\255\255\255\255\000\000\007\000\
22 \000\000\009\000\011\000\000\000\000\000\014\000\000\000\000\000\
23 ";
24 Lexing.lex_trans =
25 "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
26 \000\000\000\000\006\000\006\000\006\000\006\000\255\255\255\255\
27 \255\255\255\255\255\255\000\000\000\000\000\000\000\000\000\000\
28 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
29 \000\000\000\000\003\000\012\000\000\000\000\000\255\255\002\000\
30 \000\000\015\000\000\000\255\255\000\000\000\000\000\000\004\000\
31 \009\000\000\000\000\000\255\255\000\000\000\000\000\000\000\000\
32 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
33 \005\000\008\000\000\000\000\000\255\255\000\000\000\000\000\000\
34 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
35 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
36 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
37 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
38 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
39 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
40 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
41 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
42 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
43 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
44 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
45 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
46 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
47 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
48 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
49 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
50 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
51 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
52 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
53 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
54 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
55 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
56 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
57 \001\000\255\255\255\255\000\000\255\255\000\000\000\000\000\000\
58 \255\255";
59 Lexing.lex_check =
60 "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
61 \255\255\255\255\000\000\000\000\000\000\000\000\007\000\007\000\
62 \007\000\007\000\009\000\255\255\255\255\255\255\255\255\255\255\
63 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
64 \255\255\255\255\000\000\010\000\255\255\255\255\007\000\000\000\
65 \255\255\013\000\255\255\007\000\255\255\255\255\255\255\000\000\
66 \004\000\255\255\255\255\007\000\255\255\255\255\255\255\255\255\
67 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
68 \000\000\005\000\255\255\255\255\007\000\255\255\255\255\255\255\
69 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
70 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
71 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
72 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
73 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
74 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
75 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
76 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
77 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
78 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
79 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
80 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
81 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
82 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
83 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
84 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
85 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
86 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
87 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
88 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
89 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
90 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
91 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
92 \000\000\010\000\013\000\255\255\007\000\255\255\255\255\255\255\
93 \009\000";
94 Lexing.lex_base_code =
95 "";
96 Lexing.lex_backtrk_code =
97 "";
98 Lexing.lex_default_code =
99 "";
100 Lexing.lex_trans_code =
101 "";
102 Lexing.lex_check_code =
103 "";
104 Lexing.lex_code =
105 "";
106 }
107
108 let rec token lexbuf =
109 __ocaml_lex_token_rec lexbuf 0
110 and __ocaml_lex_token_rec lexbuf __ocaml_lex_state =
111 match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
112 | 0 ->
113 # 17 "lexer_script.mll"
114 ( TScriptData (tok lexbuf) )
115 # 116 "lexer_script.ml"
116
117 | 1 ->
118 # 18 "lexer_script.mll"
119 ( inc_line(); TScriptData (tok lexbuf) )
120 # 121 "lexer_script.ml"
121
122 | 2 ->
123 # 19 "lexer_script.mll"
124 ( TArobArob )
125 # 126 "lexer_script.ml"
126
127 | 3 ->
128 # 20 "lexer_script.mll"
129 ( TArob )
130 # 131 "lexer_script.ml"
131
132 | 4 ->
133 # 21 "lexer_script.mll"
134 ( TScriptData (tok lexbuf) )
135 # 136 "lexer_script.ml"
136
137 | 5 ->
138 # 22 "lexer_script.mll"
139 ( token lexbuf )
140 # 141 "lexer_script.ml"
141
142 | 6 ->
143 # 23 "lexer_script.mll"
144 ( TScriptData (Printf.sprintf "\"%s\"" (string lexbuf)) )
145 # 146 "lexer_script.ml"
146
147 | 7 ->
148 # 24 "lexer_script.mll"
149 ( TScriptData (Printf.sprintf "'%s'" (cstring lexbuf)) )
150 # 151 "lexer_script.ml"
151
152 | 8 ->
153 # 25 "lexer_script.mll"
154 ( EOF )
155 # 156 "lexer_script.ml"
156
157 | 9 ->
158 # 26 "lexer_script.mll"
159 ( raise (Lexical ("unrecognised symbol, in token rule:"^tok lexbuf)) )
160 # 161 "lexer_script.ml"
161
162 | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf; __ocaml_lex_token_rec lexbuf __ocaml_lex_state
163
164 and string lexbuf =
165 __ocaml_lex_string_rec lexbuf 10
166 and __ocaml_lex_string_rec lexbuf __ocaml_lex_state =
167 match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
168 | 0 ->
169 # 30 "lexer_script.mll"
170 ( "" )
171 # 172 "lexer_script.ml"
172
173 | 1 ->
174 let
175 # 31 "lexer_script.mll"
176 x
177 # 178 "lexer_script.ml"
178 = Lexing.sub_lexeme_char lexbuf lexbuf.Lexing.lex_start_pos in
179 # 31 "lexer_script.mll"
180 ( (String.make 1 x) ^ string lexbuf )
181 # 182 "lexer_script.ml"
182
183 | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf; __ocaml_lex_string_rec lexbuf __ocaml_lex_state
184
185 and cstring lexbuf =
186 __ocaml_lex_cstring_rec lexbuf 13
187 and __ocaml_lex_cstring_rec lexbuf __ocaml_lex_state =
188 match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
189 | 0 ->
190 # 34 "lexer_script.mll"
191 ( "" )
192 # 193 "lexer_script.ml"
193
194 | 1 ->
195 let
196 # 35 "lexer_script.mll"
197 x
198 # 199 "lexer_script.ml"
199 = Lexing.sub_lexeme_char lexbuf lexbuf.Lexing.lex_start_pos in
200 # 35 "lexer_script.mll"
201 ( (String.make 1 x) ^ cstring lexbuf )
202 # 203 "lexer_script.ml"
203
204 | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf; __ocaml_lex_cstring_rec lexbuf __ocaml_lex_state
205
206 ;;
207