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