Search in sources :

Example 1 with ArithmeticExpression

use of org.eclipse.persistence.jpa.jpql.parser.ArithmeticExpression in project eclipselink by eclipse-ee4j.

the class AbstractGrammarValidator method visit.

@Override
public void visit(ArithmeticFactor expression) {
    // Missing expression after +/-
    if (!expression.hasExpression()) {
        int startPosition = position(expression) + 1;
        addProblem(expression, startPosition, ArithmeticFactor_MissingExpression);
    } else {
        Expression arithmeticExpression = expression.getExpression();
        if (!isValid(arithmeticExpression, ArithmeticPrimaryBNF.ID)) {
            int startIndex = position(expression) + 1;
            int endIndex = startIndex;
            addProblem(expression, startIndex, endIndex, ArithmeticFactor_InvalidExpression);
        } else {
            arithmeticExpression.accept(this);
        }
    }
}
Also used : ArithmeticExpression(org.eclipse.persistence.jpa.jpql.parser.ArithmeticExpression) TrimExpression(org.eclipse.persistence.jpa.jpql.parser.TrimExpression) AbsExpression(org.eclipse.persistence.jpa.jpql.parser.AbsExpression) CoalesceExpression(org.eclipse.persistence.jpa.jpql.parser.CoalesceExpression) ConcatExpression(org.eclipse.persistence.jpa.jpql.parser.ConcatExpression) SubstringExpression(org.eclipse.persistence.jpa.jpql.parser.SubstringExpression) SizeExpression(org.eclipse.persistence.jpa.jpql.parser.SizeExpression) Expression(org.eclipse.persistence.jpa.jpql.parser.Expression) SubExpression(org.eclipse.persistence.jpa.jpql.parser.SubExpression) AbstractSingleEncapsulatedExpression(org.eclipse.persistence.jpa.jpql.parser.AbstractSingleEncapsulatedExpression) AbstractDoubleEncapsulatedExpression(org.eclipse.persistence.jpa.jpql.parser.AbstractDoubleEncapsulatedExpression) AndExpression(org.eclipse.persistence.jpa.jpql.parser.AndExpression) JPQLExpression(org.eclipse.persistence.jpa.jpql.parser.JPQLExpression) IndexExpression(org.eclipse.persistence.jpa.jpql.parser.IndexExpression) StateFieldPathExpression(org.eclipse.persistence.jpa.jpql.parser.StateFieldPathExpression) UpperExpression(org.eclipse.persistence.jpa.jpql.parser.UpperExpression) ExistsExpression(org.eclipse.persistence.jpa.jpql.parser.ExistsExpression) KeyExpression(org.eclipse.persistence.jpa.jpql.parser.KeyExpression) AllOrAnyExpression(org.eclipse.persistence.jpa.jpql.parser.AllOrAnyExpression) ModExpression(org.eclipse.persistence.jpa.jpql.parser.ModExpression) LikeExpression(org.eclipse.persistence.jpa.jpql.parser.LikeExpression) CaseExpression(org.eclipse.persistence.jpa.jpql.parser.CaseExpression) LengthExpression(org.eclipse.persistence.jpa.jpql.parser.LengthExpression) MultiplicationExpression(org.eclipse.persistence.jpa.jpql.parser.MultiplicationExpression) UnknownExpression(org.eclipse.persistence.jpa.jpql.parser.UnknownExpression) NullComparisonExpression(org.eclipse.persistence.jpa.jpql.parser.NullComparisonExpression) ValueExpression(org.eclipse.persistence.jpa.jpql.parser.ValueExpression) ComparisonExpression(org.eclipse.persistence.jpa.jpql.parser.ComparisonExpression) InExpression(org.eclipse.persistence.jpa.jpql.parser.InExpression) NotExpression(org.eclipse.persistence.jpa.jpql.parser.NotExpression) BadExpression(org.eclipse.persistence.jpa.jpql.parser.BadExpression) BetweenExpression(org.eclipse.persistence.jpa.jpql.parser.BetweenExpression) AbstractEncapsulatedExpression(org.eclipse.persistence.jpa.jpql.parser.AbstractEncapsulatedExpression) CompoundExpression(org.eclipse.persistence.jpa.jpql.parser.CompoundExpression) SqrtExpression(org.eclipse.persistence.jpa.jpql.parser.SqrtExpression) FunctionExpression(org.eclipse.persistence.jpa.jpql.parser.FunctionExpression) CollectionMemberExpression(org.eclipse.persistence.jpa.jpql.parser.CollectionMemberExpression) AbstractPathExpression(org.eclipse.persistence.jpa.jpql.parser.AbstractPathExpression) NullExpression(org.eclipse.persistence.jpa.jpql.parser.NullExpression) ConstructorExpression(org.eclipse.persistence.jpa.jpql.parser.ConstructorExpression) NullIfExpression(org.eclipse.persistence.jpa.jpql.parser.NullIfExpression) CollectionValuedPathExpression(org.eclipse.persistence.jpa.jpql.parser.CollectionValuedPathExpression) LocateExpression(org.eclipse.persistence.jpa.jpql.parser.LocateExpression) AdditionExpression(org.eclipse.persistence.jpa.jpql.parser.AdditionExpression) ObjectExpression(org.eclipse.persistence.jpa.jpql.parser.ObjectExpression) LogicalExpression(org.eclipse.persistence.jpa.jpql.parser.LogicalExpression) CollectionExpression(org.eclipse.persistence.jpa.jpql.parser.CollectionExpression) LowerExpression(org.eclipse.persistence.jpa.jpql.parser.LowerExpression) OrExpression(org.eclipse.persistence.jpa.jpql.parser.OrExpression) TreatExpression(org.eclipse.persistence.jpa.jpql.parser.TreatExpression) TypeExpression(org.eclipse.persistence.jpa.jpql.parser.TypeExpression) EmptyCollectionComparisonExpression(org.eclipse.persistence.jpa.jpql.parser.EmptyCollectionComparisonExpression) SubtractionExpression(org.eclipse.persistence.jpa.jpql.parser.SubtractionExpression) AbstractTripleEncapsulatedExpression(org.eclipse.persistence.jpa.jpql.parser.AbstractTripleEncapsulatedExpression) EntryExpression(org.eclipse.persistence.jpa.jpql.parser.EntryExpression) DivisionExpression(org.eclipse.persistence.jpa.jpql.parser.DivisionExpression) KeywordExpression(org.eclipse.persistence.jpa.jpql.parser.KeywordExpression)

Aggregations

AbsExpression (org.eclipse.persistence.jpa.jpql.parser.AbsExpression)1 AbstractDoubleEncapsulatedExpression (org.eclipse.persistence.jpa.jpql.parser.AbstractDoubleEncapsulatedExpression)1 AbstractEncapsulatedExpression (org.eclipse.persistence.jpa.jpql.parser.AbstractEncapsulatedExpression)1 AbstractPathExpression (org.eclipse.persistence.jpa.jpql.parser.AbstractPathExpression)1 AbstractSingleEncapsulatedExpression (org.eclipse.persistence.jpa.jpql.parser.AbstractSingleEncapsulatedExpression)1 AbstractTripleEncapsulatedExpression (org.eclipse.persistence.jpa.jpql.parser.AbstractTripleEncapsulatedExpression)1 AdditionExpression (org.eclipse.persistence.jpa.jpql.parser.AdditionExpression)1 AllOrAnyExpression (org.eclipse.persistence.jpa.jpql.parser.AllOrAnyExpression)1 AndExpression (org.eclipse.persistence.jpa.jpql.parser.AndExpression)1 ArithmeticExpression (org.eclipse.persistence.jpa.jpql.parser.ArithmeticExpression)1 BadExpression (org.eclipse.persistence.jpa.jpql.parser.BadExpression)1 BetweenExpression (org.eclipse.persistence.jpa.jpql.parser.BetweenExpression)1 CaseExpression (org.eclipse.persistence.jpa.jpql.parser.CaseExpression)1 CoalesceExpression (org.eclipse.persistence.jpa.jpql.parser.CoalesceExpression)1 CollectionExpression (org.eclipse.persistence.jpa.jpql.parser.CollectionExpression)1 CollectionMemberExpression (org.eclipse.persistence.jpa.jpql.parser.CollectionMemberExpression)1 CollectionValuedPathExpression (org.eclipse.persistence.jpa.jpql.parser.CollectionValuedPathExpression)1 ComparisonExpression (org.eclipse.persistence.jpa.jpql.parser.ComparisonExpression)1 CompoundExpression (org.eclipse.persistence.jpa.jpql.parser.CompoundExpression)1 ConcatExpression (org.eclipse.persistence.jpa.jpql.parser.ConcatExpression)1