( CallStack callstack, Interpreter interpreter)
| 35 | BSHImportDeclaration(int id) { super(id); } |
| 36 | |
| 37 | public Object eval( CallStack callstack, Interpreter interpreter) |
| 38 | throws EvalError |
| 39 | { |
| 40 | NameSpace namespace = callstack.top(); |
| 41 | if ( superImport ) |
| 42 | try { |
| 43 | namespace.doSuperImport(); |
| 44 | } catch ( UtilEvalError e ) { |
| 45 | throw e.toEvalError( this, callstack ); |
| 46 | } |
| 47 | else |
| 48 | { |
| 49 | if ( staticImport ) |
| 50 | { |
| 51 | if ( importPackage ) |
| 52 | { |
| 53 | Class clas = ((BSHAmbiguousName)jjtGetChild(0)).toClass( |
| 54 | callstack, interpreter ); |
| 55 | namespace.importStatic( clas ); |
| 56 | } else |
| 57 | throw new EvalError( |
| 58 | "static field imports not supported yet", |
| 59 | this, callstack ); |
| 60 | } else |
| 61 | { |
| 62 | String name = ((BSHAmbiguousName)jjtGetChild(0)).text; |
| 63 | if ( importPackage ) |
| 64 | namespace.importPackage(name); |
| 65 | else |
| 66 | namespace.importClass(name); |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | return Primitive.VOID; |
| 71 | } |
| 72 | } |
| 73 |
nothing calls this directly
no test coverage detected