Lines Matching refs:macro
51 const char *macro,
57 const char *macro,
133 /* Perform macro expansion in-place on the given list. */
238 glcpp_error(& @1, parser, "undefined macro %s in expression (illegal in GLES)", $2.undefined_macro);
243 glcpp_error(& @1, parser, "undefined macro %s in expression (illegal in GLES)", $2.undefined_macro);
306 * (pre-defined) macro name.
314 * By convention, all macro names containing two consecutive
319 * multiple definitions of the same name. All macro names
460 macro_t *macro = entry ? entry->data : NULL;
461 _glcpp_parser_skip_stack_push_if (parser, & @1, macro != NULL);
466 macro_t *macro = entry ? entry->data : NULL;
467 _glcpp_parser_skip_stack_push_if (parser, & @3, macro == NULL);
556 glcpp_error (& @1, parser, "#define without macro name");
1541 /* Find a set of function-like macro arguments by looking for a
1558 * simply that the macro name should be treated as a non-macro.
1651 * If the identifier is a defined macro, this function returns 1.
1653 * If the identifier is not a defined macro, this function returns 0.
1764 /* Perform macro expansion on 'list', placing the resulting tokens
1815 yyerror(&node->token->location, parser, "'##' cannot appear at either end of a macro expansion\n");
1834 * function-like macro, it is not followed with a parenthesized
1838 * macro) and subsequent nodes which are arguments.
1853 macro_t *macro;
1863 macro = entry ? entry->data : NULL;
1865 assert(macro->is_function);
1880 /* Replace a macro defined as empty with a SPACE token. */
1881 if (macro->replacements == NULL) {
1886 _string_list_length (macro->parameters)) ||
1887 (_string_list_length (macro->parameters) == 0 &&
1891 "Error: macro %s invoked with %d arguments (expected %d)\n",
1893 _string_list_length(macro->parameters));
1900 for (node = macro->replacements->head; node; node = node->next) {
1902 _string_list_contains(macro->parameters, node->token->value.str,
1936 * 'node' in the case that 'node' is a function-like macro and
1945 * As 'node' in the case of object-like macro expansion.
1948 * function-like macro expansion.
1961 macro_t *macro;
1988 macro = entry ? entry->data : NULL;
1990 /* Not a macro, so no expansion needed. */
1991 if (macro == NULL)
1994 /* Finally, don't expand this macro if we're already actively
2011 if (! macro->is_function) {
2014 /* Replace a macro defined as empty with a SPACE token. */
2015 if (macro->replacements == NULL)
2018 replacement = _token_list_copy(parser, macro->replacements);
2091 * token is the name of a defined macro. If the DEFINED token is
2195 * "All macro names containing two consecutive underscores ( __ )
2196 * are reserved for future use as predefined macro names. All
2197 * macro names prefixed with "GL_" ("GL" followed by a single
2217 glcpp_error (loc, parser, "\"defined\" cannot be used as a macro name");
2239 macro_t *macro, *previous;
2248 macro = linear_alloc_child(parser->linalloc, sizeof(macro_t));
2250 macro->is_function = 0;
2251 macro->parameters = NULL;
2252 macro->identifier = linear_strdup(parser->linalloc, identifier);
2253 macro->replacements = replacements;
2258 if (_macro_equal (macro, previous)) {
2261 glcpp_error (loc, parser, "Redefinition of macro %s\n", identifier);
2264 _mesa_hash_table_insert (parser->defines, identifier, macro);
2272 macro_t *macro, *previous;
2280 glcpp_error (loc, parser, "Duplicate macro parameter \"%s\"", dup);
2283 macro = linear_alloc_child(parser->linalloc, sizeof(macro_t));
2285 macro->is_function = 1;
2286 macro->parameters = parameters;
2287 macro->identifier = linear_strdup(parser->linalloc, identifier);
2288 macro->replacements = replacements;
2293 if (_macro_equal (macro, previous)) {
2296 glcpp_error (loc, parser, "Redefinition of macro %s\n", identifier);
2299 _mesa_hash_table_insert(parser->defines, identifier, macro);
2314 * function-like macro name, but have not yet seen its
2347 macro_t *macro = entry ? entry->data : NULL;
2348 if (macro && macro->is_function) {
2481 * fragment shader, so we always define this macro in ES2/ES3.
2534 macro_t *macro = (macro_t *) data;
2540 const char *identifier = macro->identifier;
2546 if (_macro_equal(macro, previous)) {
2549 glcpp_error(di->loc, di->parser, "Redefinition of macro %s\n",
2553 _mesa_hash_table_insert(di->parser->defines, identifier, macro);