classPrecedenceParser
final class PrecedenceParser
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
Precedence parser for the supported UPSERT expression grammar.
Methods§
public function __construct(private ExpressionCursor $cursor)Shares the token position with the enclosing expression parser.
Parameters
$cursor | ExpressionCursor |
public function parseOr(): UpsertExpressionParse or.
Returns
Throws
Test cases 1
Called from 2
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrimaryParser::parsePrimary() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrimaryParser.php:39
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\PgSqlUpsertExpressionParser::parse() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/PgSqlUpsertExpressionParser.php:28
Calls 3
- method-call PrecedenceParser::parseAnd() line 31
- static-call UpsertExpression::binary() line 34
- class-const UpsertExpressionKind::Or() line 34
public function parseAnd(): UpsertExpressionParse and.
Returns
Throws
Called from 2
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser::parseOr() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:31
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser::parseOr() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:34
Calls 3
- method-call PrecedenceParser::parseComparison() line 46
- static-call UpsertExpression::binary() line 49
- class-const UpsertExpressionKind::And() line 49
public function parseComparison(): UpsertExpressionParse comparison.
Returns
Throws
Called from 2
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser::parseAnd() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:46
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser::parseAnd() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:49
Calls 4
- method-call PrecedenceParser::parseAdditive() line 61
- method-call ComparisonOperator::comparisonOperator() line 62
- new ComparisonOperator line 62
- static-call UpsertExpression::binary() line 66
public function parseAdditive(): UpsertExpressionParse additive.
Returns
Throws
Called from 2
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser::parseComparison() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:61
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser::parseComparison() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:66
Calls 6
- method-call PrecedenceParser::parseMultiplicative() line 75
- method-call ExpressionLexeme::isSymbol() line 76
- new ExpressionLexeme line 76
- static-call UpsertExpression::binary() line 79
- class-const UpsertExpressionKind::Add() line 80
- class-const UpsertExpressionKind::Subtract() line 80
public function parseMultiplicative(): UpsertExpressionParse multiplicative.
Returns
Throws
Test cases 1
Called from 2
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser::parseAdditive() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:75
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser::parseAdditive() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:82
Calls 7
- method-call PrecedenceParser::parseUnary() line 95
- method-call ExpressionLexeme::isSymbol() line 97
- new ExpressionLexeme line 97
- class-const UpsertExpressionKind::Multiply() line 102
- class-const UpsertExpressionKind::Divide() line 103
- class-const UpsertExpressionKind::Modulo() line 103
- static-call UpsertExpression::binary() line 104
public function parseUnary(): UpsertExpressionParse unary.
Returns
Throws
Called from 4
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser::parseMultiplicative() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:95
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser::parseMultiplicative() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:104
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser::parseUnary() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:120
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser::parseUnary() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:127
Calls 9
- static-call UpsertExpression::unary() line 120
- class-const UpsertExpressionKind::Not() line 120
- method-call PrecedenceParser::parseUnary() line 120
- method-call ExpressionLexeme::isSymbol() line 122
- new ExpressionLexeme line 122
- class-const UpsertExpressionKind::UnaryPlus() line 126
- class-const UpsertExpressionKind::UnaryMinus() line 126
- method-call PrimaryParser::parsePrimary() line 131
- new PrimaryParser line 131
Private surface 1§
Implementation details, listed for orientation only.
private ExpressionCursor $cursorTest cases 13§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 6
PrecedenceParserTest::testParseAdditivePreservesPrecedenceAndConsumesItsTokenscallsPrecedenceParserTest::testParseAndPreservesPrecedenceAndConsumesItsTokenscallsPrecedenceParserTest::testParseComparisonPreservesPrecedenceAndConsumesItsTokenscallsPrecedenceParserTest::testParseMultiplicativePreservesPrecedenceAndConsumesItsTokenscallsPrecedenceParserTest::testParseOrPreservesPrecedenceAndConsumesItsTokenscallsPrecedenceParserTest::testParseUnaryPreservesPrecedenceAndConsumesItsTokenscalls
Other tests reaching this symbol 7
PgSqlSessionFactoryTestcallsPgSqlRewriterTestcallsStatementRewriterTestcallsRowMutationResolverTestcallsPrimaryParserTestcallsPgSqlUpsertExpressionParserTestcallsPgSqlMutationResolverTestcalls
Relations§
Instantiated in 2
- new ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrimaryParser::parsePrimary() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrimaryParser.php:39
- new ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\PgSqlUpsertExpressionParser::parse() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/PgSqlUpsertExpressionParser.php:28
Method calls 2
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrimaryParser::parsePrimary() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrimaryParser.php:39
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\PgSqlUpsertExpressionParser::parse() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/PgSqlUpsertExpressionParser.php:28