Commit 25ad39c4 authored by Sven Gestegård Robertz's avatar Sven Gestegård Robertz
Browse files

started adding type hierarchy to Java API and unifying that with

TypeDefParser/ASTbuilder
parent 26636eec
...@@ -2,3 +2,4 @@ ...@@ -2,3 +2,4 @@
*.class *.class
*.o *.o
*.pyc *.pyc
examples/dynamic/gen
...@@ -14,28 +14,28 @@ aspect ArrayRewrite { ...@@ -14,28 +14,28 @@ aspect ArrayRewrite {
to FixedArrayType { to FixedArrayType {
if (getNumDim() == 1) { if (getNumDim() == 1) {
return new FixedArrayType(getDataType(), return new FixedArrayType(getDataType(),
getDim(0).getExpList()); getDim(0));
} else { } else {
List l = new List(); List l = new List();
for (int i = 1 ; i < getNumDim() ; i++) { for (int i = 1 ; i < getNumDim() ; i++) {
l.add(getDim(i)); l.add(getDim(i));
} }
return new FixedArrayType(new ParseArrayType(getDataType(), l), return new FixedArrayType(new ParseArrayType(getDataType(), l),
getDim(0).getExpList()); getDim(0));
} }
} }
when (getDim(0).isVariable()) when (getDim(0).isVariable())
to VariableArrayType { to VariableArrayType {
if (getNumDim() == 1) { if (getNumDim() == 1) {
return new VariableArrayType(getDataType(), return new VariableArrayType(getDataType(),
getDim(0).getExpList()); getDim(0));
} else { } else {
List l = new List(); List l = new List();
for (int i = 1 ; i < getNumDim() ; i++) { for (int i = 1 ; i < getNumDim() ; i++) {
l.add(getDim(i)); l.add(getDim(i));
} }
return new VariableArrayType(new ParseArrayType(getDataType(), l), return new VariableArrayType(new ParseArrayType(getDataType(), l),
getDim(0).getExpList()); getDim(0));
} }
} }
} }
......
...@@ -170,6 +170,13 @@ aspect Java_Class { ...@@ -170,6 +170,13 @@ aspect Java_Class {
private void Decl.Java_declareUserTypeDeps(Java_env env) { private void Decl.Java_declareUserTypeDeps(Java_env env) {
int numDeps = type_dependencies().size(); int numDeps = type_dependencies().size();
int i=0; int i=0;
env.println("private static DataType dataType;");
env.println("static {");
env.indent();
Java_emitTypeTree(env);
env.unindent();
env.println("}");
env.println("private Set<SampleDispatcher> typeDependencies = new HashSet<SampleDispatcher>();"); env.println("private Set<SampleDispatcher> typeDependencies = new HashSet<SampleDispatcher>();");
env.println("public Dispatcher(){"); env.println("public Dispatcher(){");
...@@ -183,6 +190,12 @@ aspect Java_Class { ...@@ -183,6 +190,12 @@ aspect Java_Class {
env.unindent(); env.unindent();
env.println("}"); env.println("}");
env.println("public DataType getDataType(){");
env.indent();
env.println("return dataType;");
env.unindent();
env.println("}");
env.println("public Iterator<SampleDispatcher> getDependencyIterator(){"); env.println("public Iterator<SampleDispatcher> getDependencyIterator(){");
env.indent(); env.indent();
env.println("return typeDependencies.iterator();"); env.println("return typeDependencies.iterator();");
...@@ -274,6 +287,12 @@ aspect Java_Class { ...@@ -274,6 +287,12 @@ aspect Java_Class {
env.unindent(); env.unindent();
env.println("}"); env.println("}");
env.println(); env.println();
env.println("public static DataType getDataType(){");
env.indent();
env.println("return dispatcher.getDataType();");
env.unindent();
env.println("}");
env.println();
} }
public void TypeDecl.Java_emitClass(Java_env env, String pack) { public void TypeDecl.Java_emitClass(Java_env env, String pack) {
...@@ -284,6 +303,7 @@ aspect Java_Class { ...@@ -284,6 +303,7 @@ aspect Java_Class {
env.println("import se.lth.control.labcomm"+env.verStr+".Constant;"); env.println("import se.lth.control.labcomm"+env.verStr+".Constant;");
env.println("import se.lth.control.labcomm"+env.verStr+".SampleType;"); env.println("import se.lth.control.labcomm"+env.verStr+".SampleType;");
env.println("import se.lth.control.labcomm"+env.verStr+".*;");
if (getDataType().Java_needInstance() || hasDependencies() || isReferenced()) { if (getDataType().Java_needInstance() || hasDependencies() || isReferenced()) {
env.println("import se.lth.control.labcomm"+env.verStr+".Encoder;"); env.println("import se.lth.control.labcomm"+env.verStr+".Encoder;");
...@@ -340,6 +360,7 @@ aspect Java_Class { ...@@ -340,6 +360,7 @@ aspect Java_Class {
env.println("import se.lth.control.labcomm"+env.verStr+".Encoder;"); env.println("import se.lth.control.labcomm"+env.verStr+".Encoder;");
env.println("import se.lth.control.labcomm"+env.verStr+".SampleHandler;"); env.println("import se.lth.control.labcomm"+env.verStr+".SampleHandler;");
env.println("import se.lth.control.labcomm"+env.verStr+".Sample;"); env.println("import se.lth.control.labcomm"+env.verStr+".Sample;");
env.println("import se.lth.control.labcomm"+env.verStr+".*;");
env.println("import java.util.Set;"); env.println("import java.util.Set;");
env.println("import java.util.HashSet;"); env.println("import java.util.HashSet;");
env.println("import java.util.Iterator;"); env.println("import java.util.Iterator;");
...@@ -451,6 +472,98 @@ aspect Java_Class { ...@@ -451,6 +472,98 @@ aspect Java_Class {
} }
} }
public void TypeInstance.Java_emitTypeTree(Java_env env, String varName) {
getDataType().Java_emitTypeTree(env, varName);
}
public void TypeInstance.Java_emitTypeField(Java_env env, String struct, String name) {
getDataType().Java_emitTypeField(env, struct, name);
}
public abstract void DataType.Java_emitTypeTree(Java_env env, String name);
public abstract void DataType.Java_emitTypeField(Java_env env, String struct, String name);
public void PrimType.Java_emitTypeTree(Java_env env, String name) {
env.println("// "+name+"="+getName() + " : " + getToken());
env.println(name+" = new SigPrimitiveType("+getToken()+");");
}
public void PrimType.Java_emitTypeField(Java_env env, String struct, String name) {
//env.println("// "+struct+".addField("+name+ ", "+getName()+");");
env.println(struct+".addField(\""+name+ "\", new SigPrimitiveType("+getToken()+"));");
}
public void VoidType.Java_emitTypeTree(Java_env env, String name) {
env.println(name+"= new VoidType();");
}
public void VoidType.Java_emitTypeField(Java_env env, String struct, String name) {
throw new Error("Void may not be field");
}
public void ParseArrayType.Java_emitTypeTree(Java_env env, String name) {
String elementType = name + "_element";
env.println("DataType "+elementType+";");
getDataType().Java_emitTypeTree(env, elementType);
env.println("// "+name+"= array("+elementType+");");
}
syn String Exp.dimArrayPart();
eq IntegerLiteral.dimArrayPart() = getValue();
eq VariableSize.dimArrayPart() = "-1";
syn String Dim.dimArrayString() {
StringBuilder sb = new StringBuilder();
sb.append("new int[] {");
for(int i=0; i<getNumExp(); i++) {
sb.append(getExp(i).dimArrayPart());
if(i < getNumExp()-1) {
sb.append(", ");
}
}
sb.append("}");
return sb.toString();
}
public void ArrayType.Java_emitTypeTree(Java_env env, String name) {
String elementType = name + "_element";
StringBuilder dim = new StringBuilder();
dim.append("new int[] {");
env.println("DataType "+elementType+";");
getDataType().Java_emitTypeTree(env, elementType);
env.println(name+"= new SigArrayType("+elementType+","+getDim().dimArrayString()+");");
}
public void ParseArrayType.Java_emitTypeField(Java_env env, String struct, String name) {
env.println("// field "+name+ " = array("+getDataType().Java_getTypeName()); }
public void ArrayType.Java_emitTypeField(Java_env env, String struct, String name) {
String innerName = struct+"_"+name;
env.println("DataType "+innerName+";");
Java_emitTypeTree(env, innerName);
env.println(struct+".addField(\""+name+ "\", "+innerName+");");
//env.println(struct+".addField(\""+name+ "\", new UserType(\""+getName()+"\"));");
}
public void StructType.Java_emitTypeTree(Java_env env, String name) {
env.println(name+" = new SigStructType();");
for(Field f : getFields()) {
f.Java_emitTypeField(env, name, f.getName());
}
}
public void StructType.Java_emitTypeField(Java_env env, String struct, String name) {
String innerName = struct+"_"+name;
env.println("SigStructType "+innerName+" = new SigStructType();");
for(Field f : getFields()) {
f.Java_emitTypeField(env, innerName, f.getName());
}
env.println(struct+".addField(\""+name+ "\", "+innerName+");");
}
public void UserType.Java_emitTypeTree(Java_env env, String name) {
env.println(name+" = new SigUserType(\""+getName()+"\");");
}
public void UserType.Java_emitTypeField(Java_env env, String struct, String name) {
env.println(struct+".addField(\""+name+ "\", new SigUserType(\""+getName()+"\"));");
}
public void Decl.Java_emitTypeTree(Java_env env) {
getTypeInstance().Java_emitTypeTree(env, "dataType");
}
//XXX TODO: refactor: split into a static class ("TypeDefSingleton"?)and a (smaller) dispatcher //XXX TODO: refactor: split into a static class ("TypeDefSingleton"?)and a (smaller) dispatcher
public void Decl.Java_emitDispatcher(Java_env env, boolean isSample) { public void Decl.Java_emitDispatcher(Java_env env, boolean isSample) {
// String genericStr = ""; //env.versionHasMetaData()?"<"+getName()+">":""; // String genericStr = ""; //env.versionHasMetaData()?"<"+getName()+">":"";
...@@ -628,6 +741,39 @@ aspect Java_Class { ...@@ -628,6 +741,39 @@ aspect Java_Class {
public void VoidType.Java_emitEncoder(Java_env env, String name) { public void VoidType.Java_emitEncoder(Java_env env, String name) {
} }
public abstract String DataType.Java_getTypeName();
public String UserType.Java_getTypeName() {
return "UserType";
}
public String VoidType.Java_getTypeName() {
return "VoidType";
}
public String ArrayType.Java_getTypeName() {
return "SigArrayType";
}
public String ParseArrayType.Java_getTypeName() {
throw new Error("should not be called");
//return "ParseArrayType";
}
public String StructType.Java_getTypeName() {
return "SigStructType";
}
public String PrimType.Java_getTypeName() {
switch (getToken()) {
case LABCOMM_BOOLEAN: { return "BooleanType"; }
case LABCOMM_BYTE: { return "ByteType"; }
case LABCOMM_SHORT: { return "ShortType"; }
case LABCOMM_INT: { return "IntType"; }
case LABCOMM_LONG: { return "LongType"; }
case LABCOMM_FLOAT: { return "FloatType"; }
case LABCOMM_DOUBLE: { return "DoubleType"; }
case LABCOMM_STRING: { return "StringType"; }
case LABCOMM_SAMPLE: { return "SampleRefType"; }
}
throw new Error( "unknown primitive type ("+getToken()+")");
}
public void PrimType.Java_emitEncoder(Java_env env, String name) { public void PrimType.Java_emitEncoder(Java_env env, String name) {
switch (getToken()) { switch (getToken()) {
case LABCOMM_BOOLEAN: { env.print("e.encodeBoolean"); } break; case LABCOMM_BOOLEAN: { env.print("e.encodeBoolean"); } break;
......
...@@ -35,7 +35,7 @@ PrimType : DataType ::= <Name:String> <Token:int>; ...@@ -35,7 +35,7 @@ PrimType : DataType ::= <Name:String> <Token:int>;
UserType : DataType ::= <Name:String>; UserType : DataType ::= <Name:String>;
StructType : DataType ::= Field*; StructType : DataType ::= Field*;
ParseArrayType : DataType ::= DataType Dim*; ParseArrayType : DataType ::= DataType Dim*;
abstract ArrayType : DataType ::= DataType Exp*; abstract ArrayType : DataType ::= DataType Dim;
VariableArrayType : ArrayType; VariableArrayType : ArrayType;
FixedArrayType : ArrayType; FixedArrayType : ArrayType;
......
/* Temporary aspect with forwarding methods */ /* Temporary aspect with forwarding methods */
aspect Refactoring { aspect Refactoring {
syn int ArrayType.getNumExp() = getDim().getNumExp();
syn Exp ArrayType.getExp(int i) = getDim().getExp(i);
syn String Decl.getName() = getTypeInstance().getName(); syn String Decl.getName() = getTypeInstance().getName();
syn DataType Decl.getDataType() = getTypeInstance().getDataType(); syn DataType Decl.getDataType() = getTypeInstance().getDataType();
......
...@@ -6,6 +6,7 @@ import java.io.IOException; ...@@ -6,6 +6,7 @@ import java.io.IOException;
import se.lth.control.labcomm2014.DecoderChannel; import se.lth.control.labcomm2014.DecoderChannel;
import se.lth.control.labcomm2014.TypeDef; import se.lth.control.labcomm2014.TypeDef;
import se.lth.control.labcomm2014.TypeDefParser; import se.lth.control.labcomm2014.TypeDefParser;
import se.lth.control.labcomm2014.SigTypeDef;
//import se.lth.control.labcomm2014.TypeBinding; //import se.lth.control.labcomm2014.TypeBinding;
public class Decoder public class Decoder
...@@ -65,7 +66,7 @@ public class Decoder ...@@ -65,7 +66,7 @@ public class Decoder
// System.out.println("Got TypeBinding: "+d.getSampleIndex()+" --> "+d.getTypeIndex()+""); // System.out.println("Got TypeBinding: "+d.getSampleIndex()+" --> "+d.getTypeIndex()+"");
// } // }
public void onTypeDef(TypeDefParser.ParsedTypeDef d) { public void onTypeDef(SigTypeDef d) {
System.out.println("ontype_def: "); System.out.println("ontype_def: ");
if(d != null) { if(d != null) {
System.out.print((d.isSampleDef()?"sample ":"typedef ")+d); System.out.print((d.isSampleDef()?"sample ":"typedef ")+d);
......
...@@ -4,6 +4,7 @@ LCLJAR=${LCDIR}/lib/java/labcomm2014.jar# the LabComm library ...@@ -4,6 +4,7 @@ LCLJAR=${LCDIR}/lib/java/labcomm2014.jar# the LabComm library
EXECUTABLES=example_encoder example_decoder \ EXECUTABLES=example_encoder example_decoder \
Encoder.class Decoder.class TDDecoder.class \ Encoder.class Decoder.class TDDecoder.class \
TestDataType.class \
ExampleEncoder.exe ExampleDecoder.exe ExampleEncoder.exe ExampleDecoder.exe
include ${LCDIR}/lib/c/os_compat.mk include ${LCDIR}/lib/c/os_compat.mk
...@@ -51,6 +52,7 @@ build : ...@@ -51,6 +52,7 @@ build :
javac -cp ${LCDIR}/lib/java/labcomm2014.jar:. ${GENDIR}/*.java Encoder.java Decoder.java javac -cp ${LCDIR}/lib/java/labcomm2014.jar:. ${GENDIR}/*.java Encoder.java Decoder.java
javac -cp ${LCDIR}/lib/java/labcomm2014.jar:${LCCJAR}:${GENDIR}:. TDDecoder.java javac -cp ${LCDIR}/lib/java/labcomm2014.jar:${LCCJAR}:${GENDIR}:. TDDecoder.java
javac -cp ${LCDIR}/lib/java/labcomm2014.jar:${LCCJAR}:${GENDIR}:. TestDataType.java
${CC} ${CFLAGS} ${LDFLAGS} -Wall -Werror -Wno-unused-function \ ${CC} ${CFLAGS} ${LDFLAGS} -Wall -Werror -Wno-unused-function \
-I. -I${LCDIR}/lib/c/2014 -L${LCDIR}/lib/c \ -I. -I${LCDIR}/lib/c/2014 -L${LCDIR}/lib/c \
...@@ -183,6 +185,15 @@ runjastadd: cleanbuild ...@@ -183,6 +185,15 @@ runjastadd: cleanbuild
@echo "************ running Java TypeDefdecoder: *****************" @echo "************ running Java TypeDefdecoder: *****************"
java -cp .:${LCDIR}/lib/java/labcomm2014.jar:${LCCJAR}:${GENDIR} TDDecoder encoded_data_j java -cp .:${LCDIR}/lib/java/labcomm2014.jar:${LCCJAR}:${GENDIR} TDDecoder encoded_data_j
rundatatype: cleanbuild
@echo
@echo "********************************************"
@echo "*************** running datatype example ***"
@echo "********************************************"
@echo
@java -cp .:${LCDIR}/lib/java/labcomm2014.jar:${GENDIR} TestDataType
clean: clean:
rm -rf ${GENDIR} rm -rf ${GENDIR}
......
...@@ -6,8 +6,11 @@ import java.io.IOException; ...@@ -6,8 +6,11 @@ import java.io.IOException;
import se.lth.control.labcomm2014.DecoderChannel; import se.lth.control.labcomm2014.DecoderChannel;
import se.lth.control.labcomm2014.TypeDef; import se.lth.control.labcomm2014.TypeDef;
import se.lth.control.labcomm2014.TypeDefParser; import se.lth.control.labcomm2014.TypeDefParser;
import se.lth.control.labcomm2014.SigTypeDef;
import se.lth.control.labcomm2014.ParsedSampleDef;
import se.lth.control.labcomm2014.ASTbuilder; import se.lth.control.labcomm2014.ASTbuilder;
//import se.lth.control.labcomm2014.TypeBinding; //import se.lth.control.labcomm2014.TypeBinding;
import se.lth.control.labcomm2014.DataType;
import se.lth.control.labcomm2014.compiler.Specification; import se.lth.control.labcomm2014.compiler.Specification;
import java.io.FileOutputStream; import java.io.FileOutputStream;
...@@ -75,18 +78,29 @@ public class TDDecoder ...@@ -75,18 +78,29 @@ public class TDDecoder
// System.out.println("Got TypeBinding: "+d.getSampleIndex()+" --> "+d.getTypeIndex()+""); // System.out.println("Got TypeBinding: "+d.getSampleIndex()+" --> "+d.getTypeIndex()+"");
// } // }
public void onTypeDef(TypeDefParser.ParsedTypeDef d) { public void onTypeDef(SigTypeDef d) {
if(d != null && d.isSampleDef()){ if(d != null && d.isSampleDef()){
System.out.println("onTypeDef (sample): "); System.out.println("onTypeDef (sample): ");
//------------
try {
System.out.println("==================== DataType ======");
DataType.printDataType(System.out, d);
System.out.println();
System.out.println("==================== end ======");
} catch (IOException ioe) {
ioe.printStackTrace();
}
ASTbuilder v = new ASTbuilder(); ASTbuilder v = new ASTbuilder();
Specification p = v.makeSpecification((TypeDefParser.ParsedSampleDef) d); Specification p = v.makeSpecification((ParsedSampleDef) d);
try { try {
//FileOutputStream f = new FileOutputStream("/tmp/foopp"+d.getName()+".txt"); FileOutputStream f = new FileOutputStream("/tmp/foopp"+d.getName()+".txt");
//PrintStream out = new PrintStream(f); PrintStream out = new PrintStream(f);
p.pp(System.out); p.pp(System.out);
//p.C_genC(System.out, new Vector(), "lcname", "prefix", 2014); //p.C_genC(System.out, new Vector(), "lcname", "prefix", 2014);
//p.J_gen(out, "testpackage", 2014); p.J_gen(out, "testpackage", 2014);
//out.close(); out.close();
} catch (Throwable e) { } catch (Throwable e) {
System.err.println("Exception: " + e); System.err.println("Exception: " + e);
e.printStackTrace(); e.printStackTrace();
......
import java.io.PrintStream;
import se.lth.control.labcomm2014.*;
/**
* Test data type tree
*/
public class TestDataType
{
private PrintStream out;
public TestDataType(PrintStream out)
throws Exception
{
this.out = out;
}
public void doTest() throws java.io.IOException {
twoLines x = new twoLines();
DataType.printDataType(out, x.getDispatcher());
twoStructsAndInt y = new twoStructsAndInt();
DataType.printDataType(out, y.getDispatcher());
theFirstInt z = new theFirstInt();
DataType.printDataType(out, z.getDispatcher());
doavoid a = new doavoid();
DataType.printDataType(out, a.getDispatcher());
}
public static void main(String[] arg) throws Exception {
TestDataType example = new TestDataType(System.out);
example.doTest();
}
}
...@@ -41,3 +41,19 @@ sample struct { ...@@ -41,3 +41,19 @@ sample struct {
sample anInt theFirstInt; sample anInt theFirstInt;
sample anInt theSecondInt; sample anInt theSecondInt;
sample struct {
struct {
int x;
int y;
} s1;
struct {
int a;
int b;
} s2;
int i;
double double_array[2,3,_][3][_];
} twoStructsAndInt;
...@@ -15,8 +15,27 @@ MODULES=Constant \ ...@@ -15,8 +15,27 @@ MODULES=Constant \
TypeBinding \ TypeBinding \
ASTbuilder \ ASTbuilder \
TypeDefParser \ TypeDefParser \
SigTypeDef \
SigSampleDef \
ParsedTypeDef \
ParsedSampleDef \
Writer \ Writer \
WriterWrapper WriterWrapper \
DataType \
VoidType \
SignatureSymbolVisitor \
SignatureSymbol \
TypeSymbol \
SampleSymbol \
NameSymbol \
SigPrimitiveType \
SigStructType \
SigField \
SigArrayType \
SigUserType
.PHONY: all .PHONY: all
all: labcomm2014.jar all: labcomm2014.jar
......
...@@ -10,9 +10,6 @@ import java.io.DataInputStream; ...@@ -10,9 +10,6 @@ import java.io.DataInputStream;
import java.io.IOException; import java.io.IOException;
import java.io.EOFException; import java.io.EOFException;
import se.lth.control.labcomm2014.TypeDef;
import se.lth.control.labcomm2014.TypeDefParser;
import se.lth.control.labcomm2014.compiler.LabComm; import se.lth.control.labcomm2014.compiler.LabComm;
import se.lth.control.labcomm2014.compiler.LabCommParser; import se.lth.control.labcomm2014.compiler.LabCommParser;
...@@ -40,7 +37,7 @@ import se.lth.control.labcomm2014.compiler.VariableSize; ...@@ -40,7 +37,7 @@ import se.lth.control.labcomm2014.compiler.VariableSize;
/** A class for building a JastAdd AST from the parsed types /** A class for building a JastAdd AST from the parsed types
* created by a TypeDefParser. This class depends on the LabComm compiler. * created by a TypeDefParser. This class depends on the LabComm compiler.
*/ */
public class ASTbuilder implements TypeDefParser.ParsedSymbolVisitor { public class ASTbuilder implements SignatureSymbolVisitor {
private LinkedList<DataType> typeStack; private LinkedList<DataType> typeStack;
private LinkedList<Field> fieldStack; private LinkedList<Field> fieldStack;
...@@ -59,19 +56,19 @@ public class ASTbuilder implements TypeDefParser.ParsedSymbolVisitor { ...@@ -59,19 +56,19 @@ public class ASTbuilder implements TypeDefParser.ParsedSymbolVisitor {
} }
} }
public void visit(TypeDefParser.TypeSymbol s){ public void visit(TypeSymbol s){
throw new Error("not implemented? needed?"); throw new Error("not implemented? needed?");
} }
public void visit(TypeDefParser.SampleSymbol s){ public void visit(SampleSymbol s){
throw new Error("not implemented? needed?"); throw new Error("not implemented? needed?");
} }
public void visit(TypeDefParser.NameSymbol s){ public void visit(NameSymbol s){
throw new Error("not implemented? needed?"); throw new Error("not implemented? needed?");
} }
public void visit(TypeDefParser.PrimitiveType t){ public void visit(SigPrimitiveType t){
typeStack.push(new PrimType(t.getName(), t.getTag())); typeStack.push(new PrimType(t.getName(), t.getTag()));
} }
...@@ -81,24 +78,24 @@ public class ASTbuilder implements TypeDefParser.ParsedSymbolVisitor { ...@@ -81,24 +78,24 @@ public class ASTbuilder implements TypeDefParser.ParsedSymbolVisitor {
// typeStack.push(new SampleRefType()); // typeStack.push(new SampleRefType());
// } // }
public void visit(TypeDefParser.ParsedStructType t){ public void visit(SigStructType t){
if(t.isVoid()) { if(t.isVoid()) {
typeStack.push(new VoidType()); typeStack.push(new VoidType());
} else { } else {
List<Field> tmpF = new List<Field>(); List<Field> tmpF = new List<Field>();
for( TypeDefParser.ParsedField f : t.getFields()) { for( SigField f : t.getFields()) {
f.accept(this); f.accept(this);