Represents a scanner. More...
#include <parser.h>
Data Fields | |
int | line |
const char * | start |
const char * | consume |
const char * | current |
const char * | message |
const char * | sync |
Represents a scanner.
The scanner structure is used for scanning and tokenizing input text.
The scanning process is performed using two pointers, consume
and current
, which need to be kept separate. While current
reads from the input and checks if the character sequence is correct, consume
remains pointing to the beginning of the portion being verified. This eliminates the need to split the input into pieces and allows for precise identification of the section of input that needs to be converted.
line | Stores the line number being read. |
start | A pointer to the first character of the line. |
consume | A pointer passed to the number conversion functions. |
current | A pointer used for reading character by character. |
message | A pointer to the current error message, if any. |