tags:

views:

124

answers:

1

Alrighty, by LL(k) languages, I mean programming languages whose parsers can be described by grammars which are LL(k).

these are my guesses:

pascal
lisp
xml and friends

+6  A: 

It depends on the definition of "language". If you ask

What programming language is correctly parsable with an LL(k) parser?

then none is, not even pascal or xml, since they are all context-sensitive. A context-free grammar cannot detect errors such as identifiers that are used without being defined, or match the opening and closing tag in XML. If you ask

What programming language can be conveniently parsed with an LL(k) parser, assuming that further analysis of well-formedness must be added on top of parsing?

then ANTLR is proof that nearly every programming language can be processed with a (version of an) LL(k) parser.

Martin v. Löwis
Also, CFG can't describe "types", and allowed operations depending on types.
AraK
@Arak: right; this is probably more relevant than the need for declarations. Interestingly enough, Algol-68 solved both problems with a two-level grammar.
Martin v. Löwis
@Martin This makes assumptions about what a programming language syntax allows or restricts and toss together the lexical parsing and semantic analysis phases. I think a restructure of the answer would be helpful.
pst
@Ellery: maybe you should ask the question more clearly if you want a different answer.
Martin v. Löwis
@Ellery: Then you should edit your question to reflect what you have just said, your question just asks for languages that can be parsed via LL(k).
Vinko Vrsalovic
@Ellery: No matter what type of parser you're creating, efficiency heavily depends on how you express the grammar. I think #2 is better stated as "ANTLR can parse all sorts of crap if you're willing to use it effectively."
280Z28