Hacker News new | ask | show | jobs
by seanmcdirmid 4903 days ago
Ya, grammar only describes the syntax of a language. You still have the semantics and pragmatics to consider!

I'm not even sure if a XBNF is the best way to describe or reason about language syntax. Precedence grammars (with hacks to handle braces) are quite interesting for robust error tolerant parsing, and might more closely mirror how we internal grammars in our head.

1 comments

Technically, the grammar describes the language of the language, where the "language of the language" means the formal language, the set of characters and strings that are valid (wheras the union of all of the characters allowed in every char or string that is valid in the language is the language's alphabet, not all members of the alphabet may be allowed to stand alone as a token in a given language..)
My PhD in PL tells me your right, but I'm always on the lookout for a more intuitional vs. technical definition of language, even for programming.
You could always use META II which defines the grammar and the semantics :D