outmethodheader.println("#include \"structdefs.h\"");
/* Output types for short array and string */
+ outstructs.println("#define STRINGARRAYTYPE "+
+ (state.getArrayNumber(
+ (new TypeDescriptor(typeutil.getClass(TypeUtil.StringClass))).makeArray(state))+state.numClasses()));
+
outstructs.println("#define STRINGTYPE "+typeutil.getClass(TypeUtil.StringClass).getId());
outstructs.println("#define CHARARRAYTYPE "+
(state.getArrayNumber((new TypeDescriptor(TypeDescriptor.CHAR)).makeArray(state))+state.numClasses()));
public void generateFlatFlagActionNode(FlatMethod fm, FlatFlagActionNode ffann, PrintWriter output) {
output.print("/* FlatFlagActionNode will go here */");
+
}
}
public int kind() {
return FKind.FlatFlagActionNode;
}
+
+ /** This method returns an iterator over the Temp/Flag pairs. */
+
+ public Iterator getTempFlagPairs() {
+ return tempflagpairs.keySet().iterator();
+ }
+
+ public boolean getFlagChange(TempFlagPair tfp) {
+ return ((Boolean)tempflagpairs.get(tfp)).booleanValue();
+ }
public TempDescriptor [] readsTemps() {
if (tempflagpairs.size()==0)
#include "runtime.h"
#include "structdefs.h"
+#include <string.h>
+
extern int classsize[];
#ifdef BOEHM_GC
#include "gc.h"
#define FREEMALLOC(x) calloc(1,x)
#endif
+#ifdef TASK
+int main(int argc, char **argv) {
+ int i;
+ /* Allocate startup object */
+ struct ___StartupObject___ *startupobject=(struct ___StartupObject___*) allocate_new(STARTUPTYPE);
+
+ /* Build array of strings */
+ struct ArrayObject * stringarray=allocate_newarray(STRINGARRAYTYPE, argc);
+ startupobject->___parameters___=stringarray;
+
+ for(i=0;i<argc;i++) {
+ int length=strlen(argv[i]);
+ struct ___String___ *newstring=NewString(argv[i],length);
+ ((void **)(((char *)& stringarray->___length___)+sizeof(int)))[i]=newstring;
+ }
+
+
+}
+#endif
+
int ___Object______hashcode____(struct ___Object___ * ___this___) {
return (int) ___this___;
}
}
}
-
void * allocate_new(int type) {
void * v=FREEMALLOC(classsize[type]);
*((int *)v)=type;
return v;
}
-void * allocate_newarray(int type, int length) {
- void * v=FREEMALLOC(sizeof(struct ArrayObject)+length*classsize[type]);
- *((int *)v)=type;
- ((struct ArrayObject *)v)->___length___=length;
+struct ArrayObject * allocate_newarray(int type, int length) {
+ struct ArrayObject * v=FREEMALLOC(sizeof(struct ArrayObject)+length*classsize[type]);
+ v->type=type;
+ v->___length___=length;
return v;
}
void * allocate_new(int type);
-void * allocate_newarray(int type, int length);
+struct ArrayObject * allocate_newarray(int type, int length);
struct ___String___ * NewString(char *str,int length);
void failedboundschk();