2 open Parser_cocci_menhir
5 exception Lexical of string
6 let tok = Lexing.lexeme
8 (* ---------------------------------------------------------------------- *)
11 let myrule = [^'"''@']+
14 | myrule { TScriptData (tok lexbuf) }
17 | "//" [^ '\n']* { token lexbuf } (* skip SmPL comments *)
18 | '"' { TScriptData (Printf.sprintf "\"%s\"" (string lexbuf)) }
20 | _ { raise (Lexical ("unrecognised symbol, in token rule:"^tok lexbuf)) }
22 (* These are C strings. Perhaps they require some adjustment. *)
25 | (_ as x) { Common.string_of_char x ^ string lexbuf }
26 | ("\\" _) as x { x ^ string lexbuf }