Lines Matching refs:B

401 varline ::= key(A) ASSIGN expression(B). {  in key()
403 buffer_copy_buffer(&B->key, A); in key()
409 } else if (NULL == array_get_element_klen(ctx->current->value, BUF_PTR_LEN(&B->key))) { in key()
410 array_insert_unique(ctx->current->value, B); in key()
411 B = NULL; in key()
415 ctx->current->key.ptr, B->key.ptr); in key()
421 if (B) B->fn->free(B); in key()
422 B = NULL; in key()
425 varline ::= key(A) FORCE_ASSIGN expression(B). { in key()
433 buffer_copy_buffer(&B->key, A); in key()
434 array_replace(ctx->current->value, B); in key()
435 B = NULL; in key()
440 if (B) B->fn->free(B); in key()
441 B = NULL; in key()
444 varline ::= key(A) APPEND expression(B). { in key()
455 du = configparser_merge_data(du, B); in key()
464 buffer_copy_buffer(&B->key, A); in key()
465 array_insert_unique(ctx->current->value, B); in key()
466 B = NULL; in key()
471 if (B) B->fn->free(B); in key()
472 B = NULL; in key()
475 key(A) ::= LKEY(B). { in key()
476 if (strchr(B->ptr, '.') == NULL) { in key()
478 buffer_append_string_buffer(A, B); in key()
480 A = B; in key()
481 B = NULL; in key()
483 buffer_free(B); in key()
484 B = NULL; in key()
487 expression(A) ::= expression(B) PLUS value(C). { in expression()
490 A = configparser_merge_data(B, C); in expression()
491 B = NULL; in expression()
496 if (B) B->fn->free(B); in expression()
497 B = NULL; in expression()
502 expression(A) ::= value(B). { in expression()
503 A = B; in expression()
504 B = NULL; in expression()
507 value(A) ::= key(B). { in value()
510 if (strncmp(B->ptr, "env.", sizeof("env.") - 1) == 0) { in value()
513 if (NULL != (env = getenv(B->ptr + 4))) { in value()
520 fprintf(stderr, "Undefined env variable: %s\n", B->ptr + 4); in value()
523 } else if (NULL == (A = configparser_get_variable(ctx, B))) { in value()
524 fprintf(stderr, "Undefined config variable: %s\n", B->ptr); in value()
528 buffer_free(B); in value()
529 B = NULL; in value()
532 value(A) ::= STRING(B). { in value()
535 memcpy(&((data_string *)A)->value, B, sizeof(*B)); in value()
536 free(B); in value()
537 B = NULL; in value()
540 value(A) ::= INTEGER(B). { in value()
544 ((data_integer *)(A))->value = strtol(B->ptr, &endptr, 10); in value()
546 if (endptr != B->ptr) while (isspace(*(unsigned char *)endptr)) endptr++; in value()
548 fprintf(stderr, "error parsing number: '%s'\n", B->ptr); in value()
551 buffer_free(B); in value()
552 B = NULL; in value()
554 value(A) ::= array(B). { in value()
557 memcpy(&((data_array *)(A))->value, B, sizeof(*B)); in value()
558 free(B); in value()
559 B = NULL; in value()
564 array(A) ::= LPARAN aelements(B) RPARAN. { in array()
565 A = B; in array()
566 B = NULL; in array()
569 aelements(A) ::= aelements(C) COMMA aelement(B). { in aelements()
572 if (buffer_is_unset(&B->key) || in aelements()
573 NULL == array_get_element_klen(C, BUF_PTR_LEN(&B->key))) { in aelements()
574 array_insert_unique(C, B); in aelements()
575 B = NULL; in aelements()
578 B->key.ptr); in aelements()
587 if (B) B->fn->free(B); in aelements()
588 B = NULL; in aelements()
596 aelements(A) ::= aelement(B). { in aelements()
600 array_insert_unique(A, B); in aelements()
601 B = NULL; in aelements()
603 if (B) B->fn->free(B); in aelements()
604 B = NULL; in aelements()
607 aelement(A) ::= expression(B). { in aelement()
608 A = B; in aelement()
609 B = NULL; in aelement()
611 aelement(A) ::= stringop(B) ARRAY_ASSIGN expression(C). { in aelement()
614 buffer_copy_buffer(&C->key, B); in aelement()
621 buffer_free(B); in aelement()
622 B = NULL; in aelement()
639 condlines(A) ::= condlines(B) eols ELSE condline(C). { in condlines()
642 if (B->context_ndx >= C->context_ndx) { in condlines()
646 if (B->cond == CONFIG_COND_ELSE) { in condlines()
650 C->prev = B; in condlines()
651 B->next = C; in condlines()
654 B = NULL; in condlines()
658 condlines(A) ::= condlines(B) eols ELSE cond_else(C). { in condlines()
661 if (B->context_ndx >= C->context_ndx) { in condlines()
665 if (B->cond == CONFIG_COND_ELSE) { in condlines()
675 buffer_copy_buffer(&C->key, &B->key); in condlines()
676 C->comp_key = C->key.ptr + (B->comp_key - B->key.ptr); in condlines()
677 C->comp = B->comp; in condlines()
680 pos = buffer_clen(&C->key) - buffer_clen(&B->string) - 5; in condlines()
681 switch(B->cond) { in condlines()
713 C->prev = B; in condlines()
714 B->next = C; in condlines()
724 B = NULL; in condlines()
728 condlines(A) ::= condline(B). { in condlines()
729 A = B; in condlines()
730 B = NULL; in condlines()
747 context ::= DOLLAR SRVVARNAME(B) LBRACKET stringop(C) RBRACKET cond(E) expression(D). { in SRVVARNAME() argument
755 configparser_parse_condition(ctx, B, C, E, &((data_string *)D)->value); in SRVVARNAME()
758 buffer_free(B); in SRVVARNAME()
759 B = NULL; in SRVVARNAME()
791 stringop(A) ::= expression(B). { in stringop()
794 if (B->type == TYPE_STRING) { in stringop()
795 buffer_copy_buffer((A = buffer_init()), &((data_string*)B)->value); in stringop()
796 } else if (B->type == TYPE_INTEGER) { in stringop()
798 buffer_append_int(A, ((data_integer *)B)->value); in stringop()
804 if (B) B->fn->free(B); in stringop()
805 B = NULL; in stringop()