Help with FunctionList and userDefinedLangName (for Foxpro)

  • Tom

    Tom - 2013-12-27

    Hi, I am hoping someone here can help me out.

    I'm trying to get the function list to work for my UDF (which is foxpro). I have the following in my functionList.xml file in the %APPDATA% directory. However, the functionlist is completely empty.

    My thinking is that the functionlist is not recognizing my UDF for some reason, as the functionlist doesn't even display the name of the file at the top.

    I also tried making an association with the file extension. Any ideas?

    <association userDefinedLangName="visual foxpro" id="vfp_syntax"/>
    <parser id="vfp_syntax" displayName="VFP Classes & Functions" commentExpr="(\t\*\!\*)">
            mainExpr="^[\t ]*((define class)[\s]+)[\w:]+[\s]+as[\s]+([\w:]+)"
            closeSymbole = "^[\t ]*enddefine"
                <nameExpr expr="[\w:]+[\s]+as[\s]+([\w:]+)"/>
                mainExpr="^[\t ]*((procedure|proc|function|func)[\s]+)[\w:]+[\s]*[ \(\,\)\w]*">
                    <funcNameExpr expr="((procedure|proc|function|func)[\s]+)[\w:]+[\s]*[ \(\,\)\w]*"/>
                    <funcNameExpr expr="[\s]+[\w:]+[\s]*[ \(\,\)\w]*"/>
                    <funcNameExpr expr="[\w:]+[\s]*[ \(\,\)\w]*"/>
            mainExpr="^[\t ]*((procedure|proc|function|func)[\s]+)[\w:]+[\s]*[ \(\,\)\w]*"
                <funcNameExpr expr="((procedure|proc|function|func)[\s]+)[\w:]+[\s]*[ \(\,\)\w]*"/>
                <funcNameExpr expr="[\s]+[\w:]+[\s]*[ \(\,\)\w]*"/>
                <funcNameExpr expr="[\w:]+[\s]*[ \(\,\)\w]*"/>
  • cchris

    cchris - 2013-12-28

    What is the point of the nested parenthesised group in all the main definitions? I'd remove the outer group and try again.


  • Tom

    Tom - 2014-01-14

    Hi CChris,

    Thanks for your reply.

    I'm not exactly sure what you mean, but I did try to remove the nested parens
    ^[\t ](define class)[\s]+[\w:]+[\s]+as[\s]+([\w:]+)
    ^[\t ]
    define class[\s]+[\w:]+[\s]+as[\s]+[\w:]+
    ^[\t ]*define class[\s]+[\w:]+[\s]+as[\s]+

    nothing I did mattered. It still acts like there is no definition. Is there any way I can confirm that Np++ is trying to use these patterns? It would be immensely helpful if I could get a little feedback.

    Also, if I make a change to the functionList.xml file will Np++ pick up that change or do I have to restart to get it to recognize. I have been restarting every time since otherwise I have no way of knowing, but that makes it slow-going.

    I imagine my regex isn't right though I did test it against an online regex tool and it worked. The code I am trying to parse looks something like this:

    // class definition starting
    DEFINE CLASS NameOfMyClass AS NameOfParentClass OF NameOfParentClassFile
        PROCEDURE NameOfMyFunction (MyParam1,MyParam2)
            // function code here
        PROCEDURE NameOfAnotherFunction
    ENDDEFINE  // class definition ending
    // the keywords "func/function/proc/procedure" are all equivalent
    PROCEDURE ThisFunctionExistsOutsideOfAClass (Param,Param,Param)


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks