Libcroco
cr-parser.h
Go to the documentation of this file.
1 /* -*- Mode: C; indent-tabs-mode:nil; c-basic-offset: 8-*- */
2 
3 /*
4  * This file is part of The Croco Library
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of version 2.1 of the GNU Lesser General Public
8  * License as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
18  * USA
19  *
20  * Author: Dodji Seketeli
21  * See COPYRIGHTS file for copyrights information.
22  */
23 
24 #ifndef __CR_PARSER_H__
25 #define __CR_PARSER_H__
26 
27 #include <glib.h>
28 #include "cr-input.h"
29 #include "cr-tknzr.h"
30 #include "cr-utils.h"
31 #include "cr-doc-handler.h"
32 
33 G_BEGIN_DECLS
34 
35 /**
36  *@file
37  *The declaration file
38  *of the #CRParser class.
39  */
40 typedef struct _CRParser CRParser ;
41 typedef struct _CRParserPriv CRParserPriv ;
42 
43 
44 /**
45  *The implementation of
46  *the SAC parser.
47  *The Class is opaque
48  *and must be manipulated through
49  *the provided methods.
50  */
51 struct _CRParser {
53 } ;
54 
55 
56 CRParser * cr_parser_new (CRTknzr *a_tknzr) ;
57 
58 CRParser * cr_parser_new_from_buf (guchar *a_buf, gulong a_len,
59  enum CREncoding a_enc,
60  gboolean a_free_buf) ;
61 
62 CRParser * cr_parser_new_from_file (const guchar *a_file_uri,
63  enum CREncoding a_enc) ;
64 
66 
67 enum CRStatus cr_parser_set_tknzr (CRParser *a_this, CRTknzr *a_tknzr) ;
68 
69 enum CRStatus cr_parser_get_tknzr (CRParser *a_this, CRTknzr **a_tknzr) ;
70 
72 
74 
75 
77  CRDocHandler *a_handler) ;
78 
80  CRDocHandler **a_handler) ;
81 
83  gboolean a_use_core_grammar) ;
85  gboolean *a_use_core_grammar) ;
86 
87 enum CRStatus cr_parser_parse (CRParser *a_this) ;
88 
90  const guchar *a_file_uri,
91  enum CREncoding a_enc) ;
92 
93 enum CRStatus cr_parser_parse_buf (CRParser *a_this, const guchar *a_buf,
94  gulong a_len, enum CREncoding a_enc) ;
95 
97 
98 enum CRStatus cr_parser_parse_term (CRParser *a_this, CRTerm **a_term) ;
99 
100 enum CRStatus cr_parser_parse_expr (CRParser *a_this, CRTerm **a_expr) ;
101 
102 enum CRStatus cr_parser_parse_prio (CRParser *a_this, CRString **a_prio) ;
103 
104 enum CRStatus cr_parser_parse_declaration (CRParser *a_this, CRString **a_property,
105  CRTerm **a_expr, gboolean *a_important) ;
106 
108 
110 
111 enum CRStatus cr_parser_parse_import (CRParser *a_this, GList ** a_media_list,
112  CRString **a_import_string,
113  CRParsingLocation *a_location) ;
114 
115 enum CRStatus cr_parser_parse_media (CRParser *a_this) ;
116 
117 enum CRStatus cr_parser_parse_page (CRParser *a_this) ;
118 
119 enum CRStatus cr_parser_parse_charset (CRParser *a_this, CRString **a_value,
120  CRParsingLocation *a_charset_sym_location) ;
121 
123 
124 void cr_parser_destroy (CRParser *a_this) ;
125 
126 G_END_DECLS
127 
128 #endif /*__CR_PARSER_H__*/
cr_parser_parse_prio
enum CRStatus cr_parser_parse_prio(CRParser *a_this, CRString **a_prio)
cr_parser_parse_prio: @a_this: the current instance of CRParser.
Definition: cr-parser.c:3118
cr_parser_set_sac_handler
enum CRStatus cr_parser_set_sac_handler(CRParser *a_this, CRDocHandler *a_handler)
cr_parser_set_sac_handler: @a_this: the "this pointer" of the current instance of CRParser.
Definition: cr-parser.c:2863
cr-input.h
cr_parser_new
CRParser * cr_parser_new(CRTknzr *a_tknzr)
cr_parser_new: @a_tknzr: the tokenizer to use for the parsing.
Definition: cr-parser.c:2751
_CRParserPriv
The private attributes of CRParser.
Definition: cr-parser.c:108
_CRParser
The implementation of the SAC parser.
Definition: cr-parser.h:51
CRTknzr
typedefG_BEGIN_DECLS struct _CRTknzr CRTknzr
Definition: cr-tknzr.h:40
cr_parser_parse_buf
enum CRStatus cr_parser_parse_buf(CRParser *a_this, const guchar *a_buf, gulong a_len, enum CREncoding a_enc)
cr_parser_parse_buf: @a_this: the current instance of #CRparser @a_buf: the input buffer @a_len: the ...
Definition: cr-parser.c:4467
cr_parser_get_use_core_grammar
enum CRStatus cr_parser_get_use_core_grammar(CRParser const *a_this, gboolean *a_use_core_grammar)
cr_parser_get_use_core_grammar: @a_this: the current instance of CRParser.
Definition: cr-parser.c:2955
cr-doc-handler.h
CRString
typedefG_BEGIN_DECLS struct _CRString CRString
Definition: cr-string.h:37
CRDocHandler
typedefG_BEGIN_DECLS struct _CRDocHandler CRDocHandler
Definition: cr-doc-handler.h:40
cr_parser_parse_file
enum CRStatus cr_parser_parse_file(CRParser *a_this, const guchar *a_file_uri, enum CREncoding a_enc)
cr_parser_parse_file: @a_this: a pointer to the current instance of CRParser.
Definition: cr-parser.c:2977
cr_parser_parse
enum CRStatus cr_parser_parse(CRParser *a_this)
cr_parser_parse: @a_this: the current instance of CRParser.
Definition: cr-parser.c:4373
cr_parser_parse_expr
enum CRStatus cr_parser_parse_expr(CRParser *a_this, CRTerm **a_expr)
cr_parser_parse_expr: @a_this: the current instance of CRParser.
Definition: cr-parser.c:3011
cr_parser_get_parsing_location
enum CRStatus cr_parser_get_parsing_location(CRParser const *a_this, CRParsingLocation *a_loc)
cr_parser_get_parsing_location: @a_this: the current instance of CRParser @a_loc: the parsing locatio...
Definition: cr-parser.c:4444
cr_parser_set_tknzr
enum CRStatus cr_parser_set_tknzr(CRParser *a_this, CRTknzr *a_tknzr)
cr_parser_set_tknzr: @a_this: the current instance of CRParser; @a_tknzr: the new tokenizer.
Definition: cr-parser.c:4397
cr_parser_parse_ruleset
enum CRStatus cr_parser_parse_ruleset(CRParser *a_this)
cr_parser_parse_ruleset: @a_this: the "this pointer" of the current instance of CRParser.
Definition: cr-parser.c:3327
cr_parser_get_tknzr
enum CRStatus cr_parser_get_tknzr(CRParser *a_this, CRTknzr **a_tknzr)
cr_parser_get_tknzr: @a_this: the current instance of CRParser @a_tknzr: out parameter.
Definition: cr-parser.c:4424
_CRInput
The CRInput class provides the abstraction of an utf8-encoded character stream.
Definition: cr-input.h:47
cr_parser_parse_declaration
enum CRStatus cr_parser_parse_declaration(CRParser *a_this, CRString **a_property, CRTerm **a_expr, gboolean *a_important)
cr_parser_parse_declaration: @a_this: the "this pointer" of the current instance of CRParser.
Definition: cr-parser.c:3169
cr_parser_set_use_core_grammar
enum CRStatus cr_parser_set_use_core_grammar(CRParser *a_this, gboolean a_use_core_grammar)
cr_parser_set_use_core_grammar: @a_this: the current instance of CRParser.
Definition: cr-parser.c:2937
_CRParser::priv
CRParserPriv * priv
Definition: cr-parser.h:52
_CRParsingLocation
Definition: cr-parsing-location.h:39
cr_parser_parse_page
enum CRStatus cr_parser_parse_page(CRParser *a_this)
cr_parser_parse_page: @a_this: the "this pointer" of the current instance of CRParser.
Definition: cr-parser.c:3874
cr_parser_parse_font_face
enum CRStatus cr_parser_parse_font_face(CRParser *a_this)
cr_parser_parse_font_face: @a_this: the current instance of CRParser.
Definition: cr-parser.c:4216
cr_parser_destroy
void cr_parser_destroy(CRParser *a_this)
cr_parser_destroy: @a_this: the current instance of CRParser to destroy.
Definition: cr-parser.c:4498
cr-tknzr.h
cr_parser_try_to_skip_spaces_and_comments
enum CRStatus cr_parser_try_to_skip_spaces_and_comments(CRParser *a_this)
cr_parser_try_to_skip_spaces_and_comments: @a_this: the current instance of CRParser.
Definition: cr-parser.c:621
cr_parser_parse_statement_core
enum CRStatus cr_parser_parse_statement_core(CRParser *a_this)
cr_parser_parse_statement_core: @a_this: the current instance of CRParser.
Definition: cr-parser.c:3263
CREncoding
CREncoding
Encoding values.
Definition: cr-utils.h:84
cr_parser_parse_media
enum CRStatus cr_parser_parse_media(CRParser *a_this)
cr_parser_parse_media: @a_this: the "this pointer" of the current instance of CRParser.
Definition: cr-parser.c:3704
_CRTerm
An abstraction of a css2 term as defined in the CSS2 spec in appendix D.1: term ::= [ NUMBER S* | PER...
Definition: cr-term.h:82
cr_parser_new_from_file
CRParser * cr_parser_new_from_file(const guchar *a_file_uri, enum CREncoding a_enc)
cr_parser_new_from_file: @a_file_uri: the uri of the file to parse.
Definition: cr-parser.c:2837
CRStatus
CRStatus
The status type returned by the methods of the croco library.
Definition: cr-utils.h:43
cr_parser_set_default_sac_handler
enum CRStatus cr_parser_set_default_sac_handler(CRParser *a_this)
cr_parser_set_default_sac_handler: @a_this: a pointer to the current instance of CRParser.
Definition: cr-parser.c:2908
cr_parser_parse_import
enum CRStatus cr_parser_parse_import(CRParser *a_this, GList **a_media_list, CRString **a_import_string, CRParsingLocation *a_location)
cr_parser_parse_import: @a_this: the "this pointer" of the current instance of CRParser.
Definition: cr-parser.c:3543
cr-utils.h
cr_parser_parse_term
enum CRStatus cr_parser_parse_term(CRParser *a_this, CRTerm **a_term)
cr_parser_parse_term: @a_term: out parameter.
Definition: cr-parser.c:1507
cr_parser_new_from_buf
CRParser * cr_parser_new_from_buf(guchar *a_buf, gulong a_len, enum CREncoding a_enc, gboolean a_free_buf)
cr_parser_new_from_buf: @a_buf: the buffer to parse.
Definition: cr-parser.c:2784
cr_parser_parse_charset
enum CRStatus cr_parser_parse_charset(CRParser *a_this, CRString **a_value, CRParsingLocation *a_charset_sym_location)
cr_parser_parse_charset: @a_this: the "this pointer" of the current instance of CRParser.
Definition: cr-parser.c:4125
cr_parser_new_from_input
CRParser * cr_parser_new_from_input(CRInput *a_input)
cr_parser_new_from_input: @a_input: the parser input stream to use.
Definition: cr-parser.c:2813
cr_parser_get_sac_handler
enum CRStatus cr_parser_get_sac_handler(CRParser *a_this, CRDocHandler **a_handler)
cr_parser_get_sac_handler: @a_this: the "this pointer" of the current instance of CRParser.
Definition: cr-parser.c:2889