Commit 57c84e53 authored by Sven Gestegård Robertz's avatar Sven Gestegård Robertz
Browse files

Send TYPE_DEF also for primitive types

parent ee498fe7
......@@ -184,17 +184,17 @@ aspect Signature {
}
public void UserType.genSigLineForDecl(SignatureList list, boolean decl) {
if(decl){
//System.out.println("************ UserType.genSigLine("+decl+").... for "+getName());
TypeDecl thet=lookupType(getName());
//System.out.println("************ thet: "+thet.getName() +":"+thet.getType());
thet.genSigLineForDecl(list, decl);
}else{
// if(decl){
// //System.out.println("************ UserType.genSigLine("+decl+").... for "+getName());
// TypeDecl thet=lookupType(getName());
// //System.out.println("************ thet: "+thet.getName() +":"+thet.getType());
// thet.genSigLineForDecl(list, decl);
// }else{
//System.out.println("************ UserType.genSigLine("+decl+").... for "+getName());
TypeDecl thet = lookupType(getName());
// System.out.println("************ thet: "+thet.getName() +":"+thet.getType());
list.addTypeRef(thet, null);
}
// }
}
public void ArrayType.genSigLineForDecl(SignatureList list, boolean decl) {
......
......@@ -7,7 +7,10 @@ using se.lth.control.labcomm;
namespace user_types
{
class Decoder : twoLines.Handler, twoInts.Handler
class Decoder : twoLines.Handler,
twoInts.Handler,
theFirstInt.Handler,
theSecondInt.Handler
{
DecoderChannel dec;
......@@ -16,6 +19,8 @@ namespace user_types
dec = new DecoderChannel(stream);
twoLines.register(dec, this);
twoInts.register(dec, this);
theFirstInt.register(dec, this);
theSecondInt.register(dec, this);
try
{
Console.WriteLine("Running decoder.");
......@@ -49,6 +54,11 @@ namespace user_types
Console.WriteLine("b: "+d.b);
}
public void handle(int d)
{
Console.WriteLine("Got int: "+d);
}
static void Main(string[] args)
{
new Decoder(new FileStream(args[0], FileMode.Open));
......
......@@ -215,7 +215,7 @@ int main(void)
labcomm_encoder_register_generated_encoding_V(encoder);
EXPECT({ 0x02, 0x06, VARIABLE(0), 0x01, 'V', 0x02, 0x11, 0x00,
0x04, 0x08, VARIABLE(1), 0x03, 'v', '_', 't', 0x02, 0x11, 0x00,
0x04, 0x04, VARIABLE(2), 0x01, 'V', VARIABLE(1),
0x04, 0x05, VARIABLE(2), 0x01, 'V', 0x01, VARIABLE(1),
0x05, 0x02, VARIABLE(0), VARIABLE(2) });
labcomm_encoder_ioctl(encoder, IOCTL_WRITER_RESET);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment