classPlatform
final class Platform
Restricted visibility: declared "@visibility SqlSemantics". Code outside that scope must not name this declaration.
Wires the SQLite grammar releases, lowering rules and spelling rules into the analysis.
Methods§
public function profile(
?string $version,
?Mode $mode,
ParameterStyle $parameters,
): LanguageProfileFixes the profile of a shipped SQLite release; SQLite reads SQL under no session mode.
Parameters
$version | ?string | |
$mode | ?Mode | |
$parameters | ParameterStyle |
Returns
Throws
InvalidArgumentException When the release is not shipped, a mode is given, or the installed grammar artifacts differ from the pinned onesTest cases 17
LoweringTest::testCommandLowersAQueryCommandAndADefinitionCommandcallsLoweringTest::testCommandUsesTheRuleObjectsOfTheSameLoweringcallsLoweringTest::testStatementsLowersEveryCommandInOrderAndSkipsEmptyOnescallsLoweringTest::testStatementsRecordsTheOperandLeavesItLowerscallsLoweringTest::testTerminatedAnswersNullForAnEmptyCommandcallsLoweringTest::testTerminatedWrapsAnExplainedCommandcallsLoweringTest::testUnwrappedAnswersTheCommandInsideTheGrammarWrappercallsQueryCommandsTest::testCommandAnswersNullForACommandOfAnotherFamilycallsPlatformTest::testCodecSpellsNamesAsSqliteIdentifierscallsPlatformTest::testContextKeepsTheAttachedSchemasAfterMainAndDropsAWrittenTempcallsPlatformTest::testContextSearchesTempThenMainByDefaultAndComparesNamesWithoutAsciiCasecallsPlatformTest::testLeafKeysKeysSqliteTokenscallsPlatformTest::testLowerAnswersTheStatementsOfATreeInOrdercallsPlatformTest::testParserParsesSqliteAndIsCreatedOncePerProfilecallsPlatformTest::testProductionsAnswerTheSignaturesOfTheReleasecallsPlatformTest::testProfileAcceptsTheShippedReleaseByNameAndKeepsTheParameterStylecallsPlatformTest::testProfileFixesTheDefaultReleaseWithoutASessionModecalls
Called from 1
Calls 9
- new
InvalidArgumentExceptionline 56 - static-call GrammarRelease::tryFrom() line 58
- method-call SqliteParser::version() line 58
- new SqliteParser line 58
- method-call VersionRegistry::resolve() line 62
- new VersionRegistry line 62
- function-call
hash_fileline 63 - new LanguageProfile line 67
- new LexicalSettings line 67
public function parser(LanguageProfile $profile): SqlParserAnswers the parser of a profile, created once per profile.
Parameters
$profile | LanguageProfile |
Returns
SqlParserTest cases 10
LoweringTest::testCommandLowersAQueryCommandAndADefinitionCommandcallsLoweringTest::testStatementsLowersEveryCommandInOrderAndSkipsEmptyOnescallsLoweringTest::testStatementsRecordsTheOperandLeavesItLowerscallsLoweringTest::testTerminatedAnswersNullForAnEmptyCommandcallsLoweringTest::testTerminatedWrapsAnExplainedCommandcallsLoweringTest::testUnwrappedAnswersTheCommandInsideTheGrammarWrappercallsQueryCommandsTest::testCommandAnswersNullForACommandOfAnotherFamilycallsPlatformTest::testLowerAnswersTheStatementsOfATreeInOrdercallsPlatformTest::testParserParsesSqliteAndIsCreatedOncePerProfilecallsPlatformTest::testProductionsAnswerTheSignaturesOfTheReleasecalls
Called from 1
Calls 1
- new SqliteParser line 77
public function productions(LanguageProfile $profile): ProductionsAnswers the productions of the release.
Parameters
$profile | LanguageProfile |
Returns
Test cases 9
LoweringTest::testCommandLowersAQueryCommandAndADefinitionCommandcallsLoweringTest::testCommandUsesTheRuleObjectsOfTheSameLoweringcallsLoweringTest::testStatementsLowersEveryCommandInOrderAndSkipsEmptyOnescallsLoweringTest::testStatementsRecordsTheOperandLeavesItLowerscallsLoweringTest::testTerminatedAnswersNullForAnEmptyCommandcallsLoweringTest::testTerminatedWrapsAnExplainedCommandcallsLoweringTest::testUnwrappedAnswersTheCommandInsideTheGrammarWrappercallsQueryCommandsTest::testCommandAnswersNullForACommandOfAnotherFamilycallsPlatformTest::testProductionsAnswerTheSignaturesOfTheReleasecalls
Called from 2
Calls 2
- static-call Productions::load() line 85
- function-call
dirnameline 85
public function lower(Node $tree, LanguageProfile $profile, Leaves $leaves): list<Statement>Lowers a parse tree into its statements.
Parameters
$tree | Node | |
$profile | LanguageProfile | |
$leaves | Leaves |
Returns
list<Statement>Test cases 1
Called from 1
Calls 3
- method-call Lowering::statements() line 95
- new Lowering line 95
- method-call Platform::productions() line 95
public function codec(LanguageProfile $profile): Codecpublic function leafKeys(LanguageProfile $profile): LeafKeysAnswers the token comparison keys.
Parameters
$profile | LanguageProfile |
Returns
Test cases 1
Called from 1
public function context(
LanguageProfile $profile,
list<string>|null $searchPath,
list<Table> $tables,
bool $complete,
): AnalysisContextCreates a context: SQLite searches temp, then main, then the attached schemas, and compares names without regard to ASCII case.
Parameters
$profile | LanguageProfile | |
$searchPath | list<string>|null | |
$tables | list<Table> | |
$complete | bool |
Returns
Throws
InvalidArgumentException When the path does not start with mainTest cases 2
Called from 2
Calls 6
- function-call
strcasecmpline 124 - function-call
array_shiftline 125 - new
InvalidArgumentExceptionline 128 - new Name line 130
- new AnalysisContext line 135
- class-const Comparison::AsciiInsensitive() line 135
public function statementNamespace(): stringAnswers the namespace of the SQLite statement values.
Returns
stringTest cases 1
Called from 1
Private surface 2§
Implementation details, listed for orientation only.
private static ?self $shared = nullprivate array<string, SqlParser> $parsers = []Test cases 51§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 20
PlatformTest::testCodecSpellsNamesAsSqliteIdentifierscallsPlatformTest::testCodecSpellsNamesOfTheProfilecallsPlatformTest::testContextAppliesTheNameRulesOfTheDatabasecallsPlatformTest::testContextKeepsTheAttachedSchemasAfterMainAndDropsAWrittenTempcallsPlatformTest::testContextSearchesTempThenMainByDefaultAndComparesNamesWithoutAsciiCasecallsPlatformTest::testLeafKeysKeysSqliteTokenscallsPlatformTest::testLeafKeysKeyTokensOfTheProfilecallsPlatformTest::testLowerAnswersTheStatementsOfATreeInOrdercallsPlatformTest::testLowerTurnsAParseTreeIntoStatementsAndRecordsTheLeavescallsPlatformTest::testParserAnswersTheSameParserForOneProfilecallsPlatformTest::testParserParsesSqliteAndIsCreatedOncePerProfilecallsPlatformTest::testProductionsAnswerTheSignaturesOfTheReleasecallsPlatformTest::testProductionsSpellTheProductionOfARootNodecallsPlatformTest::testProfileAcceptsTheShippedReleaseByNameAndKeepsTheParameterStylecallsPlatformTest::testProfileFixesTheDefaultReleaseOfTheDatabasecallsPlatformTest::testProfileFixesTheDefaultReleaseWithoutASessionModecallsPlatformTest::testProfileRefusesAReleaseTheDatabaseDoesNotShipcallsPlatformTest::testSharedReusesTheDatabasePlatformcallsPlatformTest::testStatementNamespaceClosesTheValueDomainOfTheDatabasecallsPlatformTest::testStatementNamespaceNamesTheSqliteStatementValuescalls
Other tests reaching this symbol 31
LoweringTest::testCommandLowersAQueryCommandAndADefinitionCommandcallsLoweringTest::testCommandUsesTheRuleObjectsOfTheSameLoweringcallsLoweringTest::testStatementsLowersEveryCommandInOrderAndSkipsEmptyOnescallsLoweringTest::testStatementsRecordsTheOperandLeavesItLowerscallsLoweringTest::testTerminatedAnswersNullForAnEmptyCommandcallsLoweringTest::testTerminatedWrapsAnExplainedCommandcallsLoweringTest::testUnwrappedAnswersTheCommandInsideTheGrammarWrappercallsQueryCommandsTest::testCommandAnswersNullForACommandOfAnotherFamilycallsCodecTest::testNameIsQuotedWhenItWouldNotDecodeToItselfBarecallsCodecTest::testNameIsWrittenBareWhenTheProfileAllowsItcallsCodecTest::testNameSpellingDecodesToTheSameNameWhenAnalyzedAgaincallsLeafKeysTest::testKeyIdentifiesALiteralByItsValueAndAKeywordByItsTerminalcallsLeafKeysTest::testKeyIsNullAtADeclaredNoisePositioncallsNameUseTest::testThePositionIsHandedToTheCodeccallsSplitterTest::testSplitEndsEachStatementWithItsOwnTerminatorcallsSplitterTest::testSplitIgnoresTerminatorsInsideStringsCommentsAndCompoundStatementscallsSplitterTest::testSplitKeepsTrailingWhitespaceAndCommentsWithTheLastStatementcallsSplitterTest::testSplitOfAnEmptyOrBlankInputHasNoStatementscallsListsTest::testItemsOfAParsedStatementListcallsProductionsTest::testSignatureSpellsTheProductionOfAParsedNodecallsNodeTest::testRenderOfAChildIsReachedThroughTheOutputcallsNodeTest::testRenderWritesTypedPiecesOnlycallsScriptTest::testRenderSeparatesTheMembersWithTerminatorscallsSpellingsTest::testCheckAcceptsOtherSpellingsOfTheSameTokensAndTriviacallsSpellingsTest::testCheckRefusesADifferentTokencallsSpellingsTest::testCheckRefusesATokenWrittenIntoAGapcallsSpellingsTest::testTokensDropsTheEndMarkercallsSpellingsTest::testTreeRefusesTextOutsideTheGrammarcallsTokenCorrespondenceTest::testDifferenceOfARenderedStatementAgainstItsSourceIsNullcallsTokenCorrespondenceTest::testKeysIgnoreKeywordCaseWhitespaceAndQuoteStylecallsTokenCorrespondenceTest::testKeysListTheSignificantTokensInOrdercalls
Relations§
Static calls 3
- static-call SqlSemantics\Platform\Sqlite\Model\Validation\Publication::establish() packages/sql-semantics-sqlite/src/Model/Validation/Publication.php:48
- static-call SqlSemantics\Platform\Sqlite\Semantics::__construct() packages/sql-semantics-sqlite/src/Semantics.php:77
- static-call SqlSemantics\Platform\Sqlite\SqlNames::table() packages/sql-semantics-sqlite/src/SqlNames.php:32
Method calls 8
- method-call SqlSemantics\Platform\Sqlite\Semantics::__construct() packages/sql-semantics-sqlite/src/Semantics.php:78
- method-call SqlSemantics\Platform\Sqlite\Semantics::__construct() packages/sql-semantics-sqlite/src/Semantics.php:79
- method-call SqlSemantics\Platform\Sqlite\Semantics::__construct() packages/sql-semantics-sqlite/src/Semantics.php:81
- method-call SqlSemantics\Platform\Sqlite\Semantics::context() packages/sql-semantics-sqlite/src/Semantics.php:124
- method-call SqlSemantics\Platform\Sqlite\Semantics::inspect() packages/sql-semantics-sqlite/src/Semantics.php:164
- method-call SqlSemantics\Platform\Sqlite\Semantics::inspect() packages/sql-semantics-sqlite/src/Semantics.php:167
- method-call SqlSemantics\Platform\Sqlite\Semantics::inspect() packages/sql-semantics-sqlite/src/Semantics.php:171
- method-call SqlSemantics\Platform\Sqlite\Semantics::inspect() packages/sql-semantics-sqlite/src/Semantics.php:172