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 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 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 void add(int type, Token token) { struct.addToken(new CPPToken(type, actFile, token.beginLine)); } }
public void add(int type, org.antlr.v4.runtime.Token tok) { struct.addToken(new JavaToken(type, (currentFile == null ? "null" : currentFile), tok.getLine(), tok.getCharPositionInLine() + 1, tok.getText().length())); } }
public void add(int type, org.antlr.v4.runtime.Token tok) { struct.addToken(new Python3Token(type, (currentFile == null ? "null" : currentFile), tok.getLine(), tok.getCharPositionInLine() + 1, tok.getText().length())); }
public void add(int type, antlr.Token tok) { if (tok == null) { System.out.println("tok == null ERROR!"); return; } struct.addToken(new CSharpToken(type, currentFile, tok.getLine(), tok.getColumn(), tok.getText().length())); // System.out.println("type: " + CSharpToken.type2string(type) + // " text: '"+tok.getText()+"'"); }
public void add(antlr.Token tok) { ParserToken ptok = (ParserToken) tok; if (filter != null && filter.contains(tok.getText().toLowerCase())) return; struct.addToken(new TextToken(tok.getText(), currentFile, ptok .getLine(), ptok.getColumn(), ptok.getLength(), this)); }
public void add(int type, antlr.Token tok) { ParserToken ptok = (ParserToken) tok; struct.addToken(new JavaToken(type, currentFile, ptok.getLine(), ptok.getColumn(), ptok.getLength())); } }
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 addEnd(int type, org.antlr.v4.runtime.Token tok) { struct.addToken(new Python3Token(type, (currentFile == null ? "null" : currentFile), tok.getLine(), struct.tokens[struct.size()-1].getColumn() + 1,0)); } }
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 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 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 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 Python3Token(FILE_END, files[i], -1, -1, -1)); } this.parseEnd(); return struct; }
public jplag.Structure parse(File dir, String files[]) { struct = new jplag.Structure(); errors = 0; SchemeParser parser = null;// no worry it will be reinitialized // in method parseFile(...) for (int i = 0; i < files.length; i++) { actFile = files[i]; getProgram().print(null, "Parsing file " + files[i] + "\n"); if (!SchemeParser.parseFile(dir, files[i], parser, this)) errors++; struct.addToken(new SchemeToken(FILE_END, actFile, 1)); } this.parseEnd(); return struct; }
public jplag.Structure parse(File dir, String files[]) { struct = new jplag.Structure(); errors = 0; JavaParser parser = null; // This will be (re)initialised in parseFile() for (int i = 0; i < files.length; i++) { actFile = files[i]; getProgram().print(null, "Parsing file " + files[i] + "\n"); if (!JavaParser.parseFile(dir, files[i], parser, this)) errors++; struct.addToken(new JavaToken(FILE_END, actFile, -1, -1, -1)); } this.parseEnd(); return struct; }
public jplag.Structure scan(File dir, String files[]) { struct = new jplag.Structure(); errors = 0; CPPScanner scanner = null;// will be initialized in Method scanFile for (int i = 0; i < files.length; i++) { actFile = files[i]; getProgram().print(null, "Scanning file " + files[i] + "\n"); if (!CPPScanner.scanFile(dir, files[i], scanner, this)) errors++; struct.addToken(new CPPToken(FILE_END, actFile, 1)); } this.parseEnd(); return struct; }
public jplag.Structure parse(File dir, String files[]) { struct = new Structure(); errors = 0; for (int i = 0; i < files.length; i++) { getProgram().print("", "Parsing file " + files[i] + "\n"); if (!parseFile(dir, files[i])) errors++; struct.addToken(new TextToken(FILE_END, files[i], this)); } Structure tmp = struct; struct = null; this.parseEnd(); return tmp; }
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 CharToken(FILE_END, files[i], this)); } //System.err.println(struct.toString()); if (errors == 0) program.print(null, "OK"); else program.print(null, errors + " ERROR" + (errors > 1 ? "S" : "")); this.parseEnd(); return struct; }