app.cash.sqldelight.dialects.sqlite_3_35.grammar.SqliteParserUtil.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sqlite-3-35-dialect Show documentation
Show all versions of sqlite-3-35-dialect Show documentation
The SQLite v3.35 Dialect for SQLDelight
package app.cash.sqldelight.dialects.sqlite_3_35.grammar
import app.cash.sqldelight.dialects.sqlite_3_35.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 alter_table_rename_column: GeneratedParserUtilBase.Parser? = null
public var alter_table_drop_column: GeneratedParserUtilBase.Parser? = null
public var insert_stmt: GeneratedParserUtilBase.Parser? = null
public var upsert_clause: GeneratedParserUtilBase.Parser? = null
public var upsert_conflict_target: GeneratedParserUtilBase.Parser? = null
public var upsert_do_update: GeneratedParserUtilBase.Parser? = null
public var update_stmt_limited: GeneratedParserUtilBase.Parser? = null
public var delete_stmt_limited: GeneratedParserUtilBase.Parser? = null
public var returning_clause: 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 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 alterTableDropColumnExt(
builder: PsiBuilder,
level: Int,
alter_table_drop_column: GeneratedParserUtilBase.Parser,
): Boolean = (this.alter_table_drop_column ?: alter_table_drop_column).parse(builder, level)
@JvmStatic
public fun insertStmtExt(
builder: PsiBuilder,
level: Int,
insert_stmt: GeneratedParserUtilBase.Parser,
): Boolean = (this.insert_stmt ?: insert_stmt).parse(builder, level)
@JvmStatic
public fun upsertClauseExt(
builder: PsiBuilder,
level: Int,
upsert_clause: GeneratedParserUtilBase.Parser,
): Boolean = (this.upsert_clause ?: upsert_clause).parse(builder, level)
@JvmStatic
public fun upsertConflictTargetExt(
builder: PsiBuilder,
level: Int,
upsert_conflict_target: GeneratedParserUtilBase.Parser,
): Boolean = (this.upsert_conflict_target ?: upsert_conflict_target).parse(builder, level)
@JvmStatic
public fun upsertDoUpdateExt(
builder: PsiBuilder,
level: Int,
upsert_do_update: GeneratedParserUtilBase.Parser,
): Boolean = (this.upsert_do_update ?: upsert_do_update).parse(builder, level)
@JvmStatic
public fun updateStmtLimitedExt(
builder: PsiBuilder,
level: Int,
update_stmt_limited: GeneratedParserUtilBase.Parser,
): Boolean = (this.update_stmt_limited ?: update_stmt_limited).parse(builder, level)
@JvmStatic
public fun deleteStmtLimitedExt(
builder: PsiBuilder,
level: Int,
delete_stmt_limited: GeneratedParserUtilBase.Parser,
): Boolean = (this.delete_stmt_limited ?: delete_stmt_limited).parse(builder, level)
@JvmStatic
public fun returningClauseExt(
builder: PsiBuilder,
level: Int,
returning_clause: GeneratedParserUtilBase.Parser,
): Boolean = (this.returning_clause ?: returning_clause).parse(builder, level)
public fun reset(): Unit {
createElement = { SqliteTypes.Factory.createElement(it) }
overrides = null
alter_table_rules = null
alter_table_rename_column = null
alter_table_drop_column = null
insert_stmt = null
upsert_clause = null
upsert_conflict_target = null
upsert_do_update = null
update_stmt_limited = null
delete_stmt_limited = null
returning_clause = 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.insert_stmt = Parser { psiBuilder, i -> insert_stmt?.parse(psiBuilder, i) ?:
SqliteParser.insert_stmt_real(psiBuilder, i) }
SqlParserUtil.update_stmt_limited = Parser { psiBuilder, i ->
update_stmt_limited?.parse(psiBuilder, i) ?:
SqliteParser.update_stmt_limited_real(psiBuilder, i) }
SqlParserUtil.delete_stmt_limited = Parser { psiBuilder, i ->
delete_stmt_limited?.parse(psiBuilder, i) ?:
SqliteParser.delete_stmt_limited_real(psiBuilder, i) }
val currentCreateElement = SqlParserUtil.createElement
SqlParserUtil.createElement = {
try {
createElement(it)
} catch(e: AssertionError) {
currentCreateElement(it)
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy