1 package polyglot.ast; 2 3 import polyglot.types.Flags; 4 import polyglot.types.Type; 5 import polyglot.types.Type; 6 import polyglot.types.Package; 7 import polyglot.util.Position; 8 import java.util.List ; 9 10 15 public interface NodeFactory 16 { 17 18 21 Disamb disamb(); 22 23 27 AmbExpr AmbExpr(Position pos, String name); 28 29 AmbReceiver AmbReceiver(Position pos, String name); 31 AmbReceiver AmbReceiver(Position pos, Prefix prefix, String name); 32 33 AmbQualifierNode AmbQualifierNode(Position pos, String name); 35 AmbQualifierNode AmbQualifierNode(Position pos, QualifierNode qual, String name); 36 37 AmbPrefix AmbPrefix(Position pos, String name); 39 AmbPrefix AmbPrefix(Position pos, Prefix prefix, String name); 40 41 AmbTypeNode AmbTypeNode(Position pos, String name); 42 AmbTypeNode AmbTypeNode(Position pos, QualifierNode qualifier, String name); 43 44 ArrayTypeNode ArrayTypeNode(Position pos, TypeNode base); 45 CanonicalTypeNode CanonicalTypeNode(Position pos, Type type); 46 47 ArrayAccess ArrayAccess(Position pos, Expr base, Expr index); 48 49 ArrayInit ArrayInit(Position pos); 50 ArrayInit ArrayInit(Position pos, List elements); 51 52 Assert Assert(Position pos, Expr cond); 53 Assert Assert(Position pos, Expr cond, Expr errorMessage); 54 55 Assign Assign(Position pos, Expr target, Assign.Operator op, Expr source); 56 LocalAssign LocalAssign(Position pos, Local target, Assign.Operator op, Expr source); 57 FieldAssign FieldAssign(Position pos, Field target, Assign.Operator op, Expr source); 58 ArrayAccessAssign ArrayAccessAssign(Position pos, ArrayAccess target, Assign.Operator op, Expr source); 59 AmbAssign AmbAssign(Position pos, Expr target, Assign.Operator op, Expr source); 60 61 Binary Binary(Position pos, Expr left, Binary.Operator op, Expr right); 62 63 Block Block(Position pos); 64 Block Block(Position pos, Stmt s1); 65 Block Block(Position pos, Stmt s1, Stmt s2); 66 Block Block(Position pos, Stmt s1, Stmt s2, Stmt s3); 67 Block Block(Position pos, Stmt s1, Stmt s2, Stmt s3, Stmt s4); 68 Block Block(Position pos, List statements); 69 70 SwitchBlock SwitchBlock(Position pos, List statements); 71 72 BooleanLit BooleanLit(Position pos, boolean value); 73 74 Branch Break(Position pos); 75 Branch Break(Position pos, String label); 76 77 Branch Continue(Position pos); 78 Branch Continue(Position pos, String label); 79 Branch Branch(Position pos, Branch.Kind kind); 80 Branch Branch(Position pos, Branch.Kind kind, String label); 81 82 Call Call(Position pos, String name); 83 Call Call(Position pos, String name, Expr a1); 84 Call Call(Position pos, String name, Expr a1, Expr a2); 85 Call Call(Position pos, String name, Expr a1, Expr a2, Expr a3); 86 Call Call(Position pos, String name, Expr a1, Expr a2, Expr a3, Expr a4); 87 Call Call(Position pos, String name, List args); 88 89 Call Call(Position pos, Receiver target, String name); 90 Call Call(Position pos, Receiver target, String name, Expr a1); 91 Call Call(Position pos, Receiver target, String name, Expr a1, Expr a2); 92 Call Call(Position pos, Receiver target, String name, Expr a1, Expr a2, Expr a3); 93 Call Call(Position pos, Receiver target, String name, Expr a1, Expr a2, Expr a3, Expr a4); 94 Call Call(Position pos, Receiver target, String name, List args); 95 96 Case Default(Position pos); 97 Case Case(Position pos, Expr expr); 98 99 Cast Cast(Position pos, TypeNode type, Expr expr); 100 101 Catch Catch(Position pos, Formal formal, Block body); 102 103 CharLit CharLit(Position pos, char value); 104 105 ClassBody ClassBody(Position pos, List members); 106 107 ClassDecl ClassDecl(Position pos, Flags flags, String name, 108 TypeNode superClass, List interfaces, ClassBody body); 109 110 ClassLit ClassLit(Position pos, TypeNode typeNode); 111 112 Conditional Conditional(Position pos, Expr cond, Expr consequent, Expr alternative); 113 114 ConstructorCall ThisCall(Position pos, List args); 115 ConstructorCall ThisCall(Position pos, Expr outer, List args); 116 ConstructorCall SuperCall(Position pos, List args); 117 ConstructorCall SuperCall(Position pos, Expr outer, List args); 118 ConstructorCall ConstructorCall(Position pos, ConstructorCall.Kind kind, List args); 119 ConstructorCall ConstructorCall(Position pos, ConstructorCall.Kind kind, 120 Expr outer, List args); 121 122 ConstructorDecl ConstructorDecl(Position pos, Flags flags, String name, 123 List formals, List throwTypes, 124 Block body); 125 126 FieldDecl FieldDecl(Position pos, Flags flags, TypeNode type, String name); 127 FieldDecl FieldDecl(Position pos, Flags flags, TypeNode type, String name, Expr init); 128 129 Do Do(Position pos, Stmt body, Expr cond); 130 131 Empty Empty(Position pos); 132 133 Eval Eval(Position pos, Expr expr); 134 135 Field Field(Position pos, String name); 136 Field Field(Position pos, Receiver target, String name); 137 138 FloatLit FloatLit(Position pos, FloatLit.Kind kind, double value); 139 140 For For(Position pos, List inits, Expr cond, List iters, Stmt body); 141 142 Formal Formal(Position pos, Flags flags, TypeNode type, String name); 143 144 If If(Position pos, Expr cond, Stmt consequent); 145 If If(Position pos, Expr cond, Stmt consequent, Stmt alternative); 146 147 Import Import(Position pos, Import.Kind kind, String name); 148 149 Initializer Initializer(Position pos, Flags flags, Block body); 150 151 Instanceof Instanceof(Position pos, Expr expr, TypeNode type); 152 153 IntLit IntLit(Position pos, IntLit.Kind kind, long value); 154 155 Labeled Labeled(Position pos, String label, Stmt body); 156 157 Local Local(Position pos, String name); 158 159 LocalClassDecl LocalClassDecl(Position pos, ClassDecl decl); 160 161 LocalDecl LocalDecl(Position pos, Flags flags, TypeNode type, String name); 162 LocalDecl LocalDecl(Position pos, Flags flags, TypeNode type, String name, Expr init); 163 164 MethodDecl MethodDecl(Position pos, Flags flags, TypeNode returnType, String name, 165 List formals, List throwTypes, Block body); 166 167 New New(Position pos, TypeNode type, List args); 168 New New(Position pos, TypeNode type, List args, ClassBody body); 169 170 New New(Position pos, Expr outer, TypeNode objectType, List args); 171 New New(Position pos, Expr outer, TypeNode objectType, List args, ClassBody body); 172 173 NewArray NewArray(Position pos, TypeNode base, List dims); 174 NewArray NewArray(Position pos, TypeNode base, List dims, int addDims); 175 NewArray NewArray(Position pos, TypeNode base, int addDims, ArrayInit init); 176 NewArray NewArray(Position pos, TypeNode base, List dims, int addDims, ArrayInit init); 177 178 NullLit NullLit(Position pos); 179 180 Return Return(Position pos); 181 Return Return(Position pos, Expr expr); 182 183 SourceCollection SourceCollection(Position pos, List sources); 184 185 SourceFile SourceFile(Position pos, List decls); 186 SourceFile SourceFile(Position pos, List imports, List decls); 187 SourceFile SourceFile(Position pos, PackageNode packageName, List imports, List decls); 188 189 Special This(Position pos); 190 Special This(Position pos, TypeNode outer); 191 192 Special Super(Position pos); 193 Special Super(Position pos, TypeNode outer); 194 Special Special(Position pos, Special.Kind kind); 195 Special Special(Position pos, Special.Kind kind, TypeNode outer); 196 197 StringLit StringLit(Position pos, String value); 198 199 Switch Switch(Position pos, Expr expr, List elements); 200 201 Synchronized Synchronized(Position pos, Expr expr, Block body); 202 203 Throw Throw(Position pos, Expr expr); 204 205 Try Try(Position pos, Block tryBlock, List catchBlocks); 206 Try Try(Position pos, Block tryBlock, List catchBlocks, Block finallyBlock); 207 208 PackageNode PackageNode(Position pos, Package p); 209 210 Unary Unary(Position pos, Unary.Operator op, Expr expr); 211 Unary Unary(Position pos, Expr expr, Unary.Operator op); 212 213 While While(Position pos, Expr cond, Stmt body); 214 215 } 216 | Popular Tags |