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

Broken proprty inits in Right-Associative (Unary) Operators #120

Open
StephanErb opened this issue Aug 23, 2011 · 0 comments
Open

Broken proprty inits in Right-Associative (Unary) Operators #120

StephanErb opened this issue Aug 23, 2011 · 0 comments

Comments

@StephanErb
Copy link
Member

Steps to reproduce: Make the minus operator in ExpressionWithSynthesizedAttributes.tcs right associative and then run the TestOperatorParsingScenarios tests.

The actual problem is within the generated parsers:

public final void setOclRef(Object object, String propertyName, String keyName, Object keyValue, String query,
        boolean optional, String propInitURI, ModelUpdaterRegistry modelUpdaterRegistry) {

    ANTLR3LocationToken lastToken = (ANTLR3LocationToken) input.LT(-1);
    <snip> 
    ...
}

SetOCLRef is called within ret=exp.... But at this point in time the minus token has not yet been parsed. input.LT(-1) thus returns the wrong token. This leads to problems in any code relying on the token value (e.g., ReferenceHandlerImpl#resolveRemainingReferences)

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

No branches or pull requests

1 participant