From: Etienne Bergeron Date: Tue, 2 Apr 2013 23:24:22 +0000 (-0400) Subject: Add line number to parser nodes X-Git-Tag: v1.1.1~63 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=5c5c3455f616fba4e525d483735dc01a657f4519 Add line number to parser nodes Signed-off-by: Etienne Bergeron Signed-off-by: Mathieu Desnoyers --- 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);