Checks function calls, variable references and updating semantics. @param main main module; null for library modules @throws QueryException query exception
(final MainModule main)
| 271 | * @throws QueryException query exception |
| 272 | */ |
| 273 | private void check(final MainModule main) throws QueryException { |
| 274 | // resolve function calls |
| 275 | qc.functions.resolve(); |
| 276 | // resolve variable references |
| 277 | qc.vars.resolve(); |
| 278 | |
| 279 | if(qc.contextValue != null) { |
| 280 | final Expr ctx = qc.contextValue.expr; |
| 281 | if(!sc.mixUpdates && ctx.has(Flag.UPD)) throw error(UPCTX, ctx); |
| 282 | } |
| 283 | |
| 284 | if(qc.updating) { |
| 285 | // check updating semantics if updating expressions exist |
| 286 | if(!sc.mixUpdates) { |
| 287 | qc.functions.checkUp(); |
| 288 | qc.vars.checkUp(); |
| 289 | if(main != null) main.expr.checkUp(); |
| 290 | } |
| 291 | // check if main expression is updating |
| 292 | qc.updating = main != null && main.expr.has(Flag.UPD); |
| 293 | } |
| 294 | } |
| 295 | |
| 296 | /** |
| 297 | * Parses the "VersionDecl" rule. |
no test coverage detected