Tuesday 31 July 2007

Datatypes in DeepWeaver

DeepWeaver introduces limited type safety, as previously described.
To use types, you can use either built in types, or any other Java object by specifying it's full long-form name (eg. java.awt.AbstractListener)
If you're feeling really brave you can add your own datatype (although I've never seen a need to do so), just add it to the list in dw.type.Types and then add your own corresponding class file.

Here's a brief run-down of the built-in types:
  • String: Letters in double-quotes. Usually used for matching, printing or restriction
  • List: A Prolog style list, but shorthand list notation is not yet available
  • Stmt: Corresponds with the soot Unit type. A line or unit of code, which also retains information about the methods and values associated with it
  • Value: Corresponds with the soot Value type. A code value that also stores information about its declaring unit (but may be linked to by more than one unit!)
  • Block: A CodeBlock, or series of units, usually in some order that relates to their exection. In fact, it is a implemented as a chain of units, and the unit(cb,u) predicate can be used to split it into these component units. Also stores information about its parent method, and synchronization
  • Method: An analysis of an entire Method, including information of body, declaring class and synchronization.
  • Class: An analysis of an entire class, corresponding with soot.SootClass.

No comments: