diff --git a/Cargo.lock b/Cargo.lock
index 3f2d08fd..857ba230 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -460,6 +460,7 @@ name = "nac3embedded"
 version = "0.1.0"
 dependencies = [
  "pyo3",
+ "rustpython-parser",
 ]
 
 [[package]]
diff --git a/nac3embedded/Cargo.toml b/nac3embedded/Cargo.toml
index 230d0d9e..e2b466f0 100644
--- a/nac3embedded/Cargo.toml
+++ b/nac3embedded/Cargo.toml
@@ -8,6 +8,6 @@ edition = "2018"
 name = "nac3embedded"
 crate-type = ["cdylib"]
 
-[dependencies.pyo3]
-version = "0.12.4"
-features = ["extension-module"]
+[dependencies]
+pyo3 = { version = "0.12.4", features = ["extension-module"] }
+rustpython-parser = { git = "https://github.com/RustPython/RustPython", branch = "master" }
diff --git a/nac3embedded/src/lib.rs b/nac3embedded/src/lib.rs
index 213f15e6..bffe2374 100644
--- a/nac3embedded/src/lib.rs
+++ b/nac3embedded/src/lib.rs
@@ -1,5 +1,7 @@
 use pyo3::prelude::*;
 use pyo3::wrap_pyfunction;
+use pyo3::exceptions;
+use rustpython_parser::parser;
 
 #[pyfunction]
 fn add_host_object(obj: PyObject) -> PyResult<()> {
@@ -7,7 +9,9 @@ fn add_host_object(obj: PyObject) -> PyResult<()> {
         let obj: &PyAny = obj.extract(py)?;
         let inspect = PyModule::import(py, "inspect")?;
         let source = inspect.call1("getsource", (obj.get_type(), ))?;
-        println!("source:\n{}", source);
+        let ast = parser::parse_program(source.extract()?).map_err(|e|
+            exceptions::PySyntaxError::new_err(format!("failed to parse host object source: {}", e)))?;
+        println!("{:?}", ast);
         Ok(())
     })?;
     Ok(())
@@ -16,6 +20,5 @@ fn add_host_object(obj: PyObject) -> PyResult<()> {
 #[pymodule]
 fn nac3embedded(_py: Python, m: &PyModule) -> PyResult<()> {
     m.add_function(wrap_pyfunction!(add_host_object, m)?)?;
-
     Ok(())
 }