Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions fullRuntime/src/sc/util/FileUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -742,12 +742,12 @@ public static String makeCanonical(String dir) throws IOException {
}

public static String makePathAbsolute(String path) {
String[] pathDirs = StringUtil.split(path, ':');
String[] pathDirs = StringUtil.split(path, File.pathSeparator);
StringBuilder sb = new StringBuilder();
boolean first = true;
for (String pathDir:pathDirs) {
if (!first)
sb.append(":");
sb.append(File.pathSeparator);
else
first = false;
sb.append(FileUtil.makeAbsolute(pathDir));
Expand Down
2 changes: 1 addition & 1 deletion fullRuntime/src/sc/util/StringUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public static String arrayToPath(Object[] list) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < list.length; i++) {
if (i != 0)
sb.append(":");
sb.append(File.pathSeparator);
sb.append(list[i]);
}
return sb.toString();
Expand Down
25 changes: 18 additions & 7 deletions system/src/sc/classfile/ClassFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,23 @@

package sc.classfile;

import sc.lang.java.*;
import java.io.BufferedInputStream;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;

import sc.lang.java.AccessLevel;
import sc.lang.java.ExecutionContext;
import sc.lang.java.IDefinition;
import sc.lang.java.ITypeDeclaration;
import sc.lang.java.IValueNode;
import sc.lang.java.JavaSemanticNode;
import sc.layer.Layer;
import sc.layer.LayeredSystem;
import sc.type.RTypeUtil;
Expand All @@ -13,12 +29,6 @@
import sc.util.IntCoalescedHashMap;
import sc.util.MessageHandler;

import java.io.*;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;

public class ClassFile {
DataInputStream input;
IMessageHandler msg;
Expand Down Expand Up @@ -791,6 +801,7 @@ public static void main(String[] args) {
file.initialize();
}
catch (IOException exc) {
exc.printStackTrace();
System.out.println("**** Can't open file: " + exc);
}
}
Expand Down
74 changes: 59 additions & 15 deletions system/src/sc/layer/Layer.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,60 @@

package sc.layer;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InvalidClassException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.regex.Pattern;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

import sc.classfile.CFClass;
import sc.dyn.IDynObject;
import sc.lang.*;
import sc.lang.DynObject;
import sc.lang.IAnnotationProcessor;
import sc.lang.IDefinitionProcessor;
import sc.lang.ILanguageModel;
import sc.lang.SemanticNodeList;
import sc.lang.java.AnonClassDeclaration;
import sc.lang.java.BodyTypeDeclaration;
import sc.lang.java.BooleanLiteral;
import sc.lang.java.ClassType;
import sc.lang.java.DeclarationType;
import sc.lang.java.EnumConstant;
import sc.lang.java.ExecutionContext;
import sc.lang.java.ImportDeclaration;
import sc.lang.java.JavaModel;
import sc.lang.java.JavaSemanticNode;
import sc.lang.java.JavaType;
import sc.lang.java.MethodDefinition;
import sc.lang.java.ModelUtil;
import sc.lang.java.TypeDeclaration;
import sc.lang.java.UpdateInstanceInfo;
import sc.lang.sc.IScopeProcessor;
import sc.lang.sc.SCModel;
import sc.lang.sc.ModifyDeclaration;
import sc.lang.sc.PropertyAssignment;
import sc.lang.sc.SCModel;
import sc.lifecycle.ILifecycle;
import sc.lang.sc.ModifyDeclaration;
import sc.lang.java.*;
import sc.obj.CompilerSettings;
import sc.obj.Constant;
import sc.obj.GlobalScopeDefinition;
Expand All @@ -27,14 +72,11 @@
import sc.type.CTypeUtil;
import sc.type.RTypeUtil;
import sc.type.TypeUtil;
import sc.util.*;

import java.io.*;
import java.net.URL;
import java.util.*;
import java.util.regex.Pattern;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import sc.util.FileUtil;
import sc.util.IdentityWrapper;
import sc.util.MessageType;
import sc.util.PerfMon;
import sc.util.StringUtil;

/**
* The main implementation class for a Layer. There's one instance of this class for
Expand Down Expand Up @@ -1664,6 +1706,7 @@ public void start() {
zipFiles[i] = new ZipFile(classDir);
}
catch (IOException exc) {
exc.printStackTrace();
System.err.println("*** Can't open layer: " + layerPathName + "'s classPath entry as a zip file: " + classDir);
}
}
Expand All @@ -1683,6 +1726,7 @@ public void start() {
externalZipFiles[i] = new ZipFile(classDir);
}
catch (IOException exc) {
exc.printStackTrace();
System.err.println("*** Can't open layer: " + layerPathName + "'s classPath entry as a zip file: " + classDir);
}
}
Expand Down Expand Up @@ -3651,7 +3695,7 @@ public void installPackages(RepositoryPackage[] pkgList) {
if (classPath == null)
classPath = cp;
else
classPath = classPath + ":" + cp;
classPath = classPath + File.pathSeparator + cp;
}
// TODO: should we also let a package add to the src path? What about directory prefixes and file types?
}
Expand Down Expand Up @@ -3868,9 +3912,9 @@ public void addSrcPath(String srcPath, String srcPathType, String buildPrefix) {
// Relative paths will already be found in the default src path (layerPathName) - so no need to add them here
if (abs) {
if (this.srcPath != null) {
this.srcPath = this.srcPath + ":" + srcPath;
this.srcPath = this.srcPath + File.pathSeparator + srcPath;
} else
this.srcPath = layerPathName + ":" + srcPath;
this.srcPath = layerPathName + File.pathSeparator + srcPath;
}
}
else
Expand Down
2 changes: 1 addition & 1 deletion system/src/sc/layer/LayeredSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -5607,7 +5607,7 @@ public void addLayerPathDir(String dirName) {
// Include any new entries in the .layerPath file into the layer path
String layerPath = FileUtil.getFileAsString(layerPathFileName);
if (layerPath != null && !layerPath.trim().equals(".")) {
String[] newLayerPaths = layerPath.split(":");
String[] newLayerPaths = layerPath.split(File.pathSeparator);
for (String newLayerPath:newLayerPaths) {
if (!inLayerPath(newLayerPath)) {
File newDirFile = new File(newLayerPath);
Expand Down
2 changes: 1 addition & 1 deletion system/src/sc/parser/Language.java
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ public Parselet getStartParselet() {
* @param pkg
*/
public void setSemanticValueClassPath(String pkg) {
semanticValueClassPath = pkg.split(":");
semanticValueClassPath = pkg.split(File.pathSeparator);
}

public void addToSemanticValueClassPath(String newPkg) {
Expand Down