Function rcl_lexer_lookahead2_accept

Function Documentation

rcl_ret_t rcl_lexer_lookahead2_accept(rcl_lexer_lookahead2_t *buffer, const char **lexeme_text, size_t *lexeme_text_length)

Accept a lexeme and advance analysis.

A token must have been peeked before it can be accepted.

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 error occurs.

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

  • lexeme_text[out] pointer to where lexeme begins in string.

  • lexeme_text_length[out] length of lexeme_text.

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.