1 /* -*- fundamental -*- */
7 static Train *cur_train;
14 FeaturesFeature *feature;
15 FeaturesAddr *feataddr;
20 %token <name> TRAIN FEATURE SEG IS AT HAS INVERTED STEP STOPS HOME END
29 %type <num> backwards inverted
31 %type <feature> feature
32 %type <feataddr> feataddr
36 %name-prefix="record_yy"
41 | line NL { record_tempzone_clear(); } file
44 | TRAIN train IS NUM NUM '+' NUM '+' NUM
45 { if ($2) record_train_is($2,$4,$5,$7,$9);
47 | TRAIN train HOME { cur_train=$2; } segments
50 | TRAIN train STEP NUM '=' dbl
51 { if ($2) record_train_step_speed($2,$4,$6);
53 | TRAIN train STOPS NUM ':' NUM NUM
54 { if (!trains) record_train_stopregime_count();
55 else if ($2) record_train_stopregime($2,$4,$6,$7);
57 | SEG seg HAS backwards train inverted
58 { if ($2 && $5) record_seg_has($2,$4,$5,$6);
61 { if ($2) record_seg_at($2,$4);
63 | FEATURE feature IS feataddr NUM
64 { if (trains) record_feature_nmrafeat($2,$4,$5);
66 | FEATURE feature IS feataddr STEP NUM
67 { if (trains) record_feature_motor($2,$4,$6);
70 backwards: /* empty */ { $$= 0; }
73 inverted: /* empty */ { $$= 0; }
76 segments: { cur_train= (void*)-1; }
77 | backwards seg { record_train_home(cur_train,$1,$2); } segments
80 | IS | AT | HAS | INVERTED | STEP | STOPS | HOME
87 seg: ident { $$= record_pname2seg($1); }
88 train: ident { $$= record_pname2train($1); }
89 feature: ident ident { $$= record_pname2feature($1,$2); }
91 feataddr: NUM { $$= record_feataddr($1); }