ScannerG.unexpToken

Outputs a message through the scanner's msg_handler, resulting from an unexpected token in the input stream. Note that you should not call g_scanner_peek_next_token() followed by g_scanner_unexp_token() without an intermediate call to g_scanner_get_next_token(), as g_scanner_unexp_token() evaluates the scanner's current token (not the peeked token) to construct part of the message.

class ScannerG
void
unexpToken

Parameters

expectedToken GTokenType

the expected token

identifierSpec string

a string describing how the scanner's user refers to identifiers (%NULL defaults to "identifier"). This is used if @expected_token is %G_TOKEN_IDENTIFIER or %G_TOKEN_IDENTIFIER_NULL.

symbolSpec string

a string describing how the scanner's user refers to symbols (%NULL defaults to "symbol"). This is used if @expected_token is %G_TOKEN_SYMBOL or any token value greater than %G_TOKEN_LAST.

symbolName string

the name of the symbol, if the scanner's current token is a symbol.

message string

a message string to output at the end of the warning/error, or %NULL.

isError int

if %TRUE it is output as an error. If %FALSE it is output as a warning.

Meta