public jplag.Structure filter(jplag.Structure struct) { if (struct==null) return null; jplag.Structure res = new jplag.Structure(); for (int i=0; i<struct.size(); i++) { jplag.Token oldToken = struct.tokens[i]; if (table[oldToken.type]!=-1) res.addToken(new jplag.javax.JavaToken(table[oldToken.type], oldToken.file, oldToken.getLine())); } return res; } }
public void main(String args[]) { System.out.println(parse(new File("."), args).toString()); }
Structure structure = new Structure(); structure.UpdateSize(123); structure.UpdateX(34);
public jplag.Structure parse(File dir, String files[]) { struct = new Structure(); errors = 0; for (int i = 0; i < files.length; i++) { // getProgram().print(null, "Parsing file " + files[i] + "\n"); if (!parseFile(dir, files[i])) errors++; struct.addToken(new CSharpToken(FILE_END, files[i], -1, -1, -1)); } this.parseEnd(); return struct; }
public void add(int type, Token token) { if (type == SEPARATOR_TOKEN && !useMethodSeparators) return; JavaToken tok = new JavaToken(type, actFile, token.beginLine, token.beginColumn, token.image.length()); struct.addToken(tok); /* * getProgram().print(null,token.beginLine+"\t"+ * JavaToken.type2string(type)+"\t"+ token.image); */ } }
public void resetBaseSubmission(Submission sub){ Structure tmpStruct = sub.struct; Token[] tok = tmpStruct.tokens; for (int z = 0; z < tmpStruct.size()-1;z++){ tok[z].basecode = false; } } }
Structure[] structures = new Structures[numStructures]; for(int i = 0; i < numStructures; i++) { structures[i] = new Structure("whatever", 99, "some color")l }
public int query(Structure struct) { struct.write(); // this makes sure all my data is being ref'd by the pointer int size = struct.size(); Pointer p = new Memory(size + 4); p.setInt(0, size); p.write(4, struct.getPointer().getByteArray(0, size), 0, size); message msg = new message(p, size); query_ex(msg); // call to native world
public jplag.Structure parse(File dir, String files[]) { struct = new Structure(); errors = 0; for (int i = 0; i < files.length; i++) { getProgram().print(null, "Parsing file " + files[i] + "\n"); if (!parseFile(dir, files[i])) errors++; System.gc();//Emeric struct.addToken(new JavaToken(FILE_END, files[i], -1, -1, -1)); } this.parseEnd(); return struct; }
public void add(int type, Token token) { struct.addToken(new SchemeToken(type, actFile, token.beginLine)); /* * System.out.println(token.beginLine+"\t"+ (new * SchemeToken(0,null,0)).type2string(type)+"\t"+ token.image); */ }
public int size() { if (struct != null) return structSize = struct.size(); return structSize; }
Structure s = new Structure("matthew", 22, "BLUE");
public jplag.Structure parse(File dir, String files[]) { struct = new Structure(); errors = 0; for (int i = 0; i < files.length; i++) { getProgram().print(null, "Parsing file " + files[i] + "\n"); if (!parseFile(dir, files[i])) errors++; System.gc();//Emeric struct.addToken(new JavaToken(FILE_END, files[i], -1, -1, -1)); } this.parseEnd(); return struct; }
public void add(int type, Token token) { struct.addToken(new JavaToken(type, actFile, token.beginLine)); /* * System.out.println(token.beginLine+"\t"+ (new * JavaToken(0,null,0)).type2string(type)+"\t"+ token.image); */ }
public final String[] allFiles(int sub) { Structure struct = (sub==0 ? subA : subB).struct; int count = 1; for (int i=1; i<struct.size(); i++) if (!struct.tokens[i].file.equals(struct.tokens[i-1].file)) count++; String[] res = new String[count]; if (count > 0) res[0] = struct.tokens[0].file; count = 1; for (int i=1; i<struct.size(); i++) if (!struct.tokens[i].file.equals(struct.tokens[i-1].file)) res[count++] = struct.tokens[i].file; /* bubblesort by file name. (so that equally named files are displayed * approximately side by side.) */ for (int a=1; a<res.length; a++) for (int b=1; b<(res.length-a); b++) if (res[b-1].compareTo(res[b])<0) { String hilf = res[b-1]; res[b-1] = res[b]; res[b] = hilf; } return res; }