diff --git a/engine/list.inc b/engine/list.inc
index c14cbaf..58ffeea 100644
--- a/engine/list.inc
+++ b/engine/list.inc
@@ -1793,6 +1793,11 @@ class PGPBody extends PGPList {
           $strings[] = $indent . $statement->toString() . ";";
           break;
 
+        case T_NAMESPACE:
+        case T_USE:
+          $strings[] = $statement->toString($indent);
+          break;
+
         case T_INLINE_HTML:
           // 2009-06-13 Inline html
           $strings[] = $current->statementValue('value');
diff --git a/engine/object.inc b/engine/object.inc
index dc4d296..2914dc0 100644
--- a/engine/object.inc
+++ b/engine/object.inc
@@ -575,14 +575,14 @@ class PGPClass extends PGPBase {
   /**
    * Name of class (or names of interfaces) extended by this class (or interface).
    *
-   * @var array
+   * @var PGPList
    */
   public $extends;
 
   /**
    * Names of interfaces implemented by this class.
    *
-   * @var array (or PGPList???)
+   * @var PGPList
    */
   public $implements;
 
@@ -607,8 +607,8 @@ class PGPClass extends PGPBase {
     $this->modifiers = array();
     $this->type = 0;
     $this->name = $name;
-    $this->extends = array();
-    $this->implements = array();
+    $this->extends = new PGPList();
+    $this->implements = new PGPList();
   }
 
   /**
@@ -667,15 +667,15 @@ class PGPClass extends PGPBase {
 
         case 'extends':
           // Add class and interface items.
-          if ($element) {
-            $header .= $space . 'extends ' . implode(', ', $element);
+          if (is_object($element) && !$element->isEmpty()) {
+            $header .= $space . 'extends ' . $element->toString();
           }
           break;
 
         case 'implements':
           // Add class items.
-          if ($element) {
-            $header .= $space . 'implements ' . implode(', ', $element);
+          if (is_object($element) && !$element->isEmpty()) {
+            $header .= $space . 'implements ' . $element->toString();
           }
           break;
 
@@ -2572,6 +2572,132 @@ class PGPListStatement extends PGPBase {
 }
 
 /**
+ * Grammar Parser namespace or use statement class.
+ *
+ * The order of the members is important so as to be able to use a foreach
+ * statement to print the object.
+ */
+class PGPNamespace extends PGPBase {
+  /**
+   * Documentation block comment.
+   *
+   * @var string
+   */
+  public $comment;
+
+  /**
+   * Statement type.
+   *
+   * @var integer
+   */
+  public $type;
+
+  /**
+   * Namespace name.
+   *
+   * @var PGPExpression
+   */
+  public $name;
+
+  /**
+   * Alias name (applies to use statement).
+   *
+   * @var string
+   */
+  public $alias;
+
+  /**
+   * List of body statements (applies to namespace statement).
+   *
+   * @var PGPBody
+   */
+  public $body;
+
+  public function __construct() {
+    parent::__construct();
+
+    $this->type = 0;
+  }
+
+  /**
+   * Returns the text of a namespace or use statement.
+   *
+   * @param string $indent
+   *   Line indent string.
+   * @return string
+   *   A string of the expression.
+   */
+  public function toString($indent = '') {
+    $this->debug = TRUE;
+    $this->debugPrint(__METHOD__);
+
+    $expression = $this; // TODO Why use this variable name now?
+
+    $strings = array();
+    $header = $indent;
+
+    // Assemble comment and block header.
+    $add_space = 1; // Set this to one in this routine.
+    foreach ($expression as $key => $element) {
+      $this->debugPrint(__METHOD__ . " key = $key");
+      if ($key == 'body') {
+        break;
+      }
+      $space = $add_space ? ' ' : '';
+      switch ($key) {
+        case 'comment':
+          if (!empty($element)) {
+            $strings[] = PGPWriter::printComment($element, $indent);
+          }
+          break;
+
+        case 'type':
+          $type = PGPWriter::statementTypeToString($element);
+          $header .= /*$space .*/ $type;
+          $add_space = 1;
+          break;
+
+        case 'name':
+          $header .= $space . $element->toString();
+          break;
+
+        case 'alias':
+          if ($element) {
+            $header .= $space . 'as ' . $element;
+          }
+          break;
+      }
+      if ($add_space <= 0) {
+        $add_space++;
+      }
+    }
+    $this->debug = FALSE;
+
+    // Add block body.
+    if (!isset($expression->body)) {
+      // Namespace code need not be wrapped in braces.
+      $header .= ";";
+      $strings[] = $header;
+    }
+    elseif ($expression->body->isEmpty()) {
+      // No namespace code.
+      $header .= $expression->bodyComment ? ' { ' . $expression->bodyComment . "\n" . $indent . "}" : ' { }';
+      $strings[] = $header;
+    }
+    else {
+//      $header .= " {";
+      // Add body comment (i.e. a comment following the block beginning token).
+      $header .= $expression->bodyComment ? ' { ' . $expression->bodyComment : ' {';
+      $strings[] = $header;
+      $strings[] = $expression->body->toString();
+      $strings[] = $indent . "}";
+    }
+
+    return implode("\n", $strings);
+  }
+}
+
+/**
  * Grammar Parser array statement class.
  *
  * The order of the members is important so as to be able to use a foreach
diff --git a/engine/reader.inc b/engine/reader.inc
index 526ef84..1f22c1e 100644
--- a/engine/reader.inc
+++ b/engine/reader.inc
@@ -748,8 +748,41 @@ class PGPReader extends PGPParser {
           break;
 
         case T_NEW: // 2010-03-02 Added. Example: new Exception(..);
+          $node->data = $this->buildFunctionCall(TRUE);
+          $this->functionCalls[] = &$node/*->data*/;
+          break;
+
+        case T_NAMESPACE:
+          if ($this->nextRealToken() == T_NS_SEPARATOR) {
+            // This is not a namespace declaration, but an assignment or
+            // function call statement (assuming a namespace declaration does
+            // not begin with a back slash, although lint allows it).
+            // Should not be an assignment as namespace syntax does not include
+            // variables, nor assignments to constants.
+            // To determine which requires a big token lookahead.
+            prev($this->tokens);
+            $node->data = $this->buildAssignment($modifiers);
+            break;
+          }
+        case T_USE:
+          $node->data = $this->buildNamespace();
+          break;
+          // @see http://www.php.net/manual/en/language.namespaces.definitionmultiple.php
+          // Can be surrounded by brackets, global namespace has no name.
+          // @see http://www.php.net/manual/en/language.namespaces.basics.php
+          // Statement may begin with a back slash.
+          // Seems like it would make sense to concatenate the namespace as a single item.
+          // Add another item to function call being the namespace along with name.
+          $node->data = $this->buildFunctionCall(TRUE);
+          $this->functionCalls[] = &$node/*->data*/;
+          break;
+
+        case T_NS_SEPARATOR:
+          // @todo If the expression starts with the separator, then it seems to
+          // limited to being a function call.
           prev($this->tokens);
           $node->data = $this->buildAssignment($modifiers);
+          $this->functionCalls[] = &$node/*->data*/;
           break;
 
         case T_INLINE_HTML:
@@ -826,6 +859,8 @@ class PGPReader extends PGPParser {
     $class->comment = $this->comment;
     $class->modifiers = $modifiers;
     $class->type = $this->tokenType();
+    $class->extends = new PGPList();
+    $class->implements = new PGPList();
 
     // Global items.
     $this->comment = array();
@@ -838,10 +873,10 @@ class PGPReader extends PGPParser {
       switch ($this->tokenType()) {
         case T_STRING:
           if ($extends) {
-            $class->extends[] = $this->tokenValue();
+//             $class->extends[] = $this->tokenValue();
           }
           elseif ($implements) {
-            $class->implements[] = $this->tokenValue();
+//             $class->implements[] = $this->tokenValue();
           }
           else {
             $class->name = $this->tokenValue();
@@ -861,20 +896,24 @@ class PGPReader extends PGPParser {
           // Interfaces may extend multiple interfaces, classes only one class.
           $extends++;
           $implements = 0;
+          $class->extends->insertLast($this->buildExpression(array(',', T_IMPLEMENTS, '{')));
           break;
 
         case T_IMPLEMENTS:
           $implements++;
           $extends = 0;
+          $class->implements->insertLast($this->buildExpression(array(',', T_EXTENDS, '{')));
           break;
 
         case ',':
           // Delimits lists of interfaces implemented or classes extended.
           if ($implements) {
             $implements++;
+            $class->implements->insertLast($this->buildExpression(array(',', T_EXTENDS, '{')));
           }
           elseif ($extends) {
             $extends++;
+            $class->extends->insertLast($this->buildExpression(array(',', T_IMPLEMENTS, '{')));
           }
           // else error
           break;
@@ -1792,7 +1831,7 @@ class PGPReader extends PGPParser {
           break;
 
         case T_CLASS_C:
-//        case T_DIR: (Added in PHP 5.3.0.)
+        case T_DIR: // Added in PHP 5.3.0.
         case T_FILE:
         case T_FUNC_C:
         case T_LINE:
@@ -1809,6 +1848,24 @@ class PGPReader extends PGPParser {
 //          $node->setData('operand', $this->tokenValue());
 //          break;
 
+        case T_NAMESPACE:
+          $node->setData('operator3', $this->tokenValue());
+          break;
+
+        case T_NS_SEPARATOR:
+          // @todo If the expression starts with the separator, then add a leading space.
+          if ($this->previousTokenType() == T_WHITESPACE) {
+            $node->setData('operator3', $this->tokenValue());
+          }
+          else {
+            $node->setData('operator2', $this->tokenValue());
+          }
+          break;
+
+        case T_NS_C:
+          $node->setData('operand', $this->tokenValue());
+          break;
+
         default:
 //          prev($this->tokens); // This would be the ';' character???
 //          return $expression;
@@ -3077,6 +3134,80 @@ class PGPReader extends PGPParser {
   }
 
   /**
+   * Builds a namespace or use statement.
+   *
+   * @return array
+   *   An array of the statement.
+   */
+  private function buildNamespace() {
+    $this->debugPrint(__FUNCTION__);
+
+    // Create object.
+    $expression = new PGPNamespace();
+    $expression->comment = $this->comment;
+    $expression->type = $this->tokenType();
+
+    // Global items.
+    $this->comment = array();
+
+    // Local items.
+    $alias = 0;
+
+    while (next($this->tokens) !== FALSE) {
+      $this->debugPrint("while buildNamespace");
+      $this->printToken();
+      switch ($this->tokenType()) {
+        case T_STRING:
+        case T_NS_SEPARATOR:
+          if ($alias) {
+            $expression->alias = $this->tokenValue();
+          }
+          else {
+            // @todo May the name begin with a back slash?
+            // Only namespace statement may have a body.
+            prev($this->tokens);
+            $expression->name = $this->buildExpression(array(';', '{', T_AS));
+          }
+          break;
+
+        case T_AS:
+          $alias++;
+          break;
+
+        case '{':
+          if ($expression->type == T_USE) {
+            $expression->warning = 'unexected syntax in ' . __METHOD__ . '(' . __LINE__ . ')';
+            break;
+          }
+          $expression->bodyComment = $this->buildBodyComment();
+          $expression->body = $this->buildBody();
+          break;
+
+        case '}':
+          return $expression;
+          break;
+
+        case ';':
+          return $expression;
+          break;
+
+        case T_COMMENT: // TODO Until we can figure a better way to handle embedded comments
+        case T_WHITESPACE:
+          break;
+
+        default:
+          $expression->warning = 'unexected syntax in ' . __METHOD__ . '(' . __LINE__ . ')';
+          $expression->extra = $this->cleanToken();
+          return $expression;
+          break;
+      }
+    }
+    $expression->warning = 'unexpected end of file in ' . __METHOD__ . '(' . __LINE__ . ')';
+    $expression->extra = $this->cleanToken();
+    return $expression;
+  }
+
+  /**
    * @} End of "defgroup pgp_builder".
    */
 
diff --git a/engine/writer.inc b/engine/writer.inc
index f44d991..7bfde43 100644
--- a/engine/writer.inc
+++ b/engine/writer.inc
@@ -186,6 +186,12 @@ class PGPWriter extends PGPParser {
       case T_DEFINE:
         return 'constant'; // For API documentation purposes, at least.
 
+      case T_NAMESPACE:
+        return 'namespace';
+
+      case T_USE:
+        return 'use';
+
       default:
         return 'UNKNOWN-TYPE';
     }
