00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef __CR_PARSER_H__
00028 #define __CR_PARSER_H__
00029
00030 #include <glib.h>
00031 #include "cr-input.h"
00032 #include "cr-tknzr.h"
00033 #include "cr-utils.h"
00034 #include "cr-doc-handler.h"
00035
00036 G_BEGIN_DECLS
00037
00038
00039
00040
00041
00042
00043 typedef struct _CRParser CRParser ;
00044 typedef struct _CRParserPriv CRParserPriv ;
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 struct _CRParser
00055 {
00056 CRParserPriv *priv ;
00057 } ;
00058
00059 CRParser *
00060 cr_parser_new (CRTknzr *a_tknzr) ;
00061
00062 CRParser *
00063 cr_parser_new_from_buf (guchar *a_buf, gulong a_len,
00064 enum CREncoding a_enc,
00065 gboolean a_free_buf) ;
00066 CRParser *
00067 cr_parser_new_from_file (const guchar *a_file_uri,
00068 enum CREncoding a_enc) ;
00069
00070 CRParser *
00071 cr_parser_new_from_input (CRInput *a_input) ;
00072
00073 enum CRStatus
00074 cr_parser_set_tknzr (CRParser *a_this, CRTknzr *a_tknzr) ;
00075
00076 enum CRStatus
00077 cr_parser_get_tknzr (CRParser *a_this, CRTknzr **a_tknzr) ;
00078
00079 enum CRStatus
00080 cr_parser_try_to_skip_spaces_and_comments (CRParser *a_this) ;
00081
00082
00083 enum CRStatus
00084 cr_parser_set_sac_handler (CRParser *a_this,
00085 CRDocHandler *a_handler) ;
00086
00087 enum CRStatus
00088 cr_parser_get_sac_handler (CRParser *a_this,
00089 CRDocHandler **a_handler) ;
00090 enum CRStatus
00091 cr_parser_set_use_core_grammar (CRParser *a_this,
00092 gboolean a_use_core_grammar) ;
00093 enum CRStatus
00094 cr_parser_get_use_core_grammar (CRParser *a_this,
00095 gboolean *a_use_core_grammar) ;
00096
00097 enum CRStatus
00098 cr_parser_parse (CRParser *a_this) ;
00099
00100 enum CRStatus
00101 cr_parser_parse_file (CRParser *a_this,
00102 const guchar *a_file_uri,
00103 enum CREncoding a_enc) ;
00104
00105 enum CRStatus
00106 cr_parser_parse_buf (CRParser *a_this, const guchar *a_buf,
00107 gulong a_len, enum CREncoding a_enc) ;
00108
00109 enum CRStatus
00110 cr_parser_set_default_sac_handler (CRParser *a_this) ;
00111
00112 enum CRStatus
00113 cr_parser_parse_term (CRParser *a_this, CRTerm **a_term) ;
00114
00115 enum CRStatus
00116 cr_parser_parse_expr (CRParser *a_this, CRTerm **a_expr) ;
00117
00118 enum CRStatus
00119 cr_parser_parse_prio (CRParser *a_this, GString **a_prio) ;
00120
00121 enum CRStatus
00122 cr_parser_parse_declaration (CRParser *a_this, GString **a_property,
00123 CRTerm **a_expr, gboolean *a_important) ;
00124
00125 enum CRStatus
00126 cr_parser_parse_statement_core (CRParser *a_this) ;
00127
00128 enum CRStatus
00129 cr_parser_parse_ruleset (CRParser *a_this) ;
00130
00131 enum CRStatus
00132 cr_parser_parse_import (CRParser *a_this, GList ** a_media_list,
00133 GString **a_import_string) ;
00134
00135 enum CRStatus
00136 cr_parser_parse_media (CRParser *a_this) ;
00137
00138 enum CRStatus
00139 cr_parser_parse_page (CRParser *a_this) ;
00140
00141 enum CRStatus
00142 cr_parser_parse_charset (CRParser *a_this, GString **a_value) ;
00143
00144 enum CRStatus
00145 cr_parser_parse_font_face (CRParser *a_this) ;
00146
00147 void
00148 cr_parser_destroy (CRParser *a_this) ;
00149
00150 G_END_DECLS
00151
00152 #endif