Skip to content

Conversation

@Bertk
Copy link
Contributor

@Bertk Bertk commented Jul 10, 2015

Initial C++/CLI Support (experimental)

Known limitation:

New keywords cannot be used as identifier (names)

List of added CxxKeyword :

  • gcnew

@Bertk Bertk mentioned this pull request Jul 10, 2015
@guwirth guwirth added this to the M 0.9.4 milestone Jul 11, 2015
@guwirth
Copy link
Collaborator

guwirth commented Jul 12, 2015

@Bertk saw there are many changes independent from C++/CLI.
Should I do cherry picking and merge them?

@Bertk
Copy link
Contributor Author

Bertk commented Jul 12, 2015

@guwirth I am rebasing but have some Problems because the sync with upstream was not executed. Now I need some minutes to complete rebasing but I got errors with`
CxxPublicApiVisitorTest.java 😏

@Bertk Bertk force-pushed the support_C++_CLI branch 2 times, most recently from b45d21e to 2ad5b14 Compare July 12, 2015 17:49
@Bertk
Copy link
Contributor Author

Bertk commented Jul 12, 2015

@guwirth I did not fix the CxxPublicApiVisitorTest.java issue.

@Bertk
Copy link
Contributor Author

Bertk commented Jul 13, 2015

@lcintrat Can you please take a look at CxxPublicApiVisitorTest.java and give some hints how to fix it. I did not expect to break the unit test when I modified the grammar.

@Bertk
Copy link
Contributor Author

Bertk commented Jul 14, 2015

@guwirth I corrected some grammar but if you want to do cherry picking - now is the right time for this 😉

@guwirth
Copy link
Collaborator

guwirth commented Jul 14, 2015

@Bertk have anyway less time at the moment can also wait by Sunday.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This undo the fix from @lcintrat.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is an issue in AbstractCxxPublicApiVisitor and the "operator=" is now effective because of my grammar updates but not handled correctly. I wanted to get some hints from @lcintrat but did not get feedback until now.
After my investigation for the issue I have some concerns about the design of this visitor and in my understanding most the methods should be implemented in cxx-checks and not in cxx-squid. The class has a strong dependency to the AST which creates maintenance effort for further grammar updates.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did some more analysis and the algorithm to detect the "= default" fails because of C++/CLI extension

    b.rule(unqualifiedId).is(
      b.firstOf(
        templateId,
        IDENTIFIER,
        operatorFunctionId,
        conversionFunctionId,
        literalOperatorId,
        b.sequence("~", className),
        b.sequence("~", decltypeSpecifier),
        b.sequence("!", className),
        cliGenericId,
        CxxKeyword.DEFAULT
        )
      );

the AST looks now different:
capture
Removing this extension of unqualfied ID creates several parser errors in C++/CLI code 😟

@guwirth
Copy link
Collaborator

guwirth commented Jul 19, 2015

@Bertk ready to merge? Please rebase and squash...

- support data type keywords: "ref", "value"
- support override specifiers: "sealed", "abstract"
- support access specifiers: "internal"
- support "for each, in"

initial support for CLI

CLI Attributes Support

improve CLI attributes support

enhance property support

- support namespace for property
- add more test samples
- remove CLI keywords from CxxKeyword except "gcnew"

initial support for CLI

CLI Attributes Support

improve CLI attributes support

enhance property support

- support namespace for property
- add more test samples
- remove CLI keywords from CxxKeyword except "gcnew"

add test files

update forRangeDeclSepcifierSeq to consider "in" token value

fix CxxPublicApiVisitorTest.java

"operator=" is not ignored. Make test working again without correction.

revert CxxPublicApiVisitorTest updates

- reorder sequence of rules in memberDeclaration
- adjust class complexity check
@Bertk Bertk force-pushed the support_C++_CLI branch from cb7c653 to a741821 Compare July 19, 2015 19:49
@Bertk
Copy link
Contributor Author

Bertk commented Jul 19, 2015

@guwirth Done and Travis CI has started.

guwirth added a commit that referenced this pull request Jul 19, 2015
@guwirth guwirth merged commit ac5fc51 into SonarOpenCommunity:master Jul 19, 2015
@Bertk Bertk deleted the support_C++_CLI branch July 20, 2015 15:36
@guwirth guwirth mentioned this pull request Oct 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants