Lines Matching refs:cursor
810 struct token *cursor; in parse() local
816 cursor = type->name; in parse()
818 if (cursor[0].token_type != TOKEN_TYPE_NAME || in parse()
819 cursor[1].token_type != TOKEN_ASSIGNMENT) in parse()
821 cursor += 2; in parse()
823 type->element = parse_type(&cursor, type[1].name, NULL); in parse()
826 if (cursor != type[1].name) { in parse()
828 filename, cursor->line, cursor->content); in parse()
862 struct token *cursor = *_cursor; in parse_type() local
867 top = element = alloc_elem(cursor); in parse_type()
870 element->tag = token_to_tag[cursor->token_type]; in parse_type()
874 if (cursor->token_type == TOKEN_OPEN_SQUARE) { in parse_type()
875 cursor++; in parse_type()
876 if (cursor >= end) in parse_type()
878 switch (cursor->token_type) { in parse_type()
881 cursor++; in parse_type()
885 cursor++; in parse_type()
892 cursor++; in parse_type()
896 filename, cursor->line, cursor->content); in parse_type()
900 if (cursor >= end) in parse_type()
902 if (cursor->token_type != TOKEN_NUMBER) { in parse_type()
904 filename, cursor->line, cursor->content); in parse_type()
909 element->tag |= strtoul(cursor->content, &p, 10); in parse_type()
911 if (p - cursor->content != cursor->size) in parse_type()
913 cursor++; in parse_type()
915 if (cursor >= end) in parse_type()
917 if (cursor->token_type != TOKEN_CLOSE_SQUARE) { in parse_type()
919 filename, cursor->line, cursor->content); in parse_type()
922 cursor++; in parse_type()
923 if (cursor >= end) in parse_type()
929 if (cursor->token_type == DIRECTIVE_IMPLICIT) { in parse_type()
932 cursor++; in parse_type()
933 if (cursor >= end) in parse_type()
935 } else if (cursor->token_type == DIRECTIVE_EXPLICIT) { in parse_type()
937 cursor++; in parse_type()
938 if (cursor >= end) in parse_type()
946 element->children = alloc_elem(cursor); in parse_type()
950 element->tag = token_to_tag[cursor->token_type]; in parse_type()
955 element->type = cursor; in parse_type()
956 switch (cursor->token_type) { in parse_type()
959 cursor++; in parse_type()
967 cursor++; in parse_type()
990 cursor++; in parse_type()
996 cursor++; in parse_type()
997 if (cursor >= end) in parse_type()
999 if (cursor->token_type != DIRECTIVE_STRING) in parse_type()
1001 cursor++; in parse_type()
1006 cursor++; in parse_type()
1007 if (cursor >= end) in parse_type()
1009 if (cursor->token_type != DIRECTIVE_IDENTIFIER) in parse_type()
1011 cursor++; in parse_type()
1016 ref = bsearch(cursor, type_index, nr_types, sizeof(type_index[0]), in parse_type()
1020 filename, cursor->line, cursor->content); in parse_type()
1023 cursor->type = *ref; in parse_type()
1025 cursor++; in parse_type()
1030 cursor++; in parse_type()
1031 element->children = parse_compound(&cursor, end, 1); in parse_type()
1037 cursor++; in parse_type()
1038 if (cursor >= end) in parse_type()
1040 if (cursor->token_type == DIRECTIVE_OF) { in parse_type()
1042 cursor++; in parse_type()
1043 if (cursor >= end) in parse_type()
1045 element->children = parse_type(&cursor, end, NULL); in parse_type()
1047 element->children = parse_compound(&cursor, end, 0); in parse_type()
1054 cursor++; in parse_type()
1055 if (cursor >= end) in parse_type()
1057 if (cursor->token_type == DIRECTIVE_OF) { in parse_type()
1059 cursor++; in parse_type()
1060 if (cursor >= end) in parse_type()
1062 element->children = parse_type(&cursor, end, NULL); in parse_type()
1064 element->children = parse_compound(&cursor, end, 1); in parse_type()
1070 filename, cursor->line, cursor->content); in parse_type()
1075 if (cursor < end && (cursor->token_type == DIRECTIVE_OPTIONAL || in parse_type()
1076 cursor->token_type == DIRECTIVE_DEFAULT) in parse_type()
1078 cursor++; in parse_type()
1082 if (cursor < end && cursor->token_type == TOKEN_OPEN_ACTION) { in parse_type()
1083 cursor++; in parse_type()
1084 if (cursor >= end) in parse_type()
1086 if (cursor->token_type != TOKEN_ELEMENT_NAME) { in parse_type()
1088 filename, cursor->line, cursor->content); in parse_type()
1098 action->name = cursor->content; in parse_type()
1123 cursor->action = action; in parse_type()
1124 cursor++; in parse_type()
1125 if (cursor >= end) in parse_type()
1127 if (cursor->token_type != TOKEN_CLOSE_ACTION) { in parse_type()
1129 filename, cursor->line, cursor->content); in parse_type()
1132 cursor++; in parse_type()
1135 *_cursor = cursor; in parse_type()
1140 filename, cursor->line, cursor->content); in parse_type()
1155 struct token *cursor = *_cursor, *name; in parse_compound() local
1157 if (cursor->token_type != TOKEN_OPEN_CURLY) { in parse_compound()
1159 filename, cursor->line, cursor->content); in parse_compound()
1162 cursor++; in parse_compound()
1163 if (cursor >= end) in parse_compound()
1166 if (cursor->token_type == TOKEN_OPEN_CURLY) { in parse_compound()
1168 filename, cursor->line); in parse_compound()
1174 if (cursor->token_type == TOKEN_ELEMENT_NAME) { in parse_compound()
1175 name = cursor; in parse_compound()
1176 cursor++; in parse_compound()
1177 if (cursor >= end) in parse_compound()
1181 element = parse_type(&cursor, end, name); in parse_compound()
1188 if (cursor >= end) in parse_compound()
1190 if (cursor->token_type != TOKEN_COMMA) in parse_compound()
1192 cursor++; in parse_compound()
1193 if (cursor >= end) in parse_compound()
1199 if (cursor->token_type != TOKEN_CLOSE_CURLY) { in parse_compound()
1201 filename, cursor->line, cursor->content); in parse_compound()
1204 cursor++; in parse_compound()
1206 *_cursor = cursor; in parse_compound()