Loading EDG/src/main/java/edg/constraint/AccessConstraint.java +6 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,12 @@ public abstract class AccessConstraint extends EdgeConstraint { protected List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, StructuralConstraint topConstraint, int productionDepth) { return super.wrap(); } protected List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, LiteralConstraint topConstraint, int productionDepth){ if (this.operation == Operation.Add) return super.wrap(super.push(phase, constraints)); return super.wrap(); } protected List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, GrammarConstraint topConstraint, int productionDepth) { super.check(phase, Phase.SummaryGeneration); Loading EDG/src/main/java/edg/constraint/AddNodeConstraint.java +4 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,10 @@ public class AddNodeConstraint extends EdgeConstraint { constraints.nodeConstraints.add(this.nodeConstraint); return super.wrap(constraints); } protected List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, LiteralConstraint topConstraint, int productionDepth) { constraints.nodeConstraints.add(this.nodeConstraint); return super.wrap(constraints); } protected List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, GrammarConstraint topConstraint, int productionDepth) { super.check(phase, Phase.SummaryGeneration); Loading EDG/src/main/java/edg/constraint/AsteriskConstraint.java +9 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,15 @@ public class AsteriskConstraint extends EdgeConstraint final EdgeConstraint peekConstraint = newConstraints.peekEdgeConstraint(); return super.resolve(phase, edg, edge, newConstraints, peekConstraint, productionDepth); } protected List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, LiteralConstraint topConstraint, int productionDepth) { if (phase.isInstanceof(Phase.Slicing)) return super.wrap(new Constraints()); super.check(phase, Phase.SummaryGeneration); if (existsPreviousAsteriskConstraint(constraints)) return super.wrap(this.popToAsteriskConstraint(constraints)); return super.wrap(super.push(phase, constraints)); } protected List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, GrammarConstraint topConstraint, int productionDepth) { super.check(phase, Phase.SummaryGeneration); Loading EDG/src/main/java/edg/constraint/Constraints.java +2 −2 Original line number Diff line number Diff line Loading @@ -7,8 +7,8 @@ import java.util.Stack; public class Constraints { public enum Type {Node, Edge} protected final Set<NodeConstraint> nodeConstraints = new HashSet<>(); protected final Stack<EdgeConstraint> edgeConstraints = new Stack<>(); protected Set<NodeConstraint> nodeConstraints = new HashSet<>(); protected Stack<EdgeConstraint> edgeConstraints = new Stack<>(); public Set<NodeConstraint> getNodeConstraints() { Loading EDG/src/main/java/edg/constraint/EdgeConstraint.java +3 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ public abstract class EdgeConstraint extends Constraint return this.resolve(phase, edg, edge, constraints, (AccessConstraint) topConstraint, productionDepth); else if (topConstraint instanceof StructuralConstraint) return this.resolve(phase, edg, edge, constraints, (StructuralConstraint) topConstraint, productionDepth); else if (topConstraint instanceof LiteralConstraint) return this.resolve(phase, edg, edge, constraints, (LiteralConstraint) topConstraint, productionDepth); else if (topConstraint instanceof EmptyConstraint) return this.resolve(phase, edg, edge, constraints, (EmptyConstraint) topConstraint, productionDepth); else if (topConstraint instanceof PhaseConstraint) Loading @@ -36,6 +38,7 @@ public abstract class EdgeConstraint extends Constraint protected abstract List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, int productionDepth); protected abstract List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, AccessConstraint topConstraint, int productionDepth); protected abstract List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, StructuralConstraint topConstraint, int productionDepth); protected abstract List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, LiteralConstraint topConstraint, int productionDepth); protected final List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, AddNodeConstraint topConstraint, int productionDepth) { Loading Loading
EDG/src/main/java/edg/constraint/AccessConstraint.java +6 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,12 @@ public abstract class AccessConstraint extends EdgeConstraint { protected List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, StructuralConstraint topConstraint, int productionDepth) { return super.wrap(); } protected List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, LiteralConstraint topConstraint, int productionDepth){ if (this.operation == Operation.Add) return super.wrap(super.push(phase, constraints)); return super.wrap(); } protected List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, GrammarConstraint topConstraint, int productionDepth) { super.check(phase, Phase.SummaryGeneration); Loading
EDG/src/main/java/edg/constraint/AddNodeConstraint.java +4 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,10 @@ public class AddNodeConstraint extends EdgeConstraint { constraints.nodeConstraints.add(this.nodeConstraint); return super.wrap(constraints); } protected List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, LiteralConstraint topConstraint, int productionDepth) { constraints.nodeConstraints.add(this.nodeConstraint); return super.wrap(constraints); } protected List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, GrammarConstraint topConstraint, int productionDepth) { super.check(phase, Phase.SummaryGeneration); Loading
EDG/src/main/java/edg/constraint/AsteriskConstraint.java +9 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,15 @@ public class AsteriskConstraint extends EdgeConstraint final EdgeConstraint peekConstraint = newConstraints.peekEdgeConstraint(); return super.resolve(phase, edg, edge, newConstraints, peekConstraint, productionDepth); } protected List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, LiteralConstraint topConstraint, int productionDepth) { if (phase.isInstanceof(Phase.Slicing)) return super.wrap(new Constraints()); super.check(phase, Phase.SummaryGeneration); if (existsPreviousAsteriskConstraint(constraints)) return super.wrap(this.popToAsteriskConstraint(constraints)); return super.wrap(super.push(phase, constraints)); } protected List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, GrammarConstraint topConstraint, int productionDepth) { super.check(phase, Phase.SummaryGeneration); Loading
EDG/src/main/java/edg/constraint/Constraints.java +2 −2 Original line number Diff line number Diff line Loading @@ -7,8 +7,8 @@ import java.util.Stack; public class Constraints { public enum Type {Node, Edge} protected final Set<NodeConstraint> nodeConstraints = new HashSet<>(); protected final Stack<EdgeConstraint> edgeConstraints = new Stack<>(); protected Set<NodeConstraint> nodeConstraints = new HashSet<>(); protected Stack<EdgeConstraint> edgeConstraints = new Stack<>(); public Set<NodeConstraint> getNodeConstraints() { Loading
EDG/src/main/java/edg/constraint/EdgeConstraint.java +3 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ public abstract class EdgeConstraint extends Constraint return this.resolve(phase, edg, edge, constraints, (AccessConstraint) topConstraint, productionDepth); else if (topConstraint instanceof StructuralConstraint) return this.resolve(phase, edg, edge, constraints, (StructuralConstraint) topConstraint, productionDepth); else if (topConstraint instanceof LiteralConstraint) return this.resolve(phase, edg, edge, constraints, (LiteralConstraint) topConstraint, productionDepth); else if (topConstraint instanceof EmptyConstraint) return this.resolve(phase, edg, edge, constraints, (EmptyConstraint) topConstraint, productionDepth); else if (topConstraint instanceof PhaseConstraint) Loading @@ -36,6 +38,7 @@ public abstract class EdgeConstraint extends Constraint protected abstract List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, int productionDepth); protected abstract List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, AccessConstraint topConstraint, int productionDepth); protected abstract List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, StructuralConstraint topConstraint, int productionDepth); protected abstract List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, LiteralConstraint topConstraint, int productionDepth); protected final List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, AddNodeConstraint topConstraint, int productionDepth) { Loading