]> gerrit.simantics Code Review - simantics/fmil.git/blob - org.simantics.fmil.core/native/FMILibrary/src/XML/src/FMI2/fmi2_xml_variable_name_scan.l
Switch to full JavaSE-11+ compatibility
[simantics/fmil.git] / org.simantics.fmil.core / native / FMILibrary / src / XML / src / FMI2 / fmi2_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 \r
18 #include "fmi2_xml_variable_name_parser.tab.h"\r
19 #define YYSTYPE YYFMI2STYPE\r
20 \r
21 #define LEX_VAL(ID_NAME) return ID_NAME;\r
22 %}\r
23 \r
24 %option bison-bridge\r
25 \r
26 q_name          "'"({q_char}|{s_escape})+"'"\r
27 nondigit        [_a-zA-Z]\r
28 digit           [0-9]\r
29 q_char          {nondigit}|{digit}|[!#$%&()*+,-\./:;<>=?@\[\]\^{}|~ ]\r
30 s_escape        ("\\'")|("\\\"")|("\\?")|("\\\\")|("\\a")|("\\b")|("\\f")|("\\n")|("\\r")|("\\t")|("\\v")\r
31 unsigned_integer        {digit}+\r
32 \r
33 %option noyywrap\r
34 %option reentrant\r
35 \r
36 %%\r
37 \r
38 "der(" {LEX_VAL(DER)}\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 %}