@Override public Expression visit(FromClause fromClause, ILangExpression arg) throws CompilationException { Scope scopeForFromClause = scopeChecker.extendCurrentScope(); for (FromTerm fromTerm : fromClause.getFromTerms()) { fromTerm.accept(this, fromClause); // Merges the variables defined in the current from term into the scope of the current from clause. Scope scopeForFromTerm = scopeChecker.removeCurrentScope(); mergeScopes(scopeForFromClause, scopeForFromTerm, fromTerm.getSourceLocation()); } return null; }
@Override public FromTerm visit(FromTerm fromTerm, Void arg) throws CompilationException { // Visit the left expression of a from term. Expression fromExpr = (Expression) fromTerm.getLeftExpression().accept(this, arg); VariableExpr fromVar = (VariableExpr) fromTerm.getLeftVariable().accept(this, arg); VariableExpr positionVar = fromTerm.getPositionalVariable() == null ? null : (VariableExpr) fromTerm.getPositionalVariable().accept(this, arg); // Visits join/unnest/nest clauses. List<AbstractBinaryCorrelateClause> correlateClauses = new ArrayList<>(); for (AbstractBinaryCorrelateClause correlateClause : fromTerm.getCorrelateClauses()) { correlateClauses.add((AbstractBinaryCorrelateClause) correlateClause.accept(this, arg)); } FromTerm copy = new FromTerm(fromExpr, fromVar, positionVar, correlateClauses); copy.setSourceLocation(fromTerm.getSourceLocation()); return copy; }
newFromTerm.setSourceLocation(fromTerm.getSourceLocation()); return new Pair<>(newFromTerm, currentEnv);
@Override public Pair<ILogicalOperator, LogicalVariable> visit(FromTerm fromTerm, Mutable<ILogicalOperator> tupSource) throws CompilationException { SourceLocation sourceLoc = fromTerm.getSourceLocation(); LogicalVariable fromVar = context.newVarFromExpression(fromTerm.getLeftVariable()); Expression fromExpr = fromTerm.getLeftExpression();