Question 1
In direct DFA construction from a Regular Expression, what function computes the set of syntax tree positions that can be the FIRST character of a string generated by a node's subexpression?
firstpos(n) returns the set of positions at the leaves of the subexpression rooted at n that can match the first symbol of a string generated by that subexpression.