MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / token_actions

Function token_actions

extern/btyacc/output.c:168–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166}
167
168void token_actions()
169{
170 register int i, j;
171 register int shiftcount, reducecount, conflictcount, csym, cbase;
172 register int max, min;
173 register Yshort *actionrow, *r, *s;
174 register action *p;
175
176 actionrow = NEW2(3*ntokens, Yshort);
177 for (i = 0; i < nstates; ++i) {
178 if (parser[i]) {
179 for (j = 0; j < 3*ntokens; ++j)
180 actionrow[j] = 0;
181
182 shiftcount = 0;
183 reducecount = 0;
184 conflictcount = 0;
185 csym = -1;
186 cbase = nconflicts;
187 for (p = parser[i]; p; p = p->next) {
188 if (csym != -1 && csym != p->symbol) {
189 conflictcount++;
190 conflicts[nconflicts++] = -1;
191 j = find_conflict_base(cbase);
192 actionrow[csym + 2*ntokens] = j + 1;
193 if (j == cbase) {
194 cbase = nconflicts; }
195 else {
196 if (conflicts[cbase] == -1) cbase++;
197 nconflicts = cbase; }
198 csym = -1; }
199 if (p->suppressed == 0) {
200 if (p->action_code == SHIFT) {
201 ++shiftcount;
202 actionrow[p->symbol] = p->number; }
203 else if (p->action_code == REDUCE &&
204 p->number != defred[i]) {
205 ++reducecount;
206 actionrow[p->symbol + ntokens] = p->number; } }
207 else if (p->suppressed == 1) {
208 csym = p->symbol;
209 if (p->action_code == SHIFT) {
210 conflicts[nconflicts++] = p->number; }
211 else if (p->action_code == REDUCE &&
212 p->number != defred[i]) {
213 if (cbase == nconflicts) {
214 if (cbase) cbase--;
215 else conflicts[nconflicts++] = -1; }
216 conflicts[nconflicts++] = p->number - 2; } } }
217 if (csym != -1) {
218 conflictcount++;
219 conflicts[nconflicts++] = -1;
220 j = find_conflict_base(cbase);
221 actionrow[csym + 2*ntokens] = j + 1;
222 if (j == cbase) {
223 cbase = nconflicts; }
224 else {
225 if (conflicts[cbase] == -1) cbase++;

Callers 1

output_actionsFunction · 0.85

Calls 1

find_conflict_baseFunction · 0.85

Tested by

no test coverage detected