Libcroco
|
00001 /* -*- Mode: C; indent-tabs-mode:nil; c-basic-offset: 8-*- */ 00002 00003 /* 00004 * This file is part of The Croco Library 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of version 2.1 of the GNU Lesser General Public 00008 * License as published by the Free Software Foundation. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Lesser General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00018 * USA 00019 * 00020 * Author: Dodji Seketeli 00021 * See COPYRIGHTS file for copyrights information. 00022 */ 00023 00024 #ifndef __CR_PARSER_H__ 00025 #define __CR_PARSER_H__ 00026 00027 #include <glib.h> 00028 #include "cr-input.h" 00029 #include "cr-tknzr.h" 00030 #include "cr-utils.h" 00031 #include "cr-doc-handler.h" 00032 00033 G_BEGIN_DECLS 00034 00035 /** 00036 *@file 00037 *The declaration file 00038 *of the #CRParser class. 00039 */ 00040 typedef struct _CRParser CRParser ; 00041 typedef struct _CRParserPriv CRParserPriv ; 00042 00043 00044 /** 00045 *The implementation of 00046 *the SAC parser. 00047 *The Class is opaque 00048 *and must be manipulated through 00049 *the provided methods. 00050 */ 00051 struct _CRParser { 00052 CRParserPriv *priv ; 00053 } ; 00054 00055 00056 CRParser * cr_parser_new (CRTknzr *a_tknzr) ; 00057 00058 CRParser * cr_parser_new_from_buf (guchar *a_buf, gulong a_len, 00059 enum CREncoding a_enc, 00060 gboolean a_free_buf) ; 00061 00062 CRParser * cr_parser_new_from_file (const guchar *a_file_uri, 00063 enum CREncoding a_enc) ; 00064 00065 CRParser * cr_parser_new_from_input (CRInput *a_input) ; 00066 00067 enum CRStatus cr_parser_set_tknzr (CRParser *a_this, CRTknzr *a_tknzr) ; 00068 00069 enum CRStatus cr_parser_get_tknzr (CRParser *a_this, CRTknzr **a_tknzr) ; 00070 00071 enum CRStatus cr_parser_get_parsing_location (CRParser const *a_this, CRParsingLocation *a_loc) ; 00072 00073 enum CRStatus cr_parser_try_to_skip_spaces_and_comments (CRParser *a_this) ; 00074 00075 00076 enum CRStatus cr_parser_set_sac_handler (CRParser *a_this, 00077 CRDocHandler *a_handler) ; 00078 00079 enum CRStatus cr_parser_get_sac_handler (CRParser *a_this, 00080 CRDocHandler **a_handler) ; 00081 00082 enum CRStatus cr_parser_set_use_core_grammar (CRParser *a_this, 00083 gboolean a_use_core_grammar) ; 00084 enum CRStatus cr_parser_get_use_core_grammar (CRParser const *a_this, 00085 gboolean *a_use_core_grammar) ; 00086 00087 enum CRStatus cr_parser_parse (CRParser *a_this) ; 00088 00089 enum CRStatus cr_parser_parse_file (CRParser *a_this, 00090 const guchar *a_file_uri, 00091 enum CREncoding a_enc) ; 00092 00093 enum CRStatus cr_parser_parse_buf (CRParser *a_this, const guchar *a_buf, 00094 gulong a_len, enum CREncoding a_enc) ; 00095 00096 enum CRStatus cr_parser_set_default_sac_handler (CRParser *a_this) ; 00097 00098 enum CRStatus cr_parser_parse_term (CRParser *a_this, CRTerm **a_term) ; 00099 00100 enum CRStatus cr_parser_parse_expr (CRParser *a_this, CRTerm **a_expr) ; 00101 00102 enum CRStatus cr_parser_parse_prio (CRParser *a_this, CRString **a_prio) ; 00103 00104 enum CRStatus cr_parser_parse_declaration (CRParser *a_this, CRString **a_property, 00105 CRTerm **a_expr, gboolean *a_important) ; 00106 00107 enum CRStatus cr_parser_parse_statement_core (CRParser *a_this) ; 00108 00109 enum CRStatus cr_parser_parse_ruleset (CRParser *a_this) ; 00110 00111 enum CRStatus cr_parser_parse_import (CRParser *a_this, GList ** a_media_list, 00112 CRString **a_import_string, 00113 CRParsingLocation *a_location) ; 00114 00115 enum CRStatus cr_parser_parse_media (CRParser *a_this) ; 00116 00117 enum CRStatus cr_parser_parse_page (CRParser *a_this) ; 00118 00119 enum CRStatus cr_parser_parse_charset (CRParser *a_this, CRString **a_value, 00120 CRParsingLocation *a_charset_sym_location) ; 00121 00122 enum CRStatus cr_parser_parse_font_face (CRParser *a_this) ; 00123 00124 void cr_parser_destroy (CRParser *a_this) ; 00125 00126 G_END_DECLS 00127 00128 #endif /*__CR_PARSER_H__*/