0024273: Eliminate compiler warnings in lex.ExprIntrp.tab.c generated by flex 2.91
[occt.git] / src / ExprIntrp / ExprIntrp.lex
CommitLineData
61043d3f 1/*
2
3 Copyright (c) 1997-1999 Matra Datavision
b311480e 4 Copyright (c) 1999-2012 OPEN CASCADE SAS
5
6 The content of this file is subject to the Open CASCADE Technology Public
7 License Version 6.5 (the "License"). You may not use the content of this file
8 except in compliance with the License. Please obtain a copy of the License
9 at http://www.opencascade.org and read it completely before using this file.
10
11 The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13
14 The Original Code and all software distributed under the License is
15 distributed on an "AS IS" basis, without warranty of any kind, and the
16 Initial Developer hereby disclaims all such warranties, including without
17 limitation, any warranties of merchantability, fitness for a particular
18 purpose or non-infringement. Please see the License for the specific terms
19 and conditions governing the rights and limitations under the License.
20
21*/
22
7fd59977 23%option yywrap
24%{
25#include <ExprIntrp.tab.h>
105aae76 26
7fd59977 27#define YY_SKIP_YYWRAP
28
29static YY_BUFFER_STATE ExprIntrp_bufstring;
30
31void ExprIntrp_SetResult();
32void ExprIntrp_SetDegree();
33
105aae76 34int ExprIntrlex (void);
35
7fd59977 36void ExprIntrp_start_string(char* str)
37{
38 ExprIntrp_bufstring = ExprIntrp_scan_string(str);
39}
40
41void ExprIntrp_stop_string()
42{
43 ExprIntrp_delete_buffer(ExprIntrp_bufstring);
9fe1ada8 44 ExprIntrp_bufstring = (YY_BUFFER_STATE) 0;
7fd59977 45}
46
47int yywrap()
48{
49 return 1;
50}
51
105aae76 52#ifdef _MSC_VER
61043d3f 53// add includes for flex 2.91 (Linux version)
54#include <stdlib.h>
55#include <io.h>
56
57// disable MSVC warnings in flex 2.89 code
105aae76 58#pragma warning(disable:4131 4244 4273 4127)
59#endif
60
61043d3f 61#ifdef __GNUC__
62// add includes for flex 2.91 (Linux version)
63#include <unistd.h>
64
65// disable GCC warnings in flex 2.91 code
66#pragma GCC diagnostic ignored "-Wunused-function"
67#endif
68
7fd59977 69%}
70%%
71" " {;}
72"+" {return(SUMOP) ;}
73"-" {return(MINUSOP) ;}
74"/" {return(DIVIDEOP) ;}
75"^" {return(EXPOP) ;}
76"**" {return(EXPOP) ;}
77"*" {return(MULTOP) ;}
78"(" {return(PARENTHESIS);}
79"[" {return(BRACKET);}
80")" {return(ENDPARENTHESIS);}
81"]" {return(ENDBRACKET);}
82"," {return(COMMA);}
83"@" {return(DIFFERENTIAL);}
84"<-" {return(ASSIGNOP);}
85"=" {return(EQUALOP);}
86"Deassign" {return(DEASSIGNKEY);}
87"Deriv" {return(DERIVKEY);}
88"Const" {return(CONSTKEY);}
89"Sum" {return(SUMKEY);}
90"Prod" {return(PRODKEY);}
91[0-9.]+e[+|-]?[0-9]+ {ExprIntrp_SetResult(); return(VALUE);}
92[0-9.]+ {ExprIntrp_SetResult(); return(VALUE);}
93[a-zA-Z][a-zA-Z0-9_]* {ExprIntrp_SetResult(); return(IDENTIFIER);}
94";" {return(RELSEPARATOR);}
95"'"+ {ExprIntrp_SetDegree();return(DERIVATE);}