classSourceCursor
final class SourceCursor
A moving read position over grammar source text.
Scanners share one cursor and advance it as they consume characters, so the position is a collaborator they are handed rather than a field each of them reaches into. That is what lets a single lexeme rule — a quoted literal, a block comment, a brace-delimited action — be exercised on its own: give it a cursor over the input it should read, and inspect where the cursor stopped.
Methods§
public function __construct(private string $source)Parameters
$source | string | Text to read |
Test cases 25
SourceCursorTest::testAdvanceMovesTheCursorForwardcoversSourceCursorTest::testAdvanceStopsAtTheEndOfTheSourcecoversSourceCursorTest::testAtEndIsFalseWhileACharacterRemainscoversSourceCursorTest::testAtEndIsTrueForAnEmptySourcecoversSourceCursorTest::testCurrentDoesNotConsumeTheCharacterItReportscoversSourceCursorTest::testCurrentIsEmptyAtTheEndOfTheSourcecoversSourceCursorTest::testOffsetCountsWhatHasBeenConsumedcoversSourceCursorTest::testOffsetStartsAtTheBeginningOfTheSourcecoversSourceCursorTest::testPeekReportsNothingPastTheLastCharactercoversSourceCursorTest::testPeekReportsTheCharacterAfterTheCursorcoversSourceCursorTest::testSkipWhitespaceLeavesANonBlankCursorAlonecoversSourceCursorTest::testSkipWhitespaceStopsAtTheFirstOtherCharactercoversSourceCursorTest::testStartsWithComparesFromTheCursorOnwardscoversSourceCursorTest::testStartsWithIgnoresWhatTheCursorHasPassedcoversSourceCursorTest::testTakeQuotedConsumesTheRestWhenTheRunIsNeverClosedcoversSourceCursorTest::testTakeQuotedDropsTheQuotesAndUnescapescoversSourceCursorTest::testTakeQuotedEndsOnATrailingBackslashcoversSourceCursorTest::testTakeRestIsEmptyOnceTheSourceIsConsumedcoversSourceCursorTest::testTakeRestReturnsEverythingLeftcoversSourceCursorTest::testTakeUntilAnAbsentTerminatorConsumesTheRestcoversSourceCursorTest::testTakeUntilConsumesTheTerminatorWithoutReturningItcoversSourceCursorTest::testTakeWhileConsumesNothingWhenTheFirstCharacterIsRejectedcoversSourceCursorTest::testTakeWhileReturnsTheAcceptedRuncoversSourceCursorTest::testTextBetweenIsEmptyWhenTheOffsetsMeetOrCrosscoversSourceCursorTest::testTextBetweenReadsBackOverConsumedInputcovers
Calls 1
- function-call
strlenline 29
public function atEnd(): boolReports whether the whole source has been consumed.
Returns
bool True when no character remainsTest cases 14
ActionScannerTest::testScanRunsAnUnclosedActionToTheEndOfTheFilecallsBisonScannerTest::testScanConsumesTheLexemeTheScannerClaimscallsBisonTriviaTest::testSkipFromRunsToTheEndWhenOnlyTriviaRemainscallsBisonTriviaTest::testSkipToCommentCloseRunsToTheEndWhenNeverClosedcallsDirectiveScannerTest::testScanPrologueRunsAnUnterminatedBodyToTheEndOfTheFilecallsSourceCursorTest::testAdvanceMovesTheCursorForwardcoversSourceCursorTest::testAtEndIsFalseWhileACharacterRemainscovers and callsSourceCursorTest::testAtEndIsTrueForAnEmptySourcecovers and callsSourceCursorTest::testCurrentDoesNotConsumeTheCharacterItReportscoversSourceCursorTest::testCurrentIsEmptyAtTheEndOfTheSourcecoversSourceCursorTest::testSkipWhitespaceStopsAtTheFirstOtherCharactercoversSourceCursorTest::testTakeQuotedConsumesTheRestWhenTheRunIsNeverClosedcovers and callsSourceCursorTest::testTakeQuotedEndsOnATrailingBackslashcovers and callsSourceCursorTest::testTakeUntilAnAbsentTerminatorConsumesTheRestcovers and calls
Called from 4
- method-call SqlFaker\Compiler\Bison\Lexer\ActionScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/ActionScanner.php:62
- method-call SqlFaker\Compiler\Bison\Lexer\BisonLexer::scan() packages/sql-faker/src/Compiler/Bison/Lexer/BisonLexer.php:59
- method-call SqlFaker\Compiler\Bison\Lexer\SourceCursor::current() packages/sql-faker/src/Compiler/Bison/Lexer/SourceCursor.php:59
- method-call SqlFaker\Compiler\Bison\Lexer\TypeTagScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/TypeTagScanner.php:51
public function offset(): intReports the position the next read starts at.
Returns
int Zero-based offset into the sourceTest cases 9
BisonTriviaTest::testSkipCommentAtLeavesALoneSlashInPlacecallsBisonTriviaTest::testSkipCommentAtLeavesAnythingElseInPlacecallsBisonTriviaTest::testSkipFromLeavesALexemeAlonecallsSourceCursorTest::testAdvanceStopsAtTheEndOfTheSourcecovers and callsSourceCursorTest::testCurrentDoesNotConsumeTheCharacterItReportscovers and callsSourceCursorTest::testOffsetCountsWhatHasBeenConsumedcovers and callsSourceCursorTest::testOffsetStartsAtTheBeginningOfTheSourcecovers and callsSourceCursorTest::testSkipWhitespaceLeavesANonBlankCursorAlonecovers and callsSourceCursorTest::testTakeWhileConsumesNothingWhenTheFirstCharacterIsRejectedcovers and calls
Called from 12
- method-call SqlFaker\Compiler\Bison\Lexer\ActionScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/ActionScanner.php:57
- method-call SqlFaker\Compiler\Bison\Lexer\ActionScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/ActionScanner.php:93
- method-call SqlFaker\Compiler\Bison\Lexer\BisonLexer::scan() packages/sql-faker/src/Compiler/Bison/Lexer/BisonLexer.php:58
- method-call SqlFaker\Compiler\Bison\Lexer\BisonTrivia::skipFrom() packages/sql-faker/src/Compiler/Bison/Lexer/BisonTrivia.php:43
- method-call SqlFaker\Compiler\Bison\Lexer\DirectiveScanner::scanSectionSeparator() packages/sql-faker/src/Compiler/Bison/Lexer/DirectiveScanner.php:63
- method-call SqlFaker\Compiler\Bison\Lexer\DirectiveScanner::scanPrologue() packages/sql-faker/src/Compiler/Bison/Lexer/DirectiveScanner.php:81
- method-call SqlFaker\Compiler\Bison\Lexer\DirectiveScanner::scanDirectiveName() packages/sql-faker/src/Compiler/Bison/Lexer/DirectiveScanner.php:98
- method-call SqlFaker\Compiler\Bison\Lexer\IdentifierScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/IdentifierScanner.php:44
- method-call SqlFaker\Compiler\Bison\Lexer\NumberScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/NumberScanner.php:43
- method-call SqlFaker\Compiler\Bison\Lexer\PunctuationScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/PunctuationScanner.php:45
- method-call SqlFaker\Compiler\Bison\Lexer\QuotedLiteralScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/QuotedLiteralScanner.php:43
- method-call SqlFaker\Compiler\Bison\Lexer\TypeTagScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/TypeTagScanner.php:47
public function current(): stringReads the character at the cursor without consuming it.
Returns
string The current character, or an empty string at the end of the sourceTest cases 5
BisonScannerTest::testScanConsumesTheLexemeTheScannerClaimscallsSourceCursorTest::testAdvanceMovesTheCursorForwardcovers and callsSourceCursorTest::testCurrentDoesNotConsumeTheCharacterItReportscovers and callsSourceCursorTest::testCurrentIsEmptyAtTheEndOfTheSourcecovers and callsSourceCursorTest::testSkipWhitespaceStopsAtTheFirstOtherCharactercovers and calls
Called from 6
- method-call SqlFaker\Compiler\Bison\Lexer\ActionScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/ActionScanner.php:63
- method-call SqlFaker\Compiler\Bison\Lexer\BisonLexer::scan() packages/sql-faker/src/Compiler/Bison/Lexer/BisonLexer.php:63
- method-call SqlFaker\Compiler\Bison\Lexer\BisonTrivia::skipFrom() packages/sql-faker/src/Compiler/Bison/Lexer/BisonTrivia.php:42
- method-call SqlFaker\Compiler\Bison\Lexer\BisonTrivia::skipCommentAt() packages/sql-faker/src/Compiler/Bison/Lexer/BisonTrivia.php:59
- method-call SqlFaker\Compiler\Bison\Lexer\PunctuationScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/PunctuationScanner.php:46
- method-call SqlFaker\Compiler\Bison\Lexer\QuotedLiteralScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/QuotedLiteralScanner.php:44
Calls 1
- method-call SourceCursor::atEnd() line 59
public function peek(): string|nullReads the character after the cursor without consuming it.
Returns
string|null The following character, or null when none remainsTest cases 2
SourceCursorTest::testPeekReportsNothingPastTheLastCharactercovers and callsSourceCursorTest::testPeekReportsTheCharacterAfterTheCursorcovers and calls
public function startsWith(string $prefix): boolReports whether the cursor sits on the given text.
Parameters
$prefix | string | Text to compare against |
Returns
bool True when the source continues with that textTest cases 2
SourceCursorTest::testStartsWithComparesFromTheCursorOnwardscovers and callsSourceCursorTest::testStartsWithIgnoresWhatTheCursorHasPassedcovers and calls
public function advance(int $characters = 1): voidMoves the cursor forward without returning what was skipped.
Parameters
$characters | int | How many characters to skip |
Test cases 11
DirectiveScannerTest::testScanReportsTheOffsetTheDirectiveStartedAtcallsSourceCursorTest::testAdvanceMovesTheCursorForwardcovers and callsSourceCursorTest::testAdvanceStopsAtTheEndOfTheSourcecovers and callsSourceCursorTest::testOffsetCountsWhatHasBeenConsumedcovers and callsSourceCursorTest::testStartsWithComparesFromTheCursorOnwardscovers and callsSourceCursorTest::testStartsWithIgnoresWhatTheCursorHasPassedcovers and callsSourceCursorTest::testTakeQuotedConsumesTheRestWhenTheRunIsNeverClosedcoversSourceCursorTest::testTakeQuotedDropsTheQuotesAndUnescapescoversSourceCursorTest::testTakeQuotedEndsOnATrailingBackslashcoversSourceCursorTest::testTakeRestReturnsEverythingLeftcovers and callsSourceCursorTest::testTextBetweenReadsBackOverConsumedInputcovers and calls
Called from 11
- method-call SqlFaker\Compiler\Bison\Lexer\ActionScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/ActionScanner.php:76
- method-call SqlFaker\Compiler\Bison\Lexer\ActionScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/ActionScanner.php:80
- method-call SqlFaker\Compiler\Bison\Lexer\BisonTrivia::skipToEndOfLine() packages/sql-faker/src/Compiler/Bison/Lexer/BisonTrivia.php:82
- method-call SqlFaker\Compiler\Bison\Lexer\BisonTrivia::skipToCommentClose() packages/sql-faker/src/Compiler/Bison/Lexer/BisonTrivia.php:99
- method-call SqlFaker\Compiler\Bison\Lexer\DirectiveScanner::scanSectionSeparator() packages/sql-faker/src/Compiler/Bison/Lexer/DirectiveScanner.php:64
- method-call SqlFaker\Compiler\Bison\Lexer\DirectiveScanner::scanPrologue() packages/sql-faker/src/Compiler/Bison/Lexer/DirectiveScanner.php:82
- method-call SqlFaker\Compiler\Bison\Lexer\DirectiveScanner::scanDirectiveName() packages/sql-faker/src/Compiler/Bison/Lexer/DirectiveScanner.php:99
- method-call SqlFaker\Compiler\Bison\Lexer\PunctuationScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/PunctuationScanner.php:47
- method-call SqlFaker\Compiler\Bison\Lexer\SourceCursor::takeQuoted() packages/sql-faker/src/Compiler/Bison/Lexer/SourceCursor.php:159
- method-call SqlFaker\Compiler\Bison\Lexer\TypeTagScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/TypeTagScanner.php:48
- method-call SqlFaker\Compiler\Bison\Lexer\TypeTagScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/TypeTagScanner.php:55
Calls 1
- function-call
minline 93
public function skipWhitespace(): voidConsumes any run of whitespace at the cursor.
Test cases 2
SourceCursorTest::testSkipWhitespaceLeavesANonBlankCursorAlonecovers and callsSourceCursorTest::testSkipWhitespaceStopsAtTheFirstOtherCharactercovers and calls
Called from 1
Calls 2
- method-call SourceCursor::takeWhile() line 101
- function-call
ctype_spaceline 101
public function takeWhile(callable(string): bool $accepts): stringConsumes characters for as long as the predicate accepts them.
Parameters
$accepts | callable(string): bool | Decides whether a character belongs to the run |
Returns
string The consumed run, empty when the first character is rejectedTest cases 4
SourceCursorTest::testSkipWhitespaceLeavesANonBlankCursorAlonecoversSourceCursorTest::testSkipWhitespaceStopsAtTheFirstOtherCharactercoversSourceCursorTest::testTakeWhileConsumesNothingWhenTheFirstCharacterIsRejectedcovers and callsSourceCursorTest::testTakeWhileReturnsTheAcceptedRuncovers and calls
Called from 6
- method-call SqlFaker\Compiler\Bison\Lexer\BisonTrivia::skipToEndOfLine() packages/sql-faker/src/Compiler/Bison/Lexer/BisonTrivia.php:83
- method-call SqlFaker\Compiler\Bison\Lexer\DirectiveScanner::scanDirectiveName() packages/sql-faker/src/Compiler/Bison/Lexer/DirectiveScanner.php:100
- method-call SqlFaker\Compiler\Bison\Lexer\IdentifierScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/IdentifierScanner.php:45
- method-call SqlFaker\Compiler\Bison\Lexer\NumberScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/NumberScanner.php:44
- method-call SqlFaker\Compiler\Bison\Lexer\SourceCursor::skipWhitespace() packages/sql-faker/src/Compiler/Bison/Lexer/SourceCursor.php:101
- method-call SqlFaker\Compiler\Bison\Lexer\TypeTagScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/TypeTagScanner.php:49
Calls 1
- function-call
substrline 118
public function takeUntil(string $terminator): stringConsumes text up to the terminator, and the terminator with it.
An absent terminator consumes the rest of the source, which is how an unterminated prologue or comment is reported as its content instead of as a failure.
Parameters
$terminator | string | Text that closes the run |
Returns
string The text before the terminatorTest cases 2
SourceCursorTest::testTakeUntilAnAbsentTerminatorConsumesTheRestcovers and callsSourceCursorTest::testTakeUntilConsumesTheTerminatorWithoutReturningItcovers and calls
Called from 2
public function takeQuoted(string $quote): stringConsumes a quoted run, starting at its opening quote.
A backslash escapes the character after it, so an escaped quote does not close the run. An unterminated run consumes the rest of the source.
Parameters
$quote | string | The quote character that opens and closes the run |
Returns
string The unescaped text between the quotesTest cases 3
SourceCursorTest::testTakeQuotedConsumesTheRestWhenTheRunIsNeverClosedcovers and callsSourceCursorTest::testTakeQuotedDropsTheQuotesAndUnescapescovers and callsSourceCursorTest::testTakeQuotedEndsOnATrailingBackslashcovers and calls
Called from 2
Calls 1
- method-call SourceCursor::advance() line 159
public function textBetween(int $start, int $end): stringReads back text the cursor has already passed over.
A lexeme whose body is defined by delimiters — a brace-delimited action, for instance — is recognised by walking to its closing delimiter and then asking for the text in between, rather than by accumulating characters it may still turn out not to own.
Parameters
$start | int | Offset the text begins at |
$end | int | Offset the text ends before |
Returns
string The text between the two offsets, empty when they crossTest cases 2
SourceCursorTest::testTextBetweenIsEmptyWhenTheOffsetsMeetOrCrosscovers and callsSourceCursorTest::testTextBetweenReadsBackOverConsumedInputcovers and calls
Called from 1
Calls 1
- function-call
substrline 200
public function takeRest(): stringConsumes everything that is left.
Returns
string The remaining source, empty when the cursor is at the endTest cases 28
ActionScannerTest::testScanExcludesTheOuterBracesFromTheBodycallsActionScannerTest::testScanIgnoresABraceInsideABlockCommentcallsActionScannerTest::testScanIgnoresABraceInsideACharacterLiteralcallsActionScannerTest::testScanIgnoresABraceInsideALineCommentcallsActionScannerTest::testScanIgnoresABraceInsideAStringcallsActionScannerTest::testScanKeepsNestedBracesInTheBodycallsBisonTriviaTest::testSkipCommentAtConsumesABlockCommentcallsBisonTriviaTest::testSkipCommentAtConsumesALineCommentcallsBisonTriviaTest::testSkipFromLeavesTheCursorOnTheFirstLexemecallsBisonTriviaTest::testSkipToCommentCloseConsumesTheTerminatorcallsBisonTriviaTest::testSkipToEndOfLineStopsBeforeTheNewlinecallsDirectiveScannerTest::testScanDirectiveNameKeepsTheLeadingPercentSigncallsDirectiveScannerTest::testScanPrologueReadsTheCodeBetweenItsDelimiterscallsDirectiveScannerTest::testScanSectionSeparatorReadsTwoPercentSignscallsIdentifierScannerTest::testScanAllowsDigitsAndDotsAfterTheFirstCharactercallsIdentifierScannerTest::testScanCarriesTheNameSpellingcallsNumberScannerTest::testScanCarriesTheValueAsAnIntegercallsNumberScannerTest::testScanStopsAtTheFirstNonDigitcallsPunctuationScannerTest::testScanReadsEachPunctuationCharacterAsItsOwnLexemecallsQuotedLiteralScannerTest::testScanKeepsReadingPastAnEscapedQuotecallsQuotedLiteralScannerTest::testScanReadsDoubleQuotesAsAStringLiteralcallsQuotedLiteralScannerTest::testScanReadsSingleQuotesAsACharacterLiteralcallsSourceCursorTest::testTakeQuotedDropsTheQuotesAndUnescapescovers and callsSourceCursorTest::testTakeRestIsEmptyOnceTheSourceIsConsumedcovers and callsSourceCursorTest::testTakeRestReturnsEverythingLeftcovers and callsSourceCursorTest::testTakeUntilConsumesTheTerminatorWithoutReturningItcovers and callsSourceCursorTest::testTakeWhileReturnsTheAcceptedRuncovers and callsTypeTagScannerTest::testScanExcludesTheBracketsFromTheTagcalls
Called from 1
Calls 1
- function-call
substrline 210
Private surface 3§
Implementation details, listed for orientation only.
private int $lengthprivate int $offset = 0private string $sourceTest cases 83§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 25
SourceCursorTest::testAdvanceMovesTheCursorForwardcovers and callsSourceCursorTest::testAdvanceStopsAtTheEndOfTheSourcecovers and callsSourceCursorTest::testAtEndIsFalseWhileACharacterRemainscovers and callsSourceCursorTest::testAtEndIsTrueForAnEmptySourcecovers and callsSourceCursorTest::testCurrentDoesNotConsumeTheCharacterItReportscovers and callsSourceCursorTest::testCurrentIsEmptyAtTheEndOfTheSourcecovers and callsSourceCursorTest::testOffsetCountsWhatHasBeenConsumedcovers and callsSourceCursorTest::testOffsetStartsAtTheBeginningOfTheSourcecovers and callsSourceCursorTest::testPeekReportsNothingPastTheLastCharactercovers and callsSourceCursorTest::testPeekReportsTheCharacterAfterTheCursorcovers and callsSourceCursorTest::testSkipWhitespaceLeavesANonBlankCursorAlonecovers and callsSourceCursorTest::testSkipWhitespaceStopsAtTheFirstOtherCharactercovers and callsSourceCursorTest::testStartsWithComparesFromTheCursorOnwardscovers and callsSourceCursorTest::testStartsWithIgnoresWhatTheCursorHasPassedcovers and callsSourceCursorTest::testTakeQuotedConsumesTheRestWhenTheRunIsNeverClosedcovers and callsSourceCursorTest::testTakeQuotedDropsTheQuotesAndUnescapescovers and callsSourceCursorTest::testTakeQuotedEndsOnATrailingBackslashcovers and callsSourceCursorTest::testTakeRestIsEmptyOnceTheSourceIsConsumedcovers and callsSourceCursorTest::testTakeRestReturnsEverythingLeftcovers and callsSourceCursorTest::testTakeUntilAnAbsentTerminatorConsumesTheRestcovers and callsSourceCursorTest::testTakeUntilConsumesTheTerminatorWithoutReturningItcovers and callsSourceCursorTest::testTakeWhileConsumesNothingWhenTheFirstCharacterIsRejectedcovers and callsSourceCursorTest::testTakeWhileReturnsTheAcceptedRuncovers and callsSourceCursorTest::testTextBetweenIsEmptyWhenTheOffsetsMeetOrCrosscovers and callsSourceCursorTest::testTextBetweenReadsBackOverConsumedInputcovers and calls
Other tests reaching this symbol 58
BisonParserTestcallsBisonPreambleReaderTestcallsBisonDirectiveReaderChainTestcallsDefineDirectiveReaderTestcallsExpectDirectiveReaderTestcallsParamDirectiveReaderTestcallsPrecedenceDirectiveReaderTestcallsStartDirectiveReaderTestcallsTokenDirectiveReaderTestcallsTypeDirectiveReaderTestcallsUnknownDirectiveReaderTestcallsActionScannerTest::testScanExcludesTheOuterBracesFromTheBodycallsActionScannerTest::testScanIgnoresABraceInsideABlockCommentcallsActionScannerTest::testScanIgnoresABraceInsideACharacterLiteralcallsActionScannerTest::testScanIgnoresABraceInsideALineCommentcallsActionScannerTest::testScanIgnoresABraceInsideAStringcallsActionScannerTest::testScanKeepsNestedBracesInTheBodycallsActionScannerTest::testScanReadsALoneSlashAsBodyTextcallsActionScannerTest::testScanReadsAnEmptyActionAsAnEmptyBodycallsActionScannerTest::testScanRunsAnUnclosedActionToTheEndOfTheFilecallsBisonLexerTestcallsBisonScannerChainTestcallsBisonScannerTest::testScanConsumesTheLexemeTheScannerClaimscallsBisonTokenStreamTestcallsBisonTriviaTest::testSkipCommentAtConsumesABlockCommentcallsBisonTriviaTest::testSkipCommentAtConsumesALineCommentcallsBisonTriviaTest::testSkipCommentAtLeavesALoneSlashInPlacecallsBisonTriviaTest::testSkipCommentAtLeavesAnythingElseInPlacecallsBisonTriviaTest::testSkipFromLeavesALexemeAlonecallsBisonTriviaTest::testSkipFromLeavesTheCursorOnTheFirstLexemecallsBisonTriviaTest::testSkipFromReportsASlashThatOpensNoCommentcallsBisonTriviaTest::testSkipFromRunsToTheEndWhenOnlyTriviaRemainscallsBisonTriviaTest::testSkipToCommentCloseConsumesTheTerminatorcallsBisonTriviaTest::testSkipToCommentCloseRunsToTheEndWhenNeverClosedcallsBisonTriviaTest::testSkipToEndOfLineStopsBeforeTheNewlinecallsDirectiveScannerTest::testScanDirectiveNameKeepsTheLeadingPercentSigncallsDirectiveScannerTest::testScanDirectiveNameReportsAPercentSignWithoutANamecallsDirectiveScannerTest::testScanDispatchesOnTheCharacterAfterThePercentSigncallsDirectiveScannerTest::testScanPrologueReadsTheCodeBetweenItsDelimiterscallsDirectiveScannerTest::testScanPrologueRunsAnUnterminatedBodyToTheEndOfTheFilecallsDirectiveScannerTest::testScanReportsTheOffsetTheDirectiveStartedAtcallsDirectiveScannerTest::testScanSectionSeparatorReadsTwoPercentSignscallsIdentifierScannerTest::testScanAllowsDigitsAndDotsAfterTheFirstCharactercallsIdentifierScannerTest::testScanCarriesTheNameSpellingcallsNumberScannerTest::testScanCarriesTheValueAsAnIntegercallsNumberScannerTest::testScanReadsLeadingZeroescallsNumberScannerTest::testScanStopsAtTheFirstNonDigitcallsPunctuationScannerTest::testScanReadsEachPunctuationCharacterAsItsOwnLexemecallsQuotedLiteralScannerTest::testScanKeepsReadingPastAnEscapedQuotecallsQuotedLiteralScannerTest::testScanReadsAnEmptyLiteralcallsQuotedLiteralScannerTest::testScanReadsDoubleQuotesAsAStringLiteralcallsQuotedLiteralScannerTest::testScanReadsSingleQuotesAsACharacterLiteralcallsTypeTagScannerTest::testScanExcludesTheBracketsFromTheTagcallsTypeTagScannerTest::testScanReadsAnEmptyTagcallsTypeTagScannerTest::testScanReportsAnUnclosedTagRatherThanSwallowingTheFilecallsTypeTagScannerTest::testScanTrimsWhitespaceFromTheTagcallsBisonAlternativeReaderTestcallsBisonRuleReaderTestcalls
Relations§
Instantiated in 1
Method calls 45
- method-call SqlFaker\Compiler\Bison\Lexer\ActionScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/ActionScanner.php:57
- method-call SqlFaker\Compiler\Bison\Lexer\ActionScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/ActionScanner.php:62
- method-call SqlFaker\Compiler\Bison\Lexer\ActionScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/ActionScanner.php:63
- method-call SqlFaker\Compiler\Bison\Lexer\ActionScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/ActionScanner.php:70
- method-call SqlFaker\Compiler\Bison\Lexer\ActionScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/ActionScanner.php:76
- method-call SqlFaker\Compiler\Bison\Lexer\ActionScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/ActionScanner.php:80
- method-call SqlFaker\Compiler\Bison\Lexer\ActionScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/ActionScanner.php:93
- method-call SqlFaker\Compiler\Bison\Lexer\ActionScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/ActionScanner.php:95
- method-call SqlFaker\Compiler\Bison\Lexer\BisonLexer::scan() packages/sql-faker/src/Compiler/Bison/Lexer/BisonLexer.php:58
- method-call SqlFaker\Compiler\Bison\Lexer\BisonLexer::scan() packages/sql-faker/src/Compiler/Bison/Lexer/BisonLexer.php:59
- method-call SqlFaker\Compiler\Bison\Lexer\BisonLexer::scan() packages/sql-faker/src/Compiler/Bison/Lexer/BisonLexer.php:63
- method-call SqlFaker\Compiler\Bison\Lexer\BisonLexer::consumeRemaining() packages/sql-faker/src/Compiler/Bison/Lexer/BisonLexer.php:80
- method-call SqlFaker\Compiler\Bison\Lexer\BisonTrivia::skipFrom() packages/sql-faker/src/Compiler/Bison/Lexer/BisonTrivia.php:36
- method-call SqlFaker\Compiler\Bison\Lexer\BisonTrivia::skipFrom() packages/sql-faker/src/Compiler/Bison/Lexer/BisonTrivia.php:42
- method-call SqlFaker\Compiler\Bison\Lexer\BisonTrivia::skipFrom() packages/sql-faker/src/Compiler/Bison/Lexer/BisonTrivia.php:43
- method-call SqlFaker\Compiler\Bison\Lexer\BisonTrivia::skipCommentAt() packages/sql-faker/src/Compiler/Bison/Lexer/BisonTrivia.php:59
- method-call SqlFaker\Compiler\Bison\Lexer\BisonTrivia::skipCommentAt() packages/sql-faker/src/Compiler/Bison/Lexer/BisonTrivia.php:63
- method-call SqlFaker\Compiler\Bison\Lexer\BisonTrivia::skipToEndOfLine() packages/sql-faker/src/Compiler/Bison/Lexer/BisonTrivia.php:82
- method-call SqlFaker\Compiler\Bison\Lexer\BisonTrivia::skipToEndOfLine() packages/sql-faker/src/Compiler/Bison/Lexer/BisonTrivia.php:83
- method-call SqlFaker\Compiler\Bison\Lexer\BisonTrivia::skipToCommentClose() packages/sql-faker/src/Compiler/Bison/Lexer/BisonTrivia.php:99
- method-call SqlFaker\Compiler\Bison\Lexer\BisonTrivia::skipToCommentClose() packages/sql-faker/src/Compiler/Bison/Lexer/BisonTrivia.php:100
- method-call SqlFaker\Compiler\Bison\Lexer\DirectiveScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/DirectiveScanner.php:47
- method-call SqlFaker\Compiler\Bison\Lexer\DirectiveScanner::scanSectionSeparator() packages/sql-faker/src/Compiler/Bison/Lexer/DirectiveScanner.php:63
- method-call SqlFaker\Compiler\Bison\Lexer\DirectiveScanner::scanSectionSeparator() packages/sql-faker/src/Compiler/Bison/Lexer/DirectiveScanner.php:64
- method-call SqlFaker\Compiler\Bison\Lexer\DirectiveScanner::scanPrologue() packages/sql-faker/src/Compiler/Bison/Lexer/DirectiveScanner.php:81
- method-call SqlFaker\Compiler\Bison\Lexer\DirectiveScanner::scanPrologue() packages/sql-faker/src/Compiler/Bison/Lexer/DirectiveScanner.php:82
- method-call SqlFaker\Compiler\Bison\Lexer\DirectiveScanner::scanPrologue() packages/sql-faker/src/Compiler/Bison/Lexer/DirectiveScanner.php:84
- method-call SqlFaker\Compiler\Bison\Lexer\DirectiveScanner::scanDirectiveName() packages/sql-faker/src/Compiler/Bison/Lexer/DirectiveScanner.php:98
- method-call SqlFaker\Compiler\Bison\Lexer\DirectiveScanner::scanDirectiveName() packages/sql-faker/src/Compiler/Bison/Lexer/DirectiveScanner.php:99
- method-call SqlFaker\Compiler\Bison\Lexer\DirectiveScanner::scanDirectiveName() packages/sql-faker/src/Compiler/Bison/Lexer/DirectiveScanner.php:100
- method-call SqlFaker\Compiler\Bison\Lexer\IdentifierScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/IdentifierScanner.php:44
- method-call SqlFaker\Compiler\Bison\Lexer\IdentifierScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/IdentifierScanner.php:45
- method-call SqlFaker\Compiler\Bison\Lexer\NumberScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/NumberScanner.php:43
- method-call SqlFaker\Compiler\Bison\Lexer\NumberScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/NumberScanner.php:44
- method-call SqlFaker\Compiler\Bison\Lexer\PunctuationScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/PunctuationScanner.php:45
- method-call SqlFaker\Compiler\Bison\Lexer\PunctuationScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/PunctuationScanner.php:46
- method-call SqlFaker\Compiler\Bison\Lexer\PunctuationScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/PunctuationScanner.php:47
- method-call SqlFaker\Compiler\Bison\Lexer\QuotedLiteralScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/QuotedLiteralScanner.php:43
- method-call SqlFaker\Compiler\Bison\Lexer\QuotedLiteralScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/QuotedLiteralScanner.php:44
- method-call SqlFaker\Compiler\Bison\Lexer\QuotedLiteralScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/QuotedLiteralScanner.php:47
- method-call SqlFaker\Compiler\Bison\Lexer\TypeTagScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/TypeTagScanner.php:47
- method-call SqlFaker\Compiler\Bison\Lexer\TypeTagScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/TypeTagScanner.php:48
- method-call SqlFaker\Compiler\Bison\Lexer\TypeTagScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/TypeTagScanner.php:49
- method-call SqlFaker\Compiler\Bison\Lexer\TypeTagScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/TypeTagScanner.php:51
- method-call SqlFaker\Compiler\Bison\Lexer\TypeTagScanner::scan() packages/sql-faker/src/Compiler/Bison/Lexer/TypeTagScanner.php:55
Type declarations 16
- type SqlFaker\Compiler\Bison\Lexer\ActionScanner packages/sql-faker/src/Compiler/Bison/Lexer/ActionScanner.php:55
- type SqlFaker\Compiler\Bison\Lexer\BisonLexer packages/sql-faker/src/Compiler/Bison/Lexer/BisonLexer.php:24
- type SqlFaker\Compiler\Bison\Lexer\BisonScanner packages/sql-faker/src/Compiler/Bison/Lexer/BisonScanner.php:35
- type SqlFaker\Compiler\Bison\Lexer\BisonTrivia packages/sql-faker/src/Compiler/Bison/Lexer/BisonTrivia.php:33
- type SqlFaker\Compiler\Bison\Lexer\BisonTrivia packages/sql-faker/src/Compiler/Bison/Lexer/BisonTrivia.php:57
- type SqlFaker\Compiler\Bison\Lexer\BisonTrivia packages/sql-faker/src/Compiler/Bison/Lexer/BisonTrivia.php:80
- type SqlFaker\Compiler\Bison\Lexer\BisonTrivia packages/sql-faker/src/Compiler/Bison/Lexer/BisonTrivia.php:97
- type SqlFaker\Compiler\Bison\Lexer\DirectiveScanner packages/sql-faker/src/Compiler/Bison/Lexer/DirectiveScanner.php:45
- type SqlFaker\Compiler\Bison\Lexer\DirectiveScanner packages/sql-faker/src/Compiler/Bison/Lexer/DirectiveScanner.php:61
- type SqlFaker\Compiler\Bison\Lexer\DirectiveScanner packages/sql-faker/src/Compiler/Bison/Lexer/DirectiveScanner.php:79
- type SqlFaker\Compiler\Bison\Lexer\DirectiveScanner packages/sql-faker/src/Compiler/Bison/Lexer/DirectiveScanner.php:96
- type SqlFaker\Compiler\Bison\Lexer\IdentifierScanner packages/sql-faker/src/Compiler/Bison/Lexer/IdentifierScanner.php:42
- type SqlFaker\Compiler\Bison\Lexer\NumberScanner packages/sql-faker/src/Compiler/Bison/Lexer/NumberScanner.php:41
- type SqlFaker\Compiler\Bison\Lexer\PunctuationScanner packages/sql-faker/src/Compiler/Bison/Lexer/PunctuationScanner.php:43
- type SqlFaker\Compiler\Bison\Lexer\QuotedLiteralScanner packages/sql-faker/src/Compiler/Bison/Lexer/QuotedLiteralScanner.php:41
- type SqlFaker\Compiler\Bison\Lexer\TypeTagScanner packages/sql-faker/src/Compiler/Bison/Lexer/TypeTagScanner.php:45