Static$gtypeReturns the current line in the input stream (counting
from 1). This is the line of the last token parsed via
g_scanner_get_next_token().
the current line
Returns the current position in the current line (counting
from 0). This is the position of the last token parsed via
g_scanner_get_next_token().
the current position on the line
Gets the current token type. This is simply the token
field in the GLib.Scanner structure.
the current token type
Frees all memory used by the GLib.Scanner.
Returns true if the scanner has reached the end of
the file or text buffer.
true if the scanner has reached the end of the file or text buffer
Parses the next token just like g_scanner_peek_next_token()
and also removes it from the input stream. The token data is
placed in the token, value, line, and position fields of
the GLib.Scanner structure.
the type of the token
Prepares to scan a file.
a file descriptor
Prepares to scan a text buffer.
the text buffer to scan
the length of the text buffer
Looks up a symbol in the current scope and return its value.
If the symbol is not bound in the current scope, null is
returned.
the symbol to look up
the value of symbol in the current scope, or null if symbol is not bound in the current scope
Parses the next token, without removing it from the input stream.
The token data is placed in the next_token, next_value, next_line,
and next_position fields of the GLib.Scanner structure.
Note that, while the token is not removed from the input stream
(i.e. the next call to g_scanner_get_next_token() will return the
same token), it will not be reevaluated. This can lead to surprising
results when changing scope or the scanner configuration after peeking
the next token. Getting the next token after switching the scope or
configuration will return whatever was peeked before, regardless of
any symbols that may have been added or removed in the new scope.
the type of the token
Adds a symbol to the given scope.
the scope id
the symbol to add
Optionalvalue: anythe value of the symbol
Calls the given function for each of the symbol/value pairs
in the given scope of the GLib.Scanner. The function is passed
the symbol and value of each pair, and the given user_data
parameter.
the scope id
the function to call for each symbol/value pair
Looks up a symbol in a scope and return its value. If the
symbol is not bound in the scope, null is returned.
the scope id
the symbol to look up
the value of symbol in the given scope, or null if symbol is not bound in the given scope.
Removes a symbol from a scope.
the scope id
the symbol to remove
Sets the current scope.
the new scope id
the old scope id
Rewinds the filedescriptor to the current buffer position and blows the file read ahead buffer. This is useful for third party uses of the scanners filedescriptor, which hooks onto the current scanning position.
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.
the expected token
a string describing how the scanner's user refers to identifiers (null defaults to "identifier"). This is used if expected_token is GLib.TokenType.IDENTIFIER or GLib.TokenType.IDENTIFIER_NULL.
a string describing how the scanner's user refers to symbols (null defaults to "symbol"). This is used if expected_token is GLib.TokenType.SYMBOL or any token value greater than G_TOKEN_LAST.
the name of the symbol, if the scanner's current token is a symbol.
a message string to output at the end of the warning/error, or null.
if true it is output as an error. If false it is output as a warning.
GLib.Scanner provides a general-purpose lexical scanner.
You should set
input_nameafter 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_dataandmax_parse_errorsfields 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_handlerfield. The type of the message handler function is declared by GLib.ScannerMsgFunc.