GScanner

glib.scanner.Scanner provides a general-purpose lexical scanner.

You should set @input_name after creating the scanner, since it is used by the default message handler when displaying warnings and errors. If you are scanning a file, the filename would be a good choice.

The @user_data and @max_parse_errors fields are not used. If you need to associate extra data with the scanner you can place them here.

If you want to use your own message handler you can set the @msg_handler field. The type of the message handler function is declared by #GScannerMsgFunc.

Members

Variables

buffer
char* buffer;
config
GScannerConfig* config;

link into the scanner configuration

inputFd
int inputFd;
inputName
const(char)* inputName;

name of input stream, featured by the default message handler

line
uint line;

line number of the last token from glib.scanner.Scanner.getNextToken

maxParseErrors
uint maxParseErrors;

unused

msgHandler
GScannerMsgFunc msgHandler;

handler function for _warn and _error

nextLine
uint nextLine;

line number of the last token from glib.scanner.Scanner.peekNextToken

nextPosition
uint nextPosition;

char number of the last token from glib.scanner.Scanner.peekNextToken

nextToken
GTokenType nextToken;

token parsed by the last glib.scanner.Scanner.peekNextToken

nextValue
GTokenValue nextValue;

value of the last token from glib.scanner.Scanner.peekNextToken

parseErrors
uint parseErrors;

glib.scanner.Scanner.error increments this field

position
uint position;

char number of the last token from glib.scanner.Scanner.getNextToken

qdata
GData* qdata;

quarked data

scopeId
uint scopeId;
symbolTable
GHashTable* symbolTable;
text
const(char)* text;
textEnd
const(char)* textEnd;
token
GTokenType token;

token parsed by the last glib.scanner.Scanner.getNextToken

userData
void* userData;

unused

value
GTokenValue value;

value of the last token from glib.scanner.Scanner.getNextToken