Search in sources :

Example 96 with ClassB

use of ast.ExpCore.ClassB in project L42 by ElvisResearchGroup.

the class _Aux method withMember.

static ClassB withMember(ClassB cb, Member m) {
    assert cb.isConsistent();
    List<Member> newMs = new java.util.ArrayList<>(cb.getMs());
    int index = _Aux.getIndex(newMs, m);
    if (index == -1) {
        newMs.add(m);
    } else {
        newMs.set(index, m);
    }
    ClassB result = cb.withMs(newMs);
    return result;
}
Also used : ArrayList(java.util.ArrayList) Member(ast.ExpCore.ClassB.Member) ClassB(ast.ExpCore.ClassB)

Example 97 with ClassB

use of ast.ExpCore.ClassB in project L42 by ElvisResearchGroup.

the class Plugin method MremoveImplementation£xthat£xpath.

@ActionType({ ActionType.NormType.Library, ActionType.NormType.Library, ActionType.NormType.Library })
public Object MremoveImplementation£xthat£xpath(Object _that, Object _path) {
    ClassB that = ensureExtractClassB(_that);
    List<Ast.C> path = PathAux.parseValidCs(ensureExtractStringU(_path));
    return Abstract.toAbstract(that, path);
}
Also used : ClassB(ast.ExpCore.ClassB) EncodingHelper.ensureExtractClassB(auxiliaryGrammar.EncodingHelper.ensureExtractClassB) ActionType(platformSpecific.fakeInternet.ActionType)

Example 98 with ClassB

use of ast.ExpCore.ClassB in project L42 by ElvisResearchGroup.

the class Plugin method MsumMethods£xthat£xpath£xsrc1£xsrc2£xdest£xname.

@ActionType({ ActionType.NormType.Library, ActionType.NormType.Library, ActionType.NormType.Library, ActionType.NormType.Library, ActionType.NormType.Library, ActionType.NormType.Library, ActionType.NormType.Library })
public Object MsumMethods£xthat£xpath£xsrc1£xsrc2£xdest£xname(Object _that, Object _path, Object _src1, Object _src2, Object _dest, Object _name) {
    ClassB that = ensureExtractClassB(_that);
    String name = ensureExtractStringU(_name);
    List<Ast.C> path = PathAux.parseValidCs(ensureExtractStringU(_path));
    MethodSelector src1 = MethodSelector.parse(ensureExtractStringU(_src1));
    MethodSelector src2 = MethodSelector.parse(ensureExtractStringU(_src2));
    MethodSelector dest = MethodSelector.parse(ensureExtractStringU(_dest));
    return SumMethods.sumMethods(that, path, src1, src2, dest, name);
}
Also used : MethodSelector(ast.Ast.MethodSelector) ClassB(ast.ExpCore.ClassB) EncodingHelper.ensureExtractClassB(auxiliaryGrammar.EncodingHelper.ensureExtractClassB) ActionType(platformSpecific.fakeInternet.ActionType)

Example 99 with ClassB

use of ast.ExpCore.ClassB in project L42 by ElvisResearchGroup.

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

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

Example 100 with ClassB

use of ast.ExpCore.ClassB in project L42 by ElvisResearchGroup.

the class Plugin method MdeployCode£xthat£xurl.

@ActionType({ ActionType.NormType.Void, ActionType.NormType.Library, ActionType.NormType.Library })
public Resources.Void MdeployCode£xthat£xurl(Object _that, Object _url) {
    ClassB that = ensureExtractClassB(_that);
    String url = ensureExtractStringU(_url);
    String text = sugarVisitors.ToFormattedText.of(that);
    java.nio.file.Path p = Paths.get(url);
    try {
        Files.write(p, text.getBytes());
    } catch (IOException e) {
        throw new Error(e);
    }
    return Resources.Void.instance;
}
Also used : IOException(java.io.IOException) ClassB(ast.ExpCore.ClassB) EncodingHelper.ensureExtractClassB(auxiliaryGrammar.EncodingHelper.ensureExtractClassB) ActionType(platformSpecific.fakeInternet.ActionType)

Aggregations

ClassB (ast.ExpCore.ClassB)107 ArrayList (java.util.ArrayList)33 Path (ast.Ast.Path)30 ExpCore (ast.ExpCore)25 Member (ast.ExpCore.ClassB.Member)25 EncodingHelper.ensureExtractClassB (auxiliaryGrammar.EncodingHelper.ensureExtractClassB)20 Program (programReduction.Program)20 Ast (ast.Ast)19 MethodWithType (ast.ExpCore.ClassB.MethodWithType)19 MethodSelector (ast.Ast.MethodSelector)18 NestedClass (ast.ExpCore.ClassB.NestedClass)18 List (java.util.List)17 ActionType (platformSpecific.fakeInternet.ActionType)16 Doc (ast.Ast.Doc)12 Type (ast.Ast.Type)12 ErrorMessage (ast.ErrorMessage)12 Optional (java.util.Optional)10 C (ast.Ast.C)9 MethodType (ast.Ast.MethodType)8 Phase (ast.ExpCore.ClassB.Phase)8