Community
    • Login

    Function List for new language...

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    11 Posts 2 Posters 11.3k 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.
    • MAPJe71M
      MAPJe71
      last edited by

      Have a look here.

      1 Reply Last reply Reply Quote 0
      • Diego GavaniD
        Diego Gavani
        last edited by

        Well thank you but i can use google…The first reference i found for rapid language with a modified function list doesn’t work…I don’t know if it’s a problem of notepad version or is more tricky then it seems that’s why i’m asking help…

        1 Reply Last reply Reply Quote 0
        • MAPJe71M
          MAPJe71
          last edited by

          Could you supply representative example files (or links) for testing?
          Furthermore, what and how should it show up in the function list tree.

          1 Reply Last reply Reply Quote 0
          • Diego GavaniD
            Diego Gavani
            last edited by

            Thanks for your reply. The files are simple text files with different extension. I already have syntax highlighting working for those languages in fact the extension are recognized. I wrote the structure of the files in my previous post…For Kuka KRL you have two files “name_of_program.src” for source code and “name_of_program.dat” for variable declaration the content is as follow :

            “name_of_program.src”

            DEF Newprog ( ) <— this is the definition for the name of the Program that will contain all subs and functions

            DEF MainProg() <----- this is the definition for a subroutine called MainProg
            …code…
            END

            DEF Sub1() <----- this is the definition for a subroutine called Sub1
            …code…
            END

            DEFFCT func1(num:IN) <----- this is the definition for a function called func1
            …code…
            ENDFCT

            GLOBAL DEF Sub2() <----- this is the definition for a subroutine called Sub2
            …code…
            END

            END

            Instead the declaration is as follow :

            “name_of_program.dat”

            DEFDAT MAIN_PROGRAM
            int num=0
            bool true=false
            …code…
            ENDDAT

            for ABB Rapid instead there is just one file that contains both source code and variable declaration, it’s content is
            as follow :

            “name_of_the_program.prg” (or .mod or .sys)

            MODULE name_of_the_program
            var int num=0
            var bool true=false

            PROC Main
            …code…
            ENDPROC

            FUNC num GetInt
            num IntAdd)
            …code…
            ENDFUNC

            ENDMODULE

            And that’s it! In abb rapid you can get also some file with just variable declaration but in any case the Module-ENDMODULE statements are mandatory, the compiler itselfs write these files with those statements. Hope to be clear, thanks for your help.

            PS.: If you want to test, just copy and past and save the content as “.src” and “.dat” for kuka krl and “.prg” for abb rapid, that’s it.

            1 Reply Last reply Reply Quote 0
            • MAPJe71M
              MAPJe71
              last edited by

              OK, will give it a try.

              1 Reply Last reply Reply Quote 0
              • MAPJe71M
                MAPJe71
                last edited by

                KUKA Robot Language:

                <association id="krl_syntax" userDefinedLangName="KRL" />
                <association id="krl_syntax" ext=".src" />
                <association id="krl_syntax" ext=".dat" /> 
                
                <parser displayName="KRL" id="krl_syntax" commentExpr="?'SLC'(?m-s);.*$)">
                	<function
                		mainExpr="(?-i:(GLOBAL[\t ]+)?DEF(DAT|FCT)?)[\t ]+\K([A-Za-z_$][A-Za-z0-9_$]{0,23})[\t ]*\([^)]*\)"
                	>
                		<!-- comment out the following node to display the method with its parameters -->
                		<functionName>
                			<nameExpr expr="[A-Za-z_$][A-Za-z0-9_$]{0,23}" />
                		</functionName>
                	</function>
                </parser>
                
                1 Reply Last reply Reply Quote 1
                • Diego GavaniD
                  Diego Gavani
                  last edited by

                  Thank you very much pal, i don’t know why but it doesn’t work, you expression is very similar to other i try to write by myself that didn’t work. I’m really upset about that and i really don’t understand…Why is so difficult to recognize a so simple language that is derived from fortran and C? Thanks again i’ll keep trying but i think that if it’s not done till now is because it never worked…

                  1 Reply Last reply Reply Quote 0
                  • MAPJe71M
                    MAPJe71
                    last edited by

                    Make sure all three associations are added and the value of the userDefinedLangName attribute exactly matches the name in the Language menu to get this …

                    NPP FL KRL

                    1 Reply Last reply Reply Quote 1
                    • Diego GavaniD
                      Diego Gavani
                      last edited by

                      PAL YOU’RE GREAT!!! I solved! the problem was the “UserLang name=” value, they must be the same you were right…Now i’m thinking that maybe i spent one month playing with that regex and the problem was the reference name—GOSH! Anyway now i’ll make the same thing for Rapid, thank you very much you solved a big problem for me…In this way i’ll spent less time searching for subs in my programs that often are plenty. THANKS!!!

                      1 Reply Last reply Reply Quote 0
                      • MAPJe71M
                        MAPJe71
                        last edited by

                        You’re welcome!

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