MenuRainCode Engine for AdaNews

Technical information

  • RainCode parses Ada 83 and Ada 95 sources.
  • Includes full semantic and type analysis, including overloading resolution and generics expansion
  • Can be used on partially compilable systems, as opposed to tools 100% correct in order to allow for analysis of any kind. based on native compiler technology that require the system to be

Typical uses

Typical uses of RainCode include:
  • Quality assessment for outsourced work. When a project is submitted to an external company, precise coding guidelines can be defined formally as part of the assignment. Such guidelines can then be checked continuously or at delivery time on the entire source code, rather than relying on random sampling. Besides, an exhaustive analysis provides a number of metrics that quantify the degree of compliance, which gives you a precise estimation of the amount of work required to achieve full compliance, rather than a binary answer.
  • In a migration project, performing large amounts of updates automatically, identifying the places that must be updated manually, predicting the total effort required for this manual update, and monitoring the progress of the entire migration. Examples of such migrations cover the replacement of a compiler by another, the change of platforms, TP monitor or database.
  • Integration in a compilation chain to ensure that every source code is compliant before it can even be tested. The standard language within an organisation or a project moves from plain Ada to Ada restricted by the coding guidelines.
  • Implementation of a complete metrics and quality strategy. This includes monitoring the quality and maintainability of all components continuously, predicting maintenance costs, detecting abnormal entropy within systems before it becomes a maintenance issue. Metrics, such as cyclomatic complexity of functions, can be performed on a daily basis.

The RainCode Engine for Ada is used to generate the RainCode Roadmap for Ada.

How does it work ?

RainCode actually reads the Ada source code and builds an annotated parse tree after a fully documented object model, including inheritance relationships (IfStatement inherits from Statement). A scripting language can then be used to walk through the parse tree, taking full advantage of the features provided by the object model. By using the parse tree rather than its underlying textual representation, RainCode can deal with cases far too complex to be handled by text manipulation tools such as Perl.

RainCode supports both procedural and event-driven programming, the latter being used for simple scripts, such as:

    ON GotoStatement DO
      OUT.WriteLn ('goto statement found on line ', X.LineNr);
      END;
The example above issues an error message whenever a GOTO statement is encountered, indicating the line number of the offending statement.

The scripting language is a very simple dynamically-typed ALGOL-like language, and provides various features specifically designed for the purpose of manipulating parse trees:

  • Quantifiers:
           c := COUNT IN Root.SubNodes :- X IS Statement;
           OUT.WriteLn ('There are ', c, ' statements');
    
    The above example counts the number of statements and displays this count.
  • Annotations to add user-defined information to the parse tree
  • Convenient list and set-manipulation primitives
RainCode moreover provides several convenience features to ease the development of potentially complex source code manipulation scripts:
  • Access to the system resources (reading and writing files, spawning sub-processes)
  • Library of string and mathematical functions
  • Access to XML tree via the DOM API
  • Modularity, so that libraries of routines can be built, and reused in several scripts

RainCode is delivered with numerous documented scripts, which implement various checking and documentation functions. These can be used out of the box or be adapted to a specific environment. It also includes the entire script source code of the RainCode Roadmap and the RainCode Checker.

Available information

The parse tree provided by RainCode includes the entire syntactical information (that is, for every component, access to its sub-components, the image of identifiers, whether optional keywords have been used or not, etc.), positioning information to be able to resynchronize on source code. It also includes semantic information, such as the variable an identifier refers to.

The patch mechanism

RainCode also supports a complete patching mechanism to perform changes on the source code. This can range from trivial cosmetic changes such as pretty printing to normalization issues such as replacing use of global variables by accessor functions.

Distribution

The RainCode distribution includes:

  • A binary executable for NT
  • Obfuscated source code for easy recompilation on most Unix platforms (tested under Solaris, Linux, AIX, HP/Unix)
  • A printed documentation set
  • The PostScript source for this documentation, so that additional copies can be produced conviently
  • The entire documentation, including the user manual and a reference guide, structured as a set of HTML files
  • Numerous thoroughly documented sample scripts

Ada Europe 2004

RainCode supports and was be exhibitor at Ada Europe 2004, the 9th International Conference on Reliable Software Technologies, which took place in Palma de Mallorca, June 14 to 18.

On this occasion, we presented the latest developments to the RainCode Checker for Ada, a quality control tool, which performs an automatic check for compliance to a set of coding guidelines, and generates a detailed report of the offences to those rules.

Downloadable Evaluation/Demo Version

Do you want to see RainCode at work ? It is simple and easy: just register here and log in. On the download page, you will have access to the demonstration / evaluation version of the RainCode Engine for Ada. It is not a mere slide show presenting the product, this demo is an actual running version of RainCode, together with a few typical scripts. The demonstration part shows you some of the essential functions of the tool applied to some real Ada sources taken from GNAT. Running the demo, you will get, for each step, a complete explanation of the task RainCode is about to perform. You will see the scripts which make the tool work, and the source on which it is applied. Of course, you also get to see the result of the application. In less than 5 minutes, you'll see for yourself what RainCode can do for you. If you want to investigate further what can be done with the RainCode Engine, the evaluation part will allow you to write all the scripts you want and apply them on a set of given sources.

Note: under Windows 2000, you need to have the Administrator rights in order to install this demo/evaluation version.

The demonstration/evaluation version is currently only available under Windows. However, the actual RainCode Engine is multi-platform: Unix, Linux, Solaris, HP Unix, NT, OS/2, MVS, etc.



© 2002-2008 RainCode -- comments to webmaster@raincode.com