parsing - Explanation on this FIRST function -
ll(1) grammar: (1) var -> id dimlist (2) dimlist -> ε dimlist' (3) dimlist' -> dim dimlist' (4) dimlist' -> ε (5) dim -> [ const ] and, in script reading, says function first(ε dimlist') gives {#, [} . but, how? my guess since right side of (2) begins ε , skips epsilon , takes first(dimlist') is, considering (3) , (5), equal {[} , also, because of (4), takes follow(dimlist') {#} . other way that, since (2) begins ε skips epsilon , takes first(dimlist') takes follow(dimlist) (2)... first 1 makes more sense me, though i'm still in process of learning basics of ll(1) grammars appreciate if takes time make clear, thank you. edit: and, of course, neither of these true. the usual definition of first function result in first(dimlist) (or, if like, first(ε dimlist') being {ε, [} . ε in first(ε dimlist') because both ε , dimlist' nullable. [ element because first symbol in derivation of ε di...