Search in sources :

Example 26 with Doc

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

the class Plugin method MaddDocumentation£xthat£xpath£xdoc.

@ActionType({ ActionType.NormType.Library, ActionType.NormType.Library, ActionType.NormType.Library, ActionType.NormType.Library })
public Object MaddDocumentation£xthat£xpath£xdoc(Object _that, Object _path, Object _doc) {
    ClassB that = ensureExtractClassB(_that);
    List<Ast.C> path = PathAux.parseValidCs(ensureExtractStringU(_path));
    Doc doc = ensureExtractDoc(_doc);
    return AddDocumentation.addDocumentationOnNestedClass(Resources.getP(), that, path, doc);
}
Also used : Doc(ast.Ast.Doc) EncodingHelper.ensureExtractDoc(auxiliaryGrammar.EncodingHelper.ensureExtractDoc) ClassB(ast.ExpCore.ClassB) EncodingHelper.ensureExtractClassB(auxiliaryGrammar.EncodingHelper.ensureExtractClassB) ActionType(platformSpecific.fakeInternet.ActionType)

Example 27 with Doc

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

the class InjectionOnCore method visit.

public ExpCore visit(Expression.RoundBlock s) {
    Doc doc = s.getDoc();
    assert s.getContents().size() <= 1 : s.getContents();
    List<Dec> decs = new ArrayList<Dec>();
    List<ExpCore.Block.On> ons = new ArrayList<ExpCore.Block.On>();
    ExpCore inner = s.getInner().accept(this);
    if (s.getContents().size() == 1) {
        Expression.BlockContent c = s.getContents().get(0);
        for (Ast.VarDec d : c.getDecs()) {
            assert d instanceof Ast.VarDecXE : d;
            Ast.VarDecXE sugarDec = (Ast.VarDecXE) d;
            //assert sugarDec.getT().isPresent() :sugarDec;
            Optional<Type> t = sugarDec.getT();
            String x = sugarDec.getX();
            ExpCore e = sugarDec.getInner().accept(this);
            decs.add(new Dec(sugarDec.isVar(), t, x, e));
        }
        //END FOR DECS
        ;
        for (Catch k : c.get_catch()) {
            assert k instanceof Expression.Catch1;
            Expression.Catch1 k1 = (Expression.Catch1) k;
            SignalKind kind = k1.getKind();
            String x = k1.getX();
            assert x.length() >= 1;
            ons.add(new ExpCore.Block.On(kind, x, k1.getT(), lift(k1.getInner()), k1.getP()));
        }
        return new Block(doc, decs, inner, ons, s.getP());
    }
    return new Block(doc, decs, inner, Collections.emptyList(), s.getP());
}
Also used : ExpCore(ast.ExpCore) Ast(ast.Ast) Catch(ast.Expression.Catch) ArrayList(java.util.ArrayList) Type(ast.Ast.Type) MethodType(ast.Ast.MethodType) Expression(ast.Expression) Doc(ast.Ast.Doc) Block(ast.ExpCore.Block) SignalKind(ast.Ast.SignalKind)

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