high_level_data.c File Reference

#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
#include "globals.h"
#include "types.h"
#include "errors.h"
#include "ast_util.h"
#include "odin_util.h"
#include "util.h"
#include "high_level_data.h"
Include dependency graph for high_level_data.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void update_tree (ast_node_t *node)
void update_tag (ast_node_t *node, int tag, int line)
int generate_tag ()
int get_linenumber (ast_node_t *node)
void add_tag_data ()

Variables

int last_tag

Function Documentation

void add_tag_data (  ) 

Definition at line 25 of file high_level_data.c.

00026 {
00027         int i;
00028 
00029         for (i = 0; i < num_modules; i++)
00030         {
00031                 update_tree (ast_modules[i]);
00032         }
00033 }

Here is the call graph for this function:

Here is the caller graph for this function:

int generate_tag (  ) 

Definition at line 122 of file high_level_data.c.

00123 {
00124         static int high_level_id = 0;
00125         high_level_id ++;
00126         last_tag = high_level_id;
00127 
00128         return high_level_id;
00129 }

Here is the caller graph for this function:

int get_linenumber ( ast_node_t node  ) 

Definition at line 134 of file high_level_data.c.

00135 {
00136         return node->line_number;
00137 }

Here is the caller graph for this function:

void update_tag ( ast_node_t node,
int  tag,
int  line 
)

Definition at line 103 of file high_level_data.c.

00104 {
00105         int i;
00106         if (node == NULL) 
00107                 return;
00108 
00109         node->far_tag = tag;
00110         node->high_number = line;
00111 
00112         for (i=0; i < node->num_children; i++)
00113         {
00114                 update_tag(node->children[i],tag, line);
00115         }
00116         
00117 }

Here is the caller graph for this function:

void update_tree ( ast_node_t node  ) 

Definition at line 38 of file high_level_data.c.

00039 {
00040         int i;
00041         int tag;
00042         int line;
00043 
00044         if (node == NULL) 
00045                 return;
00046         
00047         if (strcmp(global_args.high_level_block,"if")==0)
00048         {
00049                 switch(node->type)
00050                 {
00051                         case IF:
00052                                 tag = generate_tag();
00053                                 line = get_linenumber(node);
00054                                 update_tag(node, tag, line);
00055                                 break;
00056                         
00057                         default:
00058                                 for (i=0; i < node->num_children; i++)
00059                                 {
00060                                         update_tree(node->children[i]);
00061                                 }
00062                 }
00063         }
00064         else if (strcmp(global_args.high_level_block,"always")==0)
00065         {
00066                 switch(node->type)
00067                 {
00068                         case ALWAYS:
00069                                 tag = generate_tag();
00070                                 line = get_linenumber(node);
00071                                 update_tag(node, tag, line);
00072                                 break;
00073                         
00074                         default:
00075                                 for (i=0; i < node->num_children; i++)
00076                                 {
00077                                         update_tree(node->children[i]);
00078                                 }
00079                 }
00080         }
00081         else if (strcmp(global_args.high_level_block,"module")==0)
00082         {
00083                 switch(node->type)
00084                 {
00085                         case MODULE:
00086                                 tag = generate_tag();
00087                                 line = get_linenumber(node);
00088                                 update_tag(node, tag, line);
00089                                 break;
00090                         
00091                         default:
00092                                 for (i=0; i < node->num_children; i++)
00093                                 {
00094                                         update_tree(node->children[i]);
00095                                 }
00096                 }
00097         }
00098 }

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

int last_tag

Definition at line 18 of file high_level_data.c.

Generated on Tue Aug 2 10:43:15 2011 for ODIN_II by  doxygen 1.6.3