Search in sources :

Example 1 with Environment

use of org.eclipse.titanium.refactoring.scope.nodes.Environment in project titan.EclipsePlug-ins by eclipse.

the class ChangeCreator method analyzeFunction.

/**
 * Analyze a function or testcase
 */
private List<Edit> analyzeFunction(final Definition def) {
    if (!(def instanceof Def_Function || def instanceof Def_Testcase)) {
        ErrorReporter.logError("ChangeCreator.analyzeFunction(): def must be a Def_Function or a Def_Testcase! def type: " + def.getClass());
        return null;
    }
    final FunctionAnalyzer vis = new FunctionAnalyzer();
    def.accept(vis);
    final Environment env = vis.getResult();
    final List<Edit> eds = env.refactor();
    return eds;
}
Also used : Def_Testcase(org.eclipse.titan.designer.AST.TTCN3.definitions.Def_Testcase) Environment(org.eclipse.titanium.refactoring.scope.nodes.Environment) Edit(org.eclipse.titanium.refactoring.scope.nodes.Edit) InsertEdit(org.eclipse.text.edits.InsertEdit) MultiTextEdit(org.eclipse.text.edits.MultiTextEdit) TextEdit(org.eclipse.text.edits.TextEdit) DeleteEdit(org.eclipse.text.edits.DeleteEdit) Def_Function(org.eclipse.titan.designer.AST.TTCN3.definitions.Def_Function)

Aggregations

DeleteEdit (org.eclipse.text.edits.DeleteEdit)1 InsertEdit (org.eclipse.text.edits.InsertEdit)1 MultiTextEdit (org.eclipse.text.edits.MultiTextEdit)1 TextEdit (org.eclipse.text.edits.TextEdit)1 Def_Function (org.eclipse.titan.designer.AST.TTCN3.definitions.Def_Function)1 Def_Testcase (org.eclipse.titan.designer.AST.TTCN3.definitions.Def_Testcase)1 Edit (org.eclipse.titanium.refactoring.scope.nodes.Edit)1 Environment (org.eclipse.titanium.refactoring.scope.nodes.Environment)1