Skip to content

more robust grammar handling #1

@vdella

Description

@vdella

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions