X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.fmil.core%2Fnative%2FFMILibrary%2Fsrc%2FXML%2Fsrc%2FFMI2%2Ffmi2_xml_variable_name_scan.l;fp=org.simantics.fmil.core%2Fnative%2FFMILibrary%2Fsrc%2FXML%2Fsrc%2FFMI2%2Ffmi2_xml_variable_name_scan.l;h=c8c83b08df90ed20c1538c3be2d22af1a816f2fb;hb=4bed8078f3f6d15b8539d7357b8815f8bfeec2c4;hp=0000000000000000000000000000000000000000;hpb=87cc423aefd98832c6c8d0979afc21551f8ceca3;p=simantics%2Ffmil.git 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 index 0000000..c8c83b0 --- /dev/null +++ b/org.simantics.fmil.core/native/FMILibrary/src/XML/src/FMI2/fmi2_xml_variable_name_scan.l @@ -0,0 +1,51 @@ +/* + Copyright (C) 2012 Modelon AB + + This program is free software: you can redistribute it and/or modify + it under the terms of the BSD style license. + + This program 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 + FMILIB_License.txt file for more details. + + You should have received a copy of the FMILIB_License.txt file + along with this program. If not, contact Modelon AB . +*/ + +%{ + +#include "fmi2_xml_variable_name_parser.tab.h" +#define YYSTYPE YYFMI2STYPE + +#define LEX_VAL(ID_NAME) return ID_NAME; +%} + +%option bison-bridge + +q_name "'"({q_char}|{s_escape})+"'" +nondigit [_a-zA-Z] +digit [0-9] +q_char {nondigit}|{digit}|[!#$%&()*+,-\./:;<>=?@\[\]\^{}|~ ] +s_escape ("\\'")|("\\\"")|("\\?")|("\\\\")|("\\a")|("\\b")|("\\f")|("\\n")|("\\r")|("\\t")|("\\v") +unsigned_integer {digit}+ + +%option noyywrap +%option reentrant + +%% + +"der(" {LEX_VAL(DER)} +"(" {LEX_VAL('(')} +")" {LEX_VAL(')')} +"," {LEX_VAL(',')} +"." {LEX_VAL('.')} +"[" {LEX_VAL('[')} +"]" {LEX_VAL(']')} +{q_name} {LEX_VAL(Q_NAME)} +{nondigit} {LEX_VAL(NONDIGIT)} +{unsigned_integer} {LEX_VAL(UNSIGNED_INTEGER);} +. {LEX_VAL(*yytext)} + +%{ +%} \ No newline at end of file