Lines Matching refs:cursor
806 struct token *cursor; in parse() local
812 cursor = type->name; in parse()
814 if (cursor[0].token_type != TOKEN_TYPE_NAME || in parse()
815 cursor[1].token_type != TOKEN_ASSIGNMENT) in parse()
817 cursor += 2; in parse()
819 type->element = parse_type(&cursor, type[1].name, NULL); in parse()
822 if (cursor != type[1].name) { in parse()
824 filename, cursor->line, cursor->content); in parse()
858 struct token *cursor = *_cursor; in parse_type() local
866 element->tag = token_to_tag[cursor->token_type]; in parse_type()
870 if (cursor->token_type == TOKEN_OPEN_SQUARE) { in parse_type()
871 cursor++; in parse_type()
872 if (cursor >= end) in parse_type()
874 switch (cursor->token_type) { in parse_type()
877 cursor++; in parse_type()
881 cursor++; in parse_type()
888 cursor++; in parse_type()
892 filename, cursor->line, cursor->content); in parse_type()
896 if (cursor >= end) in parse_type()
898 if (cursor->token_type != TOKEN_NUMBER) { in parse_type()
900 filename, cursor->line, cursor->content); in parse_type()
905 element->tag |= strtoul(cursor->content, &p, 10); in parse_type()
907 if (p - cursor->content != cursor->size) in parse_type()
909 cursor++; in parse_type()
911 if (cursor >= end) in parse_type()
913 if (cursor->token_type != TOKEN_CLOSE_SQUARE) { in parse_type()
915 filename, cursor->line, cursor->content); in parse_type()
918 cursor++; in parse_type()
919 if (cursor >= end) in parse_type()
925 if (cursor->token_type == DIRECTIVE_IMPLICIT) { in parse_type()
928 cursor++; in parse_type()
929 if (cursor >= end) in parse_type()
931 } else if (cursor->token_type == DIRECTIVE_EXPLICIT) { in parse_type()
933 cursor++; in parse_type()
934 if (cursor >= end) in parse_type()
946 element->tag = token_to_tag[cursor->token_type]; in parse_type()
951 element->type = cursor; in parse_type()
952 switch (cursor->token_type) { in parse_type()
955 cursor++; in parse_type()
963 cursor++; in parse_type()
986 cursor++; in parse_type()
992 cursor++; in parse_type()
993 if (cursor >= end) in parse_type()
995 if (cursor->token_type != DIRECTIVE_STRING) in parse_type()
997 cursor++; in parse_type()
1002 cursor++; in parse_type()
1003 if (cursor >= end) in parse_type()
1005 if (cursor->token_type != DIRECTIVE_IDENTIFIER) in parse_type()
1007 cursor++; in parse_type()
1012 ref = bsearch(cursor, type_index, nr_types, sizeof(type_index[0]), in parse_type()
1016 filename, cursor->line, cursor->content); in parse_type()
1019 cursor->type = *ref; in parse_type()
1021 cursor++; in parse_type()
1026 cursor++; in parse_type()
1027 element->children = parse_compound(&cursor, end, 1); in parse_type()
1033 cursor++; in parse_type()
1034 if (cursor >= end) in parse_type()
1036 if (cursor->token_type == DIRECTIVE_OF) { in parse_type()
1038 cursor++; in parse_type()
1039 if (cursor >= end) in parse_type()
1041 element->children = parse_type(&cursor, end, NULL); in parse_type()
1043 element->children = parse_compound(&cursor, end, 0); in parse_type()
1050 cursor++; in parse_type()
1051 if (cursor >= end) in parse_type()
1053 if (cursor->token_type == DIRECTIVE_OF) { in parse_type()
1055 cursor++; in parse_type()
1056 if (cursor >= end) in parse_type()
1058 element->children = parse_type(&cursor, end, NULL); in parse_type()
1060 element->children = parse_compound(&cursor, end, 1); in parse_type()
1066 filename, cursor->line, cursor->content); in parse_type()
1071 if (cursor < end && (cursor->token_type == DIRECTIVE_OPTIONAL || in parse_type()
1072 cursor->token_type == DIRECTIVE_DEFAULT) in parse_type()
1074 cursor++; in parse_type()
1078 if (cursor < end && cursor->token_type == TOKEN_OPEN_ACTION) { in parse_type()
1079 cursor++; in parse_type()
1080 if (cursor >= end) in parse_type()
1082 if (cursor->token_type != TOKEN_ELEMENT_NAME) { in parse_type()
1084 filename, cursor->line, cursor->content); in parse_type()
1094 action->name = cursor->content; in parse_type()
1119 cursor->action = action; in parse_type()
1120 cursor++; in parse_type()
1121 if (cursor >= end) in parse_type()
1123 if (cursor->token_type != TOKEN_CLOSE_ACTION) { in parse_type()
1125 filename, cursor->line, cursor->content); in parse_type()
1128 cursor++; in parse_type()
1131 *_cursor = cursor; in parse_type()
1136 filename, cursor->line, cursor->content); in parse_type()
1151 struct token *cursor = *_cursor, *name; in parse_compound() local
1153 if (cursor->token_type != TOKEN_OPEN_CURLY) { in parse_compound()
1155 filename, cursor->line, cursor->content); in parse_compound()
1158 cursor++; in parse_compound()
1159 if (cursor >= end) in parse_compound()
1162 if (cursor->token_type == TOKEN_OPEN_CURLY) { in parse_compound()
1164 filename, cursor->line); in parse_compound()
1170 if (cursor->token_type == TOKEN_ELEMENT_NAME) { in parse_compound()
1171 name = cursor; in parse_compound()
1172 cursor++; in parse_compound()
1173 if (cursor >= end) in parse_compound()
1177 element = parse_type(&cursor, end, name); in parse_compound()
1184 if (cursor >= end) in parse_compound()
1186 if (cursor->token_type != TOKEN_COMMA) in parse_compound()
1188 cursor++; in parse_compound()
1189 if (cursor >= end) in parse_compound()
1195 if (cursor->token_type != TOKEN_CLOSE_CURLY) { in parse_compound()
1197 filename, cursor->line, cursor->content); in parse_compound()
1200 cursor++; in parse_compound()
1202 *_cursor = cursor; in parse_compound()