|
Lesson 2: Basic syntaxLanguage extension code is XMLVerbix language extensions are based on XML code. If you open in Notepad the language extension mentioned in lesson 1, you will see something like listed below (line numbers are added here just as to make it easier to refer to the XML code). XML code consists of the following:
Note! XML code is always case sensitive! 1: <?xml version="1.0" encoding="Windows-1252"?> 2: <languages> 3: <file> 4: <created format="dd.MM.yyyy">7.5.2002</created> 5: <modified format="dd.MM.yyyy">7.5.2002</modified> 6: <creator> 7: <firstname>Erik</firstname> 8: <lastname>Lindberg</lastname> 9: <email>info@verbix.com</email> 10: <web>www.verbix.com</web> 11: </creator> 12: </file> 13: <language> 14: <info> 15: <name>Test language</name> 16: <code>test</code> 17: <created format="dd.MM.yyyy">7.5.2002</created> 18: <status percentage="1">Under construction</status> 19: <parser> 20: <name>VerbiXML</name> 21: <version> 22: <major>1</major> 23: <minor>0</minor> 24: <sub>4</sub> 25: </version> 26: </parser> 27: </info> 28: <words> 29: <verbs published="yes"> 30: <tenses> 31: <item id="0" forms="1">Infinitive</item> 32: </tenses> 33: <rules> 34: <check> 35: <rule resulttype="1" >*</rule> 36: </check> 37: </rules> 38: <code> 39: <item type="1" tense="0" command="add">Hello %root%!</item> 40: </code> 41: <items> 42: <item type="1">world</item> 43: </items> 44: </verbs> 45: </words> 46: </language> 47: </languages> Basic structureEach Verbix language extension consists of two major sections: file section (lines 3-12) and language section (lines 13-46).
File sectionFile section includes the information of the creator of the language extension. Feel free to modify it. Dates must always be entered in the same format as on line 4 and 5. Language sectionLanguage section is much more complicated, because it must contain all the information of the language and its conjugations. Lesson 3 will discuss language section. |