package com.justeat.mickeydb.generator;

import com.google.inject.Inject;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.eclipse.xtext.resource.SaveOptions;
import org.eclipse.xtext.serializer.ISerializer;
import org.eclipse.xtext.xbase.lib.Extension;

@SuppressWarnings("all")
public class SqliteDatabaseStatementGenerator {
  @Inject
  @Extension
  private ISerializer _iSerializer;
  
  private SaveOptions saveOptions;
  
  private final Pattern stripCommentsExpr = Pattern.compile("\\/\\/[^\\r\\n]+|\\/\\*.*?\\*\\/", Pattern.DOTALL);
  
  public SqliteDatabaseStatementGenerator() {
    SaveOptions.Builder _newBuilder = SaveOptions.newBuilder();
    SaveOptions.Builder _noValidation = _newBuilder.noValidation();
    SaveOptions _options = _noValidation.getOptions();
    this.saveOptions = _options;
  }
  
  public CharSequence generateStatements(final /* Iterable<DDLStatement> */Object statements) {
    throw new Error("Unresolved compilation problems:"
      + "\nThe method generateStatement(DDLStatement) from the type SqliteDatabaseStatementGenerator refers to the missing type DDLStatement");
  }
  
  public CharSequence generateTableStatements(final /* Iterable<CreateTableStatement> */Object statements) {
    throw new Error("Unresolved compilation problems:"
      + "\nThe method generateStatement(DDLStatement) from the type SqliteDatabaseStatementGenerator refers to the missing type DDLStatement");
  }
  
  public CharSequence generateViewStatements(final /* Iterable<CreateViewStatement> */Object statements) {
    throw new Error("Unresolved compilation problems:"
      + "\nThe method generateStatement(DDLStatement) from the type SqliteDatabaseStatementGenerator refers to the missing type DDLStatement");
  }
  
  public CharSequence generateTriggerStatements(final /* Iterable<CreateTriggerStatement> */Object statements) {
    throw new Error("Unresolved compilation problems:"
      + "\nThe method generateStatement(DDLStatement) from the type SqliteDatabaseStatementGenerator refers to the missing type DDLStatement");
  }
  
  public CharSequence generateIndexStatements(final /* Iterable<CreateIndexStatement> */Object statements) {
    throw new Error("Unresolved compilation problems:"
      + "\nThe method generateStatement(DDLStatement) from the type SqliteDatabaseStatementGenerator refers to the missing type DDLStatement");
  }
  
  public CharSequence generateStatement(final /* DDLStatement */Object stmt) {
    throw new Error("Unresolved compilation problems:"
      + "\nserialize cannot be resolved"
      + "\nstripComments cannot be resolved"
      + "\ntrim cannot be resolved"
      + "\nsplit cannot be resolved"
      + "\ntrim cannot be resolved"
      + "\nreplaceAll cannot be resolved");
  }
  
  public String stripComments(final String s) {
    Matcher _matcher = this.stripCommentsExpr.matcher(s);
    return _matcher.replaceAll("");
  }
}
