repo
stringlengths
1
191
file
stringlengths
23
351
code
stringlengths
0
5.32M
file_length
int64
0
5.32M
avg_line_length
float64
0
2.9k
max_line_length
int64
0
288k
extension_type
stringclasses
1 value
soot
soot-master/src/it/java_tests/Test80.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class Test80 { public static void main(String [] args){ Test80 t80 = new Test80(); t80.run(); } public void run(){ new Inner() { public void run(){ System.out.println("running from Anon 1"); } }; } static class Inner { public void run(){ System.out.println("running in Inner"); } } }
1,238
27.813953
71
java
soot
soot-master/src/it/java_tests/Test81.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class Test81 { public static void main(String [] args){ Test81 t81 = new Test81(); t81.run(); } public void run(){ Inner1 in1 = new Inner1(); in1.run(); } public class Inner1 { public void run(){ new Inner() { public void run(){ System.out.println("running from Anon 1"); } }.run(); } } public class Inner { public void run(){ System.out.println("running in Inner"); } } }
1,397
26.411765
71
java
soot
soot-master/src/it/java_tests/Test82.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class Test82 { public static void main (String [] args){ Test82 t82 = new Test82(); t82.run(); } public void run(){ final String atMe = getString(); class MyListener1 { public int x = 9; public void action(){ System.out.println("Smile: "+atMe); } }; new MyListener1().action(); } public String getString(){ return "atMe"; } }
1,285
28.227273
71
java
soot
soot-master/src/it/java_tests/Test83.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ class Helper { public static void main(String [] args){ } public void action(){ System.out.println("Helper"); } } public class Test83{ public static void main(String [] args){ Test83 t83 = new Test83(); t83.run(5); } public void run(final int x){ new Helper(){ public void action(){ int x = 9; System.out.println("x: "+x); } }.action(); } }
1,303
26.166667
71
java
soot
soot-master/src/it/java_tests/Test84.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ class Helper { public static void main(String [] args){ } public void action(){ System.out.println("Helper"); } } public class Test84{ public static void main(String [] args){ Test84 t84 = new Test84(); t84.run(5); } public void run(int x){ new Helper(){ int x = 9; public void action(){ System.out.println("x: "+x); } }.action(); } }
1,284
26.340426
71
java
soot
soot-master/src/it/java_tests/Test85.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ class Super2 { public int x = 8; } public class Test85 extends Super2 { public int x = 9; public static void main(String [] args){ Test85 t85 = new Test85(); t85.run(); } public void run(){ Inner in = new Inner(); in.run(); } class Inner { public void run(){ System.out.println("Test85.super.x: "+Test85.super.x); System.out.println("Test85.this.x: "+Test85.this.x); } } }
1,307
26.829787
71
java
soot
soot-master/src/it/java_tests/Test86.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ class Super4 { public void run(){ System.out.println("running in super"); } } public class Test86 extends Super4 { public int x = 9; public static void main(String [] args){ Test86 t86 = new Test86(); t86.run(); } public void run(){ Inner in = new Inner(); in.run(); } class Inner { public void run(){ System.out.println("Test86.super.run(): "); Test86.super.run(); System.out.println("Test86.this.go(): "); Test86.this.go(); } } public void go(){ System.out.println("running in this.go()"); } }
1,486
26.036364
71
java
soot
soot-master/src/it/java_tests/Test88.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class Test88 { public static void main(String [] args){ Test88 t88 = new Test88(); t88.run(); } public void run(){ Inner in = new Inner(); in.run(); } public class Inner { public void run(){ go("Ondrej"); } } private static void go(String name){ System.out.println("Hello "+name+"!"); } }
1,217
26.681818
71
java
soot
soot-master/src/it/java_tests/Test9.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ interface MyListener { public void action(); } public class Test9 { private int x = 9; public static void main (String [] args){ Test9 t = new Test9(); t.run(); } public void run(){ class MyListener1 implements MyListener { public void action(){ System.out.println("Smile: "+x); go(); } }; MyListener ml = new MyListener1(); ml.action(); } private void go(){ System.out.println("today"); } }
1,361
26.795918
71
java
soot
soot-master/src/it/java_tests/Test90.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ class Super5 { public void run(String s){ System.out.println("running in super "+s); } } public class Test90 extends Super5 { public int x = 9; public static void main(String [] args){ Test90 t90 = new Test90(); t90.run(); } public void run(){ Inner in = new Inner(); in.run(); } class Inner { public void run(){ System.out.println("Test90.super.run(): "); Test90.super.run(getMyString()); } public String getMyString(){ return "hi"; } } }
1,419
25.296296
71
java
soot
soot-master/src/it/java_tests/Test91.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class Test91 { public static void main(String [] args){ Test91 t91 = new Test91(); t91.run(); } public void run(){ class MyClass { public MyClass(int x){ System.out.println("x="+x); } public MyClass(int x, int y){ System.out.println("x*y="+x*y); } public void run(){ System.out.println("running"); } } MyClass m1 = new MyClass(3); MyClass m2 = new MyClass(3, 4); m1.run(); m2.run(); } }
1,413
29.085106
71
java
soot
soot-master/src/it/java_tests/Test92.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class Test92 { public static void main(String [] args){ Test92 t92 = new Test92(); int j = (new Integer(8)).intValue(); t92.run(j); } public void run(final int x){ new Object() { int y = x * 7; public void run(){ System.out.println(y); } }.run(); } }
1,193
29.615385
71
java
soot
soot-master/src/it/java_tests/Test93.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ class Helper { public static void main(String [] args){ } public void action(){ System.out.println("Helper"); } } public class Test93 { public static void main(String [] args) { Test93 t93 = new Test93(); t93.run(); } public void run(){ new Helper(){ int x = 9; {x=x+3;} public void action(){ System.out.println("x: "+x); } }.action(); } }
1,296
26.595745
71
java
soot
soot-master/src/it/java_tests/Test95.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class Test95 { public Object o = new Object () { public void run(){}}; public static void main(String [] args){ } }
962
32.206897
71
java
soot
soot-master/src/it/java_tests/TestBackdoor.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class TestBackdoor { public static void main(String[] args) { char f = 'f'; char g = f; for (char c = 'A'; c <= 'D'; c++) { System.out.println(c); } } }
1,030
31.21875
71
java
soot
soot-master/src/it/java_tests/TestsClass.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ interface TestsInterface { public static int staticVariable = 3; } public class TestsClass implements TestsInterface { public static void main(String [] args){ TestsClass tc = new TestsClass(); tc.run(); } public void run(){ int x = staticVariable; } }
1,126
28.657895
71
java
soot
soot-master/src/it/java_tests/ThisTest.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class ThisTest { int m(ThisTest t) { return t.i; } int j = m(this); final int i = 1; public static void main(String[] args) { System.out.print(new ThisTest().j); } }
1,034
31.34375
71
java
soot
soot-master/src/it/java_tests/ThrowsTest.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class ThrowsTest { public static void main(String [] args){ ThrowsTest t = new ThrowsTest(); try { t.run(); } catch(Exception e){ } } public void run() throws MyException { throw new MyException(); } } class MyException extends Exception{ }
1,149
27.04878
71
java
soot
soot-master/src/it/java_tests/TryCatch.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ import java.io.*; public class TryCatch { int x; public static void main(String [] args) { TryCatch tc = new TryCatch(); tc.run(); tc.x = 8; } private void run(){ try { InputStreamReader isr = new InputStreamReader(System.in); //BufferedReader br = new BufferedReader(isr); //while (true){ //String temp = (String)br.readLine(); // if (temp.equals("done")) break; // System.out.println(temp); //} } /*catch(IOException e) { //System.out.println(e.getMessage()); System.out.println("Error"); }*/ catch(Exception e2) { System.out.println(e2.getMessage()); } finally { System.out.println("Smile"); } } }
1,672
28.875
71
java
soot
soot-master/src/it/java_tests/TryCatch2.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ import java.io.*; public class TryCatch2 { int x; public static void main(String [] args) { TryCatch2 tc = new TryCatch2(); tc.run(); tc.x = 8; } private void run(){ try { InputStreamReader isr = new InputStreamReader(System.in); BufferedReader br = new BufferedReader(isr); while (true){ String temp = (String)br.readLine(); if (temp.equals("done")) break; System.out.println(temp); } } catch(IOException e) { System.out.println(e.getMessage()); //System.out.println("Error"); } catch(Exception e2) { System.out.println(e2.getMessage()); } } }
1,590
29.018868
71
java
soot
soot-master/src/it/java_tests/TryCatch3.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class TryCatch3 { public static void main(String [] args){ new TryCatch3().run(); } public void run(){ try { throw new RuntimeException(); } catch(Exception e){ System.out.println(e); } } }
1,095
29.444444
71
java
soot
soot-master/src/it/java_tests/TryCatchFinallyReturns.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class TryCatchFinallyReturns { public static void main(String [] args){ TryCatchFinallyReturns t = new TryCatchFinallyReturns(); int y = t.run(3); System.out.println(y); } public int run(int i){ int [] x = new int[]{i}; try { if (x[0] == 4) { return 7; } else if (x[1] == 8){ return 2; } } catch (ArrayIndexOutOfBoundsException e){ return 0; } finally { return 3; } } }
1,405
27.693878
71
java
soot
soot-master/src/it/java_tests/TryCatchFinallyReturns2.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class TryCatchFinallyReturns2 { public static void main(String [] args){ TryCatchFinallyReturns2 t = new TryCatchFinallyReturns2(); int y = t.run(3); System.out.println(y); } public int run(int i){ int [] x = new int[]{i}; try { if (x[0] == 4) { return 7; } else if (x[1] == 8){ return 2; } } catch (ArrayIndexOutOfBoundsException e){ try { if (x[0] == 4){ return 7; } else if (x[1] == 8){ return 2; } } catch (ArrayIndexOutOfBoundsException e1){ return 17; } finally { System.out.println("hello"); return 27; } } finally { System.out.println("Hello 2"); return 28; } } }
1,831
27.625
71
java
soot
soot-master/src/it/java_tests/Unary.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class Unary { public static void main (String [] args){ int i = 0; i++; i--; ++i; --i; i = +i; i = -i; i = ~i; boolean j = false; boolean k = !j; int n = 0; for (int m = 0; m < 10; m++){ n = 9+m; } int [] arr = new int [] {3, 4, 5}; int h = 0; int x = arr[h++]; h = 0; int y = arr[++h]; } }
1,288
24.78
71
java
soot
soot-master/src/it/java_tests/UnaryByte.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class UnaryByte { public static void main(String [] args){ byte b = 0; System.out.println(b++); } }
950
31.793103
71
java
soot
soot-master/src/it/java_tests/UnaryDec.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class UnaryDec { private int x = 9; public static void main(String [] args){ UnaryDec ud = new UnaryDec(); ud.run(); } public void run(){ Inner i = new Inner(); i.run(); } class Inner { public void run(){ x--; x-=1; } } }
1,150
25.767442
71
java
soot
soot-master/src/it/java_tests/UnaryFieldInc.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class UnaryFieldInc { private int x = 9; public static void main(String [] args){ UnaryFieldInc ufi = new UnaryFieldInc(); ufi.run(); } public UnaryFieldInc foo(){ System.out.println("running foo()"); return new UnaryFieldInc(); } public void run(){ Inner i = new Inner(); i.run(); } class Inner { public void run(){ foo().x++; } } }
1,289
25.326531
71
java
soot
soot-master/src/it/java_tests/UnaryInc.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class UnaryInc { private int x = 9; public static void main(String [] args){ UnaryInc u = new UnaryInc(); u.run(); } public void run(){ Inner i = new Inner(); i.run(); } public class Inner { public void run(){ x++; System.out.println(x); } } }
1,185
25.954545
71
java
soot
soot-master/src/it/java_tests/UnaryInc2.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class UnaryInc2 { int count = 0; public static void main(String [] args){ UnaryInc2 u = new UnaryInc2(); u.run(); } public void run(){ new Runnable(){ public void run(){ count++; } }.run(); } }
1,119
26.317073
71
java
soot
soot-master/src/it/java_tests/UnaryTest.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class UnaryTest { public static void main(String [] args) { int [] i = new int[4]; int j = 9; i[0] = j++; System.out.println(i[0]); i[1] = ++j; System.out.println(i[1]); } }
1,061
29.342857
71
java
soot
soot-master/src/it/java_tests/UnaryTest3.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class UnaryTest3 { //private int [] x = new int [] {2,3,4,2,3}; private int x = 9; public static void main (String [] args){ UnaryTest3 u = new UnaryTest3(); u.run(); } public void run(){ Inner i = new Inner(); i.run(); } public class Inner { public void run(){ //int i = 0; //x[i++]++; /*int j = 0; System.out.println(x[j++] += 1); System.out.println(x[0]);*/ System.out.println(x++); x--; System.out.println(++x); } } }
1,462
26.092593
71
java
soot
soot-master/src/it/java_tests/UnaryTest4.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class UnaryTest4 { private int [] y = new int [] {2,3,4,2,3}; private int x = 9; public static void main (String [] args){ UnaryTest4 u = new UnaryTest4(); u.run(); } public void run(){ Inner i = new Inner(); i.run(); } public class Inner { public void run(){ int i = 0; y[i++]++; int j = 0; System.out.println(y[j++] += 1); System.out.println(y[0]); System.out.println(x++); x--; System.out.println(++x); } } }
1,452
25.907407
71
java
soot
soot-master/src/it/java_tests/UnaryTests.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class UnaryTests { public static void main (String [] args) { UnaryTests ut = new UnaryTests(); ut.solve(); } void solve(){ long l = 10; int i = 1; l >>= 1; if (l != 0) { } i++; for (i = 1; (l >>= 1) != 0; i++); } }
1,189
22.8
71
java
soot
soot-master/src/it/java_tests/UnreachableFields.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class UnreachableFields { private int x; private Object y; public static void main(String [] args){ } }
955
29.83871
71
java
soot
soot-master/src/it/java_tests/WeirdPrivateSets.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class WeirdPrivateSets { private int x = 9; public WeirdPrivateSets foo(){ System.out.println("foo called"); //return this; return new WeirdPrivateSets(); } public static void main(String [] args){ WeirdPrivateSets wps = new WeirdPrivateSets(); Inner i = wps.new Inner(); System.out.println("x: "+wps.x); i.run(); System.out.println("x: "+wps.x); } public class Inner { public void run(){ foo().x += 2; } } }
1,374
28.255319
71
java
soot
soot-master/src/it/java_tests/WeirdSwitch.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class WeirdSwitch { public static void main(String [] args) { switch (args.length + 0x7ffffff2) { case 0x7ffffff0: case 0x7ffffff1: case 0x7ffffff2: case 0x7ffffff3: System.out.print("OK"); break; default: System.out.print("NOT_OK"); } } }
1,195
30.473684
71
java
soot
soot-master/src/it/java_tests/WhileTest.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class WhileTest { public static void main(String [] args) { int i = 4; while (i < 10 ) { System.out.println(i); if (i == 6) break; i = i + 2; } } }
1,049
30.818182
71
java
soot
soot-master/src/it/java_tests/WhileTestBreak.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class WhileTestBreak { public static void main(String [] args) { int i = 4; outer:while (i < 10 ) { System.out.println(i); if (i == 8) break outer; i = i + 2; } } }
1,066
31.333333
71
java
soot
soot-master/src/it/java_tests/X.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class X { public static void main(String [] args){ X x = new X(); x.m1(); x.m4(); x.m6(); W w = new W(); w.m9(); } public void m1(){ class Y{ public void m2(){ System.out.println("Y 1 m2"); } } Y y = new Y(); y.m2(); class Z{ public void m3(){ System.out.println("Z 1 m3"); } } Z z = new Z(); z.m3(); } public void m4(){ class Y{ public void m5(){ System.out.println("Y 2 m5"); } } Y y = new Y(); y.m5(); } public void m6(){ new Object(){ public void m7(){ System.out.println("Anon 1 in X m7"); } }.m7(); new Object(){ public void m8(){ System.out.println("Anon 2 in X m8"); } }.m8(); } } class W { public void m9(){ new Object(){ public void m10(){ System.out.println("Anon 1 in W m10"); } }.m10(); } }
2,010
23.228916
71
java
soot
soot-master/src/it/tests/arrayclone/src/test.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class test{ public static void main (String[] arg) { test[] x = new test[1]; test[] y = (test[])x.clone(); } }
983
34.142857
71
java
soot
soot-master/src/it/tests/devirt/src/Devirt.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class Devirt { public static final void main( String[] args ) { Devirt d = new Devirt(); d.go(); } public void go() { System.out.println( "Hi there" ); } }
1,021
30.9375
71
java
soot
soot-master/src/it/tests/hello/src/Hello.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class Hello { public static void main(String [] args){ System.out.println( "Hello, World!" ); } }
938
33.777778
71
java
soot
soot-master/src/it/tests/typing/src/test.java
/*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 1997 - 2018 Raja Vallée-Rai and others * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ public class test { public void A() { if (null instanceof String) System.out.println("is String"); else System.out.println("is not String"); } public void B() { int[] array = null; System.out.println("array = " + array[0]); } public static void main(String args[]) { int[] array = null; System.out.println("array = " + array.length); } }
1,266
30.675
71
java
soot
soot-master/src/main/generated/jastadd/beaver/Action.java
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This file is part of Beaver Parser Generator. * * Copyright (C) 2003,2004 Alexander Demenchuk <alder@softanvil.com>. * * All rights reserved. * * See the file "LICENSE" for the terms and conditions for copying, * * distribution and modification of Beaver. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package beaver; /** * An "interface" to Java code executed when a production is reduced. */ public abstract class Action { static public final Action NONE = new Action() { public Symbol reduce(Symbol[] args, int offset) { return new Symbol(null); } }; static public final Action RETURN = new Action() { public Symbol reduce(Symbol[] args, int offset) { return args[offset + 1]; } }; /** * Am action code that is executed when the production is reduced. * * @param args an array part of which is filled with this action arguments * @param offset to the last element <b>BEFORE</b> the first argument of this action * @return a symbol or a value of a LHS nonterminal */ public abstract Symbol reduce(Symbol[] args, int offset); }
1,287
30.414634
85
java
soot
soot-master/src/main/generated/jastadd/beaver/Parser.java
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This file is part of Beaver Parser Generator. * * Copyright (C) 2003,2004 Alexander Demenchuk <alder@softanvil.com>. * * All rights reserved. * * See the file "LICENSE" for the terms and conditions for copying, * * distribution and modification of Beaver. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package beaver; import java.io.IOException; /** * Almost complete implementation of a LALR parser. Two components that it lacks to parse a concrete * grammar -- rule actions and parsing tables -- are provided by a generated subclass. */ public abstract class Parser { static public class Exception extends java.lang.Exception { Exception(String msg) { super(msg); } } /** * This class "lists" reportable events that might happen during parsing. */ static public class Events { public void scannerError(Scanner.Exception e) { System.err.print("Scanner Error:"); if (e.line > 0) { System.err.print(e.line); System.err.print(','); System.err.print(e.column); System.err.print(':'); } System.err.print(' '); System.err.println(e.getMessage()); } public void syntaxError(Symbol token) { System.err.print(':'); System.err.print(Symbol.getLine(token.start)); System.err.print(','); System.err.print(Symbol.getColumn(token.start)); System.err.print('-'); System.err.print(Symbol.getLine(token.end)); System.err.print(','); System.err.print(Symbol.getColumn(token.end)); System.err.print(": Syntax Error: unexpected token "); if (token.value != null) { System.err.print('"'); System.err.print(token.value); System.err.println('"'); } else { System.err.print('#'); System.err.println(token.id); } } public void unexpectedTokenRemoved(Symbol token) { System.err.print(':'); System.err.print(Symbol.getLine(token.start)); System.err.print(','); System.err.print(Symbol.getColumn(token.start)); System.err.print('-'); System.err.print(Symbol.getLine(token.end)); System.err.print(','); System.err.print(Symbol.getColumn(token.end)); System.err.print(": Recovered: removed unexpected token "); if (token.value != null) { System.err.print('"'); System.err.print(token.value); System.err.println('"'); } else { System.err.print('#'); System.err.println(token.id); } } public void missingTokenInserted(Symbol token) { System.err.print(':'); System.err.print(Symbol.getLine(token.start)); System.err.print(','); System.err.print(Symbol.getColumn(token.start)); System.err.print('-'); System.err.print(Symbol.getLine(token.end)); System.err.print(','); System.err.print(Symbol.getColumn(token.end)); System.err.print(": Recovered: inserted missing token "); if (token.value != null) { System.err.print('"'); System.err.print(token.value); System.err.println('"'); } else { System.err.print('#'); System.err.println(token.id); } } public void misspelledTokenReplaced(Symbol token) { System.err.print(':'); System.err.print(Symbol.getLine(token.start)); System.err.print(','); System.err.print(Symbol.getColumn(token.start)); System.err.print('-'); System.err.print(Symbol.getLine(token.end)); System.err.print(','); System.err.print(Symbol.getColumn(token.end)); System.err.print(": Recovered: replaced unexpected token with "); if (token.value != null) { System.err.print('"'); System.err.print(token.value); System.err.println('"'); } else { System.err.print('#'); System.err.println(token.id); } } public void errorPhraseRemoved(Symbol error) { System.err.print(':'); System.err.print(Symbol.getLine(error.start)); System.err.print(','); System.err.print(Symbol.getColumn(error.start)); System.err.print('-'); System.err.print(Symbol.getLine(error.end)); System.err.print(','); System.err.print(Symbol.getColumn(error.end)); System.err.println(": Recovered: removed error phrase"); } } /** * This class wraps a Scanner and provides a token "accumulator" for a parsing simulation. * <p>If a source that is being parsed does not have syntax errors this wrapper only adds * one indirection while it delivers the next token. However when parser needs to recover * from a syntax error this wrapper accumulates tokens shifted by a forward parsing simulation * and later feeds them to the recovered parser. */ public class TokenStream { private Scanner scanner; private Symbol[] buffer; private int n_marked; private int n_read; private int n_written; public TokenStream(Scanner scanner) { this.scanner = scanner; } public TokenStream(Scanner scanner, Symbol first_symbol) { this(scanner); alloc(1); buffer[0] = first_symbol; n_written++; } public Symbol nextToken() throws IOException { if (buffer != null) { if (n_read < n_written) return buffer[n_read++]; if (n_written < n_marked) { n_read++; return buffer[n_written++] = readToken(); } buffer = null; } return readToken(); } /** * Prepare a stream to accumulate tokens. * * @param size number of shifted tokens to accumulate */ public void alloc(int size) { buffer = new Symbol[(n_marked = size) + 1]; n_read = n_written = 0; } /** * Prepare accumulated tokens to be reread by a next simulation run * or by a recovered parser. */ public void rewind() { n_read = 0; } /** * Insert two tokens at the beginning of a stream. * * @param t0 first token to be inserted * @param t1 second token to be inserted */ public void insert(Symbol t0, Symbol t1) { if (buffer.length - n_written < 2) throw new IllegalStateException ("not enough space in the buffer"); System.arraycopy(buffer, 0, buffer, 2, n_written); buffer[0] = t0; buffer[1] = t1; n_written += 2; } /** * Removes a token from the accumulator. * * @param i index of a token in the accumulator. * @return removed token */ public Symbol remove(int i) { Symbol token = buffer[i]; int last = n_written - 1; while (i < last) { buffer[i] = buffer[++i]; } n_written = last; return token; } /** * Checks whether a simulation filled the token accumulator. * * @return true if accumulator is full */ boolean isFull() { return n_read == n_marked; } /** * Reads next recognized token from the scanner. If scanner fails to recognize a token and * throws an exception it will be reported via Parser.scannerError(). * <p>It is expected that scanner is capable of returning at least an EOF token after the * exception.</p> * * @return next recognized token * @throws IOException * as thrown by a scanner */ private Symbol readToken() throws IOException { while (true) { try { return scanner.nextToken(); } catch (Scanner.Exception e) { report.scannerError(e); } } } } /** * Simulator is a stripped (of action code) version of a parser that will try to parse ahead * token stream after a syntax error. The simulation is considered successful if 3 tokens were * shifted successfully. If during simulation this parser encounters an error it drops the first * token it tried to use and restarts the simulated parsing. * <p> * Note: Without a special "error" rule present in a grammar, which a parser will try to shift * at the beginning of an error recovery, simulation continues without removing anything from * the original states stack. This often will lead to cases when no parsing ahead will recover * the parser from a syntax error. * </p> */ public class Simulator { private short[] states; private int top, min_top; public boolean parse(TokenStream in) throws IOException { initStack(); do { Symbol token = in.nextToken(); while (true) { short act = tables.findParserAction(states[top], token.id); if (act > 0) { shift(act); break; } else if (act == accept_action_id) { return true; } else if (act < 0) { short nt_id = reduce(~act); act = tables.findNextState(states[top], nt_id); if (act > 0) shift(act); else return act == accept_action_id; } else // act == 0, i.e. this is an error { return false; } } } while (!in.isFull()); return true; } private void initStack() throws IOException { if (states == null || states.length < Parser.this.states.length) { states = new short[Parser.this.states.length]; min_top = 0; } System.arraycopy(Parser.this.states, min_top, states, min_top, (top = Parser.this.top) + 1); } private void increaseStackCapacity() { short[] new_states = new short[states.length * 2]; System.arraycopy(states, 0, new_states, 0, states.length); states = new_states; } private void shift(short state) { if (++top == states.length) increaseStackCapacity(); states[top] = state; } private short reduce(int rule_id) { int rule_info = tables.rule_infos[rule_id]; int rhs_size = rule_info & 0xFFFF; top -= rhs_size; min_top = Math.min(min_top, top); return (short) (rule_info >>> 16); } } /** The automaton tables. */ protected final ParsingTables tables; /** Cached ID of the ACCEPT action. */ protected final short accept_action_id; /** The parser's stack. */ protected short[] states; /** Index of the stack's top element, i.e. it's = -1 when the stack is empty; */ protected int top; /** The stack of shifted symbols. */ protected Symbol[] _symbols; /** Parsing events notification "gateway" */ protected Events report; protected Parser(ParsingTables tables) { this.tables = tables; this.accept_action_id = (short) ~tables.rule_infos.length; this.states = new short[256]; } /** * Parses a source and returns a semantic value of the accepted nonterminal * * @param source of tokens - a Scanner * @return semantic value of the accepted nonterminal */ public Object parse(Scanner source) throws IOException, Parser.Exception { init(); return parse(new TokenStream(source)); } /** * Parses a source and returns a semantic value of the accepted nonterminal. * Before parsing starts injects alternative goal marker into the source to * indicate that an alternative goal should be matched. * * @param source of tokens - a Scanner * @param alt_goal_marker_id ID of a token like symbol that will be used as a marker * @return semantic value of the accepted nonterminal */ public Object parse(Scanner source, short alt_goal_marker_id) throws IOException, Parser.Exception { init(); TokenStream in = new TokenStream(source, new Symbol(alt_goal_marker_id)); return parse(in); } private Object parse(TokenStream in) throws IOException, Parser.Exception { while (true) { Symbol token = in.nextToken(); while (true) { short act = tables.findParserAction(states[top], token.id); if (act > 0) { shift(token, act); break; } else if (act == accept_action_id) { Symbol goal = _symbols[top]; _symbols = null; // drop this stack to prevent loitering return goal.value; } else if (act < 0) { Symbol nt = reduce(~act); act = tables.findNextState(states[top], nt.id); if (act > 0) { shift(nt, act); } else if (act == accept_action_id) { _symbols = null; // no loitering return nt.value; } else { throw new IllegalStateException("Cannot shift a nonterminal"); } } else // act == 0, i.e. this is an error { report.syntaxError(token); recoverFromError(token, in); break; // because error recovery altered token stream - parser needs to refetch the next token } } } } /** * Invoke actual reduce action routine. * Method must be implemented by a generated parser * * @param rule_num ID of a reduce action routine to invoke * @param offset to the symbol before first action routine argument * @return reduced nonterminal */ protected abstract Symbol invokeReduceAction(int rule_num, int offset); /** * Performs stacks and, if not initialized yet, reduce actions array initialization. */ private void init() { if (report == null) report = new Events(); _symbols = new Symbol[states.length]; top = 0; // i.e. it's not empty _symbols[top] = new Symbol("none"); // need a symbol here for a default reduce on the very first erroneous token states[top] = 1; // initial/first state } /** * Increases the stack capacity if it has no room for new entries. */ private void increaseStackCapacity() { short[] new_states = new short[states.length * 2]; System.arraycopy(states, 0, new_states, 0, states.length); states = new_states; Symbol[] new_stack = new Symbol[states.length]; System.arraycopy(_symbols, 0, new_stack, 0, _symbols.length); _symbols = new_stack; } /** * Shift a symbol to stack and go to a new state * * @param sym * symbol that will be shifted * @param goto_state * to switch to */ private void shift(Symbol sym, short goto_state) { if (++top == states.length) increaseStackCapacity(); _symbols[top] = sym; states[top] = goto_state; } /** * Perform a reduce action. * * @param rule_id * Number of the production by which to reduce * @return nonterminal created by a reduction */ private Symbol reduce(int rule_id) { int rule_info = tables.rule_infos[rule_id]; int rhs_size = rule_info & 0xFFFF; top -= rhs_size; Symbol lhs_sym = invokeReduceAction(rule_id, top); lhs_sym.id = (short) (rule_info >>> 16); if (rhs_size == 0) { lhs_sym.start = lhs_sym.end = _symbols[top].end; } else { lhs_sym.start = _symbols[top + 1].start; lhs_sym.end = _symbols[top + rhs_size].end; } return lhs_sym; } /** * Implements parsing error recovery. Tries several simple approaches first, like deleting "bad" token * or replacing the latter with one of the expected in his state (if possible). If simple methods did * not work tries to do error phrase recovery. * * It is expected that normally descendant parsers do not need to alter this method. In same cases though * they may want to override it if they need a different error recovery strategy. * * @param token a lookahead terminal symbol that messed parsing * @param in token stream * @throws IOException propagated from a scanner if it has issues with the source * @throws Parser.Exception if Parser cannot recover */ protected void recoverFromError(Symbol token, TokenStream in) throws IOException, Parser.Exception { if (token.id == 0) // end of input throw new Parser.Exception("Cannot recover from the syntax error"); Simulator sim = new Simulator(); in.alloc(3); short current_state = states[top]; if (!tables.compressed) // then we can try "insert missing" and "replace unexpected" recoveries { short first_term_id = tables.findFirstTerminal(current_state); if (first_term_id >= 0) { Symbol term = new Symbol(first_term_id, _symbols[top].end, token.start); in.insert(term, token); // insert expected terminal before unexpected one in.rewind(); if (sim.parse(in)) { in.rewind(); report.missingTokenInserted(term); return; } int offset = tables.actn_offsets[current_state]; for (short term_id = (short) (first_term_id + 1); term_id < tables.n_term; term_id++) { int index = offset + term_id; if (index >= tables.lookaheads.length) break; if (tables.lookaheads[index] == term_id) { term.id = term_id; in.rewind(); if (sim.parse(in)) { in.rewind(); report.missingTokenInserted(term); return; } } } in.remove(1); // unexpected token, i.e. alter stream as if we replaced // the unexpected token to an expected terminal term.start = token.start; term.end = token.end; for (short term_id = first_term_id; term_id < tables.n_term; term_id++) { int index = offset + term_id; if (index >= tables.lookaheads.length) break; if (tables.lookaheads[index] == term_id) { term.id = term_id; in.rewind(); if (sim.parse(in)) { in.rewind(); report.misspelledTokenReplaced(term); return; } } } in.remove(0); // simple recoveries failed - remove all stream changes } } // finally try parsing without unexpected token (as if it was "deleted") if (sim.parse(in)) { in.rewind(); report.unexpectedTokenRemoved(token); return; } // Simple recoveries failed or are not applicable. Next step is an error phrase recovery. /* * Find a state where parser can shift "error" symbol. Discard already reduced (and shifted) * productions, which are part of a phrase where unexpected terminal is found. (Note that if * "error" symbol was not used by a grammar, in the end the entire input becomes an error phrase, * and ... parser won't recover from it :) */ Symbol first_sym = token, last_sym = token; short goto_state; while ((goto_state = tables.findNextState(states[top], tables.error_symbol_id)) <= 0) { // parser cannot shift "error" in this state, so use the top symbol // as the leftmost symbol of an error phrase first_sym = _symbols[top]; // and go to the previous state if (--top < 0) throw new Parser.Exception("Cannot recover from the syntax error"); } Symbol error = new Symbol(tables.error_symbol_id, first_sym.start, last_sym.end); // the end is temporary shift(error, goto_state); in.rewind(); while (!sim.parse(in)) { last_sym = in.remove(0); if (last_sym.id == 0) // EOF throw new Parser.Exception("Cannot recover from the syntax error"); in.rewind(); } error.end = last_sym.end; in.rewind(); report.errorPhraseRemoved(error); } }
19,316
27.533235
116
java
soot
soot-master/src/main/generated/jastadd/beaver/ParsingTables.java
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This file is part of Beaver Parser Generator. * * Copyright (C) 2003,2004 Alexander Demenchuk <alder@softanvil.com>. * * All rights reserved. * * See the file "LICENSE" for the terms and conditions for copying, * * distribution and modification of Beaver. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package beaver; import java.io.ByteArrayInputStream; import java.io.DataInputStream; import java.io.IOException; import java.io.InputStream; import java.util.zip.InflaterInputStream; /** * Parsing Tables */ public final class ParsingTables { /** A table with all actions */ private final short[] actions; /** * A table containing the lookahead for each entry in "actions" table. * Used to detect "collisions". */ final short[] lookaheads; /** * For each state, the offset into "actions" table that is used to find action for a terminal * that has been fetched from the scanner. */ final int[] actn_offsets; /** * For each state, the offset into "actions" table that is used to find a next parser's state * using a nonterminal that has been created by a reduced production. */ private final int[] goto_offsets; /** Default action for each state */ private final short[] default_actions; /** * A table with encoded production information. * <p/> * Each slot in this table is a "structure": * <pre> * short lhs_symbol_id ; // Symbol on the left-hand side of the production * short rhs_length ; // Number of right-hand side symbols in the production * </pre> * where lhs_symbol_id uses high 16 bit of this structure, and rhs_length - lower 16 bits */ final int[] rule_infos; /** ID of the "error" nonterminal */ final short error_symbol_id; /** Indicates whether action tables were compressed. */ final boolean compressed; /** Number of terminal symbols. */ final int n_term; /** * Ensures that parser tables are loaded. * * @param impl_class class of the instance of the Parser */ public ParsingTables(Class impl_class) { this(getSpecAsResourceStream(impl_class)); } public ParsingTables(String spec) { this(new ByteArrayInputStream(decode(spec))); } private ParsingTables(InputStream in) { try { DataInputStream data = new DataInputStream(new InflaterInputStream(in)); try { int len = data.readInt(); actions = new short[len]; for (int i = 0; i < len; i++) { actions[i] = data.readShort(); } lookaheads = new short[len]; for (int i = 0; i < len; i++) { lookaheads[i] = data.readShort(); } len = data.readInt(); actn_offsets = new int[len]; for (int i = 0; i < len; i++) { actn_offsets[i] = data.readInt(); } goto_offsets = new int[len]; for (int i = 0; i < len; i++) { goto_offsets[i] = data.readInt(); } len = data.readInt(); compressed = len != 0; if (compressed) { default_actions = new short[len]; for (int i = 0; i < len; i++) { default_actions[i] = data.readShort(); } } else { default_actions = null; } int min_nt_id = Integer.MAX_VALUE; len = data.readInt(); rule_infos = new int[len]; for (int i = 0; i < len; i++) { rule_infos[i] = data.readInt(); min_nt_id = Math.min(min_nt_id, rule_infos[i] >>> 16); } n_term = min_nt_id; error_symbol_id = data.readShort(); } finally { data.close(); } } catch (IOException e) { throw new IllegalStateException("cannot initialize parser tables: " + e.getMessage()); } } /** * Scans lookaheads expected in a given state for a terminal symbol. * Used in error recovery when an unexpected terminal is replaced with one that is expected. * * @param state in which error occured * @return ID of the expected terminal symbol or -1 if there is none */ final short findFirstTerminal(int state) { int offset = actn_offsets[state]; for (short term_id = offset < 0 ? (short) -offset : 0; term_id < n_term; term_id++) { int index = offset + term_id; if (index >= lookaheads.length) break; if (lookaheads[index] == term_id) return term_id; } return -1; } /** * Find the appropriate action for a parser in a given state with a specified terminal look-ahead. * * @param state of a parser * @param lookahead * @return parser action */ final short findParserAction(int state, short lookahead) { int index = actn_offsets[state]; if (index != UNUSED_OFFSET) { index += lookahead; if (0 <= index && index < actions.length && lookaheads[index] == lookahead) { return actions[index]; } } return compressed ? default_actions[state] : 0; } /** * Find the appropriate action for a parser in a given state with a specified nonterminal look-ahead. * In this case the only possible outcomes are either a state to shift to or an accept action. * * @param state of a parser * @param lookahead * @return parser action */ final short findNextState(int state, short lookahead) { int index = goto_offsets[state]; if (index != UNUSED_OFFSET) { index += lookahead; if (0 <= index && index < actions.length && lookaheads[index] == lookahead) { return actions[index]; } } return compressed ? default_actions[state] : 0; } static final int UNUSED_OFFSET = Integer.MIN_VALUE; static byte[] decode(String spec) { char[] chars = spec.toCharArray(); if (chars.length % 4 != 0) throw new IllegalArgumentException("corrupted encoding"); int len = chars.length / 4 * 3; byte[] bytes = new byte[chars[chars.length - 1] == '=' ? chars[chars.length - 2] == '=' ? len - 2 : len - 1 : len]; len -= 3; int ci = 0, bi = 0; while (bi < len) { int acc = decode(chars[ci++]) << 18 | decode(chars[ci++]) << 12 | decode(chars[ci++]) << 6 | decode(chars[ci++]); bytes[bi++] = (byte) (acc >> 16); bytes[bi++] = (byte) (acc >> 8 & 0xFF); bytes[bi++] = (byte) (acc & 0xFF); } int acc = decode(chars[ci++]) << 18 | decode(chars[ci++]) << 12 | decode(chars[ci++]) << 6 | decode(chars[ci++]); bytes[bi++] = (byte) (acc >> 16); if (bi < bytes.length) { bytes[bi++] = (byte) (acc >> 8 & 0xFF); if (bi < bytes.length) { bytes[bi++] = (byte) (acc & 0xFF); } } return bytes; } static int decode(char c) { if (c <= '9') { if (c >= '0') return c - '0'; if (c == '#') return 62; if (c == '$') return 63; } else if (c <= 'Z') { if (c >= 'A') return c - 'A' + 10; if (c == '=') return 0; } else if ('a' <= c && c <= 'z') return c - 'a' + 36; throw new IllegalStateException("illegal encoding character '" + c + "'"); } static InputStream getSpecAsResourceStream(Class impl_class) { String name = impl_class.getName(); name = name.substring(name.lastIndexOf('.') + 1) + ".spec"; InputStream spec_stream = impl_class.getResourceAsStream(name); if (spec_stream == null) throw new IllegalStateException("parser specification not found"); return spec_stream; } }
7,289
24.94306
117
java
soot
soot-master/src/main/generated/jastadd/beaver/Scanner.java
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This file is part of Beaver Parser Generator. * * Copyright (C) 2003,2004 Alexander Demenchuk <alder@softanvil.com>. * * All rights reserved. * * See the file "LICENSE" for the terms and conditions for copying, * * distribution and modification of Beaver. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package beaver; import java.io.IOException; /** * Defines an interface expected by a generated parser. */ public abstract class Scanner { public static class Exception extends java.lang.Exception { public final int line; public final int column; public Exception(String msg) { this(0, 0, msg); } public Exception(int line, int column, String msg) { super(msg); this.line = line; this.column = column; } } public abstract Symbol nextToken() throws IOException, Scanner.Exception; }
1,039
25
74
java
soot
soot-master/src/main/generated/jastadd/beaver/Symbol.java
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This file is part of Beaver Parser Generator. * * Copyright (C) 2003,2004 Alexander Demenchuk <alder@softanvil.com>. * * All rights reserved. * * See the file "LICENSE" for the terms and conditions for copying, * * distribution and modification of Beaver. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package beaver; /** * Represents a symbol of a grammar. */ public class Symbol implements Cloneable { static private final int COLUMN_FIELD_BITS = 12; static private final int COLUMN_FIELD_MASK = (1 << COLUMN_FIELD_BITS) - 1; /** * Packs symbol "coordinates" into a single number. */ static public int makePosition(int line, int column) { return line << COLUMN_FIELD_BITS | column; } /** * Extracts line number from a packed position. */ static public int getLine(int position) { return position >>> COLUMN_FIELD_BITS; } /** * Extracts column number from a packed position. */ static public int getColumn(int position) { return position & COLUMN_FIELD_MASK; } /** * Value assigned to this symbol. */ public Object value; /** * Numeric symbol ID. */ protected short id; /** * Line and column where this symbol begins. */ protected int start; /** * Line and column where this symbol ends. */ protected int end; public Symbol(short id) { this.id = id; this.value = null; } public Symbol(short id, Object value) { this.id = id; this.value = value; } public Symbol(short id, int start, int end) { this.id = id; this.value = null; this.start = start; this.end = end; } public Symbol(short id, int left, int right, Object value) { this.id = id; this.value = value; this.start = left; this.end = right; } public Symbol(short id, int start_line, int start_column, int length) { this.id = id; this.value = null; this.start = makePosition(start_line, start_column); this.end = makePosition(start_line, start_column + length - 1); } public Symbol(short id, int start_line, int start_column, int length, Object value) { this.id = id; this.value = value; this.start = makePosition(start_line, start_column); this.end = makePosition(start_line, start_column + length - 1); } /** * Creates Symbol for non-symbolic results of action routines * * @param value attached Symbol's value */ public Symbol(Object value) { this.value = value; } /** * Special case constructor that allows creation of explicitly Symbol-ized nonterminals. * <p/> * Used by classes descending from Symbol and which instances are returned by reduce actions. * In this case ID and symbol position will be assigned by the parser when reduce action * code returns this symbol. */ protected Symbol() { this.value = this; } /** * Returns an ID of this symbol. * <p/> * This ID typically is, depending on a symbol type, either a terminal ID if a Symbol is a token * created and returned by a Scanner, or a nonterminal ID if a symbol was created by parser based * on that nonterminal definition. In the former case the ID is one of IDs generated by Beaver * for terminal symbols. The latter keeps IDs of nonterminal symbols. * * @return symbol's ID */ public short getId() { return id; } /** * Returns a position in a source where this symbol starts. * * @return packed line and column numbers */ public int getStart() { return start; } /** * Returns a position in a source where this symbol ends. * * @return packed line and column numbers */ public int getEnd() { return end; } public Symbol clone() throws CloneNotSupportedException { Symbol copy = (Symbol) super.clone(); copy.value = copy; return copy; } }
3,940
22.182353
98
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/ASTNode$State.java
package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @apilevel internal * @ast class * */ public class ASTNode$State extends java.lang.Object { /** * @apilevel internal */ public boolean IN_CIRCLE = false; /** * @apilevel internal */ public int CIRCLE_INDEX = 1; /** * @apilevel internal */ public boolean CHANGE = false; /** * @apilevel internal */ public boolean RESET_CYCLE = false; /** * @apilevel internal */ static public class CircularValue { Object value; int visited = -1; } public static final int REWRITE_CHANGE = 1; public static final int REWRITE_NOCHANGE = 2; public static final int REWRITE_INTERRUPT = 3; public int boundariesCrossed = 0; private int[] stack; private int pos; public ASTNode$State() { stack = new int[64]; pos = 0; } private void ensureSize(int size) { if(size < stack.length) return; int[] newStack = new int[stack.length * 2]; System.arraycopy(stack, 0, newStack, 0, stack.length); stack = newStack; } public void push(int i) { ensureSize(pos+1); stack[pos++] = i; } public int pop() { return stack[--pos]; } public int peek() { return stack[pos-1]; } /** * @apilevel internal */ static class IdentityHashSet extends java.util.AbstractSet implements java.util.Set { public IdentityHashSet(int initialCapacity) { map = new java.util.IdentityHashMap(initialCapacity); } private java.util.IdentityHashMap map; private static final Object PRESENT = new Object(); public java.util.Iterator iterator() { return map.keySet().iterator(); } public int size() { return map.size(); } public boolean isEmpty() { return map.isEmpty(); } public boolean contains(Object o) { return map.containsKey(o); } public boolean add(Object o) { return map.put(o, PRESENT)==null; } public boolean remove(Object o) { return map.remove(o)==PRESENT; } public void clear() { map.clear(); } } public Options options = new Options(); public int replacePos = 0; protected int duringImplicitConstructor = 0; protected int duringBoundNames = 0; protected int duringNameResolution = 0; protected int duringSyntacticClassification = 0; protected int duringAnonymousClasses = 0; protected int duringVariableDeclarationTransformation = 0; protected int duringLiterals = 0; protected int duringDU = 0; protected int duringAnnotations = 0; protected int duringEnums = 0; protected int duringGenericTypeVariables = 0; public void reset() { IN_CIRCLE = false; CIRCLE_INDEX = 1; CHANGE = false; boundariesCrossed = 0; if(duringImplicitConstructor != 0) { System.out.println("Warning: resetting duringImplicitConstructor"); duringImplicitConstructor = 0; } if(duringBoundNames != 0) { System.out.println("Warning: resetting duringBoundNames"); duringBoundNames = 0; } if(duringNameResolution != 0) { System.out.println("Warning: resetting duringNameResolution"); duringNameResolution = 0; } if(duringSyntacticClassification != 0) { System.out.println("Warning: resetting duringSyntacticClassification"); duringSyntacticClassification = 0; } if(duringAnonymousClasses != 0) { System.out.println("Warning: resetting duringAnonymousClasses"); duringAnonymousClasses = 0; } if(duringVariableDeclarationTransformation != 0) { System.out.println("Warning: resetting duringVariableDeclarationTransformation"); duringVariableDeclarationTransformation = 0; } if(duringLiterals != 0) { System.out.println("Warning: resetting duringLiterals"); duringLiterals = 0; } if(duringDU != 0) { System.out.println("Warning: resetting duringDU"); duringDU = 0; } if(duringAnnotations != 0) { System.out.println("Warning: resetting duringAnnotations"); duringAnnotations = 0; } if(duringEnums != 0) { System.out.println("Warning: resetting duringEnums"); duringEnums = 0; } if(duringGenericTypeVariables != 0) { System.out.println("Warning: resetting duringGenericTypeVariables"); duringGenericTypeVariables = 0; } } }
4,736
20.531818
87
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/ASTNode.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production ASTNode; * @ast node * */ public class ASTNode<T extends ASTNode> extends beaver.Symbol implements Cloneable, Iterable<T> { /** * @apilevel low-level */ public void flushCache() { } /** * @apilevel internal */ public void flushCollectionCache() { } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public ASTNode<T> clone() throws CloneNotSupportedException { ASTNode node = (ASTNode)super.clone(); node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public ASTNode<T> copy() { try { ASTNode node = (ASTNode) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public ASTNode<T> fullCopy() { ASTNode tree = (ASTNode) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect AccessControl * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/AccessControl.jrag:125 */ public void accessControl() { } /** * @ast method * @aspect AnonymousClasses * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/AnonymousClasses.jrag:202 */ protected void collectExceptions(Collection c, ASTNode target) { for(int i = 0; i < getNumChild(); i++) getChild(i).collectExceptions(c, target); } /** * @ast method * @aspect BranchTarget * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:44 */ public void collectBranches(Collection c) { for(int i = 0; i < getNumChild(); i++) getChild(i).collectBranches(c); } /** * @ast method * @aspect BranchTarget * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:150 */ public Stmt branchTarget(Stmt branchStmt) { if(getParent() != null) return getParent().branchTarget(branchStmt); else return null; } /** * @ast method * @aspect BranchTarget * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:190 */ public void collectFinally(Stmt branchStmt, ArrayList list) { if(getParent() != null) getParent().collectFinally(branchStmt, list); } /** * @ast method * @aspect DeclareBeforeUse * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DeclareBeforeUse.jrag:13 */ public int varChildIndex(Block b) { ASTNode node = this; while(node.getParent().getParent() != b) { node = node.getParent(); } return b.getStmtListNoTransform().getIndexOfChild(node); } /** * @ast method * @aspect DeclareBeforeUse * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DeclareBeforeUse.jrag:31 */ public int varChildIndex(TypeDecl t) { ASTNode node = this; while(node != null && node.getParent() != null && node.getParent().getParent() != t) { node = node.getParent(); } if(node == null) return -1; return t.getBodyDeclListNoTransform().getIndexOfChild(node); } /** * @ast method * @aspect DefiniteAssignment * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:12 */ public void definiteAssignment() { } /** * @ast method * @aspect DA * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:450 */ protected boolean checkDUeverywhere(Variable v) { for(int i = 0; i < getNumChild(); i++) if(!getChild(i).checkDUeverywhere(v)) return false; return true; } /** * @ast method * @aspect DA * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:560 */ protected boolean isDescendantTo(ASTNode node) { if(this == node) return true; if(getParent() == null) return false; return getParent().isDescendantTo(node); } /** * @ast method * @aspect ErrorCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:12 */ protected String sourceFile() { ASTNode node = this; while(node != null && !(node instanceof CompilationUnit)) node = node.getParent(); if(node == null) return "Unknown file"; CompilationUnit u = (CompilationUnit)node; return u.relativeName(); } /** * @ast method * @aspect ErrorCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:34 */ public ASTNode setLocation(ASTNode node) { setStart(node.getStart()); setEnd(node.getEnd()); return this; } /** * @ast method * @aspect ErrorCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:40 */ public ASTNode setStart(int i) { start = i; return this; } /** * @ast method * @aspect ErrorCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:44 */ public int start() { return start; } /** * @ast method * @aspect ErrorCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:47 */ public ASTNode setEnd(int i) { end = i; return this; } /** * @ast method * @aspect ErrorCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:51 */ public int end() { return end; } /** * @ast method * @aspect ErrorCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:55 */ public String location() { return "" + lineNumber(); } /** * @ast method * @aspect ErrorCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:58 */ public String errorPrefix() { return sourceFile() + ":" + location() + ":\n" + " *** Semantic Error: "; } /** * @ast method * @aspect ErrorCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:61 */ public String warningPrefix() { return sourceFile() + ":" + location() + ":\n" + " *** WARNING: "; } /** * @ast method * @aspect ErrorCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:171 */ public void error(String s) { ASTNode node = this; while(node != null && !(node instanceof CompilationUnit)) node = node.getParent(); CompilationUnit cu = (CompilationUnit)node; if(getNumChild() == 0 && getStart() != 0 && getEnd() != 0) { int line = getLine(getStart()); int column = getColumn(getStart()); int endLine = getLine(getEnd()); int endColumn = getColumn(getEnd()); cu.errors.add(new Problem(sourceFile(), s, line, column, endLine, endColumn, Problem.Severity.ERROR, Problem.Kind.SEMANTIC)); } else cu.errors.add(new Problem(sourceFile(), s, lineNumber(), Problem.Severity.ERROR, Problem.Kind.SEMANTIC)); } /** * @ast method * @aspect ErrorCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:187 */ public void warning(String s) { ASTNode node = this; while(node != null && !(node instanceof CompilationUnit)) node = node.getParent(); CompilationUnit cu = (CompilationUnit)node; cu.warnings.add(new Problem(sourceFile(), "WARNING: " + s, lineNumber(), Problem.Severity.WARNING)); } /** * @ast method * @aspect ExceptionHandling * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ExceptionHandling.jrag:54 */ public void exceptionHandling() { } /** * @ast method * @aspect ExceptionHandling * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ExceptionHandling.jrag:224 */ protected boolean reachedException(TypeDecl type) { for(int i = 0; i < getNumChild(); i++) if(getChild(i).reachedException(type)) return true; return false; } /** * @ast method * @aspect LookupMethod * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupMethod.jrag:54 */ public static Collection removeInstanceMethods(Collection c) { c = new LinkedList(c); for(Iterator iter = c.iterator(); iter.hasNext(); ) { MethodDecl m = (MethodDecl)iter.next(); if(!m.isStatic()) iter.remove(); } return c; } /** * @ast method * @aspect MemberMethods * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupMethod.jrag:359 */ protected static void putSimpleSetElement(HashMap map, Object key, Object value) { SimpleSet set = (SimpleSet)map.get(key); if(set == null) set = SimpleSet.emptySet; map.put(key, set.add(value)); } /** * @ast method * @aspect VariableScope * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupVariable.jrag:182 */ public SimpleSet removeInstanceVariables(SimpleSet oldSet) { SimpleSet newSet = SimpleSet.emptySet; for(Iterator iter = oldSet.iterator(); iter.hasNext(); ) { Variable v = (Variable)iter.next(); if(!v.isInstanceVariable()) newSet = newSet.add(v); } return newSet; } /** * @ast method * @aspect Modifiers * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:11 */ void checkModifiers() { } /** * @ast method * @aspect NameCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:11 */ public void nameCheck() { } /** * @ast method * @aspect NameCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:14 */ public TypeDecl extractSingleType(SimpleSet c) { if(c.size() != 1) return null; return (TypeDecl)c.iterator().next(); } /** * @ast method * @aspect AddOptionsToProgram * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Options.jadd:14 */ public Options options() { return state().options; } /** * @ast method * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:13 */ public String toString() { StringBuffer s = new StringBuffer(); toString(s); return s.toString().trim(); } /** * @ast method * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:19 */ public void toString(StringBuffer s) { throw new Error("Operation toString(StringBuffer s) not implemented for " + getClass().getName()); } /** * @ast method * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:770 */ public String dumpTree() { StringBuffer s = new StringBuffer(); dumpTree(s, 0); return s.toString(); } /** * @ast method * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:776 */ public void dumpTree(StringBuffer s, int j) { for(int i = 0; i < j; i++) { s.append(" "); } s.append(dumpString() + "\n"); for(int i = 0; i < getNumChild(); i++) getChild(i).dumpTree(s, j + 1); } /** * @ast method * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:785 */ public String dumpTreeNoRewrite() { StringBuffer s = new StringBuffer(); dumpTreeNoRewrite(s, 0); return s.toString(); } /** * @ast method * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:790 */ protected void dumpTreeNoRewrite(StringBuffer s, int indent) { for(int i = 0; i < indent; i++) s.append(" "); s.append(dumpString()); s.append("\n"); for(int i = 0; i < getNumChildNoTransform(); i++) { getChildNoTransform(i).dumpTreeNoRewrite(s, indent+1); } } /** * @ast method * @aspect PrimitiveTypes * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrimitiveTypes.jrag:11 */ protected static final String PRIMITIVE_PACKAGE_NAME = "@primitive"; /** * @ast method * @aspect TypeCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:12 */ public void typeCheck() { } /** * @ast method * @aspect UnreachableStatements * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/UnreachableStatements.jrag:12 */ void checkUnreachableStmt() { } /** * @ast method * @aspect VariableDeclarationTransformation * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/VariableDeclaration.jrag:134 */ public void clearLocations() { setStart(0); setEnd(0); for(int i = 0; i < getNumChildNoTransform(); i++) getChildNoTransform(i).clearLocations(); } /** * @ast method * @aspect Enums * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:131 */ protected void transformEnumConstructors() { for(int i = 0; i < getNumChildNoTransform(); i++) { ASTNode child = getChildNoTransform(i); if(child != null) child.transformEnumConstructors(); } } /** * @ast method * @aspect Enums * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:444 */ protected void checkEnum(EnumDecl enumDecl) { for(int i = 0; i < getNumChild(); i++) getChild(i).checkEnum(enumDecl); } /** * @ast method * @aspect FlushCaches * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/FlushCaches.jrag:3 */ public void flushCaches() { flushCache(); for(int i = 0; i < getNumChild(); i++) getChild(i).flushCaches(); } /** * @ast method * @aspect InnerClasses * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/InnerClasses.jrag:158 */ public void collectEnclosingVariables(HashSet set, TypeDecl typeDecl) { for(int i = 0; i < getNumChild(); i++) getChild(i).collectEnclosingVariables(set, typeDecl); } /** * @ast method * @aspect Transformations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/Transformations.jrag:12 */ public void transformation() { for(int i = 0; i < getNumChild(); i++) { getChild(i).transformation(); } } /** * @ast method * @aspect Transformations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/Transformations.jrag:209 */ protected ASTNode replace(ASTNode node) { state().replacePos = node.getParent().getIndexOfChild(node); node.getParent().in$Circle(true); return node.getParent(); } /** * @ast method * @aspect Transformations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/Transformations.jrag:214 */ protected ASTNode with(ASTNode node) { ((ASTNode)this).setChild(node, state().replacePos); in$Circle(false); return node; } /** * @ast method * @aspect EmitJimple * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:60 */ public void jimplify1phase1() { for(int i = 0; i < getNumChild(); i++) getChild(i).jimplify1phase1(); } /** * @ast method * @aspect EmitJimple * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:137 */ public void jimplify1phase2() { for(int i = 0; i < getNumChild(); i++) getChild(i).jimplify1phase2(); } /** * @ast method * @aspect EmitJimple * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:366 */ public void jimplify2() { for(int i = 0; i < getNumChild(); i++) getChild(i).jimplify2(); } /** * @ast method * @aspect EmitJimple * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:371 */ public void jimplify2(Body b) { for(int i = 0; i < getNumChild(); i++) getChild(i).jimplify2(b); } /** * @ast method * @aspect EmitJimple * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:405 */ public soot.Immediate asImmediate(Body b, soot.Value v) { if(v instanceof soot.Immediate) return (soot.Immediate)v; return b.newTemp(v); } /** * @ast method * @aspect EmitJimple * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:409 */ public soot.Local asLocal(Body b, soot.Value v) { if(v instanceof soot.Local) return (soot.Local)v; return b.newTemp(v); } /** * @ast method * @aspect EmitJimple * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:413 */ public soot.Local asLocal(Body b, soot.Value v, Type t) { if(v instanceof soot.Local) return (soot.Local)v; soot.Local local = b.newTemp(t); b.add(b.newAssignStmt(local, v, null)); b.copyLocation(v, local); return local; } /** * @ast method * @aspect EmitJimple * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:420 */ public soot.Value asRValue(Body b, soot.Value v) { if(v instanceof soot.Local) return v; if(v instanceof soot.jimple.Constant) return v; if(v instanceof soot.jimple.ConcreteRef) return v; if(v instanceof soot.jimple.Expr) return v; throw new Error("Need to convert " + v.getClass().getName() + " to RValue"); } /** * @ast method * @aspect EmitJimple * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:879 */ protected soot.jimple.Stmt newLabel() { return soot.jimple.Jimple.v().newNopStmt(); } /** * @ast method * @aspect EmitJimple * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:959 */ public void addAttributes() { } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:718 */ public static soot.Value emitConstant(Constant constant) { if(constant instanceof Constant.ConstantInt) return IntType.emitConstant(constant.intValue()); else if(constant instanceof Constant.ConstantLong) return soot.jimple.LongConstant.v(constant.longValue()); else if(constant instanceof Constant.ConstantFloat) return soot.jimple.FloatConstant.v(constant.floatValue()); else if(constant instanceof Constant.ConstantDouble) return soot.jimple.DoubleConstant.v(constant.doubleValue()); else if(constant instanceof Constant.ConstantChar) return IntType.emitConstant(constant.intValue()); else if(constant instanceof Constant.ConstantBoolean) return BooleanType.emitConstant(constant.booleanValue()); else if(constant instanceof Constant.ConstantString) return soot.jimple.StringConstant.v(constant.stringValue()); throw new Error("Unexpected constant"); } /** * @ast method * @aspect Statements * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:256 */ public void endExceptionRange(Body b, ArrayList list) { if(list != null) { soot.jimple.Stmt label = newLabel(); b.addLabel(label); list.add(label); //list.add(b.previousStmt()); } } /** * @ast method * @aspect Statements * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:264 */ public void beginExceptionRange(Body b, ArrayList list) { if(list != null) b.addNextStmt(list); } /** * Create a deep copy of this subtree. * The copy is dangling, i.e. has no parent. * * @return a dangling copy of the subtree at this node * @ast method * @aspect JastAddExtensions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/JastAddExtensions.jadd:20 */ public ASTNode cloneSubtree() { try { ASTNode tree = (ASTNode) clone(); tree.setParent(null);// make dangling if (children != null) { tree.children = new ASTNode[children.length]; for (int i = 0; i < children.length; ++i) { if (children[i] == null) { tree.children[i] = null; } else { tree.children[i] = children[i].cloneSubtree(); tree.children[i].setParent(tree); } } } return tree; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * @ast method * @aspect UncheckedConversion * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/UncheckedConversion.jrag:40 */ public void checkUncheckedConversion(TypeDecl source, TypeDecl dest) { if (source.isUncheckedConversionTo(dest)) warning("unchecked conversion from raw type "+source.typeName()+ " to generic type "+dest.typeName()); } /** * Checking of the SafeVarargs annotation is only needed for method * declarations. * @ast method * @aspect Warnings * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/Warnings.jadd:38 */ public void checkWarnings() { } /** * @ast method * @aspect EmitJimpleRefinements * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/SootJastAddJ/EmitJimpleRefinements.jrag:197 */ public void collectTypesToHierarchy(Collection<Type> set) { for(int i = 0; i < getNumChild(); i++) getChild(i).collectTypesToHierarchy(set); } /** * @ast method * @aspect EmitJimpleRefinements * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/SootJastAddJ/EmitJimpleRefinements.jrag:215 */ public void collectTypesToSignatures(Collection<Type> set) { for(int i = 0; i < getNumChild(); i++) getChild(i).collectTypesToSignatures(set); } /** * @ast method * */ public ASTNode() { super(); init$Children(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { } /** * @apilevel internal * @ast method * */ /** * @apilevel internal */ public static final boolean generatedWithCircularEnabled = true; /** * @apilevel internal * @ast method * */ /** * @apilevel internal */ public static final boolean generatedWithCacheCycle = false; /** * @apilevel internal * @ast method * */ /** * @apilevel internal */ public static final boolean generatedWithComponentCheck = false; /** * @apilevel internal * @ast method * */ /** * @apilevel internal */ protected static ASTNode$State state = new ASTNode$State(); /** * @apilevel internal * @ast method * */ public final ASTNode$State state() { return state; } /** * @apilevel internal * @ast method * */ /** * @apilevel internal */ public boolean in$Circle = false; /** * @apilevel internal * @ast method * */ public boolean in$Circle() { return in$Circle; } /** * @apilevel internal * @ast method * */ public void in$Circle(boolean b) { in$Circle = b; } /** * @apilevel internal * @ast method * */ /** * @apilevel internal */ public boolean is$Final = false; /** * @apilevel internal * @ast method * */ public boolean is$Final() { return is$Final; } /** * @apilevel internal * @ast method * */ public void is$Final(boolean b) { is$Final = b; } /** * @apilevel low-level * @ast method * */ @SuppressWarnings("cast") public T getChild(int i) { ASTNode node = this.getChildNoTransform(i); if(node == null) return null; if(node.is$Final()) { return (T) node; } if(!node.mayHaveRewrite()) { node.is$Final(this.is$Final()); return (T) node; } if(!node.in$Circle()) { int rewriteState; int num = this.state().boundariesCrossed; do { this.state().push(ASTNode$State.REWRITE_CHANGE); ASTNode oldNode = node; oldNode.in$Circle(true); node = node.rewriteTo(); if(node != oldNode) { this.setChild(node, i); } oldNode.in$Circle(false); rewriteState = this.state().pop(); } while(rewriteState == ASTNode$State.REWRITE_CHANGE); if(rewriteState == ASTNode$State.REWRITE_NOCHANGE && this.is$Final()) { node.is$Final(true); this.state().boundariesCrossed = num; } } else if(this.is$Final() != node.is$Final()) this.state().boundariesCrossed++; return (T) node; } /** * @apilevel internal * @ast method * */ /** * @apilevel internal */ private int childIndex; /** * @apilevel low-level * @ast method * */ public int getIndexOfChild(ASTNode node) { if(node != null && node.childIndex < getNumChildNoTransform() && node == getChildNoTransform(node.childIndex)) return node.childIndex; for(int i = 0; i < getNumChildNoTransform(); i++) if(getChildNoTransform(i) == node) { node.childIndex = i; return i; } return -1; } /** * @apilevel low-level * @ast method * */ public void addChild(T node) { setChild(node, getNumChildNoTransform()); } /** * <p><em>This method does not invoke AST transformations.</em></p> * @apilevel low-level * @ast method * */ @SuppressWarnings("cast") public final T getChildNoTransform(int i) { return (T) (children != null ? children[i] : null); } /** * @apilevel low-level * @ast method * */ /** * @apilevel low-level */ protected int numChildren; /** * @apilevel low-level * @ast method * */ protected int numChildren() { return numChildren; } /** * @apilevel low-level * @ast method * */ public int getNumChild() { return numChildren(); } /** * <p><em>This method does not invoke AST transformations.</em></p> * @apilevel low-level * @ast method * */ public final int getNumChildNoTransform() { return numChildren(); } /** * @apilevel low-level * @ast method * */ public void setChild(ASTNode node, int i) { if(children == null) { children = new ASTNode[i+1>4?i+1:4]; } else if (i >= children.length) { ASTNode c[] = new ASTNode[i << 1]; System.arraycopy(children, 0, c, 0, children.length); children = c; } children[i] = node; if(i >= numChildren) numChildren = i+1; if(node != null) { node.setParent(this); node.childIndex = i; } } /** * @apilevel low-level * @ast method * */ public void insertChild(ASTNode node, int i) { if(children == null) { children = new ASTNode[i+1>4?i+1:4]; children[i] = node; } else { ASTNode c[] = new ASTNode[children.length + 1]; System.arraycopy(children, 0, c, 0, i); c[i] = node; if(i < children.length) { System.arraycopy(children, i, c, i+1, children.length-i); for(int j = i+1; j < c.length; ++j) { if(c[j] != null) c[j].childIndex = j; } } children = c; } numChildren++; if(node != null) { node.setParent(this); node.childIndex = i; } } /** * @apilevel low-level * @ast method * */ public void removeChild(int i) { if(children != null) { ASTNode child = (ASTNode)children[i]; if(child != null) { child.parent = null; child.childIndex = -1; } if (this instanceof List || this instanceof Opt) { System.arraycopy(children, i+1, children, i, children.length-i-1); children[children.length-1] = null; numChildren--; for(int j = i; j < numChildren; ++j) { if(children[j] != null) { child = (ASTNode) children[j]; child.childIndex = j; } } } else { children[i] = null; } } } /** * @apilevel low-level * @ast method * */ public ASTNode getParent() { if(parent != null && ((ASTNode)parent).is$Final() != is$Final()) { state().boundariesCrossed++; } return (ASTNode)parent; } /** * @apilevel low-level * @ast method * */ public void setParent(ASTNode node) { parent = node; } /** * @apilevel low-level * @ast method * */ /** * @apilevel low-level */ protected ASTNode parent; /** * @apilevel low-level * @ast method * */ /** * @apilevel low-level */ protected ASTNode[] children; /** * @ast method * */ protected boolean duringImplicitConstructor() { if(state().duringImplicitConstructor == 0) { return false; } else { state().pop(); state().push(ASTNode$State.REWRITE_INTERRUPT); return true; } } /** * @ast method * */ protected boolean duringBoundNames() { if(state().duringBoundNames == 0) { return false; } else { state().pop(); state().push(ASTNode$State.REWRITE_INTERRUPT); return true; } } /** * @ast method * */ protected boolean duringNameResolution() { if(state().duringNameResolution == 0) { return false; } else { state().pop(); state().push(ASTNode$State.REWRITE_INTERRUPT); return true; } } /** * @ast method * */ protected boolean duringSyntacticClassification() { if(state().duringSyntacticClassification == 0) { return false; } else { state().pop(); state().push(ASTNode$State.REWRITE_INTERRUPT); return true; } } /** * @ast method * */ protected boolean duringAnonymousClasses() { if(state().duringAnonymousClasses == 0) { return false; } else { state().pop(); state().push(ASTNode$State.REWRITE_INTERRUPT); return true; } } /** * @ast method * */ protected boolean duringVariableDeclarationTransformation() { if(state().duringVariableDeclarationTransformation == 0) { return false; } else { state().pop(); state().push(ASTNode$State.REWRITE_INTERRUPT); return true; } } /** * @ast method * */ protected boolean duringLiterals() { if(state().duringLiterals == 0) { return false; } else { state().pop(); state().push(ASTNode$State.REWRITE_INTERRUPT); return true; } } /** * @ast method * */ protected boolean duringDU() { if(state().duringDU == 0) { return false; } else { state().pop(); state().push(ASTNode$State.REWRITE_INTERRUPT); return true; } } /** * @ast method * */ protected boolean duringAnnotations() { if(state().duringAnnotations == 0) { return false; } else { state().pop(); state().push(ASTNode$State.REWRITE_INTERRUPT); return true; } } /** * @ast method * */ protected boolean duringEnums() { if(state().duringEnums == 0) { return false; } else { state().pop(); state().push(ASTNode$State.REWRITE_INTERRUPT); return true; } } /** * @ast method * */ protected boolean duringGenericTypeVariables() { if(state().duringGenericTypeVariables == 0) { return false; } else { state().pop(); state().push(ASTNode$State.REWRITE_INTERRUPT); return true; } } /** * @apilevel low-level * @ast method * */ public java.util.Iterator<T> iterator() { return new java.util.Iterator<T>() { private int counter = 0; public boolean hasNext() { return counter < getNumChild(); } @SuppressWarnings("unchecked") public T next() { if(hasNext()) return (T)getChild(counter++); else return null; } public void remove() { throw new UnsupportedOperationException(); } }; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * The collectErrors method is refined so that it calls * the checkWarnings method on each ASTNode to report * unchecked warnings. * @ast method * @aspect Warnings * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/Warnings.jadd:20 */ public void collectErrors() { nameCheck(); typeCheck(); accessControl(); exceptionHandling(); checkUnreachableStmt(); definiteAssignment(); checkModifiers(); checkWarnings(); for(int i = 0; i < getNumChild(); i++) { getChild(i).collectErrors(); } } /** * @attribute syn * @aspect DU * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:1196 */ public boolean unassignedEverywhere(Variable v, TryStmt stmt) { ASTNode$State state = state(); try { for(int i = 0; i < getNumChild(); i++) { if(!getChild(i).unassignedEverywhere(v, stmt)) return false; } return true; } finally { } } /** * @attribute syn * @aspect ErrorCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:22 */ public int lineNumber() { ASTNode$State state = state(); try { ASTNode n = this; while(n.getParent() != null && n.getStart() == 0) { n = n.getParent(); } return getLine(n.getStart()); } finally { } } /** * @attribute syn * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:744 */ public String indent() { ASTNode$State state = state(); try { String indent = extractIndent(); return indent.startsWith("\n") ? indent : ("\n" + indent); } finally { } } /** * @attribute syn * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:749 */ public String extractIndent() { ASTNode$State state = state(); try { if(getParent() == null) return ""; String indent = getParent().extractIndent(); if(getParent().addsIndentationLevel()) indent += " "; return indent; } finally { } } /** * @attribute syn * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:758 */ public boolean addsIndentationLevel() { ASTNode$State state = state(); try { return false; } finally { } } /** * @attribute syn * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:800 */ public String dumpString() { ASTNode$State state = state(); try { return getClass().getName(); } finally { } } /** * @attribute syn * @aspect LookupParTypeDecl * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1056 */ public boolean usesTypeVariable() { ASTNode$State state = state(); try { for(int i = 0; i < getNumChild(); i++) if(getChild(i).usesTypeVariable()) return true; return false; } finally { } } /** * @attribute syn * @aspect InnerClasses * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/InnerClasses.jrag:88 */ public boolean isStringAdd() { ASTNode$State state = state(); try { return false; } finally { } } /** * @attribute syn * @aspect BooleanExpressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:21 */ public boolean definesLabel() { ASTNode$State state = state(); try { return false; } finally { } } /** * Fetches the immediately enclosing compilation unit. * @attribute inh * @aspect Literals * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/Literals.jrag:451 */ @SuppressWarnings({"unchecked", "cast"}) public CompilationUnit compilationUnit() { ASTNode$State state = state(); CompilationUnit compilationUnit_value = getParent().Define_CompilationUnit_compilationUnit(this, null); return compilationUnit_value; } /** * @apilevel internal */ public ASTNode rewriteTo() { if(state().peek() == ASTNode$State.REWRITE_CHANGE) { state().pop(); state().push(ASTNode$State.REWRITE_NOCHANGE); } return this; } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_superType(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_superType(this, caller); } /** * @apilevel internal */ public ConstructorDecl Define_ConstructorDecl_constructorDecl(ASTNode caller, ASTNode child) { return getParent().Define_ConstructorDecl_constructorDecl(this, caller); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_componentType(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_componentType(this, caller); } /** * @apilevel internal */ public LabeledStmt Define_LabeledStmt_lookupLabel(ASTNode caller, ASTNode child, String name) { return getParent().Define_LabeledStmt_lookupLabel(this, caller, name); } /** * @apilevel internal */ public boolean Define_boolean_isDest(ASTNode caller, ASTNode child) { return getParent().Define_boolean_isDest(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_isSource(ASTNode caller, ASTNode child) { return getParent().Define_boolean_isSource(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_isIncOrDec(ASTNode caller, ASTNode child) { return getParent().Define_boolean_isIncOrDec(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v) { return getParent().Define_boolean_isDAbefore(this, caller, v); } /** * @apilevel internal */ public boolean Define_boolean_isDUbefore(ASTNode caller, ASTNode child, Variable v) { return getParent().Define_boolean_isDUbefore(this, caller, v); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_typeException(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_typeException(this, caller); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_typeRuntimeException(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_typeRuntimeException(this, caller); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_typeError(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_typeError(this, caller); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_typeNullPointerException(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_typeNullPointerException(this, caller); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_typeThrowable(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_typeThrowable(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_handlesException(ASTNode caller, ASTNode child, TypeDecl exceptionType) { return getParent().Define_boolean_handlesException(this, caller, exceptionType); } /** * @apilevel internal */ public Collection Define_Collection_lookupConstructor(ASTNode caller, ASTNode child) { return getParent().Define_Collection_lookupConstructor(this, caller); } /** * @apilevel internal */ public Collection Define_Collection_lookupSuperConstructor(ASTNode caller, ASTNode child) { return getParent().Define_Collection_lookupSuperConstructor(this, caller); } /** * @apilevel internal */ public Expr Define_Expr_nestedScope(ASTNode caller, ASTNode child) { return getParent().Define_Expr_nestedScope(this, caller); } /** * @apilevel internal */ public Collection Define_Collection_lookupMethod(ASTNode caller, ASTNode child, String name) { return getParent().Define_Collection_lookupMethod(this, caller, name); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_typeObject(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_typeObject(this, caller); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_typeCloneable(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_typeCloneable(this, caller); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_typeSerializable(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_typeSerializable(this, caller); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_typeBoolean(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_typeBoolean(this, caller); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_typeByte(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_typeByte(this, caller); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_typeShort(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_typeShort(this, caller); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_typeChar(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_typeChar(this, caller); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_typeInt(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_typeInt(this, caller); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_typeLong(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_typeLong(this, caller); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_typeFloat(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_typeFloat(this, caller); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_typeDouble(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_typeDouble(this, caller); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_typeString(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_typeString(this, caller); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_typeVoid(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_typeVoid(this, caller); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_typeNull(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_typeNull(this, caller); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_unknownType(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_unknownType(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_hasPackage(ASTNode caller, ASTNode child, String packageName) { return getParent().Define_boolean_hasPackage(this, caller, packageName); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_lookupType(ASTNode caller, ASTNode child, String packageName, String typeName) { return getParent().Define_TypeDecl_lookupType(this, caller, packageName, typeName); } /** * @apilevel internal */ public SimpleSet Define_SimpleSet_lookupType(ASTNode caller, ASTNode child, String name) { return getParent().Define_SimpleSet_lookupType(this, caller, name); } /** * @apilevel internal */ public SimpleSet Define_SimpleSet_lookupVariable(ASTNode caller, ASTNode child, String name) { return getParent().Define_SimpleSet_lookupVariable(this, caller, name); } /** * @apilevel internal */ public boolean Define_boolean_mayBePublic(ASTNode caller, ASTNode child) { return getParent().Define_boolean_mayBePublic(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_mayBeProtected(ASTNode caller, ASTNode child) { return getParent().Define_boolean_mayBeProtected(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_mayBePrivate(ASTNode caller, ASTNode child) { return getParent().Define_boolean_mayBePrivate(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_mayBeStatic(ASTNode caller, ASTNode child) { return getParent().Define_boolean_mayBeStatic(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_mayBeFinal(ASTNode caller, ASTNode child) { return getParent().Define_boolean_mayBeFinal(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_mayBeAbstract(ASTNode caller, ASTNode child) { return getParent().Define_boolean_mayBeAbstract(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_mayBeVolatile(ASTNode caller, ASTNode child) { return getParent().Define_boolean_mayBeVolatile(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_mayBeTransient(ASTNode caller, ASTNode child) { return getParent().Define_boolean_mayBeTransient(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_mayBeStrictfp(ASTNode caller, ASTNode child) { return getParent().Define_boolean_mayBeStrictfp(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_mayBeSynchronized(ASTNode caller, ASTNode child) { return getParent().Define_boolean_mayBeSynchronized(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_mayBeNative(ASTNode caller, ASTNode child) { return getParent().Define_boolean_mayBeNative(this, caller); } /** * @apilevel internal */ public ASTNode Define_ASTNode_enclosingBlock(ASTNode caller, ASTNode child) { return getParent().Define_ASTNode_enclosingBlock(this, caller); } /** * @apilevel internal */ public VariableScope Define_VariableScope_outerScope(ASTNode caller, ASTNode child) { return getParent().Define_VariableScope_outerScope(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_insideLoop(ASTNode caller, ASTNode child) { return getParent().Define_boolean_insideLoop(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_insideSwitch(ASTNode caller, ASTNode child) { return getParent().Define_boolean_insideSwitch(this, caller); } /** * @apilevel internal */ public Case Define_Case_bind(ASTNode caller, ASTNode child, Case c) { return getParent().Define_Case_bind(this, caller, c); } /** * @apilevel internal */ public String Define_String_typeDeclIndent(ASTNode caller, ASTNode child) { return getParent().Define_String_typeDeclIndent(this, caller); } /** * @apilevel internal */ public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) { return getParent().Define_NameType_nameType(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_isAnonymous(ASTNode caller, ASTNode child) { return getParent().Define_boolean_isAnonymous(this, caller); } /** * @apilevel internal */ public Variable Define_Variable_unknownField(ASTNode caller, ASTNode child) { return getParent().Define_Variable_unknownField(this, caller); } /** * @apilevel internal */ public MethodDecl Define_MethodDecl_unknownMethod(ASTNode caller, ASTNode child) { return getParent().Define_MethodDecl_unknownMethod(this, caller); } /** * @apilevel internal */ public ConstructorDecl Define_ConstructorDecl_unknownConstructor(ASTNode caller, ASTNode child) { return getParent().Define_ConstructorDecl_unknownConstructor(this, caller); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_declType(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_declType(this, caller); } /** * @apilevel internal */ public BodyDecl Define_BodyDecl_enclosingBodyDecl(ASTNode caller, ASTNode child) { return getParent().Define_BodyDecl_enclosingBodyDecl(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_isMemberType(ASTNode caller, ASTNode child) { return getParent().Define_boolean_isMemberType(this, caller); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_hostType(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_hostType(this, caller); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_switchType(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_switchType(this, caller); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_returnType(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_returnType(this, caller); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_enclosingInstance(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_enclosingInstance(this, caller); } /** * @apilevel internal */ public String Define_String_methodHost(ASTNode caller, ASTNode child) { return getParent().Define_String_methodHost(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_inExplicitConstructorInvocation(ASTNode caller, ASTNode child) { return getParent().Define_boolean_inExplicitConstructorInvocation(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_inStaticContext(ASTNode caller, ASTNode child) { return getParent().Define_boolean_inStaticContext(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_reportUnreachable(ASTNode caller, ASTNode child) { return getParent().Define_boolean_reportUnreachable(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_isMethodParameter(ASTNode caller, ASTNode child) { return getParent().Define_boolean_isMethodParameter(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_isConstructorParameter(ASTNode caller, ASTNode child) { return getParent().Define_boolean_isConstructorParameter(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_isExceptionHandlerParameter(ASTNode caller, ASTNode child) { return getParent().Define_boolean_isExceptionHandlerParameter(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_mayUseAnnotationTarget(ASTNode caller, ASTNode child, String name) { return getParent().Define_boolean_mayUseAnnotationTarget(this, caller, name); } /** * @apilevel internal */ public ElementValue Define_ElementValue_lookupElementTypeValue(ASTNode caller, ASTNode child, String name) { return getParent().Define_ElementValue_lookupElementTypeValue(this, caller, name); } /** * @apilevel internal */ public boolean Define_boolean_withinSuppressWarnings(ASTNode caller, ASTNode child, String s) { return getParent().Define_boolean_withinSuppressWarnings(this, caller, s); } /** * @apilevel internal */ public boolean Define_boolean_withinDeprecatedAnnotation(ASTNode caller, ASTNode child) { return getParent().Define_boolean_withinDeprecatedAnnotation(this, caller); } /** * @apilevel internal */ public Annotation Define_Annotation_lookupAnnotation(ASTNode caller, ASTNode child, TypeDecl typeDecl) { return getParent().Define_Annotation_lookupAnnotation(this, caller, typeDecl); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_enclosingAnnotationDecl(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_enclosingAnnotationDecl(this, caller); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_assignConvertedType(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_assignConvertedType(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_inExtendsOrImplements(ASTNode caller, ASTNode child) { return getParent().Define_boolean_inExtendsOrImplements(this, caller); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_typeWildcard(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_typeWildcard(this, caller); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_lookupWildcardExtends(ASTNode caller, ASTNode child, TypeDecl typeDecl) { return getParent().Define_TypeDecl_lookupWildcardExtends(this, caller, typeDecl); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_lookupWildcardSuper(ASTNode caller, ASTNode child, TypeDecl typeDecl) { return getParent().Define_TypeDecl_lookupWildcardSuper(this, caller, typeDecl); } /** * @apilevel internal */ public LUBType Define_LUBType_lookupLUBType(ASTNode caller, ASTNode child, Collection bounds) { return getParent().Define_LUBType_lookupLUBType(this, caller, bounds); } /** * @apilevel internal */ public GLBType Define_GLBType_lookupGLBType(ASTNode caller, ASTNode child, ArrayList bounds) { return getParent().Define_GLBType_lookupGLBType(this, caller, bounds); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_genericDecl(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_genericDecl(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_variableArityValid(ASTNode caller, ASTNode child) { return getParent().Define_boolean_variableArityValid(this, caller); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_expectedType(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_expectedType(this, caller); } /** * @apilevel internal */ public soot.jimple.Stmt Define_soot_jimple_Stmt_condition_false_label(ASTNode caller, ASTNode child) { return getParent().Define_soot_jimple_Stmt_condition_false_label(this, caller); } /** * @apilevel internal */ public soot.jimple.Stmt Define_soot_jimple_Stmt_condition_true_label(ASTNode caller, ASTNode child) { return getParent().Define_soot_jimple_Stmt_condition_true_label(this, caller); } /** * @apilevel internal */ public int Define_int_localNum(ASTNode caller, ASTNode child) { return getParent().Define_int_localNum(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_enclosedByExceptionHandler(ASTNode caller, ASTNode child) { return getParent().Define_boolean_enclosedByExceptionHandler(this, caller); } /** * @apilevel internal */ public ArrayList Define_ArrayList_exceptionRanges(ASTNode caller, ASTNode child) { return getParent().Define_ArrayList_exceptionRanges(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_isCatchParam(ASTNode caller, ASTNode child) { return getParent().Define_boolean_isCatchParam(this, caller); } /** * @apilevel internal */ public CatchClause Define_CatchClause_catchClause(ASTNode caller, ASTNode child) { return getParent().Define_CatchClause_catchClause(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_resourcePreviouslyDeclared(ASTNode caller, ASTNode child, String name) { return getParent().Define_boolean_resourcePreviouslyDeclared(this, caller, name); } /** * @apilevel internal */ public ClassInstanceExpr Define_ClassInstanceExpr_getClassInstanceExpr(ASTNode caller, ASTNode child) { return getParent().Define_ClassInstanceExpr_getClassInstanceExpr(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_isAnonymousDecl(ASTNode caller, ASTNode child) { return getParent().Define_boolean_isAnonymousDecl(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_isExplicitGenericConstructorAccess(ASTNode caller, ASTNode child) { return getParent().Define_boolean_isExplicitGenericConstructorAccess(this, caller); } /** * @apilevel internal */ public CompilationUnit Define_CompilationUnit_compilationUnit(ASTNode caller, ASTNode child) { return getParent().Define_CompilationUnit_compilationUnit(this, caller); } /** * @apilevel internal */ public SimpleSet Define_SimpleSet_allImportedTypes(ASTNode caller, ASTNode child, String name) { return getParent().Define_SimpleSet_allImportedTypes(this, caller, name); } /** * @apilevel internal */ public String Define_String_packageName(ASTNode caller, ASTNode child) { return getParent().Define_String_packageName(this, caller); } /** * @apilevel internal */ public TypeDecl Define_TypeDecl_enclosingType(ASTNode caller, ASTNode child) { return getParent().Define_TypeDecl_enclosingType(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_isNestedType(ASTNode caller, ASTNode child) { return getParent().Define_boolean_isNestedType(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_isLocalClass(ASTNode caller, ASTNode child) { return getParent().Define_boolean_isLocalClass(this, caller); } /** * @apilevel internal */ public String Define_String_hostPackage(ASTNode caller, ASTNode child) { return getParent().Define_String_hostPackage(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_reachable(ASTNode caller, ASTNode child) { return getParent().Define_boolean_reachable(this, caller); } /** * @apilevel internal */ public boolean Define_boolean_inhModifiedInScope(ASTNode caller, ASTNode child, Variable var) { return getParent().Define_boolean_inhModifiedInScope(this, caller, var); } /** * @apilevel internal */ public boolean Define_boolean_reachableCatchClause(ASTNode caller, ASTNode child, TypeDecl exceptionType) { return getParent().Define_boolean_reachableCatchClause(this, caller, exceptionType); } /** * @apilevel internal */ public Collection<TypeDecl> Define_Collection_TypeDecl__caughtExceptions(ASTNode caller, ASTNode child) { return getParent().Define_Collection_TypeDecl__caughtExceptions(this, caller); } }
61,205
27.925331
131
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/AbstractDot.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production AbstractDot : {@link Access} ::= <span class="component">Left:{@link Expr}</span> <span class="component">Right:{@link Access}</span>; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:16 */ public class AbstractDot extends Access implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); isDAafter_Variable_values = null; isDUafter_Variable_values = null; type_computed = false; type_value = null; isDUbefore_Variable_values = null; } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AbstractDot clone() throws CloneNotSupportedException { AbstractDot node = (AbstractDot)super.clone(); node.isDAafter_Variable_values = null; node.isDUafter_Variable_values = null; node.type_computed = false; node.type_value = null; node.isDUbefore_Variable_values = null; node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AbstractDot copy() { try { AbstractDot node = (AbstractDot) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public AbstractDot fullCopy() { AbstractDot tree = (AbstractDot) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:446 */ public void toString(StringBuffer s) { getLeft().toString(s); if(!nextAccess().isArrayAccess()) s.append("."); getRight().toString(s); } /** * @ast method * @aspect QualifiedNames * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:135 */ public Access extractLast() { return getRightNoTransform(); } /** * @ast method * @aspect QualifiedNames * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:138 */ public void replaceLast(Access access) { setRight(access); } /** * @ast method * @aspect BooleanExpressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:181 */ public void emitEvalBranch(Body b) { lastAccess().emitEvalBranch(b); } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:190 */ public soot.Value eval(Body b) { return lastAccess().eval(b); } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:256 */ public soot.Value emitStore(Body b, soot.Value lvalue, soot.Value rvalue, ASTNode location) { return lastAccess().emitStore(b, lvalue, rvalue, location); } /** * @ast method * */ public AbstractDot() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[2]; } /** * @ast method * */ public AbstractDot(Expr p0, Access p1) { setChild(p0, 0); setChild(p1, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the Left child. * @param node The new node to replace the Left child. * @apilevel high-level * @ast method * */ public void setLeft(Expr node) { setChild(node, 0); } /** * Retrieves the Left child. * @return The current node used as the Left child. * @apilevel high-level * @ast method * */ public Expr getLeft() { return (Expr)getChild(0); } /** * Retrieves the Left child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Left child. * @apilevel low-level * @ast method * */ public Expr getLeftNoTransform() { return (Expr)getChildNoTransform(0); } /** * Replaces the Right child. * @param node The new node to replace the Right child. * @apilevel high-level * @ast method * */ public void setRight(Access node) { setChild(node, 1); } /** * Retrieves the Right child. * @return The current node used as the Right child. * @apilevel high-level * @ast method * */ public Access getRight() { return (Access)getChild(1); } /** * Retrieves the Right child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Right child. * @apilevel low-level * @ast method * */ public Access getRightNoTransform() { return (Access)getChildNoTransform(1); } /** * @attribute syn * @aspect ConstantExpression * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:91 */ public Constant constant() { ASTNode$State state = state(); try { return lastAccess().constant(); } finally { } } /** * @attribute syn * @aspect ConstantExpression * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:336 */ public boolean isConstant() { ASTNode$State state = state(); try { return lastAccess().isConstant(); } finally { } } /** * @attribute syn * @aspect DefiniteAssignment * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:58 */ public Variable varDecl() { ASTNode$State state = state(); try { return lastAccess().varDecl(); } finally { } } /*eq Stmt.isDAafter(Variable v) { //System.out.println("### isDAafter reached in " + getClass().getName()); //throw new NullPointerException(); throw new Error("Can not compute isDAafter for " + getClass().getName() + " at " + errorPrefix()); }* @attribute syn * @aspect DA * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:332 */ public boolean isDAafterTrue(Variable v) { ASTNode$State state = state(); try { return isDAafter(v); } finally { } } /** * @attribute syn * @aspect DA * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:333 */ public boolean isDAafterFalse(Variable v) { ASTNode$State state = state(); try { return isDAafter(v); } finally { } } protected java.util.Map isDAafter_Variable_values; /** * @attribute syn * @aspect DA * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:354 */ @SuppressWarnings({"unchecked", "cast"}) public boolean isDAafter(Variable v) { Object _parameters = v; if(isDAafter_Variable_values == null) isDAafter_Variable_values = new java.util.HashMap(4); if(isDAafter_Variable_values.containsKey(_parameters)) { return ((Boolean)isDAafter_Variable_values.get(_parameters)).booleanValue(); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean isDAafter_Variable_value = isDAafter_compute(v); if(isFinal && num == state().boundariesCrossed) isDAafter_Variable_values.put(_parameters, Boolean.valueOf(isDAafter_Variable_value)); return isDAafter_Variable_value; } /** * @apilevel internal */ private boolean isDAafter_compute(Variable v) { return lastAccess().isDAafter(v); } /** * @attribute syn * @aspect DU * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:702 */ public boolean isDUafterTrue(Variable v) { ASTNode$State state = state(); try { return isDUafter(v); } finally { } } /** * @attribute syn * @aspect DU * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:703 */ public boolean isDUafterFalse(Variable v) { ASTNode$State state = state(); try { return isDUafter(v); } finally { } } protected java.util.Map isDUafter_Variable_values; /** * @attribute syn * @aspect DU * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:835 */ @SuppressWarnings({"unchecked", "cast"}) public boolean isDUafter(Variable v) { Object _parameters = v; if(isDUafter_Variable_values == null) isDUafter_Variable_values = new java.util.HashMap(4); if(isDUafter_Variable_values.containsKey(_parameters)) { return ((Boolean)isDUafter_Variable_values.get(_parameters)).booleanValue(); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean isDUafter_Variable_value = isDUafter_compute(v); if(isFinal && num == state().boundariesCrossed) isDUafter_Variable_values.put(_parameters, Boolean.valueOf(isDUafter_Variable_value)); return isDUafter_Variable_value; } /** * @apilevel internal */ private boolean isDUafter_compute(Variable v) { return lastAccess().isDUafter(v); } /** * @attribute syn * @aspect Names * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/QualifiedNames.jrag:62 */ public String typeName() { ASTNode$State state = state(); try { return lastAccess().typeName(); } finally { } } /** * @attribute syn * @aspect AccessTypes * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:13 */ public boolean isTypeAccess() { ASTNode$State state = state(); try { return getRight().isTypeAccess(); } finally { } } /** * @attribute syn * @aspect AccessTypes * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:17 */ public boolean isMethodAccess() { ASTNode$State state = state(); try { return getRight().isMethodAccess(); } finally { } } /** * @attribute syn * @aspect AccessTypes * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:21 */ public boolean isFieldAccess() { ASTNode$State state = state(); try { return getRight().isFieldAccess(); } finally { } } /** * @attribute syn * @aspect AccessTypes * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:25 */ public boolean isSuperAccess() { ASTNode$State state = state(); try { return getRight().isSuperAccess(); } finally { } } /** * @attribute syn * @aspect AccessTypes * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:31 */ public boolean isThisAccess() { ASTNode$State state = state(); try { return getRight().isThisAccess(); } finally { } } /** * @attribute syn * @aspect AccessTypes * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:37 */ public boolean isPackageAccess() { ASTNode$State state = state(); try { return getRight().isPackageAccess(); } finally { } } /** * @attribute syn * @aspect AccessTypes * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:41 */ public boolean isArrayAccess() { ASTNode$State state = state(); try { return getRight().isArrayAccess(); } finally { } } /** * @attribute syn * @aspect AccessTypes * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:45 */ public boolean isClassAccess() { ASTNode$State state = state(); try { return getRight().isClassAccess(); } finally { } } /** * @attribute syn * @aspect AccessTypes * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:49 */ public boolean isSuperConstructorAccess() { ASTNode$State state = state(); try { return getRight().isSuperConstructorAccess(); } finally { } } /** * @attribute syn * @aspect QualifiedNames * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:58 */ public boolean isQualified() { ASTNode$State state = state(); try { return hasParentDot(); } finally { } } /** * @attribute syn * @aspect QualifiedNames * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:63 */ public Expr leftSide() { ASTNode$State state = state(); try { return getLeft(); } finally { } } /** * @attribute syn * @aspect QualifiedNames * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:64 */ public Access rightSide() { ASTNode$State state = state(); try { return getRight/*NoTransform*/() instanceof AbstractDot ? (Access)((AbstractDot)getRight/*NoTransform*/()).getLeft() : (Access)getRight(); } finally { } } /** * @attribute syn * @aspect QualifiedNames * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:66 */ public Access lastAccess() { ASTNode$State state = state(); try { return getRight().lastAccess(); } finally { } } /** * @attribute syn * @aspect QualifiedNames * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:75 */ public Access nextAccess() { ASTNode$State state = state(); try { return rightSide(); } finally { } } /** * @attribute syn * @aspect QualifiedNames * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:77 */ public Expr prevExpr() { ASTNode$State state = state(); try { return leftSide(); } finally { } } /** * @attribute syn * @aspect QualifiedNames * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:88 */ public boolean hasPrevExpr() { ASTNode$State state = state(); try { return true; } finally { } } /** * @attribute syn * @aspect SyntacticClassification * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/SyntacticClassification.jrag:56 */ public NameType predNameType() { ASTNode$State state = state(); try { return getLeft() instanceof Access ? ((Access)getLeft()).predNameType() : NameType.NO_NAME; } finally { } } /** * @apilevel internal */ protected boolean type_computed = false; /** * @apilevel internal */ protected TypeDecl type_value; /** * @attribute syn * @aspect TypeAnalysis * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:249 */ @SuppressWarnings({"unchecked", "cast"}) public TypeDecl type() { if(type_computed) { return type_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); type_value = type_compute(); if(isFinal && num == state().boundariesCrossed) type_computed = true; return type_value; } /** * @apilevel internal */ private TypeDecl type_compute() { return lastAccess().type(); } /** * @attribute syn * @aspect TypeCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:15 */ public boolean isVariable() { ASTNode$State state = state(); try { return lastAccess().isVariable(); } finally { } } /** * @attribute syn * @aspect TypeHierarchyCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeHierarchyCheck.jrag:150 */ public boolean staticContextQualifier() { ASTNode$State state = state(); try { return lastAccess().staticContextQualifier(); } finally { } } /** * @attribute syn * @aspect BooleanExpressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:21 */ public boolean definesLabel() { ASTNode$State state = state(); try { return getParent().definesLabel(); } finally { } } /** * @attribute syn * @aspect BooleanExpressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:82 */ public boolean canBeTrue() { ASTNode$State state = state(); try { return lastAccess().canBeTrue(); } finally { } } /** * @attribute syn * @aspect BooleanExpressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:92 */ public boolean canBeFalse() { ASTNode$State state = state(); try { return lastAccess().canBeFalse(); } finally { } } protected java.util.Map isDUbefore_Variable_values; /** * @attribute inh * @aspect DU * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:697 */ @SuppressWarnings({"unchecked", "cast"}) public boolean isDUbefore(Variable v) { Object _parameters = v; if(isDUbefore_Variable_values == null) isDUbefore_Variable_values = new java.util.HashMap(4); if(isDUbefore_Variable_values.containsKey(_parameters)) { return ((Boolean)isDUbefore_Variable_values.get(_parameters)).booleanValue(); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean isDUbefore_Variable_value = getParent().Define_boolean_isDUbefore(this, null, v); if(isFinal && num == state().boundariesCrossed) isDUbefore_Variable_values.put(_parameters, Boolean.valueOf(isDUbefore_Variable_value)); return isDUbefore_Variable_value; } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:21 * @apilevel internal */ public boolean Define_boolean_isDest(ASTNode caller, ASTNode child) { if(caller == getLeftNoTransform()) { return false; } else { return getParent().Define_boolean_isDest(this, caller); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:31 * @apilevel internal */ public boolean Define_boolean_isSource(ASTNode caller, ASTNode child) { if(caller == getLeftNoTransform()) { return true; } else { return getParent().Define_boolean_isSource(this, caller); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:353 * @apilevel internal */ public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v) { if(caller == getRightNoTransform()) { return getLeft().isDAafter(v); } else { return getParent().Define_boolean_isDAbefore(this, caller, v); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:834 * @apilevel internal */ public boolean Define_boolean_isDUbefore(ASTNode caller, ASTNode child, Variable v) { if(caller == getRightNoTransform()) { return getLeft().isDUafter(v); } else { return getParent().Define_boolean_isDUbefore(this, caller, v); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupConstructor.jrag:17 * @apilevel internal */ public Collection Define_Collection_lookupConstructor(ASTNode caller, ASTNode child) { if(caller == getRightNoTransform()) { return getLeft().type().constructors(); } else { return getParent().Define_Collection_lookupConstructor(this, caller); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupConstructor.jrag:25 * @apilevel internal */ public Collection Define_Collection_lookupSuperConstructor(ASTNode caller, ASTNode child) { if(caller == getRightNoTransform()) { return getLeft().type().lookupSuperConstructor(); } else { return getParent().Define_Collection_lookupSuperConstructor(this, caller); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupMethod.jrag:20 * @apilevel internal */ public Expr Define_Expr_nestedScope(ASTNode caller, ASTNode child) { if(caller == getLeftNoTransform()) { return isQualified() ? nestedScope() : this; } else if(caller == getRightNoTransform()) { return isQualified() ? nestedScope() : this; } else { return getParent().Define_Expr_nestedScope(this, caller); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupMethod.jrag:64 * @apilevel internal */ public Collection Define_Collection_lookupMethod(ASTNode caller, ASTNode child, String name) { if(caller == getRightNoTransform()) { return getLeft().type().memberMethods(name); } else { return getParent().Define_Collection_lookupMethod(this, caller, name); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:82 * @apilevel internal */ public boolean Define_boolean_hasPackage(ASTNode caller, ASTNode child, String packageName) { if(caller == getRightNoTransform()) { return getLeft().hasQualifiedPackage(packageName); } else { return getParent().Define_boolean_hasPackage(this, caller, packageName); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:429 * @apilevel internal */ public SimpleSet Define_SimpleSet_lookupType(ASTNode caller, ASTNode child, String name) { if(caller == getRightNoTransform()) { return getLeft().qualifiedLookupType(name); } else { return getParent().Define_SimpleSet_lookupType(this, caller, name); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupVariable.jrag:139 * @apilevel internal */ public SimpleSet Define_SimpleSet_lookupVariable(ASTNode caller, ASTNode child, String name) { if(caller == getRightNoTransform()) { return getLeft().qualifiedLookupVariable(name); } else { return getParent().Define_SimpleSet_lookupVariable(this, caller, name); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/SyntacticClassification.jrag:59 * @apilevel internal */ public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) { if(caller == getLeftNoTransform()) { return getRight().predNameType(); } else { return getParent().Define_NameType_nameType(this, caller); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:516 * @apilevel internal */ public TypeDecl Define_TypeDecl_enclosingInstance(ASTNode caller, ASTNode child) { if(caller == getRightNoTransform()) { return getLeft().type(); } else { return getParent().Define_TypeDecl_enclosingInstance(this, caller); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeHierarchyCheck.jrag:13 * @apilevel internal */ public String Define_String_methodHost(ASTNode caller, ASTNode child) { if(caller == getRightNoTransform()) { return getLeft().type().typeName(); } else { return getParent().Define_String_methodHost(this, caller); } } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
26,127
29.957346
152
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/AbstractWildcard.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production AbstractWildcard : {@link Access}; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.ast:20 */ public abstract class AbstractWildcard extends Access implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AbstractWildcard clone() throws CloneNotSupportedException { AbstractWildcard node = (AbstractWildcard)super.clone(); node.in$Circle(false); node.is$Final(false); return node; } /** * @ast method * */ public AbstractWildcard() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 0; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
1,929
20.208791
99
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/AbstractWildcardType.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production AbstractWildcardType : {@link TypeDecl}; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.ast:25 */ public abstract class AbstractWildcardType extends TypeDecl implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); getSootClassDecl_computed = false; getSootClassDecl_value = null; } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AbstractWildcardType clone() throws CloneNotSupportedException { AbstractWildcardType node = (AbstractWildcardType)super.clone(); node.getSootClassDecl_computed = false; node.getSootClassDecl_value = null; node.in$Circle(false); node.is$Final(false); return node; } /** * Qualified access for wildcard types. * Since they have no ordinary package and type name * we just return the bound access. * @ast method * @aspect Generics * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:17 */ public Access createQualifiedAccess() { // this was suggested by Hyunik Na as a fix for bug // http://svn.cs.lth.se/trac/jastadd-trac/ticket/60 return createBoundAccess(); } /** * @ast method * */ public AbstractWildcardType() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[2]; setChild(new List(), 1); } /** * @ast method * */ public AbstractWildcardType(Modifiers p0, String p1, List<BodyDecl> p2) { setChild(p0, 0); setID(p1); setChild(p2, 1); } /** * @ast method * */ public AbstractWildcardType(Modifiers p0, beaver.Symbol p1, List<BodyDecl> p2) { setChild(p0, 0); setID(p1); setChild(p2, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the Modifiers child. * @param node The new node to replace the Modifiers child. * @apilevel high-level * @ast method * */ public void setModifiers(Modifiers node) { setChild(node, 0); } /** * Retrieves the Modifiers child. * @return The current node used as the Modifiers child. * @apilevel high-level * @ast method * */ public Modifiers getModifiers() { return (Modifiers)getChild(0); } /** * Retrieves the Modifiers child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Modifiers child. * @apilevel low-level * @ast method * */ public Modifiers getModifiersNoTransform() { return (Modifiers)getChildNoTransform(0); } /** * Replaces the lexeme ID. * @param value The new value for the lexeme ID. * @apilevel high-level * @ast method * */ public void setID(String value) { tokenString_ID = value; } /** * JastAdd-internal setter for lexeme ID using the Beaver parser. * @apilevel internal * @ast method * */ public void setID(beaver.Symbol symbol) { if(symbol.value != null && !(symbol.value instanceof String)) throw new UnsupportedOperationException("setID is only valid for String lexemes"); tokenString_ID = (String)symbol.value; IDstart = symbol.getStart(); IDend = symbol.getEnd(); } /** * Retrieves the value for the lexeme ID. * @return The value for the lexeme ID. * @apilevel high-level * @ast method * */ public String getID() { return tokenString_ID != null ? tokenString_ID : ""; } /** * Replaces the BodyDecl list. * @param list The new list node to be used as the BodyDecl list. * @apilevel high-level * @ast method * */ public void setBodyDeclList(List<BodyDecl> list) { setChild(list, 1); } /** * Retrieves the number of children in the BodyDecl list. * @return Number of children in the BodyDecl list. * @apilevel high-level * @ast method * */ public int getNumBodyDecl() { return getBodyDeclList().getNumChild(); } /** * Retrieves the number of children in the BodyDecl list. * Calling this method will not trigger rewrites.. * @return Number of children in the BodyDecl list. * @apilevel low-level * @ast method * */ public int getNumBodyDeclNoTransform() { return getBodyDeclListNoTransform().getNumChildNoTransform(); } /** * Retrieves the element at index {@code i} in the BodyDecl list.. * @param i Index of the element to return. * @return The element at position {@code i} in the BodyDecl list. * @apilevel high-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public BodyDecl getBodyDecl(int i) { return (BodyDecl)getBodyDeclList().getChild(i); } /** * Append an element to the BodyDecl list. * @param node The element to append to the BodyDecl list. * @apilevel high-level * @ast method * */ public void addBodyDecl(BodyDecl node) { List<BodyDecl> list = (parent == null || state == null) ? getBodyDeclListNoTransform() : getBodyDeclList(); list.addChild(node); } /** * @apilevel low-level * @ast method * */ public void addBodyDeclNoTransform(BodyDecl node) { List<BodyDecl> list = getBodyDeclListNoTransform(); list.addChild(node); } /** * Replaces the BodyDecl list element at index {@code i} with the new node {@code node}. * @param node The new node to replace the old list element. * @param i The list index of the node to be replaced. * @apilevel high-level * @ast method * */ public void setBodyDecl(BodyDecl node, int i) { List<BodyDecl> list = getBodyDeclList(); list.setChild(node, i); } /** * Retrieves the BodyDecl list. * @return The node representing the BodyDecl list. * @apilevel high-level * @ast method * */ public List<BodyDecl> getBodyDecls() { return getBodyDeclList(); } /** * Retrieves the BodyDecl list. * <p><em>This method does not invoke AST transformations.</em></p> * @return The node representing the BodyDecl list. * @apilevel low-level * @ast method * */ public List<BodyDecl> getBodyDeclsNoTransform() { return getBodyDeclListNoTransform(); } /** * Retrieves the BodyDecl list. * @return The node representing the BodyDecl list. * @apilevel high-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public List<BodyDecl> getBodyDeclList() { List<BodyDecl> list = (List<BodyDecl>)getChild(1); list.getNumChild(); return list; } /** * Retrieves the BodyDecl list. * <p><em>This method does not invoke AST transformations.</em></p> * @return The node representing the BodyDecl list. * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public List<BodyDecl> getBodyDeclListNoTransform() { return (List<BodyDecl>)getChildNoTransform(1); } /** * @attribute syn * @aspect GenericsSubtype * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:102 */ public boolean isWildcard() { ASTNode$State state = state(); try { return true; } finally { } } /** * @apilevel internal */ protected boolean getSootClassDecl_computed = false; /** * @apilevel internal */ protected SootClass getSootClassDecl_value; /** * @attribute syn * @aspect GenericsCodegen * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/GenericsCodegen.jrag:424 */ @SuppressWarnings({"unchecked", "cast"}) public SootClass getSootClassDecl() { if(getSootClassDecl_computed) { return getSootClassDecl_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); getSootClassDecl_value = getSootClassDecl_compute(); if(isFinal && num == state().boundariesCrossed) getSootClassDecl_computed = true; return getSootClassDecl_value; } /** * @apilevel internal */ private SootClass getSootClassDecl_compute() { return typeObject().getSootClassDecl(); } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
9,330
25.433428
120
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/Access.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production Access : {@link Expr}; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:14 */ public abstract class Access extends Expr implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); prevExpr_computed = false; prevExpr_value = null; hasPrevExpr_computed = false; type_computed = false; type_value = null; } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public Access clone() throws CloneNotSupportedException { Access node = (Access)super.clone(); node.prevExpr_computed = false; node.prevExpr_value = null; node.hasPrevExpr_computed = false; node.type_computed = false; node.type_value = null; node.in$Circle(false); node.is$Final(false); return node; } /** * @ast method * @aspect QualifiedNames * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:148 */ public Access addArrayDims(List list) { Access a = this; for(int i = 0; i < list.getNumChildNoTransform(); i++) { Dims dims = (Dims)list.getChildNoTransform(i); Opt opt = dims.getExprOpt(); if(opt.getNumChildNoTransform() == 1) a = new ArrayTypeWithSizeAccess(a, (Expr)opt.getChildNoTransform(0)); else a = new ArrayTypeAccess(a); a.setStart(dims.start()); a.setEnd(dims.end()); } return a; } /** * @ast method * @aspect InnerClasses * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/InnerClasses.jrag:106 */ protected TypeDecl superConstructorQualifier(TypeDecl targetEnclosingType) { TypeDecl enclosing = hostType(); while(!enclosing.instanceOf(targetEnclosingType)) enclosing = enclosing.enclosingType(); return enclosing; } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:293 */ public soot.Value emitLoadLocalInNestedClass(Body b, Variable v) { if(inExplicitConstructorInvocation() && enclosingBodyDecl() instanceof ConstructorDecl) { ConstructorDecl c = (ConstructorDecl)enclosingBodyDecl(); return ((ParameterDeclaration)c.parameterDeclaration(v.name()).iterator().next()).local; } else { return b.newInstanceFieldRef( b.emitThis(hostType()), Scene.v().makeFieldRef(hostType().getSootClassDecl(), "val$" + v.name(), v.type().getSootType(), false), this //hostType().getSootClassDecl().getField("val$" + v.name(), v.type().getSootType()).makeRef() ); } } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:430 */ public soot.Local emitThis(Body b, TypeDecl targetDecl) { b.setLine(this); if(targetDecl == hostType()) return b.emitThis(hostType()); else { TypeDecl enclosing = hostType(); Local base; if(inExplicitConstructorInvocation()) { base = asLocal(b, b.newParameterRef(enclosing.enclosingType().getSootType(), 0, this) ); enclosing = enclosing.enclosing(); } else { base = b.emitThis(hostType()); } while(enclosing != targetDecl) { Local next = b.newTemp(enclosing.enclosingType().getSootType()); b.add( b.newAssignStmt( next, b.newInstanceFieldRef( base, enclosing.getSootField("this$0", enclosing.enclosingType()).makeRef(), this ), this ) ); base = next; enclosing = enclosing.enclosingType(); } return base; } } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:658 */ public void addArraySize(Body b, ArrayList list) { } /** * @ast method * */ public Access() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 0; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * @attribute syn * @aspect LookupMethod * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupMethod.jrag:17 */ public Expr unqualifiedScope() { ASTNode$State state = state(); try { return isQualified() ? nestedScope() : this; } finally { } } /** * @attribute syn * @aspect QualifiedNames * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:58 */ public boolean isQualified() { ASTNode$State state = state(); try { return hasPrevExpr(); } finally { } } /** * @attribute syn * @aspect QualifiedNames * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:61 */ public Expr qualifier() { ASTNode$State state = state(); try { return prevExpr(); } finally { } } /** * @attribute syn * @aspect QualifiedNames * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:66 */ public Access lastAccess() { ASTNode$State state = state(); try { return this; } finally { } } /** * @apilevel internal */ protected boolean prevExpr_computed = false; /** * @apilevel internal */ protected Expr prevExpr_value; /** * @attribute syn * @aspect QualifiedNames * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:78 */ @SuppressWarnings({"unchecked", "cast"}) public Expr prevExpr() { if(prevExpr_computed) { return prevExpr_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); prevExpr_value = prevExpr_compute(); if(isFinal && num == state().boundariesCrossed) prevExpr_computed = true; return prevExpr_value; } /** * @apilevel internal */ private Expr prevExpr_compute() { if(isLeftChildOfDot()) { if(parentDot().isRightChildOfDot()) return parentDot().parentDot().leftSide(); } else if(isRightChildOfDot()) return parentDot().leftSide(); throw new Error(this + " does not have a previous expression"); } /** * @apilevel internal */ protected boolean hasPrevExpr_computed = false; /** * @apilevel internal */ protected boolean hasPrevExpr_value; /** * @attribute syn * @aspect QualifiedNames * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:89 */ @SuppressWarnings({"unchecked", "cast"}) public boolean hasPrevExpr() { if(hasPrevExpr_computed) { return hasPrevExpr_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); hasPrevExpr_value = hasPrevExpr_compute(); if(isFinal && num == state().boundariesCrossed) hasPrevExpr_computed = true; return hasPrevExpr_value; } /** * @apilevel internal */ private boolean hasPrevExpr_compute() { if(isLeftChildOfDot()) { if(parentDot().isRightChildOfDot()) return true; } else if(isRightChildOfDot()) return true; return false; } /** * @attribute syn * @aspect SyntacticClassification * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/SyntacticClassification.jrag:56 */ public NameType predNameType() { ASTNode$State state = state(); try { return NameType.NO_NAME; } finally { } } /** * @apilevel internal */ protected boolean type_computed = false; /** * @apilevel internal */ protected TypeDecl type_value; /** * @attribute syn * @aspect TypeAnalysis * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:278 */ @SuppressWarnings({"unchecked", "cast"}) public TypeDecl type() { if(type_computed) { return type_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); type_value = type_compute(); if(isFinal && num == state().boundariesCrossed) type_computed = true; return type_value; } /** * @apilevel internal */ private TypeDecl type_compute() { return unknownType(); } /** * @attribute syn * @aspect TypeInference * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/TypeInference.jrag:65 */ public boolean isDiamond() { ASTNode$State state = state(); try { return false; } finally { } } /** * Builds a copy of this Access node where all occurrences * of type variables in the original type parameter list have been replaced * by the substitution type parameters. * * @return the substituted Access node * @attribute syn * @aspect TypeInference * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/TypeInference.jrag:406 */ public Access substituted(Collection<TypeVariable> original, List<TypeVariable> substitution) { ASTNode$State state = state(); try { return (Access) cloneSubtree(); } finally { } } /** * @attribute inh * @aspect LookupMethod * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupMethod.jrag:18 */ @SuppressWarnings({"unchecked", "cast"}) public Expr nestedScope() { ASTNode$State state = state(); Expr nestedScope_value = getParent().Define_Expr_nestedScope(this, null); return nestedScope_value; } /** * @attribute inh * @aspect TypeScopePropagation * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:221 */ @SuppressWarnings({"unchecked", "cast"}) public TypeDecl unknownType() { ASTNode$State state = state(); TypeDecl unknownType_value = getParent().Define_TypeDecl_unknownType(this, null); return unknownType_value; } /** * @attribute inh * @aspect VariableScopePropagation * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupVariable.jrag:239 */ @SuppressWarnings({"unchecked", "cast"}) public Variable unknownField() { ASTNode$State state = state(); Variable unknownField_value = getParent().Define_Variable_unknownField(this, null); return unknownField_value; } /** * @attribute inh * @aspect Annotations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:268 */ @SuppressWarnings({"unchecked", "cast"}) public boolean withinSuppressWarnings(String s) { ASTNode$State state = state(); boolean withinSuppressWarnings_String_value = getParent().Define_boolean_withinSuppressWarnings(this, null, s); return withinSuppressWarnings_String_value; } /** * @attribute inh * @aspect Annotations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:372 */ @SuppressWarnings({"unchecked", "cast"}) public boolean withinDeprecatedAnnotation() { ASTNode$State state = state(); boolean withinDeprecatedAnnotation_value = getParent().Define_boolean_withinDeprecatedAnnotation(this, null); return withinDeprecatedAnnotation_value; } /** * @attribute inh * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:292 */ @SuppressWarnings({"unchecked", "cast"}) public boolean inExplicitConstructorInvocation() { ASTNode$State state = state(); boolean inExplicitConstructorInvocation_value = getParent().Define_boolean_inExplicitConstructorInvocation(this, null); return inExplicitConstructorInvocation_value; } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
13,269
28.620536
123
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/AddExpr.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production AddExpr : {@link AdditiveExpr}; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:158 */ public class AddExpr extends AdditiveExpr implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); type_computed = false; type_value = null; } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AddExpr clone() throws CloneNotSupportedException { AddExpr node = (AddExpr)super.clone(); node.type_computed = false; node.type_value = null; node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AddExpr copy() { try { AddExpr node = (AddExpr) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public AddExpr fullCopy() { AddExpr tree = (AddExpr) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect TypeCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:172 */ public void typeCheck() { TypeDecl left = getLeftOperand().type(); TypeDecl right = getRightOperand().type(); if(!left.isString() && !right.isString()) super.typeCheck(); else if(left.isVoid()) error("The type void of the left hand side is not numeric"); else if(right.isVoid()) error("The type void of the right hand side is not numeric"); } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:805 */ public soot.Value emitOperation(Body b, soot.Value left, soot.Value right) { return asLocal(b, b.newAddExpr(asImmediate(b, left), asImmediate(b, right), this)); } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:839 */ public soot.Value eval(Body b) { if(type().isString() && isConstant()) return soot.jimple.StringConstant.v(constant().stringValue()); if(isStringAdd()) { Local v; if(firstStringAddPart()) { // new StringBuffer v = b.newTemp(b.newNewExpr( lookupType("java.lang", "StringBuffer").sootRef(), this)); b.setLine(this); b.add(b.newInvokeStmt( b.newSpecialInvokeExpr(v, Scene.v().getMethod("<java.lang.StringBuffer: void <init>()>").makeRef(), this ), this)); b.setLine(this); b.add(b.newInvokeStmt( b.newVirtualInvokeExpr(v, lookupType("java.lang", "StringBuffer").methodWithArgs("append", new TypeDecl[] { getLeftOperand().type().stringPromotion() }).sootRef(), asImmediate(b, getLeftOperand().eval(b)), this ), this)); } else v = (Local)getLeftOperand().eval(b); // append b.setLine(this); b.add(b.newInvokeStmt( b.newVirtualInvokeExpr(v, lookupType("java.lang", "StringBuffer").methodWithArgs("append", new TypeDecl[] { getRightOperand().type().stringPromotion() }).sootRef(), asImmediate(b, getRightOperand().eval(b)), this ), this)); if(lastStringAddPart()) { return b.newTemp( b.newVirtualInvokeExpr(v, Scene.v().getMethod("<java.lang.StringBuffer: java.lang.String toString()>").makeRef(), this )); } else return v; } else return b.newAddExpr( b.newTemp( getLeftOperand().type().emitCastTo(b, // Binary numeric promotion getLeftOperand(), type() ) ), asImmediate(b, getRightOperand().type().emitCastTo(b, // Binary numeric promotion getRightOperand(), type() ) ), this ); } /** * @ast method * */ public AddExpr() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[2]; } /** * @ast method * */ public AddExpr(Expr p0, Expr p1) { setChild(p0, 0); setChild(p1, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the LeftOperand child. * @param node The new node to replace the LeftOperand child. * @apilevel high-level * @ast method * */ public void setLeftOperand(Expr node) { setChild(node, 0); } /** * Retrieves the LeftOperand child. * @return The current node used as the LeftOperand child. * @apilevel high-level * @ast method * */ public Expr getLeftOperand() { return (Expr)getChild(0); } /** * Retrieves the LeftOperand child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the LeftOperand child. * @apilevel low-level * @ast method * */ public Expr getLeftOperandNoTransform() { return (Expr)getChildNoTransform(0); } /** * Replaces the RightOperand child. * @param node The new node to replace the RightOperand child. * @apilevel high-level * @ast method * */ public void setRightOperand(Expr node) { setChild(node, 1); } /** * Retrieves the RightOperand child. * @return The current node used as the RightOperand child. * @apilevel high-level * @ast method * */ public Expr getRightOperand() { return (Expr)getChild(1); } /** * Retrieves the RightOperand child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the RightOperand child. * @apilevel low-level * @ast method * */ public Expr getRightOperandNoTransform() { return (Expr)getChildNoTransform(1); } /** * @attribute syn * @aspect ConstantExpression * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:91 */ public Constant constant() { ASTNode$State state = state(); try { return type().add(getLeftOperand().constant(), getRightOperand().constant()); } finally { } } /** * @attribute syn * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:400 */ public String printOp() { ASTNode$State state = state(); try { return " + "; } finally { } } /** * @apilevel internal */ protected boolean type_computed = false; /** * @apilevel internal */ protected TypeDecl type_value; /** * @attribute syn * @aspect TypeAnalysis * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:327 */ @SuppressWarnings({"unchecked", "cast"}) public TypeDecl type() { if(type_computed) { return type_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); type_value = type_compute(); if(isFinal && num == state().boundariesCrossed) type_computed = true; return type_value; } /** * @apilevel internal */ private TypeDecl type_compute() { TypeDecl left = getLeftOperand().type(); TypeDecl right = getRightOperand().type(); if(!left.isString() && !right.isString()) return super.type(); else { if(left.isVoid() || right.isVoid()) return unknownType(); // pick the string type return left.isString() ? left : right; } } /** * @attribute syn * @aspect InnerClasses * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/InnerClasses.jrag:88 */ public boolean isStringAdd() { ASTNode$State state = state(); try { return type().isString() && !isConstant(); } finally { } } /** * @attribute syn * @aspect InnerClasses * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/InnerClasses.jrag:91 */ public boolean firstStringAddPart() { ASTNode$State state = state(); try { return type().isString() && !getLeftOperand().isStringAdd(); } finally { } } /** * @attribute syn * @aspect InnerClasses * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/InnerClasses.jrag:92 */ public boolean lastStringAddPart() { ASTNode$State state = state(); try { return !getParent().isStringAdd(); } finally { } } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
10,379
25.961039
149
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/AdditiveExpr.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production AdditiveExpr : {@link ArithmeticExpr}; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:157 */ public abstract class AdditiveExpr extends ArithmeticExpr implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); type_computed = false; type_value = null; } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AdditiveExpr clone() throws CloneNotSupportedException { AdditiveExpr node = (AdditiveExpr)super.clone(); node.type_computed = false; node.type_value = null; node.in$Circle(false); node.is$Final(false); return node; } /** * @ast method * @aspect TypeCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:164 */ public void typeCheck() { if(!getLeftOperand().type().isNumericType()) error(getLeftOperand().type().typeName() + " is not numeric"); if(!getRightOperand().type().isNumericType()) error(getRightOperand().type().typeName() + " is not numeric"); } /** * @ast method * */ public AdditiveExpr() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[2]; } /** * @ast method * */ public AdditiveExpr(Expr p0, Expr p1) { setChild(p0, 0); setChild(p1, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the LeftOperand child. * @param node The new node to replace the LeftOperand child. * @apilevel high-level * @ast method * */ public void setLeftOperand(Expr node) { setChild(node, 0); } /** * Retrieves the LeftOperand child. * @return The current node used as the LeftOperand child. * @apilevel high-level * @ast method * */ public Expr getLeftOperand() { return (Expr)getChild(0); } /** * Retrieves the LeftOperand child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the LeftOperand child. * @apilevel low-level * @ast method * */ public Expr getLeftOperandNoTransform() { return (Expr)getChildNoTransform(0); } /** * Replaces the RightOperand child. * @param node The new node to replace the RightOperand child. * @apilevel high-level * @ast method * */ public void setRightOperand(Expr node) { setChild(node, 1); } /** * Retrieves the RightOperand child. * @return The current node used as the RightOperand child. * @apilevel high-level * @ast method * */ public Expr getRightOperand() { return (Expr)getChild(1); } /** * Retrieves the RightOperand child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the RightOperand child. * @apilevel low-level * @ast method * */ public Expr getRightOperandNoTransform() { return (Expr)getChildNoTransform(1); } /** * @apilevel internal */ protected boolean type_computed = false; /** * @apilevel internal */ protected TypeDecl type_value; /** * @attribute syn * @aspect TypeAnalysis * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:325 */ @SuppressWarnings({"unchecked", "cast"}) public TypeDecl type() { if(type_computed) { return type_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); type_value = type_compute(); if(isFinal && num == state().boundariesCrossed) type_computed = true; return type_value; } /** * @apilevel internal */ private TypeDecl type_compute() { return getLeftOperand().type().binaryNumericPromotion(getRightOperand().type()); } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
5,019
23.368932
120
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/AmbiguousAccess.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production AmbiguousAccess : {@link Access} ::= <span class="component">&lt;ID:String&gt;</span>; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:35 */ public class AmbiguousAccess extends Access implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AmbiguousAccess clone() throws CloneNotSupportedException { AmbiguousAccess node = (AmbiguousAccess)super.clone(); node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AmbiguousAccess copy() { try { AmbiguousAccess node = (AmbiguousAccess) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public AmbiguousAccess fullCopy() { AmbiguousAccess tree = (AmbiguousAccess) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect NameCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:56 */ public void nameCheck() { error("ambiguous name " + name()); } /** * @ast method * @aspect NodeConstructors * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NodeConstructors.jrag:33 */ public AmbiguousAccess(String name, int start, int end) { this(name); this.start = this.IDstart = start; this.end = this.IDend = end; } /** * @ast method * */ public AmbiguousAccess() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { } /** * @ast method * */ public AmbiguousAccess(String p0) { setID(p0); } /** * @ast method * */ public AmbiguousAccess(beaver.Symbol p0) { setID(p0); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 0; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return true; } /** * Replaces the lexeme ID. * @param value The new value for the lexeme ID. * @apilevel high-level * @ast method * */ public void setID(String value) { tokenString_ID = value; } /** * @apilevel internal * @ast method * */ /** * @apilevel internal */ protected String tokenString_ID; /** * @ast method * */ public int IDstart; /** * @ast method * */ public int IDend; /** * JastAdd-internal setter for lexeme ID using the Beaver parser. * @apilevel internal * @ast method * */ public void setID(beaver.Symbol symbol) { if(symbol.value != null && !(symbol.value instanceof String)) throw new UnsupportedOperationException("setID is only valid for String lexemes"); tokenString_ID = (String)symbol.value; IDstart = symbol.getStart(); IDend = symbol.getEnd(); } /** * Retrieves the value for the lexeme ID. * @return The value for the lexeme ID. * @apilevel high-level * @ast method * */ public String getID() { return tokenString_ID != null ? tokenString_ID : ""; } /** * @attribute syn * @aspect TypeScopePropagation * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:430 */ public SimpleSet qualifiedLookupType(String name) { ASTNode$State state = state(); try { return SimpleSet.emptySet; } finally { } } /** * @attribute syn * @aspect VariableScope * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupVariable.jrag:148 */ public SimpleSet qualifiedLookupVariable(String name) { ASTNode$State state = state(); try { return SimpleSet.emptySet; } finally { } } /** * @attribute syn * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:800 */ public String dumpString() { ASTNode$State state = state(); try { return getClass().getName() + " [" + getID() + "]"; } finally { } } /** * @attribute syn * @aspect Names * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/QualifiedNames.jrag:16 */ public String name() { ASTNode$State state = state(); try { return getID(); } finally { } } /** * @attribute syn * @aspect SyntacticClassification * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/SyntacticClassification.jrag:56 */ public NameType predNameType() { ASTNode$State state = state(); try { return NameType.AMBIGUOUS_NAME; } finally { } } /** * @apilevel internal */ public ASTNode rewriteTo() { // Declared in /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag at line 194 if(!duringSyntacticClassification()) { state().duringNameResolution++; ASTNode result = rewriteRule0(); state().duringNameResolution--; return result; } return super.rewriteTo(); } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:194 * @apilevel internal */ private Access rewriteRule0() { { if(!lookupVariable(name()).isEmpty()) { return new VarAccess(name(), start(), end()); } else if(!lookupType(name()).isEmpty()) { return new TypeAccess(name(), start(), end()); } else { return new PackageAccess(name(), start(), end()); } } } }
7,270
23.900685
126
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/AndBitwiseExpr.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production AndBitwiseExpr : {@link BitwiseExpr}; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:167 */ public class AndBitwiseExpr extends BitwiseExpr implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AndBitwiseExpr clone() throws CloneNotSupportedException { AndBitwiseExpr node = (AndBitwiseExpr)super.clone(); node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AndBitwiseExpr copy() { try { AndBitwiseExpr node = (AndBitwiseExpr) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public AndBitwiseExpr fullCopy() { AndBitwiseExpr tree = (AndBitwiseExpr) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:832 */ public soot.Value emitOperation(Body b, soot.Value left, soot.Value right) { return asLocal(b, b.newAndExpr(asImmediate(b, left), asImmediate(b, right), this)); } /** * @ast method * */ public AndBitwiseExpr() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[2]; } /** * @ast method * */ public AndBitwiseExpr(Expr p0, Expr p1) { setChild(p0, 0); setChild(p1, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the LeftOperand child. * @param node The new node to replace the LeftOperand child. * @apilevel high-level * @ast method * */ public void setLeftOperand(Expr node) { setChild(node, 0); } /** * Retrieves the LeftOperand child. * @return The current node used as the LeftOperand child. * @apilevel high-level * @ast method * */ public Expr getLeftOperand() { return (Expr)getChild(0); } /** * Retrieves the LeftOperand child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the LeftOperand child. * @apilevel low-level * @ast method * */ public Expr getLeftOperandNoTransform() { return (Expr)getChildNoTransform(0); } /** * Replaces the RightOperand child. * @param node The new node to replace the RightOperand child. * @apilevel high-level * @ast method * */ public void setRightOperand(Expr node) { setChild(node, 1); } /** * Retrieves the RightOperand child. * @return The current node used as the RightOperand child. * @apilevel high-level * @ast method * */ public Expr getRightOperand() { return (Expr)getChild(1); } /** * Retrieves the RightOperand child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the RightOperand child. * @apilevel low-level * @ast method * */ public Expr getRightOperandNoTransform() { return (Expr)getChildNoTransform(1); } /** * @attribute syn * @aspect ConstantExpression * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:91 */ public Constant constant() { ASTNode$State state = state(); try { return type().andBitwise(getLeftOperand().constant(), getRightOperand().constant()); } finally { } } /** * @attribute syn * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:400 */ public String printOp() { ASTNode$State state = state(); try { return " & "; } finally { } } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
5,664
23.846491
113
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/AndLogicalExpr.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production AndLogicalExpr : {@link LogicalExpr}; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:172 */ public class AndLogicalExpr extends LogicalExpr implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); isDAafterTrue_Variable_values = null; isDAafterFalse_Variable_values = null; isDAafter_Variable_values = null; isDUafter_Variable_values = null; next_test_label_computed = false; next_test_label_value = null; } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AndLogicalExpr clone() throws CloneNotSupportedException { AndLogicalExpr node = (AndLogicalExpr)super.clone(); node.isDAafterTrue_Variable_values = null; node.isDAafterFalse_Variable_values = null; node.isDAafter_Variable_values = null; node.isDUafter_Variable_values = null; node.next_test_label_computed = false; node.next_test_label_value = null; node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AndLogicalExpr copy() { try { AndLogicalExpr node = (AndLogicalExpr) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public AndLogicalExpr fullCopy() { AndLogicalExpr tree = (AndLogicalExpr) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect BooleanExpressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:184 */ public void emitEvalBranch(Body b) { b.setLine(this); getLeftOperand().emitEvalBranch(b); b.addLabel(next_test_label()); if(getLeftOperand().canBeTrue()) { getRightOperand().emitEvalBranch(b); if(getRightOperand().canBeTrue()) b.add(b.newGotoStmt(true_label(), this)); } } /** * @ast method * */ public AndLogicalExpr() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[2]; } /** * @ast method * */ public AndLogicalExpr(Expr p0, Expr p1) { setChild(p0, 0); setChild(p1, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the LeftOperand child. * @param node The new node to replace the LeftOperand child. * @apilevel high-level * @ast method * */ public void setLeftOperand(Expr node) { setChild(node, 0); } /** * Retrieves the LeftOperand child. * @return The current node used as the LeftOperand child. * @apilevel high-level * @ast method * */ public Expr getLeftOperand() { return (Expr)getChild(0); } /** * Retrieves the LeftOperand child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the LeftOperand child. * @apilevel low-level * @ast method * */ public Expr getLeftOperandNoTransform() { return (Expr)getChildNoTransform(0); } /** * Replaces the RightOperand child. * @param node The new node to replace the RightOperand child. * @apilevel high-level * @ast method * */ public void setRightOperand(Expr node) { setChild(node, 1); } /** * Retrieves the RightOperand child. * @return The current node used as the RightOperand child. * @apilevel high-level * @ast method * */ public Expr getRightOperand() { return (Expr)getChild(1); } /** * Retrieves the RightOperand child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the RightOperand child. * @apilevel low-level * @ast method * */ public Expr getRightOperandNoTransform() { return (Expr)getChildNoTransform(1); } /** * @attribute syn * @aspect ConstantExpression * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:91 */ public Constant constant() { ASTNode$State state = state(); try { return Constant.create(left().constant().booleanValue() && right().constant().booleanValue()); } finally { } } protected java.util.Map isDAafterTrue_Variable_values; /** * @attribute syn * @aspect DA * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:362 */ @SuppressWarnings({"unchecked", "cast"}) public boolean isDAafterTrue(Variable v) { Object _parameters = v; if(isDAafterTrue_Variable_values == null) isDAafterTrue_Variable_values = new java.util.HashMap(4); if(isDAafterTrue_Variable_values.containsKey(_parameters)) { return ((Boolean)isDAafterTrue_Variable_values.get(_parameters)).booleanValue(); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean isDAafterTrue_Variable_value = isDAafterTrue_compute(v); if(isFinal && num == state().boundariesCrossed) isDAafterTrue_Variable_values.put(_parameters, Boolean.valueOf(isDAafterTrue_Variable_value)); return isDAafterTrue_Variable_value; } /** * @apilevel internal */ private boolean isDAafterTrue_compute(Variable v) { return getRightOperand().isDAafterTrue(v) || isFalse(); } protected java.util.Map isDAafterFalse_Variable_values; /** * @attribute syn * @aspect DA * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:364 */ @SuppressWarnings({"unchecked", "cast"}) public boolean isDAafterFalse(Variable v) { Object _parameters = v; if(isDAafterFalse_Variable_values == null) isDAafterFalse_Variable_values = new java.util.HashMap(4); if(isDAafterFalse_Variable_values.containsKey(_parameters)) { return ((Boolean)isDAafterFalse_Variable_values.get(_parameters)).booleanValue(); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean isDAafterFalse_Variable_value = isDAafterFalse_compute(v); if(isFinal && num == state().boundariesCrossed) isDAafterFalse_Variable_values.put(_parameters, Boolean.valueOf(isDAafterFalse_Variable_value)); return isDAafterFalse_Variable_value; } /** * @apilevel internal */ private boolean isDAafterFalse_compute(Variable v) { return (getLeftOperand().isDAafterFalse(v) && getRightOperand().isDAafterFalse(v)) || isTrue(); } protected java.util.Map isDAafter_Variable_values; /** * @attribute syn * @aspect DA * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:370 */ @SuppressWarnings({"unchecked", "cast"}) public boolean isDAafter(Variable v) { Object _parameters = v; if(isDAafter_Variable_values == null) isDAafter_Variable_values = new java.util.HashMap(4); if(isDAafter_Variable_values.containsKey(_parameters)) { return ((Boolean)isDAafter_Variable_values.get(_parameters)).booleanValue(); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean isDAafter_Variable_value = isDAafter_compute(v); if(isFinal && num == state().boundariesCrossed) isDAafter_Variable_values.put(_parameters, Boolean.valueOf(isDAafter_Variable_value)); return isDAafter_Variable_value; } /** * @apilevel internal */ private boolean isDAafter_compute(Variable v) { return isDAafterTrue(v) && isDAafterFalse(v); } /** * @attribute syn * @aspect DU * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:702 */ public boolean isDUafterTrue(Variable v) { ASTNode$State state = state(); try { return getRightOperand().isDUafterTrue(v); } finally { } } /** * @attribute syn * @aspect DU * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:703 */ public boolean isDUafterFalse(Variable v) { ASTNode$State state = state(); try { return getLeftOperand().isDUafterFalse(v) && getRightOperand().isDUafterFalse(v); } finally { } } protected java.util.Map isDUafter_Variable_values; /** * @attribute syn * @aspect DU * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:806 */ @SuppressWarnings({"unchecked", "cast"}) public boolean isDUafter(Variable v) { Object _parameters = v; if(isDUafter_Variable_values == null) isDUafter_Variable_values = new java.util.HashMap(4); if(isDUafter_Variable_values.containsKey(_parameters)) { return ((Boolean)isDUafter_Variable_values.get(_parameters)).booleanValue(); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean isDUafter_Variable_value = isDUafter_compute(v); if(isFinal && num == state().boundariesCrossed) isDUafter_Variable_values.put(_parameters, Boolean.valueOf(isDUafter_Variable_value)); return isDUafter_Variable_value; } /** * @apilevel internal */ private boolean isDUafter_compute(Variable v) { return isDUafterTrue(v) && isDUafterFalse(v); } /** * @attribute syn * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:400 */ public String printOp() { ASTNode$State state = state(); try { return " && "; } finally { } } /** * @attribute syn * @aspect BooleanExpressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:82 */ public boolean canBeTrue() { ASTNode$State state = state(); try { return getLeftOperand().canBeTrue() && getRightOperand().canBeTrue(); } finally { } } /** * @attribute syn * @aspect BooleanExpressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:92 */ public boolean canBeFalse() { ASTNode$State state = state(); try { return getLeftOperand().canBeFalse() || getRightOperand().canBeFalse(); } finally { } } /** * @apilevel internal */ protected boolean next_test_label_computed = false; /** * @apilevel internal */ protected soot.jimple.Stmt next_test_label_value; /** * @attribute syn * @aspect BooleanExpressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:194 */ @SuppressWarnings({"unchecked", "cast"}) public soot.jimple.Stmt next_test_label() { if(next_test_label_computed) { return next_test_label_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); next_test_label_value = next_test_label_compute(); if(isFinal && num == state().boundariesCrossed) next_test_label_computed = true; return next_test_label_value; } /** * @apilevel internal */ private soot.jimple.Stmt next_test_label_compute() { return newLabel(); } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:368 * @apilevel internal */ public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v) { if(caller == getRightOperandNoTransform()) { return getLeftOperand().isDAafterTrue(v); } else if(caller == getLeftOperandNoTransform()) { return isDAbefore(v); } else { return super.Define_boolean_isDAbefore(caller, child, v); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:805 * @apilevel internal */ public boolean Define_boolean_isDUbefore(ASTNode caller, ASTNode child, Variable v) { if(caller == getRightOperandNoTransform()) { return getLeftOperand().isDUafterTrue(v); } else if(caller == getLeftOperandNoTransform()) { return isDUbefore(v); } else { return super.Define_boolean_isDUbefore(caller, child, v); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:74 * @apilevel internal */ public soot.jimple.Stmt Define_soot_jimple_Stmt_condition_false_label(ASTNode caller, ASTNode child) { if(caller == getRightOperandNoTransform()) { return false_label(); } else if(caller == getLeftOperandNoTransform()) { return false_label(); } else { return getParent().Define_soot_jimple_Stmt_condition_false_label(this, caller); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:75 * @apilevel internal */ public soot.jimple.Stmt Define_soot_jimple_Stmt_condition_true_label(ASTNode caller, ASTNode child) { if(caller == getRightOperandNoTransform()) { return true_label(); } else if(caller == getLeftOperandNoTransform()) { return next_test_label(); } else { return getParent().Define_soot_jimple_Stmt_condition_true_label(this, caller); } } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
15,179
31.161017
154
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/AnnotatedCompilationUnit.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production AnnotatedCompilationUnit : {@link CompilationUnit} ::= <span class="component">{@link Modifiers}</span>; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.ast:16 */ public class AnnotatedCompilationUnit extends CompilationUnit implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AnnotatedCompilationUnit clone() throws CloneNotSupportedException { AnnotatedCompilationUnit node = (AnnotatedCompilationUnit)super.clone(); node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AnnotatedCompilationUnit copy() { try { AnnotatedCompilationUnit node = (AnnotatedCompilationUnit) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public AnnotatedCompilationUnit fullCopy() { AnnotatedCompilationUnit tree = (AnnotatedCompilationUnit) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect Annotations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:21 */ public void nameCheck() { super.nameCheck(); if(!relativeName().endsWith("package-info.java")) error("package annotations should be in a file package-info.java"); } /** * @ast method * @aspect Annotations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:557 */ public void toString(StringBuffer s) { getModifiers().toString(s); super.toString(s); } /** * @ast method * @aspect AnnotationsCodegen * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/AnnotationsCodegen.jrag:11 */ public void jimplify1phase2() { super.jimplify1phase2(); ArrayList c = new ArrayList(); getModifiers().addAllAnnotations(c); for(Iterator iter = c.iterator(); iter.hasNext(); ) { soot.tagkit.Tag tag = (soot.tagkit.Tag)iter.next(); //host.addTag(tag); } } /** * @ast method * */ public AnnotatedCompilationUnit() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[3]; setChild(new List(), 0); setChild(new List(), 1); } /** * @ast method * */ public AnnotatedCompilationUnit(java.lang.String p0, List<ImportDecl> p1, List<TypeDecl> p2, Modifiers p3) { setPackageDecl(p0); setChild(p1, 0); setChild(p2, 1); setChild(p3, 2); } /** * @ast method * */ public AnnotatedCompilationUnit(beaver.Symbol p0, List<ImportDecl> p1, List<TypeDecl> p2, Modifiers p3) { setPackageDecl(p0); setChild(p1, 0); setChild(p2, 1); setChild(p3, 2); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 3; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the lexeme PackageDecl. * @param value The new value for the lexeme PackageDecl. * @apilevel high-level * @ast method * */ public void setPackageDecl(java.lang.String value) { tokenjava_lang_String_PackageDecl = value; } /** * JastAdd-internal setter for lexeme PackageDecl using the Beaver parser. * @apilevel internal * @ast method * */ public void setPackageDecl(beaver.Symbol symbol) { if(symbol.value != null && !(symbol.value instanceof String)) throw new UnsupportedOperationException("setPackageDecl is only valid for String lexemes"); tokenjava_lang_String_PackageDecl = (String)symbol.value; PackageDeclstart = symbol.getStart(); PackageDeclend = symbol.getEnd(); } /** * Retrieves the value for the lexeme PackageDecl. * @return The value for the lexeme PackageDecl. * @apilevel high-level * @ast method * */ public java.lang.String getPackageDecl() { return tokenjava_lang_String_PackageDecl != null ? tokenjava_lang_String_PackageDecl : ""; } /** * Replaces the ImportDecl list. * @param list The new list node to be used as the ImportDecl list. * @apilevel high-level * @ast method * */ public void setImportDeclList(List<ImportDecl> list) { setChild(list, 0); } /** * Retrieves the number of children in the ImportDecl list. * @return Number of children in the ImportDecl list. * @apilevel high-level * @ast method * */ public int getNumImportDecl() { return getImportDeclList().getNumChild(); } /** * Retrieves the number of children in the ImportDecl list. * Calling this method will not trigger rewrites.. * @return Number of children in the ImportDecl list. * @apilevel low-level * @ast method * */ public int getNumImportDeclNoTransform() { return getImportDeclListNoTransform().getNumChildNoTransform(); } /** * Retrieves the element at index {@code i} in the ImportDecl list.. * @param i Index of the element to return. * @return The element at position {@code i} in the ImportDecl list. * @apilevel high-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public ImportDecl getImportDecl(int i) { return (ImportDecl)getImportDeclList().getChild(i); } /** * Append an element to the ImportDecl list. * @param node The element to append to the ImportDecl list. * @apilevel high-level * @ast method * */ public void addImportDecl(ImportDecl node) { List<ImportDecl> list = (parent == null || state == null) ? getImportDeclListNoTransform() : getImportDeclList(); list.addChild(node); } /** * @apilevel low-level * @ast method * */ public void addImportDeclNoTransform(ImportDecl node) { List<ImportDecl> list = getImportDeclListNoTransform(); list.addChild(node); } /** * Replaces the ImportDecl list element at index {@code i} with the new node {@code node}. * @param node The new node to replace the old list element. * @param i The list index of the node to be replaced. * @apilevel high-level * @ast method * */ public void setImportDecl(ImportDecl node, int i) { List<ImportDecl> list = getImportDeclList(); list.setChild(node, i); } /** * Retrieves the ImportDecl list. * @return The node representing the ImportDecl list. * @apilevel high-level * @ast method * */ public List<ImportDecl> getImportDecls() { return getImportDeclList(); } /** * Retrieves the ImportDecl list. * <p><em>This method does not invoke AST transformations.</em></p> * @return The node representing the ImportDecl list. * @apilevel low-level * @ast method * */ public List<ImportDecl> getImportDeclsNoTransform() { return getImportDeclListNoTransform(); } /** * Retrieves the ImportDecl list. * @return The node representing the ImportDecl list. * @apilevel high-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public List<ImportDecl> getImportDeclList() { List<ImportDecl> list = (List<ImportDecl>)getChild(0); list.getNumChild(); return list; } /** * Retrieves the ImportDecl list. * <p><em>This method does not invoke AST transformations.</em></p> * @return The node representing the ImportDecl list. * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public List<ImportDecl> getImportDeclListNoTransform() { return (List<ImportDecl>)getChildNoTransform(0); } /** * Replaces the TypeDecl list. * @param list The new list node to be used as the TypeDecl list. * @apilevel high-level * @ast method * */ public void setTypeDeclList(List<TypeDecl> list) { setChild(list, 1); } /** * Retrieves the number of children in the TypeDecl list. * @return Number of children in the TypeDecl list. * @apilevel high-level * @ast method * */ public int getNumTypeDecl() { return getTypeDeclList().getNumChild(); } /** * Retrieves the number of children in the TypeDecl list. * Calling this method will not trigger rewrites.. * @return Number of children in the TypeDecl list. * @apilevel low-level * @ast method * */ public int getNumTypeDeclNoTransform() { return getTypeDeclListNoTransform().getNumChildNoTransform(); } /** * Retrieves the element at index {@code i} in the TypeDecl list.. * @param i Index of the element to return. * @return The element at position {@code i} in the TypeDecl list. * @apilevel high-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public TypeDecl getTypeDecl(int i) { return (TypeDecl)getTypeDeclList().getChild(i); } /** * Append an element to the TypeDecl list. * @param node The element to append to the TypeDecl list. * @apilevel high-level * @ast method * */ public void addTypeDecl(TypeDecl node) { List<TypeDecl> list = (parent == null || state == null) ? getTypeDeclListNoTransform() : getTypeDeclList(); list.addChild(node); } /** * @apilevel low-level * @ast method * */ public void addTypeDeclNoTransform(TypeDecl node) { List<TypeDecl> list = getTypeDeclListNoTransform(); list.addChild(node); } /** * Replaces the TypeDecl list element at index {@code i} with the new node {@code node}. * @param node The new node to replace the old list element. * @param i The list index of the node to be replaced. * @apilevel high-level * @ast method * */ public void setTypeDecl(TypeDecl node, int i) { List<TypeDecl> list = getTypeDeclList(); list.setChild(node, i); } /** * Retrieves the TypeDecl list. * @return The node representing the TypeDecl list. * @apilevel high-level * @ast method * */ public List<TypeDecl> getTypeDecls() { return getTypeDeclList(); } /** * Retrieves the TypeDecl list. * <p><em>This method does not invoke AST transformations.</em></p> * @return The node representing the TypeDecl list. * @apilevel low-level * @ast method * */ public List<TypeDecl> getTypeDeclsNoTransform() { return getTypeDeclListNoTransform(); } /** * Retrieves the TypeDecl list. * @return The node representing the TypeDecl list. * @apilevel high-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public List<TypeDecl> getTypeDeclList() { List<TypeDecl> list = (List<TypeDecl>)getChild(1); list.getNumChild(); return list; } /** * Retrieves the TypeDecl list. * <p><em>This method does not invoke AST transformations.</em></p> * @return The node representing the TypeDecl list. * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public List<TypeDecl> getTypeDeclListNoTransform() { return (List<TypeDecl>)getChildNoTransform(1); } /** * Replaces the Modifiers child. * @param node The new node to replace the Modifiers child. * @apilevel high-level * @ast method * */ public void setModifiers(Modifiers node) { setChild(node, 2); } /** * Retrieves the Modifiers child. * @return The current node used as the Modifiers child. * @apilevel high-level * @ast method * */ public Modifiers getModifiers() { return (Modifiers)getChild(2); } /** * Retrieves the Modifiers child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Modifiers child. * @apilevel low-level * @ast method * */ public Modifiers getModifiersNoTransform() { return (Modifiers)getChildNoTransform(2); } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:71 * @apilevel internal */ public boolean Define_boolean_mayUseAnnotationTarget(ASTNode caller, ASTNode child, String name) { if(caller == getModifiersNoTransform()) { return name.equals("PACKAGE"); } else { return getParent().Define_boolean_mayUseAnnotationTarget(this, caller, name); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:552 * @apilevel internal */ public String Define_String_hostPackage(ASTNode caller, ASTNode child) { if(caller == getModifiersNoTransform()) { return packageName(); } else { return super.Define_String_hostPackage(caller, child); } } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
14,432
27.189453
122
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/Annotation.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production Annotation : {@link Modifier} ::= <span class="component">&lt;ID:String&gt;</span> <span class="component">{@link Access}</span> <span class="component">{@link ElementValuePair}*</span>; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.ast:6 */ public class Annotation extends Modifier implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); decl_computed = false; decl_value = null; } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public Annotation clone() throws CloneNotSupportedException { Annotation node = (Annotation)super.clone(); node.decl_computed = false; node.decl_value = null; node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public Annotation copy() { try { Annotation node = (Annotation) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public Annotation fullCopy() { Annotation tree = (Annotation) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect Annotations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:41 */ public void checkModifiers() { super.checkModifiers(); if(decl() instanceof AnnotationDecl) { AnnotationDecl T = (AnnotationDecl)decl(); Annotation m = T.annotation(lookupType("java.lang.annotation", "Target")); if(m != null && m.getNumElementValuePair() == 1 && m.getElementValuePair(0).getName().equals("value")) { ElementValue v = m.getElementValuePair(0).getElementValue(); //System.out.println("ElementValue: \n" + v.dumpTree()); //System.out.println("Annotation: \n" + dumpTree()); if(!v.validTarget(this)) error("annotation type " + T.typeName() + " is not applicable to this kind of declaration"); } } } /** * @ast method * @aspect Annotations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:383 */ public void typeCheck() { if(!decl().isAnnotationDecl()) { /* TypeName names the annotation type corresponding to the annotation. It is a compile-time error if TypeName does not name an annotation type.*/ if(!decl().isUnknown()) error(decl().typeName() + " is not an annotation type"); } else { TypeDecl typeDecl = decl(); /* It is a compile-time error if a declaration is annotated with more than one annotation for a given annotation type.*/ if(lookupAnnotation(typeDecl) != this) error("duplicate annotation " + typeDecl.typeName()); /* Annotations must contain an element-value pair for every element of the corresponding annotation type, except for those elements with default values, or a compile-time error occurs. Annotations may, but are not required to, contain element-value pairs for elements with default values.*/ for(int i = 0; i < typeDecl.getNumBodyDecl(); i++) { if(typeDecl.getBodyDecl(i) instanceof MethodDecl) { MethodDecl decl = (MethodDecl)typeDecl.getBodyDecl(i); if(elementValueFor(decl.name()) == null && (!(decl instanceof AnnotationMethodDecl) || !((AnnotationMethodDecl)decl).hasDefaultValue())) error("missing value for " + decl.name()); } } /* The Identifier in an ElementValuePair must be the simple name of one of the elements of the annotation type identified by TypeName in the containing annotation. Otherwise, a compile-time error occurs. (In other words, the identifier in an element-value pair must also be a method name in the interface identified by TypeName.) */ for(int i = 0; i < getNumElementValuePair(); i++) { ElementValuePair pair = getElementValuePair(i); if(typeDecl.memberMethods(pair.getName()).isEmpty()) error("can not find element named " + pair.getName() + " in " + typeDecl.typeName()); } } checkOverride(); } /** * @ast method * @aspect Annotations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:582 */ public void toString(StringBuffer s) { s.append("@"); getAccess().toString(s); s.append("("); for(int i = 0; i < getNumElementValuePair(); i++) { if(i != 0) s.append(", "); getElementValuePair(i).toString(s); } s.append(")"); } /** * @ast method * @aspect AnnotationsCodegen * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/AnnotationsCodegen.jrag:305 */ public void appendAsAttributeTo(Collection list) { soot.tagkit.AnnotationTag tag = new soot.tagkit.AnnotationTag(decl().typeDescriptor(), getNumElementValuePair()); ArrayList elements = new ArrayList(getNumElementValuePair()); for(int i = 0; i < getNumElementValuePair(); i++) { String name = getElementValuePair(i).getName(); ElementValue value = getElementValuePair(i).getElementValue(); value.appendAsAttributeTo(elements, name); } tag.setElems(elements); list.add(tag); } /** * @ast method * */ public Annotation() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[2]; setChild(new List(), 1); } /** * @ast method * */ public Annotation(String p0, Access p1, List<ElementValuePair> p2) { setID(p0); setChild(p1, 0); setChild(p2, 1); } /** * @ast method * */ public Annotation(beaver.Symbol p0, Access p1, List<ElementValuePair> p2) { setID(p0); setChild(p1, 0); setChild(p2, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the lexeme ID. * @param value The new value for the lexeme ID. * @apilevel high-level * @ast method * */ public void setID(String value) { tokenString_ID = value; } /** * JastAdd-internal setter for lexeme ID using the Beaver parser. * @apilevel internal * @ast method * */ public void setID(beaver.Symbol symbol) { if(symbol.value != null && !(symbol.value instanceof String)) throw new UnsupportedOperationException("setID is only valid for String lexemes"); tokenString_ID = (String)symbol.value; IDstart = symbol.getStart(); IDend = symbol.getEnd(); } /** * Retrieves the value for the lexeme ID. * @return The value for the lexeme ID. * @apilevel high-level * @ast method * */ public String getID() { return tokenString_ID != null ? tokenString_ID : ""; } /** * Replaces the Access child. * @param node The new node to replace the Access child. * @apilevel high-level * @ast method * */ public void setAccess(Access node) { setChild(node, 0); } /** * Retrieves the Access child. * @return The current node used as the Access child. * @apilevel high-level * @ast method * */ public Access getAccess() { return (Access)getChild(0); } /** * Retrieves the Access child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Access child. * @apilevel low-level * @ast method * */ public Access getAccessNoTransform() { return (Access)getChildNoTransform(0); } /** * Replaces the ElementValuePair list. * @param list The new list node to be used as the ElementValuePair list. * @apilevel high-level * @ast method * */ public void setElementValuePairList(List<ElementValuePair> list) { setChild(list, 1); } /** * Retrieves the number of children in the ElementValuePair list. * @return Number of children in the ElementValuePair list. * @apilevel high-level * @ast method * */ public int getNumElementValuePair() { return getElementValuePairList().getNumChild(); } /** * Retrieves the number of children in the ElementValuePair list. * Calling this method will not trigger rewrites.. * @return Number of children in the ElementValuePair list. * @apilevel low-level * @ast method * */ public int getNumElementValuePairNoTransform() { return getElementValuePairListNoTransform().getNumChildNoTransform(); } /** * Retrieves the element at index {@code i} in the ElementValuePair list.. * @param i Index of the element to return. * @return The element at position {@code i} in the ElementValuePair list. * @apilevel high-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public ElementValuePair getElementValuePair(int i) { return (ElementValuePair)getElementValuePairList().getChild(i); } /** * Append an element to the ElementValuePair list. * @param node The element to append to the ElementValuePair list. * @apilevel high-level * @ast method * */ public void addElementValuePair(ElementValuePair node) { List<ElementValuePair> list = (parent == null || state == null) ? getElementValuePairListNoTransform() : getElementValuePairList(); list.addChild(node); } /** * @apilevel low-level * @ast method * */ public void addElementValuePairNoTransform(ElementValuePair node) { List<ElementValuePair> list = getElementValuePairListNoTransform(); list.addChild(node); } /** * Replaces the ElementValuePair list element at index {@code i} with the new node {@code node}. * @param node The new node to replace the old list element. * @param i The list index of the node to be replaced. * @apilevel high-level * @ast method * */ public void setElementValuePair(ElementValuePair node, int i) { List<ElementValuePair> list = getElementValuePairList(); list.setChild(node, i); } /** * Retrieves the ElementValuePair list. * @return The node representing the ElementValuePair list. * @apilevel high-level * @ast method * */ public List<ElementValuePair> getElementValuePairs() { return getElementValuePairList(); } /** * Retrieves the ElementValuePair list. * <p><em>This method does not invoke AST transformations.</em></p> * @return The node representing the ElementValuePair list. * @apilevel low-level * @ast method * */ public List<ElementValuePair> getElementValuePairsNoTransform() { return getElementValuePairListNoTransform(); } /** * Retrieves the ElementValuePair list. * @return The node representing the ElementValuePair list. * @apilevel high-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public List<ElementValuePair> getElementValuePairList() { List<ElementValuePair> list = (List<ElementValuePair>)getChild(1); list.getNumChild(); return list; } /** * Retrieves the ElementValuePair list. * <p><em>This method does not invoke AST transformations.</em></p> * @return The node representing the ElementValuePair list. * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public List<ElementValuePair> getElementValuePairListNoTransform() { return (List<ElementValuePair>)getChildNoTransform(1); } /** * @ast method * @aspect Annotations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/Override.jrag:20 */ public void checkOverride() { if (decl().fullName().equals("java.lang.Override") && enclosingBodyDecl() instanceof MethodDecl) { MethodDecl method = (MethodDecl)enclosingBodyDecl(); TypeDecl host = method.hostType(); SimpleSet ancestors = host.ancestorMethods(method.signature()); boolean found = false; for (Iterator iter = ancestors.iterator(); iter.hasNext(); ) { MethodDecl decl = (MethodDecl)iter.next(); if (method.overrides(decl)) { found = true; break; } } if (!found) { TypeDecl typeObject = lookupType("java.lang", "Object"); SimpleSet overrides = typeObject.localMethodsSignature(method.signature()); if (overrides.isEmpty() || !((MethodDecl) overrides.iterator().next()).isPublic()) error("method does not override a method from a supertype"); } } } /** * @apilevel internal */ protected boolean decl_computed = false; /** * @apilevel internal */ protected TypeDecl decl_value; /** * @attribute syn * @aspect Annotations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:420 */ @SuppressWarnings({"unchecked", "cast"}) public TypeDecl decl() { if(decl_computed) { return decl_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); decl_value = decl_compute(); if(isFinal && num == state().boundariesCrossed) decl_computed = true; return decl_value; } /** * @apilevel internal */ private TypeDecl decl_compute() { return getAccess().type(); } /** * @attribute syn * @aspect Annotations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:432 */ public ElementValue elementValueFor(String name) { ASTNode$State state = state(); try { for(int i = 0; i < getNumElementValuePair(); i++) { ElementValuePair pair = getElementValuePair(i); if(pair.getName().equals(name)) return pair.getElementValue(); } return null; } finally { } } /** * @attribute syn * @aspect Annotations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:514 */ public TypeDecl type() { ASTNode$State state = state(); try { return getAccess().type(); } finally { } } /* An annotation on an annotation type declaration is known as a meta-annotation. An annotation type may be used to annotate its own declaration. More generally, circularities in the transitive closure of the "annotates" relation are permitted. For example, it is legal to annotate an annotation type declaration with another annotation type, and to annotate the latter type's declaration with the former type. (The pre-defined meta-annotation types contain several such circularities.) Comment: no problems with reference attributes. * @attribute syn * @aspect Annotations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:543 */ public boolean isMetaAnnotation() { ASTNode$State state = state(); try { return hostType().isAnnotationDecl(); } finally { } } /** * @attribute syn * @aspect AnnotationsCodegen * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/AnnotationsCodegen.jrag:143 */ public boolean isRuntimeVisible() { ASTNode$State state = state(); try { Annotation a = decl().annotation(lookupType("java.lang.annotation", "Retention")); if(a == null) return false; ElementConstantValue value = (ElementConstantValue)a.getElementValuePair(0).getElementValue(); Variable v = value.getExpr().varDecl(); return v != null && v.name().equals("RUNTIME"); } finally { } } /** * @attribute syn * @aspect AnnotationsCodegen * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/AnnotationsCodegen.jrag:153 */ public boolean isRuntimeInvisible() { ASTNode$State state = state(); try { Annotation a = decl().annotation(lookupType("java.lang.annotation", "Retention")); if(a == null) return true; // default bahavior if not annotated ElementConstantValue value = (ElementConstantValue)a.getElementValuePair(0).getElementValue(); Variable v = value.getExpr().varDecl(); return v != null && v.name().equals("CLASS"); } finally { } } /** * @attribute inh * @aspect Annotations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:55 */ @SuppressWarnings({"unchecked", "cast"}) public TypeDecl lookupType(String packageName, String typeName) { ASTNode$State state = state(); TypeDecl lookupType_String_String_value = getParent().Define_TypeDecl_lookupType(this, null, packageName, typeName); return lookupType_String_String_value; } /** * @attribute inh * @aspect Annotations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:69 */ @SuppressWarnings({"unchecked", "cast"}) public boolean mayUseAnnotationTarget(String name) { ASTNode$State state = state(); boolean mayUseAnnotationTarget_String_value = getParent().Define_boolean_mayUseAnnotationTarget(this, null, name); return mayUseAnnotationTarget_String_value; } /** * @attribute inh * @aspect Annotations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:258 */ @SuppressWarnings({"unchecked", "cast"}) public BodyDecl enclosingBodyDecl() { ASTNode$State state = state(); BodyDecl enclosingBodyDecl_value = getParent().Define_BodyDecl_enclosingBodyDecl(this, null); return enclosingBodyDecl_value; } /** * @attribute inh * @aspect Annotations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:422 */ @SuppressWarnings({"unchecked", "cast"}) public Annotation lookupAnnotation(TypeDecl typeDecl) { ASTNode$State state = state(); Annotation lookupAnnotation_TypeDecl_value = getParent().Define_Annotation_lookupAnnotation(this, null, typeDecl); return lookupAnnotation_TypeDecl_value; } /** * @attribute inh * @aspect Annotations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:544 */ @SuppressWarnings({"unchecked", "cast"}) public TypeDecl hostType() { ASTNode$State state = state(); TypeDecl hostType_value = getParent().Define_TypeDecl_hostType(this, null); return hostType_value; } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:462 * @apilevel internal */ public TypeDecl Define_TypeDecl_enclosingAnnotationDecl(ASTNode caller, ASTNode child) { if(caller == getElementValuePairListNoTransform()) { int childIndex = caller.getIndexOfChild(child); return decl(); } else { return getParent().Define_TypeDecl_enclosingAnnotationDecl(this, caller); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:549 * @apilevel internal */ public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) { if(caller == getAccessNoTransform()) { return NameType.TYPE_NAME; } else { return getParent().Define_NameType_nameType(this, caller); } } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
21,018
31.436728
201
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/AnnotationDecl.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production AnnotationDecl : {@link InterfaceDecl} ::= <span class="component">SuperInterfaceId:{@link Access}*</span>; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.ast:2 */ public class AnnotationDecl extends InterfaceDecl implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); getSuperInterfaceIdList_computed = false; getSuperInterfaceIdList_value = null; containsElementOf_TypeDecl_values = null; } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AnnotationDecl clone() throws CloneNotSupportedException { AnnotationDecl node = (AnnotationDecl)super.clone(); node.getSuperInterfaceIdList_computed = false; node.getSuperInterfaceIdList_value = null; node.containsElementOf_TypeDecl_values = null; node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AnnotationDecl copy() { try { AnnotationDecl node = (AnnotationDecl) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public AnnotationDecl fullCopy() { AnnotationDecl tree = (AnnotationDecl) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { switch (i) { case 3: tree.children[i] = new List(); continue; } ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect Annotations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:103 */ public void typeCheck() { super.typeCheck(); for(int i = 0; i < getNumBodyDecl(); i++) { if(getBodyDecl(i) instanceof MethodDecl) { MethodDecl m = (MethodDecl)getBodyDecl(i); if(!m.type().isValidAnnotationMethodReturnType()) m.error("invalid type for annotation member"); if(m.annotationMethodOverride()) m.error("annotation method overrides " + m.signature()); } } if(containsElementOf(this)) error("cyclic annotation element type"); } /** * @ast method * @aspect Annotations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:562 */ public void toString(StringBuffer s) { getModifiers().toString(s); s.append("@interface " + name()); s.append(" {"); for(int i=0; i < getNumBodyDecl(); i++) { getBodyDecl(i).toString(s); } s.append(indent() + "}"); } /** * @ast method * */ public AnnotationDecl() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[3]; setChild(new List(), 1); setChild(new List(), 2); } /** * @ast method * */ public AnnotationDecl(Modifiers p0, String p1, List<BodyDecl> p2) { setChild(p0, 0); setID(p1); setChild(p2, 1); } /** * @ast method * */ public AnnotationDecl(Modifiers p0, beaver.Symbol p1, List<BodyDecl> p2) { setChild(p0, 0); setID(p1); setChild(p2, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the Modifiers child. * @param node The new node to replace the Modifiers child. * @apilevel high-level * @ast method * */ public void setModifiers(Modifiers node) { setChild(node, 0); } /** * Retrieves the Modifiers child. * @return The current node used as the Modifiers child. * @apilevel high-level * @ast method * */ public Modifiers getModifiers() { return (Modifiers)getChild(0); } /** * Retrieves the Modifiers child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Modifiers child. * @apilevel low-level * @ast method * */ public Modifiers getModifiersNoTransform() { return (Modifiers)getChildNoTransform(0); } /** * Replaces the lexeme ID. * @param value The new value for the lexeme ID. * @apilevel high-level * @ast method * */ public void setID(String value) { tokenString_ID = value; } /** * JastAdd-internal setter for lexeme ID using the Beaver parser. * @apilevel internal * @ast method * */ public void setID(beaver.Symbol symbol) { if(symbol.value != null && !(symbol.value instanceof String)) throw new UnsupportedOperationException("setID is only valid for String lexemes"); tokenString_ID = (String)symbol.value; IDstart = symbol.getStart(); IDend = symbol.getEnd(); } /** * Retrieves the value for the lexeme ID. * @return The value for the lexeme ID. * @apilevel high-level * @ast method * */ public String getID() { return tokenString_ID != null ? tokenString_ID : ""; } /** * Replaces the BodyDecl list. * @param list The new list node to be used as the BodyDecl list. * @apilevel high-level * @ast method * */ public void setBodyDeclList(List<BodyDecl> list) { setChild(list, 1); } /** * Retrieves the number of children in the BodyDecl list. * @return Number of children in the BodyDecl list. * @apilevel high-level * @ast method * */ public int getNumBodyDecl() { return getBodyDeclList().getNumChild(); } /** * Retrieves the number of children in the BodyDecl list. * Calling this method will not trigger rewrites.. * @return Number of children in the BodyDecl list. * @apilevel low-level * @ast method * */ public int getNumBodyDeclNoTransform() { return getBodyDeclListNoTransform().getNumChildNoTransform(); } /** * Retrieves the element at index {@code i} in the BodyDecl list.. * @param i Index of the element to return. * @return The element at position {@code i} in the BodyDecl list. * @apilevel high-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public BodyDecl getBodyDecl(int i) { return (BodyDecl)getBodyDeclList().getChild(i); } /** * Append an element to the BodyDecl list. * @param node The element to append to the BodyDecl list. * @apilevel high-level * @ast method * */ public void addBodyDecl(BodyDecl node) { List<BodyDecl> list = (parent == null || state == null) ? getBodyDeclListNoTransform() : getBodyDeclList(); list.addChild(node); } /** * @apilevel low-level * @ast method * */ public void addBodyDeclNoTransform(BodyDecl node) { List<BodyDecl> list = getBodyDeclListNoTransform(); list.addChild(node); } /** * Replaces the BodyDecl list element at index {@code i} with the new node {@code node}. * @param node The new node to replace the old list element. * @param i The list index of the node to be replaced. * @apilevel high-level * @ast method * */ public void setBodyDecl(BodyDecl node, int i) { List<BodyDecl> list = getBodyDeclList(); list.setChild(node, i); } /** * Retrieves the BodyDecl list. * @return The node representing the BodyDecl list. * @apilevel high-level * @ast method * */ public List<BodyDecl> getBodyDecls() { return getBodyDeclList(); } /** * Retrieves the BodyDecl list. * <p><em>This method does not invoke AST transformations.</em></p> * @return The node representing the BodyDecl list. * @apilevel low-level * @ast method * */ public List<BodyDecl> getBodyDeclsNoTransform() { return getBodyDeclListNoTransform(); } /** * Retrieves the BodyDecl list. * @return The node representing the BodyDecl list. * @apilevel high-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public List<BodyDecl> getBodyDeclList() { List<BodyDecl> list = (List<BodyDecl>)getChild(1); list.getNumChild(); return list; } /** * Retrieves the BodyDecl list. * <p><em>This method does not invoke AST transformations.</em></p> * @return The node representing the BodyDecl list. * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public List<BodyDecl> getBodyDeclListNoTransform() { return (List<BodyDecl>)getChildNoTransform(1); } /** * Replaces the SuperInterfaceId list. * @param list The new list node to be used as the SuperInterfaceId list. * @apilevel high-level * @ast method * */ public void setSuperInterfaceIdList(List<Access> list) { setChild(list, 2); } /** * Retrieves the number of children in the SuperInterfaceId list. * @return Number of children in the SuperInterfaceId list. * @apilevel high-level * @ast method * */ public int getNumSuperInterfaceId() { return getSuperInterfaceIdList().getNumChild(); } /** * Retrieves the number of children in the SuperInterfaceId list. * Calling this method will not trigger rewrites.. * @return Number of children in the SuperInterfaceId list. * @apilevel low-level * @ast method * */ public int getNumSuperInterfaceIdNoTransform() { return getSuperInterfaceIdListNoTransform().getNumChildNoTransform(); } /** * Retrieves the element at index {@code i} in the SuperInterfaceId list.. * @param i Index of the element to return. * @return The element at position {@code i} in the SuperInterfaceId list. * @apilevel high-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public Access getSuperInterfaceId(int i) { return (Access)getSuperInterfaceIdList().getChild(i); } /** * Append an element to the SuperInterfaceId list. * @param node The element to append to the SuperInterfaceId list. * @apilevel high-level * @ast method * */ public void addSuperInterfaceId(Access node) { List<Access> list = (parent == null || state == null) ? getSuperInterfaceIdListNoTransform() : getSuperInterfaceIdList(); list.addChild(node); } /** * @apilevel low-level * @ast method * */ public void addSuperInterfaceIdNoTransform(Access node) { List<Access> list = getSuperInterfaceIdListNoTransform(); list.addChild(node); } /** * Replaces the SuperInterfaceId list element at index {@code i} with the new node {@code node}. * @param node The new node to replace the old list element. * @param i The list index of the node to be replaced. * @apilevel high-level * @ast method * */ public void setSuperInterfaceId(Access node, int i) { List<Access> list = getSuperInterfaceIdList(); list.setChild(node, i); } /** * Retrieves the SuperInterfaceId list. * @return The node representing the SuperInterfaceId list. * @apilevel high-level * @ast method * */ public List<Access> getSuperInterfaceIds() { return getSuperInterfaceIdList(); } /** * Retrieves the SuperInterfaceId list. * <p><em>This method does not invoke AST transformations.</em></p> * @return The node representing the SuperInterfaceId list. * @apilevel low-level * @ast method * */ public List<Access> getSuperInterfaceIdsNoTransform() { return getSuperInterfaceIdListNoTransform(); } /** * Retrieves the SuperInterfaceId list. * <p><em>This method does not invoke AST transformations.</em></p> * @return The node representing the SuperInterfaceId list. * @apilevel low-level * @ast method * */ public List<Access> getSuperInterfaceIdListNoTransform() { return (List<Access>)getChildNoTransform(2); } /** * Retrieves the child position of the SuperInterfaceId list. * @return The the child position of the SuperInterfaceId list. * @apilevel low-level * @ast method * */ protected int getSuperInterfaceIdListChildPosition() { return 2; } /** * @apilevel internal */ protected boolean getSuperInterfaceIdList_computed = false; /** * @apilevel internal */ protected List getSuperInterfaceIdList_value; /* The direct superinterface of an annotation type is always annotation.Annotation.* @attribute syn nta * @aspect Annotations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:99 */ @SuppressWarnings({"unchecked", "cast"}) public List getSuperInterfaceIdList() { if(getSuperInterfaceIdList_computed) { return (List) getChild(getSuperInterfaceIdListChildPosition()); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); getSuperInterfaceIdList_value = getSuperInterfaceIdList_compute(); setSuperInterfaceIdList(getSuperInterfaceIdList_value); if(isFinal && num == state().boundariesCrossed) getSuperInterfaceIdList_computed = true; return (List) getChild(getSuperInterfaceIdListChildPosition()); } /** * @apilevel internal */ private List getSuperInterfaceIdList_compute() { return new List().add(new TypeAccess("java.lang.annotation", "Annotation")); } /* It is a compile-time error if the return type of a method declared in an annotation type is any type other than one of the following: one of the primitive types, String, Class and any invocation of Class, an enum type (\ufffd8.9), an annotation type, or an array (\ufffd10) of one of the preceding types.* @attribute syn * @aspect Annotations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:121 */ public boolean isValidAnnotationMethodReturnType() { ASTNode$State state = state(); try { return true; } finally { } } protected java.util.Map containsElementOf_TypeDecl_values; /* It is a compile-time error if an annotation type T contains an element of type T, either directly or indirectly.* @attribute syn * @aspect Annotations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:144 */ @SuppressWarnings({"unchecked", "cast"}) public boolean containsElementOf(TypeDecl typeDecl) { Object _parameters = typeDecl; if(containsElementOf_TypeDecl_values == null) containsElementOf_TypeDecl_values = new java.util.HashMap(4); ASTNode$State.CircularValue _value; if(containsElementOf_TypeDecl_values.containsKey(_parameters)) { Object _o = containsElementOf_TypeDecl_values.get(_parameters); if(!(_o instanceof ASTNode$State.CircularValue)) { return ((Boolean)_o).booleanValue(); } else _value = (ASTNode$State.CircularValue)_o; } else { _value = new ASTNode$State.CircularValue(); containsElementOf_TypeDecl_values.put(_parameters, _value); _value.value = Boolean.valueOf(false); } ASTNode$State state = state(); if (!state.IN_CIRCLE) { state.IN_CIRCLE = true; int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean new_containsElementOf_TypeDecl_value; do { _value.visited = new Integer(state.CIRCLE_INDEX); state.CHANGE = false; new_containsElementOf_TypeDecl_value = containsElementOf_compute(typeDecl); if (new_containsElementOf_TypeDecl_value!=((Boolean)_value.value).booleanValue()) { state.CHANGE = true; _value.value = Boolean.valueOf(new_containsElementOf_TypeDecl_value); } state.CIRCLE_INDEX++; } while (state.CHANGE); if(isFinal && num == state().boundariesCrossed) { containsElementOf_TypeDecl_values.put(_parameters, new_containsElementOf_TypeDecl_value); } else { containsElementOf_TypeDecl_values.remove(_parameters); state.RESET_CYCLE = true; containsElementOf_compute(typeDecl); state.RESET_CYCLE = false; } state.IN_CIRCLE = false; return new_containsElementOf_TypeDecl_value; } if(!new Integer(state.CIRCLE_INDEX).equals(_value.visited)) { _value.visited = new Integer(state.CIRCLE_INDEX); boolean new_containsElementOf_TypeDecl_value = containsElementOf_compute(typeDecl); if (state.RESET_CYCLE) { containsElementOf_TypeDecl_values.remove(_parameters); } else if (new_containsElementOf_TypeDecl_value!=((Boolean)_value.value).booleanValue()) { state.CHANGE = true; _value.value = new_containsElementOf_TypeDecl_value; } return new_containsElementOf_TypeDecl_value; } return ((Boolean)_value.value).booleanValue(); } /** * @apilevel internal */ private boolean containsElementOf_compute(TypeDecl typeDecl) { for(int i = 0; i < getNumBodyDecl(); i++) { if(getBodyDecl(i) instanceof MethodDecl) { MethodDecl m = (MethodDecl)getBodyDecl(i); if(m.type() == typeDecl) return true; if(m.type() instanceof AnnotationDecl && ((AnnotationDecl)m.type()).containsElementOf(typeDecl)) return true; } } return false; } /** * @attribute syn * @aspect Annotations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:545 */ public boolean isAnnotationDecl() { ASTNode$State state = state(); try { return true; } finally { } } /** * @attribute syn * @aspect EmitJimple * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:90 */ public int sootTypeModifiers() { ASTNode$State state = state(); try { return super.sootTypeModifiers() | Modifiers.ACC_ANNOTATION; } finally { } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:77 * @apilevel internal */ public boolean Define_boolean_mayUseAnnotationTarget(ASTNode caller, ASTNode child, String name) { if(caller == getModifiersNoTransform()) { return name.equals("ANNOTATION_TYPE") || name.equals("TYPE"); } else { return super.Define_boolean_mayUseAnnotationTarget(caller, child, name); } } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
19,866
29.377676
125
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/AnnotationMethodDecl.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production AnnotationMethodDecl : {@link MethodDecl} ::= <span class="component">[DefaultValue:{@link ElementValue}]</span>; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.ast:3 */ public class AnnotationMethodDecl extends MethodDecl implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AnnotationMethodDecl clone() throws CloneNotSupportedException { AnnotationMethodDecl node = (AnnotationMethodDecl)super.clone(); node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AnnotationMethodDecl copy() { try { AnnotationMethodDecl node = (AnnotationMethodDecl) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public AnnotationMethodDecl fullCopy() { AnnotationMethodDecl tree = (AnnotationMethodDecl) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect Annotations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:160 */ public void typeCheck() { super.typeCheck(); if(hasDefaultValue() && !type().commensurateWith(getDefaultValue())) error(type().typeName() + " is not commensurate with " + getDefaultValue().type().typeName()); } /** * @ast method * @aspect Annotations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:571 */ public void toString(StringBuffer s) { s.append(indent()); getModifiers().toString(s); getTypeAccess().toString(s); s.append(" " + name() + "()"); if(hasDefaultValue()) { s.append(" default "); getDefaultValue().toString(s); } s.append(";\n"); } /** * @ast method * @aspect AnnotationsCodegen * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/AnnotationsCodegen.jrag:293 */ public void addAttributes() { super.addAttributes(); // 4.8.19 if(hasDefaultValue()) { ArrayList elements = new ArrayList(1); getDefaultValue().appendAsAttributeTo(elements, "default"); soot.tagkit.AnnotationDefaultTag tag = new soot.tagkit.AnnotationDefaultTag((soot.tagkit.AnnotationElem)elements.get(0)); sootMethod.addTag(tag); } } /** * @ast method * */ public AnnotationMethodDecl() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[6]; setChild(new List(), 2); setChild(new List(), 3); setChild(new Opt(), 4); setChild(new Opt(), 5); } /** * @ast method * */ public AnnotationMethodDecl(Modifiers p0, Access p1, String p2, List<ParameterDeclaration> p3, List<Access> p4, Opt<Block> p5, Opt<ElementValue> p6) { setChild(p0, 0); setChild(p1, 1); setID(p2); setChild(p3, 2); setChild(p4, 3); setChild(p5, 4); setChild(p6, 5); } /** * @ast method * */ public AnnotationMethodDecl(Modifiers p0, Access p1, beaver.Symbol p2, List<ParameterDeclaration> p3, List<Access> p4, Opt<Block> p5, Opt<ElementValue> p6) { setChild(p0, 0); setChild(p1, 1); setID(p2); setChild(p3, 2); setChild(p4, 3); setChild(p5, 4); setChild(p6, 5); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 6; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the Modifiers child. * @param node The new node to replace the Modifiers child. * @apilevel high-level * @ast method * */ public void setModifiers(Modifiers node) { setChild(node, 0); } /** * Retrieves the Modifiers child. * @return The current node used as the Modifiers child. * @apilevel high-level * @ast method * */ public Modifiers getModifiers() { return (Modifiers)getChild(0); } /** * Retrieves the Modifiers child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Modifiers child. * @apilevel low-level * @ast method * */ public Modifiers getModifiersNoTransform() { return (Modifiers)getChildNoTransform(0); } /** * Replaces the TypeAccess child. * @param node The new node to replace the TypeAccess child. * @apilevel high-level * @ast method * */ public void setTypeAccess(Access node) { setChild(node, 1); } /** * Retrieves the TypeAccess child. * @return The current node used as the TypeAccess child. * @apilevel high-level * @ast method * */ public Access getTypeAccess() { return (Access)getChild(1); } /** * Retrieves the TypeAccess child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the TypeAccess child. * @apilevel low-level * @ast method * */ public Access getTypeAccessNoTransform() { return (Access)getChildNoTransform(1); } /** * Replaces the lexeme ID. * @param value The new value for the lexeme ID. * @apilevel high-level * @ast method * */ public void setID(String value) { tokenString_ID = value; } /** * JastAdd-internal setter for lexeme ID using the Beaver parser. * @apilevel internal * @ast method * */ public void setID(beaver.Symbol symbol) { if(symbol.value != null && !(symbol.value instanceof String)) throw new UnsupportedOperationException("setID is only valid for String lexemes"); tokenString_ID = (String)symbol.value; IDstart = symbol.getStart(); IDend = symbol.getEnd(); } /** * Retrieves the value for the lexeme ID. * @return The value for the lexeme ID. * @apilevel high-level * @ast method * */ public String getID() { return tokenString_ID != null ? tokenString_ID : ""; } /** * Replaces the Parameter list. * @param list The new list node to be used as the Parameter list. * @apilevel high-level * @ast method * */ public void setParameterList(List<ParameterDeclaration> list) { setChild(list, 2); } /** * Retrieves the number of children in the Parameter list. * @return Number of children in the Parameter list. * @apilevel high-level * @ast method * */ public int getNumParameter() { return getParameterList().getNumChild(); } /** * Retrieves the number of children in the Parameter list. * Calling this method will not trigger rewrites.. * @return Number of children in the Parameter list. * @apilevel low-level * @ast method * */ public int getNumParameterNoTransform() { return getParameterListNoTransform().getNumChildNoTransform(); } /** * Retrieves the element at index {@code i} in the Parameter list.. * @param i Index of the element to return. * @return The element at position {@code i} in the Parameter list. * @apilevel high-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public ParameterDeclaration getParameter(int i) { return (ParameterDeclaration)getParameterList().getChild(i); } /** * Append an element to the Parameter list. * @param node The element to append to the Parameter list. * @apilevel high-level * @ast method * */ public void addParameter(ParameterDeclaration node) { List<ParameterDeclaration> list = (parent == null || state == null) ? getParameterListNoTransform() : getParameterList(); list.addChild(node); } /** * @apilevel low-level * @ast method * */ public void addParameterNoTransform(ParameterDeclaration node) { List<ParameterDeclaration> list = getParameterListNoTransform(); list.addChild(node); } /** * Replaces the Parameter list element at index {@code i} with the new node {@code node}. * @param node The new node to replace the old list element. * @param i The list index of the node to be replaced. * @apilevel high-level * @ast method * */ public void setParameter(ParameterDeclaration node, int i) { List<ParameterDeclaration> list = getParameterList(); list.setChild(node, i); } /** * Retrieves the Parameter list. * @return The node representing the Parameter list. * @apilevel high-level * @ast method * */ public List<ParameterDeclaration> getParameters() { return getParameterList(); } /** * Retrieves the Parameter list. * <p><em>This method does not invoke AST transformations.</em></p> * @return The node representing the Parameter list. * @apilevel low-level * @ast method * */ public List<ParameterDeclaration> getParametersNoTransform() { return getParameterListNoTransform(); } /** * Retrieves the Parameter list. * @return The node representing the Parameter list. * @apilevel high-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public List<ParameterDeclaration> getParameterList() { List<ParameterDeclaration> list = (List<ParameterDeclaration>)getChild(2); list.getNumChild(); return list; } /** * Retrieves the Parameter list. * <p><em>This method does not invoke AST transformations.</em></p> * @return The node representing the Parameter list. * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public List<ParameterDeclaration> getParameterListNoTransform() { return (List<ParameterDeclaration>)getChildNoTransform(2); } /** * Replaces the Exception list. * @param list The new list node to be used as the Exception list. * @apilevel high-level * @ast method * */ public void setExceptionList(List<Access> list) { setChild(list, 3); } /** * Retrieves the number of children in the Exception list. * @return Number of children in the Exception list. * @apilevel high-level * @ast method * */ public int getNumException() { return getExceptionList().getNumChild(); } /** * Retrieves the number of children in the Exception list. * Calling this method will not trigger rewrites.. * @return Number of children in the Exception list. * @apilevel low-level * @ast method * */ public int getNumExceptionNoTransform() { return getExceptionListNoTransform().getNumChildNoTransform(); } /** * Retrieves the element at index {@code i} in the Exception list.. * @param i Index of the element to return. * @return The element at position {@code i} in the Exception list. * @apilevel high-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public Access getException(int i) { return (Access)getExceptionList().getChild(i); } /** * Append an element to the Exception list. * @param node The element to append to the Exception list. * @apilevel high-level * @ast method * */ public void addException(Access node) { List<Access> list = (parent == null || state == null) ? getExceptionListNoTransform() : getExceptionList(); list.addChild(node); } /** * @apilevel low-level * @ast method * */ public void addExceptionNoTransform(Access node) { List<Access> list = getExceptionListNoTransform(); list.addChild(node); } /** * Replaces the Exception list element at index {@code i} with the new node {@code node}. * @param node The new node to replace the old list element. * @param i The list index of the node to be replaced. * @apilevel high-level * @ast method * */ public void setException(Access node, int i) { List<Access> list = getExceptionList(); list.setChild(node, i); } /** * Retrieves the Exception list. * @return The node representing the Exception list. * @apilevel high-level * @ast method * */ public List<Access> getExceptions() { return getExceptionList(); } /** * Retrieves the Exception list. * <p><em>This method does not invoke AST transformations.</em></p> * @return The node representing the Exception list. * @apilevel low-level * @ast method * */ public List<Access> getExceptionsNoTransform() { return getExceptionListNoTransform(); } /** * Retrieves the Exception list. * @return The node representing the Exception list. * @apilevel high-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public List<Access> getExceptionList() { List<Access> list = (List<Access>)getChild(3); list.getNumChild(); return list; } /** * Retrieves the Exception list. * <p><em>This method does not invoke AST transformations.</em></p> * @return The node representing the Exception list. * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public List<Access> getExceptionListNoTransform() { return (List<Access>)getChildNoTransform(3); } /** * Replaces the optional node for the Block child. This is the {@code Opt} node containing the child Block, not the actual child! * @param opt The new node to be used as the optional node for the Block child. * @apilevel low-level * @ast method * */ public void setBlockOpt(Opt<Block> opt) { setChild(opt, 4); } /** * Check whether the optional Block child exists. * @return {@code true} if the optional Block child exists, {@code false} if it does not. * @apilevel high-level * @ast method * */ public boolean hasBlock() { return getBlockOpt().getNumChild() != 0; } /** * Retrieves the (optional) Block child. * @return The Block child, if it exists. Returns {@code null} otherwise. * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public Block getBlock() { return (Block)getBlockOpt().getChild(0); } /** * Replaces the (optional) Block child. * @param node The new node to be used as the Block child. * @apilevel high-level * @ast method * */ public void setBlock(Block node) { getBlockOpt().setChild(node, 0); } /** * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public Opt<Block> getBlockOpt() { return (Opt<Block>)getChild(4); } /** * Retrieves the optional node for child Block. This is the {@code Opt} node containing the child Block, not the actual child! * <p><em>This method does not invoke AST transformations.</em></p> * @return The optional node for child Block. * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public Opt<Block> getBlockOptNoTransform() { return (Opt<Block>)getChildNoTransform(4); } /** * Replaces the optional node for the DefaultValue child. This is the {@code Opt} node containing the child DefaultValue, not the actual child! * @param opt The new node to be used as the optional node for the DefaultValue child. * @apilevel low-level * @ast method * */ public void setDefaultValueOpt(Opt<ElementValue> opt) { setChild(opt, 5); } /** * Check whether the optional DefaultValue child exists. * @return {@code true} if the optional DefaultValue child exists, {@code false} if it does not. * @apilevel high-level * @ast method * */ public boolean hasDefaultValue() { return getDefaultValueOpt().getNumChild() != 0; } /** * Retrieves the (optional) DefaultValue child. * @return The DefaultValue child, if it exists. Returns {@code null} otherwise. * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public ElementValue getDefaultValue() { return (ElementValue)getDefaultValueOpt().getChild(0); } /** * Replaces the (optional) DefaultValue child. * @param node The new node to be used as the DefaultValue child. * @apilevel high-level * @ast method * */ public void setDefaultValue(ElementValue node) { getDefaultValueOpt().setChild(node, 0); } /** * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public Opt<ElementValue> getDefaultValueOpt() { return (Opt<ElementValue>)getChild(5); } /** * Retrieves the optional node for child DefaultValue. This is the {@code Opt} node containing the child DefaultValue, not the actual child! * <p><em>This method does not invoke AST transformations.</em></p> * @return The optional node for child DefaultValue. * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public Opt<ElementValue> getDefaultValueOptNoTransform() { return (Opt<ElementValue>)getChildNoTransform(5); } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
18,676
27.298485
159
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/AnonymousDecl.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production AnonymousDecl : {@link ClassDecl} ::= <span class="component">{@link Modifiers}</span> <span class="component">&lt;ID:String&gt;</span> <span class="component">[SuperClassAccess:{@link Access}]</span> <span class="component">Implements:{@link Access}*</span> <span class="component">{@link BodyDecl}*</span>; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:70 */ public class AnonymousDecl extends ClassDecl implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); isCircular_visited = -1; isCircular_computed = false; isCircular_initialized = false; getSuperClassAccessOpt_computed = false; getSuperClassAccessOpt_value = null; getImplementsList_computed = false; getImplementsList_value = null; } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AnonymousDecl clone() throws CloneNotSupportedException { AnonymousDecl node = (AnonymousDecl)super.clone(); node.isCircular_visited = -1; node.isCircular_computed = false; node.isCircular_initialized = false; node.getSuperClassAccessOpt_computed = false; node.getSuperClassAccessOpt_value = null; node.getImplementsList_computed = false; node.getImplementsList_value = null; node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AnonymousDecl copy() { try { AnonymousDecl node = (AnonymousDecl) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public AnonymousDecl fullCopy() { AnonymousDecl tree = (AnonymousDecl) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { switch (i) { case 3: tree.children[i] = new Opt(); continue; case 4: tree.children[i] = new List(); continue; } ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * */ public AnonymousDecl() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[4]; setChild(new List(), 1); setChild(new Opt(), 2); setChild(new List(), 3); } /** * @ast method * */ public AnonymousDecl(Modifiers p0, String p1, List<BodyDecl> p2) { setChild(p0, 0); setID(p1); setChild(p2, 1); } /** * @ast method * */ public AnonymousDecl(Modifiers p0, beaver.Symbol p1, List<BodyDecl> p2) { setChild(p0, 0); setID(p1); setChild(p2, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return true; } /** * Replaces the Modifiers child. * @param node The new node to replace the Modifiers child. * @apilevel high-level * @ast method * */ public void setModifiers(Modifiers node) { setChild(node, 0); } /** * Retrieves the Modifiers child. * @return The current node used as the Modifiers child. * @apilevel high-level * @ast method * */ public Modifiers getModifiers() { return (Modifiers)getChild(0); } /** * Retrieves the Modifiers child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Modifiers child. * @apilevel low-level * @ast method * */ public Modifiers getModifiersNoTransform() { return (Modifiers)getChildNoTransform(0); } /** * Replaces the lexeme ID. * @param value The new value for the lexeme ID. * @apilevel high-level * @ast method * */ public void setID(String value) { tokenString_ID = value; } /** * JastAdd-internal setter for lexeme ID using the Beaver parser. * @apilevel internal * @ast method * */ public void setID(beaver.Symbol symbol) { if(symbol.value != null && !(symbol.value instanceof String)) throw new UnsupportedOperationException("setID is only valid for String lexemes"); tokenString_ID = (String)symbol.value; IDstart = symbol.getStart(); IDend = symbol.getEnd(); } /** * Retrieves the value for the lexeme ID. * @return The value for the lexeme ID. * @apilevel high-level * @ast method * */ public String getID() { return tokenString_ID != null ? tokenString_ID : ""; } /** * Replaces the BodyDecl list. * @param list The new list node to be used as the BodyDecl list. * @apilevel high-level * @ast method * */ public void setBodyDeclList(List<BodyDecl> list) { setChild(list, 1); } /** * Retrieves the number of children in the BodyDecl list. * @return Number of children in the BodyDecl list. * @apilevel high-level * @ast method * */ public int getNumBodyDecl() { return getBodyDeclList().getNumChild(); } /** * Retrieves the number of children in the BodyDecl list. * Calling this method will not trigger rewrites.. * @return Number of children in the BodyDecl list. * @apilevel low-level * @ast method * */ public int getNumBodyDeclNoTransform() { return getBodyDeclListNoTransform().getNumChildNoTransform(); } /** * Retrieves the element at index {@code i} in the BodyDecl list.. * @param i Index of the element to return. * @return The element at position {@code i} in the BodyDecl list. * @apilevel high-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public BodyDecl getBodyDecl(int i) { return (BodyDecl)getBodyDeclList().getChild(i); } /** * Append an element to the BodyDecl list. * @param node The element to append to the BodyDecl list. * @apilevel high-level * @ast method * */ public void addBodyDecl(BodyDecl node) { List<BodyDecl> list = (parent == null || state == null) ? getBodyDeclListNoTransform() : getBodyDeclList(); list.addChild(node); } /** * @apilevel low-level * @ast method * */ public void addBodyDeclNoTransform(BodyDecl node) { List<BodyDecl> list = getBodyDeclListNoTransform(); list.addChild(node); } /** * Replaces the BodyDecl list element at index {@code i} with the new node {@code node}. * @param node The new node to replace the old list element. * @param i The list index of the node to be replaced. * @apilevel high-level * @ast method * */ public void setBodyDecl(BodyDecl node, int i) { List<BodyDecl> list = getBodyDeclList(); list.setChild(node, i); } /** * Retrieves the BodyDecl list. * @return The node representing the BodyDecl list. * @apilevel high-level * @ast method * */ public List<BodyDecl> getBodyDecls() { return getBodyDeclList(); } /** * Retrieves the BodyDecl list. * <p><em>This method does not invoke AST transformations.</em></p> * @return The node representing the BodyDecl list. * @apilevel low-level * @ast method * */ public List<BodyDecl> getBodyDeclsNoTransform() { return getBodyDeclListNoTransform(); } /** * Retrieves the BodyDecl list. * @return The node representing the BodyDecl list. * @apilevel high-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public List<BodyDecl> getBodyDeclList() { List<BodyDecl> list = (List<BodyDecl>)getChild(1); list.getNumChild(); return list; } /** * Retrieves the BodyDecl list. * <p><em>This method does not invoke AST transformations.</em></p> * @return The node representing the BodyDecl list. * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public List<BodyDecl> getBodyDeclListNoTransform() { return (List<BodyDecl>)getChildNoTransform(1); } /** * Replaces the optional node for the SuperClassAccess child. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child! * @param opt The new node to be used as the optional node for the SuperClassAccess child. * @apilevel low-level * @ast method * */ public void setSuperClassAccessOpt(Opt<Access> opt) { setChild(opt, 2); } /** * Check whether the optional SuperClassAccess child exists. * @return {@code true} if the optional SuperClassAccess child exists, {@code false} if it does not. * @apilevel high-level * @ast method * */ public boolean hasSuperClassAccess() { return getSuperClassAccessOpt().getNumChild() != 0; } /** * Retrieves the (optional) SuperClassAccess child. * @return The SuperClassAccess child, if it exists. Returns {@code null} otherwise. * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public Access getSuperClassAccess() { return (Access)getSuperClassAccessOpt().getChild(0); } /** * Replaces the (optional) SuperClassAccess child. * @param node The new node to be used as the SuperClassAccess child. * @apilevel high-level * @ast method * */ public void setSuperClassAccess(Access node) { getSuperClassAccessOpt().setChild(node, 0); } /** * Retrieves the optional node for child SuperClassAccess. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child! * <p><em>This method does not invoke AST transformations.</em></p> * @return The optional node for child SuperClassAccess. * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public Opt<Access> getSuperClassAccessOptNoTransform() { return (Opt<Access>)getChildNoTransform(2); } /** * Retrieves the child position of the optional child SuperClassAccess. * @return The the child position of the optional child SuperClassAccess. * @apilevel low-level * @ast method * */ protected int getSuperClassAccessOptChildPosition() { return 2; } /** * Replaces the Implements list. * @param list The new list node to be used as the Implements list. * @apilevel high-level * @ast method * */ public void setImplementsList(List<Access> list) { setChild(list, 3); } /** * Retrieves the number of children in the Implements list. * @return Number of children in the Implements list. * @apilevel high-level * @ast method * */ public int getNumImplements() { return getImplementsList().getNumChild(); } /** * Retrieves the number of children in the Implements list. * Calling this method will not trigger rewrites.. * @return Number of children in the Implements list. * @apilevel low-level * @ast method * */ public int getNumImplementsNoTransform() { return getImplementsListNoTransform().getNumChildNoTransform(); } /** * Retrieves the element at index {@code i} in the Implements list.. * @param i Index of the element to return. * @return The element at position {@code i} in the Implements list. * @apilevel high-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public Access getImplements(int i) { return (Access)getImplementsList().getChild(i); } /** * Append an element to the Implements list. * @param node The element to append to the Implements list. * @apilevel high-level * @ast method * */ public void addImplements(Access node) { List<Access> list = (parent == null || state == null) ? getImplementsListNoTransform() : getImplementsList(); list.addChild(node); } /** * @apilevel low-level * @ast method * */ public void addImplementsNoTransform(Access node) { List<Access> list = getImplementsListNoTransform(); list.addChild(node); } /** * Replaces the Implements list element at index {@code i} with the new node {@code node}. * @param node The new node to replace the old list element. * @param i The list index of the node to be replaced. * @apilevel high-level * @ast method * */ public void setImplements(Access node, int i) { List<Access> list = getImplementsList(); list.setChild(node, i); } /** * Retrieves the Implements list. * @return The node representing the Implements list. * @apilevel high-level * @ast method * */ public List<Access> getImplementss() { return getImplementsList(); } /** * Retrieves the Implements list. * <p><em>This method does not invoke AST transformations.</em></p> * @return The node representing the Implements list. * @apilevel low-level * @ast method * */ public List<Access> getImplementssNoTransform() { return getImplementsListNoTransform(); } /** * Retrieves the Implements list. * <p><em>This method does not invoke AST transformations.</em></p> * @return The node representing the Implements list. * @apilevel low-level * @ast method * */ public List<Access> getImplementsListNoTransform() { return (List<Access>)getChildNoTransform(3); } /** * Retrieves the child position of the Implements list. * @return The the child position of the Implements list. * @apilevel low-level * @ast method * */ protected int getImplementsListChildPosition() { return 3; } /** * @ast method * @aspect VariableArityParameters * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/VariableArityParameters.jrag:107 */ protected List constructorParameterList(ConstructorDecl decl) { List parameterList = new List(); for(int i = 0; i < decl.getNumParameter(); i++) { ParameterDeclaration param = decl.getParameter(i); if (param instanceof VariableArityParameterDeclaration) { parameterList.add( new VariableArityParameterDeclaration( new Modifiers(new List()), ((ArrayDecl) param.type()).componentType().createBoundAccess(), param.name() )); } else { parameterList.add( new ParameterDeclaration( param.type().createBoundAccess(), param.name() )); } } return parameterList; } /** * @apilevel internal */ protected int isCircular_visited = -1; /** * @apilevel internal */ protected boolean isCircular_computed = false; /** * @apilevel internal */ protected boolean isCircular_initialized = false; /** * @apilevel internal */ protected boolean isCircular_value; /** * @attribute syn * @aspect AnonymousClasses * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/AnonymousClasses.jrag:30 */ @SuppressWarnings({"unchecked", "cast"}) public boolean isCircular() { if(isCircular_computed) { return isCircular_value; } ASTNode$State state = state(); if (!isCircular_initialized) { isCircular_initialized = true; isCircular_value = true; } if (!state.IN_CIRCLE) { state.IN_CIRCLE = true; int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); do { isCircular_visited = state.CIRCLE_INDEX; state.CHANGE = false; boolean new_isCircular_value = isCircular_compute(); if (new_isCircular_value!=isCircular_value) state.CHANGE = true; isCircular_value = new_isCircular_value; state.CIRCLE_INDEX++; } while (state.CHANGE); if(isFinal && num == state().boundariesCrossed) { isCircular_computed = true; } else { state.RESET_CYCLE = true; isCircular_compute(); state.RESET_CYCLE = false; isCircular_computed = false; isCircular_initialized = false; } state.IN_CIRCLE = false; return isCircular_value; } if(isCircular_visited != state.CIRCLE_INDEX) { isCircular_visited = state.CIRCLE_INDEX; if (state.RESET_CYCLE) { isCircular_computed = false; isCircular_initialized = false; isCircular_visited = -1; return isCircular_value; } boolean new_isCircular_value = isCircular_compute(); if (new_isCircular_value!=isCircular_value) state.CHANGE = true; isCircular_value = new_isCircular_value; return isCircular_value; } return isCircular_value; } /** * @apilevel internal */ private boolean isCircular_compute() { return false; } /** * @apilevel internal */ protected boolean getSuperClassAccessOpt_computed = false; /** * @apilevel internal */ protected Opt getSuperClassAccessOpt_value; /** * @attribute syn nta * @aspect AnonymousClasses * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/AnonymousClasses.jrag:32 */ @SuppressWarnings({"unchecked", "cast"}) public Opt getSuperClassAccessOpt() { if(getSuperClassAccessOpt_computed) { return (Opt) getChild(getSuperClassAccessOptChildPosition()); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); getSuperClassAccessOpt_value = getSuperClassAccessOpt_compute(); setSuperClassAccessOpt(getSuperClassAccessOpt_value); if(isFinal && num == state().boundariesCrossed) getSuperClassAccessOpt_computed = true; return (Opt) getChild(getSuperClassAccessOptChildPosition()); } /** * @apilevel internal */ private Opt getSuperClassAccessOpt_compute() { if(superType().isInterfaceDecl()) return new Opt(typeObject().createQualifiedAccess()); else return new Opt(superType().createBoundAccess()); } /** * @apilevel internal */ protected boolean getImplementsList_computed = false; /** * @apilevel internal */ protected List getImplementsList_value; /** * @attribute syn nta * @aspect AnonymousClasses * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/AnonymousClasses.jrag:38 */ @SuppressWarnings({"unchecked", "cast"}) public List getImplementsList() { if(getImplementsList_computed) { return (List) getChild(getImplementsListChildPosition()); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); getImplementsList_value = getImplementsList_compute(); setImplementsList(getImplementsList_value); if(isFinal && num == state().boundariesCrossed) getImplementsList_computed = true; return (List) getChild(getImplementsListChildPosition()); } /** * @apilevel internal */ private List getImplementsList_compute() { if(superType().isInterfaceDecl()) return new List().add(superType().createBoundAccess()); else return new List(); } /** * @attribute inh * @aspect AnonymousClasses * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/AnonymousClasses.jrag:14 */ @SuppressWarnings({"unchecked", "cast"}) public TypeDecl superType() { ASTNode$State state = state(); TypeDecl superType_value = getParent().Define_TypeDecl_superType(this, null); return superType_value; } /** * @attribute inh * @aspect AnonymousClasses * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/AnonymousClasses.jrag:18 */ @SuppressWarnings({"unchecked", "cast"}) public ConstructorDecl constructorDecl() { ASTNode$State state = state(); ConstructorDecl constructorDecl_value = getParent().Define_ConstructorDecl_constructorDecl(this, null); return constructorDecl_value; } /** * @attribute inh * @aspect AnonymousClasses * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/AnonymousClasses.jrag:175 */ @SuppressWarnings({"unchecked", "cast"}) public TypeDecl typeNullPointerException() { ASTNode$State state = state(); TypeDecl typeNullPointerException_value = getParent().Define_TypeDecl_typeNullPointerException(this, null); return typeNullPointerException_value; } /** * @apilevel internal */ public ASTNode rewriteTo() { // Declared in /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/AnonymousClasses.jrag at line 70 if(noConstructor()) { state().duringAnonymousClasses++; ASTNode result = rewriteRule0(); state().duringAnonymousClasses--; return result; } return super.rewriteTo(); } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/AnonymousClasses.jrag:70 * @apilevel internal */ private AnonymousDecl rewriteRule0() { { setModifiers(new Modifiers(new List().add(new Modifier("final")))); ConstructorDecl decl = constructorDecl(); Modifiers modifiers = (Modifiers)decl.getModifiers().fullCopy(); String anonName = "Anonymous" + nextAnonymousIndex(); ConstructorDecl constructor = new ConstructorDecl(modifiers, anonName, constructorParameterList(decl), new List(), new Opt(), new Block()); constructor.setDefaultConstructor(); addBodyDecl(constructor); setID(anonName); List argList = new List(); for(int i = 0; i < constructor.getNumParameter(); i++) { argList.add(new VarAccess(constructor.getParameter(i).name())); } constructor.setConstructorInvocation( new ExprStmt( new SuperConstructorAccess("super", argList) ) ); HashSet set = new HashSet(); for(int i = 0; i < getNumBodyDecl(); i++) { if(getBodyDecl(i) instanceof InstanceInitializer) { InstanceInitializer init = (InstanceInitializer)getBodyDecl(i); set.addAll(init.exceptions()); } else if(getBodyDecl(i) instanceof FieldDeclaration) { FieldDeclaration f = (FieldDeclaration)getBodyDecl(i); if(f.isInstanceVariable()) { set.addAll(f.exceptions()); } } } List exceptionList = new List(); for(Iterator iter = set.iterator(); iter.hasNext(); ) { TypeDecl exceptionType = (TypeDecl)iter.next(); if(exceptionType.isNull()) exceptionType = typeNullPointerException(); exceptionList.add(exceptionType.createQualifiedAccess()); } constructor.setExceptionList(exceptionList); return this; /* setModifiers(new Modifiers(new List().add(new Modifier("final")))); ConstructorDecl constructor = new ConstructorDecl(); addBodyDecl(constructor); constructor.setModifiers((Modifiers)constructorDecl().getModifiers().fullCopy()); String name = "Anonymous" + nextAnonymousIndex(); setID(name); constructor.setID(name); List parameterList = new List(); for(int i = 0; i < constructorDecl().getNumParameter(); i++) { parameterList.add( new ParameterDeclaration( constructorDecl().getParameter(i).type().createBoundAccess(), constructorDecl().getParameter(i).name() ) ); } constructor.setParameterList(parameterList); List argList = new List(); for(int i = 0; i < constructor.getNumParameter(); i++) argList.add(new VarAccess(constructor.getParameter(i).name())); constructor.setConstructorInvocation( new ExprStmt( new SuperConstructorAccess("super", argList) ) ); constructor.setBlock(new Block()); HashSet set = new HashSet(); for(int i = 0; i < getNumBodyDecl(); i++) { if(getBodyDecl(i) instanceof InstanceInitializer) { InstanceInitializer init = (InstanceInitializer)getBodyDecl(i); set.addAll(init.exceptions()); } else if(getBodyDecl(i) instanceof FieldDeclaration) { FieldDeclaration f = (FieldDeclaration)getBodyDecl(i); if(f.isInstanceVariable()) { set.addAll(f.exceptions()); } } } List exceptionList = new List(); for(Iterator iter = set.iterator(); iter.hasNext(); ) { TypeDecl exceptionType = (TypeDecl)iter.next(); if(exceptionType.isNull()) exceptionType = typeNullPointerException(); exceptionList.add(exceptionType.createQualifiedAccess()); } constructor.setExceptionList(exceptionList); return this; */ } } }
26,032
29.30617
323
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/ArithmeticExpr.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production ArithmeticExpr : {@link Binary}; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:152 */ public abstract class ArithmeticExpr extends Binary implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public ArithmeticExpr clone() throws CloneNotSupportedException { ArithmeticExpr node = (ArithmeticExpr)super.clone(); node.in$Circle(false); node.is$Final(false); return node; } /** * @ast method * */ public ArithmeticExpr() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[2]; } /** * @ast method * */ public ArithmeticExpr(Expr p0, Expr p1) { setChild(p0, 0); setChild(p1, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the LeftOperand child. * @param node The new node to replace the LeftOperand child. * @apilevel high-level * @ast method * */ public void setLeftOperand(Expr node) { setChild(node, 0); } /** * Retrieves the LeftOperand child. * @return The current node used as the LeftOperand child. * @apilevel high-level * @ast method * */ public Expr getLeftOperand() { return (Expr)getChild(0); } /** * Retrieves the LeftOperand child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the LeftOperand child. * @apilevel low-level * @ast method * */ public Expr getLeftOperandNoTransform() { return (Expr)getChildNoTransform(0); } /** * Replaces the RightOperand child. * @param node The new node to replace the RightOperand child. * @apilevel high-level * @ast method * */ public void setRightOperand(Expr node) { setChild(node, 1); } /** * Retrieves the RightOperand child. * @return The current node used as the RightOperand child. * @apilevel high-level * @ast method * */ public Expr getRightOperand() { return (Expr)getChild(1); } /** * Retrieves the RightOperand child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the RightOperand child. * @apilevel low-level * @ast method * */ public Expr getRightOperandNoTransform() { return (Expr)getChildNoTransform(1); } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
3,638
21.462963
96
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/ArrayAccess.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production ArrayAccess : {@link Access} ::= <span class="component">{@link Expr}</span>; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:31 */ public class ArrayAccess extends Access implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); type_computed = false; type_value = null; } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public ArrayAccess clone() throws CloneNotSupportedException { ArrayAccess node = (ArrayAccess)super.clone(); node.type_computed = false; node.type_value = null; node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public ArrayAccess copy() { try { ArrayAccess node = (ArrayAccess) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public ArrayAccess fullCopy() { ArrayAccess tree = (ArrayAccess) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:514 */ public void toString(StringBuffer s) { s.append("["); getExpr().toString(s); s.append("]"); } /** * @ast method * @aspect TypeCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:137 */ public void typeCheck() { if(isQualified() && !qualifier().type().isArrayDecl() && !qualifier().type().isUnknown()) error("the type " + qualifier().type().name() + " of the indexed element is not an array"); if(!getExpr().type().unaryNumericPromotion().isInt() || !getExpr().type().isIntegralType()) error("array index must be int after unary numeric promotion which " + getExpr().type().typeName() + " is not"); } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:410 */ public soot.Value eval(Body b) { soot.Value arrayRef = b.newTemp(prevExpr().eval(b)); soot.Value arrayIndex = b.newTemp(getExpr().eval(b)); return b.newArrayRef( asLocal(b, arrayRef), asImmediate(b, arrayIndex), this ); } /** * @ast method * */ public ArrayAccess() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[1]; } /** * @ast method * */ public ArrayAccess(Expr p0) { setChild(p0, 0); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 1; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the Expr child. * @param node The new node to replace the Expr child. * @apilevel high-level * @ast method * */ public void setExpr(Expr node) { setChild(node, 0); } /** * Retrieves the Expr child. * @return The current node used as the Expr child. * @apilevel high-level * @ast method * */ public Expr getExpr() { return (Expr)getChild(0); } /** * Retrieves the Expr child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Expr child. * @apilevel low-level * @ast method * */ public Expr getExprNoTransform() { return (Expr)getChildNoTransform(0); } /** * @attribute syn * @aspect DA * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:235 */ public boolean isDAafter(Variable v) { ASTNode$State state = state(); try { return getExpr().isDAafter(v); } finally { } } /** * @attribute syn * @aspect DU * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:694 */ public boolean isDUafter(Variable v) { ASTNode$State state = state(); try { return getExpr().isDUafter(v); } finally { } } /** * @attribute syn * @aspect AccessTypes * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:41 */ public boolean isArrayAccess() { ASTNode$State state = state(); try { return true; } finally { } } /** * @attribute syn * @aspect SyntacticClassification * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/SyntacticClassification.jrag:56 */ public NameType predNameType() { ASTNode$State state = state(); try { return NameType.EXPRESSION_NAME; } finally { } } /** * @apilevel internal */ protected boolean type_computed = false; /** * @apilevel internal */ protected TypeDecl type_value; /** * @attribute syn * @aspect TypeAnalysis * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:280 */ @SuppressWarnings({"unchecked", "cast"}) public TypeDecl type() { if(type_computed) { return type_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); type_value = type_compute(); if(isFinal && num == state().boundariesCrossed) type_computed = true; return type_value; } /** * @apilevel internal */ private TypeDecl type_compute() { return isQualified() ? qualifier().type().componentType() : unknownType(); } /** * @attribute syn * @aspect TypeCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:15 */ public boolean isVariable() { ASTNode$State state = state(); try { return true; } finally { } } /** * @attribute inh * @aspect TypeAnalysis * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:281 */ @SuppressWarnings({"unchecked", "cast"}) public TypeDecl unknownType() { ASTNode$State state = state(); TypeDecl unknownType_value = getParent().Define_TypeDecl_unknownType(this, null); return unknownType_value; } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:34 * @apilevel internal */ public boolean Define_boolean_isDest(ASTNode caller, ASTNode child) { if(caller == getExprNoTransform()) { return false; } else { return getParent().Define_boolean_isDest(this, caller); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:35 * @apilevel internal */ public boolean Define_boolean_isSource(ASTNode caller, ASTNode child) { if(caller == getExprNoTransform()) { return true; } else { return getParent().Define_boolean_isSource(this, caller); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupMethod.jrag:30 * @apilevel internal */ public Collection Define_Collection_lookupMethod(ASTNode caller, ASTNode child, String name) { if(caller == getExprNoTransform()) { return unqualifiedScope().lookupMethod(name); } else { return getParent().Define_Collection_lookupMethod(this, caller, name); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:90 * @apilevel internal */ public boolean Define_boolean_hasPackage(ASTNode caller, ASTNode child, String packageName) { if(caller == getExprNoTransform()) { return unqualifiedScope().hasPackage(packageName); } else { return getParent().Define_boolean_hasPackage(this, caller, packageName); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:255 * @apilevel internal */ public SimpleSet Define_SimpleSet_lookupType(ASTNode caller, ASTNode child, String name) { if(caller == getExprNoTransform()) { return unqualifiedScope().lookupType(name); } else { return getParent().Define_SimpleSet_lookupType(this, caller, name); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupVariable.jrag:135 * @apilevel internal */ public SimpleSet Define_SimpleSet_lookupVariable(ASTNode caller, ASTNode child, String name) { if(caller == getExprNoTransform()) { return unqualifiedScope().lookupVariable(name); } else { return getParent().Define_SimpleSet_lookupVariable(this, caller, name); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/SyntacticClassification.jrag:122 * @apilevel internal */ public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) { if(caller == getExprNoTransform()) { return NameType.EXPRESSION_NAME; } else { return getParent().Define_NameType_nameType(this, caller); } } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
10,841
27.758621
118
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/ArrayCreationExpr.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production ArrayCreationExpr : {@link PrimaryExpr} ::= <span class="component">TypeAccess:{@link Access}</span> <span class="component">[{@link ArrayInit}]</span>; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:133 */ public class ArrayCreationExpr extends PrimaryExpr implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); type_computed = false; type_value = null; numArrays_computed = false; } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public ArrayCreationExpr clone() throws CloneNotSupportedException { ArrayCreationExpr node = (ArrayCreationExpr)super.clone(); node.type_computed = false; node.type_value = null; node.numArrays_computed = false; node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public ArrayCreationExpr copy() { try { ArrayCreationExpr node = (ArrayCreationExpr) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public ArrayCreationExpr fullCopy() { ArrayCreationExpr tree = (ArrayCreationExpr) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:356 */ public void toString(StringBuffer s) { s.append("new "); getTypeAccess().toString(s); if(hasArrayInit()) { getArrayInit().toString(s); } } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:633 */ public soot.Value eval(Body b) { if(hasArrayInit()) { return getArrayInit().eval(b); } else { ArrayList list = new ArrayList(); getTypeAccess().addArraySize(b, list); if(numArrays() == 1) { soot.Value size = (soot.Value)list.get(0); return b.newNewArrayExpr( type().componentType().getSootType(), asImmediate(b, size), this ); } else { return b.newNewMultiArrayExpr( (soot.ArrayType)type().getSootType(), list, this ); } } } /** * @ast method * */ public ArrayCreationExpr() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[2]; setChild(new Opt(), 1); } /** * @ast method * */ public ArrayCreationExpr(Access p0, Opt<ArrayInit> p1) { setChild(p0, 0); setChild(p1, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the TypeAccess child. * @param node The new node to replace the TypeAccess child. * @apilevel high-level * @ast method * */ public void setTypeAccess(Access node) { setChild(node, 0); } /** * Retrieves the TypeAccess child. * @return The current node used as the TypeAccess child. * @apilevel high-level * @ast method * */ public Access getTypeAccess() { return (Access)getChild(0); } /** * Retrieves the TypeAccess child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the TypeAccess child. * @apilevel low-level * @ast method * */ public Access getTypeAccessNoTransform() { return (Access)getChildNoTransform(0); } /** * Replaces the optional node for the ArrayInit child. This is the {@code Opt} node containing the child ArrayInit, not the actual child! * @param opt The new node to be used as the optional node for the ArrayInit child. * @apilevel low-level * @ast method * */ public void setArrayInitOpt(Opt<ArrayInit> opt) { setChild(opt, 1); } /** * Check whether the optional ArrayInit child exists. * @return {@code true} if the optional ArrayInit child exists, {@code false} if it does not. * @apilevel high-level * @ast method * */ public boolean hasArrayInit() { return getArrayInitOpt().getNumChild() != 0; } /** * Retrieves the (optional) ArrayInit child. * @return The ArrayInit child, if it exists. Returns {@code null} otherwise. * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public ArrayInit getArrayInit() { return (ArrayInit)getArrayInitOpt().getChild(0); } /** * Replaces the (optional) ArrayInit child. * @param node The new node to be used as the ArrayInit child. * @apilevel high-level * @ast method * */ public void setArrayInit(ArrayInit node) { getArrayInitOpt().setChild(node, 0); } /** * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public Opt<ArrayInit> getArrayInitOpt() { return (Opt<ArrayInit>)getChild(1); } /** * Retrieves the optional node for child ArrayInit. This is the {@code Opt} node containing the child ArrayInit, not the actual child! * <p><em>This method does not invoke AST transformations.</em></p> * @return The optional node for child ArrayInit. * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public Opt<ArrayInit> getArrayInitOptNoTransform() { return (Opt<ArrayInit>)getChildNoTransform(1); } /** * @attribute syn * @aspect DA * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:432 */ public boolean isDAafterCreation(Variable v) { ASTNode$State state = state(); try { return getTypeAccess().isDAafter(v); } finally { } } /** * @attribute syn * @aspect DA * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:235 */ public boolean isDAafter(Variable v) { ASTNode$State state = state(); try { return hasArrayInit() ? getArrayInit().isDAafter(v) : isDAafterCreation(v); } finally { } } /** * @attribute syn * @aspect DU * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:860 */ public boolean isDUafterCreation(Variable v) { ASTNode$State state = state(); try { return getTypeAccess().isDUafter(v); } finally { } } /** * @attribute syn * @aspect DU * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:694 */ public boolean isDUafter(Variable v) { ASTNode$State state = state(); try { return hasArrayInit() ? getArrayInit().isDUafter(v) : isDUafterCreation(v); } finally { } } /** * @apilevel internal */ protected boolean type_computed = false; /** * @apilevel internal */ protected TypeDecl type_value; /** * @attribute syn * @aspect TypeAnalysis * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:312 */ @SuppressWarnings({"unchecked", "cast"}) public TypeDecl type() { if(type_computed) { return type_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); type_value = type_compute(); if(isFinal && num == state().boundariesCrossed) type_computed = true; return type_value; } /** * @apilevel internal */ private TypeDecl type_compute() { return getTypeAccess().type(); } /** * @apilevel internal */ protected boolean numArrays_computed = false; /** * @apilevel internal */ protected int numArrays_value; /** * @attribute syn * @aspect InnerClasses * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/InnerClasses.jrag:72 */ @SuppressWarnings({"unchecked", "cast"}) public int numArrays() { if(numArrays_computed) { return numArrays_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); numArrays_value = numArrays_compute(); if(isFinal && num == state().boundariesCrossed) numArrays_computed = true; return numArrays_value; } /** * @apilevel internal */ private int numArrays_compute() { int i = type().dimension(); Access a = getTypeAccess(); while(a instanceof ArrayTypeAccess && !(a instanceof ArrayTypeWithSizeAccess)) { i--; a = ((ArrayTypeAccess)a).getAccess(); } return i; } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:434 * @apilevel internal */ public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v) { if(caller == getArrayInitOptNoTransform()) { return isDAafterCreation(v); } else { return getParent().Define_boolean_isDAbefore(this, caller, v); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:863 * @apilevel internal */ public boolean Define_boolean_isDUbefore(ASTNode caller, ASTNode child, Variable v) { if(caller == getArrayInitOptNoTransform()) { return isDUafterCreation(v); } else { return getParent().Define_boolean_isDUbefore(this, caller, v); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/SyntacticClassification.jrag:87 * @apilevel internal */ public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) { if(caller == getTypeAccessNoTransform()) { return NameType.TYPE_NAME; } else { return getParent().Define_NameType_nameType(this, caller); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:262 * @apilevel internal */ public TypeDecl Define_TypeDecl_declType(ASTNode caller, ASTNode child) { if(caller == getArrayInitOptNoTransform()) { return type(); } else { return getParent().Define_TypeDecl_declType(this, caller); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/InnerClasses.jrag:66 * @apilevel internal */ public TypeDecl Define_TypeDecl_expectedType(ASTNode caller, ASTNode child) { if(caller == getArrayInitOptNoTransform()) { return type().componentType(); } else { return getParent().Define_TypeDecl_expectedType(this, caller); } } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
12,438
27.142534
167
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/ArrayDecl.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production ArrayDecl : {@link ClassDecl}; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:68 */ public class ArrayDecl extends ClassDecl implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); accessibleFrom_TypeDecl_values = null; dimension_computed = false; elementType_computed = false; elementType_value = null; fullName_computed = false; fullName_value = null; typeName_computed = false; typeName_value = null; castingConversionTo_TypeDecl_values = null; instanceOf_TypeDecl_values = null; involvesTypeParameters_visited = -1; involvesTypeParameters_computed = false; involvesTypeParameters_initialized = false; erasure_computed = false; erasure_value = null; usesTypeVariable_visited = -1; usesTypeVariable_computed = false; usesTypeVariable_initialized = false; subtype_TypeDecl_values = null; jvmName_computed = false; jvmName_value = null; getSootClassDecl_computed = false; getSootClassDecl_value = null; getSootType_computed = false; getSootType_value = null; } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public ArrayDecl clone() throws CloneNotSupportedException { ArrayDecl node = (ArrayDecl)super.clone(); node.accessibleFrom_TypeDecl_values = null; node.dimension_computed = false; node.elementType_computed = false; node.elementType_value = null; node.fullName_computed = false; node.fullName_value = null; node.typeName_computed = false; node.typeName_value = null; node.castingConversionTo_TypeDecl_values = null; node.instanceOf_TypeDecl_values = null; node.involvesTypeParameters_visited = -1; node.involvesTypeParameters_computed = false; node.involvesTypeParameters_initialized = false; node.erasure_computed = false; node.erasure_value = null; node.usesTypeVariable_visited = -1; node.usesTypeVariable_computed = false; node.usesTypeVariable_initialized = false; node.subtype_TypeDecl_values = null; node.jvmName_computed = false; node.jvmName_value = null; node.getSootClassDecl_computed = false; node.getSootClassDecl_value = null; node.getSootType_computed = false; node.getSootType_value = null; node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public ArrayDecl copy() { try { ArrayDecl node = (ArrayDecl) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public ArrayDecl fullCopy() { ArrayDecl tree = (ArrayDecl) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect Arrays * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Arrays.jrag:59 */ public Access createQualifiedAccess() { return new ArrayTypeAccess(componentType().createQualifiedAccess()); } /** * @ast method * @aspect LookupParTypeDecl * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:880 */ public Access substitute(Parameterization parTypeDecl) { return new ArrayTypeAccess(componentType().substitute(parTypeDecl)); } /** * @ast method * @aspect LookupParTypeDecl * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:916 */ public Access substituteReturnType(Parameterization parTypeDecl) { return new ArrayTypeAccess(componentType().substituteReturnType(parTypeDecl)); } /** * @ast method * */ public ArrayDecl() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[4]; setChild(new Opt(), 1); setChild(new List(), 2); setChild(new List(), 3); } /** * @ast method * */ public ArrayDecl(Modifiers p0, String p1, Opt<Access> p2, List<Access> p3, List<BodyDecl> p4) { setChild(p0, 0); setID(p1); setChild(p2, 1); setChild(p3, 2); setChild(p4, 3); } /** * @ast method * */ public ArrayDecl(Modifiers p0, beaver.Symbol p1, Opt<Access> p2, List<Access> p3, List<BodyDecl> p4) { setChild(p0, 0); setID(p1); setChild(p2, 1); setChild(p3, 2); setChild(p4, 3); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 4; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the Modifiers child. * @param node The new node to replace the Modifiers child. * @apilevel high-level * @ast method * */ public void setModifiers(Modifiers node) { setChild(node, 0); } /** * Retrieves the Modifiers child. * @return The current node used as the Modifiers child. * @apilevel high-level * @ast method * */ public Modifiers getModifiers() { return (Modifiers)getChild(0); } /** * Retrieves the Modifiers child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Modifiers child. * @apilevel low-level * @ast method * */ public Modifiers getModifiersNoTransform() { return (Modifiers)getChildNoTransform(0); } /** * Replaces the lexeme ID. * @param value The new value for the lexeme ID. * @apilevel high-level * @ast method * */ public void setID(String value) { tokenString_ID = value; } /** * JastAdd-internal setter for lexeme ID using the Beaver parser. * @apilevel internal * @ast method * */ public void setID(beaver.Symbol symbol) { if(symbol.value != null && !(symbol.value instanceof String)) throw new UnsupportedOperationException("setID is only valid for String lexemes"); tokenString_ID = (String)symbol.value; IDstart = symbol.getStart(); IDend = symbol.getEnd(); } /** * Retrieves the value for the lexeme ID. * @return The value for the lexeme ID. * @apilevel high-level * @ast method * */ public String getID() { return tokenString_ID != null ? tokenString_ID : ""; } /** * Replaces the optional node for the SuperClassAccess child. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child! * @param opt The new node to be used as the optional node for the SuperClassAccess child. * @apilevel low-level * @ast method * */ public void setSuperClassAccessOpt(Opt<Access> opt) { setChild(opt, 1); } /** * Check whether the optional SuperClassAccess child exists. * @return {@code true} if the optional SuperClassAccess child exists, {@code false} if it does not. * @apilevel high-level * @ast method * */ public boolean hasSuperClassAccess() { return getSuperClassAccessOpt().getNumChild() != 0; } /** * Retrieves the (optional) SuperClassAccess child. * @return The SuperClassAccess child, if it exists. Returns {@code null} otherwise. * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public Access getSuperClassAccess() { return (Access)getSuperClassAccessOpt().getChild(0); } /** * Replaces the (optional) SuperClassAccess child. * @param node The new node to be used as the SuperClassAccess child. * @apilevel high-level * @ast method * */ public void setSuperClassAccess(Access node) { getSuperClassAccessOpt().setChild(node, 0); } /** * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public Opt<Access> getSuperClassAccessOpt() { return (Opt<Access>)getChild(1); } /** * Retrieves the optional node for child SuperClassAccess. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child! * <p><em>This method does not invoke AST transformations.</em></p> * @return The optional node for child SuperClassAccess. * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public Opt<Access> getSuperClassAccessOptNoTransform() { return (Opt<Access>)getChildNoTransform(1); } /** * Replaces the Implements list. * @param list The new list node to be used as the Implements list. * @apilevel high-level * @ast method * */ public void setImplementsList(List<Access> list) { setChild(list, 2); } /** * Retrieves the number of children in the Implements list. * @return Number of children in the Implements list. * @apilevel high-level * @ast method * */ public int getNumImplements() { return getImplementsList().getNumChild(); } /** * Retrieves the number of children in the Implements list. * Calling this method will not trigger rewrites.. * @return Number of children in the Implements list. * @apilevel low-level * @ast method * */ public int getNumImplementsNoTransform() { return getImplementsListNoTransform().getNumChildNoTransform(); } /** * Retrieves the element at index {@code i} in the Implements list.. * @param i Index of the element to return. * @return The element at position {@code i} in the Implements list. * @apilevel high-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public Access getImplements(int i) { return (Access)getImplementsList().getChild(i); } /** * Append an element to the Implements list. * @param node The element to append to the Implements list. * @apilevel high-level * @ast method * */ public void addImplements(Access node) { List<Access> list = (parent == null || state == null) ? getImplementsListNoTransform() : getImplementsList(); list.addChild(node); } /** * @apilevel low-level * @ast method * */ public void addImplementsNoTransform(Access node) { List<Access> list = getImplementsListNoTransform(); list.addChild(node); } /** * Replaces the Implements list element at index {@code i} with the new node {@code node}. * @param node The new node to replace the old list element. * @param i The list index of the node to be replaced. * @apilevel high-level * @ast method * */ public void setImplements(Access node, int i) { List<Access> list = getImplementsList(); list.setChild(node, i); } /** * Retrieves the Implements list. * @return The node representing the Implements list. * @apilevel high-level * @ast method * */ public List<Access> getImplementss() { return getImplementsList(); } /** * Retrieves the Implements list. * <p><em>This method does not invoke AST transformations.</em></p> * @return The node representing the Implements list. * @apilevel low-level * @ast method * */ public List<Access> getImplementssNoTransform() { return getImplementsListNoTransform(); } /** * Retrieves the Implements list. * @return The node representing the Implements list. * @apilevel high-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public List<Access> getImplementsList() { List<Access> list = (List<Access>)getChild(2); list.getNumChild(); return list; } /** * Retrieves the Implements list. * <p><em>This method does not invoke AST transformations.</em></p> * @return The node representing the Implements list. * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public List<Access> getImplementsListNoTransform() { return (List<Access>)getChildNoTransform(2); } /** * Replaces the BodyDecl list. * @param list The new list node to be used as the BodyDecl list. * @apilevel high-level * @ast method * */ public void setBodyDeclList(List<BodyDecl> list) { setChild(list, 3); } /** * Retrieves the number of children in the BodyDecl list. * @return Number of children in the BodyDecl list. * @apilevel high-level * @ast method * */ public int getNumBodyDecl() { return getBodyDeclList().getNumChild(); } /** * Retrieves the number of children in the BodyDecl list. * Calling this method will not trigger rewrites.. * @return Number of children in the BodyDecl list. * @apilevel low-level * @ast method * */ public int getNumBodyDeclNoTransform() { return getBodyDeclListNoTransform().getNumChildNoTransform(); } /** * Retrieves the element at index {@code i} in the BodyDecl list.. * @param i Index of the element to return. * @return The element at position {@code i} in the BodyDecl list. * @apilevel high-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public BodyDecl getBodyDecl(int i) { return (BodyDecl)getBodyDeclList().getChild(i); } /** * Append an element to the BodyDecl list. * @param node The element to append to the BodyDecl list. * @apilevel high-level * @ast method * */ public void addBodyDecl(BodyDecl node) { List<BodyDecl> list = (parent == null || state == null) ? getBodyDeclListNoTransform() : getBodyDeclList(); list.addChild(node); } /** * @apilevel low-level * @ast method * */ public void addBodyDeclNoTransform(BodyDecl node) { List<BodyDecl> list = getBodyDeclListNoTransform(); list.addChild(node); } /** * Replaces the BodyDecl list element at index {@code i} with the new node {@code node}. * @param node The new node to replace the old list element. * @param i The list index of the node to be replaced. * @apilevel high-level * @ast method * */ public void setBodyDecl(BodyDecl node, int i) { List<BodyDecl> list = getBodyDeclList(); list.setChild(node, i); } /** * Retrieves the BodyDecl list. * @return The node representing the BodyDecl list. * @apilevel high-level * @ast method * */ public List<BodyDecl> getBodyDecls() { return getBodyDeclList(); } /** * Retrieves the BodyDecl list. * <p><em>This method does not invoke AST transformations.</em></p> * @return The node representing the BodyDecl list. * @apilevel low-level * @ast method * */ public List<BodyDecl> getBodyDeclsNoTransform() { return getBodyDeclListNoTransform(); } /** * Retrieves the BodyDecl list. * @return The node representing the BodyDecl list. * @apilevel high-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public List<BodyDecl> getBodyDeclList() { List<BodyDecl> list = (List<BodyDecl>)getChild(3); list.getNumChild(); return list; } /** * Retrieves the BodyDecl list. * <p><em>This method does not invoke AST transformations.</em></p> * @return The node representing the BodyDecl list. * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public List<BodyDecl> getBodyDeclListNoTransform() { return (List<BodyDecl>)getChildNoTransform(3); } /** * @ast method * @aspect TypeConversion * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:120 */ private boolean refined_TypeConversion_ArrayDecl_castingConversionTo_TypeDecl(TypeDecl type) { if(type.isArrayDecl()) { TypeDecl SC = componentType(); TypeDecl TC = type.componentType(); if(SC.isPrimitiveType() && TC.isPrimitiveType() && SC == TC) return true; if(SC.isReferenceType() && TC.isReferenceType()) { return SC.castingConversionTo(TC); } return false; } else if(type.isClassDecl()) { return type.isObject(); } else if(type.isInterfaceDecl()) { return type == typeSerializable() || type == typeCloneable(); } else return super.castingConversionTo(type); } protected java.util.Map accessibleFrom_TypeDecl_values; /** * @attribute syn * @aspect AccessControl * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/AccessControl.jrag:13 */ @SuppressWarnings({"unchecked", "cast"}) public boolean accessibleFrom(TypeDecl type) { Object _parameters = type; if(accessibleFrom_TypeDecl_values == null) accessibleFrom_TypeDecl_values = new java.util.HashMap(4); if(accessibleFrom_TypeDecl_values.containsKey(_parameters)) { return ((Boolean)accessibleFrom_TypeDecl_values.get(_parameters)).booleanValue(); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean accessibleFrom_TypeDecl_value = accessibleFrom_compute(type); if(isFinal && num == state().boundariesCrossed) accessibleFrom_TypeDecl_values.put(_parameters, Boolean.valueOf(accessibleFrom_TypeDecl_value)); return accessibleFrom_TypeDecl_value; } /** * @apilevel internal */ private boolean accessibleFrom_compute(TypeDecl type) { return elementType().accessibleFrom(type); } /** * @apilevel internal */ protected boolean dimension_computed = false; /** * @apilevel internal */ protected int dimension_value; /** * @attribute syn * @aspect Arrays * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Arrays.jrag:12 */ @SuppressWarnings({"unchecked", "cast"}) public int dimension() { if(dimension_computed) { return dimension_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); dimension_value = dimension_compute(); if(isFinal && num == state().boundariesCrossed) dimension_computed = true; return dimension_value; } /** * @apilevel internal */ private int dimension_compute() { return componentType().dimension() + 1; } /** * @apilevel internal */ protected boolean elementType_computed = false; /** * @apilevel internal */ protected TypeDecl elementType_value; /** * @attribute syn * @aspect Arrays * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Arrays.jrag:16 */ @SuppressWarnings({"unchecked", "cast"}) public TypeDecl elementType() { if(elementType_computed) { return elementType_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); elementType_value = elementType_compute(); if(isFinal && num == state().boundariesCrossed) elementType_computed = true; return elementType_value; } /** * @apilevel internal */ private TypeDecl elementType_compute() { return componentType().elementType(); } /** * @attribute syn * @aspect TypeName * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/QualifiedNames.jrag:68 */ public String name() { ASTNode$State state = state(); try { return fullName(); } finally { } } /** * @apilevel internal */ protected boolean fullName_computed = false; /** * @apilevel internal */ protected String fullName_value; /** * @attribute syn * @aspect Arrays * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Arrays.jrag:54 */ @SuppressWarnings({"unchecked", "cast"}) public String fullName() { if(fullName_computed) { return fullName_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); fullName_value = fullName_compute(); if(isFinal && num == state().boundariesCrossed) fullName_computed = true; return fullName_value; } /** * @apilevel internal */ private String fullName_compute() { return getID(); } /** * @apilevel internal */ protected boolean typeName_computed = false; /** * @apilevel internal */ protected String typeName_value; /** * @attribute syn * @aspect TypeName * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/QualifiedNames.jrag:87 */ @SuppressWarnings({"unchecked", "cast"}) public String typeName() { if(typeName_computed) { return typeName_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); typeName_value = typeName_compute(); if(isFinal && num == state().boundariesCrossed) typeName_computed = true; return typeName_value; } /** * @apilevel internal */ private String typeName_compute() { return componentType().typeName() + "[]"; } protected java.util.Map castingConversionTo_TypeDecl_values; /** * @attribute syn * @aspect Generics * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:96 */ @SuppressWarnings({"unchecked", "cast"}) public boolean castingConversionTo(TypeDecl type) { Object _parameters = type; if(castingConversionTo_TypeDecl_values == null) castingConversionTo_TypeDecl_values = new java.util.HashMap(4); if(castingConversionTo_TypeDecl_values.containsKey(_parameters)) { return ((Boolean)castingConversionTo_TypeDecl_values.get(_parameters)).booleanValue(); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean castingConversionTo_TypeDecl_value = castingConversionTo_compute(type); if(isFinal && num == state().boundariesCrossed) castingConversionTo_TypeDecl_values.put(_parameters, Boolean.valueOf(castingConversionTo_TypeDecl_value)); return castingConversionTo_TypeDecl_value; } /** * @apilevel internal */ private boolean castingConversionTo_compute(TypeDecl type) { TypeDecl S = this; TypeDecl T = type; if(T instanceof TypeVariable) { TypeVariable t = (TypeVariable)T; if(!type.isReferenceType()) return false; if(t.getNumTypeBound() == 0) return true; for(int i = 0; i < t.getNumTypeBound(); i++) { TypeDecl bound = t.getTypeBound(i).type(); if(bound.isObject() || bound == typeSerializable() || bound == typeCloneable()) return true; if(bound.isTypeVariable() && castingConversionTo(bound)) return true; if(bound.isArrayDecl() && castingConversionTo(bound)) return true; } return false; } else return refined_TypeConversion_ArrayDecl_castingConversionTo_TypeDecl(type); } /** * @attribute syn * @aspect TypeAnalysis * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:213 */ public boolean isArrayDecl() { ASTNode$State state = state(); try { return true; } finally { } } protected java.util.Map instanceOf_TypeDecl_values; /** * @attribute syn * @aspect GenericsSubtype * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:389 */ @SuppressWarnings({"unchecked", "cast"}) public boolean instanceOf(TypeDecl type) { Object _parameters = type; if(instanceOf_TypeDecl_values == null) instanceOf_TypeDecl_values = new java.util.HashMap(4); if(instanceOf_TypeDecl_values.containsKey(_parameters)) { return ((Boolean)instanceOf_TypeDecl_values.get(_parameters)).booleanValue(); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean instanceOf_TypeDecl_value = instanceOf_compute(type); if(isFinal && num == state().boundariesCrossed) instanceOf_TypeDecl_values.put(_parameters, Boolean.valueOf(instanceOf_TypeDecl_value)); return instanceOf_TypeDecl_value; } /** * @apilevel internal */ private boolean instanceOf_compute(TypeDecl type) { return subtype(type); } /** * @attribute syn * @aspect TypeWideningAndIdentity * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:453 */ public boolean isSupertypeOfArrayDecl(ArrayDecl type) { ASTNode$State state = state(); try { if(type.elementType().isPrimitive() && elementType().isPrimitive()) return type.dimension() == dimension() && type.elementType() == elementType(); return type.componentType().instanceOf(componentType()); } finally { } } /* It is a compile-time error if the return type of a method declared in an annotation type is any type other than one of the following: one of the primitive types, String, Class and any invocation of Class, an enum type (\ufffd8.9), an annotation type, or an array (\ufffd10) of one of the preceding types.* @attribute syn * @aspect Annotations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:121 */ public boolean isValidAnnotationMethodReturnType() { ASTNode$State state = state(); try { return componentType().isValidAnnotationMethodReturnType(); } finally { } } /* An element type T is commensurate with an element value V if and only if one of the following conditions is true: * T is an array type E[] and either: o V is an ElementValueArrayInitializer and each ElementValueInitializer (analogous to a variable initializer in an array initializer) in V is commensurate with E. Or o V is an ElementValue that is commensurate with T. * The type of V is assignment compatible (\ufffd5.2) with T and, furthermore: o If T is a primitive type or String, V is a constant expression (\ufffd15.28). o V is not null. o if T is Class, or an invocation of Class, and V is a class literal (\ufffd15.8.2). o If T is an enum type, and V is an enum constant. * @attribute syn * @aspect Annotations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:474 */ public boolean commensurateWith(ElementValue value) { ASTNode$State state = state(); try { return value.commensurateWithArrayDecl(this); } finally { } } /** * @apilevel internal */ protected int involvesTypeParameters_visited = -1; /** * @apilevel internal */ protected boolean involvesTypeParameters_computed = false; /** * @apilevel internal */ protected boolean involvesTypeParameters_initialized = false; /** * @apilevel internal */ protected boolean involvesTypeParameters_value; /** * @attribute syn * @aspect GenericMethodsInference * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericMethodsInference.jrag:17 */ @SuppressWarnings({"unchecked", "cast"}) public boolean involvesTypeParameters() { if(involvesTypeParameters_computed) { return involvesTypeParameters_value; } ASTNode$State state = state(); if (!involvesTypeParameters_initialized) { involvesTypeParameters_initialized = true; involvesTypeParameters_value = false; } if (!state.IN_CIRCLE) { state.IN_CIRCLE = true; int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); do { involvesTypeParameters_visited = state.CIRCLE_INDEX; state.CHANGE = false; boolean new_involvesTypeParameters_value = involvesTypeParameters_compute(); if (new_involvesTypeParameters_value!=involvesTypeParameters_value) state.CHANGE = true; involvesTypeParameters_value = new_involvesTypeParameters_value; state.CIRCLE_INDEX++; } while (state.CHANGE); if(isFinal && num == state().boundariesCrossed) { involvesTypeParameters_computed = true; } else { state.RESET_CYCLE = true; involvesTypeParameters_compute(); state.RESET_CYCLE = false; involvesTypeParameters_computed = false; involvesTypeParameters_initialized = false; } state.IN_CIRCLE = false; return involvesTypeParameters_value; } if(involvesTypeParameters_visited != state.CIRCLE_INDEX) { involvesTypeParameters_visited = state.CIRCLE_INDEX; if (state.RESET_CYCLE) { involvesTypeParameters_computed = false; involvesTypeParameters_initialized = false; involvesTypeParameters_visited = -1; return involvesTypeParameters_value; } boolean new_involvesTypeParameters_value = involvesTypeParameters_compute(); if (new_involvesTypeParameters_value!=involvesTypeParameters_value) state.CHANGE = true; involvesTypeParameters_value = new_involvesTypeParameters_value; return involvesTypeParameters_value; } return involvesTypeParameters_value; } /** * @apilevel internal */ private boolean involvesTypeParameters_compute() { return componentType().involvesTypeParameters(); } /** * @apilevel internal */ protected boolean erasure_computed = false; /** * @apilevel internal */ protected TypeDecl erasure_value; /** * @attribute syn * @aspect GenericsErasure * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:353 */ @SuppressWarnings({"unchecked", "cast"}) public TypeDecl erasure() { if(erasure_computed) { return erasure_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); erasure_value = erasure_compute(); if(isFinal && num == state().boundariesCrossed) erasure_computed = true; return erasure_value; } /** * @apilevel internal */ private TypeDecl erasure_compute() { return componentType().erasure().arrayType(); } /** * @apilevel internal */ protected int usesTypeVariable_visited = -1; /** * @apilevel internal */ protected boolean usesTypeVariable_computed = false; /** * @apilevel internal */ protected boolean usesTypeVariable_initialized = false; /** * @apilevel internal */ protected boolean usesTypeVariable_value; /** * @attribute syn * @aspect LookupParTypeDecl * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1082 */ @SuppressWarnings({"unchecked", "cast"}) public boolean usesTypeVariable() { if(usesTypeVariable_computed) { return usesTypeVariable_value; } ASTNode$State state = state(); if (!usesTypeVariable_initialized) { usesTypeVariable_initialized = true; usesTypeVariable_value = false; } if (!state.IN_CIRCLE) { state.IN_CIRCLE = true; int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); do { usesTypeVariable_visited = state.CIRCLE_INDEX; state.CHANGE = false; boolean new_usesTypeVariable_value = usesTypeVariable_compute(); if (new_usesTypeVariable_value!=usesTypeVariable_value) state.CHANGE = true; usesTypeVariable_value = new_usesTypeVariable_value; state.CIRCLE_INDEX++; } while (state.CHANGE); if(isFinal && num == state().boundariesCrossed) { usesTypeVariable_computed = true; } else { state.RESET_CYCLE = true; usesTypeVariable_compute(); state.RESET_CYCLE = false; usesTypeVariable_computed = false; usesTypeVariable_initialized = false; } state.IN_CIRCLE = false; return usesTypeVariable_value; } if(usesTypeVariable_visited != state.CIRCLE_INDEX) { usesTypeVariable_visited = state.CIRCLE_INDEX; if (state.RESET_CYCLE) { usesTypeVariable_computed = false; usesTypeVariable_initialized = false; usesTypeVariable_visited = -1; return usesTypeVariable_value; } boolean new_usesTypeVariable_value = usesTypeVariable_compute(); if (new_usesTypeVariable_value!=usesTypeVariable_value) state.CHANGE = true; usesTypeVariable_value = new_usesTypeVariable_value; return usesTypeVariable_value; } return usesTypeVariable_value; } /** * @apilevel internal */ private boolean usesTypeVariable_compute() { return elementType().usesTypeVariable(); } protected java.util.Map subtype_TypeDecl_values; /** * @attribute syn * @aspect GenericsSubtype * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:409 */ @SuppressWarnings({"unchecked", "cast"}) public boolean subtype(TypeDecl type) { Object _parameters = type; if(subtype_TypeDecl_values == null) subtype_TypeDecl_values = new java.util.HashMap(4); ASTNode$State.CircularValue _value; if(subtype_TypeDecl_values.containsKey(_parameters)) { Object _o = subtype_TypeDecl_values.get(_parameters); if(!(_o instanceof ASTNode$State.CircularValue)) { return ((Boolean)_o).booleanValue(); } else _value = (ASTNode$State.CircularValue)_o; } else { _value = new ASTNode$State.CircularValue(); subtype_TypeDecl_values.put(_parameters, _value); _value.value = Boolean.valueOf(true); } ASTNode$State state = state(); if (!state.IN_CIRCLE) { state.IN_CIRCLE = true; int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean new_subtype_TypeDecl_value; do { _value.visited = new Integer(state.CIRCLE_INDEX); state.CHANGE = false; new_subtype_TypeDecl_value = subtype_compute(type); if (new_subtype_TypeDecl_value!=((Boolean)_value.value).booleanValue()) { state.CHANGE = true; _value.value = Boolean.valueOf(new_subtype_TypeDecl_value); } state.CIRCLE_INDEX++; } while (state.CHANGE); if(isFinal && num == state().boundariesCrossed) { subtype_TypeDecl_values.put(_parameters, new_subtype_TypeDecl_value); } else { subtype_TypeDecl_values.remove(_parameters); state.RESET_CYCLE = true; subtype_compute(type); state.RESET_CYCLE = false; } state.IN_CIRCLE = false; return new_subtype_TypeDecl_value; } if(!new Integer(state.CIRCLE_INDEX).equals(_value.visited)) { _value.visited = new Integer(state.CIRCLE_INDEX); boolean new_subtype_TypeDecl_value = subtype_compute(type); if (state.RESET_CYCLE) { subtype_TypeDecl_values.remove(_parameters); } else if (new_subtype_TypeDecl_value!=((Boolean)_value.value).booleanValue()) { state.CHANGE = true; _value.value = new_subtype_TypeDecl_value; } return new_subtype_TypeDecl_value; } return ((Boolean)_value.value).booleanValue(); } /** * @apilevel internal */ private boolean subtype_compute(TypeDecl type) { return type.supertypeArrayDecl(this); } /** * @attribute syn * @aspect GenericsSubtype * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:450 */ public boolean supertypeArrayDecl(ArrayDecl type) { ASTNode$State state = state(); try { if(type.elementType().isPrimitive() && elementType().isPrimitive()) return type.dimension() == dimension() && type.elementType() == elementType(); return type.componentType().subtype(componentType()); } finally { } } /** * @apilevel internal */ protected boolean jvmName_computed = false; /** * @apilevel internal */ protected String jvmName_value; /** * @attribute syn * @aspect Java2Rewrites * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/Java2Rewrites.jrag:26 */ @SuppressWarnings({"unchecked", "cast"}) public String jvmName() { if(jvmName_computed) { return jvmName_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); jvmName_value = jvmName_compute(); if(isFinal && num == state().boundariesCrossed) jvmName_computed = true; return jvmName_value; } /** * @apilevel internal */ private String jvmName_compute() { StringBuffer dim = new StringBuffer(); for(int i = 0; i < dimension(); i++) dim.append("["); if(elementType().isReferenceType()) return dim.toString() + "L" + elementType().jvmName() + ";"; else return dim.toString() + elementType().jvmName(); } /** * @attribute syn * @aspect Java2Rewrites * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/Java2Rewrites.jrag:57 */ public String referenceClassFieldName() { ASTNode$State state = state(); try { return "array" + jvmName().replace('[', '$').replace('.', '$').replace(';', ' ').trim(); } finally { } } /** * @apilevel internal */ protected boolean getSootClassDecl_computed = false; /** * @apilevel internal */ protected SootClass getSootClassDecl_value; /** * @attribute syn * @aspect EmitJimple * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:44 */ @SuppressWarnings({"unchecked", "cast"}) public SootClass getSootClassDecl() { if(getSootClassDecl_computed) { return getSootClassDecl_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); getSootClassDecl_value = getSootClassDecl_compute(); if(isFinal && num == state().boundariesCrossed) getSootClassDecl_computed = true; return getSootClassDecl_value; } /** * @apilevel internal */ private SootClass getSootClassDecl_compute() { return typeObject().getSootClassDecl(); } /** * @apilevel internal */ protected boolean getSootType_computed = false; /** * @apilevel internal */ protected Type getSootType_value; /** * @attribute syn * @aspect EmitJimple * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:56 */ @SuppressWarnings({"unchecked", "cast"}) public Type getSootType() { if(getSootType_computed) { return getSootType_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); getSootType_value = getSootType_compute(); if(isFinal && num == state().boundariesCrossed) getSootType_computed = true; return getSootType_value; } /** * @apilevel internal */ private Type getSootType_compute() { return soot.ArrayType.v(elementType().getSootType(), dimension()); } /** * A type is reifiable if it either refers to a non-parameterized type, * is a raw type, is a parameterized type with only unbound wildcard * parameters or is an array type with a reifiable type parameter. * * @see "JLSv3 &sect;4.7" * @attribute syn * @aspect SafeVarargs * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/SafeVarargs.jrag:106 */ public boolean isReifiable() { ASTNode$State state = state(); try { return elementType().isReifiable(); } finally { } } /** * @attribute inh * @aspect TypeConversion * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:140 */ @SuppressWarnings({"unchecked", "cast"}) public TypeDecl typeSerializable() { ASTNode$State state = state(); TypeDecl typeSerializable_value = getParent().Define_TypeDecl_typeSerializable(this, null); return typeSerializable_value; } /** * @attribute inh * @aspect TypeConversion * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:141 */ @SuppressWarnings({"unchecked", "cast"}) public TypeDecl typeCloneable() { ASTNode$State state = state(); TypeDecl typeCloneable_value = getParent().Define_TypeDecl_typeCloneable(this, null); return typeCloneable_value; } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
41,776
30.915202
175
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/ArrayInit.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production ArrayInit : {@link Expr} ::= <span class="component">Init:{@link Expr}*</span>; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:93 */ public class ArrayInit extends Expr implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); computeDABefore_int_Variable_values = null; computeDUbefore_int_Variable_values = null; type_computed = false; type_value = null; declType_computed = false; declType_value = null; } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public ArrayInit clone() throws CloneNotSupportedException { ArrayInit node = (ArrayInit)super.clone(); node.computeDABefore_int_Variable_values = null; node.computeDUbefore_int_Variable_values = null; node.type_computed = false; node.type_value = null; node.declType_computed = false; node.declType_value = null; node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public ArrayInit copy() { try { ArrayInit node = (ArrayInit) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public ArrayInit fullCopy() { ArrayInit tree = (ArrayInit) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:221 */ public void toString(StringBuffer s) { s.append("{ "); if(getNumInit() > 0) { getInit(0).toString(s); for(int i = 1; i < getNumInit(); i++) { s.append(", "); getInit(i).toString(s); } } s.append(" } "); } /** * @ast method * @aspect TypeCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:144 */ public void typeCheck() { TypeDecl initializerType = declType().componentType(); if(initializerType.isUnknown()) error("the dimension of the initializer is larger than the expected dimension"); for(int i = 0; i < getNumInit(); i++) { Expr e = getInit(i); if(!e.type().assignConversionTo(initializerType, e)) error("the type " + e.type().name() + " of the initializer is not compatible with " + initializerType.name()); } } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:668 */ public soot.Value eval(Body b) { soot.Value size = IntType.emitConstant(getNumInit()); Local array = asLocal(b, b.newNewArrayExpr( type().componentType().getSootType(), asImmediate(b, size), this )); for(int i = 0; i < getNumInit(); i++) { Value rvalue = getInit(i).type().emitCastTo(b, // Assign conversion getInit(i), expectedType() ); Value index = IntType.emitConstant(i); Value lvalue = b.newArrayRef(array, index, getInit(i)); b.setLine(this); b.add(b.newAssignStmt(lvalue, asImmediate(b, rvalue), getInit(i))); } return array; } /** * @ast method * */ public ArrayInit() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[1]; setChild(new List(), 0); } /** * @ast method * */ public ArrayInit(List<Expr> p0) { setChild(p0, 0); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 1; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the Init list. * @param list The new list node to be used as the Init list. * @apilevel high-level * @ast method * */ public void setInitList(List<Expr> list) { setChild(list, 0); } /** * Retrieves the number of children in the Init list. * @return Number of children in the Init list. * @apilevel high-level * @ast method * */ public int getNumInit() { return getInitList().getNumChild(); } /** * Retrieves the number of children in the Init list. * Calling this method will not trigger rewrites.. * @return Number of children in the Init list. * @apilevel low-level * @ast method * */ public int getNumInitNoTransform() { return getInitListNoTransform().getNumChildNoTransform(); } /** * Retrieves the element at index {@code i} in the Init list.. * @param i Index of the element to return. * @return The element at position {@code i} in the Init list. * @apilevel high-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public Expr getInit(int i) { return (Expr)getInitList().getChild(i); } /** * Append an element to the Init list. * @param node The element to append to the Init list. * @apilevel high-level * @ast method * */ public void addInit(Expr node) { List<Expr> list = (parent == null || state == null) ? getInitListNoTransform() : getInitList(); list.addChild(node); } /** * @apilevel low-level * @ast method * */ public void addInitNoTransform(Expr node) { List<Expr> list = getInitListNoTransform(); list.addChild(node); } /** * Replaces the Init list element at index {@code i} with the new node {@code node}. * @param node The new node to replace the old list element. * @param i The list index of the node to be replaced. * @apilevel high-level * @ast method * */ public void setInit(Expr node, int i) { List<Expr> list = getInitList(); list.setChild(node, i); } /** * Retrieves the Init list. * @return The node representing the Init list. * @apilevel high-level * @ast method * */ public List<Expr> getInits() { return getInitList(); } /** * Retrieves the Init list. * <p><em>This method does not invoke AST transformations.</em></p> * @return The node representing the Init list. * @apilevel low-level * @ast method * */ public List<Expr> getInitsNoTransform() { return getInitListNoTransform(); } /** * Retrieves the Init list. * @return The node representing the Init list. * @apilevel high-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public List<Expr> getInitList() { List<Expr> list = (List<Expr>)getChild(0); list.getNumChild(); return list; } /** * Retrieves the Init list. * <p><em>This method does not invoke AST transformations.</em></p> * @return The node representing the Init list. * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public List<Expr> getInitListNoTransform() { return (List<Expr>)getChildNoTransform(0); } /* * representableIn(T) is true if and only if the the expression is a * compile-time constant of type byte, char, short or int, and the value * of the expression can be represented (by an expression) in the type T * where T must be byte, char or short. * @attribute syn * @aspect ConstantExpression * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:308 */ public boolean representableIn(TypeDecl t) { ASTNode$State state = state(); try { for(int i = 0; i < getNumInit(); i++) if(!getInit(i).representableIn(t)) return false; return true; } finally { } } /** * @attribute syn * @aspect DA * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:235 */ public boolean isDAafter(Variable v) { ASTNode$State state = state(); try { return getNumInit() == 0 ? isDAbefore(v) : getInit(getNumInit()-1).isDAafter(v); } finally { } } protected java.util.Map computeDABefore_int_Variable_values; /** * @attribute syn * @aspect DA * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:502 */ @SuppressWarnings({"unchecked", "cast"}) public boolean computeDABefore(int childIndex, Variable v) { java.util.List _parameters = new java.util.ArrayList(2); _parameters.add(Integer.valueOf(childIndex)); _parameters.add(v); if(computeDABefore_int_Variable_values == null) computeDABefore_int_Variable_values = new java.util.HashMap(4); if(computeDABefore_int_Variable_values.containsKey(_parameters)) { return ((Boolean)computeDABefore_int_Variable_values.get(_parameters)).booleanValue(); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean computeDABefore_int_Variable_value = computeDABefore_compute(childIndex, v); if(isFinal && num == state().boundariesCrossed) computeDABefore_int_Variable_values.put(_parameters, Boolean.valueOf(computeDABefore_int_Variable_value)); return computeDABefore_int_Variable_value; } /** * @apilevel internal */ private boolean computeDABefore_compute(int childIndex, Variable v) { if(childIndex == 0) return isDAbefore(v); int index = childIndex-1; while(index > 0 && getInit(index).isConstant()) index--; return getInit(childIndex-1).isDAafter(v); } /** * @attribute syn * @aspect DU * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:694 */ public boolean isDUafter(Variable v) { ASTNode$State state = state(); try { return getNumInit() == 0 ? isDUbefore(v) : getInit(getNumInit()-1).isDUafter(v); } finally { } } protected java.util.Map computeDUbefore_int_Variable_values; /** * @attribute syn * @aspect DU * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:885 */ @SuppressWarnings({"unchecked", "cast"}) public boolean computeDUbefore(int childIndex, Variable v) { java.util.List _parameters = new java.util.ArrayList(2); _parameters.add(Integer.valueOf(childIndex)); _parameters.add(v); if(computeDUbefore_int_Variable_values == null) computeDUbefore_int_Variable_values = new java.util.HashMap(4); if(computeDUbefore_int_Variable_values.containsKey(_parameters)) { return ((Boolean)computeDUbefore_int_Variable_values.get(_parameters)).booleanValue(); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean computeDUbefore_int_Variable_value = computeDUbefore_compute(childIndex, v); if(isFinal && num == state().boundariesCrossed) computeDUbefore_int_Variable_values.put(_parameters, Boolean.valueOf(computeDUbefore_int_Variable_value)); return computeDUbefore_int_Variable_value; } /** * @apilevel internal */ private boolean computeDUbefore_compute(int childIndex, Variable v) { if(childIndex == 0) return isDUbefore(v); int index = childIndex-1; while(index > 0 && getInit(index).isConstant()) index--; return getInit(childIndex-1).isDUafter(v); } /** * @apilevel internal */ protected boolean type_computed = false; /** * @apilevel internal */ protected TypeDecl type_value; /** * @attribute syn * @aspect TypeAnalysis * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:265 */ @SuppressWarnings({"unchecked", "cast"}) public TypeDecl type() { if(type_computed) { return type_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); type_value = type_compute(); if(isFinal && num == state().boundariesCrossed) type_computed = true; return type_value; } /** * @apilevel internal */ private TypeDecl type_compute() { return declType(); } /** * @apilevel internal */ protected boolean declType_computed = false; /** * @apilevel internal */ protected TypeDecl declType_value; /** * @attribute inh * @aspect TypeAnalysis * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:255 */ @SuppressWarnings({"unchecked", "cast"}) public TypeDecl declType() { if(declType_computed) { return declType_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); declType_value = getParent().Define_TypeDecl_declType(this, null); if(isFinal && num == state().boundariesCrossed) declType_computed = true; return declType_value; } /** * @attribute inh * @aspect InnerClasses * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/InnerClasses.jrag:61 */ @SuppressWarnings({"unchecked", "cast"}) public TypeDecl expectedType() { ASTNode$State state = state(); TypeDecl expectedType_value = getParent().Define_TypeDecl_expectedType(this, null); return expectedType_value; } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:42 * @apilevel internal */ public boolean Define_boolean_isSource(ASTNode caller, ASTNode child) { if(caller == getInitListNoTransform()) { int childIndex = caller.getIndexOfChild(child); return true; } else { return getParent().Define_boolean_isSource(this, caller); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:500 * @apilevel internal */ public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v) { if(caller == getInitListNoTransform()) { int childIndex = caller.getIndexOfChild(child); return computeDABefore(childIndex, v); } else { return getParent().Define_boolean_isDAbefore(this, caller, v); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:883 * @apilevel internal */ public boolean Define_boolean_isDUbefore(ASTNode caller, ASTNode child, Variable v) { if(caller == getInitListNoTransform()) { int childIndex = caller.getIndexOfChild(child); return computeDUbefore(childIndex, v); } else { return getParent().Define_boolean_isDUbefore(this, caller, v); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:263 * @apilevel internal */ public TypeDecl Define_TypeDecl_declType(ASTNode caller, ASTNode child) { if(caller == getInitListNoTransform()) { int childIndex = caller.getIndexOfChild(child); return declType().componentType(); } else { return getParent().Define_TypeDecl_declType(this, caller); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericMethodsInference.jrag:37 * @apilevel internal */ public TypeDecl Define_TypeDecl_assignConvertedType(ASTNode caller, ASTNode child) { if(caller == getInitListNoTransform()) { int childIndex = caller.getIndexOfChild(child); return declType().componentType(); } else { return getParent().Define_TypeDecl_assignConvertedType(this, caller); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/InnerClasses.jrag:70 * @apilevel internal */ public TypeDecl Define_TypeDecl_expectedType(ASTNode caller, ASTNode child) { if(caller == getInitListNoTransform()) { int childIndex = caller.getIndexOfChild(child); return expectedType().componentType(); } else { return getParent().Define_TypeDecl_expectedType(this, caller); } } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
17,609
30.003521
160
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/ArrayTypeAccess.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production ArrayTypeAccess : {@link TypeAccess} ::= <span class="component">&lt;Package:String&gt;</span> <span class="component">&lt;ID:String&gt;</span> <span class="component">{@link Access}</span>; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:25 */ public class ArrayTypeAccess extends TypeAccess implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); getPackage_computed = false; getPackage_value = null; getID_computed = false; getID_value = null; decl_computed = false; decl_value = null; } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public ArrayTypeAccess clone() throws CloneNotSupportedException { ArrayTypeAccess node = (ArrayTypeAccess)super.clone(); node.getPackage_computed = false; node.getPackage_value = null; node.getID_computed = false; node.getID_value = null; node.decl_computed = false; node.decl_value = null; node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public ArrayTypeAccess copy() { try { ArrayTypeAccess node = (ArrayTypeAccess) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public ArrayTypeAccess fullCopy() { ArrayTypeAccess tree = (ArrayTypeAccess) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect NameCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:155 */ public void nameCheck() { if(decl().elementType().isUnknown()) error("no type named " + decl().elementType().typeName()); } /** * @ast method * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:490 */ public void toString(StringBuffer s) { getAccess().toString(s); s.append("[]"); } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:660 */ public void addArraySize(Body b, ArrayList list) { getAccess().addArraySize(b, list); } /** * @ast method * */ public ArrayTypeAccess() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[1]; } /** * @ast method * */ public ArrayTypeAccess(Access p0) { setChild(p0, 0); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 1; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the Access child. * @param node The new node to replace the Access child. * @apilevel high-level * @ast method * */ public void setAccess(Access node) { setChild(node, 0); } /** * Retrieves the Access child. * @return The current node used as the Access child. * @apilevel high-level * @ast method * */ public Access getAccess() { return (Access)getChild(0); } /** * Retrieves the Access child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Access child. * @apilevel low-level * @ast method * */ public Access getAccessNoTransform() { return (Access)getChildNoTransform(0); } /** * Replaces the lexeme Package. * @param value The new value for the lexeme Package. * @apilevel high-level * @ast method * */ public void setPackage(String value) { tokenString_Package = value; } /** * @apilevel internal * @ast method * */ /** * @apilevel internal */ protected String tokenString_Package; /** * Replaces the lexeme ID. * @param value The new value for the lexeme ID. * @apilevel high-level * @ast method * */ public void setID(String value) { tokenString_ID = value; } /** * @apilevel internal * @ast method * */ /** * @apilevel internal */ protected String tokenString_ID; /** * @apilevel internal */ protected boolean getPackage_computed = false; /** * @apilevel internal */ protected String getPackage_value; /** * @attribute syn nta * @aspect Arrays * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Arrays.jrag:56 */ @SuppressWarnings({"unchecked", "cast"}) public String getPackage() { if(getPackage_computed) { return getPackage_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); getPackage_value = getPackage_compute(); setPackage(getPackage_value); if(isFinal && num == state().boundariesCrossed) getPackage_computed = true; return getPackage_value; } /** * @apilevel internal */ private String getPackage_compute() { return getAccess().type().packageName(); } /** * @apilevel internal */ protected boolean getID_computed = false; /** * @apilevel internal */ protected String getID_value; /** * @attribute syn nta * @aspect Arrays * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Arrays.jrag:57 */ @SuppressWarnings({"unchecked", "cast"}) public String getID() { if(getID_computed) { return getID_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); getID_value = getID_compute(); setID(getID_value); if(isFinal && num == state().boundariesCrossed) getID_computed = true; return getID_value; } /** * @apilevel internal */ private String getID_compute() { return getAccess().type().name(); } /** * @attribute syn * @aspect DA * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:235 */ public boolean isDAafter(Variable v) { ASTNode$State state = state(); try { return getAccess().isDAafter(v); } finally { } } /** * @attribute syn * @aspect DU * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:694 */ public boolean isDUafter(Variable v) { ASTNode$State state = state(); try { return getAccess().isDUafter(v); } finally { } } /** * @apilevel internal */ protected boolean decl_computed = false; /** * @apilevel internal */ protected TypeDecl decl_value; /** * @attribute syn * @aspect TypeScopePropagation * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:246 */ @SuppressWarnings({"unchecked", "cast"}) public TypeDecl decl() { if(decl_computed) { return decl_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); decl_value = decl_compute(); if(isFinal && num == state().boundariesCrossed) decl_computed = true; return decl_value; } /** * @apilevel internal */ private TypeDecl decl_compute() { return getAccess().type().arrayType(); } /** * @attribute syn * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:800 */ public String dumpString() { ASTNode$State state = state(); try { return getClass().getName(); } finally { } } /** * @attribute syn * @aspect SyntacticClassification * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/SyntacticClassification.jrag:56 */ public NameType predNameType() { ASTNode$State state = state(); try { return NameType.AMBIGUOUS_NAME; } finally { } } /** * @attribute syn * @aspect TypeHierarchyCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeHierarchyCheck.jrag:150 */ public boolean staticContextQualifier() { ASTNode$State state = state(); try { return true; } finally { } } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
9,933
24.603093
205
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/ArrayTypeWithSizeAccess.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production ArrayTypeWithSizeAccess : {@link ArrayTypeAccess} ::= <span class="component">{@link Expr}</span>; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:26 */ public class ArrayTypeWithSizeAccess extends ArrayTypeAccess implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public ArrayTypeWithSizeAccess clone() throws CloneNotSupportedException { ArrayTypeWithSizeAccess node = (ArrayTypeWithSizeAccess)super.clone(); node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public ArrayTypeWithSizeAccess copy() { try { ArrayTypeWithSizeAccess node = (ArrayTypeWithSizeAccess) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public ArrayTypeWithSizeAccess fullCopy() { ArrayTypeWithSizeAccess tree = (ArrayTypeWithSizeAccess) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:495 */ public void toString(StringBuffer s) { getAccess().toString(s); s.append("["); getExpr().toString(s); s.append("]"); } /** * @ast method * @aspect TypeCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:555 */ public void typeCheck() { super.typeCheck(); if(!getExpr().type().unaryNumericPromotion().isInt()) error(getExpr().type().typeName() + " is not int after unary numeric promotion"); } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:663 */ public void addArraySize(Body b, ArrayList list) { getAccess().addArraySize(b, list); list.add(asImmediate(b, getExpr().eval(b))); } /** * @ast method * */ public ArrayTypeWithSizeAccess() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[2]; } /** * @ast method * */ public ArrayTypeWithSizeAccess(Access p0, Expr p1) { setChild(p0, 0); setChild(p1, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the Access child. * @param node The new node to replace the Access child. * @apilevel high-level * @ast method * */ public void setAccess(Access node) { setChild(node, 0); } /** * Retrieves the Access child. * @return The current node used as the Access child. * @apilevel high-level * @ast method * */ public Access getAccess() { return (Access)getChild(0); } /** * Retrieves the Access child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Access child. * @apilevel low-level * @ast method * */ public Access getAccessNoTransform() { return (Access)getChildNoTransform(0); } /** * Replaces the Expr child. * @param node The new node to replace the Expr child. * @apilevel high-level * @ast method * */ public void setExpr(Expr node) { setChild(node, 1); } /** * Retrieves the Expr child. * @return The current node used as the Expr child. * @apilevel high-level * @ast method * */ public Expr getExpr() { return (Expr)getChild(1); } /** * Retrieves the Expr child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Expr child. * @apilevel low-level * @ast method * */ public Expr getExprNoTransform() { return (Expr)getChildNoTransform(1); } /** * Replaces the lexeme Package. * @param value The new value for the lexeme Package. * @apilevel high-level * @ast method * */ public void setPackage(String value) { tokenString_Package = value; } /** * Replaces the lexeme ID. * @param value The new value for the lexeme ID. * @apilevel high-level * @ast method * */ public void setID(String value) { tokenString_ID = value; } /** * @attribute syn * @aspect DA * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:235 */ public boolean isDAafter(Variable v) { ASTNode$State state = state(); try { return getExpr().isDAafter(v); } finally { } } /** * @attribute syn * @aspect DU * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:694 */ public boolean isDUafter(Variable v) { ASTNode$State state = state(); try { return getExpr().isDUafter(v); } finally { } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:36 * @apilevel internal */ public boolean Define_boolean_isDest(ASTNode caller, ASTNode child) { if(caller == getExprNoTransform()) { return false; } else { return getParent().Define_boolean_isDest(this, caller); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:37 * @apilevel internal */ public boolean Define_boolean_isSource(ASTNode caller, ASTNode child) { if(caller == getExprNoTransform()) { return true; } else { return getParent().Define_boolean_isSource(this, caller); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:359 * @apilevel internal */ public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v) { if(caller == getExprNoTransform()) { return getAccess().isDAafter(v); } else { return getParent().Define_boolean_isDAbefore(this, caller, v); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:839 * @apilevel internal */ public boolean Define_boolean_isDUbefore(ASTNode caller, ASTNode child, Variable v) { if(caller == getExprNoTransform()) { return getAccess().isDUafter(v); } else { return getParent().Define_boolean_isDUbefore(this, caller, v); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupMethod.jrag:31 * @apilevel internal */ public Collection Define_Collection_lookupMethod(ASTNode caller, ASTNode child, String name) { if(caller == getExprNoTransform()) { return unqualifiedScope().lookupMethod(name); } else { return getParent().Define_Collection_lookupMethod(this, caller, name); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:91 * @apilevel internal */ public boolean Define_boolean_hasPackage(ASTNode caller, ASTNode child, String packageName) { if(caller == getExprNoTransform()) { return unqualifiedScope().hasPackage(packageName); } else { return getParent().Define_boolean_hasPackage(this, caller, packageName); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:256 * @apilevel internal */ public SimpleSet Define_SimpleSet_lookupType(ASTNode caller, ASTNode child, String name) { if(caller == getExprNoTransform()) { return unqualifiedScope().lookupType(name); } else { return getParent().Define_SimpleSet_lookupType(this, caller, name); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupVariable.jrag:136 * @apilevel internal */ public SimpleSet Define_SimpleSet_lookupVariable(ASTNode caller, ASTNode child, String name) { if(caller == getExprNoTransform()) { return unqualifiedScope().lookupVariable(name); } else { return getParent().Define_SimpleSet_lookupVariable(this, caller, name); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/SyntacticClassification.jrag:123 * @apilevel internal */ public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) { if(caller == getExprNoTransform()) { return NameType.EXPRESSION_NAME; } else { return getParent().Define_NameType_nameType(this, caller); } } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
10,491
27.433604
118
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/AssertStmt.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production AssertStmt : {@link Stmt} ::= <span class="component">first:{@link Expr}</span> <span class="component">[{@link Expr}]</span>; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:221 */ public class AssertStmt extends Stmt implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); isDAafter_Variable_values = null; isDUafter_Variable_values = null; } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AssertStmt clone() throws CloneNotSupportedException { AssertStmt node = (AssertStmt)super.clone(); node.isDAafter_Variable_values = null; node.isDUafter_Variable_values = null; node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AssertStmt copy() { try { AssertStmt node = (AssertStmt) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public AssertStmt fullCopy() { AssertStmt tree = (AssertStmt) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:729 */ public void toString(StringBuffer s) { s.append(indent()); s.append("assert "); getfirst().toString(s); if(hasExpr()) { s.append(" : "); getExpr().toString(s); } s.append(";"); } /** * @ast method * @aspect TypeCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:378 */ public void typeCheck() { // 14.10 if(!getfirst().type().isBoolean()) error("Assert requires boolean condition"); if(hasExpr() && getExpr().type().isVoid()) error("The second part of an assert statement may not be void"); } /** * @ast method * @aspect Transformations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/Transformations.jrag:170 */ public void transformation() { super.transformation(); // add field to hold cached result as a side-effect FieldDeclaration f = hostType().topLevelType().createStaticClassField(hostType().topLevelType().referenceClassFieldName()); FieldDeclaration assertionsDisabled = hostType().createAssertionsDisabled(); Expr condition = (Expr)getfirst().fullCopy(); List args = new List(); if(hasExpr()) if(getExpr().type().isString()) args.add(new CastExpr(new TypeAccess("java.lang", "Object"), (Expr)getExpr().fullCopy())); else args.add(getExpr().fullCopy()); Stmt stmt = new IfStmt( new LogNotExpr( new ParExpr( new OrLogicalExpr( new BoundFieldAccess(assertionsDisabled), condition ) ) ), new ThrowStmt( new ClassInstanceExpr( lookupType("java.lang", "AssertionError").createQualifiedAccess(), args, new Opt() ) ), new Opt() ); replace(this).with(stmt); stmt.transformation(); } /** * @ast method * */ public AssertStmt() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[2]; setChild(new Opt(), 1); } /** * @ast method * */ public AssertStmt(Expr p0, Opt<Expr> p1) { setChild(p0, 0); setChild(p1, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the first child. * @param node The new node to replace the first child. * @apilevel high-level * @ast method * */ public void setfirst(Expr node) { setChild(node, 0); } /** * Retrieves the first child. * @return The current node used as the first child. * @apilevel high-level * @ast method * */ public Expr getfirst() { return (Expr)getChild(0); } /** * Retrieves the first child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the first child. * @apilevel low-level * @ast method * */ public Expr getfirstNoTransform() { return (Expr)getChildNoTransform(0); } /** * Replaces the optional node for the Expr child. This is the {@code Opt} node containing the child Expr, not the actual child! * @param opt The new node to be used as the optional node for the Expr child. * @apilevel low-level * @ast method * */ public void setExprOpt(Opt<Expr> opt) { setChild(opt, 1); } /** * Check whether the optional Expr child exists. * @return {@code true} if the optional Expr child exists, {@code false} if it does not. * @apilevel high-level * @ast method * */ public boolean hasExpr() { return getExprOpt().getNumChild() != 0; } /** * Retrieves the (optional) Expr child. * @return The Expr child, if it exists. Returns {@code null} otherwise. * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public Expr getExpr() { return (Expr)getExprOpt().getChild(0); } /** * Replaces the (optional) Expr child. * @param node The new node to be used as the Expr child. * @apilevel high-level * @ast method * */ public void setExpr(Expr node) { getExprOpt().setChild(node, 0); } /** * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public Opt<Expr> getExprOpt() { return (Opt<Expr>)getChild(1); } /** * Retrieves the optional node for child Expr. This is the {@code Opt} node containing the child Expr, not the actual child! * <p><em>This method does not invoke AST transformations.</em></p> * @return The optional node for child Expr. * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public Opt<Expr> getExprOptNoTransform() { return (Opt<Expr>)getChildNoTransform(1); } protected java.util.Map isDAafter_Variable_values; /** * @attribute syn * @aspect DA * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:418 */ @SuppressWarnings({"unchecked", "cast"}) public boolean isDAafter(Variable v) { Object _parameters = v; if(isDAafter_Variable_values == null) isDAafter_Variable_values = new java.util.HashMap(4); if(isDAafter_Variable_values.containsKey(_parameters)) { return ((Boolean)isDAafter_Variable_values.get(_parameters)).booleanValue(); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean isDAafter_Variable_value = isDAafter_compute(v); if(isFinal && num == state().boundariesCrossed) isDAafter_Variable_values.put(_parameters, Boolean.valueOf(isDAafter_Variable_value)); return isDAafter_Variable_value; } /** * @apilevel internal */ private boolean isDAafter_compute(Variable v) { return getfirst().isDAafter(v); } protected java.util.Map isDUafter_Variable_values; /** * @attribute syn * @aspect DU * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:866 */ @SuppressWarnings({"unchecked", "cast"}) public boolean isDUafter(Variable v) { Object _parameters = v; if(isDUafter_Variable_values == null) isDUafter_Variable_values = new java.util.HashMap(4); if(isDUafter_Variable_values.containsKey(_parameters)) { return ((Boolean)isDUafter_Variable_values.get(_parameters)).booleanValue(); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean isDUafter_Variable_value = isDUafter_compute(v); if(isFinal && num == state().boundariesCrossed) isDUafter_Variable_values.put(_parameters, Boolean.valueOf(isDUafter_Variable_value)); return isDUafter_Variable_value; } /** * @apilevel internal */ private boolean isDUafter_compute(Variable v) { return getfirst().isDUafter(v); } /** * @attribute syn * @aspect PreciseRethrow * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/PreciseRethrow.jrag:55 */ public boolean modifiedInScope(Variable var) { ASTNode$State state = state(); try { return false; } finally { } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:419 * @apilevel internal */ public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v) { if(caller == getExprOptNoTransform()) { return getfirst().isDAafter(v); } else { return getParent().Define_boolean_isDAbefore(this, caller, v); } } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
10,745
27.96496
141
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/AssignAdditiveExpr.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production AssignAdditiveExpr : {@link AssignExpr}; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:115 */ public abstract class AssignAdditiveExpr extends AssignExpr implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AssignAdditiveExpr clone() throws CloneNotSupportedException { AssignAdditiveExpr node = (AssignAdditiveExpr)super.clone(); node.in$Circle(false); node.is$Final(false); return node; } /** * @ast method * */ public AssignAdditiveExpr() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[2]; } /** * @ast method * */ public AssignAdditiveExpr(Expr p0, Expr p1) { setChild(p0, 0); setChild(p1, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the Dest child. * @param node The new node to replace the Dest child. * @apilevel high-level * @ast method * */ public void setDest(Expr node) { setChild(node, 0); } /** * Retrieves the Dest child. * @return The current node used as the Dest child. * @apilevel high-level * @ast method * */ public Expr getDest() { return (Expr)getChild(0); } /** * Retrieves the Dest child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Dest child. * @apilevel low-level * @ast method * */ public Expr getDestNoTransform() { return (Expr)getChildNoTransform(0); } /** * Replaces the Source child. * @param node The new node to replace the Source child. * @apilevel high-level * @ast method * */ public void setSource(Expr node) { setChild(node, 1); } /** * Retrieves the Source child. * @return The current node used as the Source child. * @apilevel high-level * @ast method * */ public Expr getSource() { return (Expr)getChild(1); } /** * Retrieves the Source child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Source child. * @apilevel low-level * @ast method * */ public Expr getSourceNoTransform() { return (Expr)getChildNoTransform(1); } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
3,557
20.962963
96
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/AssignAndExpr.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production AssignAndExpr : {@link AssignBitwiseExpr}; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:125 */ public class AssignAndExpr extends AssignBitwiseExpr implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AssignAndExpr clone() throws CloneNotSupportedException { AssignAndExpr node = (AssignAndExpr)super.clone(); node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AssignAndExpr copy() { try { AssignAndExpr node = (AssignAndExpr) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public AssignAndExpr fullCopy() { AssignAndExpr tree = (AssignAndExpr) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:180 */ public soot.Value createAssignOp(Body b, soot.Value fst, soot.Value snd) { return b.newAndExpr(asImmediate(b, fst), asImmediate(b, snd), this); } /** * @ast method * */ public AssignAndExpr() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[2]; } /** * @ast method * */ public AssignAndExpr(Expr p0, Expr p1) { setChild(p0, 0); setChild(p1, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the Dest child. * @param node The new node to replace the Dest child. * @apilevel high-level * @ast method * */ public void setDest(Expr node) { setChild(node, 0); } /** * Retrieves the Dest child. * @return The current node used as the Dest child. * @apilevel high-level * @ast method * */ public Expr getDest() { return (Expr)getChild(0); } /** * Retrieves the Dest child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Dest child. * @apilevel low-level * @ast method * */ public Expr getDestNoTransform() { return (Expr)getChildNoTransform(0); } /** * Replaces the Source child. * @param node The new node to replace the Source child. * @apilevel high-level * @ast method * */ public void setSource(Expr node) { setChild(node, 1); } /** * Retrieves the Source child. * @return The current node used as the Source child. * @apilevel high-level * @ast method * */ public Expr getSource() { return (Expr)getChild(1); } /** * Retrieves the Source child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Source child. * @apilevel low-level * @ast method * */ public Expr getSourceNoTransform() { return (Expr)getChildNoTransform(1); } /** * @attribute syn * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:247 */ public String printOp() { ASTNode$State state = state(); try { return " &= "; } finally { } } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
5,166
22.81106
113
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/AssignBitwiseExpr.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production AssignBitwiseExpr : {@link AssignExpr}; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:124 */ public abstract class AssignBitwiseExpr extends AssignExpr implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AssignBitwiseExpr clone() throws CloneNotSupportedException { AssignBitwiseExpr node = (AssignBitwiseExpr)super.clone(); node.in$Circle(false); node.is$Final(false); return node; } /** * @ast method * @aspect TypeCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:98 */ public void typeCheck() { TypeDecl source = sourceType(); TypeDecl dest = getDest().type(); if(source.isIntegralType() && dest.isIntegralType()) super.typeCheck(); else if(source.isBoolean() && dest.isBoolean()) super.typeCheck(); else error("Operator only operates on integral and boolean types"); } /** * @ast method * */ public AssignBitwiseExpr() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[2]; } /** * @ast method * */ public AssignBitwiseExpr(Expr p0, Expr p1) { setChild(p0, 0); setChild(p1, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the Dest child. * @param node The new node to replace the Dest child. * @apilevel high-level * @ast method * */ public void setDest(Expr node) { setChild(node, 0); } /** * Retrieves the Dest child. * @return The current node used as the Dest child. * @apilevel high-level * @ast method * */ public Expr getDest() { return (Expr)getChild(0); } /** * Retrieves the Dest child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Dest child. * @apilevel low-level * @ast method * */ public Expr getDestNoTransform() { return (Expr)getChildNoTransform(0); } /** * Replaces the Source child. * @param node The new node to replace the Source child. * @apilevel high-level * @ast method * */ public void setSource(Expr node) { setChild(node, 1); } /** * Retrieves the Source child. * @return The current node used as the Source child. * @apilevel high-level * @ast method * */ public Expr getSource() { return (Expr)getChild(1); } /** * Retrieves the Source child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Source child. * @apilevel low-level * @ast method * */ public Expr getSourceNoTransform() { return (Expr)getChildNoTransform(1); } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
4,050
21.887006
103
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/AssignDivExpr.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production AssignDivExpr : {@link AssignMultiplicativeExpr}; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:112 */ public class AssignDivExpr extends AssignMultiplicativeExpr implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AssignDivExpr clone() throws CloneNotSupportedException { AssignDivExpr node = (AssignDivExpr)super.clone(); node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AssignDivExpr copy() { try { AssignDivExpr node = (AssignDivExpr) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public AssignDivExpr fullCopy() { AssignDivExpr tree = (AssignDivExpr) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:159 */ public soot.Value createAssignOp(Body b, soot.Value fst, soot.Value snd) { return b.newDivExpr(asImmediate(b, fst), asImmediate(b, snd), this); } /** * @ast method * */ public AssignDivExpr() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[2]; } /** * @ast method * */ public AssignDivExpr(Expr p0, Expr p1) { setChild(p0, 0); setChild(p1, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the Dest child. * @param node The new node to replace the Dest child. * @apilevel high-level * @ast method * */ public void setDest(Expr node) { setChild(node, 0); } /** * Retrieves the Dest child. * @return The current node used as the Dest child. * @apilevel high-level * @ast method * */ public Expr getDest() { return (Expr)getChild(0); } /** * Retrieves the Dest child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Dest child. * @apilevel low-level * @ast method * */ public Expr getDestNoTransform() { return (Expr)getChildNoTransform(0); } /** * Replaces the Source child. * @param node The new node to replace the Source child. * @apilevel high-level * @ast method * */ public void setSource(Expr node) { setChild(node, 1); } /** * Retrieves the Source child. * @return The current node used as the Source child. * @apilevel high-level * @ast method * */ public Expr getSource() { return (Expr)getChild(1); } /** * Retrieves the Source child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Source child. * @apilevel low-level * @ast method * */ public Expr getSourceNoTransform() { return (Expr)getChildNoTransform(1); } /** * @attribute syn * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:247 */ public String printOp() { ASTNode$State state = state(); try { return " /= "; } finally { } } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
5,180
22.875576
113
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/AssignExpr.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production AssignExpr : {@link Expr} ::= <span class="component">Dest:{@link Expr}</span> <span class="component">Source:{@link Expr}</span>; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:106 */ public abstract class AssignExpr extends Expr implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); type_computed = false; type_value = null; } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AssignExpr clone() throws CloneNotSupportedException { AssignExpr node = (AssignExpr)super.clone(); node.type_computed = false; node.type_value = null; node.in$Circle(false); node.is$Final(false); return node; } /** * @ast method * @aspect DA * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:463 */ protected boolean checkDUeverywhere(Variable v) { if(getDest().isVariable() && getDest().varDecl() == v) if(!getSource().isDAafter(v)) return false; return super.checkDUeverywhere(v); } /** * @ast method * @aspect NodeConstructors * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NodeConstructors.jrag:94 */ public static Stmt asStmt(Expr left, Expr right) { return new ExprStmt(new AssignSimpleExpr(left, right)); } /** * @ast method * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:241 */ public void toString(StringBuffer s) { getDest().toString(s); s.append(printOp()); getSource().toString(s); } /** * @ast method * @aspect TypeCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:52 */ public void typeCheck() { if(!getDest().isVariable()) error("left hand side is not a variable"); else { TypeDecl source = sourceType(); TypeDecl dest = getDest().type(); if(getSource().type().isPrimitive() && getDest().type().isPrimitive()) return; error("can not assign " + getDest() + " of type " + getDest().type().typeName() + " a value of type " + sourceType().typeName()); } } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:62 */ public soot.Value eval(Body b) { TypeDecl dest = getDest().type(); TypeDecl source = getSource().type(); TypeDecl type; if(dest.isNumericType() && source.isNumericType()) type = dest.binaryNumericPromotion(source); else type = dest; Value lvalue = getDest().eval(b); Value v = lvalue instanceof Local ? lvalue : (Value)lvalue.clone(); Value value = b.newTemp(dest.emitCastTo(b, v, type, this)); Value rvalue = source.emitCastTo(b, getSource(), type); Value result = asImmediate(b, type.emitCastTo(b, createAssignOp(b, value, rvalue), dest, getDest() )); getDest().emitStore(b, lvalue, result, this); return result; } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:129 */ public soot.Value emitShiftExpr(Body b) { TypeDecl dest = getDest().type(); TypeDecl source = getSource().type(); TypeDecl type = dest.unaryNumericPromotion(); Value lvalue = getDest().eval(b); Value v = lvalue instanceof Local ? lvalue : (Value)lvalue.clone(); Value value = b.newTemp(dest.emitCastTo(b, v, type, getDest())); Value rvalue = source.emitCastTo(b, getSource(), typeInt()); Value result = asImmediate(b, type.emitCastTo(b, createAssignOp(b, value, rvalue), dest, getDest() )); getDest().emitStore(b, lvalue, result, this); return result; } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:153 */ public soot.Value createAssignOp(Body b, soot.Value fst, soot.Value snd) { throw new Error("Operation createAssignOp is not implemented for " + getClass().getName()); } /** * @ast method * */ public AssignExpr() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[2]; } /** * @ast method * */ public AssignExpr(Expr p0, Expr p1) { setChild(p0, 0); setChild(p1, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the Dest child. * @param node The new node to replace the Dest child. * @apilevel high-level * @ast method * */ public void setDest(Expr node) { setChild(node, 0); } /** * Retrieves the Dest child. * @return The current node used as the Dest child. * @apilevel high-level * @ast method * */ public Expr getDest() { return (Expr)getChild(0); } /** * Retrieves the Dest child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Dest child. * @apilevel low-level * @ast method * */ public Expr getDestNoTransform() { return (Expr)getChildNoTransform(0); } /** * Replaces the Source child. * @param node The new node to replace the Source child. * @apilevel high-level * @ast method * */ public void setSource(Expr node) { setChild(node, 1); } /** * Retrieves the Source child. * @return The current node used as the Source child. * @apilevel high-level * @ast method * */ public Expr getSource() { return (Expr)getChild(1); } /** * Retrieves the Source child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Source child. * @apilevel low-level * @ast method * */ public Expr getSourceNoTransform() { return (Expr)getChildNoTransform(1); } /** * @attribute syn * @aspect DA * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:235 */ public boolean isDAafter(Variable v) { ASTNode$State state = state(); try { return (getDest().isVariable() && getDest().varDecl() == v) || getSource().isDAafter(v); } finally { } } /*eq Stmt.isDAafter(Variable v) { //System.out.println("### isDAafter reached in " + getClass().getName()); //throw new NullPointerException(); throw new Error("Can not compute isDAafter for " + getClass().getName() + " at " + errorPrefix()); }* @attribute syn * @aspect DA * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:332 */ public boolean isDAafterTrue(Variable v) { ASTNode$State state = state(); try { return isDAafter(v) || isFalse(); } finally { } } /** * @attribute syn * @aspect DA * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:333 */ public boolean isDAafterFalse(Variable v) { ASTNode$State state = state(); try { return isDAafter(v) || isTrue(); } finally { } } /** * @attribute syn * @aspect DU * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:694 */ public boolean isDUafter(Variable v) { ASTNode$State state = state(); try { return getSource().isDUafter(v); } finally { } } /** * @attribute syn * @aspect DU * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:702 */ public boolean isDUafterTrue(Variable v) { ASTNode$State state = state(); try { return isDUafter(v); } finally { } } /** * @attribute syn * @aspect DU * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:703 */ public boolean isDUafterFalse(Variable v) { ASTNode$State state = state(); try { return isDUafter(v); } finally { } } /** * @attribute syn * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:247 */ public String printOp() { ASTNode$State state = state(); try { return " = "; } finally { } } /** * @apilevel internal */ protected boolean type_computed = false; /** * @apilevel internal */ protected TypeDecl type_value; /** * @attribute syn * @aspect TypeAnalysis * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:298 */ @SuppressWarnings({"unchecked", "cast"}) public TypeDecl type() { if(type_computed) { return type_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); type_value = type_compute(); if(isFinal && num == state().boundariesCrossed) type_computed = true; return type_value; } /** * @apilevel internal */ private TypeDecl type_compute() { return getDest().type(); } /** * @attribute syn * @aspect TypeCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:109 */ public TypeDecl sourceType() { ASTNode$State state = state(); try { return getSource().type().isPrimitive() ? getSource().type() : unknownType(); } finally { } } /** * @attribute syn * @aspect PreciseRethrow * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/PreciseRethrow.jrag:111 */ public boolean modifiedInScope(Variable var) { ASTNode$State state = state(); try { return getDest().isVariable(var); } finally { } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:19 * @apilevel internal */ public boolean Define_boolean_isDest(ASTNode caller, ASTNode child) { if(caller == getSourceNoTransform()) { return false; } else if(caller == getDestNoTransform()) { return true; } else { return getParent().Define_boolean_isDest(this, caller); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:29 * @apilevel internal */ public boolean Define_boolean_isSource(ASTNode caller, ASTNode child) { if(caller == getSourceNoTransform()) { return true; } else if(caller == getDestNoTransform()) { return true; } else { return getParent().Define_boolean_isSource(this, caller); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:392 * @apilevel internal */ public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v) { if(caller == getDestNoTransform()) { return isDAbefore(v); } else if(caller == getSourceNoTransform()) { return getDest().isDAafter(v); } else { return getParent().Define_boolean_isDAbefore(this, caller, v); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:828 * @apilevel internal */ public boolean Define_boolean_isDUbefore(ASTNode caller, ASTNode child, Variable v) { if(caller == getDestNoTransform()) { return isDUbefore(v); } else if(caller == getSourceNoTransform()) { return getDest().isDUafter(v); } else { return getParent().Define_boolean_isDUbefore(this, caller, v); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/SyntacticClassification.jrag:99 * @apilevel internal */ public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) { if(caller == getDestNoTransform()) { return NameType.EXPRESSION_NAME; } else { return getParent().Define_NameType_nameType(this, caller); } } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
13,429
27.88172
145
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/AssignLShiftExpr.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production AssignLShiftExpr : {@link AssignShiftExpr}; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:120 */ public class AssignLShiftExpr extends AssignShiftExpr implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AssignLShiftExpr clone() throws CloneNotSupportedException { AssignLShiftExpr node = (AssignLShiftExpr)super.clone(); node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AssignLShiftExpr copy() { try { AssignLShiftExpr node = (AssignLShiftExpr) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public AssignLShiftExpr fullCopy() { AssignLShiftExpr tree = (AssignLShiftExpr) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:147 */ public soot.Value eval(Body b) { return emitShiftExpr(b); } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:171 */ public soot.Value createAssignOp(Body b, soot.Value fst, soot.Value snd) { return b.newShlExpr(asImmediate(b, fst), asImmediate(b, snd), this); } /** * @ast method * */ public AssignLShiftExpr() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[2]; } /** * @ast method * */ public AssignLShiftExpr(Expr p0, Expr p1) { setChild(p0, 0); setChild(p1, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the Dest child. * @param node The new node to replace the Dest child. * @apilevel high-level * @ast method * */ public void setDest(Expr node) { setChild(node, 0); } /** * Retrieves the Dest child. * @return The current node used as the Dest child. * @apilevel high-level * @ast method * */ public Expr getDest() { return (Expr)getChild(0); } /** * Retrieves the Dest child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Dest child. * @apilevel low-level * @ast method * */ public Expr getDestNoTransform() { return (Expr)getChildNoTransform(0); } /** * Replaces the Source child. * @param node The new node to replace the Source child. * @apilevel high-level * @ast method * */ public void setSource(Expr node) { setChild(node, 1); } /** * Retrieves the Source child. * @return The current node used as the Source child. * @apilevel high-level * @ast method * */ public Expr getSource() { return (Expr)getChild(1); } /** * Retrieves the Source child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Source child. * @apilevel low-level * @ast method * */ public Expr getSourceNoTransform() { return (Expr)getChildNoTransform(1); } /** * @attribute syn * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:247 */ public String printOp() { ASTNode$State state = state(); try { return " <<= "; } finally { } } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
5,433
23.367713
113
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/AssignMinusExpr.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production AssignMinusExpr : {@link AssignAdditiveExpr}; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:117 */ public class AssignMinusExpr extends AssignAdditiveExpr implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AssignMinusExpr clone() throws CloneNotSupportedException { AssignMinusExpr node = (AssignMinusExpr)super.clone(); node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AssignMinusExpr copy() { try { AssignMinusExpr node = (AssignMinusExpr) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public AssignMinusExpr fullCopy() { AssignMinusExpr tree = (AssignMinusExpr) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect TypeCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:86 */ public void typeCheck() { if(sourceType().isBoolean() || getDest().type().isBoolean()) error("Operator - does not operate on boolean types"); super.typeCheck(); } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:168 */ public soot.Value createAssignOp(Body b, soot.Value fst, soot.Value snd) { return b.newSubExpr(asImmediate(b, fst), asImmediate(b, snd), this); } /** * @ast method * */ public AssignMinusExpr() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[2]; } /** * @ast method * */ public AssignMinusExpr(Expr p0, Expr p1) { setChild(p0, 0); setChild(p1, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the Dest child. * @param node The new node to replace the Dest child. * @apilevel high-level * @ast method * */ public void setDest(Expr node) { setChild(node, 0); } /** * Retrieves the Dest child. * @return The current node used as the Dest child. * @apilevel high-level * @ast method * */ public Expr getDest() { return (Expr)getChild(0); } /** * Retrieves the Dest child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Dest child. * @apilevel low-level * @ast method * */ public Expr getDestNoTransform() { return (Expr)getChildNoTransform(0); } /** * Replaces the Source child. * @param node The new node to replace the Source child. * @apilevel high-level * @ast method * */ public void setSource(Expr node) { setChild(node, 1); } /** * Retrieves the Source child. * @return The current node used as the Source child. * @apilevel high-level * @ast method * */ public Expr getSource() { return (Expr)getChild(1); } /** * Retrieves the Source child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Source child. * @apilevel low-level * @ast method * */ public Expr getSourceNoTransform() { return (Expr)getChildNoTransform(1); } /** * @attribute syn * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:247 */ public String printOp() { ASTNode$State state = state(); try { return " -= "; } finally { } } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
5,532
23.374449
113
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/AssignModExpr.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production AssignModExpr : {@link AssignMultiplicativeExpr}; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:113 */ public class AssignModExpr extends AssignMultiplicativeExpr implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AssignModExpr clone() throws CloneNotSupportedException { AssignModExpr node = (AssignModExpr)super.clone(); node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AssignModExpr copy() { try { AssignModExpr node = (AssignModExpr) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public AssignModExpr fullCopy() { AssignModExpr tree = (AssignModExpr) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:162 */ public soot.Value createAssignOp(Body b, soot.Value fst, soot.Value snd) { return b.newRemExpr(asImmediate(b, fst), asImmediate(b, snd), this); } /** * @ast method * */ public AssignModExpr() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[2]; } /** * @ast method * */ public AssignModExpr(Expr p0, Expr p1) { setChild(p0, 0); setChild(p1, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the Dest child. * @param node The new node to replace the Dest child. * @apilevel high-level * @ast method * */ public void setDest(Expr node) { setChild(node, 0); } /** * Retrieves the Dest child. * @return The current node used as the Dest child. * @apilevel high-level * @ast method * */ public Expr getDest() { return (Expr)getChild(0); } /** * Retrieves the Dest child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Dest child. * @apilevel low-level * @ast method * */ public Expr getDestNoTransform() { return (Expr)getChildNoTransform(0); } /** * Replaces the Source child. * @param node The new node to replace the Source child. * @apilevel high-level * @ast method * */ public void setSource(Expr node) { setChild(node, 1); } /** * Retrieves the Source child. * @return The current node used as the Source child. * @apilevel high-level * @ast method * */ public Expr getSource() { return (Expr)getChild(1); } /** * Retrieves the Source child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Source child. * @apilevel low-level * @ast method * */ public Expr getSourceNoTransform() { return (Expr)getChildNoTransform(1); } /** * @attribute syn * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:247 */ public String printOp() { ASTNode$State state = state(); try { return " %= "; } finally { } } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
5,180
22.875576
113
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/AssignMulExpr.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production AssignMulExpr : {@link AssignMultiplicativeExpr}; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:111 */ public class AssignMulExpr extends AssignMultiplicativeExpr implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AssignMulExpr clone() throws CloneNotSupportedException { AssignMulExpr node = (AssignMulExpr)super.clone(); node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AssignMulExpr copy() { try { AssignMulExpr node = (AssignMulExpr) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public AssignMulExpr fullCopy() { AssignMulExpr tree = (AssignMulExpr) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:156 */ public soot.Value createAssignOp(Body b, soot.Value fst, soot.Value snd) { return asImmediate(b, b.newMulExpr(asImmediate(b, fst), asImmediate(b, snd), this)); } /** * @ast method * */ public AssignMulExpr() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[2]; } /** * @ast method * */ public AssignMulExpr(Expr p0, Expr p1) { setChild(p0, 0); setChild(p1, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the Dest child. * @param node The new node to replace the Dest child. * @apilevel high-level * @ast method * */ public void setDest(Expr node) { setChild(node, 0); } /** * Retrieves the Dest child. * @return The current node used as the Dest child. * @apilevel high-level * @ast method * */ public Expr getDest() { return (Expr)getChild(0); } /** * Retrieves the Dest child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Dest child. * @apilevel low-level * @ast method * */ public Expr getDestNoTransform() { return (Expr)getChildNoTransform(0); } /** * Replaces the Source child. * @param node The new node to replace the Source child. * @apilevel high-level * @ast method * */ public void setSource(Expr node) { setChild(node, 1); } /** * Retrieves the Source child. * @return The current node used as the Source child. * @apilevel high-level * @ast method * */ public Expr getSource() { return (Expr)getChild(1); } /** * Retrieves the Source child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Source child. * @apilevel low-level * @ast method * */ public Expr getSourceNoTransform() { return (Expr)getChildNoTransform(1); } /** * @attribute syn * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:247 */ public String printOp() { ASTNode$State state = state(); try { return " *= "; } finally { } } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
5,196
22.949309
113
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/AssignMultiplicativeExpr.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production AssignMultiplicativeExpr : {@link AssignExpr}; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:110 */ public abstract class AssignMultiplicativeExpr extends AssignExpr implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AssignMultiplicativeExpr clone() throws CloneNotSupportedException { AssignMultiplicativeExpr node = (AssignMultiplicativeExpr)super.clone(); node.in$Circle(false); node.is$Final(false); return node; } /** * @ast method * @aspect TypeCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:65 */ public void typeCheck() { if(sourceType().isBoolean() || getDest().type().isBoolean()) error("Multiplicative operators do not operate on boolean types"); super.typeCheck(); } /** * @ast method * */ public AssignMultiplicativeExpr() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[2]; } /** * @ast method * */ public AssignMultiplicativeExpr(Expr p0, Expr p1) { setChild(p0, 0); setChild(p1, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the Dest child. * @param node The new node to replace the Dest child. * @apilevel high-level * @ast method * */ public void setDest(Expr node) { setChild(node, 0); } /** * Retrieves the Dest child. * @return The current node used as the Dest child. * @apilevel high-level * @ast method * */ public Expr getDest() { return (Expr)getChild(0); } /** * Retrieves the Dest child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Dest child. * @apilevel low-level * @ast method * */ public Expr getDestNoTransform() { return (Expr)getChildNoTransform(0); } /** * Replaces the Source child. * @param node The new node to replace the Source child. * @apilevel high-level * @ast method * */ public void setSource(Expr node) { setChild(node, 1); } /** * Retrieves the Source child. * @return The current node used as the Source child. * @apilevel high-level * @ast method * */ public Expr getSource() { return (Expr)getChild(1); } /** * Retrieves the Source child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Source child. * @apilevel low-level * @ast method * */ public Expr getSourceNoTransform() { return (Expr)getChildNoTransform(1); } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
3,949
21.965116
103
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/AssignOrExpr.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production AssignOrExpr : {@link AssignBitwiseExpr}; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:127 */ public class AssignOrExpr extends AssignBitwiseExpr implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AssignOrExpr clone() throws CloneNotSupportedException { AssignOrExpr node = (AssignOrExpr)super.clone(); node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AssignOrExpr copy() { try { AssignOrExpr node = (AssignOrExpr) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public AssignOrExpr fullCopy() { AssignOrExpr tree = (AssignOrExpr) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:186 */ public soot.Value createAssignOp(Body b, soot.Value fst, soot.Value snd) { return b.newOrExpr(asImmediate(b, fst), asImmediate(b, snd), this); } /** * @ast method * */ public AssignOrExpr() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[2]; } /** * @ast method * */ public AssignOrExpr(Expr p0, Expr p1) { setChild(p0, 0); setChild(p1, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the Dest child. * @param node The new node to replace the Dest child. * @apilevel high-level * @ast method * */ public void setDest(Expr node) { setChild(node, 0); } /** * Retrieves the Dest child. * @return The current node used as the Dest child. * @apilevel high-level * @ast method * */ public Expr getDest() { return (Expr)getChild(0); } /** * Retrieves the Dest child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Dest child. * @apilevel low-level * @ast method * */ public Expr getDestNoTransform() { return (Expr)getChildNoTransform(0); } /** * Replaces the Source child. * @param node The new node to replace the Source child. * @apilevel high-level * @ast method * */ public void setSource(Expr node) { setChild(node, 1); } /** * Retrieves the Source child. * @return The current node used as the Source child. * @apilevel high-level * @ast method * */ public Expr getSource() { return (Expr)getChild(1); } /** * Retrieves the Source child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Source child. * @apilevel low-level * @ast method * */ public Expr getSourceNoTransform() { return (Expr)getChildNoTransform(1); } /** * @attribute syn * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:247 */ public String printOp() { ASTNode$State state = state(); try { return " |= "; } finally { } } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
5,152
22.746544
113
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/AssignPlusExpr.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production AssignPlusExpr : {@link AssignAdditiveExpr}; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:116 */ public class AssignPlusExpr extends AssignAdditiveExpr implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AssignPlusExpr clone() throws CloneNotSupportedException { AssignPlusExpr node = (AssignPlusExpr)super.clone(); node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AssignPlusExpr copy() { try { AssignPlusExpr node = (AssignPlusExpr) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public AssignPlusExpr fullCopy() { AssignPlusExpr tree = (AssignPlusExpr) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect TypeCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:71 */ public void typeCheck() { if(!getDest().isVariable()) error("left hand side is not a variable"); else if(getSource().type().isUnknown() || getDest().type().isUnknown()) return; else if(getDest().type().isString() && !(getSource().type().isVoid())) return; else if(getSource().type().isBoolean() || getDest().type().isBoolean()) error("Operator + does not operate on boolean types"); else if(getSource().type().isPrimitive() && getDest().type().isPrimitive()) return; else error("can not assign " + getDest() + " of type " + getDest().type().typeName() + " a value of type " + sourceType().typeName()); } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:84 */ public soot.Value eval(Body b) { TypeDecl dest = getDest().type(); TypeDecl source = getSource().type(); if(dest.isString()) { Value lvalue = getDest().eval(b); Value v = asImmediate(b, lvalue); // new StringBuffer(left) Local local = b.newTemp(b.newNewExpr( lookupType("java.lang", "StringBuffer").sootRef(), this)); b.setLine(this); b.add(b.newInvokeStmt( b.newSpecialInvokeExpr(local, Scene.v().getMethod("<java.lang.StringBuffer: void <init>(java.lang.String)>").makeRef(), v, this ), this)); // append right Local rightResult = b.newTemp( b.newVirtualInvokeExpr(local, lookupType("java.lang", "StringBuffer").methodWithArgs("append", new TypeDecl[] { source.stringPromotion() }).sootRef(), asImmediate(b, getSource().eval(b)), this )); // toString Local result = b.newTemp( b.newVirtualInvokeExpr(rightResult, Scene.v().getMethod("<java.lang.StringBuffer: java.lang.String toString()>").makeRef(), this )); Value v2 = lvalue instanceof Local ? lvalue : (Value)lvalue.clone(); getDest().emitStore(b, v2, result, this); return result; } else { return super.eval(b); } } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:165 */ public soot.Value createAssignOp(Body b, soot.Value fst, soot.Value snd) { return b.newAddExpr(asImmediate(b, fst), asImmediate(b, snd), this); } /** * @ast method * */ public AssignPlusExpr() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[2]; } /** * @ast method * */ public AssignPlusExpr(Expr p0, Expr p1) { setChild(p0, 0); setChild(p1, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the Dest child. * @param node The new node to replace the Dest child. * @apilevel high-level * @ast method * */ public void setDest(Expr node) { setChild(node, 0); } /** * Retrieves the Dest child. * @return The current node used as the Dest child. * @apilevel high-level * @ast method * */ public Expr getDest() { return (Expr)getChild(0); } /** * Retrieves the Dest child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Dest child. * @apilevel low-level * @ast method * */ public Expr getDestNoTransform() { return (Expr)getChildNoTransform(0); } /** * Replaces the Source child. * @param node The new node to replace the Source child. * @apilevel high-level * @ast method * */ public void setSource(Expr node) { setChild(node, 1); } /** * Retrieves the Source child. * @return The current node used as the Source child. * @apilevel high-level * @ast method * */ public Expr getSource() { return (Expr)getChild(1); } /** * Retrieves the Source child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Source child. * @apilevel low-level * @ast method * */ public Expr getSourceNoTransform() { return (Expr)getChildNoTransform(1); } /** * @attribute syn * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:247 */ public String printOp() { ASTNode$State state = state(); try { return " += "; } finally { } } /** * @attribute syn * @aspect TypeCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:109 */ public TypeDecl sourceType() { ASTNode$State state = state(); try { TypeDecl left = getDest().type(); TypeDecl right = getSource().type(); if(!left.isString() && !right.isString()) return super.sourceType(); if(left.isVoid() || right.isVoid()) return unknownType(); return left.isString() ? left : right; } finally { } } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
8,057
25.506579
130
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/AssignRShiftExpr.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production AssignRShiftExpr : {@link AssignShiftExpr}; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:121 */ public class AssignRShiftExpr extends AssignShiftExpr implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AssignRShiftExpr clone() throws CloneNotSupportedException { AssignRShiftExpr node = (AssignRShiftExpr)super.clone(); node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AssignRShiftExpr copy() { try { AssignRShiftExpr node = (AssignRShiftExpr) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public AssignRShiftExpr fullCopy() { AssignRShiftExpr tree = (AssignRShiftExpr) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:148 */ public soot.Value eval(Body b) { return emitShiftExpr(b); } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:174 */ public soot.Value createAssignOp(Body b, soot.Value fst, soot.Value snd) { return b.newShrExpr(asImmediate(b, fst), asImmediate(b, snd), this); } /** * @ast method * */ public AssignRShiftExpr() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[2]; } /** * @ast method * */ public AssignRShiftExpr(Expr p0, Expr p1) { setChild(p0, 0); setChild(p1, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the Dest child. * @param node The new node to replace the Dest child. * @apilevel high-level * @ast method * */ public void setDest(Expr node) { setChild(node, 0); } /** * Retrieves the Dest child. * @return The current node used as the Dest child. * @apilevel high-level * @ast method * */ public Expr getDest() { return (Expr)getChild(0); } /** * Retrieves the Dest child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Dest child. * @apilevel low-level * @ast method * */ public Expr getDestNoTransform() { return (Expr)getChildNoTransform(0); } /** * Replaces the Source child. * @param node The new node to replace the Source child. * @apilevel high-level * @ast method * */ public void setSource(Expr node) { setChild(node, 1); } /** * Retrieves the Source child. * @return The current node used as the Source child. * @apilevel high-level * @ast method * */ public Expr getSource() { return (Expr)getChild(1); } /** * Retrieves the Source child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Source child. * @apilevel low-level * @ast method * */ public Expr getSourceNoTransform() { return (Expr)getChildNoTransform(1); } /** * @attribute syn * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:247 */ public String printOp() { ASTNode$State state = state(); try { return " >>= "; } finally { } } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
5,433
23.367713
113
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/AssignShiftExpr.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production AssignShiftExpr : {@link AssignExpr}; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:119 */ public abstract class AssignShiftExpr extends AssignExpr implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AssignShiftExpr clone() throws CloneNotSupportedException { AssignShiftExpr node = (AssignShiftExpr)super.clone(); node.in$Circle(false); node.is$Final(false); return node; } /** * @ast method * @aspect TypeCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:92 */ public void typeCheck() { if(!sourceType().isIntegralType() || !getDest().type().isIntegralType()) error("Shift operators only operate on integral types"); super.typeCheck(); } /** * @ast method * */ public AssignShiftExpr() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[2]; } /** * @ast method * */ public AssignShiftExpr(Expr p0, Expr p1) { setChild(p0, 0); setChild(p1, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the Dest child. * @param node The new node to replace the Dest child. * @apilevel high-level * @ast method * */ public void setDest(Expr node) { setChild(node, 0); } /** * Retrieves the Dest child. * @return The current node used as the Dest child. * @apilevel high-level * @ast method * */ public Expr getDest() { return (Expr)getChild(0); } /** * Retrieves the Dest child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Dest child. * @apilevel low-level * @ast method * */ public Expr getDestNoTransform() { return (Expr)getChildNoTransform(0); } /** * Replaces the Source child. * @param node The new node to replace the Source child. * @apilevel high-level * @ast method * */ public void setSource(Expr node) { setChild(node, 1); } /** * Retrieves the Source child. * @return The current node used as the Source child. * @apilevel high-level * @ast method * */ public Expr getSource() { return (Expr)getChild(1); } /** * Retrieves the Source child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Source child. * @apilevel low-level * @ast method * */ public Expr getSourceNoTransform() { return (Expr)getChildNoTransform(1); } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
3,888
21.610465
103
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/AssignSimpleExpr.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production AssignSimpleExpr : {@link AssignExpr}; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:108 */ public class AssignSimpleExpr extends AssignExpr implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AssignSimpleExpr clone() throws CloneNotSupportedException { AssignSimpleExpr node = (AssignSimpleExpr)super.clone(); node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AssignSimpleExpr copy() { try { AssignSimpleExpr node = (AssignSimpleExpr) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public AssignSimpleExpr fullCopy() { AssignSimpleExpr tree = (AssignSimpleExpr) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect TypeCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:44 */ public void typeCheck() { if(!getDest().isVariable()) error("left hand side is not a variable"); else if(!sourceType().assignConversionTo(getDest().type(), getSource()) && !sourceType().isUnknown()) error("can not assign " + getDest() + " of type " + getDest().type().typeName() + " a value of type " + sourceType().typeName()); } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:50 */ public soot.Value eval(Body b) { Value lvalue = getDest().eval(b); Value rvalue = asRValue(b, getSource().type().emitCastTo(b, // Assign conversion getSource(), getDest().type() ) ); return getDest().emitStore(b, lvalue, asImmediate(b, rvalue), this); } /** * @ast method * @aspect UncheckedConversion * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/UncheckedConversion.jrag:30 */ public void checkWarnings() { if (!withinSuppressWarnings("unchecked")) checkUncheckedConversion(getSource().type(), getDest().type()); } /** * @ast method * */ public AssignSimpleExpr() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[2]; } /** * @ast method * */ public AssignSimpleExpr(Expr p0, Expr p1) { setChild(p0, 0); setChild(p1, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the Dest child. * @param node The new node to replace the Dest child. * @apilevel high-level * @ast method * */ public void setDest(Expr node) { setChild(node, 0); } /** * Retrieves the Dest child. * @return The current node used as the Dest child. * @apilevel high-level * @ast method * */ public Expr getDest() { return (Expr)getChild(0); } /** * Retrieves the Dest child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Dest child. * @apilevel low-level * @ast method * */ public Expr getDestNoTransform() { return (Expr)getChildNoTransform(0); } /** * Replaces the Source child. * @param node The new node to replace the Source child. * @apilevel high-level * @ast method * */ public void setSource(Expr node) { setChild(node, 1); } /** * Retrieves the Source child. * @return The current node used as the Source child. * @apilevel high-level * @ast method * */ public Expr getSource() { return (Expr)getChild(1); } /** * Retrieves the Source child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Source child. * @apilevel low-level * @ast method * */ public Expr getSourceNoTransform() { return (Expr)getChildNoTransform(1); } /** * @attribute syn * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:247 */ public String printOp() { ASTNode$State state = state(); try { return " = "; } finally { } } /** * @attribute syn * @aspect TypeCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:121 */ public TypeDecl sourceType() { ASTNode$State state = state(); try { return getSource().type(); } finally { } } /** * @attribute inh * @aspect SuppressWarnings * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/SuppressWarnings.jrag:15 */ @SuppressWarnings({"unchecked", "cast"}) public boolean withinSuppressWarnings(String s) { ASTNode$State state = state(); boolean withinSuppressWarnings_String_value = getParent().Define_boolean_withinSuppressWarnings(this, null, s); return withinSuppressWarnings_String_value; } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:17 * @apilevel internal */ public boolean Define_boolean_isDest(ASTNode caller, ASTNode child) { if(caller == getDestNoTransform()) { return true; } else { return super.Define_boolean_isDest(caller, child); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:27 * @apilevel internal */ public boolean Define_boolean_isSource(ASTNode caller, ASTNode child) { if(caller == getDestNoTransform()) { return false; } else { return super.Define_boolean_isSource(caller, child); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericMethodsInference.jrag:36 * @apilevel internal */ public TypeDecl Define_TypeDecl_assignConvertedType(ASTNode caller, ASTNode child) { if(caller == getSourceNoTransform()) { return getDest().type(); } else { return getParent().Define_TypeDecl_assignConvertedType(this, caller); } } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
8,100
26.003333
117
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/AssignURShiftExpr.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production AssignURShiftExpr : {@link AssignShiftExpr}; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:122 */ public class AssignURShiftExpr extends AssignShiftExpr implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AssignURShiftExpr clone() throws CloneNotSupportedException { AssignURShiftExpr node = (AssignURShiftExpr)super.clone(); node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AssignURShiftExpr copy() { try { AssignURShiftExpr node = (AssignURShiftExpr) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public AssignURShiftExpr fullCopy() { AssignURShiftExpr tree = (AssignURShiftExpr) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:149 */ public soot.Value eval(Body b) { return emitShiftExpr(b); } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:177 */ public soot.Value createAssignOp(Body b, soot.Value fst, soot.Value snd) { return b.newUshrExpr(asImmediate(b, fst), asImmediate(b, snd), this); } /** * @ast method * */ public AssignURShiftExpr() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[2]; } /** * @ast method * */ public AssignURShiftExpr(Expr p0, Expr p1) { setChild(p0, 0); setChild(p1, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the Dest child. * @param node The new node to replace the Dest child. * @apilevel high-level * @ast method * */ public void setDest(Expr node) { setChild(node, 0); } /** * Retrieves the Dest child. * @return The current node used as the Dest child. * @apilevel high-level * @ast method * */ public Expr getDest() { return (Expr)getChild(0); } /** * Retrieves the Dest child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Dest child. * @apilevel low-level * @ast method * */ public Expr getDestNoTransform() { return (Expr)getChildNoTransform(0); } /** * Replaces the Source child. * @param node The new node to replace the Source child. * @apilevel high-level * @ast method * */ public void setSource(Expr node) { setChild(node, 1); } /** * Retrieves the Source child. * @return The current node used as the Source child. * @apilevel high-level * @ast method * */ public Expr getSource() { return (Expr)getChild(1); } /** * Retrieves the Source child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Source child. * @apilevel low-level * @ast method * */ public Expr getSourceNoTransform() { return (Expr)getChildNoTransform(1); } /** * @attribute syn * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:247 */ public String printOp() { ASTNode$State state = state(); try { return " >>>= "; } finally { } } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
5,448
23.434978
113
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/AssignXorExpr.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production AssignXorExpr : {@link AssignBitwiseExpr}; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:126 */ public class AssignXorExpr extends AssignBitwiseExpr implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AssignXorExpr clone() throws CloneNotSupportedException { AssignXorExpr node = (AssignXorExpr)super.clone(); node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public AssignXorExpr copy() { try { AssignXorExpr node = (AssignXorExpr) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public AssignXorExpr fullCopy() { AssignXorExpr tree = (AssignXorExpr) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:183 */ public soot.Value createAssignOp(Body b, soot.Value fst, soot.Value snd) { return b.newXorExpr(asImmediate(b, fst), asImmediate(b, snd), this); } /** * @ast method * */ public AssignXorExpr() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[2]; } /** * @ast method * */ public AssignXorExpr(Expr p0, Expr p1) { setChild(p0, 0); setChild(p1, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the Dest child. * @param node The new node to replace the Dest child. * @apilevel high-level * @ast method * */ public void setDest(Expr node) { setChild(node, 0); } /** * Retrieves the Dest child. * @return The current node used as the Dest child. * @apilevel high-level * @ast method * */ public Expr getDest() { return (Expr)getChild(0); } /** * Retrieves the Dest child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Dest child. * @apilevel low-level * @ast method * */ public Expr getDestNoTransform() { return (Expr)getChildNoTransform(0); } /** * Replaces the Source child. * @param node The new node to replace the Source child. * @apilevel high-level * @ast method * */ public void setSource(Expr node) { setChild(node, 1); } /** * Retrieves the Source child. * @return The current node used as the Source child. * @apilevel high-level * @ast method * */ public Expr getSource() { return (Expr)getChild(1); } /** * Retrieves the Source child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Source child. * @apilevel low-level * @ast method * */ public Expr getSourceNoTransform() { return (Expr)getChildNoTransform(1); } /** * @attribute syn * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:247 */ public String printOp() { ASTNode$State state = state(); try { return " ^= "; } finally { } } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
5,166
22.81106
113
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/Attributes.java
package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @ast class * */ public class Attributes extends java.lang.Object { protected BytecodeParser p; protected boolean isSynthetic; protected Attributes(BytecodeParser parser) { p = parser; isSynthetic = false; } protected void processAttribute(String attribute_name, int attribute_length) { if(attribute_name.equals("Synthetic")) { isSynthetic = true; } else { this.p.skip(attribute_length); } } protected void attributes() { int attributes_count = p.u2(); if(BytecodeParser.VERBOSE) p.println(" " + attributes_count + " attributes:"); for (int j = 0; j < attributes_count; j++) { int attribute_name_index = p.u2(); int attribute_length = p.u4(); String attribute_name = p.getCONSTANT_Utf8_Info(attribute_name_index).string(); if(BytecodeParser.VERBOSE) p.println(" Attribute: " + attribute_name + ", length: " + attribute_length); processAttribute(attribute_name, attribute_length); } } public boolean isSynthetic() { return isSynthetic; } // 4.8.15.1 protected ElementValue readElementValue() { char c = (char)p.u1(); switch (c) { case 'e': int type_name_index = this.p.u2(); String type_name = this.p.getCONSTANT_Utf8_Info(type_name_index).string(); // remove inital L and trailing ; Access typeAccess = this.p.fromClassName(type_name.substring(1, type_name.length() - 1)); int const_name_index = this.p.u2(); String const_name = this.p.getCONSTANT_Utf8_Info(const_name_index).string(); return new ElementConstantValue(typeAccess.qualifiesAccess(new VarAccess(const_name))); case 'B': case 'C': case 'D': case 'F': case 'I': case 'J': case 'S': case 'Z': case 's': int const_value_index = p.u2(); Expr e = this.p.getCONSTANT_Info(const_value_index).expr(); return new ElementConstantValue(e); case 'c': int class_info_index = p.u2(); String descriptor = this.p.getCONSTANT_Utf8_Info(class_info_index).string(); e = new TypeDescriptor(p, descriptor).type(); return new ElementConstantValue(e); case '@': return new ElementAnnotationValue(readAnnotation()); case '[': int index = p.u2(); List list = new List(); for(int i = 0; i < index; i++) list.add(readElementValue()); return new ElementArrayValue(list); default: throw new Error("AnnotationDefault tag " + c + " not supported"); } } // 4.8.15 protected Annotation readAnnotation() { Access typeAccess = new FieldDescriptor(p, "").type(); int num_element_value_pairs = p.u2(); List list = new List(); for(int i = 0; i < num_element_value_pairs; i++) { int element_name_index = p.u2(); String element_name = p.getCONSTANT_Utf8_Info(element_name_index).string(); ElementValue element_value = readElementValue(); list.add(new ElementValuePair(element_name, element_value)); } return new Annotation("Annotation", typeAccess, list); } public static class FieldAttributes extends Attributes { protected CONSTANT_Info constantValue; public java.util.ArrayList annotations; public Signatures.FieldSignature fieldSignature; public FieldAttributes(BytecodeParser p) { super(p); attributes(); } protected void processAttribute(String attribute_name, int attribute_length) { if(attribute_name.equals("ConstantValue") && attribute_length == 2) { int constantvalue_index = p.u2(); constantValue = p.getCONSTANT_Info(constantvalue_index); } else if(attribute_name.equals("RuntimeVisibleAnnotations")) { int num_annotations = p.u2(); if(annotations == null) annotations = new java.util.ArrayList(); for(int j = 0; j < num_annotations; j++) annotations.add(readAnnotation()); } else if(attribute_name.equals("RuntimeInvisibleAnnotations")) { int num_annotations = p.u2(); if(annotations == null) annotations = new java.util.ArrayList(); for(int j = 0; j < num_annotations; j++) annotations.add(readAnnotation()); } else if(attribute_name.equals("Signature")) { int signature_index = p.u2(); String s = p.getCONSTANT_Utf8_Info(signature_index).string(); fieldSignature = new Signatures.FieldSignature(s); } else { super.processAttribute(attribute_name, attribute_length); } } public CONSTANT_Info constantValue() { return constantValue; } } public static class MethodAttributes extends Attributes { protected List exceptionList; protected ElementValue elementValue; public Signatures.MethodSignature methodSignature; public java.util.ArrayList annotations; public java.util.ArrayList[] parameterAnnotations; public MethodAttributes(BytecodeParser p) { super(p); attributes(); } protected void processAttribute(String attribute_name, int attribute_length) { if(attribute_name.equals("Exceptions")) { parseExceptions(); } else if(attribute_name.equals("AnnotationDefault")) { annotationDefault(); } else if(attribute_name.equals("Signature")) { int signature_index = p.u2(); String s = p.getCONSTANT_Utf8_Info(signature_index).string(); methodSignature = new Signatures.MethodSignature(s); } else if(attribute_name.equals("RuntimeVisibleAnnotations")) { int num_annotations = p.u2(); if(annotations == null) annotations = new java.util.ArrayList(); for(int j = 0; j < num_annotations; j++) annotations.add(readAnnotation()); } else if(attribute_name.equals("RuntimeInvisibleAnnotations")) { int num_annotations = p.u2(); if(annotations == null) annotations = new java.util.ArrayList(); for(int j = 0; j < num_annotations; j++) annotations.add(readAnnotation()); } else if(attribute_name.equals("RuntimeVisibleParameterAnnotations")) { int num_parameters = p.u1(); if(parameterAnnotations == null) parameterAnnotations = new java.util.ArrayList[num_parameters]; for(int i = 0; i < num_parameters; i++) { if(parameterAnnotations[i] == null) parameterAnnotations[i] = new java.util.ArrayList(); int num_annotations = p.u2(); for(int j = 0; j < num_annotations; j++) parameterAnnotations[i].add(readAnnotation()); } } else if(attribute_name.equals("RuntimeInvisibleParameterAnnotations")) { int num_parameters = p.u1(); if(parameterAnnotations == null) parameterAnnotations = new java.util.ArrayList[num_parameters]; for(int i = 0; i < num_parameters; i++) { if(parameterAnnotations[i] == null) parameterAnnotations[i] = new java.util.ArrayList(); int num_annotations = p.u2(); for(int j = 0; j < num_annotations; j++) parameterAnnotations[i].add(readAnnotation()); } } /* else if(attribute_name.equals("RuntimeVisibleExtendedAnnotations")) { int num_annotations = p.u2(); java.util.ArrayList extendedAnnotations = new java.util.ArrayList(); for(int j = 0; j < num_annotations; j++) { extendedAnnotations.add(readAnnotation()); } int kind = p.u1(); if(kind == 0x06) System.out.println("Found receiver annotation"); if(kind >= 0x00 && kind <= 0x05) // typecast, instaceof, new p.u2(); // skip 2 else if(kind == 0x08 || kind == 0x09) { // local variable int table_length = p.u2(); for(int i = 0; i < table_length; i++) p.skip(6); } else if(kind >= 0x10 && kind <= 0x13) // bound p.skip(2); else if(kind >= 0x14 && kind <= 0x15) // extends, implements p.skip(1); else if(kind >= 0x16 && kind <= 0x17) // throws p.skip(1); this.p.skip(attribute_length); } */ else { super.processAttribute(attribute_name, attribute_length); } } private void parseExceptions() { int number_of_exceptions = p.u2(); exceptionList = new List(); if(BytecodeParser.VERBOSE) p.println(" " + number_of_exceptions + " exceptions:"); for (int i = 0; i < number_of_exceptions; i++) { CONSTANT_Class_Info exception = p.getCONSTANT_Class_Info(p.u2()); if(BytecodeParser.VERBOSE) p.println(" exception " + exception.name()); exceptionList.add(exception.access()); } } public List exceptionList() { return exceptionList != null ? exceptionList : new List(); } public ElementValue elementValue() { return elementValue; } // 4.8.19 private void annotationDefault() { elementValue = readElementValue(); } } public static class TypeAttributes extends Attributes { TypeDecl typeDecl; TypeDecl outerTypeDecl; Program classPath; private boolean isInnerClass; public TypeAttributes(BytecodeParser p, TypeDecl typeDecl, TypeDecl outerTypeDecl, Program classPath) { super(p); this.typeDecl = typeDecl; this.outerTypeDecl = outerTypeDecl; this.classPath = classPath; attributes(); } public boolean isInnerClass() { return isInnerClass; } protected void processAttribute(String attribute_name, int attribute_length) { if(attribute_name.equals("InnerClasses")) { innerClasses(); } else if(attribute_name.equals("Signature")) { int signature_index = p.u2(); String s = p.getCONSTANT_Utf8_Info(signature_index).string(); Signatures.ClassSignature classSignature = new Signatures.ClassSignature(s); typeDecl = typeDecl.makeGeneric(classSignature); } else if(attribute_name.equals("RuntimeVisibleAnnotations")) { int num_annotations = p.u2(); //System.out.println("RuntimeVisibleAnnotations: " + num_annotations); for(int j = 0; j < num_annotations; j++) { Annotation a = readAnnotation(); typeDecl.getModifiers().addModifier(a); } } else if(attribute_name.equals("RuntimeInvisibleAnnotations")) { int num_annotations = p.u2(); //System.out.println("RuntimeInvisibleAnnotations: " + num_annotations); for(int j = 0; j < num_annotations; j++) { Annotation a = readAnnotation(); typeDecl.getModifiers().addModifier(a); } } else { super.processAttribute(attribute_name, attribute_length); } } protected void innerClasses() { int number_of_classes = this.p.u2(); if(BytecodeParser.VERBOSE) p.println(" Number of classes: " + number_of_classes); for (int i = 0; i < number_of_classes; i++) { if(BytecodeParser.VERBOSE) p.print(" " + i + "(" + number_of_classes + ")" + ":"); int inner_class_info_index = this.p.u2(); int outer_class_info_index = this.p.u2(); int inner_name_index = this.p.u2(); int inner_class_access_flags = this.p.u2(); if(inner_class_info_index > 0) { CONSTANT_Class_Info inner_class_info = this.p.getCONSTANT_Class_Info(inner_class_info_index); String inner_class_name = inner_class_info.name(); String inner_name = inner_class_name.substring(inner_class_name.lastIndexOf("$")+1); String outer_class_name; if (outer_class_info_index > 0) { CONSTANT_Class_Info outer_class_info = this.p.getCONSTANT_Class_Info(outer_class_info_index); if(inner_class_info == null || outer_class_info == null) { System.out.println("Null"); } outer_class_name = outer_class_info.name(); if(BytecodeParser.VERBOSE) this.p.println(" inner: " + inner_class_name + ", outer: " + outer_class_name); } else { //anonymous inner class; need to infer outer_class_name from inner_class_name outer_class_name = inner_class_name.substring(0,inner_class_name.lastIndexOf("$")); } if (inner_class_info.name().equals(p.classInfo.name())) { if(BytecodeParser.VERBOSE) p.println(" Class " + inner_class_name + " is inner (" + inner_name + ")"); typeDecl.setID(inner_name); typeDecl.setModifiers(BytecodeParser.modifiers(inner_class_access_flags & 0x041f)); if (this.p.outerClassName != null && this.p.outerClassName.equals(outer_class_name)) { MemberTypeDecl m = null; if (typeDecl instanceof ClassDecl) { m = new MemberClassDecl((ClassDecl)typeDecl); outerTypeDecl.addBodyDecl(m); } else if (typeDecl instanceof InterfaceDecl) { m = new MemberInterfaceDecl((InterfaceDecl)typeDecl); outerTypeDecl.addBodyDecl(m); } } else { isInnerClass = true; } } if (outer_class_name.equals(this.p.classInfo.name())) { if(BytecodeParser.VERBOSE) p.println(" Class " + this.p.classInfo.name() + " has inner class: " + inner_class_name); if(BytecodeParser.VERBOSE) p.println("Begin processing: " + inner_class_name); try { java.io.InputStream is=null; try{ is = classPath.getInputStream(inner_class_name); if(is != null) { BytecodeParser p = new BytecodeParser(is, this.p.name); p.parse(typeDecl, outer_class_name, classPath, (inner_class_access_flags & Flags.ACC_STATIC) == 0); } else { p.println("Error: ClassFile " + inner_class_name + " not found"); } } catch(Error e) { if(!e.getMessage().startsWith("Could not find nested type")) { throw e; } } finally { if(is != null){ is.close(); is = null; } } } catch (FileNotFoundException e) { System.out.println("Error: " + inner_class_name + " not found"); } catch (Exception e) { throw new RuntimeException(e); } if(BytecodeParser.VERBOSE) p.println("End processing: " + inner_class_name); } } } if(BytecodeParser.VERBOSE) p.println(" end"); } } }
15,849
35.104784
115
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/BasicCatch.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * A catch clause that can catch a single exception type. * @production BasicCatch : {@link CatchClause} ::= <span class="component">Parameter:{@link ParameterDeclaration}</span> <span class="component">{@link Block}</span>; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.ast:9 */ public class BasicCatch extends CatchClause implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); parameterDeclaration_String_values = null; label_computed = false; label_value = null; } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public BasicCatch clone() throws CloneNotSupportedException { BasicCatch node = (BasicCatch)super.clone(); node.parameterDeclaration_String_values = null; node.label_computed = false; node.label_value = null; node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public BasicCatch copy() { try { BasicCatch node = (BasicCatch) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public BasicCatch fullCopy() { BasicCatch tree = (BasicCatch) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:722 */ public void toString(StringBuffer s) { s.append("catch ("); getParameter().toString(s); s.append(") "); getBlock().toString(s); } /** * @ast method * @aspect TypeCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:368 */ public void typeCheck() { if(!getParameter().type().instanceOf(typeThrowable())) error("*** The catch variable must extend Throwable"); } /** * @ast method * @aspect Statements * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:470 */ public void jimplify2(Body b) { b.addLabel(label()); Local local = b.newLocal(getParameter().name(), getParameter().type().getSootType()); b.setLine(this); b.add(b.newIdentityStmt(local, b.newCaughtExceptionRef(getParameter()), this)); getParameter().local = local; getBlock().jimplify2(b); } /** * @ast method * @aspect PreciseRethrow * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/PreciseRethrow.jrag:198 */ void checkUnreachableStmt() { if (!getBlock().reachable() && reportUnreachable()) error("the exception "+getParameter().type().fullName()+ " is not thrown in the body of the try statement"); } /** * @ast method * */ public BasicCatch() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[2]; } /** * @ast method * */ public BasicCatch(ParameterDeclaration p0, Block p1) { setChild(p0, 0); setChild(p1, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the Parameter child. * @param node The new node to replace the Parameter child. * @apilevel high-level * @ast method * */ public void setParameter(ParameterDeclaration node) { setChild(node, 0); } /** * Retrieves the Parameter child. * @return The current node used as the Parameter child. * @apilevel high-level * @ast method * */ public ParameterDeclaration getParameter() { return (ParameterDeclaration)getChild(0); } /** * Retrieves the Parameter child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Parameter child. * @apilevel low-level * @ast method * */ public ParameterDeclaration getParameterNoTransform() { return (ParameterDeclaration)getChildNoTransform(0); } /** * Replaces the Block child. * @param node The new node to replace the Block child. * @apilevel high-level * @ast method * */ public void setBlock(Block node) { setChild(node, 1); } /** * Retrieves the Block child. * @return The current node used as the Block child. * @apilevel high-level * @ast method * */ public Block getBlock() { return (Block)getChild(1); } /** * Retrieves the Block child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Block child. * @apilevel low-level * @ast method * */ public Block getBlockNoTransform() { return (Block)getChildNoTransform(1); } /** * @attribute syn * @aspect ExceptionHandling * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ExceptionHandling.jrag:212 */ public boolean handles(TypeDecl exceptionType) { ASTNode$State state = state(); try { return !getParameter().type().isUnknown() && exceptionType.instanceOf(getParameter().type()); } finally { } } protected java.util.Map parameterDeclaration_String_values; /** * @attribute syn * @aspect VariableScope * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupVariable.jrag:113 */ @SuppressWarnings({"unchecked", "cast"}) public SimpleSet parameterDeclaration(String name) { Object _parameters = name; if(parameterDeclaration_String_values == null) parameterDeclaration_String_values = new java.util.HashMap(4); if(parameterDeclaration_String_values.containsKey(_parameters)) { return (SimpleSet)parameterDeclaration_String_values.get(_parameters); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); SimpleSet parameterDeclaration_String_value = parameterDeclaration_compute(name); if(isFinal && num == state().boundariesCrossed) parameterDeclaration_String_values.put(_parameters, parameterDeclaration_String_value); return parameterDeclaration_String_value; } /** * @apilevel internal */ private SimpleSet parameterDeclaration_compute(String name) { return getParameter().name().equals(name) ? getParameter() : SimpleSet.emptySet; } /** * @apilevel internal */ protected boolean label_computed = false; /** * @apilevel internal */ protected soot.jimple.Stmt label_value; /** * @attribute syn * @aspect Statements * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:469 */ @SuppressWarnings({"unchecked", "cast"}) public soot.jimple.Stmt label() { if(label_computed) { return label_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); label_value = label_compute(); if(isFinal && num == state().boundariesCrossed) label_computed = true; return label_value; } /** * @apilevel internal */ private soot.jimple.Stmt label_compute() { return newLabel(); } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupVariable.jrag:83 * @apilevel internal */ public SimpleSet Define_SimpleSet_lookupVariable(ASTNode caller, ASTNode child, String name) { if(caller == getParameterNoTransform()) { return parameterDeclaration(name); } else { return super.Define_SimpleSet_lookupVariable(caller, child, name); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:295 * @apilevel internal */ public VariableScope Define_VariableScope_outerScope(ASTNode caller, ASTNode child) { if(caller == getParameterNoTransform()) { return this; } else { return getParent().Define_VariableScope_outerScope(this, caller); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/SyntacticClassification.jrag:86 * @apilevel internal */ public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) { if(caller == getParameterNoTransform()) { return NameType.TYPE_NAME; } else { return getParent().Define_NameType_nameType(this, caller); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/UnreachableStatements.jrag:122 * @apilevel internal */ public boolean Define_boolean_reachable(ASTNode caller, ASTNode child) { if(caller == getBlockNoTransform()) { return reachableCatchClause(getParameter().type()); } else { return getParent().Define_boolean_reachable(this, caller); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/VariableDeclaration.jrag:64 * @apilevel internal */ public boolean Define_boolean_isMethodParameter(ASTNode caller, ASTNode child) { if(caller == getParameterNoTransform()) { return false; } else { return getParent().Define_boolean_isMethodParameter(this, caller); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/VariableDeclaration.jrag:65 * @apilevel internal */ public boolean Define_boolean_isConstructorParameter(ASTNode caller, ASTNode child) { if(caller == getParameterNoTransform()) { return false; } else { return getParent().Define_boolean_isConstructorParameter(this, caller); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/VariableDeclaration.jrag:66 * @apilevel internal */ public boolean Define_boolean_isExceptionHandlerParameter(ASTNode caller, ASTNode child) { if(caller == getParameterNoTransform()) { return true; } else { return getParent().Define_boolean_isExceptionHandlerParameter(this, caller); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/VariableArityParameters.jrag:23 * @apilevel internal */ public boolean Define_boolean_variableArityValid(ASTNode caller, ASTNode child) { if(caller == getParameterNoTransform()) { return false; } else { return getParent().Define_boolean_variableArityValid(this, caller); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/PreciseRethrow.jrag:52 * @apilevel internal */ public boolean Define_boolean_inhModifiedInScope(ASTNode caller, ASTNode child, Variable var) { if(caller == getParameterNoTransform()) { return getBlock().modifiedInScope(var); } else { return getParent().Define_boolean_inhModifiedInScope(this, caller, var); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/PreciseRethrow.jrag:125 * @apilevel internal */ public boolean Define_boolean_isCatchParam(ASTNode caller, ASTNode child) { if(caller == getParameterNoTransform()) { return true; } else { return getParent().Define_boolean_isCatchParam(this, caller); } } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
13,020
29.782506
167
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/Binary.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production Binary : {@link Expr} ::= <span class="component">LeftOperand:{@link Expr}</span> <span class="component">RightOperand:{@link Expr}</span>; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:150 */ public abstract class Binary extends Expr implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); isConstant_visited = -1; isConstant_computed = false; isConstant_initialized = false; isDAafterTrue_Variable_values = null; isDAafterFalse_Variable_values = null; isDAafter_Variable_values = null; isDUafter_Variable_values = null; isDUbefore_Variable_values = null; } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public Binary clone() throws CloneNotSupportedException { Binary node = (Binary)super.clone(); node.isConstant_visited = -1; node.isConstant_computed = false; node.isConstant_initialized = false; node.isDAafterTrue_Variable_values = null; node.isDAafterFalse_Variable_values = null; node.isDAafter_Variable_values = null; node.isDUafter_Variable_values = null; node.isDUbefore_Variable_values = null; node.in$Circle(false); node.is$Final(false); return node; } /** * @ast method * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:394 */ public void toString(StringBuffer s) { getLeftOperand().toString(s); s.append(printOp()); getRightOperand().toString(s); } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:772 */ public soot.Value eval(Body b) { return asLocal(b, emitOperation(b, getLeftOperand().type().emitCastTo(b, // Binary numeric promotion getLeftOperand(), type() ), getRightOperand().type().emitCastTo(b, // Binary numeric promotion getRightOperand(), type() ) )); } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:785 */ public soot.Value emitShiftExpr(Body b) { return asLocal(b, emitOperation(b, getLeftOperand().type().emitCastTo(b, // Binary numeric promotion getLeftOperand(), type() ), getRightOperand().type().emitCastTo(b, getRightOperand(), typeInt() ) )); } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:802 */ public soot.Value emitOperation(Body b, soot.Value left, soot.Value right) { throw new Error("emitOperation not implemented in " + getClass().getName()); } /** * @ast method * */ public Binary() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[2]; } /** * @ast method * */ public Binary(Expr p0, Expr p1) { setChild(p0, 0); setChild(p1, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the LeftOperand child. * @param node The new node to replace the LeftOperand child. * @apilevel high-level * @ast method * */ public void setLeftOperand(Expr node) { setChild(node, 0); } /** * Retrieves the LeftOperand child. * @return The current node used as the LeftOperand child. * @apilevel high-level * @ast method * */ public Expr getLeftOperand() { return (Expr)getChild(0); } /** * Retrieves the LeftOperand child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the LeftOperand child. * @apilevel low-level * @ast method * */ public Expr getLeftOperandNoTransform() { return (Expr)getChildNoTransform(0); } /** * Replaces the RightOperand child. * @param node The new node to replace the RightOperand child. * @apilevel high-level * @ast method * */ public void setRightOperand(Expr node) { setChild(node, 1); } /** * Retrieves the RightOperand child. * @return The current node used as the RightOperand child. * @apilevel high-level * @ast method * */ public Expr getRightOperand() { return (Expr)getChild(1); } /** * Retrieves the RightOperand child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the RightOperand child. * @apilevel low-level * @ast method * */ public Expr getRightOperandNoTransform() { return (Expr)getChildNoTransform(1); } /** * @ast method * @aspect ConstantExpression * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:370 */ private TypeDecl refined_ConstantExpression_Binary_binaryNumericPromotedType() { TypeDecl leftType = left().type(); TypeDecl rightType = right().type(); if(leftType.isString()) return leftType; if(rightType.isString()) return rightType; if(leftType.isNumericType() && rightType.isNumericType()) return leftType.binaryNumericPromotion(rightType); if(leftType.isBoolean() && rightType.isBoolean()) return leftType; return unknownType(); } /** * @attribute syn * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:400 */ @SuppressWarnings({"unchecked", "cast"}) public abstract String printOp(); /** * @apilevel internal */ protected int isConstant_visited = -1; /** * @apilevel internal */ protected boolean isConstant_computed = false; /** * @apilevel internal */ protected boolean isConstant_initialized = false; /** * @apilevel internal */ protected boolean isConstant_value; /** * @attribute syn * @aspect ConstantExpression * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:345 */ @SuppressWarnings({"unchecked", "cast"}) public boolean isConstant() { if(isConstant_computed) { return isConstant_value; } ASTNode$State state = state(); if (!isConstant_initialized) { isConstant_initialized = true; isConstant_value = false; } if (!state.IN_CIRCLE) { state.IN_CIRCLE = true; int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); do { isConstant_visited = state.CIRCLE_INDEX; state.CHANGE = false; boolean new_isConstant_value = isConstant_compute(); if (new_isConstant_value!=isConstant_value) state.CHANGE = true; isConstant_value = new_isConstant_value; state.CIRCLE_INDEX++; } while (state.CHANGE); if(isFinal && num == state().boundariesCrossed) { isConstant_computed = true; } else { state.RESET_CYCLE = true; isConstant_compute(); state.RESET_CYCLE = false; isConstant_computed = false; isConstant_initialized = false; } state.IN_CIRCLE = false; return isConstant_value; } if(isConstant_visited != state.CIRCLE_INDEX) { isConstant_visited = state.CIRCLE_INDEX; if (state.RESET_CYCLE) { isConstant_computed = false; isConstant_initialized = false; isConstant_visited = -1; return isConstant_value; } boolean new_isConstant_value = isConstant_compute(); if (new_isConstant_value!=isConstant_value) state.CHANGE = true; isConstant_value = new_isConstant_value; return isConstant_value; } return isConstant_value; } /** * @apilevel internal */ private boolean isConstant_compute() { return getLeftOperand().isConstant() && getRightOperand().isConstant(); } /** * @attribute syn * @aspect ConstantExpression * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:368 */ public Expr left() { ASTNode$State state = state(); try { return getLeftOperand(); } finally { } } /** * @attribute syn * @aspect ConstantExpression * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:369 */ public Expr right() { ASTNode$State state = state(); try { return getRightOperand(); } finally { } } /** * @attribute syn * @aspect ConstantExpression * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:370 */ public TypeDecl binaryNumericPromotedType() { ASTNode$State state = state(); try { TypeDecl leftType = left().type(); TypeDecl rightType = right().type(); if(leftType.isBoolean() && rightType.isBoolean()) { return leftType.isReferenceType() ? leftType.unboxed() : leftType; } return refined_ConstantExpression_Binary_binaryNumericPromotedType(); } finally { } } protected java.util.Map isDAafterTrue_Variable_values; /** * @attribute syn * @aspect DA * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:401 */ @SuppressWarnings({"unchecked", "cast"}) public boolean isDAafterTrue(Variable v) { Object _parameters = v; if(isDAafterTrue_Variable_values == null) isDAafterTrue_Variable_values = new java.util.HashMap(4); if(isDAafterTrue_Variable_values.containsKey(_parameters)) { return ((Boolean)isDAafterTrue_Variable_values.get(_parameters)).booleanValue(); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean isDAafterTrue_Variable_value = isDAafterTrue_compute(v); if(isFinal && num == state().boundariesCrossed) isDAafterTrue_Variable_values.put(_parameters, Boolean.valueOf(isDAafterTrue_Variable_value)); return isDAafterTrue_Variable_value; } /** * @apilevel internal */ private boolean isDAafterTrue_compute(Variable v) { return getRightOperand().isDAafter(v) || isFalse(); } protected java.util.Map isDAafterFalse_Variable_values; /** * @attribute syn * @aspect DA * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:402 */ @SuppressWarnings({"unchecked", "cast"}) public boolean isDAafterFalse(Variable v) { Object _parameters = v; if(isDAafterFalse_Variable_values == null) isDAafterFalse_Variable_values = new java.util.HashMap(4); if(isDAafterFalse_Variable_values.containsKey(_parameters)) { return ((Boolean)isDAafterFalse_Variable_values.get(_parameters)).booleanValue(); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean isDAafterFalse_Variable_value = isDAafterFalse_compute(v); if(isFinal && num == state().boundariesCrossed) isDAafterFalse_Variable_values.put(_parameters, Boolean.valueOf(isDAafterFalse_Variable_value)); return isDAafterFalse_Variable_value; } /** * @apilevel internal */ private boolean isDAafterFalse_compute(Variable v) { return getRightOperand().isDAafter(v) || isTrue(); } protected java.util.Map isDAafter_Variable_values; /** * @attribute syn * @aspect DA * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:404 */ @SuppressWarnings({"unchecked", "cast"}) public boolean isDAafter(Variable v) { Object _parameters = v; if(isDAafter_Variable_values == null) isDAafter_Variable_values = new java.util.HashMap(4); if(isDAafter_Variable_values.containsKey(_parameters)) { return ((Boolean)isDAafter_Variable_values.get(_parameters)).booleanValue(); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean isDAafter_Variable_value = isDAafter_compute(v); if(isFinal && num == state().boundariesCrossed) isDAafter_Variable_values.put(_parameters, Boolean.valueOf(isDAafter_Variable_value)); return isDAafter_Variable_value; } /** * @apilevel internal */ private boolean isDAafter_compute(Variable v) { return getRightOperand().isDAafter(v); } protected java.util.Map isDUafter_Variable_values; /** * @attribute syn * @aspect DU * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:845 */ @SuppressWarnings({"unchecked", "cast"}) public boolean isDUafter(Variable v) { Object _parameters = v; if(isDUafter_Variable_values == null) isDUafter_Variable_values = new java.util.HashMap(4); if(isDUafter_Variable_values.containsKey(_parameters)) { return ((Boolean)isDUafter_Variable_values.get(_parameters)).booleanValue(); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean isDUafter_Variable_value = isDUafter_compute(v); if(isFinal && num == state().boundariesCrossed) isDUafter_Variable_values.put(_parameters, Boolean.valueOf(isDUafter_Variable_value)); return isDUafter_Variable_value; } /** * @apilevel internal */ private boolean isDUafter_compute(Variable v) { return getRightOperand().isDUafter(v); } protected java.util.Map isDUbefore_Variable_values; /** * @attribute inh * @aspect DU * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:696 */ @SuppressWarnings({"unchecked", "cast"}) public boolean isDUbefore(Variable v) { Object _parameters = v; if(isDUbefore_Variable_values == null) isDUbefore_Variable_values = new java.util.HashMap(4); if(isDUbefore_Variable_values.containsKey(_parameters)) { return ((Boolean)isDUbefore_Variable_values.get(_parameters)).booleanValue(); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean isDUbefore_Variable_value = getParent().Define_boolean_isDUbefore(this, null, v); if(isFinal && num == state().boundariesCrossed) isDUbefore_Variable_values.put(_parameters, Boolean.valueOf(isDUbefore_Variable_value)); return isDUbefore_Variable_value; } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:405 * @apilevel internal */ public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v) { if(caller == getRightOperandNoTransform()) { return getLeftOperand().isDAafter(v); } else { return getParent().Define_boolean_isDAbefore(this, caller, v); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:846 * @apilevel internal */ public boolean Define_boolean_isDUbefore(ASTNode caller, ASTNode child, Variable v) { if(caller == getRightOperandNoTransform()) { return getLeftOperand().isDUafter(v); } else { return getParent().Define_boolean_isDUbefore(this, caller, v); } } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
16,529
31.348337
154
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/BitNotExpr.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production BitNotExpr : {@link Unary}; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:141 */ public class BitNotExpr extends Unary implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); type_computed = false; type_value = null; } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public BitNotExpr clone() throws CloneNotSupportedException { BitNotExpr node = (BitNotExpr)super.clone(); node.type_computed = false; node.type_value = null; node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public BitNotExpr copy() { try { BitNotExpr node = (BitNotExpr) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public BitNotExpr fullCopy() { BitNotExpr tree = (BitNotExpr) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect TypeCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:281 */ public void typeCheck() { if(!getOperand().type().isIntegralType()) error("unary ~ only operates on integral types"); } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:696 */ public soot.Value eval(Body b) { soot.Value v = IntType.emitConstant(-1); soot.Local result = asLocal(b, b.newXorExpr( asImmediate(b, typeInt().emitCastTo(b, v, type(), this)), asImmediate(b, getOperand().eval(b)), this ) ); return result; } /** * @ast method * */ public BitNotExpr() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[1]; } /** * @ast method * */ public BitNotExpr(Expr p0) { setChild(p0, 0); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 1; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the Operand child. * @param node The new node to replace the Operand child. * @apilevel high-level * @ast method * */ public void setOperand(Expr node) { setChild(node, 0); } /** * Retrieves the Operand child. * @return The current node used as the Operand child. * @apilevel high-level * @ast method * */ public Expr getOperand() { return (Expr)getChild(0); } /** * Retrieves the Operand child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Operand child. * @apilevel low-level * @ast method * */ public Expr getOperandNoTransform() { return (Expr)getChildNoTransform(0); } /** * @attribute syn * @aspect ConstantExpression * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:91 */ public Constant constant() { ASTNode$State state = state(); try { return type().bitNot(getOperand().constant()); } finally { } } /** * @attribute syn * @aspect ConstantExpression * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:336 */ public boolean isConstant() { ASTNode$State state = state(); try { return getOperand().isConstant(); } finally { } } /** * @attribute syn * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:376 */ public String printPreOp() { ASTNode$State state = state(); try { return "~"; } finally { } } /** * @apilevel internal */ protected boolean type_computed = false; /** * @apilevel internal */ protected TypeDecl type_value; /** * @attribute syn * @aspect TypeAnalysis * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:317 */ @SuppressWarnings({"unchecked", "cast"}) public TypeDecl type() { if(type_computed) { return type_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); type_value = type_compute(); if(isFinal && num == state().boundariesCrossed) type_computed = true; return type_value; } /** * @apilevel internal */ private TypeDecl type_compute() { return getOperand().type().unaryNumericPromotion(); } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
6,365
23.770428
113
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/BitwiseExpr.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production BitwiseExpr : {@link Binary}; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:166 */ public abstract class BitwiseExpr extends Binary implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); type_computed = false; type_value = null; } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public BitwiseExpr clone() throws CloneNotSupportedException { BitwiseExpr node = (BitwiseExpr)super.clone(); node.type_computed = false; node.type_value = null; node.in$Circle(false); node.is$Final(false); return node; } /** * @ast method * @aspect TypeCheck * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:192 */ public void typeCheck() { TypeDecl left = getLeftOperand().type(); TypeDecl right = getRightOperand().type(); if(left.isIntegralType() && right.isIntegralType()) return; else if(left.isBoolean() && right.isBoolean()) return; else error(left.typeName() + " is not compatible with " + right.typeName()); } /** * @ast method * */ public BitwiseExpr() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[2]; } /** * @ast method * */ public BitwiseExpr(Expr p0, Expr p1) { setChild(p0, 0); setChild(p1, 1); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 2; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the LeftOperand child. * @param node The new node to replace the LeftOperand child. * @apilevel high-level * @ast method * */ public void setLeftOperand(Expr node) { setChild(node, 0); } /** * Retrieves the LeftOperand child. * @return The current node used as the LeftOperand child. * @apilevel high-level * @ast method * */ public Expr getLeftOperand() { return (Expr)getChild(0); } /** * Retrieves the LeftOperand child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the LeftOperand child. * @apilevel low-level * @ast method * */ public Expr getLeftOperandNoTransform() { return (Expr)getChildNoTransform(0); } /** * Replaces the RightOperand child. * @param node The new node to replace the RightOperand child. * @apilevel high-level * @ast method * */ public void setRightOperand(Expr node) { setChild(node, 1); } /** * Retrieves the RightOperand child. * @return The current node used as the RightOperand child. * @apilevel high-level * @ast method * */ public Expr getRightOperand() { return (Expr)getChild(1); } /** * Retrieves the RightOperand child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the RightOperand child. * @apilevel low-level * @ast method * */ public Expr getRightOperandNoTransform() { return (Expr)getChildNoTransform(1); } /** * @apilevel internal */ protected boolean type_computed = false; /** * @apilevel internal */ protected TypeDecl type_value; /** * @attribute syn * @aspect TypeAnalysis * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:350 */ @SuppressWarnings({"unchecked", "cast"}) public TypeDecl type() { if(type_computed) { return type_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); type_value = type_compute(); if(isFinal && num == state().boundariesCrossed) type_computed = true; return type_value; } /** * @apilevel internal */ private TypeDecl type_compute() { if(getLeftOperand().type().isIntegralType() && getRightOperand().type().isIntegralType()) // 15.22.1 return getLeftOperand().type().binaryNumericPromotion(getRightOperand().type()); else if(getLeftOperand().type().isBoolean() && getRightOperand().type().isBoolean()) // 15.22.2 return typeBoolean(); return unknownType(); } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
5,349
23.541284
107
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/Block.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production Block : {@link Stmt} ::= <span class="component">{@link Stmt}*</span>; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:197 */ public class Block extends Stmt implements Cloneable, VariableScope { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); checkReturnDA_Variable_values = null; isDAafter_Variable_values = null; checkReturnDU_Variable_values = null; isDUafter_Variable_values = null; localVariableDeclaration_String_values = null; canCompleteNormally_computed = false; lookupType_String_values = null; lookupVariable_String_values = null; } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public Block clone() throws CloneNotSupportedException { Block node = (Block)super.clone(); node.checkReturnDA_Variable_values = null; node.isDAafter_Variable_values = null; node.checkReturnDU_Variable_values = null; node.isDUafter_Variable_values = null; node.localVariableDeclaration_String_values = null; node.canCompleteNormally_computed = false; node.lookupType_String_values = null; node.lookupVariable_String_values = null; node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public Block copy() { try { Block node = (Block) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public Block fullCopy() { Block tree = (Block) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect DeclareBeforeUse * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DeclareBeforeUse.jrag:21 */ public boolean declaredBeforeUse(Variable decl, ASTNode use) { int indexDecl = ((ASTNode)decl).varChildIndex(this); int indexUse = use.varChildIndex(this); return indexDecl <= indexUse; } /** * @ast method * @aspect DeclareBeforeUse * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DeclareBeforeUse.jrag:26 */ public boolean declaredBeforeUse(Variable decl, int indexUse) { int indexDecl = ((ASTNode)decl).varChildIndex(this); return indexDecl <= indexUse; } /** * @ast method * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:526 */ public void toString(StringBuffer s) { String indent = indent(); s.append(shouldHaveIndent() ? indent : ""); s.append("{"); for(int i = 0; i < getNumStmt(); i++) { getStmt(i).toString(s); } s.append(shouldHaveIndent() ? indent : indent.substring(0, indent.length()-2)); s.append("}"); } /** * @ast method * @aspect Statements * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:15 */ public void jimplify2(Body b) { for(int i = 0; i < getNumStmt(); i++) getStmt(i).jimplify2(b); } /** * @ast method * */ public Block() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[1]; setChild(new List(), 0); } /** * @ast method * */ public Block(List<Stmt> p0) { setChild(p0, 0); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 1; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the Stmt list. * @param list The new list node to be used as the Stmt list. * @apilevel high-level * @ast method * */ public void setStmtList(List<Stmt> list) { setChild(list, 0); } /** * Retrieves the number of children in the Stmt list. * @return Number of children in the Stmt list. * @apilevel high-level * @ast method * */ public int getNumStmt() { return getStmtList().getNumChild(); } /** * Retrieves the number of children in the Stmt list. * Calling this method will not trigger rewrites.. * @return Number of children in the Stmt list. * @apilevel low-level * @ast method * */ public int getNumStmtNoTransform() { return getStmtListNoTransform().getNumChildNoTransform(); } /** * Retrieves the element at index {@code i} in the Stmt list.. * @param i Index of the element to return. * @return The element at position {@code i} in the Stmt list. * @apilevel high-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public Stmt getStmt(int i) { return (Stmt)getStmtList().getChild(i); } /** * Append an element to the Stmt list. * @param node The element to append to the Stmt list. * @apilevel high-level * @ast method * */ public void addStmt(Stmt node) { List<Stmt> list = (parent == null || state == null) ? getStmtListNoTransform() : getStmtList(); list.addChild(node); } /** * @apilevel low-level * @ast method * */ public void addStmtNoTransform(Stmt node) { List<Stmt> list = getStmtListNoTransform(); list.addChild(node); } /** * Replaces the Stmt list element at index {@code i} with the new node {@code node}. * @param node The new node to replace the old list element. * @param i The list index of the node to be replaced. * @apilevel high-level * @ast method * */ public void setStmt(Stmt node, int i) { List<Stmt> list = getStmtList(); list.setChild(node, i); } /** * Retrieves the Stmt list. * @return The node representing the Stmt list. * @apilevel high-level * @ast method * */ public List<Stmt> getStmts() { return getStmtList(); } /** * Retrieves the Stmt list. * <p><em>This method does not invoke AST transformations.</em></p> * @return The node representing the Stmt list. * @apilevel low-level * @ast method * */ public List<Stmt> getStmtsNoTransform() { return getStmtListNoTransform(); } /** * Retrieves the Stmt list. * @return The node representing the Stmt list. * @apilevel high-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public List<Stmt> getStmtList() { List<Stmt> list = (List<Stmt>)getChild(0); list.getNumChild(); return list; } /** * Retrieves the Stmt list. * <p><em>This method does not invoke AST transformations.</em></p> * @return The node representing the Stmt list. * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public List<Stmt> getStmtListNoTransform() { return (List<Stmt>)getChildNoTransform(0); } protected java.util.Map checkReturnDA_Variable_values; /** * @attribute syn * @aspect DA * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:300 */ @SuppressWarnings({"unchecked", "cast"}) public boolean checkReturnDA(Variable v) { Object _parameters = v; if(checkReturnDA_Variable_values == null) checkReturnDA_Variable_values = new java.util.HashMap(4); if(checkReturnDA_Variable_values.containsKey(_parameters)) { return ((Boolean)checkReturnDA_Variable_values.get(_parameters)).booleanValue(); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean checkReturnDA_Variable_value = checkReturnDA_compute(v); if(isFinal && num == state().boundariesCrossed) checkReturnDA_Variable_values.put(_parameters, Boolean.valueOf(checkReturnDA_Variable_value)); return checkReturnDA_Variable_value; } /** * @apilevel internal */ private boolean checkReturnDA_compute(Variable v) { HashSet set = new HashSet(); collectBranches(set); for(Iterator iter = set.iterator(); iter.hasNext(); ) { Object o = iter.next(); if(o instanceof ReturnStmt) { ReturnStmt stmt = (ReturnStmt)o; if(!stmt.isDAafterReachedFinallyBlocks(v)) return false; } } return true; } protected java.util.Map isDAafter_Variable_values; /** * @attribute syn * @aspect DA * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:441 */ @SuppressWarnings({"unchecked", "cast"}) public boolean isDAafter(Variable v) { Object _parameters = v; if(isDAafter_Variable_values == null) isDAafter_Variable_values = new java.util.HashMap(4); if(isDAafter_Variable_values.containsKey(_parameters)) { return ((Boolean)isDAafter_Variable_values.get(_parameters)).booleanValue(); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean isDAafter_Variable_value = isDAafter_compute(v); if(isFinal && num == state().boundariesCrossed) isDAafter_Variable_values.put(_parameters, Boolean.valueOf(isDAafter_Variable_value)); return isDAafter_Variable_value; } /** * @apilevel internal */ private boolean isDAafter_compute(Variable v) { return getNumStmt() == 0 ? isDAbefore(v) : getStmt(getNumStmt()-1).isDAafter(v); } /** * @attribute syn * @aspect DA * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:447 */ public boolean isDUeverywhere(Variable v) { ASTNode$State state = state(); try { return isDUbefore(v) && checkDUeverywhere(v); } finally { } } protected java.util.Map checkReturnDU_Variable_values; /** * @attribute syn * @aspect DU * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:757 */ @SuppressWarnings({"unchecked", "cast"}) public boolean checkReturnDU(Variable v) { Object _parameters = v; if(checkReturnDU_Variable_values == null) checkReturnDU_Variable_values = new java.util.HashMap(4); if(checkReturnDU_Variable_values.containsKey(_parameters)) { return ((Boolean)checkReturnDU_Variable_values.get(_parameters)).booleanValue(); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean checkReturnDU_Variable_value = checkReturnDU_compute(v); if(isFinal && num == state().boundariesCrossed) checkReturnDU_Variable_values.put(_parameters, Boolean.valueOf(checkReturnDU_Variable_value)); return checkReturnDU_Variable_value; } /** * @apilevel internal */ private boolean checkReturnDU_compute(Variable v) { HashSet set = new HashSet(); collectBranches(set); for(Iterator iter = set.iterator(); iter.hasNext(); ) { Object o = iter.next(); if(o instanceof ReturnStmt) { ReturnStmt stmt = (ReturnStmt)o; if(!stmt.isDUafterReachedFinallyBlocks(v)) return false; } } return true; } protected java.util.Map isDUafter_Variable_values; /** * @attribute syn * @aspect DU * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:870 */ @SuppressWarnings({"unchecked", "cast"}) public boolean isDUafter(Variable v) { Object _parameters = v; if(isDUafter_Variable_values == null) isDUafter_Variable_values = new java.util.HashMap(4); if(isDUafter_Variable_values.containsKey(_parameters)) { return ((Boolean)isDUafter_Variable_values.get(_parameters)).booleanValue(); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean isDUafter_Variable_value = isDUafter_compute(v); if(isFinal && num == state().boundariesCrossed) isDUafter_Variable_values.put(_parameters, Boolean.valueOf(isDUafter_Variable_value)); return isDUafter_Variable_value; } /** * @apilevel internal */ private boolean isDUafter_compute(Variable v) { return getNumStmt() == 0 ? isDUbefore(v) : getStmt(getNumStmt()-1).isDUafter(v); } protected java.util.Map localVariableDeclaration_String_values; /** * @attribute syn * @aspect VariableScope * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupVariable.jrag:116 */ @SuppressWarnings({"unchecked", "cast"}) public VariableDeclaration localVariableDeclaration(String name) { Object _parameters = name; if(localVariableDeclaration_String_values == null) localVariableDeclaration_String_values = new java.util.HashMap(4); if(localVariableDeclaration_String_values.containsKey(_parameters)) { return (VariableDeclaration)localVariableDeclaration_String_values.get(_parameters); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); VariableDeclaration localVariableDeclaration_String_value = localVariableDeclaration_compute(name); if(isFinal && num == state().boundariesCrossed) localVariableDeclaration_String_values.put(_parameters, localVariableDeclaration_String_value); return localVariableDeclaration_String_value; } /** * @apilevel internal */ private VariableDeclaration localVariableDeclaration_compute(String name) { for(int i = 0; i < getNumStmt(); i++) if(getStmt(i).declaresVariable(name)) return (VariableDeclaration)getStmt(i); return null; } /** * @attribute syn * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:758 */ public boolean addsIndentationLevel() { ASTNode$State state = state(); try { return shouldHaveIndent(); } finally { } } /** * @attribute syn * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:765 */ public boolean shouldHaveIndent() { ASTNode$State state = state(); try { return getParent() instanceof List && getParent().getParent() instanceof Block; } finally { } } /** * @apilevel internal */ protected boolean canCompleteNormally_computed = false; /** * @apilevel internal */ protected boolean canCompleteNormally_value; /** * @attribute syn * @aspect UnreachableStatements * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/UnreachableStatements.jrag:37 */ @SuppressWarnings({"unchecked", "cast"}) public boolean canCompleteNormally() { if(canCompleteNormally_computed) { return canCompleteNormally_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); canCompleteNormally_value = canCompleteNormally_compute(); if(isFinal && num == state().boundariesCrossed) canCompleteNormally_computed = true; return canCompleteNormally_value; } /** * @apilevel internal */ private boolean canCompleteNormally_compute() { return getNumStmt() == 0 ? reachable() : getStmt(getNumStmt() - 1).canCompleteNormally(); } /** * @attribute syn * @aspect PreciseRethrow * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/PreciseRethrow.jrag:55 */ public boolean modifiedInScope(Variable var) { ASTNode$State state = state(); try { for (Stmt stmt : getStmtList()) if (stmt.modifiedInScope(var)) return true; return false; } finally { } } protected java.util.Map lookupType_String_values; /** * @attribute inh * @aspect TypeScopePropagation * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:263 */ @SuppressWarnings({"unchecked", "cast"}) public SimpleSet lookupType(String name) { Object _parameters = name; if(lookupType_String_values == null) lookupType_String_values = new java.util.HashMap(4); if(lookupType_String_values.containsKey(_parameters)) { return (SimpleSet)lookupType_String_values.get(_parameters); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); SimpleSet lookupType_String_value = getParent().Define_SimpleSet_lookupType(this, null, name); if(isFinal && num == state().boundariesCrossed) lookupType_String_values.put(_parameters, lookupType_String_value); return lookupType_String_value; } protected java.util.Map lookupVariable_String_values; /** * @attribute inh * @aspect VariableScope * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupVariable.jrag:17 */ @SuppressWarnings({"unchecked", "cast"}) public SimpleSet lookupVariable(String name) { Object _parameters = name; if(lookupVariable_String_values == null) lookupVariable_String_values = new java.util.HashMap(4); if(lookupVariable_String_values.containsKey(_parameters)) { return (SimpleSet)lookupVariable_String_values.get(_parameters); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); SimpleSet lookupVariable_String_value = getParent().Define_SimpleSet_lookupVariable(this, null, name); if(isFinal && num == state().boundariesCrossed) lookupVariable_String_values.put(_parameters, lookupVariable_String_value); return lookupVariable_String_value; } /** * @attribute inh * @aspect UnreachableStatements * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/UnreachableStatements.jrag:28 */ @SuppressWarnings({"unchecked", "cast"}) public boolean reachable() { ASTNode$State state = state(); boolean reachable_value = getParent().Define_boolean_reachable(this, null); return reachable_value; } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:52 * @apilevel internal */ public boolean Define_boolean_isIncOrDec(ASTNode caller, ASTNode child) { if(caller == getStmtListNoTransform()) { int childIndex = caller.getIndexOfChild(child); return false; } else { return getParent().Define_boolean_isIncOrDec(this, caller); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:444 * @apilevel internal */ public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v) { if(caller == getStmtListNoTransform()) { int index = caller.getIndexOfChild(child); return index == 0 ? isDAbefore(v) : getStmt(index - 1).isDAafter(v); } else { return getParent().Define_boolean_isDAbefore(this, caller, v); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:871 * @apilevel internal */ public boolean Define_boolean_isDUbefore(ASTNode caller, ASTNode child, Variable v) { if(caller == getStmtListNoTransform()) { int index = caller.getIndexOfChild(child); return index == 0 ? isDUbefore(v) : getStmt(index - 1).isDUafter(v); } else { return getParent().Define_boolean_isDUbefore(this, caller, v); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:380 * @apilevel internal */ public SimpleSet Define_SimpleSet_lookupType(ASTNode caller, ASTNode child, String name) { if(caller == getStmtListNoTransform()) { int index = caller.getIndexOfChild(child); { SimpleSet c = SimpleSet.emptySet; for(int i = index; i >= 0 && !(getStmt(i) instanceof Case); i--) { if(getStmt(i) instanceof LocalClassDeclStmt) { TypeDecl t = ((LocalClassDeclStmt)getStmt(i)).getClassDecl(); if(t.name().equals(name)) { c = c.add(t); } } } if(!c.isEmpty()) return c; return lookupType(name); } } else { return getParent().Define_SimpleSet_lookupType(this, caller, name); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupVariable.jrag:68 * @apilevel internal */ public SimpleSet Define_SimpleSet_lookupVariable(ASTNode caller, ASTNode child, String name) { if(caller == getStmtListNoTransform()) { int index = caller.getIndexOfChild(child); { VariableDeclaration v = localVariableDeclaration(name); // declare before use and shadowing if(v != null && declaredBeforeUse(v, index)) return v; return lookupVariable(name); } } else { return getParent().Define_SimpleSet_lookupVariable(this, caller, name); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:296 * @apilevel internal */ public VariableScope Define_VariableScope_outerScope(ASTNode caller, ASTNode child) { if(caller == getStmtListNoTransform()) { int childIndex = caller.getIndexOfChild(child); return this; } else { return getParent().Define_VariableScope_outerScope(this, caller); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/SyntacticClassification.jrag:116 * @apilevel internal */ public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) { if(caller == getStmtListNoTransform()) { int childIndex = caller.getIndexOfChild(child); return NameType.EXPRESSION_NAME; } else { return getParent().Define_NameType_nameType(this, caller); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/UnreachableStatements.jrag:38 * @apilevel internal */ public boolean Define_boolean_reachable(ASTNode caller, ASTNode child) { if(caller == getStmtListNoTransform()) { int childIndex = caller.getIndexOfChild(child); return childIndex == 0 ? reachable() : getStmt(childIndex-1).canCompleteNormally(); } else { return getParent().Define_boolean_reachable(this, caller); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/UnreachableStatements.jrag:148 * @apilevel internal */ public boolean Define_boolean_reportUnreachable(ASTNode caller, ASTNode child) { if(caller == getStmtListNoTransform()) { int i = caller.getIndexOfChild(child); return i == 0 ? reachable() : getStmt(i-1).reachable(); } else { return getParent().Define_boolean_reportUnreachable(this, caller); } } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
24,255
32.595568
149
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/Body.java
package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @ast class * */ public class Body extends java.lang.Object { int nextTempIndex = 0; soot.jimple.JimpleBody body; java.util.Stack chains; TypeDecl typeDecl; public Body(TypeDecl typeDecl, soot.jimple.JimpleBody body, ASTNode container) { this.typeDecl = typeDecl; this.body = body; chains = new java.util.Stack(); chains.push(body.getUnits()); setLine(container); if(!body.getMethod().isStatic()) emitThis(typeDecl); } public Local getParam(int i) { return body.getParameterLocal(i); } public Local newTemp(soot.Type type) { Local local = Jimple.v().newLocal("temp$" + nextTempIndex++, type); body.getLocals().add(local); return local; } public Local newTemp(soot.Value v) { if (v == NullConstant.v()) throw new UnsupportedOperationException( "Cannot create a temporary local for null literal"); Local local = newTemp(v.getType()); if(v instanceof soot.jimple.ParameterRef) { add(newIdentityStmt(local, (soot.jimple.ParameterRef)v, null)); } else { add(newAssignStmt(local, v, null)); } copyLocation(v, local); return local; } public Local newLocal(String name, soot.Type type) { Local local = Jimple.v().newLocal(name, type); body.getLocals().add(local); if(name.equals("this") && thisName == null) thisName = local; return local; } private soot.tagkit.Tag lineTag; public void setLine(ASTNode node) { if(node.getStart() != 0 && node.getEnd() != 0) { int line = node.getLine(node.getStart()); int column = node.getColumn(node.getStart()); int endLine = node.getLine(node.getEnd()); int endColumn = node.getColumn(node.getEnd()); String s = node.sourceFile(); s = s != null ? s.substring(s.lastIndexOf(java.io.File.separatorChar)+1) : "Unknown"; lineTag = new soot.tagkit.SourceLnNamePosTag(s, line, endLine, column, endColumn); } else { lineTag = new soot.tagkit.LineNumberTag(node.lineNumber()); } } private soot.tagkit.Tag currentSourceRangeTag() { return lineTag; } public Body add(soot.jimple.Stmt stmt) { if(list != null) { list.add(stmt); list = null; } stmt.addTag(currentSourceRangeTag()); soot.PatchingChain<Unit> chain = (soot.PatchingChain<Unit>)chains.peek(); if(stmt instanceof IdentityStmt && chain.size() != 0) { IdentityStmt idstmt = (IdentityStmt) stmt; if(!(idstmt.getRightOp() instanceof CaughtExceptionRef)) { soot.Unit s = chain.getFirst(); while(s instanceof IdentityStmt) s = chain.getSuccOf((soot.jimple.Stmt)s); if(s != null) { chain.insertBefore(stmt, (soot.jimple.Stmt)s); return this; } } } chain.add(stmt); return this; } public void pushBlock(soot.PatchingChain c) { chains.push(c); } public void popBlock() { chains.pop(); } public soot.jimple.Stmt newLabel() { return soot.jimple.Jimple.v().newNopStmt(); } public Body addLabel(soot.jimple.Stmt label) { add(label); return this; } public soot.Local emitThis(TypeDecl typeDecl) { if(thisName == null) { thisName = newLocal("this", typeDecl.getSootType()); if(body.getMethod().isStatic()) add(Jimple.v().newIdentityStmt(thisName, Jimple.v().newParameterRef(typeDecl.getSootType(), 0))); else add(Jimple.v().newIdentityStmt(thisName, Jimple.v().newThisRef(typeDecl.sootRef()))); } return thisName; } Local thisName; public Body addTrap(TypeDecl type, soot.jimple.Stmt firstStmt, soot.jimple.Stmt lastStmt, soot.jimple.Stmt handler) { body.getTraps().add(Jimple.v().newTrap(type.getSootClassDecl(), firstStmt, lastStmt, handler)); return this; } public soot.jimple.Stmt previousStmt() { PatchingChain<Unit> o = (PatchingChain<Unit>)chains.lastElement(); return (soot.jimple.Stmt)o.getLast(); } public void addNextStmt(java.util.ArrayList list) { this.list = list; } java.util.ArrayList list = null; public soot.jimple.BinopExpr newXorExpr(soot.Value op1, soot.Value op2, ASTNode location) { return updateTags(Jimple.v().newXorExpr(op1, op2), location, op1, op2); } public soot.jimple.BinopExpr newUshrExpr(soot.Value op1, soot.Value op2, ASTNode location) { return updateTags(Jimple.v().newUshrExpr(op1, op2), location, op1, op2); } public soot.jimple.BinopExpr newSubExpr(soot.Value op1, soot.Value op2, ASTNode location) { return updateTags(Jimple.v().newSubExpr(op1, op2), location, op1, op2); } public soot.jimple.BinopExpr newShrExpr(soot.Value op1, soot.Value op2, ASTNode location) { return updateTags(Jimple.v().newShrExpr(op1, op2), location, op1, op2); } public soot.jimple.BinopExpr newShlExpr(soot.Value op1, soot.Value op2, ASTNode location) { return updateTags(Jimple.v().newShlExpr(op1, op2), location, op1, op2); } public soot.jimple.BinopExpr newRemExpr(soot.Value op1, soot.Value op2, ASTNode location) { return updateTags(Jimple.v().newRemExpr(op1, op2), location, op1, op2); } public soot.jimple.BinopExpr newOrExpr(soot.Value op1, soot.Value op2, ASTNode location) { return updateTags(Jimple.v().newOrExpr(op1, op2), location, op1, op2); } public soot.jimple.BinopExpr newNeExpr(soot.Value op1, soot.Value op2, ASTNode location) { return updateTags(Jimple.v().newNeExpr(op1, op2), location, op1, op2); } public soot.jimple.BinopExpr newMulExpr(soot.Value op1, soot.Value op2, ASTNode location) { return updateTags(Jimple.v().newMulExpr(op1, op2), location, op1, op2); } public soot.jimple.BinopExpr newLeExpr(soot.Value op1, soot.Value op2, ASTNode location) { return updateTags(Jimple.v().newLeExpr(op1, op2), location, op1, op2); } public soot.jimple.BinopExpr newGeExpr(soot.Value op1, soot.Value op2, ASTNode location) { return updateTags(Jimple.v().newGeExpr(op1, op2), location, op1, op2); } public soot.jimple.BinopExpr newEqExpr(soot.Value op1, soot.Value op2, ASTNode location) { return updateTags(Jimple.v().newEqExpr(op1, op2), location, op1, op2); } public soot.jimple.BinopExpr newDivExpr(soot.Value op1, soot.Value op2, ASTNode location) { return updateTags(Jimple.v().newDivExpr(op1, op2), location, op1, op2); } public soot.jimple.BinopExpr newCmplExpr(soot.Value op1, soot.Value op2, ASTNode location) { return updateTags(Jimple.v().newCmplExpr(op1, op2), location, op1, op2); } public soot.jimple.BinopExpr newCmpgExpr(soot.Value op1, soot.Value op2, ASTNode location) { return updateTags(Jimple.v().newCmpgExpr(op1, op2), location, op1, op2); } public soot.jimple.BinopExpr newCmpExpr(soot.Value op1, soot.Value op2, ASTNode location) { return updateTags(Jimple.v().newCmpExpr(op1, op2), location, op1, op2); } public soot.jimple.BinopExpr newGtExpr(soot.Value op1, soot.Value op2, ASTNode location) { return updateTags(Jimple.v().newGtExpr(op1, op2), location, op1, op2); } public soot.jimple.BinopExpr newLtExpr(soot.Value op1, soot.Value op2, ASTNode location) { return updateTags(Jimple.v().newLtExpr(op1, op2), location, op1, op2); } public soot.jimple.BinopExpr newAddExpr(soot.Value op1, soot.Value op2, ASTNode location) { return updateTags(Jimple.v().newAddExpr(op1, op2), location, op1, op2); } public soot.jimple.BinopExpr newAndExpr(soot.Value op1, soot.Value op2, ASTNode location) { return updateTags(Jimple.v().newAndExpr(op1, op2), location, op1, op2); } public soot.jimple.UnopExpr newNegExpr(soot.Value op, ASTNode location) { return updateTags(Jimple.v().newNegExpr(op), location, op); } public soot.jimple.UnopExpr newLengthExpr(soot.Value op, ASTNode location) { return updateTags(Jimple.v().newLengthExpr(op), location, op); } public soot.jimple.CastExpr newCastExpr(Value op1, Type t, ASTNode location) { soot.jimple.CastExpr expr = Jimple.v().newCastExpr(op1, t); createTag(expr, location); soot.tagkit.Tag op1tag = getTag(op1); if(op1tag != null) expr.getOpBox().addTag(op1tag); return expr; } public soot.jimple.InstanceOfExpr newInstanceOfExpr(Value op1, Type t, ASTNode location) { soot.jimple.InstanceOfExpr expr = Jimple.v().newInstanceOfExpr(op1, t); createTag(expr, location); soot.tagkit.Tag op1tag = getTag(op1); if(op1tag != null) expr.getOpBox().addTag(op1tag); return expr; } public soot.jimple.NewExpr newNewExpr(RefType type, ASTNode location) { soot.jimple.NewExpr expr = Jimple.v().newNewExpr(type); createTag(expr, location); return expr; } public soot.jimple.NewArrayExpr newNewArrayExpr(Type type, Value size, ASTNode location) { soot.jimple.NewArrayExpr expr = Jimple.v().newNewArrayExpr(type, size); createTag(expr, location); soot.tagkit.Tag tag = getTag(size); if(tag != null) expr.getSizeBox().addTag(tag); return expr; } public soot.jimple.NewMultiArrayExpr newNewMultiArrayExpr(ArrayType type, java.util.List sizes, ASTNode location) { soot.jimple.NewMultiArrayExpr expr = Jimple.v().newNewMultiArrayExpr(type, sizes); createTag(expr, location); for(int i = 0; i < sizes.size(); i++) { soot.tagkit.Tag tag = getTag((Value)sizes.get(i)); if(tag != null) expr.getSizeBox(i).addTag(tag); } return expr; } public soot.jimple.StaticInvokeExpr newStaticInvokeExpr(SootMethodRef method, java.util.List args, ASTNode location) { soot.jimple.StaticInvokeExpr expr = Jimple.v().newStaticInvokeExpr(method, args); createTag(expr, location); for(int i = 0; i < args.size(); i++) { soot.tagkit.Tag tag = getTag((Value)args.get(i)); if(tag != null) expr.getArgBox(i).addTag(tag); } return expr; } public soot.jimple.SpecialInvokeExpr newSpecialInvokeExpr(Local base, SootMethodRef method, java.util.List args, ASTNode location) { soot.jimple.SpecialInvokeExpr expr = Jimple.v().newSpecialInvokeExpr(base, method, args); createTag(expr, location); for(int i = 0; i < args.size(); i++) { soot.tagkit.Tag tag = getTag((Value)args.get(i)); if(tag != null) expr.getArgBox(i).addTag(tag); } return expr; } public soot.jimple.VirtualInvokeExpr newVirtualInvokeExpr(Local base, SootMethodRef method, java.util.List args, ASTNode location) { soot.jimple.VirtualInvokeExpr expr = Jimple.v().newVirtualInvokeExpr(base, method, args); createTag(expr, location); for(int i = 0; i < args.size(); i++) { soot.tagkit.Tag tag = getTag((Value)args.get(i)); if(tag != null) expr.getArgBox(i).addTag(tag); } return expr; } public soot.jimple.InterfaceInvokeExpr newInterfaceInvokeExpr(Local base, SootMethodRef method, java.util.List args, ASTNode location) { soot.jimple.InterfaceInvokeExpr expr = Jimple.v().newInterfaceInvokeExpr(base, method, args); createTag(expr, location); for(int i = 0; i < args.size(); i++) { soot.tagkit.Tag tag = getTag((Value)args.get(i)); if(tag != null) expr.getArgBox(i).addTag(tag); } return expr; } public soot.jimple.StaticInvokeExpr newStaticInvokeExpr(SootMethodRef method, ASTNode location) { return newStaticInvokeExpr(method, new ArrayList(), location); } public soot.jimple.SpecialInvokeExpr newSpecialInvokeExpr(Local base, SootMethodRef method, ASTNode location) { return newSpecialInvokeExpr(base, method, new ArrayList(), location); } public soot.jimple.VirtualInvokeExpr newVirtualInvokeExpr(Local base, SootMethodRef method, ASTNode location) { return newVirtualInvokeExpr(base, method, new ArrayList(), location); } public soot.jimple.InterfaceInvokeExpr newInterfaceInvokeExpr(Local base, SootMethodRef method, ASTNode location) { return newInterfaceInvokeExpr(base, method, new ArrayList(), location); } public soot.jimple.StaticInvokeExpr newStaticInvokeExpr(SootMethodRef method, Value arg, ASTNode location) { return newStaticInvokeExpr(method, Arrays.asList(new Value[] { arg }), location); } public soot.jimple.SpecialInvokeExpr newSpecialInvokeExpr(Local base, SootMethodRef method, Value arg, ASTNode location) { return newSpecialInvokeExpr(base, method, Arrays.asList(new Value[] { arg }), location); } public soot.jimple.VirtualInvokeExpr newVirtualInvokeExpr(Local base, SootMethodRef method, Value arg, ASTNode location) { return newVirtualInvokeExpr(base, method, Arrays.asList(new Value[] { arg }), location); } public soot.jimple.InterfaceInvokeExpr newInterfaceInvokeExpr(Local base, SootMethodRef method, Value arg, ASTNode location) { return newInterfaceInvokeExpr(base, method, Arrays.asList(new Value[] { arg }), location); } public soot.jimple.ThrowStmt newThrowStmt(Value op, ASTNode location) { soot.jimple.ThrowStmt stmt = Jimple.v().newThrowStmt(op); soot.tagkit.Tag tag = getTag(op); if(tag != null) stmt.getOpBox().addTag(tag); return stmt; } public soot.jimple.ExitMonitorStmt newExitMonitorStmt(Value op, ASTNode location) { soot.jimple.ExitMonitorStmt stmt = Jimple.v().newExitMonitorStmt(op); soot.tagkit.Tag tag = getTag(op); if(tag != null) stmt.getOpBox().addTag(tag); return stmt; } public soot.jimple.EnterMonitorStmt newEnterMonitorStmt(Value op, ASTNode location) { soot.jimple.EnterMonitorStmt stmt = Jimple.v().newEnterMonitorStmt(op); soot.tagkit.Tag tag = getTag(op); if(tag != null) stmt.getOpBox().addTag(tag); return stmt; } public soot.jimple.GotoStmt newGotoStmt(Unit target, ASTNode location) { soot.jimple.GotoStmt stmt = Jimple.v().newGotoStmt(target); return stmt; } public soot.jimple.ReturnVoidStmt newReturnVoidStmt(ASTNode location) { return Jimple.v().newReturnVoidStmt(); } public soot.jimple.ReturnStmt newReturnStmt(Value op, ASTNode location) { soot.jimple.ReturnStmt stmt = Jimple.v().newReturnStmt(op); soot.tagkit.Tag tag = getTag(op); if(tag != null) stmt.getOpBox().addTag(tag); return stmt; } public soot.jimple.IfStmt newIfStmt(Value op, Unit target, ASTNode location) { soot.jimple.IfStmt stmt = Jimple.v().newIfStmt(op, target); soot.tagkit.Tag tag = getTag(op); if(tag != null) stmt.getConditionBox().addTag(tag); return stmt; } public soot.jimple.IdentityStmt newIdentityStmt(Value local, Value identityRef, ASTNode location) { soot.jimple.IdentityStmt stmt = Jimple.v().newIdentityStmt(local, identityRef); soot.tagkit.Tag left = getTag(local); if(left != null) stmt.getLeftOpBox().addTag(left); soot.tagkit.Tag right = getTag(identityRef); if(right != null) stmt.getRightOpBox().addTag(right); return stmt; } public soot.jimple.AssignStmt newAssignStmt(Value variable, Value rvalue, ASTNode location) { soot.jimple.AssignStmt stmt = Jimple.v().newAssignStmt(variable, rvalue); soot.tagkit.Tag left = getTag(variable); if(left != null) stmt.getLeftOpBox().addTag(left); soot.tagkit.Tag right = getTag(rvalue); if(right != null) stmt.getRightOpBox().addTag(right); return stmt; } public soot.jimple.InvokeStmt newInvokeStmt(Value op, ASTNode location) { soot.jimple.InvokeStmt stmt = Jimple.v().newInvokeStmt(op); soot.tagkit.Tag tag = getTag(op); if(tag != null) stmt.getInvokeExprBox().addTag(tag); return stmt; } public soot.jimple.TableSwitchStmt newTableSwitchStmt(Value key, int lowIndex, int highIndex, java.util.List targets, Unit defaultTarget, ASTNode location) { soot.jimple.TableSwitchStmt stmt = Jimple.v().newTableSwitchStmt(key, lowIndex, highIndex, targets, defaultTarget); soot.tagkit.Tag tag = getTag(key); if(tag != null) stmt.getKeyBox().addTag(tag); return stmt; } public soot.jimple.LookupSwitchStmt newLookupSwitchStmt(Value key, java.util.List lookupValues, java.util.List targets, Unit defaultTarget, ASTNode location) { soot.jimple.LookupSwitchStmt stmt = Jimple.v().newLookupSwitchStmt(key, lookupValues, targets, defaultTarget); soot.tagkit.Tag tag = getTag(key); if(tag != null) stmt.getKeyBox().addTag(tag); return stmt; } public soot.jimple.StaticFieldRef newStaticFieldRef(SootFieldRef f, ASTNode location) { soot.jimple.StaticFieldRef ref = Jimple.v().newStaticFieldRef(f); createTag(ref, location); return ref; } public soot.jimple.ThisRef newThisRef(RefType t, ASTNode location) { soot.jimple.ThisRef ref = Jimple.v().newThisRef(t); createTag(ref, location); return ref; } public soot.jimple.ParameterRef newParameterRef(Type paramType, int number, ASTNode location) { soot.jimple.ParameterRef ref = Jimple.v().newParameterRef(paramType, number); createTag(ref, location); return ref; } public soot.jimple.InstanceFieldRef newInstanceFieldRef(Value base, SootFieldRef f, ASTNode location) { soot.jimple.InstanceFieldRef ref = Jimple.v().newInstanceFieldRef(base, f); createTag(ref, location); soot.tagkit.Tag tag = getTag(base); if(tag != null) ref.getBaseBox().addTag(tag); return ref; } public soot.jimple.CaughtExceptionRef newCaughtExceptionRef(ASTNode location) { soot.jimple.CaughtExceptionRef ref = Jimple.v().newCaughtExceptionRef(); createTag(ref, location); return ref; } public soot.jimple.ArrayRef newArrayRef(Value base, Value index, ASTNode location) { soot.jimple.ArrayRef ref = Jimple.v().newArrayRef(base, index); createTag(ref, location); soot.tagkit.Tag baseTag = getTag(base); if(baseTag != null) ref.getBaseBox().addTag(baseTag); soot.tagkit.Tag indexTag = getTag(index); if(indexTag != null) ref.getIndexBox().addTag(indexTag); return ref; } private soot.jimple.BinopExpr updateTags(soot.jimple.BinopExpr binary, ASTNode binaryLocation, soot.Value op1, soot.Value op2) { createTag(binary, binaryLocation); soot.tagkit.Tag op1tag = getTag(op1); if(op1tag != null) binary.getOp1Box().addTag(op1tag); soot.tagkit.Tag op2tag = getTag(op2); if(op2tag != null) binary.getOp2Box().addTag(op2tag); return binary; } private soot.jimple.UnopExpr updateTags(soot.jimple.UnopExpr unary, ASTNode unaryLocation, soot.Value op) { createTag(unary, unaryLocation); soot.tagkit.Tag optag = getTag(op); if(optag != null) unary.getOpBox().addTag(optag); return unary; } private java.util.HashMap<soot.Value, soot.tagkit.Tag> tagMap = new java.util.HashMap<soot.Value, soot.tagkit.Tag>(); private soot.tagkit.Tag getTag(soot.Value value) { return tagMap.get(value); } private void createTag(soot.Value value, ASTNode node) { if(node == null || tagMap.containsKey(value)) return; if(node.getStart() != 0 && node.getEnd() != 0) { int line = node.getLine(node.getStart()); int column = node.getColumn(node.getStart()); int endLine = node.getLine(node.getEnd()); int endColumn = node.getColumn(node.getEnd()); String s = node.sourceFile(); s = s != null ? s.substring(s.lastIndexOf(java.io.File.separatorChar)+1) : "Unknown"; tagMap.put(value, new soot.tagkit.SourceLnNamePosTag(s, line, endLine, column, endColumn)); } else { tagMap.put(value, new soot.tagkit.LineNumberTag(node.lineNumber())); } } public void copyLocation(soot.Value fromValue, soot.Value toValue) { soot.tagkit.Tag tag = tagMap.get(fromValue); if(tag != null) tagMap.put(toValue, tag); } }
20,794
32.540323
171
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/BodyDecl.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production BodyDecl : {@link ASTNode}; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:72 */ public abstract class BodyDecl extends ASTNode<ASTNode> implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); isDAafter_Variable_values = null; isDUafter_Variable_values = null; isDAbefore_Variable_values = null; isDUbefore_Variable_values = null; typeThrowable_computed = false; typeThrowable_value = null; lookupVariable_String_values = null; } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public BodyDecl clone() throws CloneNotSupportedException { BodyDecl node = (BodyDecl)super.clone(); node.isDAafter_Variable_values = null; node.isDUafter_Variable_values = null; node.isDAbefore_Variable_values = null; node.isDUbefore_Variable_values = null; node.typeThrowable_computed = false; node.typeThrowable_value = null; node.lookupVariable_String_values = null; node.in$Circle(false); node.is$Final(false); return node; } /** * @ast method * @aspect BranchTarget * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:210 */ public void collectFinally(Stmt branchStmt, ArrayList list) { // terminate search if body declaration is reached } /** * @ast method * @aspect LookupParTypeDecl * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1238 */ public BodyDecl substitutedBodyDecl(Parameterization parTypeDecl) { throw new Error("Operation substitutedBodyDecl not supported for " + getClass().getName()); } /** * @ast method * @aspect EmitJimple * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:207 */ public void jimplify1phase2() { } /** * @ast method * @aspect EmitJimple * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:973 */ public void jimplify2() { } /** * We must report illegal uses of the SafeVarargs annotation. * It is only allowed on variable arity method and constructor declarations. * @ast method * @aspect SafeVarargs * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/SafeVarargs.jrag:93 */ public void checkWarnings() { if (hasIllegalAnnotationSafeVarargs()) error("@SafeVarargs is only allowed for variable " + "arity method and constructor declarations"); } /** * @ast method * */ public BodyDecl() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 0; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } protected java.util.Map isDAafter_Variable_values; /** * @attribute syn * @aspect DA * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:243 */ @SuppressWarnings({"unchecked", "cast"}) public boolean isDAafter(Variable v) { Object _parameters = v; if(isDAafter_Variable_values == null) isDAafter_Variable_values = new java.util.HashMap(4); if(isDAafter_Variable_values.containsKey(_parameters)) { return ((Boolean)isDAafter_Variable_values.get(_parameters)).booleanValue(); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean isDAafter_Variable_value = isDAafter_compute(v); if(isFinal && num == state().boundariesCrossed) isDAafter_Variable_values.put(_parameters, Boolean.valueOf(isDAafter_Variable_value)); return isDAafter_Variable_value; } /** * @apilevel internal */ private boolean isDAafter_compute(Variable v) { return true; } protected java.util.Map isDUafter_Variable_values; /** * @attribute syn * @aspect DU * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:708 */ @SuppressWarnings({"unchecked", "cast"}) public boolean isDUafter(Variable v) { Object _parameters = v; if(isDUafter_Variable_values == null) isDUafter_Variable_values = new java.util.HashMap(4); if(isDUafter_Variable_values.containsKey(_parameters)) { return ((Boolean)isDUafter_Variable_values.get(_parameters)).booleanValue(); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean isDUafter_Variable_value = isDUafter_compute(v); if(isFinal && num == state().boundariesCrossed) isDUafter_Variable_values.put(_parameters, Boolean.valueOf(isDUafter_Variable_value)); return isDUafter_Variable_value; } /** * @apilevel internal */ private boolean isDUafter_compute(Variable v) { return true; } /** * @attribute syn * @aspect TypeScopePropagation * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:479 */ public boolean declaresType(String name) { ASTNode$State state = state(); try { return false; } finally { } } /** * @attribute syn * @aspect TypeScopePropagation * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:481 */ public TypeDecl type(String name) { ASTNode$State state = state(); try { return null; } finally { } } /** * @attribute syn * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:758 */ public boolean addsIndentationLevel() { ASTNode$State state = state(); try { return true; } finally { } } /** * @attribute syn * @aspect TypeAnalysis * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:271 */ public boolean isVoid() { ASTNode$State state = state(); try { return false; } finally { } } /** * @attribute syn * @aspect Annotations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:283 */ public boolean hasAnnotationSuppressWarnings(String s) { ASTNode$State state = state(); try { return false; } finally { } } /** * @attribute syn * @aspect Annotations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:326 */ public boolean isDeprecated() { ASTNode$State state = state(); try { return false; } finally { } } /** * @attribute syn * @aspect Enums * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:26 */ public boolean isEnumConstant() { ASTNode$State state = state(); try { return false; } finally { } } /** * @attribute syn * @aspect GenericsParTypeDecl * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsParTypeDecl.jrag:67 */ public boolean visibleTypeParameters() { ASTNode$State state = state(); try { return true; } finally { } } /** * @attribute syn * @aspect EmitJimple * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:161 */ public boolean generate() { ASTNode$State state = state(); try { return true; } finally { } } /** * @return true if the modifier list includes the SafeVarargs annotation * @attribute syn * @aspect SafeVarargs * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/SafeVarargs.jrag:20 */ public boolean hasAnnotationSafeVarargs() { ASTNode$State state = state(); try { return false; } finally { } } /** * It is an error if the SafeVarargs annotation is used on something * that is not a variable arity method or constructor. * @attribute syn * @aspect SafeVarargs * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/SafeVarargs.jrag:56 */ public boolean hasIllegalAnnotationSafeVarargs() { ASTNode$State state = state(); try { return hasAnnotationSafeVarargs(); } finally { } } protected java.util.Map isDAbefore_Variable_values; /** * @attribute inh * @aspect DA * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:242 */ @SuppressWarnings({"unchecked", "cast"}) public boolean isDAbefore(Variable v) { Object _parameters = v; if(isDAbefore_Variable_values == null) isDAbefore_Variable_values = new java.util.HashMap(4); if(isDAbefore_Variable_values.containsKey(_parameters)) { return ((Boolean)isDAbefore_Variable_values.get(_parameters)).booleanValue(); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean isDAbefore_Variable_value = getParent().Define_boolean_isDAbefore(this, null, v); if(isFinal && num == state().boundariesCrossed) isDAbefore_Variable_values.put(_parameters, Boolean.valueOf(isDAbefore_Variable_value)); return isDAbefore_Variable_value; } protected java.util.Map isDUbefore_Variable_values; /** * @attribute inh * @aspect DU * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:707 */ @SuppressWarnings({"unchecked", "cast"}) public boolean isDUbefore(Variable v) { Object _parameters = v; if(isDUbefore_Variable_values == null) isDUbefore_Variable_values = new java.util.HashMap(4); if(isDUbefore_Variable_values.containsKey(_parameters)) { return ((Boolean)isDUbefore_Variable_values.get(_parameters)).booleanValue(); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean isDUbefore_Variable_value = getParent().Define_boolean_isDUbefore(this, null, v); if(isFinal && num == state().boundariesCrossed) isDUbefore_Variable_values.put(_parameters, Boolean.valueOf(isDUbefore_Variable_value)); return isDUbefore_Variable_value; } /** * @apilevel internal */ protected boolean typeThrowable_computed = false; /** * @apilevel internal */ protected TypeDecl typeThrowable_value; /** * @attribute inh * @aspect ExceptionHandling * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ExceptionHandling.jrag:22 */ @SuppressWarnings({"unchecked", "cast"}) public TypeDecl typeThrowable() { if(typeThrowable_computed) { return typeThrowable_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); typeThrowable_value = getParent().Define_TypeDecl_typeThrowable(this, null); if(isFinal && num == state().boundariesCrossed) typeThrowable_computed = true; return typeThrowable_value; } /** * @attribute inh * @aspect LookupMethod * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupMethod.jrag:25 */ @SuppressWarnings({"unchecked", "cast"}) public Collection lookupMethod(String name) { ASTNode$State state = state(); Collection lookupMethod_String_value = getParent().Define_Collection_lookupMethod(this, null, name); return lookupMethod_String_value; } /** * @attribute inh * @aspect LookupFullyQualifiedTypes * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:97 */ @SuppressWarnings({"unchecked", "cast"}) public TypeDecl lookupType(String packageName, String typeName) { ASTNode$State state = state(); TypeDecl lookupType_String_String_value = getParent().Define_TypeDecl_lookupType(this, null, packageName, typeName); return lookupType_String_String_value; } /** * @attribute inh * @aspect TypeScopePropagation * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:261 */ @SuppressWarnings({"unchecked", "cast"}) public SimpleSet lookupType(String name) { ASTNode$State state = state(); SimpleSet lookupType_String_value = getParent().Define_SimpleSet_lookupType(this, null, name); return lookupType_String_value; } protected java.util.Map lookupVariable_String_values; /** * @attribute inh * @aspect VariableScope * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupVariable.jrag:15 */ @SuppressWarnings({"unchecked", "cast"}) public SimpleSet lookupVariable(String name) { Object _parameters = name; if(lookupVariable_String_values == null) lookupVariable_String_values = new java.util.HashMap(4); if(lookupVariable_String_values.containsKey(_parameters)) { return (SimpleSet)lookupVariable_String_values.get(_parameters); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); SimpleSet lookupVariable_String_value = getParent().Define_SimpleSet_lookupVariable(this, null, name); if(isFinal && num == state().boundariesCrossed) lookupVariable_String_values.put(_parameters, lookupVariable_String_value); return lookupVariable_String_value; } /** * @attribute inh * @aspect SyntacticClassification * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/SyntacticClassification.jrag:21 */ @SuppressWarnings({"unchecked", "cast"}) public NameType nameType() { ASTNode$State state = state(); NameType nameType_value = getParent().Define_NameType_nameType(this, null); return nameType_value; } /** * @attribute inh * @aspect NestedTypes * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:566 */ @SuppressWarnings({"unchecked", "cast"}) public String hostPackage() { ASTNode$State state = state(); String hostPackage_value = getParent().Define_String_hostPackage(this, null); return hostPackage_value; } /** * @attribute inh * @aspect NestedTypes * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:585 */ @SuppressWarnings({"unchecked", "cast"}) public TypeDecl hostType() { ASTNode$State state = state(); TypeDecl hostType_value = getParent().Define_TypeDecl_hostType(this, null); return hostType_value; } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:353 * @apilevel internal */ public String Define_String_typeDeclIndent(ASTNode caller, ASTNode child) { { int childIndex = this.getIndexOfChild(caller); return indent(); } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:514 * @apilevel internal */ public BodyDecl Define_BodyDecl_enclosingBodyDecl(ASTNode caller, ASTNode child) { { int childIndex = this.getIndexOfChild(caller); return this; } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:464 * @apilevel internal */ public ArrayList Define_ArrayList_exceptionRanges(ASTNode caller, ASTNode child) { { int childIndex = this.getIndexOfChild(caller); return null; } } /** * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/TryWithResources.jrag:153 * @apilevel internal */ public boolean Define_boolean_resourcePreviouslyDeclared(ASTNode caller, ASTNode child, String name) { { int i = this.getIndexOfChild(caller); return false; } } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
17,012
32.358824
142
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/BodyDeclList.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production BodyDeclList : {@link List}; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.ast:13 */ public class BodyDeclList extends List implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); localMethodSignatureCopy_MethodDecl_MemberSubstitutor_values = null; localMethodSignatureCopy_MethodDecl_MemberSubstitutor_list = null; localFieldCopy_FieldDeclaration_MemberSubstitutor_values = null; localFieldCopy_FieldDeclaration_MemberSubstitutor_list = null; localClassDeclCopy_ClassDecl_MemberSubstitutor_values = null; localClassDeclCopy_ClassDecl_MemberSubstitutor_list = null; localInterfaceDeclCopy_InterfaceDecl_MemberSubstitutor_values = null; localInterfaceDeclCopy_InterfaceDecl_MemberSubstitutor_list = null; constructorCopy_ConstructorDecl_MemberSubstitutor_values = null; constructorCopy_ConstructorDecl_MemberSubstitutor_list = null; } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public BodyDeclList clone() throws CloneNotSupportedException { BodyDeclList node = (BodyDeclList)super.clone(); node.localMethodSignatureCopy_MethodDecl_MemberSubstitutor_values = null; node.localMethodSignatureCopy_MethodDecl_MemberSubstitutor_list = null; node.localFieldCopy_FieldDeclaration_MemberSubstitutor_values = null; node.localFieldCopy_FieldDeclaration_MemberSubstitutor_list = null; node.localClassDeclCopy_ClassDecl_MemberSubstitutor_values = null; node.localClassDeclCopy_ClassDecl_MemberSubstitutor_list = null; node.localInterfaceDeclCopy_InterfaceDecl_MemberSubstitutor_values = null; node.localInterfaceDeclCopy_InterfaceDecl_MemberSubstitutor_list = null; node.constructorCopy_ConstructorDecl_MemberSubstitutor_values = null; node.constructorCopy_ConstructorDecl_MemberSubstitutor_list = null; node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public BodyDeclList copy() { try { BodyDeclList node = (BodyDeclList) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public BodyDeclList fullCopy() { BodyDeclList tree = (BodyDeclList) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * */ public BodyDeclList() { super(); is$Final(true); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 0; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return true; } /** * @apilevel internal */ protected java.util.Map localMethodSignatureCopy_MethodDecl_MemberSubstitutor_values; /** * @apilevel internal */ protected List localMethodSignatureCopy_MethodDecl_MemberSubstitutor_list; /** * @attribute syn * @aspect LookupParTypeDecl * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1114 */ @SuppressWarnings({"unchecked", "cast"}) public BodyDecl localMethodSignatureCopy(MethodDecl originalMethod, MemberSubstitutor m) { java.util.List _parameters = new java.util.ArrayList(2); _parameters.add(originalMethod); _parameters.add(m); if(localMethodSignatureCopy_MethodDecl_MemberSubstitutor_values == null) localMethodSignatureCopy_MethodDecl_MemberSubstitutor_values = new java.util.HashMap(4); if(localMethodSignatureCopy_MethodDecl_MemberSubstitutor_values.containsKey(_parameters)) { return (BodyDecl)localMethodSignatureCopy_MethodDecl_MemberSubstitutor_values.get(_parameters); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); BodyDecl localMethodSignatureCopy_MethodDecl_MemberSubstitutor_value = localMethodSignatureCopy_compute(originalMethod, m); if(localMethodSignatureCopy_MethodDecl_MemberSubstitutor_list == null) { localMethodSignatureCopy_MethodDecl_MemberSubstitutor_list = new List(); localMethodSignatureCopy_MethodDecl_MemberSubstitutor_list.is$Final = true; localMethodSignatureCopy_MethodDecl_MemberSubstitutor_list.setParent(this); } localMethodSignatureCopy_MethodDecl_MemberSubstitutor_list.add(localMethodSignatureCopy_MethodDecl_MemberSubstitutor_value); if(localMethodSignatureCopy_MethodDecl_MemberSubstitutor_value != null) { localMethodSignatureCopy_MethodDecl_MemberSubstitutor_value.is$Final = true; } if(true) localMethodSignatureCopy_MethodDecl_MemberSubstitutor_values.put(_parameters, localMethodSignatureCopy_MethodDecl_MemberSubstitutor_value); return localMethodSignatureCopy_MethodDecl_MemberSubstitutor_value; } /** * @apilevel internal */ private BodyDecl localMethodSignatureCopy_compute(MethodDecl originalMethod, MemberSubstitutor m) { return originalMethod.substitutedBodyDecl(m); } /** * @apilevel internal */ protected java.util.Map localFieldCopy_FieldDeclaration_MemberSubstitutor_values; /** * @apilevel internal */ protected List localFieldCopy_FieldDeclaration_MemberSubstitutor_list; /** * @attribute syn * @aspect LookupParTypeDecl * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1148 */ @SuppressWarnings({"unchecked", "cast"}) public BodyDecl localFieldCopy(FieldDeclaration originalDecl, MemberSubstitutor m) { java.util.List _parameters = new java.util.ArrayList(2); _parameters.add(originalDecl); _parameters.add(m); if(localFieldCopy_FieldDeclaration_MemberSubstitutor_values == null) localFieldCopy_FieldDeclaration_MemberSubstitutor_values = new java.util.HashMap(4); if(localFieldCopy_FieldDeclaration_MemberSubstitutor_values.containsKey(_parameters)) { return (BodyDecl)localFieldCopy_FieldDeclaration_MemberSubstitutor_values.get(_parameters); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); BodyDecl localFieldCopy_FieldDeclaration_MemberSubstitutor_value = localFieldCopy_compute(originalDecl, m); if(localFieldCopy_FieldDeclaration_MemberSubstitutor_list == null) { localFieldCopy_FieldDeclaration_MemberSubstitutor_list = new List(); localFieldCopy_FieldDeclaration_MemberSubstitutor_list.is$Final = true; localFieldCopy_FieldDeclaration_MemberSubstitutor_list.setParent(this); } localFieldCopy_FieldDeclaration_MemberSubstitutor_list.add(localFieldCopy_FieldDeclaration_MemberSubstitutor_value); if(localFieldCopy_FieldDeclaration_MemberSubstitutor_value != null) { localFieldCopy_FieldDeclaration_MemberSubstitutor_value.is$Final = true; } if(true) localFieldCopy_FieldDeclaration_MemberSubstitutor_values.put(_parameters, localFieldCopy_FieldDeclaration_MemberSubstitutor_value); return localFieldCopy_FieldDeclaration_MemberSubstitutor_value; } /** * @apilevel internal */ private BodyDecl localFieldCopy_compute(FieldDeclaration originalDecl, MemberSubstitutor m) { return originalDecl.substitutedBodyDecl(m); } /** * @apilevel internal */ protected java.util.Map localClassDeclCopy_ClassDecl_MemberSubstitutor_values; /** * @apilevel internal */ protected List localClassDeclCopy_ClassDecl_MemberSubstitutor_list; /** * @attribute syn * @aspect LookupParTypeDecl * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1204 */ @SuppressWarnings({"unchecked", "cast"}) public MemberClassDecl localClassDeclCopy(ClassDecl originalDecl, MemberSubstitutor m) { java.util.List _parameters = new java.util.ArrayList(2); _parameters.add(originalDecl); _parameters.add(m); if(localClassDeclCopy_ClassDecl_MemberSubstitutor_values == null) localClassDeclCopy_ClassDecl_MemberSubstitutor_values = new java.util.HashMap(4); if(localClassDeclCopy_ClassDecl_MemberSubstitutor_values.containsKey(_parameters)) { return (MemberClassDecl)localClassDeclCopy_ClassDecl_MemberSubstitutor_values.get(_parameters); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); MemberClassDecl localClassDeclCopy_ClassDecl_MemberSubstitutor_value = localClassDeclCopy_compute(originalDecl, m); if(localClassDeclCopy_ClassDecl_MemberSubstitutor_list == null) { localClassDeclCopy_ClassDecl_MemberSubstitutor_list = new List(); localClassDeclCopy_ClassDecl_MemberSubstitutor_list.is$Final = true; localClassDeclCopy_ClassDecl_MemberSubstitutor_list.setParent(this); } localClassDeclCopy_ClassDecl_MemberSubstitutor_list.add(localClassDeclCopy_ClassDecl_MemberSubstitutor_value); if(localClassDeclCopy_ClassDecl_MemberSubstitutor_value != null) { localClassDeclCopy_ClassDecl_MemberSubstitutor_value.is$Final = true; } if(true) localClassDeclCopy_ClassDecl_MemberSubstitutor_values.put(_parameters, localClassDeclCopy_ClassDecl_MemberSubstitutor_value); return localClassDeclCopy_ClassDecl_MemberSubstitutor_value; } /** * @apilevel internal */ private MemberClassDecl localClassDeclCopy_compute(ClassDecl originalDecl, MemberSubstitutor m) { ClassDecl copy = originalDecl.substitutedClassDecl(m); return new MemberClassDecl(copy); } /** * @apilevel internal */ protected java.util.Map localInterfaceDeclCopy_InterfaceDecl_MemberSubstitutor_values; /** * @apilevel internal */ protected List localInterfaceDeclCopy_InterfaceDecl_MemberSubstitutor_list; /** * @attribute syn * @aspect LookupParTypeDecl * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1208 */ @SuppressWarnings({"unchecked", "cast"}) public MemberInterfaceDecl localInterfaceDeclCopy(InterfaceDecl originalDecl, MemberSubstitutor m) { java.util.List _parameters = new java.util.ArrayList(2); _parameters.add(originalDecl); _parameters.add(m); if(localInterfaceDeclCopy_InterfaceDecl_MemberSubstitutor_values == null) localInterfaceDeclCopy_InterfaceDecl_MemberSubstitutor_values = new java.util.HashMap(4); if(localInterfaceDeclCopy_InterfaceDecl_MemberSubstitutor_values.containsKey(_parameters)) { return (MemberInterfaceDecl)localInterfaceDeclCopy_InterfaceDecl_MemberSubstitutor_values.get(_parameters); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); MemberInterfaceDecl localInterfaceDeclCopy_InterfaceDecl_MemberSubstitutor_value = localInterfaceDeclCopy_compute(originalDecl, m); if(localInterfaceDeclCopy_InterfaceDecl_MemberSubstitutor_list == null) { localInterfaceDeclCopy_InterfaceDecl_MemberSubstitutor_list = new List(); localInterfaceDeclCopy_InterfaceDecl_MemberSubstitutor_list.is$Final = true; localInterfaceDeclCopy_InterfaceDecl_MemberSubstitutor_list.setParent(this); } localInterfaceDeclCopy_InterfaceDecl_MemberSubstitutor_list.add(localInterfaceDeclCopy_InterfaceDecl_MemberSubstitutor_value); if(localInterfaceDeclCopy_InterfaceDecl_MemberSubstitutor_value != null) { localInterfaceDeclCopy_InterfaceDecl_MemberSubstitutor_value.is$Final = true; } if(true) localInterfaceDeclCopy_InterfaceDecl_MemberSubstitutor_values.put(_parameters, localInterfaceDeclCopy_InterfaceDecl_MemberSubstitutor_value); return localInterfaceDeclCopy_InterfaceDecl_MemberSubstitutor_value; } /** * @apilevel internal */ private MemberInterfaceDecl localInterfaceDeclCopy_compute(InterfaceDecl originalDecl, MemberSubstitutor m) { InterfaceDecl copy = originalDecl.substitutedInterfaceDecl(m); return new MemberInterfaceDecl(copy); } /** * @apilevel internal */ protected java.util.Map constructorCopy_ConstructorDecl_MemberSubstitutor_values; /** * @apilevel internal */ protected List constructorCopy_ConstructorDecl_MemberSubstitutor_list; /** * @attribute syn * @aspect LookupParTypeDecl * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1234 */ @SuppressWarnings({"unchecked", "cast"}) public BodyDecl constructorCopy(ConstructorDecl originalDecl, MemberSubstitutor m) { java.util.List _parameters = new java.util.ArrayList(2); _parameters.add(originalDecl); _parameters.add(m); if(constructorCopy_ConstructorDecl_MemberSubstitutor_values == null) constructorCopy_ConstructorDecl_MemberSubstitutor_values = new java.util.HashMap(4); if(constructorCopy_ConstructorDecl_MemberSubstitutor_values.containsKey(_parameters)) { return (BodyDecl)constructorCopy_ConstructorDecl_MemberSubstitutor_values.get(_parameters); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); BodyDecl constructorCopy_ConstructorDecl_MemberSubstitutor_value = constructorCopy_compute(originalDecl, m); if(constructorCopy_ConstructorDecl_MemberSubstitutor_list == null) { constructorCopy_ConstructorDecl_MemberSubstitutor_list = new List(); constructorCopy_ConstructorDecl_MemberSubstitutor_list.is$Final = true; constructorCopy_ConstructorDecl_MemberSubstitutor_list.setParent(this); } constructorCopy_ConstructorDecl_MemberSubstitutor_list.add(constructorCopy_ConstructorDecl_MemberSubstitutor_value); if(constructorCopy_ConstructorDecl_MemberSubstitutor_value != null) { constructorCopy_ConstructorDecl_MemberSubstitutor_value.is$Final = true; } if(true) constructorCopy_ConstructorDecl_MemberSubstitutor_values.put(_parameters, constructorCopy_ConstructorDecl_MemberSubstitutor_value); return constructorCopy_ConstructorDecl_MemberSubstitutor_value; } /** * @apilevel internal */ private BodyDecl constructorCopy_compute(ConstructorDecl originalDecl, MemberSubstitutor m) { return originalDecl.substitutedBodyDecl(m); } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
15,777
42.706371
167
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/BooleanLiteral.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * Represents a Java boolean; either "true" or "false". * @production BooleanLiteral : {@link Literal}; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/Literals.ast:23 */ public class BooleanLiteral extends Literal implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); constant_computed = false; constant_value = null; type_computed = false; type_value = null; } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public BooleanLiteral clone() throws CloneNotSupportedException { BooleanLiteral node = (BooleanLiteral)super.clone(); node.constant_computed = false; node.constant_value = null; node.type_computed = false; node.type_value = null; node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public BooleanLiteral copy() { try { BooleanLiteral node = (BooleanLiteral) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public BooleanLiteral fullCopy() { BooleanLiteral tree = (BooleanLiteral) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect NodeConstructors * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NodeConstructors.jrag:52 */ public BooleanLiteral(boolean b) { this(b ? "true" : "false"); } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:38 */ public soot.Value eval(Body b) { return BooleanType.emitConstant(constant().booleanValue()); } /** * @ast method * */ public BooleanLiteral() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { } /** * @ast method * */ public BooleanLiteral(String p0) { setLITERAL(p0); } /** * @ast method * */ public BooleanLiteral(beaver.Symbol p0) { setLITERAL(p0); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 0; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the lexeme LITERAL. * @param value The new value for the lexeme LITERAL. * @apilevel high-level * @ast method * */ public void setLITERAL(String value) { tokenString_LITERAL = value; } /** * JastAdd-internal setter for lexeme LITERAL using the Beaver parser. * @apilevel internal * @ast method * */ public void setLITERAL(beaver.Symbol symbol) { if(symbol.value != null && !(symbol.value instanceof String)) throw new UnsupportedOperationException("setLITERAL is only valid for String lexemes"); tokenString_LITERAL = (String)symbol.value; LITERALstart = symbol.getStart(); LITERALend = symbol.getEnd(); } /** * Retrieves the value for the lexeme LITERAL. * @return The value for the lexeme LITERAL. * @apilevel high-level * @ast method * */ public String getLITERAL() { return tokenString_LITERAL != null ? tokenString_LITERAL : ""; } /** * @apilevel internal */ protected boolean constant_computed = false; /** * @apilevel internal */ protected Constant constant_value; /** * @attribute syn * @aspect ConstantExpression * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:156 */ @SuppressWarnings({"unchecked", "cast"}) public Constant constant() { if(constant_computed) { return constant_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); constant_value = constant_compute(); if(isFinal && num == state().boundariesCrossed) constant_computed = true; return constant_value; } /** * @apilevel internal */ private Constant constant_compute() { return Constant.create(Boolean.valueOf(getLITERAL()).booleanValue()); } /** * @apilevel internal */ protected boolean type_computed = false; /** * @apilevel internal */ protected TypeDecl type_value; /** * @attribute syn * @aspect TypeAnalysis * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:304 */ @SuppressWarnings({"unchecked", "cast"}) public TypeDecl type() { if(type_computed) { return type_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); type_value = type_compute(); if(isFinal && num == state().boundariesCrossed) type_computed = true; return type_value; } /** * @apilevel internal */ private TypeDecl type_compute() { return typeBoolean(); } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
6,576
24.59144
113
java
soot
soot-master/src/main/generated/jastadd/soot/JastAddJ/BooleanType.java
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */ package soot.JastAddJ; import java.util.HashSet; import java.io.File; import java.util.*; import beaver.*; import java.util.ArrayList; import java.util.zip.*; import java.io.*; import java.io.FileNotFoundException; import java.util.Collection; import soot.*; import soot.util.*; import soot.jimple.*; import soot.coffi.ClassFile; import soot.coffi.method_info; import soot.coffi.CONSTANT_Utf8_info; import soot.tagkit.SourceFileTag; import soot.coffi.CoffiMethodSource; /** * @production BooleanType : {@link PrimitiveType}; * @ast node * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:54 */ public class BooleanType extends PrimitiveType implements Cloneable { /** * @apilevel low-level */ public void flushCache() { super.flushCache(); boxed_computed = false; boxed_value = null; jvmName_computed = false; jvmName_value = null; getSootType_computed = false; getSootType_value = null; } /** * @apilevel internal */ public void flushCollectionCache() { super.flushCollectionCache(); } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public BooleanType clone() throws CloneNotSupportedException { BooleanType node = (BooleanType)super.clone(); node.boxed_computed = false; node.boxed_value = null; node.jvmName_computed = false; node.jvmName_value = null; node.getSootType_computed = false; node.getSootType_value = null; node.in$Circle(false); node.is$Final(false); return node; } /** * @apilevel internal */ @SuppressWarnings({"unchecked", "cast"}) public BooleanType copy() { try { BooleanType node = (BooleanType) clone(); node.parent = null; if(children != null) node.children = (ASTNode[]) children.clone(); return node; } catch (CloneNotSupportedException e) { throw new Error("Error: clone not supported for " + getClass().getName()); } } /** * Create a deep copy of the AST subtree at this node. * The copy is dangling, i.e. has no parent. * @return dangling copy of the subtree at this node * @apilevel low-level */ @SuppressWarnings({"unchecked", "cast"}) public BooleanType fullCopy() { BooleanType tree = (BooleanType) copy(); if (children != null) { for (int i = 0; i < children.length; ++i) { ASTNode child = (ASTNode) children[i]; if(child != null) { child = child.fullCopy(); tree.setChild(child, i); } } } return tree; } /** * @ast method * @aspect PrettyPrint * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:832 */ public void toString(StringBuffer s) { s.append("boolean"); } /** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:45 */ public static soot.Value emitConstant(boolean b) { return soot.jimple.IntConstant.v(b ? 1 : 0); } /** * @ast method * @aspect AutoBoxingCodegen * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/AutoBoxingCodegen.jrag:12 */ public soot.Value emitCastTo(Body b, soot.Value v, TypeDecl type, ASTNode location) { if(type == this) return v; else if(type.unboxed() == this || type.isObject()) return boxed().emitBoxingOperation(b, v, location); else return v; } /** * @ast method * */ public BooleanType() { super(); } /** * Initializes the child array to the correct size. * Initializes List and Opt nta children. * @apilevel internal * @ast method * @ast method * */ public void init$Children() { children = new ASTNode[3]; setChild(new Opt(), 1); setChild(new List(), 2); } /** * @ast method * */ public BooleanType(Modifiers p0, String p1, Opt<Access> p2, List<BodyDecl> p3) { setChild(p0, 0); setID(p1); setChild(p2, 1); setChild(p3, 2); } /** * @ast method * */ public BooleanType(Modifiers p0, beaver.Symbol p1, Opt<Access> p2, List<BodyDecl> p3) { setChild(p0, 0); setID(p1); setChild(p2, 1); setChild(p3, 2); } /** * @apilevel low-level * @ast method * */ protected int numChildren() { return 3; } /** * @apilevel internal * @ast method * */ public boolean mayHaveRewrite() { return false; } /** * Replaces the Modifiers child. * @param node The new node to replace the Modifiers child. * @apilevel high-level * @ast method * */ public void setModifiers(Modifiers node) { setChild(node, 0); } /** * Retrieves the Modifiers child. * @return The current node used as the Modifiers child. * @apilevel high-level * @ast method * */ public Modifiers getModifiers() { return (Modifiers)getChild(0); } /** * Retrieves the Modifiers child. * <p><em>This method does not invoke AST transformations.</em></p> * @return The current node used as the Modifiers child. * @apilevel low-level * @ast method * */ public Modifiers getModifiersNoTransform() { return (Modifiers)getChildNoTransform(0); } /** * Replaces the lexeme ID. * @param value The new value for the lexeme ID. * @apilevel high-level * @ast method * */ public void setID(String value) { tokenString_ID = value; } /** * JastAdd-internal setter for lexeme ID using the Beaver parser. * @apilevel internal * @ast method * */ public void setID(beaver.Symbol symbol) { if(symbol.value != null && !(symbol.value instanceof String)) throw new UnsupportedOperationException("setID is only valid for String lexemes"); tokenString_ID = (String)symbol.value; IDstart = symbol.getStart(); IDend = symbol.getEnd(); } /** * Retrieves the value for the lexeme ID. * @return The value for the lexeme ID. * @apilevel high-level * @ast method * */ public String getID() { return tokenString_ID != null ? tokenString_ID : ""; } /** * Replaces the optional node for the SuperClassAccess child. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child! * @param opt The new node to be used as the optional node for the SuperClassAccess child. * @apilevel low-level * @ast method * */ public void setSuperClassAccessOpt(Opt<Access> opt) { setChild(opt, 1); } /** * Check whether the optional SuperClassAccess child exists. * @return {@code true} if the optional SuperClassAccess child exists, {@code false} if it does not. * @apilevel high-level * @ast method * */ public boolean hasSuperClassAccess() { return getSuperClassAccessOpt().getNumChild() != 0; } /** * Retrieves the (optional) SuperClassAccess child. * @return The SuperClassAccess child, if it exists. Returns {@code null} otherwise. * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public Access getSuperClassAccess() { return (Access)getSuperClassAccessOpt().getChild(0); } /** * Replaces the (optional) SuperClassAccess child. * @param node The new node to be used as the SuperClassAccess child. * @apilevel high-level * @ast method * */ public void setSuperClassAccess(Access node) { getSuperClassAccessOpt().setChild(node, 0); } /** * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public Opt<Access> getSuperClassAccessOpt() { return (Opt<Access>)getChild(1); } /** * Retrieves the optional node for child SuperClassAccess. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child! * <p><em>This method does not invoke AST transformations.</em></p> * @return The optional node for child SuperClassAccess. * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public Opt<Access> getSuperClassAccessOptNoTransform() { return (Opt<Access>)getChildNoTransform(1); } /** * Replaces the BodyDecl list. * @param list The new list node to be used as the BodyDecl list. * @apilevel high-level * @ast method * */ public void setBodyDeclList(List<BodyDecl> list) { setChild(list, 2); } /** * Retrieves the number of children in the BodyDecl list. * @return Number of children in the BodyDecl list. * @apilevel high-level * @ast method * */ public int getNumBodyDecl() { return getBodyDeclList().getNumChild(); } /** * Retrieves the number of children in the BodyDecl list. * Calling this method will not trigger rewrites.. * @return Number of children in the BodyDecl list. * @apilevel low-level * @ast method * */ public int getNumBodyDeclNoTransform() { return getBodyDeclListNoTransform().getNumChildNoTransform(); } /** * Retrieves the element at index {@code i} in the BodyDecl list.. * @param i Index of the element to return. * @return The element at position {@code i} in the BodyDecl list. * @apilevel high-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public BodyDecl getBodyDecl(int i) { return (BodyDecl)getBodyDeclList().getChild(i); } /** * Append an element to the BodyDecl list. * @param node The element to append to the BodyDecl list. * @apilevel high-level * @ast method * */ public void addBodyDecl(BodyDecl node) { List<BodyDecl> list = (parent == null || state == null) ? getBodyDeclListNoTransform() : getBodyDeclList(); list.addChild(node); } /** * @apilevel low-level * @ast method * */ public void addBodyDeclNoTransform(BodyDecl node) { List<BodyDecl> list = getBodyDeclListNoTransform(); list.addChild(node); } /** * Replaces the BodyDecl list element at index {@code i} with the new node {@code node}. * @param node The new node to replace the old list element. * @param i The list index of the node to be replaced. * @apilevel high-level * @ast method * */ public void setBodyDecl(BodyDecl node, int i) { List<BodyDecl> list = getBodyDeclList(); list.setChild(node, i); } /** * Retrieves the BodyDecl list. * @return The node representing the BodyDecl list. * @apilevel high-level * @ast method * */ public List<BodyDecl> getBodyDecls() { return getBodyDeclList(); } /** * Retrieves the BodyDecl list. * <p><em>This method does not invoke AST transformations.</em></p> * @return The node representing the BodyDecl list. * @apilevel low-level * @ast method * */ public List<BodyDecl> getBodyDeclsNoTransform() { return getBodyDeclListNoTransform(); } /** * Retrieves the BodyDecl list. * @return The node representing the BodyDecl list. * @apilevel high-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public List<BodyDecl> getBodyDeclList() { List<BodyDecl> list = (List<BodyDecl>)getChild(2); list.getNumChild(); return list; } /** * Retrieves the BodyDecl list. * <p><em>This method does not invoke AST transformations.</em></p> * @return The node representing the BodyDecl list. * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public List<BodyDecl> getBodyDeclListNoTransform() { return (List<BodyDecl>)getChildNoTransform(2); } /** * @attribute syn * @aspect ConstantExpression * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:160 */ public Constant cast(Constant c) { ASTNode$State state = state(); try { return Constant.create(c.booleanValue()); } finally { } } /** * @attribute syn * @aspect ConstantExpression * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:266 */ public Constant andBitwise(Constant c1, Constant c2) { ASTNode$State state = state(); try { return Constant.create(c1.booleanValue() & c2.booleanValue()); } finally { } } /** * @attribute syn * @aspect ConstantExpression * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:274 */ public Constant xorBitwise(Constant c1, Constant c2) { ASTNode$State state = state(); try { return Constant.create(c1.booleanValue() ^ c2.booleanValue()); } finally { } } /** * @attribute syn * @aspect ConstantExpression * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:282 */ public Constant orBitwise(Constant c1, Constant c2) { ASTNode$State state = state(); try { return Constant.create(c1.booleanValue() | c2.booleanValue()); } finally { } } /** * @attribute syn * @aspect ConstantExpression * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:290 */ public Constant questionColon(Constant cond, Constant c1, Constant c2) { ASTNode$State state = state(); try { return Constant.create(cond.booleanValue() ? c1.booleanValue() : c2.booleanValue()); } finally { } } /** * @attribute syn * @aspect ConstantExpression * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:394 */ public boolean eqIsTrue(Expr left, Expr right) { ASTNode$State state = state(); try { return left.isTrue() && right.isTrue() || left.isFalse() && right.isFalse(); } finally { } } /** * @attribute syn * @aspect TypeAnalysis * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:181 */ public boolean isBoolean() { ASTNode$State state = state(); try { return true; } finally { } } /** * @apilevel internal */ protected boolean boxed_computed = false; /** * @apilevel internal */ protected TypeDecl boxed_value; /** * @attribute syn * @aspect AutoBoxing * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/AutoBoxing.jrag:36 */ @SuppressWarnings({"unchecked", "cast"}) public TypeDecl boxed() { if(boxed_computed) { return boxed_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boxed_value = boxed_compute(); if(isFinal && num == state().boundariesCrossed) boxed_computed = true; return boxed_value; } /** * @apilevel internal */ private TypeDecl boxed_compute() { return lookupType("java.lang", "Boolean"); } /** * @apilevel internal */ protected boolean jvmName_computed = false; /** * @apilevel internal */ protected String jvmName_value; /** * @attribute syn * @aspect Java2Rewrites * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/Java2Rewrites.jrag:42 */ @SuppressWarnings({"unchecked", "cast"}) public String jvmName() { if(jvmName_computed) { return jvmName_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); jvmName_value = jvmName_compute(); if(isFinal && num == state().boundariesCrossed) jvmName_computed = true; return jvmName_value; } /** * @apilevel internal */ private String jvmName_compute() { return "Z"; } /** * @attribute syn * @aspect Java2Rewrites * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/Java2Rewrites.jrag:44 */ public String primitiveClassName() { ASTNode$State state = state(); try { return "Boolean"; } finally { } } /** * @apilevel internal */ protected boolean getSootType_computed = false; /** * @apilevel internal */ protected Type getSootType_value; /** * @attribute syn * @aspect EmitJimple * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:47 */ @SuppressWarnings({"unchecked", "cast"}) public Type getSootType() { if(getSootType_computed) { return getSootType_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); getSootType_value = getSootType_compute(); if(isFinal && num == state().boundariesCrossed) getSootType_computed = true; return getSootType_value; } /** * @apilevel internal */ private Type getSootType_compute() { return soot.BooleanType.v(); } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }
17,134
26.952692
153
java