php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
parser.h File Reference

Go to the source code of this file.

Data Structures

struct  lxb_css_parser
 
struct  lxb_css_parser_state
 
struct  lxb_css_parser_error
 

Macros

#define lxb_css_parser_token_m(parser, token)
 
#define lxb_css_parser_token_next_m(parser, token)
 
#define lxb_css_parser_token_wo_ws_m(parser, token)
 
#define lxb_css_parser_token_status_m(parser, token)
 
#define lxb_css_parser_token_status_next_m(parser, token)
 
#define lxb_css_parser_token_status_wo_ws_m(parser, token)
 
#define lxb_css_parser_string_dup_m(parser, token, _str, mraw)
 

Enumerations

enum  {
  LXB_CSS_SYNTAX_PARSER_ERROR_UNDEF = 0x0000 , LXB_CSS_SYNTAX_PARSER_ERROR_EOINATRU , LXB_CSS_SYNTAX_PARSER_ERROR_EOINQURU , LXB_CSS_SYNTAX_PARSER_ERROR_EOINSIBL ,
  LXB_CSS_SYNTAX_PARSER_ERROR_EOINFU , LXB_CSS_SYNTAX_PARSER_ERROR_EOBEPARU , LXB_CSS_SYNTAX_PARSER_ERROR_UNTOAFPARU , LXB_CSS_SYNTAX_PARSER_ERROR_EOBEPACOVA ,
  LXB_CSS_SYNTAX_PARSER_ERROR_UNTOAFPACOVA , LXB_CSS_SYNTAX_PARSER_ERROR_UNTOINDE
}
 
enum  lxb_css_parser_stage_t { LXB_CSS_PARSER_CLEAN = 0 , LXB_CSS_PARSER_RUN , LXB_CSS_PARSER_STOP , LXB_CSS_PARSER_END }
 

Functions

LXB_API lxb_css_parser_tlxb_css_parser_create (void)
 
LXB_API lxb_status_t lxb_css_parser_init (lxb_css_parser_t *parser, lxb_css_syntax_tokenizer_t *tkz)
 
LXB_API void lxb_css_parser_clean (lxb_css_parser_t *parser)
 
LXB_API void lxb_css_parser_erase (lxb_css_parser_t *parser)
 
LXB_API lxb_css_parser_tlxb_css_parser_destroy (lxb_css_parser_t *parser, bool self_destroy)
 
LXB_API lxb_css_parser_state_tlxb_css_parser_states_push (lxb_css_parser_t *parser, lxb_css_parser_state_f state, void *context, bool stop)
 
LXB_API lxb_css_parser_state_tlxb_css_parser_states_next (lxb_css_parser_t *parser, lxb_css_parser_state_f next, lxb_css_parser_state_f back, void *ctx, bool root)
 
LXB_API lxb_status_t lxb_css_parser_types_push (lxb_css_parser_t *parser, lxb_css_syntax_token_type_t type)
 
LXB_API bool lxb_css_parser_stop (lxb_css_parser_t *parser)
 
LXB_API bool lxb_css_parser_fail (lxb_css_parser_t *parser, lxb_status_t status)
 
LXB_API bool lxb_css_parser_unexpected (lxb_css_parser_t *parser)
 
LXB_API bool lxb_css_parser_success (lxb_css_parser_t *parser)
 
LXB_API bool lxb_css_parser_failed (lxb_css_parser_t *parser)
 
LXB_API lxb_status_t lxb_css_parser_unexpected_status (lxb_css_parser_t *parser)
 
LXB_API bool lxb_css_parser_unexpected_data (lxb_css_parser_t *parser, const lxb_css_syntax_token_t *token)
 
LXB_API lxb_status_t lxb_css_parser_unexpected_data_status (lxb_css_parser_t *parser, const lxb_css_syntax_token_t *token)
 
LXB_API bool lxb_css_parser_memory_fail (lxb_css_parser_t *parser)
 
lxb_status_t lxb_css_parser_memory_fail_status (lxb_css_parser_t *parser)
 
lxb_inline lxb_status_t lxb_css_parser_status (lxb_css_parser_t *parser)
 
lxb_inline lxb_css_memory_tlxb_css_parser_memory (lxb_css_parser_t *parser)
 
lxb_inline void lxb_css_parser_memory_set (lxb_css_parser_t *parser, lxb_css_memory_t *memory)
 
lxb_inline lxb_css_selectors_tlxb_css_parser_selectors (lxb_css_parser_t *parser)
 
lxb_inline void lxb_css_parser_selectors_set (lxb_css_parser_t *parser, lxb_css_selectors_t *selectors)
 
lxb_inline bool lxb_css_parser_is_running (lxb_css_parser_t *parser)
 
lxb_inline bool lxb_css_parser_status_is_unexpected_data (lxb_css_parser_t *parser)
 
lxb_inline void lxb_css_parser_failed_set (lxb_css_parser_t *parser, bool is)
 
lxb_inline void lxb_css_parser_failed_set_by_id (lxb_css_parser_t *parser, int idx, bool is)
 
lxb_inline bool lxb_css_parser_is_failed (lxb_css_parser_t *parser)
 
lxb_inline void lxb_css_parser_set_ok (lxb_css_parser_t *parser)
 
lxb_inline const lxb_char_tlxb_css_parser_buffer (lxb_css_parser_t *parser, size_t *length)
 
lxb_inline void lxb_css_parser_buffer_set (lxb_css_parser_t *parser, const lxb_char_t *data, size_t length)
 
lxb_inline lxb_css_parser_state_f lxb_css_parser_state (lxb_css_parser_t *parser)
 
lxb_inline void lxb_css_parser_state_set (lxb_css_parser_t *parser, lxb_css_parser_state_f state)
 
lxb_inline void lxb_css_parser_state_block_set (lxb_css_parser_t *parser, lxb_css_parser_state_f state)
 
lxb_inline void lxb_css_parser_state_value_set (lxb_css_parser_t *parser, lxb_css_parser_state_f state)
 
lxb_inline voidlxb_css_parser_context (lxb_css_parser_t *parser)
 
lxb_inline void lxb_css_parser_context_set (lxb_css_parser_t *parser, void *context)
 
lxb_inline lxb_css_syntax_rule_tlxb_css_parser_current_rule (lxb_css_parser_t *parser)
 
lxb_inline size_t lxb_css_parser_rule_deep (lxb_css_parser_t *parser)
 
lxb_inline lxb_css_parser_state_tlxb_css_parser_states_pop (lxb_css_parser_t *parser)
 
lxb_inline lxb_css_parser_state_tlxb_css_parser_states_to_root (lxb_css_parser_t *parser)
 
lxb_inline bool lxb_css_parser_states_set_back (lxb_css_parser_t *parser)
 
lxb_inline void lxb_css_parser_states_change_back (lxb_css_parser_t *parser, lxb_css_parser_state_f state)
 
lxb_inline void lxb_css_parser_states_clean (lxb_css_parser_t *parser)
 
lxb_inline lxb_css_parser_state_tlxb_css_parser_states_current (lxb_css_parser_t *parser)
 
lxb_inline void lxb_css_parser_states_set (lxb_css_parser_state_t *states, lxb_css_parser_state_f state, void *context)
 
lxb_inline void lxb_css_parser_states_up (lxb_css_parser_t *parser)
 
lxb_inline void lxb_css_parser_states_down (lxb_css_parser_t *parser)
 
lxb_inline lxb_css_log_tlxb_css_parser_log (lxb_css_parser_t *parser)
 
lxb_inline void lxb_css_parser_offset_set (lxb_css_parser_t *parser, const lxb_css_syntax_token_t *token)
 
lxb_inline const lxb_css_syntax_list_rules_offset_tlxb_css_parser_list_rules_offset (lxb_css_parser_t *parser)
 
lxb_inline const lxb_css_syntax_at_rule_offset_tlxb_css_parser_at_rule_offset (lxb_css_parser_t *parser)
 
lxb_inline const lxb_css_syntax_qualified_offset_tlxb_css_parser_qualified_rule_offset (lxb_css_parser_t *parser)
 
lxb_inline const lxb_css_syntax_declarations_offset_tlxb_css_parser_declarations_offset (lxb_css_parser_t *parser)
 

Macro Definition Documentation

◆ lxb_css_parser_string_dup_m

#define lxb_css_parser_string_dup_m ( parser,
token,
_str,
mraw )
Value:
do { \
(_str), (mraw)) != LXB_STATUS_OK) \
{ \
return lxb_css_parser_fail((parser), \
} \
} \
while (false)
@ LXB_STATUS_ERROR_MEMORY_ALLOCATION
Definition base.h:51
@ LXB_STATUS_OK
Definition base.h:49
bool lxb_css_parser_fail(lxb_css_parser_t *parser, lxb_status_t status)
Definition parser.c:264
lxb_status_t lxb_css_syntax_token_string_dup(lxb_css_syntax_token_string_t *token, lexbor_str_t *str, lexbor_mraw_t *mraw)
Definition token.c:96
#define lxb_css_syntax_token_string(token)
Definition token.h:25

Definition at line 89 of file parser.h.

◆ lxb_css_parser_token_m

#define lxb_css_parser_token_m ( parser,
token )
Value:
do { \
token = lxb_css_syntax_parser_token(parser); \
if (token == NULL) { \
return lxb_css_parser_fail((parser), (parser)->tkz->status); \
} \
} \
while (false)
const lxb_css_syntax_token_t * lxb_css_syntax_parser_token(lxb_css_parser_t *parser)
Definition parser.c:142
#define NULL
Definition gdcache.h:45

Definition at line 21 of file parser.h.

◆ lxb_css_parser_token_next_m

#define lxb_css_parser_token_next_m ( parser,
token )
Value:
do { \
token = lxb_css_syntax_token_next((parser)->tkz); \
if (token == NULL) { \
return lxb_css_parser_fail((parser), (parser)->tkz->status); \
} \
} \
while (false)
lxb_css_syntax_token_t * lxb_css_syntax_token_next(lxb_css_syntax_tokenizer_t *tkz)
Definition token.c:57

Definition at line 30 of file parser.h.

◆ lxb_css_parser_token_status_m

#define lxb_css_parser_token_status_m ( parser,
token )
Value:
do { \
if ((token = lxb_css_syntax_parser_token(parser)) == NULL) { \
return parser->tkz->status; \
} \
} \
while (false)

Definition at line 56 of file parser.h.

◆ lxb_css_parser_token_status_next_m

#define lxb_css_parser_token_status_next_m ( parser,
token )
Value:
do { \
token = lxb_css_syntax_token_next((parser)->tkz); \
if (token == NULL) { \
return parser->tkz->status; \
} \
} \
while (false)

Definition at line 64 of file parser.h.

◆ lxb_css_parser_token_status_wo_ws_m

#define lxb_css_parser_token_status_wo_ws_m ( parser,
token )
Value:
do { \
if ((token = lxb_css_syntax_parser_token(parser)) == NULL) { \
return parser->tkz->status; \
} \
\
if (token->type == LXB_CSS_SYNTAX_TOKEN_WHITESPACE) { \
lxb_css_syntax_parser_consume(parser); \
if ((token = lxb_css_syntax_parser_token(parser)) == NULL) { \
return parser->tkz->status; \
} \
} \
} \
while (false)
@ LXB_CSS_SYNTAX_TOKEN_WHITESPACE
Definition token.h:81

Definition at line 74 of file parser.h.

◆ lxb_css_parser_token_wo_ws_m

#define lxb_css_parser_token_wo_ws_m ( parser,
token )
Value:
do { \
token = lxb_css_syntax_parser_token(parser); \
if (token == NULL) { \
return lxb_css_parser_fail((parser), (parser)->tkz->status); \
} \
\
if (token->type == LXB_CSS_SYNTAX_TOKEN_WHITESPACE) { \
lxb_css_syntax_parser_consume(parser); \
token = lxb_css_syntax_parser_token(parser); \
if (token == NULL) { \
return lxb_css_parser_fail((parser), (parser)->tkz->status); \
} \
} \
} \
while (false)

Definition at line 39 of file parser.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
LXB_CSS_SYNTAX_PARSER_ERROR_UNDEF 
LXB_CSS_SYNTAX_PARSER_ERROR_EOINATRU 
LXB_CSS_SYNTAX_PARSER_ERROR_EOINQURU 
LXB_CSS_SYNTAX_PARSER_ERROR_EOINSIBL 
LXB_CSS_SYNTAX_PARSER_ERROR_EOINFU 
LXB_CSS_SYNTAX_PARSER_ERROR_EOBEPARU 
LXB_CSS_SYNTAX_PARSER_ERROR_UNTOAFPARU 
LXB_CSS_SYNTAX_PARSER_ERROR_EOBEPACOVA 
LXB_CSS_SYNTAX_PARSER_ERROR_UNTOAFPACOVA 
LXB_CSS_SYNTAX_PARSER_ERROR_UNTOINDE 

Definition at line 101 of file parser.h.

◆ lxb_css_parser_stage_t

Enumerator
LXB_CSS_PARSER_CLEAN 
LXB_CSS_PARSER_RUN 
LXB_CSS_PARSER_STOP 
LXB_CSS_PARSER_END 

Definition at line 123 of file parser.h.

Function Documentation

◆ lxb_css_parser_at_rule_offset()

lxb_inline const lxb_css_syntax_at_rule_offset_t * lxb_css_parser_at_rule_offset ( lxb_css_parser_t * parser)

Definition at line 495 of file parser.h.

◆ lxb_css_parser_buffer()

lxb_inline const lxb_char_t * lxb_css_parser_buffer ( lxb_css_parser_t * parser,
size_t * length )

Definition at line 328 of file parser.h.

◆ lxb_css_parser_buffer_set()

lxb_inline void lxb_css_parser_buffer_set ( lxb_css_parser_t * parser,
const lxb_char_t * data,
size_t length )

Definition at line 338 of file parser.h.

◆ lxb_css_parser_clean()

LXB_API void lxb_css_parser_clean ( lxb_css_parser_t * parser)

Definition at line 104 of file parser.c.

◆ lxb_css_parser_context()

lxb_inline void * lxb_css_parser_context ( lxb_css_parser_t * parser)

Definition at line 371 of file parser.h.

◆ lxb_css_parser_context_set()

lxb_inline void lxb_css_parser_context_set ( lxb_css_parser_t * parser,
void * context )

Definition at line 377 of file parser.h.

◆ lxb_css_parser_create()

LXB_API lxb_css_parser_t * lxb_css_parser_create ( void )

Definition at line 13 of file parser.c.

◆ lxb_css_parser_current_rule()

lxb_inline lxb_css_syntax_rule_t * lxb_css_parser_current_rule ( lxb_css_parser_t * parser)

Definition at line 383 of file parser.h.

◆ lxb_css_parser_declarations_offset()

lxb_inline const lxb_css_syntax_declarations_offset_t * lxb_css_parser_declarations_offset ( lxb_css_parser_t * parser)

Definition at line 507 of file parser.h.

◆ lxb_css_parser_destroy()

LXB_API lxb_css_parser_t * lxb_css_parser_destroy ( lxb_css_parser_t * parser,
bool self_destroy )

Definition at line 130 of file parser.c.

◆ lxb_css_parser_erase()

LXB_API void lxb_css_parser_erase ( lxb_css_parser_t * parser)

Definition at line 120 of file parser.c.

◆ lxb_css_parser_fail()

LXB_API bool lxb_css_parser_fail ( lxb_css_parser_t * parser,
lxb_status_t status )

Definition at line 264 of file parser.c.

◆ lxb_css_parser_failed()

LXB_API bool lxb_css_parser_failed ( lxb_css_parser_t * parser)

Definition at line 286 of file parser.c.

◆ lxb_css_parser_failed_set()

lxb_inline void lxb_css_parser_failed_set ( lxb_css_parser_t * parser,
bool is )

Definition at line 299 of file parser.h.

◆ lxb_css_parser_failed_set_by_id()

lxb_inline void lxb_css_parser_failed_set_by_id ( lxb_css_parser_t * parser,
int idx,
bool is )

Definition at line 305 of file parser.h.

◆ lxb_css_parser_init()

LXB_API lxb_status_t lxb_css_parser_init ( lxb_css_parser_t * parser,
lxb_css_syntax_tokenizer_t * tkz )

Definition at line 19 of file parser.c.

◆ lxb_css_parser_is_failed()

lxb_inline bool lxb_css_parser_is_failed ( lxb_css_parser_t * parser)

Definition at line 315 of file parser.h.

◆ lxb_css_parser_is_running()

lxb_inline bool lxb_css_parser_is_running ( lxb_css_parser_t * parser)

Definition at line 287 of file parser.h.

◆ lxb_css_parser_list_rules_offset()

lxb_inline const lxb_css_syntax_list_rules_offset_t * lxb_css_parser_list_rules_offset ( lxb_css_parser_t * parser)

Definition at line 489 of file parser.h.

◆ lxb_css_parser_log()

lxb_inline lxb_css_log_t * lxb_css_parser_log ( lxb_css_parser_t * parser)

Definition at line 466 of file parser.h.

◆ lxb_css_parser_memory()

lxb_inline lxb_css_memory_t * lxb_css_parser_memory ( lxb_css_parser_t * parser)

Definition at line 262 of file parser.h.

◆ lxb_css_parser_memory_fail()

LXB_API bool lxb_css_parser_memory_fail ( lxb_css_parser_t * parser)

Definition at line 335 of file parser.c.

◆ lxb_css_parser_memory_fail_status()

lxb_status_t lxb_css_parser_memory_fail_status ( lxb_css_parser_t * parser)

Definition at line 343 of file parser.c.

◆ lxb_css_parser_memory_set()

lxb_inline void lxb_css_parser_memory_set ( lxb_css_parser_t * parser,
lxb_css_memory_t * memory )

Definition at line 268 of file parser.h.

◆ lxb_css_parser_offset_set()

lxb_inline void lxb_css_parser_offset_set ( lxb_css_parser_t * parser,
const lxb_css_syntax_token_t * token )

Definition at line 472 of file parser.h.

◆ lxb_css_parser_qualified_rule_offset()

lxb_inline const lxb_css_syntax_qualified_offset_t * lxb_css_parser_qualified_rule_offset ( lxb_css_parser_t * parser)

Definition at line 501 of file parser.h.

◆ lxb_css_parser_rule_deep()

lxb_inline size_t lxb_css_parser_rule_deep ( lxb_css_parser_t * parser)

Definition at line 389 of file parser.h.

◆ lxb_css_parser_selectors()

lxb_inline lxb_css_selectors_t * lxb_css_parser_selectors ( lxb_css_parser_t * parser)

Definition at line 274 of file parser.h.

◆ lxb_css_parser_selectors_set()

lxb_inline void lxb_css_parser_selectors_set ( lxb_css_parser_t * parser,
lxb_css_selectors_t * selectors )

Definition at line 280 of file parser.h.

◆ lxb_css_parser_set_ok()

lxb_inline void lxb_css_parser_set_ok ( lxb_css_parser_t * parser)

Definition at line 321 of file parser.h.

◆ lxb_css_parser_state()

lxb_inline lxb_css_parser_state_f lxb_css_parser_state ( lxb_css_parser_t * parser)

Definition at line 345 of file parser.h.

◆ lxb_css_parser_state_block_set()

lxb_inline void lxb_css_parser_state_block_set ( lxb_css_parser_t * parser,
lxb_css_parser_state_f state )

Definition at line 357 of file parser.h.

◆ lxb_css_parser_state_set()

lxb_inline void lxb_css_parser_state_set ( lxb_css_parser_t * parser,
lxb_css_parser_state_f state )

Definition at line 351 of file parser.h.

◆ lxb_css_parser_state_value_set()

lxb_inline void lxb_css_parser_state_value_set ( lxb_css_parser_t * parser,
lxb_css_parser_state_f state )

Definition at line 364 of file parser.h.

◆ lxb_css_parser_states_change_back()

lxb_inline void lxb_css_parser_states_change_back ( lxb_css_parser_t * parser,
lxb_css_parser_state_f state )

Definition at line 427 of file parser.h.

◆ lxb_css_parser_states_clean()

lxb_inline void lxb_css_parser_states_clean ( lxb_css_parser_t * parser)

Definition at line 434 of file parser.h.

◆ lxb_css_parser_states_current()

lxb_inline lxb_css_parser_state_t * lxb_css_parser_states_current ( lxb_css_parser_t * parser)

Definition at line 440 of file parser.h.

◆ lxb_css_parser_states_down()

lxb_inline void lxb_css_parser_states_down ( lxb_css_parser_t * parser)

Definition at line 460 of file parser.h.

◆ lxb_css_parser_states_next()

LXB_API lxb_css_parser_state_t * lxb_css_parser_states_next ( lxb_css_parser_t * parser,
lxb_css_parser_state_f next,
lxb_css_parser_state_f back,
void * ctx,
bool root )

Definition at line 208 of file parser.c.

◆ lxb_css_parser_states_pop()

lxb_inline lxb_css_parser_state_t * lxb_css_parser_states_pop ( lxb_css_parser_t * parser)

Definition at line 395 of file parser.h.

◆ lxb_css_parser_states_push()

LXB_API lxb_css_parser_state_t * lxb_css_parser_states_push ( lxb_css_parser_t * parser,
lxb_css_parser_state_f state,
void * context,
bool stop )

Definition at line 166 of file parser.c.

◆ lxb_css_parser_states_set()

lxb_inline void lxb_css_parser_states_set ( lxb_css_parser_state_t * states,
lxb_css_parser_state_f state,
void * context )

Definition at line 446 of file parser.h.

◆ lxb_css_parser_states_set_back()

lxb_inline bool lxb_css_parser_states_set_back ( lxb_css_parser_t * parser)

Definition at line 415 of file parser.h.

◆ lxb_css_parser_states_to_root()

lxb_inline lxb_css_parser_state_t * lxb_css_parser_states_to_root ( lxb_css_parser_t * parser)

Definition at line 401 of file parser.h.

◆ lxb_css_parser_states_up()

lxb_inline void lxb_css_parser_states_up ( lxb_css_parser_t * parser)

Definition at line 454 of file parser.h.

◆ lxb_css_parser_status()

lxb_inline lxb_status_t lxb_css_parser_status ( lxb_css_parser_t * parser)

Definition at line 256 of file parser.h.

◆ lxb_css_parser_status_is_unexpected_data()

lxb_inline bool lxb_css_parser_status_is_unexpected_data ( lxb_css_parser_t * parser)

Definition at line 293 of file parser.h.

◆ lxb_css_parser_stop()

LXB_API bool lxb_css_parser_stop ( lxb_css_parser_t * parser)

Definition at line 257 of file parser.c.

◆ lxb_css_parser_success()

LXB_API bool lxb_css_parser_success ( lxb_css_parser_t * parser)

Definition at line 279 of file parser.c.

◆ lxb_css_parser_types_push()

LXB_API lxb_status_t lxb_css_parser_types_push ( lxb_css_parser_t * parser,
lxb_css_syntax_token_type_t type )

Definition at line 225 of file parser.c.

◆ lxb_css_parser_unexpected()

LXB_API bool lxb_css_parser_unexpected ( lxb_css_parser_t * parser)

Definition at line 272 of file parser.c.

◆ lxb_css_parser_unexpected_data()

LXB_API bool lxb_css_parser_unexpected_data ( lxb_css_parser_t * parser,
const lxb_css_syntax_token_t * token )

Definition at line 307 of file parser.c.

◆ lxb_css_parser_unexpected_data_status()

LXB_API lxb_status_t lxb_css_parser_unexpected_data_status ( lxb_css_parser_t * parser,
const lxb_css_syntax_token_t * token )

Definition at line 321 of file parser.c.

◆ lxb_css_parser_unexpected_status()

LXB_API lxb_status_t lxb_css_parser_unexpected_status ( lxb_css_parser_t * parser)

Definition at line 297 of file parser.c.