Lines Matching defs:distance

74 	* The distance-parser:
76 This parser includes an additional argument distance. It pushes
77 elements on the queue until it has parsed distance tokens, or an
237 (lex result * lexer), a state stack, a queue, and a distance
239 with the nth token shifted on top, a queue, a distance, and action
252 queue,distance) =
261 Fifo.put((newStack,newLexPair),queue),distance-1)
267 queue,distance)
269 | ERROR => (lexPair,stack,queue,distance,SOME nextAction)
270 | ACCEPT => (lexPair,stack,queue,distance,SOME nextAction)
304 (* now number elements of stateList, giving distance from
316 distance = the number of tokens beyond the error token which the
323 {pos : int, distance : int, leftPos: 'b, rightPos: 'b,
330 let val CHANGE {distance,new,orig,pos,...} = c
331 in (print ("{distance= " ^ (Int.toString distance));
340 (* parse: given a lexPair, a stack, and the distance from the error
341 token, return the distance past the error token that we are able to parse.*)
345 of (_,_,_,distance,SOME ACCEPT) =>
346 if maxAdvance-distance-1 >= 0
348 else maxAdvance-distance-1
349 | (_,_,_,distance,_) => maxAdvance - distance - 1
360 val distance = parse(lex',stack,pos+length new-length orig)
361 in if distance >= minAdvance + keywordsDelta new
363 distance=distance,orig=orig,new=new}]
444 foldr (fn (CHANGE {distance,...},high) => Int.max(distance,high)) 0 l
446 (* maxDist: max distance past error taken that we could parse *)
453 (fn(c as CHANGE{distance,...}) =>
454 if distance=maxDist then [c] else [])
519 let val distance = 15 (* defer distance tokens *)
521 val maxAdvance = Int.max(lookahead,0)(* max distance for parse check *)
532 | loop (lexPair,stack,queue,distance,SOME ERROR) =
534 in loop (distanceParse(lexPair,stack,queue,distance))
539 in loop (distanceParse(lexPair,startStack,startQueue,distance))