Function rcl_lexer_lookahead2_peek

Function Documentation

rcl_ret_t rcl_lexer_lookahead2_peek(rcl_lexer_lookahead2_t *buffer, rcl_lexeme_t *next_type)

Look ahead at the next lexeme in the string.

Repeated calls to peek will return the same lexeme. A parser that deems the next lexeme as valid must accept it to advance lexing.

Attribute

Adherence

Allocates Memory

Yes [1]

Thread-Safe

No

Uses Atomics

No

Lock-Free

Yes

[1] Only allocates if an argument is invalid or an internal bug is detected.

Parameters:
  • buffer[in] the lookahead2 buffer being used to analyze a string.

  • next_type[out] an output variable for the next lexeme in the string.

Returns:

RCL_RET_OK if peeking was successfull, or

Returns:

RCL_RET_INVALID_ARGUMENT if any function arguments are invalid, or

Returns:

RCL_RET_ERROR if an unspecified error occurs.