• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/swig-12/Source/Preprocessor/

Lines Matching defs:macro

11  * - A new macro %define ... %enddef can be used for multiline macros
260 * Defines a new C preprocessor symbol. swigmacro specifies whether or not the macro has
261 * SWIG macro semantics.
279 Swig_error(Getfile(line), Getline(line), "Illegal macro argument name '%s'\n", str);
295 Hash *macro = 0, *symbols = 0, *m1;
319 /* Now look for a macro name */
325 /* It is a macro. Go extract its argument string */
333 Swig_error(Getfile(str), Getline(str), "Missing \')\' in macro parameters\n");
349 /*Swig_error(Getfile(str),Getline(str),"Illegal character in macro name\n");
362 /* If there are any macro arguments, convert into a list */
373 Swig_error(Getfile(str), Getline(str), "Variable-length macro argument must be last parameter\n");
383 Swig_error(Getfile(str), Getline(str), "Illegal character in macro argument name\n");
487 /* Go create the macro */
488 macro = NewHash();
489 Setattr(macro, kpp_name, macroname);
492 Setattr(macro, kpp_args, arglist);
495 Setattr(macro, kpp_varargs, "1");
498 Setattr(macro, kpp_value, macrovalue);
499 Setline(macro, line);
500 Setfile(macro, file);
502 Setattr(macro, kpp_swigmacro, "1");
512 Setattr(symbols, macroname, macro);
513 Delete(macro);
521 return macro;
535 * Undefines a macro.
547 * Isolates macro arguments and returns them in a list. For each argument,
567 /* Not a macro, bail out now! */
573 /* Okay. This appears to be a macro so we will start isolating arguments */
621 Swig_error(Getfile(args), Getline(args), "Unterminated macro call.\n");
690 * Perform macro expansion and return a new string. Returns NULL if some sort
696 DOH *symbols, *macro, *margs, *mvalue, *temp, *tempa, *e;
705 macro = Getattr(symbols, name);
706 if (!macro)
708 if (Getattr(macro, kpp_expanded)) {
726 /* Get macro arguments and value */
727 mvalue = Getattr(macro, kpp_value);
729 margs = Getattr(macro, kpp_args);
731 if (args && Getattr(macro, kpp_varargs)) {
733 /* Variable length argument macro. We need to collect all of the extra arguments into a single argument */
765 /* If the macro expects arguments, but none were supplied, we leave it in place */
770 /* Copy the macro value */
774 /* Tag the macro as being expanded. This is to avoid recursion in
775 macro expansion */
786 aname = Getitem(margs, i); /* Get macro argument name */
809 /* Non-standard macro expansion. The value `x` is replaced by a quoted
849 /* Zero length varargs macro argument. We search for commas that might appear before and nuke them */
886 /* Expand this macro even further */
887 Setattr(macro, kpp_expanded, "1");
891 Delattr(macro, kpp_expanded);
894 if (Getattr(macro, kpp_swigmacro)) {
898 copy_location(macro, e);
902 /* Drop the macro in place, but with a marker around it */
903 Printf(f, "/*@%s,%d,%s@*/%s/*@@*/", Getfile(macro), Getline(macro), name, g);
907 Printf(f, "/*@SWIG:%s,%d,%s@*/%s/*@SWIG@*/", Getfile(macro), Getline(macro), name, g);
928 * Evaluate the arguments of a macro
944 * Performs a macro substitution on a string s. Returns a new string with
965 /* Try to locate identifiers in s and replace them with macro replacements */
993 /* See if this is the special "defined" macro */
1022 /* This is not a defined() macro. */
1054 /* See if the macro is defined in the preprocessor symbol table */
1058 /* See if the macro expects arguments */
1118 /* See if this is the special "defined" macro */
1123 /* Yes. There is a macro here */
1124 /* See if the macro expects arguments */
1144 * function contains the heuristic that determines whether or not a macro
1401 /* States 45-48 are used to remove, but retain comments from macro values. The comments
1805 /* Got the macro */
1834 Swig_error(Getfile(s), -1, "Missing %%enddef for macro starting on line %d\n", Getline(value));