)[numpy.newaxis, numpy.newaxis, :],
0
)
- self.accessing_symbols = numpy.zeros(
+ self.accessing_symbols = numpy.full(
(len(lr1dfa.states),),
+ 2, # '$undefined'
numpy.int16
)
for i in range(1, len(lr1dfa.states)):
(
action_table[:, :, numpy.newaxis] ==
numpy.arange(
- 1,
+ -1,
-len(lr1dfa.productions),
-1,
dtype = numpy.int16
),
1
)
+ #print(action_table)
+ #print(self.default_action)
self.default_goto = numpy.argmax(
numpy.concatenate(
[
),
1
)
+ #print(goto_table)
+ #print(self.default_goto)
# fill in the zero entries in the tables with default reduce or goto
for i in range(len(lr1dfa.states)):
action_table[i, action_table[i, :] == 0] = -self.default_action[i]
for i in range(n_nonterminals):
goto_table[i, goto_table[i, :] == 0] = self.default_goto[i]
+ #print(action_table)
+ #print(goto_table)
# entry_base indicates the most negative starting index we can expect
# we maintain entry_size such that entry_used[entry_size:, :] == False