Search in sources :

Example 26 with MethodSelector

use of ast.Ast.MethodSelector 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 27 with MethodSelector

use of ast.Ast.MethodSelector 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 28 with MethodSelector

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

the class MakeKs method prototypeK.

//can not reuse the desugar one, here we create ExpCore stuff, also , the sugar one may disappear
private static MethodWithType prototypeK(Doc doc, List<String> fieldNames, List<Type> fieldTypes, Position pos) {
    MethodSelector ms = MethodSelector.of("", fieldNames);
    Type resT = Type.mutThis0;
    MethodType mt = new MethodType(false, ast.Ast.Mdf.Class, fieldTypes, resT, Collections.emptyList());
    return new MethodWithType(doc, ms, mt, Optional.empty(), pos);
}
Also used : MethodType(ast.Ast.MethodType) MethodSelector(ast.Ast.MethodSelector) Type(ast.Ast.Type) MethodType(ast.Ast.MethodType)

Example 29 with MethodSelector

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

the class Plugin method MliftValue£xthat£xselector£xlib.

@ActionType({ ActionType.NormType.Library, ActionType.NormType.ImmAny, ActionType.NormType.Library, ActionType.NormType.Library })
public Object MliftValue£xthat£xselector£xlib(Object _that, Object _selector, Object _lib) {
    ClassB lib = ensureExtractClassB(_lib);
    MethodSelector selector = MethodSelector.parse(ensureExtractStringU(_selector));
    //TODO: would go in loop for circular graphs?
    ExpCore val = Revertable.doRevert(_that);
    val = From.from(val, Path.outer(1));
    return LiftValue.liftValue(val, selector, lib);
}
Also used : ExpCore(ast.ExpCore) MethodSelector(ast.Ast.MethodSelector) ClassB(ast.ExpCore.ClassB) EncodingHelper.ensureExtractClassB(auxiliaryGrammar.EncodingHelper.ensureExtractClassB) ActionType(platformSpecific.fakeInternet.ActionType)

Example 30 with MethodSelector

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

the class Plugin method MhideMethod£xthat£xpath£xsrc.

//--------------------------
@ActionType({ ActionType.NormType.Library, ActionType.NormType.Library, ActionType.NormType.Library, ActionType.NormType.Library })
public Object MhideMethod£xthat£xpath£xsrc(Object _that, Object _path, Object _src) {
    ClassB that = ensureExtractClassB(_that);
    List<Ast.C> path = PathAux.parseValidCs(ensureExtractStringU(_path));
    MethodSelector src = MethodSelector.parse(ensureExtractStringU(_src));
    MethodSelector dest = src.withUniqueNum(L42.freshPrivate());
    return Rename.renameMethod(Resources.getP(), that, path, src, dest);
}
Also used : MethodSelector(ast.Ast.MethodSelector) ClassB(ast.ExpCore.ClassB) EncodingHelper.ensureExtractClassB(auxiliaryGrammar.EncodingHelper.ensureExtractClassB) ActionType(platformSpecific.fakeInternet.ActionType)

Aggregations

MethodSelector (ast.Ast.MethodSelector)31 ClassB (ast.ExpCore.ClassB)17 MethodType (ast.Ast.MethodType)11 ArrayList (java.util.ArrayList)11 Path (ast.Ast.Path)9 MethodWithType (ast.ExpCore.ClassB.MethodWithType)9 Type (ast.Ast.Type)8 EncodingHelper.ensureExtractClassB (auxiliaryGrammar.EncodingHelper.ensureExtractClassB)8 ActionType (platformSpecific.fakeInternet.ActionType)8 Ast (ast.Ast)6 Doc (ast.Ast.Doc)6 ExpCore (ast.ExpCore)6 List (java.util.List)6 Member (ast.ExpCore.ClassB.Member)5 MethodWithType (ast.Expression.ClassB.MethodWithType)5 Collections (java.util.Collections)5 Optional (java.util.Optional)5 Program (programReduction.Program)5 C (ast.Ast.C)4 Mdf (ast.Ast.Mdf)4