Community
    • Login

    Create a User Defined Language from existing

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    6 Posts 6 Posters 10.5k 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.
    • Bence Gyula BujtorB
      Bence Gyula Bujtor
      last edited by

      Hey All,

      I wish to make my own Assembly language for my project.
      Is there a way to use the existing Assembly in Notepad++ by creating my own version based on what’s already in?

      Thanks
      Ben

      Claudia FrankC gstaviG 2 Replies Last reply Reply Quote 1
      • Claudia FrankC
        Claudia Frank @Bence Gyula Bujtor
        last edited by

        @Bence-Gyula-Bujtor

        there is no direct export/import way to do this.
        What you need to do is
        Open langs.xml file which is either under %APPDATA%\notepad++ or within
        installation directory, depends on your configuration, copy the keywords and put it into
        the new UDL keywords box(es).
        Instead of the file you can use the GUI -> Settings->StyleConfigurator->YOUR_LANGUAGE
        and click through the names under Style to get the listed keywords.

        Cheers
        Claudia

        Yoan SoucyY 1 Reply Last reply Reply Quote 0
        • My1M
          My1
          last edited by

          will there be a way to do this in the future? directly. because I also want to modify a few aspects of the Language I use.

          1 Reply Last reply Reply Quote 0
          • gstaviG
            gstavi @Bence Gyula Bujtor
            last edited by

            @Bence-Gyula-Bujtor
            Just to make sure that you mean UDL1 based on UDL2.
            This should be easy enough since every UDL is based on textual definition.
            You will never be able to create a UDL that is based on Scintilla Lexer since these are implemented in C.

            1 Reply Last reply Reply Quote 0
            • Yoan SoucyY
              Yoan Soucy @Claudia Frank
              last edited by

              @Claudia-Frank This solution is good to recreate styling based on keywords, but is there a way to find out the configurations about operators and delimiters from standard languages?

              I would like to have a new UDL combining the standard styling for html, xml and sql and add some specific user language keywords.

              Thanks

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

                @Yoan-Soucy ,

                Sorry. The UDL and the Lexers are two separate bits of code, so you cannot just “inherit” or “export” the original lexer to a UDL.

                However, you can add extra highlighting to any builtin lexer (like the HTML or XML or SQL lexer) or to a User Defined Language (UDL) using regexes via the script EnhanceAnyLexer.py that @Ekopalypse shares in his github repo … this might allow you to provide the extra syntax that either the lexer alone or the UDL alone won’t give you.

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