UDL-XML for Perl



  • Hi,

    I have a rather simple proprietary language, which encapsulates snippets of Perl code in certain sections of the code, delimited by simple keywords.
    I would like do define a UDL for this language, but it should use the usual Notepad++ Perl code highlighting and folding in the Perl areas.

    My question is: Do I have to go through all the pain and define everything needed for Perl just to have the highlighting and folding for my simple language? Or is there an XML available, which I can import in the UDL dialog and just add the few items required for my proprietary language?

    Thanks for any help!
    Gerhard



  • @Gerhard-Petrowitsch

    UDL and builtin lexers are very different from each other you cannot easily
    combine them.
    Afaik, you have four possible ways you can go

    1. Using the builtin perl lexer and extend it with your keywords
      -> obviously works only if your language uses perl syntax and has different keywords only
    2. Define your own UDL (that’s your pain :-)
    3. Use a scripting language plugin and extend the builtin perl lexer with additional coloring (no folding operations) syntaxes like for example described here.
    4. Write your own lexer (either a dll or by using scripting language plugin)


  • Thanks for your suggestions!
    Can you give me a pointer on how to realize option 1?



  • @Gerhard-Petrowitsch said in UDL-XML for Perl:

    Can you give me a pointer on how to realize option 1?

    The Preferences > Style Configurator documentation explains:

    Some language/style combinations (like Preferences > Style Configurator > Perl > INSTRUCTION WORD) will additionally have a list of default keywords (not editable) and user-defined keywords (which allow you to add new keywords to apply this style to).


Log in to reply