Skip to content

Commit

Permalink
Agoras as linhas são armazenadas nos nós da tabela AST
Browse files Browse the repository at this point in the history
  • Loading branch information
fkeglevich committed Jun 19, 2017
1 parent 5b40fac commit b3c9f5f
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 3,445 deletions.
4 changes: 4 additions & 0 deletions ast.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Professor: Marcelo Johann

#include "ast.h"

int getLineNumber(void);

AST_NODE* ast_insert(int type, HASH_NODE *symbol, AST_NODE* c0, AST_NODE* c1, AST_NODE* c2, AST_NODE* c3)
{
AST_NODE *astNode;
Expand All @@ -27,6 +29,8 @@ AST_NODE* ast_insert(int type, HASH_NODE *symbol, AST_NODE* c0, AST_NODE* c1, AS
astNode->children[2] = c2;
astNode->children[3] = c3;

astNode->lineNumber = getLineNumber();

return astNode;
}

Expand Down
1 change: 1 addition & 0 deletions ast.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ FILE* OUT_FILE;

typedef struct ast_node {
int type;
int lineNumber;
HASH_NODE *symbol;
struct ast_node *children[NUM_CHILDREN];
} AST_NODE;
Expand Down
Binary file removed etapa4
Binary file not shown.
Loading

0 comments on commit b3c9f5f

Please sign in to comment.