forked from SonarOpenCommunity/sonar-cxx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a test failure, which occurres on cloudbees and one of my machines.
The failure occurred because of parsing many files and not triggering the finishedParsing() event on the preprocessor.
- Loading branch information
Showing
5 changed files
with
67 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Sonar C++ Plugin (Community) | ||
* Copyright (C) 2011 Waleri Enns and CONTACT Software GmbH | ||
* dev@sonar.codehaus.org | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 | ||
*/ | ||
package org.sonar.cxx; | ||
|
||
import com.sonar.sslr.api.AstAndTokenVisitor; | ||
import com.sonar.sslr.api.AstNode; | ||
import com.sonar.sslr.api.Grammar; | ||
import com.sonar.sslr.api.Token; | ||
import com.sonar.sslr.squid.SquidAstVisitor; | ||
import org.sonar.squid.measures.MetricDef; | ||
import com.sonar.sslr.squid.SquidAstVisitorContext; | ||
|
||
import org.sonar.cxx.parser.CxxParser; | ||
|
||
public class CxxFileVisitor<GRAMMAR extends Grammar> extends SquidAstVisitor<GRAMMAR> | ||
implements AstAndTokenVisitor { | ||
|
||
private SquidAstVisitorContext context = null; | ||
|
||
CxxFileVisitor(SquidAstVisitorContext context){ | ||
this.context = context; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public void visitFile(AstNode node) { | ||
CxxParser.finishedParsing(context.getFile()); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public void visitToken(Token token) { | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters