add the -dump_parse_top and -dump_parse_modules
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8390 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
f86657bb71
commit
0b345e8546
2 changed files with 40 additions and 10 deletions
|
|
@ -1,6 +1,19 @@
|
||||||
Version 1.3.28 (unreleased).
|
Version 1.3.28 (unreleased).
|
||||||
===========================
|
===========================
|
||||||
|
|
||||||
|
01/12/2006: mmatus
|
||||||
|
- Add the -dump_parse_module and -dump_parse_top options,
|
||||||
|
which are similar to -dump_module and -dump_top, but they
|
||||||
|
dump the node trees just after parsing, showing only the
|
||||||
|
attributes visible at the parsing stage, and not the added
|
||||||
|
later in typemap.cxx, allocate.cxx, lang.cxx or elsewhere.
|
||||||
|
|
||||||
|
Besides debugging porpuses, these options are very useful
|
||||||
|
if you plan to use %rename in an "advance way", since it
|
||||||
|
shows only and all the node's attributes you can use
|
||||||
|
inside the match rules.
|
||||||
|
|
||||||
|
|
||||||
01/12/2006: mmatus
|
01/12/2006: mmatus
|
||||||
- Add predicates to %rename, so, you don't need to
|
- Add predicates to %rename, so, you don't need to
|
||||||
remember, for example, how to match a member function.
|
remember, for example, how to match a member function.
|
||||||
|
|
@ -381,8 +394,8 @@ Version 1.3.28 (unreleased).
|
||||||
%rename("%(<my encoder for enums inside a class>)",match="enumitem",
|
%rename("%(<my encoder for enums inside a class>)",match="enumitem",
|
||||||
match$parentNode$parentNode$nodeType="class") "";
|
match$parentNode$parentNode$nodeType="class") "";
|
||||||
|
|
||||||
Use "swig -dump_module" to see the attribute names you can use to
|
Use "swig -dump_parse_module" to see the attribute names you can use to
|
||||||
match an specific case.
|
match a specific case.
|
||||||
|
|
||||||
- 'sourcefmt' and 'targetfmt': sometimes you need to
|
- 'sourcefmt' and 'targetfmt': sometimes you need to
|
||||||
process the 'source' name before comparing, for example
|
process the 'source' name before comparing, for example
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,8 @@ static const char *usage1 = (const char*)"\
|
||||||
-D<symbol> - Define a symbol <symbol> (for conditional compilation)\n\
|
-D<symbol> - Define a symbol <symbol> (for conditional compilation)\n\
|
||||||
-dump_classes - Display information about the classes found in the interface\n\
|
-dump_classes - Display information about the classes found in the interface\n\
|
||||||
-dump_module - Display information on the module node tree avoiding system nodes\n\
|
-dump_module - Display information on the module node tree avoiding system nodes\n\
|
||||||
|
-dump_parse_module - Display information on the module node tree after parsing avoiding system nodes\n\
|
||||||
|
-dump_parse_top - Display information on the node tree after parsing including system nodes\n\
|
||||||
-dump_tags - Display information about the tags found in the interface\n\
|
-dump_tags - Display information about the tags found in the interface\n\
|
||||||
-dump_top - Display information on the entire node tree including system nodes\n\
|
-dump_top - Display information on the entire node tree including system nodes\n\
|
||||||
-dump_typedef - Display information about the types and typedefs in the interface\n\
|
-dump_typedef - Display information about the types and typedefs in the interface\n\
|
||||||
|
|
@ -70,11 +72,11 @@ static const char *usage1 = (const char*)"\
|
||||||
-features <list>- Set global features, where <list> is a comma separated list of\n\
|
-features <list>- Set global features, where <list> is a comma separated list of\n\
|
||||||
features, eg -features directors,autodoc=1\n\
|
features, eg -features directors,autodoc=1\n\
|
||||||
If no explicit value is given to the feature, a default of 1 is used\n\
|
If no explicit value is given to the feature, a default of 1 is used\n\
|
||||||
-fastdispatch - Enable fast dispatch mode to produce faster overload dispatcher code\n\
|
|
||||||
-Fmicrosoft - Display error/warning messages in Microsoft format\n\
|
|
||||||
";
|
";
|
||||||
|
|
||||||
static const char *usage2 = (const char*)"\
|
static const char *usage2 = (const char*)"\
|
||||||
|
-fastdispatch - Enable fast dispatch mode to produce faster overload dispatcher code\n\
|
||||||
|
-Fmicrosoft - Display error/warning messages in Microsoft format\n\
|
||||||
-Fstandard - Display error/warning messages in commonly used format\n\
|
-Fstandard - Display error/warning messages in commonly used format\n\
|
||||||
-fvirtual - Compile in virtual elimination mode\n\
|
-fvirtual - Compile in virtual elimination mode\n\
|
||||||
-help - This output\n\
|
-help - This output\n\
|
||||||
|
|
@ -100,14 +102,14 @@ static const char *usage2 = (const char*)"\
|
||||||
-noexcept - Do not wrap exception specifiers\n\
|
-noexcept - Do not wrap exception specifiers\n\
|
||||||
-nofastdispatch - Disable fast dispatch mode (default)\n\
|
-nofastdispatch - Disable fast dispatch mode (default)\n\
|
||||||
-nopreprocess - Skip the preprocessor step\n\
|
-nopreprocess - Skip the preprocessor step\n\
|
||||||
|
";
|
||||||
|
|
||||||
|
static const char *usage3 = (const char*)"\
|
||||||
-notemplatereduce - Disable reduction of the typedefs in templates\n\
|
-notemplatereduce - Disable reduction of the typedefs in templates\n\
|
||||||
-o <outfile> - Set name of the output file to <outfile>\n\
|
-o <outfile> - Set name of the output file to <outfile>\n\
|
||||||
-oh <headfile> - Set name of the output header file to <headfile>\n\
|
-oh <headfile> - Set name of the output header file to <headfile>\n\
|
||||||
-outdir <dir> - Set language specific files output directory <dir>\n\
|
-outdir <dir> - Set language specific files output directory <dir>\n\
|
||||||
-small - Compile in virtual elimination & compact mode\n\
|
-small - Compile in virtual elimination & compact mode\n\
|
||||||
";
|
|
||||||
|
|
||||||
static const char *usage3 = (const char*)"\
|
|
||||||
-swiglib - Report location of SWIG library and exit\n\
|
-swiglib - Report location of SWIG library and exit\n\
|
||||||
-templatereduce - Reduce all the typedefs in templates\n\
|
-templatereduce - Reduce all the typedefs in templates\n\
|
||||||
-v - Run in verbose mode\n\
|
-v - Run in verbose mode\n\
|
||||||
|
|
@ -145,8 +147,10 @@ static char *outfile_name = 0;
|
||||||
static char *outfile_name_h = 0;
|
static char *outfile_name_h = 0;
|
||||||
static int tm_debug = 0;
|
static int tm_debug = 0;
|
||||||
static int dump_tags = 0;
|
static int dump_tags = 0;
|
||||||
static int dump_tree = 0;
|
static int dump_top = 0;
|
||||||
static int dump_module = 0;
|
static int dump_module = 0;
|
||||||
|
static int dump_parse_module = 0;
|
||||||
|
static int dump_parse_top = 0;
|
||||||
static int dump_xml = 0;
|
static int dump_xml = 0;
|
||||||
static int browse = 0;
|
static int browse = 0;
|
||||||
static int dump_typedef = 0;
|
static int dump_typedef = 0;
|
||||||
|
|
@ -656,11 +660,17 @@ void SWIG_getoptions(int argc, char *argv[])
|
||||||
dump_tags = 1;
|
dump_tags = 1;
|
||||||
Swig_mark_arg(i);
|
Swig_mark_arg(i);
|
||||||
} else if ((strcmp(argv[i],"-dump_tree") == 0) || (strcmp(argv[i],"-dump_top") == 0)) {
|
} else if ((strcmp(argv[i],"-dump_tree") == 0) || (strcmp(argv[i],"-dump_top") == 0)) {
|
||||||
dump_tree = 1;
|
dump_top = 1;
|
||||||
Swig_mark_arg(i);
|
Swig_mark_arg(i);
|
||||||
} else if (strcmp(argv[i],"-dump_module") == 0) {
|
} else if (strcmp(argv[i],"-dump_module") == 0) {
|
||||||
dump_module = 1;
|
dump_module = 1;
|
||||||
Swig_mark_arg(i);
|
Swig_mark_arg(i);
|
||||||
|
} else if (strcmp(argv[i],"-dump_parse_module") == 0) {
|
||||||
|
dump_parse_module = 1;
|
||||||
|
Swig_mark_arg(i);
|
||||||
|
} else if (strcmp(argv[i],"-dump_parse_top") == 0) {
|
||||||
|
dump_parse_top = 1;
|
||||||
|
Swig_mark_arg(i);
|
||||||
} else if (strcmp(argv[i],"-dump_xml") == 0) {
|
} else if (strcmp(argv[i],"-dump_xml") == 0) {
|
||||||
dump_xml = 1;
|
dump_xml = 1;
|
||||||
Swig_mark_arg(i);
|
Swig_mark_arg(i);
|
||||||
|
|
@ -989,6 +999,13 @@ int SWIG_main(int argc, char *argv[], Language *l) {
|
||||||
|
|
||||||
Node *top = Swig_cparse(cpps);
|
Node *top = Swig_cparse(cpps);
|
||||||
|
|
||||||
|
if (dump_parse_top) {
|
||||||
|
Swig_print_tree(top);
|
||||||
|
}
|
||||||
|
if (dump_parse_module) {
|
||||||
|
Swig_print_tree(Getattr(top,"module"));
|
||||||
|
}
|
||||||
|
|
||||||
if (Verbose) {
|
if (Verbose) {
|
||||||
Printf(stdout,"Processing types...\n");
|
Printf(stdout,"Processing types...\n");
|
||||||
}
|
}
|
||||||
|
|
@ -1053,7 +1070,7 @@ int SWIG_main(int argc, char *argv[], Language *l) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (dump_tree) {
|
if (dump_top) {
|
||||||
Swig_print_tree(top);
|
Swig_print_tree(top);
|
||||||
}
|
}
|
||||||
if (dump_module) {
|
if (dump_module) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue