📄 scanner.sgml
字号:
<colspec colwidth="8*"><tbody><row><entry align="right"><parameter>scanner</parameter> :</entry><entry>a <link linkend="GScanner">GScanner</link>.</entry></row><row><entry align="right"><parameter>scope_id</parameter> :</entry><entry>the scope id.</entry></row><row><entry align="right"><parameter>symbol</parameter> :</entry><entry>the symbol to add.</entry></row><row><entry align="right"><parameter>value</parameter> :</entry><entry>the value of the symbol.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-scanner-scope-foreach-symbol">g_scanner_scope_foreach_symbol ()</title><programlisting>void g_scanner_scope_foreach_symbol (<link linkend="GScanner">GScanner</link> *scanner, <link linkend="guint">guint</link> scope_id, <link linkend="GHFunc">GHFunc</link> func, <link linkend="gpointer">gpointer</link> user_data);</programlisting><para>Calls the given function for each of the symbol/value pairs in the given scope of the <link linkend="GScanner">GScanner</link>. The function is passed the symbol and value of each pair, and the given <parameter>user_data</parameter> parameter.</para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>scanner</parameter> :</entry><entry>a <link linkend="GScanner">GScanner</link>.</entry></row><row><entry align="right"><parameter>scope_id</parameter> :</entry><entry>the scope id.</entry></row><row><entry align="right"><parameter>func</parameter> :</entry><entry>the function to call for each symbol/value pair.</entry></row><row><entry align="right"><parameter>user_data</parameter> :</entry><entry>user data to pass to the function.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-scanner-scope-lookup-symbol">g_scanner_scope_lookup_symbol ()</title><programlisting><link linkend="gpointer">gpointer</link> g_scanner_scope_lookup_symbol (<link linkend="GScanner">GScanner</link> *scanner, <link linkend="guint">guint</link> scope_id, const <link linkend="gchar">gchar</link> *symbol);</programlisting><para>Looks up a symbol in a scope and return its value. If thesymbol is not bound in the scope, <literal>NULL</literal> is returned.</para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>scanner</parameter> :</entry><entry>a <link linkend="GScanner">GScanner</link>.</entry></row><row><entry align="right"><parameter>scope_id</parameter> :</entry><entry>the scope id.</entry></row><row><entry align="right"><parameter>symbol</parameter> :</entry><entry>the symbol to look up.</entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the value of <parameter>symbol</parameter> in the given scope, or <literal>NULL</literal>if <parameter>symbol</parameter> is not bound in the given scope.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-scanner-scope-remove-symbol">g_scanner_scope_remove_symbol ()</title><programlisting>void g_scanner_scope_remove_symbol (<link linkend="GScanner">GScanner</link> *scanner, <link linkend="guint">guint</link> scope_id, const <link linkend="gchar">gchar</link> *symbol);</programlisting><para>Removes a symbol from a scope.</para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>scanner</parameter> :</entry><entry>a <link linkend="GScanner">GScanner</link>.</entry></row><row><entry align="right"><parameter>scope_id</parameter> :</entry><entry>the scope id.</entry></row><row><entry align="right"><parameter>symbol</parameter> :</entry><entry>the symbol to remove.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-scanner-freeze-symbol-table">g_scanner_freeze_symbol_table()</title><programlisting>#define g_scanner_freeze_symbol_table(scanner)</programlisting><warning><para><literal>g_scanner_freeze_symbol_table</literal> is deprecated and should not be used in newly-written code.</para></warning><para>This function is deprecated and will be removed in the next majorrelease of GLib. It does nothing.</para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>scanner</parameter> :</entry><entry>a <link linkend="GScanner">GScanner</link>.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-scanner-thaw-symbol-table">g_scanner_thaw_symbol_table()</title><programlisting>#define g_scanner_thaw_symbol_table(scanner)</programlisting><warning><para><literal>g_scanner_thaw_symbol_table</literal> is deprecated and should not be used in newly-written code.</para></warning><para>This function is deprecated and will be removed in the next majorrelease of GLib. It does nothing.</para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>scanner</parameter> :</entry><entry>a <link linkend="GScanner">GScanner</link>.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-scanner-lookup-symbol">g_scanner_lookup_symbol ()</title><programlisting><link linkend="gpointer">gpointer</link> g_scanner_lookup_symbol (<link linkend="GScanner">GScanner</link> *scanner, const <link linkend="gchar">gchar</link> *symbol);</programlisting><para>Looks up a symbol in the current scope and return its value. If thesymbol is not bound in the current scope, <literal>NULL</literal> is returned.</para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>scanner</parameter> :</entry><entry>a <link linkend="GScanner">GScanner</link>.</entry></row><row><entry align="right"><parameter>symbol</parameter> :</entry><entry>the symbol to look up.</entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the value of <parameter>symbol</parameter> in the current scope, or <literal>NULL</literal>if <parameter>symbol</parameter> is not bound in the current scope.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-scanner-warn">g_scanner_warn ()</title><programlisting>void g_scanner_warn (<link linkend="GScanner">GScanner</link> *scanner, const <link linkend="gchar">gchar</link> *format, ...);</programlisting><para>Outputs a warning message, via the <link linkend="GScanner">GScanner</link> message handler.</para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>scanner</parameter> :</entry><entry>a <link linkend="GScanner">GScanner</link>.</entry></row><row><entry align="right"><parameter>format</parameter> :</entry><entry>the message format. See the <function>printf()</function>documentation.</entry></row><row><entry align="right"><parameter>...</parameter> :</entry><entry>the parameters to insert into the format string.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-scanner-error">g_scanner_error ()</title><programlisting>void g_scanner_error (<link linkend="GScanner">GScanner</link> *scanner, const <link linkend="gchar">gchar</link> *format, ...);</programlisting><para>Outputs an error message, via the <link linkend="GScanner">GScanner</link> message handler.</para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>scanner</parameter> :</entry><entry>a <link linkend="GScanner">GScanner</link>.</entry></row><row><entry align="right"><parameter>format</parameter> :</entry><entry>the message format. See the <function>printf()</function>documentation.</entry></row><row><entry align="right"><parameter>...</parameter> :</entry><entry>the parameters to insert into the format string.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-scanner-unexp-token">g_scanner_unexp_token ()</title><programlisting>void g_scanner_unexp_token (<link linkend="GScanner">GScanner</link> *scanner, <link linkend="GTokenType">GTokenType</link> expected_token, const <link linkend="gchar">gchar</link> *identifier_spec, const <link linkend="gchar">gchar</link> *symbol_spec, const <link linkend="gchar">gchar</link> *symbol_name, const <link linkend="gchar">gchar</link> *message, <link linkend="gint">gint</link> is_error);</programlisting><para>Outputs a message resulting from an unexpected token in the input stream.</para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>scanner</parameter> :</entry><entry>a <link linkend="GScanner">GScanner</link>.</entry></row><row><entry align="right"><parameter>expected_token</parameter> :</entry><entry>the expected token.</entry></row><row><entry align="right"><parameter>identifier_spec</parameter> :</entry><entry>a string describing the expected type of identifier, or <literal>NULL</literal> to use the default "identifier" string. This is used if <parameter>expected_token</parameter> is <link linkend="G-TOKEN-IDENTIFIER-CAPS">G_TOKEN_IDENTIFIER</link> or <link linkend="G-TOKEN-IDENTIFIER-NULL-CAPS">G_TOKEN_IDENTIFIER_NULL</link>.</entry></row><row><entry align="right"><parameter>symbol_spec</parameter> :</entry><entry>a string describing the expected type of symbol, or <literal>NULL</literal> to use the default "symbol" string. This is used if <parameter>expected_token</parameter> is <link linkend="G-TOKEN-SYMBOL-CAPS">G_TOKEN_SYMBOL</link>.</entry></row><row><entry align="right"><parameter>symbol_name</parameter> :</entry><entry>the name of the expected symbol. This is used if <parameter>expected_token</parameter> is <link linkend="G-TOKEN-SYMBOL-CAPS">G_TOKEN_SYMBOL</link>.</entry></row><row><entry align="right"><parameter>message</parameter> :</entry><entry>a message string to output at the end of the warning/error, or <literal>NULL</literal>.</entry></row><row><entry align="right"><parameter>is_error</parameter> :</entry><entry>if <literal>TRUE</literal> it is output as an error. If <literal>FALSE</literal> it is output as awarning.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="GScannerMsgFunc">GScannerMsgFunc ()</title><programlisting>void (*GScannerMsgFunc) (<link linkend="GScanner">GScanner</link> *scanner, <link linkend="gchar">gchar</link> *message, <link linkend="gboolean">gboolean</link> error);</programlisting><para>Specifies the type of the message handler function.</para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>scanner</parameter> :</entry><entry>a <link linkend="GScanner">GScanner</link>.</entry></row><row><entry align="right"><parameter>message</parameter> :</entry><entry>the message.</entry></row><row><entry align="right"><parameter>error</parameter> :</entry><entry><literal>TRUE</literal> if the message signals an error, <literal>FALSE</literal> if it signals a warning.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-scanner-destroy">g_scanner_destroy ()</title><programlisting>void g_scanner_destroy (<link linkend="GScanner">GScanner</link> *scanner);</programlisting><para>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -