Adding Language Support 5: Creating an Add-On installer

Home Forums Multi-Edit User/Developer Additional Language/Compiler Support Adding Language Support 5: Creating an Add-On installer

This topic contains 0 replies, has 7,141 voices, and was last updated by  deleyd 10 years, 8 months ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #2504

    deleyd
    Participant

    Adding Language Support 5: Creating an Add-On installer

    This is a template for adding support for a new language. Currently it is set up as:
    [code:39ct9s1d] Language Name: ZZZZZZ
    Filename Extension: .ZZZ
    Prefix: Zzz (See notes below on prefixes)[/code:39ct9s1d][list:39ct9s1d][*:39ct9s1d]The new language is called ZZZZZZ[/*:m:39ct9s1d]
    [*:39ct9s1d]The file extension for this language is .ZZZ[/*:m:39ct9s1d]
    [*:39ct9s1d]The prefix used for this language is Zzz (See notes below on prefixes)[/*:m:39ct9s1d][/list:u:39ct9s1d]The attached zip file contains the following files which comprise the installer:[list:39ct9s1d][list:39ct9s1d][*:39ct9s1d]ZZZZZZ.dat
    [*:39ct9s1d]ZZZZZZ.del[/*:m:39ct9s1d]
    [*:39ct9s1d]ZZZZZZ.mwl[/*:m:39ct9s1d]
    [*:39ct9s1d]ZZZZZZ.s[/*:m:39ct9s1d]
    [*:39ct9s1d]ZZZZZZ.upd[/*:m:39ct9s1d]
    [*:39ct9s1d]Install.lst[/*:m:39ct9s1d][/list:u:39ct9s1d][/*:m:39ct9s1d][/list:u:39ct9s1d]All we need to do is:

      [*:39ct9s1d]Change the name of the language from ZZZZZZ to the name of your language.[/*:m:39ct9s1d]
      [*:39ct9s1d]Change the file extension from .ZZZ to the extension for your language.[/*:m:39ct9s1d]
      [*:39ct9s1d]Change the prefix from Zzz to some 3 letters for your language.[/*:m:39ct9s1d]
      [*:39ct9s1d]Add the keywords for your language to ZZZZZZ.mwl[/*:m:39ct9s1d]
      [*:39ct9s1d]Rename the modifed files ZZZZZZ.* to <your language>.*[/*:m:39ct9s1d]
      [*:39ct9s1d]Test install our new language support.

      Then we can:[/*:m:39ct9s1d]
      [*:39ct9s1d]Have a look at the new filename extension entry we created.[/*:m:39ct9s1d]
      [*:39ct9s1d]Have a look at the new language entry we created.[/*:m:39ct9s1d]
      [*:39ct9s1d]Fine Tune the language setup.[/*:m:39ct9s1d][/list:o:39ct9s1d]
      Example:
      To set up a language named Wiles:

      [code:39ct9s1d] Language Name: Wiles
      Filename Extension: .WIL
      Prefix: Wes (See notes below on prefixes)[/code:39ct9s1d]
      Copy these files to an empty directory (Note: Leave out this ReadMe.txt file):[list:39ct9s1d][list:39ct9s1d][*:39ct9s1d]Install.lst
      [*:39ct9s1d]ZZZZZZ.dat[/*:m:39ct9s1d]
      [*:39ct9s1d]ZZZZZZ.del[/*:m:39ct9s1d]
      [*:39ct9s1d]ZZZZZZ.mwl[/*:m:39ct9s1d]
      [*:39ct9s1d]ZZZZZZ.s[/*:m:39ct9s1d]
      [*:39ct9s1d]ZZZZZZ.upd[/*:m:39ct9s1d][/list:u:39ct9s1d][/*:m:39ct9s1d][/list:u:39ct9s1d]

      [*:39ct9s1d]Change the name of the language from ZZZZZZ to the name of your language
      Our new language is called Wiles.
      Do a File Search & Replace, search for "ZZZZZZ", replace with "Wiles"
      (SEARCH -> FILE REPLACE)
      [/*:m:39ct9s1d]
      [*:39ct9s1d]Change the file extension from .ZZZ to the extension for your language
      Two files:[list:39ct9s1d][*:39ct9s1d]ZZZZZZ.upd[/*:m:39ct9s1d][*:39ct9s1d]ZZZZZZ.del[/*:m:39ct9s1d][/list:u:39ct9s1d]For these two files only, do a CASE SENSITIVE Search & Replace, replace "ZZZ" with "WIL"
      [/*:m:39ct9s1d]
      [*:39ct9s1d]Change the prefix from Zzz to some 3 letters for your language.
      Our new language prefix is Wes.
      Do a CASE SENSITIVE File Search & Replace, search for "Zzz", replace with "Wes"
      (There are a lot of them, so select ‘All Files’ to quickly do them all)
      [/*:m:39ct9s1d]
      [*:39ct9s1d]Add the keyword file listing the keywords for your language.
      Edit file ZZZZZZ.mwl and add the keywords.
      There are 4 sections:

      [list:39ct9s1d][*:39ct9s1d]WordList1.wl[/*:m:39ct9s1d]
      [*:39ct9s1d]WordList2.wl[/*:m:39ct9s1d]
      [*:39ct9s1d]WordList3.wl[/*:m:39ct9s1d]
      [*:39ct9s1d]WordList4.wl[/*:m:39ct9s1d][/list:u:39ct9s1d]
      The only difference is the color Multi-Edit displays the keywords in. In the Color Setup dialog:TOOLS -> CUSTOMIZE -> General(left side) -> COLOR SETUP (right side)
      the four colors correspond to:

      [list:39ct9s1d][*:39ct9s1d]Reserved Words 1[/*:m:39ct9s1d]
      [*:39ct9s1d]Reserved Words 2[/*:m:39ct9s1d]
      [*:39ct9s1d]Reserved Words 3[/*:m:39ct9s1d]
      [*:39ct9s1d]Reserved Words 4[/*:m:39ct9s1d][/list:u:39ct9s1d]
      For more, see this article:
      Adding Language Support. 1: Syntax Highlighting
      http://www.multieditsoftware.com/forums … php?t=1614
      http://www.multiedit.com/forums/viewtopic.php?t=2013

      (You could simply place all the keywords under WordList1.wl)

      [/*:m:39ct9s1d]
      [*:39ct9s1d]Rename ZZZZZZ.* to <your language>.*
      Our new language is called Wiles. Our files are now named:
      [list:39ct9s1d][*:39ct9s1d]Install.lst[/*:m:39ct9s1d]
      [*:39ct9s1d]Wiles.dat[/*:m:39ct9s1d]
      [*:39ct9s1d]Wiles.del[/*:m:39ct9s1d]
      [*:39ct9s1d]Wiles.mwl[/*:m:39ct9s1d]
      [*:39ct9s1d]Wiles.s[/*:m:39ct9s1d]
      [*:39ct9s1d]Wiles.upd[/*:m:39ct9s1d][/list:u:39ct9s1d][/*:m:39ct9s1d]
      [*:39ct9s1d]Test install our new language support.
      [Note: Before doing this, check to see if you already have some support for this language and/or filename extension. Perform steps 7 & 8 now to check this. If you do find existing entries for your language, go to step 9: "Fine tune the language setup", and copy over those existing entries to your *.upd install file, then come back here and test install your new language.]

      Run INSTALL ADD-ON PACKAGES to install your new language:

      [*:39ct9s1d]TOOLS -> INSTALL ADD-ON PACKAGES[/*:m:39ct9s1d]
      [*:39ct9s1d]Browse to the directory with your new install files we just made and click OK.[/*:m:39ct9s1d]
      [*:39ct9s1d]The new install package should show up.
      (It searches for file install.lst)
      (install.lst is also where the version number is stored.)[/*:m:39ct9s1d]
      [*:39ct9s1d]Click ‘Install'[/*:m:39ct9s1d]
      [*:39ct9s1d]For a reinstall, select ‘Full Install’ if it asks.[/*:m:39ct9s1d][/list:o:39ct9s1d][/*:m:39ct9s1d]
      [*:39ct9s1d]Have a look at the new filename extension entry:
      [*:39ct9s1d]TOOLS -> CUSTOMIZE -> General(left side) -> FILENAME EXTENSIONS (right side)[/*:m:39ct9s1d]
      [*:39ct9s1d]Select WIL (probably at the bottom of the list)[/*:m:39ct9s1d]
      [*:39ct9s1d]and click ‘Edit'[/*:m:39ct9s1d][/list:o:39ct9s1d]Make any necessary changes.
      [/*:m:39ct9s1d]
      [*:39ct9s1d]Have a look at the new language entry:
      [*:39ct9s1d]TOOLS -> CUSTOMIZE -> General(left side) -> LANGUAGES (right side)[/*:m:39ct9s1d]
      [*:39ct9s1d]Select Wiles (probably at the bottom of the list)[/*:m:39ct9s1d]
      [*:39ct9s1d]and click ‘Edit'[/*:m:39ct9s1d][/list:o:39ct9s1d]Make any necessary changes.
      [/*:m:39ct9s1d]
      [*:39ct9s1d]Fine tune the language setup
      Repeat steps 7,8 to fine tune the new filename extension setup and the new language setup.

      When the new Language Setup and Filename Extension dialogs are correct, we can update our installer file Wiles.upd

      [*:39ct9s1d]Exit Multi-Edit[/*:m:39ct9s1d]
      [*:39ct9s1d]Go to the Multi-Edit Config directory and find file MeConfig.db
      See: How to find the Meconfig.db and Wcmdmap.db files[list:39ct9s1d][*:39ct9s1d][url:39ct9s1d]http://www.multieditsoftware.com/TheDev/v04_i08_2007.htm#CMC[/url:39ct9s1d][/*:m:39ct9s1d]
      [*:39ct9s1d][url:39ct9s1d]http://www.multiedit.com/forums/viewtopic.php?t=2013[/url:39ct9s1d][/*:m:39ct9s1d][/list:u:39ct9s1d][/*:m:39ct9s1d][*:39ct9s1d]Make a copy of MeConfig.db .
      We will examine the copy only and leave the original alone.[/*:m:39ct9s1d]
      [*:39ct9s1d]Start Multi-Edit.
      Load the copy of MeConfig.db
      Load Wiles.upd[/*:m:39ct9s1d]
      [*:39ct9s1d]In Wiles.upd note that there are two lines that start with "Dat"
      Those are the two lines we will change.
      (Note: these lines have embedded 0x7F characters in them that might look like squares.)[/*:m:39ct9s1d]
      [*:39ct9s1d]In the copy of MeConfig.db, search for "EXT=WIL"
      replace the line in Wiles.upd with this line, and precede the line with "Dat "[/*:m:39ct9s1d]
      [*:39ct9s1d]In the copy of MeConfig.db, search for "LANG=Wiles"
      replace the line in Wiles.upd with this line, and precede the line with "Dat "[/*:m:39ct9s1d][/list:o:39ct9s1d][/*:m:39ct9s1d][/list:o:39ct9s1d]We have now updated our installer files. Try installing it again.
      We can also port this installer to other computers now.

      ——–
      NOTES:

      PREFIXES: Just make something up. For a list of currently used prefixes, see:[list:39ct9s1d][*:39ct9s1d]Adding Language Support 2. Language Specific Macros
      [url:39ct9s1d]http://www.multieditsoftware.com/forums/viewtopic.php?t=1854[/url:39ct9s1d][/*:m:39ct9s1d][/list:u:39ct9s1d]Some of these names could be the same. e.g. you could have:
      [code:39ct9s1d] Language Name: AWK
      Filename Extension: .AWK
      Prefix: Awk[/code:39ct9s1d]

      ———
      *Wiles:
      Andrew Wiles – Proved Fermat’s Last Theorem (1994)

      ——————————————————————————
      Related Articles:







      (Additions to this Adding Language Support series are occasionally made as I have time.)
      Adding Language Support ZZZ.zip

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.