forked from Conedy/Conedy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScanner.ll.begin
More file actions
120 lines (83 loc) · 3.21 KB
/
Scanner.ll.begin
File metadata and controls
120 lines (83 loc) · 3.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/*
Conedy is a scientific tool which allows numerical integration of dynamical networks.
Copyright (C) 2011 Alexander Rothkegel, Henning Dickten, Ferdinand Stolz, Justus Schwabedahl
This file is part of conedy.
Conedy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
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
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
*/
%option noyywrap
%option yylineno
%{
#include "Parserbase.h" // Make sure the flexer can communicate with bison++
//using return values
%}
digit [0-9]
ws [ \t\n]+
ID [A-Za-z][a-z0-9A-Z\_]*
%%
{ws} { /* no action */ }
{digit}+ {return (ParserBase::INT); }
/* {digit}+"."{digit}*e {return (ParserBase::DOUBLE); } */
/*[0-9]+"."[0-9]+([eE][-+]?[0-9]+)? {return (ParserBase::DOUBLE); */
[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)? { return (ParserBase::FLOATCONSTANT); }
"#"[^\n]*\n {}
"\""[^\"]*"\"" {return (ParserBase::STRING);}
":" {return (ParserBase::SYSTEMCOMMAND);}
"&&" {return(ParserBase::AND);}
"||" {return(ParserBase::OR);}
"!" {return(ParserBase::NOT);}
"<" {return('<');}
">" {return('>');}
"==" {return(ParserBase::EQUAL);}
"!=" {return(ParserBase::NEQUAL);}
"<=" {return(ParserBase::LESSEQUAL);}
">=" {return(ParserBase::GREATEREQUAL);}
true {return(ParserBase::BOOLONE);}
false {return(ParserBase::BOOLZERO);}
"+=" {return(ParserBase::ASSIGNPLUS);}
"-=" {return(ParserBase::ASSIGNMINUS);}
"*=" {return(ParserBase::ASSIGNTIMES);}
"/=" {return(ParserBase::ASSIGNDIVIDE);}
"%=" {return(ParserBase::ASSIGNMODOLO);}
"++" {return(ParserBase::PLUSPLUS);}
"--" {return(ParserBase::MINUSMINUS);}
"-" {return('-');}
"+" {return('+');}
"*" {return('*');}
"/" {return('/');}
"(" {return('(');}
")" {return(')');}
"{" {return('{');}
"}" {return('}');}
print {return(ParserBase::PRINT);}
loop {return(ParserBase::LOOP);}
double {return(ParserBase::DOUBLETOKEN);}
bool {return(ParserBase::BOOLTOKEN);}
baseType {return(ParserBase::DOUBLETOKEN);}
string {return(ParserBase::STRINGTOKEN);}
while {return(ParserBase::WHILE);}
for {return(ParserBase::FOR);}
exit {return(ParserBase::EXIT);}
vectorFor {return(ParserBase::VECTORFOR);}
chainedFor {return(ParserBase::CHAINEDFOR); }
if {return(ParserBase::IF);}
network {return(ParserBase::NETWORKTOKEN); }
ode {return(ParserBase::NODETOKEN); }
int {return(ParserBase::INTTOKEN); }
readInitialCondition {return(ParserBase::READINITIALCONDITION); }
%{ // Nodes
%}
countEdges {return(ParserBase::COUNTEDGES); }
randomBlueprintNode {return(ParserBase::RANDOMBLUEPRINTNODE); }
setParams {return(ParserBase::SETPARAMS); }
setParam {return(ParserBase::SETPARAM); }
snapshot {return(ParserBase::SNAPSHOT); }
streamInLattice {return(ParserBase::STREAMINLATTICE); }