You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by er...@apache.org on 2008/06/20 07:21:49 UTC

svn commit: r669796 - /webservices/axis2/trunk/java/modules/corba/src/org/apache/axis2/corba/idl/parser/IDLVisitor.java

Author: eranga
Date: Thu Jun 19 22:21:49 2008
New Revision: 669796

URL: http://svn.apache.org/viewvc?rev=669796&view=rev
Log:
Fix for the issues in 'unsigned' keyword and 'long long' data type

Modified:
    webservices/axis2/trunk/java/modules/corba/src/org/apache/axis2/corba/idl/parser/IDLVisitor.java

Modified: webservices/axis2/trunk/java/modules/corba/src/org/apache/axis2/corba/idl/parser/IDLVisitor.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/corba/src/org/apache/axis2/corba/idl/parser/IDLVisitor.java?rev=669796&r1=669795&r2=669796&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/corba/src/org/apache/axis2/corba/idl/parser/IDLVisitor.java (original)
+++ webservices/axis2/trunk/java/modules/corba/src/org/apache/axis2/corba/idl/parser/IDLVisitor.java Thu Jun 19 22:21:49 2008
@@ -346,7 +346,48 @@
 
         DataType dataType = null;
         Map compositeDataTypes = idl.getCompositeDataTypes();
-        String typeName = getTypeName(typeNode);
+
+        String typeName;
+        if (typeNode.getType() == IDLTokenTypes.LITERAL_unsigned) {
+            AST nextNode = typeNode.getNextSibling();
+            if (nextNode == null) {
+                throw new InvalidIDLException("'unsigned' without a data type");
+            } else if (nextNode.getType() == IDLTokenTypes.LITERAL_short) {
+                typeNode.setNextSibling(nextNode.getNextSibling());
+                typeNode.setFirstChild(nextNode.getFirstChild());
+                typeName = "ushort";
+            } else if (nextNode.getType() == IDLTokenTypes.LITERAL_long) {
+                AST nextToLong = nextNode.getNextSibling();
+                if (nextToLong == null) {
+                    throw new InvalidIDLException("an identifier is required after the 'long' keyword");
+                } else if (nextToLong.getType() == IDLTokenTypes.LITERAL_long) {
+                    typeNode.setNextSibling(nextToLong.getNextSibling());
+                    typeNode.setFirstChild(nextToLong.getFirstChild());
+                    typeName = "ulonglong";
+                } else {
+                    typeNode.setNextSibling(nextNode.getNextSibling());
+                    typeNode.setFirstChild(nextNode.getFirstChild());
+                    typeName = "ulong";
+                }
+            } else {
+                throw new InvalidIDLException("either 'long' or 'short' is expected after the 'unsigned' keyword");
+            }
+        } else if (typeNode.getType() == IDLTokenTypes.LITERAL_long) {
+            AST nextToLong = typeNode.getNextSibling();
+            if (nextToLong == null) {
+                throw new InvalidIDLException("an identifier is required after the 'long' keyword");
+            } else if (nextToLong.getType() == IDLTokenTypes.LITERAL_long) {
+                typeNode.setNextSibling(nextToLong.getNextSibling());
+                typeNode.setFirstChild(nextToLong.getFirstChild());
+                typeName = "longlong";
+            } else {
+                typeName = "long";
+            }
+        } else {
+            typeName = getTypeName(typeNode);    
+        }
+
+
         if (compositeDataTypes!=null) {
             if (!module.equals("")) {
                 if (!typeName.startsWith(module)) {