diff --git a/src/language/ast/ASTBacktrace.cpp b/src/language/ast/ASTBacktrace.cpp
index f34eb0273b1b8d47b25a77a29eefd956e8602160..18442ec439194924fe83a5080b5bee2016eab4da 100644
--- a/src/language/ast/ASTBacktrace.cpp
+++ b/src/language/ast/ASTBacktrace.cpp
@@ -26,6 +26,15 @@ ASTBacktrace::errorMessageAt(const std::string& message) const
   return error_msg.str();
 }
 
+SourceLocation
+ASTBacktrace::sourceLocation() const
+{
+  auto& stack = ASTBacktrace::getInstance().m_stack;
+
+  auto p = stack[stack.size() - 1]->begin();
+  return SourceLocation(p.source, p.line, p.column);
+}
+
 void
 ASTBacktrace::create()
 {
diff --git a/src/language/ast/ASTBacktrace.hpp b/src/language/ast/ASTBacktrace.hpp
index add4bc8b09f2c09c157a6d980104791a9cd89b08..6ea9a53645ea4c4fda5c35585a80e44392254b5f 100644
--- a/src/language/ast/ASTBacktrace.hpp
+++ b/src/language/ast/ASTBacktrace.hpp
@@ -2,6 +2,7 @@
 #define AST_BACTRACE_HPP
 
 #include <utils/PugsAssert.hpp>
+#include <utils/SourceLocation.hpp>
 
 #include <pegtl/file_input.hpp>
 #include <string>
@@ -24,6 +25,8 @@ class ASTBacktrace
  public:
   std::string errorMessageAt(const std::string& error_msg) const;
 
+  SourceLocation sourceLocation() const;
+
   void
   push(const ASTNode* node)
   {
diff --git a/src/utils/SourceLocation.hpp b/src/utils/SourceLocation.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..d57116c8c47146cefad751b556ba767f98e35f70
--- /dev/null
+++ b/src/utils/SourceLocation.hpp
@@ -0,0 +1,58 @@
+#ifndef SOURCE_LOCATION_HPP
+#define SOURCE_LOCATION_HPP
+
+#include <experimental/source_location>
+#include <string>
+
+class SourceLocation
+{
+ private:
+  std::string m_filename;
+  std::string m_function;
+  size_t m_line;
+  size_t m_column;
+
+ public:
+  const std::string&
+  filename() const
+  {
+    return m_filename;
+  }
+
+  const std::string&
+  function() const
+  {
+    return m_function;
+  }
+
+  size_t
+  line() const
+  {
+    return m_line;
+  }
+
+  size_t
+  column() const
+  {
+    return m_column;
+  }
+
+  SourceLocation(
+    const std::experimental::source_location& source_location = std::experimental::source_location::current())
+    : m_filename{source_location.file_name()},
+      m_function{source_location.function_name()},
+      m_line{source_location.line()},
+      m_column{source_location.column()}
+  {}
+
+  SourceLocation(std::string filename, size_t line, size_t column, std::string function = "")
+    : m_filename{filename}, m_function{function}, m_line{line}, m_column{column}
+  {}
+
+  SourceLocation(SourceLocation&&)      = default;
+  SourceLocation(const SourceLocation&) = default;
+
+  ~SourceLocation() = default;
+};
+
+#endif   // SOURCE_LOCATION_HPP