[openrtm-commit:01532] r529 - in trunk/rtmtools/jp.go.aist.rtm.rtcbuilder: resource/IDL src/jp/go/aist/rtm/rtcbuilder/generator test/jp/go/aist/rtm/rtcbuilder/_test/com
openrtm @ openrtm.org
openrtm @ openrtm.org
2015年 5月 27日 (水) 09:25:58 JST
Author: ga
Date: 2015-05-27 09:25:58 +0900 (Wed, 27 May 2015)
New Revision: 529
Added:
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/IDL/InterfaceSample.idl
Modified:
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/IDLParamConverter.java
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/test/jp/go/aist/rtm/rtcbuilder/_test/com/CORBAParseInheritTest.java
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/test/jp/go/aist/rtm/rtcbuilder/_test/com/CORBAParseTypeDefTest.java
Log:
Modified IDL Parse
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/IDL/InterfaceSample.idl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/IDL/InterfaceSample.idl (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/IDL/InterfaceSample.idl 2015-05-27 00:25:58 UTC (rev 529)
@@ -0,0 +1,7 @@
+interface sample{
+
+typedef short shortArray10 [10];
+
+short hoge(out shortArray10 a, in shortArray10 b);
+
+};
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/IDLParamConverter.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/IDLParamConverter.java 2014-10-29 02:59:14 UTC (rev 528)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/IDLParamConverter.java 2015-05-27 00:25:58 UTC (rev 529)
@@ -174,6 +174,10 @@
tdparam.setScopedName(ifname);
tdparam.setTargetDef(node2String(n));
}
+ @Override
+ public void visit(array_declarator n) {
+ tdparam.setArray(true);
+ }
});
n.type_spec.accept(new DepthFirstVisitor(){
@Override
@@ -187,11 +191,16 @@
@Override
public void visit(base_type_spec n) {
tdparam.setOriginalDef(node2String(n));
+
}
@Override
public void visit(scoped_name n) {
tdparam.setOriginalDef(node2String(n));
}
+ @Override
+ public void visit(array_declarator n) {
+ tdparam.setArray(true);
+ }
});
}
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/test/jp/go/aist/rtm/rtcbuilder/_test/com/CORBAParseInheritTest.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/test/jp/go/aist/rtm/rtcbuilder/_test/com/CORBAParseInheritTest.java 2014-10-29 02:59:14 UTC (rev 528)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/test/jp/go/aist/rtm/rtcbuilder/_test/com/CORBAParseInheritTest.java 2015-05-27 00:25:58 UTC (rev 529)
@@ -37,7 +37,7 @@
assertEquals("getGain", serviceClassParams.get(1).getMethods().get(3).getName());
//
assertEquals(1, includeFiles.size());
- assertEquals("D:\\GlobalAssist\\EclipseAISTRep\\jp.go.aist.rtm.rtcbuilder\\resource\\IDL\\MyServiceParent.idl",
+ assertEquals("C:\\GlobalAssist\\EclipseAISTRep\\jp.go.aist.rtm.rtcbuilder\\resource\\IDL\\MyServiceParent.idl",
includeFiles.get(0));
}
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/test/jp/go/aist/rtm/rtcbuilder/_test/com/CORBAParseTypeDefTest.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/test/jp/go/aist/rtm/rtcbuilder/_test/com/CORBAParseTypeDefTest.java 2014-10-29 02:59:14 UTC (rev 528)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/test/jp/go/aist/rtm/rtcbuilder/_test/com/CORBAParseTypeDefTest.java 2015-05-27 00:25:58 UTC (rev 529)
@@ -28,6 +28,19 @@
assertEquals(false, typedefParams.get(1).isSequence());
}
+ public void testArrayDef() throws Exception{
+ String idlContent = FileUtil.readFile(rootPath + "\\resource\\IDL\\InterfaceSample.idl");
+ IDLParser parser = new IDLParser(new StringReader(idlContent));
+
+ specification spec = parser.specification();
+ List<TypeDefParam> typedefParams = IDLParamConverter
+ .convert_typedef(spec, "");
+
+ assertEquals(1, typedefParams.size());
+ assertEquals("short", typedefParams.get(0).getOriginalDef());
+ assertEquals(true, typedefParams.get(0).isArray());
+ }
+
public void testModule() throws Exception{
String idlContent = FileUtil.readFile(rootPath + "\\resource\\IDL\\MyServiceRec.idl");
IDLParser parser = new IDLParser(new StringReader(idlContent));
More information about the openrtm-commit
mailing list