Search in sources :

Example 6 with Doc

use of ast.Ast.Doc in project L42 by ElvisResearchGroup.

the class PathAnnotateClass method visit.

public ExpCore visit(ClassB cb) {
    //computeComment(this.getAstNodesPath(),this.getAstIndexesPath());
    String comment = this.getLocator().toStringNoAnnotation();
    Doc doc = Doc.factory(true, comment).sum(cb.getDoc1());
    return super.visit(cb.withDoc1(doc));
}
Also used : Doc(ast.Ast.Doc)

Example 7 with Doc

use of ast.Ast.Doc in project L42 by ElvisResearchGroup.

the class PathAnnotateClass method visit.

public ClassB.MethodImplemented visit(ClassB.MethodImplemented mi) {
    //computeComment(this.getAstNodesPath(),this.getAstIndexesPath());
    String comment = this.getLocator().toStringNoAnnotation();
    //comment+=mi.getS();
    Doc doc = Doc.factory(true, comment).sum(mi.getDoc());
    return super.visit(mi.withDoc(doc));
}
Also used : Doc(ast.Ast.Doc)

Example 8 with Doc

use of ast.Ast.Doc in project L42 by ElvisResearchGroup.

the class PathAnnotateClass method visit.

public ClassB.MethodWithType visit(ClassB.MethodWithType mt) {
    //computeComment(this.getAstNodesPath(),this.getAstIndexesPath());
    String comment = this.getLocator().toStringNoAnnotation();
    //comment+=mt.getMs();
    Doc doc = Doc.factory(true, comment).sum(mt.getDoc());
    return super.visit(mt.withDoc(doc));
}
Also used : Doc(ast.Ast.Doc)

Example 9 with Doc

use of ast.Ast.Doc in project L42 by ElvisResearchGroup.

the class PathAnnotateClass method visit.

public ClassB.NestedClass visit(ClassB.NestedClass nc) {
    //computeComment(this.getAstNodesPath(),this.getAstIndexesPath());
    String comment = this.getLocator().toStringNoAnnotation();
    //comment+=nc.getName();
    Doc doc = Doc.factory(true, comment).sum(nc.getDoc());
    return super.visit(nc.withDoc(doc));
}
Also used : Doc(ast.Ast.Doc)

Example 10 with Doc

use of ast.Ast.Doc in project L42 by ElvisResearchGroup.

the class InjectionOnSugar method visit.

@Override
public Expression visit(MCall s) {
    ast.Expression receiver = lift(s.getInner());
    String name = s.getS().nameToS();
    Doc docs = s.getDoc();
    List<String> xs = s.getS().getNames();
    List<ast.ExpCore> es1 = s.getEs();
    List<ast.Expression> es = new ArrayList<ast.Expression>();
    for (ast.ExpCore e : es1) {
        es.add(lift(e));
    }
    ast.Ast.Parameters ps = new ast.Ast.Parameters(Optional.<ast.Expression>empty(), xs, es);
    Position pos = s.getP();
    return new Expression.MCall(receiver, name, docs, ps, pos);
}
Also used : ExpCore(ast.ExpCore) Ast(ast.Ast) Position(ast.Ast.Position) ArrayList(java.util.ArrayList) ExpCore(ast.ExpCore) Expression(ast.Expression) Expression(ast.Expression) MCall(ast.ExpCore.MCall) Doc(ast.Ast.Doc)

Aggregations

Doc (ast.Ast.Doc)27 ArrayList (java.util.ArrayList)11 Ast (ast.Ast)9 ClassB (ast.ExpCore.ClassB)9 Expression (ast.Expression)9 Path (ast.Ast.Path)8 MethodType (ast.Ast.MethodType)7 Type (ast.Ast.Type)7 ExpCore (ast.ExpCore)7 MethodSelector (ast.Ast.MethodSelector)5 List (java.util.List)5 Optional (java.util.Optional)5 VarDec (ast.Ast.VarDec)4 Member (ast.ExpCore.ClassB.Member)4 Catch (ast.Expression.Catch)4 Mdf (ast.Ast.Mdf)3 Position (ast.Ast.Position)3 Block (ast.ExpCore.Block)3 MethodWithType (ast.ExpCore.ClassB.MethodWithType)3 Phase (ast.ExpCore.ClassB.Phase)3