Lines Matching refs:rule
114 (* look_pos: position in the rhs of a rule at which we should start placing
123 (* rule_pos: calculate place in the rhs of a rule at which we should start
133 rule has proven to be nullable so far.
155 val check_rule = fn (rule as RULE {num,...}) =>
156 let val pos = rule_pos rule
158 prRule rule;
162 update(positions,num,rule_pos rule))
171 fn (ITEM{rule,dot, rhsAfter=NONTERM _ :: _}) =>
172 dot >= (look_pos rule)
189 map (fn rule=>(ITEM{rule=rule,dot=0,rhsAfter=nil},
221 (* findRuleRefs: state -> rule -> lookahead refs for rule. *)
227 fn (rule as RULE {rhs=nil,...}) =>
228 [findRef(state,ITEM{rule=rule,dot=0,rhsAfter=nil})]
229 | (rule as RULE {rhs=sym::rest,...}) =>
230 let val pos = Int.max(look_pos rule,1)
232 findRef(state,ITEM{rule=rule,
237 findRef(state,ITEM{rule=rule,
246 [findRef(state,ITEM{rule=rule,dot=pos,rhsAfter=nil})]
262 List.foldr (fn (rule as RULE {rhs=rhs as NONTERM n :: _,...},r) =>
264 (rest_is_null(ITEM {dot=0,rhsAfter=rhs,rule=rule}))
390 be propagated. For each rule, it must trace the shift/gotos in the LR(0)
413 dot,rule})::t,r) =
418 val newr = if dot >= (look_pos rule)
434 let fun f (item as ITEM {rule,dot,...}) =
435 let val refs = findRuleRefs state rule
448 if dot >= (look_pos rule) then