So, inspired by this post, I started wondering how it would be to have a natural-ish language that would be parseable by an LL(1) parser.
An LL(1) parser is, essentially, a parser that looks only one token ahead and uses the leftmost production rule. To put it in much simpler terms, if a language is LL(1), you can always predict a word's role in the sentence without looking further ahead and without backtracking.
English (and most natural languages, I suppose) is not LL(1). Imagine an English sentence that begins like that:
Code: Select all
This apple …
Code: Select all
This apple | tastes good.
Code: Select all
This apple | juice is sweet.
Another thing is that while we can't write a grammar that would look like that:
Code: Select all
Sentence = SVO | SOV
SVO = Subject Verb Object
SOV = Subject Object Verb
Subject = Noun
Object = Noun
Code: Select all
Sentence = Subject VerbPhrase
VerbPhrase = VO | OV
VO = Verb Object
OV = Object Verb
Subject = Noun
Object = Noun
* * *
So, we want to create a conlang that is parseable by a certain class of algorithms. It would help if we had an automated tool that could determine if our conlang fulfills that.
Luckily enough, I've already written such a thing. It is a set of scripts that, given a lexicon and a syntax description, build a fully functional parser for an LL(1) conlang, able to transform a conlang text into a syntax tree. If a grammar isn't LL(1), the build process will fail.
And here I stopped. Turns out, while I'm able to write a framework for creating a conlang, I have problems creating the conlang itself. I haven't been regularly conlanging for quite a long time, and now it's quite difficult for me to find inspiration for the language. The fact that I'm more used to creating languages bottom-up, first playing with a phonology and building on top of that, and here I have to start with syntax and move from the top down, might be playing a role as well.
So, well, this was supposed to be an introduction of a conlang. But since there's no conlang (yet?), it will just be an introduction.
Enjoy.