... | ... | @@ -157,7 +157,8 @@ In vim, you can this like so : |
|
|
|
|
|
Obviously replace `EXAMPLE`, `Example` and `EX` with your traversal id.
|
|
|
Now add the required functions the nodes you specified in step 1.
|
|
|
The next section should give you the knowledge to do this succesfully.
|
|
|
The next section should give you the knowledge to do this successfully.
|
|
|
|
|
|
## OK so what is actually in this header file?
|
|
|
|
|
|
The `#include types.h` just gives you the types you need to define this header.
|
... | ... | @@ -272,7 +273,7 @@ MakeInfo () |
|
|
|
|
|
result = MEMmalloc (sizeof (info));
|
|
|
|
|
|
INFO_TEMP (result) = NULL;
|
|
|
INFO_FOO (result) = NULL;
|
|
|
|
|
|
DBUG_RETURN (result);
|
|
|
}
|
... | ... | @@ -310,13 +311,13 @@ TEMPdoTemplateTraversal (node *syntax_tree) |
|
|
|
|
|
info = MakeInfo ();
|
|
|
|
|
|
DBUG_PRINT ("TEMP", ("Starting template traversal."));
|
|
|
DBUG_PRINT ("Starting template traversal.");
|
|
|
|
|
|
TRAVpush (TR_temp);
|
|
|
syntax_tree = TRAVdo (syntax_tree, info);
|
|
|
TRAVpop ();
|
|
|
|
|
|
DBUG_PRINT ("TEMP", ("Template traversal complete."));
|
|
|
DBUG_PRINT ("Template traversal complete.");
|
|
|
|
|
|
info = FreeInfo (info);
|
|
|
|
... | ... | @@ -375,7 +376,7 @@ To make the template your own perform the following search and replace operation |
|
|
1. `:%s/template_traversal.h/example_traversal.h/g`
|
|
|
2. `:%s/TemplateTraversal/ExampleTraversal/g`
|
|
|
3. `:%s/TEMP/EX/g`
|
|
|
4. `:%s/tr_temp/tr_ex/g`
|
|
|
4. `:%s/TR_temp/TR_ex/g`
|
|
|
|
|
|
Do not forget to update `@ingroup` to match the correct compiler phase and add a description of your phase.
|
|
|
|
... | ... | |