-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
further refactoring and grouped transformation test
- Loading branch information
Showing
9 changed files
with
199 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
.../src/main/java/io/github/douira/glsl_transformer/ast/transform/TriFullTransformation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package io.github.douira.glsl_transformer.ast.transform; | ||
|
||
import io.github.douira.glsl_transformer.ast.node.basic.ASTNode; | ||
import io.github.douira.glsl_transformer.ast.query.Root; | ||
import io.github.douira.glsl_transformer.job_parameter.JobParameters; | ||
|
||
@FunctionalInterface | ||
public interface TriFullTransformation<A extends ASTNode, T extends JobParameters> { | ||
void accept(A a, A b, A c, Root rootA, Root rootB, Root rootC, T jobParameters); | ||
} |
9 changes: 9 additions & 0 deletions
9
.../main/java/io/github/douira/glsl_transformer/ast/transform/TriRootOnlyTransformation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package io.github.douira.glsl_transformer.ast.transform; | ||
|
||
import io.github.douira.glsl_transformer.ast.node.basic.ASTNode; | ||
import io.github.douira.glsl_transformer.ast.query.Root; | ||
|
||
@FunctionalInterface | ||
public interface TriRootOnlyTransformation<A extends ASTNode> { | ||
void accept(A a, A b, A c, Root rootA, Root rootB, Root rootC); | ||
} |
49 changes: 49 additions & 0 deletions
49
glsl-transformer/src/main/java/io/github/douira/glsl_transformer/util/Triple.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package io.github.douira.glsl_transformer.util; | ||
|
||
public class Triple<V> { | ||
public final V a, b, c; | ||
|
||
public Triple(V a, V b, V c) { | ||
this.a = a; | ||
this.b = b; | ||
this.c = c; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
final int prime = 31; | ||
int result = 1; | ||
result = prime * result + ((a == null) ? 0 : a.hashCode()); | ||
result = prime * result + ((b == null) ? 0 : b.hashCode()); | ||
result = prime * result + ((c == null) ? 0 : c.hashCode()); | ||
return result; | ||
} | ||
|
||
@Override | ||
@SuppressWarnings("unchecked") | ||
public boolean equals(Object obj) { | ||
if (this == obj) | ||
return true; | ||
if (obj == null) | ||
return false; | ||
if (getClass() != obj.getClass()) | ||
return false; | ||
Triple<V> other = (Triple<V>) obj; | ||
if (a == null) { | ||
if (other.a != null) | ||
return false; | ||
} else if (!a.equals(other.a)) | ||
return false; | ||
if (b == null) { | ||
if (other.b != null) | ||
return false; | ||
} else if (!b.equals(other.b)) | ||
return false; | ||
if (c == null) { | ||
if (other.c != null) | ||
return false; | ||
} else if (!c.equals(other.c)) | ||
return false; | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters