=== modified file 'src/com/goldencode/p2j/uast/progress.g'
--- old/src/com/goldencode/p2j/uast/progress.g	2017-10-19 15:05:06 +0000
+++ new/src/com/goldencode/p2j/uast/progress.g	2017-10-24 21:01:44 +0000
@@ -6641,6 +6641,7 @@
       sym.addBuiltinFunction("dynamic-current-value", FUNC_INT64      , false);
       sym.addBuiltinFunction("dynamic-function"     , FUNC_POLY       , true ); // like called func, uses for annotations only
       sym.addBuiltinFunction("dynamic-invoke"       , FUNC_POLY       , true );
+      sym.addBuiltinFunction("dynamic-new"          , FUNC_CLASS      , true , "Progress.Lang.Object");  // used for annotations only
       sym.addBuiltinFunction("dynamic-next-value"   , FUNC_INT64      , false);
       sym.addBuiltinFunction("encode"               , FUNC_CHAR       , true );
       sym.addBuiltinFunction("encrypt"              , FUNC_MEMPTR     , false);
@@ -8613,28 +8614,43 @@
    }              
    
    /**
-    * Returns <code>true</code> if the given type is <code>VAR_CLASS</code>,
-    * <code>FIELD_CLASS</code>, <code>FUNC_CLASS</code>, 
-    * <code>METH_CLASS</code>, <code>CLASS_NAME</code> or if this is a built-in 
-    * attribute or non-user defined method call <code>COLON</code> that has a
-    * <code>ATTR_CLASS</code> or <code>METH_CLASS</code> in the index
-    * position 1.
+    * Returns <code>true</code> if the given subtree resolves to a <code>VAR_CLASS</code>,
+    * <code>FIELD_CLASS</code>, <code>FUNC_CLASS</code>, <code>METH_CLASS</code>,
+    * <code>CLASS_NAME</code> or if this is a built-in attribute or non-user defined method call
+    * <code>COLON</code> that has a <code>ATTR_CLASS</code> or <code>METH_CLASS</code> in the
+    * index position 1.
+    * <p>
+    * Parenthesis will be ignored and the contained sub-expression will be checked.
     *
     * @param    node
     *           AST node to test.
     *
     * @return   <code>true</code> if the type represents an object reference.
     */
-   private boolean isObjectType(Aast node)
+   private boolean isObjectSubtree(Aast node)
    {
-      return isObjectType(node.getType());
+      int  type = node.getType();
+      Aast ref  = node;
+   
+      while (ref != null && type == LPARENS)
+      {
+         ref = ref.getChildAt(0);
+         
+         if (ref == null)
+         {
+            break;
+         }
+         
+         type = ref.getType();
+      }
+   
+      return isObjectType(type);
    }
    
    /**
     * Returns <code>true</code> if the given type is <code>VAR_CLASS</code>,
-    * <code>FIELD_CLASS</code>, <code>FUNC_CLASS</code>, 
-    * <code>METH_CLASS</code>, <code>CLASS_NAME</code> or
-    * <code>ATTR_CLASS</code>.
+    * <code>FIELD_CLASS</code>, <code>FUNC_CLASS</code>, <code>METH_CLASS</code>,  
+    * <code>CLASS_NAME</code> or <code>ATTR_CLASS</code>.
     *
     * @param    type
     *           The type to test.
@@ -8652,6 +8668,35 @@
    }
    
    /**
+    * Returns <code>true</code> if the given subtree resolves to a <code>CLASS_NAME</code>.
+    * Parenthesis will be ignored and the contained sub-expression will be checked.
+    *
+    * @param    node
+    *           AST node to test.
+    *
+    * @return   <code>true</code> if the type represents an class reference.
+    */
+   private boolean isStaticObject(Aast node)
+   {
+      int  type = node.getType();
+      Aast ref  = node;
+   
+      while (ref != null && type == LPARENS)
+      {
+         ref = ref.getChildAt(0);
+         
+         if (ref == null)
+         {
+            break;
+         }
+         
+         type = ref.getType();
+      }
+   
+      return (type == CLASS_NAME);
+   }
+   
+   /**
     * Find the class name referenced by the given object reference.
     *
     * @param    node
@@ -8663,7 +8708,22 @@
     */
    private String getObjectClassName(Aast node)
    {
-      return (String) node.getAnnotation("qualified");
+      int  type = node.getType();
+      Aast ref  = node;
+      
+      while (ref != null && type == LPARENS)
+      {
+         ref = ref.getChildAt(0);
+         
+         if (ref == null)
+         {
+            break;
+         }
+         
+         type = ref.getType();
+      }
+   
+      return (String) ref.getAnnotation("qualified");
    }
    
    /**
@@ -25651,13 +25711,13 @@
            
               // COM-HANDLE reference (or possible reference)
               active_x = isComHandleType(refnode);
-           
+              
               // determine if the primary expression is an object or class reference
-              object = isObjectType(refnode);
+              object = isObjectSubtree(refnode);
               
               if (object)
               {
-                 isStatic = (refnode.getType() == CLASS_NAME);
+                 isStatic = isStaticObject(refnode);
               
                  // determine to what specific class that reference refers
                  cls = getObjectClassName(refnode);
@@ -26932,8 +26992,7 @@
          // write our function-specific annotations
          sym.annotateFunction(#c.getText(), ##, false);
          
-         // the above probably did not set the class name so we force it
-         // here
+         // the above probably did not set the class name so we force it here
          String qname = (String) #udt.getAnnotation("qualified");
          sym.annotateClassRef(qname, ##);
       }
@@ -28783,7 +28842,19 @@
  */
 new_phrase
    :
-      KW_NEW^ user_defined_type_name param_passing_list[false]
+      KW_NEW^ udt:user_defined_type_name param_passing_list[false]
+      {
+         // save the original token type, then rewrite the type
+         ##.putAnnotation("oldtype", new Long(##.getType()));
+         ##.setType(FUNC_CLASS);
+            
+         // write our function-specific annotations
+         sym.annotateFunction(##.getText(), ##, false);
+         
+         // the above probably did not set the class name so we force it here
+         String qname = (String) #udt.getAnnotation("qualified");
+         sym.annotateClassRef(qname, ##);
+      }
    ;
    
 /**
@@ -28801,6 +28872,17 @@
          :
          KW_NO_ERROR
       )?
+      {
+         // save the original token type, then rewrite the type
+         ##.putAnnotation("oldtype", new Long(##.getType()));
+         ##.setType(FUNC_CLASS);
+            
+         // write our function-specific annotations
+         sym.annotateFunction(##.getText(), ##, false);
+         
+         // the above probably did not set the class name so we force it here
+         sym.annotateClassRef("Progress.Lang.Object", ##);
+      }
    ;
    
 /**

