Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 394
    • Issues 394
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 19
    • Merge requests 19
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Wiki
  • Tutorials
  • adding a traversal

adding a traversal · Changes

Page history
Fix traversal template, it compiles wrong after replacing. authored Apr 09, 2025 by Quinten Cabo's avatar Quinten Cabo
Show whitespace changes
Inline Side-by-side
tutorials/adding-a-traversal.md
View page @ db74a6fe
......@@ -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.
......
Clone repository
  • concepts
    • Deprecated Modules
    • Globals
    • Named Tuples
    • Overloading
    • Preprocessor
    • Primitive functions
    • Runetime Representations
    • input stdin
    • phm xt
    • ref counting methods
    • type famlies
    • type patterns
  • error messages
    • Anthropomorphic error essages
    • Colored error messages
    • Empty file error
View All Pages