Package org.pdtextensions.core.ast.util

Examples of org.pdtextensions.core.ast.util.LocalVariableFinder


    // compute source ranges before and after the selected code
    fPreSelectedSourceRange = new SourceRange(fSelectedMethodSourceRange.getOffset(), fSelectionStart - fSelectedMethodSourceRange.getOffset());
    fPostSelectedSourceRange = new SourceRange(fSelectionStart + fSelectionLength, fSelectedMethodSourceRange.getOffset() + fSelectedMethodSourceRange.getLength() - fSelectionStart + fSelectionLength);
   
    // find all variables used in the selected method
    LocalVariableFinder finder = new LocalVariableFinder();
    finder.setRange(fSelectedMethodSourceRange);
    fProgram.accept(finder);
   
    // those are the used variables, including method parameters
    fMethodVariables = finder.getFoundVariables();
    // those are only the method parameters, as FormalParameter
    fMethodParameters = finder.getParameters();
   
    // find all assignments in the selected method
    RangeAssignmentFinder assignmentFinder = new RangeAssignmentFinder();
    assignmentFinder.setRange(fSelectedMethodSourceRange);
    fProgram.accept(assignmentFinder);
View Full Code Here

TOP

Related Classes of org.pdtextensions.core.ast.util.LocalVariableFinder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.