Hacker News new | past | comments | ask | show | jobs | submit login

I don't think "context free" is the concept i was referring to. AFAIK, a grammar can be context free but still have these kind of "syntactic overloads" annoyances. E.g. in Python these expression will always be parsed the same no matter its context: "(foo(bar, baz) + (a,))"; it bothers me, however, that each one of those three pair of parentheses has a different syntactic meaning (one is for grouping, one is for function call, and the last one is for a tuple). Not ambiguous for the parser, but quite inconvenient for my brain's parser that i have distinguish between three possible different meanings for the same syntactic symbol.



Such an unambiguous grammar would only have as many state transitions in its FSM than characters in the grammar, which would limit the language considerably, so you would have to raise the number of characters.

Also ( means something different in a string, so in that sense evert programming language with strings are hard to parse locally.

Also note that ambiguity formally means that more than one parse trees can represent the same string.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: