From 5c5c3455f616fba4e525d483735dc01a657f4519 Mon Sep 17 00:00:00 2001 From: Etienne Bergeron Date: Tue, 2 Apr 2013 19:24:22 -0400 Subject: [PATCH] Add line number to parser nodes Signed-off-by: Etienne Bergeron Signed-off-by: Mathieu Desnoyers --- formats/ctf/metadata/ctf-ast.h | 1 + formats/ctf/metadata/ctf-parser.y | 1 + 2 files changed, 2 insertions(+) diff --git a/formats/ctf/metadata/ctf-ast.h b/formats/ctf/metadata/ctf-ast.h index 13686271..042726e9 100644 --- a/formats/ctf/metadata/ctf-ast.h +++ b/formats/ctf/metadata/ctf-ast.h @@ -76,6 +76,7 @@ struct ctf_node { struct bt_list_head siblings; struct bt_list_head tmp_head; struct bt_list_head gc; + unsigned int lineno; enum node_type type; union { diff --git a/formats/ctf/metadata/ctf-parser.y b/formats/ctf/metadata/ctf-parser.y index 6397f428..30f4c949 100644 --- a/formats/ctf/metadata/ctf-parser.y +++ b/formats/ctf/metadata/ctf-parser.y @@ -250,6 +250,7 @@ static struct ctf_node *make_node(struct ctf_scanner *scanner, return NULL; memset(node, 0, sizeof(*node)); node->type = type; + node->lineno = yyget_lineno(scanner->scanner); BT_INIT_LIST_HEAD(&node->tmp_head); bt_list_add(&node->gc, &ast->allocated_nodes); bt_list_add(&node->siblings, &node->tmp_head); -- 2.34.1