Saturday, September 24, 2005

Grammary Front End Goodnes'

I have a very nice C# form front end to my grammar parser, builder, excuter-majig.
(probably about 15 minutes work - C# is a wonder! Once again I'd love to show pictures - I'm holding out that one day bloggers picture option will work for me, too)


[start] -> [C][V][C][End]
[C] -> "b" | "c" | "d" | "f" | "g" | "h" | "j" | "k" | "l" |
"m" | "n" | "p" | "q" |"r" | "s" | "t" | "w" | "x" | "y" | "z"
[V] -> "a" | "e" | "i" | "o" | "u"
[End] -> "dur" | "mir"


Grammars such as the above go in one box - names come out the other! Splendid.

Minor problem is that, for different grammars, I never reset the parse tree so the grammar just grows and grows. The end functions probably aren't too clean in lua either. (as in tricky to remove memory-wise)

Here's some example output:


Bifmir
Mesdur
Lizdur
Giymir
Rojdur
Jirdur
Foldur


Not bad names - ends could do with a little variety though.

This and my world generation algorithm in my main code has made today quite successful!

I've registered a source forge account and might upload this project once I've polished it. Probably under the MIT license or some quite unrestrictive license.

No comments: