Menu

mShell language support

AlbatroS
2007-12-04
2012-11-14
  • AlbatroS

    AlbatroS - 2007-12-04

    Hi,

    mShell (http://www.m-shell.net) is a Symbian mobile devices programming language. It has about 40.000 REGISTERED users, as stated in 10th post of this thread: http://www.m-shell.net/Forum/Default.aspx?g=posts&t=137

    ATM no editor supports syntax, auto-completion etc. for it. It could ne nice if NPP will be the first (maybe the only). I'm not very skilled in such things, but I will very happy to collaborate if someone will give me instruction to do that all together.

    @ Jens: I've sent an email to you containing similar request before to find this forum. Sorry for that.

    AlbatroS

     
    • Nobody/Anonymous

      Hi AlbatroS,

      copy this into your userDefineLang.xml. It's just a start point. You can edit it later.

          <UserLang name="nShell" ext="m">
              <Settings>
                  <Global caseIgnored="no" />
                  <TreatAsSymbol comment="yes" commentLine="no" />
                  <Prefix words1="no" words2="yes" words3="no" words4="no" />
              </Settings>
              <KeywordLists>
                  <Keywords name="Delimiters">&quot;00&quot;00</Keywords>
                  <Keywords name="Folder+"></Keywords>
                  <Keywords name="Folder-"></Keywords>
                  <Keywords name="Operators">- ! # ( ) , ; [ ] { } + &lt; = &gt;</Keywords>
                  <Keywords name="Comment"> 1/* 2*/ 0//</Keywords>
                  <Keywords name="Words1">if while end then else function break do until use for try catch return</Keywords>
                  <Keywords name="Words2">proc. app. phone. gsm. cam. audio. sms. obex. msg. mms. net. comm. bt. contacts. agende. math. bigint. vibra. ui. graph. zip. time. system. io. files. array.</Keywords>
                  <Keywords name="Words3">print lower trim edit const</Keywords>
                  <Keywords name="Words4">true false null and in by</Keywords>
              </KeywordLists>
              <Styles>
                  <WordsStyle name="DEFAULT" styleID="11" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
                  <WordsStyle name="FOLDEROPEN" styleID="12" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
                  <WordsStyle name="FOLDERCLOSE" styleID="13" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
                  <WordsStyle name="KEYWORD1" styleID="5" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="1" />
                  <WordsStyle name="KEYWORD2" styleID="6" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0" />
                  <WordsStyle name="KEYWORD3" styleID="7" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="0" />
                  <WordsStyle name="KEYWORD4" styleID="8" fgColor="0080C0" bgColor="FFFFFF" fontName="" fontStyle="0" />
                  <WordsStyle name="COMMENT" styleID="1" fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="0" />
                  <WordsStyle name="COMMENT LINE" styleID="2" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
                  <WordsStyle name="NUMBER" styleID="4" fgColor="FF8000" bgColor="FFFFFF" fontName="" fontStyle="0" />
                  <WordsStyle name="OPERATOR" styleID="10" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="0" />
                  <WordsStyle name="DELIMINER1" styleID="14" fgColor="800000" bgColor="FFFFFF" fontName="" fontStyle="0" />
                  <WordsStyle name="DELIMINER2" styleID="15" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
                  <WordsStyle name="DELIMINER3" styleID="16" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
              </Styles>
          </UserLang>

      Best regards,

      Simon

       
    • Nobody/Anonymous

      Hi again,

      this version allows code folding. Have fun!

          <UserLang name="mShell" ext="mshell">
              <Settings>
                  <Global caseIgnored="no" />
                  <TreatAsSymbol comment="yes" commentLine="no" />
                  <Prefix words1="no" words2="yes" words3="no" words4="no" />
              </Settings>
              <KeywordLists>
                  <Keywords name="Delimiters">&quot;00&quot;00</Keywords>
                  <Keywords name="Folder+">if do for</Keywords>
                  <Keywords name="Folder-">end until</Keywords>
                  <Keywords name="Operators">- ! # ( ) , ; [ ] { } + &lt; = &gt;</Keywords>
                  <Keywords name="Comment">1/* 2*/ 0//</Keywords>
                  <Keywords name="Words1">then else function break do until use try catch return</Keywords>
                  <Keywords name="Words2">proc. app. phone. gsm. cam. audio. sms. obex. msg. mms. net. comm. bt. contacts. agende. math. bigint. vibra. ui. graph. zip. time. system. io. files. array.</Keywords>
                  <Keywords name="Words3">print lower trim edit const</Keywords>
                  <Keywords name="Words4">true false null and in by</Keywords>
              </KeywordLists>
              <Styles>
                  <WordsStyle name="DEFAULT" styleID="11" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
                  <WordsStyle name="FOLDEROPEN" styleID="12" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="1" />
                  <WordsStyle name="FOLDERCLOSE" styleID="13" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="1" />
                  <WordsStyle name="KEYWORD1" styleID="5" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="1" />
                  <WordsStyle name="KEYWORD2" styleID="6" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0" />
                  <WordsStyle name="KEYWORD3" styleID="7" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="0" />
                  <WordsStyle name="KEYWORD4" styleID="8" fgColor="0080C0" bgColor="FFFFFF" fontName="" fontStyle="0" />
                  <WordsStyle name="COMMENT" styleID="1" fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="0" />
                  <WordsStyle name="COMMENT LINE" styleID="2" fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="0" />
                  <WordsStyle name="NUMBER" styleID="4" fgColor="FF8000" bgColor="FFFFFF" fontName="" fontStyle="0" />
                  <WordsStyle name="OPERATOR" styleID="10" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="0" />
                  <WordsStyle name="DELIMINER1" styleID="14" fgColor="800000" bgColor="FFFFFF" fontName="" fontStyle="0" />
                  <WordsStyle name="DELIMINER2" styleID="15" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
                  <WordsStyle name="DELIMINER3" styleID="16" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
              </Styles>
          </UserLang>

      Simon

       
    • Nobody/Anonymous

      why not starting a section for user language definition on the notepad++ wiki?

       
    • AlbatroS

      AlbatroS - 2007-12-06

      Simon, your isctructions are very good: now I get highlighting! :-)
      Now I still need 2 advices:
      - How can I activate auto-completion? ATM it doesn't work with mShell (neither with other user-defined languages I tested);
      - Which criteria should have I to use to insert a word into a group or in another?

      PS you are not a mShell user, so I'm very impressed how deeply you went into language to do the job.

       
    • AlbatroS

      AlbatroS - 2007-12-09

      In the while I've studied so I discovered that to have auto-completion I have to create an api file. About words groups I still have doubts, please give advices.

      AlbatroS

       
      • Nobody/Anonymous

        Sorry, I was away and and couldn't answer earlier.
        I have no idea how to insert a word into a group or
        in another. Maybe someone other can give you an advice.

        Good luck!!

        Simon

         
    • AlbatroS

      AlbatroS - 2007-12-13

      I released a 1st release: http://www.m-shell.net/Forum/Default.aspx?g=posts&t=158
      Thanx to NPP community.
      Simon, I gave you credits on above link ;-)

      AlbatroS

       
    • AlbatroS

      AlbatroS - 2007-12-06

      hi Simon,

      first of all thanx for effort, I really appreciate. Are you a mShell user or simply a NPP cotributor? Can I give you credits in mShell forum after 1st release of this language definition?

      Anyway, I did as described in "User Defined Language files" section in http://notepad-plus.sourceforge.net/uk/download.php
      After that step all I get is autocompletition via ctrl(+shift)+space. So no syntax highlighting etc.

      So I went to http://notepad-plus.sourceforge.net/uk/UserLanguageDefineSystem-HOWTO.php , but I really don't understand how to access that User Define Language dialog, and how can I link it and new userDefineLang.xml addition.

      AlbatroS

       
      • Nobody/Anonymous

        Dear AlbatroS,

        you have two possibilities to include the mShell highlighting:

        1) You seek for the file userDefineLang.xml (in the Notepad++ home directory or in %APPDATA%\Notepad++\) and merge the posted code into this file (before the last line "</NotepadPlus>"). You have to change the part "<UserLang name="mShell" ext="mshell">" to "<UserLang name="mShell" ext="m">" (my mistake, I'm a MATLAB programmer which use also m-files).
        You have to do that outside of Notepad++, because the file is overwritten when closing the program, at least I guess.

        2) You choose the menu command "View\User Define Dialog...". There you do the following:
        - press >Create New...< and name it "mShell"
        - type Ext: "m"
        - add >Folder Open ...< "if do for", change font to bold blue (for example)
        - add >Folder Close ...< "end until", change font to bold blue (for example)
        - goto tab >keyword lists<
        - add 1st group: "then else function break do until use try catch return"
        - add 2nd group: "proc. app. phone. gsm. cam. audio. sms. obex. msg. mms. net. comm. bt. contacts. agende. math. bigint. vibra. ui. graph. zip. time. system. io. files. array."
        - add 3rd group: "print lower trim edit const"
        - add 4th group: "true false null and in by"
        - goto tab >Comment & Number<
        - add "//" to >Comment line<
        - add "/*" and "*/" to >Comment block<
        - change number color
        - goto tab >Operators<
        - activate following operators : - ! # () [] {} , ; + <> =
        - change there color
        - set delimiter to " and " and change color

        - close Dialog
        - to save the userDefineLang-xml restart Notepad++
        - done!! :-)

        - opened mShell (*.m) files should be highlighted
        - you just have to modify the rules and add more keywords (I just add few)

        Of course you can give me credits, but you don't have to. I'm just a Notepad++ user and also benefit from the help and especially the work of others.

        Simon Neitzel

        PS: Sorry for my terrible english!