Skip to content

Commit

Permalink
GH-615 Simplify panda module and move language from `panda-framew…
Browse files Browse the repository at this point in the history
…ork` to `framework` package
  • Loading branch information
dzikoysk committed Feb 7, 2021
1 parent 59d7e7a commit 7ed1433
Show file tree
Hide file tree
Showing 640 changed files with 4,947 additions and 3,856 deletions.
16 changes: 16 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
#!/bin/bash

#
# Copyright (c) 2021 dzikoysk
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

MAVEN_OPTS="-Xverify:none -XX:+TieredCompilation -XX:TieredStopAtLevel=1"
mvn -T 1C install -am -offline
2 changes: 1 addition & 1 deletion examples/lang/let.panda
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ main {

/* Nillable */

nil let nillableValue = '#'
nil let nillableValue = Java.null()
}
2 changes: 1 addition & 1 deletion panda-framework/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><!--
~ Copyright (c) 2020 Dzikoysk
~ Copyright (c) 2021 dzikoysk
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 Dzikoysk
* Copyright (c) 2021 dzikoysk
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,10 +14,10 @@
* limitations under the License.
*/

package org.panda_lang.language;
package org.panda_lang.framework;

import org.jetbrains.annotations.Nullable;
import org.panda_lang.language.interpreter.source.IndicatedSource;
import org.panda_lang.framework.interpreter.source.IndicatedSource;
import org.panda_lang.utilities.commons.function.Option;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 Dzikoysk
* Copyright (c) 2021 dzikoysk
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,12 +14,12 @@
* limitations under the License.
*/

package org.panda_lang.language;
package org.panda_lang.framework;

import org.panda_lang.language.interpreter.logging.Logger;
import org.panda_lang.language.interpreter.logging.LoggerHolder;
import org.panda_lang.language.resource.Language;
import org.panda_lang.language.resource.Resources;
import org.panda_lang.framework.interpreter.logging.Logger;
import org.panda_lang.framework.interpreter.logging.LoggerHolder;
import org.panda_lang.framework.resource.Language;
import org.panda_lang.framework.resource.Resources;

/**
* Panda Framework controller
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 Dzikoysk
* Copyright (c) 2021 dzikoysk
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.panda_lang.language;
package org.panda_lang.framework;

import java.net.URL;
import java.net.URLClassLoader;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 Dzikoysk
* Copyright (c) 2021 dzikoysk
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,11 +14,11 @@
* limitations under the License.
*/

package org.panda_lang.language;
package org.panda_lang.framework;

import org.panda_lang.language.interpreter.logging.Logger;
import org.panda_lang.language.resource.Language;
import org.panda_lang.language.resource.Resources;
import org.panda_lang.framework.interpreter.logging.Logger;
import org.panda_lang.framework.resource.Language;
import org.panda_lang.framework.resource.Resources;

public abstract class PandaFramework implements FrameworkController {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 Dzikoysk
* Copyright (c) 2021 dzikoysk
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.panda_lang.language;
package org.panda_lang.framework;

public final class PandaFrameworkConstants {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 Dzikoysk
* Copyright (c) 2021 dzikoysk
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.panda_lang.language;
package org.panda_lang.framework;

/**
* Exception thrown by the framework
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 Dzikoysk
* Copyright (c) 2021 dzikoysk
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,10 +14,10 @@
* limitations under the License.
*/

package org.panda_lang.language.architecture;
package org.panda_lang.framework.architecture;

import org.panda_lang.language.interpreter.logging.Logger;
import org.panda_lang.language.interpreter.logging.LoggerHolder;
import org.panda_lang.framework.interpreter.logging.Logger;
import org.panda_lang.framework.interpreter.logging.LoggerHolder;
import org.panda_lang.utilities.commons.function.Option;
import org.panda_lang.utilities.commons.function.Result;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 Dzikoysk
* Copyright (c) 2021 dzikoysk
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,15 +14,15 @@
* limitations under the License.
*/

package org.panda_lang.language.architecture;
package org.panda_lang.framework.architecture;

import org.panda_lang.language.FrameworkController;
import org.panda_lang.language.architecture.module.ModulePath;
import org.panda_lang.language.architecture.module.TypeLoader;
import org.panda_lang.language.architecture.type.generator.TypeGenerator;
import org.panda_lang.language.interpreter.Interpreter;
import org.panda_lang.language.interpreter.logging.LoggerHolder;
import org.panda_lang.language.interpreter.source.SourceService;
import org.panda_lang.framework.FrameworkController;
import org.panda_lang.framework.architecture.module.ModulePath;
import org.panda_lang.framework.architecture.module.TypeLoader;
import org.panda_lang.framework.architecture.type.generator.TypeGenerator;
import org.panda_lang.framework.interpreter.Interpreter;
import org.panda_lang.framework.interpreter.logging.LoggerHolder;
import org.panda_lang.framework.interpreter.source.SourceService;

import java.io.File;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright (c) 2021 dzikoysk
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.panda_lang.framework.architecture;

import org.panda_lang.framework.interpreter.source.Source;

import java.util.Collection;

public interface ModuleSource {

Collection<? extends Source> getSources();

Package getPackage();

String getSimpleName();

String getName();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright (c) 2021 dzikoysk
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.panda_lang.framework.architecture;

public interface Package {

String getVersion();

String getName();

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 Dzikoysk
* Copyright (c) 2021 dzikoysk
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,15 +14,12 @@
* limitations under the License.
*/

package org.panda_lang.panda.language.architecture;
package org.panda_lang.framework.architecture;

import org.panda_lang.language.PandaFrameworkException;
import org.panda_lang.language.architecture.Application;
import org.panda_lang.language.architecture.Environment;
import org.panda_lang.language.architecture.Script;
import org.panda_lang.language.runtime.PandaProcess;
import org.panda_lang.language.runtime.Process;
import org.panda_lang.panda.language.resource.syntax.head.MainScope;
import org.panda_lang.framework.PandaFrameworkException;
import org.panda_lang.framework.architecture.statement.Main;
import org.panda_lang.framework.runtime.PandaProcess;
import org.panda_lang.framework.runtime.Process;
import org.panda_lang.utilities.commons.function.Option;
import org.panda_lang.utilities.commons.function.Result;

Expand Down Expand Up @@ -51,9 +48,9 @@ public <T> Result<Option<T>, Throwable> launch(String... args) {
}
}

private MainScope selectMain() {
List<MainScope> mains = scripts.stream()
.map(applicationScript -> applicationScript.select(MainScope.class))
private Main selectMain() {
List<Main> mains = scripts.stream()
.map(applicationScript -> applicationScript.select(Main.class))
.flatMap(List::stream)
.collect(Collectors.toList());

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 Dzikoysk
* Copyright (c) 2021 dzikoysk
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,22 +14,22 @@
* limitations under the License.
*/

package org.panda_lang.language.architecture;
package org.panda_lang.framework.architecture;

import org.panda_lang.language.architecture.module.Module;
import org.panda_lang.language.architecture.statement.Statement;
import org.panda_lang.framework.architecture.module.Module;
import org.panda_lang.framework.architecture.statement.Statement;
import org.panda_lang.utilities.commons.function.Completable;

import java.util.ArrayList;
import java.util.List;

public abstract class AbstractScript implements Script {
public class PandaScript implements Script {

private final String scriptName;
private final List<Statement> statements = new ArrayList<>();
private final Completable<Module> associatedModule = new Completable<>();

public AbstractScript(String scriptName) {
public PandaScript(String scriptName) {
this.scriptName = scriptName;
}

Expand Down Expand Up @@ -65,4 +65,9 @@ public String getName() {
return scriptName;
}

@Override
public String toString() {
return getName();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright (c) 2021 dzikoysk
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.panda_lang.framework.architecture;

import org.panda_lang.utilities.commons.function.Option;

public interface Routable<T> {

Option<T> getParent();

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 Dzikoysk
* Copyright (c) 2021 dzikoysk
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,10 +14,10 @@
* limitations under the License.
*/

package org.panda_lang.language.architecture;
package org.panda_lang.framework.architecture;

import org.panda_lang.language.architecture.module.Module;
import org.panda_lang.language.architecture.statement.Statement;
import org.panda_lang.framework.architecture.module.Module;
import org.panda_lang.framework.architecture.statement.Statement;
import org.panda_lang.utilities.commons.function.Completable;

import java.util.List;
Expand Down
Loading

0 comments on commit 7ed1433

Please sign in to comment.