Loading EDG/src/main/java/edg/constraint/AccessConstraint.java +3 −0 Original line number Diff line number Diff line Loading @@ -89,6 +89,9 @@ public abstract class AccessConstraint extends EdgeConstraint { return super.wrap(super.push(phase, constraints)); } 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, 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 @@ -40,6 +40,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, StructuralConstraint 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 +19 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,25 @@ 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, StructuralConstraint 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)); if (topConstraint.getConstraint().operation == AccessConstraint.Operation.Remove) return super.wrap(super.push(phase, constraints)); super.check(topConstraint.getConstraint().operation, AccessConstraint.Operation.Add); final Constraints newConstraints = super.pop(constraints); if (newConstraints.isEdgeConstraintsEmpty()) return super.wrap(newConstraints); 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, GrammarConstraint topConstraint, int productionDepth) { super.check(phase, Phase.SummaryGeneration); Loading EDG/src/main/java/edg/constraint/EdgeConstraint.java +4 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ public abstract class EdgeConstraint extends Constraint return this.resolve(phase, edg, edge, constraints, (ListComprehensionConstraint) topConstraint, productionDepth); else if (topConstraint instanceof AccessConstraint) 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 EmptyConstraint) return this.resolve(phase, edg, edge, constraints, (EmptyConstraint) topConstraint, productionDepth); else if (topConstraint instanceof PhaseConstraint) Loading @@ -33,6 +35,8 @@ 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 final List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, AddNodeConstraint topConstraint, int productionDepth) { throw new RuntimeException("The add node constraint should not be on the stack"); Loading EDG/src/main/java/edg/constraint/EmptyConstraint.java +4 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,10 @@ public class EmptyConstraint extends EdgeConstraint { return super.wrap(constraints); } protected List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, StructuralConstraint topConstraint, int productionDepth) { 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 Loading
EDG/src/main/java/edg/constraint/AccessConstraint.java +3 −0 Original line number Diff line number Diff line Loading @@ -89,6 +89,9 @@ public abstract class AccessConstraint extends EdgeConstraint { return super.wrap(super.push(phase, constraints)); } 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, 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 @@ -40,6 +40,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, StructuralConstraint 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 +19 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,25 @@ 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, StructuralConstraint 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)); if (topConstraint.getConstraint().operation == AccessConstraint.Operation.Remove) return super.wrap(super.push(phase, constraints)); super.check(topConstraint.getConstraint().operation, AccessConstraint.Operation.Add); final Constraints newConstraints = super.pop(constraints); if (newConstraints.isEdgeConstraintsEmpty()) return super.wrap(newConstraints); 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, GrammarConstraint topConstraint, int productionDepth) { super.check(phase, Phase.SummaryGeneration); Loading
EDG/src/main/java/edg/constraint/EdgeConstraint.java +4 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ public abstract class EdgeConstraint extends Constraint return this.resolve(phase, edg, edge, constraints, (ListComprehensionConstraint) topConstraint, productionDepth); else if (topConstraint instanceof AccessConstraint) 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 EmptyConstraint) return this.resolve(phase, edg, edge, constraints, (EmptyConstraint) topConstraint, productionDepth); else if (topConstraint instanceof PhaseConstraint) Loading @@ -33,6 +35,8 @@ 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 final List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, AddNodeConstraint topConstraint, int productionDepth) { throw new RuntimeException("The add node constraint should not be on the stack"); Loading
EDG/src/main/java/edg/constraint/EmptyConstraint.java +4 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,10 @@ public class EmptyConstraint extends EdgeConstraint { return super.wrap(constraints); } protected List<Constraints> resolve(Phase phase, EDG edg, Edge edge, Constraints constraints, StructuralConstraint topConstraint, int productionDepth) { 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