Community
    • Login

    UDL-XML for Perl

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 3 Posters 466 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Gerhard PetrowitschG
      Gerhard Petrowitsch
      last edited by Gerhard Petrowitsch

      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

      EkopalypseE 1 Reply Last reply Reply Quote 0
      • EkopalypseE
        Ekopalypse @Gerhard Petrowitsch
        last edited by

        @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)
        1 Reply Last reply Reply Quote 1
        • Gerhard PetrowitschG
          Gerhard Petrowitsch
          last edited by

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

          1 Reply Last reply Reply Quote 0
          • PeterJonesP
            PeterJones
            last edited by

            @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).

            1 Reply Last reply Reply Quote 1
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors