Skip to content

Commit 642f099

Browse files
committed
Update legacy naming
1 parent 32b340b commit 642f099

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+3910
-163
lines changed

grammars/mysql_exp.sgl

+3,745
Large diffs are not rendered by default.

grammars/test.sgl

+4-2
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ createTable returns[cn]
2222
;
2323

2424
t [c=1] returns [d]
25-
: <c>=11> 'T' c t[c-1] d=$c | <c<1> '<->' | '<==>'
25+
: <c>=11> 'T' c t[c$-1] d=$c | <c<1> '<->' | '<==>'
2626
;
2727

2828
ord
29-
: @2 ' ' i+1 @1 i=5-2+3
29+
: @2 ' ' i+1 @1 i=5$-2$+3
3030
;
3131

3232
ls
@@ -47,4 +47,6 @@ LIKE : ' LIKE ';
4747

4848
INT : (DIGIT)**random[3,10];
4949

50+
table returns [t] : t=$query['SHOW TABLES;', 'Tables_in_'$+DB];
51+
5052
DIGIT : [0-9];

pom.xml

+5-5
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<testSourceDirectory>test</testSourceDirectory>
4343
<resources>
4444
<resource>
45-
<directory>src/lancerfuzz/resources</directory>
45+
<directory>src/SGL/resources</directory>
4646
</resource>
4747
</resources>
4848
<plugins>
@@ -217,11 +217,11 @@
217217
</configuration>
218218
</execution>
219219
<execution>
220-
<id>lancerfuzz</id>
220+
<id>SGL</id>
221221
<goals><goal>single</goal></goals>
222222
<phase>package</phase>
223223
<configuration>
224-
<classifier>lancerfuzz</classifier>
224+
<classifier>SGL</classifier>
225225
<forceCreation>true</forceCreation>
226226
<descriptorRefs>
227227
<descriptorRef>jar-with-dependencies</descriptorRef>
@@ -230,10 +230,10 @@
230230
<manifest>
231231
<addClasspath>true</addClasspath>
232232
<classpathPrefix>lib/</classpathPrefix>
233-
<mainClass>lancerfuzz.Main</mainClass>
233+
<mainClass>SGL.Main</mainClass>
234234
</manifest>
235235
</archive>
236-
<finalName>lancerfuzz</finalName>
236+
<finalName>SGL</finalName>
237237
</configuration>
238238
</execution>
239239
</executions>

scripts/run.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/bash
22
cp src/sqlancer/any/Fuzzer.java.template.txt src/sqlancer/any/Fuzzer.java && \
3-
#First build, to get the lancerfuzz jar
3+
#First build, to get the SGL jar
44
echo "Building LancerBuild" && \
55
mvn -DskipTests clean package && \
66
#Generate fuzzer java code from grammar file and configuration file
77
echo "Starting LancerBuild" && \
8-
java -jar target/lancerfuzz-jar-with-dependencies.jar -c $2 -g $1 && \
8+
java -jar target/SGL-jar-with-dependencies.jar -c $2 -g $1 && \
99
echo "Fuzzer generated" && \
1010
mv Fuzzer.java src/sqlancer/any/Fuzzer.java && \
1111
#Second build with the real Fuzzer code, to get the sqlancer jar

scripts/test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ mvn -DskipTests package
33
for file in grammars/test/*.sgl; do
44
if [ -e "$file" ]; then
55
echo "Testing $file"
6-
java -jar target/lancerfuzz-jar-with-dependencies.jar -c grammars/test.json -g $file
6+
java -jar target/SGL-jar-with-dependencies.jar -c grammars/test.json -g $file
77
mv Fuzzer.java rig/
88
cd rig
99
sed -i '/package sqlancer.any/d' Fuzzer.java

src/lancerfuzz/AST/ActionNode.java src/SGL/AST/ActionNode.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
package lancerfuzz.AST;
1+
package SGL.AST;
22

33
import java.util.List;
44

55
import org.antlr.v4.runtime.tree.TerminalNode;
66

7-
import lancerfuzz.Utils;
8-
import lancerfuzz.parser.SGLParser.ActionBlockContext;
7+
import SGL.Utils;
8+
import SGL.parser.SGLParser.ActionBlockContext;
99

1010
public class ActionNode extends Node{
1111
private String src;

src/lancerfuzz/AST/AlternationNode.java src/SGL/AST/AlternationNode.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
package lancerfuzz.AST;
1+
package SGL.AST;
22

33
import java.util.List;
44
import java.util.ArrayList;
55

6-
import lancerfuzz.Utils;
7-
import lancerfuzz.parser.SGLParser.AltListContext;
8-
import lancerfuzz.parser.SGLParser.AlternativeContext;
9-
import lancerfuzz.parser.SGLParser.LexerAltContext;
10-
import lancerfuzz.parser.SGLParser.LexerAltListContext;
6+
import SGL.Utils;
7+
import SGL.parser.SGLParser.AltListContext;
8+
import SGL.parser.SGLParser.AlternativeContext;
9+
import SGL.parser.SGLParser.LexerAltContext;
10+
import SGL.parser.SGLParser.LexerAltListContext;
1111

1212
public class AlternationNode extends Node {
1313
private List<PredicateNode> predicates;

src/lancerfuzz/AST/AlternativeNode.java src/SGL/AST/AlternativeNode.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
package lancerfuzz.AST;
1+
package SGL.AST;
22

33
import java.util.List;
44

5-
import lancerfuzz.parser.SGLParser.AlternativeContext;
6-
import lancerfuzz.parser.SGLParser.ElementContext;
7-
import lancerfuzz.parser.SGLParser.LexerAltContext;
8-
import lancerfuzz.parser.SGLParser.LexerElementContext;
5+
import SGL.parser.SGLParser.AlternativeContext;
6+
import SGL.parser.SGLParser.ElementContext;
7+
import SGL.parser.SGLParser.LexerAltContext;
8+
import SGL.parser.SGLParser.LexerElementContext;
99

1010
public class AlternativeNode extends Node{
1111
//these will be handled at the building stage

src/lancerfuzz/AST/ArgNode.java src/SGL/AST/ArgNode.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// An argument will be either an ExpressionNode or a VariableNode
2-
package lancerfuzz.AST;
2+
package SGL.AST;
33

4-
import lancerfuzz.parser.SGLParser.ArgContext;
4+
import SGL.parser.SGLParser.ArgContext;
55

66
public class ArgNode extends Node{
77
// private ExpressionNode a;

src/lancerfuzz/AST/AstUtils.java src/SGL/AST/AstUtils.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package lancerfuzz.AST;
1+
package SGL.AST;
22

33
import java.util.List;
44
import java.util.ArrayList;
55

6-
import lancerfuzz.Utils;
6+
import SGL.Utils;
77

88
public class AstUtils {
99

src/lancerfuzz/AST/CharSetNode.java src/SGL/AST/CharSetNode.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
package lancerfuzz.AST;
1+
package SGL.AST;
22

33
import java.util.List;
44
import java.util.HashMap;
55
import java.util.ArrayList;
66

7-
import lancerfuzz.Utils;
8-
import lancerfuzz.parser.SGLParser.LexerAtomContext;
7+
import SGL.Utils;
8+
import SGL.parser.SGLParser.LexerAtomContext;
99

1010
public class CharSetNode extends Node {
1111
// each of these the Lists represents the printable characters in the corresponding encoding set

src/lancerfuzz/AST/CompIdentifierNode.java src/SGL/AST/CompIdentifierNode.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package lancerfuzz.AST;
1+
package SGL.AST;
22

33
import java.util.*;
4-
import lancerfuzz.Utils;
5-
import lancerfuzz.parser.SGLParser.ArgContext;
6-
import lancerfuzz.parser.SGLParser.CompIdentifierContext;
4+
import SGL.Utils;
5+
import SGL.parser.SGLParser.ArgContext;
6+
import SGL.parser.SGLParser.CompIdentifierContext;
77

88
public class CompIdentifierNode extends Node {
99
//a[b].c.d

src/lancerfuzz/AST/Edge.java src/SGL/AST/Edge.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package lancerfuzz.AST;
1+
package SGL.AST;
22

3-
import lancerfuzz.Utils;
3+
import SGL.Utils;
44

55
// This represents a directed Edge in the AST
66
public class Edge {

src/lancerfuzz/AST/ExpressionNode.java src/SGL/AST/ExpressionNode.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
package lancerfuzz.AST;
1+
package SGL.AST;
22

33
import java.util.List;
44

5-
import lancerfuzz.parser.SGLParser.ExpressionContext;
6-
import lancerfuzz.parser.SGLParser.MexprContext;
7-
import lancerfuzz.parser.SGLParser.LexprContext;
5+
import SGL.parser.SGLParser.ExpressionContext;
6+
import SGL.parser.SGLParser.MexprContext;
7+
import SGL.parser.SGLParser.LexprContext;
88

99
public class ExpressionNode extends Node {
1010
private ExpressionNode lhs;

src/lancerfuzz/AST/GrammarGraph.java src/SGL/AST/GrammarGraph.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package lancerfuzz.AST;
1+
package SGL.AST;
22

33
import java.util.List;
44
import java.util.ArrayList;
@@ -7,10 +7,10 @@
77
import java.util.Set;
88
import java.util.regex.Pattern;
99

10-
import lancerfuzz.Options;
10+
import SGL.Options;
1111

12-
import lancerfuzz.Utils;
13-
import lancerfuzz.parser.SGLParser.*;
12+
import SGL.Utils;
13+
import SGL.parser.SGLParser.*;
1414

1515
@SuppressWarnings("unused")
1616
public class GrammarGraph{

src/lancerfuzz/AST/Node.java src/SGL/AST/Node.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
package lancerfuzz.AST;
1+
package SGL.AST;
22

33
import java.util.List;
44
import java.util.ArrayList;
55
import java.util.Collections;
66

7-
import lancerfuzz.Utils;
7+
import SGL.Utils;
88

99
@SuppressWarnings("unused")
1010
public class Node {

src/lancerfuzz/AST/PredicateNode.java src/SGL/AST/PredicateNode.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
package lancerfuzz.AST;
1+
package SGL.AST;
22

3-
import lancerfuzz.Utils;
3+
import SGL.Utils;
44

55
import java.util.List;
66

7-
import lancerfuzz.parser.SGLParser.PredicateContext;
7+
import SGL.parser.SGLParser.PredicateContext;
88

99
// Expect a child variable node with type of boolean
1010
public class PredicateNode extends Node {

src/lancerfuzz/AST/QuantifierNode.java src/SGL/AST/QuantifierNode.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
package lancerfuzz.AST;
1+
package SGL.AST;
22

33
import java.util.List;
44

5-
import lancerfuzz.Utils;
6-
import lancerfuzz.parser.SGLParser.ArgContext;
7-
import lancerfuzz.parser.SGLParser.EbnfContext;
8-
import lancerfuzz.parser.SGLParser.EbnfSuffixContext;
9-
import lancerfuzz.parser.SGLParser.LexerAltListContext;
10-
import lancerfuzz.parser.SGLParser.LexerAtomContext;
5+
import SGL.Utils;
6+
import SGL.parser.SGLParser.ArgContext;
7+
import SGL.parser.SGLParser.EbnfContext;
8+
import SGL.parser.SGLParser.EbnfSuffixContext;
9+
import SGL.parser.SGLParser.LexerAltListContext;
10+
import SGL.parser.SGLParser.LexerAtomContext;
1111

1212
//Defines how many repetition a rule should have
1313
public class QuantifierNode extends Node{

src/lancerfuzz/AST/RuleNode.java src/SGL/AST/RuleNode.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package lancerfuzz.AST;
1+
package SGL.AST;
22

33
import java.util.List;
44

5-
import lancerfuzz.Utils;
6-
import lancerfuzz.parser.SGLParser.RuleSpecContext;
5+
import SGL.Utils;
6+
import SGL.parser.SGLParser.RuleSpecContext;
77

88
public class RuleNode extends Node{
99
public static enum RuleNodeType {UNLEXER, UNPARSER};

src/lancerfuzz/AST/ScheduleNode.java src/SGL/AST/ScheduleNode.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package lancerfuzz.AST;
1+
package SGL.AST;
22

33
//this is the IR for @X notations
44
// during IR processing, all nodes with this expansion priority will be moved
@@ -9,7 +9,7 @@
99

1010
import java.util.List;
1111

12-
import lancerfuzz.parser.SGLParser.PrecedenceContext;
12+
import SGL.parser.SGLParser.PrecedenceContext;
1313

1414
public class ScheduleNode extends Node{
1515
private int priority;

src/lancerfuzz/AST/UnlexerRuleNode.java src/SGL/AST/UnlexerRuleNode.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package lancerfuzz.AST;
1+
package SGL.AST;
22

33
import java.util.List;
44

5-
import lancerfuzz.Utils;
6-
import lancerfuzz.parser.SGLParser.LexerRuleSpecContext;
5+
import SGL.Utils;
6+
import SGL.parser.SGLParser.LexerRuleSpecContext;
77

88
public class UnlexerRuleNode extends RuleNode{
99
public UnlexerRuleNode(String name){

src/lancerfuzz/AST/UnparserRuleNode.java src/SGL/AST/UnparserRuleNode.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
package lancerfuzz.AST;
1+
package SGL.AST;
22

33
import java.util.List;
44

5-
import lancerfuzz.Utils;
6-
import lancerfuzz.parser.SGLParser.ArgContext;
7-
import lancerfuzz.parser.SGLParser.ParserRuleSpecContext;
5+
import SGL.Utils;
6+
import SGL.parser.SGLParser.ArgContext;
7+
import SGL.parser.SGLParser.ParserRuleSpecContext;
88

99
import java.util.ArrayList;
1010

src/lancerfuzz/AST/VariableNode.java src/SGL/AST/VariableNode.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package lancerfuzz.AST;
1+
package SGL.AST;
22

33
import java.util.List;
44

5-
import lancerfuzz.Utils;
6-
import lancerfuzz.parser.SGLParser.VariableContext;
5+
import SGL.Utils;
6+
import SGL.parser.SGLParser.VariableContext;
77

88
public class VariableNode extends ExpressionNode{
99
private CompIdentifierNode identifierNode;
@@ -65,21 +65,21 @@ public String render(List<String> function_list, String padding, boolean print){
6565
if (this.type == 2){
6666
String res = "Variable.factory(\""+this.strLiteral+"\")";
6767
if (print){
68-
res = padding+"buf.add(" + res + ");";
68+
res = padding+"buf.add(" + res + ");\n";
6969
}
7070
return res;
7171
}
7272
if (this.type == 3){
7373
String res = "Variable.factory("+this.intLiteral+")";
7474
if (print){
75-
res = padding+"buf.add(" + res + ");";
75+
res = padding+"buf.add(" + res + ");\n";
7676
}
7777
return res;
7878
}
7979
if (this.type == 4){
8080
String res = "Variable.factory("+this.boolLiteral+ ")";
8181
if (print){
82-
res = padding+"buf.add(" + res + ");";
82+
res = padding+"buf.add(" + res + ");\n";
8383
}
8484
return res;
8585
}

src/lancerfuzz/ConfigProcessor.java src/SGL/ConfigProcessor.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package lancerfuzz;
1+
package SGL;
22

33
import java.nio.file.Files;
44
import java.nio.file.Paths;
@@ -9,7 +9,7 @@
99
import org.json.JSONException;
1010
import org.json.JSONObject;
1111

12-
import lancerfuzz.AST.GrammarGraph;
12+
import SGL.AST.GrammarGraph;
1313

1414
public class ConfigProcessor {
1515
public static JSONObject read_json_file(String file_path){

src/lancerfuzz/DBMSOption.java src/SGL/DBMSOption.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package lancerfuzz;
1+
package SGL;
22

33
public class DBMSOption {
44
private String name;

0 commit comments

Comments
 (0)