Skip to content

Commit

Permalink
Merge pull request #14 from JoshuaRadin37/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
joshradin authored Apr 3, 2020
2 parents 008ac07 + a754a44 commit aed174f
Show file tree
Hide file tree
Showing 518 changed files with 2,893 additions and 2,726 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ runtime.jdn
*.tast

# Gradle
.gradle
.gradle
/target/
4 changes: 2 additions & 2 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions .idea/runConfigurations/Interpreter_Speed_Test.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions .idea/runConfigurations/JodinGradleMove__build_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/runConfigurations/Toolchain_Runner.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions BackEnd/build/tmp/jar/MANIFEST.MF

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package radin.core.output.backend.compilation;
package radin.backend.compilation;

import radin.core.chaining.ICompilerFunction;
import radin.core.errorhandling.AbstractCompilationError;
import radin.core.output.midanalysis.TypeAugmentedSemanticNode;
import radin.midanalysis.TypeAugmentedSemanticNode;
import radin.core.lexical.Token;
import radin.core.utility.ICompilationSettings;

import java.io.PrintWriter;
import java.io.StringWriter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package radin.core.output.backend.compilation;
package radin.backend.compilation;

import radin.core.output.backend.microcompilers.IndentPrintWriter;
import radin.backend.microcompilers.IndentPrintWriter;
import radin.core.utility.UniversalCompilerSettings;

import java.io.PrintWriter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package radin.core.output.backend.compilation;
package radin.backend.compilation;



import radin.core.output.midanalysis.TypeAugmentedSemanticNode;
import radin.midanalysis.TypeAugmentedSemanticNode;

import java.io.PrintWriter;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package radin.core.output.backend.compilation;
package radin.backend.compilation;

import radin.core.output.backend.microcompilers.TopLevelDeclarationCompiler;
import radin.core.output.midanalysis.TypeAugmentedSemanticNode;
import radin.backend.microcompilers.TopLevelDeclarationCompiler;
import radin.midanalysis.TypeAugmentedSemanticNode;
import radin.core.utility.ICompilationSettings;

import java.io.File;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package radin.core.output.backend.compilation;
package radin.backend.compilation;

import radin.core.output.backend.microcompilers.IndentPrintWriter;
import radin.backend.microcompilers.IndentPrintWriter;
import radin.core.semantics.TypeEnvironment;
import radin.core.semantics.types.compound.CXClassType;
import radin.core.utility.ICompilationSettings;
import radin.core.utility.UniversalCompilerSettings;

import java.io.*;
Expand All @@ -13,6 +14,8 @@
import java.util.function.Predicate;
import java.util.stream.Collectors;

import static radin.core.utility.ICompilationSettings.createBuildFile;

public class RuntimeCompiler extends AbstractIndentedOutputSingleOutputCompiler {


Expand All @@ -21,7 +24,7 @@ public class RuntimeCompiler extends AbstractIndentedOutputSingleOutputCompiler
private String jodinEntrancePoint = "__main";

public RuntimeCompiler(TypeEnvironment environment) throws IOException {
super(new PrintWriter(new FileWriter(new File("runtime.jdn"))), 0);
super(new PrintWriter(new FileWriter(createBuildFile("runtime.jdn"))), 0);
this.environment = environment;
}

Expand All @@ -34,7 +37,8 @@ public static <T> Predicate<T> distinctBy(Function<? super T, ?> f) {
public boolean compile() {

if(System.getenv("JODIN_HOME") != null) {
File baseRuntimeFile = new File(new File(System.getenv("JODIN_HOME")), "runtime.i");
File baseRuntimeFile = ICompilationSettings.getCoreFile("runtime.i");
if(baseRuntimeFile == null) throw new NullPointerException("JODIN_HOME not set, can't create runtime");
try {
BufferedReader bufferedReader = new BufferedReader(new FileReader(baseRuntimeFile));

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package radin.core.output.backend.microcompilers;
package radin.backend.microcompilers;

import radin.core.output.midanalysis.TypeAugmentedSemanticNode;
import radin.core.output.midanalysis.TypeAugmentedSemanticTree;
import radin.core.output.backend.compilation.AbstractIndentedOutputSingleOutputCompiler;
import radin.core.output.tags.PriorConstructorTag;
import radin.midanalysis.TypeAugmentedSemanticNode;
import radin.midanalysis.TypeAugmentedSemanticTree;
import radin.backend.compilation.AbstractIndentedOutputSingleOutputCompiler;
import radin.output.tags.PriorConstructorTag;
import radin.core.semantics.ASTNodeType;
import radin.core.semantics.AbstractSyntaxNode;
import radin.core.semantics.types.compound.CXClassType;
import radin.core.semantics.types.compound.CXStructType;
import radin.core.semantics.types.compound.ICXClassType;
import radin.core.semantics.types.methods.CXConstructor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package radin.core.output.backend.microcompilers;
package radin.backend.microcompilers;

import radin.core.lexical.Token;
import radin.core.output.backend.compilation.AbstractIndentedOutputCompiler;
import radin.core.output.midanalysis.TypeAugmentedSemanticNode;
import radin.backend.compilation.AbstractIndentedOutputCompiler;
import radin.midanalysis.TypeAugmentedSemanticNode;

import java.io.PrintWriter;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package radin.core.output.backend.microcompilers;
package radin.backend.microcompilers;

import radin.core.output.midanalysis.TypeAugmentedSemanticNode;
import radin.core.output.backend.compilation.AbstractIndentedOutputSingleOutputCompiler;
import radin.core.output.tags.PriorConstructorTag;
import radin.midanalysis.TypeAugmentedSemanticNode;
import radin.backend.compilation.AbstractIndentedOutputSingleOutputCompiler;
import radin.output.tags.PriorConstructorTag;
import radin.core.semantics.types.methods.CXConstructor;
import radin.core.semantics.types.methods.CXParameter;
import radin.core.semantics.types.primitives.PointerType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package radin.core.output.backend.microcompilers;
package radin.backend.microcompilers;

import radin.core.output.backend.compilation.AbstractCompiler;
import radin.core.output.midanalysis.TypeAugmentedSemanticNode;
import radin.core.output.tags.BasicCompilationTag;
import radin.core.output.tags.ConstructorCallTag;
import radin.core.output.tags.MethodCallTag;
import radin.core.output.tags.SuperCallTag;
import radin.backend.compilation.AbstractCompiler;
import radin.midanalysis.TypeAugmentedSemanticNode;
import radin.output.tags.BasicCompilationTag;
import radin.output.tags.ConstructorCallTag;
import radin.output.tags.MethodCallTag;
import radin.output.tags.SuperCallTag;
import radin.core.lexical.Token;
import radin.core.semantics.ASTNodeType;
import radin.core.semantics.TypeEnvironment;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package radin.core.output.backend.microcompilers;
package radin.backend.microcompilers;

import radin.core.output.backend.compilation.AbstractIndentedOutputSingleOutputCompiler;
import radin.core.output.midanalysis.TypeAugmentedSemanticNode;
import radin.backend.compilation.AbstractIndentedOutputSingleOutputCompiler;
import radin.midanalysis.TypeAugmentedSemanticNode;
import radin.core.semantics.TypeEnvironment;
import radin.core.semantics.types.CXType;
import radin.core.semantics.types.compound.CXClassType;
import radin.core.semantics.types.methods.CXParameter;
import radin.core.output.typeanalysis.errors.IncorrectlyMissingCompoundStatement;
import radin.output.typeanalysis.errors.IncorrectlyMissingCompoundStatement;
import radin.core.utility.ICompilationSettings;
import radin.core.utility.UniversalCompilerSettings;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package radin.core.output.backend.microcompilers;
package radin.backend.microcompilers;

import radin.core.output.backend.compilation.AbstractIndentedOutputSingleOutputCompiler;
import radin.core.output.midanalysis.TypeAugmentedSemanticNode;
import radin.core.output.tags.ImplementMethodTag;
import radin.core.output.tags.PriorConstructorTag;
import radin.backend.compilation.AbstractIndentedOutputSingleOutputCompiler;
import radin.midanalysis.TypeAugmentedSemanticNode;
import radin.output.tags.ImplementMethodTag;
import radin.output.tags.PriorConstructorTag;
import radin.core.semantics.ASTNodeType;
import radin.core.semantics.types.compound.CXClassType;
import radin.core.semantics.types.methods.CXConstructor;
import radin.core.semantics.types.wrapped.CXMappedType;

import java.io.PrintWriter;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package radin.core.output.backend.microcompilers;
package radin.backend.microcompilers;

import java.io.PrintWriter;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package radin.core.output.backend.microcompilers;
package radin.backend.microcompilers;

import radin.core.output.midanalysis.MethodTASNTracker;
import radin.core.output.midanalysis.TypeAugmentedSemanticNode;
import radin.core.output.typeanalysis.errors.IncorrectlyMissingCompoundStatement;
import radin.core.semantics.ASTNodeType;
import radin.midanalysis.MethodTASNTracker;
import radin.midanalysis.TypeAugmentedSemanticNode;
import radin.output.typeanalysis.errors.IncorrectlyMissingCompoundStatement;
import radin.core.semantics.types.compound.CXClassType;
import radin.core.semantics.types.methods.CXMethod;
import radin.core.semantics.types.methods.CXParameter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package radin.core.output.backend.microcompilers;
package radin.backend.microcompilers;

import radin.core.output.backend.compilation.AbstractIndentedOutputCompiler;
import radin.core.output.midanalysis.TypeAugmentedSemanticNode;
import radin.core.output.tags.ArrayWithSizeTag;
import radin.core.output.tags.BasicCompilationTag;
import radin.core.output.tags.MultiDimensionalArrayWithSizeTag;
import radin.backend.compilation.AbstractIndentedOutputCompiler;
import radin.midanalysis.TypeAugmentedSemanticNode;
import radin.output.tags.ArrayWithSizeTag;
import radin.output.tags.BasicCompilationTag;
import radin.output.tags.MultiDimensionalArrayWithSizeTag;
import radin.core.semantics.ASTNodeType;
import radin.core.semantics.types.CXType;
import radin.core.semantics.types.TypedAbstractSyntaxNode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package radin.core.output.backend.microcompilers;
package radin.backend.microcompilers;

import radin.core.output.backend.compilation.AbstractCompiler;
import radin.core.output.midanalysis.TypeAugmentedSemanticNode;
import radin.core.output.tags.TypeDefHelperTag;
import radin.backend.compilation.AbstractCompiler;
import radin.midanalysis.TypeAugmentedSemanticNode;
import radin.output.tags.TypeDefHelperTag;
import radin.core.semantics.ASTNodeType;
import radin.core.semantics.types.CXType;
import radin.core.semantics.types.ICXWrapper;
Expand Down
2 changes: 0 additions & 2 deletions Combo/build/tmp/jar/MANIFEST.MF

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package radin.core.output.combo;
package radin.combo;

import radin.core.ErrorReader;
import radin.core.IFrontEndUnit;
import radin.core.chaining.IToolChain;
import radin.core.errorhandling.AbstractCompilationError;
import radin.core.errorhandling.CompilationError;
import radin.core.errorhandling.ICompilationErrorCollector;
import radin.core.output.midanalysis.ScopedTypeTracker;
import radin.core.output.midanalysis.TypeAugmentedSemanticNode;
import radin.core.output.typeanalysis.TypeAnalyzer;
import radin.core.output.typeanalysis.errors.MissingMainFunctionError;
import radin.core.output.typeanalysis.errors.MultipleMainDefinitionsError;
import radin.midanalysis.ScopedTypeTracker;
import radin.midanalysis.TypeAugmentedSemanticNode;
import radin.output.typeanalysis.TypeAnalyzer;
import radin.output.typeanalysis.errors.MissingMainFunctionError;
import radin.output.typeanalysis.errors.MultipleMainDefinitionsError;
import radin.core.semantics.AbstractSyntaxNode;
import radin.core.semantics.TypeEnvironment;
import radin.core.semantics.types.CXIdentifier;
Expand Down Expand Up @@ -75,6 +75,25 @@ public MultipleFileHandler(List<File> files, ICompilationSettings<AbstractSyntax
classToFile = new HashMap<>();

}

public void addFile(File file) {
CompilationNode e = new CompilationNode(file, TypeAnalyzer.getEnvironment());
nodes.add(e);
dependencies.put(e, new LinkedList<>());
numberFilesToCompile++;
}

public void addFiles(Collection<File> files) {
for (File file : files) {
addFile(file);
}
}

public void addFiles(File[] files) {
for (File file : files) {
addFile(file);
}
}

public List<Output> getGeneratedOutputs() {
return generatedOutputs;
Expand Down
Loading

0 comments on commit aed174f

Please sign in to comment.