ptolemy.backtrack.eclipse.ast.transform
Interface AliasHandler

All Known Implementing Classes:
AssignmentTransformer

public interface AliasHandler

Interface of the alias handlers called by TypeAnalyzer. Users may register alias handlers (and other kinds of supported handlers) to the TypeAnalyzer used to analyze Java source code. When the analyzer detects an alias point, it calls back those alias handlers after proper types are assigned to both the left-hand side and the right-hand side of the assignment.

Alias handlers are allowed to modify the alias AST node, either by modifying its children in the AST, or by replacing the whole alias node with another expression or statement. This is because the handler is called after the subtree rooted at the alias node is completely visited by the analyzer. However, modifying any node out of this subtree (e.g., changing the parent of this alias node to another one) may cause unexpected effect.

Alias points in Java include assignment from an array field to a local variable, calling a method with an array field (so that it may be changed with another name within the method), returning an array field from a method, etc.

Since:
Ptolemy II 5.1
Version:
$Id: AliasHandler.java 42150 2006-04-26 18:14:56Z tfeng $
Author:
Thomas Feng
Accepted Rating:
Red (tfeng)
Proposed Rating:
Red (tfeng)

Method Summary
 void handle(org.eclipse.jdt.core.dom.Assignment node, TypeAnalyzerState state)
          Handle an assignment.
 void handle(org.eclipse.jdt.core.dom.ClassInstanceCreation node, TypeAnalyzerState state)
          Handle a class instance creation (with the new operator).
 void handle(org.eclipse.jdt.core.dom.MethodInvocation node, TypeAnalyzerState state)
          Handle a method invocation.
 void handle(org.eclipse.jdt.core.dom.ReturnStatement node, TypeAnalyzerState state)
          Handle a return statement.
 void handle(org.eclipse.jdt.core.dom.VariableDeclarationFragment node, TypeAnalyzerState state)
          Handle a variable declaration fragment.
 

Method Detail

handle

void handle(org.eclipse.jdt.core.dom.Assignment node,
            TypeAnalyzerState state)
Handle an assignment. It may or may not be an aliasing.

Parameters:
node - The node to be handled.
state - The current state of the type analyzer.

handle

void handle(org.eclipse.jdt.core.dom.ClassInstanceCreation node,
            TypeAnalyzerState state)
Handle a class instance creation (with the new operator). The arguments to the class constructor may or may not be alias of fields.

Parameters:
node - The node to be handled.
state - The current state of the type analyzer.

handle

void handle(org.eclipse.jdt.core.dom.MethodInvocation node,
            TypeAnalyzerState state)
Handle a method invocation. The arguments of the invocation may or may not be alias of fields.

Parameters:
node - The node to be handled.
state - The current state of the type analyzer.

handle

void handle(org.eclipse.jdt.core.dom.ReturnStatement node,
            TypeAnalyzerState state)
Handle a return statement. The return expression may or may not be an aliased field.

Parameters:
node - The node to be handled.
state - The current state of the type analyzer.

handle

void handle(org.eclipse.jdt.core.dom.VariableDeclarationFragment node,
            TypeAnalyzerState state)
Handle a variable declaration fragment. Its initializer may or may not be an aliased field.

Parameters:
node - The node to be handled.
state - The current state of the type analyzer.