All the starting symbols or possible ε that can be introduced by non-ending symbols, but this starting symbol is required to be an ending symbol. In this case, question a can deduce a and ε, so first (A) = {A, ε}; similarly, first (B) = {B, ε}; s can deduce ABC, you can also export BC and C, so first (S) = {a, B, c} The first set is ultimately for the right string of the form, but the key is to find the first set of non-Terminator, because the first set of Terminator is its own, therefore, after finding the first set of non-Terminator, you can obtain the first set of each string intuitively. 1.Directly charged: pairs such as U-... Generate (where a is the terminator), and send a's revenue to first (u) 2.Repeated transmission: the object is in the u-p... (P is not a terminator), and all content in first (p) should be transmitted to first (u.
|
For example, for a, the formula is S → abc a → A | ε, but only S → ABC is useful. The ending symbol following a is first (B) = {B, ε}. When the first (B) element is ε, the symbol following a is C, so follow (A) = {B, c} is the same as follow (B) = {c} The follow set is for non-Terminator. Follow (u) expresses the set of all possible terminologies with non-terminator U in a sentence. In particular, "#" is the suffix of the identifier. 1.Charge directly: Pay attention to each of the right parts of the generative formula, such as "... UA ..." To directly generate a to follow (u. 2. direct charge: The pair is like "... Up ..." (P) is a combination of non-terminologies, and first (P) is directly included in follow (u. 3. Repeated transmission: pairs such as U -... P (where p is not a terminator), all content in follow (u) should be transmitted to follow (P ). |