Lines Matching refs:list
55 _string_list_append_item (string_list_t *list, const char *str);
58 _string_list_contains (string_list_t *list, const char *member, int *index);
61 _string_list_length (string_list_t *list);
70 _argument_list_append (argument_list_t *list, token_list_t *argument);
73 _argument_list_length (argument_list_t *list);
76 _argument_list_member_at (argument_list_t *list, int index);
89 _token_list_append (token_list_t *list, token_t *token);
92 _token_list_append_list (token_list_t *list, token_list_t *tail);
108 /* Expand list, and begin lexing from the result (after first
114 token_list_t *list);
116 /* Perform macro expansion in-place on the given list. */
119 token_list_t *list);
123 token_list_t *list);
140 glcpp_parser_lex_from (glcpp_parser_t *parser, token_list_t *list);
595 string_list_t *list;
597 list = ralloc (ctx, string_list_t);
598 list->head = NULL;
599 list->tail = NULL;
601 return list;
605 _string_list_append_item (string_list_t *list, const char *str)
609 node = ralloc (list, string_node_t);
614 if (list->head == NULL) {
615 list->head = node;
617 list->tail->next = node;
620 list->tail = node;
624 _string_list_contains (string_list_t *list, const char *member, int *index)
629 if (list == NULL)
632 for (i = 0, node = list->head; node; i++, node = node->next) {
644 _string_list_length (string_list_t *list)
649 if (list == NULL)
652 for (node = list->head; node; node = node->next)
679 * list). */
686 list;
688 list = ralloc (ctx, argument_list_t);
689 list->head = NULL;
690 list->tail = NULL;
692 return list;
696 _argument_list_append (argument_list_t *list, token_list_t *argument)
700 node = ralloc (list, argument_node_t);
705 if (list->head == NULL) {
706 list->head = node;
708 list->tail->next = node;
711 list->tail = node;
715 _argument_list_length (argument_list_t *list)
720 if (list == NULL)
723 for (node = list->head; node; node = node->next)
730 _argument_list_member_at (argument_list_t *list, int index)
735 if (list == NULL)
738 node = list->head;
781 token_list_t *list;
783 list = ralloc (ctx, token_list_t);
784 list->head = NULL;
785 list->tail = NULL;
786 list->non_space_tail = NULL;
788 return list;
792 _token_list_append (token_list_t *list, token_t *token)
796 node = ralloc (list, token_node_t);
800 if (list->head == NULL) {
801 list->head = node;
803 list->tail->next = node;
806 list->tail = node;
808 list->non_space_tail = node;
812 _token_list_append_list (token_list_t *list, token_list_t *tail)
817 if (list->head == NULL) {
818 list->head = tail->head;
820 list->tail->next = tail->head;
823 list->tail = tail->tail;
824 list->non_space_tail = tail->non_space_tail;
847 _token_list_trim_trailing_space (token_list_t *list)
851 if (list->non_space_tail) {
852 tail = list->non_space_tail->next;
853 list->non_space_tail->next = NULL;
854 list->tail = list->non_space_tail;
1088 _token_list_print (glcpp_parser_t *parser, token_list_t *list)
1092 if (list == NULL)
1095 for (node = list->head; node; node = node->next)
1109 token_list_t *list;
1113 list = _token_list_create(parser);
1114 _token_list_append(list, tok);
1115 _define_object_macro(parser, NULL, name, list);
1299 token_list_t *list;
1302 list = _token_list_create (ctx);
1303 space = _token_create_ival (list, SPACE, SPACE);
1304 _token_list_append (list, space);
1306 return list;
1309 /* Perform macro expansion on 'list', placing the resulting tokens
1310 * into a new list which is initialized with a first token of type
1311 * 'head_token_type'. Then begin lexing from the resulting list,
1312 * (return to the current lexing source when this list is exhausted).
1317 token_list_t *list)
1325 _glcpp_parser_expand_token_list (parser, list);
1326 _token_list_append_list (expanded, list);
1331 _glcpp_parser_apply_pastes (glcpp_parser_t *parser, token_list_t *list)
1335 node = list->head;
1365 if (next_non_space == list->tail)
1366 list->tail = node;
1369 list->non_space_tail = list->tail;
1379 * argument list).
1384 * Returns the token list that results from the expansion and sets
1385 * *last to the last node in the list that was consumed by the
1441 /* Perform argument substitution on the replacement list. */
1494 * Otherwise, returns the token list that results from the expansion
1495 * and sets *last to the last node in the list that was consumed by
1568 /* Push a new identifier onto the parser's active list.
1570 * Here, 'marker' is the token node that appears in the list after the
1571 * expansion of 'identifier'. That is, when the list iterator begins
1621 /* Walk over the token list replacing nodes with their expansion.
1624 * 'list' itself;
1628 token_list_t *list)
1635 if (list == NULL)
1638 _token_list_trim_trailing_space (list);
1641 node = list->head;
1663 /* Splice expansion into list, supporting a
1670 list->head = expansion->head;
1672 if (last == list->tail)
1673 list->tail = expansion->tail;
1678 list->head = last->next;
1679 if (last == list->tail)
1680 list->tail = NULL;
1685 node = node_prev ? node_prev->next : list->head;
1689 * active list. That is, pop until the list looks like it did
1694 list->non_space_tail = list->tail;
1699 token_list_t *list)
1701 if (list == NULL)
1704 _glcpp_parser_expand_token_list (parser, list);
1706 _token_list_trim_trailing_space (list);
1708 _token_list_print (parser, list);
1885 glcpp_parser_lex_from (glcpp_parser_t *parser, token_list_t *list)
1891 /* Copy list, eliminating any space tokens. */
1894 for (node = list->head; node; node = node->next) {
1900 ralloc_free (list);
1904 /* It's possible the list consisted of nothing but whitespace. */