The unified diff between revisions [6726c07e..] and [9a6e8df1..] is displayed below. It can also be downloaded as a raw diff.
This diff has been restricted to the following files: 'src/lsc/ast.c'
# # old_revision [6726c07e4874e76763555e1476ce427743e8f73c] # new_revision [9a6e8df1d6b102f467702e274d53d90f9151e2c8] # # patch "src/lsc/ast.c" # from [38b009ee4723c4e585350f483aa20ae113304362] # to [38d7a1613ebd1088ccb91c4fc2c7c711467cdd57] # ============================================================ --- src/lsc/ast.c 38b009ee4723c4e585350f483aa20ae113304362 +++ src/lsc/ast.c 38d7a1613ebd1088ccb91c4fc2c7c711467cdd57 @@ -7,6 +7,8 @@ #include "ast.h" #include "mem.h" +extern int yylineno; + ast_list *make_list(ast *elem, ast_list *tail) { ast_list *list = safe_malloc(sizeof(ast_list)); @@ -39,6 +41,7 @@ ast *make_list_node(ast_list *list) elem->tag = node_ast; elem->info.node.tag = kind_list; elem->info.node.head = list; + elem->lineno = yylineno; return elem; } @@ -49,6 +52,7 @@ ast *make_string(char *string) elem->tag = str_ast; elem->info.string = string; + elem->lineno = yylineno; return elem; } @@ -59,6 +63,7 @@ ast *make_integer(long integer) elem->tag = int_ast; elem->info.integer = integer; + elem->lineno = yylineno; return elem; } @@ -69,6 +74,7 @@ ast *make_real(float real) elem->tag = real_ast; elem->info.real = real; + elem->lineno = yylineno; return elem; } @@ -84,6 +90,7 @@ ast *make_function(char *identifier, ast list = make_list(make_list_node(args), list); list = make_list(make_string(identifier), list); elem->info.node.head = list; + elem->lineno = yylineno; return elem; } @@ -98,6 +105,7 @@ ast *make_fndefint(char *identifier, lon list = make_list(make_integer(num), list); list = make_list(make_string(identifier), list); elem->info.node.head = list; + elem->lineno = yylineno; return elem; } @@ -112,6 +120,7 @@ ast *make_constant(char *identifier, lon list = make_list(make_integer(num), list); list = make_list(make_string(identifier), list); elem->info.node.head = list; + elem->lineno = yylineno; return elem; } @@ -126,6 +135,7 @@ ast *make_realconstant(char *identifier, list = make_list(make_real(num), list); list = make_list(make_string(identifier), list); elem->info.node.head = list; + elem->lineno = yylineno; return elem; } @@ -139,6 +149,7 @@ ast *make_fndefext(char *identifier) elem->info.node.tag = kind_fndefext; list = make_list(make_string(identifier), list); elem->info.node.head = list; + elem->lineno = yylineno; return elem; } @@ -149,6 +160,7 @@ ast *make_variable(char *identifier) elem->tag = var_ast; elem->info.variable = identifier; + elem->lineno = yylineno; return elem; } @@ -163,6 +175,7 @@ ast *make_array(char *identifier, ast *e list = make_list(expression, NULL); list = make_list(make_variable(identifier), list); elem->info.node.head = list; + elem->lineno = yylineno; return elem; } @@ -178,6 +191,7 @@ ast *make_assignment(char *identifier, a list = make_list(expression, NULL); list = make_list(make_variable(identifier), list); elem->info.node.head = list; + elem->lineno = yylineno; return elem; } @@ -193,6 +207,7 @@ ast *make_assignment(ast_list *identifie list = make_list(expression, NULL); list = make_list(make_list_node(identifier_list), list); elem->info.node.head = list; + elem->lineno = yylineno; return elem; } @@ -207,6 +222,7 @@ ast *make_binary_op(ast_kind op, ast *ex list = make_list(exp2, NULL); list = make_list(exp1, list); elem->info.node.head = list; + elem->lineno = yylineno; return elem; } @@ -220,6 +236,7 @@ ast *make_unary_op(ast_kind op, ast *exp elem->info.node.tag = op; list = make_list(exp1, NULL); elem->info.node.head = list; + elem->lineno = yylineno; return elem; } @@ -234,6 +251,7 @@ ast *make_call(char *identifier, ast_lis list = make_list(make_list_node(args), NULL); list = make_list(make_string(identifier), list); elem->info.node.head = list; + elem->lineno = yylineno; return elem; } @@ -252,6 +270,7 @@ ast *make_statement(ast_kind type, ast * list = make_list(make_list_node(statements), list); list = make_list(expression, list); elem->info.node.head = list; + elem->lineno = yylineno; return elem; } @@ -262,6 +281,7 @@ ast *make_case_statement_variable(char * elem->tag = casevar_ast; elem->info.variable = identifier; + elem->lineno = yylineno; return elem; } @@ -272,6 +292,7 @@ ast *make_case_statement_number(long num elem->tag = casenum_ast; elem->info.integer = num; + elem->lineno = yylineno; return elem; } @@ -283,6 +304,7 @@ ast *make_return_statement(void) elem->tag = node_ast; elem->info.node.tag = stmt_return; elem->info.node.head = NULL; + elem->lineno = yylineno; return elem; } @@ -294,6 +316,7 @@ ast *make_break_statement(void) elem->tag = node_ast; elem->info.node.tag = stmt_break; elem->info.node.head = NULL; + elem->lineno = yylineno; return elem; } @@ -305,6 +328,7 @@ ast *make_default_statement(void) elem->tag = node_ast; elem->info.node.tag = stmt_default; elem->info.node.head = NULL; + elem->lineno = yylineno; return elem; }