Lines Matching defs:distance

104 	* The distance-parser:
106 This parser includes an additional argument distance. It pushes
107 elements on the queue until it has parsed distance tokens, or an
265 (lex result * lexer), a state stack, a queue, and a distance
267 with the nth token shifted on top, a queue, a distance, and action
280 queue,distance) =
289 Fifo.put((newStack,newLexPair),queue),distance-1)
295 queue,distance)
297 | ERROR => (lexPair,stack,queue,distance,SOME nextAction)
298 | ACCEPT => (lexPair,stack,queue,distance,SOME nextAction)
332 (* now number elements of stateList, giving distance from
344 distance = the number of tokens beyond the error token which the
351 {pos : int, distance : int, leftPos: 'b, rightPos: 'b,
357 (* parse: given a lexPair, a stack, and the distance from the error
358 token, return the distance past the error token that we are able to parse.*)
362 of (_,_,_,distance,SOME ACCEPT) =>
363 if maxAdvance-distance-1 >= 0
365 else maxAdvance-distance-1
366 | (_,_,_,distance,_) => maxAdvance - distance - 1
377 val distance = parse(lex',stack,
379 in if distance >= minAdvance + keywordsDelta new
381 distance=distance,orig=orig,new=new}]
462 foldr (fn (CHANGE {distance,...},high) => Int.max(distance,high)) 0 l
464 (* maxDist: max distance past error taken that we could parse *)
471 (fn(c as CHANGE{distance,...}) =>
472 if distance=maxDist then [c] else [])
537 let val distance = 15 (* defer distance tokens *)
539 val maxAdvance = Int.max(lookahead,0)(* max distance for parse check *)
550 | loop (lexPair,stack,queue,distance,SOME ERROR) =
552 in loop (distanceParse(lexPair,stack,queue,distance))
557 in loop (distanceParse(lexPair,startStack,startQueue,distance))