Skip to content
Snippets Groups Projects
Commit df2a18ef authored by Sven Gestegård Robertz's avatar Sven Gestegård Robertz
Browse files

added more messages to RAPID exceptions. added an example .lc file that works for RAPID

parent 5b2422b1
Branches
No related tags found
No related merge requests found
...@@ -94,7 +94,7 @@ aspect RAPID_CodeGen { ...@@ -94,7 +94,7 @@ aspect RAPID_CodeGen {
} }
public void Decl.RAPID_gen(RAPID_env env) { public void Decl.RAPID_gen(RAPID_env env) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException("RAPID code generation (currently) does not support "+getClass().getSimpleName());
} }
public void SampleDecl.RAPID_gen(RAPID_env env) { public void SampleDecl.RAPID_gen(RAPID_env env) {
...@@ -194,7 +194,7 @@ aspect RAPID_CodeGen { ...@@ -194,7 +194,7 @@ aspect RAPID_CodeGen {
} }
public String Type.RAPID_AddType(RAPID_env env, String name) { public String Type.RAPID_AddType(RAPID_env env, String name) {
throw new UnsupportedOperationException("RAPID_AddType not implemented for "+getClass().getSimpleName()); throw new UnsupportedOperationException("RAPID code generation does (currently) not support "+getClass().getSimpleName());
} }
public String StructType.RAPID_AddType(RAPID_env env, String name) { public String StructType.RAPID_AddType(RAPID_env env, String name) {
...@@ -212,7 +212,7 @@ aspect RAPID_CodeGen { ...@@ -212,7 +212,7 @@ aspect RAPID_CodeGen {
public String FixedArrayType.RAPID_AddType(RAPID_env env, String name) { public String FixedArrayType.RAPID_AddType(RAPID_env env, String name) {
String typeName = getType().RAPID_AddType(env, name + "_e"); String typeName = getType().RAPID_AddType(env, name + "_e");
if (getNumExp() > 1) { if (getNumExp() > 1) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException("RAPID generation only (currently) supports one-dimensional arrays");
} }
ArrayList<String> components = new ArrayList<String>(); ArrayList<String> components = new ArrayList<String>();
for (int i = 1; i <= getExp(0).RAPID_getValue(); i++) { for (int i = 1; i <= getExp(0).RAPID_getValue(); i++) {
...@@ -236,13 +236,13 @@ aspect RAPID_CodeGen { ...@@ -236,13 +236,13 @@ aspect RAPID_CodeGen {
} else if (getToken() == LABCOMM_BYTE) { } else if (getToken() == LABCOMM_BYTE) {
return "byte"; return "byte";
} }
throw new UnsupportedOperationException(); throw new UnsupportedOperationException("RAPID code generation does not (currently) support "+getName());
} }
public void Type.RAPID_AddDecodeInstr(RAPID_env env, public void Type.RAPID_AddDecodeInstr(RAPID_env env,
java.util.List<String> instrs, java.util.List<String> instrs,
String var_name, String stream_name) { String var_name, String stream_name) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException("RAPID code generation does not (currently) support "+getClass().getSimpleName());
} }
public void StructType.RAPID_AddDecodeInstr(RAPID_env env, public void StructType.RAPID_AddDecodeInstr(RAPID_env env,
...@@ -289,14 +289,14 @@ aspect RAPID_CodeGen { ...@@ -289,14 +289,14 @@ aspect RAPID_CodeGen {
instrs.add("Decode_String " + stream_name + "," + var_name + ";"); instrs.add("Decode_String " + stream_name + "," + var_name + ";");
break; break;
default: default:
throw new UnsupportedOperationException(); throw new UnsupportedOperationException("RAPID code generation does not (currently) support "+getName());
} }
} }
public void Type.RAPID_AddEncodeInstr(RAPID_env env, public void Type.RAPID_AddEncodeInstr(RAPID_env env,
java.util.List<String> instrs, java.util.List<String> instrs,
String var_name, String stream_name) { String var_name, String stream_name) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException("RAPID code generation does not (currently) support "+getClass().getSimpleName());
} }
public void StructType.RAPID_AddEncodeInstr(RAPID_env env, public void StructType.RAPID_AddEncodeInstr(RAPID_env env,
...@@ -343,12 +343,12 @@ aspect RAPID_CodeGen { ...@@ -343,12 +343,12 @@ aspect RAPID_CodeGen {
instrs.add("Encode_String " + stream_name + "," + var_name + ";"); instrs.add("Encode_String " + stream_name + "," + var_name + ";");
break; break;
default: default:
throw new UnsupportedOperationException(); throw new UnsupportedOperationException("RAPID code generation does not (currently) support "+getName());
} }
} }
public int Exp.RAPID_getValue() { public int Exp.RAPID_getValue() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException("RAPID code generation does not (currently) support "+getClass().getSimpleName());
} }
public int IntegerLiteral.RAPID_getValue() { public int IntegerLiteral.RAPID_getValue() {
......
...@@ -6,17 +6,9 @@ sample struct { ...@@ -6,17 +6,9 @@ sample struct {
} IntString; } IntString;
sample struct { sample struct {
double x; struct {
double y; float x;
} TwoDoubles; float y;
} point;
sample struct { boolean b;
int fixed[2]; } nestedStruct;
int variable[2,_];
} TwoArrays;
sample struct {
int a[2];
int b[2,3];
} TwoFixedArrays;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment