Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using ACER for Type and Variable Resolution #5

Open
code2graph opened this issue Apr 3, 2024 · 0 comments
Open

Using ACER for Type and Variable Resolution #5

code2graph opened this issue Apr 3, 2024 · 0 comments

Comments

@code2graph
Copy link

code2graph commented Apr 3, 2024

I came across the ACER repository and have been reviewing the open issues to understand more about its capabilities, specifically in the context of variable and type resolution. My interest is in leveraging ACER purely as a library for analyzing code, particularly for:

  • Resolving the name of a variable within a given piece of code.

For example, I have a Calculator class that uses MathOperations. Here's an example where I aim to resolve that mathOperations is an instance of MathOperations:

public class Calculator {
    private MathOperations mathOperations;

    public Calculator() {
        this.mathOperations = new MathOperations();
    }

    public int performAddition(int x, int y) {
        mathOperations.add(x);
        mathOperations.add(y);
        return mathOperations.getTotal();
    }
}

Now lets say I have created another class AdvancedCalculator class that utilizes Calculator:

public class AdvancedCalculator {
    private Calculator myCalc;

    public AdvancedCalculator() {
        this.myCalc = new Calculator();
    }

    public int computeComplexOperation(int a, int b) {
        return myCalc.performAddition(a, b) * 2; // I want to know myCalc is Calculator
    }
}

I'm seeking guidance on how ACER can be applied as a library. Any examples or detailed instructions on integrating ACER for this purpose would be greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant