X-Git-Url: https://git.hcoop.net/bpt/coccinelle.git/blobdiff_plain/7f00441914f5b9bd4f845a1c866da65e1946083e..9bc82bae75129fec4d981ebf245f2f7d7ca73a41:/parsing_cocci/lexer_script.mll
diff --git a/parsing_cocci/lexer_script.mll b/parsing_cocci/lexer_script.mll
index f1ec8ef..c0b6c3c 100644
--- a/parsing_cocci/lexer_script.mll
+++ b/parsing_cocci/lexer_script.mll
@@ -1,19 +1,70 @@
+(*
+ * Copyright 2010, INRIA, University of Copenhagen
+ * Julia Lawall, Rene Rydhof Hansen, Gilles Muller, Nicolas Palix
+ * Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen
+ * Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller, Nicolas Palix
+ * This file is part of Coccinelle.
+ *
+ * Coccinelle is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, according to version 2 of the License.
+ *
+ * Coccinelle is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Coccinelle. If not, see .
+ *
+ * The authors reserve the right to distribute this or future versions of
+ * Coccinelle under other licenses.
+ *)
+
+
+(*
+ * Copyright 2010, INRIA, University of Copenhagen
+ * Julia Lawall, Rene Rydhof Hansen, Gilles Muller, Nicolas Palix
+ * Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen
+ * Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller, Nicolas Palix
+ * This file is part of Coccinelle.
+ *
+ * Coccinelle is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, according to version 2 of the License.
+ *
+ * Coccinelle is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Coccinelle. If not, see .
+ *
+ * The authors reserve the right to distribute this or future versions of
+ * Coccinelle under other licenses.
+ *)
+
+
{
open Parser_cocci_menhir
module D = Data
module Ast = Ast_cocci
exception Lexical of string
let tok = Lexing.lexeme
+let inc_line _ = Lexer_cocci.line := !Lexer_cocci.line + 1
}
(* ---------------------------------------------------------------------- *)
(* tokens *)
-let myrule = [^'"''@']+
+let myrule = [^'"''@''/''\n''\r''\011''\012']+
rule token = parse
- | myrule { TScriptData (tok lexbuf) }
+ | myrule { TScriptData (tok lexbuf) }
+ | ['\n' '\r' '\011' '\012'] { inc_line(); TScriptData (tok lexbuf) }
| "@@" { TArobArob }
| "@" { TArob }
+ | "/" { TScriptData (tok lexbuf) }
| "//" [^ '\n']* { token lexbuf } (* skip SmPL comments *)
| '"' { TScriptData (Printf.sprintf "\"%s\"" (string lexbuf)) }
| eof { EOF }