/* Ċ Ġ* ĠCopyright Ġ( C ) Ġ 2 0 1 6 ĠSquare , ĠInc . Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* ĠĠĠĠĠ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ package Ġcom . squareup . sql de light . intellij . lang Ċ Ċ import Ġcom . intellij . lang . AST Factory Ċ import Ġcom . intellij . lang . AST Node Ċ import Ġcom . intellij . psi . impl . source . tree . Composite Element Ċ import Ġcom . intellij . psi . impl . source . tree . File Element Ċ import Ġcom . intellij . psi . impl . source . tree . Leaf Psi Element Ċ import Ġcom . intellij . psi . tree . I ElementType Ċ import Ġcom . intellij . psi . tree . I File ElementType Ċ import Ġcom . squareup . sql de light . Sqlite Lexer Ċ import Ġcom . squareup . sql de light . Sqlite Parser Ċ import Ġcom . squareup . sql de light . intellij . lang . Sqlite Token Types . RULE _ ELEMENT _ TYPES Ċ import Ġcom . squareup . sql de light . intellij . lang . Sqlite Token Types . TOKEN _ ELEMENT _ TYPES Ċ import Ġcom . squareup . sql de light . intellij . psi . AST Wrapper Psi Element Ċ import Ġcom . squareup . sql de light . intellij . psi . ClassName Element Ċ import Ġcom . squareup . sql de light . intellij . psi . Identifier Element Ċ import Ġcom . squareup . sql de light . intellij . psi . Import Element Ċ import Ġcom . squareup . sql de light . intellij . psi . Parse Element Ċ import Ġcom . squareup . sql de light . intellij . psi . Sql Del ight Comment Ċ import Ġcom . squareup . sql de light . intellij . psi . Sqlite Element . Column Alias Element Ċ import Ġcom . squareup . sql de light . intellij . psi . Sqlite Element . ColumnName Element Ċ import Ġcom . squareup . sql de light . intellij . psi . Sqlite Element . Sql Stmt Name Element Ċ import Ġcom . squareup . sql de light . intellij . psi . Sqlite Element . Table Alias Element Ċ import Ġcom . squareup . sql de light . intellij . psi . Sqlite Element . TableName Element Ċ import Ġcom . squareup . sql de light . intellij . psi . Sqlite Element . View Name Element Ċ Ċ class ĠSql ite AST Factory Ġ: ĠAST Factory () Ġ{ ĊĠ Ġoverride Ġfun Ġcreate Composite ( type : ĠI ElementType ) Ġ= ĊĠĠĠĠĠ Ġwhen Ġ( type ) Ġ{ ĊĠĠĠĠĠĠĠ Ġis ĠI File ElementType Ġ-> ĠFile Element ( type , Ġnull ) ĊĠĠĠĠĠĠĠ Ġelse Ġ-> ĠComposite Element ( type ) ĊĠĠĠĠĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġcreate Leaf ( type : ĠI ElementType , Ġtext : ĠCharSequence ) Ġ= ĊĠĠĠĠĠ Ġwhen Ġ( type ) Ġ{ ĊĠĠĠĠĠĠĠ ĠTOKEN _ ELEMENT _ TYPES [ Sqlite Lexer . IDENTIFIER ] Ġ-> ĠIdentifier Element ( type , Ġtext ) ĊĠĠĠĠĠĠĠ ĠTOKEN _ ELEMENT _ TYPES [ Sqlite Lexer . J AV AD OC _ COMMENT ] Ġ-> ĠSql Del ight Comment ( type , Ġtext ) ĊĠĠĠĠĠĠĠ ĠTOKEN _ ELEMENT _ TYPES [ Sqlite Lexer . MULT IL INE _ COMMENT ] Ġ-> ĠSql Del ight Comment ( type , Ġtext ) ĊĠĠĠĠĠĠĠ Ġelse Ġ-> ĠLeaf Psi Element ( type , Ġtext ) ĊĠĠĠĠĠ Ġ} Ċ } Ċ Ċ private Ġval Ġfactories Ġ= Ġmap Of ( ĊĠĠĠ ĠRULE _ ELEMENT _ TYPES [ Sqlite Parser . RULE _ parse ] Ġto Ġ:: Parse Element , ĊĠĠĠ ĠRULE _ ELEMENT _ TYPES [ Sqlite Parser . RULE _ table _ name ] Ġto Ġ:: TableName Element , ĊĠĠĠ ĠRULE _ ELEMENT _ TYPES [ Sqlite Parser . RULE _ column _ name ] Ġto Ġ:: ColumnName Element , ĊĠĠĠ ĠRULE _ ELEMENT _ TYPES [ Sqlite Parser . RULE _ sql _ stmt _ name ] Ġto Ġ:: Sql Stmt Name Element , ĊĠĠĠ ĠRULE _ ELEMENT _ TYPES [ Sqlite Parser . RULE _ view _ name ] Ġto Ġ:: View Name Element , ĊĠĠĠ ĠRULE _ ELEMENT _ TYPES [ Sqlite Parser . RULE _ table _ alias ] Ġto Ġ:: Table Alias Element , ĊĠĠĠ ĠRULE _ ELEMENT _ TYPES [ Sqlite Parser . RULE _ column _ alias ] Ġto Ġ:: Column Alias Element , ĊĠĠĠ ĠRULE _ ELEMENT _ TYPES [ Sqlite Parser . RULE _ import _ stmt ] Ġto Ġ:: Import Element , ĊĠĠĠ ĠRULE _ ELEMENT _ TYPES [ Sqlite Parser . RULE _ java _ type ] Ġto Ġ:: ClassName Element Ċ ) Ċ Ċ internal Ġfun ĠAST Node . as PS IN ode () Ġ= Ġfactories [ elementType ]?. call ( this ) Ġ?: ĠAST Wrapper Psi Element ( this ) ĊĊ