risingwave_sqlparser::parser

Struct Parser

source
pub struct Parser<'a>(pub(crate) &'a [TokenWithLocation]);

Tuple Fields§

§0: &'a [TokenWithLocation]

Implementations§

source§

impl Parser<'_>

source

fn peek_format_encode_format(&mut self) -> bool

Peek the next tokens to see if it is FORMAT or ROW FORMAT (for compatibility).

source

pub fn parse_format_encode_with_connector( &mut self, connector: &str, cdc_source_job: bool, ) -> PResult<CompatibleFormatEncode>

Parse the source schema. The behavior depends on the connector type.

source

pub fn parse_schema(&mut self) -> PResult<Option<FormatEncodeOptions>>

Parse FORMAT ... ENCODE ... (...).

source§

impl Parser<'_>

source

pub fn parse_sql(sql: &str) -> Result<Vec<Statement>, ParserError>

Parse a SQL statement and produce an Abstract Syntax Tree (AST)

source

pub fn parse_object_name_str(s: &str) -> Result<ObjectName, ParserError>

Parse object name from a string.

source

fn parse_statements(&mut self) -> PResult<Vec<Statement>>

Parse a list of semicolon-separated statements.

source

pub fn parse_statement(&mut self) -> PResult<Statement>

Parse a single top-level statement (such as SELECT, INSERT, CREATE, etc.), stopping before the statement separator, if any.

source

pub fn parse_truncate(&mut self) -> PResult<Statement>

source

pub fn parse_analyze(&mut self) -> PResult<Statement>

source

pub fn parse_wildcard_or_expr(&mut self) -> PResult<WildcardOrExpr>

Tries to parse a wildcard expression. If it is not a wildcard, parses an expression.

A wildcard expression either means:

source

pub fn word_concat_wildcard_expr( &mut self, ident: Ident, simple_wildcard_expr: WildcardOrExpr, ) -> PResult<WildcardOrExpr>

Concats ident and wildcard_expr in ident.wildcard_expr

source

pub fn expr_concat_wildcard_expr( &mut self, expr: Expr, simple_wildcard_expr: WildcardOrExpr, ) -> PResult<WildcardOrExpr>

Concats expr and wildcard_expr in (expr).wildcard_expr.

source

pub fn parse_simple_wildcard_expr( &mut self, checkpoint: Self, ) -> PResult<WildcardOrExpr>

Tries to parses a wildcard expression without any parentheses.

If wildcard is not found, go back to index and parse an expression.

source

pub fn parse_except(&mut self) -> PResult<Option<Vec<Expr>>>

source

pub fn parse_expr(&mut self) -> PResult<Expr>

Parse a new expression

source

pub fn parse_subexpr(&mut self, precedence: Precedence) -> PResult<Expr>

Parse tokens until the precedence changes

source

pub fn parse_prefix(&mut self) -> PResult<Expr>

Parse an expression prefix

source

fn parse_param(&mut self, param: String) -> PResult<Expr>

source

pub fn parse_struct_selection(&mut self, expr: Expr) -> PResult<Expr>

Parses a field selection expression. See also Expr::FieldIdentifier.

source

pub fn parse_fields(&mut self) -> PResult<Vec<Ident>>

Parses consecutive field identifiers after a period. i.e., .foo.bar.baz

source

pub fn parse_qualified_operator(&mut self) -> PResult<QualifiedOperator>

source

pub fn parse_function(&mut self) -> PResult<Expr>

Parse a function call.

source

pub fn parse_window_frame_units(&mut self) -> PResult<WindowFrameUnits>

source

pub fn parse_window_frame(&mut self) -> PResult<WindowFrame>

source

pub fn parse_window_frame_bound(&mut self) -> PResult<WindowFrameBound>

Parse CURRENT ROW or { <non-negative numeric | datetime | interval> | UNBOUNDED } { PRECEDING | FOLLOWING }

source

pub fn parse_window_frame_exclusion(&mut self) -> PResult<WindowFrameExclusion>

source

fn parse_group_by_expr(&mut self) -> PResult<Expr>

parse a group by expr. a group by expr can be one of group sets, roll up, cube, or simple expr.

source

fn parse_tuple( &mut self, lift_singleton: bool, allow_empty: bool, ) -> PResult<Vec<Expr>>

parse a tuple with ( and ). If lift_singleton is true, then a singleton tuple is lifted to a tuple of length 1, otherwise it will fail. If allow_empty is true, then an empty tuple is allowed.

source

pub fn parse_case_expr(&mut self) -> PResult<Expr>

source

pub fn parse_cast_expr(&mut self) -> PResult<Expr>

Parse a SQL CAST function e.g. CAST(expr AS FLOAT)

source

pub fn parse_try_cast_expr(&mut self) -> PResult<Expr>

Parse a SQL TRY_CAST function e.g. TRY_CAST(expr AS FLOAT)

source

pub fn parse_exists_expr(&mut self) -> PResult<Expr>

Parse a SQL EXISTS expression e.g. WHERE EXISTS(SELECT ...).

source

pub fn parse_extract_expr(&mut self) -> PResult<Expr>

source

pub fn parse_substring_expr(&mut self) -> PResult<Expr>

source

pub fn parse_position_expr(&mut self) -> PResult<Expr>

POSITION(<expr> IN <expr>)

source

pub fn parse_overlay_expr(&mut self) -> PResult<Expr>

OVERLAY(<expr> PLACING <expr> FROM <expr> [ FOR <expr> ])

source

pub fn parse_trim_expr(&mut self) -> PResult<Expr>

TRIM ([WHERE] ['text'] FROM 'text')
TRIM ([WHERE] [FROM] 'text' [, 'text'])

source

pub fn parse_trim_where(&mut self) -> PResult<TrimWhereField>

source

pub fn parse_array_expr(&mut self) -> PResult<Expr>

Parses an array expression [ex1, ex2, ..]

source

fn parse_array_inner( &mut self, depth: usize, expected_depth: &mut Option<usize>, ) -> PResult<Vec<Expr>>

source

pub fn parse_map_expr(&mut self) -> PResult<Expr>

Parses a map expression MAP {k1:v1, k2:v2, ..}

source

pub fn parse_date_time_field(&mut self) -> PResult<DateTimeField>

source

pub fn parse_date_time_field_in_extract(&mut self) -> PResult<String>

source

pub fn parse_literal_interval(&mut self) -> PResult<Expr>

Parse an INTERVAL literal.

Some syntactically valid intervals:

  1. INTERVAL '1' DAY
  2. INTERVAL '1-1' YEAR TO MONTH
  3. INTERVAL '1' SECOND
  4. INTERVAL '1:1:1.1' HOUR (5) TO SECOND (5)
  5. INTERVAL '1.1' SECOND (2, 2)
  6. INTERVAL '1:1' HOUR (5) TO MINUTE (5)

Note that we do not currently attempt to parse the quoted value.

source

pub fn parse_infix( &mut self, expr: Expr, precedence: Precedence, ) -> PResult<Expr>

Parse an operator following an expression

source

pub fn parse_escape(&mut self) -> PResult<Option<EscapeChar>>

parse the ESCAPE CHAR portion of LIKE, ILIKE, and SIMILAR TO

source

pub fn parse_array_index(&mut self, expr: Expr) -> PResult<Expr>

We parse both array[1,9][1], array[1,9][1:2], array[1,9][:2], array[1,9][1:] and array[1,9][:] in this function.

source

pub fn parse_is_json(&mut self, expr: Expr, negated: bool) -> PResult<Expr>

Parses the optional constraints following the IS [NOT] JSON predicate

source

pub fn parse_in(&mut self, expr: Expr, negated: bool) -> PResult<Expr>

Parses the parens following the [ NOT ] IN operator

source

pub fn parse_between(&mut self, expr: Expr, negated: bool) -> PResult<Expr>

Parses BETWEEN <low> AND <high>, assuming the BETWEEN keyword was already consumed

source

pub fn parse_pg_cast(&mut self, expr: Expr) -> PResult<Expr>

Parse a postgresql casting style which is in the form of expr::datatype

source

pub fn get_next_precedence(&self) -> PResult<Precedence>

Get the precedence of the next token

source

pub fn peek_token(&self) -> TokenWithLocation

Return the first non-whitespace token that has not yet been processed (or None if reached end-of-file)

source

pub fn peek_nth_token(&self, n: usize) -> TokenWithLocation

Return nth non-whitespace token that has not yet been processed

source

pub fn next_token(&mut self) -> TokenWithLocation

Return the first non-whitespace token that has not yet been processed (or None if reached end-of-file) and mark it as processed. OK to call repeatedly after reaching EOF.

source

pub fn next_token_no_skip(&mut self) -> Option<&TokenWithLocation>

Return the first unprocessed token, possibly whitespace.

source

pub fn expected<T>(&self, expected: &str) -> PResult<T>

Report an expected error at the current position.

source

pub fn expected_at<T>(&mut self, checkpoint: Self, expected: &str) -> PResult<T>

Revert the parser to a previous position and report an expected error.

source

pub fn parse_word(&mut self, expected: &str) -> bool

Check if the expected match is the next token. The equality check is case-insensitive.

source

pub fn parse_keyword(&mut self, expected: Keyword) -> bool

Look for an expected keyword and consume it if it exists

source

pub fn parse_keywords(&mut self, keywords: &[Keyword]) -> bool

Look for an expected sequence of keywords and consume them if they exist

source

pub fn parse_one_of_keywords(&mut self, keywords: &[Keyword]) -> Option<Keyword>

Look for one of the given keywords and return the one that matches.

source

pub fn peek_nth_any_of_keywords( &mut self, n: usize, keywords: &[Keyword], ) -> bool

source

pub fn expect_one_of_keywords( &mut self, keywords: &[Keyword], ) -> PResult<Keyword>

Bail out if the current token is not one of the expected keywords, or consume it if it is

source

pub fn expect_keyword(&mut self, expected: Keyword) -> PResult<()>

Bail out if the current token is not an expected keyword, or consume it if it is

source

pub fn expect_keywords(&mut self, expected: &[Keyword]) -> PResult<()>

Bail out if the following tokens are not the expected sequence of keywords, or consume them if they are.

source

pub fn consume_token(&mut self, expected: &Token) -> bool

Consume the next token if it matches the expected token, otherwise return false

source

pub fn expect_token(&mut self, expected: &Token) -> PResult<()>

Bail out if the current token is not an expected keyword, or consume it if it is

source

pub fn parse_comma_separated<T, F>(&mut self, f: F) -> PResult<Vec<T>>
where F: FnMut(&mut Self) -> PResult<T>,

Parse a comma-separated list of 1+ items accepted by F

source

fn maybe_parse<T, F>(&mut self, f: F) -> Option<T>
where F: FnMut(&mut Self) -> PResult<T>,

Run a parser method f, reverting back to the current position if unsuccessful.

source

pub fn parse_all_or_distinct(&mut self) -> PResult<bool>

Parse either ALL or DISTINCT. Returns true if DISTINCT is parsed and results in a ParserError if both ALL and DISTINCT are fround.

source

pub fn parse_all_or_distinct_on(&mut self) -> PResult<Distinct>

Parse either ALL or DISTINCT or DISTINCT ON (<expr>).

source

pub fn parse_create(&mut self) -> PResult<Statement>

Parse a SQL CREATE statement

source

pub fn parse_create_schema(&mut self) -> PResult<Statement>

source

pub fn parse_create_database(&mut self) -> PResult<Statement>

source

pub fn parse_create_view( &mut self, materialized: bool, or_replace: bool, ) -> PResult<Statement>

source

pub fn parse_create_source( &mut self, _or_replace: bool, temporary: bool, ) -> PResult<Statement>

source

pub fn parse_create_sink(&mut self, _or_replace: bool) -> PResult<Statement>

source

pub fn parse_create_subscription( &mut self, _or_replace: bool, ) -> PResult<Statement>

source

pub fn parse_create_connection(&mut self) -> PResult<Statement>

source

pub fn parse_create_function( &mut self, or_replace: bool, temporary: bool, ) -> PResult<Statement>

source

fn parse_create_aggregate(&mut self, or_replace: bool) -> PResult<Statement>

source

pub fn parse_declare(&mut self) -> PResult<Statement>

source

pub fn parse_fetch_cursor(&mut self) -> PResult<Statement>

source

pub fn parse_close_cursor(&mut self) -> PResult<Statement>

source

fn parse_table_column_def(&mut self) -> PResult<TableColumnDef>

source

fn parse_function_arg(&mut self) -> PResult<OperateFunctionArg>

source

fn parse_create_function_body(&mut self) -> PResult<CreateFunctionBody>

source

fn parse_create_function_using(&mut self) -> PResult<CreateFunctionUsing>

source

fn parse_create_user(&mut self) -> PResult<Statement>

source

fn parse_create_secret(&mut self) -> PResult<Statement>

source

pub fn parse_with_properties(&mut self) -> PResult<Vec<SqlOption>>

source

pub fn parse_discard(&mut self) -> PResult<Statement>

source

pub fn parse_drop(&mut self) -> PResult<Statement>

source

fn parse_drop_function(&mut self) -> PResult<Statement>

DROP FUNCTION [ IF EXISTS ] name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ] [, ...]
[ CASCADE | RESTRICT ]
source

fn parse_drop_aggregate(&mut self) -> PResult<Statement>

DROP AGGREGATE [ IF EXISTS ] name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ] [, ...]
[ CASCADE | RESTRICT ]
source

fn parse_function_desc(&mut self) -> PResult<FunctionDesc>

source

pub fn parse_create_index(&mut self, unique: bool) -> PResult<Statement>

source

pub fn parse_with_version_column(&mut self) -> PResult<Option<String>>

source

pub fn parse_on_conflict(&mut self) -> PResult<Option<OnConflict>>

source

pub fn parse_create_table( &mut self, or_replace: bool, temporary: bool, ) -> PResult<Statement>

source

pub fn parse_include_options(&mut self) -> PResult<IncludeOption>

source

pub fn parse_columns_with_watermark( &mut self, ) -> PResult<(Vec<ColumnDef>, Vec<TableConstraint>, Vec<SourceWatermark>, Option<usize>)>

source

fn parse_column_def(&mut self) -> PResult<ColumnDef>

source

pub fn parse_optional_column_option(&mut self) -> PResult<Option<ColumnOption>>

source

pub fn parse_handle_conflict_behavior(&mut self) -> PResult<Option<OnConflict>>

source

pub fn parse_referential_action(&mut self) -> PResult<ReferentialAction>

source

pub fn parse_optional_watermark(&mut self) -> PResult<Option<SourceWatermark>>

source

pub fn parse_optional_table_constraint( &mut self, ) -> PResult<Option<TableConstraint>>

source

pub fn parse_options_with_preceding_keyword( &mut self, keyword: Keyword, ) -> PResult<Vec<SqlOption>>

source

pub fn parse_options(&mut self) -> PResult<Vec<SqlOption>>

source

pub fn parse_options_inner(&mut self) -> PResult<Vec<SqlOption>>

source

pub fn parse_sql_option(&mut self) -> PResult<SqlOption>

source

pub fn parse_since(&mut self) -> PResult<Since>

source

pub fn parse_emit_mode(&mut self) -> PResult<Option<EmitMode>>

source

pub fn parse_alter(&mut self) -> PResult<Statement>

source

pub fn parse_alter_database(&mut self) -> PResult<Statement>

source

pub fn parse_alter_schema(&mut self) -> PResult<Statement>

source

pub fn parse_alter_user(&mut self) -> PResult<Statement>

source

pub fn parse_alter_table(&mut self) -> PResult<Statement>

source

pub fn parse_alter_backfill_rate_limit(&mut self) -> PResult<Option<i32>>

BACKFILL_RATE_LIMIT = default | NUMBER BACKFILL_RATE_LIMIT TO default | NUMBER

source

pub fn parse_alter_source_rate_limit( &mut self, is_table: bool, ) -> PResult<Option<i32>>

SOURCE_RATE_LIMIT = default | NUMBER SOURCE_RATE_LIMIT TO default | NUMBER

source

pub fn parse_alter_index(&mut self) -> PResult<Statement>

source

pub fn parse_alter_view(&mut self, materialized: bool) -> PResult<Statement>

source

pub fn parse_alter_sink(&mut self) -> PResult<Statement>

source

pub fn parse_alter_subscription(&mut self) -> PResult<Statement>

source

pub fn parse_alter_source(&mut self) -> PResult<Statement>

source

pub fn parse_alter_function(&mut self) -> PResult<Statement>

source

pub fn parse_alter_connection(&mut self) -> PResult<Statement>

source

pub fn parse_alter_system(&mut self) -> PResult<Statement>

source

pub fn parse_copy(&mut self) -> PResult<Statement>

Parse a copy statement

source

fn parse_tsv(&mut self) -> Vec<Option<String>>

Parse a tab separated values in COPY payload

source

fn parse_tab_value(&mut self) -> Vec<Option<String>>

source

pub fn parse_value(&mut self) -> PResult<Value>

Parse a literal value (numbers, strings, date/time, booleans)

source

fn parse_set_variable(&mut self) -> PResult<SetVariableValue>

source

pub fn parse_number_value(&mut self) -> PResult<String>

source

pub fn parse_literal_uint(&mut self) -> PResult<u64>

Parse an unsigned literal integer/long

source

pub fn parse_function_definition(&mut self) -> PResult<FunctionDefinition>

source

pub fn parse_literal_string(&mut self) -> PResult<String>

Parse a literal string

source

pub fn parse_map_key(&mut self) -> PResult<Expr>

Parse a map key string

source

pub fn parse_data_type(&mut self) -> PResult<DataType>

Parse a SQL datatype (in the context of a CREATE TABLE statement for example)

source

pub fn parse_optional_alias( &mut self, reserved_kwds: &[Keyword], ) -> PResult<Option<Ident>>

Parse AS identifier (or simply identifier if it’s not a reserved keyword) Some examples with aliases: SELECT 1 foo, SELECT COUNT(*) AS cnt, SELECT ... FROM t1 foo, t2 bar, SELECT ... FROM (...) AS bar

source

pub fn parse_optional_table_alias( &mut self, reserved_kwds: &[Keyword], ) -> PResult<Option<TableAlias>>

Parse AS identifier when the AS is describing a table-valued object, like in ... FROM generate_series(1, 10) AS t (col). In this case the alias is allowed to optionally name the columns in the table, in addition to the table itself.

source

pub fn parse_as_of(&mut self) -> PResult<AsOf>

syntax FOR SYSTEM_TIME AS OF PROCTIME() is used for temporal join.

source

pub fn parse_object_name(&mut self) -> PResult<ObjectName>

Parse a possibly qualified, possibly quoted identifier, e.g. foo or `myschema.“table”

source

pub fn parse_identifiers_non_keywords(&mut self) -> PResult<Vec<Ident>>

Parse identifiers strictly i.e. don’t parse keywords

source

pub fn parse_identifiers(&mut self) -> PResult<Vec<Ident>>

Parse identifiers

source

pub fn parse_identifier(&mut self) -> PResult<Ident>

Parse a simple one-word identifier (possibly quoted, possibly a keyword)

source

pub fn parse_identifier_non_reserved(&mut self) -> PResult<Ident>

Parse a simple one-word identifier (possibly quoted, possibly a non-reserved keyword)

source

pub fn parse_parenthesized_column_list( &mut self, optional: IsOptional, ) -> PResult<Vec<Ident>>

Parse a parenthesized comma-separated list of unqualified, possibly quoted identifiers

source

pub fn parse_returning( &mut self, optional: IsOptional, ) -> PResult<Vec<SelectItem>>

source

pub fn parse_row_expr(&mut self) -> PResult<Expr>

source

pub fn parse_token_wrapped_exprs( &mut self, left: &Token, right: &Token, ) -> PResult<Vec<Expr>>

Parse a comma-separated list (maybe empty) from a wrapped expression

source

pub fn parse_optional_precision(&mut self) -> PResult<Option<u64>>

source

pub fn parse_optional_precision_scale( &mut self, ) -> PResult<(Option<u64>, Option<u64>)>

source

pub fn parse_delete(&mut self) -> PResult<Statement>

source

pub fn parse_optional_boolean(&mut self, default: bool) -> bool

source

pub fn parse_explain(&mut self) -> PResult<Statement>

source

pub fn parse_query(&mut self) -> PResult<Query>

Parse a query expression, i.e. a SELECT statement optionally preceded with some WITH CTE declarations and optionally followed by ORDER BY. Unlike some other parse_… methods, this one doesn’t expect the initial keyword to be already consumed

source

fn parse_cte(&mut self) -> PResult<Cte>

Parse a CTE (alias [( col1, col2, ... )] AS (subquery))

source

fn parse_cte_inner(&mut self) -> PResult<CteInner>

source

fn parse_query_body(&mut self, precedence: u8) -> PResult<SetExpr>

Parse a “query body”, which is an expression with roughly the following grammar:

  query_body ::= restricted_select | '(' subquery ')' | set_operation
  restricted_select ::= 'SELECT' [expr_list] [ from ] [ where ] [ groupby_having ]
  subquery ::= query_body [ order_by_limit ]
  set_operation ::= query_body { 'UNION' | 'EXCEPT' | 'INTERSECT' } [ 'ALL' ] query_body
source

fn parse_set_operator(&mut self, token: &Token) -> Option<SetOperator>

source

fn parse_corresponding(&mut self) -> PResult<Corresponding>

source

pub fn parse_select(&mut self) -> PResult<Select>

Parse a restricted SELECT statement (no CTEs / UNION / ORDER BY), assuming the initial SELECT was already consumed

source

pub fn parse_set(&mut self) -> PResult<Statement>

source

pub fn parse_show(&mut self) -> PResult<Statement>

If have databases,tables,columns,schemas and materialized views after show, return Statement::ShowCommand or Statement::ShowColumn, otherwise, return Statement::ShowVariable.

source

pub fn parse_cancel_job(&mut self) -> PResult<Statement>

source

pub fn parse_kill_process(&mut self) -> PResult<Statement>

source

pub fn parse_from_and_identifier(&mut self) -> PResult<Option<Ident>>

Parser from schema after show tables and show materialized views, if not conclude from then use default schema name.

source

pub fn parse_show_create(&mut self) -> PResult<Statement>

Parse object type and name after show create.

source

pub fn parse_show_statement_filter( &mut self, ) -> PResult<Option<ShowStatementFilter>>

source

pub fn parse_table_and_joins(&mut self) -> PResult<TableWithJoins>

source

pub fn parse_table_factor(&mut self) -> PResult<TableFactor>

A table name or a parenthesized subquery, followed by optional [AS] alias

source

pub fn parse_derived_table_factor( &mut self, lateral: IsLateral, ) -> PResult<TableFactor>

source

fn parse_join_constraint(&mut self, natural: bool) -> PResult<JoinConstraint>

source

pub fn parse_grant(&mut self) -> PResult<Statement>

Parse a GRANT statement.

source

fn parse_grant_revoke_privileges_objects( &mut self, ) -> PResult<(Privileges, GrantObjects)>

source

fn parse_grant_permission(&mut self) -> PResult<(Keyword, Option<Vec<Ident>>)>

source

pub fn parse_revoke(&mut self) -> PResult<Statement>

Parse a REVOKE statement

source

pub fn parse_insert(&mut self) -> PResult<Statement>

Parse an INSERT statement

source

pub fn parse_update(&mut self) -> PResult<Statement>

source

pub fn parse_assignment(&mut self) -> PResult<Assignment>

Parse a var = expr assignment, used in an UPDATE statement

source

fn parse_function_args(&mut self) -> PResult<(bool, FunctionArg)>

Parse a [VARIADIC] name => expr.

source

pub fn parse_argument_list(&mut self) -> PResult<FunctionArgList>

source

pub fn parse_select_item(&mut self) -> PResult<SelectItem>

Parse a comma-delimited list of projections after SELECT

source

pub fn parse_order_by_expr(&mut self) -> PResult<OrderByExpr>

Parse an expression, optionally followed by ASC or DESC (used in ORDER BY)

source

pub fn parse_limit(&mut self) -> PResult<Option<String>>

Parse a LIMIT clause

source

pub fn parse_offset(&mut self) -> PResult<String>

Parse an OFFSET clause

source

pub fn parse_fetch(&mut self) -> PResult<Fetch>

Parse a FETCH clause

source

pub fn parse_values(&mut self) -> PResult<Values>

source

pub fn parse_start_transaction(&mut self) -> PResult<Statement>

source

pub fn parse_begin(&mut self) -> PResult<Statement>

source

pub fn parse_transaction_modes(&mut self) -> PResult<Vec<TransactionMode>>

source

pub fn parse_commit(&mut self) -> PResult<Statement>

source

pub fn parse_rollback(&mut self) -> PResult<Statement>

source

pub fn parse_commit_rollback_chain(&mut self) -> PResult<bool>

source

fn parse_deallocate(&mut self) -> PResult<Statement>

source

fn parse_execute(&mut self) -> PResult<Statement>

source

fn parse_prepare(&mut self) -> PResult<Statement>

source

fn parse_comment(&mut self) -> PResult<Statement>

Trait Implementations§

source§

impl<'a> Clone for Parser<'a>

source§

fn clone(&self) -> Parser<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Parser<'_>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Default for Parser<'a>

source§

fn default() -> Parser<'a>

Returns the “default value” for a type. Read more
source§

impl<'a> Offset<CheckpointWrapper<'a>> for Parser<'a>

source§

fn offset_from(&self, start: &CheckpointWrapper<'a>) -> usize

Offset between the first byte of start and the first byte of selfa Read more
source§

impl<'a> Offset for Parser<'a>

source§

fn offset_from(&self, start: &Self) -> usize

Offset between the first byte of start and the first byte of selfa Read more
source§

impl<'a> ParseV1 for Parser<'a>

source§

fn parse_v1<F, O>(&mut self, f: F) -> PResult<O>
where F: FnOnce(&mut Parser<'a>) -> PResult<O>,

source§

impl SliceLen for Parser<'_>

source§

fn slice_len(&self) -> usize

Calculates the input length, as indicated by its name, and the name of the trait itself
source§

impl<'a> Stream for Parser<'a>

source§

type Checkpoint = CheckpointWrapper<'a>

A parse location within the stream
source§

type IterOffsets = <&'a [TokenWithLocation] as Stream>::IterOffsets

Iterate with the offset from the current location
source§

type Slice = Parser<'a>

Sequence of Tokens Read more
source§

type Token = <&'a [TokenWithLocation] as Stream>::Token

The smallest unit being parsed Read more
source§

fn iter_offsets(&self) -> Self::IterOffsets

Iterate with the offset from the current location
source§

fn eof_offset(&self) -> usize

Returns the offset to the end of the input
source§

fn next_token(&mut self) -> Option<Self::Token>

Split off the next token from the input
source§

fn offset_for<P>(&self, predicate: P) -> Option<usize>
where P: Fn(Self::Token) -> bool,

Finds the offset of the next matching token
source§

fn offset_at(&self, tokens: usize) -> Result<usize, Needed>

Get the offset for the number of tokens into the stream Read more
source§

fn next_slice(&mut self, offset: usize) -> Self::Slice

Split off a slice of tokens from the input Read more
source§

fn checkpoint(&self) -> Self::Checkpoint

Save the current parse location within the stream
source§

fn reset(&mut self, checkpoint: &Self::Checkpoint)

Revert the stream to a prior [Self::Checkpoint] Read more
source§

fn raw(&self) -> &dyn Debug

Return the inner-most stream
§

fn peek_token(&self) -> Option<(Self, Self::Token)>
where Self: Clone,

Split off the next token from the input
§

fn peek_slice(&self, offset: usize) -> (Self, Self::Slice)
where Self: Clone,

Split off a slice of tokens from the input
§

fn finish(&mut self) -> Self::Slice

Advance to the end of the stream
§

fn peek_finish(&self) -> (Self, Self::Slice)
where Self: Clone,

Advance to the end of the stream
source§

impl<'a> StreamIsPartial for Parser<'a>

source§

type PartialState = <&'a [TokenWithLocation] as StreamIsPartial>::PartialState

Whether the stream is currently partial or complete
source§

fn complete(&mut self) -> Self::PartialState

Mark the stream is complete
source§

fn restore_partial(&mut self, state: Self::PartialState)

Restore the stream back to its previous state
source§

fn is_partial_supported() -> bool

Report whether the [Stream] is can ever be incomplete
§

fn is_partial(&self) -> bool

Report whether the [Stream] is currently incomplete
source§

impl UpdateSlice for Parser<'_>

source§

fn update_slice(self, inner: Self::Slice) -> Self

Convert an Output type to be used as Stream
source§

impl<'a> Copy for Parser<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Parser<'a>

§

impl<'a> RefUnwindSafe for Parser<'a>

§

impl<'a> Send for Parser<'a>

§

impl<'a> Sync for Parser<'a>

§

impl<'a> Unpin for Parser<'a>

§

impl<'a> UnwindSafe for Parser<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<S> TokenStream for S
where S: Stream<Token = TokenWithLocation> + StreamIsPartial + Default + ParseV1,