mimic-sussex / sema

Sema – A Playground for Live Coding Music and Machine Learning
https://sema.codes
MIT License
151 stars 51 forks source link

responding to ambiguous grammars #162

Open chriskiefer opened 4 years ago

chriskiefer commented 4 years ago

nearley can generate multiple possibilities with ambiguous grammars (indicated by >1 elements in the root of the parser tree) - how should be deal with this? choose the first one by default and give the user a warning? Or create an error? (tempted towards the latter)

frantic0 commented 4 years ago

I recommend creating a warning and suggest the user to correct the grammar and eliminate the ambiguity.

chriskiefer commented 4 years ago

that sounds good. @frantic0 can you add this to the debug window?

frantic0 commented 4 years ago

sure, I'll add the warning on grammar output. First AST will show on the language parsing output