Commit 3cc887ed authored by Sergio Pérez's avatar Sergio Pérez
Browse files

Ignored GrammarConstraint before AsteriskConstraint in summary generation

parent 69a10263
Loading
Loading
Loading
Loading
+31 −23
Original line number Diff line number Diff line
@@ -42,19 +42,22 @@ public class AsteriskConstraint extends EdgeConstraint
			return super.wrap(new Constraints());
		super.check(phase, Phase.SummaryGeneration);

		if (existsPreviousAsteriskConstraint(constraints))
			return super.wrap(this.popToAsteriskConstraint(constraints));

		if (topConstraint.operation == AccessConstraint.Operation.Remove)
			return super.wrap(super.push(phase, constraints));
		super.check(topConstraint.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);
		Constraints newConstraints = new Constraints();
		return super.wrap(super.push(phase, newConstraints));

//		if (existsPreviousAsteriskConstraint(constraints))
//			return super.wrap(this.popToAsteriskConstraint(constraints));
//
//		if (topConstraint.operation == AccessConstraint.Operation.Remove)
//			return super.wrap(super.push(phase, constraints));
//		super.check(topConstraint.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, LiteralConstraint topConstraint, int productionDepth) {
@@ -62,19 +65,24 @@ public class AsteriskConstraint extends EdgeConstraint
			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));
		Constraints newConstraints = new Constraints();
		return super.wrap(super.push(phase, newConstraints));

//		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);

		// If the constraint prior to a grammar constraint is an asterisk constraint and we traverse another Asterisk
		if (isPreviousConstraintAsteriskConstraint(constraints))
			return super.wrap(this.popToAsteriskConstraint(constraints));

		return super.wrap(super.push(phase, constraints));
		Constraints newConstraints = new Constraints();
		return super.wrap(super.push(phase, newConstraints));
//		super.check(phase, Phase.SummaryGeneration);
//
//		// If the constraint prior to a grammar constraint is an asterisk constraint and we traverse another Asterisk
//		if (isPreviousConstraintAsteriskConstraint(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, SeekingConstraint topConstraint, int productionDepth)
	{