stb_c_lexer_get_location function

  1. @Native<Void Function(Pointer<stb_lexer>, Pointer<Char>, Pointer<stb_lex_location>)>(ffi.Pointer<stb_lexer>, ffi.Pointer<ffi.Char>, ffi.Pointer<stb_lex_location>)>()
void stb_c_lexer_get_location(
  1. Pointer<stb_lexer> lexer,
  2. Pointer<Char> where,
  3. Pointer<stb_lex_location> loc
)

this function returns non-zero if a token is parsed, or 0 if at EOF Output:

  • lexer->token is the token ID, which is unicode code point for a single-char token, < 0 for a multichar or eof or error
  • lexer->real_number is a double constant value for CLEX_floatlit, or CLEX_intlit if STB_C_LEX_INTEGERS_AS_DOUBLES
  • lexer->int_number is an integer constant for CLEX_intlit if !STB_C_LEX_INTEGERS_AS_DOUBLES, or character for CLEX_charlit
  • lexer->string is a 0-terminated string for CLEX_dqstring or CLEX_sqstring or CLEX_identifier
  • lexer->string_len is the byte length of lexer->string

Implementation

@ffi.Native<
  ffi.Void Function(
    ffi.Pointer<stb_lexer>,
    ffi.Pointer<ffi.Char>,
    ffi.Pointer<stb_lex_location>,
  )
>()
external void stb_c_lexer_get_location(
  ffi.Pointer<stb_lexer> lexer,
  ffi.Pointer<ffi.Char> where,
  ffi.Pointer<stb_lex_location> loc,
);