Right now, our project can only handle grammars that are described by terminals and non-terminals that have, each one, one char for its identification, such as S -> aSa | bSb | a | b. However, for enhancing software robustness, it would be nice to enable parsing of grammars that have more complex forms, such as:
E -> TE'
E' -> ∨TE' | &
T -> FT'
T' -> ∧FT' | &
F -> ¬F | id
Note that, apart from having E' as a non-terminal, this grammar has also id as one of its terminals. The presented grammar is LL(1).
An approach would be changing the productions rules for grammars, from {'E', 'TE'} to {'E', ['T', 'E'']}. Thus, pattern matching needs to be implemented and appended at the parsing process.
Right now, our project can only handle grammars that are described by terminals and non-terminals that have, each one, one char for its identification, such as
S -> aSa | bSb | a | b. However, for enhancing software robustness, it would be nice to enable parsing of grammars that have more complex forms, such as:Note that, apart from having
E'as a non-terminal, this grammar has alsoidas one of its terminals. The presented grammar is LL(1).An approach would be changing the productions rules for grammars, from
{'E', 'TE'}to{'E', ['T', 'E'']}. Thus, pattern matching needs to be implemented and appended at the parsing process.