use of ast.Expression in project L42 by ElvisResearchGroup.
the class ToAst method visitUseSquare.
@Override
public Expression visitUseSquare(UseSquareContext ctx) {
SquareContext sq = ctx.square();
SquareWContext sqW = ctx.squareW();
assert sq == null || sqW == null;
assert sq != null || sqW != null;
if (sq != null) {
Expression sq2 = this.new VisitEPost(Expression._void.instance).visitSquare(sq);
assert sq2 instanceof Expression.SquareCall;
return new Expression.UseSquare(sq2);
}
Expression sW2 = sqW.accept(this);
assert sW2 instanceof Expression.SquareWithCall;
return new Expression.UseSquare(((SquareWithCall) sW2).getWith());
}
Aggregations