📄 scanner.sgml
字号:
@scanner: a #GScanner.@Returns: the current position on the line.<!-- ##### FUNCTION g_scanner_cur_token ##### --><para>Gets the current token type.This is simply the <structfield>token</structfield> field in the #GScannerstructure.</para>@scanner: a #GScanner.@Returns: the current token type.<!-- ##### FUNCTION g_scanner_cur_value ##### --><para>Gets the current token value.This is simply the <structfield>value</structfield> field in the #GScannerstructure.</para>@scanner: a #GScanner.@Returns: the current token value.<!-- ##### FUNCTION g_scanner_eof ##### --><para>Returns %TRUE if the scanner has reached the end of the file or text buffer.</para>@scanner: a #GScanner.@Returns: %TRUE if the scanner has reached the end of the file or text buffer.<!-- ##### FUNCTION g_scanner_set_scope ##### --><para>Sets the current scope.</para>@scanner: a #GScanner.@scope_id: the new scope id.@Returns: the old scope id.<!-- ##### FUNCTION g_scanner_scope_add_symbol ##### --><para>Adds a symbol to the given scope.</para>@scanner: a #GScanner.@scope_id: the scope id.@symbol: the symbol to add.@value: the value of the symbol.<!-- ##### FUNCTION g_scanner_scope_foreach_symbol ##### --><para>Calls the given function for each of the symbol/value pairs in the given scope of the #GScanner. The function is passed the symbol and value of each pair, and the given @user_data parameter.</para>@scanner: a #GScanner.@scope_id: the scope id.@func: the function to call for each symbol/value pair.@user_data: user data to pass to the function.<!-- ##### FUNCTION g_scanner_scope_lookup_symbol ##### --><para>Looks up a symbol in a scope and return its value. If thesymbol is not bound in the scope, %NULL is returned.</para>@scanner: a #GScanner.@scope_id: the scope id.@symbol: the symbol to look up.@Returns: the value of @symbol in the given scope, or %NULLif @symbol is not bound in the given scope.<!-- ##### FUNCTION g_scanner_scope_remove_symbol ##### --><para>Removes a symbol from a scope.</para>@scanner: a #GScanner.@scope_id: the scope id.@symbol: the symbol to remove.<!-- ##### MACRO g_scanner_freeze_symbol_table ##### --><para>This function is deprecated and will be removed in the next majorrelease of GLib. It does nothing.</para>@scanner: a #GScanner.<!-- ##### MACRO g_scanner_thaw_symbol_table ##### --><para>This function is deprecated and will be removed in the next majorrelease of GLib. It does nothing.</para>@scanner: a #GScanner.<!-- ##### FUNCTION g_scanner_lookup_symbol ##### --><para>Looks up a symbol in the current scope and return its value. If thesymbol is not bound in the current scope, %NULL is returned.</para>@scanner: a #GScanner.@symbol: the symbol to look up.@Returns: the value of @symbol in the current scope, or %NULLif @symbol is not bound in the current scope.<!-- ##### FUNCTION g_scanner_warn ##### --><para>Outputs a warning message, via the #GScanner message handler.</para>@scanner: a #GScanner.@format: the message format. See the <function>printf()</function>documentation.@Varargs: the parameters to insert into the format string.<!-- ##### FUNCTION g_scanner_error ##### --><para>Outputs an error message, via the #GScanner message handler.</para>@scanner: a #GScanner.@format: the message format. See the <function>printf()</function>documentation.@Varargs: the parameters to insert into the format string.<!-- ##### FUNCTION g_scanner_unexp_token ##### --><para>Outputs a message resulting from an unexpected token in the input stream.</para>@scanner: a #GScanner.@expected_token: the expected token.@identifier_spec: a string describing the expected type of identifier, or %NULL to use the default "identifier" string. This is used if @expected_token is #G_TOKEN_IDENTIFIER or #G_TOKEN_IDENTIFIER_NULL.@symbol_spec: a string describing the expected type of symbol, or %NULL to use the default "symbol" string. This is used if @expected_token is #G_TOKEN_SYMBOL.@symbol_name: the name of the expected symbol. This is used if @expected_token is #G_TOKEN_SYMBOL.@message: a message string to output at the end of the warning/error, or %NULL.@is_error: if %TRUE it is output as an error. If %FALSE it is output as awarning.<!-- ##### USER_FUNCTION GScannerMsgFunc ##### --><para>Specifies the type of the message handler function.</para>@scanner: a #GScanner.@message: the message.@error: %TRUE if the message signals an error, %FALSE if it signals a warning.<!-- ##### FUNCTION g_scanner_destroy ##### --><para>Frees all memory used by the #GScanner.</para>@scanner: a #GScanner.<!-- ##### ENUM GTokenType ##### --><para>The possible types of token returned from each g_scanner_get_next_token() call.</para>@G_TOKEN_EOF: the end of the file.@G_TOKEN_LEFT_PAREN: a '(' character.@G_TOKEN_LEFT_CURLY: a '{' character.@G_TOKEN_RIGHT_CURLY: a '}' character.<!-- ##### UNION GTokenValue ##### --><para>A union holding the value of the token.</para><!-- ##### ENUM GErrorType ##### --><para>The possible errors, used in the <structfield>v_error</structfield> fieldof #GTokenValue, when the token is a #G_TOKEN_ERROR.</para>@G_ERR_UNKNOWN: unknown error.@G_ERR_UNEXP_EOF: unexpected end of file.@G_ERR_UNEXP_EOF_IN_STRING: unterminated string constant.@G_ERR_UNEXP_EOF_IN_COMMENT: unterminated comment.@G_ERR_NON_DIGIT_IN_CONST: non-digit character in a number.@G_ERR_DIGIT_RADIX: digit beyond radix in a number.@G_ERR_FLOAT_RADIX: non-decimal floating point number.@G_ERR_FLOAT_MALFORMED: malformed floating point number.<!-- ##### MACRO G_CSET_a_2_z ##### --><para>The set of lowercase ASCII alphabet characters.Used for specifying valid identifier characters in #GScannerConfig.</para><!-- ##### MACRO G_CSET_A_2_Z ##### --><para>The set of uppercase ASCII alphabet characters.Used for specifying valid identifier characters in #GScannerConfig.</para><!-- ##### MACRO G_CSET_DIGITS ##### --><para>The set of digits.Used for specifying valid identifier characters in #GScannerConfig.</para><!-- ##### MACRO G_CSET_LATINC ##### --><para>The set of uppercase ISO 8859-1 alphabet characters which are not ASCII characters. Used for specifying valid identifier characters in #GScannerConfig.</para><!-- ##### MACRO G_CSET_LATINS ##### --><para>The set of lowercase ISO 8859-1 alphabet characters which are not ASCII characters. Used for specifying valid identifier characters in #GScannerConfig.</para><!-- ##### MACRO g_scanner_add_symbol ##### --><para>Adds a symbol to the default scope.Deprecated in favour of g_scanner_scope_add_symbol().</para>@scanner: a #GScanner.@symbol: the symbol to add.@value: the value of the symbol.<!-- ##### MACRO g_scanner_remove_symbol ##### --><para>Removes a symbol from the default scope.Deprecated in favour of g_scanner_scope_remove_symbol().</para>@scanner: a #GScanner.@symbol: the symbol to remove.<!-- ##### MACRO g_scanner_foreach_symbol ##### --><para>Calls a function for each symbol in the default scope.Deprecated in favour of g_scanner_scope_foreach_symbol().</para>@scanner: a #GScanner.@func: the function to call with each symbol.@data: data to pass to the function.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -