Lines Matching refs:tok
105 struct token tok; in add_hll_linemark() local
109 cil_lexer_next(&tok); in add_hll_linemark()
110 hll_type = cil_strpool_add(tok.value); in add_hll_linemark()
119 create_node(&node, *current, tok.line, *hll_lineno, NULL); in add_hll_linemark()
123 create_node(&node, *current, tok.line, *hll_lineno, CIL_KEY_SRC_INFO); in add_hll_linemark()
126 create_node(&node, *current, tok.line, *hll_lineno, CIL_KEY_SRC_HLL); in add_hll_linemark()
138 cil_lexer_next(&tok); in add_hll_linemark()
139 if (tok.type != SYMBOL) { in add_hll_linemark()
143 *hll_lineno = strtol(tok.value, &end, 10); in add_hll_linemark()
151 cil_lexer_next(&tok); in add_hll_linemark()
152 if (tok.type != SYMBOL && tok.type != QSTRING) { in add_hll_linemark()
157 if (tok.type == QSTRING) { in add_hll_linemark()
158 tok.value[strlen(tok.value) - 1] = '\0'; in add_hll_linemark()
159 tok.value = tok.value+1; in add_hll_linemark()
162 hll_file = cil_strpool_add(tok.value); in add_hll_linemark()
164 create_node(&node, *current, tok.line, *hll_lineno, hll_file); in add_hll_linemark()
168 cil_lexer_next(&tok); in add_hll_linemark()
169 if (tok.type != NEWLINE) { in add_hll_linemark()
177 cil_log(CIL_ERR, "Problem with high-level line mark at line %d of %s\n", tok.line, path); in add_hll_linemark()
211 struct token tok; in cil_parser() local
228 cil_lexer_next(&tok); in cil_parser()
229 switch (tok.type) { in cil_parser()
239 create_node(&node, current, tok.line, hll_lineno, NULL); in cil_parser()
246 cil_log(CIL_ERR, "Close parenthesis without matching open at line %d of %s\n", tok.line, path); in cil_parser()
252 tok.value[strlen(tok.value) - 1] = '\0'; in cil_parser()
253 tok.value = tok.value+1; in cil_parser()
257 cil_log(CIL_ERR, "Symbol not inside parenthesis at line %d of %s\n", tok.line, path); in cil_parser()
261 create_node(&node, current, tok.line, hll_lineno, cil_strpool_add(tok.value)); in cil_parser()
270 while (tok.type != NEWLINE && tok.type != END_OF_FILE) { in cil_parser()
271 cil_lexer_next(&tok); in cil_parser()
276 if (tok.type != END_OF_FILE) { in cil_parser()
283 cil_log(CIL_ERR, "Open parenthesis without matching close at line %d of %s\n", tok.line, path); in cil_parser()
287 …cil_log(CIL_ERR, "High-level language line marker start without close at line %d of %s\n", tok.lin… in cil_parser()
292 cil_log(CIL_ERR, "Invalid token '%s' at line %d of %s\n", tok.value, tok.line, path); in cil_parser()
295 cil_log(CIL_ERR, "Unknown token type '%d' at line %d of %s\n", tok.type, tok.line, path); in cil_parser()
299 while (tok.type != END_OF_FILE); in cil_parser()