// Path: stylechecker/src/main/java/com/sqatntu/ThrowingErrorListener.java
// public class ThrowingErrorListener extends BaseErrorListener {
// 
//   @Override
//   public void syntaxError(
//       Recognizer<?, ?> recognizer,
//       Object offendingSymbol,
//       int line,
//       int charPositionInLine,
//       String message,
//       RecognitionException error)
//       throws ParseCancellationException {
//     throw new ParseCancellationException("line " + line + ":" + charPositionInLine + " " + message);
//   }
// }
// 
// Path: stylechecker/src/main/java/com/sqatntu/stylechecker/configuration/Configuration.java
// public interface Configuration {
// 
//   String[] getAttributeNames();
// 
//   String getAttribute(String name) throws StyleCheckerException;
// }
// 
// Path: stylechecker/src/main/java/com/sqatntu/stylechecker/configuration/ConfigurationLoader.java
// public interface ConfigurationLoader {
//   Configuration loadFileConfiguration(String filePath) throws IOException;
// 
//   Configuration loadJsonConfiguration(String json);
// }
// 
// Path: stylechecker/src/main/java/com/sqatntu/stylechecker/injection/StyleCheckerModule.java
// @Module(injects = {StyleChecker.class})
// public class StyleCheckerModule {
// 
//   @Provides
//   @Singleton
//   ConfigurationLoader provideConfigurationLoader() {
//     return new JsonConfigurationLoader();
//   }
// 
//   @Provides
//   StyleReport provideStyleReport() {
//     return new StyleReport();
//   }
// 
//   @Provides
//   @Singleton
//   ThrowingErrorListener provideThrowingErrorListener() {
//     return new ThrowingErrorListener();
//   }
// }
// 
// Path: stylechecker/src/main/java/com/sqatntu/stylechecker/listener/AllListeners.java
// public class AllListeners extends JavaBaseListener {
// 
//   private MethodNameFormatListener methodNameFormatListener;
//   private WildCardImportStatementListener wildCardImportStatementListener;
//   private BraceStyleListener braceStyleListener;
// 
//   public AllListeners(Configuration configuration, StyleReport report) {
//     methodNameFormatListener = new MethodNameFormatListener(configuration, report);
//     wildCardImportStatementListener = new WildCardImportStatementListener(configuration, report);
//     braceStyleListener = new BraceStyleListener(configuration, report);
//   }
// 
//   @Override
//   public void enterMethodDeclaration(JavaParser.MethodDeclarationContext ctx) {
//     methodNameFormatListener.enterMethodDeclaration(ctx);
//   }
// 
//   @Override
//   public void enterImportDeclaration(JavaParser.ImportDeclarationContext ctx) {
//     wildCardImportStatementListener.enterImportDeclaration(ctx);
//   }
// 
//   @Override
//   public void enterBlock(com.sqatntu.api.JavaParser.BlockContext ctx) {
//     braceStyleListener.enterBlock(ctx);
//   }
// 
//   @Override
//   public void enterClassBody(JavaParser.ClassBodyContext ctx) {
//     braceStyleListener.enterClassBody(ctx);
//   }
// 
//   @Override
//   public void enterInterfaceBody(JavaParser.InterfaceBodyContext ctx) {
//     braceStyleListener.enterInterfaceBody(ctx);
//   }
// 
//   @Override
//   public void enterStatement(JavaParser.StatementContext ctx) {
//     braceStyleListener.enterStatement(ctx);
//   }
// 
//   @Override
//   public void enterCatchClause(JavaParser.CatchClauseContext ctx) {
//     braceStyleListener.enterCatchClause(ctx);
//   }
// 
//   @Override
//   public void enterFinallyBlock(JavaParser.FinallyBlockContext ctx) {
//     braceStyleListener.enterFinallyBlock(ctx);
//   }
// }
// 
// Path: stylechecker/src/main/java/com/sqatntu/stylechecker/report/StyleReport.java
// public class StyleReport {
// 
//   List<StyleReportContent> reportContents;
// 
//   public StyleReport() {
//     reportContents = new ArrayList<>();
//   }
// 
//   public List<StyleReportContent> getReportContents() {
//     return ImmutableList.<StyleReportContent>builder().addAll(reportContents).build();
//   }
// 
//   public void addReportContents(StyleReportContent reportContents) {
//     this.reportContents.add(reportContents);
//   }
// }


import dagger.ObjectGraph;
import org.antlr.v4.runtime.ANTLRFileStream;
import org.antlr.v4.runtime.ANTLRInputStream;
import org.antlr.v4.runtime.CharStream;
import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.misc.ParseCancellationException;
import org.antlr.v4.runtime.tree.ParseTreeWalker;
import java.io.IOException;
import javax.inject.Inject;
import com.sqatntu.ThrowingErrorListener;
import com.sqatntu.api.JavaLexer;
import com.sqatntu.api.JavaParser;
import com.sqatntu.stylechecker.configuration.Configuration;
import com.sqatntu.stylechecker.configuration.ConfigurationLoader;
import com.sqatntu.stylechecker.injection.StyleCheckerModule;
import com.sqatntu.stylechecker.listener.AllListeners;
import com.sqatntu.stylechecker.report.StyleReport;
/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2015 Andy Chong Chin Shin
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
 * and associated documentation files (the "Software"), to deal in the Software without restriction,
 * including without limitation the rights to use, copy, modify, merge, publish, distribute,
 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software
 * is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or
 * substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 */

package com.sqatntu.stylechecker;




/**
 * StyleChecker provides only one method, i.e. the {@link #checkSourceCode} method.
 * The method accepts source code and style check configuration and performs style
 * checking by using Visitor pattern.
 */
public class StyleChecker {

  @Inject
// Path: stylechecker/src/main/java/com/sqatntu/ThrowingErrorListener.java
// public class ThrowingErrorListener extends BaseErrorListener {
// 
//   @Override
//   public void syntaxError(
//       Recognizer<?, ?> recognizer,
//       Object offendingSymbol,
//       int line,
//       int charPositionInLine,
//       String message,
//       RecognitionException error)
//       throws ParseCancellationException {
//     throw new ParseCancellationException("line " + line + ":" + charPositionInLine + " " + message);
//   }
// }
// 
// Path: stylechecker/src/main/java/com/sqatntu/stylechecker/configuration/Configuration.java
// public interface Configuration {
// 
//   String[] getAttributeNames();
// 
//   String getAttribute(String name) throws StyleCheckerException;
// }
// 
// Path: stylechecker/src/main/java/com/sqatntu/stylechecker/configuration/ConfigurationLoader.java
// public interface ConfigurationLoader {
//   Configuration loadFileConfiguration(String filePath) throws IOException;
// 
//   Configuration loadJsonConfiguration(String json);
// }
// 
// Path: stylechecker/src/main/java/com/sqatntu/stylechecker/injection/StyleCheckerModule.java
// @Module(injects = {StyleChecker.class})
// public class StyleCheckerModule {
// 
//   @Provides
//   @Singleton
//   ConfigurationLoader provideConfigurationLoader() {
//     return new JsonConfigurationLoader();
//   }
// 
//   @Provides
//   StyleReport provideStyleReport() {
//     return new StyleReport();
//   }
// 
//   @Provides
//   @Singleton
//   ThrowingErrorListener provideThrowingErrorListener() {
//     return new ThrowingErrorListener();
//   }
// }
// 
// Path: stylechecker/src/main/java/com/sqatntu/stylechecker/listener/AllListeners.java
// public class AllListeners extends JavaBaseListener {
// 
//   private MethodNameFormatListener methodNameFormatListener;
//   private WildCardImportStatementListener wildCardImportStatementListener;
//   private BraceStyleListener braceStyleListener;
// 
//   public AllListeners(Configuration configuration, StyleReport report) {
//     methodNameFormatListener = new MethodNameFormatListener(configuration, report);
//     wildCardImportStatementListener = new WildCardImportStatementListener(configuration, report);
//     braceStyleListener = new BraceStyleListener(configuration, report);
//   }
// 
//   @Override
//   public void enterMethodDeclaration(JavaParser.MethodDeclarationContext ctx) {
//     methodNameFormatListener.enterMethodDeclaration(ctx);
//   }
// 
//   @Override
//   public void enterImportDeclaration(JavaParser.ImportDeclarationContext ctx) {
//     wildCardImportStatementListener.enterImportDeclaration(ctx);
//   }
// 
//   @Override
//   public void enterBlock(com.sqatntu.api.JavaParser.BlockContext ctx) {
//     braceStyleListener.enterBlock(ctx);
//   }
// 
//   @Override
//   public void enterClassBody(JavaParser.ClassBodyContext ctx) {
//     braceStyleListener.enterClassBody(ctx);
//   }
// 
//   @Override
//   public void enterInterfaceBody(JavaParser.InterfaceBodyContext ctx) {
//     braceStyleListener.enterInterfaceBody(ctx);
//   }
// 
//   @Override
//   public void enterStatement(JavaParser.StatementContext ctx) {
//     braceStyleListener.enterStatement(ctx);
//   }
// 
//   @Override
//   public void enterCatchClause(JavaParser.CatchClauseContext ctx) {
//     braceStyleListener.enterCatchClause(ctx);
//   }
// 
//   @Override
//   public void enterFinallyBlock(JavaParser.FinallyBlockContext ctx) {
//     braceStyleListener.enterFinallyBlock(ctx);
//   }
// }
// 
// Path: stylechecker/src/main/java/com/sqatntu/stylechecker/report/StyleReport.java
// public class StyleReport {
// 
//   List<StyleReportContent> reportContents;
// 
//   public StyleReport() {
//     reportContents = new ArrayList<>();
//   }
// 
//   public List<StyleReportContent> getReportContents() {
//     return ImmutableList.<StyleReportContent>builder().addAll(reportContents).build();
//   }
// 
//   public void addReportContents(StyleReportContent reportContents) {
//     this.reportContents.add(reportContents);
//   }
// }


// Path: stylechecker/src/main/java/com/sqatntu/stylechecker/StyleChecker.java
import dagger.ObjectGraph;
import org.antlr.v4.runtime.ANTLRFileStream;
import org.antlr.v4.runtime.ANTLRInputStream;
import org.antlr.v4.runtime.CharStream;
import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.misc.ParseCancellationException;
import org.antlr.v4.runtime.tree.ParseTreeWalker;
import java.io.IOException;
import javax.inject.Inject;
import com.sqatntu.ThrowingErrorListener;
import com.sqatntu.api.JavaLexer;
import com.sqatntu.api.JavaParser;
import com.sqatntu.stylechecker.configuration.Configuration;
import com.sqatntu.stylechecker.configuration.ConfigurationLoader;
import com.sqatntu.stylechecker.injection.StyleCheckerModule;
import com.sqatntu.stylechecker.listener.AllListeners;
import com.sqatntu.stylechecker.report.StyleReport;

/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2015 Andy Chong Chin Shin
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
 * and associated documentation files (the "Software"), to deal in the Software without restriction,
 * including without limitation the rights to use, copy, modify, merge, publish, distribute,
 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software
 * is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or
 * substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 */

package com.sqatntu.stylechecker;




/**
 * StyleChecker provides only one method, i.e. the {@link #checkSourceCode} method.
 * The method accepts source code and style check configuration and performs style
 * checking by using Visitor pattern.
 */
public class StyleChecker {

  @Inject
  public StyleReport styleReport;