Menu

My functions parser to manage devphps funcs

2005-01-25
2012-12-07
  • Raphael Metzler

    Raphael Metzler - 2005-01-25

    Hi DevPhp community.

    I'm using DevPHP as my favourite php editor.
    Programming cms-systems and having a lot of functions I felt it would come handy to have your own functions (e.g. api-functions) in the DevPHP internal functions list (which you can show by pressing CTRL + SPACE).
    So I started to edit functions_lite.dat and functions_full.dat by hand. As you maybe imagine this was very depressing :)
    So I began to search a tool which is able to parse the functions from php code. All I found were some php code documentation tools, but I wasn't satisfied.

    So I programed my own tool which parses the function names and parameters from .php files, adds them to functions_lite.dat and functions_full.dat, sorts the list by alphabet and removes double entries.

    I called this tool fparser for functions parser
    I included the c sourcecode (I wrote it in c because I wanted to improve my c skills).
    This program has three very small commandline tools (see readme.txt).

    Here you can download it:
    fparser version 0.1 with c source: http://mitglied.lycos.de/rame03/fparser

    And here is the Readme.txt
    FPARSER - FUNCTIONS PARSER - README

    ***************************
    * What does this program? *
    ***************************
    This program parses your php files for functions,
    tries to extract parameters and parameter types
    and combines these functions with the these from
    DevPHP. So you'll be able to have your own functions
    listed in DevPHP (by pressing CTRL + SPACE) very easily.

    ****************************
    * How to use this program? *
    ****************************
    You need a list of filenames, which will be parsed, first.
    You can create it manually or simply call genlist.exe.
    Having this list you may want to execute parselist.exe, which
    will pase the function names and params from the files and
    store it in the functions.txt file. Correct this file manually
    and call combinelist.exe to combine the functions from functions.txt
    with the DevPhp ones (functions_lite.dat and functions_full.dat).

    *************************
    * Where can I get help? *
    *************************
    Please see original_author.txt.

    End of readme.txt

    I hope this tool can be usefull for you

    Yours
    Raphael

    ps. please post your opinions

     
    • Urs Mäder

      Urs Mäder - 2005-01-25

      Hi Raphael

      really great your work.

      would be nice to work with the externals possibilities from dev-php to automatically save a file and process your chain...

      the genlist.exe should work without asking the path. this should taked from the comandline parameters and only ask if not a given path.

      thanks a lot

      urs maeder

       
      • Raphael Metzler

        Raphael Metzler - 2005-01-26

        Hi,

        because I'm using Dev-PHP 3.00 which hasn't implemented this feature, I didn't thought about this :(
        I've just implemented commandline parameters, hope it works

        Greetings
        Raphael

         
    • Raphael Metzler

      Raphael Metzler - 2005-01-26

      With maeders advise I just added commandline handling:

      changes.txt:
      fparser 0.2
         genlist.exe version 0.2
          * added commandline parameter handling (see readme.txt and docs/commandline.txt)
         parselist.exe version 0.2
          * added commandline parameter handling (see readme.txt and docs/commandline.txt)
         combinelists.exe version 0.2
          * added commandline parameter handling (see readme.txt and docs/commandline.txt)

      docs/commandline.txt:
      Commandline parameters:

      Tip: You can show help by using the parameter -h.

      *************
      *genlist.exe*
      *************
      GENLIST VERSION 0.2 - commandline parameters:
      genlist [-d dir OR -dd] [-e file_types OR -ed] [-h] [-v] [-n]
      -h      show help
      -v      print version
      -d      specify dir to scan, so genlist won't ask for this
              spaces are currently NOT supported in directory names, sorry
      -dd     same as -d, but using default value (current dir)
      -e      specify file extensions to scan, so genlist won't ask for this
              also do not use spaces here
      -ed     same as -e, but using default value (php,php3,php4)
      -n      genlist won't wait for the user pressing RETURN in the end

      Example usages:
      genlist -h
      genlist -dd -ed
      genlist -d c:\homepages\php -ed -n
      genlist -d c:\homepages\php -e php,php4 -n

      ***************
      *parselist.exe*
      ***************
      PARSELIST Version 0.2 - commandline parameters

      parselist [-n]
      -n      parselist won't wait for the user pressing RETURN in the end

      Example usages:
      parselist -n

      ******************
      *combinelists.exe*
      ******************
      COMBINE LISTS VERSION 0.2 - commandline parameters

      combinelists [-s] [-n]
      -s      skip security question
      -n      parselist won't wait for the user pressing RETURN in the end

      Example usages:
      combinelists -s
      combinelists -s -n

      Download server is the same: http://mitglied.lycos.de/rame03/fparser

      Have fun

      Yours
      Raphael

      ps. please post opinions/bugs/advises here

      ps2. When fparser can't determine a parameter type (if eg. there is no default value), fparser will use "string" as type. This type can be changed by editing the DEFAULT_PARAM_TYPE in src/parselist.c file

       
      • Urs Mäder

        Urs Mäder - 2005-01-26

        reallly, really great !!!!!!!!!

         

Log in to post a comment.

MongoDB Logo MongoDB