has anyone ever managed to create a user-defined language

2013-10-18
2013-11-10
  • edualc zatebed

    edualc zatebed - 2013-10-18

    Hi,
    I've been trying to defined my own language (called pronto4GL) which is very similar to c but with different keys and after 5 hours of trying everything I just give up it just doesnt work.
    I tried to define it in npp itself and I tried to edit userDefineLang.xml as well.

    I also tried to change one of the language in the langs.xml but it just ignores it. I saw lots of posts on the net from people trying to change how a comment line is defined but there is no answer.
    Can the gurus who wrote notepad++ .. '..comment' on that ? (no punt intended)

    • can we change the langs.xml ? (if not why is everything defined in it ?)
    • can you provide a example of userDefineLang.xml

    ps: I have downloaded 3 version of notepadd++ including the latest one.

    heeeeeelp !

     
  • Loreia2

    Loreia2 - 2013-10-19

    Hi edualc,

    langs.xml is used for build in Scintilla languages. That file does not affect UDL in any way.

    Regarding UDL, I really don't understand where the problem is. Documentation site explains Comments in detail: http://udl20.weebly.com/comments.html

    If you need further explanation, please be specific. What is it about comments in UDL that confuses you?

    BR,
    Loreia

     
  • edualc zatebed

    edualc zatebed - 2013-10-20

    Hi Loera. well, I have a simple requirement. i want to adapt the c language so it picks up keyword that my language is using.

    can I simply update the [Language name="c"] section of langs.xml adding or removing some of the keywords ? changing the [commentLine="//"] ?

    if not, i understand I can have a userdefined language in userDefineLang.xml
    (which DOES appear on my list of language now) but NPP crashes when it tries to read it.
    so, can you provide a sample of userDefineLang.xml for ANY language that I can then change (e.g. changing the comment line char, or the keywords)

    that would be very helpful

    thank you

     
  • Loreia2

    Loreia2 - 2013-10-21

    Hi Edualc,

    so, can you provide a sample of userDefineLang.xml for ANY language that I can then change (e.g. changing the comment line char, or the keywords)

    Sure,
    http://sourceforge.net/apps/mediawiki/notepad-plus/?title=User_Defined_Language_Files

    Most of these are old (pre 2.0 versions), so just download the file, and the use Import button in UDL to convert it to current version.

    In case you wish to edit userDefine.xml file directly, use some other editor because Notepad++ will overwrite file content when you exit from application.

    can I simply update the [Language name="c"] section of langs.xml adding or removing some of the keywords ? changing the [commentLine="//"] ?

    No, you can not. You must define entire new language in UDL.

    BR,
    Loreia

     
  • cchris

    cchris - 2013-11-10

    Changing the comment mark in langs.xml will cause N++ to insert thhe new mark when using the various Edit -> Comment functions. The lexers, among which the one for UDLs, never heard of langs.xml.

    CChris