Skip to content

Commit

Permalink
newcode
Browse files Browse the repository at this point in the history
  • Loading branch information
marapapman committed May 4, 2016
1 parent 02418e6 commit 3d401d2
Show file tree
Hide file tree
Showing 174 changed files with 16,260 additions and 0 deletions.
27 changes: 27 additions & 0 deletions code_automaton/AutomatonTranslator/.classpath
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry combineaccessrules="false" kind="src" path="/stringresolver"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
23 changes: 23 additions & 0 deletions code_automaton/AutomatonTranslator/.project
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>AutomatonTranslator</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
@@ -0,0 +1,4 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/test/java=UTF-8
encoding/<project>=UTF-8
@@ -0,0 +1,12 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.7
@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
52 changes: 52 additions & 0 deletions code_automaton/AutomatonTranslator/pom.xml
@@ -0,0 +1,52 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>usc.sql</groupId>
<artifactId>stringresolver</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>stringresolver</name>
<url>http://maven.apache.org</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>dk.brics.automaton</groupId>
<artifactId>automaton</artifactId>
<version>1.11-8</version>
</dependency>
<dependency>
<groupId>soot-all</groupId>
<artifactId>soot-all</artifactId>
<version>soot-all</version>
</dependency>
<dependency>
<groupId>bcel</groupId>
<artifactId>bcel</artifactId>
<version>5.2</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>usc.sql</id>
<name>USC Software Quality Lab</name>
<url>http://atlanta.usc.edu:8081/artifactory/repo</url>
</repository>
</repositories>
</project>
57 changes: 57 additions & 0 deletions code_automaton/AutomatonTranslator/src/main/java/JustForFun.java
@@ -0,0 +1,57 @@
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Set;

import sql.usc.StringResolver.ExtendedOperation;
import dk.brics.automaton.Automaton;


public class JustForFun {
public static Automaton readtext(String path) throws IOException
{
BufferedReader br = new BufferedReader(new FileReader(path));
String line;
Set<String> set=new HashSet<String>();
int maxlen=0;
Automaton f=Automaton.makeEmpty();
int cnt=0;
while ((line = br.readLine()) != null) {
// process the line.
//System.out.println(line);
cnt++;
Automaton c=Automaton.makeString(line);
System.out.println(cnt);

if(!c.subsetOf(f))
{
Automaton t=f.union(c);
f=ExtendedOperation.Widen(f, t);



}
else{
System.out.println("converge "+cnt);
return f;
}

}
return f;
}
public static void main(String argv[]) throws IOException, ClassCastException, ClassNotFoundException{
if(argv.length!=1)
{
System.out.println("Usage: AutomatonWidener string_folder");
System.exit(0);
}
String stringpath=argv[0];
Automaton a=readtext(stringpath);

}
}

0 comments on commit 3d401d2

Please sign in to comment.