Menu

#108 Power Builder inclusion

v1.63
pending
nobody
1
2015-10-02
2015-05-04
Anonymous
No

I have gone through the tool and it is very helpful to determine the size . This tool is not supported Power Builder Language and its extension is PB and it is similar to Visual Basic.
Please let me know how to count Power Builder by using this tool

Discussion

  • Al Danial

    Al Danial - 2015-05-05

    You can add a custom language definition for Power Builder. First run with

     cloc --write-lang-def=def.txt
    

    Then edit def.txt and create a new entry for Power Builder using the Visual Basic definition as a guide. Then tell cloc to read this updated definition file when you count your code, ie,

     cloc --read-lang-def=def.txt  dir1  dir2  dir3  et cetera
    

    Once you have the definition for Power Builder working the way you like, send it to me and I'll include it in the tool.

     
  • Anonymous

    Anonymous - 2015-09-28

    Has it been done? I need it urgently as we're facing the task of counting our PB code for corporate statistics. We have tons of code.

    Many thanks, Leon

     
  • Al Danial

    Al Danial - 2015-09-29

    No, Power Builder is not added. Ref the note I made in May, it is easy for you to add yourself. You need to provide more information before I can add PB.
    See https://github.com/AlDanial/cloc/#AdditionalLanguages on how to request a language be added. Also note new development is at GitHub.

     
  • Anonymous

    Anonymous - 2015-09-29

    Thank you so much. I would've done so already, but unfortunately the def.txt that gets generated when I run the cloc --write-lang-def=def.txt
    command doesn't seem to be valid. Even if I make no changes to it and just tell the CLOC to use it, I get the following error all the time:

    Missing computer language name, line 1 of def.txt

     
  • Al Danial

    Al Danial - 2015-09-30

    The latest release of cloc (https://github.com/AlDanial/cloc/blob/master/cloc ) shouldn't have that problem. In any case, I am happy to add Power Builder for you but I'm missing information. What are the file extensions? I did some research on my own and found many (plb/plw/plt), some of which looked like binary files. How are comments defined? My own digging makes it look like C++ comment style is used. However that conflicts with your statement that comments look like Visual Basic. Please give me the info necessary to integrate PB!

     
  • Anonymous

    Anonymous - 2015-10-01

    Al,

    Thank you so much for support and willing to help. I was able to make def.txt work by removing the “Unknown” profile on top of it and adding a profile for PowerBuilder (please see below). The comment system used by PB is not uncommon and quite simple – double-slashes denote a single-line comment and // are for multi-line comments. Have I figured the profile right? It probably has to be adjusted as I wouldn’t really know what 3rd_gen_scale really means.
    As for the extensions, you don’t have to account for any binaries since all the PB shops who use repositories just store the flat files there. Basically, they all have a .SR* extension (and for simplicity purposes you can adjust the profile to say just so), but I personally opted to exclude some of them as they contain GUI-generated code only. Instead, I included those ones containing code for windows (.srw), user objects (.sru), menus (.srm), global functions (.srf), structures (.srf) and application objects (.sra). These files represent human-written code (at least, to the most part). Nothing else should really be considered.

    PowerBuilder
    filter remove_matches ^\s//
    filter call_regexp_common C
    filter remove_inline //.
    $
    extension sra
    extension srf
    extension srm
    extension srs
    extension sru
    extension srw
    3rd_gen_scale 0.77
    end_of_line_continuation \$

     
  • Al Danial

    Al Danial - 2015-10-02
    • status: open --> pending
     
  • Al Danial

    Al Danial - 2015-10-02

    Perfect, that information is exactly what I was after. I added support for PowerBuilder to cloc with git commit 9dcff8f; you can get the code from https://github.com/AlDanial/cloc/blob/master/cloc (new cloc development is happening at GitHub).

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.