isphinx / protobuf-actionscript3

Automatically exported from code.google.com/p/protobuf-actionscript3
0 stars 0 forks source link

as3 generated code file is wrong #11

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
for this proto i get this as which is completely wrong it doesn't compile it 
has obvious mistakes like :
 private memoizedSerializedSize:int = -1;  which should contain also "var"
or 
  public void writeTo(com.google.protobuf.CodedOutputStream output)  which is 
java def for this method not actionscript 
 also hasName() etc... are missing, is not usable at all.

Original issue reported on code.google.com by zahar...@gmail.com on 13 Oct 2009 at 2:58

Attachments:

GoogleCodeExporter commented 8 years ago
I understand this project is not mantained is there any other AS 
implementation, or maybe the older 
versions are more stable ?
Regards

Original comment by zahar...@gmail.com on 15 Oct 2009 at 6:50

GoogleCodeExporter commented 8 years ago
I don't have much bandwith to look at it, but the project is maintained. I used
version 2.1 in a commercial project and had no issues with it.

Something might have with the introduction of protobuf-2.2, I'll have to look 
at it.

In the mean time, try 2.1.

Original comment by sorrydevil@gmail.com on 16 Oct 2009 at 2:54

GoogleCodeExporter commented 8 years ago
ty for ur input but im looking in message.cc in compiler (version 2.1) and read 
this

 printer->Print(
    "}\n"
    "\n"
    "private memoizedSerializedSize:int = -1;\n"
    "public getSerializedSize():int {\n"
    "  var size:int = memoizedSerializedSize;\n"
    "  if (size != -1) return size;\n"
    "\n"
    "  size = 0;\n");

I'm not a C guru but the string generated is wrong in AS:

private memoizedSerializedSize:int should be
private var memoizedSerializedSize:int the next function def is wrong no 
"function" 
keyword and it misses a override i think.

Original comment by zahar...@gmail.com on 16 Oct 2009 at 6:13

GoogleCodeExporter commented 8 years ago
It seems that as part of protobuf2.2, the "SPEED" option is set by default, 
which
went through an unexplored path full of bad code generation. I ignored the 
SPEED flag
for now.
I also added some support for messages without "java_package" defined.

Original comment by sorrydevil@gmail.com on 16 Oct 2009 at 7:14

GoogleCodeExporter commented 8 years ago
thank you

Original comment by zahar...@gmail.com on 17 Oct 2009 at 6:25