Search in sources :

Example 66 with Expression

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());
}
Also used : Expression(ast.Expression)

Aggregations

Expression (ast.Expression)66 ArrayList (java.util.ArrayList)24 VarDec (ast.Ast.VarDec)14 X (ast.Expression.X)13 Type (ast.Ast.Type)11 VarDecXE (ast.Ast.VarDecXE)11 ExpCore (ast.ExpCore)11 Catch (ast.Expression.Catch)11 RoundBlock (ast.Expression.RoundBlock)11 VarDecE (ast.Ast.VarDecE)10 Doc (ast.Ast.Doc)8 Position (ast.Ast.Position)8 MethodSelectorX (ast.Ast.MethodSelectorX)7 Parameters (ast.Ast.Parameters)7 MethodWithType (ast.Expression.ClassB.MethodWithType)7 MethodType (ast.Ast.MethodType)6 ClassB (ast.ExpCore.ClassB)6 InjectionOnCore (sugarVisitors.InjectionOnCore)6 Ast (ast.Ast)5 Path (ast.Ast.Path)4