| 106 | | private Parser.Result compileInner(FortressRepository bcr, |
|---|
| 107 | | String... files) { |
|---|
| 108 | | Parser.Result result = new Parser.Result(); |
|---|
| 109 | | |
|---|
| 110 | | // bcr.addRootApis(); |
|---|
| 111 | | |
|---|
| 112 | | for (String s : files) { |
|---|
| 113 | | APIName name = Driver.fileAsApi(s); |
|---|
| 114 | | |
|---|
| 115 | | try { |
|---|
| 116 | | if (name != null) { |
|---|
| 117 | | result = addApiToResult(bcr, result, name); |
|---|
| 118 | | } else { |
|---|
| 119 | | name = Driver.fileAsComponent(s); |
|---|
| 120 | | |
|---|
| 121 | | if (name != null) { |
|---|
| 122 | | result = addComponentToResult(bcr, result, name); |
|---|
| 123 | | } else { |
|---|
| 124 | | result = addComponentToResult(bcr, result, NodeFactory.makeAPIName(s)); |
|---|
| 125 | | } |
|---|
| 126 | | } |
|---|
| 127 | | } catch (ProgramError pe) { |
|---|
| 128 | | Iterable<? extends StaticError> se = pe.getStaticErrors(); |
|---|
| 129 | | if (se == null) { |
|---|
| 130 | | result = new Parser.Result(result, new Parser.Result(new WrappedException(pe, ProjectProperties.debug))); |
|---|
| 131 | | } |
|---|
| 132 | | else { |
|---|
| 133 | | result = new Parser.Result(result, new Parser.Result(se)); |
|---|
| 134 | | } |
|---|
| 135 | | } catch (RepositoryError ex) { |
|---|
| 136 | | throw ex; |
|---|
| 137 | | } catch ( FileNotFoundException ex ){ |
|---|
| 138 | | throw new WrappedException(ex); |
|---|
| 139 | | } catch ( IOException e ){ |
|---|
| 140 | | throw new WrappedException(e); |
|---|
| 141 | | } catch (StaticError ex) { |
|---|
| 142 | | result = addExceptionToResult(result, ex); |
|---|
| 143 | | } |
|---|
| 144 | | } |
|---|
| | 107 | private Parser.Result compileInner(FortressRepository bcr, |
|---|
| | 108 | String file) { |
|---|
| | 109 | Parser.Result result = new Parser.Result(); |
|---|
| | 110 | |
|---|
| | 111 | // bcr.addRootApis(); |
|---|
| | 112 | |
|---|
| | 113 | APIName name = Shell.cuName(file); |
|---|
| | 114 | |
|---|
| | 115 | try { |
|---|
| | 116 | if (Shell.isApi(file)) { |
|---|
| | 117 | result = addApiToResult(bcr, result, name); |
|---|
| | 118 | } else if (Shell.isComponent(file)) { |
|---|
| | 119 | result = addComponentToResult(bcr, result, name); |
|---|
| | 120 | } else { |
|---|
| | 121 | result = addComponentToResult(bcr, result, NodeFactory.makeAPIName(file)); |
|---|
| | 122 | } |
|---|
| | 123 | } catch (ProgramError pe) { |
|---|
| | 124 | Iterable<? extends StaticError> se = pe.getStaticErrors(); |
|---|
| | 125 | if (se == null) { |
|---|
| | 126 | result = new Parser.Result(result, new Parser.Result(new WrappedException(pe, ProjectProperties.debug))); |
|---|
| | 127 | } |
|---|
| | 128 | else { |
|---|
| | 129 | result = new Parser.Result(result, new Parser.Result(se)); |
|---|
| | 130 | } |
|---|
| | 131 | } catch (RepositoryError ex) { |
|---|
| | 132 | throw ex; |
|---|
| | 133 | } catch ( FileNotFoundException ex ){ |
|---|
| | 134 | throw new WrappedException(ex); |
|---|
| | 135 | } catch ( IOException e ){ |
|---|
| | 136 | throw new WrappedException(e); |
|---|
| | 137 | } catch (StaticError ex) { |
|---|
| | 138 | result = addExceptionToResult(result, ex); |
|---|
| | 139 | } |
|---|