use of ast.Expression.ClassB.Member in project L42 by ElvisResearchGroup.
the class ToFormattedText method formatMembers.
private void formatMembers(List<Member> ms) {
for (Member m : ms) {
m.match(nestedClass -> {
nl();
c(nestedClass.getName().toString());
c(":");
formatDoc(nestedClass.getDoc());
return nestedClass.getInner().accept(this);
}, methImpl -> {
nl();
c("method ");
formatMs(methImpl.getS());
return methImpl.getInner().accept(this);
}, methT -> {
nl();
formatMts(methT);
if (methT.getInner().isPresent()) {
methT.getInner().get().accept(this);
}
return null;
});
}
}
use of ast.Expression.ClassB.Member in project L42 by ElvisResearchGroup.
the class ToFormattedText method ofCompact.
public static String ofCompact(Expression e, boolean inline) {
ToFormattedText tft = new ToFormattedText() {
public Void visit(ClassB cb) {
//String res="";
String wb = "";
for (Member m : cb.getMs()) {
if (m instanceof NestedClass) {
NestedClass nc = (NestedClass) m;
if (nc.getInner() instanceof WalkBy) {
wb = nc.getName() + ":##";
}
}
}
return c("{.." + wb + "..}");
}
};
e.accept(tft);
String res = tft.result.toString();
if (inline) {
res = res.replace("\n", " ");
}
//if(res.length()>80){ res=res.substring(0, 34)+" ... "+res.substring(res.length()-34); }
return res;
}
Aggregations