]> gerrit.simantics Code Review - simantics/fmil.git/blob - org.simantics.fmil.core/native/FMILibrary/src/XML/src/FMI1/fmi1_xml_variable_name_scan.l
Merge remote-tracking branch 'origin/master' into release/1.35.1
[simantics/fmil.git] / org.simantics.fmil.core / native / FMILibrary / src / XML / src / FMI1 / fmi1_xml_variable_name_scan.l
1 /*\r
2     Copyright (C) 2012 Modelon AB\r
3 \r
4     This program is free software: you can redistribute it and/or modify\r
5     it under the terms of the BSD style license.\r
6 \r
7      This program is distributed in the hope that it will be useful,\r
8     but WITHOUT ANY WARRANTY; without even the implied warranty of\r
9     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
10     FMILIB_License.txt file for more details.\r
11 \r
12     You should have received a copy of the FMILIB_License.txt file\r
13     along with this program. If not, contact Modelon AB <http://www.modelon.com>.\r
14 */\r
15 \r
16 %{\r
17 #include "fmi1_xml_variable_name_parser.tab.h"\r
18 #define YYSTYPE YYFMI1STYPE\r
19 \r
20 #define LEX_VAL(ID_NAME) return ID_NAME;\r
21 %}\r
22 \r
23 %option bison-bridge\r
24 \r
25 q_name          "'"({q_char}|{s_escape})+"'"\r
26 nondigit        [_a-zA-Z]\r
27 digit           [0-9]\r
28 q_char          {nondigit}|{digit}|[^'\\]\r
29 s_escape        ("\\'")|("\\\"")|("\\?")|("\\\\")|("\\a")|("\\b")|("\\f")|("\\n")|("\\r")|("\\t")|("\\v")\r
30 unsigned_integer        {digit}+\r
31 \r
32 %option noyywrap\r
33 %option reentrant\r
34 \r
35 %%\r
36 \r
37 "der(" {LEX_VAL(DER)}\r
38 "(" {LEX_VAL('(')}\r
39 ")" {LEX_VAL(')')}\r
40 ", " {LEX_VAL(',')}\r
41 "," {LEX_VAL(',')}\r
42 "." {LEX_VAL('.')}\r
43 "[" {LEX_VAL('[')}\r
44 "]" {LEX_VAL(']')}\r
45 {q_name} {LEX_VAL(Q_NAME)}\r
46 {nondigit} {LEX_VAL(NONDIGIT)}\r
47 {unsigned_integer} {LEX_VAL(UNSIGNED_INTEGER)}\r
48 . {LEX_VAL(*yytext)}\r
49 \r
50 %{\r
51 %}