use of ast.Expression in project L42 by ElvisResearchGroup.
the class CloneVisitor method visit.
@Override
public Expression visit(RoundBlock s) {
List<BlockContent> content = Map.of(this::liftBC, s.getContents());
Expression inner = lift(s.getInner());
Expression result = new RoundBlock(s.getP(), liftDoc(s.getDoc()), inner, content);
//assert L42.checkWellFormedness(result);
return result;
}
use of ast.Expression in project L42 by ElvisResearchGroup.
the class DesugarContext method of.
public static Expression of(Set<String> usedVars, Expression e) {
DesugarContext d = new DesugarContext();
d.usedVars = usedVars;
Expression result = e.accept(d);
return result;
//TODO: need to check there is no \ out of scope, that would be ill formed
//it is a subset of what is asserted now with checkRemoved.
}
use of ast.Expression in project L42 by ElvisResearchGroup.
the class DesugarNormalizeReceiver method of.
public static Expression of(Set<String> usedVars, Expression e) {
DesugarNormalizeReceiver d = new DesugarNormalizeReceiver();
d.usedVars = usedVars;
Expression result = e.accept(d);
return result;
}
use of ast.Expression in project L42 by ElvisResearchGroup.
the class Desugar method visit.
public Expression visit(RoundBlock s) {
s = blockEtoXE(s);
//s=blockInferVar(s);
HashMap<String, Type> oldVarEnv = new HashMap<String, Type>(varEnv);
try {
if (!s.getContents().isEmpty()) {
addAllDec(s.getContents().get(0).getDecs());
}
Expression result = super.visit(s);
return result;
} finally {
varEnv = oldVarEnv;
}
}
use of ast.Expression in project L42 by ElvisResearchGroup.
the class Desugar method getBlock.
static RoundBlock getBlock(Position p, String x, Expression xe, Expression inner) {
List<Expression.BlockContent> bc = new ArrayList<>();
List<VarDec> decs = new ArrayList<VarDec>();
decs.add(new VarDecXE(false, Optional.empty(), x, xe));
bc.add(new Expression.BlockContent(decs, Collections.emptyList()));
return new RoundBlock(p, Doc.empty(), inner, bc);
}
Aggregations