Function opg::find_less[][src]

pub(crate) fn find_less(
    table: &mut OpTable,
    productions: &Vec<Production>,
    nts: &HashSet<String>,
    firstvt: &HashMap<String, HashSet<String>>
)

Find the less relations

Input

table the mutable OpTable struct for output

productions the vector of struct Production

nts the non-terminal set, which could be generated from the function get_non_terminals().

firstvt the FIRSTVT set generated from the function gen_firstvt().

Example

let firstvt = gen_firstvt(&productions, &nts);
find_less(&mut table, &productions, &nts, &firstvt);

Principles

Find ...T1U1..., where T2 is in FIRSTVT(U1) and make T1<T2. Notice that this doesn't indicate that T2>T1.