librdesc
Loading...
Searching...
No Matches
Public Attributes | List of all members
exblex Struct Reference

EXtremely Basic LEXer. More...

#include <exblex.h>

Public Attributes

const char * buf
 Underlying null-terminated input buffer.
 
const char * tokens
 Array of token characters.
 
size_t token_count
 Number of tokens in provided array.
 
size_t cur
 (current) Position in the buffer.
 

Detailed Description

EXtremely Basic LEXer.

A lightweight lexer designed for internal tests. It ignores whitespace and tokenizes the input based on three categories:

  1. Words (w): Matches identifiers consisting of alphanumeric characters and underscores ([a-zA-Z0-9_]).
  2. Digits (d): Matches integer literals consisting of numeric digits ([0-9]).
  3. One-Character Punctuation: Matches single-character symbols provided in the lookup table (e.g., +, *, ;).
Note
The lexer gives precedence to character classes (w, d). If a character does not fit into these classes, it is checked against the tokens table.
Identifier 0 is reserved in exblex.

The documentation for this struct was generated from the following file: