Skip to content

Commit

Permalink
Class rename and cleaning up unneeded classes
Browse files Browse the repository at this point in the history
  • Loading branch information
avishek-sen-gupta committed Nov 17, 2024
1 parent f891f00 commit 7d26c73
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 89 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ private TranspilerInstruction resolveNode(LocationNode locationNode, List<Transp
entry(nextLocation(instructions, currentAddress), transpilerNodeMap, instructions);
case ExitIterationScopeLocationNode s ->
exit(iterationExit(currentAddress, instructions), transpilerNodeMap, instructions);
case IdLocationNode i ->
instructions.stream().filter(instr -> instr.ref().id().equals(i.getDestination().id()) && instr.sentinel() == i.getSentinel()).findFirst().get();
default -> TranspilerInstruction.NULL;
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ private TranspilerInstruction resolveNode(LocationNode locationNode, List<Transp
entry(nextLocation(instructions, currentAddress), transpilerNodeMap, instructions);
case ExitIterationScopeLocationNode s ->
exit(iterationExit(currentAddress, instructions), transpilerNodeMap, instructions);
case IdLocationNode i ->
instructions.stream().filter(instr -> instr.ref().id().equals(i.getDestination().id()) && instr.sentinel() == i.getSentinel()).findFirst().get();
default -> TranspilerInstruction.NULL;
};
}
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,9 @@ public static TranspilerNode clone(TranspilerNode original, List<TranspilerNode>
case NestedConditionNode n -> new NestedConditionNode(n.getExpression());
case NextLocationNode n -> new NextLocationNode();
case NamedLocationNode n -> new NamedLocationNode(n.getName());
case InstructionLocationNode n -> new InstructionLocationNode(n.getNode());
case ExitTranspilerNode n -> new ExitTranspilerNode();
case ExitIterationScopeLocationNode n -> new ExitIterationScopeLocationNode();
case ProgramTerminalLocationNode n -> new ProgramTerminalLocationNode();
case IdLocationNode n -> new IdLocationNode(n.getDestination(), n.getSentinel());
case PrintTranspilerNode n -> new PrintTranspilerNode(n.getOperands());
case SetTranspilerNode n -> new SetTranspilerNode(n.getSource(), n.getDestination());
case LabelledTranspilerCodeBlockNode n ->
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@

import java.io.IOException;

public class BuildSeedModelTask implements AnalysisTask {
public class BuildBaseModelTask implements AnalysisTask {
private final ParsePipeline pipeline;
private final IdProvider idProvider;

public BuildSeedModelTask(ParsePipeline pipeline, IdProvider idProvider) {
public BuildBaseModelTask(ParsePipeline pipeline, IdProvider idProvider) {
this.pipeline = pipeline;
this.idProvider = idProvider;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public AnalysisTaskResult run() {
public AnalysisTask BUILD_BASE_ANALYSIS = new AnalysisTask() {
@Override
public AnalysisTaskResult run() {
AnalysisTaskResult result = new BuildSeedModelTask(pipeline, idProvider).run();
AnalysisTaskResult result = new BuildBaseModelTask(pipeline, idProvider).run();
return switch (result) {
case AnalysisTaskResultOK o -> {
baseModel = o.getDetail();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.smojol.toolkit.analysis.pipeline.ParsePipeline;
import org.smojol.toolkit.analysis.pipeline.config.GraphMLExportConfig;
import org.smojol.toolkit.analysis.pipeline.config.SourceConfig;
import org.smojol.toolkit.analysis.task.analysis.BuildSeedModelTask;
import org.smojol.toolkit.analysis.task.analysis.BuildBaseModelTask;
import org.smojol.toolkit.analysis.task.analysis.ExportToGraphMLTask;
import org.smojol.toolkit.interpreter.structure.OccursIgnoringFormat1DataStructureBuilder;
import org.smojol.toolkit.task.AnalysisTaskResult;
Expand All @@ -43,7 +43,7 @@ void canCreateDataStructures() {
new EntityNavigatorBuilder(), new UnresolvedReferenceThrowStrategy(),
new OccursIgnoringFormat1DataStructureBuilder(), new UUIDProvider(), resourceOperations);
ParsePipeline pipeline = new ParsePipeline(sourceConfig, ops, LanguageDialect.COBOL);
AnalysisTaskResult buildSeedModelResult = new BuildSeedModelTask(pipeline, new UUIDProvider()).run();
AnalysisTaskResult buildSeedModelResult = new BuildBaseModelTask(pipeline, new UUIDProvider()).run();
switch (buildSeedModelResult) {
case AnalysisTaskResultOK o -> {
BaseAnalysisModel r = o.getDetail();
Expand Down

0 comments on commit 7d26c73

Please sign in to comment.