Runtime Error Detection (RTED) Project

This is a project to detect the use of undefined langauge use and
report it to the user in a constistant way across all languages and
compilers. 

RTED/RuntimeSystem.[Ch]:
   This is the API used to instrument input programs.

CppRuntimeSystem directory:
   This contains the run-time system.

rted_qt directory:
   This is where the RTED debugger lives (ask Martin, but this should be checked)

files extract-expected-error.sed and extract-actual-error.sed:
  These are files used to test if the error identified
matches the line number of the expected error. Note
that extract-expected-error.sed has comments about 
exceptions.

file RuntimeSystem_ParsingWorkaround.h:
  This is a work around to bug test2009_30.C (and
redundently test2009_35.C).  Once this bug is
fixed the use of this file can be fixed in the Makefile.am
and the header file can be removed.

OLD test files (might be best to remove):
   buffer2.c (from February 2009)
   example.C (from March 2009
   test.C    (from March 2009)

OLD test files (seemingly useless; might be removed)
   file_read.txt
   index_array.txt

NEW Test file, but not referenced in the Makefile.am (is it used/required)
   test_runtime.c (modified recently: Sept 2009)

Translator
runtimeCheck.cpp: working name of the ROSE-RTED source-to-source compiler

The rest of the files in RTED (top level directory) are the 
implementation of the transformations required to instrument 
the input source code using RTED.

The transformation to introduce the runtime system are handled
with the rest of the files:

Problems:
   Heavily dependent on state
   Some large functions
   Hard to understand code


Suggested High level refactoring:
   Seperate out different types of transformations as separate traversals
   using inherited and synthesized attributes.
     a. File I/O
     b. Variables
     c. C standard library functions
     d. scope issue (memory leaks)
     e. managing type system (write to memory with consistant types)

FYI: File I/O only addresses C not C++ cases.

File sizes are a guide to what code might best be refactored first
(e.g. RtedTransf_array.cpp and RtedTransf_variable.cpp)

What is the relationship between RtedTransf_variable.cpp and RtedTransf_array.cpp?

Some long functions (in RtedTransf_array.cpp):
   void RtedTransformation::visit_isArraySgAssignOp(SgNode* n)
   void RtedTransformation::visit_isSgVarRefExp(SgVarRefExp* n)

What does this do:
   void RtedTransformation::addPaddingToAllocatedMemory(SgStatement* stmt,  RTedArray* array)
   (for example, what RTED test is this relevant to).


Suggested Low level refactoring:
   Run variable name tests on RTED source code to get better variable names.
   Make functions simpler
   Add comments
   Use "switch" statements (and "default" cases)
   Use nested traversals (with narrowly defined inherited and synthesized attributes).






RtedTransf_prolog.cpp:
    This rewrites "main()" to "RuntimeSystem_original_main()"
allowing for code to be instered after the users "main()".
This is where destructors of static objects could be called 
(but are not currently). 

Makefile introduces the use of the "runtimesystem.h" header file
at the top of the source file. This could be replaced with
a "preinclude" header in the custom ROSE-RTED translator.









