All Downloads are FREE. Search and download functionalities are using the official Maven repository.

app.cash.sqldelight.dialects.sqlite_3_25.grammar.SqliteParserUtil.kt Maven / Gradle / Ivy

The newest version!
package app.cash.sqldelight.dialects.sqlite_3_25.grammar

import app.cash.sqldelight.dialects.sqlite_3_25.grammar.psi.SqliteTypes
import com.alecstrong.sql.psi.core.SqlParserUtil
import com.intellij.lang.ASTNode
import com.intellij.lang.PsiBuilder
import com.intellij.lang.parser.GeneratedParserUtilBase
import com.intellij.psi.PsiElement
import java.lang.AssertionError
import kotlin.Boolean
import kotlin.Int
import kotlin.Unit
import kotlin.jvm.JvmStatic

public object SqliteParserUtil : GeneratedParserUtilBase() {
  public var createElement: (ASTNode) -> PsiElement = { SqliteTypes.Factory.createElement(it) }

  public var overrides: GeneratedParserUtilBase.Parser? = null

  public var alter_table_rules: GeneratedParserUtilBase.Parser? = null

  public var result_column: GeneratedParserUtilBase.Parser? = null

  public var select_stmt: GeneratedParserUtilBase.Parser? = null

  public var alter_table_rename_column: GeneratedParserUtilBase.Parser? = null

  public var alter_table_column_alias: GeneratedParserUtilBase.Parser? = null

  public var window_function_invocation: GeneratedParserUtilBase.Parser? = null

  public var window_defn: GeneratedParserUtilBase.Parser? = null

  public var frame_spec: GeneratedParserUtilBase.Parser? = null

  public var window_func: GeneratedParserUtilBase.Parser? = null

  public var window_name: GeneratedParserUtilBase.Parser? = null

  public var base_window_name: GeneratedParserUtilBase.Parser? = null

  @JvmStatic
  public fun overridesExt(
    builder: PsiBuilder,
    level: Int,
    overrides: GeneratedParserUtilBase.Parser,
  ): Boolean = (this.overrides ?: overrides).parse(builder, level)

  @JvmStatic
  public fun alterTableRulesExt(
    builder: PsiBuilder,
    level: Int,
    alter_table_rules: GeneratedParserUtilBase.Parser,
  ): Boolean = (this.alter_table_rules ?: alter_table_rules).parse(builder, level)

  @JvmStatic
  public fun resultColumnExt(
    builder: PsiBuilder,
    level: Int,
    result_column: GeneratedParserUtilBase.Parser,
  ): Boolean = (this.result_column ?: result_column).parse(builder, level)

  @JvmStatic
  public fun selectStmtExt(
    builder: PsiBuilder,
    level: Int,
    select_stmt: GeneratedParserUtilBase.Parser,
  ): Boolean = (this.select_stmt ?: select_stmt).parse(builder, level)

  @JvmStatic
  public fun alterTableRenameColumnExt(
    builder: PsiBuilder,
    level: Int,
    alter_table_rename_column: GeneratedParserUtilBase.Parser,
  ): Boolean = (this.alter_table_rename_column ?: alter_table_rename_column).parse(builder, level)

  @JvmStatic
  public fun alterTableColumnAliasExt(
    builder: PsiBuilder,
    level: Int,
    alter_table_column_alias: GeneratedParserUtilBase.Parser,
  ): Boolean = (this.alter_table_column_alias ?: alter_table_column_alias).parse(builder, level)

  @JvmStatic
  public fun windowFunctionInvocationExt(
    builder: PsiBuilder,
    level: Int,
    window_function_invocation: GeneratedParserUtilBase.Parser,
  ): Boolean = (this.window_function_invocation ?: window_function_invocation).parse(builder, level)

  @JvmStatic
  public fun windowDefnExt(
    builder: PsiBuilder,
    level: Int,
    window_defn: GeneratedParserUtilBase.Parser,
  ): Boolean = (this.window_defn ?: window_defn).parse(builder, level)

  @JvmStatic
  public fun frameSpecExt(
    builder: PsiBuilder,
    level: Int,
    frame_spec: GeneratedParserUtilBase.Parser,
  ): Boolean = (this.frame_spec ?: frame_spec).parse(builder, level)

  @JvmStatic
  public fun windowFuncExt(
    builder: PsiBuilder,
    level: Int,
    window_func: GeneratedParserUtilBase.Parser,
  ): Boolean = (this.window_func ?: window_func).parse(builder, level)

  @JvmStatic
  public fun windowNameExt(
    builder: PsiBuilder,
    level: Int,
    window_name: GeneratedParserUtilBase.Parser,
  ): Boolean = (this.window_name ?: window_name).parse(builder, level)

  @JvmStatic
  public fun baseWindowNameExt(
    builder: PsiBuilder,
    level: Int,
    base_window_name: GeneratedParserUtilBase.Parser,
  ): Boolean = (this.base_window_name ?: base_window_name).parse(builder, level)

  public fun reset(): Unit {
    createElement = { SqliteTypes.Factory.createElement(it) }
    overrides = null
    alter_table_rules = null
    result_column = null
    select_stmt = null
    alter_table_rename_column = null
    alter_table_column_alias = null
    window_function_invocation = null
    window_defn = null
    frame_spec = null
    window_func = null
    window_name = null
    base_window_name = null
  }

  public fun overrideSqlParser(): Unit {
    SqlParserUtil.alter_table_rules = Parser { psiBuilder, i -> alter_table_rules?.parse(psiBuilder,
        i) ?: SqliteParser.alter_table_rules_real(psiBuilder, i) }
    SqlParserUtil.result_column = Parser { psiBuilder, i -> result_column?.parse(psiBuilder, i) ?:
        SqliteParser.result_column_real(psiBuilder, i) }
    SqlParserUtil.select_stmt = Parser { psiBuilder, i -> select_stmt?.parse(psiBuilder, i) ?:
        SqliteParser.select_stmt_real(psiBuilder, i) }
    val currentCreateElement = SqlParserUtil.createElement
    SqlParserUtil.createElement = {
      try {
        createElement(it)
      } catch(e: AssertionError) {
        currentCreateElement(it)
      }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy