Index: src/Parser/ParseNode.h
===================================================================
--- src/Parser/ParseNode.h	(revision 695e00deb437e7e1ea8ef4dd70418cf6c70c8896)
+++ src/Parser/ParseNode.h	(revision b18830e160544a32e0d1b1ea1100232bf1c4545d)
@@ -44,6 +44,10 @@
 //##############################################################################
 
+typedef CodeLocation YYLTYPE;
+#define YYLTYPE_IS_DECLARED 1 /* alert the parser that we have our own definition */
+
 extern char * yyfilename;
 extern int yylineno;
+extern YYLTYPE yylloc;
 
 class ParseNode {
@@ -73,5 +77,5 @@
 	ParseNode * next = nullptr;
 	std::string * name = nullptr;
-	CodeLocation location = { yyfilename, yylineno };
+	CodeLocation location = yylloc;
 }; // ParseNode
 
Index: src/Parser/lex.ll
===================================================================
--- src/Parser/lex.ll	(revision 695e00deb437e7e1ea8ef4dd70418cf6c70c8896)
+++ src/Parser/lex.ll	(revision b18830e160544a32e0d1b1ea1100232bf1c4545d)
@@ -26,5 +26,5 @@
 
 unsigned int column = 0;								// position of the end of the last token parsed
-#define YY_USER_ACTION column += yyleng;				// trigger before each matching rule's action
+#define YY_USER_ACTION yylloc.first_line = yylineno; yylloc.first_column = column; column += yyleng; yylloc.last_column = column; yylloc.last_line = yylineno; yylloc.filename = yyfilename ? yyfilename : "";				// trigger before each matching rule's action
 
 #include <string>
Index: src/Parser/parser.yy
===================================================================
--- src/Parser/parser.yy	(revision 695e00deb437e7e1ea8ef4dd70418cf6c70c8896)
+++ src/Parser/parser.yy	(revision b18830e160544a32e0d1b1ea1100232bf1c4545d)
@@ -116,4 +116,21 @@
 
 bool forall = false;									// aggregate have one or more forall qualifiers ?
+
+# define YYLLOC_DEFAULT(Cur, Rhs, N)                            \
+do                                                              \
+	if (N) {                                                      \
+		(Cur).first_line   = YYRHSLOC(Rhs, 1).first_line;           \
+		(Cur).first_column = YYRHSLOC(Rhs, 1).first_column;         \
+		(Cur).last_line    = YYRHSLOC(Rhs, N).last_line;            \
+		(Cur).last_column  = YYRHSLOC(Rhs, N).last_column;          \
+		(Cur).filename     = YYRHSLOC(Rhs, 1).filename;             \
+	} else {                                                      \
+		(Cur).first_line   = (Cur).last_line   =                    \
+			YYRHSLOC(Rhs, 0).last_line;                               \
+		(Cur).first_column = (Cur).last_column =                    \
+			YYRHSLOC(Rhs, 0).last_column;                             \
+		(Cur).filename     = YYRHSLOC(Rhs, 0).filename;             \
+	}                                                             \
+while (0)
 %}
 
@@ -346,4 +363,5 @@
 %precedence ELSE	// token precedence for start of else clause in IF/WAITFOR statement
 
+%locations
 
 %start translation_unit									// parse-tree root
