Skip to content

Commit

Permalink
Merge pull request #4 from specs-feup/refactor/langspecv1-removal
Browse files Browse the repository at this point in the history
Replace LanguageSpecification
  • Loading branch information
joaobispo authored Jan 2, 2025
2 parents 10dbec3 + 2c7c49b commit 6fcd9fa
Show file tree
Hide file tree
Showing 41 changed files with 3,398 additions and 2,989 deletions.
43 changes: 16 additions & 27 deletions AlpakkaWeaver/src/pt/up/fe/specs/alpakka/weaver/SmaliWeaver.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
import org.lara.interpreter.weaver.interf.JoinPoint;
import org.lara.interpreter.weaver.options.WeaverOption;
import org.lara.interpreter.weaver.utils.LaraResourceProvider;
import org.lara.language.specification.LanguageSpecification;
import org.lara.language.specification.dsl.LanguageSpecification;
import org.suikasoft.jOptions.Interfaces.DataStore;
import pt.up.fe.specs.alpakka.ast.App;
import pt.up.fe.specs.alpakka.ast.SmaliNode;
import pt.up.fe.specs.alpakka.weaver.abstracts.ASmaliWeaverJoinPoint;
import pt.up.fe.specs.alpakka.parser.antlr.SmaliFileParser;
import pt.up.fe.specs.alpakka.parser.antlr.AlpakkaParser;
import pt.up.fe.specs.alpakka.parser.antlr.SmaliFileParser;
import pt.up.fe.specs.alpakka.weaver.abstracts.ASmaliWeaverJoinPoint;
import pt.up.fe.specs.alpakka.weaver.abstracts.weaver.ASmaliWeaver;
import pt.up.fe.specs.alpakka.weaver.options.SmaliWeaverOption;
import pt.up.fe.specs.alpakka.weaver.options.SmaliWeaverOptions;
Expand All @@ -26,7 +26,7 @@
* The abstract class {@link ASmaliWeaverJoinPoint} can be used to add
* user-defined methods and fields which the user intends to add for all join points and are not intended to be used in
* LARA aspects.
*
*
* @author Lara Weaver Generator
*/
public class SmaliWeaver extends ASmaliWeaver {
Expand All @@ -37,21 +37,13 @@ public static String getWovenCodeFoldername() {
return WOVEN_CODE_FOLDERNAME;
}

/**
* Thread-scope WeaverEngine
*/
// private static final SpecsThreadLocal<WeaverEngine> THREAD_LOCAL_WEAVER = new
// SpecsThreadLocal<>(
// WeaverEngine.class);

/**
* @deprecated
* @return
*/
@Deprecated
public static LanguageSpecification buildLanguageSpecificationOld() {
public static LanguageSpecification buildLanguageSpecification() {
return LanguageSpecification.newInstance(() -> "smali/weaverspecs/joinPointModel.xml",
() -> "smali/weaverspecs/artifacts.xml", () -> "smali/weaverspecs/actionModel.xml", true);
() -> "smali/weaverspecs/artifacts.xml", () -> "smali/weaverspecs/actionModel.xml");
}

private static final String ALPAKKA_API_NAME = "alpakka-js";
Expand Down Expand Up @@ -80,7 +72,7 @@ public String getWeaverApiName() {

/**
* Warns the lara interpreter if the weaver accepts a folder as the application or only one file at a time.
*
*
* @return true if the weaver is able to work with several files, false if only works with one file
*/
@Override
Expand All @@ -103,13 +95,10 @@ private List<File> filterSupportedFiles(File... sources) {

/**
* Set a file/folder in the weaver if it is valid file/folder type for the weaver.
*
* @param sources
* the file with the source code
* @param outputDir
* output directory for the generated file(s)
* @param args
* arguments to start the weaver
*
* @param sources the file with the source code
* @param outputDir output directory for the generated file(s)
* @param args arguments to start the weaver
* @return true if the file type is valid
*/
@Override
Expand Down Expand Up @@ -156,7 +145,7 @@ public AstMethods getAstMethods() {

/**
* Return a JoinPoint instance of the language root, i.e., an instance of APlaceholder
*
*
* @return an instance of the join point root/program
*/
@Override
Expand All @@ -169,7 +158,7 @@ public JoinPoint select() {

/**
* Closes the weaver to the specified output directory location, if the weaver generates new file(s)
*
*
* @return if close was successful
*/
@Override
Expand All @@ -182,7 +171,7 @@ public boolean close() {

/**
* Returns a list of Gears associated to this weaver engine
*
*
* @return a list of implementations of {@link AGear} or null if no gears are available
*/
@Override
Expand All @@ -205,8 +194,8 @@ public List<WeaverOption> getOptions() {
}

@Override
public LanguageSpecification getLanguageSpecification() {
return buildLanguageSpecificationOld();
protected LanguageSpecification buildLangSpecs() {
return buildLanguageSpecification();
}

@Override
Expand Down
Binary file modified AlpakkaWeaver/src/pt/up/fe/specs/alpakka/weaver/SmaliWeaver.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 6fcd9fa

Please sign in to comment.