// Path: stylechecker/src/main/java/com/sqatntu/stylechecker/StyleCheckerException.java
// public class StyleCheckerException extends Exception {
// 
//   public StyleCheckerException(String message) {
//     super(message);
//   }
// 
//   public StyleCheckerException(String message, Throwable cause) {
//     super(message, cause);
//   }
// }
// 
// 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/StyleName.java
// public class StyleName {
// 
//   public static final String IGNORE_STYLE = "ignore";
// 
//   public static final String METHOD_NAME_FORMAT = "methodNameFormat";
//   public static final String METHOD_NAME_FORMAT_CAMEL_CASE = "camelCase";
// 
//   public static final String WILD_CARD_IMPORT = "wildCardImport";
//   public static final String WILD_CARD_IMPORT_OK = "wildCard";
//   public static final String WILD_CARD_IMPORT_NO = "noWildCard";
// 
//   public static final String BRACE_STYLE = "braceStyle";
//   public static final String BRACE_STYLE_KR = "kr";
//   public static final String BRACE_STYLE_NON_KR = "nonKr";
// 
//   public static final String[] ALL_STYLE_NAMES = {
//       METHOD_NAME_FORMAT,
//       WILD_CARD_IMPORT,
//       BRACE_STYLE,
//   };
// }
// 
// 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/report/StyleReportContent.java
// public class StyleReportContent {
// 
//   private int lineNumber;
// 
//   private int columnNumber;
// 
//   private String message;
// 
//   private String suggestion;
// 
//   public StyleReportContent(int lineNumber, int columnNumber, String message) {
//     this.lineNumber = lineNumber;
//     this.columnNumber = columnNumber;
//     this.message = message;
//   }
// 
//   public StyleReportContent(int lineNumber, int columnNumber, String message, String suggestion) {
//     this.lineNumber = lineNumber;
//     this.columnNumber = columnNumber;
//     this.message = message;
//     this.suggestion = suggestion;
//   }
// 
//   public int getLineNumber() {
//     return lineNumber;
//   }
// 
//   public int getColumnNumber() {
//     return columnNumber;
//   }
// 
//   public String getMessage() {
//     return message;
//   }
// 
//   public String getSuggestion() {
//     return suggestion;
//   }
// }


import com.sqatntu.api.JavaBaseListener;
import com.sqatntu.api.JavaParser;
import com.sqatntu.stylechecker.StyleCheckerException;
import com.sqatntu.stylechecker.configuration.Configuration;
import com.sqatntu.stylechecker.configuration.StyleName;
import com.sqatntu.stylechecker.report.StyleReport;
import com.sqatntu.stylechecker.report.StyleReportContent;

    String methodNameFormatValue = StyleName.METHOD_NAME_FORMAT_CAMEL_CASE;
    String regex = "^([a-z])([a-zA-Z0-9])*";

    // Do matching and add new report
    String methodName = ctx.getChild(1).getText();

    // If there is no problem with the method name
    if (methodName.matches(regex)) {
      return;
    }

    String message;
    String suggestion;

    switch (methodNameFormatValue) {
      case StyleName.METHOD_NAME_FORMAT_CAMEL_CASE:
        message = "You should use camel case for method name";
        suggestion = "Change method name to " + toCamelCase(methodName);
        break;
      default:
        // This should never happens
        message = "";
        suggestion = "";
        break;
    }

    int line = ctx.getStart().getLine();
    int column = ctx.getStart().getCharPositionInLine() + ctx.getChild(0).getText().length() + 2;

// Path: stylechecker/src/main/java/com/sqatntu/stylechecker/StyleCheckerException.java
// public class StyleCheckerException extends Exception {
// 
//   public StyleCheckerException(String message) {
//     super(message);
//   }
// 
//   public StyleCheckerException(String message, Throwable cause) {
//     super(message, cause);
//   }
// }
// 
// 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/StyleName.java
// public class StyleName {
// 
//   public static final String IGNORE_STYLE = "ignore";
// 
//   public static final String METHOD_NAME_FORMAT = "methodNameFormat";
//   public static final String METHOD_NAME_FORMAT_CAMEL_CASE = "camelCase";
// 
//   public static final String WILD_CARD_IMPORT = "wildCardImport";
//   public static final String WILD_CARD_IMPORT_OK = "wildCard";
//   public static final String WILD_CARD_IMPORT_NO = "noWildCard";
// 
//   public static final String BRACE_STYLE = "braceStyle";
//   public static final String BRACE_STYLE_KR = "kr";
//   public static final String BRACE_STYLE_NON_KR = "nonKr";
// 
//   public static final String[] ALL_STYLE_NAMES = {
//       METHOD_NAME_FORMAT,
//       WILD_CARD_IMPORT,
//       BRACE_STYLE,
//   };
// }
// 
// 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/report/StyleReportContent.java
// public class StyleReportContent {
// 
//   private int lineNumber;
// 
//   private int columnNumber;
// 
//   private String message;
// 
//   private String suggestion;
// 
//   public StyleReportContent(int lineNumber, int columnNumber, String message) {
//     this.lineNumber = lineNumber;
//     this.columnNumber = columnNumber;
//     this.message = message;
//   }
// 
//   public StyleReportContent(int lineNumber, int columnNumber, String message, String suggestion) {
//     this.lineNumber = lineNumber;
//     this.columnNumber = columnNumber;
//     this.message = message;
//     this.suggestion = suggestion;
//   }
// 
//   public int getLineNumber() {
//     return lineNumber;
//   }
// 
//   public int getColumnNumber() {
//     return columnNumber;
//   }
// 
//   public String getMessage() {
//     return message;
//   }
// 
//   public String getSuggestion() {
//     return suggestion;
//   }
// }


// Path: stylechecker/src/main/java/com/sqatntu/stylechecker/listener/MethodNameFormatListener.java
import com.sqatntu.api.JavaBaseListener;
import com.sqatntu.api.JavaParser;
import com.sqatntu.stylechecker.StyleCheckerException;
import com.sqatntu.stylechecker.configuration.Configuration;
import com.sqatntu.stylechecker.configuration.StyleName;
import com.sqatntu.stylechecker.report.StyleReport;
import com.sqatntu.stylechecker.report.StyleReportContent;


    String methodNameFormatValue = StyleName.METHOD_NAME_FORMAT_CAMEL_CASE;
    String regex = "^([a-z])([a-zA-Z0-9])*";

    // Do matching and add new report
    String methodName = ctx.getChild(1).getText();

    // If there is no problem with the method name
    if (methodName.matches(regex)) {
      return;
    }

    String message;
    String suggestion;

    switch (methodNameFormatValue) {
      case StyleName.METHOD_NAME_FORMAT_CAMEL_CASE:
        message = "You should use camel case for method name";
        suggestion = "Change method name to " + toCamelCase(methodName);
        break;
      default:
        // This should never happens
        message = "";
        suggestion = "";
        break;
    }

    int line = ctx.getStart().getLine();
    int column = ctx.getStart().getCharPositionInLine() + ctx.getChild(0).getText().length() + 2;

    StyleReportContent reportContent = new StyleReportContent(line, column, message, suggestion);