forked from Conedy/Conedy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Parser.yy.declaration
642 lines (502 loc) · 39.7 KB
/
Parser.yy.declaration
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
%%
program: commands { $1->execute();};
commands: commands instruction ';' { ((instructionBlock*)$1)->addInstruction($2); $$ = $1; }
| instruction ';' { $$ = new instructionBlock(); ((instructionBlock*)$$)->addInstruction($1); };
// | error { $$ = new instructionBlock(); cout << "jjj" << endl; };
instruction : system
| print
| loop
| while
| declare
| assign
| for
| networkCommand
| commandBlock
| createNetworkCommand
| spatialNetworkCommand
| globalCommand
| bluePrintCommand
| statisticsNetworkCommandInt { $$ = $1; }
// | EXIT { $$ = new bindInstruction(bind(exit, 1)); }
| if
| vectorFor ;
commandBlock : '{' commands '}' { $$ = $2;};
globalCommand: SETRANDOMSEED '(' integer ')' { $$ = new bindInstruction( bind(&gslNoise::setSeed,_E(int,$3))); }
| ADDINPUTFILE '(' string ')' { $$ = new bindInstruction(bind(&command::addInputFile, _E(string,$3))); }
| CLEAR '(' ')' { $$ = new bindInstruction( bind(&command::clear)); }
| SYSTEM '(' string ')' {
#if CONDOR
$$ = new emptyInstruction();
#else
$$ = new systemInstruction( $3);
#endif
};
assign : baseType '=' baseType { $$ = new assignInstruction<baseType> ((varCommand<baseType>*)$1, $3); }
| integer '=' integer { $$ = new assignInstruction<int> ((varCommand<int>*)$1,$3); }
| bool '=' bool { $$ = new assignInstruction<bool> ((varCommand<bool>*)$1,$3); }
| string '=' string { $$ = new assignInstruction<string> ((varCommand<string>*)$1,$3); }
| integer ASSIGNPLUS integer { varCommand<int> *var = (varCommand<int>*)$1;
$$ = new assignInstruction<int> ( var, new plusCommandint<int, int> ($3, (var)) ) ; }
| integer ASSIGNMINUS integer { varCommand<int> *var = (varCommand<int>*)$1;
$$ = new assignInstruction<int> ( var, new minusCommandint<int, int> ($3, (var))); }
| integer ASSIGNDIVIDE integer { varCommand<int> *var = (varCommand<int>*)$1;
$$ = new assignInstruction<int> ( var, new divideCommandint<int, int> ($3, (var))); }
| integer ASSIGNMODOLO integer { varCommand<int> *var = (varCommand<int>*)$1;
$$ = new assignInstruction<int> ( var, new modoloCommandint<int, int> ($3, (var))); }
| integer ASSIGNTIMES integer { varCommand<int> *var = (varCommand<int>*)$1;
$$ = new assignInstruction<int> ( var, new timesCommandint<int, int> ($3, (var))); }
| integer PLUSPLUS { varCommand<int> *var = (varCommand<int>*)$1;
$$ = new assignInstruction<int> ( var, new plusCommandint<int, int> (new constantCommand<int>(1), (var))); }
| baseType PLUSPLUS { varCommand<baseType> *var = (varCommand<baseType>*)$1;
$$ = new assignInstruction<baseType> ( var, new plusCommandbaseType<baseType, baseType> (new constantCommand<baseType>(1), (var))); }
| integer MINUSMINUS { varCommand<int> *var = (varCommand<int>*)$1;
$$ = new assignInstruction<int> ( var, new minusCommandint<int, int> (new constantCommand<int>(1), (var))); }
| baseType MINUSMINUS { varCommand<baseType> *var = (varCommand<baseType>*)$1;
$$ = new assignInstruction<baseType> ( var, new minusCommandbaseType<baseType, baseType> (new constantCommand<baseType>(1), (var))); };
nodeDescriptor: integer { $$ = new convertToNodeDescriptor ( $1); };
declare :
DOUBLETOKEN ID { command::declare($2->evaluate(),_baseType_); $$ = new emptyInstruction(); }
| BOOLTOKEN ID { command::declare($2->evaluate(),_bool_); $$ = new emptyInstruction(); }
| NODETOKEN ID { command::declare($2->evaluate(), _node_); $$ = new emptyInstruction(); }
| INTTOKEN ID { command::declare($2->evaluate(), _int_); $$ = new emptyInstruction (); }
| NETWORKTOKEN ID { command::declare($2->evaluate(), _network_); $$ = new emptyInstruction(); }
| STRINGTOKEN ID { command::declare($2->evaluate(), _string_); $$ = new emptyInstruction(); }
| INTTOKEN identifier '=' integer { command::declare($2->evaluate(),_int_); $$ = new assignInstruction<int> (new varCommand<int> ($2->evaluate()), $4); }
| DOUBLETOKEN identifier '=' baseType { command::declare($2->evaluate(),_baseType_); $$ = new assignInstruction<baseType> (new varCommand<baseType>($2->evaluate()), $4); };
identifier : ID { $$ = $1; };
system : SYSTEMCOMMAND string SYSTEMCOMMAND {
#if CONDOR
$$ = new emptyInstruction ();
#else
$$ = new systemInstruction($2 );
#endif
};
networkCommand : NETWORK '.' CLEAR '(' ')' { $$ = NETWORKFUNK(clear,$1); }
| NETWORK '.' SNAPSHOT '(' ')' { $$ = NETWORKFUNK(snapshot,$1); }
| NETWORK '.' ADDNODE '(' createNode ')' { $$ = NETWORKFUNK1(addNode,$1,_E(nodeBlueprint*,$5)); }
| NETWORK '.' PRINTNODESTATISTICS '(' ')'{ $$ = NETWORKFUNK(printNodeStatistics,$1); }
| NETWORK '.' ADDEDGE '(' nodeDescriptor ',' nodeDescriptor ',' baseType ')' { $$ = NETWORKFUNK3(addWeightedEdge,$1,_E(nodeDescriptor,$5),_E(nodeDescriptor,$7),_E(baseType,$9)); }
| NETWORK '.' UNLINK '(' nodeDescriptor ',' nodeDescriptor ')' { $$= NETWORKFUNK2(unlink,$1,_E(nodeDescriptor,$5),_E(nodeDescriptor,$7)); }
| NETWORK '.' SETTIME '(' baseType ')' { $$= NETWORKFUNK1(setTime,$1,_E(baseType,$5)); }
| NETWORK '.' SELECT '(' string ')' { $$ = NETWORKFUNK1(select, $1, _E(string, $5)); }
| NETWORK '.' ADDEDGE '(' nodeDescriptor ',' nodeDescriptor ',' createLink ')' { $$ = NETWORKFUNK3(addEdge,$1,_E(nodeDescriptor,$5),_E(nodeDescriptor,$7),_E(edgeBlueprint*,$9)); }
| NETWORK '.' EVOLVE '(' baseType ',' baseType ')' { $$ = NETWORKFUNK2(evolve,$1,_E(baseType,$5), _E(baseType,$7)); }
| NETWORK '.' EVOLVE '(' baseType ')' { $$ = NETWORKFUNK1(evolveFor,$1,_E(baseType,$5)); }
| NETWORK '.' REALIGNATEVENT '(' string ',' string ',' createNode ',' baseType ',' integer ',' integer ')'
{
#if CONDOR
//$$ = new bindInstruction(bind(&command::addInputFile, _E(string,$5)));
$$ = new emptyInstruction();
#else
$$ = NETWORKFUNK6(realignAtEvent,$1, _E(string, $5 ),_E(string, $7 ) , $9->evaluate()->getNodeInfo().theNodeType, _E(baseType, $11), _E(int,$13), _E(int,$15 ));
#endif
}
| NETWORK '.' REALIGNWHENDISTANT '(' string ',' string ',' createNode ',' baseType ',' integer ',' integer ')'
{
#if CONDOR
//$$ = new bindInstruction(bind(&command::addInputFile, _E(string,$5)));
$$ = new emptyInstruction();
#else
$$ = NETWORKFUNK6(realignWhenDistant,$1, _E(string, $5 ),_E(string, $7 ) , $9->evaluate()->getNodeInfo().theNodeType, _E(baseType, $11), _E(int,$13), _E(int,$15 ));
#endif
}
| NETWORK '.' REALIGNATEVENTSIGNATURE '(' string ',' string ',' createNode ',' baseType ',' integer ',' integer ')'
{
#if CONDOR
$$ = new emptyInstruction();
//$$ = new bindInstruction(bind(&command::addInputFile, _E(string,$5)));
#else
$$ = NETWORKFUNK6(realignAtEventSignature,$1, _E(string, $5 ),_E(string, $7 ) , $9->evaluate()->getNodeInfo().theNodeType, _E(baseType, $11), _E(int,$13), _E(int,$15 ));
#endif
}
| NETWORK '.' INDEGREEDISTRIBUTION '(' string ')' { $$ = NETWORKFUNK1(inDegreeDistributionToFile,$1,_E(string,$5));}
| NETWORK '.' OUTDEGREEDISTRIBUTION '(' string ')' { $$ = NETWORKFUNK1(outDegreeDistributionToFile,$1,_E(string,$5)); }
| NETWORK '.' NOISETOSTATES '(' createNode ',' randomList ')' { $$ = NETWORKFUNK2(noiseToStatesVec, $1, _E(nodeBlueprint*, $5),*$7 ); }
| NETWORK '.' RANDOMIZESTATES '(' createNode ',' randomList ')'{ $$ = NETWORKFUNK2(randomizeStatesVec, $1, _E(nodeBlueprint*, $5),*$7 ); }
| NETWORK '.' RANDOMIZEPARAMETER '(' string ',' random ')'
{ function<baseType ()> r = bind(&expression<baseType>::evaluate,$7);
$$ = new bindInstruction(
bind(&networkTemplate::randomizeParameter,$1,
bind(&expression<string>::evaluate, $5), r)); }
| NETWORK '.' ADDGLOBALNOISE '(' random ')'
{ function <baseType ()> r = bind(&expression<baseType>::evaluate, $5);
$$ = new bindInstruction( bind(&networkTemplate::addGlobalNoise, $1, r)); }
| NETWORK '.' RANDOMIZEWEIGHTS '(' random ')'
{ function<baseType ()> r = bind(&expression<baseType>::evaluate,$5);
$$ = new bindInstruction( bind(&networkTemplate::randomizeWeights, $1, r));}
| NETWORK '.' READINITIALCONDITION '(' createNode ',' string ')'
{
#if CONDOR
$$ = new bindInstruction(bind(&command::addInputFile, _E(string,$7)));
#else
$$ = NETWORKFUNK2(readInitialCondition, $1, _E(string,$7), _E(nodeBlueprint *,$5) );
//new bindInstruction(bind(&networkTemplate::readInitialCondition, $1, _E(string,$7),$5->evaluate()->getNodeInfo().theNodeType));
#endif
}
| NETWORK '.' READPARAMS '(' string ',' string ')'
{
#if CONDOR
$$ = new bindInstruction(bind(&command::addInputFile, _E(string,$7)));
#else
$$ =NETWORKFUNK2(readParameter, $1, _E(string,$5),_E(string,$7));
#endif
}
| NETWORK '.' STARTINGCONDITIONOPENWAVEENDING '(' ')' { $$ = NETWORKFUNK(startingConditionOpenWaveEnding,$1); }
| NETWORK '.' STARTINGCONDITIONOPENWAVEMIDDLE '(' ')' { $$ = NETWORKFUNK(startingConditionOpenWaveEndingMiddle,$1); }
| NETWORK '.' STARTINGCONDITIONSMALLDISTURBANCE '(' baseType ',' random ')'
{ function<baseType ()> r = bind(&expression<baseType>::evaluate,$7);
$$ = NETWORKFUNK2(smallDisturbance,$1,_E(baseType,$5), r); }
| NETWORK '.' STARTINGCONDITIONSMALLDISTURBANCE '(' baseType ',' integer ',' integer ',' random ')'
{ function<baseType ()> r = bind(&expression<baseType>::evaluate,$11);
$$ = NETWORKFUNK4(smallDisturbance,$1,_E(baseType,$5), _E(int,$7), _E(int,$9), r); }
| NETWORK '.' DYNAMICS '(' nodeDescriptor ')' { $$=NETWORKFUNK1(dynamics, $1, _E(nodeDescriptor, $5)); }
| NETWORK '.' SETSTATE '(' nodeDescriptor ',' argList ')'
// { $$ = NETWORKFUNK2(setInitialCondition, $1, _E(int, $5), bind(&expressionVector<baseType>::evaluate, $7)); };
{$$ = NETWORKFUNK2(setInitialConditionVec, $1, _E(nodeDescriptor, $5), bind(&expressionVector<baseType>::evaluate, $7)); };
//{$$ = new bindInstruction(bind(&networkTemplate::setInitialCondition, $1, _E(nodeDescriptor, $5), bind(&expressionVector<baseType>::evaluate, $7))); };
string : STRING { std::string s(d_scanner.YYText()+1, strlen(d_scanner.YYText()) - 2); $$ = new constantCommand<string>(s);}
| string '+' integer { $$ = new stringCat<string,int>($1,$3); }
| string '+' string { $$ = new stringCat<string,string>($1,$3); }
| string '+' baseType { $$ = new stringCat<string,baseType>($1,$3);}
| STRINGVAR {$$ = new varCommand<string>(d_scanner.YYText()); }
| string '+' bool { $$ = new stringCat <string, bool > ( $1, $3);}
| NEWLINE { $$ = new constantCommand<string>("\n"); }
// Ohne Seg-Schutz
//| COMANDLINESTRING '(' integer ')' { $$ = new constantCommand<string>( commandLineArguments::arg[ $3->evaluate() + 1].c_str() ); }
| COMANDLINESTRING '(' integer ')' { $$ = new constantCommand<string>( commandLineArguments::getStringArg( $3->evaluate() + 1)); };
spatialNetworkCommand : NETWORK '.' USERANDOMPOSITIONING '(' ')'
{ $$ = NETWORKFUNK(useRandomPositioning, $1); }
| NETWORK '.' USELATTICEPOSITIONING '(' integer ',' integer ')' // REDUCE CONFLICT XXX
{ $$ = NETWORKFUNK2(useLatticePositioning, $1, _E(int, $5),_E(int,$7) );};
bluePrintCommand : createNode '=' createNode { $$ = new assignInstruction<nodeBlueprint*> ((varCommand<nodeBlueprint*>*)$1 ,$3);}
| createNode '.' SETPARAMS '(' argList ')' { $$ = new bindInstruction( bind( ¶ms<baseType>::setSheet , bind (&expression<nodeBlueprint*>::evaluate, $1), bind(&expressionVector<baseType>::evaluate, $5))); };
createNetworkCommand : | NETWORK '.' OBSERVE '(' nodeDescriptor ',' string ')' { $$ = NETWORKFUNK3(observe, $1, _E(nodeDescriptor, $5), _E(string, $7) ,network::stdEdge); }
| NETWORK '.' OBSERVEMEAN '(' string ')' { $$ =NETWORKFUNK2(observeSum,$1,_E(string,$5), network::stdEdge ); }
| NETWORK '.' OBSERVEHIST '(' string ',' createNode ')' { $$ =NETWORKFUNK2(observeHist,$1,_E(string,$5), _E(nodeBlueprint*, $7 ) ); }
| NETWORK '.' OBSERVEPHASECOHERENCE '(' string ')' { $$ = NETWORKFUNK5(observePhaseCoherence,$1, _E(string,$5), network::stdEdge, network::stdNode, 0, numeric_limits<nodeDescriptor>::max()); }
| NETWORK '.' OBSERVEPHASECOHERENCE '(' string ',' createLink ')' { $$ = NETWORKFUNK5(observePhaseCoherence,$1, _E(string,$5), _E(edgeBlueprint*, $7), network::stdNode, 0, numeric_limits<nodeDescriptor>::max() ); }
| NETWORK '.' OBSERVEPHASECOHERENCE '(' string ',' node ')' { $$ = NETWORKFUNK5(observePhaseCoherence,$1, _E(string,$5), network::stdEdge, _E(nodeBlueprint*, $7), 0, numeric_limits<nodeDescriptor>::max() ); }
| NETWORK '.' OBSERVEPHASECOHERENCE '(' string ',' createLink ',' node ')'
{ $$ = NETWORKFUNK5(observePhaseCoherence,$1, _E(string,$5) ,_E(edgeBlueprint*, $7), _E(nodeBlueprint*, $9) , 0 , numeric_limits<nodeDescriptor>::max()); }
| NETWORK '.' OBSERVEPHASECORRELATION '(' string ',' node ')'
{ $$ = NETWORKFUNK2( observePhaseCorrelation, $1, _E(string, $5 ), _E(nodeBlueprint*, $7)); }
| NETWORK '.' OBSERVEPHASEDISTANCE '(' string ',' node ')'
{ $$ = NETWORKFUNK2( observePhaseDistance, $1, _E(string, $5 ), _E(nodeBlueprint*, $7)); }
| NETWORK '.' OBSERVEPHASECOHERENCE '(' string ',' createLink ',' integer ',' integer ')'
{ $$ = NETWORKFUNK5(observePhaseCoherence,$1, _E(string,$5) ,_E(edgeBlueprint*, $7), network::stdNode, _E(int,$9), _E(int,$11) ); }
| NETWORK '.' OBSERVEMEANPHASE '(' string ')' { $$ = NETWORKFUNK1(observeMeanPhase,$1, _E(string,$5) ); }
| NETWORK '.' OBSERVEMEANPHASE '(' string ',' createLink ')' { $$ = NETWORKFUNK2(observeMeanPhase,$1, _E(string,$5), _E(edgeBlueprint*, $7) ); }
| NETWORK '.' OBSERVETIME '(' string ')' { $$ = NETWORKFUNK1(observeTime,$1, _E(string,$5)); }
| NETWORK '.' OBSERVEEVENT '(' string ',' integer ')' { $$ = NETWORKFUNK2(observeEvent,$1, _E(string,$5), _E(int, $7)); }
| NETWORK '.' SNAPSHOTATEVENT '(' integer ')' { $$ = NETWORKFUNK1(snapshotAtEvent,$1, _E(int, $5)); }
| NETWORK '.' SNAPSHOTATEVENTSIGNATURE '(' integer ')' { $$ = NETWORKFUNK1(snapshotAtEventSignature,$1, _E(int, $5)); }
| NETWORK '.' SNAPSHOTATEVENT '(' nodeDescriptor ',' integer ')' { $$ = NETWORKFUNK2(snapshotAtEventOfNode,$1, _E(nodeDescriptor, $5), _E(int,$7)); }
| NETWORK '.' OBSERVEEVENTTIMES '(' string ',' integer ')' { $$ = NETWORKFUNK2(observeEventTimes,$1, _E(string,$5), _E(int, $7)); }
| NETWORK '.' OBSERVEEVENTTIMESEQUALS '(' string ',' integer ')' { $$ = NETWORKFUNK2(observeEventTimesEquals,$1, _E(string,$5), _E(int, $7)); }
| NETWORK '.' OBSERVEEVENTSIGNATURETIMES '(' string ',' integer ')' { $$ = NETWORKFUNK2(observeEventSignatureTimes,$1, _E(string,$5), _E(int, $7)); }
| NETWORK '.' OBSERVEALL '(' string ')' { $$ = NETWORKFUNK2(observeAll, $1, _E(string,$5), network::stdEdge); }
| NETWORK '.' OBSERVECOMPONENTS '(' nodeDescriptor ',' string ')' { $$ = NETWORKFUNK2(observeComponents, $1, _E(nodeDescriptor, $5),_E(string,$7)); }
| NETWORK '.' OBSERVE '(' nodeDescriptor ',' string ',' createLink ')' {$$ = NETWORKFUNK3(observe,$1,_E(nodeDescriptor,$5),_E(string,$7),_E(edgeBlueprint*,$9)); }
| NETWORK '.' OBSERVEMEAN '(' string ',' createLink ')' { $$ = NETWORKFUNK2(observeSum,$1, _E(string,$5),_E(edgeBlueprint*,$7)); }
| NETWORK '.' OBSERVEALL '(' string ',' createLink ')' { $$ = NETWORKFUNK2(observeAll,$1,_E(string,$5), _E(edgeBlueprint*, $7));}
| NETWORK '.' REMOVEOBSERVER '(' ')' { $$ = NETWORKFUNK(removeObserver,$1); }
| NETWORK '.' REMOVEINPUT '(' ')' { $$ = NETWORKFUNK1(remove,$1,_inNode_| _dynNode_ ); }
| NETWORK '.' REMOVEEDGES '(' createLink ')' { $$ = NETWORKFUNK1 (removeEdges, $1, _E(edgeBlueprint*, $5)); }
| NETWORK '.' REMOVEEDGE '(' nodeDescriptor ',' nodeDescriptor ')' { $$ = NETWORKFUNK2 (unlink, $1, _E(nodeDescriptor, $5), _E(nodeDescriptor, $7) ); }
| NETWORK '.' CONNECTCLOSENODES '(' createNode ',' createNode ',' baseType ',' createLink ')'
{ $$ = NETWORKFUNK4(connectCloseNodes, $1, _E(nodeBlueprint *, $5), _E(nodeBlueprint *, $7), _E(baseType, $9), _E(edgeBlueprint*,$11)); }
| NETWORK '.' CONNECTCLOSENODESTORUS '(' createNode ',' createNode ',' baseType ',' createLink ')'
{ $$ = NETWORKFUNK4(connectCloseNodesTorus, $1, _E(nodeBlueprint *, $5), _E(nodeBlueprint *, $7), _E(baseType, $9), _E(edgeBlueprint*,$11)); }
| NETWORK '.' SETPARAM '(' nodeDescriptor ',' string ',' baseType ')' { $$ = NETWORKFUNK3(setParam, $1, _E(nodeDescriptor,$5), _E(string, $7), _E(baseType,$9));}
// at the moment not supported
//| NETWORK '.' CNNSTD '<' createNode ',' createLink '>' '(' integer ',' integer ',' string ')'
// { $$ = NETWORKFUNK5(cnnStd,$1,_E(nodeDescriptor,$10), _E(nodeDescriptor,$12), _E(string,$14), _E(nodeBlueprint*,$5), _E(edgeBlueprint*, $7)); }
// | NETWORK '.' CNNSTD '<' createNode '>' '(' nodeDescriptor ',' nodeDescriptor ',' string ')'
// { $$ = NETWORKFUNK5(cnnStd,$1,_E(nodeDescriptor,$8), _E(nodeDescriptor,$10), _E(string,$12), _E(nodeBlueprint*,$5), new weightedEdgeVirtual); }
// | NETWORK '.' CNNNEUTRAL '<' createNode ',' createLink '>' '(' nodeDescriptor ',' nodeDescriptor ',' string ')'
// { $$ = NETWORKFUNK5(cnnNeutral,$1,_E(nodeDescriptor,$10), _E(nodeDescriptor,$12), _E(string,$14), _E(nodeBlueprint*,$5), _E(edgeBlueprint*, $7)); }
// | NETWORK '.' CNNNEUTRAL '<' createNode '>' '(' nodeDescriptor ',' nodeDescriptor ',' string ')'
// { $$ = NETWORKFUNK5(cnnNeutral,$1,_E(nodeDescriptor,$8), _E(nodeDescriptor,$10), _E(string,$12), _E(nodeBlueprint*,$5), new weightedEdgeVirtual); }
| NETWORK '.' STREAMINLATTICE '(' integer ',' integer ',' string ')' { $$ =NETWORKFUNK3(streamInLattice,$1,_E(int,$5),_E(int,$7),_E(string,$9)); }
// at the moment not supported ^
| NETWORK '.' OBSERVEGLUT '(' baseType ',' string ')'
{
#if OPENGL
$$ = NETWORKFUNK2(startNeverStopGlut,$1,_E(string,$7),_E(baseType,$5));
#else
throw "OpenGl nicht mitKompiliert!";
#endif
}
| NETWORK '.' OBSERVEGL '(' baseType ',' baseType ')'
{
#if OPENGL
$$ = NETWORKFUNK3(startNeverStopOld,$1,_E(baseType,$5),_E(baseType,$7),networkTemplate::stdEdge);
#else
throw "OpenGl nicht mitKompiliert!";
#endif
}
| NETWORK '.' OBSERVEGL '(' baseType ',' baseType ',' createLink ')'
{
#if OPENGL
$$ = NETWORKFUNK3(startNeverStopOld,$1,_E(baseType,$7),_E(baseType,$5),_E(edgeBlueprint*,$9));
#else
throw "OpenGl nicht mitKompiliert!";
#endif
}
| NETWORK '.' OBSERVEGL '(' baseType ',' createLink ')'
{
#if OPENGL
$$ = NETWORKFUNK2(startNeverStopOld,$1,_E(baseType,$5),_E(edgeBlueprint*,$7));
#else
throw "OpenGl nicht mitKompiliert!";
#endif
}
| NETWORK '.' OBSERVEGL '(' baseType ')'
{
#if OPENGL
$$ = NETWORKFUNK2(startNeverStopOld,$1,_E(baseType,$5), networkTemplate::stdEdge);
#else
throw "OpenGl nicht mitKompiliert!";
#endif
}
| NETWORK '.' OBSERVEGLUT '(' baseType ',' string ',' createLink ')'
{
#if OPENGL
$$ = NETWORKFUNK3(startNeverStopGlut,$1,_E(string,$7),_E(baseType,$5),_E(edgeBlueprint*,$9));
#else
throw "OpenGl nicht mitKompiliert!";
#endif
}
| NETWORK '.' REWIRESOURCE '(' baseType ')' { $$ = NETWORKFUNK2(rewireSource,$1,_E(baseType,$5), _dynNode_); }
| NETWORK '.' REWIRETARGET '(' baseType ')' { $$ = NETWORKFUNK2(rewireTarget,$1,_E(baseType,$5),_dynNode_); }
| NETWORK '.' REWIRE '(' baseType ')' { $$ = NETWORKFUNK2(rewire,$1,_E(baseType,$5), network::stdNode); }
| NETWORK '.' NORMALIZEINWEIGHTSUM '(' baseType ')' { $$ = NETWORKFUNK1(normalizeInputs,$1,_E(baseType,$5)); }
| NETWORK '.' NORMALIZEOUTWEIGHTSUM '(' baseType ')' { $$ = NETWORKFUNK1(normalizeOutputs,$1,_E(baseType,$5)); }
| NETWORK '.' REWIRE '(' baseType ',' createLink ')' { $$ = NETWORKFUNK3(replaceEdges,$1,_E(baseType,$5), _E(edgeBlueprint*,$7),network::stdNode); }
| NETWORK '.' REWIRE '(' baseType ',' createNode ')' { $$ = NETWORKFUNK2(rewire,$1,_E(baseType,$5), _E(nodeBlueprint*,$7)); }
| NETWORK '.' REWIREUNDIRECTED '(' baseType ')' { $$ = NETWORKFUNK2(rewireUndirected,$1,_E(baseType,$5),_dynNode_); }
| NETWORK '.' REWIRETARGETUNDIRECTED '(' baseType ')' { $$ = NETWORKFUNK2(rewireTargetUndirected,$1,_E(baseType,$5),_dynNode_); }
| NETWORK '.' REWIRESOURCEPERTIMESTEP '(' baseType ',' baseType ')'
{ function<baseType ()> r = bind(&expression<baseType>::evaluate,$7);
$$ = new bindInstruction( bind(&networkTemplate::rewireSourcePerTimestep, $1 ,
bind(&expression<baseType>::evaluate, $5) , r,_dynNode_)); }
| NETWORK '.' REWIRE '(' baseType ',' random ')'
{ function<baseType ()> r = bind(&expression<baseType>::evaluate,$7);
$$ = new bindInstruction(bind(&networkTemplate::rewireWeights ,$1, bind(&expression<baseType>::evaluate, $5),r,_dynNode_)); }
| NETWORK '.' ADDRANDOMEDGES '(' baseType ',' createLink ')' { $$ = NETWORKFUNK2(addRandomEdges,$1,_E(baseType,$5), _E(edgeBlueprint*,$7)); }
| NETWORK '.' REMOVERANDOMEDGES '(' baseType ',' createLink ')' { $$ = NETWORKFUNK2(removeRandomEdges,$1,_E(baseType,$5), _E(edgeBlueprint*,$7)); }
| NETWORK '.' ADDRANDOMEDGESUNDIRECTED '(' baseType ',' createLink ')' { $$ = NETWORKFUNK2(addRandomEdgesUndirected,$1,_E(baseType,$5), _E(edgeBlueprint*,$7)); }
| NETWORK '.' ADDRANDOMEDGESDEGREEDISTRIBUTION '(' random ',' createLink ')'
{ function<baseType ()> r = bind(&expression<baseType>::evaluate,$5); $$ = NETWORKFUNK2(addRandomEdgesDegreeDistribution,$1,r, _E(edgeBlueprint*,$7)); }
| NETWORK '.' ADDRANDOMEDGESDEGREEDISTRIBUTIONUNDIRECTED '(' random ',' createLink ')'
{ function<baseType ()> r = bind(&expression<baseType>::evaluate,$5); $$ = NETWORKFUNK2(addRandomEdgesDegreeDistributionUndirected,$1,r, _E(edgeBlueprint*,$7)); }
// | NETWORK '.' CYCLECLUSTER '<' createNode ',' nodeDescriptor '>' '<' createNode ',' integer '>' '(' integer ')' { $$ = NETWORKFUNK5(cycleCluster,$1, _E(nodeDescriptor,$7),_E(nodeBlueprint*,$5), _E(nodeDescriptor,$12),_E(nodeBlueprint*,$10), _E(nodeDescriptor,$15)); }
| NETWORK '.' BETWEENNESSCENTRALITY '(' string ')' { $$ = NETWORKFUNK1(betweennessCentrality,$1,_E(string,$5)); }
| NETWORK '.' CLOSENESSCENTRALITY '(' string ')' { $$ = NETWORKFUNK1(closenessCentrality,$1, _E(string,$5)); }
| NETWORK '.' DEGREECENTRALITY '(' string ')' { $$ = NETWORKFUNK1(degreeCentrality, $1, _E(string,$5)); }
| NETWORK '.' SAVEADJACENCYLIST '(' string ')' { $$ = NETWORKFUNK1(saveAdjacencyList,$1,_E(string,$5)); }
| NETWORK '.' SAVEADJACENCYMATRIX '(' string ')' { $$ = NETWORKFUNK1(saveAdjacencyMatrix,$1,_E(string,$5)); }
| NETWORK '.' SAVEGRAPHML '(' string ')' { $$ = NETWORKFUNK1(saveGraphML,$1,_E(string,$5)); };
print : PRINT baseType { $$ = new printInstructionDouble ($2);}
| PRINT bool { $$ = new printInstruction<bool> ($2); }
| PRINT integer { $$ = new printInstruction<int> ($2); }
| PRINT string { $$ = new printInstruction<string> ($2); }
| PRINT NEWLINE { $$ = new printInstruction<string>(new constantCommand<string>("\n")); };
loop : LOOP '(' integer ')' instruction { $$ = new loopInstruction ($3,$5); };
while : WHILE '(' bool ')' instruction { $$ = new whileInstruction ($3,$5); };
for : FOR '(' instruction ';' bool ';' instruction ')' instruction { $$ = new forInstruction ($3,$5,$7,$9); };
vectorFor : VECTORFOR '(' instruction ';' bool ';' instruction ')' instruction {
//#ifdef CONDOR
vectorForInstruction::registerNewLoop(); $$ = new vectorForInstruction ($3,$5,$7,$9, false);
//#else
// cout << "#Warning. This Executable of Conedy was not compiled for generating condor-scripts. \n Calculating at home." << endl; $$ = new forInstruction ($3,$5,$7,$9);
//endif
}
| CHAINEDFOR '(' instruction ';' bool ';' instruction ')' instruction {
vectorForInstruction::registerNewLoop(); $$ = new vectorForInstruction ($3,$5,$7,$9, true); };
if : IF '(' bool ')' instruction { $$ = new ifInstruction ($3,$5);
};
//: ID { $$ = new varCommand<nodeBlueprint*> (*$1); }
//: node '(' argList ')' { ( (dynNode*)($1->evaluate() ) ) ->params<baseType>::rerouteParams(($3->evaluate())); }
createNode : node
| NODEVAR { $$ = new varCommand<nodeBlueprint *>(d_scanner.YYText()); }
| node '(' ')'
| node '(' argList ')' { $$ = new setNodeParameter ( $3, $1); };
createLink : link
| link '(' ')'
| link '(' argList ')' { $$ = new setEdgeParameter ( $3, $1); };
link : DELAYLINK '(' integer ')' {edgeBlueprint *l = new delayEdge($3->evaluate()); $$ = new constantCommand<edgeBlueprint*>(l); }
// | STDEDGEORD3 { edgeBlueprint *l = new stdEdgeOrd3(); $$ = new constantCommand<edgeBlueprint*>(l); }
//| SIGEDGE'(' integer ')' {edgeBlueprint *l = new sigEdge($3->evaluate()); $$ = new constantCommand<edgeBlueprint*>(l); }
// | SIGEDGE {edgeBlueprint *l = new sigEdge(); $$ = new constantCommand<edgeBlueprint*>(l); }
//| SIGEDGEORD3'(' integer ')' {edgeBlueprint *l = new sigEdgeOrd3($3->evaluate()); $$ = new constantCommand<edgeBlueprint*>(l); }
// | SIGEDGEORD3 {edgeBlueprint *l = new sigEdgeOrd3(); $$ = new constantCommand<edgeBlueprint*>(l); }
//| SIGEDGEPARAMS'(' integer ')' {edgeBlueprint *l = new sigEdgeParams($3->evaluate()); $$ = new constantCommand<edgeBlueprint*>(l); }
// | SIGEDGEPARAMS {edgeBlueprint *l = new sigEdgeParams(); $$ = new constantCommand<edgeBlueprint*>(l); }
| PULSECOUPLEEDGE'(' baseType ')' {edgeBlueprint *l = new stepEdge< edgeVirtual> ($3->evaluate()); $$ = new constantCommand<edgeBlueprint*>(l); }
| PULSECOUPLEDELAYEDGE'(' baseType ',' baseType ')' {edgeBlueprint *l = new pulsecoupleDelayEdge($3->evaluate(), $5->evaluate()); $$ = new constantCommand<edgeBlueprint*>(l); }
| WEIGHTEDEDGE { edgeBlueprint *l = new weightedEdgeVirtual(); $$ = new constantCommand<edgeBlueprint*>(l); }
| EDGE { edgeBlueprint *l = new edgeVirtual(); $$ = new constantCommand<edgeBlueprint*>(l); }
| STATICWEIGHTEDEDGE { edgeBlueprint *l = new staticWeightedEdgeVirtual();$$ = new constantCommand<edgeBlueprint*>(l); }
| COMPONENT { $$ = new constantCommand<edgeBlueprint*>(new component<edgeVirtual>); }
| COMPONENT_WEIGHTEDEDGE { $$ = new constantCommand<edgeBlueprint*>(new component<weightedEdgeVirtual>); }
| COMPONENT_STATICWEIGHTEDEDGE { $$ = new constantCommand<edgeBlueprint*>(new component<staticWeightedEdgeVirtual>); }
| STATICCOMPONENT { $$ = new constantCommand<edgeBlueprint*>(new staticComponent<edgeVirtual>); }
| STATICCOMPONENT_WEIGHTEDEDGE { $$ = new constantCommand<edgeBlueprint*>(new staticComponent<weightedEdgeVirtual>); }
| STATICCOMPONENT_STATICWEIGHTEDEDGE { $$ = new constantCommand<edgeBlueprint*>(new staticComponent<staticWeightedEdgeVirtual>); }
| RANDOMTARGET { $$ = new constantCommand<edgeBlueprint*>(new randomTarget<edgeVirtual>); }
| RANDOMTARGET_WEIGHTEDEDGE { $$ = new constantCommand<edgeBlueprint*>(new randomTarget<weightedEdgeVirtual>); }
| RANDOMTARGET_STATICWEIGHTEDEDGE { $$ = new constantCommand<edgeBlueprint*>(new randomTarget<staticWeightedEdgeVirtual>); }
| STEPEDGE { $$ = new constantCommand<edgeBlueprint*>(new stepEdge<edgeVirtual>); }
| STEPEDGE_WEIGHTEDEDGE { $$ = new constantCommand<edgeBlueprint*>(new stepEdge<weightedEdgeVirtual>); }
| STEPEDGE_STATICWEIGHTEDEDGE { $$ = new constantCommand<edgeBlueprint*>(new stepEdge<staticWeightedEdgeVirtual>); };
//boost::function<baseType(baseType)> r = baseTypeSin();
//boost::function<baseType(baseType)>(&sin);
random : GAUSSIAN '(' baseType ',' baseType ')'
{ $$ = new bindExpression<baseType>(bind(&gslNoise::getGaussian ,bind(&expression<baseType>::evaluate, $3), bind(&expression<baseType>::evaluate, $5)));}
| POWERLAW '(' baseType ',' baseType ')'
{ $$ = new bindExpression<baseType>(bind(&gslNoise::getPowerLaw,bind(&expression<baseType>::evaluate, $3), bind(&expression<baseType>::evaluate, $5)));}
| EXPONENTIAL '(' baseType ')'
{ $$ = new bindExpression<baseType>(bind(&gslNoise::getExponential,bind(&expression<baseType>::evaluate, $3)));}
| UNIFORM '(' baseType ',' baseType ')'
{ $$ = new bindExpression<baseType>(bind(&gslNoise::getUniform,bind(&expression<baseType>::evaluate, $3), bind(&expression<baseType>::evaluate, $5)));}
| BIMODAL '(' baseType ',' baseType ',' baseType ')'
{ $$ = new bindExpression<baseType>(bind(&gslNoise::getBimodal, bind(&expression<baseType>::evaluate, $3), bind(&expression<baseType>::evaluate, $5), bind(&expression<baseType>::evaluate, $7))); }
| POISSON '(' baseType ')'
{ $$ = new bindExpression<baseType>(bind(gslNoise::getPoisson, bind(&expression<baseType>::evaluate, $3))); }
| POISSON '(' baseType ',' baseType ')'
{ $$ = new bindExpression<baseType>(bind(gslNoise::getPoisson, bind(&expression<baseType>::evaluate, $3), _E(baseType,$5))); }
| CONSTANT '(' baseType ')'
{ $$ = new bindExpression<baseType>(bind(&gslNoise::getGaussian, _E(baseType, $3), 0)); }
| FROMFILE '(' string ')'
{
cyclicStream *cs = new cyclicStream ( $3->evaluate());
$$ = new bindExpression <baseType>(bind (&cyclicStream::readBaseType, cs));
};
// Typ der Zufallszahlen aus einer Datei liest.
//$$ = new gaussian<baseType>($3->evaluate(), $5->evaluate()); }
argList : argList ',' baseType { $1->push_back($3); }
| argList ',' integer { $1->push_back(new convertIntegerToBaseType($3)); }
| baseType { $$ = new expressionVector<baseType> (); $$->push_back($1); }
| integer { $$ = new expressionVector<baseType> (); $$->push_back(new convertIntegerToBaseType($1)); };
randomList : randomList ',' random { $1->push_back(((bindExpression<baseType> *)$3) -> _f); }
| random { $$ = new vector < function <baseType () > >(); $$ -> push_back(((bindExpression<baseType> *)$1)->_f ); };
integer : INT { $$ = new constantCommand<int>(atoi(d_scanner.YYText())); }
| INTVAR { $$ = new varCommand<int>(d_scanner.YYText()); }
| integer '+' integer { $$ = new plusCommandint<int,int>($1,$3); }
| '(' integer ')' { $$ = $2;}
| integer '-' integer { $$ = new minusCommandint<int,int>($1,$3); }
| integer '*' integer { $$ = new timesCommandint<int,int>($1,$3); }
| integer '/' integer { $$ = new divideCommandint<int,int>($1,$3); }
| integer '%' integer { $$ = new modoloCommandint<int,int>($1,$3); }
| '(' INTTOKEN ')' baseType { $$ = new convertToInt($4); }
| '-'integer { $$ = new timesCommandint<int,int>(new constantCommand<int>(-1),$2); } %prec UMINUS
| GETRANDOMSEED '(' ')' { $$ = new bindExpression<int> (bind(&gslNoise::getSeed)); }
| statisticsNetworkCommandInt;
baseType : FLOATCONSTANT { $$ = new constantCommand<baseType>(atof(d_scanner.YYText())); }
| DOUBLEVAR {$$ = new varCommand<baseType>(d_scanner.YYText()); }
| '(' baseType ')' { $$ = $2;}
| baseType '+' baseType {$$ = new plusCommandbaseType<baseType,baseType>($1,$3);}
| baseType '-' baseType {$$ = new minusCommandbaseType<baseType,baseType>($1,$3);}
| baseType '*' baseType {$$ = new timesCommandbaseType<baseType,baseType>($1,$3);}
| baseType '/' baseType {$$ = new divideCommandbaseType<baseType,baseType>($1,$3);}
| baseType '+' integer {$$ = new plusCommandbaseType<baseType,int>($1,$3);}
| baseType '-' integer {$$ = new minusCommandbaseType<baseType,int>($1,$3);}
| baseType '*' integer {$$ = new timesCommandbaseType<baseType,int>($1,$3);}
| baseType '/' integer {$$ = new divideCommandbaseType<baseType,int>($1,$3);}
| integer '-' baseType {$$ = new minusCommandbaseType<int,baseType>($1,$3);}
| integer '+' baseType {$$ = new plusCommandbaseType<int,baseType>($1,$3);}
| integer '*' baseType {$$ = new timesCommandbaseType<int,baseType>($1,$3);}
| integer '/' baseType {$$ = new divideCommandbaseType<int,baseType>($1,$3);}
| LOG '(' baseType ')' { $$ = new logCommandbaseType<baseType> ($3);}
| SQRT '(' baseType ')' { $$ = new sqrtCommandbaseType<baseType> ($3);}
| EXP '(' baseType ')' { $$ = new expCommandbaseType<baseType> ($3);}
| SIN '(' baseType ')' { $$ = new sinCommandbaseType<baseType> ($3);}
| '(' DOUBLETOKEN ')' integer { $$ = new convertIntegerToBaseType($4); }
| '-' baseType { $$ = new timesCommandbaseType<baseType,baseType>(new constantCommand<baseType>(-1),$2); } %prec UMINUS
| statisticsNetworkCommandBaseType
// veraltet ohne Seg-Schutz:
// | COMANDLINE '(' int ')' { $$ = new constantCommand<baseType>((atof( commandLineArguments::arg[ $3->evaluate() + 1].c_str()) )); }
| COMANDLINE '(' integer ')' { $$ = new constantCommand<baseType>( commandLineArguments::getDoubleArg( $3->evaluate() + 1)); }
| random ;
NETWORK : NETWORKVAR { $$ = command::retrieve<networkTemplate>(d_scanner.YYText()); };
statisticsNetworkCommandBaseType: NETWORK '.' MEANDEGREE '(' ')' { $$ = BASETYPENETWORKFUNK(meanDegree, $1); }
| NETWORK '.' MEANWEIGHT '(' ')' { $$= BASETYPENETWORKFUNK(meanWeight, $1);}
| NETWORK '.' MEANPATHLENGTH '(' ')' { $$= BASETYPENETWORKFUNK(meanPathLength, $1); }
| NETWORK '.' MEANCLUSTERING '(' ')' { $$= BASETYPENETWORKFUNK(meanClustering, $1); }
| NETWORK '.' GETPARAM '(' nodeDescriptor ',' string ')' { $$= BASETYPENETWORKFUNK2 (getParam, $1, _E(nodeDescriptor, $5), _E(string, $7)); }
| NETWORK '.' GETSTATE '(' nodeDescriptor ')' { $$= BASETYPENETWORKFUNK2 (getState, $1, _E(nodeDescriptor, $5),0 ); }
| NETWORK '.' GETSTATE '(' nodeDescriptor ',' integer ')' { $$= BASETYPENETWORKFUNK2 (getState, $1, _E(nodeDescriptor, $5),_E(int, $7) ); }
| NETWORK '.' TIME '(' ')' { $$= BASETYPENETWORKFUNK (time, $1); };
statisticsNetworkCommandInt: NETWORK '.' DEGREE '(' nodeDescriptor ')' { $$ = INTNETWORKFUNK1( degree, $1, _E(nodeDescriptor, $5)); }
| NETWORK '.' INDEGREE '(' nodeDescriptor')' { $$= INTNETWORKFUNK1 (inDegree, $1, _E(nodeDescriptor, $5)); }
| NETWORK '.' OUTDEGREE '(' nodeDescriptor')' { $$= INTNETWORKFUNK1 (degree, $1, _E(nodeDescriptor, $5)); }
| NETWORK '.' GETTARGET '(' nodeDescriptor ',' integer ')' { $$ = INTNETWORKFUNK2 (getTarget, $1, _E(nodeDescriptor, $5), _E(int, $7)); }
| NETWORK '.' COUNTEDGES '(' createLink ')' { $$ = INTNETWORKFUNK1 ( countEdges , $1, _E(edgeBlueprint*, $5)); }
| NETWORK '.' ADDNODE '(' createNode ')' { $$ = INTNETWORKFUNK1(addNode,$1,_E(nodeBlueprint*,$5)); }
| NETWORK '.' RANDOMNETWORK '(' nodeDescriptor ',' baseType ','createNode ',' createLink ')' { $$ = INTNETWORKFUNK4(randomNetwork,$1,_E(nodeDescriptor,$5),_E(baseType,$7),_E(nodeBlueprint*,$9),_E(edgeBlueprint*,$11));}
| NETWORK '.' RANDOMNETWORK '(' nodeDescriptor ',' baseType ','createNode ')' { $$ = INTNETWORKFUNK4(randomNetwork,$1,_E(nodeDescriptor,$5),_E(baseType,$7),_E(nodeBlueprint*,$9),network::stdEdge );}
| NETWORK '.' RANDOMUNDIRECTEDNETWORK '(' nodeDescriptor ',' baseType ','createNode ',' createLink ')' { $$ = INTNETWORKFUNK4(randomUndirectedNetwork,$1,_E(nodeDescriptor,$5),_E(baseType,$7),_E(nodeBlueprint*,$9),_E(edgeBlueprint*,$11));}
| NETWORK '.' RANDOMUNDIRECTEDNETWORK '(' nodeDescriptor ',' baseType ','createNode ')' { $$ = INTNETWORKFUNK4(randomUndirectedNetwork,$1,_E(nodeDescriptor,$5),_E(baseType,$7),_E(nodeBlueprint*,$9),network::stdEdge );}
| NETWORK '.' SCALEFREENETWORK '(' nodeDescriptor ',' nodeDescriptor ','createNode ',' createLink ')' { $$ = INTNETWORKFUNK4(scaleFreeNetwork,$1,_E(nodeDescriptor,$5),_E(nodeDescriptor,$7),_E(nodeBlueprint*,$9),_E(edgeBlueprint*,$11));}
| NETWORK '.' SCALEFREENETWORK '(' nodeDescriptor ',' nodeDescriptor ','createNode ')' { $$ = INTNETWORKFUNK4(scaleFreeNetwork,$1,_E(nodeDescriptor,$5),_E(nodeDescriptor,$7),_E(nodeBlueprint*,$9),network::stdEdge );}
| NETWORK '.' COMPLETENETWORK '(' integer ',' createNode ',' createLink ')' { $$ = INTNETWORKFUNK3(completeNetwork,$1,_E(int,$5),_E(nodeBlueprint*,$7),_E(edgeBlueprint*,$9)); }
| NETWORK '.' COMPLETENETWORK '(' integer ')' { $$ = INTNETWORKFUNK3(completeNetwork,$1,_E(int,$5), network::stdNode, network::stdEdge ); }
| NETWORK '.' LATTICE '(' integer ',' integer ',' baseType ',' createNode ')'
{ $$ = INTNETWORKFUNK5(lattice,$1,_E(int,$5),_E(int,$7),_E(baseType,$9), _E(nodeBlueprint*,$11),networkTemplate::stdEdge); }
| NETWORK '.' LATTICE '(' integer ',' integer ',' baseType ','createNode ',' createLink ')'
{ $$ = INTNETWORKFUNK5(lattice,$1,_E(int,$5), _E(int,$7), _E(baseType,$9), _E(nodeBlueprint*,$11), _E(edgeBlueprint*,$13)); }
| NETWORK '.' TORUS '(' integer ',' integer ',' baseType ',' createNode ',' createLink ')'
{ $$ = INTNETWORKFUNK5(torus,$1,_E(int,$5), _E(int,$7), _E(baseType,$9), _E(nodeBlueprint*,$11), _E(edgeBlueprint*, $13)); }
| NETWORK '.' CYCLE '(' nodeDescriptor ',' nodeDescriptor ',' createNode ')'{ $$ = INTNETWORKFUNK4(cycle,$1,_E(nodeDescriptor,$5),_E(nodeDescriptor,$7),_E(nodeBlueprint*,$9), network::stdEdge); }
| NETWORK '.' CYCLE '(' nodeDescriptor ',' nodeDescriptor ',' createNode ',' createLink ')' { $$ = INTNETWORKFUNK4(cycle,$1,_E(nodeDescriptor,$5),_E(nodeDescriptor,$7),_E(nodeBlueprint*,$9), _E(edgeBlueprint*,$11)); }
| NETWORK '.' LINE '(' nodeDescriptor ',' nodeDescriptor ',' createNode ',' createLink ')' { $$ = INTNETWORKFUNK4(line,$1,_E(nodeDescriptor,$5),_E(nodeDescriptor,$7),_E(nodeBlueprint*,$9), _E(edgeBlueprint*,$11)); }
| NETWORK '.' TORUSNEARESTNEIGHBORS '(' integer ',' integer ',' baseType ',' createNode ',' createLink ')'
{ $$ = INTNETWORKFUNK5(torusNearestNeighbors,$1,_E(int,$5), _E(int,$7), _E(baseType,$9), _E(nodeBlueprint*,$11), _E(edgeBlueprint*, $13)); }
| NETWORK '.' CREATEFROMADJACENCYLIST '(' string ',' createNode ',' createLink ')' {
#if CONDOR
$$ = new bindExpression<int>(bind(&command::addInputFileInt, _E(string,$5)));
#else
$$ = INTNETWORKFUNK3(createFromAdjacencyList,$1,_E(string,$5),_E(nodeBlueprint*,$7),_E(edgeBlueprint*,$9));
#endif
}
| NETWORK '.' SIZE '(' ')' { $$= INTNETWORKFUNK(size, $1); };
statisticsNetworkCommandBool: NETWORK '.' ISCONNECTED '(' ')' { $$ = BOOLNETWORKFUNK(isConnected, $1);}
| NETWORK '.' ISDIRECTED '(' ')' { $$ = BOOLNETWORKFUNK(isDirected, $1);}
| NETWORK '.' ISLINKED '(' nodeDescriptor ',' nodeDescriptor ')' { $$ = BOOLNETWORKFUNK2 (isLinked, $1, _E(nodeDescriptor, $5), _E(nodeDescriptor, $7)); };
bool : '(' bool ')' { $$ = $2; }
| BOOLVAR {$$ = new varCommand<bool>(d_scanner.YYText()); }
| integer EQUAL integer {$$ = new equalCommandbool<int,int>($1,$3); }
| baseType EQUAL baseType {$$ = new equalCommandbool<baseType,baseType>($1,$3); }
| integer NEQUAL integer {$$ = new nequalCommandbool<int,int>($1,$3); }
| baseType NEQUAL baseType {$$ = new nequalCommandbool<baseType,baseType>($1,$3); }
| baseType NEQUAL integer {$$ = new nequalCommandbool<baseType,int>($1,$3); }
| baseType NEQUAL baseType {$$ = new nequalCommandbool<baseType,baseType>($1,$3); }
| baseType '<' baseType {$$ = new lessCommandbool<baseType,baseType>($1,$3); }
| integer '<' integer {$$ = new lessCommandbool<int,int>($1,$3); }
| integer '<' baseType {$$ = new lessCommandbool<int,baseType>($1,$3); }
| baseType '<' integer {$$ = new lessCommandbool<baseType,int>($1,$3); }
| integer '>' integer {$$ = new greaterCommandbool<int,int>($1,$3); }
| integer '>' baseType {$$ = new greaterCommandbool<int,baseType>($1,$3); }
| baseType '>' integer {$$ = new greaterCommandbool<baseType,int>($1,$3); }
| baseType '>' baseType {$$ = new greaterCommandbool<baseType,baseType>($1,$3); }
| integer GREATEREQUAL integer {$$ = new greaterEqualCommandbool<int,int>($1,$3); }
| integer GREATEREQUAL baseType {$$ = new greaterEqualCommandbool<int,baseType>($1,$3); }
| baseType GREATEREQUAL integer {$$ = new greaterEqualCommandbool<baseType,int>($1,$3); }
| baseType GREATEREQUAL baseType {$$ = new greaterEqualCommandbool<baseType,baseType>($1,$3); }
| integer LESSEQUAL integer {$$ = new lessEqualCommandbool<int,int>($1,$3); }
| integer LESSEQUAL baseType {$$ = new lessEqualCommandbool<int,baseType>($1,$3); }
| baseType LESSEQUAL integer {$$ = new lessEqualCommandbool<baseType,int>($1,$3); }
| baseType LESSEQUAL baseType {$$ = new lessEqualCommandbool<baseType,baseType>($1,$3); }
| bool AND bool {$$ = new andCommandbool<bool,bool>($1,$3); }
| bool OR bool { $$ = new orCommandbool<bool,bool>($1,$3); }
| bool EQUAL bool { $$ = new equalCommandbool<bool, bool > ( $1, $3 ); }
| NOT bool { $$ = new notCommand($2); }
| BOOLONE { $$ = new constantCommand<bool>(1); }
| BOOLZERO { $$ = new constantCommand<bool>(0); }
| statisticsNetworkCommandBool;
node : NODE { nodeBlueprint *n = new nodeVirtualEdges<dynNode>(); $$ = new constantCommand<nodeBlueprint*>(n);}
| INTEGRATEFIREQUEUE { nodeBlueprint *n = new nodeVirtualEdges<pulseCoupledExcitatoryNeuron>(); $$ = new constantCommand<nodeBlueprint*>(n);}
| RANDOMBLUEPRINTNODE '(' createNode ',' createNode ',' baseType ')' { nodeBlueprint *n = new randomBlueprintNode ( $3, $5, $7->evaluate()); $$ = new constantCommand<nodeBlueprint*>(n); }
| STREAMOUTNODE '(' string ')' { nodeBlueprint *n = new nodeVirtualEdges<streamOutNode> ($3->evaluate()); $$ = new constantCommand<nodeBlueprint*>(n);}
| STREAMINNODE '(' string ')' { nodeBlueprint *n = new nodeVirtualEdges<streamInNode> ($3->evaluate()); $$ = new constantCommand<nodeBlueprint*>(n);}