# Do a transition in the automata
private fun go_to(index: Int): Int
do
var state = state
var low = 1
var high = parser_goto(index, 0) - 1
while low <= high do
var middle = (low + high) / 2
var subindex = middle * 2 + 1 # +1 because parser_goto(index, 0) is the length
var goal = parser_goto(index, subindex)
if state < goal then
high = middle - 1
else if state > goal then
low = middle + 1
else
return parser_goto(index, subindex+1)
end
end
return parser_goto(index, 2) # Default value
end
src/parser/parser_work.nit:46,2--68,4