Lines Matching refs:cursor
779 struct token *cursor; in parse() local
785 cursor = type->name; in parse()
787 if (cursor[0].token_type != TOKEN_TYPE_NAME || in parse()
788 cursor[1].token_type != TOKEN_ASSIGNMENT) in parse()
790 cursor += 2; in parse()
792 type->element = parse_type(&cursor, type[1].name, NULL); in parse()
795 if (cursor != type[1].name) { in parse()
797 filename, cursor->line, in parse()
798 (int)cursor->size, (int)cursor->size, cursor->value); in parse()
832 struct token *cursor = *_cursor; in parse_type() local
837 top = element = alloc_elem(cursor); in parse_type()
840 element->tag = token_to_tag[cursor->token_type]; in parse_type()
844 if (cursor->token_type == TOKEN_OPEN_SQUARE) { in parse_type()
845 cursor++; in parse_type()
846 if (cursor >= end) in parse_type()
848 switch (cursor->token_type) { in parse_type()
851 cursor++; in parse_type()
855 cursor++; in parse_type()
862 cursor++; in parse_type()
866 filename, cursor->line, in parse_type()
867 (int)cursor->size, (int)cursor->size, cursor->value); in parse_type()
871 if (cursor >= end) in parse_type()
873 if (cursor->token_type != TOKEN_NUMBER) { in parse_type()
875 filename, cursor->line, in parse_type()
876 (int)cursor->size, (int)cursor->size, cursor->value); in parse_type()
881 element->tag |= strtoul(cursor->value, &p, 10); in parse_type()
882 if (p - cursor->value != cursor->size) in parse_type()
884 cursor++; in parse_type()
886 if (cursor >= end) in parse_type()
888 if (cursor->token_type != TOKEN_CLOSE_SQUARE) { in parse_type()
890 filename, cursor->line, in parse_type()
891 (int)cursor->size, (int)cursor->size, cursor->value); in parse_type()
894 cursor++; in parse_type()
895 if (cursor >= end) in parse_type()
901 if (cursor->token_type == DIRECTIVE_IMPLICIT) { in parse_type()
904 cursor++; in parse_type()
905 if (cursor >= end) in parse_type()
907 } else if (cursor->token_type == DIRECTIVE_EXPLICIT) { in parse_type()
909 cursor++; in parse_type()
910 if (cursor >= end) in parse_type()
918 element->children = alloc_elem(cursor); in parse_type()
922 element->tag = token_to_tag[cursor->token_type]; in parse_type()
927 element->type = cursor; in parse_type()
928 switch (cursor->token_type) { in parse_type()
931 cursor++; in parse_type()
939 cursor++; in parse_type()
962 cursor++; in parse_type()
968 cursor++; in parse_type()
969 if (cursor >= end) in parse_type()
971 if (cursor->token_type != DIRECTIVE_STRING) in parse_type()
973 cursor++; in parse_type()
978 cursor++; in parse_type()
979 if (cursor >= end) in parse_type()
981 if (cursor->token_type != DIRECTIVE_IDENTIFIER) in parse_type()
983 cursor++; in parse_type()
988 ref = bsearch(cursor, type_index, nr_types, sizeof(type_index[0]), in parse_type()
992 filename, cursor->line, in parse_type()
993 (int)cursor->size, (int)cursor->size, cursor->value); in parse_type()
996 cursor->type = *ref; in parse_type()
998 cursor++; in parse_type()
1003 cursor++; in parse_type()
1004 element->children = parse_compound(&cursor, end, 1); in parse_type()
1010 cursor++; in parse_type()
1011 if (cursor >= end) in parse_type()
1013 if (cursor->token_type == DIRECTIVE_OF) { in parse_type()
1015 cursor++; in parse_type()
1016 if (cursor >= end) in parse_type()
1018 element->children = parse_type(&cursor, end, NULL); in parse_type()
1020 element->children = parse_compound(&cursor, end, 0); in parse_type()
1027 cursor++; in parse_type()
1028 if (cursor >= end) in parse_type()
1030 if (cursor->token_type == DIRECTIVE_OF) { in parse_type()
1032 cursor++; in parse_type()
1033 if (cursor >= end) in parse_type()
1035 element->children = parse_type(&cursor, end, NULL); in parse_type()
1037 element->children = parse_compound(&cursor, end, 1); in parse_type()
1043 filename, cursor->line, in parse_type()
1044 (int)cursor->size, (int)cursor->size, cursor->value); in parse_type()
1049 if (cursor < end && (cursor->token_type == DIRECTIVE_OPTIONAL || in parse_type()
1050 cursor->token_type == DIRECTIVE_DEFAULT) in parse_type()
1052 cursor++; in parse_type()
1056 if (cursor < end && cursor->token_type == TOKEN_OPEN_ACTION) { in parse_type()
1057 cursor++; in parse_type()
1058 if (cursor >= end) in parse_type()
1060 if (cursor->token_type != TOKEN_ELEMENT_NAME) { in parse_type()
1062 filename, cursor->line, in parse_type()
1063 (int)cursor->size, (int)cursor->size, cursor->value); in parse_type()
1067 action = malloc(sizeof(struct action) + cursor->size + 1); in parse_type()
1073 memcpy(action->name, cursor->value, cursor->size); in parse_type()
1074 action->name[cursor->size] = 0; in parse_type()
1099 cursor->action = action; in parse_type()
1100 cursor++; in parse_type()
1101 if (cursor >= end) in parse_type()
1103 if (cursor->token_type != TOKEN_CLOSE_ACTION) { in parse_type()
1105 filename, cursor->line, in parse_type()
1106 (int)cursor->size, (int)cursor->size, cursor->value); in parse_type()
1109 cursor++; in parse_type()
1112 *_cursor = cursor; in parse_type()
1117 filename, cursor->line, in parse_type()
1118 (int)cursor->size, (int)cursor->size, cursor->value); in parse_type()
1133 struct token *cursor = *_cursor, *name; in parse_compound() local
1135 if (cursor->token_type != TOKEN_OPEN_CURLY) { in parse_compound()
1137 filename, cursor->line, in parse_compound()
1138 (int)cursor->size, (int)cursor->size, cursor->value); in parse_compound()
1141 cursor++; in parse_compound()
1142 if (cursor >= end) in parse_compound()
1145 if (cursor->token_type == TOKEN_OPEN_CURLY) { in parse_compound()
1147 filename, cursor->line); in parse_compound()
1153 if (cursor->token_type == TOKEN_ELEMENT_NAME) { in parse_compound()
1154 name = cursor; in parse_compound()
1155 cursor++; in parse_compound()
1156 if (cursor >= end) in parse_compound()
1160 element = parse_type(&cursor, end, name); in parse_compound()
1167 if (cursor >= end) in parse_compound()
1169 if (cursor->token_type != TOKEN_COMMA) in parse_compound()
1171 cursor++; in parse_compound()
1172 if (cursor >= end) in parse_compound()
1178 if (cursor->token_type != TOKEN_CLOSE_CURLY) { in parse_compound()
1180 filename, cursor->line, in parse_compound()
1181 (int)cursor->size, (int)cursor->size, cursor->value); in parse_compound()
1184 cursor++; in parse_compound()
1186 *_cursor = cursor; in parse_compound()