Extracting operators and operands from the source code

Hi there,
I am looking for a way to extract operators and operands from a source code to do a complexity analysis of the code. The final outcome I am expecting is to get the number of operators and operands in the code, to perform a Halstead Complexity Analysis.
Please let me know how this parsing can be done apart from just doing a sequential search of the content in the file.
Any samples and references are highly appreciated.
Thanks in advance!
Regards,
Aravinda777

Common way to analyze code is to defining the things you are interested in using some approproate language and then using a parser generator (or compiler compiler = cc). I used antlr some time ago for this reason. Perhaps you want to take a look at it:
http://www.antlr.org/

Similar Messages

  • How to set database location in the crystal report X1 from the Source code.

    Dear All,
    I am using Crystal report X1 for report generation.Now I am setting the database location manually in the crystal report. How can I Set the database location from the Source code.
    Awaiting for your reply.
    Thanks in advance.
    Regards,
    Rahaneef T

    Here's a routine that also searches for subreports to set the log on info. Simply remove that aprt to set the main report logon info:
    IDatabaseTablePtr pTable;
    //get first table
    pTable = m_Report->Database->Tables->GetItem(1) ;
    long lTableCount = m_Report->Database->Tables->Count;
    for( long lTable=1; lTable<=lTableCount; lTable++ )
         pTable = m_Report->Database->Tables->GetItem(lTable);
         pTable->ConnectionProperties->DeleteAll();
         pTable->ConnectionProperties->Add("DSN", "Name of your DSN");
         pTable->ConnectionProperties->Add("Database", "Demo");
         pTable->ConnectionProperties->Add("Password", "sa");
         pTable->ConnectionProperties->Add("User ID", "1Oem2000");
    // Log on the tables of the subreports.
    long lSectionCount = m_Report->Sections->Count;
    for( long lSection=1; lSection<=lSectionCount; lSection++ )
         ISectionPtr pSection = m_Report->Sections->Item[lSection];
         long lSubreportCount = pSection->ReportObjects->Count;
         for( long lSubreport=1; lSubreport<=lSubreportCount; lSubreport++ )
              IReportObjectPtr pSubreportObject = pSection->ReportObjects->Item[lSubreport];
              CRObjectKind crObjectKind;
              pSubreportObject->get_Kind(&crObjectKind);
              if( crObjectKind == crSubreportObject )
                   ISubreportObjectPtr SubReportPtr = pSubreportObject;
                   IReportPtr pSubReport = SubReportPtr->OpenSubreport();
                   long lTableCount = pSubReport->Database->Tables->Count;
                   for( long lTable=1; lTable<=lTableCount; lTable++ )
                        pTable = m_Report->Database->Tables->GetItem(lTable);
                        pTable->ConnectionProperties->DeleteAll();
                        //pTable->ConnectionProperties->Add("DSN", "dwcb12003");
                        pTable->ConnectionProperties->Add("Database", "CrystalEport_DB");
                        pTable->ConnectionProperties->Add("Password", "sa");
                        pTable->ConnectionProperties->Add("User ID", "1Oem2000");
    If that doesn't work you need to tell us what is the error you are getting and paste in the code you are using.

  • How to find the Web Dnpro component from the Source code ?

    Hi Gurus,
    Please help me to find out the WD Component Name from the Source Code?
    Regards
    Anil

    Hi Thomos,
    When i right clik on the screen i see the following line by line.
    -Back
    -forward
    -save background as
    -set as background
    -copy background
    -set as desktop item
    -select all
    -Paste
    -create shotcut
    -add to favorites
    -view source
    -encoding
    -print
    -refresh
    -export to microsoft excel
    -properties
    I have mentioned every thing i see when ever i right click on the screen.
    --Anil

  • Is there a way to decorelate annotations from the source code?

    sorry : the title of the question may sound bizarre but , not being a native speaker, I do not know how to precisely state my problem.
    I'll try:
    an example: suppose you want to annotate your code with annotation such as @MightBeNull (a fictitious annotation) to mark a field as being potentially null.
    this annotation is going to be used by annotation processor X and is specified by (fictitious) library org.something.staticcheck ...
    Now if a new (and better) tool appears for the same purpose you'll have to change your code. At compile time your code is dependent on a precise library (and a set of precise tools for annotation processing).
    I my dreams I would like a way to write my own annotations and configure an adapter that redirects to the precise library that I choose at given moment.
    For sure that cannot be so easy since adaptations could not fit easily (but let's forget it for the moment).
    This seems impossible ... or it is?
    ( a better way could be to annotate not the source code itself but a separate description of its features that could be annotated independently)

    Sorry bruce I am a bit slow: I don't understand your suggestion.
    if I have a code like that:
    import org.staticcheck.annotations.MightBeNull ;
    public class Thing {
           @MighBeNull private Something relation;
    }my code is dependent on library "org.staticcheck.annotations".
    then afterwards if I change for another tool that uses annotation
        com.newprovider.annotations.CouldBeNullI am obliged to modify my source code!
    I daresay I am tempted by hacks such as :
    import com.mybusiness.annotations.MetaAnnotation ;
    public class Thing {
           @MetaAnnotation("null_possible") private Something relation;
    }and then perform some precompile wizardry (thru a preprocessor ;-( or tricky annotation processor
    that transforms the source code). But it could turn out ugly/clumsy ....
    that means that there will be a resource for describing a "translation" from the MetaAnnotation to the
    real thing needed at a precise moment.
    So my question is: has someone found a way to do that elegantly? (btw I can think of many more reasons for this decorrelation between
    the source code and its annotations).

  • Adobe flex 3 training from the source, code download

    I've got this book here
    adobe flex 3 training from the source
    but we've lost the cd's, can I download the code?

    I've progressed to Lesson 13 where the reported problem is
    also happening. As i didn't keep the files for Lesson 9 this will
    have to do. There are 5 files that show up as different in the SCR
    folder in my code vs the COMPLETE folder of Lesson 13. All of the
    differences seem to be cosmetic &/or style in nature so I have
    no Idea what is going on. Note: the comment lines are just added in
    this message so you can tell one file from another.

  • How to Extract data and reports from the SAP BW warehouse

    Hi to All Guru's
    I am new to SAP BW. Can any one help me to know, How to Extract data and reports from SAP BW. Do we use any tools.  After Extracting the data from SAP BW how can we move all the data to Cognos.  It would be kind enough to provide me with any documentation or links.  Step by step procedure would be very much helpfull to me.
    Thanks
    Venu

    Hi Voodi
    Thanks for the quick response. I think Open hub is to extract the data from SAP BW, but what about sending this data into Cognos.  Can you please let me know in detail regarding answer. If possible send me any documentation or links regarding this.  Thanks for your concern.
    Venu

  • Default implementations of JPDK V2 classes and interfaces - is the source code?

    Hi
    Is the source code for all the default implementations of the JPDK interfaces, renderers etc. available somewhere?
    Regards
    Harry

    Please find jpdk samples sources for jpdk implementation under src.zip inside PDK.zip
    In addition, one can many articles related to PDK under articles folder.

  • It is possible to generate the T2 layout as image from the source code?

    Hi to all.
    I want to say about me that I am not expert in processor design but I am curious about OpenSPARC. As an open-source programmer, I consider the open-source processor as a very good thing.
    I have seen on the website this image:
    http://www.opensparc.net/images/stories/t2/ultrasparc-t2-layout.png
    And I am wondering if I can generate the image at much higher resolution from the opensparc source code (which I already downloaded ;) . If it's possible, how can I do this?
    Thank you for the answer.
    Paul

    The picture you see is simply a photograph of the original UltraSPARC T2 chip. You may be able to generate a layout of your own, but it will probably be different from ours.
    Sun released only the Source RTL (Register Transfer Level) code, and synthesis scripts for the processor. To generate a complete layout, you would need to:
    1. Synthesize all control blocks for the chip.
    2. Manually lay out all custom RAMs, and datapaths.
    3. Perform top-level floor-planning
    4. Do detailed place and route on control blocks
    5. Place & route the top-level chip.
    It's a lot of work and involves lots of expensive CAD tools.
    formalGuy

  • Extract image and Features from the Catalog via JAVA API

    Hello,
    I would like to Extract image from the Catalog via JAVA API, Can anybody help on that? I also tried to extract the Features field form the Catalog but results in the error "Features field not found" Any ideas what could have wrong?
    Many thanks,
    Dharmi

    Hello,
    Can anybody tell me where i can find the latest JAVAAPI reference guide? I found the one for MDM 5.5 SP 1 but that also refers to the last parameter of the CatalogCache.Init as int and not string.
    I looked up in service.sap.com/instguides -> SAP Netweaver -> Release 4 -> Installation and there only following 3 files are there for MDM 5.5 SP2
    MDM 5.5 SP02 - Configuration Guide  SAP MDM
    MDM 5.5 SP02 - Installation Guide   SAP MDM
    MDM 5.5 SP02 – ERP-MDM Field Mapping and Check Tables
    Regards,
    Dharmi
    Message was edited by: Dharmi Tanna
    Message was edited by: Dharmi Tanna

  • Extraction hierarchies and fields from the logical layer

    Hello all !
    I build a repository and I would like to ask if it is possible to take an extraction of the names of the hierarchies and fields of the business layer that are mapped to the tables and fields of the physical layer. Because now my model is quite big and I want to create a file that I can follow my logical layer that is mapped to the physical layer.
    Thank you in advance!

    better to go for Repository Documnetation from utilities,it will give you the complete info of ur RPD

  • HT1212 my screen is shattered and black. but the phone is on. im trying to extract photos and videos from the phone but it says i cannot access anything wothout putting the passcode in to unlock the phone.  do you have any advice to help me get into it.

    help

    I don't think there's a solution for you.
    However, consider this a learning experience:  Use the free (and automatic) backup methods that Apple provides, such as iCloud & Photo Stream.  Or, use the built in function of your computer to regular copy & save your photos & videos from your iPhone to your computer. http://support.apple.com/kb/ht4083

  • Can I extract Conditions and Calculations from the Discoverer V5 EUL?

    I have been using The Discoverer V5 EUL Business Area to extract information on workbooks such as the owners, report names, descriptions etc. I am trying find out if the conditions and calculations within reports are stored separately within the EUL5 tables? So far I have only been able to extract the entire SQL.
    Does anyone know if the conditions and calculations are stored within the EUL5_DOCUMENTS.DOC_DOCUMENT field or elsewhere? I am looking for a quick way to access them which avoids having to look at each report manually.
    Thanks
    GB

    Hi GB
    You are out of luck. Conditions and calculation associated with a workbook are embedded within the workbook itself and are not accessible outside of it. Workbooks themselves are stored as binary objects within the database and are not decodable.
    Best wishes
    Michael

  • View the source code before deciding which PHP CMS to download?

    Maybe no one knows this site, for I just was recommend by a friend, if you want to install an Open Source [PHP CMS|http://www.phpkode.com/projects/category/php-cms/] but don't know which one to choose you can visit PHPKode.com and first view the source code of this PHP CMS with the file list feature on the page before installing it...

    If you use SAPlink http://www.saplink.org - you can download the entire component.
    If you want just the classes, that is a little bit harder.  The classes are dynamically generated.  There are different tricks to find out what the class names are. You should NEVER directly interact with the underlying classes. However if you just want to view the code in them you can see the class names in the debugger.  Also if you want, you can just set a breakpoint within one of the methods and then choose utilities->breakpoints->display . You will see the name of the class where your breakpoint is set.  It will be something like: /1BCWDY/4XLHG76LQV8VMTT2GRB2  - however you might find that it is difficult to look at the code from these classes; as we now restrict the ability to pull them up in the class editor.  You just get a message that the object does not exist or is not assigned to a package. This restriction is a protection to keep anyone from accidentally changing the generated objects and corrupting the WD Component.

  • Flow chart from Java source code?

    Can anyone please tell me whether there is a tool/plugin to generate a structured flow chart (preferably based on UML) from the source code of a Java program?

    Dear Chuck,
    I have used Google and other search engines intensively since years. What I need (and this is why I've opened this thread actually) is a suggestion for a product from someone that has already used it. That could also save me time instead of searching, installing, trying, and eventually deinstalling at random. After all, the forum should allow to exchange knowledge and experience with people having similar interests.

  • Protecting the source code

    I heard about the possibilty of decompiling the java code and getting back the source code, is this flaw specific to java or is it common among all programming langauges?
    how is it possible to protect the source code? and how expensive is the solution?
    thank you

    This is not a flaw!
    Java is compiled on the byte level not bit level. This is so because the same class can run on Windows, Solaris, Linux and Unix. This makes the execution a little bit slower and easier to decompile but a small price to pay for cross platform compatibilty.

Maybe you are looking for

  • JWSDP and J2EE Integration: Doesn't work. What's the point?

    My problems involve the integration of JWSDP and J2EE as described in these two documents: http://developer.java.sun.com/developer/technicalArticles/WebServices/wsj2ee/ http://java.sun.com/j2ee/documentation/windows_guide.html It looks like a long on

  • Spooling Extracts from Multiple SQL statements in 1 File

    Hi all, I am trying to spool extract results of 3 separate SQL statements into one single file. I wrote a SQL block similar to the one below. However, the result of the statements overwrite each other: 3 overwrote 2 and overwrote 1. Any suggestion ho

  • Passing Variable via BridgeTalk

    Hello, I'm simply trying to send send 2 variables through BT to PS from IA to create a new document of the specified size.  Why isn't this working, please?  It works fine if I substitute numbers for the variables in the body of the script. #target il

  • Lost Annimation - Save as Flash CS4 to CS3 - any recovery options?

    My son and his friend have been working almost 24 hours straight for a project for school. During the wee dark hours of the night they added the motion bits to their annimation. The school is using CS3, the only version we could buy was CS4. So they

  • HighPoint RocketRAID 2322 v1.1.1 and OS X Yosemite?!

    Help! I have no access to my 32 TB archive, I can not install the driver for the HighPoint RocketRAID 2322 v1.1.1 under OS X Yosemite?!