]> gerrit.simantics Code Review - simantics/fmil.git/blobdiff - org.simantics.fmil.core/native/FMILibrary/src/XML/src/FMI2/fmi2_xml_variable_name_scan.l
Add FMILibrary-2.0.3 to org.simantics.fmil.core\native.
[simantics/fmil.git] / org.simantics.fmil.core / native / FMILibrary / src / XML / src / FMI2 / fmi2_xml_variable_name_scan.l
diff --git a/org.simantics.fmil.core/native/FMILibrary/src/XML/src/FMI2/fmi2_xml_variable_name_scan.l b/org.simantics.fmil.core/native/FMILibrary/src/XML/src/FMI2/fmi2_xml_variable_name_scan.l
new file mode 100644 (file)
index 0000000..c8c83b0
--- /dev/null
@@ -0,0 +1,51 @@
+/*\r
+    Copyright (C) 2012 Modelon AB\r
+\r
+    This program is free software: you can redistribute it and/or modify\r
+    it under the terms of the BSD style license.\r
+\r
+     This program is distributed in the hope that it will be useful,\r
+    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+    FMILIB_License.txt file for more details.\r
+\r
+    You should have received a copy of the FMILIB_License.txt file\r
+    along with this program. If not, contact Modelon AB <http://www.modelon.com>.\r
+*/\r
+\r
+%{\r
+\r
+#include "fmi2_xml_variable_name_parser.tab.h"\r
+#define YYSTYPE YYFMI2STYPE\r
+\r
+#define LEX_VAL(ID_NAME) return ID_NAME;\r
+%}\r
+\r
+%option bison-bridge\r
+\r
+q_name         "'"({q_char}|{s_escape})+"'"\r
+nondigit       [_a-zA-Z]\r
+digit          [0-9]\r
+q_char         {nondigit}|{digit}|[!#$%&()*+,-\./:;<>=?@\[\]\^{}|~ ]\r
+s_escape       ("\\'")|("\\\"")|("\\?")|("\\\\")|("\\a")|("\\b")|("\\f")|("\\n")|("\\r")|("\\t")|("\\v")\r
+unsigned_integer       {digit}+\r
+\r
+%option noyywrap\r
+%option reentrant\r
+\r
+%%\r
+\r
+"der(" {LEX_VAL(DER)}\r
+"(" {LEX_VAL('(')}\r
+")" {LEX_VAL(')')}\r
+"," {LEX_VAL(',')}\r
+"." {LEX_VAL('.')}\r
+"[" {LEX_VAL('[')}\r
+"]" {LEX_VAL(']')}\r
+{q_name} {LEX_VAL(Q_NAME)}\r
+{nondigit} {LEX_VAL(NONDIGIT)}\r
+{unsigned_integer} {LEX_VAL(UNSIGNED_INTEGER);}\r
+. {LEX_VAL(*yytext)}\r
+\r
+%{\r
+%}
\ No newline at end of file