edu.neu.ccs.demeterf.demfgen.dgp
Class DGPFunc

java.lang.Object
  extended by edu.neu.ccs.demeterf.FC
      extended by edu.neu.ccs.demeterf.demfgen.dgp.DGPFunc
Direct Known Subclasses:
TravGeneric

public abstract class DGPFunc
extends FC

The base class of Data-Generic Function generation objects. DGP Functions are traversals that return Strings representing some computated value based on a given CD. Usually this translates into a class definition of some function like Print or ToString, but could also be some meta information like a graph of the CD, or static traversal code.


Field Summary
 
Fields inherited from class edu.neu.ccs.demeterf.FC
augMethodName, buildMethodName
 
Constructor Summary
DGPFunc()
          Need this one for the whole thing to work right...
 
Method Summary
 java.lang.String argument()
          What is the starting argument expression?
 MutableControl baseControl()
          Return the normal Control needed...
 java.lang.String[] builtins()
          An Array of built ins for the traversal.
 Control control()
          Traversal control for this function generation
abstract  java.lang.String docComment()
          Documentation comment to be placed above the Class definition
 java.lang.String fileName()
          First part of the file name (no extension)
 java.lang.String fileSuffix()
          The Extension of the output File
abstract  FC functionObj()
          The function object responsible for function generation
 boolean hasArgument()
          Does the generated traversal method take an argument?
 java.lang.String header(java.lang.String com, java.lang.String pkg, java.lang.String cdImports)
          Import declarations
 java.lang.String method(java.lang.String pkg)
          The stub method implementation; just needs to call the static method.
 java.lang.String methodBody(java.lang.String pkg)
          The body of the stub method.
 java.lang.String methodName()
          Returns the name of the Method to be added to each generated class
 java.lang.String methodReturn()
          The return type of the generated method.
 boolean override()
          Needed for C#: Does this generated Method override something in Object? E.g., toString() does, but print() does not.
 Option<?> startArgument()
          Initial traversal argument (Some|None)
 java.lang.String stubMethod()
          The full static stub method within the generated class.
 java.lang.String stubMethodBody()
          The body of the method stub.
 java.lang.String stubMethodName()
          The name of the static stub method
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DGPFunc

public DGPFunc()
Need this one for the whole thing to work right...

Method Detail

functionObj

public abstract FC functionObj()
The function object responsible for function generation


docComment

public abstract java.lang.String docComment()
Documentation comment to be placed above the Class definition


header

public java.lang.String header(java.lang.String com,
                               java.lang.String pkg,
                               java.lang.String cdImports)
Import declarations


control

public Control control()
Traversal control for this function generation


baseControl

public MutableControl baseControl()
Return the normal Control needed... subclasses can mutate it if needed.


fileName

public java.lang.String fileName()
First part of the file name (no extension)


fileSuffix

public java.lang.String fileSuffix()
The Extension of the output File


startArgument

public Option<?> startArgument()
Initial traversal argument (Some|None)


methodName

public java.lang.String methodName()
Returns the name of the Method to be added to each generated class


override

public boolean override()
Needed for C#: Does this generated Method override something in Object? E.g., toString() does, but print() does not.


builtins

public java.lang.String[] builtins()
An Array of built ins for the traversal. Language specific primitives are added to this array.


methodReturn

public java.lang.String methodReturn()
The return type of the generated method. E.g., ToString would be "String"


stubMethodName

public java.lang.String stubMethodName()
The name of the static stub method


stubMethod

public java.lang.String stubMethod()
The full static stub method within the generated class. This is called by the method implementations to make the generated code cleaner. It is placed in the DGP generated class by default.


stubMethodBody

public java.lang.String stubMethodBody()
The body of the method stub. Usually just create a new traversal with a new instace of the generated class (this), returning the traversal result.


method

public java.lang.String method(java.lang.String pkg)
The stub method implementation; just needs to call the static method.


methodBody

public java.lang.String methodBody(java.lang.String pkg)
The body of the stub method.


hasArgument

public boolean hasArgument()
Does the generated traversal method take an argument?


argument

public java.lang.String argument()
What is the starting argument expression?