Home | History | Annotate | Download | only in glcpp

Lines Matching full:macro

41 		      const char *macro,
47 const char *macro,
116 /* Perform macro expansion in-place on the given list. */
240 macro_t *macro = hash_table_find (parser->defines, $2);
241 if (macro) {
243 ralloc_free (macro);
286 macro_t *macro = hash_table_find (parser->defines, $2);
288 _glcpp_parser_skip_stack_push_if (parser, & @1, macro != NULL);
291 macro_t *macro = hash_table_find (parser->defines, $2);
293 _glcpp_parser_skip_stack_push_if (parser, & @1, macro == NULL);
337 macro_t *macro = hash_table_find (parser->defines, "__VERSION__");
338 if (macro) {
340 ralloc_free (macro);
348 * fragment shader, so we always define this macro in ES2.
1213 /* Find a set of function-like macro arguments by looking for a
1229 * Macro name not followed by a '('. This is not an error, but
1230 * simply that the macro name should be treated as a non-macro.
1234 * Macro name is not followed by a balanced set of parentheses.
1309 /* Perform macro expansion on 'list', placing the resulting tokens
1359 yyerror (&node->token->location, parser, "'##' cannot appear at either end of a macro expansion\n");
1378 * function-like macro, it is not followed with a parenthesized
1382 * macro
1395 macro_t *macro;
1404 macro = hash_table_find (parser->defines, identifier);
1406 assert (macro->is_function);
1417 glcpp_error (&node->token->location, parser, "Macro %s call has unbalanced parentheses\n", identifier);
1421 /* Replace a macro defined as empty with a SPACE token. */
1422 if (macro->replacements == NULL) {
1428 _string_list_length (macro->parameters)) ||
1429 (_string_list_length (macro->parameters) == 0 &&
1434 "Error: macro %s invoked with %d arguments (expected %d)\n",
1437 _string_list_length (macro->parameters));
1444 for (node = macro->replacements->head; node; node = node->next)
1447 _string_list_contains (macro->parameters,
1489 * 'node' in the case that 'node' is a function-like macro and
1498 * As 'node' in the case of object-like macro expansion.
1501 * function-like macro expansion.
1510 macro_t *macro;
1527 macro = hash_table_find (parser->defines, identifier);
1529 /* Not a macro, so no expansion needed. */
1530 if (macro == NULL)
1533 /* Finally, don't expand this macro if we're already actively
1551 if (! macro->is_function)
1556 /* Replace a macro defined as empty with a SPACE token. */
1557 if (macro->replacements == NULL)
1560 replacement = _token_list_copy (parser, macro->replacements);
1715 /* According to the GLSL specification, macro names starting with "__"
1719 glcpp_error (loc, parser, "Macro names containing \"__\" are reserved.\n");
1722 glcpp_error (loc, parser, "Macro names starting with \"GL_\" are reserved.\n");
1747 macro_t *macro, *previous;
1752 macro = ralloc (parser, macro_t);
1754 macro->is_function = 0;
1755 macro->parameters = NULL;
1756 macro->identifier = ralloc_strdup (macro, identifier);
1757 macro->replacements = replacements;
1758 ralloc_steal (macro, replacements);
1762 if (_macro_equal (macro, previous)) {
1763 ralloc_free (macro);
1766 glcpp_error (loc, parser, "Redefinition of macro %s\n",
1770 hash_table_insert (parser->defines, macro, identifier);
1780 macro_t *macro, *previous;
1784 macro = ralloc (parser, macro_t);
1785 ralloc_steal (macro, parameters);
1786 ralloc_steal (macro, replacements);
1788 macro->is_function = 1;
1789 macro->parameters = parameters;
1790 macro->identifier = ralloc_strdup (macro, identifier);
1791 macro->replacements = replacements;
1794 if (_macro_equal (macro, previous)) {
1795 ralloc_free (macro);
1798 glcpp_error (loc, parser, "Redefinition of macro %s\n",
1802 hash_table_insert (parser->defines, macro, identifier);
1817 * function-like macro name, but have not yet seen its
1856 macro_t *macro;
1857 macro = hash_table_find (parser->defines,
1859 if (macro && macro->is_function) {