3 Copyright (c) 1997-1999 Matra Datavision
4 Copyright (c) 1999-2014 OPEN CASCADE SAS
6 This file is part of Open CASCADE Technology software library.
8 This library is free software; you can redistribute it and/or modify it under
9 the terms of the GNU Lesser General Public License version 2.1 as published
10 by the Free Software Foundation, with special exception defined in the file
11 OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 distribution for complete text of the license and disclaimer of any warranty.
14 Alternatively, this file may be used under the terms of Open CASCADE
15 commercial license or contractual agreement.
20 #include <ExprIntrp.tab.h>
22 #include <ExprIntrp_yaccintrf.hxx>
24 #define YY_SKIP_YYWRAP
26 static YY_BUFFER_STATE ExprIntrp_bufstring;
28 void ExprIntrp_start_string(const char* str)
30 // depending on configuration and generator, yyconst may be defined as const or empty
31 ExprIntrp_bufstring = ExprIntrp_scan_string((yyconst char*)str);
34 void ExprIntrp_stop_string()
36 ExprIntrp_delete_buffer(ExprIntrp_bufstring);
37 ExprIntrp_bufstring = (YY_BUFFER_STATE) 0;
45 // provide safe error handler (exception instead of exit())
46 #define YY_FATAL_ERROR(msg) ExprIntrperror(msg)
51 // add includes for flex 2.91 (Linux version)
55 // Avoid includion of unistd.h if parser is generated on Linux (flex 2.5.35)
56 #define YY_NO_UNISTD_H
58 // disable MSVC warnings in flex 2.89 and 2.5.35 code
59 // Note that Intel compiler also defines _MSC_VER but has different warning ids
60 #if defined(__INTEL_COMPILER)
61 #pragma warning(disable:177 1786 1736)
62 #elif defined(__clang__)
63 #pragma GCC diagnostic ignored "-Wunused-function"
64 #pragma GCC diagnostic ignored "-Winconsistent-dllimport"
65 #pragma GCC diagnostic ignored "-Wunneeded-internal-declaration"
67 #pragma warning(disable:4131 4244 4273 4127 4267)
73 // add includes for flex 2.91 (Linux version)
76 // disable GCC warnings in flex 2.91 code
77 #pragma GCC diagnostic ignored "-Wunused-function"
84 "-" {return(MINUSOP) ;}
85 "/" {return(DIVIDEOP) ;}
87 "**" {return(EXPOP) ;}
88 "*" {return(MULTOP) ;}
89 "(" {return(PARENTHESIS);}
90 "[" {return(BRACKET);}
91 ")" {return(ENDPARENTHESIS);}
92 "]" {return(ENDBRACKET);}
94 "@" {return(DIFFERENTIAL);}
95 "<-" {return(ASSIGNOP);}
96 "=" {return(EQUALOP);}
97 "Deassign" {return(DEASSIGNKEY);}
98 "Deriv" {return(DERIVKEY);}
99 "Const" {return(CONSTKEY);}
100 "Sum" {return(SUMKEY);}
101 "Prod" {return(PRODKEY);}
102 [0-9.]+e[+|-]?[0-9]+ {ExprIntrp_SetResult(); return(VALUE);}
103 [0-9.]+ {ExprIntrp_SetResult(); return(VALUE);}
104 [a-zA-Z][a-zA-Z0-9_]* {ExprIntrp_SetResult(); return(IDENTIFIER);}
105 ";" {return(RELSEPARATOR);}
106 "'"+ {ExprIntrp_SetDegree();return(DERIVATE);}