/src/wrappers/glib/library/utilities/glib_lexical_scanner.e

http://github.com/tybor/Liberty · Specman e · 800 lines · 2 code · 247 blank · 551 comment · 0 complexity · 968946d95ca8f81b334a49d863075d14 MD5 · raw file

  1. deferred class GLIB_LEXICAL_SCANNER
  2. -- Lexical Scanner
  3. -- Lexical Scanner -- a general purpose lexical scanner.
  4. -- Synopsis
  5. -- #include <glib.h>
  6. -- GScanner;
  7. -- GScanner* g_scanner_new (const GScannerConfig *config_templ);
  8. -- GScannerConfig;
  9. -- void g_scanner_input_file (GScanner *scanner,
  10. -- gint input_fd);
  11. -- void g_scanner_sync_file_offset (GScanner *scanner);
  12. -- void g_scanner_input_text (GScanner *scanner,
  13. -- const gchar *text,
  14. -- guint text_len);
  15. -- GTokenType g_scanner_peek_next_token (GScanner *scanner);
  16. -- GTokenType g_scanner_get_next_token (GScanner *scanner);
  17. -- guint g_scanner_cur_line (GScanner *scanner);
  18. -- guint g_scanner_cur_position (GScanner *scanner);
  19. -- GTokenType g_scanner_cur_token (GScanner *scanner);
  20. -- GTokenValue g_scanner_cur_value (GScanner *scanner);
  21. -- gboolean g_scanner_eof (GScanner *scanner);
  22. -- guint g_scanner_set_scope (GScanner *scanner,
  23. -- guint scope_id);
  24. -- void g_scanner_scope_add_symbol (GScanner *scanner,
  25. -- guint scope_id,
  26. -- const gchar *symbol,
  27. -- gpointer value);
  28. -- void g_scanner_scope_foreach_symbol (GScanner *scanner,
  29. -- guint scope_id,
  30. -- GHFunc func,
  31. -- gpointer user_data);
  32. -- gpointer g_scanner_scope_lookup_symbol (GScanner *scanner,
  33. -- guint scope_id,
  34. -- const gchar *symbol);
  35. -- void g_scanner_scope_remove_symbol (GScanner *scanner,
  36. -- guint scope_id,
  37. -- const gchar *symbol);
  38. -- #define g_scanner_freeze_symbol_table (scanner)
  39. -- #define g_scanner_thaw_symbol_table (scanner)
  40. -- gpointer g_scanner_lookup_symbol (GScanner *scanner,
  41. -- const gchar *symbol);
  42. -- void g_scanner_warn (GScanner *scanner,
  43. -- const gchar *format,
  44. -- ...);
  45. -- void g_scanner_error (GScanner *scanner,
  46. -- const gchar *format,
  47. -- ...);
  48. -- void g_scanner_unexp_token (GScanner *scanner,
  49. -- GTokenType expected_token,
  50. -- const gchar *identifier_spec,
  51. -- const gchar *symbol_spec,
  52. -- const gchar *symbol_name,
  53. -- const gchar *message,
  54. -- gint is_error);
  55. -- void (*GScannerMsgFunc) (GScanner *scanner,
  56. -- gchar *message,
  57. -- gboolean error);
  58. -- void g_scanner_destroy (GScanner *scanner);
  59. -- enum GTokenType;
  60. -- union GTokenValue;
  61. -- enum GErrorType;
  62. -- #define G_CSET_a_2_z
  63. -- #define G_CSET_A_2_Z
  64. -- #define G_CSET_DIGITS
  65. -- #define G_CSET_LATINC
  66. -- #define G_CSET_LATINS
  67. -- #define g_scanner_add_symbol ( scanner, symbol, value )
  68. -- #define g_scanner_remove_symbol ( scanner, symbol )
  69. -- #define g_scanner_foreach_symbol ( scanner, func, data )
  70. -- Description
  71. -- The GScanner and its associated functions provide a general purpose lexical
  72. -- scanner.
  73. -- Details
  74. -- GScanner
  75. -- typedef struct {
  76. -- /* unused fields */
  77. -- gpointer user_data;
  78. -- guint max_parse_errors;
  79. -- /* g_scanner_error() increments this field */
  80. -- guint parse_errors;
  81. -- /* name of input stream, featured by the default message handler */
  82. -- const gchar *input_name;
  83. -- /* quarked data */
  84. -- GData *qdata;
  85. -- /* link into the scanner configuration */
  86. -- GScannerConfig *config;
  87. -- /* fields filled in after g_scanner_get_next_token() */
  88. -- GTokenType token;
  89. -- GTokenValue value;
  90. -- guint line;
  91. -- guint position;
  92. -- /* fields filled in after g_scanner_peek_next_token() */
  93. -- GTokenType next_token;
  94. -- GTokenValue next_value;
  95. -- guint next_line;
  96. -- guint next_position;
  97. -- /* to be considered private */
  98. -- GHashTable *symbol_table;
  99. -- gint input_fd;
  100. -- const gchar *text;
  101. -- const gchar *text_end;
  102. -- gchar *buffer;
  103. -- guint scope_id;
  104. -- /* handler function for _warn and _error */
  105. -- GScannerMsgFunc msg_handler;
  106. -- } GScanner;
  107. -- The data structure representing a lexical scanner.
  108. -- You should set input_name after creating the scanner, since it is used by the
  109. -- default message handler when displaying warnings and errors. If you are scanning
  110. -- a file, the file name would be a good choice.
  111. -- The user_data and max_parse_errors fields are not used. If you need to associate
  112. -- extra data with the scanner you can place them here.
  113. -- If you want to use your own message handler you can set the msg_handler field.
  114. -- The type of the message handler function is declared by GScannerMsgFunc.
  115. -- ---------------------------------------------------------------------------------
  116. -- g_scanner_new ()
  117. -- GScanner* g_scanner_new (const GScannerConfig *config_templ);
  118. -- Creates a new GScanner. The config_templ structure specifies the initial settings
  119. -- of the scanner, which are copied into the GScanner config field. If you pass NULL
  120. -- then the default settings are used.
  121. -- config_templ : the initial scanner settings.
  122. -- Returns : the new GScanner.
  123. -- ---------------------------------------------------------------------------------
  124. -- GScannerConfig
  125. -- typedef struct {
  126. -- /* Character sets
  127. -- */
  128. -- gchar *cset_skip_characters; /* default: " \t\n" */
  129. -- gchar *cset_identifier_first;
  130. -- gchar *cset_identifier_nth;
  131. -- gchar *cpair_comment_single; /* default: "#\n" */
  132. -- /* Should symbol lookup work case sensitive?
  133. -- */
  134. -- guint case_sensitive : 1;
  135. -- /* Boolean values to be adjusted "on the fly"
  136. -- * to configure scanning behaviour.
  137. -- */
  138. -- guint skip_comment_multi : 1; /* C like comment */
  139. -- guint skip_comment_single : 1; /* single line comment */
  140. -- guint scan_comment_multi : 1; /* scan multi line comments? */
  141. -- guint scan_identifier : 1;
  142. -- guint scan_identifier_1char : 1;
  143. -- guint scan_identifier_NULL : 1;
  144. -- guint scan_symbols : 1;
  145. -- guint scan_binary : 1;
  146. -- guint scan_octal : 1;
  147. -- guint scan_float : 1;
  148. -- guint scan_hex : 1; /* `0x0ff0' */
  149. -- guint scan_hex_dollar : 1; /* `$0ff0' */
  150. -- guint scan_string_sq : 1; /* string: 'anything' */
  151. -- guint scan_string_dq : 1; /* string: "\\-escapes!\n" */
  152. -- guint numbers_2_int : 1; /* bin, octal, hex => int */
  153. -- guint int_2_float : 1; /* int => G_TOKEN_FLOAT? */
  154. -- guint identifier_2_string : 1;
  155. -- guint char_2_token : 1; /* return G_TOKEN_CHAR? */
  156. -- guint symbol_2_token : 1;
  157. -- guint scope_0_fallback : 1; /* try scope 0 on lookups? */
  158. -- guint store_int64 : 1; /* use value.v_int64 rather than v_int */
  159. -- guint padding_dummy;
  160. -- } GScannerConfig;
  161. -- Specifies the GScanner settings.
  162. -- cset_skip_characters specifies which characters should be skipped by the scanner
  163. -- (the default is the whitespace characters: space, tab, carriage-return and
  164. -- line-feed).
  165. -- cset_identifier_first specifies the characters which can start identifiers (the
  166. -- default is G_CSET_a_2_z, "_", and G_CSET_A_2_Z).
  167. -- cset_identifier_nth specifies the characters which can be used in identifiers,
  168. -- after the first character (the default is G_CSET_a_2_z, "_0123456789",
  169. -- G_CSET_A_2_Z, G_CSET_LATINS, G_CSET_LATINC).
  170. -- cpair_comment_single specifies the characters at the start and end of single-line
  171. -- comments. The default is "#\n" which means that single-line comments start with a
  172. -- '#' and continue until a '\n' (end of line).
  173. -- case_sensitive specifies if symbols are case sensitive (the default is FALSE).
  174. -- skip_comment_multi specifies if multi-line comments are skipped and not returned
  175. -- as tokens (the default is TRUE).
  176. -- skip_comment_single specifies if single-line comments are skipped and not
  177. -- returned as tokens (the default is TRUE).
  178. -- scan_comment_multi specifies if multi-line comments are recognized (the default
  179. -- is TRUE).
  180. -- scan_identifier specifies if identifiers are recognized (the default is TRUE).
  181. -- scan_identifier_1char specifies if single-character identifiers are recognized
  182. -- (the default is FALSE).
  183. -- scan_identifier_NULL specifies if NULL is reported as G_TOKEN_IDENTIFIER_NULL.
  184. -- (the default is FALSE).
  185. -- scan_symbols specifies if symbols are recognized (the default is TRUE).
  186. -- scan_binary specifies if binary numbers are recognized (the default is FALSE).
  187. -- scan_octal specifies if octal numbers are recognized (the default is TRUE).
  188. -- scan_float specifies if floating point numbers are recognized (the default is
  189. -- TRUE).
  190. -- scan_hex specifies if hexadecimal numbers are recognized (the default is TRUE).
  191. -- scan_hex_dollar specifies if '$' is recognized as a prefix for hexadecimal
  192. -- numbers (the default is FALSE).
  193. -- scan_string_sq specifies if strings can be enclosed in single quotes (the default
  194. -- is TRUE).
  195. -- scan_string_dq specifies if strings can be enclosed in double quotes (the default
  196. -- is TRUE).
  197. -- numbers_2_int specifies if binary, octal and hexadecimal numbers are reported as
  198. -- G_TOKEN_INT (the default is TRUE).
  199. -- int_2_float specifies if all numbers are reported as G_TOKEN_FLOAT (the default
  200. -- is FALSE).
  201. -- identifier_2_string specifies if identifiers are reported as strings (the default
  202. -- is FALSE).
  203. -- char_2_token specifies if characters are reported by setting token = ch or as
  204. -- G_TOKEN_CHAR (the default is TRUE).
  205. -- symbol_2_token specifies if symbols are reported by setting token = v_symbol or
  206. -- as G_TOKEN_SYMBOL (the default is FALSE).
  207. -- scope_0_fallback specifies if a symbol is searched for in the default scope in
  208. -- addition to the current scope (the default is FALSE).
  209. -- ---------------------------------------------------------------------------------
  210. -- g_scanner_input_file ()
  211. -- void g_scanner_input_file (GScanner *scanner,
  212. -- gint input_fd);
  213. -- Prepares to scan a file.
  214. -- scanner : a GScanner.
  215. -- input_fd : a file descriptor.
  216. -- ---------------------------------------------------------------------------------
  217. -- g_scanner_sync_file_offset ()
  218. -- void g_scanner_sync_file_offset (GScanner *scanner);
  219. -- Rewinds the filedescriptor to the current buffer position and blows the file read
  220. -- ahead buffer. This is useful for third party uses of the scanners filedescriptor,
  221. -- which hooks onto the current scanning position.
  222. -- scanner : a GScanner.
  223. -- ---------------------------------------------------------------------------------
  224. -- g_scanner_input_text ()
  225. -- void g_scanner_input_text (GScanner *scanner,
  226. -- const gchar *text,
  227. -- guint text_len);
  228. -- Prepares to scan a text buffer.
  229. -- scanner : a GScanner.
  230. -- text : the text buffer to scan.
  231. -- text_len : the length of the text buffer.
  232. -- ---------------------------------------------------------------------------------
  233. -- g_scanner_peek_next_token ()
  234. -- GTokenType g_scanner_peek_next_token (GScanner *scanner);
  235. -- Gets the next token, without removing it from the input stream. The token data is
  236. -- placed in the next_token, next_value, next_line, and next_position fields of the
  237. -- GScanner structure.
  238. -- Note that, while the token is not removed from the input stream (i.e. the next
  239. -- call to g_scanner_get_next_token() will return the same token), it will not be
  240. -- reevaluated. This can lead to surprising results when changing scope after
  241. -- peeking for the next token. Getting the next token after switching the scope will
  242. -- return whatever was peeked before, regardless of any symbols that may have been
  243. -- added or removed in the new scope.
  244. -- scanner : a GScanner.
  245. -- Returns : the type of the token.
  246. -- ---------------------------------------------------------------------------------
  247. -- g_scanner_get_next_token ()
  248. -- GTokenType g_scanner_get_next_token (GScanner *scanner);
  249. -- Gets the next token, removing it from the input stream. The token data is placed
  250. -- in the token, value, line, and position fields of the GScanner structure.
  251. -- scanner : a GScanner.
  252. -- Returns : the type of the token.
  253. -- ---------------------------------------------------------------------------------
  254. -- g_scanner_cur_line ()
  255. -- guint g_scanner_cur_line (GScanner *scanner);
  256. -- Gets the current line in the input stream (counting from 1).
  257. -- scanner : a GScanner.
  258. -- Returns : the current line.
  259. -- ---------------------------------------------------------------------------------
  260. -- g_scanner_cur_position ()
  261. -- guint g_scanner_cur_position (GScanner *scanner);
  262. -- Gets the current position in the current line (counting from 0).
  263. -- scanner : a GScanner.
  264. -- Returns : the current position on the line.
  265. -- ---------------------------------------------------------------------------------
  266. -- g_scanner_cur_token ()
  267. -- GTokenType g_scanner_cur_token (GScanner *scanner);
  268. -- Gets the current token type. This is simply the token field in the GScanner
  269. -- structure.
  270. -- scanner : a GScanner.
  271. -- Returns : the current token type.
  272. -- ---------------------------------------------------------------------------------
  273. -- g_scanner_cur_value ()
  274. -- GTokenValue g_scanner_cur_value (GScanner *scanner);
  275. -- Gets the current token value. This is simply the value field in the GScanner
  276. -- structure.
  277. -- scanner : a GScanner.
  278. -- Returns : the current token value.
  279. -- ---------------------------------------------------------------------------------
  280. -- g_scanner_eof ()
  281. -- gboolean g_scanner_eof (GScanner *scanner);
  282. -- Returns TRUE if the scanner has reached the end of the file or text buffer.
  283. -- scanner : a GScanner.
  284. -- Returns : TRUE if the scanner has reached the end of the file or text buffer.
  285. -- ---------------------------------------------------------------------------------
  286. -- g_scanner_set_scope ()
  287. -- guint g_scanner_set_scope (GScanner *scanner,
  288. -- guint scope_id);
  289. -- Sets the current scope.
  290. -- scanner : a GScanner.
  291. -- scope_id : the new scope id.
  292. -- Returns : the old scope id.
  293. -- ---------------------------------------------------------------------------------
  294. -- g_scanner_scope_add_symbol ()
  295. -- void g_scanner_scope_add_symbol (GScanner *scanner,
  296. -- guint scope_id,
  297. -- const gchar *symbol,
  298. -- gpointer value);
  299. -- Adds a symbol to the given scope.
  300. -- scanner : a GScanner.
  301. -- scope_id : the scope id.
  302. -- symbol : the symbol to add.
  303. -- value : the value of the symbol.
  304. -- ---------------------------------------------------------------------------------
  305. -- g_scanner_scope_foreach_symbol ()
  306. -- void g_scanner_scope_foreach_symbol (GScanner *scanner,
  307. -- guint scope_id,
  308. -- GHFunc func,
  309. -- gpointer user_data);
  310. -- Calls the given function for each of the symbol/value pairs in the given scope of
  311. -- the GScanner. The function is passed the symbol and value of each pair, and the
  312. -- given user_data parameter.
  313. -- scanner : a GScanner.
  314. -- scope_id : the scope id.
  315. -- func : the function to call for each symbol/value pair.
  316. -- user_data : user data to pass to the function.
  317. -- ---------------------------------------------------------------------------------
  318. -- g_scanner_scope_lookup_symbol ()
  319. -- gpointer g_scanner_scope_lookup_symbol (GScanner *scanner,
  320. -- guint scope_id,
  321. -- const gchar *symbol);
  322. -- Looks up a symbol in a scope and return its value. If the symbol is not bound in
  323. -- the scope, NULL is returned.
  324. -- scanner : a GScanner.
  325. -- scope_id : the scope id.
  326. -- symbol : the symbol to look up.
  327. -- Returns : the value of symbol in the given scope, or NULL if symbol is not bound
  328. -- in the given scope.
  329. -- ---------------------------------------------------------------------------------
  330. -- g_scanner_scope_remove_symbol ()
  331. -- void g_scanner_scope_remove_symbol (GScanner *scanner,
  332. -- guint scope_id,
  333. -- const gchar *symbol);
  334. -- Removes a symbol from a scope.
  335. -- scanner : a GScanner.
  336. -- scope_id : the scope id.
  337. -- symbol : the symbol to remove.
  338. -- ---------------------------------------------------------------------------------
  339. -- g_scanner_freeze_symbol_table()
  340. -- #define g_scanner_freeze_symbol_table(scanner)
  341. -- Warning
  342. -- g_scanner_freeze_symbol_table has been deprecated since version 2.2 and should
  343. -- not be used in newly-written code. This macro does nothing.
  344. -- scanner : a GScanner.
  345. -- ---------------------------------------------------------------------------------
  346. -- g_scanner_thaw_symbol_table()
  347. -- #define g_scanner_thaw_symbol_table(scanner)
  348. -- Warning
  349. -- g_scanner_thaw_symbol_table has been deprecated since version 2.2 and should not
  350. -- be used in newly-written code. This macro does nothing.
  351. -- scanner : a GScanner.
  352. -- ---------------------------------------------------------------------------------
  353. -- g_scanner_lookup_symbol ()
  354. -- gpointer g_scanner_lookup_symbol (GScanner *scanner,
  355. -- const gchar *symbol);
  356. -- Looks up a symbol in the current scope and return its value. If the symbol is not
  357. -- bound in the current scope, NULL is returned.
  358. -- scanner : a GScanner.
  359. -- symbol : the symbol to look up.
  360. -- Returns : the value of symbol in the current scope, or NULL if symbol is not
  361. -- bound in the current scope.
  362. -- ---------------------------------------------------------------------------------
  363. -- g_scanner_warn ()
  364. -- void g_scanner_warn (GScanner *scanner,
  365. -- const gchar *format,
  366. -- ...);
  367. -- Outputs a warning message, via the GScanner message handler.
  368. -- scanner : a GScanner.
  369. -- format : the message format. See the printf() documentation.
  370. -- ... : the parameters to insert into the format string.
  371. -- ---------------------------------------------------------------------------------
  372. -- g_scanner_error ()
  373. -- void g_scanner_error (GScanner *scanner,
  374. -- const gchar *format,
  375. -- ...);
  376. -- Outputs an error message, via the GScanner message handler.
  377. -- scanner : a GScanner.
  378. -- format : the message format. See the printf() documentation.
  379. -- ... : the parameters to insert into the format string.
  380. -- ---------------------------------------------------------------------------------
  381. -- g_scanner_unexp_token ()
  382. -- void g_scanner_unexp_token (GScanner *scanner,
  383. -- GTokenType expected_token,
  384. -- const gchar *identifier_spec,
  385. -- const gchar *symbol_spec,
  386. -- const gchar *symbol_name,
  387. -- const gchar *message,
  388. -- gint is_error);
  389. -- Outputs a message through the scanner's msg_handler, resulting from an unexpected
  390. -- token in the input stream. Note that you should not call
  391. -- g_scanner_peek_next_token() followed by g_scanner_unexp_token() without an
  392. -- intermediate call to g_scanner_get_next_token(), as g_scanner_unexp_token()
  393. -- evaluates the scanner's current token (not the peeked token) to construct part of
  394. -- the message.
  395. -- scanner : a GScanner.
  396. -- expected_token : the expected token.
  397. -- identifier_spec : a string describing how the scanner's user refers to
  398. -- identifiers (NULL defaults to "identifier"). This is used if
  399. -- expected_token is G_TOKEN_IDENTIFIER or
  400. -- G_TOKEN_IDENTIFIER_NULL.
  401. -- symbol_spec : a string describing how the scanner's user refers to symbols
  402. -- (NULL defaults to "symbol"). This is used if expected_token is
  403. -- G_TOKEN_SYMBOL or any token value greater than G_TOKEN_LAST.
  404. -- symbol_name : the name of the symbol, if the scanner's current token is a
  405. -- symbol.
  406. -- message : a message string to output at the end of the warning/error, or
  407. -- NULL.
  408. -- is_error : if TRUE it is output as an error. If FALSE it is output as a
  409. -- warning.
  410. -- ---------------------------------------------------------------------------------
  411. -- GScannerMsgFunc ()
  412. -- void (*GScannerMsgFunc) (GScanner *scanner,
  413. -- gchar *message,
  414. -- gboolean error);
  415. -- Specifies the type of the message handler function.
  416. -- scanner : a GScanner.
  417. -- message : the message.
  418. -- error : TRUE if the message signals an error, FALSE if it signals a warning.
  419. -- ---------------------------------------------------------------------------------
  420. -- g_scanner_destroy ()
  421. -- void g_scanner_destroy (GScanner *scanner);
  422. -- Frees all memory used by the GScanner.
  423. -- scanner : a GScanner.
  424. -- ---------------------------------------------------------------------------------
  425. -- enum GTokenType
  426. -- typedef enum
  427. -- {
  428. -- G_TOKEN_EOF = 0,
  429. -- G_TOKEN_LEFT_PAREN = '(',
  430. -- G_TOKEN_RIGHT_PAREN = ')',
  431. -- G_TOKEN_LEFT_CURLY = '{',
  432. -- G_TOKEN_RIGHT_CURLY = '}',
  433. -- G_TOKEN_LEFT_BRACE = '[',
  434. -- G_TOKEN_RIGHT_BRACE = ']',
  435. -- G_TOKEN_EQUAL_SIGN = '=',
  436. -- G_TOKEN_COMMA = ',',
  437. -- G_TOKEN_NONE = 256,
  438. -- G_TOKEN_ERROR,
  439. -- G_TOKEN_CHAR,
  440. -- G_TOKEN_BINARY,
  441. -- G_TOKEN_OCTAL,
  442. -- G_TOKEN_INT,
  443. -- G_TOKEN_HEX,
  444. -- G_TOKEN_FLOAT,
  445. -- G_TOKEN_STRING,
  446. -- G_TOKEN_SYMBOL,
  447. -- G_TOKEN_IDENTIFIER,
  448. -- G_TOKEN_IDENTIFIER_NULL,
  449. -- G_TOKEN_COMMENT_SINGLE,
  450. -- G_TOKEN_COMMENT_MULTI,
  451. -- G_TOKEN_LAST
  452. -- } GTokenType;
  453. -- The possible types of token returned from each g_scanner_get_next_token() call.
  454. -- G_TOKEN_EOF the end of the file.
  455. -- G_TOKEN_LEFT_PAREN a '(' character.
  456. -- G_TOKEN_LEFT_CURLY a '{' character.
  457. -- G_TOKEN_RIGHT_CURLY a '}' character.
  458. -- ---------------------------------------------------------------------------------
  459. -- union GTokenValue
  460. -- union GTokenValue
  461. -- {
  462. -- gpointer v_symbol;
  463. -- gchar *v_identifier;
  464. -- gulong v_binary;
  465. -- gulong v_octal;
  466. -- gulong v_int;
  467. -- guint64 v_int64;
  468. -- gdouble v_float;
  469. -- gulong v_hex;
  470. -- gchar *v_string;
  471. -- gchar *v_comment;
  472. -- guchar v_char;
  473. -- guint v_error;
  474. -- };
  475. -- A union holding the value of the token.
  476. -- ---------------------------------------------------------------------------------
  477. -- enum GErrorType
  478. -- typedef enum
  479. -- {
  480. -- G_ERR_UNKNOWN,
  481. -- G_ERR_UNEXP_EOF,
  482. -- G_ERR_UNEXP_EOF_IN_STRING,
  483. -- G_ERR_UNEXP_EOF_IN_COMMENT,
  484. -- G_ERR_NON_DIGIT_IN_CONST,
  485. -- G_ERR_DIGIT_RADIX,
  486. -- G_ERR_FLOAT_RADIX,
  487. -- G_ERR_FLOAT_MALFORMED
  488. -- } GErrorType;
  489. -- The possible errors, used in the v_error field of GTokenValue, when the token is
  490. -- a G_TOKEN_ERROR.
  491. -- G_ERR_UNKNOWN unknown error.
  492. -- G_ERR_UNEXP_EOF unexpected end of file.
  493. -- G_ERR_UNEXP_EOF_IN_STRING unterminated string constant.
  494. -- G_ERR_UNEXP_EOF_IN_COMMENT unterminated comment.
  495. -- G_ERR_NON_DIGIT_IN_CONST non-digit character in a number.
  496. -- G_ERR_DIGIT_RADIX digit beyond radix in a number.
  497. -- G_ERR_FLOAT_RADIX non-decimal floating point number.
  498. -- G_ERR_FLOAT_MALFORMED malformed floating point number.
  499. -- ---------------------------------------------------------------------------------
  500. -- G_CSET_a_2_z
  501. -- #define G_CSET_a_2_z "abcdefghijklmnopqrstuvwxyz"
  502. -- The set of lowercase ASCII alphabet characters. Used for specifying valid
  503. -- identifier characters in GScannerConfig.
  504. -- ---------------------------------------------------------------------------------
  505. -- G_CSET_A_2_Z
  506. -- #define G_CSET_A_2_Z "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  507. -- The set of uppercase ASCII alphabet characters. Used for specifying valid
  508. -- identifier characters in GScannerConfig.
  509. -- ---------------------------------------------------------------------------------
  510. -- G_CSET_DIGITS
  511. -- #define G_CSET_DIGITS "0123456789"
  512. -- The set of digits. Used for specifying valid identifier characters in
  513. -- GScannerConfig.
  514. -- ---------------------------------------------------------------------------------
  515. -- G_CSET_LATINC
  516. -- #define G_CSET_LATINC
  517. -- The set of uppercase ISO 8859-1 alphabet characters which are not ASCII
  518. -- characters. Used for specifying valid identifier characters in GScannerConfig.
  519. -- ---------------------------------------------------------------------------------
  520. -- G_CSET_LATINS
  521. -- #define G_CSET_LATINS
  522. -- The set of lowercase ISO 8859-1 alphabet characters which are not ASCII
  523. -- characters. Used for specifying valid identifier characters in GScannerConfig.
  524. -- ---------------------------------------------------------------------------------
  525. -- g_scanner_add_symbol()
  526. -- #define g_scanner_add_symbol( scanner, symbol, value )
  527. -- Warning
  528. -- g_scanner_add_symbol has been deprecated since version 2.2 and should not be used
  529. -- in newly-written code. Use g_scanner_scope_add_symbol() instead.
  530. -- Adds a symbol to the default scope.
  531. -- scanner : a GScanner.
  532. -- symbol : the symbol to add.
  533. -- value : the value of the symbol.
  534. -- ---------------------------------------------------------------------------------
  535. -- g_scanner_remove_symbol()
  536. -- #define g_scanner_remove_symbol( scanner, symbol )
  537. -- Warning
  538. -- g_scanner_remove_symbol has been deprecated since version 2.2 and should not be
  539. -- used in newly-written code. Use g_scanner_scope_remove_symbol() instead.
  540. -- Removes a symbol from the default scope.
  541. -- scanner : a GScanner.
  542. -- symbol : the symbol to remove.
  543. -- ---------------------------------------------------------------------------------
  544. -- g_scanner_foreach_symbol()
  545. -- #define g_scanner_foreach_symbol( scanner, func, data )
  546. -- Warning
  547. -- g_scanner_foreach_symbol has been deprecated since version 2.2 and should not be
  548. -- used in newly-written code. Use g_scanner_scope_foreach_symbol() instead.
  549. -- Calls a function for each symbol in the default scope.
  550. -- scanner : a GScanner.
  551. -- func : the function to call with each symbol.
  552. -- data : data to pass to the function.
  553. end -- class GLIB_LEXICAL_SCANNER