diff --git a/base/src/test/java/com/blazebit/expression/base/DataFetcherMetadataDefinition.java b/base/src/test/java/com/blazebit/expression/base/DataFetcherMetadataDefinition.java new file mode 100644 index 0000000..8b09949 --- /dev/null +++ b/base/src/test/java/com/blazebit/expression/base/DataFetcherMetadataDefinition.java @@ -0,0 +1,46 @@ +/* + * Copyright 2019 - 2024 Blazebit. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.blazebit.expression.base; + +import java.io.Serializable; + +import com.blazebit.domain.boot.model.MetadataDefinition; +import com.blazebit.domain.boot.model.MetadataDefinitionHolder; +import com.blazebit.expression.spi.DataFetcher; + +/** + * @author Christian Beikov + * @since 1.0.0 + */ +public class DataFetcherMetadataDefinition implements MetadataDefinition, Serializable { + + private final DataFetcher dataFetcher; + + public DataFetcherMetadataDefinition(DataFetcher dataFetcher) { + this.dataFetcher = dataFetcher; + } + + @Override + public Class getJavaType() { + return DataFetcher.class; + } + + @Override + public DataFetcher build(MetadataDefinitionHolder definitionHolder) { + return dataFetcher; + } +} diff --git a/base/src/test/java/com/blazebit/expression/base/QueryInterpreterTest.java b/base/src/test/java/com/blazebit/expression/base/QueryInterpreterTest.java new file mode 100644 index 0000000..8d55dab --- /dev/null +++ b/base/src/test/java/com/blazebit/expression/base/QueryInterpreterTest.java @@ -0,0 +1,345 @@ +package com.blazebit.expression.base; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Currency; +import java.util.List; +import java.util.Locale; + +import org.junit.Test; + +import com.blazebit.domain.Domain; +import com.blazebit.domain.boot.model.DomainBuilder; +import com.blazebit.domain.boot.model.MetadataDefinition; +import com.blazebit.domain.boot.model.MetadataDefinitionHolder; +import com.blazebit.domain.runtime.model.DomainModel; +import com.blazebit.domain.runtime.model.DomainType; +import com.blazebit.domain.runtime.model.EntityDomainTypeAttribute; +import com.blazebit.domain.runtime.model.EnumDomainType; +import com.blazebit.domain.runtime.model.EnumDomainTypeValue; +import com.blazebit.expression.ExpressionCompiler; +import com.blazebit.expression.ExpressionInterpreter; +import com.blazebit.expression.ExpressionInterpreterContext; +import com.blazebit.expression.ExpressionService; +import com.blazebit.expression.Expressions; +import com.blazebit.expression.base.function.FunctionInvokerMetadataDefinition; +import com.blazebit.expression.spi.AttributeAccessor; +import com.blazebit.expression.spi.DataFetcher; +import com.blazebit.expression.spi.TypeAdapter; + +import static org.junit.Assert.assertEquals; + +/** + * @author Christian Beikov + * @since 1.0.0 + */ +public class QueryInterpreterTest { + + private final DomainModel domainModel; + private final ExpressionService expressionService; + private final ExpressionCompiler compiler; + private final ExpressionInterpreter interpreter; + private final List users = new ArrayList<>(); + private final List persons = new ArrayList<>(); + + public class User extends Person { + String status; + Locale language; + Currency currency; + public User(Long id, String name, Boolean status, Locale language, Currency currency) { + super(id, name); + this.status = status.toString(); + this.language = language; + this.currency = currency; + } + public String getStatus() { + return status; + } + public Locale getLanguage() { + return language; + } + public Currency getCurrency() { + return currency; + } + } + public class Person { + Long id; + String name; + public Person(Long id, String name) { + this.id = id; + this.name = name; + } + public Long getId() { + return id; + } + public String getName() { + return name; + } + } + public static class PersonIdAttributeAccessor implements MetadataDefinition, AttributeAccessor { + public PersonIdAttributeAccessor() { + } + @Override + public Object getAttribute(ExpressionInterpreter.Context context, Object value, EntityDomainTypeAttribute attribute) { + return ((Person) value).getId(); + } + @Override + public Class getJavaType() { + return AttributeAccessor.class; + } + @Override + public AttributeAccessor build(MetadataDefinitionHolder definitionHolder) { + return this; + } + } + public static class PersonNameAttributeAccessor implements MetadataDefinition, AttributeAccessor { + public PersonNameAttributeAccessor() { + } + @Override + public Object getAttribute(ExpressionInterpreter.Context context, Object value, EntityDomainTypeAttribute attribute) { + return ((Person) value).getName(); + } + @Override + public Class getJavaType() { + return AttributeAccessor.class; + } + @Override + public AttributeAccessor build(MetadataDefinitionHolder definitionHolder) { + return this; + } + } + public static class UserStatusAttributeAccessor implements MetadataDefinition, AttributeAccessor { + public UserStatusAttributeAccessor() { + } + @Override + public Object getAttribute(ExpressionInterpreter.Context context, Object value, EntityDomainTypeAttribute attribute) { + return ((User) value).getStatus(); + } + @Override + public Class getJavaType() { + return AttributeAccessor.class; + } + @Override + public AttributeAccessor build(MetadataDefinitionHolder definitionHolder) { + return this; + } + } + public static class UserLanguageAttributeAccessor implements MetadataDefinition, AttributeAccessor { + public UserLanguageAttributeAccessor() { + } + @Override + public Object getAttribute(ExpressionInterpreter.Context context, Object value, EntityDomainTypeAttribute attribute) { + return ((User) value).getLanguage(); + } + @Override + public Class getJavaType() { + return AttributeAccessor.class; + } + @Override + public AttributeAccessor build(MetadataDefinitionHolder definitionHolder) { + return this; + } + } + public static class UserCurrencyAttributeAccessor implements MetadataDefinition, AttributeAccessor { + public UserCurrencyAttributeAccessor() { + } + @Override + public Object getAttribute(ExpressionInterpreter.Context context, Object value, EntityDomainTypeAttribute attribute) { + return ((User) value).getCurrency(); + } + @Override + public Class getJavaType() { + return AttributeAccessor.class; + } + @Override + public AttributeAccessor build(MetadataDefinitionHolder definitionHolder) { + return this; + } + } + private static class BooleanTypeAdapter implements TypeAdapter { + public static final BooleanTypeAdapter INSTANCE = new BooleanTypeAdapter(); + + @Override + public Boolean toInternalType(ExpressionInterpreter.Context context, String value, DomainType domainType) { + return value == null || value.isEmpty() ? null : Boolean.valueOf(value); + } + + @Override + public String toModelType(ExpressionInterpreter.Context context, Boolean value, DomainType domainType) { + return value == null ? null : value.toString(); + } + } + private static class TypeAdapterMetadataDefinition implements MetadataDefinition> { + private final TypeAdapter typeAdapter; + + public TypeAdapterMetadataDefinition(TypeAdapter typeAdapter) { + this.typeAdapter = typeAdapter; + } + + @Override + public Class> getJavaType() { + return (Class>) (Class) TypeAdapter.class; + } + + @Override + public TypeAdapter build(MetadataDefinitionHolder definitionHolder) { + return typeAdapter; + } + } + + public QueryInterpreterTest() { + MetadataDefinition[] idAttributeMetadata = new MetadataDefinition[1]; + idAttributeMetadata[0] = new PersonIdAttributeAccessor(); + MetadataDefinition[] nameAttributeMetadata = new MetadataDefinition[1]; + nameAttributeMetadata[0] = new PersonNameAttributeAccessor(); + MetadataDefinition[] languageAttributeMetadata = new MetadataDefinition[1]; + languageAttributeMetadata[0] = new UserLanguageAttributeAccessor(); + MetadataDefinition[] currencyAttributeMetadata = new MetadataDefinition[2]; + currencyAttributeMetadata[0] = new UserCurrencyAttributeAccessor(); + currencyAttributeMetadata[1] = new TypeAdapterMetadataDefinition(new TypeAdapter() { + @Override + public EnumDomainTypeValue toInternalType(ExpressionInterpreter.Context context, Currency value, DomainType domainType) { + return ((EnumDomainType) domainType).getEnumValues().get(value.getCurrencyCode()); + } + + @Override + public Currency toModelType(ExpressionInterpreter.Context context, EnumDomainTypeValue value, DomainType domainType) { + return Currency.getInstance(value.getValue()); + } + }); + + MetadataDefinition[] statusAttributeMetadata = new MetadataDefinition[2]; + statusAttributeMetadata[0] = new UserStatusAttributeAccessor(); + statusAttributeMetadata[1] = new TypeAdapterMetadataDefinition( BooleanTypeAdapter.INSTANCE); + + DomainBuilder domainBuilder = Domain.getDefaultProvider().createEmptyBuilder(); + domainBuilder.withDefaults(); + domainBuilder.createBasicType("Language"); + domainBuilder.createEnumType("Currency") + .withValue("EUR") + .withValue("USD") + .build(); + StringlyTypeUtils.registerStringlyType(domainBuilder, "Language", Locale::new); + StringlyTypeUtils.registerStringlyType(domainBuilder, "Currency", Currency::getInstance); + domainBuilder.createFunction("is_true") + .withMetadata(new FunctionInvokerMetadataDefinition((context, function, arguments) -> arguments.getValue(0))) + .withArgument("value", BaseContributor.BOOLEAN_TYPE_NAME) + .withResultType(BaseContributor.BOOLEAN_TYPE_NAME) + .build(); + domainBuilder.createEntityType("person") + .withMetadata( new DataFetcherMetadataDefinition( new DataFetcher() { + @Override + public List fetch(ExpressionInterpreter.Context context) { + return persons; + } + } ) ) + .addAttribute( "id", BaseContributor.NUMERIC_TYPE_NAME, idAttributeMetadata ) + .addAttribute( "name", BaseContributor.STRING_TYPE_NAME, nameAttributeMetadata ) + .build(); + domainBuilder.createEntityType("user") + .withMetadata( new DataFetcherMetadataDefinition( new DataFetcher() { + @Override + public List fetch(ExpressionInterpreter.Context context) { + return users; + } + } ) ) + .addAttribute( "id", BaseContributor.NUMERIC_TYPE_NAME, idAttributeMetadata ) + .addAttribute( "name", BaseContributor.STRING_TYPE_NAME, nameAttributeMetadata ) + .addAttribute("status", BaseContributor.BOOLEAN_TYPE_NAME, statusAttributeMetadata) + .addAttribute("language", "Language", languageAttributeMetadata) + .addAttribute("currency", "Currency", currencyAttributeMetadata) + .build(); + this.domainModel = domainBuilder.build(); + this.expressionService = Expressions.forModel(domainModel); + this.compiler = expressionService.createCompiler(); + this.interpreter = expressionService.createInterpreter(); + this.users.add(new User(1L, "Max", true, new Locale("de"), Currency.getInstance("EUR"))); + this.users.add(new User(2L, "John", false, new Locale("en"), Currency.getInstance("USD"))); + this.users.add(new User(3L, "Pierre", false, new Locale("fr"), Currency.getInstance("EUR"))); + this.persons.add( new Person( 1L, "Max" ) ); + this.persons.add( new Person( 2L, "Tony" ) ); + } + + private ExpressionInterpreter.Context createInterpreterContext() { + ExpressionInterpreterContext context = ExpressionInterpreterContext.create(expressionService); + return context; + } + private List testQuery(String query) { + return interpreter.evaluate( + compiler.createQuery(query, compiler.createContext( Collections.emptyMap() )), + createInterpreterContext()); + } + + @Test + public void testFilter() { + List userList = testQuery("from user u where u.language = 'de'"); + assertEquals(1, userList.size()); + } + + @Test + public void testFilterEmpty() { + List userList = testQuery("from user u where u.language is null"); + assertEquals(0, userList.size()); + } + + @Test + public void testProjection() { + List userList = testQuery("select u.currency from user u"); + assertEquals(3, userList.size()); + } + + @Test + public void testDistinct() { + List userList = testQuery("select distinct u.currency from user u"); + assertEquals(2, userList.size()); + } + + @Test + public void testJoin() { + List userList = testQuery("select u.language, u2.language from user u join user u2 on u.currency = u2.currency and u.id != u2.id"); + assertEquals(2, userList.size()); + } + + @Test + public void testLeftJoin() { + List userList = testQuery("select u, p from user u left join person p on u.name = p.name"); + assertEquals(3, userList.size()); + } + + @Test + public void testRightJoin() { + List userList = testQuery("select u, p from user u right join person p on u.name = p.name"); + assertEquals(2, userList.size()); + } + + @Test + public void testFullJoin() { + List userList = testQuery("select u, p from user u full join person p on u.name = p.name"); + assertEquals(4, userList.size()); + } + + @Test + public void testJoinReverse() { + List userList = testQuery("select u, p from person p join user u on p.name = u.name"); + assertEquals(1, userList.size()); + } + + @Test + public void testLeftJoinReverse() { + List userList = testQuery("select u, p from person p left join user u on p.name = u.name"); + assertEquals(2, userList.size()); + } + + @Test + public void testRightJoinReverse() { + List userList = testQuery("select u, p from person p right join user u on p.name = u.name"); + assertEquals(3, userList.size()); + } + + @Test + public void testFullJoinReverse() { + List userList = testQuery("select u, p from person p full join user u on p.name = u.name"); + assertEquals(4, userList.size()); + } + +} diff --git a/core/api/src/main/java/com/blazebit/expression/DataFetcherData.java b/core/api/src/main/java/com/blazebit/expression/DataFetcherData.java new file mode 100644 index 0000000..2e7e8ec --- /dev/null +++ b/core/api/src/main/java/com/blazebit/expression/DataFetcherData.java @@ -0,0 +1,47 @@ +/* + * Copyright 2019 - 2024 Blazebit. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.blazebit.expression; + +import java.util.List; + +/** + * Provides access to data that {@link com.blazebit.expression.spi.DataFetcher} acquired during interpretation. + * + * @author Christian Beikov + * @since 1.0.0 + */ +public interface DataFetcherData { + + /** + * Returns the data that was read by a {@link com.blazebit.expression.spi.DataFetcher}, + * for a domain type with the given name. + * + * @param domainTypeName The domain type name for which to get data + * @return the data that was read by a data fetcher + */ + List getDataForDomainType(String domainTypeName); + + /** + * Sets the data that the {@link com.blazebit.expression.spi.DataFetcher} read for a domain type with the given name. + * + * @param domainTypeName The domain type name for which to set data + * @param data The new data to set + * @return The old data that was set + */ + List setDataForDomainType(String domainTypeName, List data); + +} diff --git a/core/api/src/main/java/com/blazebit/expression/Expression.java b/core/api/src/main/java/com/blazebit/expression/Expression.java index 89c2756..ded95b1 100644 --- a/core/api/src/main/java/com/blazebit/expression/Expression.java +++ b/core/api/src/main/java/com/blazebit/expression/Expression.java @@ -140,6 +140,27 @@ interface Visitor { * @param e The expression to visit */ void visit(CollectionLiteral e); + + /** + * Visits the given query. + * + * @param e The query to visit + */ + void visit(Query e); + + /** + * Visits the given expression. + * + * @param e The expression to visit + */ + void visit(FromItem e); + + /** + * Visits the given expression. + * + * @param e The expression to visit + */ + void visit(Join e); } /** @@ -269,6 +290,30 @@ interface ResultVisitor { * @return the result */ T visit(CollectionLiteral e); + + /** + * Visits the given expression and returns a result. + * + * @param e The expression to visit + * @return the result + */ + T visit(Query e); + + /** + * Visits the given expression and returns a result. + * + * @param e The expression to visit + * @return the result + */ + T visit(FromItem e); + + /** + * Visits the given expression and returns a result. + * + * @param e The expression to visit + * @return the result + */ + T visit(Join e); } /** diff --git a/core/api/src/main/java/com/blazebit/expression/ExpressionCompiler.java b/core/api/src/main/java/com/blazebit/expression/ExpressionCompiler.java index 6f29365..97f2293 100644 --- a/core/api/src/main/java/com/blazebit/expression/ExpressionCompiler.java +++ b/core/api/src/main/java/com/blazebit/expression/ExpressionCompiler.java @@ -122,6 +122,15 @@ public default Expression createTemplateExpression(String templateString) { */ public Expression createTemplateExpression(String templateString, Context compileContext); + /** + * Creates and compiles the given query string with the given compile context. + * + * @param queryString The query expression string to compile + * @param compileContext The compile context to use + * @return The compiled query + */ + public Query createQuery(String queryString, Context compileContext); + /** * A compiler context that returns the domain type for available root variables. * diff --git a/core/api/src/main/java/com/blazebit/expression/ExpressionInterpreter.java b/core/api/src/main/java/com/blazebit/expression/ExpressionInterpreter.java index c38a865..93941bd 100644 --- a/core/api/src/main/java/com/blazebit/expression/ExpressionInterpreter.java +++ b/core/api/src/main/java/com/blazebit/expression/ExpressionInterpreter.java @@ -149,5 +149,12 @@ public interface Context { */ public X getRoot(String alias); + /** + * Returns the data fetcher data object. + * + * @return the data fetcher data object + */ + public DataFetcherData getDataFetcherData(); + } } diff --git a/core/api/src/main/java/com/blazebit/expression/ExpressionInterpreterContext.java b/core/api/src/main/java/com/blazebit/expression/ExpressionInterpreterContext.java index 8496d83..87d171a 100644 --- a/core/api/src/main/java/com/blazebit/expression/ExpressionInterpreterContext.java +++ b/core/api/src/main/java/com/blazebit/expression/ExpressionInterpreterContext.java @@ -17,6 +17,7 @@ package com.blazebit.expression; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.function.Function; @@ -34,6 +35,7 @@ public class ExpressionInterpreterContext implements ExpressionInterpreter.Co private final Map properties; private final Map roots; private final Map> rootProviders; + private final SimpleDataFetcherData dataFetcherData; private ExpressionInterpreterContext(ExpressionService expressionService) { this.expressionService = expressionService; @@ -41,6 +43,7 @@ private ExpressionInterpreterContext(ExpressionService expressionService) { this.properties = new HashMap<>(); this.roots = new HashMap<>(); this.rootProviders = new HashMap<>(); + this.dataFetcherData = new SimpleDataFetcherData(); } /** @@ -55,6 +58,7 @@ public ExpressionInterpreterContext(ExpressionService expressionService, T rootP this.properties = new HashMap<>(); this.roots = new HashMap<>(); this.rootProviders = new HashMap<>(); + this.dataFetcherData = new SimpleDataFetcherData(); } /** @@ -140,4 +144,22 @@ public X getRoot(String alias) { return (X) result; } + @Override + public DataFetcherData getDataFetcherData() { + return dataFetcherData; + } + + private static class SimpleDataFetcherData extends HashMap> implements DataFetcherData { + + @Override + public List getDataForDomainType(String domainTypeName) { + return get( domainTypeName ); + } + + @Override + public List setDataForDomainType(String domainTypeName, List data) { + return put( domainTypeName, data ); + } + } + } diff --git a/core/api/src/main/java/com/blazebit/expression/FromItem.java b/core/api/src/main/java/com/blazebit/expression/FromItem.java new file mode 100644 index 0000000..c370ede --- /dev/null +++ b/core/api/src/main/java/com/blazebit/expression/FromItem.java @@ -0,0 +1,62 @@ +/* + * Copyright 2019 - 2024 Blazebit. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.blazebit.expression; + +import java.util.List; + +import com.blazebit.domain.runtime.model.DomainType; + +/** + * A from item to represent a data source. + * + * @author Christian Beikov + * @since 1.0.0 + */ +public final class FromItem extends FromNode { + private final List joins; + + /** + * Creates a new from item. + * + * @param type The domain type + * @param alias The alias + * @param joins The joins + */ + public FromItem(DomainType type, String alias, List joins) { + super( type, alias ); + this.joins = joins; + } + + /** + * Returns the joins of this from item. + * + * @return the joins of this from item + */ + public List getJoins() { + return joins; + } + + @Override + public void accept(Visitor visitor) { + visitor.visit( this ); + } + + @Override + public T accept(ResultVisitor visitor) { + return visitor.visit( this ); + } +} diff --git a/core/api/src/main/java/com/blazebit/expression/FromNode.java b/core/api/src/main/java/com/blazebit/expression/FromNode.java new file mode 100644 index 0000000..e72004d --- /dev/null +++ b/core/api/src/main/java/com/blazebit/expression/FromNode.java @@ -0,0 +1,50 @@ +/* + * Copyright 2019 - 2024 Blazebit. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.blazebit.expression; + +import com.blazebit.domain.runtime.model.DomainType; + +/** + * A from node to represent a data source. + * + * @author Christian Beikov + * @since 1.0.0 + */ +public abstract class FromNode extends AbstractExpression { + private final String alias; + + /** + * Creates a new from node. + * + * @param type The domain type + * @param alias The alias + */ + public FromNode(DomainType type, String alias) { + super( type ); + this.alias = alias; + } + + /** + * Returns the alias of this from item. + * + * @return the alias of this from item + */ + public String getAlias() { + return alias; + } + +} diff --git a/core/api/src/main/java/com/blazebit/expression/Join.java b/core/api/src/main/java/com/blazebit/expression/Join.java new file mode 100644 index 0000000..c747468 --- /dev/null +++ b/core/api/src/main/java/com/blazebit/expression/Join.java @@ -0,0 +1,73 @@ +/* + * Copyright 2019 - 2024 Blazebit. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.blazebit.expression; + +import com.blazebit.domain.runtime.model.DomainType; + +/** + * A join between data sources. + * + * @author Christian Beikov + * @since 1.0.0 + */ +public final class Join extends FromNode { + + private final JoinType joinType; + private final Predicate joinPredicate; + + /** + * Creates a new join. + * + * @param type The domain type + * @param alias The alias + * @param joinType The join type + * @param joinPredicate The join predicate + */ + public Join(DomainType type, String alias, JoinType joinType, Predicate joinPredicate) { + super( type, alias ); + this.joinType = joinType; + this.joinPredicate = joinPredicate; + } + + /** + * Returns the join type of this join. + * + * @return the join type of this join + */ + public JoinType getJoinType() { + return joinType; + } + + /** + * Returns the join predicate of this join. + * + * @return the join predicate of this join + */ + public Predicate getJoinPredicate() { + return joinPredicate; + } + + @Override + public void accept(Visitor visitor) { + visitor.visit( this ); + } + + @Override + public T accept(ResultVisitor visitor) { + return visitor.visit( this ); + } +} diff --git a/core/api/src/main/java/com/blazebit/expression/JoinType.java b/core/api/src/main/java/com/blazebit/expression/JoinType.java new file mode 100644 index 0000000..e40a562 --- /dev/null +++ b/core/api/src/main/java/com/blazebit/expression/JoinType.java @@ -0,0 +1,30 @@ +/* + * Copyright 2019 - 2024 Blazebit. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.blazebit.expression; + +/** + * The join type. + * + * @author Christian Beikov + * @since 1.0.0 + */ +public enum JoinType { + INNER, + LEFT, + RIGHT, + FULL; +} diff --git a/core/api/src/main/java/com/blazebit/expression/Query.java b/core/api/src/main/java/com/blazebit/expression/Query.java new file mode 100644 index 0000000..0bcbe2b --- /dev/null +++ b/core/api/src/main/java/com/blazebit/expression/Query.java @@ -0,0 +1,103 @@ +/* + * Copyright 2019 - 2024 Blazebit. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.blazebit.expression; + +import java.util.List; + +import com.blazebit.domain.runtime.model.DomainType; + +/** + * A query to filter and select data from sources. + * + * @author Christian Beikov + * @since 1.0.0 + */ +public final class Query extends AbstractExpression { + + private final List selectItems; + private final boolean distinct; + private final List fromItems; + private final Predicate wherePredicate; + + /** + * Creates a new query. + * + * @param type The query result domain type + * @param selectItems The select items + * @param distinct Whether the query should produce distinct results + * @param fromItems The from items + * @param wherePredicate The where predicate + */ + public Query( + DomainType type, + List selectItems, + boolean distinct, + List fromItems, + Predicate wherePredicate) { + super( type ); + this.selectItems = selectItems; + this.distinct = distinct; + this.fromItems = fromItems; + this.wherePredicate = wherePredicate; + } + + /** + * Returns the select items of this query. + * + * @return the select items of this query + */ + public List getSelectItems() { + return selectItems; + } + + /** + * Returns whether this query should produce distinct results. + * + * @return whether this query should produce distinct results + */ + public boolean isDistinct() { + return distinct; + } + + /** + * Returns the from items of this query. + * + * @return the from items of this query + */ + public List getFromItems() { + return fromItems; + } + + /** + * Returns the where predicate of this query, or {@code null} if it doesn't have a predicate. + * + * @return the where predicate of this query + */ + public Predicate getWherePredicate() { + return wherePredicate; + } + + @Override + public void accept(Visitor visitor) { + visitor.visit( this ); + } + + @Override + public T accept(ResultVisitor visitor) { + return visitor.visit( this ); + } +} diff --git a/core/api/src/main/java/com/blazebit/expression/VisitorAdapter.java b/core/api/src/main/java/com/blazebit/expression/VisitorAdapter.java index 0016ef3..4b889a5 100644 --- a/core/api/src/main/java/com/blazebit/expression/VisitorAdapter.java +++ b/core/api/src/main/java/com/blazebit/expression/VisitorAdapter.java @@ -113,4 +113,30 @@ public void visit(EntityLiteral e) { public void visit(CollectionLiteral e) { } + + @Override + public void visit(Query e) { + for ( FromItem fromItem : e.getFromItems() ) { + fromItem.accept( this ); + } + Predicate wherePredicate = e.getWherePredicate(); + if ( wherePredicate != null ) { + wherePredicate.accept( this ); + } + for ( Expression selectItem : e.getSelectItems() ) { + selectItem.accept( this ); + } + } + + @Override + public void visit(FromItem e) { + for ( Join join : e.getJoins() ) { + join.accept( this ); + } + } + + @Override + public void visit(Join e) { + e.getJoinPredicate().accept( this ); + } } diff --git a/core/api/src/main/java/com/blazebit/expression/spi/DataFetcher.java b/core/api/src/main/java/com/blazebit/expression/spi/DataFetcher.java new file mode 100644 index 0000000..66798ae --- /dev/null +++ b/core/api/src/main/java/com/blazebit/expression/spi/DataFetcher.java @@ -0,0 +1,38 @@ +/* + * Copyright 2019 - 2024 Blazebit. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.blazebit.expression.spi; + +import java.util.List; + +import com.blazebit.expression.ExpressionInterpreter; + +/** + * A fetcher for data of domain objects. + * + * @author Christian Beikov + * @since 1.0.0 + */ +public interface DataFetcher { + + /** + * Fetches and returns the data for the given interpreter context. + * + * @param context The expression interpreter context + * @return the fetched data + */ + public List fetch(ExpressionInterpreter.Context context); +} diff --git a/core/impl/src/main/antlr4/com/blazebit/expression/impl/PredicateLexer.g4 b/core/impl/src/main/antlr4/com/blazebit/expression/impl/PredicateLexer.g4 index 181ab01..1ff8071 100644 --- a/core/impl/src/main/antlr4/com/blazebit/expression/impl/PredicateLexer.g4 +++ b/core/impl/src/main/antlr4/com/blazebit/expression/impl/PredicateLexer.g4 @@ -49,21 +49,30 @@ AND : [aA] [nN] [dD]; BETWEEN : [bB] [eE] [tT] [wW] [eE] [eE] [nN]; DATE : [dD] [aA] [tT] [eE]; DAYS : [dD] [aA] [yY] [sS]; +DISTINCT : [dD] [iI] [sS] [tT] [iI] [nN] [cC] [tT]; EMPTY : [eE] [mM] [pP] [tT] [yY]; FALSE : [fF] [aA] [lL] [sS] [eE]; +FROM : [fF] [rR] [oO] [mM]; +FULL : [fF] [uU] [lL] [lL]; HOURS : [hH] [oO] [uU] [rR] [sS]; IN : [iI] [nN]; INTERVAL : [iI] [nN] [tT] [eE] [rR] [vV] [aA] [lL]; IS : [iI] [sS]; +JOIN : [jJ] [oO] [iI] [nN]; +LEFT : [lL] [eE] [fF] [tT]; MINUTES : [mM] [iI] [nN] [uU] [tT] [eE] [sS]; MONTHS : [mM] [oO] [nN] [tT] [hH] [sS]; NOT : [nN] [oO] [tT]; NULL : [nN] [uU] [lL] [lL]; +ON : [oO] [nN]; OR : [oO] [rR]; +RIGHT : [rR] [iI] [gG] [hH] [tT]; SECONDS : [sS] [eE] [cC] [oO] [nN] [dD] [sS]; +SELECT : [sS] [eE] [lL] [eE] [cC] [tT]; TIME : [tT] [iI] [mM] [eE]; TIMESTAMP : [tT] [iI] [mM] [eE] [sS] [tT] [aA] [mM] [pP]; TRUE : [tT] [rR] [uU] [eE]; +WHERE : [wW] [hH] [eE] [rR] [eE]; YEARS : [yY] [eE] [aA] [rR] [sS]; LESS : '<'; diff --git a/core/impl/src/main/antlr4/com/blazebit/expression/impl/PredicateParser.g4 b/core/impl/src/main/antlr4/com/blazebit/expression/impl/PredicateParser.g4 index 518fc21..2bd4d4c 100644 --- a/core/impl/src/main/antlr4/com/blazebit/expression/impl/PredicateParser.g4 +++ b/core/impl/src/main/antlr4/com/blazebit/expression/impl/PredicateParser.g4 @@ -30,6 +30,9 @@ parseExpressionOrPredicate parseTemplate : template? EOF; +parseQuery + : query EOF; + template : (TEXT | (EXPRESSION_START expression EXPRESSION_END))+ ; @@ -69,6 +72,46 @@ predicateOrExpression | predicate ; +query + : selectClause? fromClause whereClause? + ; + +selectClause + : SELECT DISTINCT? expression (COMMA expression)* + ; + +fromClause + : FROM fromItem (COMMA fromItem)* + ; + +whereClause + : WHERE predicate + ; + +fromItem + : fromRoot join* + ; + +fromRoot + : domainTypeName variable + ; + +join + : (LEFT|RIGHT|FULL)? JOIN joinTarget ON predicate + ; + +joinTarget + : domainTypeName variable + ; + +domainTypeName + : identifier + ; + +variable + : AS? identifier + ; + inList : LP expression (COMMA expression)* RP | expression @@ -153,15 +196,24 @@ identifier | BETWEEN | DATE | DAYS + | DISTINCT + | FROM + | FULL | HOURS | IN | IS + | JOIN + | LEFT | MINUTES | MONTHS | NOT + | ON | OR + | RIGHT | SECONDS + | SELECT | TIME | TIMESTAMP + | WHERE | YEARS ; \ No newline at end of file diff --git a/core/impl/src/main/java/com/blazebit/expression/impl/ExpressionCompilerImpl.java b/core/impl/src/main/java/com/blazebit/expression/impl/ExpressionCompilerImpl.java index ce490fc..e507b8f 100644 --- a/core/impl/src/main/java/com/blazebit/expression/impl/ExpressionCompilerImpl.java +++ b/core/impl/src/main/java/com/blazebit/expression/impl/ExpressionCompilerImpl.java @@ -22,6 +22,7 @@ import com.blazebit.expression.ExpressionService; import com.blazebit.expression.ImplicitRootProvider; import com.blazebit.expression.Predicate; +import com.blazebit.expression.Query; import com.blazebit.expression.SyntaxErrorException; import org.antlr.v4.runtime.ANTLRErrorListener; import org.antlr.v4.runtime.CharStreams; @@ -70,6 +71,12 @@ public ParserRuleContext invokeRule(PredicateParser parser) { return parser.parseTemplate(); } }; + protected static final RuleInvoker QUERY_RULE_INVOKER = new RuleInvoker() { + @Override + public ParserRuleContext invokeRule(PredicateParser parser) { + return parser.parseQuery(); + } + }; protected final ExpressionService expressionService; protected final LiteralFactory literalFactory; @@ -133,6 +140,11 @@ public Expression createTemplateExpression(String templateString, Context compil return parse(templateString, true, TEMPLATE_RULE_INVOKER, compileContext); } + @Override + public Query createQuery(String queryString, Context compileContext) { + return parse(queryString, false, QUERY_RULE_INVOKER, compileContext); + } + @SuppressWarnings("unchecked") protected T parse(String input, boolean templateMode, RuleInvoker ruleInvoker, Context compileContext) { if (compileContext.getExpressionService() != expressionService) { diff --git a/core/impl/src/main/java/com/blazebit/expression/impl/ExpressionInterpreterImpl.java b/core/impl/src/main/java/com/blazebit/expression/impl/ExpressionInterpreterImpl.java index 52a8136..1a93790 100644 --- a/core/impl/src/main/java/com/blazebit/expression/impl/ExpressionInterpreterImpl.java +++ b/core/impl/src/main/java/com/blazebit/expression/impl/ExpressionInterpreterImpl.java @@ -29,6 +29,7 @@ import com.blazebit.expression.ComparisonOperator; import com.blazebit.expression.ComparisonPredicate; import com.blazebit.expression.CompoundPredicate; +import com.blazebit.expression.DataFetcherData; import com.blazebit.expression.DomainModelException; import com.blazebit.expression.EntityLiteral; import com.blazebit.expression.EnumLiteral; @@ -37,15 +38,21 @@ import com.blazebit.expression.ExpressionInterpreterContext; import com.blazebit.expression.ExpressionPredicate; import com.blazebit.expression.ExpressionService; +import com.blazebit.expression.FromItem; +import com.blazebit.expression.FromNode; import com.blazebit.expression.FunctionInvocation; import com.blazebit.expression.InPredicate; import com.blazebit.expression.IsEmptyPredicate; import com.blazebit.expression.IsNullPredicate; +import com.blazebit.expression.Join; +import com.blazebit.expression.JoinType; import com.blazebit.expression.Literal; import com.blazebit.expression.Path; import com.blazebit.expression.Predicate; +import com.blazebit.expression.Query; import com.blazebit.expression.spi.AttributeAccessor; import com.blazebit.expression.spi.ComparisonOperatorInterpreter; +import com.blazebit.expression.spi.DataFetcher; import com.blazebit.expression.spi.DomainFunctionArguments; import com.blazebit.expression.spi.DomainOperatorInterpreter; import com.blazebit.expression.spi.FunctionInvoker; @@ -53,10 +60,15 @@ import com.blazebit.expression.spi.TypeConverter; import java.util.ArrayList; +import java.util.Arrays; +import java.util.BitSet; import java.util.Collection; import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; /** * @author Christian Beikov @@ -67,6 +79,7 @@ public class ExpressionInterpreterImpl implements Expression.ResultVisitor dataMap; public ExpressionInterpreterImpl(ExpressionService expressionService) { this.expressionService = expressionService; @@ -341,7 +354,7 @@ public Object visit(IsEmptyPredicate e) { public Object visit(Path e) { Object value; if (e.getBase() == null) { - value = context.getRoot(e.getAlias()); + value = resolveRoot(e.getAlias()); } else { value = e.getBase().accept(this); } @@ -443,6 +456,438 @@ public Object visit(CollectionLiteral e) { return visit((Literal) e); } + protected Object resolveRoot(String alias) { + if (dataMap != null) { + Object object = dataMap.get( alias ); + if (object != null) { + return object; + } + } + return context.getRoot(alias); + } + + @Override + public List visit(Query e) { + List fromItems = e.getFromItems(); + if (fromItems.size() == 1 && fromItems.get( 0 ).getJoins().isEmpty()) { + return visitSimpleQuery(e); + } + return visitJoinQuery( e ); + } + + private List visitSimpleQuery(Query e) { + FromItem fromItem = e.getFromItems().get( 0 ); + List data = getData( fromItem ); + List result = new ArrayList<>(); + dataMap = new HashMap<>( 1 ); + dataMap.put( fromItem.getAlias(), null ); + Map.Entry entry = dataMap.entrySet().iterator().next(); + Predicate predicate = e.getWherePredicate(); + Set uniqueResults = e.isDistinct() ? new HashSet<>() : null; + for ( Object object : data ) { + entry.setValue( object ); + Object predicateResult = predicate == null ? Boolean.TRUE : predicate.accept( this ); + if (predicateResult == Boolean.TRUE) { + Object selectResult = visitSelectItems( e ); + if ( uniqueResults == null || uniqueResults.add( selectResult ) ) { + result.add( selectResult ); + } + } + } + return result; + } + + private Object visitSelectItems(Query e) { + List selectItems = e.getSelectItems(); + if (selectItems.size() == 1) { + return selectItems.get( 0 ).accept( this ); + } + Object[] array = new Object[selectItems.size()]; + for ( int i = 0; i < selectItems.size(); i++ ) { + array[i] = selectItems.get( i ).accept( this ); + } + return array; + } + + private List visitJoinQuery(Query e) { + FromNode[] fromNodes = tupleNodes( e.getFromItems() ); + + Map.Entry[] entries = new Map.Entry[fromNodes.length]; + dataMap = new HashMap<>(fromNodes.length); + for ( int i = 0; i < fromNodes.length; i++ ) { + dataMap.put( fromNodes[i].getAlias(), i ); + } + for ( Map.Entry entry : dataMap.entrySet() ) { + entries[(int) entry.getValue()] = entry; + } + + TupleList tuples = joinTuples( fromNodes, entries ); + + List result = new ArrayList<>(); + Predicate predicate = e.getWherePredicate(); + Set uniqueResults = e.isDistinct() ? new HashSet<>() : null; + for ( Object[] tuple : tuples ) { + initDataMap( entries, tuple ); + Object predicateResult = predicate == null ? Boolean.TRUE : predicate.accept( this ); + if (predicateResult == Boolean.TRUE) { + Object selectResult = visitSelectItems( e ); + if ( uniqueResults == null || uniqueResults.add( selectResult ) ) { + result.add( selectResult ); + } + } + } + return result; + } + + private TupleList joinTuples(FromNode[] fromNodes, Map.Entry[] entries) { + TupleList tuples = null; + for ( int fromNodeIndex = 0; fromNodeIndex < fromNodes.length; fromNodeIndex++ ) { + List data = getData( fromNodes[fromNodeIndex] ); + if ( tuples == null ) { + tuples = new TupleList( data.size() ); + for ( Object object : data ) { + Object[] tuple = new Object[fromNodes.length]; + tuple[fromNodeIndex] = object; + tuples.add( tuple ); + } + } else { + if ( fromNodes[fromNodeIndex] instanceof Join) { + Join join = (Join) fromNodes[fromNodeIndex]; + Path[] eqHashJoinPaths; + if ( data.isEmpty() ) { + if ( join.getJoinType() == JoinType.INNER || join.getJoinType() == JoinType.RIGHT ) { + // empty data on RHS produces empty tuples + tuples.clear(); + } + } else if ( (eqHashJoinPaths = determineEqHashJoinPaths( join ) ) != null ) { + tuples = hashJoin( entries, data, fromNodeIndex, tuples, join, eqHashJoinPaths ); + } else { + tuples = nestedLoopJoin( entries, data, fromNodeIndex, tuples, join ); + } + } else if (data.isEmpty()) { + // Cross join with empty data on the RHS + tuples.clear(); + } else { + // Cross join + int lhsTuples = tuples.size(); + tuples.ensureCapacity( tuples.size() * data.size() ); + for ( int i = 0; i < lhsTuples; i++ ) { + tuples.get( i )[fromNodeIndex] = data.get( 0 ); + } + for ( int i = 1; i < data.size(); i++ ) { + for ( int j = 0; j < lhsTuples; j++ ) { + Object[] newTuple = tuples.get( j ).clone(); + newTuple[fromNodeIndex] = data.get( i ); + tuples.add( newTuple ); + } + } + } + } + } + return tuples; + } + + private Path[] determineEqHashJoinPaths(Join join) { + Predicate joinPredicate = join.getJoinPredicate(); + if (!joinPredicate.isNegated() && joinPredicate instanceof ComparisonPredicate) { + ComparisonPredicate comparisonPredicate = (ComparisonPredicate) joinPredicate; + if (comparisonPredicate.getOperator() == ComparisonOperator.EQUAL) { + ArithmeticExpression lhs = comparisonPredicate.getLeft(); + ArithmeticExpression rhs = comparisonPredicate.getRight(); + String alias = join.getAlias(); + if ( lhs instanceof Path && rhs instanceof Path ) { + Path lhsPath = (Path) lhs; + Path rhsPath = (Path) rhs; + if (alias.equals( lhsPath.getAlias() )) { + return new Path[]{ rhsPath, lhsPath }; + } else if (alias.equals( rhsPath.getAlias() )) { + return new Path[]{ lhsPath, rhsPath }; + } + } + } + } + return null; + } + + private TupleList nestedLoopJoin( + Map.Entry[] entries, + List data, + int fromNodeIndex, + TupleList tuples, + Join join) { + BitSet matchedBitSet = join.getJoinType() == JoinType.RIGHT || join.getJoinType() == JoinType.FULL ? new BitSet( data.size() ) : null; + for ( int i = 0, tuplesSize = tuples.size(); i < tuplesSize; i++ ) { + Object[] tuple = tuples.get( i ); + initDataMap( entries, tuple ); + int matches = 0; + for ( int j = 0; j < data.size(); j++ ) { + Object rhsObject = data.get( j ); + entries[fromNodeIndex].setValue( rhsObject ); + Object predicateResult = join.getJoinPredicate().accept( this ); + if ( predicateResult == Boolean.TRUE ) { + if (matchedBitSet != null) { + matchedBitSet.set( j ); + } + if ( matches == 0 ) { + tuple[fromNodeIndex] = rhsObject; + } else { + Object[] clonedTuple = tuple.clone(); + clonedTuple[fromNodeIndex] = rhsObject; + tuples.add( clonedTuple ); + } + matches++; + } + } + if (matches == 0 && (join.getJoinType() == JoinType.INNER || join.getJoinType() == JoinType.RIGHT)) { + // TODO: optimize by storing deleted bitmap + tuples.remove( i ); + i--; + tuplesSize--; + } + } + if (matchedBitSet != null) { + for ( int i = matchedBitSet.nextClearBit( 0 ); i >= 0; i = matchedBitSet.nextClearBit( i + 1 ) ) { + if ( i == data.size() ) { + break; + } + Object[] tuple = new Object[entries.length]; + tuple[fromNodeIndex] = data.get( i ); + tuples.add( tuple ); + } + } + return tuples; + } + + private TupleList hashJoin( + Map.Entry[] entries, + List data, + int fromNodeIndex, + TupleList tuples, + Join join, + Path[] eqHashJoinPaths) { + if (tuples.size() < data.size()) { + return hashJoinTuples( entries, data, fromNodeIndex, tuples, join, eqHashJoinPaths ); + } else { + return hashJoinObjects( entries, data, fromNodeIndex, tuples, join, eqHashJoinPaths ); + } + } + + private TupleList hashJoinTuples( + Map.Entry[] entries, + List data, + int fromNodeIndex, + TupleList tuples, + Join join, + Path[] eqHashJoinPaths) { + HashMap map = new HashMap<>( tuples.size() ); + int lhsIndex = findEntry( entries, eqHashJoinPaths[0].getAlias()); + Map.Entry lhsEntry = entries[lhsIndex]; + for ( int i = 0; i < tuples.size(); i++ ) { + lhsEntry.setValue( tuples.get( i )[lhsIndex] ); + Object lhsValue = eqHashJoinPaths[0].accept( this ); + Integer tupleIndex = i; + Object existing = map.putIfAbsent( lhsValue, tupleIndex ); + if ( existing != null ) { + IndexList objects; + if ( existing instanceof IndexList ) { + objects = (IndexList) existing; + } else { + objects = new IndexList(); + } + objects.add( tupleIndex ); + map.put( lhsValue, objects ); + } + } + + TupleList joinedTuples = new TupleList(); + Map.Entry rhsEntry = entries[fromNodeIndex]; + BitSet matchedBitSet = join.getJoinType() == JoinType.LEFT || join.getJoinType() == JoinType.FULL ? new BitSet( tuples.size() ) : null; + for ( int i = 0, objectsSize = data.size(); i < objectsSize; i++ ) { + Object rhsObject = data.get( i ); + rhsEntry.setValue( rhsObject ); + Object rhsValue = eqHashJoinPaths[1].accept( this ); + Object matches = map.get( rhsValue ); + if (matches == null) { + if (join.getJoinType() == JoinType.RIGHT || join.getJoinType() == JoinType.FULL) { + Object[] tuple = new Object[entries.length]; + tuple[fromNodeIndex] = rhsObject; + joinedTuples.add( tuple ); + } + } else if (matches instanceof IndexList ) { + IndexList indexList = (IndexList) matches; + int tupleIndex = indexList.get( 0 ); + if (matchedBitSet != null) { + matchedBitSet.set( tupleIndex ); + } + Object[] tuple = tuples.get( tupleIndex ).clone(); + tuple[fromNodeIndex] = rhsObject; + joinedTuples.add( tuple ); + for ( int j = 1; j < indexList.size(); j++ ) { + tupleIndex = indexList.get( j ); + if (matchedBitSet != null) { + matchedBitSet.set( tupleIndex ); + } + tuple = tuples.get( tupleIndex ).clone(); + tuple[fromNodeIndex] = rhsObject; + joinedTuples.add( tuple ); + } + } else { + int tupleIndex = (int) matches; + if (matchedBitSet != null) { + matchedBitSet.set( tupleIndex ); + } + Object[] tuple = tuples.get( tupleIndex ).clone(); + tuple[fromNodeIndex] = rhsObject; + joinedTuples.add( tuple ); + } + } + if (matchedBitSet != null) { + for ( int i = matchedBitSet.nextClearBit( 0 ); i >= 0; i = matchedBitSet.nextClearBit( i + 1 ) ) { + if ( i == tuples.size() ) { + break; + } + joinedTuples.add( tuples.get( i ) ); + } + } + return joinedTuples; + } + + private TupleList hashJoinObjects( + Map.Entry[] entries, + List data, + int fromNodeIndex, + TupleList tuples, + Join join, + Path[] eqHashJoinPaths) { + HashMap map = new HashMap<>( data.size() ); + Map.Entry rhsEntry = entries[fromNodeIndex]; + for ( int i = 0; i < data.size(); i++ ) { + rhsEntry.setValue( data.get( i ) ); + Object rhsValue = eqHashJoinPaths[1].accept( this ); + Integer rhsIndex = i; + Object existing = map.putIfAbsent( rhsValue, rhsIndex ); + if ( existing != null ) { + IndexList objects; + if ( existing instanceof IndexList ) { + objects = (IndexList) existing; + } else { + objects = new IndexList(); + } + objects.add( rhsIndex ); + map.put( rhsValue, objects ); + } + } + + int lhsIndex = findEntry( entries, eqHashJoinPaths[0].getAlias()); + Map.Entry lhsEntry = entries[lhsIndex]; + BitSet matchedBitSet = join.getJoinType() == JoinType.RIGHT || join.getJoinType() == JoinType.FULL ? new BitSet( data.size() ) : null; + for ( int i = 0, tuplesSize = tuples.size(); i < tuplesSize; i++ ) { + Object[] tuple = tuples.get( i ); + lhsEntry.setValue( tuple[lhsIndex] ); + Object lhsValue = eqHashJoinPaths[0].accept( this ); + Object matches = map.get( lhsValue ); + if (matches == null ) { + if (join.getJoinType() == JoinType.INNER || join.getJoinType() == JoinType.RIGHT) { + // TODO: optimize by storing deleted bitmap + tuples.remove( i ); + i--; + tuplesSize--; + } + } else if (matches instanceof IndexList ) { + IndexList indexList = (IndexList) matches; + int rhsIndex = indexList.get( 0 ); + tuple[fromNodeIndex] = data.get( rhsIndex ); + if (matchedBitSet != null) { + matchedBitSet.set( rhsIndex ); + } + for ( int j = 1; j < indexList.size(); j++ ) { + rhsIndex = indexList.get( j ); + if (matchedBitSet != null) { + matchedBitSet.set( rhsIndex ); + } + Object[] clonedTuple = tuple.clone(); + tuple[fromNodeIndex] = data.get( rhsIndex ); + tuples.add( clonedTuple ); + } + } else { + int rhsIndex = (int) matches; + if (matchedBitSet != null) { + matchedBitSet.set( rhsIndex ); + } + tuple[fromNodeIndex] = data.get( rhsIndex ); + } + } + if (matchedBitSet != null) { + for ( int i = matchedBitSet.nextClearBit( 0 ); i >= 0; i = matchedBitSet.nextClearBit( i + 1 ) ) { + if ( i == data.size() ) { + break; + } + Object[] tuple = new Object[entries.length]; + tuple[fromNodeIndex] = data.get( i ); + tuples.add( tuple ); + } + } + return tuples; + } + + private int findEntry(Map.Entry[] entries, String alias) { + for ( int i = 0; i < entries.length; i++ ) { + if ( alias.equals( entries[i].getKey() ) ) { + return i; + } + } + + throw new IllegalStateException("No entry found for alias: " + alias); + } + + private static void initDataMap(Map.Entry[] entries, Object[] tuple) { + for ( int i = 0; i < tuple.length; i++ ) { + entries[i].setValue( tuple[i] ); + } + } + + private FromNode[] tupleNodes(List fromItems) { + int size = fromItems.size(); + for ( FromItem fromItem : fromItems ) { + size += fromItem.getJoins().size(); + } + FromNode[] tupleNodes = new FromNode[size]; + int index = 0; + for ( FromItem fromItem : fromItems ) { + tupleNodes[index++] = fromItem; + for ( Join join : fromItem.getJoins() ) { + tupleNodes[index++] = join; + } + } + return tupleNodes; + } + + protected List getData(FromNode fromNode) { + DataFetcherData dataFetcherData = context.getDataFetcherData(); + String domainTypeName = fromNode.getType().getName(); + List cachedData = dataFetcherData.getDataForDomainType( domainTypeName ); + if (cachedData != null) { + return cachedData; + } + DataFetcher dataFetcher = fromNode.getType().getMetadata( DataFetcher.class ); + if (dataFetcher == null) { + throw new IllegalArgumentException("No data fetcher available for type: " + fromNode.getType()); + } + List fetchedData = dataFetcher.fetch( context ); + dataFetcherData.setDataForDomainType( domainTypeName, fetchedData ); + return fetchedData; + } + + @Override + public Object visit(FromItem e) { + return null; + } + + @Override + public Object visit(Join e) { + return null; + } + protected Boolean compare(DomainType leftType, DomainType rightType, Object left, Object right, ComparisonOperator operator) { ComparisonOperatorInterpreter comparisonOperatorInterpreter = leftType.getMetadata(ComparisonOperatorInterpreter.class); if (comparisonOperatorInterpreter == null) { @@ -498,4 +943,87 @@ public int assignedArguments() { return assignedArguments; } } + + + /** + * @author Christian Beikov + * @since 1.0.0 + */ + private static final class TupleList extends ArrayList { + public TupleList(int initialCapacity) { + super( initialCapacity ); + } + + public TupleList() { + } + } + + /** + * @author Christian Beikov + * @since 1.0.0 + */ + private static final class IndexList { + private static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8; + private int[] elementData; + private int size; + + public IndexList() { + elementData = new int[10]; + } + + private int[] grow(int minCapacity) { + return elementData = Arrays.copyOf( elementData, newCapacity(minCapacity)); + } + + private int[] grow() { + return grow(size + 1); + } + private int newCapacity(int minCapacity) { + // overflow-conscious code + int oldCapacity = elementData.length; + int newCapacity = oldCapacity + (oldCapacity >> 1); + if (newCapacity - minCapacity <= 0) { + if (minCapacity < 0) { + // overflow + throw new OutOfMemoryError(); + } + + return minCapacity; + } + return (newCapacity - MAX_ARRAY_SIZE <= 0) + ? newCapacity + : hugeCapacity(minCapacity); + } + private static int hugeCapacity(int minCapacity) { + if (minCapacity < 0) { + // overflow + throw new OutOfMemoryError(); + } + return (minCapacity > MAX_ARRAY_SIZE) + ? Integer.MAX_VALUE + : MAX_ARRAY_SIZE; + } + + public int size() { + return size; + } + + public boolean isEmpty() { + return size == 0; + } + + public int get(int index) { + if (index < 0 || index >= size) { + throw new IndexOutOfBoundsException("Index out of range: " + index); + } + return elementData[index]; + } + public void add(int e) { + if (size == elementData.length) { + elementData = grow(); + } + elementData[size] = e; + size = size + 1; + } + } } diff --git a/core/impl/src/main/java/com/blazebit/expression/impl/ExpressionSerializerImpl.java b/core/impl/src/main/java/com/blazebit/expression/impl/ExpressionSerializerImpl.java index d3b07f5..d65e02f 100644 --- a/core/impl/src/main/java/com/blazebit/expression/impl/ExpressionSerializerImpl.java +++ b/core/impl/src/main/java/com/blazebit/expression/impl/ExpressionSerializerImpl.java @@ -35,13 +35,16 @@ import com.blazebit.expression.ExpressionPredicate; import com.blazebit.expression.ExpressionSerializer; import com.blazebit.expression.ExpressionService; +import com.blazebit.expression.FromItem; import com.blazebit.expression.FunctionInvocation; import com.blazebit.expression.InPredicate; import com.blazebit.expression.IsEmptyPredicate; import com.blazebit.expression.IsNullPredicate; +import com.blazebit.expression.Join; import com.blazebit.expression.Literal; import com.blazebit.expression.Path; import com.blazebit.expression.Predicate; +import com.blazebit.expression.Query; import com.blazebit.expression.spi.LiteralRenderer; import java.time.Instant; @@ -442,6 +445,97 @@ public void visit(IsEmptyPredicate e) { sb.append("EMPTY"); } + @Override + public void visit(Query e) { + List selectItems = e.getSelectItems(); + List fromItems = e.getFromItems(); + if (e.isDistinct() || !isImplicitSelect(fromItems, selectItems)) { + sb.append( "SELECT " ); + if (e.isDistinct()) { + sb.append( "DISTINCT " ); + } + boolean first = true; + for ( Expression selectItem : selectItems ) { + if ( first ) { + first = false; + } else { + sb.append( ", " ); + } + selectItem.accept( this ); + } + sb.append( ' ' ); + } + sb.append("FROM "); + boolean first = true; + for ( FromItem fromItem : e.getFromItems() ) { + if ( first ) { + first = false; + } else { + sb.append( ", " ); + } + fromItem.accept( this ); + } + Predicate wherePredicate = e.getWherePredicate(); + if ( wherePredicate != null ) { + sb.append( " WHERE " ); + wherePredicate.accept( this ); + } + } + + private boolean isImplicitSelect(List fromItems, List selectItems) { + if (selectItems.size() != fromItems.size()) { + return false; + } + for (int i = 0; i < selectItems.size(); i++) { + FromItem fromItem = fromItems.get( i ); + Expression expression = selectItems.get( i ); + if (expression instanceof Path) { + Path path = (Path) expression; + if (path.getAlias() == null || !path.getAlias().equals( fromItem.getAlias() ) || !path.getAttributes().isEmpty()) { + return false; + } + } else { + return false; + } + } + return true; + } + + @Override + public void visit(FromItem e) { + sb.append( e.getType().getName() ); + sb.append( " " ); + sb.append( e.getAlias() ); + for ( Join join : e.getJoins() ) { + join.accept( this ); + } + } + + @Override + public void visit(Join e) { + switch ( e.getJoinType() ) { + case INNER: + sb.append( " JOIN " ); + break; + case LEFT: + sb.append( " LEFT JOIN " ); + break; + case RIGHT: + sb.append( " RIGHT JOIN " ); + break; + case FULL: + sb.append( " FULL JOIN " ); + break; + default: + throw new IllegalArgumentException( "Unknown join type: " + e.getJoinType() ); + } + sb.append( e.getType().getName() ); + sb.append( " " ); + sb.append( e.getAlias() ); + sb.append( " ON " ); + e.getJoinPredicate().accept( this ); + } + private void appendIdentifier(String identifier) { int startIndex = sb.length(); int end = identifier.length(); diff --git a/core/impl/src/main/java/com/blazebit/expression/impl/PredicateModelGenerator.java b/core/impl/src/main/java/com/blazebit/expression/impl/PredicateModelGenerator.java index 9866c64..9f5be7d 100644 --- a/core/impl/src/main/java/com/blazebit/expression/impl/PredicateModelGenerator.java +++ b/core/impl/src/main/java/com/blazebit/expression/impl/PredicateModelGenerator.java @@ -45,14 +45,18 @@ import com.blazebit.expression.Expression; import com.blazebit.expression.ExpressionCompiler; import com.blazebit.expression.ExpressionPredicate; +import com.blazebit.expression.FromItem; import com.blazebit.expression.FunctionInvocation; import com.blazebit.expression.ImplicitRootProvider; import com.blazebit.expression.InPredicate; import com.blazebit.expression.IsEmptyPredicate; import com.blazebit.expression.IsNullPredicate; +import com.blazebit.expression.Join; +import com.blazebit.expression.JoinType; import com.blazebit.expression.Literal; import com.blazebit.expression.Path; import com.blazebit.expression.Predicate; +import com.blazebit.expression.Query; import com.blazebit.expression.SyntaxErrorException; import com.blazebit.expression.TypeErrorException; import com.blazebit.expression.impl.PredicateParser.PathContext; @@ -83,13 +87,14 @@ * @author Christian Beikov * @since 1.0.0 */ -public class PredicateModelGenerator extends PredicateParserBaseVisitor { +public class PredicateModelGenerator extends PredicateParserBaseVisitor { protected final DomainModel domainModel; protected final LiteralFactory literalFactory; protected final ExpressionCompiler.Context compileContext; protected Literal cachedBooleanTrueLiteral; protected Literal cachedBooleanFalseLiteral; + protected Map fromNodes; public PredicateModelGenerator(DomainModel domainModel, LiteralFactory literalFactory, ExpressionCompiler.Context compileContext) { this.domainModel = domainModel; @@ -97,19 +102,29 @@ public PredicateModelGenerator(DomainModel domainModel, LiteralFactory literalFa this.compileContext = compileContext; } + protected DomainType resolveAlias(String alias) { + if (fromNodes != null) { + DomainType domainType = fromNodes.get( alias ); + if (domainType != null) { + return domainType; + } + } + return compileContext.getRootDomainType( alias ); + } + @Override public Expression visitParsePredicate(PredicateParser.ParsePredicateContext ctx) { - return ctx.predicate().accept(this); + return (Expression) ctx.predicate().accept( this); } @Override public Expression visitParseExpression(PredicateParser.ParseExpressionContext ctx) { - return ctx.expression().accept(this); + return (Expression) ctx.expression().accept( this); } @Override public Expression visitParseExpressionOrPredicate(PredicateParser.ParseExpressionOrPredicateContext ctx) { - return ctx.predicateOrExpression().accept(this); + return (Expression) ctx.predicateOrExpression().accept( this); } @Override @@ -118,7 +133,12 @@ public Expression visitParseTemplate(PredicateParser.ParseTemplateContext ctx) { if (templateContext == null) { return new Literal(literalFactory.ofString(compileContext, "")); } - return templateContext.accept(this); + return (Expression) templateContext.accept( this); + } + + @Override + public Query visitParseQuery(PredicateParser.ParseQueryContext ctx) { + return (Query) ctx.query().accept( this ); } @Override @@ -151,9 +171,108 @@ public Expression visitTemplate(PredicateParser.TemplateContext ctx) { return expression; } + @Override + public Query visitQuery(PredicateParser.QueryContext ctx) { + List fromItems = visitFromClause( ctx.fromClause() ); + PredicateParser.SelectClauseContext selectClauseContext = ctx.selectClause(); + List selectItems; + boolean distinct = false; + if ( selectClauseContext == null ) { + selectItems = new ArrayList<>(fromItems.size()); + for ( FromItem fromItem : fromItems ) { + selectItems.add( new Path( fromItem.getAlias(), Collections.emptyList(), fromItem.getType() ) ); + } + } else { + distinct = selectClauseContext.DISTINCT() != null; + List selectItemContexts = selectClauseContext.expression(); + selectItems = new ArrayList<>(selectItemContexts.size()); + for ( PredicateParser.ExpressionContext selectItemContext : selectItemContexts ) { + selectItems.add( (Expression) selectItemContext.accept( this ) ); + } + } + Predicate wherePredicate = visitWhereClause( ctx.whereClause() ); + return new Query( null, selectItems, distinct, fromItems, wherePredicate ); + } + + @Override + public Predicate visitWhereClause(PredicateParser.WhereClauseContext ctx) { + if ( ctx == null ) { + return null; + } + return (Predicate) ctx.predicate().accept( this ); + } + + @Override + public List visitFromClause(PredicateParser.FromClauseContext ctx) { + List fromItemContexts = ctx.fromItem(); + List fromItems = new ArrayList<>(fromItemContexts.size()); + Map finalFromNodes = fromItemContexts.size() > 1 ? new HashMap<>() : null; + for ( int i = 0; i < fromItemContexts.size(); i++ ) { + PredicateParser.FromItemContext fromItemContext = fromItemContexts.get( i ); + fromNodes = new HashMap<>(); + fromItems.add( visitFromItem( fromItemContext ) ); + if ( finalFromNodes != null ) { + finalFromNodes.putAll( fromNodes ); + } + } + if ( finalFromNodes != null ) { + fromNodes = finalFromNodes; + } + return fromItems; + } + + @Override + public FromItem visitFromItem(PredicateParser.FromItemContext ctx) { + PredicateParser.FromRootContext fromRootContext = ctx.fromRoot(); + DomainType domainType = domainModel.getType( fromRootContext.domainTypeName().getText() ); + if ( domainType == null ) { + throw unknownType( fromRootContext.domainTypeName().getText() ); + } + String alias = visitVariable( fromRootContext.variable() ); + fromNodes.put( alias, domainType ); + List joins = visitJoins( ctx.join() ); + return new FromItem( domainType, alias, joins ); + } + + private List visitJoins(List joinContexts) { + List joins = new ArrayList<>(joinContexts.size()); + for ( PredicateParser.JoinContext joinContext : joinContexts ) { + TerminalNode terminalNode = (TerminalNode) joinContext.getChild( 0 ); + JoinType joinType; + switch ( terminalNode.getSymbol().getType() ) { + case PredicateLexer.LEFT: + joinType = JoinType.LEFT; + break; + case PredicateLexer.RIGHT: + joinType = JoinType.RIGHT; + break; + case PredicateLexer.FULL: + joinType = JoinType.FULL; + break; + default: + joinType = JoinType.INNER; + break; + } + PredicateParser.JoinTargetContext joinTargetContext = joinContext.joinTarget(); + DomainType domainType = domainModel.getType( joinTargetContext.domainTypeName().getText() ); + if ( domainType == null ) { + throw unknownType( joinTargetContext.domainTypeName().getText() ); + } + String alias = visitVariable( joinTargetContext.variable() ); + fromNodes.put( alias, domainType ); + joins.add( new Join( domainType, alias, joinType, (Predicate) joinContext.predicate().accept( this ) ) ); + } + return Collections.unmodifiableList( joins ); + } + + @Override + public String visitVariable(PredicateParser.VariableContext ctx) { + return ctx.identifier().getText(); + } + @Override public Expression visitGroupedPredicate(PredicateParser.GroupedPredicateContext ctx) { - return ctx.predicate().accept(this); + return (Expression) ctx.predicate().accept( this); } @Override @@ -205,7 +324,7 @@ private List unmodifiable(List predicates) { @Override public Predicate visitIsNullPredicate(PredicateParser.IsNullPredicateContext ctx) { - Expression left = ctx.expression().accept(this); + Expression left = (Expression) ctx.expression().accept( this); DomainPredicateTypeResolver predicateTypeResolver = domainModel.getPredicateTypeResolver(left.getType().getName(), DomainPredicate.NULLNESS); @@ -224,7 +343,7 @@ public Predicate visitIsNullPredicate(PredicateParser.IsNullPredicateContext ctx @Override public Predicate visitIsEmptyPredicate(PredicateParser.IsEmptyPredicateContext ctx) { - Expression left = ctx.expression().accept(this); + Expression left = (Expression) ctx.expression().accept( this); DomainPredicateTypeResolver predicateTypeResolver = domainModel.getPredicateTypeResolver(left.getType().getName(), DomainPredicate.COLLECTION); @@ -359,7 +478,7 @@ public Predicate visitBetweenPredicate(PredicateParser.BetweenPredicateContext c @Override public Expression visitBooleanFunction(PredicateParser.BooleanFunctionContext ctx) { - Expression expression = super.visitBooleanFunction(ctx); + Expression expression = (Expression) super.visitBooleanFunction( ctx); DomainType booleanDomainType = domainModel.getPredicateDefaultResultType(); if (expression.getType() == booleanDomainType) { if (expression instanceof Predicate) { @@ -374,7 +493,7 @@ public Expression visitBooleanFunction(PredicateParser.BooleanFunctionContext ct @Override public Expression visitGroupedExpression(PredicateParser.GroupedExpressionContext ctx) { - return ctx.expression().accept(this); + return (Expression) ctx.expression().accept( this); } @Override @@ -452,7 +571,7 @@ public Expression visitUnaryPlusExpression(PredicateParser.UnaryPlusExpressionCo throw cannotResolveOperationType(DomainOperator.UNARY_PLUS, operandTypes); } else if (domainType == left.getType()) { // Don't create a wrapper for a unary plus if the type doesn't change - return ctx.expression().accept(this); + return (Expression) ctx.expression().accept( this); } else { return new ArithmeticFactor(domainType, left, false); @@ -566,12 +685,12 @@ protected Expression createPathExpression(PathContext ctx) { PredicateParser.PathAttributesContext pathAttributesContext = ctx.pathAttributes(); ArrayList pathAttributes = new ArrayList<>(); if (identifierContext == null) { - Expression base = ctx.functionInvocation().accept(this); + Expression base = (Expression) ctx.functionInvocation().accept( this); DomainType domainType = visitPathAttributes(base.getType(), pathAttributes, pathAttributesContext); return new Path((ArithmeticExpression) base, Collections.unmodifiableList(pathAttributes), domainType); } else { String alias = identifierContext.getText(); - DomainType type = compileContext.getRootDomainType(alias); + DomainType type = resolveAlias(alias); if (type == null) { List identifiers; if (pathAttributesContext != null) { @@ -593,7 +712,7 @@ protected Expression createPathExpression(PathContext ctx) { } String rootAlias = implicitRootProvider.determineImplicitRoot(pathParts, compileContext); if (rootAlias != null) { - type = compileContext.getRootDomainType(rootAlias); + type = resolveAlias(rootAlias); if (type != null) { type = visitPathAttribute(type, pathAttributes, alias); DomainType domainType = visitPathAttributes(type, pathAttributes, pathAttributesContext); @@ -606,7 +725,7 @@ protected Expression createPathExpression(PathContext ctx) { if (implicitRootProvider != null) { String rootAlias = implicitRootProvider.determineImplicitRoot(Collections.singletonList(alias), compileContext); if (rootAlias != null) { - type = compileContext.getRootDomainType(rootAlias); + type = resolveAlias(rootAlias); if (type != null) { DomainType domainType = visitPathAttribute(type, pathAttributes, alias); return new Path(rootAlias, Collections.unmodifiableList(pathAttributes), domainType); diff --git a/core/impl/src/test/java/com/blazebit/expression/impl/AbstractExpressionCompilerTest.java b/core/impl/src/test/java/com/blazebit/expression/impl/AbstractExpressionCompilerTest.java index b052cf6..27ac7d9 100644 --- a/core/impl/src/test/java/com/blazebit/expression/impl/AbstractExpressionCompilerTest.java +++ b/core/impl/src/test/java/com/blazebit/expression/impl/AbstractExpressionCompilerTest.java @@ -45,12 +45,16 @@ import com.blazebit.expression.ExpressionSerializer; import com.blazebit.expression.ExpressionService; import com.blazebit.expression.Expressions; +import com.blazebit.expression.FromItem; import com.blazebit.expression.FunctionInvocation; import com.blazebit.expression.ImplicitRootProvider; import com.blazebit.expression.InPredicate; +import com.blazebit.expression.Join; +import com.blazebit.expression.JoinType; import com.blazebit.expression.Literal; import com.blazebit.expression.Path; import com.blazebit.expression.Predicate; +import com.blazebit.expression.Query; import com.blazebit.expression.impl.domain.DefaultBooleanLiteralResolver; import com.blazebit.expression.impl.domain.DefaultEnumLiteralResolver; import com.blazebit.expression.impl.domain.DefaultNumericLiteralResolver; @@ -62,16 +66,16 @@ import org.junit.BeforeClass; import java.math.BigDecimal; -import java.math.BigInteger; import java.time.Instant; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import static java.util.Arrays.asList; + /** * @author Christian Beikov * @since 1.0.0 @@ -135,12 +139,12 @@ public static void createDefaultTestDomainModel() { .build() .withFunctionTypeResolver("self", StaticDomainFunctionTypeResolvers.FIRST_ARGUMENT_TYPE); - for (final String type : Arrays.asList(INTEGER, LONG, BIGDECIMAL)) { + for (final String type : asList(INTEGER, LONG, BIGDECIMAL)) { builder.withOperationTypeResolver(type, DomainOperator.MODULO, StaticDomainOperationTypeResolvers.returning(INTEGER)); builder.withOperationTypeResolver(type, DomainOperator.UNARY_MINUS, StaticDomainOperationTypeResolvers.returning(type)); builder.withOperationTypeResolver(type, DomainOperator.UNARY_PLUS, StaticDomainOperationTypeResolvers.returning(type)); builder.withOperationTypeResolver(type, DomainOperator.DIVISION, StaticDomainOperationTypeResolvers.returning(BIGDECIMAL)); - for (DomainOperator domainOperator : Arrays.asList(DomainOperator.PLUS, DomainOperator.MINUS, DomainOperator.MULTIPLICATION)) { + for (DomainOperator domainOperator : asList(DomainOperator.PLUS, DomainOperator.MINUS, DomainOperator.MULTIPLICATION)) { builder.withOperationTypeResolver(type, domainOperator, StaticDomainOperationTypeResolvers.widest(BIGDECIMAL, INTEGER)); } } @@ -210,12 +214,20 @@ protected Expression parseTemplateExpression(String input) { return templateExpression; } + protected Query parseQuery(String input) { + Query query = expressionCompiler.createQuery(input, context); + StringBuilder sb = new StringBuilder(); + expressionSerializer.serializeTo(query, sb); + Assert.assertEquals(input, sb.toString()); + return query; + } + protected CompoundPredicate or(Predicate... disjuncts) { - return new CompoundPredicate(booleanDomainType(), Arrays.asList(disjuncts), false); + return new CompoundPredicate(booleanDomainType(), asList(disjuncts), false); } protected CompoundPredicate and(Predicate... conjuncts) { - return new CompoundPredicate(booleanDomainType(), Arrays.asList(conjuncts), true); + return new CompoundPredicate(booleanDomainType(), asList(conjuncts), true); } protected Literal time(Instant value) { @@ -251,6 +263,10 @@ protected Literal number(String value) { } protected Path attr(String entity, String... attributes) { + return path(entity, entity, attributes); + } + + protected Path path(String entity, String alias, String... attributes) { EntityDomainType entityDomainType = (EntityDomainType) domainModel.getType(entity); DomainType type = entityDomainType; List pathAttributes = new ArrayList<>(attributes.length); @@ -273,7 +289,7 @@ protected Path attr(String entity, String... attributes) { } } } - return new Path(entity, Collections.unmodifiableList(pathAttributes), type); + return new Path(alias, Collections.unmodifiableList(pathAttributes), type); } protected Path attr(ArithmeticExpression base, String... attributes) { @@ -311,6 +327,30 @@ protected Literal enumValue(String enumName, String enumKey) { // return new CollectionAtom(new Path(identifier, TermType.COLLECTION)); // } + protected FromItem fromItem(String typeName, String alias) { + return new FromItem( domainModel.getType( typeName ), alias, Collections.emptyList() ); + } + + protected FromItem fromItem(String typeName, String alias, Join... joins) { + return new FromItem( domainModel.getType( typeName ), alias, asList(joins) ); + } + + protected Join join(String typeName, String alias, Predicate predicate) { + return new Join( domainModel.getType( typeName ), alias, JoinType.INNER, predicate ); + } + + protected Join leftJoin(String typeName, String alias, Predicate predicate) { + return new Join( domainModel.getType( typeName ), alias, JoinType.LEFT, predicate ); + } + + protected Join rightJoin(String typeName, String alias, Predicate predicate) { + return new Join( domainModel.getType( typeName ), alias, JoinType.RIGHT, predicate ); + } + + protected Join fullJoin(String typeName, String alias, Predicate predicate) { + return new Join( domainModel.getType( typeName ), alias, JoinType.FULL, predicate ); + } + protected ComparisonPredicate neq(ArithmeticExpression left, ArithmeticExpression right) { return new ComparisonPredicate(booleanDomainType(), left, right, ComparisonOperator.NOT_EQUAL); } @@ -372,7 +412,7 @@ protected BetweenPredicate between(ArithmeticExpression left, ArithmeticExpressi // } protected InPredicate in(ArithmeticExpression value, ArithmeticExpression... items) { - return new InPredicate(booleanDomainType(), value, Arrays.asList(items), false); + return new InPredicate(booleanDomainType(), value, asList(items), false); } protected FunctionInvocation functionInvocation(String functionName, Expression... argumentArray) { diff --git a/core/impl/src/test/java/com/blazebit/expression/impl/QueryCompilerTest.java b/core/impl/src/test/java/com/blazebit/expression/impl/QueryCompilerTest.java new file mode 100644 index 0000000..70d928b --- /dev/null +++ b/core/impl/src/test/java/com/blazebit/expression/impl/QueryCompilerTest.java @@ -0,0 +1,171 @@ +/* + * Copyright 2019 - 2024 Blazebit. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.blazebit.expression.impl; + +import org.junit.Test; + +import com.blazebit.expression.Query; + +import static java.util.Arrays.asList; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; + +/** + * @author Christian Beikov + * @since 1.0.0 + */ +public class QueryCompilerTest extends AbstractExpressionCompilerTest { + + @Test + public void testSimple() { + Query query = parseQuery( "FROM user u"); + assertEquals( + asList( path( "user", "u" )), + query.getSelectItems() + ); + assertEquals( + asList(fromItem("user", "u")), + query.getFromItems() + ); + assertNull( query.getWherePredicate() ); + } + + @Test + public void testPredicate() { + Query query = parseQuery( "FROM user u WHERE 1 > 2"); + assertEquals( + asList( path( "user", "u" )), + query.getSelectItems() + ); + assertEquals( + asList(fromItem("user", "u")), + query.getFromItems() + ); + assertEquals( + gt(pos(number(1L)), pos(number(2L))), + query.getWherePredicate() + ); + } + + @Test + public void testSelectAttribute() { + Query query = parseQuery( "SELECT u.id FROM user u"); + assertEquals( + asList(path( "user", "u", "id" )), + query.getSelectItems() + ); + assertEquals( + asList(fromItem("user", "u")), + query.getFromItems() + ); + assertNull( query.getWherePredicate() ); + } + + @Test + public void testSelectDistinct() { + Query query = parseQuery( "SELECT DISTINCT u FROM user u"); + assertEquals( + asList(path( "user", "u" )), + query.getSelectItems() + ); + assertEquals( + asList(fromItem("user", "u")), + query.getFromItems() + ); + assertNull( query.getWherePredicate() ); + } + + @Test + public void testJoin() { + Query query = parseQuery( "FROM user u JOIN user u2 ON u.id = u2.id"); + assertEquals( + asList( path( "user", "u" )), + query.getSelectItems() + ); + assertEquals( + asList( + fromItem( + "user", + "u", + join( "user", "u2", eq( path( "user", "u", "id" ), path( "user", "u2", "id" ) ) ) + ) + ), + query.getFromItems() + ); + assertNull( query.getWherePredicate() ); + } + + @Test + public void testLeftJoin() { + Query query = parseQuery( "FROM user u LEFT JOIN user u2 ON u.id = u2.id"); + assertEquals( + asList( path( "user", "u" )), + query.getSelectItems() + ); + assertEquals( + asList( + fromItem( + "user", + "u", + leftJoin( "user", "u2", eq( path( "user", "u", "id" ), path( "user", "u2", "id" ) ) ) + ) + ), + query.getFromItems() + ); + assertNull( query.getWherePredicate() ); + } + + @Test + public void testRightJoin() { + Query query = parseQuery( "FROM user u RIGHT JOIN user u2 ON u.id = u2.id"); + assertEquals( + asList( path( "user", "u" )), + query.getSelectItems() + ); + assertEquals( + asList( + fromItem( + "user", + "u", + rightJoin( "user", "u2", eq( path( "user", "u", "id" ), path( "user", "u2", "id" ) ) ) + ) + ), + query.getFromItems() + ); + assertNull( query.getWherePredicate() ); + } + + @Test + public void testFullJoin() { + Query query = parseQuery( "FROM user u FULL JOIN user u2 ON u.id = u2.id"); + assertEquals( + asList( path( "user", "u" )), + query.getSelectItems() + ); + assertEquals( + asList( + fromItem( + "user", + "u", + fullJoin( "user", "u2", eq( path( "user", "u", "id" ), path( "user", "u2", "id" ) ) ) + ) + ), + query.getFromItems() + ); + assertNull( query.getWherePredicate() ); + } +} diff --git a/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionLexer.interp b/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionLexer.interp index fc1f04d..daa4764 100644 --- a/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionLexer.interp +++ b/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionLexer.interp @@ -26,6 +26,15 @@ null null null null +null +null +null +null +null +null +null +null +null '<' '<=' '>' @@ -67,21 +76,30 @@ AND BETWEEN DATE DAYS +DISTINCT EMPTY FALSE +FROM +FULL HOURS IN INTERVAL IS +JOIN +LEFT MINUTES MONTHS NOT NULL +ON OR +RIGHT SECONDS +SELECT TIME TIMESTAMP TRUE +WHERE YEARS LESS LESS_EQUAL @@ -133,21 +151,30 @@ AND BETWEEN DATE DAYS +DISTINCT EMPTY FALSE +FROM +FULL HOURS IN INTERVAL IS +JOIN +LEFT MINUTES MONTHS NOT NULL +ON OR +RIGHT SECONDS +SELECT TIME TIMESTAMP TRUE +WHERE YEARS LESS LESS_EQUAL @@ -189,4 +216,4 @@ QUOTE_STRING DOUBLE_QUOTE_STRING atn: -[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 2, 56, 443, 8, 1, 8, 1, 8, 1, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 3, 2, 3, 2, 5, 2, 137, 10, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 5, 3, 144, 10, 3, 3, 4, 3, 4, 3, 5, 6, 5, 149, 10, 5, 13, 5, 14, 5, 150, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 5, 7, 158, 10, 7, 5, 7, 160, 10, 7, 3, 8, 3, 8, 3, 8, 3, 9, 5, 9, 166, 10, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 5, 10, 175, 10, 10, 3, 10, 5, 10, 178, 10, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 5, 16, 203, 10, 16, 3, 16, 3, 16, 3, 16, 5, 16, 208, 10, 16, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 3, 41, 3, 41, 3, 42, 3, 42, 3, 43, 3, 43, 3, 43, 3, 43, 5, 43, 345, 10, 43, 3, 44, 3, 44, 3, 45, 3, 45, 3, 46, 3, 46, 3, 47, 3, 47, 3, 48, 3, 48, 3, 49, 3, 49, 3, 50, 3, 50, 3, 51, 3, 51, 3, 52, 3, 52, 3, 53, 3, 53, 3, 54, 3, 54, 3, 55, 3, 55, 3, 56, 3, 56, 3, 57, 3, 57, 7, 57, 375, 10, 57, 12, 57, 14, 57, 378, 11, 57, 3, 58, 3, 58, 3, 58, 7, 58, 383, 10, 58, 12, 58, 14, 58, 386, 11, 58, 3, 58, 3, 58, 3, 58, 3, 59, 3, 59, 3, 59, 3, 59, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 6, 61, 406, 10, 61, 13, 61, 14, 61, 407, 3, 61, 3, 61, 3, 62, 3, 62, 3, 62, 6, 62, 415, 10, 62, 13, 62, 14, 62, 416, 3, 62, 5, 62, 420, 10, 62, 5, 62, 422, 10, 62, 3, 63, 3, 63, 3, 63, 3, 63, 3, 64, 3, 64, 3, 64, 6, 64, 431, 10, 64, 13, 64, 14, 64, 432, 3, 64, 5, 64, 436, 10, 64, 5, 64, 438, 10, 64, 3, 65, 3, 65, 3, 65, 3, 65, 2, 2, 2, 66, 6, 2, 3, 8, 2, 2, 10, 2, 2, 12, 2, 2, 14, 2, 2, 16, 2, 2, 18, 2, 2, 20, 2, 2, 22, 2, 2, 24, 2, 2, 26, 2, 2, 28, 2, 4, 30, 2, 5, 32, 2, 6, 34, 2, 7, 36, 2, 8, 38, 2, 9, 40, 2, 10, 42, 2, 11, 44, 2, 12, 46, 2, 13, 48, 2, 14, 50, 2, 15, 52, 2, 16, 54, 2, 17, 56, 2, 18, 58, 2, 19, 60, 2, 20, 62, 2, 21, 64, 2, 22, 66, 2, 23, 68, 2, 24, 70, 2, 25, 72, 2, 26, 74, 2, 27, 76, 2, 28, 78, 2, 29, 80, 2, 30, 82, 2, 31, 84, 2, 32, 86, 2, 33, 88, 2, 34, 90, 2, 35, 92, 2, 36, 94, 2, 37, 96, 2, 38, 98, 2, 39, 100, 2, 40, 102, 2, 41, 104, 2, 42, 106, 2, 43, 108, 2, 44, 110, 2, 45, 112, 2, 46, 114, 2, 47, 116, 2, 48, 118, 2, 49, 120, 2, 50, 122, 2, 51, 124, 2, 52, 126, 2, 53, 128, 2, 54, 130, 2, 55, 132, 2, 56, 6, 2, 3, 4, 5, 34, 5, 2, 11, 11, 14, 14, 34, 34, 4, 2, 12, 12, 15, 15, 4, 2, 71, 71, 103, 103, 4, 2, 45, 45, 47, 47, 7, 2, 100, 100, 104, 104, 112, 112, 116, 116, 118, 118, 4, 2, 41, 41, 94, 94, 5, 2, 50, 59, 67, 72, 99, 104, 4, 2, 67, 67, 99, 99, 4, 2, 80, 80, 112, 112, 4, 2, 70, 70, 102, 102, 4, 2, 68, 68, 100, 100, 4, 2, 86, 86, 118, 118, 4, 2, 89, 89, 121, 121, 4, 2, 91, 91, 123, 123, 4, 2, 85, 85, 117, 117, 4, 2, 79, 79, 111, 111, 4, 2, 82, 82, 114, 114, 4, 2, 72, 72, 104, 104, 4, 2, 78, 78, 110, 110, 4, 2, 74, 74, 106, 106, 4, 2, 81, 81, 113, 113, 4, 2, 87, 87, 119, 119, 4, 2, 84, 84, 116, 116, 4, 2, 75, 75, 107, 107, 4, 2, 88, 88, 120, 120, 4, 2, 69, 69, 101, 101, 7, 2, 38, 38, 67, 92, 97, 97, 99, 124, 130, 0, 8, 2, 38, 38, 50, 59, 67, 92, 97, 97, 99, 124, 130, 0, 6, 2, 12, 12, 15, 15, 94, 94, 98, 98, 3, 2, 37, 37, 6, 2, 12, 12, 15, 15, 41, 41, 94, 94, 6, 2, 12, 12, 15, 15, 36, 36, 94, 94, 2, 455, 2, 6, 3, 2, 2, 2, 2, 28, 3, 2, 2, 2, 2, 30, 3, 2, 2, 2, 2, 32, 3, 2, 2, 2, 2, 34, 3, 2, 2, 2, 2, 36, 3, 2, 2, 2, 2, 38, 3, 2, 2, 2, 2, 40, 3, 2, 2, 2, 2, 42, 3, 2, 2, 2, 2, 44, 3, 2, 2, 2, 2, 46, 3, 2, 2, 2, 2, 48, 3, 2, 2, 2, 2, 50, 3, 2, 2, 2, 2, 52, 3, 2, 2, 2, 2, 54, 3, 2, 2, 2, 2, 56, 3, 2, 2, 2, 2, 58, 3, 2, 2, 2, 2, 60, 3, 2, 2, 2, 2, 62, 3, 2, 2, 2, 2, 64, 3, 2, 2, 2, 2, 66, 3, 2, 2, 2, 2, 68, 3, 2, 2, 2, 2, 70, 3, 2, 2, 2, 2, 72, 3, 2, 2, 2, 2, 74, 3, 2, 2, 2, 2, 76, 3, 2, 2, 2, 2, 78, 3, 2, 2, 2, 2, 80, 3, 2, 2, 2, 2, 82, 3, 2, 2, 2, 2, 84, 3, 2, 2, 2, 2, 86, 3, 2, 2, 2, 2, 88, 3, 2, 2, 2, 2, 90, 3, 2, 2, 2, 2, 92, 3, 2, 2, 2, 2, 94, 3, 2, 2, 2, 2, 96, 3, 2, 2, 2, 2, 98, 3, 2, 2, 2, 2, 100, 3, 2, 2, 2, 2, 102, 3, 2, 2, 2, 2, 104, 3, 2, 2, 2, 2, 106, 3, 2, 2, 2, 2, 108, 3, 2, 2, 2, 2, 110, 3, 2, 2, 2, 2, 112, 3, 2, 2, 2, 2, 114, 3, 2, 2, 2, 2, 116, 3, 2, 2, 2, 2, 118, 3, 2, 2, 2, 2, 120, 3, 2, 2, 2, 3, 122, 3, 2, 2, 2, 3, 124, 3, 2, 2, 2, 4, 126, 3, 2, 2, 2, 4, 128, 3, 2, 2, 2, 5, 130, 3, 2, 2, 2, 5, 132, 3, 2, 2, 2, 6, 136, 3, 2, 2, 2, 8, 143, 3, 2, 2, 2, 10, 145, 3, 2, 2, 2, 12, 148, 3, 2, 2, 2, 14, 152, 3, 2, 2, 2, 16, 159, 3, 2, 2, 2, 18, 161, 3, 2, 2, 2, 20, 165, 3, 2, 2, 2, 22, 177, 3, 2, 2, 2, 24, 179, 3, 2, 2, 2, 26, 181, 3, 2, 2, 2, 28, 188, 3, 2, 2, 2, 30, 192, 3, 2, 2, 2, 32, 196, 3, 2, 2, 2, 34, 207, 3, 2, 2, 2, 36, 209, 3, 2, 2, 2, 38, 212, 3, 2, 2, 2, 40, 216, 3, 2, 2, 2, 42, 224, 3, 2, 2, 2, 44, 229, 3, 2, 2, 2, 46, 234, 3, 2, 2, 2, 48, 240, 3, 2, 2, 2, 50, 246, 3, 2, 2, 2, 52, 252, 3, 2, 2, 2, 54, 255, 3, 2, 2, 2, 56, 264, 3, 2, 2, 2, 58, 267, 3, 2, 2, 2, 60, 275, 3, 2, 2, 2, 62, 282, 3, 2, 2, 2, 64, 286, 3, 2, 2, 2, 66, 291, 3, 2, 2, 2, 68, 294, 3, 2, 2, 2, 70, 302, 3, 2, 2, 2, 72, 307, 3, 2, 2, 2, 74, 317, 3, 2, 2, 2, 76, 322, 3, 2, 2, 2, 78, 328, 3, 2, 2, 2, 80, 330, 3, 2, 2, 2, 82, 333, 3, 2, 2, 2, 84, 335, 3, 2, 2, 2, 86, 338, 3, 2, 2, 2, 88, 344, 3, 2, 2, 2, 90, 346, 3, 2, 2, 2, 92, 348, 3, 2, 2, 2, 94, 350, 3, 2, 2, 2, 96, 352, 3, 2, 2, 2, 98, 354, 3, 2, 2, 2, 100, 356, 3, 2, 2, 2, 102, 358, 3, 2, 2, 2, 104, 360, 3, 2, 2, 2, 106, 362, 3, 2, 2, 2, 108, 364, 3, 2, 2, 2, 110, 366, 3, 2, 2, 2, 112, 368, 3, 2, 2, 2, 114, 370, 3, 2, 2, 2, 116, 372, 3, 2, 2, 2, 118, 379, 3, 2, 2, 2, 120, 390, 3, 2, 2, 2, 122, 394, 3, 2, 2, 2, 124, 405, 3, 2, 2, 2, 126, 421, 3, 2, 2, 2, 128, 423, 3, 2, 2, 2, 130, 437, 3, 2, 2, 2, 132, 439, 3, 2, 2, 2, 134, 137, 9, 2, 2, 2, 135, 137, 5, 8, 3, 2, 136, 134, 3, 2, 2, 2, 136, 135, 3, 2, 2, 2, 137, 138, 3, 2, 2, 2, 138, 139, 8, 2, 2, 2, 139, 7, 3, 2, 2, 2, 140, 141, 7, 15, 2, 2, 141, 144, 7, 12, 2, 2, 142, 144, 9, 3, 2, 2, 143, 140, 3, 2, 2, 2, 143, 142, 3, 2, 2, 2, 144, 9, 3, 2, 2, 2, 145, 146, 4, 50, 59, 2, 146, 11, 3, 2, 2, 2, 147, 149, 5, 10, 4, 2, 148, 147, 3, 2, 2, 2, 149, 150, 3, 2, 2, 2, 150, 148, 3, 2, 2, 2, 150, 151, 3, 2, 2, 2, 151, 13, 3, 2, 2, 2, 152, 153, 4, 51, 59, 2, 153, 15, 3, 2, 2, 2, 154, 160, 7, 50, 2, 2, 155, 157, 5, 14, 6, 2, 156, 158, 5, 12, 5, 2, 157, 156, 3, 2, 2, 2, 157, 158, 3, 2, 2, 2, 158, 160, 3, 2, 2, 2, 159, 154, 3, 2, 2, 2, 159, 155, 3, 2, 2, 2, 160, 17, 3, 2, 2, 2, 161, 162, 9, 4, 2, 2, 162, 163, 5, 20, 9, 2, 163, 19, 3, 2, 2, 2, 164, 166, 9, 5, 2, 2, 165, 164, 3, 2, 2, 2, 165, 166, 3, 2, 2, 2, 166, 167, 3, 2, 2, 2, 167, 168, 5, 12, 5, 2, 168, 21, 3, 2, 2, 2, 169, 174, 7, 94, 2, 2, 170, 175, 9, 6, 2, 2, 171, 172, 7, 94, 2, 2, 172, 175, 7, 36, 2, 2, 173, 175, 9, 7, 2, 2, 174, 170, 3, 2, 2, 2, 174, 171, 3, 2, 2, 2, 174, 173, 3, 2, 2, 2, 175, 178, 3, 2, 2, 2, 176, 178, 5, 26, 12, 2, 177, 169, 3, 2, 2, 2, 177, 176, 3, 2, 2, 2, 178, 23, 3, 2, 2, 2, 179, 180, 9, 8, 2, 2, 180, 25, 3, 2, 2, 2, 181, 182, 7, 94, 2, 2, 182, 183, 7, 119, 2, 2, 183, 184, 5, 24, 11, 2, 184, 185, 5, 24, 11, 2, 185, 186, 5, 24, 11, 2, 186, 187, 5, 24, 11, 2, 187, 27, 3, 2, 2, 2, 188, 189, 7, 41, 2, 2, 189, 190, 3, 2, 2, 2, 190, 191, 8, 13, 3, 2, 191, 29, 3, 2, 2, 2, 192, 193, 7, 36, 2, 2, 193, 194, 3, 2, 2, 2, 194, 195, 8, 14, 4, 2, 195, 31, 3, 2, 2, 2, 196, 197, 5, 16, 7, 2, 197, 33, 3, 2, 2, 2, 198, 199, 5, 16, 7, 2, 199, 200, 7, 48, 2, 2, 200, 202, 5, 12, 5, 2, 201, 203, 5, 18, 8, 2, 202, 201, 3, 2, 2, 2, 202, 203, 3, 2, 2, 2, 203, 208, 3, 2, 2, 2, 204, 205, 5, 16, 7, 2, 205, 206, 5, 18, 8, 2, 206, 208, 3, 2, 2, 2, 207, 198, 3, 2, 2, 2, 207, 204, 3, 2, 2, 2, 208, 35, 3, 2, 2, 2, 209, 210, 7, 50, 2, 2, 210, 211, 5, 12, 5, 2, 211, 37, 3, 2, 2, 2, 212, 213, 9, 9, 2, 2, 213, 214, 9, 10, 2, 2, 214, 215, 9, 11, 2, 2, 215, 39, 3, 2, 2, 2, 216, 217, 9, 12, 2, 2, 217, 218, 9, 4, 2, 2, 218, 219, 9, 13, 2, 2, 219, 220, 9, 14, 2, 2, 220, 221, 9, 4, 2, 2, 221, 222, 9, 4, 2, 2, 222, 223, 9, 10, 2, 2, 223, 41, 3, 2, 2, 2, 224, 225, 9, 11, 2, 2, 225, 226, 9, 9, 2, 2, 226, 227, 9, 13, 2, 2, 227, 228, 9, 4, 2, 2, 228, 43, 3, 2, 2, 2, 229, 230, 9, 11, 2, 2, 230, 231, 9, 9, 2, 2, 231, 232, 9, 15, 2, 2, 232, 233, 9, 16, 2, 2, 233, 45, 3, 2, 2, 2, 234, 235, 9, 4, 2, 2, 235, 236, 9, 17, 2, 2, 236, 237, 9, 18, 2, 2, 237, 238, 9, 13, 2, 2, 238, 239, 9, 15, 2, 2, 239, 47, 3, 2, 2, 2, 240, 241, 9, 19, 2, 2, 241, 242, 9, 9, 2, 2, 242, 243, 9, 20, 2, 2, 243, 244, 9, 16, 2, 2, 244, 245, 9, 4, 2, 2, 245, 49, 3, 2, 2, 2, 246, 247, 9, 21, 2, 2, 247, 248, 9, 22, 2, 2, 248, 249, 9, 23, 2, 2, 249, 250, 9, 24, 2, 2, 250, 251, 9, 16, 2, 2, 251, 51, 3, 2, 2, 2, 252, 253, 9, 25, 2, 2, 253, 254, 9, 10, 2, 2, 254, 53, 3, 2, 2, 2, 255, 256, 9, 25, 2, 2, 256, 257, 9, 10, 2, 2, 257, 258, 9, 13, 2, 2, 258, 259, 9, 4, 2, 2, 259, 260, 9, 24, 2, 2, 260, 261, 9, 26, 2, 2, 261, 262, 9, 9, 2, 2, 262, 263, 9, 20, 2, 2, 263, 55, 3, 2, 2, 2, 264, 265, 9, 25, 2, 2, 265, 266, 9, 16, 2, 2, 266, 57, 3, 2, 2, 2, 267, 268, 9, 17, 2, 2, 268, 269, 9, 25, 2, 2, 269, 270, 9, 10, 2, 2, 270, 271, 9, 23, 2, 2, 271, 272, 9, 13, 2, 2, 272, 273, 9, 4, 2, 2, 273, 274, 9, 16, 2, 2, 274, 59, 3, 2, 2, 2, 275, 276, 9, 17, 2, 2, 276, 277, 9, 22, 2, 2, 277, 278, 9, 10, 2, 2, 278, 279, 9, 13, 2, 2, 279, 280, 9, 21, 2, 2, 280, 281, 9, 16, 2, 2, 281, 61, 3, 2, 2, 2, 282, 283, 9, 10, 2, 2, 283, 284, 9, 22, 2, 2, 284, 285, 9, 13, 2, 2, 285, 63, 3, 2, 2, 2, 286, 287, 9, 10, 2, 2, 287, 288, 9, 23, 2, 2, 288, 289, 9, 20, 2, 2, 289, 290, 9, 20, 2, 2, 290, 65, 3, 2, 2, 2, 291, 292, 9, 22, 2, 2, 292, 293, 9, 24, 2, 2, 293, 67, 3, 2, 2, 2, 294, 295, 9, 16, 2, 2, 295, 296, 9, 4, 2, 2, 296, 297, 9, 27, 2, 2, 297, 298, 9, 22, 2, 2, 298, 299, 9, 10, 2, 2, 299, 300, 9, 11, 2, 2, 300, 301, 9, 16, 2, 2, 301, 69, 3, 2, 2, 2, 302, 303, 9, 13, 2, 2, 303, 304, 9, 25, 2, 2, 304, 305, 9, 17, 2, 2, 305, 306, 9, 4, 2, 2, 306, 71, 3, 2, 2, 2, 307, 308, 9, 13, 2, 2, 308, 309, 9, 25, 2, 2, 309, 310, 9, 17, 2, 2, 310, 311, 9, 4, 2, 2, 311, 312, 9, 16, 2, 2, 312, 313, 9, 13, 2, 2, 313, 314, 9, 9, 2, 2, 314, 315, 9, 17, 2, 2, 315, 316, 9, 18, 2, 2, 316, 73, 3, 2, 2, 2, 317, 318, 9, 13, 2, 2, 318, 319, 9, 24, 2, 2, 319, 320, 9, 23, 2, 2, 320, 321, 9, 4, 2, 2, 321, 75, 3, 2, 2, 2, 322, 323, 9, 15, 2, 2, 323, 324, 9, 4, 2, 2, 324, 325, 9, 9, 2, 2, 325, 326, 9, 24, 2, 2, 326, 327, 9, 16, 2, 2, 327, 77, 3, 2, 2, 2, 328, 329, 7, 62, 2, 2, 329, 79, 3, 2, 2, 2, 330, 331, 7, 62, 2, 2, 331, 332, 7, 63, 2, 2, 332, 81, 3, 2, 2, 2, 333, 334, 7, 64, 2, 2, 334, 83, 3, 2, 2, 2, 335, 336, 7, 64, 2, 2, 336, 337, 7, 63, 2, 2, 337, 85, 3, 2, 2, 2, 338, 339, 7, 63, 2, 2, 339, 87, 3, 2, 2, 2, 340, 341, 7, 35, 2, 2, 341, 345, 7, 63, 2, 2, 342, 343, 7, 62, 2, 2, 343, 345, 7, 64, 2, 2, 344, 340, 3, 2, 2, 2, 344, 342, 3, 2, 2, 2, 345, 89, 3, 2, 2, 2, 346, 347, 7, 45, 2, 2, 347, 91, 3, 2, 2, 2, 348, 349, 7, 47, 2, 2, 349, 93, 3, 2, 2, 2, 350, 351, 7, 44, 2, 2, 351, 95, 3, 2, 2, 2, 352, 353, 7, 49, 2, 2, 353, 97, 3, 2, 2, 2, 354, 355, 7, 39, 2, 2, 355, 99, 3, 2, 2, 2, 356, 357, 7, 42, 2, 2, 357, 101, 3, 2, 2, 2, 358, 359, 7, 43, 2, 2, 359, 103, 3, 2, 2, 2, 360, 361, 7, 93, 2, 2, 361, 105, 3, 2, 2, 2, 362, 363, 7, 95, 2, 2, 363, 107, 3, 2, 2, 2, 364, 365, 7, 46, 2, 2, 365, 109, 3, 2, 2, 2, 366, 367, 7, 48, 2, 2, 367, 111, 3, 2, 2, 2, 368, 369, 7, 60, 2, 2, 369, 113, 3, 2, 2, 2, 370, 371, 7, 35, 2, 2, 371, 115, 3, 2, 2, 2, 372, 376, 9, 28, 2, 2, 373, 375, 9, 29, 2, 2, 374, 373, 3, 2, 2, 2, 375, 378, 3, 2, 2, 2, 376, 374, 3, 2, 2, 2, 376, 377, 3, 2, 2, 2, 377, 117, 3, 2, 2, 2, 378, 376, 3, 2, 2, 2, 379, 384, 7, 98, 2, 2, 380, 383, 5, 22, 10, 2, 381, 383, 10, 30, 2, 2, 382, 380, 3, 2, 2, 2, 382, 381, 3, 2, 2, 2, 383, 386, 3, 2, 2, 2, 384, 382, 3, 2, 2, 2, 384, 385, 3, 2, 2, 2, 385, 387, 3, 2, 2, 2, 386, 384, 3, 2, 2, 2, 387, 388, 7, 98, 2, 2, 388, 389, 8, 58, 5, 2, 389, 119, 3, 2, 2, 2, 390, 391, 7, 127, 2, 2, 391, 392, 3, 2, 2, 2, 392, 393, 8, 59, 6, 2, 393, 121, 3, 2, 2, 2, 394, 395, 7, 37, 2, 2, 395, 396, 7, 125, 2, 2, 396, 397, 3, 2, 2, 2, 397, 398, 8, 60, 7, 2, 398, 123, 3, 2, 2, 2, 399, 400, 7, 94, 2, 2, 400, 401, 7, 37, 2, 2, 401, 406, 7, 125, 2, 2, 402, 406, 10, 31, 2, 2, 403, 404, 7, 37, 2, 2, 404, 406, 6, 61, 2, 2, 405, 399, 3, 2, 2, 2, 405, 402, 3, 2, 2, 2, 405, 403, 3, 2, 2, 2, 406, 407, 3, 2, 2, 2, 407, 405, 3, 2, 2, 2, 407, 408, 3, 2, 2, 2, 408, 409, 3, 2, 2, 2, 409, 410, 8, 61, 8, 2, 410, 125, 3, 2, 2, 2, 411, 422, 5, 8, 3, 2, 412, 415, 5, 22, 10, 2, 413, 415, 10, 32, 2, 2, 414, 412, 3, 2, 2, 2, 414, 413, 3, 2, 2, 2, 415, 416, 3, 2, 2, 2, 416, 414, 3, 2, 2, 2, 416, 417, 3, 2, 2, 2, 417, 419, 3, 2, 2, 2, 418, 420, 5, 8, 3, 2, 419, 418, 3, 2, 2, 2, 419, 420, 3, 2, 2, 2, 420, 422, 3, 2, 2, 2, 421, 411, 3, 2, 2, 2, 421, 414, 3, 2, 2, 2, 422, 127, 3, 2, 2, 2, 423, 424, 7, 41, 2, 2, 424, 425, 3, 2, 2, 2, 425, 426, 8, 63, 7, 2, 426, 129, 3, 2, 2, 2, 427, 438, 5, 8, 3, 2, 428, 431, 5, 22, 10, 2, 429, 431, 10, 33, 2, 2, 430, 428, 3, 2, 2, 2, 430, 429, 3, 2, 2, 2, 431, 432, 3, 2, 2, 2, 432, 430, 3, 2, 2, 2, 432, 433, 3, 2, 2, 2, 433, 435, 3, 2, 2, 2, 434, 436, 5, 8, 3, 2, 435, 434, 3, 2, 2, 2, 435, 436, 3, 2, 2, 2, 436, 438, 3, 2, 2, 2, 437, 427, 3, 2, 2, 2, 437, 430, 3, 2, 2, 2, 438, 131, 3, 2, 2, 2, 439, 440, 7, 36, 2, 2, 440, 441, 3, 2, 2, 2, 441, 442, 8, 65, 7, 2, 442, 133, 3, 2, 2, 2, 30, 2, 3, 4, 5, 136, 143, 150, 157, 159, 165, 174, 177, 202, 207, 344, 376, 382, 384, 405, 407, 414, 416, 419, 421, 430, 432, 435, 437, 9, 2, 3, 2, 7, 4, 2, 7, 5, 2, 3, 58, 2, 7, 3, 2, 6, 2, 2, 3, 61, 3] \ No newline at end of file +[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 2, 65, 512, 8, 1, 8, 1, 8, 1, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 3, 2, 3, 2, 5, 2, 155, 10, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 5, 3, 162, 10, 3, 3, 4, 3, 4, 3, 5, 6, 5, 167, 10, 5, 13, 5, 14, 5, 168, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 5, 7, 176, 10, 7, 5, 7, 178, 10, 7, 3, 8, 3, 8, 3, 8, 3, 9, 5, 9, 184, 10, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 5, 10, 193, 10, 10, 3, 10, 5, 10, 196, 10, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 5, 16, 221, 10, 16, 3, 16, 3, 16, 3, 16, 5, 16, 226, 10, 16, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 47, 3, 47, 3, 48, 3, 48, 3, 48, 3, 49, 3, 49, 3, 50, 3, 50, 3, 50, 3, 51, 3, 51, 3, 52, 3, 52, 3, 52, 3, 52, 5, 52, 414, 10, 52, 3, 53, 3, 53, 3, 54, 3, 54, 3, 55, 3, 55, 3, 56, 3, 56, 3, 57, 3, 57, 3, 58, 3, 58, 3, 59, 3, 59, 3, 60, 3, 60, 3, 61, 3, 61, 3, 62, 3, 62, 3, 63, 3, 63, 3, 64, 3, 64, 3, 65, 3, 65, 3, 66, 3, 66, 7, 66, 444, 10, 66, 12, 66, 14, 66, 447, 11, 66, 3, 67, 3, 67, 3, 67, 7, 67, 452, 10, 67, 12, 67, 14, 67, 455, 11, 67, 3, 67, 3, 67, 3, 67, 3, 68, 3, 68, 3, 68, 3, 68, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 6, 70, 475, 10, 70, 13, 70, 14, 70, 476, 3, 70, 3, 70, 3, 71, 3, 71, 3, 71, 6, 71, 484, 10, 71, 13, 71, 14, 71, 485, 3, 71, 5, 71, 489, 10, 71, 5, 71, 491, 10, 71, 3, 72, 3, 72, 3, 72, 3, 72, 3, 73, 3, 73, 3, 73, 6, 73, 500, 10, 73, 13, 73, 14, 73, 501, 3, 73, 5, 73, 505, 10, 73, 5, 73, 507, 10, 73, 3, 74, 3, 74, 3, 74, 3, 74, 2, 2, 2, 75, 6, 2, 3, 8, 2, 2, 10, 2, 2, 12, 2, 2, 14, 2, 2, 16, 2, 2, 18, 2, 2, 20, 2, 2, 22, 2, 2, 24, 2, 2, 26, 2, 2, 28, 2, 4, 30, 2, 5, 32, 2, 6, 34, 2, 7, 36, 2, 8, 38, 2, 9, 40, 2, 10, 42, 2, 11, 44, 2, 12, 46, 2, 13, 48, 2, 14, 50, 2, 15, 52, 2, 16, 54, 2, 17, 56, 2, 18, 58, 2, 19, 60, 2, 20, 62, 2, 21, 64, 2, 22, 66, 2, 23, 68, 2, 24, 70, 2, 25, 72, 2, 26, 74, 2, 27, 76, 2, 28, 78, 2, 29, 80, 2, 30, 82, 2, 31, 84, 2, 32, 86, 2, 33, 88, 2, 34, 90, 2, 35, 92, 2, 36, 94, 2, 37, 96, 2, 38, 98, 2, 39, 100, 2, 40, 102, 2, 41, 104, 2, 42, 106, 2, 43, 108, 2, 44, 110, 2, 45, 112, 2, 46, 114, 2, 47, 116, 2, 48, 118, 2, 49, 120, 2, 50, 122, 2, 51, 124, 2, 52, 126, 2, 53, 128, 2, 54, 130, 2, 55, 132, 2, 56, 134, 2, 57, 136, 2, 58, 138, 2, 59, 140, 2, 60, 142, 2, 61, 144, 2, 62, 146, 2, 63, 148, 2, 64, 150, 2, 65, 6, 2, 3, 4, 5, 36, 5, 2, 11, 11, 14, 14, 34, 34, 4, 2, 12, 12, 15, 15, 4, 2, 71, 71, 103, 103, 4, 2, 45, 45, 47, 47, 7, 2, 100, 100, 104, 104, 112, 112, 116, 116, 118, 118, 4, 2, 41, 41, 94, 94, 5, 2, 50, 59, 67, 72, 99, 104, 4, 2, 67, 67, 99, 99, 4, 2, 80, 80, 112, 112, 4, 2, 70, 70, 102, 102, 4, 2, 68, 68, 100, 100, 4, 2, 86, 86, 118, 118, 4, 2, 89, 89, 121, 121, 4, 2, 91, 91, 123, 123, 4, 2, 85, 85, 117, 117, 4, 2, 75, 75, 107, 107, 4, 2, 69, 69, 101, 101, 4, 2, 79, 79, 111, 111, 4, 2, 82, 82, 114, 114, 4, 2, 72, 72, 104, 104, 4, 2, 78, 78, 110, 110, 4, 2, 84, 84, 116, 116, 4, 2, 81, 81, 113, 113, 4, 2, 87, 87, 119, 119, 4, 2, 74, 74, 106, 106, 4, 2, 88, 88, 120, 120, 4, 2, 76, 76, 108, 108, 4, 2, 73, 73, 105, 105, 7, 2, 38, 38, 67, 92, 97, 97, 99, 124, 130, 0, 8, 2, 38, 38, 50, 59, 67, 92, 97, 97, 99, 124, 130, 0, 6, 2, 12, 12, 15, 15, 94, 94, 98, 98, 3, 2, 37, 37, 6, 2, 12, 12, 15, 15, 41, 41, 94, 94, 6, 2, 12, 12, 15, 15, 36, 36, 94, 94, 2, 524, 2, 6, 3, 2, 2, 2, 2, 28, 3, 2, 2, 2, 2, 30, 3, 2, 2, 2, 2, 32, 3, 2, 2, 2, 2, 34, 3, 2, 2, 2, 2, 36, 3, 2, 2, 2, 2, 38, 3, 2, 2, 2, 2, 40, 3, 2, 2, 2, 2, 42, 3, 2, 2, 2, 2, 44, 3, 2, 2, 2, 2, 46, 3, 2, 2, 2, 2, 48, 3, 2, 2, 2, 2, 50, 3, 2, 2, 2, 2, 52, 3, 2, 2, 2, 2, 54, 3, 2, 2, 2, 2, 56, 3, 2, 2, 2, 2, 58, 3, 2, 2, 2, 2, 60, 3, 2, 2, 2, 2, 62, 3, 2, 2, 2, 2, 64, 3, 2, 2, 2, 2, 66, 3, 2, 2, 2, 2, 68, 3, 2, 2, 2, 2, 70, 3, 2, 2, 2, 2, 72, 3, 2, 2, 2, 2, 74, 3, 2, 2, 2, 2, 76, 3, 2, 2, 2, 2, 78, 3, 2, 2, 2, 2, 80, 3, 2, 2, 2, 2, 82, 3, 2, 2, 2, 2, 84, 3, 2, 2, 2, 2, 86, 3, 2, 2, 2, 2, 88, 3, 2, 2, 2, 2, 90, 3, 2, 2, 2, 2, 92, 3, 2, 2, 2, 2, 94, 3, 2, 2, 2, 2, 96, 3, 2, 2, 2, 2, 98, 3, 2, 2, 2, 2, 100, 3, 2, 2, 2, 2, 102, 3, 2, 2, 2, 2, 104, 3, 2, 2, 2, 2, 106, 3, 2, 2, 2, 2, 108, 3, 2, 2, 2, 2, 110, 3, 2, 2, 2, 2, 112, 3, 2, 2, 2, 2, 114, 3, 2, 2, 2, 2, 116, 3, 2, 2, 2, 2, 118, 3, 2, 2, 2, 2, 120, 3, 2, 2, 2, 2, 122, 3, 2, 2, 2, 2, 124, 3, 2, 2, 2, 2, 126, 3, 2, 2, 2, 2, 128, 3, 2, 2, 2, 2, 130, 3, 2, 2, 2, 2, 132, 3, 2, 2, 2, 2, 134, 3, 2, 2, 2, 2, 136, 3, 2, 2, 2, 2, 138, 3, 2, 2, 2, 3, 140, 3, 2, 2, 2, 3, 142, 3, 2, 2, 2, 4, 144, 3, 2, 2, 2, 4, 146, 3, 2, 2, 2, 5, 148, 3, 2, 2, 2, 5, 150, 3, 2, 2, 2, 6, 154, 3, 2, 2, 2, 8, 161, 3, 2, 2, 2, 10, 163, 3, 2, 2, 2, 12, 166, 3, 2, 2, 2, 14, 170, 3, 2, 2, 2, 16, 177, 3, 2, 2, 2, 18, 179, 3, 2, 2, 2, 20, 183, 3, 2, 2, 2, 22, 195, 3, 2, 2, 2, 24, 197, 3, 2, 2, 2, 26, 199, 3, 2, 2, 2, 28, 206, 3, 2, 2, 2, 30, 210, 3, 2, 2, 2, 32, 214, 3, 2, 2, 2, 34, 225, 3, 2, 2, 2, 36, 227, 3, 2, 2, 2, 38, 230, 3, 2, 2, 2, 40, 234, 3, 2, 2, 2, 42, 242, 3, 2, 2, 2, 44, 247, 3, 2, 2, 2, 46, 252, 3, 2, 2, 2, 48, 261, 3, 2, 2, 2, 50, 267, 3, 2, 2, 2, 52, 273, 3, 2, 2, 2, 54, 278, 3, 2, 2, 2, 56, 283, 3, 2, 2, 2, 58, 289, 3, 2, 2, 2, 60, 292, 3, 2, 2, 2, 62, 301, 3, 2, 2, 2, 64, 304, 3, 2, 2, 2, 66, 309, 3, 2, 2, 2, 68, 314, 3, 2, 2, 2, 70, 322, 3, 2, 2, 2, 72, 329, 3, 2, 2, 2, 74, 333, 3, 2, 2, 2, 76, 338, 3, 2, 2, 2, 78, 341, 3, 2, 2, 2, 80, 344, 3, 2, 2, 2, 82, 350, 3, 2, 2, 2, 84, 358, 3, 2, 2, 2, 86, 365, 3, 2, 2, 2, 88, 370, 3, 2, 2, 2, 90, 380, 3, 2, 2, 2, 92, 385, 3, 2, 2, 2, 94, 391, 3, 2, 2, 2, 96, 397, 3, 2, 2, 2, 98, 399, 3, 2, 2, 2, 100, 402, 3, 2, 2, 2, 102, 404, 3, 2, 2, 2, 104, 407, 3, 2, 2, 2, 106, 413, 3, 2, 2, 2, 108, 415, 3, 2, 2, 2, 110, 417, 3, 2, 2, 2, 112, 419, 3, 2, 2, 2, 114, 421, 3, 2, 2, 2, 116, 423, 3, 2, 2, 2, 118, 425, 3, 2, 2, 2, 120, 427, 3, 2, 2, 2, 122, 429, 3, 2, 2, 2, 124, 431, 3, 2, 2, 2, 126, 433, 3, 2, 2, 2, 128, 435, 3, 2, 2, 2, 130, 437, 3, 2, 2, 2, 132, 439, 3, 2, 2, 2, 134, 441, 3, 2, 2, 2, 136, 448, 3, 2, 2, 2, 138, 459, 3, 2, 2, 2, 140, 463, 3, 2, 2, 2, 142, 474, 3, 2, 2, 2, 144, 490, 3, 2, 2, 2, 146, 492, 3, 2, 2, 2, 148, 506, 3, 2, 2, 2, 150, 508, 3, 2, 2, 2, 152, 155, 9, 2, 2, 2, 153, 155, 5, 8, 3, 2, 154, 152, 3, 2, 2, 2, 154, 153, 3, 2, 2, 2, 155, 156, 3, 2, 2, 2, 156, 157, 8, 2, 2, 2, 157, 7, 3, 2, 2, 2, 158, 159, 7, 15, 2, 2, 159, 162, 7, 12, 2, 2, 160, 162, 9, 3, 2, 2, 161, 158, 3, 2, 2, 2, 161, 160, 3, 2, 2, 2, 162, 9, 3, 2, 2, 2, 163, 164, 4, 50, 59, 2, 164, 11, 3, 2, 2, 2, 165, 167, 5, 10, 4, 2, 166, 165, 3, 2, 2, 2, 167, 168, 3, 2, 2, 2, 168, 166, 3, 2, 2, 2, 168, 169, 3, 2, 2, 2, 169, 13, 3, 2, 2, 2, 170, 171, 4, 51, 59, 2, 171, 15, 3, 2, 2, 2, 172, 178, 7, 50, 2, 2, 173, 175, 5, 14, 6, 2, 174, 176, 5, 12, 5, 2, 175, 174, 3, 2, 2, 2, 175, 176, 3, 2, 2, 2, 176, 178, 3, 2, 2, 2, 177, 172, 3, 2, 2, 2, 177, 173, 3, 2, 2, 2, 178, 17, 3, 2, 2, 2, 179, 180, 9, 4, 2, 2, 180, 181, 5, 20, 9, 2, 181, 19, 3, 2, 2, 2, 182, 184, 9, 5, 2, 2, 183, 182, 3, 2, 2, 2, 183, 184, 3, 2, 2, 2, 184, 185, 3, 2, 2, 2, 185, 186, 5, 12, 5, 2, 186, 21, 3, 2, 2, 2, 187, 192, 7, 94, 2, 2, 188, 193, 9, 6, 2, 2, 189, 190, 7, 94, 2, 2, 190, 193, 7, 36, 2, 2, 191, 193, 9, 7, 2, 2, 192, 188, 3, 2, 2, 2, 192, 189, 3, 2, 2, 2, 192, 191, 3, 2, 2, 2, 193, 196, 3, 2, 2, 2, 194, 196, 5, 26, 12, 2, 195, 187, 3, 2, 2, 2, 195, 194, 3, 2, 2, 2, 196, 23, 3, 2, 2, 2, 197, 198, 9, 8, 2, 2, 198, 25, 3, 2, 2, 2, 199, 200, 7, 94, 2, 2, 200, 201, 7, 119, 2, 2, 201, 202, 5, 24, 11, 2, 202, 203, 5, 24, 11, 2, 203, 204, 5, 24, 11, 2, 204, 205, 5, 24, 11, 2, 205, 27, 3, 2, 2, 2, 206, 207, 7, 41, 2, 2, 207, 208, 3, 2, 2, 2, 208, 209, 8, 13, 3, 2, 209, 29, 3, 2, 2, 2, 210, 211, 7, 36, 2, 2, 211, 212, 3, 2, 2, 2, 212, 213, 8, 14, 4, 2, 213, 31, 3, 2, 2, 2, 214, 215, 5, 16, 7, 2, 215, 33, 3, 2, 2, 2, 216, 217, 5, 16, 7, 2, 217, 218, 7, 48, 2, 2, 218, 220, 5, 12, 5, 2, 219, 221, 5, 18, 8, 2, 220, 219, 3, 2, 2, 2, 220, 221, 3, 2, 2, 2, 221, 226, 3, 2, 2, 2, 222, 223, 5, 16, 7, 2, 223, 224, 5, 18, 8, 2, 224, 226, 3, 2, 2, 2, 225, 216, 3, 2, 2, 2, 225, 222, 3, 2, 2, 2, 226, 35, 3, 2, 2, 2, 227, 228, 7, 50, 2, 2, 228, 229, 5, 12, 5, 2, 229, 37, 3, 2, 2, 2, 230, 231, 9, 9, 2, 2, 231, 232, 9, 10, 2, 2, 232, 233, 9, 11, 2, 2, 233, 39, 3, 2, 2, 2, 234, 235, 9, 12, 2, 2, 235, 236, 9, 4, 2, 2, 236, 237, 9, 13, 2, 2, 237, 238, 9, 14, 2, 2, 238, 239, 9, 4, 2, 2, 239, 240, 9, 4, 2, 2, 240, 241, 9, 10, 2, 2, 241, 41, 3, 2, 2, 2, 242, 243, 9, 11, 2, 2, 243, 244, 9, 9, 2, 2, 244, 245, 9, 13, 2, 2, 245, 246, 9, 4, 2, 2, 246, 43, 3, 2, 2, 2, 247, 248, 9, 11, 2, 2, 248, 249, 9, 9, 2, 2, 249, 250, 9, 15, 2, 2, 250, 251, 9, 16, 2, 2, 251, 45, 3, 2, 2, 2, 252, 253, 9, 11, 2, 2, 253, 254, 9, 17, 2, 2, 254, 255, 9, 16, 2, 2, 255, 256, 9, 13, 2, 2, 256, 257, 9, 17, 2, 2, 257, 258, 9, 10, 2, 2, 258, 259, 9, 18, 2, 2, 259, 260, 9, 13, 2, 2, 260, 47, 3, 2, 2, 2, 261, 262, 9, 4, 2, 2, 262, 263, 9, 19, 2, 2, 263, 264, 9, 20, 2, 2, 264, 265, 9, 13, 2, 2, 265, 266, 9, 15, 2, 2, 266, 49, 3, 2, 2, 2, 267, 268, 9, 21, 2, 2, 268, 269, 9, 9, 2, 2, 269, 270, 9, 22, 2, 2, 270, 271, 9, 16, 2, 2, 271, 272, 9, 4, 2, 2, 272, 51, 3, 2, 2, 2, 273, 274, 9, 21, 2, 2, 274, 275, 9, 23, 2, 2, 275, 276, 9, 24, 2, 2, 276, 277, 9, 19, 2, 2, 277, 53, 3, 2, 2, 2, 278, 279, 9, 21, 2, 2, 279, 280, 9, 25, 2, 2, 280, 281, 9, 22, 2, 2, 281, 282, 9, 22, 2, 2, 282, 55, 3, 2, 2, 2, 283, 284, 9, 26, 2, 2, 284, 285, 9, 24, 2, 2, 285, 286, 9, 25, 2, 2, 286, 287, 9, 23, 2, 2, 287, 288, 9, 16, 2, 2, 288, 57, 3, 2, 2, 2, 289, 290, 9, 17, 2, 2, 290, 291, 9, 10, 2, 2, 291, 59, 3, 2, 2, 2, 292, 293, 9, 17, 2, 2, 293, 294, 9, 10, 2, 2, 294, 295, 9, 13, 2, 2, 295, 296, 9, 4, 2, 2, 296, 297, 9, 23, 2, 2, 297, 298, 9, 27, 2, 2, 298, 299, 9, 9, 2, 2, 299, 300, 9, 22, 2, 2, 300, 61, 3, 2, 2, 2, 301, 302, 9, 17, 2, 2, 302, 303, 9, 16, 2, 2, 303, 63, 3, 2, 2, 2, 304, 305, 9, 28, 2, 2, 305, 306, 9, 24, 2, 2, 306, 307, 9, 17, 2, 2, 307, 308, 9, 10, 2, 2, 308, 65, 3, 2, 2, 2, 309, 310, 9, 22, 2, 2, 310, 311, 9, 4, 2, 2, 311, 312, 9, 21, 2, 2, 312, 313, 9, 13, 2, 2, 313, 67, 3, 2, 2, 2, 314, 315, 9, 19, 2, 2, 315, 316, 9, 17, 2, 2, 316, 317, 9, 10, 2, 2, 317, 318, 9, 25, 2, 2, 318, 319, 9, 13, 2, 2, 319, 320, 9, 4, 2, 2, 320, 321, 9, 16, 2, 2, 321, 69, 3, 2, 2, 2, 322, 323, 9, 19, 2, 2, 323, 324, 9, 24, 2, 2, 324, 325, 9, 10, 2, 2, 325, 326, 9, 13, 2, 2, 326, 327, 9, 26, 2, 2, 327, 328, 9, 16, 2, 2, 328, 71, 3, 2, 2, 2, 329, 330, 9, 10, 2, 2, 330, 331, 9, 24, 2, 2, 331, 332, 9, 13, 2, 2, 332, 73, 3, 2, 2, 2, 333, 334, 9, 10, 2, 2, 334, 335, 9, 25, 2, 2, 335, 336, 9, 22, 2, 2, 336, 337, 9, 22, 2, 2, 337, 75, 3, 2, 2, 2, 338, 339, 9, 24, 2, 2, 339, 340, 9, 10, 2, 2, 340, 77, 3, 2, 2, 2, 341, 342, 9, 24, 2, 2, 342, 343, 9, 23, 2, 2, 343, 79, 3, 2, 2, 2, 344, 345, 9, 23, 2, 2, 345, 346, 9, 17, 2, 2, 346, 347, 9, 29, 2, 2, 347, 348, 9, 26, 2, 2, 348, 349, 9, 13, 2, 2, 349, 81, 3, 2, 2, 2, 350, 351, 9, 16, 2, 2, 351, 352, 9, 4, 2, 2, 352, 353, 9, 18, 2, 2, 353, 354, 9, 24, 2, 2, 354, 355, 9, 10, 2, 2, 355, 356, 9, 11, 2, 2, 356, 357, 9, 16, 2, 2, 357, 83, 3, 2, 2, 2, 358, 359, 9, 16, 2, 2, 359, 360, 9, 4, 2, 2, 360, 361, 9, 22, 2, 2, 361, 362, 9, 4, 2, 2, 362, 363, 9, 18, 2, 2, 363, 364, 9, 13, 2, 2, 364, 85, 3, 2, 2, 2, 365, 366, 9, 13, 2, 2, 366, 367, 9, 17, 2, 2, 367, 368, 9, 19, 2, 2, 368, 369, 9, 4, 2, 2, 369, 87, 3, 2, 2, 2, 370, 371, 9, 13, 2, 2, 371, 372, 9, 17, 2, 2, 372, 373, 9, 19, 2, 2, 373, 374, 9, 4, 2, 2, 374, 375, 9, 16, 2, 2, 375, 376, 9, 13, 2, 2, 376, 377, 9, 9, 2, 2, 377, 378, 9, 19, 2, 2, 378, 379, 9, 20, 2, 2, 379, 89, 3, 2, 2, 2, 380, 381, 9, 13, 2, 2, 381, 382, 9, 23, 2, 2, 382, 383, 9, 25, 2, 2, 383, 384, 9, 4, 2, 2, 384, 91, 3, 2, 2, 2, 385, 386, 9, 14, 2, 2, 386, 387, 9, 26, 2, 2, 387, 388, 9, 4, 2, 2, 388, 389, 9, 23, 2, 2, 389, 390, 9, 4, 2, 2, 390, 93, 3, 2, 2, 2, 391, 392, 9, 15, 2, 2, 392, 393, 9, 4, 2, 2, 393, 394, 9, 9, 2, 2, 394, 395, 9, 23, 2, 2, 395, 396, 9, 16, 2, 2, 396, 95, 3, 2, 2, 2, 397, 398, 7, 62, 2, 2, 398, 97, 3, 2, 2, 2, 399, 400, 7, 62, 2, 2, 400, 401, 7, 63, 2, 2, 401, 99, 3, 2, 2, 2, 402, 403, 7, 64, 2, 2, 403, 101, 3, 2, 2, 2, 404, 405, 7, 64, 2, 2, 405, 406, 7, 63, 2, 2, 406, 103, 3, 2, 2, 2, 407, 408, 7, 63, 2, 2, 408, 105, 3, 2, 2, 2, 409, 410, 7, 35, 2, 2, 410, 414, 7, 63, 2, 2, 411, 412, 7, 62, 2, 2, 412, 414, 7, 64, 2, 2, 413, 409, 3, 2, 2, 2, 413, 411, 3, 2, 2, 2, 414, 107, 3, 2, 2, 2, 415, 416, 7, 45, 2, 2, 416, 109, 3, 2, 2, 2, 417, 418, 7, 47, 2, 2, 418, 111, 3, 2, 2, 2, 419, 420, 7, 44, 2, 2, 420, 113, 3, 2, 2, 2, 421, 422, 7, 49, 2, 2, 422, 115, 3, 2, 2, 2, 423, 424, 7, 39, 2, 2, 424, 117, 3, 2, 2, 2, 425, 426, 7, 42, 2, 2, 426, 119, 3, 2, 2, 2, 427, 428, 7, 43, 2, 2, 428, 121, 3, 2, 2, 2, 429, 430, 7, 93, 2, 2, 430, 123, 3, 2, 2, 2, 431, 432, 7, 95, 2, 2, 432, 125, 3, 2, 2, 2, 433, 434, 7, 46, 2, 2, 434, 127, 3, 2, 2, 2, 435, 436, 7, 48, 2, 2, 436, 129, 3, 2, 2, 2, 437, 438, 7, 60, 2, 2, 438, 131, 3, 2, 2, 2, 439, 440, 7, 35, 2, 2, 440, 133, 3, 2, 2, 2, 441, 445, 9, 30, 2, 2, 442, 444, 9, 31, 2, 2, 443, 442, 3, 2, 2, 2, 444, 447, 3, 2, 2, 2, 445, 443, 3, 2, 2, 2, 445, 446, 3, 2, 2, 2, 446, 135, 3, 2, 2, 2, 447, 445, 3, 2, 2, 2, 448, 453, 7, 98, 2, 2, 449, 452, 5, 22, 10, 2, 450, 452, 10, 32, 2, 2, 451, 449, 3, 2, 2, 2, 451, 450, 3, 2, 2, 2, 452, 455, 3, 2, 2, 2, 453, 451, 3, 2, 2, 2, 453, 454, 3, 2, 2, 2, 454, 456, 3, 2, 2, 2, 455, 453, 3, 2, 2, 2, 456, 457, 7, 98, 2, 2, 457, 458, 8, 67, 5, 2, 458, 137, 3, 2, 2, 2, 459, 460, 7, 127, 2, 2, 460, 461, 3, 2, 2, 2, 461, 462, 8, 68, 6, 2, 462, 139, 3, 2, 2, 2, 463, 464, 7, 37, 2, 2, 464, 465, 7, 125, 2, 2, 465, 466, 3, 2, 2, 2, 466, 467, 8, 69, 7, 2, 467, 141, 3, 2, 2, 2, 468, 469, 7, 94, 2, 2, 469, 470, 7, 37, 2, 2, 470, 475, 7, 125, 2, 2, 471, 475, 10, 33, 2, 2, 472, 473, 7, 37, 2, 2, 473, 475, 6, 70, 2, 2, 474, 468, 3, 2, 2, 2, 474, 471, 3, 2, 2, 2, 474, 472, 3, 2, 2, 2, 475, 476, 3, 2, 2, 2, 476, 474, 3, 2, 2, 2, 476, 477, 3, 2, 2, 2, 477, 478, 3, 2, 2, 2, 478, 479, 8, 70, 8, 2, 479, 143, 3, 2, 2, 2, 480, 491, 5, 8, 3, 2, 481, 484, 5, 22, 10, 2, 482, 484, 10, 34, 2, 2, 483, 481, 3, 2, 2, 2, 483, 482, 3, 2, 2, 2, 484, 485, 3, 2, 2, 2, 485, 483, 3, 2, 2, 2, 485, 486, 3, 2, 2, 2, 486, 488, 3, 2, 2, 2, 487, 489, 5, 8, 3, 2, 488, 487, 3, 2, 2, 2, 488, 489, 3, 2, 2, 2, 489, 491, 3, 2, 2, 2, 490, 480, 3, 2, 2, 2, 490, 483, 3, 2, 2, 2, 491, 145, 3, 2, 2, 2, 492, 493, 7, 41, 2, 2, 493, 494, 3, 2, 2, 2, 494, 495, 8, 72, 7, 2, 495, 147, 3, 2, 2, 2, 496, 507, 5, 8, 3, 2, 497, 500, 5, 22, 10, 2, 498, 500, 10, 35, 2, 2, 499, 497, 3, 2, 2, 2, 499, 498, 3, 2, 2, 2, 500, 501, 3, 2, 2, 2, 501, 499, 3, 2, 2, 2, 501, 502, 3, 2, 2, 2, 502, 504, 3, 2, 2, 2, 503, 505, 5, 8, 3, 2, 504, 503, 3, 2, 2, 2, 504, 505, 3, 2, 2, 2, 505, 507, 3, 2, 2, 2, 506, 496, 3, 2, 2, 2, 506, 499, 3, 2, 2, 2, 507, 149, 3, 2, 2, 2, 508, 509, 7, 36, 2, 2, 509, 510, 3, 2, 2, 2, 510, 511, 8, 74, 7, 2, 511, 151, 3, 2, 2, 2, 30, 2, 3, 4, 5, 154, 161, 168, 175, 177, 183, 192, 195, 220, 225, 413, 445, 451, 453, 474, 476, 483, 485, 488, 490, 499, 501, 504, 506, 9, 2, 3, 2, 7, 4, 2, 7, 5, 2, 3, 67, 2, 7, 3, 2, 6, 2, 2, 3, 70, 3] \ No newline at end of file diff --git a/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionLexer.tokens b/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionLexer.tokens index 7d9b433..a58c42d 100644 --- a/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionLexer.tokens +++ b/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionLexer.tokens @@ -8,67 +8,76 @@ AND=7 BETWEEN=8 DATE=9 DAYS=10 -EMPTY=11 -FALSE=12 -HOURS=13 -IN=14 -INTERVAL=15 -IS=16 -MINUTES=17 -MONTHS=18 -NOT=19 -NULL=20 -OR=21 -SECONDS=22 -TIME=23 -TIMESTAMP=24 -TRUE=25 -YEARS=26 -LESS=27 -LESS_EQUAL=28 -GREATER=29 -GREATER_EQUAL=30 -EQUAL=31 -NOT_EQUAL=32 -PLUS=33 -MINUS=34 -ASTERISK=35 -SLASH=36 -PERCENT=37 -LP=38 -RP=39 -LB=40 -RB=41 -COMMA=42 -DOT=43 -COLON=44 -EXCLAMATION_MARK=45 -IDENTIFIER=46 -QUOTED_IDENTIFIER=47 -EXPRESSION_END=48 -EXPRESSION_START=49 -TEXT=50 -TEXT_IN_QUOTE=51 -END_QUOTE=52 -TEXT_IN_DOUBLE_QUOTE=53 -END_DOUBLE_QUOTE=54 -'<'=27 -'<='=28 -'>'=29 -'>='=30 -'='=31 -'+'=33 -'-'=34 -'*'=35 -'/'=36 -'%'=37 -'('=38 -')'=39 -'['=40 -']'=41 -','=42 -'.'=43 -':'=44 -'!'=45 -'}'=48 -'#{'=49 +DISTINCT=11 +EMPTY=12 +FALSE=13 +FROM=14 +FULL=15 +HOURS=16 +IN=17 +INTERVAL=18 +IS=19 +JOIN=20 +LEFT=21 +MINUTES=22 +MONTHS=23 +NOT=24 +NULL=25 +ON=26 +OR=27 +RIGHT=28 +SECONDS=29 +SELECT=30 +TIME=31 +TIMESTAMP=32 +TRUE=33 +WHERE=34 +YEARS=35 +LESS=36 +LESS_EQUAL=37 +GREATER=38 +GREATER_EQUAL=39 +EQUAL=40 +NOT_EQUAL=41 +PLUS=42 +MINUS=43 +ASTERISK=44 +SLASH=45 +PERCENT=46 +LP=47 +RP=48 +LB=49 +RB=50 +COMMA=51 +DOT=52 +COLON=53 +EXCLAMATION_MARK=54 +IDENTIFIER=55 +QUOTED_IDENTIFIER=56 +EXPRESSION_END=57 +EXPRESSION_START=58 +TEXT=59 +TEXT_IN_QUOTE=60 +END_QUOTE=61 +TEXT_IN_DOUBLE_QUOTE=62 +END_DOUBLE_QUOTE=63 +'<'=36 +'<='=37 +'>'=38 +'>='=39 +'='=40 +'+'=42 +'-'=43 +'*'=44 +'/'=45 +'%'=46 +'('=47 +')'=48 +'['=49 +']'=50 +','=51 +'.'=52 +':'=53 +'!'=54 +'}'=57 +'#{'=58 diff --git a/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionLexer.ts b/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionLexer.ts index 5dd9ea8..5dbee55 100644 --- a/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionLexer.ts +++ b/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionLexer.ts @@ -29,50 +29,59 @@ export class BlazeExpressionLexer extends Lexer { public static readonly BETWEEN = 8; public static readonly DATE = 9; public static readonly DAYS = 10; - public static readonly EMPTY = 11; - public static readonly FALSE = 12; - public static readonly HOURS = 13; - public static readonly IN = 14; - public static readonly INTERVAL = 15; - public static readonly IS = 16; - public static readonly MINUTES = 17; - public static readonly MONTHS = 18; - public static readonly NOT = 19; - public static readonly NULL = 20; - public static readonly OR = 21; - public static readonly SECONDS = 22; - public static readonly TIME = 23; - public static readonly TIMESTAMP = 24; - public static readonly TRUE = 25; - public static readonly YEARS = 26; - public static readonly LESS = 27; - public static readonly LESS_EQUAL = 28; - public static readonly GREATER = 29; - public static readonly GREATER_EQUAL = 30; - public static readonly EQUAL = 31; - public static readonly NOT_EQUAL = 32; - public static readonly PLUS = 33; - public static readonly MINUS = 34; - public static readonly ASTERISK = 35; - public static readonly SLASH = 36; - public static readonly PERCENT = 37; - public static readonly LP = 38; - public static readonly RP = 39; - public static readonly LB = 40; - public static readonly RB = 41; - public static readonly COMMA = 42; - public static readonly DOT = 43; - public static readonly COLON = 44; - public static readonly EXCLAMATION_MARK = 45; - public static readonly IDENTIFIER = 46; - public static readonly QUOTED_IDENTIFIER = 47; - public static readonly EXPRESSION_END = 48; - public static readonly EXPRESSION_START = 49; - public static readonly TEXT = 50; - public static readonly TEXT_IN_QUOTE = 51; - public static readonly END_QUOTE = 52; - public static readonly TEXT_IN_DOUBLE_QUOTE = 53; - public static readonly END_DOUBLE_QUOTE = 54; + public static readonly DISTINCT = 11; + public static readonly EMPTY = 12; + public static readonly FALSE = 13; + public static readonly FROM = 14; + public static readonly FULL = 15; + public static readonly HOURS = 16; + public static readonly IN = 17; + public static readonly INTERVAL = 18; + public static readonly IS = 19; + public static readonly JOIN = 20; + public static readonly LEFT = 21; + public static readonly MINUTES = 22; + public static readonly MONTHS = 23; + public static readonly NOT = 24; + public static readonly NULL = 25; + public static readonly ON = 26; + public static readonly OR = 27; + public static readonly RIGHT = 28; + public static readonly SECONDS = 29; + public static readonly SELECT = 30; + public static readonly TIME = 31; + public static readonly TIMESTAMP = 32; + public static readonly TRUE = 33; + public static readonly WHERE = 34; + public static readonly YEARS = 35; + public static readonly LESS = 36; + public static readonly LESS_EQUAL = 37; + public static readonly GREATER = 38; + public static readonly GREATER_EQUAL = 39; + public static readonly EQUAL = 40; + public static readonly NOT_EQUAL = 41; + public static readonly PLUS = 42; + public static readonly MINUS = 43; + public static readonly ASTERISK = 44; + public static readonly SLASH = 45; + public static readonly PERCENT = 46; + public static readonly LP = 47; + public static readonly RP = 48; + public static readonly LB = 49; + public static readonly RB = 50; + public static readonly COMMA = 51; + public static readonly DOT = 52; + public static readonly COLON = 53; + public static readonly EXCLAMATION_MARK = 54; + public static readonly IDENTIFIER = 55; + public static readonly QUOTED_IDENTIFIER = 56; + public static readonly EXPRESSION_END = 57; + public static readonly EXPRESSION_START = 58; + public static readonly TEXT = 59; + public static readonly TEXT_IN_QUOTE = 60; + public static readonly END_QUOTE = 61; + public static readonly TEXT_IN_DOUBLE_QUOTE = 62; + public static readonly END_DOUBLE_QUOTE = 63; public static readonly TEMPLATE = 1; public static readonly QUOTE_STRING = 2; public static readonly DOUBLE_QUOTE_STRING = 3; @@ -91,11 +100,12 @@ export class BlazeExpressionLexer extends Lexer { "WS", "EOL", "DIGIT", "DIGITS", "DIGIT_NOT_ZERO", "INTEGER", "EXPONENT_PART", "SIGNED_INTEGER", "ESCAPE_SEQUENCE", "HEX_DIGIT", "UNICODE_ESCAPE", "START_QUOTE", "START_DOUBLE_QUOTE", "INTEGER_LITERAL", "NUMERIC_LITERAL", "LEADING_ZERO_INTEGER_LITERAL", - "AND", "BETWEEN", "DATE", "DAYS", "EMPTY", "FALSE", "HOURS", "IN", "INTERVAL", - "IS", "MINUTES", "MONTHS", "NOT", "NULL", "OR", "SECONDS", "TIME", "TIMESTAMP", - "TRUE", "YEARS", "LESS", "LESS_EQUAL", "GREATER", "GREATER_EQUAL", "EQUAL", - "NOT_EQUAL", "PLUS", "MINUS", "ASTERISK", "SLASH", "PERCENT", "LP", "RP", - "LB", "RB", "COMMA", "DOT", "COLON", "EXCLAMATION_MARK", "IDENTIFIER", + "AND", "BETWEEN", "DATE", "DAYS", "DISTINCT", "EMPTY", "FALSE", "FROM", + "FULL", "HOURS", "IN", "INTERVAL", "IS", "JOIN", "LEFT", "MINUTES", "MONTHS", + "NOT", "NULL", "ON", "OR", "RIGHT", "SECONDS", "SELECT", "TIME", "TIMESTAMP", + "TRUE", "WHERE", "YEARS", "LESS", "LESS_EQUAL", "GREATER", "GREATER_EQUAL", + "EQUAL", "NOT_EQUAL", "PLUS", "MINUS", "ASTERISK", "SLASH", "PERCENT", + "LP", "RP", "LB", "RB", "COMMA", "DOT", "COLON", "EXCLAMATION_MARK", "IDENTIFIER", "QUOTED_IDENTIFIER", "EXPRESSION_END", "EXPRESSION_START", "TEXT", "TEXT_IN_QUOTE", "END_QUOTE", "TEXT_IN_DOUBLE_QUOTE", "END_DOUBLE_QUOTE", ]; @@ -104,17 +114,19 @@ export class BlazeExpressionLexer extends Lexer { undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, - undefined, undefined, undefined, undefined, undefined, undefined, "'<'", - "'<='", "'>'", "'>='", "'='", undefined, "'+'", "'-'", "'*'", "'/'", "'%'", - "'('", "')'", "'['", "']'", "','", "'.'", "':'", "'!'", undefined, undefined, - "'}'", "'#{'", + undefined, undefined, undefined, undefined, undefined, undefined, undefined, + undefined, undefined, undefined, undefined, undefined, undefined, undefined, + undefined, "'<'", "'<='", "'>'", "'>='", "'='", undefined, "'+'", "'-'", + "'*'", "'/'", "'%'", "'('", "')'", "'['", "']'", "','", "'.'", "':'", + "'!'", undefined, undefined, "'}'", "'#{'", ]; private static readonly _SYMBOLIC_NAMES: Array = [ undefined, "WS", "START_QUOTE", "START_DOUBLE_QUOTE", "INTEGER_LITERAL", "NUMERIC_LITERAL", "LEADING_ZERO_INTEGER_LITERAL", "AND", "BETWEEN", "DATE", - "DAYS", "EMPTY", "FALSE", "HOURS", "IN", "INTERVAL", "IS", "MINUTES", - "MONTHS", "NOT", "NULL", "OR", "SECONDS", "TIME", "TIMESTAMP", "TRUE", - "YEARS", "LESS", "LESS_EQUAL", "GREATER", "GREATER_EQUAL", "EQUAL", "NOT_EQUAL", + "DAYS", "DISTINCT", "EMPTY", "FALSE", "FROM", "FULL", "HOURS", "IN", "INTERVAL", + "IS", "JOIN", "LEFT", "MINUTES", "MONTHS", "NOT", "NULL", "ON", "OR", + "RIGHT", "SECONDS", "SELECT", "TIME", "TIMESTAMP", "TRUE", "WHERE", "YEARS", + "LESS", "LESS_EQUAL", "GREATER", "GREATER_EQUAL", "EQUAL", "NOT_EQUAL", "PLUS", "MINUS", "ASTERISK", "SLASH", "PERCENT", "LP", "RP", "LB", "RB", "COMMA", "DOT", "COLON", "EXCLAMATION_MARK", "IDENTIFIER", "QUOTED_IDENTIFIER", "EXPRESSION_END", "EXPRESSION_START", "TEXT", "TEXT_IN_QUOTE", "END_QUOTE", @@ -161,11 +173,11 @@ export class BlazeExpressionLexer extends Lexer { // @Override public action(_localctx: RuleContext, ruleIndex: number, actionIndex: number): void { switch (ruleIndex) { - case 56: + case 65: this.QUOTED_IDENTIFIER_action(_localctx, actionIndex); break; - case 59: + case 68: this.TEXT_action(_localctx, actionIndex); break; } @@ -187,7 +199,7 @@ export class BlazeExpressionLexer extends Lexer { // @Override public sempred(_localctx: RuleContext, ruleIndex: number, predIndex: number): boolean { switch (ruleIndex) { - case 59: + case 68: return this.TEXT_sempred(_localctx, predIndex); } return true; @@ -201,7 +213,7 @@ export class BlazeExpressionLexer extends Lexer { } public static readonly _serializedATN: string = - "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x028\u01BB\b\x01" + + "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x02A\u0200\b\x01" + "\b\x01\b\x01\b\x01\x04\x02\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t" + "\x05\x04\x06\t\x06\x04\x07\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t" + "\v\x04\f\t\f\x04\r\t\r\x04\x0E\t\x0E\x04\x0F\t\x0F\x04\x10\t\x10\x04\x11" + @@ -211,206 +223,238 @@ export class BlazeExpressionLexer extends Lexer { " \x04!\t!\x04\"\t\"\x04#\t#\x04$\t$\x04%\t%\x04&\t&\x04\'\t\'\x04(\t(" + "\x04)\t)\x04*\t*\x04+\t+\x04,\t,\x04-\t-\x04.\t.\x04/\t/\x040\t0\x041" + "\t1\x042\t2\x043\t3\x044\t4\x045\t5\x046\t6\x047\t7\x048\t8\x049\t9\x04" + - ":\t:\x04;\t;\x04<\t<\x04=\t=\x04>\t>\x04?\t?\x04@\t@\x04A\tA\x03\x02\x03" + - "\x02\x05\x02\x89\n\x02\x03\x02\x03\x02\x03\x03\x03\x03\x03\x03\x05\x03" + - "\x90\n\x03\x03\x04\x03\x04\x03\x05\x06\x05\x95\n\x05\r\x05\x0E\x05\x96" + - "\x03\x06\x03\x06\x03\x07\x03\x07\x03\x07\x05\x07\x9E\n\x07\x05\x07\xA0" + - "\n\x07\x03\b\x03\b\x03\b\x03\t\x05\t\xA6\n\t\x03\t\x03\t\x03\n\x03\n\x03" + - "\n\x03\n\x03\n\x05\n\xAF\n\n\x03\n\x05\n\xB2\n\n\x03\v\x03\v\x03\f\x03" + + ":\t:\x04;\t;\x04<\t<\x04=\t=\x04>\t>\x04?\t?\x04@\t@\x04A\tA\x04B\tB\x04" + + "C\tC\x04D\tD\x04E\tE\x04F\tF\x04G\tG\x04H\tH\x04I\tI\x04J\tJ\x03\x02\x03" + + "\x02\x05\x02\x9B\n\x02\x03\x02\x03\x02\x03\x03\x03\x03\x03\x03\x05\x03" + + "\xA2\n\x03\x03\x04\x03\x04\x03\x05\x06\x05\xA7\n\x05\r\x05\x0E\x05\xA8" + + "\x03\x06\x03\x06\x03\x07\x03\x07\x03\x07\x05\x07\xB0\n\x07\x05\x07\xB2" + + "\n\x07\x03\b\x03\b\x03\b\x03\t\x05\t\xB8\n\t\x03\t\x03\t\x03\n\x03\n\x03" + + "\n\x03\n\x03\n\x05\n\xC1\n\n\x03\n\x05\n\xC4\n\n\x03\v\x03\v\x03\f\x03" + "\f\x03\f\x03\f\x03\f\x03\f\x03\f\x03\r\x03\r\x03\r\x03\r\x03\x0E\x03\x0E" + "\x03\x0E\x03\x0E\x03\x0F\x03\x0F\x03\x10\x03\x10\x03\x10\x03\x10\x05\x10" + - "\xCB\n\x10\x03\x10\x03\x10\x03\x10\x05\x10\xD0\n\x10\x03\x11\x03\x11\x03" + + "\xDD\n\x10\x03\x10\x03\x10\x03\x10\x05\x10\xE2\n\x10\x03\x11\x03\x11\x03" + "\x11\x03\x12\x03\x12\x03\x12\x03\x12\x03\x13\x03\x13\x03\x13\x03\x13\x03" + "\x13\x03\x13\x03\x13\x03\x13\x03\x14\x03\x14\x03\x14\x03\x14\x03\x14\x03" + "\x15\x03\x15\x03\x15\x03\x15\x03\x15\x03\x16\x03\x16\x03\x16\x03\x16\x03" + - "\x16\x03\x16\x03\x17\x03\x17\x03\x17\x03\x17\x03\x17\x03\x17\x03\x18\x03" + - "\x18\x03\x18\x03\x18\x03\x18\x03\x18\x03\x19\x03\x19\x03\x19\x03\x1A\x03" + - "\x1A\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03\x1B\x03" + - "\x1B\x03\x1B\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03" + - "\x1C\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1E\x03" + + "\x16\x03\x16\x03\x16\x03\x16\x03\x16\x03\x17\x03\x17\x03\x17\x03\x17\x03" + + "\x17\x03\x17\x03\x18\x03\x18\x03\x18\x03\x18\x03\x18\x03\x18\x03\x19\x03" + + "\x19\x03\x19\x03\x19\x03\x19\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03" + + "\x1B\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x03\x1C\x03\x1C\x03\x1C\x03" + + "\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03" + "\x1E\x03\x1E\x03\x1E\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03 \x03" + - " \x03 \x03!\x03!\x03!\x03!\x03!\x03!\x03!\x03!\x03\"\x03\"\x03\"\x03\"" + - "\x03\"\x03#\x03#\x03#\x03#\x03#\x03#\x03#\x03#\x03#\x03#\x03$\x03$\x03" + - "$\x03$\x03$\x03%\x03%\x03%\x03%\x03%\x03%\x03&\x03&\x03\'\x03\'\x03\'" + - "\x03(\x03(\x03)\x03)\x03)\x03*\x03*\x03+\x03+\x03+\x03+\x05+\u0159\n+" + - "\x03,\x03,\x03-\x03-\x03.\x03.\x03/\x03/\x030\x030\x031\x031\x032\x03" + - "2\x033\x033\x034\x034\x035\x035\x036\x036\x037\x037\x038\x038\x039\x03" + - "9\x079\u0177\n9\f9\x0E9\u017A\v9\x03:\x03:\x03:\x07:\u017F\n:\f:\x0E:" + - "\u0182\v:\x03:\x03:\x03:\x03;\x03;\x03;\x03;\x03<\x03<\x03<\x03<\x03<" + - "\x03=\x03=\x03=\x03=\x03=\x03=\x06=\u0196\n=\r=\x0E=\u0197\x03=\x03=\x03" + - ">\x03>\x03>\x06>\u019F\n>\r>\x0E>\u01A0\x03>\x05>\u01A4\n>\x05>\u01A6" + - "\n>\x03?\x03?\x03?\x03?\x03@\x03@\x03@\x06@\u01AF\n@\r@\x0E@\u01B0\x03" + - "@\x05@\u01B4\n@\x05@\u01B6\n@\x03A\x03A\x03A\x03A\x02\x02\x02B\x06\x02" + - "\x03\b\x02\x02\n\x02\x02\f\x02\x02\x0E\x02\x02\x10\x02\x02\x12\x02\x02" + - "\x14\x02\x02\x16\x02\x02\x18\x02\x02\x1A\x02\x02\x1C\x02\x04\x1E\x02\x05" + - " \x02\x06\"\x02\x07$\x02\b&\x02\t(\x02\n*\x02\v,\x02\f.\x02\r0\x02\x0E" + - "2\x02\x0F4\x02\x106\x02\x118\x02\x12:\x02\x13<\x02\x14>\x02\x15@\x02\x16" + - "B\x02\x17D\x02\x18F\x02\x19H\x02\x1AJ\x02\x1BL\x02\x1CN\x02\x1DP\x02\x1E" + - "R\x02\x1FT\x02 V\x02!X\x02\"Z\x02#\\\x02$^\x02%`\x02&b\x02\'d\x02(f\x02" + - ")h\x02*j\x02+l\x02,n\x02-p\x02.r\x02/t\x020v\x021x\x022z\x023|\x024~\x02" + - "5\x80\x026\x82\x027\x84\x028\x06\x02\x03\x04\x05\"\x05\x02\v\v\x0E\x0E" + - "\"\"\x04\x02\f\f\x0F\x0F\x04\x02GGgg\x04\x02--//\x07\x02ddhhppttvv\x04" + - "\x02))^^\x05\x022;CHch\x04\x02CCcc\x04\x02PPpp\x04\x02FFff\x04\x02DDd" + - "d\x04\x02VVvv\x04\x02YYyy\x04\x02[[{{\x04\x02UUuu\x04\x02OOoo\x04\x02" + - "RRrr\x04\x02HHhh\x04\x02NNnn\x04\x02JJjj\x04\x02QQqq\x04\x02WWww\x04\x02" + - "TTtt\x04\x02KKkk\x04\x02XXxx\x04\x02EEee\x07\x02&&C\\aac|\x82\x00\b\x02" + - "&&2;C\\aac|\x82\x00\x06\x02\f\f\x0F\x0F^^bb\x03\x02%%\x06\x02\f\f\x0F" + - "\x0F))^^\x06\x02\f\f\x0F\x0F$$^^\x02\u01C7\x02\x06\x03\x02\x02\x02\x02" + - "\x1C\x03\x02\x02\x02\x02\x1E\x03\x02\x02\x02\x02 \x03\x02\x02\x02\x02" + - "\"\x03\x02\x02\x02\x02$\x03\x02\x02\x02\x02&\x03\x02\x02\x02\x02(\x03" + - "\x02\x02\x02\x02*\x03\x02\x02\x02\x02,\x03\x02\x02\x02\x02.\x03\x02\x02" + - "\x02\x020\x03\x02\x02\x02\x022\x03\x02\x02\x02\x024\x03\x02\x02\x02\x02" + - "6\x03\x02\x02\x02\x028\x03\x02\x02\x02\x02:\x03\x02\x02\x02\x02<\x03\x02" + - "\x02\x02\x02>\x03\x02\x02\x02\x02@\x03\x02\x02\x02\x02B\x03\x02\x02\x02" + - "\x02D\x03\x02\x02\x02\x02F\x03\x02\x02\x02\x02H\x03\x02\x02\x02\x02J\x03" + - "\x02\x02\x02\x02L\x03\x02\x02\x02\x02N\x03\x02\x02\x02\x02P\x03\x02\x02" + - "\x02\x02R\x03\x02\x02\x02\x02T\x03\x02\x02\x02\x02V\x03\x02\x02\x02\x02" + - "X\x03\x02\x02\x02\x02Z\x03\x02\x02\x02\x02\\\x03\x02\x02\x02\x02^\x03" + - "\x02\x02\x02\x02`\x03\x02\x02\x02\x02b\x03\x02\x02\x02\x02d\x03\x02\x02" + - "\x02\x02f\x03\x02\x02\x02\x02h\x03\x02\x02\x02\x02j\x03\x02\x02\x02\x02" + - "l\x03\x02\x02\x02\x02n\x03\x02\x02\x02\x02p\x03\x02\x02\x02\x02r\x03\x02" + - "\x02\x02\x02t\x03\x02\x02\x02\x02v\x03\x02\x02\x02\x02x\x03\x02\x02\x02" + - "\x03z\x03\x02\x02\x02\x03|\x03\x02\x02\x02\x04~\x03\x02\x02\x02\x04\x80" + - "\x03\x02\x02\x02\x05\x82\x03\x02\x02\x02\x05\x84\x03\x02\x02\x02\x06\x88" + - "\x03\x02\x02\x02\b\x8F\x03\x02\x02\x02\n\x91\x03\x02\x02\x02\f\x94\x03" + - "\x02\x02\x02\x0E\x98\x03\x02\x02\x02\x10\x9F\x03\x02\x02\x02\x12\xA1\x03" + - "\x02\x02\x02\x14\xA5\x03\x02\x02\x02\x16\xB1\x03\x02\x02\x02\x18\xB3\x03" + - "\x02\x02\x02\x1A\xB5\x03\x02\x02\x02\x1C\xBC\x03\x02\x02\x02\x1E\xC0\x03" + - "\x02\x02\x02 \xC4\x03\x02\x02\x02\"\xCF\x03\x02\x02\x02$\xD1\x03\x02\x02" + - "\x02&\xD4\x03\x02\x02\x02(\xD8\x03\x02\x02\x02*\xE0\x03\x02\x02\x02,\xE5" + - "\x03\x02\x02\x02.\xEA\x03\x02\x02\x020\xF0\x03\x02\x02\x022\xF6\x03\x02" + - "\x02\x024\xFC\x03\x02\x02\x026\xFF\x03\x02\x02\x028\u0108\x03\x02\x02" + - "\x02:\u010B\x03\x02\x02\x02<\u0113\x03\x02\x02\x02>\u011A\x03\x02\x02" + - "\x02@\u011E\x03\x02\x02\x02B\u0123\x03\x02\x02\x02D\u0126\x03\x02\x02" + - "\x02F\u012E\x03\x02\x02\x02H\u0133\x03\x02\x02\x02J\u013D\x03\x02\x02" + - "\x02L\u0142\x03\x02\x02\x02N\u0148\x03\x02\x02\x02P\u014A\x03\x02\x02" + - "\x02R\u014D\x03\x02\x02\x02T\u014F\x03\x02\x02\x02V\u0152\x03\x02\x02" + - "\x02X\u0158\x03\x02\x02\x02Z\u015A\x03\x02\x02\x02\\\u015C\x03\x02\x02" + - "\x02^\u015E\x03\x02\x02\x02`\u0160\x03\x02\x02\x02b\u0162\x03\x02\x02" + - "\x02d\u0164\x03\x02\x02\x02f\u0166\x03\x02\x02\x02h\u0168\x03\x02\x02" + - "\x02j\u016A\x03\x02\x02\x02l\u016C\x03\x02\x02\x02n\u016E\x03\x02\x02" + - "\x02p\u0170\x03\x02\x02\x02r\u0172\x03\x02\x02\x02t\u0174\x03\x02\x02" + - "\x02v\u017B\x03\x02\x02\x02x\u0186\x03\x02\x02\x02z\u018A\x03\x02\x02" + - "\x02|\u0195\x03\x02\x02\x02~\u01A5\x03\x02\x02\x02\x80\u01A7\x03\x02\x02" + - "\x02\x82\u01B5\x03\x02\x02\x02\x84\u01B7\x03\x02\x02\x02\x86\x89\t\x02" + - "\x02\x02\x87\x89\x05\b\x03\x02\x88\x86\x03\x02\x02\x02\x88\x87\x03\x02" + - "\x02\x02\x89\x8A\x03\x02\x02\x02\x8A\x8B\b\x02\x02\x02\x8B\x07\x03\x02" + - "\x02\x02\x8C\x8D\x07\x0F\x02\x02\x8D\x90\x07\f\x02\x02\x8E\x90\t\x03\x02" + - "\x02\x8F\x8C\x03\x02\x02\x02\x8F\x8E\x03\x02\x02\x02\x90\t\x03\x02\x02" + - "\x02\x91\x92\x042;\x02\x92\v\x03\x02\x02\x02\x93\x95\x05\n\x04\x02\x94" + - "\x93\x03\x02\x02\x02\x95\x96\x03\x02\x02\x02\x96\x94\x03\x02\x02\x02\x96" + - "\x97\x03\x02\x02\x02\x97\r\x03\x02\x02\x02\x98\x99\x043;\x02\x99\x0F\x03" + - "\x02\x02\x02\x9A\xA0\x072\x02\x02\x9B\x9D\x05\x0E\x06\x02\x9C\x9E\x05" + - "\f\x05\x02\x9D\x9C\x03\x02\x02\x02\x9D\x9E\x03\x02\x02\x02\x9E\xA0\x03" + - "\x02\x02\x02\x9F\x9A\x03\x02\x02\x02\x9F\x9B\x03\x02\x02\x02\xA0\x11\x03" + - "\x02\x02\x02\xA1\xA2\t\x04\x02\x02\xA2\xA3\x05\x14\t\x02\xA3\x13\x03\x02" + - "\x02\x02\xA4\xA6\t\x05\x02\x02\xA5\xA4\x03\x02\x02\x02\xA5\xA6\x03\x02" + - "\x02\x02\xA6\xA7\x03\x02\x02\x02\xA7\xA8\x05\f\x05\x02\xA8\x15\x03\x02" + - "\x02\x02\xA9\xAE\x07^\x02\x02\xAA\xAF\t\x06\x02\x02\xAB\xAC\x07^\x02\x02" + - "\xAC\xAF\x07$\x02\x02\xAD\xAF\t\x07\x02\x02\xAE\xAA\x03\x02\x02\x02\xAE" + - "\xAB\x03\x02\x02\x02\xAE\xAD\x03\x02\x02\x02\xAF\xB2\x03\x02\x02\x02\xB0" + - "\xB2\x05\x1A\f\x02\xB1\xA9\x03\x02\x02\x02\xB1\xB0\x03\x02\x02\x02\xB2" + - "\x17\x03\x02\x02\x02\xB3\xB4\t\b\x02\x02\xB4\x19\x03\x02\x02\x02\xB5\xB6" + - "\x07^\x02\x02\xB6\xB7\x07w\x02\x02\xB7\xB8\x05\x18\v\x02\xB8\xB9\x05\x18" + - "\v\x02\xB9\xBA\x05\x18\v\x02\xBA\xBB\x05\x18\v\x02\xBB\x1B\x03\x02\x02" + - "\x02\xBC\xBD\x07)\x02\x02\xBD\xBE\x03\x02\x02\x02\xBE\xBF\b\r\x03\x02" + - "\xBF\x1D\x03\x02\x02\x02\xC0\xC1\x07$\x02\x02\xC1\xC2\x03\x02\x02\x02" + - "\xC2\xC3\b\x0E\x04\x02\xC3\x1F\x03\x02\x02\x02\xC4\xC5\x05\x10\x07\x02" + - "\xC5!\x03\x02\x02\x02\xC6\xC7\x05\x10\x07\x02\xC7\xC8\x070\x02\x02\xC8" + - "\xCA\x05\f\x05\x02\xC9\xCB\x05\x12\b\x02\xCA\xC9\x03\x02\x02\x02\xCA\xCB" + - "\x03\x02\x02\x02\xCB\xD0\x03\x02\x02\x02\xCC\xCD\x05\x10\x07\x02\xCD\xCE" + - "\x05\x12\b\x02\xCE\xD0\x03\x02\x02\x02\xCF\xC6\x03\x02\x02\x02\xCF\xCC" + - "\x03\x02\x02\x02\xD0#\x03\x02\x02\x02\xD1\xD2\x072\x02\x02\xD2\xD3\x05" + - "\f\x05\x02\xD3%\x03\x02\x02\x02\xD4\xD5\t\t\x02\x02\xD5\xD6\t\n\x02\x02" + - "\xD6\xD7\t\v\x02\x02\xD7\'\x03\x02\x02\x02\xD8\xD9\t\f\x02\x02\xD9\xDA" + - "\t\x04\x02\x02\xDA\xDB\t\r\x02\x02\xDB\xDC\t\x0E\x02\x02\xDC\xDD\t\x04" + - "\x02\x02\xDD\xDE\t\x04\x02\x02\xDE\xDF\t\n\x02\x02\xDF)\x03\x02\x02\x02" + - "\xE0\xE1\t\v\x02\x02\xE1\xE2\t\t\x02\x02\xE2\xE3\t\r\x02\x02\xE3\xE4\t" + - "\x04\x02\x02\xE4+\x03\x02\x02\x02\xE5\xE6\t\v\x02\x02\xE6\xE7\t\t\x02" + - "\x02\xE7\xE8\t\x0F\x02\x02\xE8\xE9\t\x10\x02\x02\xE9-\x03\x02\x02\x02" + - "\xEA\xEB\t\x04\x02\x02\xEB\xEC\t\x11\x02\x02\xEC\xED\t\x12\x02\x02\xED" + - "\xEE\t\r\x02\x02\xEE\xEF\t\x0F\x02\x02\xEF/\x03\x02\x02\x02\xF0\xF1\t" + - "\x13\x02\x02\xF1\xF2\t\t\x02\x02\xF2\xF3\t\x14\x02\x02\xF3\xF4\t\x10\x02" + - "\x02\xF4\xF5\t\x04\x02\x02\xF51\x03\x02\x02\x02\xF6\xF7\t\x15\x02\x02" + - "\xF7\xF8\t\x16\x02\x02\xF8\xF9\t\x17\x02\x02\xF9\xFA\t\x18\x02\x02\xFA" + - "\xFB\t\x10\x02\x02\xFB3\x03\x02\x02\x02\xFC\xFD\t\x19\x02\x02\xFD\xFE" + - "\t\n\x02\x02\xFE5\x03\x02\x02\x02\xFF\u0100\t\x19\x02\x02\u0100\u0101" + - "\t\n\x02\x02\u0101\u0102\t\r\x02\x02\u0102\u0103\t\x04\x02\x02\u0103\u0104" + - "\t\x18\x02\x02\u0104\u0105\t\x1A\x02\x02\u0105\u0106\t\t\x02\x02\u0106" + - "\u0107\t\x14\x02\x02\u01077\x03\x02\x02\x02\u0108\u0109\t\x19\x02\x02" + - "\u0109\u010A\t\x10\x02\x02\u010A9\x03\x02\x02\x02\u010B\u010C\t\x11\x02" + - "\x02\u010C\u010D\t\x19\x02\x02\u010D\u010E\t\n\x02\x02\u010E\u010F\t\x17" + - "\x02\x02\u010F\u0110\t\r\x02\x02\u0110\u0111\t\x04\x02\x02\u0111\u0112" + - "\t\x10\x02\x02\u0112;\x03\x02\x02\x02\u0113\u0114\t\x11\x02\x02\u0114" + - "\u0115\t\x16\x02\x02\u0115\u0116\t\n\x02\x02\u0116\u0117\t\r\x02\x02\u0117" + - "\u0118\t\x15\x02\x02\u0118\u0119\t\x10\x02\x02\u0119=\x03\x02\x02\x02" + - "\u011A\u011B\t\n\x02\x02\u011B\u011C\t\x16\x02\x02\u011C\u011D\t\r\x02" + - "\x02\u011D?\x03\x02\x02\x02\u011E\u011F\t\n\x02\x02\u011F\u0120\t\x17" + - "\x02\x02\u0120\u0121\t\x14\x02\x02\u0121\u0122\t\x14\x02\x02\u0122A\x03" + - "\x02\x02\x02\u0123\u0124\t\x16\x02\x02\u0124\u0125\t\x18\x02\x02\u0125" + - "C\x03\x02\x02\x02\u0126\u0127\t\x10\x02\x02\u0127\u0128\t\x04\x02\x02" + - "\u0128\u0129\t\x1B\x02\x02\u0129\u012A\t\x16\x02\x02\u012A\u012B\t\n\x02" + - "\x02\u012B\u012C\t\v\x02\x02\u012C\u012D\t\x10\x02\x02\u012DE\x03\x02" + - "\x02\x02\u012E\u012F\t\r\x02\x02\u012F\u0130\t\x19\x02\x02\u0130\u0131" + - "\t\x11\x02\x02\u0131\u0132\t\x04\x02\x02\u0132G\x03\x02\x02\x02\u0133" + - "\u0134\t\r\x02\x02\u0134\u0135\t\x19\x02\x02\u0135\u0136\t\x11\x02\x02" + - "\u0136\u0137\t\x04\x02\x02\u0137\u0138\t\x10\x02\x02\u0138\u0139\t\r\x02" + - "\x02\u0139\u013A\t\t\x02\x02\u013A\u013B\t\x11\x02\x02\u013B\u013C\t\x12" + - "\x02\x02\u013CI\x03\x02\x02\x02\u013D\u013E\t\r\x02\x02\u013E\u013F\t" + - "\x18\x02\x02\u013F\u0140\t\x17\x02\x02\u0140\u0141\t\x04\x02\x02\u0141" + - "K\x03\x02\x02\x02\u0142\u0143\t\x0F\x02\x02\u0143\u0144\t\x04\x02\x02" + - "\u0144\u0145\t\t\x02\x02\u0145\u0146\t\x18\x02\x02\u0146\u0147\t\x10\x02" + - "\x02\u0147M\x03\x02\x02\x02\u0148\u0149\x07>\x02\x02\u0149O\x03\x02\x02" + - "\x02\u014A\u014B\x07>\x02\x02\u014B\u014C\x07?\x02\x02\u014CQ\x03\x02" + - "\x02\x02\u014D\u014E\x07@\x02\x02\u014ES\x03\x02\x02\x02\u014F\u0150\x07" + - "@\x02\x02\u0150\u0151\x07?\x02\x02\u0151U\x03\x02\x02\x02\u0152\u0153" + - "\x07?\x02\x02\u0153W\x03\x02\x02\x02\u0154\u0155\x07#\x02\x02\u0155\u0159" + - "\x07?\x02\x02\u0156\u0157\x07>\x02\x02\u0157\u0159\x07@\x02\x02\u0158" + - "\u0154\x03\x02\x02\x02\u0158\u0156\x03\x02\x02\x02\u0159Y\x03\x02\x02" + - "\x02\u015A\u015B\x07-\x02\x02\u015B[\x03\x02\x02\x02\u015C\u015D\x07/" + - "\x02\x02\u015D]\x03\x02\x02\x02\u015E\u015F\x07,\x02\x02\u015F_\x03\x02" + - "\x02\x02\u0160\u0161\x071\x02\x02\u0161a\x03\x02\x02\x02\u0162\u0163\x07" + - "\'\x02\x02\u0163c\x03\x02\x02\x02\u0164\u0165\x07*\x02\x02\u0165e\x03" + - "\x02\x02\x02\u0166\u0167\x07+\x02\x02\u0167g\x03\x02\x02\x02\u0168\u0169" + - "\x07]\x02\x02\u0169i\x03\x02\x02\x02\u016A\u016B\x07_\x02\x02\u016Bk\x03" + - "\x02\x02\x02\u016C\u016D\x07.\x02\x02\u016Dm\x03\x02\x02\x02\u016E\u016F" + - "\x070\x02\x02\u016Fo\x03\x02\x02\x02\u0170\u0171\x07<\x02\x02\u0171q\x03" + - "\x02\x02\x02\u0172\u0173\x07#\x02\x02\u0173s\x03\x02\x02\x02\u0174\u0178" + - "\t\x1C\x02\x02\u0175\u0177\t\x1D\x02\x02\u0176\u0175\x03\x02\x02\x02\u0177" + - "\u017A\x03\x02\x02\x02\u0178\u0176\x03\x02\x02\x02\u0178\u0179\x03\x02" + - "\x02\x02\u0179u\x03\x02\x02\x02\u017A\u0178\x03\x02\x02\x02\u017B\u0180" + - "\x07b\x02\x02\u017C\u017F\x05\x16\n\x02\u017D\u017F\n\x1E\x02\x02\u017E" + - "\u017C\x03\x02\x02\x02\u017E\u017D\x03\x02\x02\x02\u017F\u0182\x03\x02" + - "\x02\x02\u0180\u017E\x03\x02\x02\x02\u0180\u0181\x03\x02\x02\x02\u0181" + - "\u0183\x03\x02\x02\x02\u0182\u0180\x03\x02\x02\x02\u0183\u0184\x07b\x02" + - "\x02\u0184\u0185\b:\x05\x02\u0185w\x03\x02\x02\x02\u0186\u0187\x07\x7F" + - "\x02\x02\u0187\u0188\x03\x02\x02\x02\u0188\u0189\b;\x06\x02\u0189y\x03" + - "\x02\x02\x02\u018A\u018B\x07%\x02\x02\u018B\u018C\x07}\x02\x02\u018C\u018D" + - "\x03\x02\x02\x02\u018D\u018E\b<\x07\x02\u018E{\x03\x02\x02\x02\u018F\u0190" + - "\x07^\x02\x02\u0190\u0191\x07%\x02\x02\u0191\u0196\x07}\x02\x02\u0192" + - "\u0196\n\x1F\x02\x02\u0193\u0194\x07%\x02\x02\u0194\u0196\x06=\x02\x02" + - "\u0195\u018F\x03\x02\x02\x02\u0195\u0192\x03\x02\x02\x02\u0195\u0193\x03" + - "\x02\x02\x02\u0196\u0197\x03\x02\x02\x02\u0197\u0195\x03\x02\x02\x02\u0197" + - "\u0198\x03\x02\x02\x02\u0198\u0199\x03\x02\x02\x02\u0199\u019A\b=\b\x02" + - "\u019A}\x03\x02\x02\x02\u019B\u01A6\x05\b\x03\x02\u019C\u019F\x05\x16" + - "\n\x02\u019D\u019F\n \x02\x02\u019E\u019C\x03\x02\x02\x02\u019E\u019D" + - "\x03\x02\x02\x02\u019F\u01A0\x03\x02\x02\x02\u01A0\u019E\x03\x02\x02\x02" + - "\u01A0\u01A1\x03\x02\x02\x02\u01A1\u01A3\x03\x02\x02\x02\u01A2\u01A4\x05" + - "\b\x03\x02\u01A3\u01A2\x03\x02\x02\x02\u01A3\u01A4\x03\x02\x02\x02\u01A4" + - "\u01A6\x03\x02\x02\x02\u01A5\u019B\x03\x02\x02\x02\u01A5\u019E\x03\x02" + - "\x02\x02\u01A6\x7F\x03\x02\x02\x02\u01A7\u01A8\x07)\x02\x02\u01A8\u01A9" + - "\x03\x02\x02\x02\u01A9\u01AA\b?\x07\x02\u01AA\x81\x03\x02\x02\x02\u01AB" + - "\u01B6\x05\b\x03\x02\u01AC\u01AF\x05\x16\n\x02\u01AD\u01AF\n!\x02\x02" + - "\u01AE\u01AC\x03\x02\x02\x02\u01AE\u01AD\x03\x02\x02\x02\u01AF\u01B0\x03" + - "\x02\x02\x02\u01B0\u01AE\x03\x02\x02\x02\u01B0\u01B1\x03\x02\x02\x02\u01B1" + - "\u01B3\x03\x02\x02\x02\u01B2\u01B4\x05\b\x03\x02\u01B3\u01B2\x03\x02\x02" + - "\x02\u01B3\u01B4\x03\x02\x02\x02\u01B4\u01B6\x03\x02\x02\x02\u01B5\u01AB" + - "\x03\x02\x02\x02\u01B5\u01AE\x03\x02\x02\x02\u01B6\x83\x03\x02\x02\x02" + - "\u01B7\u01B8\x07$\x02\x02\u01B8\u01B9\x03\x02\x02\x02\u01B9\u01BA\bA\x07" + - "\x02\u01BA\x85\x03\x02\x02\x02\x1E\x02\x03\x04\x05\x88\x8F\x96\x9D\x9F" + - "\xA5\xAE\xB1\xCA\xCF\u0158\u0178\u017E\u0180\u0195\u0197\u019E\u01A0\u01A3" + - "\u01A5\u01AE\u01B0\u01B3\u01B5\t\x02\x03\x02\x07\x04\x02\x07\x05\x02\x03" + - ":\x02\x07\x03\x02\x06\x02\x02\x03=\x03"; + " \x03 \x03 \x03 \x03!\x03!\x03!\x03!\x03!\x03!\x03!\x03!\x03\"\x03\"\x03" + + "\"\x03\"\x03\"\x03\"\x03\"\x03#\x03#\x03#\x03#\x03$\x03$\x03$\x03$\x03" + + "$\x03%\x03%\x03%\x03&\x03&\x03&\x03\'\x03\'\x03\'\x03\'\x03\'\x03\'\x03" + + "(\x03(\x03(\x03(\x03(\x03(\x03(\x03(\x03)\x03)\x03)\x03)\x03)\x03)\x03" + + ")\x03*\x03*\x03*\x03*\x03*\x03+\x03+\x03+\x03+\x03+\x03+\x03+\x03+\x03" + + "+\x03+\x03,\x03,\x03,\x03,\x03,\x03-\x03-\x03-\x03-\x03-\x03-\x03.\x03" + + ".\x03.\x03.\x03.\x03.\x03/\x03/\x030\x030\x030\x031\x031\x032\x032\x03" + + "2\x033\x033\x034\x034\x034\x034\x054\u019E\n4\x035\x035\x036\x036\x03" + + "7\x037\x038\x038\x039\x039\x03:\x03:\x03;\x03;\x03<\x03<\x03=\x03=\x03" + + ">\x03>\x03?\x03?\x03@\x03@\x03A\x03A\x03B\x03B\x07B\u01BC\nB\fB\x0EB\u01BF" + + "\vB\x03C\x03C\x03C\x07C\u01C4\nC\fC\x0EC\u01C7\vC\x03C\x03C\x03C\x03D" + + "\x03D\x03D\x03D\x03E\x03E\x03E\x03E\x03E\x03F\x03F\x03F\x03F\x03F\x03" + + "F\x06F\u01DB\nF\rF\x0EF\u01DC\x03F\x03F\x03G\x03G\x03G\x06G\u01E4\nG\r" + + "G\x0EG\u01E5\x03G\x05G\u01E9\nG\x05G\u01EB\nG\x03H\x03H\x03H\x03H\x03" + + "I\x03I\x03I\x06I\u01F4\nI\rI\x0EI\u01F5\x03I\x05I\u01F9\nI\x05I\u01FB" + + "\nI\x03J\x03J\x03J\x03J\x02\x02\x02K\x06\x02\x03\b\x02\x02\n\x02\x02\f" + + "\x02\x02\x0E\x02\x02\x10\x02\x02\x12\x02\x02\x14\x02\x02\x16\x02\x02\x18" + + "\x02\x02\x1A\x02\x02\x1C\x02\x04\x1E\x02\x05 \x02\x06\"\x02\x07$\x02\b" + + "&\x02\t(\x02\n*\x02\v,\x02\f.\x02\r0\x02\x0E2\x02\x0F4\x02\x106\x02\x11" + + "8\x02\x12:\x02\x13<\x02\x14>\x02\x15@\x02\x16B\x02\x17D\x02\x18F\x02\x19" + + "H\x02\x1AJ\x02\x1BL\x02\x1CN\x02\x1DP\x02\x1ER\x02\x1FT\x02 V\x02!X\x02" + + "\"Z\x02#\\\x02$^\x02%`\x02&b\x02\'d\x02(f\x02)h\x02*j\x02+l\x02,n\x02" + + "-p\x02.r\x02/t\x020v\x021x\x022z\x023|\x024~\x025\x80\x026\x82\x027\x84" + + "\x028\x86\x029\x88\x02:\x8A\x02;\x8C\x02<\x8E\x02=\x90\x02>\x92\x02?\x94" + + "\x02@\x96\x02A\x06\x02\x03\x04\x05$\x05\x02\v\v\x0E\x0E\"\"\x04\x02\f" + + "\f\x0F\x0F\x04\x02GGgg\x04\x02--//\x07\x02ddhhppttvv\x04\x02))^^\x05\x02" + + "2;CHch\x04\x02CCcc\x04\x02PPpp\x04\x02FFff\x04\x02DDdd\x04\x02VVvv\x04" + + "\x02YYyy\x04\x02[[{{\x04\x02UUuu\x04\x02KKkk\x04\x02EEee\x04\x02OOoo\x04" + + "\x02RRrr\x04\x02HHhh\x04\x02NNnn\x04\x02TTtt\x04\x02QQqq\x04\x02WWww\x04" + + "\x02JJjj\x04\x02XXxx\x04\x02LLll\x04\x02IIii\x07\x02&&C\\aac|\x82\x00" + + "\b\x02&&2;C\\aac|\x82\x00\x06\x02\f\f\x0F\x0F^^bb\x03\x02%%\x06\x02\f" + + "\f\x0F\x0F))^^\x06\x02\f\f\x0F\x0F$$^^\x02\u020C\x02\x06\x03\x02\x02\x02" + + "\x02\x1C\x03\x02\x02\x02\x02\x1E\x03\x02\x02\x02\x02 \x03\x02\x02\x02" + + "\x02\"\x03\x02\x02\x02\x02$\x03\x02\x02\x02\x02&\x03\x02\x02\x02\x02(" + + "\x03\x02\x02\x02\x02*\x03\x02\x02\x02\x02,\x03\x02\x02\x02\x02.\x03\x02" + + "\x02\x02\x020\x03\x02\x02\x02\x022\x03\x02\x02\x02\x024\x03\x02\x02\x02" + + "\x026\x03\x02\x02\x02\x028\x03\x02\x02\x02\x02:\x03\x02\x02\x02\x02<\x03" + + "\x02\x02\x02\x02>\x03\x02\x02\x02\x02@\x03\x02\x02\x02\x02B\x03\x02\x02" + + "\x02\x02D\x03\x02\x02\x02\x02F\x03\x02\x02\x02\x02H\x03\x02\x02\x02\x02" + + "J\x03\x02\x02\x02\x02L\x03\x02\x02\x02\x02N\x03\x02\x02\x02\x02P\x03\x02" + + "\x02\x02\x02R\x03\x02\x02\x02\x02T\x03\x02\x02\x02\x02V\x03\x02\x02\x02" + + "\x02X\x03\x02\x02\x02\x02Z\x03\x02\x02\x02\x02\\\x03\x02\x02\x02\x02^" + + "\x03\x02\x02\x02\x02`\x03\x02\x02\x02\x02b\x03\x02\x02\x02\x02d\x03\x02" + + "\x02\x02\x02f\x03\x02\x02\x02\x02h\x03\x02\x02\x02\x02j\x03\x02\x02\x02" + + "\x02l\x03\x02\x02\x02\x02n\x03\x02\x02\x02\x02p\x03\x02\x02\x02\x02r\x03" + + "\x02\x02\x02\x02t\x03\x02\x02\x02\x02v\x03\x02\x02\x02\x02x\x03\x02\x02" + + "\x02\x02z\x03\x02\x02\x02\x02|\x03\x02\x02\x02\x02~\x03\x02\x02\x02\x02" + + "\x80\x03\x02\x02\x02\x02\x82\x03\x02\x02\x02\x02\x84\x03\x02\x02\x02\x02" + + "\x86\x03\x02\x02\x02\x02\x88\x03\x02\x02\x02\x02\x8A\x03\x02\x02\x02\x03" + + "\x8C\x03\x02\x02\x02\x03\x8E\x03\x02\x02\x02\x04\x90\x03\x02\x02\x02\x04" + + "\x92\x03\x02\x02\x02\x05\x94\x03\x02\x02\x02\x05\x96\x03\x02\x02\x02\x06" + + "\x9A\x03\x02\x02\x02\b\xA1\x03\x02\x02\x02\n\xA3\x03\x02\x02\x02\f\xA6" + + "\x03\x02\x02\x02\x0E\xAA\x03\x02\x02\x02\x10\xB1\x03\x02\x02\x02\x12\xB3" + + "\x03\x02\x02\x02\x14\xB7\x03\x02\x02\x02\x16\xC3\x03\x02\x02\x02\x18\xC5" + + "\x03\x02\x02\x02\x1A\xC7\x03\x02\x02\x02\x1C\xCE\x03\x02\x02\x02\x1E\xD2" + + "\x03\x02\x02\x02 \xD6\x03\x02\x02\x02\"\xE1\x03\x02\x02\x02$\xE3\x03\x02" + + "\x02\x02&\xE6\x03\x02\x02\x02(\xEA\x03\x02\x02\x02*\xF2\x03\x02\x02\x02" + + ",\xF7\x03\x02\x02\x02.\xFC\x03\x02\x02\x020\u0105\x03\x02\x02\x022\u010B" + + "\x03\x02\x02\x024\u0111\x03\x02\x02\x026\u0116\x03\x02\x02\x028\u011B" + + "\x03\x02\x02\x02:\u0121\x03\x02\x02\x02<\u0124\x03\x02\x02\x02>\u012D" + + "\x03\x02\x02\x02@\u0130\x03\x02\x02\x02B\u0135\x03\x02\x02\x02D\u013A" + + "\x03\x02\x02\x02F\u0142\x03\x02\x02\x02H\u0149\x03\x02\x02\x02J\u014D" + + "\x03\x02\x02\x02L\u0152\x03\x02\x02\x02N\u0155\x03\x02\x02\x02P\u0158" + + "\x03\x02\x02\x02R\u015E\x03\x02\x02\x02T\u0166\x03\x02\x02\x02V\u016D" + + "\x03\x02\x02\x02X\u0172\x03\x02\x02\x02Z\u017C\x03\x02\x02\x02\\\u0181" + + "\x03\x02\x02\x02^\u0187\x03\x02\x02\x02`\u018D\x03\x02\x02\x02b\u018F" + + "\x03\x02\x02\x02d\u0192\x03\x02\x02\x02f\u0194\x03\x02\x02\x02h\u0197" + + "\x03\x02\x02\x02j\u019D\x03\x02\x02\x02l\u019F\x03\x02\x02\x02n\u01A1" + + "\x03\x02\x02\x02p\u01A3\x03\x02\x02\x02r\u01A5\x03\x02\x02\x02t\u01A7" + + "\x03\x02\x02\x02v\u01A9\x03\x02\x02\x02x\u01AB\x03\x02\x02\x02z\u01AD" + + "\x03\x02\x02\x02|\u01AF\x03\x02\x02\x02~\u01B1\x03\x02\x02\x02\x80\u01B3" + + "\x03\x02\x02\x02\x82\u01B5\x03\x02\x02\x02\x84\u01B7\x03\x02\x02\x02\x86" + + "\u01B9\x03\x02\x02\x02\x88\u01C0\x03\x02\x02\x02\x8A\u01CB\x03\x02\x02" + + "\x02\x8C\u01CF\x03\x02\x02\x02\x8E\u01DA\x03\x02\x02\x02\x90\u01EA\x03" + + "\x02\x02\x02\x92\u01EC\x03\x02\x02\x02\x94\u01FA\x03\x02\x02\x02\x96\u01FC" + + "\x03\x02\x02\x02\x98\x9B\t\x02\x02\x02\x99\x9B\x05\b\x03\x02\x9A\x98\x03" + + "\x02\x02\x02\x9A\x99\x03\x02\x02\x02\x9B\x9C\x03\x02\x02\x02\x9C\x9D\b" + + "\x02\x02\x02\x9D\x07\x03\x02\x02\x02\x9E\x9F\x07\x0F\x02\x02\x9F\xA2\x07" + + "\f\x02\x02\xA0\xA2\t\x03\x02\x02\xA1\x9E\x03\x02\x02\x02\xA1\xA0\x03\x02" + + "\x02\x02\xA2\t\x03\x02\x02\x02\xA3\xA4\x042;\x02\xA4\v\x03\x02\x02\x02" + + "\xA5\xA7\x05\n\x04\x02\xA6\xA5\x03\x02\x02\x02\xA7\xA8\x03\x02\x02\x02" + + "\xA8\xA6\x03\x02\x02\x02\xA8\xA9\x03\x02\x02\x02\xA9\r\x03\x02\x02\x02" + + "\xAA\xAB\x043;\x02\xAB\x0F\x03\x02\x02\x02\xAC\xB2\x072\x02\x02\xAD\xAF" + + "\x05\x0E\x06\x02\xAE\xB0\x05\f\x05\x02\xAF\xAE\x03\x02\x02\x02\xAF\xB0" + + "\x03\x02\x02\x02\xB0\xB2\x03\x02\x02\x02\xB1\xAC\x03\x02\x02\x02\xB1\xAD" + + "\x03\x02\x02\x02\xB2\x11\x03\x02\x02\x02\xB3\xB4\t\x04\x02\x02\xB4\xB5" + + "\x05\x14\t\x02\xB5\x13\x03\x02\x02\x02\xB6\xB8\t\x05\x02\x02\xB7\xB6\x03" + + "\x02\x02\x02\xB7\xB8\x03\x02\x02\x02\xB8\xB9\x03\x02\x02\x02\xB9\xBA\x05" + + "\f\x05\x02\xBA\x15\x03\x02\x02\x02\xBB\xC0\x07^\x02\x02\xBC\xC1\t\x06" + + "\x02\x02\xBD\xBE\x07^\x02\x02\xBE\xC1\x07$\x02\x02\xBF\xC1\t\x07\x02\x02" + + "\xC0\xBC\x03\x02\x02\x02\xC0\xBD\x03\x02\x02\x02\xC0\xBF\x03\x02\x02\x02" + + "\xC1\xC4\x03\x02\x02\x02\xC2\xC4\x05\x1A\f\x02\xC3\xBB\x03\x02\x02\x02" + + "\xC3\xC2\x03\x02\x02\x02\xC4\x17\x03\x02\x02\x02\xC5\xC6\t\b\x02\x02\xC6" + + "\x19\x03\x02\x02\x02\xC7\xC8\x07^\x02\x02\xC8\xC9\x07w\x02\x02\xC9\xCA" + + "\x05\x18\v\x02\xCA\xCB\x05\x18\v\x02\xCB\xCC\x05\x18\v\x02\xCC\xCD\x05" + + "\x18\v\x02\xCD\x1B\x03\x02\x02\x02\xCE\xCF\x07)\x02\x02\xCF\xD0\x03\x02" + + "\x02\x02\xD0\xD1\b\r\x03\x02\xD1\x1D\x03\x02\x02\x02\xD2\xD3\x07$\x02" + + "\x02\xD3\xD4\x03\x02\x02\x02\xD4\xD5\b\x0E\x04\x02\xD5\x1F\x03\x02\x02" + + "\x02\xD6\xD7\x05\x10\x07\x02\xD7!\x03\x02\x02\x02\xD8\xD9\x05\x10\x07" + + "\x02\xD9\xDA\x070\x02\x02\xDA\xDC\x05\f\x05\x02\xDB\xDD\x05\x12\b\x02" + + "\xDC\xDB\x03\x02\x02\x02\xDC\xDD\x03\x02\x02\x02\xDD\xE2\x03\x02\x02\x02" + + "\xDE\xDF\x05\x10\x07\x02\xDF\xE0\x05\x12\b\x02\xE0\xE2\x03\x02\x02\x02" + + "\xE1\xD8\x03\x02\x02\x02\xE1\xDE\x03\x02\x02\x02\xE2#\x03\x02\x02\x02" + + "\xE3\xE4\x072\x02\x02\xE4\xE5\x05\f\x05\x02\xE5%\x03\x02\x02\x02\xE6\xE7" + + "\t\t\x02\x02\xE7\xE8\t\n\x02\x02\xE8\xE9\t\v\x02\x02\xE9\'\x03\x02\x02" + + "\x02\xEA\xEB\t\f\x02\x02\xEB\xEC\t\x04\x02\x02\xEC\xED\t\r\x02\x02\xED" + + "\xEE\t\x0E\x02\x02\xEE\xEF\t\x04\x02\x02\xEF\xF0\t\x04\x02\x02\xF0\xF1" + + "\t\n\x02\x02\xF1)\x03\x02\x02\x02\xF2\xF3\t\v\x02\x02\xF3\xF4\t\t\x02" + + "\x02\xF4\xF5\t\r\x02\x02\xF5\xF6\t\x04\x02\x02\xF6+\x03\x02\x02\x02\xF7" + + "\xF8\t\v\x02\x02\xF8\xF9\t\t\x02\x02\xF9\xFA\t\x0F\x02\x02\xFA\xFB\t\x10" + + "\x02\x02\xFB-\x03\x02\x02\x02\xFC\xFD\t\v\x02\x02\xFD\xFE\t\x11\x02\x02" + + "\xFE\xFF\t\x10\x02\x02\xFF\u0100\t\r\x02\x02\u0100\u0101\t\x11\x02\x02" + + "\u0101\u0102\t\n\x02\x02\u0102\u0103\t\x12\x02\x02\u0103\u0104\t\r\x02" + + "\x02\u0104/\x03\x02\x02\x02\u0105\u0106\t\x04\x02\x02\u0106\u0107\t\x13" + + "\x02\x02\u0107\u0108\t\x14\x02\x02\u0108\u0109\t\r\x02\x02\u0109\u010A" + + "\t\x0F\x02\x02\u010A1\x03\x02\x02\x02\u010B\u010C\t\x15\x02\x02\u010C" + + "\u010D\t\t\x02\x02\u010D\u010E\t\x16\x02\x02\u010E\u010F\t\x10\x02\x02" + + "\u010F\u0110\t\x04\x02\x02\u01103\x03\x02\x02\x02\u0111\u0112\t\x15\x02" + + "\x02\u0112\u0113\t\x17\x02\x02\u0113\u0114\t\x18\x02\x02\u0114\u0115\t" + + "\x13\x02\x02\u01155\x03\x02\x02\x02\u0116\u0117\t\x15\x02\x02\u0117\u0118" + + "\t\x19\x02\x02\u0118\u0119\t\x16\x02\x02\u0119\u011A\t\x16\x02\x02\u011A" + + "7\x03\x02\x02\x02\u011B\u011C\t\x1A\x02\x02\u011C\u011D\t\x18\x02\x02" + + "\u011D\u011E\t\x19\x02\x02\u011E\u011F\t\x17\x02\x02\u011F\u0120\t\x10" + + "\x02\x02\u01209\x03\x02\x02\x02\u0121\u0122\t\x11\x02\x02\u0122\u0123" + + "\t\n\x02\x02\u0123;\x03\x02\x02\x02\u0124\u0125\t\x11\x02\x02\u0125\u0126" + + "\t\n\x02\x02\u0126\u0127\t\r\x02\x02\u0127\u0128\t\x04\x02\x02\u0128\u0129" + + "\t\x17\x02\x02\u0129\u012A\t\x1B\x02\x02\u012A\u012B\t\t\x02\x02\u012B" + + "\u012C\t\x16\x02\x02\u012C=\x03\x02\x02\x02\u012D\u012E\t\x11\x02\x02" + + "\u012E\u012F\t\x10\x02\x02\u012F?\x03\x02\x02\x02\u0130\u0131\t\x1C\x02" + + "\x02\u0131\u0132\t\x18\x02\x02\u0132\u0133\t\x11\x02\x02\u0133\u0134\t" + + "\n\x02\x02\u0134A\x03\x02\x02\x02\u0135\u0136\t\x16\x02\x02\u0136\u0137" + + "\t\x04\x02\x02\u0137\u0138\t\x15\x02\x02\u0138\u0139\t\r\x02\x02\u0139" + + "C\x03\x02\x02\x02\u013A\u013B\t\x13\x02\x02\u013B\u013C\t\x11\x02\x02" + + "\u013C\u013D\t\n\x02\x02\u013D\u013E\t\x19\x02\x02\u013E\u013F\t\r\x02" + + "\x02\u013F\u0140\t\x04\x02\x02\u0140\u0141\t\x10\x02\x02\u0141E\x03\x02" + + "\x02\x02\u0142\u0143\t\x13\x02\x02\u0143\u0144\t\x18\x02\x02\u0144\u0145" + + "\t\n\x02\x02\u0145\u0146\t\r\x02\x02\u0146\u0147\t\x1A\x02\x02\u0147\u0148" + + "\t\x10\x02\x02\u0148G\x03\x02\x02\x02\u0149\u014A\t\n\x02\x02\u014A\u014B" + + "\t\x18\x02\x02\u014B\u014C\t\r\x02\x02\u014CI\x03\x02\x02\x02\u014D\u014E" + + "\t\n\x02\x02\u014E\u014F\t\x19\x02\x02\u014F\u0150\t\x16\x02\x02\u0150" + + "\u0151\t\x16\x02\x02\u0151K\x03\x02\x02\x02\u0152\u0153\t\x18\x02\x02" + + "\u0153\u0154\t\n\x02\x02\u0154M\x03\x02\x02\x02\u0155\u0156\t\x18\x02" + + "\x02\u0156\u0157\t\x17\x02\x02\u0157O\x03\x02\x02\x02\u0158\u0159\t\x17" + + "\x02\x02\u0159\u015A\t\x11\x02\x02\u015A\u015B\t\x1D\x02\x02\u015B\u015C" + + "\t\x1A\x02\x02\u015C\u015D\t\r\x02\x02\u015DQ\x03\x02\x02\x02\u015E\u015F" + + "\t\x10\x02\x02\u015F\u0160\t\x04\x02\x02\u0160\u0161\t\x12\x02\x02\u0161" + + "\u0162\t\x18\x02\x02\u0162\u0163\t\n\x02\x02\u0163\u0164\t\v\x02\x02\u0164" + + "\u0165\t\x10\x02\x02\u0165S\x03\x02\x02\x02\u0166\u0167\t\x10\x02\x02" + + "\u0167\u0168\t\x04\x02\x02\u0168\u0169\t\x16\x02\x02\u0169\u016A\t\x04" + + "\x02\x02\u016A\u016B\t\x12\x02\x02\u016B\u016C\t\r\x02\x02\u016CU\x03" + + "\x02\x02\x02\u016D\u016E\t\r\x02\x02\u016E\u016F\t\x11\x02\x02\u016F\u0170" + + "\t\x13\x02\x02\u0170\u0171\t\x04\x02\x02\u0171W\x03\x02\x02\x02\u0172" + + "\u0173\t\r\x02\x02\u0173\u0174\t\x11\x02\x02\u0174\u0175\t\x13\x02\x02" + + "\u0175\u0176\t\x04\x02\x02\u0176\u0177\t\x10\x02\x02\u0177\u0178\t\r\x02" + + "\x02\u0178\u0179\t\t\x02\x02\u0179\u017A\t\x13\x02\x02\u017A\u017B\t\x14" + + "\x02\x02\u017BY\x03\x02\x02\x02\u017C\u017D\t\r\x02\x02\u017D\u017E\t" + + "\x17\x02\x02\u017E\u017F\t\x19\x02\x02\u017F\u0180\t\x04\x02\x02\u0180" + + "[\x03\x02\x02\x02\u0181\u0182\t\x0E\x02\x02\u0182\u0183\t\x1A\x02\x02" + + "\u0183\u0184\t\x04\x02\x02\u0184\u0185\t\x17\x02\x02\u0185\u0186\t\x04" + + "\x02\x02\u0186]\x03\x02\x02\x02\u0187\u0188\t\x0F\x02\x02\u0188\u0189" + + "\t\x04\x02\x02\u0189\u018A\t\t\x02\x02\u018A\u018B\t\x17\x02\x02\u018B" + + "\u018C\t\x10\x02\x02\u018C_\x03\x02\x02\x02\u018D\u018E\x07>\x02\x02\u018E" + + "a\x03\x02\x02\x02\u018F\u0190\x07>\x02\x02\u0190\u0191\x07?\x02\x02\u0191" + + "c\x03\x02\x02\x02\u0192\u0193\x07@\x02\x02\u0193e\x03\x02\x02\x02\u0194" + + "\u0195\x07@\x02\x02\u0195\u0196\x07?\x02\x02\u0196g\x03\x02\x02\x02\u0197" + + "\u0198\x07?\x02\x02\u0198i\x03\x02\x02\x02\u0199\u019A\x07#\x02\x02\u019A" + + "\u019E\x07?\x02\x02\u019B\u019C\x07>\x02\x02\u019C\u019E\x07@\x02\x02" + + "\u019D\u0199\x03\x02\x02\x02\u019D\u019B\x03\x02\x02\x02\u019Ek\x03\x02" + + "\x02\x02\u019F\u01A0\x07-\x02\x02\u01A0m\x03\x02\x02\x02\u01A1\u01A2\x07" + + "/\x02\x02\u01A2o\x03\x02\x02\x02\u01A3\u01A4\x07,\x02\x02\u01A4q\x03\x02" + + "\x02\x02\u01A5\u01A6\x071\x02\x02\u01A6s\x03\x02\x02\x02\u01A7\u01A8\x07" + + "\'\x02\x02\u01A8u\x03\x02\x02\x02\u01A9\u01AA\x07*\x02\x02\u01AAw\x03" + + "\x02\x02\x02\u01AB\u01AC\x07+\x02\x02\u01ACy\x03\x02\x02\x02\u01AD\u01AE" + + "\x07]\x02\x02\u01AE{\x03\x02\x02\x02\u01AF\u01B0\x07_\x02\x02\u01B0}\x03" + + "\x02\x02\x02\u01B1\u01B2\x07.\x02\x02\u01B2\x7F\x03\x02\x02\x02\u01B3" + + "\u01B4\x070\x02\x02\u01B4\x81\x03\x02\x02\x02\u01B5\u01B6\x07<\x02\x02" + + "\u01B6\x83\x03\x02\x02\x02\u01B7\u01B8\x07#\x02\x02\u01B8\x85\x03\x02" + + "\x02\x02\u01B9\u01BD\t\x1E\x02\x02\u01BA\u01BC\t\x1F\x02\x02\u01BB\u01BA" + + "\x03\x02\x02\x02\u01BC\u01BF\x03\x02\x02\x02\u01BD\u01BB\x03\x02\x02\x02" + + "\u01BD\u01BE\x03\x02\x02\x02\u01BE\x87\x03\x02\x02\x02\u01BF\u01BD\x03" + + "\x02\x02\x02\u01C0\u01C5\x07b\x02\x02\u01C1\u01C4\x05\x16\n\x02\u01C2" + + "\u01C4\n \x02\x02\u01C3\u01C1\x03\x02\x02\x02\u01C3\u01C2\x03\x02\x02" + + "\x02\u01C4\u01C7\x03\x02\x02\x02\u01C5\u01C3\x03\x02\x02\x02\u01C5\u01C6" + + "\x03\x02\x02\x02\u01C6\u01C8\x03\x02\x02\x02\u01C7\u01C5\x03\x02\x02\x02" + + "\u01C8\u01C9\x07b\x02\x02\u01C9\u01CA\bC\x05\x02\u01CA\x89\x03\x02\x02" + + "\x02\u01CB\u01CC\x07\x7F\x02\x02\u01CC\u01CD\x03\x02\x02\x02\u01CD\u01CE" + + "\bD\x06\x02\u01CE\x8B\x03\x02\x02\x02\u01CF\u01D0\x07%\x02\x02\u01D0\u01D1" + + "\x07}\x02\x02\u01D1\u01D2\x03\x02\x02\x02\u01D2\u01D3\bE\x07\x02\u01D3" + + "\x8D\x03\x02\x02\x02\u01D4\u01D5\x07^\x02\x02\u01D5\u01D6\x07%\x02\x02" + + "\u01D6\u01DB\x07}\x02\x02\u01D7\u01DB\n!\x02\x02\u01D8\u01D9\x07%\x02" + + "\x02\u01D9\u01DB\x06F\x02\x02\u01DA\u01D4\x03\x02\x02\x02\u01DA\u01D7" + + "\x03\x02\x02\x02\u01DA\u01D8\x03\x02\x02\x02\u01DB\u01DC\x03\x02\x02\x02" + + "\u01DC\u01DA\x03\x02\x02\x02\u01DC\u01DD\x03\x02\x02\x02\u01DD\u01DE\x03" + + "\x02\x02\x02\u01DE\u01DF\bF\b\x02\u01DF\x8F\x03\x02\x02\x02\u01E0\u01EB" + + "\x05\b\x03\x02\u01E1\u01E4\x05\x16\n\x02\u01E2\u01E4\n\"\x02\x02\u01E3" + + "\u01E1\x03\x02\x02\x02\u01E3\u01E2\x03\x02\x02\x02\u01E4\u01E5\x03\x02" + + "\x02\x02\u01E5\u01E3\x03\x02\x02\x02\u01E5\u01E6\x03\x02\x02\x02\u01E6" + + "\u01E8\x03\x02\x02\x02\u01E7\u01E9\x05\b\x03\x02\u01E8\u01E7\x03\x02\x02" + + "\x02\u01E8\u01E9\x03\x02\x02\x02\u01E9\u01EB\x03\x02\x02\x02\u01EA\u01E0" + + "\x03\x02\x02\x02\u01EA\u01E3\x03\x02\x02\x02\u01EB\x91\x03\x02\x02\x02" + + "\u01EC\u01ED\x07)\x02\x02\u01ED\u01EE\x03\x02\x02\x02\u01EE\u01EF\bH\x07" + + "\x02\u01EF\x93\x03\x02\x02\x02\u01F0\u01FB\x05\b\x03\x02\u01F1\u01F4\x05" + + "\x16\n\x02\u01F2\u01F4\n#\x02\x02\u01F3\u01F1\x03\x02\x02\x02\u01F3\u01F2" + + "\x03\x02\x02\x02\u01F4\u01F5\x03\x02\x02\x02\u01F5\u01F3\x03\x02\x02\x02" + + "\u01F5\u01F6\x03\x02\x02\x02\u01F6\u01F8\x03\x02\x02\x02\u01F7\u01F9\x05" + + "\b\x03\x02\u01F8\u01F7\x03\x02\x02\x02\u01F8\u01F9\x03\x02\x02\x02\u01F9" + + "\u01FB\x03\x02\x02\x02\u01FA\u01F0\x03\x02\x02\x02\u01FA\u01F3\x03\x02" + + "\x02\x02\u01FB\x95\x03\x02\x02\x02\u01FC\u01FD\x07$\x02\x02\u01FD\u01FE" + + "\x03\x02\x02\x02\u01FE\u01FF\bJ\x07\x02\u01FF\x97\x03\x02\x02\x02\x1E" + + "\x02\x03\x04\x05\x9A\xA1\xA8\xAF\xB1\xB7\xC0\xC3\xDC\xE1\u019D\u01BD\u01C3" + + "\u01C5\u01DA\u01DC\u01E3\u01E5\u01E8\u01EA\u01F3\u01F5\u01F8\u01FA\t\x02" + + "\x03\x02\x07\x04\x02\x07\x05\x02\x03C\x02\x07\x03\x02\x06\x02\x02\x03" + + "F\x03"; public static __ATN: ATN; public static get _ATN(): ATN { if (!BlazeExpressionLexer.__ATN) { diff --git a/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionParser.interp b/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionParser.interp index 397e0d9..a18c01e 100644 --- a/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionParser.interp +++ b/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionParser.interp @@ -26,6 +26,15 @@ null null null null +null +null +null +null +null +null +null +null +null '<' '<=' '>' @@ -54,6 +63,7 @@ null null null null +null token symbolic names: null @@ -67,21 +77,30 @@ AND BETWEEN DATE DAYS +DISTINCT EMPTY FALSE +FROM +FULL HOURS IN INTERVAL IS +JOIN +LEFT MINUTES MONTHS NOT NULL +ON OR +RIGHT SECONDS +SELECT TIME TIMESTAMP TRUE +WHERE YEARS LESS LESS_EQUAL @@ -111,16 +130,28 @@ TEXT_IN_QUOTE END_QUOTE TEXT_IN_DOUBLE_QUOTE END_DOUBLE_QUOTE +AS rule names: parsePredicate parseExpression parseExpressionOrPredicate parseTemplate +parseQuery template expression predicate predicateOrExpression +query +selectClause +fromClause +whereClause +fromItem +fromRoot +join +joinTarget +domainTypeName +variable inList path pathAttributes @@ -139,4 +170,4 @@ identifier atn: -[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 3, 56, 419, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 4, 3, 5, 5, 5, 59, 10, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 6, 6, 68, 10, 6, 13, 6, 14, 6, 69, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 84, 10, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 7, 7, 92, 10, 7, 12, 7, 14, 7, 95, 11, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 5, 8, 107, 10, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 5, 8, 114, 10, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 5, 8, 144, 10, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 5, 8, 151, 10, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 5, 8, 160, 10, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 7, 8, 168, 10, 8, 12, 8, 14, 8, 171, 11, 8, 3, 9, 3, 9, 5, 9, 175, 10, 9, 3, 10, 3, 10, 3, 10, 3, 10, 7, 10, 181, 10, 10, 12, 10, 14, 10, 184, 11, 10, 3, 10, 3, 10, 3, 10, 5, 10, 189, 10, 10, 3, 11, 3, 11, 5, 11, 193, 10, 11, 3, 11, 3, 11, 3, 11, 5, 11, 198, 10, 11, 3, 12, 3, 12, 6, 12, 202, 10, 12, 13, 12, 14, 12, 203, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 5, 13, 217, 10, 13, 3, 14, 3, 14, 7, 14, 221, 10, 14, 12, 14, 14, 14, 224, 11, 14, 3, 14, 3, 14, 3, 14, 7, 14, 229, 10, 14, 12, 14, 14, 14, 232, 11, 14, 3, 14, 5, 14, 235, 10, 14, 3, 15, 3, 15, 3, 15, 3, 15, 7, 15, 241, 10, 15, 12, 15, 14, 15, 244, 11, 15, 5, 15, 246, 10, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 7, 16, 257, 10, 16, 12, 16, 14, 16, 260, 11, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 7, 17, 274, 10, 17, 12, 17, 14, 17, 277, 11, 17, 3, 17, 3, 17, 3, 17, 3, 17, 5, 17, 283, 10, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 7, 17, 292, 10, 17, 12, 17, 14, 17, 295, 11, 17, 3, 17, 5, 17, 298, 10, 17, 3, 17, 3, 17, 5, 17, 302, 10, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 5, 19, 314, 10, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 5, 20, 324, 10, 20, 5, 20, 326, 10, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 5, 23, 347, 10, 23, 3, 23, 3, 23, 5, 23, 351, 10, 23, 3, 23, 3, 23, 5, 23, 355, 10, 23, 3, 23, 3, 23, 5, 23, 359, 10, 23, 3, 23, 3, 23, 5, 23, 363, 10, 23, 3, 23, 3, 23, 3, 23, 3, 23, 5, 23, 369, 10, 23, 3, 23, 3, 23, 5, 23, 373, 10, 23, 3, 23, 3, 23, 5, 23, 377, 10, 23, 3, 23, 3, 23, 5, 23, 381, 10, 23, 3, 23, 3, 23, 3, 23, 3, 23, 5, 23, 387, 10, 23, 3, 23, 3, 23, 5, 23, 391, 10, 23, 3, 23, 3, 23, 5, 23, 395, 10, 23, 3, 23, 3, 23, 3, 23, 3, 23, 5, 23, 401, 10, 23, 3, 23, 3, 23, 5, 23, 405, 10, 23, 3, 23, 3, 23, 3, 23, 3, 23, 5, 23, 411, 10, 23, 3, 23, 3, 23, 5, 23, 415, 10, 23, 3, 24, 3, 24, 3, 24, 2, 2, 4, 12, 14, 25, 2, 2, 4, 2, 6, 2, 8, 2, 10, 2, 12, 2, 14, 2, 16, 2, 18, 2, 20, 2, 22, 2, 24, 2, 26, 2, 28, 2, 30, 2, 32, 2, 34, 2, 36, 2, 38, 2, 40, 2, 42, 2, 44, 2, 46, 2, 2, 7, 3, 2, 37, 39, 3, 2, 35, 36, 4, 2, 21, 21, 47, 47, 4, 2, 6, 6, 8, 8, 8, 2, 9, 12, 15, 16, 18, 21, 23, 26, 28, 28, 48, 49, 2, 474, 2, 48, 3, 2, 2, 2, 4, 51, 3, 2, 2, 2, 6, 54, 3, 2, 2, 2, 8, 58, 3, 2, 2, 2, 10, 67, 3, 2, 2, 2, 12, 83, 3, 2, 2, 2, 14, 159, 3, 2, 2, 2, 16, 174, 3, 2, 2, 2, 18, 188, 3, 2, 2, 2, 20, 197, 3, 2, 2, 2, 22, 201, 3, 2, 2, 2, 24, 216, 3, 2, 2, 2, 26, 234, 3, 2, 2, 2, 28, 236, 3, 2, 2, 2, 30, 249, 3, 2, 2, 2, 32, 301, 3, 2, 2, 2, 34, 303, 3, 2, 2, 2, 36, 308, 3, 2, 2, 2, 38, 317, 3, 2, 2, 2, 40, 329, 3, 2, 2, 2, 42, 335, 3, 2, 2, 2, 44, 341, 3, 2, 2, 2, 46, 416, 3, 2, 2, 2, 48, 49, 5, 14, 8, 2, 49, 50, 7, 2, 2, 3, 50, 3, 3, 2, 2, 2, 51, 52, 5, 12, 7, 2, 52, 53, 7, 2, 2, 3, 53, 5, 3, 2, 2, 2, 54, 55, 5, 16, 9, 2, 55, 56, 7, 2, 2, 3, 56, 7, 3, 2, 2, 2, 57, 59, 5, 10, 6, 2, 58, 57, 3, 2, 2, 2, 58, 59, 3, 2, 2, 2, 59, 60, 3, 2, 2, 2, 60, 61, 7, 2, 2, 3, 61, 9, 3, 2, 2, 2, 62, 68, 7, 52, 2, 2, 63, 64, 7, 51, 2, 2, 64, 65, 5, 12, 7, 2, 65, 66, 7, 50, 2, 2, 66, 68, 3, 2, 2, 2, 67, 62, 3, 2, 2, 2, 67, 63, 3, 2, 2, 2, 68, 69, 3, 2, 2, 2, 69, 67, 3, 2, 2, 2, 69, 70, 3, 2, 2, 2, 70, 11, 3, 2, 2, 2, 71, 72, 8, 7, 1, 2, 72, 73, 7, 40, 2, 2, 73, 74, 5, 12, 7, 2, 74, 75, 7, 41, 2, 2, 75, 84, 3, 2, 2, 2, 76, 84, 5, 24, 13, 2, 77, 84, 5, 20, 11, 2, 78, 84, 5, 32, 17, 2, 79, 80, 7, 36, 2, 2, 80, 84, 5, 12, 7, 6, 81, 82, 7, 35, 2, 2, 82, 84, 5, 12, 7, 5, 83, 71, 3, 2, 2, 2, 83, 76, 3, 2, 2, 2, 83, 77, 3, 2, 2, 2, 83, 78, 3, 2, 2, 2, 83, 79, 3, 2, 2, 2, 83, 81, 3, 2, 2, 2, 84, 93, 3, 2, 2, 2, 85, 86, 12, 4, 2, 2, 86, 87, 9, 2, 2, 2, 87, 92, 5, 12, 7, 5, 88, 89, 12, 3, 2, 2, 89, 90, 9, 3, 2, 2, 90, 92, 5, 12, 7, 4, 91, 85, 3, 2, 2, 2, 91, 88, 3, 2, 2, 2, 92, 95, 3, 2, 2, 2, 93, 91, 3, 2, 2, 2, 93, 94, 3, 2, 2, 2, 94, 13, 3, 2, 2, 2, 95, 93, 3, 2, 2, 2, 96, 97, 8, 8, 1, 2, 97, 98, 7, 40, 2, 2, 98, 99, 5, 14, 8, 2, 99, 100, 7, 41, 2, 2, 100, 160, 3, 2, 2, 2, 101, 102, 9, 4, 2, 2, 102, 160, 5, 14, 8, 17, 103, 104, 5, 12, 7, 2, 104, 106, 7, 18, 2, 2, 105, 107, 7, 21, 2, 2, 106, 105, 3, 2, 2, 2, 106, 107, 3, 2, 2, 2, 107, 108, 3, 2, 2, 2, 108, 109, 7, 22, 2, 2, 109, 160, 3, 2, 2, 2, 110, 111, 5, 12, 7, 2, 111, 113, 7, 18, 2, 2, 112, 114, 7, 21, 2, 2, 113, 112, 3, 2, 2, 2, 113, 114, 3, 2, 2, 2, 114, 115, 3, 2, 2, 2, 115, 116, 7, 13, 2, 2, 116, 160, 3, 2, 2, 2, 117, 118, 5, 12, 7, 2, 118, 119, 7, 33, 2, 2, 119, 120, 5, 12, 7, 2, 120, 160, 3, 2, 2, 2, 121, 122, 5, 12, 7, 2, 122, 123, 7, 34, 2, 2, 123, 124, 5, 12, 7, 2, 124, 160, 3, 2, 2, 2, 125, 126, 5, 12, 7, 2, 126, 127, 7, 31, 2, 2, 127, 128, 5, 12, 7, 2, 128, 160, 3, 2, 2, 2, 129, 130, 5, 12, 7, 2, 130, 131, 7, 32, 2, 2, 131, 132, 5, 12, 7, 2, 132, 160, 3, 2, 2, 2, 133, 134, 5, 12, 7, 2, 134, 135, 7, 29, 2, 2, 135, 136, 5, 12, 7, 2, 136, 160, 3, 2, 2, 2, 137, 138, 5, 12, 7, 2, 138, 139, 7, 30, 2, 2, 139, 140, 5, 12, 7, 2, 140, 160, 3, 2, 2, 2, 141, 143, 5, 12, 7, 2, 142, 144, 7, 21, 2, 2, 143, 142, 3, 2, 2, 2, 143, 144, 3, 2, 2, 2, 144, 145, 3, 2, 2, 2, 145, 146, 7, 16, 2, 2, 146, 147, 5, 18, 10, 2, 147, 160, 3, 2, 2, 2, 148, 150, 5, 12, 7, 2, 149, 151, 7, 21, 2, 2, 150, 149, 3, 2, 2, 2, 150, 151, 3, 2, 2, 2, 151, 152, 3, 2, 2, 2, 152, 153, 7, 10, 2, 2, 153, 154, 5, 12, 7, 2, 154, 155, 7, 9, 2, 2, 155, 156, 5, 12, 7, 2, 156, 160, 3, 2, 2, 2, 157, 160, 5, 32, 17, 2, 158, 160, 5, 20, 11, 2, 159, 96, 3, 2, 2, 2, 159, 101, 3, 2, 2, 2, 159, 103, 3, 2, 2, 2, 159, 110, 3, 2, 2, 2, 159, 117, 3, 2, 2, 2, 159, 121, 3, 2, 2, 2, 159, 125, 3, 2, 2, 2, 159, 129, 3, 2, 2, 2, 159, 133, 3, 2, 2, 2, 159, 137, 3, 2, 2, 2, 159, 141, 3, 2, 2, 2, 159, 148, 3, 2, 2, 2, 159, 157, 3, 2, 2, 2, 159, 158, 3, 2, 2, 2, 160, 169, 3, 2, 2, 2, 161, 162, 12, 16, 2, 2, 162, 163, 7, 9, 2, 2, 163, 168, 5, 14, 8, 17, 164, 165, 12, 15, 2, 2, 165, 166, 7, 23, 2, 2, 166, 168, 5, 14, 8, 16, 167, 161, 3, 2, 2, 2, 167, 164, 3, 2, 2, 2, 168, 171, 3, 2, 2, 2, 169, 167, 3, 2, 2, 2, 169, 170, 3, 2, 2, 2, 170, 15, 3, 2, 2, 2, 171, 169, 3, 2, 2, 2, 172, 175, 5, 12, 7, 2, 173, 175, 5, 14, 8, 2, 174, 172, 3, 2, 2, 2, 174, 173, 3, 2, 2, 2, 175, 17, 3, 2, 2, 2, 176, 177, 7, 40, 2, 2, 177, 182, 5, 12, 7, 2, 178, 179, 7, 44, 2, 2, 179, 181, 5, 12, 7, 2, 180, 178, 3, 2, 2, 2, 181, 184, 3, 2, 2, 2, 182, 180, 3, 2, 2, 2, 182, 183, 3, 2, 2, 2, 183, 185, 3, 2, 2, 2, 184, 182, 3, 2, 2, 2, 185, 186, 7, 41, 2, 2, 186, 189, 3, 2, 2, 2, 187, 189, 5, 12, 7, 2, 188, 176, 3, 2, 2, 2, 188, 187, 3, 2, 2, 2, 189, 19, 3, 2, 2, 2, 190, 192, 5, 46, 24, 2, 191, 193, 5, 22, 12, 2, 192, 191, 3, 2, 2, 2, 192, 193, 3, 2, 2, 2, 193, 198, 3, 2, 2, 2, 194, 195, 5, 32, 17, 2, 195, 196, 5, 22, 12, 2, 196, 198, 3, 2, 2, 2, 197, 190, 3, 2, 2, 2, 197, 194, 3, 2, 2, 2, 198, 21, 3, 2, 2, 2, 199, 200, 7, 45, 2, 2, 200, 202, 5, 46, 24, 2, 201, 199, 3, 2, 2, 2, 202, 203, 3, 2, 2, 2, 203, 201, 3, 2, 2, 2, 203, 204, 3, 2, 2, 2, 204, 23, 3, 2, 2, 2, 205, 217, 7, 7, 2, 2, 206, 217, 7, 6, 2, 2, 207, 217, 5, 26, 14, 2, 208, 217, 7, 27, 2, 2, 209, 217, 7, 14, 2, 2, 210, 217, 5, 34, 18, 2, 211, 217, 5, 36, 19, 2, 212, 217, 5, 38, 20, 2, 213, 217, 5, 44, 23, 2, 214, 217, 5, 28, 15, 2, 215, 217, 5, 30, 16, 2, 216, 205, 3, 2, 2, 2, 216, 206, 3, 2, 2, 2, 216, 207, 3, 2, 2, 2, 216, 208, 3, 2, 2, 2, 216, 209, 3, 2, 2, 2, 216, 210, 3, 2, 2, 2, 216, 211, 3, 2, 2, 2, 216, 212, 3, 2, 2, 2, 216, 213, 3, 2, 2, 2, 216, 214, 3, 2, 2, 2, 216, 215, 3, 2, 2, 2, 217, 25, 3, 2, 2, 2, 218, 222, 7, 4, 2, 2, 219, 221, 7, 53, 2, 2, 220, 219, 3, 2, 2, 2, 221, 224, 3, 2, 2, 2, 222, 220, 3, 2, 2, 2, 222, 223, 3, 2, 2, 2, 223, 225, 3, 2, 2, 2, 224, 222, 3, 2, 2, 2, 225, 235, 7, 54, 2, 2, 226, 230, 7, 5, 2, 2, 227, 229, 7, 55, 2, 2, 228, 227, 3, 2, 2, 2, 229, 232, 3, 2, 2, 2, 230, 228, 3, 2, 2, 2, 230, 231, 3, 2, 2, 2, 231, 233, 3, 2, 2, 2, 232, 230, 3, 2, 2, 2, 233, 235, 7, 56, 2, 2, 234, 218, 3, 2, 2, 2, 234, 226, 3, 2, 2, 2, 235, 27, 3, 2, 2, 2, 236, 245, 7, 42, 2, 2, 237, 242, 5, 24, 13, 2, 238, 239, 7, 44, 2, 2, 239, 241, 5, 24, 13, 2, 240, 238, 3, 2, 2, 2, 241, 244, 3, 2, 2, 2, 242, 240, 3, 2, 2, 2, 242, 243, 3, 2, 2, 2, 243, 246, 3, 2, 2, 2, 244, 242, 3, 2, 2, 2, 245, 237, 3, 2, 2, 2, 245, 246, 3, 2, 2, 2, 246, 247, 3, 2, 2, 2, 247, 248, 7, 43, 2, 2, 248, 29, 3, 2, 2, 2, 249, 250, 5, 46, 24, 2, 250, 258, 7, 40, 2, 2, 251, 252, 5, 46, 24, 2, 252, 253, 7, 33, 2, 2, 253, 254, 5, 16, 9, 2, 254, 255, 7, 44, 2, 2, 255, 257, 3, 2, 2, 2, 256, 251, 3, 2, 2, 2, 257, 260, 3, 2, 2, 2, 258, 256, 3, 2, 2, 2, 258, 259, 3, 2, 2, 2, 259, 261, 3, 2, 2, 2, 260, 258, 3, 2, 2, 2, 261, 262, 5, 46, 24, 2, 262, 263, 7, 33, 2, 2, 263, 264, 5, 16, 9, 2, 264, 265, 7, 41, 2, 2, 265, 31, 3, 2, 2, 2, 266, 267, 5, 46, 24, 2, 267, 282, 7, 40, 2, 2, 268, 269, 5, 46, 24, 2, 269, 270, 7, 33, 2, 2, 270, 271, 5, 16, 9, 2, 271, 272, 7, 44, 2, 2, 272, 274, 3, 2, 2, 2, 273, 268, 3, 2, 2, 2, 274, 277, 3, 2, 2, 2, 275, 273, 3, 2, 2, 2, 275, 276, 3, 2, 2, 2, 276, 278, 3, 2, 2, 2, 277, 275, 3, 2, 2, 2, 278, 279, 5, 46, 24, 2, 279, 280, 7, 33, 2, 2, 280, 281, 5, 16, 9, 2, 281, 283, 3, 2, 2, 2, 282, 275, 3, 2, 2, 2, 282, 283, 3, 2, 2, 2, 283, 284, 3, 2, 2, 2, 284, 285, 7, 41, 2, 2, 285, 302, 3, 2, 2, 2, 286, 287, 5, 46, 24, 2, 287, 297, 7, 40, 2, 2, 288, 289, 5, 16, 9, 2, 289, 290, 7, 44, 2, 2, 290, 292, 3, 2, 2, 2, 291, 288, 3, 2, 2, 2, 292, 295, 3, 2, 2, 2, 293, 291, 3, 2, 2, 2, 293, 294, 3, 2, 2, 2, 294, 296, 3, 2, 2, 2, 295, 293, 3, 2, 2, 2, 296, 298, 5, 16, 9, 2, 297, 293, 3, 2, 2, 2, 297, 298, 3, 2, 2, 2, 298, 299, 3, 2, 2, 2, 299, 300, 7, 41, 2, 2, 300, 302, 3, 2, 2, 2, 301, 266, 3, 2, 2, 2, 301, 286, 3, 2, 2, 2, 302, 33, 3, 2, 2, 2, 303, 304, 7, 11, 2, 2, 304, 305, 7, 40, 2, 2, 305, 306, 5, 40, 21, 2, 306, 307, 7, 41, 2, 2, 307, 35, 3, 2, 2, 2, 308, 309, 7, 25, 2, 2, 309, 310, 7, 40, 2, 2, 310, 313, 5, 42, 22, 2, 311, 312, 7, 45, 2, 2, 312, 314, 9, 5, 2, 2, 313, 311, 3, 2, 2, 2, 313, 314, 3, 2, 2, 2, 314, 315, 3, 2, 2, 2, 315, 316, 7, 41, 2, 2, 316, 37, 3, 2, 2, 2, 317, 318, 7, 26, 2, 2, 318, 319, 7, 40, 2, 2, 319, 325, 5, 40, 21, 2, 320, 323, 5, 42, 22, 2, 321, 322, 7, 45, 2, 2, 322, 324, 9, 5, 2, 2, 323, 321, 3, 2, 2, 2, 323, 324, 3, 2, 2, 2, 324, 326, 3, 2, 2, 2, 325, 320, 3, 2, 2, 2, 325, 326, 3, 2, 2, 2, 326, 327, 3, 2, 2, 2, 327, 328, 7, 41, 2, 2, 328, 39, 3, 2, 2, 2, 329, 330, 7, 6, 2, 2, 330, 331, 7, 36, 2, 2, 331, 332, 9, 5, 2, 2, 332, 333, 7, 36, 2, 2, 333, 334, 9, 5, 2, 2, 334, 41, 3, 2, 2, 2, 335, 336, 9, 5, 2, 2, 336, 337, 7, 46, 2, 2, 337, 338, 9, 5, 2, 2, 338, 339, 7, 46, 2, 2, 339, 340, 9, 5, 2, 2, 340, 43, 3, 2, 2, 2, 341, 414, 7, 17, 2, 2, 342, 343, 7, 6, 2, 2, 343, 346, 7, 28, 2, 2, 344, 345, 7, 6, 2, 2, 345, 347, 7, 20, 2, 2, 346, 344, 3, 2, 2, 2, 346, 347, 3, 2, 2, 2, 347, 350, 3, 2, 2, 2, 348, 349, 7, 6, 2, 2, 349, 351, 7, 12, 2, 2, 350, 348, 3, 2, 2, 2, 350, 351, 3, 2, 2, 2, 351, 354, 3, 2, 2, 2, 352, 353, 7, 6, 2, 2, 353, 355, 7, 15, 2, 2, 354, 352, 3, 2, 2, 2, 354, 355, 3, 2, 2, 2, 355, 358, 3, 2, 2, 2, 356, 357, 7, 6, 2, 2, 357, 359, 7, 19, 2, 2, 358, 356, 3, 2, 2, 2, 358, 359, 3, 2, 2, 2, 359, 362, 3, 2, 2, 2, 360, 361, 7, 6, 2, 2, 361, 363, 7, 24, 2, 2, 362, 360, 3, 2, 2, 2, 362, 363, 3, 2, 2, 2, 363, 415, 3, 2, 2, 2, 364, 365, 7, 6, 2, 2, 365, 368, 7, 20, 2, 2, 366, 367, 7, 6, 2, 2, 367, 369, 7, 12, 2, 2, 368, 366, 3, 2, 2, 2, 368, 369, 3, 2, 2, 2, 369, 372, 3, 2, 2, 2, 370, 371, 7, 6, 2, 2, 371, 373, 7, 15, 2, 2, 372, 370, 3, 2, 2, 2, 372, 373, 3, 2, 2, 2, 373, 376, 3, 2, 2, 2, 374, 375, 7, 6, 2, 2, 375, 377, 7, 19, 2, 2, 376, 374, 3, 2, 2, 2, 376, 377, 3, 2, 2, 2, 377, 380, 3, 2, 2, 2, 378, 379, 7, 6, 2, 2, 379, 381, 7, 24, 2, 2, 380, 378, 3, 2, 2, 2, 380, 381, 3, 2, 2, 2, 381, 415, 3, 2, 2, 2, 382, 383, 7, 6, 2, 2, 383, 386, 7, 12, 2, 2, 384, 385, 7, 6, 2, 2, 385, 387, 7, 15, 2, 2, 386, 384, 3, 2, 2, 2, 386, 387, 3, 2, 2, 2, 387, 390, 3, 2, 2, 2, 388, 389, 7, 6, 2, 2, 389, 391, 7, 19, 2, 2, 390, 388, 3, 2, 2, 2, 390, 391, 3, 2, 2, 2, 391, 394, 3, 2, 2, 2, 392, 393, 7, 6, 2, 2, 393, 395, 7, 24, 2, 2, 394, 392, 3, 2, 2, 2, 394, 395, 3, 2, 2, 2, 395, 415, 3, 2, 2, 2, 396, 397, 7, 6, 2, 2, 397, 400, 7, 15, 2, 2, 398, 399, 7, 6, 2, 2, 399, 401, 7, 19, 2, 2, 400, 398, 3, 2, 2, 2, 400, 401, 3, 2, 2, 2, 401, 404, 3, 2, 2, 2, 402, 403, 7, 6, 2, 2, 403, 405, 7, 24, 2, 2, 404, 402, 3, 2, 2, 2, 404, 405, 3, 2, 2, 2, 405, 415, 3, 2, 2, 2, 406, 407, 7, 6, 2, 2, 407, 410, 7, 19, 2, 2, 408, 409, 7, 6, 2, 2, 409, 411, 7, 24, 2, 2, 410, 408, 3, 2, 2, 2, 410, 411, 3, 2, 2, 2, 411, 415, 3, 2, 2, 2, 412, 413, 7, 6, 2, 2, 413, 415, 7, 24, 2, 2, 414, 342, 3, 2, 2, 2, 414, 364, 3, 2, 2, 2, 414, 382, 3, 2, 2, 2, 414, 396, 3, 2, 2, 2, 414, 406, 3, 2, 2, 2, 414, 412, 3, 2, 2, 2, 415, 45, 3, 2, 2, 2, 416, 417, 9, 6, 2, 2, 417, 47, 3, 2, 2, 2, 52, 58, 67, 69, 83, 91, 93, 106, 113, 143, 150, 159, 167, 169, 174, 182, 188, 192, 197, 203, 216, 222, 230, 234, 242, 245, 258, 275, 282, 293, 297, 301, 313, 323, 325, 346, 350, 354, 358, 362, 368, 372, 376, 380, 386, 390, 394, 400, 404, 410, 414] \ No newline at end of file +[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 3, 66, 503, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 4, 3, 5, 5, 5, 81, 10, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 6, 7, 93, 10, 7, 13, 7, 14, 7, 94, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 5, 8, 109, 10, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 7, 8, 117, 10, 8, 12, 8, 14, 8, 120, 11, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 5, 9, 132, 10, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 5, 9, 139, 10, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 5, 9, 169, 10, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 5, 9, 176, 10, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 5, 9, 185, 10, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 7, 9, 193, 10, 9, 12, 9, 14, 9, 196, 11, 9, 3, 10, 3, 10, 5, 10, 200, 10, 10, 3, 11, 5, 11, 203, 10, 11, 3, 11, 3, 11, 5, 11, 207, 10, 11, 3, 12, 3, 12, 5, 12, 211, 10, 12, 3, 12, 3, 12, 3, 12, 7, 12, 216, 10, 12, 12, 12, 14, 12, 219, 11, 12, 3, 13, 3, 13, 3, 13, 3, 13, 7, 13, 225, 10, 13, 12, 13, 14, 13, 228, 11, 13, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 7, 15, 235, 10, 15, 12, 15, 14, 15, 238, 11, 15, 3, 16, 3, 16, 3, 16, 3, 17, 5, 17, 244, 10, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 5, 20, 257, 10, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 265, 10, 21, 12, 21, 14, 21, 268, 11, 21, 3, 21, 3, 21, 3, 21, 5, 21, 273, 10, 21, 3, 22, 3, 22, 5, 22, 277, 10, 22, 3, 22, 3, 22, 3, 22, 5, 22, 282, 10, 22, 3, 23, 3, 23, 6, 23, 286, 10, 23, 13, 23, 14, 23, 287, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 5, 24, 301, 10, 24, 3, 25, 3, 25, 7, 25, 305, 10, 25, 12, 25, 14, 25, 308, 11, 25, 3, 25, 3, 25, 3, 25, 7, 25, 313, 10, 25, 12, 25, 14, 25, 316, 11, 25, 3, 25, 5, 25, 319, 10, 25, 3, 26, 3, 26, 3, 26, 3, 26, 7, 26, 325, 10, 26, 12, 26, 14, 26, 328, 11, 26, 5, 26, 330, 10, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 7, 27, 341, 10, 27, 12, 27, 14, 27, 344, 11, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 7, 28, 358, 10, 28, 12, 28, 14, 28, 361, 11, 28, 3, 28, 3, 28, 3, 28, 3, 28, 5, 28, 367, 10, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 7, 28, 376, 10, 28, 12, 28, 14, 28, 379, 11, 28, 3, 28, 5, 28, 382, 10, 28, 3, 28, 3, 28, 5, 28, 386, 10, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 398, 10, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 5, 31, 408, 10, 31, 5, 31, 410, 10, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 5, 34, 431, 10, 34, 3, 34, 3, 34, 5, 34, 435, 10, 34, 3, 34, 3, 34, 5, 34, 439, 10, 34, 3, 34, 3, 34, 5, 34, 443, 10, 34, 3, 34, 3, 34, 5, 34, 447, 10, 34, 3, 34, 3, 34, 3, 34, 3, 34, 5, 34, 453, 10, 34, 3, 34, 3, 34, 5, 34, 457, 10, 34, 3, 34, 3, 34, 5, 34, 461, 10, 34, 3, 34, 3, 34, 5, 34, 465, 10, 34, 3, 34, 3, 34, 3, 34, 3, 34, 5, 34, 471, 10, 34, 3, 34, 3, 34, 5, 34, 475, 10, 34, 3, 34, 3, 34, 5, 34, 479, 10, 34, 3, 34, 3, 34, 3, 34, 3, 34, 5, 34, 485, 10, 34, 3, 34, 3, 34, 5, 34, 489, 10, 34, 3, 34, 3, 34, 3, 34, 3, 34, 5, 34, 495, 10, 34, 3, 34, 3, 34, 5, 34, 499, 10, 34, 3, 35, 3, 35, 3, 35, 2, 2, 4, 14, 16, 36, 2, 2, 4, 2, 6, 2, 8, 2, 10, 2, 12, 2, 14, 2, 16, 2, 18, 2, 20, 2, 22, 2, 24, 2, 26, 2, 28, 2, 30, 2, 32, 2, 34, 2, 36, 2, 38, 2, 40, 2, 42, 2, 44, 2, 46, 2, 48, 2, 50, 2, 52, 2, 54, 2, 56, 2, 58, 2, 60, 2, 62, 2, 64, 2, 66, 2, 68, 2, 2, 8, 3, 2, 46, 48, 3, 2, 44, 45, 4, 2, 26, 26, 56, 56, 5, 2, 17, 17, 23, 23, 30, 30, 4, 2, 6, 6, 8, 8, 8, 2, 9, 13, 16, 19, 21, 26, 28, 34, 36, 37, 57, 58, 2, 555, 2, 70, 3, 2, 2, 2, 4, 73, 3, 2, 2, 2, 6, 76, 3, 2, 2, 2, 8, 80, 3, 2, 2, 2, 10, 84, 3, 2, 2, 2, 12, 92, 3, 2, 2, 2, 14, 108, 3, 2, 2, 2, 16, 184, 3, 2, 2, 2, 18, 199, 3, 2, 2, 2, 20, 202, 3, 2, 2, 2, 22, 208, 3, 2, 2, 2, 24, 220, 3, 2, 2, 2, 26, 229, 3, 2, 2, 2, 28, 232, 3, 2, 2, 2, 30, 239, 3, 2, 2, 2, 32, 243, 3, 2, 2, 2, 34, 250, 3, 2, 2, 2, 36, 253, 3, 2, 2, 2, 38, 256, 3, 2, 2, 2, 40, 272, 3, 2, 2, 2, 42, 281, 3, 2, 2, 2, 44, 285, 3, 2, 2, 2, 46, 300, 3, 2, 2, 2, 48, 318, 3, 2, 2, 2, 50, 320, 3, 2, 2, 2, 52, 333, 3, 2, 2, 2, 54, 385, 3, 2, 2, 2, 56, 387, 3, 2, 2, 2, 58, 392, 3, 2, 2, 2, 60, 401, 3, 2, 2, 2, 62, 413, 3, 2, 2, 2, 64, 419, 3, 2, 2, 2, 66, 425, 3, 2, 2, 2, 68, 500, 3, 2, 2, 2, 70, 71, 5, 16, 9, 2, 71, 72, 7, 2, 2, 3, 72, 3, 3, 2, 2, 2, 73, 74, 5, 14, 8, 2, 74, 75, 7, 2, 2, 3, 75, 5, 3, 2, 2, 2, 76, 77, 5, 18, 10, 2, 77, 78, 7, 2, 2, 3, 78, 7, 3, 2, 2, 2, 79, 81, 5, 12, 7, 2, 80, 79, 3, 2, 2, 2, 80, 81, 3, 2, 2, 2, 81, 82, 3, 2, 2, 2, 82, 83, 7, 2, 2, 3, 83, 9, 3, 2, 2, 2, 84, 85, 5, 20, 11, 2, 85, 86, 7, 2, 2, 3, 86, 11, 3, 2, 2, 2, 87, 93, 7, 61, 2, 2, 88, 89, 7, 60, 2, 2, 89, 90, 5, 14, 8, 2, 90, 91, 7, 59, 2, 2, 91, 93, 3, 2, 2, 2, 92, 87, 3, 2, 2, 2, 92, 88, 3, 2, 2, 2, 93, 94, 3, 2, 2, 2, 94, 92, 3, 2, 2, 2, 94, 95, 3, 2, 2, 2, 95, 13, 3, 2, 2, 2, 96, 97, 8, 8, 1, 2, 97, 98, 7, 49, 2, 2, 98, 99, 5, 14, 8, 2, 99, 100, 7, 50, 2, 2, 100, 109, 3, 2, 2, 2, 101, 109, 5, 46, 24, 2, 102, 109, 5, 42, 22, 2, 103, 109, 5, 54, 28, 2, 104, 105, 7, 45, 2, 2, 105, 109, 5, 14, 8, 6, 106, 107, 7, 44, 2, 2, 107, 109, 5, 14, 8, 5, 108, 96, 3, 2, 2, 2, 108, 101, 3, 2, 2, 2, 108, 102, 3, 2, 2, 2, 108, 103, 3, 2, 2, 2, 108, 104, 3, 2, 2, 2, 108, 106, 3, 2, 2, 2, 109, 118, 3, 2, 2, 2, 110, 111, 12, 4, 2, 2, 111, 112, 9, 2, 2, 2, 112, 117, 5, 14, 8, 5, 113, 114, 12, 3, 2, 2, 114, 115, 9, 3, 2, 2, 115, 117, 5, 14, 8, 4, 116, 110, 3, 2, 2, 2, 116, 113, 3, 2, 2, 2, 117, 120, 3, 2, 2, 2, 118, 116, 3, 2, 2, 2, 118, 119, 3, 2, 2, 2, 119, 15, 3, 2, 2, 2, 120, 118, 3, 2, 2, 2, 121, 122, 8, 9, 1, 2, 122, 123, 7, 49, 2, 2, 123, 124, 5, 16, 9, 2, 124, 125, 7, 50, 2, 2, 125, 185, 3, 2, 2, 2, 126, 127, 9, 4, 2, 2, 127, 185, 5, 16, 9, 17, 128, 129, 5, 14, 8, 2, 129, 131, 7, 21, 2, 2, 130, 132, 7, 26, 2, 2, 131, 130, 3, 2, 2, 2, 131, 132, 3, 2, 2, 2, 132, 133, 3, 2, 2, 2, 133, 134, 7, 27, 2, 2, 134, 185, 3, 2, 2, 2, 135, 136, 5, 14, 8, 2, 136, 138, 7, 21, 2, 2, 137, 139, 7, 26, 2, 2, 138, 137, 3, 2, 2, 2, 138, 139, 3, 2, 2, 2, 139, 140, 3, 2, 2, 2, 140, 141, 7, 14, 2, 2, 141, 185, 3, 2, 2, 2, 142, 143, 5, 14, 8, 2, 143, 144, 7, 42, 2, 2, 144, 145, 5, 14, 8, 2, 145, 185, 3, 2, 2, 2, 146, 147, 5, 14, 8, 2, 147, 148, 7, 43, 2, 2, 148, 149, 5, 14, 8, 2, 149, 185, 3, 2, 2, 2, 150, 151, 5, 14, 8, 2, 151, 152, 7, 40, 2, 2, 152, 153, 5, 14, 8, 2, 153, 185, 3, 2, 2, 2, 154, 155, 5, 14, 8, 2, 155, 156, 7, 41, 2, 2, 156, 157, 5, 14, 8, 2, 157, 185, 3, 2, 2, 2, 158, 159, 5, 14, 8, 2, 159, 160, 7, 38, 2, 2, 160, 161, 5, 14, 8, 2, 161, 185, 3, 2, 2, 2, 162, 163, 5, 14, 8, 2, 163, 164, 7, 39, 2, 2, 164, 165, 5, 14, 8, 2, 165, 185, 3, 2, 2, 2, 166, 168, 5, 14, 8, 2, 167, 169, 7, 26, 2, 2, 168, 167, 3, 2, 2, 2, 168, 169, 3, 2, 2, 2, 169, 170, 3, 2, 2, 2, 170, 171, 7, 19, 2, 2, 171, 172, 5, 40, 21, 2, 172, 185, 3, 2, 2, 2, 173, 175, 5, 14, 8, 2, 174, 176, 7, 26, 2, 2, 175, 174, 3, 2, 2, 2, 175, 176, 3, 2, 2, 2, 176, 177, 3, 2, 2, 2, 177, 178, 7, 10, 2, 2, 178, 179, 5, 14, 8, 2, 179, 180, 7, 9, 2, 2, 180, 181, 5, 14, 8, 2, 181, 185, 3, 2, 2, 2, 182, 185, 5, 54, 28, 2, 183, 185, 5, 42, 22, 2, 184, 121, 3, 2, 2, 2, 184, 126, 3, 2, 2, 2, 184, 128, 3, 2, 2, 2, 184, 135, 3, 2, 2, 2, 184, 142, 3, 2, 2, 2, 184, 146, 3, 2, 2, 2, 184, 150, 3, 2, 2, 2, 184, 154, 3, 2, 2, 2, 184, 158, 3, 2, 2, 2, 184, 162, 3, 2, 2, 2, 184, 166, 3, 2, 2, 2, 184, 173, 3, 2, 2, 2, 184, 182, 3, 2, 2, 2, 184, 183, 3, 2, 2, 2, 185, 194, 3, 2, 2, 2, 186, 187, 12, 16, 2, 2, 187, 188, 7, 9, 2, 2, 188, 193, 5, 16, 9, 17, 189, 190, 12, 15, 2, 2, 190, 191, 7, 29, 2, 2, 191, 193, 5, 16, 9, 16, 192, 186, 3, 2, 2, 2, 192, 189, 3, 2, 2, 2, 193, 196, 3, 2, 2, 2, 194, 192, 3, 2, 2, 2, 194, 195, 3, 2, 2, 2, 195, 17, 3, 2, 2, 2, 196, 194, 3, 2, 2, 2, 197, 200, 5, 14, 8, 2, 198, 200, 5, 16, 9, 2, 199, 197, 3, 2, 2, 2, 199, 198, 3, 2, 2, 2, 200, 19, 3, 2, 2, 2, 201, 203, 5, 22, 12, 2, 202, 201, 3, 2, 2, 2, 202, 203, 3, 2, 2, 2, 203, 204, 3, 2, 2, 2, 204, 206, 5, 24, 13, 2, 205, 207, 5, 26, 14, 2, 206, 205, 3, 2, 2, 2, 206, 207, 3, 2, 2, 2, 207, 21, 3, 2, 2, 2, 208, 210, 7, 32, 2, 2, 209, 211, 7, 13, 2, 2, 210, 209, 3, 2, 2, 2, 210, 211, 3, 2, 2, 2, 211, 212, 3, 2, 2, 2, 212, 217, 5, 14, 8, 2, 213, 214, 7, 53, 2, 2, 214, 216, 5, 14, 8, 2, 215, 213, 3, 2, 2, 2, 216, 219, 3, 2, 2, 2, 217, 215, 3, 2, 2, 2, 217, 218, 3, 2, 2, 2, 218, 23, 3, 2, 2, 2, 219, 217, 3, 2, 2, 2, 220, 221, 7, 16, 2, 2, 221, 226, 5, 28, 15, 2, 222, 223, 7, 53, 2, 2, 223, 225, 5, 28, 15, 2, 224, 222, 3, 2, 2, 2, 225, 228, 3, 2, 2, 2, 226, 224, 3, 2, 2, 2, 226, 227, 3, 2, 2, 2, 227, 25, 3, 2, 2, 2, 228, 226, 3, 2, 2, 2, 229, 230, 7, 36, 2, 2, 230, 231, 5, 16, 9, 2, 231, 27, 3, 2, 2, 2, 232, 236, 5, 30, 16, 2, 233, 235, 5, 32, 17, 2, 234, 233, 3, 2, 2, 2, 235, 238, 3, 2, 2, 2, 236, 234, 3, 2, 2, 2, 236, 237, 3, 2, 2, 2, 237, 29, 3, 2, 2, 2, 238, 236, 3, 2, 2, 2, 239, 240, 5, 36, 19, 2, 240, 241, 5, 38, 20, 2, 241, 31, 3, 2, 2, 2, 242, 244, 9, 5, 2, 2, 243, 242, 3, 2, 2, 2, 243, 244, 3, 2, 2, 2, 244, 245, 3, 2, 2, 2, 245, 246, 7, 22, 2, 2, 246, 247, 5, 34, 18, 2, 247, 248, 7, 28, 2, 2, 248, 249, 5, 16, 9, 2, 249, 33, 3, 2, 2, 2, 250, 251, 5, 36, 19, 2, 251, 252, 5, 38, 20, 2, 252, 35, 3, 2, 2, 2, 253, 254, 5, 68, 35, 2, 254, 37, 3, 2, 2, 2, 255, 257, 7, 66, 2, 2, 256, 255, 3, 2, 2, 2, 256, 257, 3, 2, 2, 2, 257, 258, 3, 2, 2, 2, 258, 259, 5, 68, 35, 2, 259, 39, 3, 2, 2, 2, 260, 261, 7, 49, 2, 2, 261, 266, 5, 14, 8, 2, 262, 263, 7, 53, 2, 2, 263, 265, 5, 14, 8, 2, 264, 262, 3, 2, 2, 2, 265, 268, 3, 2, 2, 2, 266, 264, 3, 2, 2, 2, 266, 267, 3, 2, 2, 2, 267, 269, 3, 2, 2, 2, 268, 266, 3, 2, 2, 2, 269, 270, 7, 50, 2, 2, 270, 273, 3, 2, 2, 2, 271, 273, 5, 14, 8, 2, 272, 260, 3, 2, 2, 2, 272, 271, 3, 2, 2, 2, 273, 41, 3, 2, 2, 2, 274, 276, 5, 68, 35, 2, 275, 277, 5, 44, 23, 2, 276, 275, 3, 2, 2, 2, 276, 277, 3, 2, 2, 2, 277, 282, 3, 2, 2, 2, 278, 279, 5, 54, 28, 2, 279, 280, 5, 44, 23, 2, 280, 282, 3, 2, 2, 2, 281, 274, 3, 2, 2, 2, 281, 278, 3, 2, 2, 2, 282, 43, 3, 2, 2, 2, 283, 284, 7, 54, 2, 2, 284, 286, 5, 68, 35, 2, 285, 283, 3, 2, 2, 2, 286, 287, 3, 2, 2, 2, 287, 285, 3, 2, 2, 2, 287, 288, 3, 2, 2, 2, 288, 45, 3, 2, 2, 2, 289, 301, 7, 7, 2, 2, 290, 301, 7, 6, 2, 2, 291, 301, 5, 48, 25, 2, 292, 301, 7, 35, 2, 2, 293, 301, 7, 15, 2, 2, 294, 301, 5, 56, 29, 2, 295, 301, 5, 58, 30, 2, 296, 301, 5, 60, 31, 2, 297, 301, 5, 66, 34, 2, 298, 301, 5, 50, 26, 2, 299, 301, 5, 52, 27, 2, 300, 289, 3, 2, 2, 2, 300, 290, 3, 2, 2, 2, 300, 291, 3, 2, 2, 2, 300, 292, 3, 2, 2, 2, 300, 293, 3, 2, 2, 2, 300, 294, 3, 2, 2, 2, 300, 295, 3, 2, 2, 2, 300, 296, 3, 2, 2, 2, 300, 297, 3, 2, 2, 2, 300, 298, 3, 2, 2, 2, 300, 299, 3, 2, 2, 2, 301, 47, 3, 2, 2, 2, 302, 306, 7, 4, 2, 2, 303, 305, 7, 62, 2, 2, 304, 303, 3, 2, 2, 2, 305, 308, 3, 2, 2, 2, 306, 304, 3, 2, 2, 2, 306, 307, 3, 2, 2, 2, 307, 309, 3, 2, 2, 2, 308, 306, 3, 2, 2, 2, 309, 319, 7, 63, 2, 2, 310, 314, 7, 5, 2, 2, 311, 313, 7, 64, 2, 2, 312, 311, 3, 2, 2, 2, 313, 316, 3, 2, 2, 2, 314, 312, 3, 2, 2, 2, 314, 315, 3, 2, 2, 2, 315, 317, 3, 2, 2, 2, 316, 314, 3, 2, 2, 2, 317, 319, 7, 65, 2, 2, 318, 302, 3, 2, 2, 2, 318, 310, 3, 2, 2, 2, 319, 49, 3, 2, 2, 2, 320, 329, 7, 51, 2, 2, 321, 326, 5, 46, 24, 2, 322, 323, 7, 53, 2, 2, 323, 325, 5, 46, 24, 2, 324, 322, 3, 2, 2, 2, 325, 328, 3, 2, 2, 2, 326, 324, 3, 2, 2, 2, 326, 327, 3, 2, 2, 2, 327, 330, 3, 2, 2, 2, 328, 326, 3, 2, 2, 2, 329, 321, 3, 2, 2, 2, 329, 330, 3, 2, 2, 2, 330, 331, 3, 2, 2, 2, 331, 332, 7, 52, 2, 2, 332, 51, 3, 2, 2, 2, 333, 334, 5, 68, 35, 2, 334, 342, 7, 49, 2, 2, 335, 336, 5, 68, 35, 2, 336, 337, 7, 42, 2, 2, 337, 338, 5, 18, 10, 2, 338, 339, 7, 53, 2, 2, 339, 341, 3, 2, 2, 2, 340, 335, 3, 2, 2, 2, 341, 344, 3, 2, 2, 2, 342, 340, 3, 2, 2, 2, 342, 343, 3, 2, 2, 2, 343, 345, 3, 2, 2, 2, 344, 342, 3, 2, 2, 2, 345, 346, 5, 68, 35, 2, 346, 347, 7, 42, 2, 2, 347, 348, 5, 18, 10, 2, 348, 349, 7, 50, 2, 2, 349, 53, 3, 2, 2, 2, 350, 351, 5, 68, 35, 2, 351, 366, 7, 49, 2, 2, 352, 353, 5, 68, 35, 2, 353, 354, 7, 42, 2, 2, 354, 355, 5, 18, 10, 2, 355, 356, 7, 53, 2, 2, 356, 358, 3, 2, 2, 2, 357, 352, 3, 2, 2, 2, 358, 361, 3, 2, 2, 2, 359, 357, 3, 2, 2, 2, 359, 360, 3, 2, 2, 2, 360, 362, 3, 2, 2, 2, 361, 359, 3, 2, 2, 2, 362, 363, 5, 68, 35, 2, 363, 364, 7, 42, 2, 2, 364, 365, 5, 18, 10, 2, 365, 367, 3, 2, 2, 2, 366, 359, 3, 2, 2, 2, 366, 367, 3, 2, 2, 2, 367, 368, 3, 2, 2, 2, 368, 369, 7, 50, 2, 2, 369, 386, 3, 2, 2, 2, 370, 371, 5, 68, 35, 2, 371, 381, 7, 49, 2, 2, 372, 373, 5, 18, 10, 2, 373, 374, 7, 53, 2, 2, 374, 376, 3, 2, 2, 2, 375, 372, 3, 2, 2, 2, 376, 379, 3, 2, 2, 2, 377, 375, 3, 2, 2, 2, 377, 378, 3, 2, 2, 2, 378, 380, 3, 2, 2, 2, 379, 377, 3, 2, 2, 2, 380, 382, 5, 18, 10, 2, 381, 377, 3, 2, 2, 2, 381, 382, 3, 2, 2, 2, 382, 383, 3, 2, 2, 2, 383, 384, 7, 50, 2, 2, 384, 386, 3, 2, 2, 2, 385, 350, 3, 2, 2, 2, 385, 370, 3, 2, 2, 2, 386, 55, 3, 2, 2, 2, 387, 388, 7, 11, 2, 2, 388, 389, 7, 49, 2, 2, 389, 390, 5, 62, 32, 2, 390, 391, 7, 50, 2, 2, 391, 57, 3, 2, 2, 2, 392, 393, 7, 33, 2, 2, 393, 394, 7, 49, 2, 2, 394, 397, 5, 64, 33, 2, 395, 396, 7, 54, 2, 2, 396, 398, 9, 6, 2, 2, 397, 395, 3, 2, 2, 2, 397, 398, 3, 2, 2, 2, 398, 399, 3, 2, 2, 2, 399, 400, 7, 50, 2, 2, 400, 59, 3, 2, 2, 2, 401, 402, 7, 34, 2, 2, 402, 403, 7, 49, 2, 2, 403, 409, 5, 62, 32, 2, 404, 407, 5, 64, 33, 2, 405, 406, 7, 54, 2, 2, 406, 408, 9, 6, 2, 2, 407, 405, 3, 2, 2, 2, 407, 408, 3, 2, 2, 2, 408, 410, 3, 2, 2, 2, 409, 404, 3, 2, 2, 2, 409, 410, 3, 2, 2, 2, 410, 411, 3, 2, 2, 2, 411, 412, 7, 50, 2, 2, 412, 61, 3, 2, 2, 2, 413, 414, 7, 6, 2, 2, 414, 415, 7, 45, 2, 2, 415, 416, 9, 6, 2, 2, 416, 417, 7, 45, 2, 2, 417, 418, 9, 6, 2, 2, 418, 63, 3, 2, 2, 2, 419, 420, 9, 6, 2, 2, 420, 421, 7, 55, 2, 2, 421, 422, 9, 6, 2, 2, 422, 423, 7, 55, 2, 2, 423, 424, 9, 6, 2, 2, 424, 65, 3, 2, 2, 2, 425, 498, 7, 20, 2, 2, 426, 427, 7, 6, 2, 2, 427, 430, 7, 37, 2, 2, 428, 429, 7, 6, 2, 2, 429, 431, 7, 25, 2, 2, 430, 428, 3, 2, 2, 2, 430, 431, 3, 2, 2, 2, 431, 434, 3, 2, 2, 2, 432, 433, 7, 6, 2, 2, 433, 435, 7, 12, 2, 2, 434, 432, 3, 2, 2, 2, 434, 435, 3, 2, 2, 2, 435, 438, 3, 2, 2, 2, 436, 437, 7, 6, 2, 2, 437, 439, 7, 18, 2, 2, 438, 436, 3, 2, 2, 2, 438, 439, 3, 2, 2, 2, 439, 442, 3, 2, 2, 2, 440, 441, 7, 6, 2, 2, 441, 443, 7, 24, 2, 2, 442, 440, 3, 2, 2, 2, 442, 443, 3, 2, 2, 2, 443, 446, 3, 2, 2, 2, 444, 445, 7, 6, 2, 2, 445, 447, 7, 31, 2, 2, 446, 444, 3, 2, 2, 2, 446, 447, 3, 2, 2, 2, 447, 499, 3, 2, 2, 2, 448, 449, 7, 6, 2, 2, 449, 452, 7, 25, 2, 2, 450, 451, 7, 6, 2, 2, 451, 453, 7, 12, 2, 2, 452, 450, 3, 2, 2, 2, 452, 453, 3, 2, 2, 2, 453, 456, 3, 2, 2, 2, 454, 455, 7, 6, 2, 2, 455, 457, 7, 18, 2, 2, 456, 454, 3, 2, 2, 2, 456, 457, 3, 2, 2, 2, 457, 460, 3, 2, 2, 2, 458, 459, 7, 6, 2, 2, 459, 461, 7, 24, 2, 2, 460, 458, 3, 2, 2, 2, 460, 461, 3, 2, 2, 2, 461, 464, 3, 2, 2, 2, 462, 463, 7, 6, 2, 2, 463, 465, 7, 31, 2, 2, 464, 462, 3, 2, 2, 2, 464, 465, 3, 2, 2, 2, 465, 499, 3, 2, 2, 2, 466, 467, 7, 6, 2, 2, 467, 470, 7, 12, 2, 2, 468, 469, 7, 6, 2, 2, 469, 471, 7, 18, 2, 2, 470, 468, 3, 2, 2, 2, 470, 471, 3, 2, 2, 2, 471, 474, 3, 2, 2, 2, 472, 473, 7, 6, 2, 2, 473, 475, 7, 24, 2, 2, 474, 472, 3, 2, 2, 2, 474, 475, 3, 2, 2, 2, 475, 478, 3, 2, 2, 2, 476, 477, 7, 6, 2, 2, 477, 479, 7, 31, 2, 2, 478, 476, 3, 2, 2, 2, 478, 479, 3, 2, 2, 2, 479, 499, 3, 2, 2, 2, 480, 481, 7, 6, 2, 2, 481, 484, 7, 18, 2, 2, 482, 483, 7, 6, 2, 2, 483, 485, 7, 24, 2, 2, 484, 482, 3, 2, 2, 2, 484, 485, 3, 2, 2, 2, 485, 488, 3, 2, 2, 2, 486, 487, 7, 6, 2, 2, 487, 489, 7, 31, 2, 2, 488, 486, 3, 2, 2, 2, 488, 489, 3, 2, 2, 2, 489, 499, 3, 2, 2, 2, 490, 491, 7, 6, 2, 2, 491, 494, 7, 24, 2, 2, 492, 493, 7, 6, 2, 2, 493, 495, 7, 31, 2, 2, 494, 492, 3, 2, 2, 2, 494, 495, 3, 2, 2, 2, 495, 499, 3, 2, 2, 2, 496, 497, 7, 6, 2, 2, 497, 499, 7, 31, 2, 2, 498, 426, 3, 2, 2, 2, 498, 448, 3, 2, 2, 2, 498, 466, 3, 2, 2, 2, 498, 480, 3, 2, 2, 2, 498, 490, 3, 2, 2, 2, 498, 496, 3, 2, 2, 2, 499, 67, 3, 2, 2, 2, 500, 501, 9, 7, 2, 2, 501, 69, 3, 2, 2, 2, 60, 80, 92, 94, 108, 116, 118, 131, 138, 168, 175, 184, 192, 194, 199, 202, 206, 210, 217, 226, 236, 243, 256, 266, 272, 276, 281, 287, 300, 306, 314, 318, 326, 329, 342, 359, 366, 377, 381, 385, 397, 407, 409, 430, 434, 438, 442, 446, 452, 456, 460, 464, 470, 474, 478, 484, 488, 494, 498] \ No newline at end of file diff --git a/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionParser.tokens b/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionParser.tokens index 7d9b433..5d233f6 100644 --- a/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionParser.tokens +++ b/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionParser.tokens @@ -8,67 +8,77 @@ AND=7 BETWEEN=8 DATE=9 DAYS=10 -EMPTY=11 -FALSE=12 -HOURS=13 -IN=14 -INTERVAL=15 -IS=16 -MINUTES=17 -MONTHS=18 -NOT=19 -NULL=20 -OR=21 -SECONDS=22 -TIME=23 -TIMESTAMP=24 -TRUE=25 -YEARS=26 -LESS=27 -LESS_EQUAL=28 -GREATER=29 -GREATER_EQUAL=30 -EQUAL=31 -NOT_EQUAL=32 -PLUS=33 -MINUS=34 -ASTERISK=35 -SLASH=36 -PERCENT=37 -LP=38 -RP=39 -LB=40 -RB=41 -COMMA=42 -DOT=43 -COLON=44 -EXCLAMATION_MARK=45 -IDENTIFIER=46 -QUOTED_IDENTIFIER=47 -EXPRESSION_END=48 -EXPRESSION_START=49 -TEXT=50 -TEXT_IN_QUOTE=51 -END_QUOTE=52 -TEXT_IN_DOUBLE_QUOTE=53 -END_DOUBLE_QUOTE=54 -'<'=27 -'<='=28 -'>'=29 -'>='=30 -'='=31 -'+'=33 -'-'=34 -'*'=35 -'/'=36 -'%'=37 -'('=38 -')'=39 -'['=40 -']'=41 -','=42 -'.'=43 -':'=44 -'!'=45 -'}'=48 -'#{'=49 +DISTINCT=11 +EMPTY=12 +FALSE=13 +FROM=14 +FULL=15 +HOURS=16 +IN=17 +INTERVAL=18 +IS=19 +JOIN=20 +LEFT=21 +MINUTES=22 +MONTHS=23 +NOT=24 +NULL=25 +ON=26 +OR=27 +RIGHT=28 +SECONDS=29 +SELECT=30 +TIME=31 +TIMESTAMP=32 +TRUE=33 +WHERE=34 +YEARS=35 +LESS=36 +LESS_EQUAL=37 +GREATER=38 +GREATER_EQUAL=39 +EQUAL=40 +NOT_EQUAL=41 +PLUS=42 +MINUS=43 +ASTERISK=44 +SLASH=45 +PERCENT=46 +LP=47 +RP=48 +LB=49 +RB=50 +COMMA=51 +DOT=52 +COLON=53 +EXCLAMATION_MARK=54 +IDENTIFIER=55 +QUOTED_IDENTIFIER=56 +EXPRESSION_END=57 +EXPRESSION_START=58 +TEXT=59 +TEXT_IN_QUOTE=60 +END_QUOTE=61 +TEXT_IN_DOUBLE_QUOTE=62 +END_DOUBLE_QUOTE=63 +AS=64 +'<'=36 +'<='=37 +'>'=38 +'>='=39 +'='=40 +'+'=42 +'-'=43 +'*'=44 +'/'=45 +'%'=46 +'('=47 +')'=48 +'['=49 +']'=50 +','=51 +'.'=52 +':'=53 +'!'=54 +'}'=57 +'#{'=58 diff --git a/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionParser.ts b/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionParser.ts index 74e2aa6..f549e5d 100644 --- a/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionParser.ts +++ b/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionParser.ts @@ -38,79 +38,102 @@ export class BlazeExpressionParser extends Parser { public static readonly BETWEEN = 8; public static readonly DATE = 9; public static readonly DAYS = 10; - public static readonly EMPTY = 11; - public static readonly FALSE = 12; - public static readonly HOURS = 13; - public static readonly IN = 14; - public static readonly INTERVAL = 15; - public static readonly IS = 16; - public static readonly MINUTES = 17; - public static readonly MONTHS = 18; - public static readonly NOT = 19; - public static readonly NULL = 20; - public static readonly OR = 21; - public static readonly SECONDS = 22; - public static readonly TIME = 23; - public static readonly TIMESTAMP = 24; - public static readonly TRUE = 25; - public static readonly YEARS = 26; - public static readonly LESS = 27; - public static readonly LESS_EQUAL = 28; - public static readonly GREATER = 29; - public static readonly GREATER_EQUAL = 30; - public static readonly EQUAL = 31; - public static readonly NOT_EQUAL = 32; - public static readonly PLUS = 33; - public static readonly MINUS = 34; - public static readonly ASTERISK = 35; - public static readonly SLASH = 36; - public static readonly PERCENT = 37; - public static readonly LP = 38; - public static readonly RP = 39; - public static readonly LB = 40; - public static readonly RB = 41; - public static readonly COMMA = 42; - public static readonly DOT = 43; - public static readonly COLON = 44; - public static readonly EXCLAMATION_MARK = 45; - public static readonly IDENTIFIER = 46; - public static readonly QUOTED_IDENTIFIER = 47; - public static readonly EXPRESSION_END = 48; - public static readonly EXPRESSION_START = 49; - public static readonly TEXT = 50; - public static readonly TEXT_IN_QUOTE = 51; - public static readonly END_QUOTE = 52; - public static readonly TEXT_IN_DOUBLE_QUOTE = 53; - public static readonly END_DOUBLE_QUOTE = 54; + public static readonly DISTINCT = 11; + public static readonly EMPTY = 12; + public static readonly FALSE = 13; + public static readonly FROM = 14; + public static readonly FULL = 15; + public static readonly HOURS = 16; + public static readonly IN = 17; + public static readonly INTERVAL = 18; + public static readonly IS = 19; + public static readonly JOIN = 20; + public static readonly LEFT = 21; + public static readonly MINUTES = 22; + public static readonly MONTHS = 23; + public static readonly NOT = 24; + public static readonly NULL = 25; + public static readonly ON = 26; + public static readonly OR = 27; + public static readonly RIGHT = 28; + public static readonly SECONDS = 29; + public static readonly SELECT = 30; + public static readonly TIME = 31; + public static readonly TIMESTAMP = 32; + public static readonly TRUE = 33; + public static readonly WHERE = 34; + public static readonly YEARS = 35; + public static readonly LESS = 36; + public static readonly LESS_EQUAL = 37; + public static readonly GREATER = 38; + public static readonly GREATER_EQUAL = 39; + public static readonly EQUAL = 40; + public static readonly NOT_EQUAL = 41; + public static readonly PLUS = 42; + public static readonly MINUS = 43; + public static readonly ASTERISK = 44; + public static readonly SLASH = 45; + public static readonly PERCENT = 46; + public static readonly LP = 47; + public static readonly RP = 48; + public static readonly LB = 49; + public static readonly RB = 50; + public static readonly COMMA = 51; + public static readonly DOT = 52; + public static readonly COLON = 53; + public static readonly EXCLAMATION_MARK = 54; + public static readonly IDENTIFIER = 55; + public static readonly QUOTED_IDENTIFIER = 56; + public static readonly EXPRESSION_END = 57; + public static readonly EXPRESSION_START = 58; + public static readonly TEXT = 59; + public static readonly TEXT_IN_QUOTE = 60; + public static readonly END_QUOTE = 61; + public static readonly TEXT_IN_DOUBLE_QUOTE = 62; + public static readonly END_DOUBLE_QUOTE = 63; + public static readonly AS = 64; public static readonly RULE_parsePredicate = 0; public static readonly RULE_parseExpression = 1; public static readonly RULE_parseExpressionOrPredicate = 2; public static readonly RULE_parseTemplate = 3; - public static readonly RULE_template = 4; - public static readonly RULE_expression = 5; - public static readonly RULE_predicate = 6; - public static readonly RULE_predicateOrExpression = 7; - public static readonly RULE_inList = 8; - public static readonly RULE_path = 9; - public static readonly RULE_pathAttributes = 10; - public static readonly RULE_literal = 11; - public static readonly RULE_stringLiteral = 12; - public static readonly RULE_collectionLiteral = 13; - public static readonly RULE_entityLiteral = 14; - public static readonly RULE_functionInvocation = 15; - public static readonly RULE_dateLiteral = 16; - public static readonly RULE_timeLiteral = 17; - public static readonly RULE_timestampLiteral = 18; - public static readonly RULE_datePart = 19; - public static readonly RULE_timePart = 20; - public static readonly RULE_temporalIntervalLiteral = 21; - public static readonly RULE_identifier = 22; + public static readonly RULE_parseQuery = 4; + public static readonly RULE_template = 5; + public static readonly RULE_expression = 6; + public static readonly RULE_predicate = 7; + public static readonly RULE_predicateOrExpression = 8; + public static readonly RULE_query = 9; + public static readonly RULE_selectClause = 10; + public static readonly RULE_fromClause = 11; + public static readonly RULE_whereClause = 12; + public static readonly RULE_fromItem = 13; + public static readonly RULE_fromRoot = 14; + public static readonly RULE_join = 15; + public static readonly RULE_joinTarget = 16; + public static readonly RULE_domainTypeName = 17; + public static readonly RULE_variable = 18; + public static readonly RULE_inList = 19; + public static readonly RULE_path = 20; + public static readonly RULE_pathAttributes = 21; + public static readonly RULE_literal = 22; + public static readonly RULE_stringLiteral = 23; + public static readonly RULE_collectionLiteral = 24; + public static readonly RULE_entityLiteral = 25; + public static readonly RULE_functionInvocation = 26; + public static readonly RULE_dateLiteral = 27; + public static readonly RULE_timeLiteral = 28; + public static readonly RULE_timestampLiteral = 29; + public static readonly RULE_datePart = 30; + public static readonly RULE_timePart = 31; + public static readonly RULE_temporalIntervalLiteral = 32; + public static readonly RULE_identifier = 33; // tslint:disable:no-trailing-whitespace public static readonly ruleNames: string[] = [ "parsePredicate", "parseExpression", "parseExpressionOrPredicate", "parseTemplate", - "template", "expression", "predicate", "predicateOrExpression", "inList", - "path", "pathAttributes", "literal", "stringLiteral", "collectionLiteral", - "entityLiteral", "functionInvocation", "dateLiteral", "timeLiteral", "timestampLiteral", + "parseQuery", "template", "expression", "predicate", "predicateOrExpression", + "query", "selectClause", "fromClause", "whereClause", "fromItem", "fromRoot", + "join", "joinTarget", "domainTypeName", "variable", "inList", "path", + "pathAttributes", "literal", "stringLiteral", "collectionLiteral", "entityLiteral", + "functionInvocation", "dateLiteral", "timeLiteral", "timestampLiteral", "datePart", "timePart", "temporalIntervalLiteral", "identifier", ]; @@ -118,21 +141,23 @@ export class BlazeExpressionParser extends Parser { undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, - undefined, undefined, undefined, undefined, undefined, undefined, "'<'", - "'<='", "'>'", "'>='", "'='", undefined, "'+'", "'-'", "'*'", "'/'", "'%'", - "'('", "')'", "'['", "']'", "','", "'.'", "':'", "'!'", undefined, undefined, - "'}'", "'#{'", + undefined, undefined, undefined, undefined, undefined, undefined, undefined, + undefined, undefined, undefined, undefined, undefined, undefined, undefined, + undefined, "'<'", "'<='", "'>'", "'>='", "'='", undefined, "'+'", "'-'", + "'*'", "'/'", "'%'", "'('", "')'", "'['", "']'", "','", "'.'", "':'", + "'!'", undefined, undefined, "'}'", "'#{'", ]; private static readonly _SYMBOLIC_NAMES: Array = [ undefined, "WS", "START_QUOTE", "START_DOUBLE_QUOTE", "INTEGER_LITERAL", "NUMERIC_LITERAL", "LEADING_ZERO_INTEGER_LITERAL", "AND", "BETWEEN", "DATE", - "DAYS", "EMPTY", "FALSE", "HOURS", "IN", "INTERVAL", "IS", "MINUTES", - "MONTHS", "NOT", "NULL", "OR", "SECONDS", "TIME", "TIMESTAMP", "TRUE", - "YEARS", "LESS", "LESS_EQUAL", "GREATER", "GREATER_EQUAL", "EQUAL", "NOT_EQUAL", + "DAYS", "DISTINCT", "EMPTY", "FALSE", "FROM", "FULL", "HOURS", "IN", "INTERVAL", + "IS", "JOIN", "LEFT", "MINUTES", "MONTHS", "NOT", "NULL", "ON", "OR", + "RIGHT", "SECONDS", "SELECT", "TIME", "TIMESTAMP", "TRUE", "WHERE", "YEARS", + "LESS", "LESS_EQUAL", "GREATER", "GREATER_EQUAL", "EQUAL", "NOT_EQUAL", "PLUS", "MINUS", "ASTERISK", "SLASH", "PERCENT", "LP", "RP", "LB", "RB", "COMMA", "DOT", "COLON", "EXCLAMATION_MARK", "IDENTIFIER", "QUOTED_IDENTIFIER", "EXPRESSION_END", "EXPRESSION_START", "TEXT", "TEXT_IN_QUOTE", "END_QUOTE", - "TEXT_IN_DOUBLE_QUOTE", "END_DOUBLE_QUOTE", + "TEXT_IN_DOUBLE_QUOTE", "END_DOUBLE_QUOTE", "AS", ]; public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(BlazeExpressionParser._LITERAL_NAMES, BlazeExpressionParser._SYMBOLIC_NAMES, []); @@ -167,9 +192,9 @@ export class BlazeExpressionParser extends Parser { try { this.enterOuterAlt(_localctx, 1); { - this.state = 46; + this.state = 68; this.predicate(0); - this.state = 47; + this.state = 69; this.match(BlazeExpressionParser.EOF); } } @@ -194,9 +219,9 @@ export class BlazeExpressionParser extends Parser { try { this.enterOuterAlt(_localctx, 1); { - this.state = 49; + this.state = 71; this.expression(0); - this.state = 50; + this.state = 72; this.match(BlazeExpressionParser.EOF); } } @@ -221,9 +246,9 @@ export class BlazeExpressionParser extends Parser { try { this.enterOuterAlt(_localctx, 1); { - this.state = 52; + this.state = 74; this.predicateOrExpression(); - this.state = 53; + this.state = 75; this.match(BlazeExpressionParser.EOF); } } @@ -249,17 +274,44 @@ export class BlazeExpressionParser extends Parser { try { this.enterOuterAlt(_localctx, 1); { - this.state = 56; + this.state = 78; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === BlazeExpressionParser.EXPRESSION_START || _la === BlazeExpressionParser.TEXT) { { - this.state = 55; + this.state = 77; this.template(); } } - this.state = 58; + this.state = 80; + this.match(BlazeExpressionParser.EOF); + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public parseQuery(): ParseQueryContext { + let _localctx: ParseQueryContext = new ParseQueryContext(this._ctx, this.state); + this.enterRule(_localctx, 8, BlazeExpressionParser.RULE_parseQuery); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 82; + this.query(); + this.state = 83; this.match(BlazeExpressionParser.EOF); } } @@ -280,33 +332,33 @@ export class BlazeExpressionParser extends Parser { // @RuleVersion(0) public template(): TemplateContext { let _localctx: TemplateContext = new TemplateContext(this._ctx, this.state); - this.enterRule(_localctx, 8, BlazeExpressionParser.RULE_template); + this.enterRule(_localctx, 10, BlazeExpressionParser.RULE_template); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 65; + this.state = 90; this._errHandler.sync(this); _la = this._input.LA(1); do { { - this.state = 65; + this.state = 90; this._errHandler.sync(this); switch (this._input.LA(1)) { case BlazeExpressionParser.TEXT: { - this.state = 60; + this.state = 85; this.match(BlazeExpressionParser.TEXT); } break; case BlazeExpressionParser.EXPRESSION_START: { { - this.state = 61; + this.state = 86; this.match(BlazeExpressionParser.EXPRESSION_START); - this.state = 62; + this.state = 87; this.expression(0); - this.state = 63; + this.state = 88; this.match(BlazeExpressionParser.EXPRESSION_END); } } @@ -315,7 +367,7 @@ export class BlazeExpressionParser extends Parser { throw new NoViableAltException(this); } } - this.state = 67; + this.state = 92; this._errHandler.sync(this); _la = this._input.LA(1); } while (_la === BlazeExpressionParser.EXPRESSION_START || _la === BlazeExpressionParser.TEXT); @@ -348,14 +400,14 @@ export class BlazeExpressionParser extends Parser { let _parentState: number = this.state; let _localctx: ExpressionContext = new ExpressionContext(this._ctx, _parentState); let _prevctx: ExpressionContext = _localctx; - let _startState: number = 10; - this.enterRecursionRule(_localctx, 10, BlazeExpressionParser.RULE_expression, _p); + let _startState: number = 12; + this.enterRecursionRule(_localctx, 12, BlazeExpressionParser.RULE_expression, _p); let _la: number; try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 81; + this.state = 106; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input, 3, this._ctx) ) { case 1: @@ -364,11 +416,11 @@ export class BlazeExpressionParser extends Parser { this._ctx = _localctx; _prevctx = _localctx; - this.state = 70; + this.state = 95; this.match(BlazeExpressionParser.LP); - this.state = 71; + this.state = 96; this.expression(0); - this.state = 72; + this.state = 97; this.match(BlazeExpressionParser.RP); } break; @@ -378,7 +430,7 @@ export class BlazeExpressionParser extends Parser { _localctx = new LiteralExpressionContext(_localctx); this._ctx = _localctx; _prevctx = _localctx; - this.state = 74; + this.state = 99; this.literal(); } break; @@ -388,7 +440,7 @@ export class BlazeExpressionParser extends Parser { _localctx = new PathExpressionContext(_localctx); this._ctx = _localctx; _prevctx = _localctx; - this.state = 75; + this.state = 100; this.path(); } break; @@ -398,7 +450,7 @@ export class BlazeExpressionParser extends Parser { _localctx = new FunctionExpressionContext(_localctx); this._ctx = _localctx; _prevctx = _localctx; - this.state = 76; + this.state = 101; this.functionInvocation(); } break; @@ -408,9 +460,9 @@ export class BlazeExpressionParser extends Parser { _localctx = new UnaryMinusExpressionContext(_localctx); this._ctx = _localctx; _prevctx = _localctx; - this.state = 77; + this.state = 102; this.match(BlazeExpressionParser.MINUS); - this.state = 78; + this.state = 103; this.expression(4); } break; @@ -420,15 +472,15 @@ export class BlazeExpressionParser extends Parser { _localctx = new UnaryPlusExpressionContext(_localctx); this._ctx = _localctx; _prevctx = _localctx; - this.state = 79; + this.state = 104; this.match(BlazeExpressionParser.PLUS); - this.state = 80; + this.state = 105; this.expression(3); } break; } this._ctx._stop = this._input.tryLT(-1); - this.state = 91; + this.state = 116; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 5, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { @@ -438,7 +490,7 @@ export class BlazeExpressionParser extends Parser { } _prevctx = _localctx; { - this.state = 89; + this.state = 114; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input, 4, this._ctx) ) { case 1: @@ -446,14 +498,14 @@ export class BlazeExpressionParser extends Parser { _localctx = new MultiplicativeExpressionContext(new ExpressionContext(_parentctx, _parentState)); (_localctx as MultiplicativeExpressionContext)._lhs = _prevctx; this.pushNewRecursionContext(_localctx, _startState, BlazeExpressionParser.RULE_expression); - this.state = 83; + this.state = 108; if (!(this.precpred(this._ctx, 2))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 2)"); } - this.state = 84; + this.state = 109; (_localctx as MultiplicativeExpressionContext)._op = this._input.LT(1); _la = this._input.LA(1); - if (!(((((_la - 35)) & ~0x1F) === 0 && ((1 << (_la - 35)) & ((1 << (BlazeExpressionParser.ASTERISK - 35)) | (1 << (BlazeExpressionParser.SLASH - 35)) | (1 << (BlazeExpressionParser.PERCENT - 35)))) !== 0))) { + if (!(((((_la - 44)) & ~0x1F) === 0 && ((1 << (_la - 44)) & ((1 << (BlazeExpressionParser.ASTERISK - 44)) | (1 << (BlazeExpressionParser.SLASH - 44)) | (1 << (BlazeExpressionParser.PERCENT - 44)))) !== 0))) { (_localctx as MultiplicativeExpressionContext)._op = this._errHandler.recoverInline(this); } else { if (this._input.LA(1) === Token.EOF) { @@ -463,7 +515,7 @@ export class BlazeExpressionParser extends Parser { this._errHandler.reportMatch(this); this.consume(); } - this.state = 85; + this.state = 110; (_localctx as MultiplicativeExpressionContext)._rhs = this.expression(3); } break; @@ -473,11 +525,11 @@ export class BlazeExpressionParser extends Parser { _localctx = new AdditiveExpressionContext(new ExpressionContext(_parentctx, _parentState)); (_localctx as AdditiveExpressionContext)._lhs = _prevctx; this.pushNewRecursionContext(_localctx, _startState, BlazeExpressionParser.RULE_expression); - this.state = 86; + this.state = 111; if (!(this.precpred(this._ctx, 1))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); } - this.state = 87; + this.state = 112; (_localctx as AdditiveExpressionContext)._op = this._input.LT(1); _la = this._input.LA(1); if (!(_la === BlazeExpressionParser.PLUS || _la === BlazeExpressionParser.MINUS)) { @@ -490,14 +542,14 @@ export class BlazeExpressionParser extends Parser { this._errHandler.reportMatch(this); this.consume(); } - this.state = 88; + this.state = 113; (_localctx as AdditiveExpressionContext)._rhs = this.expression(2); } break; } } } - this.state = 93; + this.state = 118; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 5, this._ctx); } @@ -530,14 +582,14 @@ export class BlazeExpressionParser extends Parser { let _parentState: number = this.state; let _localctx: PredicateContext = new PredicateContext(this._ctx, _parentState); let _prevctx: PredicateContext = _localctx; - let _startState: number = 12; - this.enterRecursionRule(_localctx, 12, BlazeExpressionParser.RULE_predicate, _p); + let _startState: number = 14; + this.enterRecursionRule(_localctx, 14, BlazeExpressionParser.RULE_predicate, _p); let _la: number; try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 157; + this.state = 182; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input, 10, this._ctx) ) { case 1: @@ -546,11 +598,11 @@ export class BlazeExpressionParser extends Parser { this._ctx = _localctx; _prevctx = _localctx; - this.state = 95; + this.state = 120; this.match(BlazeExpressionParser.LP); - this.state = 96; + this.state = 121; this.predicate(0); - this.state = 97; + this.state = 122; this.match(BlazeExpressionParser.RP); } break; @@ -560,7 +612,7 @@ export class BlazeExpressionParser extends Parser { _localctx = new NegatedPredicateContext(_localctx); this._ctx = _localctx; _prevctx = _localctx; - this.state = 99; + this.state = 124; _la = this._input.LA(1); if (!(_la === BlazeExpressionParser.NOT || _la === BlazeExpressionParser.EXCLAMATION_MARK)) { this._errHandler.recoverInline(this); @@ -572,7 +624,7 @@ export class BlazeExpressionParser extends Parser { this._errHandler.reportMatch(this); this.consume(); } - this.state = 100; + this.state = 125; this.predicate(15); } break; @@ -582,21 +634,21 @@ export class BlazeExpressionParser extends Parser { _localctx = new IsNullPredicateContext(_localctx); this._ctx = _localctx; _prevctx = _localctx; - this.state = 101; + this.state = 126; this.expression(0); - this.state = 102; + this.state = 127; this.match(BlazeExpressionParser.IS); - this.state = 104; + this.state = 129; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === BlazeExpressionParser.NOT) { { - this.state = 103; + this.state = 128; this.match(BlazeExpressionParser.NOT); } } - this.state = 106; + this.state = 131; this.match(BlazeExpressionParser.NULL); } break; @@ -606,21 +658,21 @@ export class BlazeExpressionParser extends Parser { _localctx = new IsEmptyPredicateContext(_localctx); this._ctx = _localctx; _prevctx = _localctx; - this.state = 108; + this.state = 133; this.expression(0); - this.state = 109; + this.state = 134; this.match(BlazeExpressionParser.IS); - this.state = 111; + this.state = 136; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === BlazeExpressionParser.NOT) { { - this.state = 110; + this.state = 135; this.match(BlazeExpressionParser.NOT); } } - this.state = 113; + this.state = 138; this.match(BlazeExpressionParser.EMPTY); } break; @@ -630,11 +682,11 @@ export class BlazeExpressionParser extends Parser { _localctx = new EqualityPredicateContext(_localctx); this._ctx = _localctx; _prevctx = _localctx; - this.state = 115; + this.state = 140; (_localctx as EqualityPredicateContext)._lhs = this.expression(0); - this.state = 116; + this.state = 141; this.match(BlazeExpressionParser.EQUAL); - this.state = 117; + this.state = 142; (_localctx as EqualityPredicateContext)._rhs = this.expression(0); } break; @@ -644,11 +696,11 @@ export class BlazeExpressionParser extends Parser { _localctx = new InequalityPredicateContext(_localctx); this._ctx = _localctx; _prevctx = _localctx; - this.state = 119; + this.state = 144; (_localctx as InequalityPredicateContext)._lhs = this.expression(0); - this.state = 120; + this.state = 145; this.match(BlazeExpressionParser.NOT_EQUAL); - this.state = 121; + this.state = 146; (_localctx as InequalityPredicateContext)._rhs = this.expression(0); } break; @@ -658,11 +710,11 @@ export class BlazeExpressionParser extends Parser { _localctx = new GreaterThanPredicateContext(_localctx); this._ctx = _localctx; _prevctx = _localctx; - this.state = 123; + this.state = 148; (_localctx as GreaterThanPredicateContext)._lhs = this.expression(0); - this.state = 124; + this.state = 149; this.match(BlazeExpressionParser.GREATER); - this.state = 125; + this.state = 150; (_localctx as GreaterThanPredicateContext)._rhs = this.expression(0); } break; @@ -672,11 +724,11 @@ export class BlazeExpressionParser extends Parser { _localctx = new GreaterThanOrEqualPredicateContext(_localctx); this._ctx = _localctx; _prevctx = _localctx; - this.state = 127; + this.state = 152; (_localctx as GreaterThanOrEqualPredicateContext)._lhs = this.expression(0); - this.state = 128; + this.state = 153; this.match(BlazeExpressionParser.GREATER_EQUAL); - this.state = 129; + this.state = 154; (_localctx as GreaterThanOrEqualPredicateContext)._rhs = this.expression(0); } break; @@ -686,11 +738,11 @@ export class BlazeExpressionParser extends Parser { _localctx = new LessThanPredicateContext(_localctx); this._ctx = _localctx; _prevctx = _localctx; - this.state = 131; + this.state = 156; (_localctx as LessThanPredicateContext)._lhs = this.expression(0); - this.state = 132; + this.state = 157; this.match(BlazeExpressionParser.LESS); - this.state = 133; + this.state = 158; (_localctx as LessThanPredicateContext)._rhs = this.expression(0); } break; @@ -700,11 +752,11 @@ export class BlazeExpressionParser extends Parser { _localctx = new LessThanOrEqualPredicateContext(_localctx); this._ctx = _localctx; _prevctx = _localctx; - this.state = 135; + this.state = 160; (_localctx as LessThanOrEqualPredicateContext)._lhs = this.expression(0); - this.state = 136; + this.state = 161; this.match(BlazeExpressionParser.LESS_EQUAL); - this.state = 137; + this.state = 162; (_localctx as LessThanOrEqualPredicateContext)._rhs = this.expression(0); } break; @@ -714,21 +766,21 @@ export class BlazeExpressionParser extends Parser { _localctx = new InPredicateContext(_localctx); this._ctx = _localctx; _prevctx = _localctx; - this.state = 139; + this.state = 164; this.expression(0); - this.state = 141; + this.state = 166; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === BlazeExpressionParser.NOT) { { - this.state = 140; + this.state = 165; this.match(BlazeExpressionParser.NOT); } } - this.state = 143; + this.state = 168; this.match(BlazeExpressionParser.IN); - this.state = 144; + this.state = 169; this.inList(); } break; @@ -738,25 +790,25 @@ export class BlazeExpressionParser extends Parser { _localctx = new BetweenPredicateContext(_localctx); this._ctx = _localctx; _prevctx = _localctx; - this.state = 146; + this.state = 171; (_localctx as BetweenPredicateContext)._lhs = this.expression(0); - this.state = 148; + this.state = 173; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === BlazeExpressionParser.NOT) { { - this.state = 147; + this.state = 172; this.match(BlazeExpressionParser.NOT); } } - this.state = 150; + this.state = 175; this.match(BlazeExpressionParser.BETWEEN); - this.state = 151; + this.state = 176; (_localctx as BetweenPredicateContext)._begin = this.expression(0); - this.state = 152; + this.state = 177; this.match(BlazeExpressionParser.AND); - this.state = 153; + this.state = 178; (_localctx as BetweenPredicateContext)._end = this.expression(0); } break; @@ -766,7 +818,7 @@ export class BlazeExpressionParser extends Parser { _localctx = new BooleanFunctionContext(_localctx); this._ctx = _localctx; _prevctx = _localctx; - this.state = 155; + this.state = 180; this.functionInvocation(); } break; @@ -776,13 +828,13 @@ export class BlazeExpressionParser extends Parser { _localctx = new PathPredicateContext(_localctx); this._ctx = _localctx; _prevctx = _localctx; - this.state = 156; + this.state = 181; this.path(); } break; } this._ctx._stop = this._input.tryLT(-1); - this.state = 167; + this.state = 192; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 12, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { @@ -792,20 +844,20 @@ export class BlazeExpressionParser extends Parser { } _prevctx = _localctx; { - this.state = 165; + this.state = 190; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input, 11, this._ctx) ) { case 1: { _localctx = new AndPredicateContext(new PredicateContext(_parentctx, _parentState)); this.pushNewRecursionContext(_localctx, _startState, BlazeExpressionParser.RULE_predicate); - this.state = 159; + this.state = 184; if (!(this.precpred(this._ctx, 14))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 14)"); } - this.state = 160; + this.state = 185; this.match(BlazeExpressionParser.AND); - this.state = 161; + this.state = 186; this.predicate(15); } break; @@ -814,20 +866,20 @@ export class BlazeExpressionParser extends Parser { { _localctx = new OrPredicateContext(new PredicateContext(_parentctx, _parentState)); this.pushNewRecursionContext(_localctx, _startState, BlazeExpressionParser.RULE_predicate); - this.state = 162; + this.state = 187; if (!(this.precpred(this._ctx, 13))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 13)"); } - this.state = 163; + this.state = 188; this.match(BlazeExpressionParser.OR); - this.state = 164; + this.state = 189; this.predicate(14); } break; } } } - this.state = 169; + this.state = 194; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 12, this._ctx); } @@ -850,15 +902,15 @@ export class BlazeExpressionParser extends Parser { // @RuleVersion(0) public predicateOrExpression(): PredicateOrExpressionContext { let _localctx: PredicateOrExpressionContext = new PredicateOrExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 14, BlazeExpressionParser.RULE_predicateOrExpression); + this.enterRule(_localctx, 16, BlazeExpressionParser.RULE_predicateOrExpression); try { - this.state = 172; + this.state = 197; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input, 13, this._ctx) ) { case 1: this.enterOuterAlt(_localctx, 1); { - this.state = 170; + this.state = 195; this.expression(0); } break; @@ -866,7 +918,7 @@ export class BlazeExpressionParser extends Parser { case 2: this.enterOuterAlt(_localctx, 2); { - this.state = 171; + this.state = 196; this.predicate(0); } break; @@ -887,49 +939,35 @@ export class BlazeExpressionParser extends Parser { return _localctx; } // @RuleVersion(0) - public inList(): InListContext { - let _localctx: InListContext = new InListContext(this._ctx, this.state); - this.enterRule(_localctx, 16, BlazeExpressionParser.RULE_inList); + public query(): QueryContext { + let _localctx: QueryContext = new QueryContext(this._ctx, this.state); + this.enterRule(_localctx, 18, BlazeExpressionParser.RULE_query); let _la: number; try { - this.state = 186; + this.enterOuterAlt(_localctx, 1); + { + this.state = 200; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 15, this._ctx) ) { - case 1: - this.enterOuterAlt(_localctx, 1); + _la = this._input.LA(1); + if (_la === BlazeExpressionParser.SELECT) { { - this.state = 174; - this.match(BlazeExpressionParser.LP); - this.state = 175; - this.expression(0); - this.state = 180; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === BlazeExpressionParser.COMMA) { - { - { - this.state = 176; - this.match(BlazeExpressionParser.COMMA); - this.state = 177; - this.expression(0); - } - } - this.state = 182; - this._errHandler.sync(this); - _la = this._input.LA(1); - } - this.state = 183; - this.match(BlazeExpressionParser.RP); + this.state = 199; + this.selectClause(); } - break; + } - case 2: - this.enterOuterAlt(_localctx, 2); + this.state = 202; + this.fromClause(); + this.state = 204; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === BlazeExpressionParser.WHERE) { { - this.state = 185; - this.expression(0); + this.state = 203; + this.whereClause(); } - break; + } + } } catch (re) { @@ -947,40 +985,43 @@ export class BlazeExpressionParser extends Parser { return _localctx; } // @RuleVersion(0) - public path(): PathContext { - let _localctx: PathContext = new PathContext(this._ctx, this.state); - this.enterRule(_localctx, 18, BlazeExpressionParser.RULE_path); + public selectClause(): SelectClauseContext { + let _localctx: SelectClauseContext = new SelectClauseContext(this._ctx, this.state); + this.enterRule(_localctx, 20, BlazeExpressionParser.RULE_selectClause); + let _la: number; try { - this.state = 195; + this.enterOuterAlt(_localctx, 1); + { + this.state = 206; + this.match(BlazeExpressionParser.SELECT); + this.state = 208; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 17, this._ctx) ) { + switch ( this.interpreter.adaptivePredict(this._input, 16, this._ctx) ) { case 1: - this.enterOuterAlt(_localctx, 1); { - this.state = 188; - this.identifier(); - this.state = 190; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 16, this._ctx) ) { - case 1: - { - this.state = 189; - this.pathAttributes(); - } - break; - } + this.state = 207; + this.match(BlazeExpressionParser.DISTINCT); } break; - - case 2: - this.enterOuterAlt(_localctx, 2); + } + this.state = 210; + this.expression(0); + this.state = 215; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === BlazeExpressionParser.COMMA) { { - this.state = 192; - this.functionInvocation(); - this.state = 193; - this.pathAttributes(); + { + this.state = 211; + this.match(BlazeExpressionParser.COMMA); + this.state = 212; + this.expression(0); } - break; + } + this.state = 217; + this._errHandler.sync(this); + _la = this._input.LA(1); + } } } catch (re) { @@ -998,35 +1039,33 @@ export class BlazeExpressionParser extends Parser { return _localctx; } // @RuleVersion(0) - public pathAttributes(): PathAttributesContext { - let _localctx: PathAttributesContext = new PathAttributesContext(this._ctx, this.state); - this.enterRule(_localctx, 20, BlazeExpressionParser.RULE_pathAttributes); + public fromClause(): FromClauseContext { + let _localctx: FromClauseContext = new FromClauseContext(this._ctx, this.state); + this.enterRule(_localctx, 22, BlazeExpressionParser.RULE_fromClause); + let _la: number; try { - let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 199; + this.state = 218; + this.match(BlazeExpressionParser.FROM); + this.state = 219; + this.fromItem(); + this.state = 224; this._errHandler.sync(this); - _alt = 1; - do { - switch (_alt) { - case 1: - { - { - this.state = 197; - this.match(BlazeExpressionParser.DOT); - this.state = 198; - this.identifier(); - } - } - break; - default: - throw new NoViableAltException(this); + _la = this._input.LA(1); + while (_la === BlazeExpressionParser.COMMA) { + { + { + this.state = 220; + this.match(BlazeExpressionParser.COMMA); + this.state = 221; + this.fromItem(); } - this.state = 201; + } + this.state = 226; this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 18, this._ctx); - } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); + _la = this._input.LA(1); + } } } catch (re) { @@ -1044,100 +1083,56 @@ export class BlazeExpressionParser extends Parser { return _localctx; } // @RuleVersion(0) - public literal(): LiteralContext { - let _localctx: LiteralContext = new LiteralContext(this._ctx, this.state); - this.enterRule(_localctx, 22, BlazeExpressionParser.RULE_literal); + public whereClause(): WhereClauseContext { + let _localctx: WhereClauseContext = new WhereClauseContext(this._ctx, this.state); + this.enterRule(_localctx, 24, BlazeExpressionParser.RULE_whereClause); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 227; + this.match(BlazeExpressionParser.WHERE); + this.state = 228; + this.predicate(0); + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public fromItem(): FromItemContext { + let _localctx: FromItemContext = new FromItemContext(this._ctx, this.state); + this.enterRule(_localctx, 26, BlazeExpressionParser.RULE_fromItem); + let _la: number; try { - this.state = 214; + this.enterOuterAlt(_localctx, 1); + { + this.state = 230; + this.fromRoot(); + this.state = 234; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 19, this._ctx) ) { - case 1: - this.enterOuterAlt(_localctx, 1); - { - this.state = 203; - this.match(BlazeExpressionParser.NUMERIC_LITERAL); - } - break; - - case 2: - this.enterOuterAlt(_localctx, 2); - { - this.state = 204; - this.match(BlazeExpressionParser.INTEGER_LITERAL); - } - break; - - case 3: - this.enterOuterAlt(_localctx, 3); - { - this.state = 205; - this.stringLiteral(); - } - break; - - case 4: - this.enterOuterAlt(_localctx, 4); - { - this.state = 206; - this.match(BlazeExpressionParser.TRUE); - } - break; - - case 5: - this.enterOuterAlt(_localctx, 5); + _la = this._input.LA(1); + while ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << BlazeExpressionParser.FULL) | (1 << BlazeExpressionParser.JOIN) | (1 << BlazeExpressionParser.LEFT) | (1 << BlazeExpressionParser.RIGHT))) !== 0)) { { - this.state = 207; - this.match(BlazeExpressionParser.FALSE); - } - break; - - case 6: - this.enterOuterAlt(_localctx, 6); { - this.state = 208; - this.dateLiteral(); + this.state = 231; + this.join(); } - break; - - case 7: - this.enterOuterAlt(_localctx, 7); - { - this.state = 209; - this.timeLiteral(); } - break; - - case 8: - this.enterOuterAlt(_localctx, 8); - { - this.state = 210; - this.timestampLiteral(); - } - break; - - case 9: - this.enterOuterAlt(_localctx, 9); - { - this.state = 211; - this.temporalIntervalLiteral(); - } - break; - - case 10: - this.enterOuterAlt(_localctx, 10); - { - this.state = 212; - this.collectionLiteral(); - } - break; - - case 11: - this.enterOuterAlt(_localctx, 11); - { - this.state = 213; - this.entityLiteral(); - } - break; + this.state = 236; + this._errHandler.sync(this); + _la = this._input.LA(1); + } } } catch (re) { @@ -1155,62 +1150,16 @@ export class BlazeExpressionParser extends Parser { return _localctx; } // @RuleVersion(0) - public stringLiteral(): StringLiteralContext { - let _localctx: StringLiteralContext = new StringLiteralContext(this._ctx, this.state); - this.enterRule(_localctx, 24, BlazeExpressionParser.RULE_stringLiteral); - let _la: number; + public fromRoot(): FromRootContext { + let _localctx: FromRootContext = new FromRootContext(this._ctx, this.state); + this.enterRule(_localctx, 28, BlazeExpressionParser.RULE_fromRoot); try { - this.state = 232; - this._errHandler.sync(this); - switch (this._input.LA(1)) { - case BlazeExpressionParser.START_QUOTE: - this.enterOuterAlt(_localctx, 1); - { - this.state = 216; - this.match(BlazeExpressionParser.START_QUOTE); - this.state = 220; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === BlazeExpressionParser.TEXT_IN_QUOTE) { - { - { - this.state = 217; - this.match(BlazeExpressionParser.TEXT_IN_QUOTE); - } - } - this.state = 222; - this._errHandler.sync(this); - _la = this._input.LA(1); - } - this.state = 223; - this.match(BlazeExpressionParser.END_QUOTE); - } - break; - case BlazeExpressionParser.START_DOUBLE_QUOTE: - this.enterOuterAlt(_localctx, 2); - { - this.state = 224; - this.match(BlazeExpressionParser.START_DOUBLE_QUOTE); - this.state = 228; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === BlazeExpressionParser.TEXT_IN_DOUBLE_QUOTE) { - { - { - this.state = 225; - this.match(BlazeExpressionParser.TEXT_IN_DOUBLE_QUOTE); - } - } - this.state = 230; - this._errHandler.sync(this); - _la = this._input.LA(1); - } - this.state = 231; - this.match(BlazeExpressionParser.END_DOUBLE_QUOTE); - } - break; - default: - throw new NoViableAltException(this); + this.enterOuterAlt(_localctx, 1); + { + this.state = 237; + this.domainTypeName(); + this.state = 238; + this.variable(); } } catch (re) { @@ -1228,43 +1177,41 @@ export class BlazeExpressionParser extends Parser { return _localctx; } // @RuleVersion(0) - public collectionLiteral(): CollectionLiteralContext { - let _localctx: CollectionLiteralContext = new CollectionLiteralContext(this._ctx, this.state); - this.enterRule(_localctx, 26, BlazeExpressionParser.RULE_collectionLiteral); + public join(): JoinContext { + let _localctx: JoinContext = new JoinContext(this._ctx, this.state); + this.enterRule(_localctx, 30, BlazeExpressionParser.RULE_join); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 234; - this.match(BlazeExpressionParser.LB); - this.state = 243; + this.state = 241; this._errHandler.sync(this); _la = this._input.LA(1); - if ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << BlazeExpressionParser.START_QUOTE) | (1 << BlazeExpressionParser.START_DOUBLE_QUOTE) | (1 << BlazeExpressionParser.INTEGER_LITERAL) | (1 << BlazeExpressionParser.NUMERIC_LITERAL) | (1 << BlazeExpressionParser.AND) | (1 << BlazeExpressionParser.BETWEEN) | (1 << BlazeExpressionParser.DATE) | (1 << BlazeExpressionParser.DAYS) | (1 << BlazeExpressionParser.FALSE) | (1 << BlazeExpressionParser.HOURS) | (1 << BlazeExpressionParser.IN) | (1 << BlazeExpressionParser.INTERVAL) | (1 << BlazeExpressionParser.IS) | (1 << BlazeExpressionParser.MINUTES) | (1 << BlazeExpressionParser.MONTHS) | (1 << BlazeExpressionParser.NOT) | (1 << BlazeExpressionParser.OR) | (1 << BlazeExpressionParser.SECONDS) | (1 << BlazeExpressionParser.TIME) | (1 << BlazeExpressionParser.TIMESTAMP) | (1 << BlazeExpressionParser.TRUE) | (1 << BlazeExpressionParser.YEARS))) !== 0) || ((((_la - 40)) & ~0x1F) === 0 && ((1 << (_la - 40)) & ((1 << (BlazeExpressionParser.LB - 40)) | (1 << (BlazeExpressionParser.IDENTIFIER - 40)) | (1 << (BlazeExpressionParser.QUOTED_IDENTIFIER - 40)))) !== 0)) { + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << BlazeExpressionParser.FULL) | (1 << BlazeExpressionParser.LEFT) | (1 << BlazeExpressionParser.RIGHT))) !== 0)) { { - this.state = 235; - this.literal(); this.state = 240; - this._errHandler.sync(this); _la = this._input.LA(1); - while (_la === BlazeExpressionParser.COMMA) { - { - { - this.state = 236; - this.match(BlazeExpressionParser.COMMA); - this.state = 237; - this.literal(); - } + if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << BlazeExpressionParser.FULL) | (1 << BlazeExpressionParser.LEFT) | (1 << BlazeExpressionParser.RIGHT))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } - this.state = 242; - this._errHandler.sync(this); - _la = this._input.LA(1); + + this._errHandler.reportMatch(this); + this.consume(); } } } + this.state = 243; + this.match(BlazeExpressionParser.JOIN); + this.state = 244; + this.joinTarget(); this.state = 245; - this.match(BlazeExpressionParser.RB); + this.match(BlazeExpressionParser.ON); + this.state = 246; + this.predicate(0); } } catch (re) { @@ -1282,162 +1229,16 @@ export class BlazeExpressionParser extends Parser { return _localctx; } // @RuleVersion(0) - public entityLiteral(): EntityLiteralContext { - let _localctx: EntityLiteralContext = new EntityLiteralContext(this._ctx, this.state); - this.enterRule(_localctx, 28, BlazeExpressionParser.RULE_entityLiteral); + public joinTarget(): JoinTargetContext { + let _localctx: JoinTargetContext = new JoinTargetContext(this._ctx, this.state); + this.enterRule(_localctx, 32, BlazeExpressionParser.RULE_joinTarget); try { - let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 247; - _localctx._name = this.identifier(); this.state = 248; - this.match(BlazeExpressionParser.LP); - this.state = 256; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 25, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - { - { - this.state = 249; - this.identifier(); - this.state = 250; - this.match(BlazeExpressionParser.EQUAL); - this.state = 251; - this.predicateOrExpression(); - this.state = 252; - this.match(BlazeExpressionParser.COMMA); - } - } - } - this.state = 258; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 25, this._ctx); - } - this.state = 259; - this.identifier(); - this.state = 260; - this.match(BlazeExpressionParser.EQUAL); - this.state = 261; - this.predicateOrExpression(); - this.state = 262; - this.match(BlazeExpressionParser.RP); - } - } - catch (re) { - if (re instanceof RecognitionException) { - _localctx.exception = re; - this._errHandler.reportError(this, re); - this._errHandler.recover(this, re); - } else { - throw re; - } - } - finally { - this.exitRule(); - } - return _localctx; - } - // @RuleVersion(0) - public functionInvocation(): FunctionInvocationContext { - let _localctx: FunctionInvocationContext = new FunctionInvocationContext(this._ctx, this.state); - this.enterRule(_localctx, 30, BlazeExpressionParser.RULE_functionInvocation); - let _la: number; - try { - let _alt: number; - this.state = 299; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 30, this._ctx) ) { - case 1: - _localctx = new NamedInvocationContext(_localctx); - this.enterOuterAlt(_localctx, 1); - { - this.state = 264; - (_localctx as NamedInvocationContext)._name = this.identifier(); - this.state = 265; - this.match(BlazeExpressionParser.LP); - this.state = 280; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << BlazeExpressionParser.AND) | (1 << BlazeExpressionParser.BETWEEN) | (1 << BlazeExpressionParser.DATE) | (1 << BlazeExpressionParser.DAYS) | (1 << BlazeExpressionParser.HOURS) | (1 << BlazeExpressionParser.IN) | (1 << BlazeExpressionParser.IS) | (1 << BlazeExpressionParser.MINUTES) | (1 << BlazeExpressionParser.MONTHS) | (1 << BlazeExpressionParser.NOT) | (1 << BlazeExpressionParser.OR) | (1 << BlazeExpressionParser.SECONDS) | (1 << BlazeExpressionParser.TIME) | (1 << BlazeExpressionParser.TIMESTAMP) | (1 << BlazeExpressionParser.YEARS))) !== 0) || _la === BlazeExpressionParser.IDENTIFIER || _la === BlazeExpressionParser.QUOTED_IDENTIFIER) { - { - this.state = 273; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 26, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - { - { - this.state = 266; - this.identifier(); - this.state = 267; - this.match(BlazeExpressionParser.EQUAL); - this.state = 268; - this.predicateOrExpression(); - this.state = 269; - this.match(BlazeExpressionParser.COMMA); - } - } - } - this.state = 275; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 26, this._ctx); - } - this.state = 276; - this.identifier(); - this.state = 277; - this.match(BlazeExpressionParser.EQUAL); - this.state = 278; - this.predicateOrExpression(); - } - } - - this.state = 282; - this.match(BlazeExpressionParser.RP); - } - break; - - case 2: - _localctx = new IndexedFunctionInvocationContext(_localctx); - this.enterOuterAlt(_localctx, 2); - { - this.state = 284; - (_localctx as IndexedFunctionInvocationContext)._name = this.identifier(); - this.state = 285; - this.match(BlazeExpressionParser.LP); - this.state = 295; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << BlazeExpressionParser.START_QUOTE) | (1 << BlazeExpressionParser.START_DOUBLE_QUOTE) | (1 << BlazeExpressionParser.INTEGER_LITERAL) | (1 << BlazeExpressionParser.NUMERIC_LITERAL) | (1 << BlazeExpressionParser.AND) | (1 << BlazeExpressionParser.BETWEEN) | (1 << BlazeExpressionParser.DATE) | (1 << BlazeExpressionParser.DAYS) | (1 << BlazeExpressionParser.FALSE) | (1 << BlazeExpressionParser.HOURS) | (1 << BlazeExpressionParser.IN) | (1 << BlazeExpressionParser.INTERVAL) | (1 << BlazeExpressionParser.IS) | (1 << BlazeExpressionParser.MINUTES) | (1 << BlazeExpressionParser.MONTHS) | (1 << BlazeExpressionParser.NOT) | (1 << BlazeExpressionParser.OR) | (1 << BlazeExpressionParser.SECONDS) | (1 << BlazeExpressionParser.TIME) | (1 << BlazeExpressionParser.TIMESTAMP) | (1 << BlazeExpressionParser.TRUE) | (1 << BlazeExpressionParser.YEARS))) !== 0) || ((((_la - 33)) & ~0x1F) === 0 && ((1 << (_la - 33)) & ((1 << (BlazeExpressionParser.PLUS - 33)) | (1 << (BlazeExpressionParser.MINUS - 33)) | (1 << (BlazeExpressionParser.LP - 33)) | (1 << (BlazeExpressionParser.LB - 33)) | (1 << (BlazeExpressionParser.EXCLAMATION_MARK - 33)) | (1 << (BlazeExpressionParser.IDENTIFIER - 33)) | (1 << (BlazeExpressionParser.QUOTED_IDENTIFIER - 33)))) !== 0)) { - { - this.state = 291; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 28, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - { - { - this.state = 286; - this.predicateOrExpression(); - this.state = 287; - this.match(BlazeExpressionParser.COMMA); - } - } - } - this.state = 293; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 28, this._ctx); - } - this.state = 294; - this.predicateOrExpression(); - } - } - - this.state = 297; - this.match(BlazeExpressionParser.RP); - } - break; + this.domainTypeName(); + this.state = 249; + this.variable(); } } catch (re) { @@ -1455,20 +1256,14 @@ export class BlazeExpressionParser extends Parser { return _localctx; } // @RuleVersion(0) - public dateLiteral(): DateLiteralContext { - let _localctx: DateLiteralContext = new DateLiteralContext(this._ctx, this.state); - this.enterRule(_localctx, 32, BlazeExpressionParser.RULE_dateLiteral); + public domainTypeName(): DomainTypeNameContext { + let _localctx: DomainTypeNameContext = new DomainTypeNameContext(this._ctx, this.state); + this.enterRule(_localctx, 34, BlazeExpressionParser.RULE_domainTypeName); try { this.enterOuterAlt(_localctx, 1); { - this.state = 301; - this.match(BlazeExpressionParser.DATE); - this.state = 302; - this.match(BlazeExpressionParser.LP); - this.state = 303; - this.datePart(); - this.state = 304; - this.match(BlazeExpressionParser.RP); + this.state = 251; + this.identifier(); } } catch (re) { @@ -1486,44 +1281,25 @@ export class BlazeExpressionParser extends Parser { return _localctx; } // @RuleVersion(0) - public timeLiteral(): TimeLiteralContext { - let _localctx: TimeLiteralContext = new TimeLiteralContext(this._ctx, this.state); - this.enterRule(_localctx, 34, BlazeExpressionParser.RULE_timeLiteral); + public variable(): VariableContext { + let _localctx: VariableContext = new VariableContext(this._ctx, this.state); + this.enterRule(_localctx, 36, BlazeExpressionParser.RULE_variable); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 306; - this.match(BlazeExpressionParser.TIME); - this.state = 307; - this.match(BlazeExpressionParser.LP); - this.state = 308; - this.timePart(); - this.state = 311; + this.state = 254; this._errHandler.sync(this); _la = this._input.LA(1); - if (_la === BlazeExpressionParser.DOT) { + if (_la === BlazeExpressionParser.AS) { { - this.state = 309; - this.match(BlazeExpressionParser.DOT); - this.state = 310; - _localctx._fraction = this._input.LT(1); - _la = this._input.LA(1); - if (!(_la === BlazeExpressionParser.INTEGER_LITERAL || _la === BlazeExpressionParser.LEADING_ZERO_INTEGER_LITERAL)) { - _localctx._fraction = this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } + this.state = 253; + this.match(BlazeExpressionParser.AS); } } - this.state = 313; - this.match(BlazeExpressionParser.RP); + this.state = 256; + this.identifier(); } } catch (re) { @@ -1541,34 +1317,688 @@ export class BlazeExpressionParser extends Parser { return _localctx; } // @RuleVersion(0) - public timestampLiteral(): TimestampLiteralContext { - let _localctx: TimestampLiteralContext = new TimestampLiteralContext(this._ctx, this.state); - this.enterRule(_localctx, 36, BlazeExpressionParser.RULE_timestampLiteral); + public inList(): InListContext { + let _localctx: InListContext = new InListContext(this._ctx, this.state); + this.enterRule(_localctx, 38, BlazeExpressionParser.RULE_inList); let _la: number; try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 315; - this.match(BlazeExpressionParser.TIMESTAMP); - this.state = 316; - this.match(BlazeExpressionParser.LP); - this.state = 317; - this.datePart(); - this.state = 323; + this.state = 270; this._errHandler.sync(this); - _la = this._input.LA(1); + switch ( this.interpreter.adaptivePredict(this._input, 23, this._ctx) ) { + case 1: + this.enterOuterAlt(_localctx, 1); + { + this.state = 258; + this.match(BlazeExpressionParser.LP); + this.state = 259; + this.expression(0); + this.state = 264; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === BlazeExpressionParser.COMMA) { + { + { + this.state = 260; + this.match(BlazeExpressionParser.COMMA); + this.state = 261; + this.expression(0); + } + } + this.state = 266; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + this.state = 267; + this.match(BlazeExpressionParser.RP); + } + break; + + case 2: + this.enterOuterAlt(_localctx, 2); + { + this.state = 269; + this.expression(0); + } + break; + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public path(): PathContext { + let _localctx: PathContext = new PathContext(this._ctx, this.state); + this.enterRule(_localctx, 40, BlazeExpressionParser.RULE_path); + try { + this.state = 279; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 25, this._ctx) ) { + case 1: + this.enterOuterAlt(_localctx, 1); + { + this.state = 272; + this.identifier(); + this.state = 274; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 24, this._ctx) ) { + case 1: + { + this.state = 273; + this.pathAttributes(); + } + break; + } + } + break; + + case 2: + this.enterOuterAlt(_localctx, 2); + { + this.state = 276; + this.functionInvocation(); + this.state = 277; + this.pathAttributes(); + } + break; + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public pathAttributes(): PathAttributesContext { + let _localctx: PathAttributesContext = new PathAttributesContext(this._ctx, this.state); + this.enterRule(_localctx, 42, BlazeExpressionParser.RULE_pathAttributes); + try { + let _alt: number; + this.enterOuterAlt(_localctx, 1); + { + this.state = 283; + this._errHandler.sync(this); + _alt = 1; + do { + switch (_alt) { + case 1: + { + { + this.state = 281; + this.match(BlazeExpressionParser.DOT); + this.state = 282; + this.identifier(); + } + } + break; + default: + throw new NoViableAltException(this); + } + this.state = 285; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 26, this._ctx); + } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public literal(): LiteralContext { + let _localctx: LiteralContext = new LiteralContext(this._ctx, this.state); + this.enterRule(_localctx, 44, BlazeExpressionParser.RULE_literal); + try { + this.state = 298; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 27, this._ctx) ) { + case 1: + this.enterOuterAlt(_localctx, 1); + { + this.state = 287; + this.match(BlazeExpressionParser.NUMERIC_LITERAL); + } + break; + + case 2: + this.enterOuterAlt(_localctx, 2); + { + this.state = 288; + this.match(BlazeExpressionParser.INTEGER_LITERAL); + } + break; + + case 3: + this.enterOuterAlt(_localctx, 3); + { + this.state = 289; + this.stringLiteral(); + } + break; + + case 4: + this.enterOuterAlt(_localctx, 4); + { + this.state = 290; + this.match(BlazeExpressionParser.TRUE); + } + break; + + case 5: + this.enterOuterAlt(_localctx, 5); + { + this.state = 291; + this.match(BlazeExpressionParser.FALSE); + } + break; + + case 6: + this.enterOuterAlt(_localctx, 6); + { + this.state = 292; + this.dateLiteral(); + } + break; + + case 7: + this.enterOuterAlt(_localctx, 7); + { + this.state = 293; + this.timeLiteral(); + } + break; + + case 8: + this.enterOuterAlt(_localctx, 8); + { + this.state = 294; + this.timestampLiteral(); + } + break; + + case 9: + this.enterOuterAlt(_localctx, 9); + { + this.state = 295; + this.temporalIntervalLiteral(); + } + break; + + case 10: + this.enterOuterAlt(_localctx, 10); + { + this.state = 296; + this.collectionLiteral(); + } + break; + + case 11: + this.enterOuterAlt(_localctx, 11); + { + this.state = 297; + this.entityLiteral(); + } + break; + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public stringLiteral(): StringLiteralContext { + let _localctx: StringLiteralContext = new StringLiteralContext(this._ctx, this.state); + this.enterRule(_localctx, 46, BlazeExpressionParser.RULE_stringLiteral); + let _la: number; + try { + this.state = 316; + this._errHandler.sync(this); + switch (this._input.LA(1)) { + case BlazeExpressionParser.START_QUOTE: + this.enterOuterAlt(_localctx, 1); + { + this.state = 300; + this.match(BlazeExpressionParser.START_QUOTE); + this.state = 304; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === BlazeExpressionParser.TEXT_IN_QUOTE) { + { + { + this.state = 301; + this.match(BlazeExpressionParser.TEXT_IN_QUOTE); + } + } + this.state = 306; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + this.state = 307; + this.match(BlazeExpressionParser.END_QUOTE); + } + break; + case BlazeExpressionParser.START_DOUBLE_QUOTE: + this.enterOuterAlt(_localctx, 2); + { + this.state = 308; + this.match(BlazeExpressionParser.START_DOUBLE_QUOTE); + this.state = 312; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === BlazeExpressionParser.TEXT_IN_DOUBLE_QUOTE) { + { + { + this.state = 309; + this.match(BlazeExpressionParser.TEXT_IN_DOUBLE_QUOTE); + } + } + this.state = 314; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + this.state = 315; + this.match(BlazeExpressionParser.END_DOUBLE_QUOTE); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public collectionLiteral(): CollectionLiteralContext { + let _localctx: CollectionLiteralContext = new CollectionLiteralContext(this._ctx, this.state); + this.enterRule(_localctx, 48, BlazeExpressionParser.RULE_collectionLiteral); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 318; + this.match(BlazeExpressionParser.LB); + this.state = 327; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << BlazeExpressionParser.START_QUOTE) | (1 << BlazeExpressionParser.START_DOUBLE_QUOTE) | (1 << BlazeExpressionParser.INTEGER_LITERAL) | (1 << BlazeExpressionParser.NUMERIC_LITERAL) | (1 << BlazeExpressionParser.AND) | (1 << BlazeExpressionParser.BETWEEN) | (1 << BlazeExpressionParser.DATE) | (1 << BlazeExpressionParser.DAYS) | (1 << BlazeExpressionParser.DISTINCT) | (1 << BlazeExpressionParser.FALSE) | (1 << BlazeExpressionParser.FROM) | (1 << BlazeExpressionParser.FULL) | (1 << BlazeExpressionParser.HOURS) | (1 << BlazeExpressionParser.IN) | (1 << BlazeExpressionParser.INTERVAL) | (1 << BlazeExpressionParser.IS) | (1 << BlazeExpressionParser.JOIN) | (1 << BlazeExpressionParser.LEFT) | (1 << BlazeExpressionParser.MINUTES) | (1 << BlazeExpressionParser.MONTHS) | (1 << BlazeExpressionParser.NOT) | (1 << BlazeExpressionParser.ON) | (1 << BlazeExpressionParser.OR) | (1 << BlazeExpressionParser.RIGHT) | (1 << BlazeExpressionParser.SECONDS) | (1 << BlazeExpressionParser.SELECT) | (1 << BlazeExpressionParser.TIME))) !== 0) || ((((_la - 32)) & ~0x1F) === 0 && ((1 << (_la - 32)) & ((1 << (BlazeExpressionParser.TIMESTAMP - 32)) | (1 << (BlazeExpressionParser.TRUE - 32)) | (1 << (BlazeExpressionParser.WHERE - 32)) | (1 << (BlazeExpressionParser.YEARS - 32)) | (1 << (BlazeExpressionParser.LB - 32)) | (1 << (BlazeExpressionParser.IDENTIFIER - 32)) | (1 << (BlazeExpressionParser.QUOTED_IDENTIFIER - 32)))) !== 0)) { + { + this.state = 319; + this.literal(); + this.state = 324; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === BlazeExpressionParser.COMMA) { + { + { + this.state = 320; + this.match(BlazeExpressionParser.COMMA); + this.state = 321; + this.literal(); + } + } + this.state = 326; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + } + } + + this.state = 329; + this.match(BlazeExpressionParser.RB); + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public entityLiteral(): EntityLiteralContext { + let _localctx: EntityLiteralContext = new EntityLiteralContext(this._ctx, this.state); + this.enterRule(_localctx, 50, BlazeExpressionParser.RULE_entityLiteral); + try { + let _alt: number; + this.enterOuterAlt(_localctx, 1); + { + this.state = 331; + _localctx._name = this.identifier(); + this.state = 332; + this.match(BlazeExpressionParser.LP); + this.state = 340; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 33, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + { + { + this.state = 333; + this.identifier(); + this.state = 334; + this.match(BlazeExpressionParser.EQUAL); + this.state = 335; + this.predicateOrExpression(); + this.state = 336; + this.match(BlazeExpressionParser.COMMA); + } + } + } + this.state = 342; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 33, this._ctx); + } + this.state = 343; + this.identifier(); + this.state = 344; + this.match(BlazeExpressionParser.EQUAL); + this.state = 345; + this.predicateOrExpression(); + this.state = 346; + this.match(BlazeExpressionParser.RP); + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public functionInvocation(): FunctionInvocationContext { + let _localctx: FunctionInvocationContext = new FunctionInvocationContext(this._ctx, this.state); + this.enterRule(_localctx, 52, BlazeExpressionParser.RULE_functionInvocation); + let _la: number; + try { + let _alt: number; + this.state = 383; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 38, this._ctx) ) { + case 1: + _localctx = new NamedInvocationContext(_localctx); + this.enterOuterAlt(_localctx, 1); + { + this.state = 348; + (_localctx as NamedInvocationContext)._name = this.identifier(); + this.state = 349; + this.match(BlazeExpressionParser.LP); + this.state = 364; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << BlazeExpressionParser.AND) | (1 << BlazeExpressionParser.BETWEEN) | (1 << BlazeExpressionParser.DATE) | (1 << BlazeExpressionParser.DAYS) | (1 << BlazeExpressionParser.DISTINCT) | (1 << BlazeExpressionParser.FROM) | (1 << BlazeExpressionParser.FULL) | (1 << BlazeExpressionParser.HOURS) | (1 << BlazeExpressionParser.IN) | (1 << BlazeExpressionParser.IS) | (1 << BlazeExpressionParser.JOIN) | (1 << BlazeExpressionParser.LEFT) | (1 << BlazeExpressionParser.MINUTES) | (1 << BlazeExpressionParser.MONTHS) | (1 << BlazeExpressionParser.NOT) | (1 << BlazeExpressionParser.ON) | (1 << BlazeExpressionParser.OR) | (1 << BlazeExpressionParser.RIGHT) | (1 << BlazeExpressionParser.SECONDS) | (1 << BlazeExpressionParser.SELECT) | (1 << BlazeExpressionParser.TIME))) !== 0) || ((((_la - 32)) & ~0x1F) === 0 && ((1 << (_la - 32)) & ((1 << (BlazeExpressionParser.TIMESTAMP - 32)) | (1 << (BlazeExpressionParser.WHERE - 32)) | (1 << (BlazeExpressionParser.YEARS - 32)) | (1 << (BlazeExpressionParser.IDENTIFIER - 32)) | (1 << (BlazeExpressionParser.QUOTED_IDENTIFIER - 32)))) !== 0)) { + { + this.state = 357; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 34, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + { + { + this.state = 350; + this.identifier(); + this.state = 351; + this.match(BlazeExpressionParser.EQUAL); + this.state = 352; + this.predicateOrExpression(); + this.state = 353; + this.match(BlazeExpressionParser.COMMA); + } + } + } + this.state = 359; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 34, this._ctx); + } + this.state = 360; + this.identifier(); + this.state = 361; + this.match(BlazeExpressionParser.EQUAL); + this.state = 362; + this.predicateOrExpression(); + } + } + + this.state = 366; + this.match(BlazeExpressionParser.RP); + } + break; + + case 2: + _localctx = new IndexedFunctionInvocationContext(_localctx); + this.enterOuterAlt(_localctx, 2); + { + this.state = 368; + (_localctx as IndexedFunctionInvocationContext)._name = this.identifier(); + this.state = 369; + this.match(BlazeExpressionParser.LP); + this.state = 379; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << BlazeExpressionParser.START_QUOTE) | (1 << BlazeExpressionParser.START_DOUBLE_QUOTE) | (1 << BlazeExpressionParser.INTEGER_LITERAL) | (1 << BlazeExpressionParser.NUMERIC_LITERAL) | (1 << BlazeExpressionParser.AND) | (1 << BlazeExpressionParser.BETWEEN) | (1 << BlazeExpressionParser.DATE) | (1 << BlazeExpressionParser.DAYS) | (1 << BlazeExpressionParser.DISTINCT) | (1 << BlazeExpressionParser.FALSE) | (1 << BlazeExpressionParser.FROM) | (1 << BlazeExpressionParser.FULL) | (1 << BlazeExpressionParser.HOURS) | (1 << BlazeExpressionParser.IN) | (1 << BlazeExpressionParser.INTERVAL) | (1 << BlazeExpressionParser.IS) | (1 << BlazeExpressionParser.JOIN) | (1 << BlazeExpressionParser.LEFT) | (1 << BlazeExpressionParser.MINUTES) | (1 << BlazeExpressionParser.MONTHS) | (1 << BlazeExpressionParser.NOT) | (1 << BlazeExpressionParser.ON) | (1 << BlazeExpressionParser.OR) | (1 << BlazeExpressionParser.RIGHT) | (1 << BlazeExpressionParser.SECONDS) | (1 << BlazeExpressionParser.SELECT) | (1 << BlazeExpressionParser.TIME))) !== 0) || ((((_la - 32)) & ~0x1F) === 0 && ((1 << (_la - 32)) & ((1 << (BlazeExpressionParser.TIMESTAMP - 32)) | (1 << (BlazeExpressionParser.TRUE - 32)) | (1 << (BlazeExpressionParser.WHERE - 32)) | (1 << (BlazeExpressionParser.YEARS - 32)) | (1 << (BlazeExpressionParser.PLUS - 32)) | (1 << (BlazeExpressionParser.MINUS - 32)) | (1 << (BlazeExpressionParser.LP - 32)) | (1 << (BlazeExpressionParser.LB - 32)) | (1 << (BlazeExpressionParser.EXCLAMATION_MARK - 32)) | (1 << (BlazeExpressionParser.IDENTIFIER - 32)) | (1 << (BlazeExpressionParser.QUOTED_IDENTIFIER - 32)))) !== 0)) { + { + this.state = 375; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 36, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + { + { + this.state = 370; + this.predicateOrExpression(); + this.state = 371; + this.match(BlazeExpressionParser.COMMA); + } + } + } + this.state = 377; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 36, this._ctx); + } + this.state = 378; + this.predicateOrExpression(); + } + } + + this.state = 381; + this.match(BlazeExpressionParser.RP); + } + break; + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public dateLiteral(): DateLiteralContext { + let _localctx: DateLiteralContext = new DateLiteralContext(this._ctx, this.state); + this.enterRule(_localctx, 54, BlazeExpressionParser.RULE_dateLiteral); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 385; + this.match(BlazeExpressionParser.DATE); + this.state = 386; + this.match(BlazeExpressionParser.LP); + this.state = 387; + this.datePart(); + this.state = 388; + this.match(BlazeExpressionParser.RP); + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public timeLiteral(): TimeLiteralContext { + let _localctx: TimeLiteralContext = new TimeLiteralContext(this._ctx, this.state); + this.enterRule(_localctx, 56, BlazeExpressionParser.RULE_timeLiteral); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 390; + this.match(BlazeExpressionParser.TIME); + this.state = 391; + this.match(BlazeExpressionParser.LP); + this.state = 392; + this.timePart(); + this.state = 395; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === BlazeExpressionParser.DOT) { + { + this.state = 393; + this.match(BlazeExpressionParser.DOT); + this.state = 394; + _localctx._fraction = this._input.LT(1); + _la = this._input.LA(1); + if (!(_la === BlazeExpressionParser.INTEGER_LITERAL || _la === BlazeExpressionParser.LEADING_ZERO_INTEGER_LITERAL)) { + _localctx._fraction = this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + } + } + + this.state = 397; + this.match(BlazeExpressionParser.RP); + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public timestampLiteral(): TimestampLiteralContext { + let _localctx: TimestampLiteralContext = new TimestampLiteralContext(this._ctx, this.state); + this.enterRule(_localctx, 58, BlazeExpressionParser.RULE_timestampLiteral); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 399; + this.match(BlazeExpressionParser.TIMESTAMP); + this.state = 400; + this.match(BlazeExpressionParser.LP); + this.state = 401; + this.datePart(); + this.state = 407; + this._errHandler.sync(this); + _la = this._input.LA(1); if (_la === BlazeExpressionParser.INTEGER_LITERAL || _la === BlazeExpressionParser.LEADING_ZERO_INTEGER_LITERAL) { { - this.state = 318; + this.state = 402; this.timePart(); - this.state = 321; + this.state = 405; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === BlazeExpressionParser.DOT) { { - this.state = 319; + this.state = 403; this.match(BlazeExpressionParser.DOT); - this.state = 320; + this.state = 404; _localctx._fraction = this._input.LT(1); _la = this._input.LA(1); if (!(_la === BlazeExpressionParser.INTEGER_LITERAL || _la === BlazeExpressionParser.LEADING_ZERO_INTEGER_LITERAL)) { @@ -1587,7 +2017,7 @@ export class BlazeExpressionParser extends Parser { } } - this.state = 325; + this.state = 409; this.match(BlazeExpressionParser.RP); } } @@ -1608,16 +2038,16 @@ export class BlazeExpressionParser extends Parser { // @RuleVersion(0) public datePart(): DatePartContext { let _localctx: DatePartContext = new DatePartContext(this._ctx, this.state); - this.enterRule(_localctx, 38, BlazeExpressionParser.RULE_datePart); + this.enterRule(_localctx, 60, BlazeExpressionParser.RULE_datePart); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 327; + this.state = 411; this.match(BlazeExpressionParser.INTEGER_LITERAL); - this.state = 328; + this.state = 412; this.match(BlazeExpressionParser.MINUS); - this.state = 329; + this.state = 413; _la = this._input.LA(1); if (!(_la === BlazeExpressionParser.INTEGER_LITERAL || _la === BlazeExpressionParser.LEADING_ZERO_INTEGER_LITERAL)) { this._errHandler.recoverInline(this); @@ -1629,9 +2059,9 @@ export class BlazeExpressionParser extends Parser { this._errHandler.reportMatch(this); this.consume(); } - this.state = 330; + this.state = 414; this.match(BlazeExpressionParser.MINUS); - this.state = 331; + this.state = 415; _la = this._input.LA(1); if (!(_la === BlazeExpressionParser.INTEGER_LITERAL || _la === BlazeExpressionParser.LEADING_ZERO_INTEGER_LITERAL)) { this._errHandler.recoverInline(this); @@ -1662,12 +2092,12 @@ export class BlazeExpressionParser extends Parser { // @RuleVersion(0) public timePart(): TimePartContext { let _localctx: TimePartContext = new TimePartContext(this._ctx, this.state); - this.enterRule(_localctx, 40, BlazeExpressionParser.RULE_timePart); + this.enterRule(_localctx, 62, BlazeExpressionParser.RULE_timePart); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 333; + this.state = 417; _la = this._input.LA(1); if (!(_la === BlazeExpressionParser.INTEGER_LITERAL || _la === BlazeExpressionParser.LEADING_ZERO_INTEGER_LITERAL)) { this._errHandler.recoverInline(this); @@ -1679,9 +2109,9 @@ export class BlazeExpressionParser extends Parser { this._errHandler.reportMatch(this); this.consume(); } - this.state = 334; + this.state = 418; this.match(BlazeExpressionParser.COLON); - this.state = 335; + this.state = 419; _la = this._input.LA(1); if (!(_la === BlazeExpressionParser.INTEGER_LITERAL || _la === BlazeExpressionParser.LEADING_ZERO_INTEGER_LITERAL)) { this._errHandler.recoverInline(this); @@ -1693,9 +2123,9 @@ export class BlazeExpressionParser extends Parser { this._errHandler.reportMatch(this); this.consume(); } - this.state = 336; + this.state = 420; this.match(BlazeExpressionParser.COLON); - this.state = 337; + this.state = 421; _la = this._input.LA(1); if (!(_la === BlazeExpressionParser.INTEGER_LITERAL || _la === BlazeExpressionParser.LEADING_ZERO_INTEGER_LITERAL)) { this._errHandler.recoverInline(this); @@ -1726,78 +2156,78 @@ export class BlazeExpressionParser extends Parser { // @RuleVersion(0) public temporalIntervalLiteral(): TemporalIntervalLiteralContext { let _localctx: TemporalIntervalLiteralContext = new TemporalIntervalLiteralContext(this._ctx, this.state); - this.enterRule(_localctx, 42, BlazeExpressionParser.RULE_temporalIntervalLiteral); + this.enterRule(_localctx, 64, BlazeExpressionParser.RULE_temporalIntervalLiteral); try { this.enterOuterAlt(_localctx, 1); { - this.state = 339; + this.state = 423; this.match(BlazeExpressionParser.INTERVAL); - this.state = 412; + this.state = 496; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 49, this._ctx) ) { + switch ( this.interpreter.adaptivePredict(this._input, 57, this._ctx) ) { case 1: { { - this.state = 340; + this.state = 424; _localctx._years = this.match(BlazeExpressionParser.INTEGER_LITERAL); - this.state = 341; + this.state = 425; this.match(BlazeExpressionParser.YEARS); - this.state = 344; + this.state = 428; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 34, this._ctx) ) { + switch ( this.interpreter.adaptivePredict(this._input, 42, this._ctx) ) { case 1: { - this.state = 342; + this.state = 426; _localctx._months = this.match(BlazeExpressionParser.INTEGER_LITERAL); - this.state = 343; + this.state = 427; this.match(BlazeExpressionParser.MONTHS); } break; } - this.state = 348; + this.state = 432; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 35, this._ctx) ) { + switch ( this.interpreter.adaptivePredict(this._input, 43, this._ctx) ) { case 1: { - this.state = 346; + this.state = 430; _localctx._days = this.match(BlazeExpressionParser.INTEGER_LITERAL); - this.state = 347; + this.state = 431; this.match(BlazeExpressionParser.DAYS); } break; } - this.state = 352; + this.state = 436; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 36, this._ctx) ) { + switch ( this.interpreter.adaptivePredict(this._input, 44, this._ctx) ) { case 1: { - this.state = 350; + this.state = 434; _localctx._hours = this.match(BlazeExpressionParser.INTEGER_LITERAL); - this.state = 351; + this.state = 435; this.match(BlazeExpressionParser.HOURS); } break; } - this.state = 356; + this.state = 440; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 37, this._ctx) ) { + switch ( this.interpreter.adaptivePredict(this._input, 45, this._ctx) ) { case 1: { - this.state = 354; + this.state = 438; _localctx._minutes = this.match(BlazeExpressionParser.INTEGER_LITERAL); - this.state = 355; + this.state = 439; this.match(BlazeExpressionParser.MINUTES); } break; } - this.state = 360; + this.state = 444; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 38, this._ctx) ) { + switch ( this.interpreter.adaptivePredict(this._input, 46, this._ctx) ) { case 1: { - this.state = 358; + this.state = 442; _localctx._seconds = this.match(BlazeExpressionParser.INTEGER_LITERAL); - this.state = 359; + this.state = 443; this.match(BlazeExpressionParser.SECONDS); } break; @@ -1809,54 +2239,54 @@ export class BlazeExpressionParser extends Parser { case 2: { { - this.state = 362; + this.state = 446; _localctx._months = this.match(BlazeExpressionParser.INTEGER_LITERAL); - this.state = 363; + this.state = 447; this.match(BlazeExpressionParser.MONTHS); - this.state = 366; + this.state = 450; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 39, this._ctx) ) { + switch ( this.interpreter.adaptivePredict(this._input, 47, this._ctx) ) { case 1: { - this.state = 364; + this.state = 448; _localctx._days = this.match(BlazeExpressionParser.INTEGER_LITERAL); - this.state = 365; + this.state = 449; this.match(BlazeExpressionParser.DAYS); } break; } - this.state = 370; + this.state = 454; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 40, this._ctx) ) { + switch ( this.interpreter.adaptivePredict(this._input, 48, this._ctx) ) { case 1: { - this.state = 368; + this.state = 452; _localctx._hours = this.match(BlazeExpressionParser.INTEGER_LITERAL); - this.state = 369; + this.state = 453; this.match(BlazeExpressionParser.HOURS); } break; } - this.state = 374; + this.state = 458; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 41, this._ctx) ) { + switch ( this.interpreter.adaptivePredict(this._input, 49, this._ctx) ) { case 1: { - this.state = 372; + this.state = 456; _localctx._minutes = this.match(BlazeExpressionParser.INTEGER_LITERAL); - this.state = 373; + this.state = 457; this.match(BlazeExpressionParser.MINUTES); } break; } - this.state = 378; + this.state = 462; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 42, this._ctx) ) { + switch ( this.interpreter.adaptivePredict(this._input, 50, this._ctx) ) { case 1: { - this.state = 376; + this.state = 460; _localctx._seconds = this.match(BlazeExpressionParser.INTEGER_LITERAL); - this.state = 377; + this.state = 461; this.match(BlazeExpressionParser.SECONDS); } break; @@ -1868,42 +2298,42 @@ export class BlazeExpressionParser extends Parser { case 3: { { - this.state = 380; + this.state = 464; _localctx._days = this.match(BlazeExpressionParser.INTEGER_LITERAL); - this.state = 381; + this.state = 465; this.match(BlazeExpressionParser.DAYS); - this.state = 384; + this.state = 468; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 43, this._ctx) ) { + switch ( this.interpreter.adaptivePredict(this._input, 51, this._ctx) ) { case 1: { - this.state = 382; + this.state = 466; _localctx._hours = this.match(BlazeExpressionParser.INTEGER_LITERAL); - this.state = 383; + this.state = 467; this.match(BlazeExpressionParser.HOURS); } break; } - this.state = 388; + this.state = 472; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 44, this._ctx) ) { + switch ( this.interpreter.adaptivePredict(this._input, 52, this._ctx) ) { case 1: { - this.state = 386; + this.state = 470; _localctx._minutes = this.match(BlazeExpressionParser.INTEGER_LITERAL); - this.state = 387; + this.state = 471; this.match(BlazeExpressionParser.MINUTES); } break; } - this.state = 392; + this.state = 476; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 45, this._ctx) ) { + switch ( this.interpreter.adaptivePredict(this._input, 53, this._ctx) ) { case 1: { - this.state = 390; + this.state = 474; _localctx._seconds = this.match(BlazeExpressionParser.INTEGER_LITERAL); - this.state = 391; + this.state = 475; this.match(BlazeExpressionParser.SECONDS); } break; @@ -1915,30 +2345,30 @@ export class BlazeExpressionParser extends Parser { case 4: { { - this.state = 394; + this.state = 478; _localctx._hours = this.match(BlazeExpressionParser.INTEGER_LITERAL); - this.state = 395; + this.state = 479; this.match(BlazeExpressionParser.HOURS); - this.state = 398; + this.state = 482; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 46, this._ctx) ) { + switch ( this.interpreter.adaptivePredict(this._input, 54, this._ctx) ) { case 1: { - this.state = 396; + this.state = 480; _localctx._minutes = this.match(BlazeExpressionParser.INTEGER_LITERAL); - this.state = 397; + this.state = 481; this.match(BlazeExpressionParser.MINUTES); } break; } - this.state = 402; + this.state = 486; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 47, this._ctx) ) { + switch ( this.interpreter.adaptivePredict(this._input, 55, this._ctx) ) { case 1: { - this.state = 400; + this.state = 484; _localctx._seconds = this.match(BlazeExpressionParser.INTEGER_LITERAL); - this.state = 401; + this.state = 485; this.match(BlazeExpressionParser.SECONDS); } break; @@ -1950,18 +2380,18 @@ export class BlazeExpressionParser extends Parser { case 5: { { - this.state = 404; + this.state = 488; _localctx._minutes = this.match(BlazeExpressionParser.INTEGER_LITERAL); - this.state = 405; + this.state = 489; this.match(BlazeExpressionParser.MINUTES); - this.state = 408; + this.state = 492; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 48, this._ctx) ) { + switch ( this.interpreter.adaptivePredict(this._input, 56, this._ctx) ) { case 1: { - this.state = 406; + this.state = 490; _localctx._seconds = this.match(BlazeExpressionParser.INTEGER_LITERAL); - this.state = 407; + this.state = 491; this.match(BlazeExpressionParser.SECONDS); } break; @@ -1973,9 +2403,9 @@ export class BlazeExpressionParser extends Parser { case 6: { { - this.state = 410; + this.state = 494; _localctx._seconds = this.match(BlazeExpressionParser.INTEGER_LITERAL); - this.state = 411; + this.state = 495; this.match(BlazeExpressionParser.SECONDS); } } @@ -2000,14 +2430,14 @@ export class BlazeExpressionParser extends Parser { // @RuleVersion(0) public identifier(): IdentifierContext { let _localctx: IdentifierContext = new IdentifierContext(this._ctx, this.state); - this.enterRule(_localctx, 44, BlazeExpressionParser.RULE_identifier); + this.enterRule(_localctx, 66, BlazeExpressionParser.RULE_identifier); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 414; + this.state = 498; _la = this._input.LA(1); - if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << BlazeExpressionParser.AND) | (1 << BlazeExpressionParser.BETWEEN) | (1 << BlazeExpressionParser.DATE) | (1 << BlazeExpressionParser.DAYS) | (1 << BlazeExpressionParser.HOURS) | (1 << BlazeExpressionParser.IN) | (1 << BlazeExpressionParser.IS) | (1 << BlazeExpressionParser.MINUTES) | (1 << BlazeExpressionParser.MONTHS) | (1 << BlazeExpressionParser.NOT) | (1 << BlazeExpressionParser.OR) | (1 << BlazeExpressionParser.SECONDS) | (1 << BlazeExpressionParser.TIME) | (1 << BlazeExpressionParser.TIMESTAMP) | (1 << BlazeExpressionParser.YEARS))) !== 0) || _la === BlazeExpressionParser.IDENTIFIER || _la === BlazeExpressionParser.QUOTED_IDENTIFIER)) { + if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << BlazeExpressionParser.AND) | (1 << BlazeExpressionParser.BETWEEN) | (1 << BlazeExpressionParser.DATE) | (1 << BlazeExpressionParser.DAYS) | (1 << BlazeExpressionParser.DISTINCT) | (1 << BlazeExpressionParser.FROM) | (1 << BlazeExpressionParser.FULL) | (1 << BlazeExpressionParser.HOURS) | (1 << BlazeExpressionParser.IN) | (1 << BlazeExpressionParser.IS) | (1 << BlazeExpressionParser.JOIN) | (1 << BlazeExpressionParser.LEFT) | (1 << BlazeExpressionParser.MINUTES) | (1 << BlazeExpressionParser.MONTHS) | (1 << BlazeExpressionParser.NOT) | (1 << BlazeExpressionParser.ON) | (1 << BlazeExpressionParser.OR) | (1 << BlazeExpressionParser.RIGHT) | (1 << BlazeExpressionParser.SECONDS) | (1 << BlazeExpressionParser.SELECT) | (1 << BlazeExpressionParser.TIME))) !== 0) || ((((_la - 32)) & ~0x1F) === 0 && ((1 << (_la - 32)) & ((1 << (BlazeExpressionParser.TIMESTAMP - 32)) | (1 << (BlazeExpressionParser.WHERE - 32)) | (1 << (BlazeExpressionParser.YEARS - 32)) | (1 << (BlazeExpressionParser.IDENTIFIER - 32)) | (1 << (BlazeExpressionParser.QUOTED_IDENTIFIER - 32)))) !== 0))) { this._errHandler.recoverInline(this); } else { if (this._input.LA(1) === Token.EOF) { @@ -2036,10 +2466,10 @@ export class BlazeExpressionParser extends Parser { public sempred(_localctx: RuleContext, ruleIndex: number, predIndex: number): boolean { switch (ruleIndex) { - case 5: + case 6: return this.expression_sempred(_localctx as ExpressionContext, predIndex); - case 6: + case 7: return this.predicate_sempred(_localctx as PredicateContext, predIndex); } return true; @@ -2062,257 +2492,496 @@ export class BlazeExpressionParser extends Parser { case 3: return this.precpred(this._ctx, 13); } - return true; + return true; + } + + public static readonly _serializedATN: string = + "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x03B\u01F7\x04\x02" + + "\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06\x04\x07" + + "\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x04\f\t\f\x04\r\t\r\x04" + + "\x0E\t\x0E\x04\x0F\t\x0F\x04\x10\t\x10\x04\x11\t\x11\x04\x12\t\x12\x04" + + "\x13\t\x13\x04\x14\t\x14\x04\x15\t\x15\x04\x16\t\x16\x04\x17\t\x17\x04" + + "\x18\t\x18\x04\x19\t\x19\x04\x1A\t\x1A\x04\x1B\t\x1B\x04\x1C\t\x1C\x04" + + "\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t\x1F\x04 \t \x04!\t!\x04\"\t\"\x04#" + + "\t#\x03\x02\x03\x02\x03\x02\x03\x03\x03\x03\x03\x03\x03\x04\x03\x04\x03" + + "\x04\x03\x05\x05\x05Q\n\x05\x03\x05\x03\x05\x03\x06\x03\x06\x03\x06\x03" + + "\x07\x03\x07\x03\x07\x03\x07\x03\x07\x06\x07]\n\x07\r\x07\x0E\x07^\x03" + + "\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x05" + + "\bm\n\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x07\bu\n\b\f\b\x0E\bx\v\b" + + "\x03\t\x03\t\x03\t\x03\t\x03\t\x03\t\x03\t\x03\t\x03\t\x03\t\x05\t\x84" + + "\n\t\x03\t\x03\t\x03\t\x03\t\x03\t\x05\t\x8B\n\t\x03\t\x03\t\x03\t\x03" + + "\t\x03\t\x03\t\x03\t\x03\t\x03\t\x03\t\x03\t\x03\t\x03\t\x03\t\x03\t\x03" + + "\t\x03\t\x03\t\x03\t\x03\t\x03\t\x03\t\x03\t\x03\t\x03\t\x03\t\x03\t\x03" + + "\t\x05\t\xA9\n\t\x03\t\x03\t\x03\t\x03\t\x03\t\x05\t\xB0\n\t\x03\t\x03" + + "\t\x03\t\x03\t\x03\t\x03\t\x03\t\x05\t\xB9\n\t\x03\t\x03\t\x03\t\x03\t" + + "\x03\t\x03\t\x07\t\xC1\n\t\f\t\x0E\t\xC4\v\t\x03\n\x03\n\x05\n\xC8\n\n" + + "\x03\v\x05\v\xCB\n\v\x03\v\x03\v\x05\v\xCF\n\v\x03\f\x03\f\x05\f\xD3\n" + + "\f\x03\f\x03\f\x03\f\x07\f\xD8\n\f\f\f\x0E\f\xDB\v\f\x03\r\x03\r\x03\r" + + "\x03\r\x07\r\xE1\n\r\f\r\x0E\r\xE4\v\r\x03\x0E\x03\x0E\x03\x0E\x03\x0F" + + "\x03\x0F\x07\x0F\xEB\n\x0F\f\x0F\x0E\x0F\xEE\v\x0F\x03\x10\x03\x10\x03" + + "\x10\x03\x11\x05\x11\xF4\n\x11\x03\x11\x03\x11\x03\x11\x03\x11\x03\x11" + + "\x03\x12\x03\x12\x03\x12\x03\x13\x03\x13\x03\x14\x05\x14\u0101\n\x14\x03" + + "\x14\x03\x14\x03\x15\x03\x15\x03\x15\x03\x15\x07\x15\u0109\n\x15\f\x15" + + "\x0E\x15\u010C\v\x15\x03\x15\x03\x15\x03\x15\x05\x15\u0111\n\x15\x03\x16" + + "\x03\x16\x05\x16\u0115\n\x16\x03\x16\x03\x16\x03\x16\x05\x16\u011A\n\x16" + + "\x03\x17\x03\x17\x06\x17\u011E\n\x17\r\x17\x0E\x17\u011F\x03\x18\x03\x18" + + "\x03\x18\x03\x18\x03\x18\x03\x18\x03\x18\x03\x18\x03\x18\x03\x18\x03\x18" + + "\x05\x18\u012D\n\x18\x03\x19\x03\x19\x07\x19\u0131\n\x19\f\x19\x0E\x19" + + "\u0134\v\x19\x03\x19\x03\x19\x03\x19\x07\x19\u0139\n\x19\f\x19\x0E\x19" + + "\u013C\v\x19\x03\x19\x05\x19\u013F\n\x19\x03\x1A\x03\x1A\x03\x1A\x03\x1A" + + "\x07\x1A\u0145\n\x1A\f\x1A\x0E\x1A\u0148\v\x1A\x05\x1A\u014A\n\x1A\x03" + + "\x1A\x03\x1A\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x07" + + "\x1B\u0155\n\x1B\f\x1B\x0E\x1B\u0158\v\x1B\x03\x1B\x03\x1B\x03\x1B\x03" + + "\x1B\x03\x1B\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x07" + + "\x1C\u0166\n\x1C\f\x1C\x0E\x1C\u0169\v\x1C\x03\x1C\x03\x1C\x03\x1C\x03" + + "\x1C\x05\x1C\u016F\n\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C" + + "\x03\x1C\x07\x1C\u0178\n\x1C\f\x1C\x0E\x1C\u017B\v\x1C\x03\x1C\x05\x1C" + + "\u017E\n\x1C\x03\x1C\x03\x1C\x05\x1C\u0182\n\x1C\x03\x1D\x03\x1D\x03\x1D" + + "\x03\x1D\x03\x1D\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x05\x1E\u018E" + + "\n\x1E\x03\x1E\x03\x1E\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F" + + "\x05\x1F\u0198\n\x1F\x05\x1F\u019A\n\x1F\x03\x1F\x03\x1F\x03 \x03 \x03" + + " \x03 \x03 \x03 \x03!\x03!\x03!\x03!\x03!\x03!\x03\"\x03\"\x03\"\x03\"" + + "\x03\"\x05\"\u01AF\n\"\x03\"\x03\"\x05\"\u01B3\n\"\x03\"\x03\"\x05\"\u01B7" + + "\n\"\x03\"\x03\"\x05\"\u01BB\n\"\x03\"\x03\"\x05\"\u01BF\n\"\x03\"\x03" + + "\"\x03\"\x03\"\x05\"\u01C5\n\"\x03\"\x03\"\x05\"\u01C9\n\"\x03\"\x03\"" + + "\x05\"\u01CD\n\"\x03\"\x03\"\x05\"\u01D1\n\"\x03\"\x03\"\x03\"\x03\"\x05" + + "\"\u01D7\n\"\x03\"\x03\"\x05\"\u01DB\n\"\x03\"\x03\"\x05\"\u01DF\n\"\x03" + + "\"\x03\"\x03\"\x03\"\x05\"\u01E5\n\"\x03\"\x03\"\x05\"\u01E9\n\"\x03\"" + + "\x03\"\x03\"\x03\"\x05\"\u01EF\n\"\x03\"\x03\"\x05\"\u01F3\n\"\x03#\x03" + + "#\x03#\x02\x02\x04\x0E\x10$\x02\x02\x04\x02\x06\x02\b\x02\n\x02\f\x02" + + "\x0E\x02\x10\x02\x12\x02\x14\x02\x16\x02\x18\x02\x1A\x02\x1C\x02\x1E\x02" + + " \x02\"\x02$\x02&\x02(\x02*\x02,\x02.\x020\x022\x024\x026\x028\x02:\x02" + + "<\x02>\x02@\x02B\x02D\x02\x02\b\x03\x02.0\x03\x02,-\x04\x02\x1A\x1A88" + + "\x05\x02\x11\x11\x17\x17\x1E\x1E\x04\x02\x06\x06\b\b\b\x02\t\r\x10\x13" + + "\x15\x1A\x1C\"$%9:\x02\u022B\x02F\x03\x02\x02\x02\x04I\x03\x02\x02\x02" + + "\x06L\x03\x02\x02\x02\bP\x03\x02\x02\x02\nT\x03\x02\x02\x02\f\\\x03\x02" + + "\x02\x02\x0El\x03\x02\x02\x02\x10\xB8\x03\x02\x02\x02\x12\xC7\x03\x02" + + "\x02\x02\x14\xCA\x03\x02\x02\x02\x16\xD0\x03\x02\x02\x02\x18\xDC\x03\x02" + + "\x02\x02\x1A\xE5\x03\x02\x02\x02\x1C\xE8\x03\x02\x02\x02\x1E\xEF\x03\x02" + + "\x02\x02 \xF3\x03\x02\x02\x02\"\xFA\x03\x02\x02\x02$\xFD\x03\x02\x02\x02" + + "&\u0100\x03\x02\x02\x02(\u0110\x03\x02\x02\x02*\u0119\x03\x02\x02\x02" + + ",\u011D\x03\x02\x02\x02.\u012C\x03\x02\x02\x020\u013E\x03\x02\x02\x02" + + "2\u0140\x03\x02\x02\x024\u014D\x03\x02\x02\x026\u0181\x03\x02\x02\x02" + + "8\u0183\x03\x02\x02\x02:\u0188\x03\x02\x02\x02<\u0191\x03\x02\x02\x02" + + ">\u019D\x03\x02\x02\x02@\u01A3\x03\x02\x02\x02B\u01A9\x03\x02\x02\x02" + + "D\u01F4\x03\x02\x02\x02FG\x05\x10\t\x02GH\x07\x02\x02\x03H\x03\x03\x02" + + "\x02\x02IJ\x05\x0E\b\x02JK\x07\x02\x02\x03K\x05\x03\x02\x02\x02LM\x05" + + "\x12\n\x02MN\x07\x02\x02\x03N\x07\x03\x02\x02\x02OQ\x05\f\x07\x02PO\x03" + + "\x02\x02\x02PQ\x03\x02\x02\x02QR\x03\x02\x02\x02RS\x07\x02\x02\x03S\t" + + "\x03\x02\x02\x02TU\x05\x14\v\x02UV\x07\x02\x02\x03V\v\x03\x02\x02\x02" + + "W]\x07=\x02\x02XY\x07<\x02\x02YZ\x05\x0E\b\x02Z[\x07;\x02\x02[]\x03\x02" + + "\x02\x02\\W\x03\x02\x02\x02\\X\x03\x02\x02\x02]^\x03\x02\x02\x02^\\\x03" + + "\x02\x02\x02^_\x03\x02\x02\x02_\r\x03\x02\x02\x02`a\b\b\x01\x02ab\x07" + + "1\x02\x02bc\x05\x0E\b\x02cd\x072\x02\x02dm\x03\x02\x02\x02em\x05.\x18" + + "\x02fm\x05*\x16\x02gm\x056\x1C\x02hi\x07-\x02\x02im\x05\x0E\b\x06jk\x07" + + ",\x02\x02km\x05\x0E\b\x05l`\x03\x02\x02\x02le\x03\x02\x02\x02lf\x03\x02" + + "\x02\x02lg\x03\x02\x02\x02lh\x03\x02\x02\x02lj\x03\x02\x02\x02mv\x03\x02" + + "\x02\x02no\f\x04\x02\x02op\t\x02\x02\x02pu\x05\x0E\b\x05qr\f\x03\x02\x02" + + "rs\t\x03\x02\x02su\x05\x0E\b\x04tn\x03\x02\x02\x02tq\x03\x02\x02\x02u" + + "x\x03\x02\x02\x02vt\x03\x02\x02\x02vw\x03\x02\x02\x02w\x0F\x03\x02\x02" + + "\x02xv\x03\x02\x02\x02yz\b\t\x01\x02z{\x071\x02\x02{|\x05\x10\t\x02|}" + + "\x072\x02\x02}\xB9\x03\x02\x02\x02~\x7F\t\x04\x02\x02\x7F\xB9\x05\x10" + + "\t\x11\x80\x81\x05\x0E\b\x02\x81\x83\x07\x15\x02\x02\x82\x84\x07\x1A\x02" + + "\x02\x83\x82\x03\x02\x02\x02\x83\x84\x03\x02\x02\x02\x84\x85\x03\x02\x02" + + "\x02\x85\x86\x07\x1B\x02\x02\x86\xB9\x03\x02\x02\x02\x87\x88\x05\x0E\b" + + "\x02\x88\x8A\x07\x15\x02\x02\x89\x8B\x07\x1A\x02\x02\x8A\x89\x03\x02\x02" + + "\x02\x8A\x8B\x03\x02\x02\x02\x8B\x8C\x03\x02\x02\x02\x8C\x8D\x07\x0E\x02" + + "\x02\x8D\xB9\x03\x02\x02\x02\x8E\x8F\x05\x0E\b\x02\x8F\x90\x07*\x02\x02" + + "\x90\x91\x05\x0E\b\x02\x91\xB9\x03\x02\x02\x02\x92\x93\x05\x0E\b\x02\x93" + + "\x94\x07+\x02\x02\x94\x95\x05\x0E\b\x02\x95\xB9\x03\x02\x02\x02\x96\x97" + + "\x05\x0E\b\x02\x97\x98\x07(\x02\x02\x98\x99\x05\x0E\b\x02\x99\xB9\x03" + + "\x02\x02\x02\x9A\x9B\x05\x0E\b\x02\x9B\x9C\x07)\x02\x02\x9C\x9D\x05\x0E" + + "\b\x02\x9D\xB9\x03\x02\x02\x02\x9E\x9F\x05\x0E\b\x02\x9F\xA0\x07&\x02" + + "\x02\xA0\xA1\x05\x0E\b\x02\xA1\xB9\x03\x02\x02\x02\xA2\xA3\x05\x0E\b\x02" + + "\xA3\xA4\x07\'\x02\x02\xA4\xA5\x05\x0E\b\x02\xA5\xB9\x03\x02\x02\x02\xA6" + + "\xA8\x05\x0E\b\x02\xA7\xA9\x07\x1A\x02\x02\xA8\xA7\x03\x02\x02\x02\xA8" + + "\xA9\x03\x02\x02\x02\xA9\xAA\x03\x02\x02\x02\xAA\xAB\x07\x13\x02\x02\xAB" + + "\xAC\x05(\x15\x02\xAC\xB9\x03\x02\x02\x02\xAD\xAF\x05\x0E\b\x02\xAE\xB0" + + "\x07\x1A\x02\x02\xAF\xAE\x03\x02\x02\x02\xAF\xB0\x03\x02\x02\x02\xB0\xB1" + + "\x03\x02\x02\x02\xB1\xB2\x07\n\x02\x02\xB2\xB3\x05\x0E\b\x02\xB3\xB4\x07" + + "\t\x02\x02\xB4\xB5\x05\x0E\b\x02\xB5\xB9\x03\x02\x02\x02\xB6\xB9\x056" + + "\x1C\x02\xB7\xB9\x05*\x16\x02\xB8y\x03\x02\x02\x02\xB8~\x03\x02\x02\x02" + + "\xB8\x80\x03\x02\x02\x02\xB8\x87\x03\x02\x02\x02\xB8\x8E\x03\x02\x02\x02" + + "\xB8\x92\x03\x02\x02\x02\xB8\x96\x03\x02\x02\x02\xB8\x9A\x03\x02\x02\x02" + + "\xB8\x9E\x03\x02\x02\x02\xB8\xA2\x03\x02\x02\x02\xB8\xA6\x03\x02\x02\x02" + + "\xB8\xAD\x03\x02\x02\x02\xB8\xB6\x03\x02\x02\x02\xB8\xB7\x03\x02\x02\x02" + + "\xB9\xC2\x03\x02\x02\x02\xBA\xBB\f\x10\x02\x02\xBB\xBC\x07\t\x02\x02\xBC" + + "\xC1\x05\x10\t\x11\xBD\xBE\f\x0F\x02\x02\xBE\xBF\x07\x1D\x02\x02\xBF\xC1" + + "\x05\x10\t\x10\xC0\xBA\x03\x02\x02\x02\xC0\xBD\x03\x02\x02\x02\xC1\xC4" + + "\x03\x02\x02\x02\xC2\xC0\x03\x02\x02\x02\xC2\xC3\x03\x02\x02\x02\xC3\x11" + + "\x03\x02\x02\x02\xC4\xC2\x03\x02\x02\x02\xC5\xC8\x05\x0E\b\x02\xC6\xC8" + + "\x05\x10\t\x02\xC7\xC5\x03\x02\x02\x02\xC7\xC6\x03\x02\x02\x02\xC8\x13" + + "\x03\x02\x02\x02\xC9\xCB\x05\x16\f\x02\xCA\xC9\x03\x02\x02\x02\xCA\xCB" + + "\x03\x02\x02\x02\xCB\xCC\x03\x02\x02\x02\xCC\xCE\x05\x18\r\x02\xCD\xCF" + + "\x05\x1A\x0E\x02\xCE\xCD\x03\x02\x02\x02\xCE\xCF\x03\x02\x02\x02\xCF\x15" + + "\x03\x02\x02\x02\xD0\xD2\x07 \x02\x02\xD1\xD3\x07\r\x02\x02\xD2\xD1\x03" + + "\x02\x02\x02\xD2\xD3\x03\x02\x02\x02\xD3\xD4\x03\x02\x02\x02\xD4\xD9\x05" + + "\x0E\b\x02\xD5\xD6\x075\x02\x02\xD6\xD8\x05\x0E\b\x02\xD7\xD5\x03\x02" + + "\x02\x02\xD8\xDB\x03\x02\x02\x02\xD9\xD7\x03\x02\x02\x02\xD9\xDA\x03\x02" + + "\x02\x02\xDA\x17\x03\x02\x02\x02\xDB\xD9\x03\x02\x02\x02\xDC\xDD\x07\x10" + + "\x02\x02\xDD\xE2\x05\x1C\x0F\x02\xDE\xDF\x075\x02\x02\xDF\xE1\x05\x1C" + + "\x0F\x02\xE0\xDE\x03\x02\x02\x02\xE1\xE4\x03\x02\x02\x02\xE2\xE0\x03\x02" + + "\x02\x02\xE2\xE3\x03\x02\x02\x02\xE3\x19\x03\x02\x02\x02\xE4\xE2\x03\x02" + + "\x02\x02\xE5\xE6\x07$\x02\x02\xE6\xE7\x05\x10\t\x02\xE7\x1B\x03\x02\x02" + + "\x02\xE8\xEC\x05\x1E\x10\x02\xE9\xEB\x05 \x11\x02\xEA\xE9\x03\x02\x02" + + "\x02\xEB\xEE\x03\x02\x02\x02\xEC\xEA\x03\x02\x02\x02\xEC\xED\x03\x02\x02" + + "\x02\xED\x1D\x03\x02\x02\x02\xEE\xEC\x03\x02\x02\x02\xEF\xF0\x05$\x13" + + "\x02\xF0\xF1\x05&\x14\x02\xF1\x1F\x03\x02\x02\x02\xF2\xF4\t\x05\x02\x02" + + "\xF3\xF2\x03\x02\x02\x02\xF3\xF4\x03\x02\x02\x02\xF4\xF5\x03\x02\x02\x02" + + "\xF5\xF6\x07\x16\x02\x02\xF6\xF7\x05\"\x12\x02\xF7\xF8\x07\x1C\x02\x02" + + "\xF8\xF9\x05\x10\t\x02\xF9!\x03\x02\x02\x02\xFA\xFB\x05$\x13\x02\xFB\xFC" + + "\x05&\x14\x02\xFC#\x03\x02\x02\x02\xFD\xFE\x05D#\x02\xFE%\x03\x02\x02" + + "\x02\xFF\u0101\x07B\x02\x02\u0100\xFF\x03\x02\x02\x02\u0100\u0101\x03" + + "\x02\x02\x02\u0101\u0102\x03\x02\x02\x02\u0102\u0103\x05D#\x02\u0103\'" + + "\x03\x02\x02\x02\u0104\u0105\x071\x02\x02\u0105\u010A\x05\x0E\b\x02\u0106" + + "\u0107\x075\x02\x02\u0107\u0109\x05\x0E\b\x02\u0108\u0106\x03\x02\x02" + + "\x02\u0109\u010C\x03\x02\x02\x02\u010A\u0108\x03\x02\x02\x02\u010A\u010B" + + "\x03\x02\x02\x02\u010B\u010D\x03\x02\x02\x02\u010C\u010A\x03\x02\x02\x02" + + "\u010D\u010E\x072\x02\x02\u010E\u0111\x03\x02\x02\x02\u010F\u0111\x05" + + "\x0E\b\x02\u0110\u0104\x03\x02\x02\x02\u0110\u010F\x03\x02\x02\x02\u0111" + + ")\x03\x02\x02\x02\u0112\u0114\x05D#\x02\u0113\u0115\x05,\x17\x02\u0114" + + "\u0113\x03\x02\x02\x02\u0114\u0115\x03\x02\x02\x02\u0115\u011A\x03\x02" + + "\x02\x02\u0116\u0117\x056\x1C\x02\u0117\u0118\x05,\x17\x02\u0118\u011A" + + "\x03\x02\x02\x02\u0119\u0112\x03\x02\x02\x02\u0119\u0116\x03\x02\x02\x02" + + "\u011A+\x03\x02\x02\x02\u011B\u011C\x076\x02\x02\u011C\u011E\x05D#\x02" + + "\u011D\u011B\x03\x02\x02\x02\u011E\u011F\x03\x02\x02\x02\u011F\u011D\x03" + + "\x02\x02\x02\u011F\u0120\x03\x02\x02\x02\u0120-\x03\x02\x02\x02\u0121" + + "\u012D\x07\x07\x02\x02\u0122\u012D\x07\x06\x02\x02\u0123\u012D\x050\x19" + + "\x02\u0124\u012D\x07#\x02\x02\u0125\u012D\x07\x0F\x02\x02\u0126\u012D" + + "\x058\x1D\x02\u0127\u012D\x05:\x1E\x02\u0128\u012D\x05<\x1F\x02\u0129" + + "\u012D\x05B\"\x02\u012A\u012D\x052\x1A\x02\u012B\u012D\x054\x1B\x02\u012C" + + "\u0121\x03\x02\x02\x02\u012C\u0122\x03\x02\x02\x02\u012C\u0123\x03\x02" + + "\x02\x02\u012C\u0124\x03\x02\x02\x02\u012C\u0125\x03\x02\x02\x02\u012C" + + "\u0126\x03\x02\x02\x02\u012C\u0127\x03\x02\x02\x02\u012C\u0128\x03\x02" + + "\x02\x02\u012C\u0129\x03\x02\x02\x02\u012C\u012A\x03\x02\x02\x02\u012C" + + "\u012B\x03\x02\x02\x02\u012D/\x03\x02\x02\x02\u012E\u0132\x07\x04\x02" + + "\x02\u012F\u0131\x07>\x02\x02\u0130\u012F\x03\x02\x02\x02\u0131\u0134" + + "\x03\x02\x02\x02\u0132\u0130\x03\x02\x02\x02\u0132\u0133\x03\x02\x02\x02" + + "\u0133\u0135\x03\x02\x02\x02\u0134\u0132\x03\x02\x02\x02\u0135\u013F\x07" + + "?\x02\x02\u0136\u013A\x07\x05\x02\x02\u0137\u0139\x07@\x02\x02\u0138\u0137" + + "\x03\x02\x02\x02\u0139\u013C\x03\x02\x02\x02\u013A\u0138\x03\x02\x02\x02" + + "\u013A\u013B\x03\x02\x02\x02\u013B\u013D\x03\x02\x02\x02\u013C\u013A\x03" + + "\x02\x02\x02\u013D\u013F\x07A\x02\x02\u013E\u012E\x03\x02\x02\x02\u013E" + + "\u0136\x03\x02\x02\x02\u013F1\x03\x02\x02\x02\u0140\u0149\x073\x02\x02" + + "\u0141\u0146\x05.\x18\x02\u0142\u0143\x075\x02\x02\u0143\u0145\x05.\x18" + + "\x02\u0144\u0142\x03\x02\x02\x02\u0145\u0148\x03\x02\x02\x02\u0146\u0144" + + "\x03\x02\x02\x02\u0146\u0147\x03\x02\x02\x02\u0147\u014A\x03\x02\x02\x02" + + "\u0148\u0146\x03\x02\x02\x02\u0149\u0141\x03\x02\x02\x02\u0149\u014A\x03" + + "\x02\x02\x02\u014A\u014B\x03\x02\x02\x02\u014B\u014C\x074\x02\x02\u014C" + + "3\x03\x02\x02\x02\u014D\u014E\x05D#\x02\u014E\u0156\x071\x02\x02\u014F" + + "\u0150\x05D#\x02\u0150\u0151\x07*\x02\x02\u0151\u0152\x05\x12\n\x02\u0152" + + "\u0153\x075\x02\x02\u0153\u0155\x03\x02\x02\x02\u0154\u014F\x03\x02\x02" + + "\x02\u0155\u0158\x03\x02\x02\x02\u0156\u0154\x03\x02\x02\x02\u0156\u0157" + + "\x03\x02\x02\x02\u0157\u0159\x03\x02\x02\x02\u0158\u0156\x03\x02\x02\x02" + + "\u0159\u015A\x05D#\x02\u015A\u015B\x07*\x02\x02\u015B\u015C\x05\x12\n" + + "\x02\u015C\u015D\x072\x02\x02\u015D5\x03\x02\x02\x02\u015E\u015F\x05D" + + "#\x02\u015F\u016E\x071\x02\x02\u0160\u0161\x05D#\x02\u0161\u0162\x07*" + + "\x02\x02\u0162\u0163\x05\x12\n\x02\u0163\u0164\x075\x02\x02\u0164\u0166" + + "\x03\x02\x02\x02\u0165\u0160\x03\x02\x02\x02\u0166\u0169\x03\x02\x02\x02" + + "\u0167\u0165\x03\x02\x02\x02\u0167\u0168\x03\x02\x02\x02\u0168\u016A\x03" + + "\x02\x02\x02\u0169\u0167\x03\x02\x02\x02\u016A\u016B\x05D#\x02\u016B\u016C" + + "\x07*\x02\x02\u016C\u016D\x05\x12\n\x02\u016D\u016F\x03\x02\x02\x02\u016E" + + "\u0167\x03\x02\x02\x02\u016E\u016F\x03\x02\x02\x02\u016F\u0170\x03\x02" + + "\x02\x02\u0170\u0171\x072\x02\x02\u0171\u0182\x03\x02\x02\x02\u0172\u0173" + + "\x05D#\x02\u0173\u017D\x071\x02\x02\u0174\u0175\x05\x12\n\x02\u0175\u0176" + + "\x075\x02\x02\u0176\u0178\x03\x02\x02\x02\u0177\u0174\x03\x02\x02\x02" + + "\u0178\u017B\x03\x02\x02\x02\u0179\u0177\x03\x02\x02\x02\u0179\u017A\x03" + + "\x02\x02\x02\u017A\u017C\x03\x02\x02\x02\u017B\u0179\x03\x02\x02\x02\u017C" + + "\u017E\x05\x12\n\x02\u017D\u0179\x03\x02\x02\x02\u017D\u017E\x03\x02\x02" + + "\x02\u017E\u017F\x03\x02\x02\x02\u017F\u0180\x072\x02\x02\u0180\u0182" + + "\x03\x02\x02\x02\u0181\u015E\x03\x02\x02\x02\u0181\u0172\x03\x02\x02\x02" + + "\u01827\x03\x02\x02\x02\u0183\u0184\x07\v\x02\x02\u0184\u0185\x071\x02" + + "\x02\u0185\u0186\x05> \x02\u0186\u0187\x072\x02\x02\u01879\x03\x02\x02" + + "\x02\u0188\u0189\x07!\x02\x02\u0189\u018A\x071\x02\x02\u018A\u018D\x05" + + "@!\x02\u018B\u018C\x076\x02\x02\u018C\u018E\t\x06\x02\x02\u018D\u018B" + + "\x03\x02\x02\x02\u018D\u018E\x03\x02\x02\x02\u018E\u018F\x03\x02\x02\x02" + + "\u018F\u0190\x072\x02\x02\u0190;\x03\x02\x02\x02\u0191\u0192\x07\"\x02" + + "\x02\u0192\u0193\x071\x02\x02\u0193\u0199\x05> \x02\u0194\u0197\x05@!" + + "\x02\u0195\u0196\x076\x02\x02\u0196\u0198\t\x06\x02\x02\u0197\u0195\x03" + + "\x02\x02\x02\u0197\u0198\x03\x02\x02\x02\u0198\u019A\x03\x02\x02\x02\u0199" + + "\u0194\x03\x02\x02\x02\u0199\u019A\x03\x02\x02\x02\u019A\u019B\x03\x02" + + "\x02\x02\u019B\u019C\x072\x02\x02\u019C=\x03\x02\x02\x02\u019D\u019E\x07" + + "\x06\x02\x02\u019E\u019F\x07-\x02\x02\u019F\u01A0\t\x06\x02\x02\u01A0" + + "\u01A1\x07-\x02\x02\u01A1\u01A2\t\x06\x02\x02\u01A2?\x03\x02\x02\x02\u01A3" + + "\u01A4\t\x06\x02\x02\u01A4\u01A5\x077\x02\x02\u01A5\u01A6\t\x06\x02\x02" + + "\u01A6\u01A7\x077\x02\x02\u01A7\u01A8\t\x06\x02\x02\u01A8A\x03\x02\x02" + + "\x02\u01A9\u01F2\x07\x14\x02\x02\u01AA\u01AB\x07\x06\x02\x02\u01AB\u01AE" + + "\x07%\x02\x02\u01AC\u01AD\x07\x06\x02\x02\u01AD\u01AF\x07\x19\x02\x02" + + "\u01AE\u01AC\x03\x02\x02\x02\u01AE\u01AF\x03\x02\x02\x02\u01AF\u01B2\x03" + + "\x02\x02\x02\u01B0\u01B1\x07\x06\x02\x02\u01B1\u01B3\x07\f\x02\x02\u01B2" + + "\u01B0\x03\x02\x02\x02\u01B2\u01B3\x03\x02\x02\x02\u01B3\u01B6\x03\x02" + + "\x02\x02\u01B4\u01B5\x07\x06\x02\x02\u01B5\u01B7\x07\x12\x02\x02\u01B6" + + "\u01B4\x03\x02\x02\x02\u01B6\u01B7\x03\x02\x02\x02\u01B7\u01BA\x03\x02" + + "\x02\x02\u01B8\u01B9\x07\x06\x02\x02\u01B9\u01BB\x07\x18\x02\x02\u01BA" + + "\u01B8\x03\x02\x02\x02\u01BA\u01BB\x03\x02\x02\x02\u01BB\u01BE\x03\x02" + + "\x02\x02\u01BC\u01BD\x07\x06\x02\x02\u01BD\u01BF\x07\x1F\x02\x02\u01BE" + + "\u01BC\x03\x02\x02\x02\u01BE\u01BF\x03\x02\x02\x02\u01BF\u01F3\x03\x02" + + "\x02\x02\u01C0\u01C1\x07\x06\x02\x02\u01C1\u01C4\x07\x19\x02\x02\u01C2" + + "\u01C3\x07\x06\x02\x02\u01C3\u01C5\x07\f\x02\x02\u01C4\u01C2\x03\x02\x02" + + "\x02\u01C4\u01C5\x03\x02\x02\x02\u01C5\u01C8\x03\x02\x02\x02\u01C6\u01C7" + + "\x07\x06\x02\x02\u01C7\u01C9\x07\x12\x02\x02\u01C8\u01C6\x03\x02\x02\x02" + + "\u01C8\u01C9\x03\x02\x02\x02\u01C9\u01CC\x03\x02\x02\x02\u01CA\u01CB\x07" + + "\x06\x02\x02\u01CB\u01CD\x07\x18\x02\x02\u01CC\u01CA\x03\x02\x02\x02\u01CC" + + "\u01CD\x03\x02\x02\x02\u01CD\u01D0\x03\x02\x02\x02\u01CE\u01CF\x07\x06" + + "\x02\x02\u01CF\u01D1\x07\x1F\x02\x02\u01D0\u01CE\x03\x02\x02\x02\u01D0" + + "\u01D1\x03\x02\x02\x02\u01D1\u01F3\x03\x02\x02\x02\u01D2\u01D3\x07\x06" + + "\x02\x02\u01D3\u01D6\x07\f\x02\x02\u01D4\u01D5\x07\x06\x02\x02\u01D5\u01D7" + + "\x07\x12\x02\x02\u01D6\u01D4\x03\x02\x02\x02\u01D6\u01D7\x03\x02\x02\x02" + + "\u01D7\u01DA\x03\x02\x02\x02\u01D8\u01D9\x07\x06\x02\x02\u01D9\u01DB\x07" + + "\x18\x02\x02\u01DA\u01D8\x03\x02\x02\x02\u01DA\u01DB\x03\x02\x02\x02\u01DB" + + "\u01DE\x03\x02\x02\x02\u01DC\u01DD\x07\x06\x02\x02\u01DD\u01DF\x07\x1F" + + "\x02\x02\u01DE\u01DC\x03\x02\x02\x02\u01DE\u01DF\x03\x02\x02\x02\u01DF" + + "\u01F3\x03\x02\x02\x02\u01E0\u01E1\x07\x06\x02\x02\u01E1\u01E4\x07\x12" + + "\x02\x02\u01E2\u01E3\x07\x06\x02\x02\u01E3\u01E5\x07\x18\x02\x02\u01E4" + + "\u01E2\x03\x02\x02\x02\u01E4\u01E5\x03\x02\x02\x02\u01E5\u01E8\x03\x02" + + "\x02\x02\u01E6\u01E7\x07\x06\x02\x02\u01E7\u01E9\x07\x1F\x02\x02\u01E8" + + "\u01E6\x03\x02\x02\x02\u01E8\u01E9\x03\x02\x02\x02\u01E9\u01F3\x03\x02" + + "\x02\x02\u01EA\u01EB\x07\x06\x02\x02\u01EB\u01EE\x07\x18\x02\x02\u01EC" + + "\u01ED\x07\x06\x02\x02\u01ED\u01EF\x07\x1F\x02\x02\u01EE\u01EC\x03\x02" + + "\x02\x02\u01EE\u01EF\x03\x02\x02\x02\u01EF\u01F3\x03\x02\x02\x02\u01F0" + + "\u01F1\x07\x06\x02\x02\u01F1\u01F3\x07\x1F\x02\x02\u01F2\u01AA\x03\x02" + + "\x02\x02\u01F2\u01C0\x03\x02\x02\x02\u01F2\u01D2\x03\x02\x02\x02\u01F2" + + "\u01E0\x03\x02\x02\x02\u01F2\u01EA\x03\x02\x02\x02\u01F2\u01F0\x03\x02" + + "\x02\x02\u01F3C\x03\x02\x02\x02\u01F4\u01F5\t\x07\x02\x02\u01F5E\x03\x02" + + "\x02\x02(visitor: BlazeExpressionParserVisitor): Result { + if (visitor.visitParsePredicate) { + return visitor.visitParsePredicate(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class ParseExpressionContext extends ParserRuleContext { + public expression(): ExpressionContext { + return this.getRuleContext(0, ExpressionContext); + } + public EOF(): TerminalNode { return this.getToken(BlazeExpressionParser.EOF, 0); } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return BlazeExpressionParser.RULE_parseExpression; } + // @Override + public enterRule(listener: BlazeExpressionParserListener): void { + if (listener.enterParseExpression) { + listener.enterParseExpression(this); + } + } + // @Override + public exitRule(listener: BlazeExpressionParserListener): void { + if (listener.exitParseExpression) { + listener.exitParseExpression(this); + } + } + // @Override + public accept(visitor: BlazeExpressionParserVisitor): Result { + if (visitor.visitParseExpression) { + return visitor.visitParseExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class ParseExpressionOrPredicateContext extends ParserRuleContext { + public predicateOrExpression(): PredicateOrExpressionContext { + return this.getRuleContext(0, PredicateOrExpressionContext); + } + public EOF(): TerminalNode { return this.getToken(BlazeExpressionParser.EOF, 0); } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return BlazeExpressionParser.RULE_parseExpressionOrPredicate; } + // @Override + public enterRule(listener: BlazeExpressionParserListener): void { + if (listener.enterParseExpressionOrPredicate) { + listener.enterParseExpressionOrPredicate(this); + } + } + // @Override + public exitRule(listener: BlazeExpressionParserListener): void { + if (listener.exitParseExpressionOrPredicate) { + listener.exitParseExpressionOrPredicate(this); + } + } + // @Override + public accept(visitor: BlazeExpressionParserVisitor): Result { + if (visitor.visitParseExpressionOrPredicate) { + return visitor.visitParseExpressionOrPredicate(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class ParseTemplateContext extends ParserRuleContext { + public EOF(): TerminalNode { return this.getToken(BlazeExpressionParser.EOF, 0); } + public template(): TemplateContext | undefined { + return this.tryGetRuleContext(0, TemplateContext); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return BlazeExpressionParser.RULE_parseTemplate; } + // @Override + public enterRule(listener: BlazeExpressionParserListener): void { + if (listener.enterParseTemplate) { + listener.enterParseTemplate(this); + } + } + // @Override + public exitRule(listener: BlazeExpressionParserListener): void { + if (listener.exitParseTemplate) { + listener.exitParseTemplate(this); + } + } + // @Override + public accept(visitor: BlazeExpressionParserVisitor): Result { + if (visitor.visitParseTemplate) { + return visitor.visitParseTemplate(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class ParseQueryContext extends ParserRuleContext { + public query(): QueryContext { + return this.getRuleContext(0, QueryContext); + } + public EOF(): TerminalNode { return this.getToken(BlazeExpressionParser.EOF, 0); } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return BlazeExpressionParser.RULE_parseQuery; } + // @Override + public enterRule(listener: BlazeExpressionParserListener): void { + if (listener.enterParseQuery) { + listener.enterParseQuery(this); + } + } + // @Override + public exitRule(listener: BlazeExpressionParserListener): void { + if (listener.exitParseQuery) { + listener.exitParseQuery(this); + } + } + // @Override + public accept(visitor: BlazeExpressionParserVisitor): Result { + if (visitor.visitParseQuery) { + return visitor.visitParseQuery(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class TemplateContext extends ParserRuleContext { + public TEXT(): TerminalNode[]; + public TEXT(i: number): TerminalNode; + public TEXT(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(BlazeExpressionParser.TEXT); + } else { + return this.getToken(BlazeExpressionParser.TEXT, i); + } + } + public EXPRESSION_START(): TerminalNode[]; + public EXPRESSION_START(i: number): TerminalNode; + public EXPRESSION_START(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(BlazeExpressionParser.EXPRESSION_START); + } else { + return this.getToken(BlazeExpressionParser.EXPRESSION_START, i); + } } - - public static readonly _serializedATN: string = - "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x038\u01A3\x04\x02" + - "\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06\x04\x07" + - "\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x04\f\t\f\x04\r\t\r\x04" + - "\x0E\t\x0E\x04\x0F\t\x0F\x04\x10\t\x10\x04\x11\t\x11\x04\x12\t\x12\x04" + - "\x13\t\x13\x04\x14\t\x14\x04\x15\t\x15\x04\x16\t\x16\x04\x17\t\x17\x04" + - "\x18\t\x18\x03\x02\x03\x02\x03\x02\x03\x03\x03\x03\x03\x03\x03\x04\x03" + - "\x04\x03\x04\x03\x05\x05\x05;\n\x05\x03\x05\x03\x05\x03\x06\x03\x06\x03" + - "\x06\x03\x06\x03\x06\x06\x06D\n\x06\r\x06\x0E\x06E\x03\x07\x03\x07\x03" + - "\x07\x03\x07\x03\x07\x03\x07\x03\x07\x03\x07\x03\x07\x03\x07\x03\x07\x03" + - "\x07\x05\x07T\n\x07\x03\x07\x03\x07\x03\x07\x03\x07\x03\x07\x03\x07\x07" + - "\x07\\\n\x07\f\x07\x0E\x07_\v\x07\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b" + - "\x03\b\x03\b\x03\b\x03\b\x05\bk\n\b\x03\b\x03\b\x03\b\x03\b\x03\b\x05" + - "\br\n\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03" + - "\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03" + - "\b\x03\b\x03\b\x03\b\x03\b\x03\b\x05\b\x90\n\b\x03\b\x03\b\x03\b\x03\b" + - "\x03\b\x05\b\x97\n\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x05\b\xA0" + - "\n\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x07\b\xA8\n\b\f\b\x0E\b\xAB\v" + - "\b\x03\t\x03\t\x05\t\xAF\n\t\x03\n\x03\n\x03\n\x03\n\x07\n\xB5\n\n\f\n" + - "\x0E\n\xB8\v\n\x03\n\x03\n\x03\n\x05\n\xBD\n\n\x03\v\x03\v\x05\v\xC1\n" + - "\v\x03\v\x03\v\x03\v\x05\v\xC6\n\v\x03\f\x03\f\x06\f\xCA\n\f\r\f\x0E\f" + - "\xCB\x03\r\x03\r\x03\r\x03\r\x03\r\x03\r\x03\r\x03\r\x03\r\x03\r\x03\r" + - "\x05\r\xD9\n\r\x03\x0E\x03\x0E\x07\x0E\xDD\n\x0E\f\x0E\x0E\x0E\xE0\v\x0E" + - "\x03\x0E\x03\x0E\x03\x0E\x07\x0E\xE5\n\x0E\f\x0E\x0E\x0E\xE8\v\x0E\x03" + - "\x0E\x05\x0E\xEB\n\x0E\x03\x0F\x03\x0F\x03\x0F\x03\x0F\x07\x0F\xF1\n\x0F" + - "\f\x0F\x0E\x0F\xF4\v\x0F\x05\x0F\xF6\n\x0F\x03\x0F\x03\x0F\x03\x10\x03" + - "\x10\x03\x10\x03\x10\x03\x10\x03\x10\x03\x10\x07\x10\u0101\n\x10\f\x10" + - "\x0E\x10\u0104\v\x10\x03\x10\x03\x10\x03\x10\x03\x10\x03\x10\x03\x11\x03" + - "\x11\x03\x11\x03\x11\x03\x11\x03\x11\x03\x11\x07\x11\u0112\n\x11\f\x11" + - "\x0E\x11\u0115\v\x11\x03\x11\x03\x11\x03\x11\x03\x11\x05\x11\u011B\n\x11" + - "\x03\x11\x03\x11\x03\x11\x03\x11\x03\x11\x03\x11\x03\x11\x07\x11\u0124" + - "\n\x11\f\x11\x0E\x11\u0127\v\x11\x03\x11\x05\x11\u012A\n\x11\x03\x11\x03" + - "\x11\x05\x11\u012E\n\x11\x03\x12\x03\x12\x03\x12\x03\x12\x03\x12\x03\x13" + - "\x03\x13\x03\x13\x03\x13\x03\x13\x05\x13\u013A\n\x13\x03\x13\x03\x13\x03" + - "\x14\x03\x14\x03\x14\x03\x14\x03\x14\x03\x14\x05\x14\u0144\n\x14\x05\x14" + - "\u0146\n\x14\x03\x14\x03\x14\x03\x15\x03\x15\x03\x15\x03\x15\x03\x15\x03" + - "\x15\x03\x16\x03\x16\x03\x16\x03\x16\x03\x16\x03\x16\x03\x17\x03\x17\x03" + - "\x17\x03\x17\x03\x17\x05\x17\u015B\n\x17\x03\x17\x03\x17\x05\x17\u015F" + - "\n\x17\x03\x17\x03\x17\x05\x17\u0163\n\x17\x03\x17\x03\x17\x05\x17\u0167" + - "\n\x17\x03\x17\x03\x17\x05\x17\u016B\n\x17\x03\x17\x03\x17\x03\x17\x03" + - "\x17\x05\x17\u0171\n\x17\x03\x17\x03\x17\x05\x17\u0175\n\x17\x03\x17\x03" + - "\x17\x05\x17\u0179\n\x17\x03\x17\x03\x17\x05\x17\u017D\n\x17\x03\x17\x03" + - "\x17\x03\x17\x03\x17\x05\x17\u0183\n\x17\x03\x17\x03\x17\x05\x17\u0187" + - "\n\x17\x03\x17\x03\x17\x05\x17\u018B\n\x17\x03\x17\x03\x17\x03\x17\x03" + - "\x17\x05\x17\u0191\n\x17\x03\x17\x03\x17\x05\x17\u0195\n\x17\x03\x17\x03" + - "\x17\x03\x17\x03\x17\x05\x17\u019B\n\x17\x03\x17\x03\x17\x05\x17\u019F" + - "\n\x17\x03\x18\x03\x18\x03\x18\x02\x02\x04\f\x0E\x19\x02\x02\x04\x02\x06" + - "\x02\b\x02\n\x02\f\x02\x0E\x02\x10\x02\x12\x02\x14\x02\x16\x02\x18\x02" + - "\x1A\x02\x1C\x02\x1E\x02 \x02\"\x02$\x02&\x02(\x02*\x02,\x02.\x02\x02" + - "\x07\x03\x02%\'\x03\x02#$\x04\x02\x15\x15//\x04\x02\x06\x06\b\b\b\x02" + - "\t\f\x0F\x10\x12\x15\x17\x1A\x1C\x1C01\x02\u01DA\x020\x03\x02\x02\x02" + - "\x043\x03\x02\x02\x02\x066\x03\x02\x02\x02\b:\x03\x02\x02\x02\nC\x03\x02" + - "\x02\x02\fS\x03\x02\x02\x02\x0E\x9F\x03\x02\x02\x02\x10\xAE\x03\x02\x02" + - "\x02\x12\xBC\x03\x02\x02\x02\x14\xC5\x03\x02\x02\x02\x16\xC9\x03\x02\x02" + - "\x02\x18\xD8\x03\x02\x02\x02\x1A\xEA\x03\x02\x02\x02\x1C\xEC\x03\x02\x02" + - "\x02\x1E\xF9\x03\x02\x02\x02 \u012D\x03\x02\x02\x02\"\u012F\x03\x02\x02" + - "\x02$\u0134\x03\x02\x02\x02&\u013D\x03\x02\x02\x02(\u0149\x03\x02\x02" + - "\x02*\u014F\x03\x02\x02\x02,\u0155\x03\x02\x02\x02.\u01A0\x03\x02\x02" + - "\x0201\x05\x0E\b\x0212\x07\x02\x02\x032\x03\x03\x02\x02\x0234\x05\f\x07" + - "\x0245\x07\x02\x02\x035\x05\x03\x02\x02\x0267\x05\x10\t\x0278\x07\x02" + - "\x02\x038\x07\x03\x02\x02\x029;\x05\n\x06\x02:9\x03\x02\x02\x02:;\x03" + - "\x02\x02\x02;<\x03\x02\x02\x02<=\x07\x02\x02\x03=\t\x03\x02\x02\x02>D" + - "\x074\x02\x02?@\x073\x02\x02@A\x05\f\x07\x02AB\x072\x02\x02BD\x03\x02" + - "\x02\x02C>\x03\x02\x02\x02C?\x03\x02\x02\x02DE\x03\x02\x02\x02EC\x03\x02" + - "\x02\x02EF\x03\x02\x02\x02F\v\x03\x02\x02\x02GH\b\x07\x01\x02HI\x07(\x02" + - "\x02IJ\x05\f\x07\x02JK\x07)\x02\x02KT\x03\x02\x02\x02LT\x05\x18\r\x02" + - "MT\x05\x14\v\x02NT\x05 \x11\x02OP\x07$\x02\x02PT\x05\f\x07\x06QR\x07#" + - "\x02\x02RT\x05\f\x07\x05SG\x03\x02\x02\x02SL\x03\x02\x02\x02SM\x03\x02" + - "\x02\x02SN\x03\x02\x02\x02SO\x03\x02\x02\x02SQ\x03\x02\x02\x02T]\x03\x02" + - "\x02\x02UV\f\x04\x02\x02VW\t\x02\x02\x02W\\\x05\f\x07\x05XY\f\x03\x02" + - "\x02YZ\t\x03\x02\x02Z\\\x05\f\x07\x04[U\x03\x02\x02\x02[X\x03\x02\x02" + - "\x02\\_\x03\x02\x02\x02][\x03\x02\x02\x02]^\x03\x02\x02\x02^\r\x03\x02" + - "\x02\x02_]\x03\x02\x02\x02`a\b\b\x01\x02ab\x07(\x02\x02bc\x05\x0E\b\x02" + - "cd\x07)\x02\x02d\xA0\x03\x02\x02\x02ef\t\x04\x02\x02f\xA0\x05\x0E\b\x11" + - "gh\x05\f\x07\x02hj\x07\x12\x02\x02ik\x07\x15\x02\x02ji\x03\x02\x02\x02" + - "jk\x03\x02\x02\x02kl\x03\x02\x02\x02lm\x07\x16\x02\x02m\xA0\x03\x02\x02" + - "\x02no\x05\f\x07\x02oq\x07\x12\x02\x02pr\x07\x15\x02\x02qp\x03\x02\x02" + - "\x02qr\x03\x02\x02\x02rs\x03\x02\x02\x02st\x07\r\x02\x02t\xA0\x03\x02" + - "\x02\x02uv\x05\f\x07\x02vw\x07!\x02\x02wx\x05\f\x07\x02x\xA0\x03\x02\x02" + - "\x02yz\x05\f\x07\x02z{\x07\"\x02\x02{|\x05\f\x07\x02|\xA0\x03\x02\x02" + - "\x02}~\x05\f\x07\x02~\x7F\x07\x1F\x02\x02\x7F\x80\x05\f\x07\x02\x80\xA0" + - "\x03\x02\x02\x02\x81\x82\x05\f\x07\x02\x82\x83\x07 \x02\x02\x83\x84\x05" + - "\f\x07\x02\x84\xA0\x03\x02\x02\x02\x85\x86\x05\f\x07\x02\x86\x87\x07\x1D" + - "\x02\x02\x87\x88\x05\f\x07\x02\x88\xA0\x03\x02\x02\x02\x89\x8A\x05\f\x07" + - "\x02\x8A\x8B\x07\x1E\x02\x02\x8B\x8C\x05\f\x07\x02\x8C\xA0\x03\x02\x02" + - "\x02\x8D\x8F\x05\f\x07\x02\x8E\x90\x07\x15\x02\x02\x8F\x8E\x03\x02\x02" + - "\x02\x8F\x90\x03\x02\x02\x02\x90\x91\x03\x02\x02\x02\x91\x92\x07\x10\x02" + - "\x02\x92\x93\x05\x12\n\x02\x93\xA0\x03\x02\x02\x02\x94\x96\x05\f\x07\x02" + - "\x95\x97\x07\x15\x02\x02\x96\x95\x03\x02\x02\x02\x96\x97\x03\x02\x02\x02" + - "\x97\x98\x03\x02\x02\x02\x98\x99\x07\n\x02\x02\x99\x9A\x05\f\x07\x02\x9A" + - "\x9B\x07\t\x02\x02\x9B\x9C\x05\f\x07\x02\x9C\xA0\x03\x02\x02\x02\x9D\xA0" + - "\x05 \x11\x02\x9E\xA0\x05\x14\v\x02\x9F`\x03\x02\x02\x02\x9Fe\x03\x02" + - "\x02\x02\x9Fg\x03\x02\x02\x02\x9Fn\x03\x02\x02\x02\x9Fu\x03\x02\x02\x02" + - "\x9Fy\x03\x02\x02\x02\x9F}\x03\x02\x02\x02\x9F\x81\x03\x02\x02\x02\x9F" + - "\x85\x03\x02\x02\x02\x9F\x89\x03\x02\x02\x02\x9F\x8D\x03\x02\x02\x02\x9F" + - "\x94\x03\x02\x02\x02\x9F\x9D\x03\x02\x02\x02\x9F\x9E\x03\x02\x02\x02\xA0" + - "\xA9\x03\x02\x02\x02\xA1\xA2\f\x10\x02\x02\xA2\xA3\x07\t\x02\x02\xA3\xA8" + - "\x05\x0E\b\x11\xA4\xA5\f\x0F\x02\x02\xA5\xA6\x07\x17\x02\x02\xA6\xA8\x05" + - "\x0E\b\x10\xA7\xA1\x03\x02\x02\x02\xA7\xA4\x03\x02\x02\x02\xA8\xAB\x03" + - "\x02\x02\x02\xA9\xA7\x03\x02\x02\x02\xA9\xAA\x03\x02\x02\x02\xAA\x0F\x03" + - "\x02\x02\x02\xAB\xA9\x03\x02\x02\x02\xAC\xAF\x05\f\x07\x02\xAD\xAF\x05" + - "\x0E\b\x02\xAE\xAC\x03\x02\x02\x02\xAE\xAD\x03\x02\x02\x02\xAF\x11\x03" + - "\x02\x02\x02\xB0\xB1\x07(\x02\x02\xB1\xB6\x05\f\x07\x02\xB2\xB3\x07,\x02" + - "\x02\xB3\xB5\x05\f\x07\x02\xB4\xB2\x03\x02\x02\x02\xB5\xB8\x03\x02\x02" + - "\x02\xB6\xB4\x03\x02\x02\x02\xB6\xB7\x03\x02\x02\x02\xB7\xB9\x03\x02\x02" + - "\x02\xB8\xB6\x03\x02\x02\x02\xB9\xBA\x07)\x02\x02\xBA\xBD\x03\x02\x02" + - "\x02\xBB\xBD\x05\f\x07\x02\xBC\xB0\x03\x02\x02\x02\xBC\xBB\x03\x02\x02" + - "\x02\xBD\x13\x03\x02\x02\x02\xBE\xC0\x05.\x18\x02\xBF\xC1\x05\x16\f\x02" + - "\xC0\xBF\x03\x02\x02\x02\xC0\xC1\x03\x02\x02\x02\xC1\xC6\x03\x02\x02\x02" + - "\xC2\xC3\x05 \x11\x02\xC3\xC4\x05\x16\f\x02\xC4\xC6\x03\x02\x02\x02\xC5" + - "\xBE\x03\x02\x02\x02\xC5\xC2\x03\x02\x02\x02\xC6\x15\x03\x02\x02\x02\xC7" + - "\xC8\x07-\x02\x02\xC8\xCA\x05.\x18\x02\xC9\xC7\x03\x02\x02\x02\xCA\xCB" + - "\x03\x02\x02\x02\xCB\xC9\x03\x02\x02\x02\xCB\xCC\x03\x02\x02\x02\xCC\x17" + - "\x03\x02\x02\x02\xCD\xD9\x07\x07\x02\x02\xCE\xD9\x07\x06\x02\x02\xCF\xD9" + - "\x05\x1A\x0E\x02\xD0\xD9\x07\x1B\x02\x02\xD1\xD9\x07\x0E\x02\x02\xD2\xD9" + - "\x05\"\x12\x02\xD3\xD9\x05$\x13\x02\xD4\xD9\x05&\x14\x02\xD5\xD9\x05," + - "\x17\x02\xD6\xD9\x05\x1C\x0F\x02\xD7\xD9\x05\x1E\x10\x02\xD8\xCD\x03\x02" + - "\x02\x02\xD8\xCE\x03\x02\x02\x02\xD8\xCF\x03\x02\x02\x02\xD8\xD0\x03\x02" + - "\x02\x02\xD8\xD1\x03\x02\x02\x02\xD8\xD2\x03\x02\x02\x02\xD8\xD3\x03\x02" + - "\x02\x02\xD8\xD4\x03\x02\x02\x02\xD8\xD5\x03\x02\x02\x02\xD8\xD6\x03\x02" + - "\x02\x02\xD8\xD7\x03\x02\x02\x02\xD9\x19\x03\x02\x02\x02\xDA\xDE\x07\x04" + - "\x02\x02\xDB\xDD\x075\x02\x02\xDC\xDB\x03\x02\x02\x02\xDD\xE0\x03\x02" + - "\x02\x02\xDE\xDC\x03\x02\x02\x02\xDE\xDF\x03\x02\x02\x02\xDF\xE1\x03\x02" + - "\x02\x02\xE0\xDE\x03\x02\x02\x02\xE1\xEB\x076\x02\x02\xE2\xE6\x07\x05" + - "\x02\x02\xE3\xE5\x077\x02\x02\xE4\xE3\x03\x02\x02\x02\xE5\xE8\x03\x02" + - "\x02\x02\xE6\xE4\x03\x02\x02\x02\xE6\xE7\x03\x02\x02\x02\xE7\xE9\x03\x02" + - "\x02\x02\xE8\xE6\x03\x02\x02\x02\xE9\xEB\x078\x02\x02\xEA\xDA\x03\x02" + - "\x02\x02\xEA\xE2\x03\x02\x02\x02\xEB\x1B\x03\x02\x02\x02\xEC\xF5\x07*" + - "\x02\x02\xED\xF2\x05\x18\r\x02\xEE\xEF\x07,\x02\x02\xEF\xF1\x05\x18\r" + - "\x02\xF0\xEE\x03\x02\x02\x02\xF1\xF4\x03\x02\x02\x02\xF2\xF0\x03\x02\x02" + - "\x02\xF2\xF3\x03\x02\x02\x02\xF3\xF6\x03\x02\x02\x02\xF4\xF2\x03\x02\x02" + - "\x02\xF5\xED\x03\x02\x02\x02\xF5\xF6\x03\x02\x02\x02\xF6\xF7\x03\x02\x02" + - "\x02\xF7\xF8\x07+\x02\x02\xF8\x1D\x03\x02\x02\x02\xF9\xFA\x05.\x18\x02" + - "\xFA\u0102\x07(\x02\x02\xFB\xFC\x05.\x18\x02\xFC\xFD\x07!\x02\x02\xFD" + - "\xFE\x05\x10\t\x02\xFE\xFF\x07,\x02\x02\xFF\u0101\x03\x02\x02\x02\u0100" + - "\xFB\x03\x02\x02\x02\u0101\u0104\x03\x02\x02\x02\u0102\u0100\x03\x02\x02" + - "\x02\u0102\u0103\x03\x02\x02\x02\u0103\u0105\x03\x02\x02\x02\u0104\u0102" + - "\x03\x02\x02\x02\u0105\u0106\x05.\x18\x02\u0106\u0107\x07!\x02\x02\u0107" + - "\u0108\x05\x10\t\x02\u0108\u0109\x07)\x02\x02\u0109\x1F\x03\x02\x02\x02" + - "\u010A\u010B\x05.\x18\x02\u010B\u011A\x07(\x02\x02\u010C\u010D\x05.\x18" + - "\x02\u010D\u010E\x07!\x02\x02\u010E\u010F\x05\x10\t\x02\u010F\u0110\x07" + - ",\x02\x02\u0110\u0112\x03\x02\x02\x02\u0111\u010C\x03\x02\x02\x02\u0112" + - "\u0115\x03\x02\x02\x02\u0113\u0111\x03\x02\x02\x02\u0113\u0114\x03\x02" + - "\x02\x02\u0114\u0116\x03\x02\x02\x02\u0115\u0113\x03\x02\x02\x02\u0116" + - "\u0117\x05.\x18\x02\u0117\u0118\x07!\x02\x02\u0118\u0119\x05\x10\t\x02" + - "\u0119\u011B\x03\x02\x02\x02\u011A\u0113\x03\x02\x02\x02\u011A\u011B\x03" + - "\x02\x02\x02\u011B\u011C\x03\x02\x02\x02\u011C\u011D\x07)\x02\x02\u011D" + - "\u012E\x03\x02\x02\x02\u011E\u011F\x05.\x18\x02\u011F\u0129\x07(\x02\x02" + - "\u0120\u0121\x05\x10\t\x02\u0121\u0122\x07,\x02\x02\u0122\u0124\x03\x02" + - "\x02\x02\u0123\u0120\x03\x02\x02\x02\u0124\u0127\x03\x02\x02\x02\u0125" + - "\u0123\x03\x02\x02\x02\u0125\u0126\x03\x02\x02\x02\u0126\u0128\x03\x02" + - "\x02\x02\u0127\u0125\x03\x02\x02\x02\u0128\u012A\x05\x10\t\x02\u0129\u0125" + - "\x03\x02\x02\x02\u0129\u012A\x03\x02\x02\x02\u012A\u012B\x03\x02\x02\x02" + - "\u012B\u012C\x07)\x02\x02\u012C\u012E\x03\x02\x02\x02\u012D\u010A\x03" + - "\x02\x02\x02\u012D\u011E\x03\x02\x02\x02\u012E!\x03\x02\x02\x02\u012F" + - "\u0130\x07\v\x02\x02\u0130\u0131\x07(\x02\x02\u0131\u0132\x05(\x15\x02" + - "\u0132\u0133\x07)\x02\x02\u0133#\x03\x02\x02\x02\u0134\u0135\x07\x19\x02" + - "\x02\u0135\u0136\x07(\x02\x02\u0136\u0139\x05*\x16\x02\u0137\u0138\x07" + - "-\x02\x02\u0138\u013A\t\x05\x02\x02\u0139\u0137\x03\x02\x02\x02\u0139" + - "\u013A\x03\x02\x02\x02\u013A\u013B\x03\x02\x02\x02\u013B\u013C\x07)\x02" + - "\x02\u013C%\x03\x02\x02\x02\u013D\u013E\x07\x1A\x02\x02\u013E\u013F\x07" + - "(\x02\x02\u013F\u0145\x05(\x15\x02\u0140\u0143\x05*\x16\x02\u0141\u0142" + - "\x07-\x02\x02\u0142\u0144\t\x05\x02\x02\u0143\u0141\x03\x02\x02\x02\u0143" + - "\u0144\x03\x02\x02\x02\u0144\u0146\x03\x02\x02\x02\u0145\u0140\x03\x02" + - "\x02\x02\u0145\u0146\x03\x02\x02\x02\u0146\u0147\x03\x02\x02\x02\u0147" + - "\u0148\x07)\x02\x02\u0148\'\x03\x02\x02\x02\u0149\u014A\x07\x06\x02\x02" + - "\u014A\u014B\x07$\x02\x02\u014B\u014C\t\x05\x02\x02\u014C\u014D\x07$\x02" + - "\x02\u014D\u014E\t\x05\x02\x02\u014E)\x03\x02\x02\x02\u014F\u0150\t\x05" + - "\x02\x02\u0150\u0151\x07.\x02\x02\u0151\u0152\t\x05\x02\x02\u0152\u0153" + - "\x07.\x02\x02\u0153\u0154\t\x05\x02\x02\u0154+\x03\x02\x02\x02\u0155\u019E" + - "\x07\x11\x02\x02\u0156\u0157\x07\x06\x02\x02\u0157\u015A\x07\x1C\x02\x02" + - "\u0158\u0159\x07\x06\x02\x02\u0159\u015B\x07\x14\x02\x02\u015A\u0158\x03" + - "\x02\x02\x02\u015A\u015B\x03\x02\x02\x02\u015B\u015E\x03\x02\x02\x02\u015C" + - "\u015D\x07\x06\x02\x02\u015D\u015F\x07\f\x02\x02\u015E\u015C\x03\x02\x02" + - "\x02\u015E\u015F\x03\x02\x02\x02\u015F\u0162\x03\x02\x02\x02\u0160\u0161" + - "\x07\x06\x02\x02\u0161\u0163\x07\x0F\x02\x02\u0162\u0160\x03\x02\x02\x02" + - "\u0162\u0163\x03\x02\x02\x02\u0163\u0166\x03\x02\x02\x02\u0164\u0165\x07" + - "\x06\x02\x02\u0165\u0167\x07\x13\x02\x02\u0166\u0164\x03\x02\x02\x02\u0166" + - "\u0167\x03\x02\x02\x02\u0167\u016A\x03\x02\x02\x02\u0168\u0169\x07\x06" + - "\x02\x02\u0169\u016B\x07\x18\x02\x02\u016A\u0168\x03\x02\x02\x02\u016A" + - "\u016B\x03\x02\x02\x02\u016B\u019F\x03\x02\x02\x02\u016C\u016D\x07\x06" + - "\x02\x02\u016D\u0170\x07\x14\x02\x02\u016E\u016F\x07\x06\x02\x02\u016F" + - "\u0171\x07\f\x02\x02\u0170\u016E\x03\x02\x02\x02\u0170\u0171\x03\x02\x02" + - "\x02\u0171\u0174\x03\x02\x02\x02\u0172\u0173\x07\x06\x02\x02\u0173\u0175" + - "\x07\x0F\x02\x02\u0174\u0172\x03\x02\x02\x02\u0174\u0175\x03\x02\x02\x02" + - "\u0175\u0178\x03\x02\x02\x02\u0176\u0177\x07\x06\x02\x02\u0177\u0179\x07" + - "\x13\x02\x02\u0178\u0176\x03\x02\x02\x02\u0178\u0179\x03\x02\x02\x02\u0179" + - "\u017C\x03\x02\x02\x02\u017A\u017B\x07\x06\x02\x02\u017B\u017D\x07\x18" + - "\x02\x02\u017C\u017A\x03\x02\x02\x02\u017C\u017D\x03\x02\x02\x02\u017D" + - "\u019F\x03\x02\x02\x02\u017E\u017F\x07\x06\x02\x02\u017F\u0182\x07\f\x02" + - "\x02\u0180\u0181\x07\x06\x02\x02\u0181\u0183\x07\x0F\x02\x02\u0182\u0180" + - "\x03\x02\x02\x02\u0182\u0183\x03\x02\x02\x02\u0183\u0186\x03\x02\x02\x02" + - "\u0184\u0185\x07\x06\x02\x02\u0185\u0187\x07\x13\x02\x02\u0186\u0184\x03" + - "\x02\x02\x02\u0186\u0187\x03\x02\x02\x02\u0187\u018A\x03\x02\x02\x02\u0188" + - "\u0189\x07\x06\x02\x02\u0189\u018B\x07\x18\x02\x02\u018A\u0188\x03\x02" + - "\x02\x02\u018A\u018B\x03\x02\x02\x02\u018B\u019F\x03\x02\x02\x02\u018C" + - "\u018D\x07\x06\x02\x02\u018D\u0190\x07\x0F\x02\x02\u018E\u018F\x07\x06" + - "\x02\x02\u018F\u0191\x07\x13\x02\x02\u0190\u018E\x03\x02\x02\x02\u0190" + - "\u0191\x03\x02\x02\x02\u0191\u0194\x03\x02\x02\x02\u0192\u0193\x07\x06" + - "\x02\x02\u0193\u0195\x07\x18\x02\x02\u0194\u0192\x03\x02\x02\x02\u0194" + - "\u0195\x03\x02\x02\x02\u0195\u019F\x03\x02\x02\x02\u0196\u0197\x07\x06" + - "\x02\x02\u0197\u019A\x07\x13\x02\x02\u0198\u0199\x07\x06\x02\x02\u0199" + - "\u019B\x07\x18\x02\x02\u019A\u0198\x03\x02\x02\x02\u019A\u019B\x03\x02" + - "\x02\x02\u019B\u019F\x03\x02\x02\x02\u019C\u019D\x07\x06\x02\x02\u019D" + - "\u019F\x07\x18\x02\x02\u019E\u0156\x03\x02\x02\x02\u019E\u016C\x03\x02" + - "\x02\x02\u019E\u017E\x03\x02\x02\x02\u019E\u018C\x03\x02\x02\x02\u019E" + - "\u0196\x03\x02\x02\x02\u019E\u019C\x03\x02\x02\x02\u019F-\x03\x02\x02" + - "\x02\u01A0\u01A1\t\x06\x02\x02\u01A1/\x03\x02\x02\x024:CES[]jq\x8F\x96" + - "\x9F\xA7\xA9\xAE\xB6\xBC\xC0\xC5\xCB\xD8\xDE\xE6\xEA\xF2\xF5\u0102\u0113" + - "\u011A\u0125\u0129\u012D\u0139\u0143\u0145\u015A\u015E\u0162\u0166\u016A" + - "\u0170\u0174\u0178\u017C\u0182\u0186\u018A\u0190\u0194\u019A\u019E"; - public static __ATN: ATN; - public static get _ATN(): ATN { - if (!BlazeExpressionParser.__ATN) { - BlazeExpressionParser.__ATN = new ATNDeserializer().deserialize(Utils.toCharArray(BlazeExpressionParser._serializedATN)); + public expression(): ExpressionContext[]; + public expression(i: number): ExpressionContext; + public expression(i?: number): ExpressionContext | ExpressionContext[] { + if (i === undefined) { + return this.getRuleContexts(ExpressionContext); + } else { + return this.getRuleContext(i, ExpressionContext); } - - return BlazeExpressionParser.__ATN; } - -} - -export class ParsePredicateContext extends ParserRuleContext { - public predicate(): PredicateContext { - return this.getRuleContext(0, PredicateContext); + public EXPRESSION_END(): TerminalNode[]; + public EXPRESSION_END(i: number): TerminalNode; + public EXPRESSION_END(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(BlazeExpressionParser.EXPRESSION_END); + } else { + return this.getToken(BlazeExpressionParser.EXPRESSION_END, i); + } } - public EOF(): TerminalNode { return this.getToken(BlazeExpressionParser.EOF, 0); } constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return BlazeExpressionParser.RULE_parsePredicate; } + public get ruleIndex(): number { return BlazeExpressionParser.RULE_template; } // @Override public enterRule(listener: BlazeExpressionParserListener): void { - if (listener.enterParsePredicate) { - listener.enterParsePredicate(this); + if (listener.enterTemplate) { + listener.enterTemplate(this); } } // @Override public exitRule(listener: BlazeExpressionParserListener): void { - if (listener.exitParsePredicate) { - listener.exitParsePredicate(this); + if (listener.exitTemplate) { + listener.exitTemplate(this); } } // @Override public accept(visitor: BlazeExpressionParserVisitor): Result { - if (visitor.visitParsePredicate) { - return visitor.visitParsePredicate(this); + if (visitor.visitTemplate) { + return visitor.visitTemplate(this); } else { return visitor.visitChildren(this); } @@ -2320,124 +2989,239 @@ export class ParsePredicateContext extends ParserRuleContext { } -export class ParseExpressionContext extends ParserRuleContext { +export class ExpressionContext extends ParserRuleContext { + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return BlazeExpressionParser.RULE_expression; } + public copyFrom(ctx: ExpressionContext): void { + super.copyFrom(ctx); + } +} +export class GroupedExpressionContext extends ExpressionContext { + public LP(): TerminalNode { return this.getToken(BlazeExpressionParser.LP, 0); } public expression(): ExpressionContext { return this.getRuleContext(0, ExpressionContext); } - public EOF(): TerminalNode { return this.getToken(BlazeExpressionParser.EOF, 0); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); + public RP(): TerminalNode { return this.getToken(BlazeExpressionParser.RP, 0); } + constructor(ctx: ExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); } // @Override - public get ruleIndex(): number { return BlazeExpressionParser.RULE_parseExpression; } + public enterRule(listener: BlazeExpressionParserListener): void { + if (listener.enterGroupedExpression) { + listener.enterGroupedExpression(this); + } + } + // @Override + public exitRule(listener: BlazeExpressionParserListener): void { + if (listener.exitGroupedExpression) { + listener.exitGroupedExpression(this); + } + } + // @Override + public accept(visitor: BlazeExpressionParserVisitor): Result { + if (visitor.visitGroupedExpression) { + return visitor.visitGroupedExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class LiteralExpressionContext extends ExpressionContext { + public literal(): LiteralContext { + return this.getRuleContext(0, LiteralContext); + } + constructor(ctx: ExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } // @Override public enterRule(listener: BlazeExpressionParserListener): void { - if (listener.enterParseExpression) { - listener.enterParseExpression(this); + if (listener.enterLiteralExpression) { + listener.enterLiteralExpression(this); } } // @Override public exitRule(listener: BlazeExpressionParserListener): void { - if (listener.exitParseExpression) { - listener.exitParseExpression(this); + if (listener.exitLiteralExpression) { + listener.exitLiteralExpression(this); } } // @Override public accept(visitor: BlazeExpressionParserVisitor): Result { - if (visitor.visitParseExpression) { - return visitor.visitParseExpression(this); + if (visitor.visitLiteralExpression) { + return visitor.visitLiteralExpression(this); } else { return visitor.visitChildren(this); } } } - - -export class ParseExpressionOrPredicateContext extends ParserRuleContext { - public predicateOrExpression(): PredicateOrExpressionContext { - return this.getRuleContext(0, PredicateOrExpressionContext); +export class PathExpressionContext extends ExpressionContext { + public path(): PathContext { + return this.getRuleContext(0, PathContext); } - public EOF(): TerminalNode { return this.getToken(BlazeExpressionParser.EOF, 0); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); + constructor(ctx: ExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); } // @Override - public get ruleIndex(): number { return BlazeExpressionParser.RULE_parseExpressionOrPredicate; } + public enterRule(listener: BlazeExpressionParserListener): void { + if (listener.enterPathExpression) { + listener.enterPathExpression(this); + } + } + // @Override + public exitRule(listener: BlazeExpressionParserListener): void { + if (listener.exitPathExpression) { + listener.exitPathExpression(this); + } + } + // @Override + public accept(visitor: BlazeExpressionParserVisitor): Result { + if (visitor.visitPathExpression) { + return visitor.visitPathExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class FunctionExpressionContext extends ExpressionContext { + public functionInvocation(): FunctionInvocationContext { + return this.getRuleContext(0, FunctionInvocationContext); + } + constructor(ctx: ExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } // @Override public enterRule(listener: BlazeExpressionParserListener): void { - if (listener.enterParseExpressionOrPredicate) { - listener.enterParseExpressionOrPredicate(this); + if (listener.enterFunctionExpression) { + listener.enterFunctionExpression(this); } } // @Override public exitRule(listener: BlazeExpressionParserListener): void { - if (listener.exitParseExpressionOrPredicate) { - listener.exitParseExpressionOrPredicate(this); + if (listener.exitFunctionExpression) { + listener.exitFunctionExpression(this); } } // @Override public accept(visitor: BlazeExpressionParserVisitor): Result { - if (visitor.visitParseExpressionOrPredicate) { - return visitor.visitParseExpressionOrPredicate(this); + if (visitor.visitFunctionExpression) { + return visitor.visitFunctionExpression(this); } else { return visitor.visitChildren(this); } } } - - -export class ParseTemplateContext extends ParserRuleContext { - public EOF(): TerminalNode { return this.getToken(BlazeExpressionParser.EOF, 0); } - public template(): TemplateContext | undefined { - return this.tryGetRuleContext(0, TemplateContext); +export class UnaryMinusExpressionContext extends ExpressionContext { + public MINUS(): TerminalNode { return this.getToken(BlazeExpressionParser.MINUS, 0); } + public expression(): ExpressionContext { + return this.getRuleContext(0, ExpressionContext); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); + constructor(ctx: ExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); } // @Override - public get ruleIndex(): number { return BlazeExpressionParser.RULE_parseTemplate; } + public enterRule(listener: BlazeExpressionParserListener): void { + if (listener.enterUnaryMinusExpression) { + listener.enterUnaryMinusExpression(this); + } + } + // @Override + public exitRule(listener: BlazeExpressionParserListener): void { + if (listener.exitUnaryMinusExpression) { + listener.exitUnaryMinusExpression(this); + } + } + // @Override + public accept(visitor: BlazeExpressionParserVisitor): Result { + if (visitor.visitUnaryMinusExpression) { + return visitor.visitUnaryMinusExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class UnaryPlusExpressionContext extends ExpressionContext { + public PLUS(): TerminalNode { return this.getToken(BlazeExpressionParser.PLUS, 0); } + public expression(): ExpressionContext { + return this.getRuleContext(0, ExpressionContext); + } + constructor(ctx: ExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } // @Override public enterRule(listener: BlazeExpressionParserListener): void { - if (listener.enterParseTemplate) { - listener.enterParseTemplate(this); + if (listener.enterUnaryPlusExpression) { + listener.enterUnaryPlusExpression(this); } } // @Override public exitRule(listener: BlazeExpressionParserListener): void { - if (listener.exitParseTemplate) { - listener.exitParseTemplate(this); + if (listener.exitUnaryPlusExpression) { + listener.exitUnaryPlusExpression(this); } } // @Override public accept(visitor: BlazeExpressionParserVisitor): Result { - if (visitor.visitParseTemplate) { - return visitor.visitParseTemplate(this); + if (visitor.visitUnaryPlusExpression) { + return visitor.visitUnaryPlusExpression(this); } else { return visitor.visitChildren(this); } } } - - -export class TemplateContext extends ParserRuleContext { - public TEXT(): TerminalNode[]; - public TEXT(i: number): TerminalNode; - public TEXT(i?: number): TerminalNode | TerminalNode[] { +export class MultiplicativeExpressionContext extends ExpressionContext { + public _lhs!: ExpressionContext; + public _op!: Token; + public _rhs!: ExpressionContext; + public expression(): ExpressionContext[]; + public expression(i: number): ExpressionContext; + public expression(i?: number): ExpressionContext | ExpressionContext[] { if (i === undefined) { - return this.getTokens(BlazeExpressionParser.TEXT); + return this.getRuleContexts(ExpressionContext); } else { - return this.getToken(BlazeExpressionParser.TEXT, i); + return this.getRuleContext(i, ExpressionContext); + } + } + public ASTERISK(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.ASTERISK, 0); } + public SLASH(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.SLASH, 0); } + public PERCENT(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.PERCENT, 0); } + constructor(ctx: ExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: BlazeExpressionParserListener): void { + if (listener.enterMultiplicativeExpression) { + listener.enterMultiplicativeExpression(this); } } - public EXPRESSION_START(): TerminalNode[]; - public EXPRESSION_START(i: number): TerminalNode; - public EXPRESSION_START(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(BlazeExpressionParser.EXPRESSION_START); + // @Override + public exitRule(listener: BlazeExpressionParserListener): void { + if (listener.exitMultiplicativeExpression) { + listener.exitMultiplicativeExpression(this); + } + } + // @Override + public accept(visitor: BlazeExpressionParserVisitor): Result { + if (visitor.visitMultiplicativeExpression) { + return visitor.visitMultiplicativeExpression(this); } else { - return this.getToken(BlazeExpressionParser.EXPRESSION_START, i); + return visitor.visitChildren(this); } } +} +export class AdditiveExpressionContext extends ExpressionContext { + public _lhs!: ExpressionContext; + public _op!: Token; + public _rhs!: ExpressionContext; public expression(): ExpressionContext[]; public expression(i: number): ExpressionContext; public expression(i?: number): ExpressionContext | ExpressionContext[] { @@ -2447,36 +3231,28 @@ export class TemplateContext extends ParserRuleContext { return this.getRuleContext(i, ExpressionContext); } } - public EXPRESSION_END(): TerminalNode[]; - public EXPRESSION_END(i: number): TerminalNode; - public EXPRESSION_END(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(BlazeExpressionParser.EXPRESSION_END); - } else { - return this.getToken(BlazeExpressionParser.EXPRESSION_END, i); - } - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); + public PLUS(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.PLUS, 0); } + public MINUS(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.MINUS, 0); } + constructor(ctx: ExpressionContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); } // @Override - public get ruleIndex(): number { return BlazeExpressionParser.RULE_template; } - // @Override public enterRule(listener: BlazeExpressionParserListener): void { - if (listener.enterTemplate) { - listener.enterTemplate(this); + if (listener.enterAdditiveExpression) { + listener.enterAdditiveExpression(this); } } // @Override public exitRule(listener: BlazeExpressionParserListener): void { - if (listener.exitTemplate) { - listener.exitTemplate(this); + if (listener.exitAdditiveExpression) { + listener.exitAdditiveExpression(this); } } // @Override public accept(visitor: BlazeExpressionParserVisitor): Result { - if (visitor.visitTemplate) { - return visitor.visitTemplate(this); + if (visitor.visitAdditiveExpression) { + return visitor.visitAdditiveExpression(this); } else { return visitor.visitChildren(this); } @@ -2484,198 +3260,294 @@ export class TemplateContext extends ParserRuleContext { } -export class ExpressionContext extends ParserRuleContext { +export class PredicateContext extends ParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return BlazeExpressionParser.RULE_expression; } - public copyFrom(ctx: ExpressionContext): void { + public get ruleIndex(): number { return BlazeExpressionParser.RULE_predicate; } + public copyFrom(ctx: PredicateContext): void { super.copyFrom(ctx); } } -export class GroupedExpressionContext extends ExpressionContext { +export class GroupedPredicateContext extends PredicateContext { public LP(): TerminalNode { return this.getToken(BlazeExpressionParser.LP, 0); } - public expression(): ExpressionContext { - return this.getRuleContext(0, ExpressionContext); + public predicate(): PredicateContext { + return this.getRuleContext(0, PredicateContext); } public RP(): TerminalNode { return this.getToken(BlazeExpressionParser.RP, 0); } - constructor(ctx: ExpressionContext) { + constructor(ctx: PredicateContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } // @Override public enterRule(listener: BlazeExpressionParserListener): void { - if (listener.enterGroupedExpression) { - listener.enterGroupedExpression(this); + if (listener.enterGroupedPredicate) { + listener.enterGroupedPredicate(this); } } // @Override public exitRule(listener: BlazeExpressionParserListener): void { - if (listener.exitGroupedExpression) { - listener.exitGroupedExpression(this); + if (listener.exitGroupedPredicate) { + listener.exitGroupedPredicate(this); } } // @Override public accept(visitor: BlazeExpressionParserVisitor): Result { - if (visitor.visitGroupedExpression) { - return visitor.visitGroupedExpression(this); + if (visitor.visitGroupedPredicate) { + return visitor.visitGroupedPredicate(this); } else { return visitor.visitChildren(this); } } } -export class LiteralExpressionContext extends ExpressionContext { - public literal(): LiteralContext { - return this.getRuleContext(0, LiteralContext); +export class NegatedPredicateContext extends PredicateContext { + public predicate(): PredicateContext { + return this.getRuleContext(0, PredicateContext); } - constructor(ctx: ExpressionContext) { + public NOT(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.NOT, 0); } + public EXCLAMATION_MARK(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.EXCLAMATION_MARK, 0); } + constructor(ctx: PredicateContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } // @Override public enterRule(listener: BlazeExpressionParserListener): void { - if (listener.enterLiteralExpression) { - listener.enterLiteralExpression(this); + if (listener.enterNegatedPredicate) { + listener.enterNegatedPredicate(this); } } // @Override public exitRule(listener: BlazeExpressionParserListener): void { - if (listener.exitLiteralExpression) { - listener.exitLiteralExpression(this); + if (listener.exitNegatedPredicate) { + listener.exitNegatedPredicate(this); } } // @Override public accept(visitor: BlazeExpressionParserVisitor): Result { - if (visitor.visitLiteralExpression) { - return visitor.visitLiteralExpression(this); + if (visitor.visitNegatedPredicate) { + return visitor.visitNegatedPredicate(this); } else { return visitor.visitChildren(this); } } } -export class PathExpressionContext extends ExpressionContext { - public path(): PathContext { - return this.getRuleContext(0, PathContext); +export class AndPredicateContext extends PredicateContext { + public predicate(): PredicateContext[]; + public predicate(i: number): PredicateContext; + public predicate(i?: number): PredicateContext | PredicateContext[] { + if (i === undefined) { + return this.getRuleContexts(PredicateContext); + } else { + return this.getRuleContext(i, PredicateContext); + } } - constructor(ctx: ExpressionContext) { + public AND(): TerminalNode { return this.getToken(BlazeExpressionParser.AND, 0); } + constructor(ctx: PredicateContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } // @Override public enterRule(listener: BlazeExpressionParserListener): void { - if (listener.enterPathExpression) { - listener.enterPathExpression(this); + if (listener.enterAndPredicate) { + listener.enterAndPredicate(this); } } // @Override public exitRule(listener: BlazeExpressionParserListener): void { - if (listener.exitPathExpression) { - listener.exitPathExpression(this); + if (listener.exitAndPredicate) { + listener.exitAndPredicate(this); } } // @Override public accept(visitor: BlazeExpressionParserVisitor): Result { - if (visitor.visitPathExpression) { - return visitor.visitPathExpression(this); + if (visitor.visitAndPredicate) { + return visitor.visitAndPredicate(this); } else { return visitor.visitChildren(this); } } } -export class FunctionExpressionContext extends ExpressionContext { - public functionInvocation(): FunctionInvocationContext { - return this.getRuleContext(0, FunctionInvocationContext); +export class OrPredicateContext extends PredicateContext { + public predicate(): PredicateContext[]; + public predicate(i: number): PredicateContext; + public predicate(i?: number): PredicateContext | PredicateContext[] { + if (i === undefined) { + return this.getRuleContexts(PredicateContext); + } else { + return this.getRuleContext(i, PredicateContext); + } } - constructor(ctx: ExpressionContext) { + public OR(): TerminalNode { return this.getToken(BlazeExpressionParser.OR, 0); } + constructor(ctx: PredicateContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } // @Override public enterRule(listener: BlazeExpressionParserListener): void { - if (listener.enterFunctionExpression) { - listener.enterFunctionExpression(this); + if (listener.enterOrPredicate) { + listener.enterOrPredicate(this); } } // @Override public exitRule(listener: BlazeExpressionParserListener): void { - if (listener.exitFunctionExpression) { - listener.exitFunctionExpression(this); + if (listener.exitOrPredicate) { + listener.exitOrPredicate(this); } } // @Override public accept(visitor: BlazeExpressionParserVisitor): Result { - if (visitor.visitFunctionExpression) { - return visitor.visitFunctionExpression(this); + if (visitor.visitOrPredicate) { + return visitor.visitOrPredicate(this); } else { return visitor.visitChildren(this); } } } -export class UnaryMinusExpressionContext extends ExpressionContext { - public MINUS(): TerminalNode { return this.getToken(BlazeExpressionParser.MINUS, 0); } +export class IsNullPredicateContext extends PredicateContext { public expression(): ExpressionContext { return this.getRuleContext(0, ExpressionContext); } - constructor(ctx: ExpressionContext) { + public IS(): TerminalNode { return this.getToken(BlazeExpressionParser.IS, 0); } + public NULL(): TerminalNode { return this.getToken(BlazeExpressionParser.NULL, 0); } + public NOT(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.NOT, 0); } + constructor(ctx: PredicateContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } // @Override public enterRule(listener: BlazeExpressionParserListener): void { - if (listener.enterUnaryMinusExpression) { - listener.enterUnaryMinusExpression(this); + if (listener.enterIsNullPredicate) { + listener.enterIsNullPredicate(this); } } // @Override public exitRule(listener: BlazeExpressionParserListener): void { - if (listener.exitUnaryMinusExpression) { - listener.exitUnaryMinusExpression(this); + if (listener.exitIsNullPredicate) { + listener.exitIsNullPredicate(this); } } // @Override public accept(visitor: BlazeExpressionParserVisitor): Result { - if (visitor.visitUnaryMinusExpression) { - return visitor.visitUnaryMinusExpression(this); + if (visitor.visitIsNullPredicate) { + return visitor.visitIsNullPredicate(this); } else { return visitor.visitChildren(this); } } } -export class UnaryPlusExpressionContext extends ExpressionContext { - public PLUS(): TerminalNode { return this.getToken(BlazeExpressionParser.PLUS, 0); } +export class IsEmptyPredicateContext extends PredicateContext { public expression(): ExpressionContext { return this.getRuleContext(0, ExpressionContext); } - constructor(ctx: ExpressionContext) { + public IS(): TerminalNode { return this.getToken(BlazeExpressionParser.IS, 0); } + public EMPTY(): TerminalNode { return this.getToken(BlazeExpressionParser.EMPTY, 0); } + public NOT(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.NOT, 0); } + constructor(ctx: PredicateContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: BlazeExpressionParserListener): void { + if (listener.enterIsEmptyPredicate) { + listener.enterIsEmptyPredicate(this); + } + } + // @Override + public exitRule(listener: BlazeExpressionParserListener): void { + if (listener.exitIsEmptyPredicate) { + listener.exitIsEmptyPredicate(this); + } + } + // @Override + public accept(visitor: BlazeExpressionParserVisitor): Result { + if (visitor.visitIsEmptyPredicate) { + return visitor.visitIsEmptyPredicate(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class EqualityPredicateContext extends PredicateContext { + public _lhs!: ExpressionContext; + public _rhs!: ExpressionContext; + public EQUAL(): TerminalNode { return this.getToken(BlazeExpressionParser.EQUAL, 0); } + public expression(): ExpressionContext[]; + public expression(i: number): ExpressionContext; + public expression(i?: number): ExpressionContext | ExpressionContext[] { + if (i === undefined) { + return this.getRuleContexts(ExpressionContext); + } else { + return this.getRuleContext(i, ExpressionContext); + } + } + constructor(ctx: PredicateContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: BlazeExpressionParserListener): void { + if (listener.enterEqualityPredicate) { + listener.enterEqualityPredicate(this); + } + } + // @Override + public exitRule(listener: BlazeExpressionParserListener): void { + if (listener.exitEqualityPredicate) { + listener.exitEqualityPredicate(this); + } + } + // @Override + public accept(visitor: BlazeExpressionParserVisitor): Result { + if (visitor.visitEqualityPredicate) { + return visitor.visitEqualityPredicate(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class InequalityPredicateContext extends PredicateContext { + public _lhs!: ExpressionContext; + public _rhs!: ExpressionContext; + public NOT_EQUAL(): TerminalNode { return this.getToken(BlazeExpressionParser.NOT_EQUAL, 0); } + public expression(): ExpressionContext[]; + public expression(i: number): ExpressionContext; + public expression(i?: number): ExpressionContext | ExpressionContext[] { + if (i === undefined) { + return this.getRuleContexts(ExpressionContext); + } else { + return this.getRuleContext(i, ExpressionContext); + } + } + constructor(ctx: PredicateContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } // @Override public enterRule(listener: BlazeExpressionParserListener): void { - if (listener.enterUnaryPlusExpression) { - listener.enterUnaryPlusExpression(this); + if (listener.enterInequalityPredicate) { + listener.enterInequalityPredicate(this); } } // @Override public exitRule(listener: BlazeExpressionParserListener): void { - if (listener.exitUnaryPlusExpression) { - listener.exitUnaryPlusExpression(this); + if (listener.exitInequalityPredicate) { + listener.exitInequalityPredicate(this); } } // @Override public accept(visitor: BlazeExpressionParserVisitor): Result { - if (visitor.visitUnaryPlusExpression) { - return visitor.visitUnaryPlusExpression(this); + if (visitor.visitInequalityPredicate) { + return visitor.visitInequalityPredicate(this); } else { return visitor.visitChildren(this); } } } -export class MultiplicativeExpressionContext extends ExpressionContext { +export class GreaterThanPredicateContext extends PredicateContext { public _lhs!: ExpressionContext; - public _op!: Token; public _rhs!: ExpressionContext; + public GREATER(): TerminalNode { return this.getToken(BlazeExpressionParser.GREATER, 0); } public expression(): ExpressionContext[]; public expression(i: number): ExpressionContext; public expression(i?: number): ExpressionContext | ExpressionContext[] { @@ -2685,38 +3557,35 @@ export class MultiplicativeExpressionContext extends ExpressionContext { return this.getRuleContext(i, ExpressionContext); } } - public ASTERISK(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.ASTERISK, 0); } - public SLASH(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.SLASH, 0); } - public PERCENT(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.PERCENT, 0); } - constructor(ctx: ExpressionContext) { + constructor(ctx: PredicateContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } // @Override public enterRule(listener: BlazeExpressionParserListener): void { - if (listener.enterMultiplicativeExpression) { - listener.enterMultiplicativeExpression(this); + if (listener.enterGreaterThanPredicate) { + listener.enterGreaterThanPredicate(this); } } // @Override public exitRule(listener: BlazeExpressionParserListener): void { - if (listener.exitMultiplicativeExpression) { - listener.exitMultiplicativeExpression(this); + if (listener.exitGreaterThanPredicate) { + listener.exitGreaterThanPredicate(this); } } // @Override public accept(visitor: BlazeExpressionParserVisitor): Result { - if (visitor.visitMultiplicativeExpression) { - return visitor.visitMultiplicativeExpression(this); + if (visitor.visitGreaterThanPredicate) { + return visitor.visitGreaterThanPredicate(this); } else { return visitor.visitChildren(this); } } } -export class AdditiveExpressionContext extends ExpressionContext { +export class GreaterThanOrEqualPredicateContext extends PredicateContext { public _lhs!: ExpressionContext; - public _op!: Token; public _rhs!: ExpressionContext; + public GREATER_EQUAL(): TerminalNode { return this.getToken(BlazeExpressionParser.GREATER_EQUAL, 0); } public expression(): ExpressionContext[]; public expression(i: number): ExpressionContext; public expression(i?: number): ExpressionContext | ExpressionContext[] { @@ -2726,323 +3595,317 @@ export class AdditiveExpressionContext extends ExpressionContext { return this.getRuleContext(i, ExpressionContext); } } - public PLUS(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.PLUS, 0); } - public MINUS(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.MINUS, 0); } - constructor(ctx: ExpressionContext) { + constructor(ctx: PredicateContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } // @Override public enterRule(listener: BlazeExpressionParserListener): void { - if (listener.enterAdditiveExpression) { - listener.enterAdditiveExpression(this); + if (listener.enterGreaterThanOrEqualPredicate) { + listener.enterGreaterThanOrEqualPredicate(this); } } // @Override public exitRule(listener: BlazeExpressionParserListener): void { - if (listener.exitAdditiveExpression) { - listener.exitAdditiveExpression(this); + if (listener.exitGreaterThanOrEqualPredicate) { + listener.exitGreaterThanOrEqualPredicate(this); } } // @Override public accept(visitor: BlazeExpressionParserVisitor): Result { - if (visitor.visitAdditiveExpression) { - return visitor.visitAdditiveExpression(this); + if (visitor.visitGreaterThanOrEqualPredicate) { + return visitor.visitGreaterThanOrEqualPredicate(this); } else { return visitor.visitChildren(this); } } } - - -export class PredicateContext extends ParserRuleContext { - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return BlazeExpressionParser.RULE_predicate; } - public copyFrom(ctx: PredicateContext): void { - super.copyFrom(ctx); - } -} -export class GroupedPredicateContext extends PredicateContext { - public LP(): TerminalNode { return this.getToken(BlazeExpressionParser.LP, 0); } - public predicate(): PredicateContext { - return this.getRuleContext(0, PredicateContext); +export class LessThanPredicateContext extends PredicateContext { + public _lhs!: ExpressionContext; + public _rhs!: ExpressionContext; + public LESS(): TerminalNode { return this.getToken(BlazeExpressionParser.LESS, 0); } + public expression(): ExpressionContext[]; + public expression(i: number): ExpressionContext; + public expression(i?: number): ExpressionContext | ExpressionContext[] { + if (i === undefined) { + return this.getRuleContexts(ExpressionContext); + } else { + return this.getRuleContext(i, ExpressionContext); + } } - public RP(): TerminalNode { return this.getToken(BlazeExpressionParser.RP, 0); } constructor(ctx: PredicateContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } // @Override public enterRule(listener: BlazeExpressionParserListener): void { - if (listener.enterGroupedPredicate) { - listener.enterGroupedPredicate(this); + if (listener.enterLessThanPredicate) { + listener.enterLessThanPredicate(this); } } // @Override public exitRule(listener: BlazeExpressionParserListener): void { - if (listener.exitGroupedPredicate) { - listener.exitGroupedPredicate(this); + if (listener.exitLessThanPredicate) { + listener.exitLessThanPredicate(this); } } // @Override public accept(visitor: BlazeExpressionParserVisitor): Result { - if (visitor.visitGroupedPredicate) { - return visitor.visitGroupedPredicate(this); + if (visitor.visitLessThanPredicate) { + return visitor.visitLessThanPredicate(this); } else { return visitor.visitChildren(this); } } } -export class NegatedPredicateContext extends PredicateContext { - public predicate(): PredicateContext { - return this.getRuleContext(0, PredicateContext); +export class LessThanOrEqualPredicateContext extends PredicateContext { + public _lhs!: ExpressionContext; + public _rhs!: ExpressionContext; + public LESS_EQUAL(): TerminalNode { return this.getToken(BlazeExpressionParser.LESS_EQUAL, 0); } + public expression(): ExpressionContext[]; + public expression(i: number): ExpressionContext; + public expression(i?: number): ExpressionContext | ExpressionContext[] { + if (i === undefined) { + return this.getRuleContexts(ExpressionContext); + } else { + return this.getRuleContext(i, ExpressionContext); + } } - public NOT(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.NOT, 0); } - public EXCLAMATION_MARK(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.EXCLAMATION_MARK, 0); } constructor(ctx: PredicateContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } // @Override public enterRule(listener: BlazeExpressionParserListener): void { - if (listener.enterNegatedPredicate) { - listener.enterNegatedPredicate(this); + if (listener.enterLessThanOrEqualPredicate) { + listener.enterLessThanOrEqualPredicate(this); } } // @Override public exitRule(listener: BlazeExpressionParserListener): void { - if (listener.exitNegatedPredicate) { - listener.exitNegatedPredicate(this); + if (listener.exitLessThanOrEqualPredicate) { + listener.exitLessThanOrEqualPredicate(this); } } // @Override public accept(visitor: BlazeExpressionParserVisitor): Result { - if (visitor.visitNegatedPredicate) { - return visitor.visitNegatedPredicate(this); + if (visitor.visitLessThanOrEqualPredicate) { + return visitor.visitLessThanOrEqualPredicate(this); } else { return visitor.visitChildren(this); } } } -export class AndPredicateContext extends PredicateContext { - public predicate(): PredicateContext[]; - public predicate(i: number): PredicateContext; - public predicate(i?: number): PredicateContext | PredicateContext[] { - if (i === undefined) { - return this.getRuleContexts(PredicateContext); - } else { - return this.getRuleContext(i, PredicateContext); - } +export class InPredicateContext extends PredicateContext { + public expression(): ExpressionContext { + return this.getRuleContext(0, ExpressionContext); } - public AND(): TerminalNode { return this.getToken(BlazeExpressionParser.AND, 0); } + public IN(): TerminalNode { return this.getToken(BlazeExpressionParser.IN, 0); } + public inList(): InListContext { + return this.getRuleContext(0, InListContext); + } + public NOT(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.NOT, 0); } constructor(ctx: PredicateContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } // @Override public enterRule(listener: BlazeExpressionParserListener): void { - if (listener.enterAndPredicate) { - listener.enterAndPredicate(this); + if (listener.enterInPredicate) { + listener.enterInPredicate(this); } } // @Override public exitRule(listener: BlazeExpressionParserListener): void { - if (listener.exitAndPredicate) { - listener.exitAndPredicate(this); + if (listener.exitInPredicate) { + listener.exitInPredicate(this); } } // @Override public accept(visitor: BlazeExpressionParserVisitor): Result { - if (visitor.visitAndPredicate) { - return visitor.visitAndPredicate(this); + if (visitor.visitInPredicate) { + return visitor.visitInPredicate(this); } else { return visitor.visitChildren(this); } } } -export class OrPredicateContext extends PredicateContext { - public predicate(): PredicateContext[]; - public predicate(i: number): PredicateContext; - public predicate(i?: number): PredicateContext | PredicateContext[] { +export class BetweenPredicateContext extends PredicateContext { + public _lhs!: ExpressionContext; + public _begin!: ExpressionContext; + public _end!: ExpressionContext; + public BETWEEN(): TerminalNode { return this.getToken(BlazeExpressionParser.BETWEEN, 0); } + public AND(): TerminalNode { return this.getToken(BlazeExpressionParser.AND, 0); } + public expression(): ExpressionContext[]; + public expression(i: number): ExpressionContext; + public expression(i?: number): ExpressionContext | ExpressionContext[] { if (i === undefined) { - return this.getRuleContexts(PredicateContext); + return this.getRuleContexts(ExpressionContext); } else { - return this.getRuleContext(i, PredicateContext); + return this.getRuleContext(i, ExpressionContext); } } - public OR(): TerminalNode { return this.getToken(BlazeExpressionParser.OR, 0); } + public NOT(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.NOT, 0); } constructor(ctx: PredicateContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } // @Override public enterRule(listener: BlazeExpressionParserListener): void { - if (listener.enterOrPredicate) { - listener.enterOrPredicate(this); + if (listener.enterBetweenPredicate) { + listener.enterBetweenPredicate(this); } } // @Override public exitRule(listener: BlazeExpressionParserListener): void { - if (listener.exitOrPredicate) { - listener.exitOrPredicate(this); + if (listener.exitBetweenPredicate) { + listener.exitBetweenPredicate(this); } } // @Override public accept(visitor: BlazeExpressionParserVisitor): Result { - if (visitor.visitOrPredicate) { - return visitor.visitOrPredicate(this); + if (visitor.visitBetweenPredicate) { + return visitor.visitBetweenPredicate(this); } else { return visitor.visitChildren(this); } } } -export class IsNullPredicateContext extends PredicateContext { - public expression(): ExpressionContext { - return this.getRuleContext(0, ExpressionContext); +export class BooleanFunctionContext extends PredicateContext { + public functionInvocation(): FunctionInvocationContext { + return this.getRuleContext(0, FunctionInvocationContext); } - public IS(): TerminalNode { return this.getToken(BlazeExpressionParser.IS, 0); } - public NULL(): TerminalNode { return this.getToken(BlazeExpressionParser.NULL, 0); } - public NOT(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.NOT, 0); } constructor(ctx: PredicateContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } // @Override public enterRule(listener: BlazeExpressionParserListener): void { - if (listener.enterIsNullPredicate) { - listener.enterIsNullPredicate(this); + if (listener.enterBooleanFunction) { + listener.enterBooleanFunction(this); } } // @Override public exitRule(listener: BlazeExpressionParserListener): void { - if (listener.exitIsNullPredicate) { - listener.exitIsNullPredicate(this); + if (listener.exitBooleanFunction) { + listener.exitBooleanFunction(this); } } // @Override public accept(visitor: BlazeExpressionParserVisitor): Result { - if (visitor.visitIsNullPredicate) { - return visitor.visitIsNullPredicate(this); + if (visitor.visitBooleanFunction) { + return visitor.visitBooleanFunction(this); } else { return visitor.visitChildren(this); } } } -export class IsEmptyPredicateContext extends PredicateContext { - public expression(): ExpressionContext { - return this.getRuleContext(0, ExpressionContext); +export class PathPredicateContext extends PredicateContext { + public path(): PathContext { + return this.getRuleContext(0, PathContext); } - public IS(): TerminalNode { return this.getToken(BlazeExpressionParser.IS, 0); } - public EMPTY(): TerminalNode { return this.getToken(BlazeExpressionParser.EMPTY, 0); } - public NOT(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.NOT, 0); } constructor(ctx: PredicateContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } // @Override public enterRule(listener: BlazeExpressionParserListener): void { - if (listener.enterIsEmptyPredicate) { - listener.enterIsEmptyPredicate(this); + if (listener.enterPathPredicate) { + listener.enterPathPredicate(this); } } // @Override public exitRule(listener: BlazeExpressionParserListener): void { - if (listener.exitIsEmptyPredicate) { - listener.exitIsEmptyPredicate(this); + if (listener.exitPathPredicate) { + listener.exitPathPredicate(this); } } // @Override public accept(visitor: BlazeExpressionParserVisitor): Result { - if (visitor.visitIsEmptyPredicate) { - return visitor.visitIsEmptyPredicate(this); + if (visitor.visitPathPredicate) { + return visitor.visitPathPredicate(this); } else { return visitor.visitChildren(this); } } } -export class EqualityPredicateContext extends PredicateContext { - public _lhs!: ExpressionContext; - public _rhs!: ExpressionContext; - public EQUAL(): TerminalNode { return this.getToken(BlazeExpressionParser.EQUAL, 0); } - public expression(): ExpressionContext[]; - public expression(i: number): ExpressionContext; - public expression(i?: number): ExpressionContext | ExpressionContext[] { - if (i === undefined) { - return this.getRuleContexts(ExpressionContext); - } else { - return this.getRuleContext(i, ExpressionContext); - } + + +export class PredicateOrExpressionContext extends ParserRuleContext { + public expression(): ExpressionContext | undefined { + return this.tryGetRuleContext(0, ExpressionContext); } - constructor(ctx: PredicateContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); + public predicate(): PredicateContext | undefined { + return this.tryGetRuleContext(0, PredicateContext); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); } // @Override + public get ruleIndex(): number { return BlazeExpressionParser.RULE_predicateOrExpression; } + // @Override public enterRule(listener: BlazeExpressionParserListener): void { - if (listener.enterEqualityPredicate) { - listener.enterEqualityPredicate(this); + if (listener.enterPredicateOrExpression) { + listener.enterPredicateOrExpression(this); } } // @Override public exitRule(listener: BlazeExpressionParserListener): void { - if (listener.exitEqualityPredicate) { - listener.exitEqualityPredicate(this); + if (listener.exitPredicateOrExpression) { + listener.exitPredicateOrExpression(this); } } // @Override public accept(visitor: BlazeExpressionParserVisitor): Result { - if (visitor.visitEqualityPredicate) { - return visitor.visitEqualityPredicate(this); + if (visitor.visitPredicateOrExpression) { + return visitor.visitPredicateOrExpression(this); } else { return visitor.visitChildren(this); } } } -export class InequalityPredicateContext extends PredicateContext { - public _lhs!: ExpressionContext; - public _rhs!: ExpressionContext; - public NOT_EQUAL(): TerminalNode { return this.getToken(BlazeExpressionParser.NOT_EQUAL, 0); } - public expression(): ExpressionContext[]; - public expression(i: number): ExpressionContext; - public expression(i?: number): ExpressionContext | ExpressionContext[] { - if (i === undefined) { - return this.getRuleContexts(ExpressionContext); - } else { - return this.getRuleContext(i, ExpressionContext); - } + + +export class QueryContext extends ParserRuleContext { + public fromClause(): FromClauseContext { + return this.getRuleContext(0, FromClauseContext); } - constructor(ctx: PredicateContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); + public selectClause(): SelectClauseContext | undefined { + return this.tryGetRuleContext(0, SelectClauseContext); + } + public whereClause(): WhereClauseContext | undefined { + return this.tryGetRuleContext(0, WhereClauseContext); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); } // @Override + public get ruleIndex(): number { return BlazeExpressionParser.RULE_query; } + // @Override public enterRule(listener: BlazeExpressionParserListener): void { - if (listener.enterInequalityPredicate) { - listener.enterInequalityPredicate(this); + if (listener.enterQuery) { + listener.enterQuery(this); } } // @Override public exitRule(listener: BlazeExpressionParserListener): void { - if (listener.exitInequalityPredicate) { - listener.exitInequalityPredicate(this); + if (listener.exitQuery) { + listener.exitQuery(this); } } // @Override public accept(visitor: BlazeExpressionParserVisitor): Result { - if (visitor.visitInequalityPredicate) { - return visitor.visitInequalityPredicate(this); + if (visitor.visitQuery) { + return visitor.visitQuery(this); } else { return visitor.visitChildren(this); } } } -export class GreaterThanPredicateContext extends PredicateContext { - public _lhs!: ExpressionContext; - public _rhs!: ExpressionContext; - public GREATER(): TerminalNode { return this.getToken(BlazeExpressionParser.GREATER, 0); } + + +export class SelectClauseContext extends ParserRuleContext { + public SELECT(): TerminalNode { return this.getToken(BlazeExpressionParser.SELECT, 0); } public expression(): ExpressionContext[]; public expression(i: number): ExpressionContext; public expression(i?: number): ExpressionContext | ExpressionContext[] { @@ -3052,273 +3915,301 @@ export class GreaterThanPredicateContext extends PredicateContext { return this.getRuleContext(i, ExpressionContext); } } - constructor(ctx: PredicateContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); + public DISTINCT(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.DISTINCT, 0); } + public COMMA(): TerminalNode[]; + public COMMA(i: number): TerminalNode; + public COMMA(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(BlazeExpressionParser.COMMA); + } else { + return this.getToken(BlazeExpressionParser.COMMA, i); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); } // @Override + public get ruleIndex(): number { return BlazeExpressionParser.RULE_selectClause; } + // @Override public enterRule(listener: BlazeExpressionParserListener): void { - if (listener.enterGreaterThanPredicate) { - listener.enterGreaterThanPredicate(this); + if (listener.enterSelectClause) { + listener.enterSelectClause(this); } } // @Override public exitRule(listener: BlazeExpressionParserListener): void { - if (listener.exitGreaterThanPredicate) { - listener.exitGreaterThanPredicate(this); + if (listener.exitSelectClause) { + listener.exitSelectClause(this); } } // @Override public accept(visitor: BlazeExpressionParserVisitor): Result { - if (visitor.visitGreaterThanPredicate) { - return visitor.visitGreaterThanPredicate(this); + if (visitor.visitSelectClause) { + return visitor.visitSelectClause(this); } else { return visitor.visitChildren(this); } } } -export class GreaterThanOrEqualPredicateContext extends PredicateContext { - public _lhs!: ExpressionContext; - public _rhs!: ExpressionContext; - public GREATER_EQUAL(): TerminalNode { return this.getToken(BlazeExpressionParser.GREATER_EQUAL, 0); } - public expression(): ExpressionContext[]; - public expression(i: number): ExpressionContext; - public expression(i?: number): ExpressionContext | ExpressionContext[] { + + +export class FromClauseContext extends ParserRuleContext { + public FROM(): TerminalNode { return this.getToken(BlazeExpressionParser.FROM, 0); } + public fromItem(): FromItemContext[]; + public fromItem(i: number): FromItemContext; + public fromItem(i?: number): FromItemContext | FromItemContext[] { if (i === undefined) { - return this.getRuleContexts(ExpressionContext); + return this.getRuleContexts(FromItemContext); } else { - return this.getRuleContext(i, ExpressionContext); + return this.getRuleContext(i, FromItemContext); } } - constructor(ctx: PredicateContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); + public COMMA(): TerminalNode[]; + public COMMA(i: number): TerminalNode; + public COMMA(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(BlazeExpressionParser.COMMA); + } else { + return this.getToken(BlazeExpressionParser.COMMA, i); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); } // @Override + public get ruleIndex(): number { return BlazeExpressionParser.RULE_fromClause; } + // @Override public enterRule(listener: BlazeExpressionParserListener): void { - if (listener.enterGreaterThanOrEqualPredicate) { - listener.enterGreaterThanOrEqualPredicate(this); + if (listener.enterFromClause) { + listener.enterFromClause(this); } } // @Override public exitRule(listener: BlazeExpressionParserListener): void { - if (listener.exitGreaterThanOrEqualPredicate) { - listener.exitGreaterThanOrEqualPredicate(this); + if (listener.exitFromClause) { + listener.exitFromClause(this); } } // @Override public accept(visitor: BlazeExpressionParserVisitor): Result { - if (visitor.visitGreaterThanOrEqualPredicate) { - return visitor.visitGreaterThanOrEqualPredicate(this); + if (visitor.visitFromClause) { + return visitor.visitFromClause(this); } else { return visitor.visitChildren(this); } } } -export class LessThanPredicateContext extends PredicateContext { - public _lhs!: ExpressionContext; - public _rhs!: ExpressionContext; - public LESS(): TerminalNode { return this.getToken(BlazeExpressionParser.LESS, 0); } - public expression(): ExpressionContext[]; - public expression(i: number): ExpressionContext; - public expression(i?: number): ExpressionContext | ExpressionContext[] { - if (i === undefined) { - return this.getRuleContexts(ExpressionContext); - } else { - return this.getRuleContext(i, ExpressionContext); - } + + +export class WhereClauseContext extends ParserRuleContext { + public WHERE(): TerminalNode { return this.getToken(BlazeExpressionParser.WHERE, 0); } + public predicate(): PredicateContext { + return this.getRuleContext(0, PredicateContext); } - constructor(ctx: PredicateContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); } // @Override + public get ruleIndex(): number { return BlazeExpressionParser.RULE_whereClause; } + // @Override public enterRule(listener: BlazeExpressionParserListener): void { - if (listener.enterLessThanPredicate) { - listener.enterLessThanPredicate(this); + if (listener.enterWhereClause) { + listener.enterWhereClause(this); } } // @Override public exitRule(listener: BlazeExpressionParserListener): void { - if (listener.exitLessThanPredicate) { - listener.exitLessThanPredicate(this); + if (listener.exitWhereClause) { + listener.exitWhereClause(this); } } // @Override public accept(visitor: BlazeExpressionParserVisitor): Result { - if (visitor.visitLessThanPredicate) { - return visitor.visitLessThanPredicate(this); + if (visitor.visitWhereClause) { + return visitor.visitWhereClause(this); } else { return visitor.visitChildren(this); } } } -export class LessThanOrEqualPredicateContext extends PredicateContext { - public _lhs!: ExpressionContext; - public _rhs!: ExpressionContext; - public LESS_EQUAL(): TerminalNode { return this.getToken(BlazeExpressionParser.LESS_EQUAL, 0); } - public expression(): ExpressionContext[]; - public expression(i: number): ExpressionContext; - public expression(i?: number): ExpressionContext | ExpressionContext[] { + + +export class FromItemContext extends ParserRuleContext { + public fromRoot(): FromRootContext { + return this.getRuleContext(0, FromRootContext); + } + public join(): JoinContext[]; + public join(i: number): JoinContext; + public join(i?: number): JoinContext | JoinContext[] { if (i === undefined) { - return this.getRuleContexts(ExpressionContext); + return this.getRuleContexts(JoinContext); } else { - return this.getRuleContext(i, ExpressionContext); + return this.getRuleContext(i, JoinContext); } } - constructor(ctx: PredicateContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); } // @Override + public get ruleIndex(): number { return BlazeExpressionParser.RULE_fromItem; } + // @Override public enterRule(listener: BlazeExpressionParserListener): void { - if (listener.enterLessThanOrEqualPredicate) { - listener.enterLessThanOrEqualPredicate(this); + if (listener.enterFromItem) { + listener.enterFromItem(this); } } // @Override public exitRule(listener: BlazeExpressionParserListener): void { - if (listener.exitLessThanOrEqualPredicate) { - listener.exitLessThanOrEqualPredicate(this); + if (listener.exitFromItem) { + listener.exitFromItem(this); } } // @Override public accept(visitor: BlazeExpressionParserVisitor): Result { - if (visitor.visitLessThanOrEqualPredicate) { - return visitor.visitLessThanOrEqualPredicate(this); + if (visitor.visitFromItem) { + return visitor.visitFromItem(this); } else { return visitor.visitChildren(this); } } } -export class InPredicateContext extends PredicateContext { - public expression(): ExpressionContext { - return this.getRuleContext(0, ExpressionContext); + + +export class FromRootContext extends ParserRuleContext { + public domainTypeName(): DomainTypeNameContext { + return this.getRuleContext(0, DomainTypeNameContext); } - public IN(): TerminalNode { return this.getToken(BlazeExpressionParser.IN, 0); } - public inList(): InListContext { - return this.getRuleContext(0, InListContext); + public variable(): VariableContext { + return this.getRuleContext(0, VariableContext); } - public NOT(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.NOT, 0); } - constructor(ctx: PredicateContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); } // @Override + public get ruleIndex(): number { return BlazeExpressionParser.RULE_fromRoot; } + // @Override public enterRule(listener: BlazeExpressionParserListener): void { - if (listener.enterInPredicate) { - listener.enterInPredicate(this); + if (listener.enterFromRoot) { + listener.enterFromRoot(this); } } // @Override public exitRule(listener: BlazeExpressionParserListener): void { - if (listener.exitInPredicate) { - listener.exitInPredicate(this); + if (listener.exitFromRoot) { + listener.exitFromRoot(this); } } // @Override public accept(visitor: BlazeExpressionParserVisitor): Result { - if (visitor.visitInPredicate) { - return visitor.visitInPredicate(this); + if (visitor.visitFromRoot) { + return visitor.visitFromRoot(this); } else { return visitor.visitChildren(this); } } } -export class BetweenPredicateContext extends PredicateContext { - public _lhs!: ExpressionContext; - public _begin!: ExpressionContext; - public _end!: ExpressionContext; - public BETWEEN(): TerminalNode { return this.getToken(BlazeExpressionParser.BETWEEN, 0); } - public AND(): TerminalNode { return this.getToken(BlazeExpressionParser.AND, 0); } - public expression(): ExpressionContext[]; - public expression(i: number): ExpressionContext; - public expression(i?: number): ExpressionContext | ExpressionContext[] { - if (i === undefined) { - return this.getRuleContexts(ExpressionContext); - } else { - return this.getRuleContext(i, ExpressionContext); - } + + +export class JoinContext extends ParserRuleContext { + public JOIN(): TerminalNode { return this.getToken(BlazeExpressionParser.JOIN, 0); } + public joinTarget(): JoinTargetContext { + return this.getRuleContext(0, JoinTargetContext); } - public NOT(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.NOT, 0); } - constructor(ctx: PredicateContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); + public ON(): TerminalNode { return this.getToken(BlazeExpressionParser.ON, 0); } + public predicate(): PredicateContext { + return this.getRuleContext(0, PredicateContext); + } + public LEFT(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.LEFT, 0); } + public RIGHT(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.RIGHT, 0); } + public FULL(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.FULL, 0); } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); } // @Override + public get ruleIndex(): number { return BlazeExpressionParser.RULE_join; } + // @Override public enterRule(listener: BlazeExpressionParserListener): void { - if (listener.enterBetweenPredicate) { - listener.enterBetweenPredicate(this); + if (listener.enterJoin) { + listener.enterJoin(this); } } // @Override public exitRule(listener: BlazeExpressionParserListener): void { - if (listener.exitBetweenPredicate) { - listener.exitBetweenPredicate(this); + if (listener.exitJoin) { + listener.exitJoin(this); } } // @Override public accept(visitor: BlazeExpressionParserVisitor): Result { - if (visitor.visitBetweenPredicate) { - return visitor.visitBetweenPredicate(this); + if (visitor.visitJoin) { + return visitor.visitJoin(this); } else { return visitor.visitChildren(this); } } } -export class BooleanFunctionContext extends PredicateContext { - public functionInvocation(): FunctionInvocationContext { - return this.getRuleContext(0, FunctionInvocationContext); + + +export class JoinTargetContext extends ParserRuleContext { + public domainTypeName(): DomainTypeNameContext { + return this.getRuleContext(0, DomainTypeNameContext); } - constructor(ctx: PredicateContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); + public variable(): VariableContext { + return this.getRuleContext(0, VariableContext); } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return BlazeExpressionParser.RULE_joinTarget; } // @Override public enterRule(listener: BlazeExpressionParserListener): void { - if (listener.enterBooleanFunction) { - listener.enterBooleanFunction(this); + if (listener.enterJoinTarget) { + listener.enterJoinTarget(this); } } // @Override public exitRule(listener: BlazeExpressionParserListener): void { - if (listener.exitBooleanFunction) { - listener.exitBooleanFunction(this); + if (listener.exitJoinTarget) { + listener.exitJoinTarget(this); } } // @Override public accept(visitor: BlazeExpressionParserVisitor): Result { - if (visitor.visitBooleanFunction) { - return visitor.visitBooleanFunction(this); + if (visitor.visitJoinTarget) { + return visitor.visitJoinTarget(this); } else { return visitor.visitChildren(this); } } } -export class PathPredicateContext extends PredicateContext { - public path(): PathContext { - return this.getRuleContext(0, PathContext); + + +export class DomainTypeNameContext extends ParserRuleContext { + public identifier(): IdentifierContext { + return this.getRuleContext(0, IdentifierContext); } - constructor(ctx: PredicateContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); } // @Override + public get ruleIndex(): number { return BlazeExpressionParser.RULE_domainTypeName; } + // @Override public enterRule(listener: BlazeExpressionParserListener): void { - if (listener.enterPathPredicate) { - listener.enterPathPredicate(this); + if (listener.enterDomainTypeName) { + listener.enterDomainTypeName(this); } } // @Override public exitRule(listener: BlazeExpressionParserListener): void { - if (listener.exitPathPredicate) { - listener.exitPathPredicate(this); + if (listener.exitDomainTypeName) { + listener.exitDomainTypeName(this); } } // @Override public accept(visitor: BlazeExpressionParserVisitor): Result { - if (visitor.visitPathPredicate) { - return visitor.visitPathPredicate(this); + if (visitor.visitDomainTypeName) { + return visitor.visitDomainTypeName(this); } else { return visitor.visitChildren(this); } @@ -3326,34 +4217,32 @@ export class PathPredicateContext extends PredicateContext { } -export class PredicateOrExpressionContext extends ParserRuleContext { - public expression(): ExpressionContext | undefined { - return this.tryGetRuleContext(0, ExpressionContext); - } - public predicate(): PredicateContext | undefined { - return this.tryGetRuleContext(0, PredicateContext); +export class VariableContext extends ParserRuleContext { + public identifier(): IdentifierContext { + return this.getRuleContext(0, IdentifierContext); } + public AS(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.AS, 0); } constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return BlazeExpressionParser.RULE_predicateOrExpression; } + public get ruleIndex(): number { return BlazeExpressionParser.RULE_variable; } // @Override public enterRule(listener: BlazeExpressionParserListener): void { - if (listener.enterPredicateOrExpression) { - listener.enterPredicateOrExpression(this); + if (listener.enterVariable) { + listener.enterVariable(this); } } // @Override public exitRule(listener: BlazeExpressionParserListener): void { - if (listener.exitPredicateOrExpression) { - listener.exitPredicateOrExpression(this); + if (listener.exitVariable) { + listener.exitVariable(this); } } // @Override public accept(visitor: BlazeExpressionParserVisitor): Result { - if (visitor.visitPredicateOrExpression) { - return visitor.visitPredicateOrExpression(this); + if (visitor.visitVariable) { + return visitor.visitVariable(this); } else { return visitor.visitChildren(this); } @@ -4130,16 +5019,25 @@ export class IdentifierContext extends ParserRuleContext { public BETWEEN(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.BETWEEN, 0); } public DATE(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.DATE, 0); } public DAYS(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.DAYS, 0); } + public DISTINCT(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.DISTINCT, 0); } + public FROM(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.FROM, 0); } + public FULL(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.FULL, 0); } public HOURS(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.HOURS, 0); } public IN(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.IN, 0); } public IS(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.IS, 0); } + public JOIN(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.JOIN, 0); } + public LEFT(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.LEFT, 0); } public MINUTES(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.MINUTES, 0); } public MONTHS(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.MONTHS, 0); } public NOT(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.NOT, 0); } + public ON(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.ON, 0); } public OR(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.OR, 0); } + public RIGHT(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.RIGHT, 0); } public SECONDS(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.SECONDS, 0); } + public SELECT(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.SELECT, 0); } public TIME(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.TIME, 0); } public TIMESTAMP(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.TIMESTAMP, 0); } + public WHERE(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.WHERE, 0); } public YEARS(): TerminalNode | undefined { return this.tryGetToken(BlazeExpressionParser.YEARS, 0); } constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); diff --git a/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionParserListener.ts b/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionParserListener.ts index 4ca45e4..984124e 100644 --- a/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionParserListener.ts +++ b/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionParserListener.ts @@ -3,14 +3,6 @@ import { ParseTreeListener } from "antlr4ts/tree/ParseTreeListener"; -import { GroupedExpressionContext } from "./BlazeExpressionParser"; -import { LiteralExpressionContext } from "./BlazeExpressionParser"; -import { PathExpressionContext } from "./BlazeExpressionParser"; -import { FunctionExpressionContext } from "./BlazeExpressionParser"; -import { UnaryMinusExpressionContext } from "./BlazeExpressionParser"; -import { UnaryPlusExpressionContext } from "./BlazeExpressionParser"; -import { MultiplicativeExpressionContext } from "./BlazeExpressionParser"; -import { AdditiveExpressionContext } from "./BlazeExpressionParser"; import { NamedInvocationContext } from "./BlazeExpressionParser"; import { IndexedFunctionInvocationContext } from "./BlazeExpressionParser"; import { GroupedPredicateContext } from "./BlazeExpressionParser"; @@ -29,14 +21,33 @@ import { InPredicateContext } from "./BlazeExpressionParser"; import { BetweenPredicateContext } from "./BlazeExpressionParser"; import { BooleanFunctionContext } from "./BlazeExpressionParser"; import { PathPredicateContext } from "./BlazeExpressionParser"; +import { GroupedExpressionContext } from "./BlazeExpressionParser"; +import { LiteralExpressionContext } from "./BlazeExpressionParser"; +import { PathExpressionContext } from "./BlazeExpressionParser"; +import { FunctionExpressionContext } from "./BlazeExpressionParser"; +import { UnaryMinusExpressionContext } from "./BlazeExpressionParser"; +import { UnaryPlusExpressionContext } from "./BlazeExpressionParser"; +import { MultiplicativeExpressionContext } from "./BlazeExpressionParser"; +import { AdditiveExpressionContext } from "./BlazeExpressionParser"; import { ParsePredicateContext } from "./BlazeExpressionParser"; import { ParseExpressionContext } from "./BlazeExpressionParser"; import { ParseExpressionOrPredicateContext } from "./BlazeExpressionParser"; import { ParseTemplateContext } from "./BlazeExpressionParser"; +import { ParseQueryContext } from "./BlazeExpressionParser"; import { TemplateContext } from "./BlazeExpressionParser"; import { ExpressionContext } from "./BlazeExpressionParser"; import { PredicateContext } from "./BlazeExpressionParser"; import { PredicateOrExpressionContext } from "./BlazeExpressionParser"; +import { QueryContext } from "./BlazeExpressionParser"; +import { SelectClauseContext } from "./BlazeExpressionParser"; +import { FromClauseContext } from "./BlazeExpressionParser"; +import { WhereClauseContext } from "./BlazeExpressionParser"; +import { FromItemContext } from "./BlazeExpressionParser"; +import { FromRootContext } from "./BlazeExpressionParser"; +import { JoinContext } from "./BlazeExpressionParser"; +import { JoinTargetContext } from "./BlazeExpressionParser"; +import { DomainTypeNameContext } from "./BlazeExpressionParser"; +import { VariableContext } from "./BlazeExpressionParser"; import { InListContext } from "./BlazeExpressionParser"; import { PathContext } from "./BlazeExpressionParser"; import { PathAttributesContext } from "./BlazeExpressionParser"; @@ -59,110 +70,6 @@ import { IdentifierContext } from "./BlazeExpressionParser"; * `BlazeExpressionParser`. */ export interface BlazeExpressionParserListener extends ParseTreeListener { - /** - * Enter a parse tree produced by the `GroupedExpression` - * labeled alternative in `BlazeExpressionParser.expression`. - * @param ctx the parse tree - */ - enterGroupedExpression?: (ctx: GroupedExpressionContext) => void; - /** - * Exit a parse tree produced by the `GroupedExpression` - * labeled alternative in `BlazeExpressionParser.expression`. - * @param ctx the parse tree - */ - exitGroupedExpression?: (ctx: GroupedExpressionContext) => void; - - /** - * Enter a parse tree produced by the `LiteralExpression` - * labeled alternative in `BlazeExpressionParser.expression`. - * @param ctx the parse tree - */ - enterLiteralExpression?: (ctx: LiteralExpressionContext) => void; - /** - * Exit a parse tree produced by the `LiteralExpression` - * labeled alternative in `BlazeExpressionParser.expression`. - * @param ctx the parse tree - */ - exitLiteralExpression?: (ctx: LiteralExpressionContext) => void; - - /** - * Enter a parse tree produced by the `PathExpression` - * labeled alternative in `BlazeExpressionParser.expression`. - * @param ctx the parse tree - */ - enterPathExpression?: (ctx: PathExpressionContext) => void; - /** - * Exit a parse tree produced by the `PathExpression` - * labeled alternative in `BlazeExpressionParser.expression`. - * @param ctx the parse tree - */ - exitPathExpression?: (ctx: PathExpressionContext) => void; - - /** - * Enter a parse tree produced by the `FunctionExpression` - * labeled alternative in `BlazeExpressionParser.expression`. - * @param ctx the parse tree - */ - enterFunctionExpression?: (ctx: FunctionExpressionContext) => void; - /** - * Exit a parse tree produced by the `FunctionExpression` - * labeled alternative in `BlazeExpressionParser.expression`. - * @param ctx the parse tree - */ - exitFunctionExpression?: (ctx: FunctionExpressionContext) => void; - - /** - * Enter a parse tree produced by the `UnaryMinusExpression` - * labeled alternative in `BlazeExpressionParser.expression`. - * @param ctx the parse tree - */ - enterUnaryMinusExpression?: (ctx: UnaryMinusExpressionContext) => void; - /** - * Exit a parse tree produced by the `UnaryMinusExpression` - * labeled alternative in `BlazeExpressionParser.expression`. - * @param ctx the parse tree - */ - exitUnaryMinusExpression?: (ctx: UnaryMinusExpressionContext) => void; - - /** - * Enter a parse tree produced by the `UnaryPlusExpression` - * labeled alternative in `BlazeExpressionParser.expression`. - * @param ctx the parse tree - */ - enterUnaryPlusExpression?: (ctx: UnaryPlusExpressionContext) => void; - /** - * Exit a parse tree produced by the `UnaryPlusExpression` - * labeled alternative in `BlazeExpressionParser.expression`. - * @param ctx the parse tree - */ - exitUnaryPlusExpression?: (ctx: UnaryPlusExpressionContext) => void; - - /** - * Enter a parse tree produced by the `MultiplicativeExpression` - * labeled alternative in `BlazeExpressionParser.expression`. - * @param ctx the parse tree - */ - enterMultiplicativeExpression?: (ctx: MultiplicativeExpressionContext) => void; - /** - * Exit a parse tree produced by the `MultiplicativeExpression` - * labeled alternative in `BlazeExpressionParser.expression`. - * @param ctx the parse tree - */ - exitMultiplicativeExpression?: (ctx: MultiplicativeExpressionContext) => void; - - /** - * Enter a parse tree produced by the `AdditiveExpression` - * labeled alternative in `BlazeExpressionParser.expression`. - * @param ctx the parse tree - */ - enterAdditiveExpression?: (ctx: AdditiveExpressionContext) => void; - /** - * Exit a parse tree produced by the `AdditiveExpression` - * labeled alternative in `BlazeExpressionParser.expression`. - * @param ctx the parse tree - */ - exitAdditiveExpression?: (ctx: AdditiveExpressionContext) => void; - /** * Enter a parse tree produced by the `NamedInvocation` * labeled alternative in `BlazeExpressionParser.functionInvocation`. @@ -397,6 +304,110 @@ export interface BlazeExpressionParserListener extends ParseTreeListener { */ exitPathPredicate?: (ctx: PathPredicateContext) => void; + /** + * Enter a parse tree produced by the `GroupedExpression` + * labeled alternative in `BlazeExpressionParser.expression`. + * @param ctx the parse tree + */ + enterGroupedExpression?: (ctx: GroupedExpressionContext) => void; + /** + * Exit a parse tree produced by the `GroupedExpression` + * labeled alternative in `BlazeExpressionParser.expression`. + * @param ctx the parse tree + */ + exitGroupedExpression?: (ctx: GroupedExpressionContext) => void; + + /** + * Enter a parse tree produced by the `LiteralExpression` + * labeled alternative in `BlazeExpressionParser.expression`. + * @param ctx the parse tree + */ + enterLiteralExpression?: (ctx: LiteralExpressionContext) => void; + /** + * Exit a parse tree produced by the `LiteralExpression` + * labeled alternative in `BlazeExpressionParser.expression`. + * @param ctx the parse tree + */ + exitLiteralExpression?: (ctx: LiteralExpressionContext) => void; + + /** + * Enter a parse tree produced by the `PathExpression` + * labeled alternative in `BlazeExpressionParser.expression`. + * @param ctx the parse tree + */ + enterPathExpression?: (ctx: PathExpressionContext) => void; + /** + * Exit a parse tree produced by the `PathExpression` + * labeled alternative in `BlazeExpressionParser.expression`. + * @param ctx the parse tree + */ + exitPathExpression?: (ctx: PathExpressionContext) => void; + + /** + * Enter a parse tree produced by the `FunctionExpression` + * labeled alternative in `BlazeExpressionParser.expression`. + * @param ctx the parse tree + */ + enterFunctionExpression?: (ctx: FunctionExpressionContext) => void; + /** + * Exit a parse tree produced by the `FunctionExpression` + * labeled alternative in `BlazeExpressionParser.expression`. + * @param ctx the parse tree + */ + exitFunctionExpression?: (ctx: FunctionExpressionContext) => void; + + /** + * Enter a parse tree produced by the `UnaryMinusExpression` + * labeled alternative in `BlazeExpressionParser.expression`. + * @param ctx the parse tree + */ + enterUnaryMinusExpression?: (ctx: UnaryMinusExpressionContext) => void; + /** + * Exit a parse tree produced by the `UnaryMinusExpression` + * labeled alternative in `BlazeExpressionParser.expression`. + * @param ctx the parse tree + */ + exitUnaryMinusExpression?: (ctx: UnaryMinusExpressionContext) => void; + + /** + * Enter a parse tree produced by the `UnaryPlusExpression` + * labeled alternative in `BlazeExpressionParser.expression`. + * @param ctx the parse tree + */ + enterUnaryPlusExpression?: (ctx: UnaryPlusExpressionContext) => void; + /** + * Exit a parse tree produced by the `UnaryPlusExpression` + * labeled alternative in `BlazeExpressionParser.expression`. + * @param ctx the parse tree + */ + exitUnaryPlusExpression?: (ctx: UnaryPlusExpressionContext) => void; + + /** + * Enter a parse tree produced by the `MultiplicativeExpression` + * labeled alternative in `BlazeExpressionParser.expression`. + * @param ctx the parse tree + */ + enterMultiplicativeExpression?: (ctx: MultiplicativeExpressionContext) => void; + /** + * Exit a parse tree produced by the `MultiplicativeExpression` + * labeled alternative in `BlazeExpressionParser.expression`. + * @param ctx the parse tree + */ + exitMultiplicativeExpression?: (ctx: MultiplicativeExpressionContext) => void; + + /** + * Enter a parse tree produced by the `AdditiveExpression` + * labeled alternative in `BlazeExpressionParser.expression`. + * @param ctx the parse tree + */ + enterAdditiveExpression?: (ctx: AdditiveExpressionContext) => void; + /** + * Exit a parse tree produced by the `AdditiveExpression` + * labeled alternative in `BlazeExpressionParser.expression`. + * @param ctx the parse tree + */ + exitAdditiveExpression?: (ctx: AdditiveExpressionContext) => void; + /** * Enter a parse tree produced by `BlazeExpressionParser.parsePredicate`. * @param ctx the parse tree @@ -441,6 +452,17 @@ export interface BlazeExpressionParserListener extends ParseTreeListener { */ exitParseTemplate?: (ctx: ParseTemplateContext) => void; + /** + * Enter a parse tree produced by `BlazeExpressionParser.parseQuery`. + * @param ctx the parse tree + */ + enterParseQuery?: (ctx: ParseQueryContext) => void; + /** + * Exit a parse tree produced by `BlazeExpressionParser.parseQuery`. + * @param ctx the parse tree + */ + exitParseQuery?: (ctx: ParseQueryContext) => void; + /** * Enter a parse tree produced by `BlazeExpressionParser.template`. * @param ctx the parse tree @@ -485,6 +507,116 @@ export interface BlazeExpressionParserListener extends ParseTreeListener { */ exitPredicateOrExpression?: (ctx: PredicateOrExpressionContext) => void; + /** + * Enter a parse tree produced by `BlazeExpressionParser.query`. + * @param ctx the parse tree + */ + enterQuery?: (ctx: QueryContext) => void; + /** + * Exit a parse tree produced by `BlazeExpressionParser.query`. + * @param ctx the parse tree + */ + exitQuery?: (ctx: QueryContext) => void; + + /** + * Enter a parse tree produced by `BlazeExpressionParser.selectClause`. + * @param ctx the parse tree + */ + enterSelectClause?: (ctx: SelectClauseContext) => void; + /** + * Exit a parse tree produced by `BlazeExpressionParser.selectClause`. + * @param ctx the parse tree + */ + exitSelectClause?: (ctx: SelectClauseContext) => void; + + /** + * Enter a parse tree produced by `BlazeExpressionParser.fromClause`. + * @param ctx the parse tree + */ + enterFromClause?: (ctx: FromClauseContext) => void; + /** + * Exit a parse tree produced by `BlazeExpressionParser.fromClause`. + * @param ctx the parse tree + */ + exitFromClause?: (ctx: FromClauseContext) => void; + + /** + * Enter a parse tree produced by `BlazeExpressionParser.whereClause`. + * @param ctx the parse tree + */ + enterWhereClause?: (ctx: WhereClauseContext) => void; + /** + * Exit a parse tree produced by `BlazeExpressionParser.whereClause`. + * @param ctx the parse tree + */ + exitWhereClause?: (ctx: WhereClauseContext) => void; + + /** + * Enter a parse tree produced by `BlazeExpressionParser.fromItem`. + * @param ctx the parse tree + */ + enterFromItem?: (ctx: FromItemContext) => void; + /** + * Exit a parse tree produced by `BlazeExpressionParser.fromItem`. + * @param ctx the parse tree + */ + exitFromItem?: (ctx: FromItemContext) => void; + + /** + * Enter a parse tree produced by `BlazeExpressionParser.fromRoot`. + * @param ctx the parse tree + */ + enterFromRoot?: (ctx: FromRootContext) => void; + /** + * Exit a parse tree produced by `BlazeExpressionParser.fromRoot`. + * @param ctx the parse tree + */ + exitFromRoot?: (ctx: FromRootContext) => void; + + /** + * Enter a parse tree produced by `BlazeExpressionParser.join`. + * @param ctx the parse tree + */ + enterJoin?: (ctx: JoinContext) => void; + /** + * Exit a parse tree produced by `BlazeExpressionParser.join`. + * @param ctx the parse tree + */ + exitJoin?: (ctx: JoinContext) => void; + + /** + * Enter a parse tree produced by `BlazeExpressionParser.joinTarget`. + * @param ctx the parse tree + */ + enterJoinTarget?: (ctx: JoinTargetContext) => void; + /** + * Exit a parse tree produced by `BlazeExpressionParser.joinTarget`. + * @param ctx the parse tree + */ + exitJoinTarget?: (ctx: JoinTargetContext) => void; + + /** + * Enter a parse tree produced by `BlazeExpressionParser.domainTypeName`. + * @param ctx the parse tree + */ + enterDomainTypeName?: (ctx: DomainTypeNameContext) => void; + /** + * Exit a parse tree produced by `BlazeExpressionParser.domainTypeName`. + * @param ctx the parse tree + */ + exitDomainTypeName?: (ctx: DomainTypeNameContext) => void; + + /** + * Enter a parse tree produced by `BlazeExpressionParser.variable`. + * @param ctx the parse tree + */ + enterVariable?: (ctx: VariableContext) => void; + /** + * Exit a parse tree produced by `BlazeExpressionParser.variable`. + * @param ctx the parse tree + */ + exitVariable?: (ctx: VariableContext) => void; + /** * Enter a parse tree produced by `BlazeExpressionParser.inList`. * @param ctx the parse tree diff --git a/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionParserVisitor.ts b/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionParserVisitor.ts index 4718c12..e50cfa8 100644 --- a/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionParserVisitor.ts +++ b/editor/monaco/src/main/typescript/blaze-expression-predicate/BlazeExpressionParserVisitor.ts @@ -3,14 +3,6 @@ import { ParseTreeVisitor } from "antlr4ts/tree/ParseTreeVisitor"; -import { GroupedExpressionContext } from "./BlazeExpressionParser"; -import { LiteralExpressionContext } from "./BlazeExpressionParser"; -import { PathExpressionContext } from "./BlazeExpressionParser"; -import { FunctionExpressionContext } from "./BlazeExpressionParser"; -import { UnaryMinusExpressionContext } from "./BlazeExpressionParser"; -import { UnaryPlusExpressionContext } from "./BlazeExpressionParser"; -import { MultiplicativeExpressionContext } from "./BlazeExpressionParser"; -import { AdditiveExpressionContext } from "./BlazeExpressionParser"; import { NamedInvocationContext } from "./BlazeExpressionParser"; import { IndexedFunctionInvocationContext } from "./BlazeExpressionParser"; import { GroupedPredicateContext } from "./BlazeExpressionParser"; @@ -29,14 +21,33 @@ import { InPredicateContext } from "./BlazeExpressionParser"; import { BetweenPredicateContext } from "./BlazeExpressionParser"; import { BooleanFunctionContext } from "./BlazeExpressionParser"; import { PathPredicateContext } from "./BlazeExpressionParser"; +import { GroupedExpressionContext } from "./BlazeExpressionParser"; +import { LiteralExpressionContext } from "./BlazeExpressionParser"; +import { PathExpressionContext } from "./BlazeExpressionParser"; +import { FunctionExpressionContext } from "./BlazeExpressionParser"; +import { UnaryMinusExpressionContext } from "./BlazeExpressionParser"; +import { UnaryPlusExpressionContext } from "./BlazeExpressionParser"; +import { MultiplicativeExpressionContext } from "./BlazeExpressionParser"; +import { AdditiveExpressionContext } from "./BlazeExpressionParser"; import { ParsePredicateContext } from "./BlazeExpressionParser"; import { ParseExpressionContext } from "./BlazeExpressionParser"; import { ParseExpressionOrPredicateContext } from "./BlazeExpressionParser"; import { ParseTemplateContext } from "./BlazeExpressionParser"; +import { ParseQueryContext } from "./BlazeExpressionParser"; import { TemplateContext } from "./BlazeExpressionParser"; import { ExpressionContext } from "./BlazeExpressionParser"; import { PredicateContext } from "./BlazeExpressionParser"; import { PredicateOrExpressionContext } from "./BlazeExpressionParser"; +import { QueryContext } from "./BlazeExpressionParser"; +import { SelectClauseContext } from "./BlazeExpressionParser"; +import { FromClauseContext } from "./BlazeExpressionParser"; +import { WhereClauseContext } from "./BlazeExpressionParser"; +import { FromItemContext } from "./BlazeExpressionParser"; +import { FromRootContext } from "./BlazeExpressionParser"; +import { JoinContext } from "./BlazeExpressionParser"; +import { JoinTargetContext } from "./BlazeExpressionParser"; +import { DomainTypeNameContext } from "./BlazeExpressionParser"; +import { VariableContext } from "./BlazeExpressionParser"; import { InListContext } from "./BlazeExpressionParser"; import { PathContext } from "./BlazeExpressionParser"; import { PathAttributesContext } from "./BlazeExpressionParser"; @@ -62,70 +73,6 @@ import { IdentifierContext } from "./BlazeExpressionParser"; * operations with no return type. */ export interface BlazeExpressionParserVisitor extends ParseTreeVisitor { - /** - * Visit a parse tree produced by the `GroupedExpression` - * labeled alternative in `BlazeExpressionParser.expression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitGroupedExpression?: (ctx: GroupedExpressionContext) => Result; - - /** - * Visit a parse tree produced by the `LiteralExpression` - * labeled alternative in `BlazeExpressionParser.expression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitLiteralExpression?: (ctx: LiteralExpressionContext) => Result; - - /** - * Visit a parse tree produced by the `PathExpression` - * labeled alternative in `BlazeExpressionParser.expression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitPathExpression?: (ctx: PathExpressionContext) => Result; - - /** - * Visit a parse tree produced by the `FunctionExpression` - * labeled alternative in `BlazeExpressionParser.expression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitFunctionExpression?: (ctx: FunctionExpressionContext) => Result; - - /** - * Visit a parse tree produced by the `UnaryMinusExpression` - * labeled alternative in `BlazeExpressionParser.expression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitUnaryMinusExpression?: (ctx: UnaryMinusExpressionContext) => Result; - - /** - * Visit a parse tree produced by the `UnaryPlusExpression` - * labeled alternative in `BlazeExpressionParser.expression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitUnaryPlusExpression?: (ctx: UnaryPlusExpressionContext) => Result; - - /** - * Visit a parse tree produced by the `MultiplicativeExpression` - * labeled alternative in `BlazeExpressionParser.expression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitMultiplicativeExpression?: (ctx: MultiplicativeExpressionContext) => Result; - - /** - * Visit a parse tree produced by the `AdditiveExpression` - * labeled alternative in `BlazeExpressionParser.expression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitAdditiveExpression?: (ctx: AdditiveExpressionContext) => Result; - /** * Visit a parse tree produced by the `NamedInvocation` * labeled alternative in `BlazeExpressionParser.functionInvocation`. @@ -270,6 +217,70 @@ export interface BlazeExpressionParserVisitor extends ParseTreeVisitor Result; + /** + * Visit a parse tree produced by the `GroupedExpression` + * labeled alternative in `BlazeExpressionParser.expression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitGroupedExpression?: (ctx: GroupedExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `LiteralExpression` + * labeled alternative in `BlazeExpressionParser.expression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitLiteralExpression?: (ctx: LiteralExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `PathExpression` + * labeled alternative in `BlazeExpressionParser.expression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitPathExpression?: (ctx: PathExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `FunctionExpression` + * labeled alternative in `BlazeExpressionParser.expression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitFunctionExpression?: (ctx: FunctionExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `UnaryMinusExpression` + * labeled alternative in `BlazeExpressionParser.expression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitUnaryMinusExpression?: (ctx: UnaryMinusExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `UnaryPlusExpression` + * labeled alternative in `BlazeExpressionParser.expression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitUnaryPlusExpression?: (ctx: UnaryPlusExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `MultiplicativeExpression` + * labeled alternative in `BlazeExpressionParser.expression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitMultiplicativeExpression?: (ctx: MultiplicativeExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `AdditiveExpression` + * labeled alternative in `BlazeExpressionParser.expression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitAdditiveExpression?: (ctx: AdditiveExpressionContext) => Result; + /** * Visit a parse tree produced by `BlazeExpressionParser.parsePredicate`. * @param ctx the parse tree @@ -298,6 +309,13 @@ export interface BlazeExpressionParserVisitor extends ParseTreeVisitor Result; + /** + * Visit a parse tree produced by `BlazeExpressionParser.parseQuery`. + * @param ctx the parse tree + * @return the visitor result + */ + visitParseQuery?: (ctx: ParseQueryContext) => Result; + /** * Visit a parse tree produced by `BlazeExpressionParser.template`. * @param ctx the parse tree @@ -326,6 +344,76 @@ export interface BlazeExpressionParserVisitor extends ParseTreeVisitor Result; + /** + * Visit a parse tree produced by `BlazeExpressionParser.query`. + * @param ctx the parse tree + * @return the visitor result + */ + visitQuery?: (ctx: QueryContext) => Result; + + /** + * Visit a parse tree produced by `BlazeExpressionParser.selectClause`. + * @param ctx the parse tree + * @return the visitor result + */ + visitSelectClause?: (ctx: SelectClauseContext) => Result; + + /** + * Visit a parse tree produced by `BlazeExpressionParser.fromClause`. + * @param ctx the parse tree + * @return the visitor result + */ + visitFromClause?: (ctx: FromClauseContext) => Result; + + /** + * Visit a parse tree produced by `BlazeExpressionParser.whereClause`. + * @param ctx the parse tree + * @return the visitor result + */ + visitWhereClause?: (ctx: WhereClauseContext) => Result; + + /** + * Visit a parse tree produced by `BlazeExpressionParser.fromItem`. + * @param ctx the parse tree + * @return the visitor result + */ + visitFromItem?: (ctx: FromItemContext) => Result; + + /** + * Visit a parse tree produced by `BlazeExpressionParser.fromRoot`. + * @param ctx the parse tree + * @return the visitor result + */ + visitFromRoot?: (ctx: FromRootContext) => Result; + + /** + * Visit a parse tree produced by `BlazeExpressionParser.join`. + * @param ctx the parse tree + * @return the visitor result + */ + visitJoin?: (ctx: JoinContext) => Result; + + /** + * Visit a parse tree produced by `BlazeExpressionParser.joinTarget`. + * @param ctx the parse tree + * @return the visitor result + */ + visitJoinTarget?: (ctx: JoinTargetContext) => Result; + + /** + * Visit a parse tree produced by `BlazeExpressionParser.domainTypeName`. + * @param ctx the parse tree + * @return the visitor result + */ + visitDomainTypeName?: (ctx: DomainTypeNameContext) => Result; + + /** + * Visit a parse tree produced by `BlazeExpressionParser.variable`. + * @param ctx the parse tree + * @return the visitor result + */ + visitVariable?: (ctx: VariableContext) => Result; + /** * Visit a parse tree produced by `BlazeExpressionParser.inList`. * @param ctx the parse tree diff --git a/excel/src/main/java/com/blazebit/expression/excel/ExcelExpressionSerializer.java b/excel/src/main/java/com/blazebit/expression/excel/ExcelExpressionSerializer.java index f39071d..d3ed44d 100644 --- a/excel/src/main/java/com/blazebit/expression/excel/ExcelExpressionSerializer.java +++ b/excel/src/main/java/com/blazebit/expression/excel/ExcelExpressionSerializer.java @@ -36,13 +36,16 @@ import com.blazebit.expression.ExpressionPredicate; import com.blazebit.expression.ExpressionSerializer; import com.blazebit.expression.ExpressionService; +import com.blazebit.expression.FromItem; import com.blazebit.expression.FunctionInvocation; import com.blazebit.expression.InPredicate; import com.blazebit.expression.IsEmptyPredicate; import com.blazebit.expression.IsNullPredicate; +import com.blazebit.expression.Join; import com.blazebit.expression.Literal; import com.blazebit.expression.Path; import com.blazebit.expression.Predicate; +import com.blazebit.expression.Query; import java.util.List; import java.util.Map; @@ -498,6 +501,21 @@ public Boolean visit(IsEmptyPredicate e) { throw new UnsupportedOperationException("No support for collections in Excel"); } + @Override + public Boolean visit(Query e) { + throw new UnsupportedOperationException("No support for queries in Excel"); + } + + @Override + public Boolean visit(FromItem e) { + throw new UnsupportedOperationException("No support for queries in Excel"); + } + + @Override + public Boolean visit(Join e) { + throw new UnsupportedOperationException("No support for queries in Excel"); + } + /** * @author Christian Beikov * @since 1.0.0 diff --git a/models/azure/subscription/jersey3/src/main/java/com/blazebit/expression/azure/subscription/AzureQueryConfig.java b/models/azure/subscription/jersey3/src/main/java/com/blazebit/expression/azure/subscription/AzureQueryConfig.java new file mode 100644 index 0000000..398e2aa --- /dev/null +++ b/models/azure/subscription/jersey3/src/main/java/com/blazebit/expression/azure/subscription/AzureQueryConfig.java @@ -0,0 +1,35 @@ +/* + * Copyright 2019 - 2024 Blazebit. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.blazebit.expression.azure.subscription; + +/** + * Configuration properties for the Azure {@link com.blazebit.expression.spi.DataFetcher} instances. + * + * @author Christian Beikov + * @since 1.0.0 + */ +public final class AzureQueryConfig { + + /** + * The property name to use for a lookup in {@link com.blazebit.expression.ExpressionInterpreter.Context#getProperty(String)} + * to acquire the {@link com.blazebit.expression.azure.invoker.ApiClient}. + */ + public static final String API_CLIENT = "apiClient"; + + private AzureQueryConfig() { + } +} diff --git a/models/azure/subscription/jersey3/src/main/java/com/blazebit/expression/azure/subscription/AzureSubscriptionModel.java b/models/azure/subscription/jersey3/src/main/java/com/blazebit/expression/azure/subscription/AzureSubscriptionModel.java index 9b26783..bccb580 100644 --- a/models/azure/subscription/jersey3/src/main/java/com/blazebit/expression/azure/subscription/AzureSubscriptionModel.java +++ b/models/azure/subscription/jersey3/src/main/java/com/blazebit/expression/azure/subscription/AzureSubscriptionModel.java @@ -17,6 +17,7 @@ package com.blazebit.expression.azure.subscription; import java.io.Serializable; +import java.lang.annotation.Annotation; import java.util.Map; import com.blazebit.domain.Domain; @@ -25,8 +26,10 @@ import com.blazebit.domain.boot.model.MetadataDefinitionHolder; import com.blazebit.domain.declarative.DeclarativeDomain; import com.blazebit.domain.declarative.DeclarativeDomainConfiguration; +import com.blazebit.domain.declarative.spi.DeclarativeMetadataProcessor; import com.blazebit.domain.runtime.model.DomainOperator; import com.blazebit.domain.runtime.model.DomainPredicate; +import com.blazebit.domain.spi.ServiceProvider; import com.blazebit.expression.DocumentationMetadataDefinition; import com.blazebit.expression.azure.subscription.model.AvailabilityZoneMappings; import com.blazebit.expression.azure.subscription.model.AvailabilityZonePeers; @@ -137,6 +140,25 @@ public static DeclarativeDomainConfiguration contribute(DeclarativeDomainConfigu addDomainType(SubscriptionPolicies.class, declarativeDomainConfiguration); addDomainType(TenantIdDescription.class, declarativeDomainConfiguration); addDomainType(TenantListResult.class, declarativeDomainConfiguration); + declarativeDomainConfiguration.withMetadataProcessor( new DeclarativeMetadataProcessor<>() { + @Override + public Class getProcessingAnnotation() { + return null; + } + + @Override + public MetadataDefinition process( + Class annotatedClass, + Annotation annotation, + ServiceProvider serviceProvider) { + if (annotatedClass == Subscription.class) { + return new DataFetcherMetadataDefinition( SubscriptionDataFetcher.INSTANCE ); + } else if (annotatedClass == TenantIdDescriptionDataFetcher.class) { + return new DataFetcherMetadataDefinition( TenantIdDescriptionDataFetcher.INSTANCE ); + } + return null; + } + } ); return declarativeDomainConfiguration; } diff --git a/models/azure/subscription/jersey3/src/main/java/com/blazebit/expression/azure/subscription/DataFetcherMetadataDefinition.java b/models/azure/subscription/jersey3/src/main/java/com/blazebit/expression/azure/subscription/DataFetcherMetadataDefinition.java new file mode 100644 index 0000000..5f008ce --- /dev/null +++ b/models/azure/subscription/jersey3/src/main/java/com/blazebit/expression/azure/subscription/DataFetcherMetadataDefinition.java @@ -0,0 +1,49 @@ +/* + * Copyright 2019 - 2024 Blazebit. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.blazebit.expression.azure.subscription; + +import com.blazebit.domain.boot.model.MetadataDefinition; +import com.blazebit.domain.boot.model.MetadataDefinitionHolder; +import com.blazebit.expression.spi.DataFetcher; + +/** + * @author Christian Beikov + * @since 1.0.0 + */ +public class DataFetcherMetadataDefinition implements MetadataDefinition { + + private final DataFetcher dataFetcher; + + /** + * Creates a metadata definition for the given {@link DataFetcher}. + * + * @param dataFetcher The data fetcher + */ + public DataFetcherMetadataDefinition(DataFetcher dataFetcher) { + this.dataFetcher = dataFetcher; + } + + @Override + public Class getJavaType() { + return DataFetcher.class; + } + + @Override + public DataFetcher build(MetadataDefinitionHolder definitionHolder) { + return dataFetcher; + } +} diff --git a/models/azure/subscription/jersey3/src/main/java/com/blazebit/expression/azure/subscription/SubscriptionDataFetcher.java b/models/azure/subscription/jersey3/src/main/java/com/blazebit/expression/azure/subscription/SubscriptionDataFetcher.java new file mode 100644 index 0000000..0801e6a --- /dev/null +++ b/models/azure/subscription/jersey3/src/main/java/com/blazebit/expression/azure/subscription/SubscriptionDataFetcher.java @@ -0,0 +1,47 @@ +/* + * Copyright 2019 - 2024 Blazebit. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.blazebit.expression.azure.subscription; + +import java.io.Serializable; +import java.util.List; + +import com.blazebit.expression.ExpressionInterpreter; +import com.blazebit.expression.azure.invoker.ApiException; +import com.blazebit.expression.azure.subscription.api.SubscriptionsApi; +import com.blazebit.expression.spi.DataFetcher; + +/** + * @author Christian Beikov + * @since 1.0.0 + */ +public class SubscriptionDataFetcher implements DataFetcher, Serializable { + + public static final SubscriptionDataFetcher INSTANCE = new SubscriptionDataFetcher(); + + private SubscriptionDataFetcher() { + } + + @Override + public List fetch(ExpressionInterpreter.Context context) { + try { + return new SubscriptionsApi( context.getProperty( AzureQueryConfig.API_CLIENT ) ) + .subscriptionsList( "2022-12-01" ).getValue(); + } catch (ApiException e) { + throw new RuntimeException( "Could not fetch subscription list", e ); + } + } +} diff --git a/models/azure/subscription/jersey3/src/main/java/com/blazebit/expression/azure/subscription/TenantIdDescriptionDataFetcher.java b/models/azure/subscription/jersey3/src/main/java/com/blazebit/expression/azure/subscription/TenantIdDescriptionDataFetcher.java new file mode 100644 index 0000000..22c2bb0 --- /dev/null +++ b/models/azure/subscription/jersey3/src/main/java/com/blazebit/expression/azure/subscription/TenantIdDescriptionDataFetcher.java @@ -0,0 +1,47 @@ +/* + * Copyright 2019 - 2024 Blazebit. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.blazebit.expression.azure.subscription; + +import java.io.Serializable; +import java.util.List; + +import com.blazebit.expression.ExpressionInterpreter; +import com.blazebit.expression.azure.invoker.ApiException; +import com.blazebit.expression.azure.subscription.api.TenantsApi; +import com.blazebit.expression.spi.DataFetcher; + +/** + * @author Christian Beikov + * @since 1.0.0 + */ +public class TenantIdDescriptionDataFetcher implements DataFetcher, Serializable { + + public static final TenantIdDescriptionDataFetcher INSTANCE = new TenantIdDescriptionDataFetcher(); + + private TenantIdDescriptionDataFetcher() { + } + + @Override + public List fetch(ExpressionInterpreter.Context context) { + try { + return new TenantsApi( context.getProperty( AzureQueryConfig.API_CLIENT ) ) + .tenantsList( "2022-12-01" ).getValue(); + } catch (ApiException e) { + throw new RuntimeException( "Could not fetch tenant list", e ); + } + } +} diff --git a/models/azure/vm/jersey3/src/main/java/com/blazebit/expression/azure/vm/AzureVmModel.java b/models/azure/vm/jersey3/src/main/java/com/blazebit/expression/azure/vm/AzureVmModel.java index ff452c2..5682135 100644 --- a/models/azure/vm/jersey3/src/main/java/com/blazebit/expression/azure/vm/AzureVmModel.java +++ b/models/azure/vm/jersey3/src/main/java/com/blazebit/expression/azure/vm/AzureVmModel.java @@ -17,6 +17,7 @@ package com.blazebit.expression.azure.vm; import java.io.Serializable; +import java.lang.annotation.Annotation; import java.util.Map; import com.blazebit.domain.Domain; @@ -25,9 +26,12 @@ import com.blazebit.domain.boot.model.MetadataDefinitionHolder; import com.blazebit.domain.declarative.DeclarativeDomain; import com.blazebit.domain.declarative.DeclarativeDomainConfiguration; +import com.blazebit.domain.declarative.spi.DeclarativeMetadataProcessor; import com.blazebit.domain.runtime.model.DomainOperator; import com.blazebit.domain.runtime.model.DomainPredicate; +import com.blazebit.domain.spi.ServiceProvider; import com.blazebit.expression.DocumentationMetadataDefinition; +import com.blazebit.expression.azure.subscription.DataFetcherMetadataDefinition; import com.blazebit.expression.azure.vm.model.AdditionalCapabilities; import com.blazebit.expression.azure.vm.model.AdditionalUnattendContent; import com.blazebit.expression.azure.vm.model.ApiEntityReference; @@ -342,6 +346,23 @@ public static DeclarativeDomainConfiguration contribute(DeclarativeDomainConfigu addDomainType(WindowsVMGuestPatchAutomaticByPlatformSettings.class, declarativeDomainConfiguration); addDomainType(WinRMConfiguration.class, declarativeDomainConfiguration); addDomainType(WinRMListener.class, declarativeDomainConfiguration); + declarativeDomainConfiguration.withMetadataProcessor( new DeclarativeMetadataProcessor<>() { + @Override + public Class getProcessingAnnotation() { + return null; + } + + @Override + public MetadataDefinition process( + Class annotatedClass, + Annotation annotation, + ServiceProvider serviceProvider) { + if (annotatedClass == VirtualMachine.class) { + return new DataFetcherMetadataDefinition( VirtualMachineDataFetcher.INSTANCE ); + } + return null; + } + } ); return declarativeDomainConfiguration; } diff --git a/models/azure/vm/jersey3/src/main/java/com/blazebit/expression/azure/vm/VirtualMachineDataFetcher.java b/models/azure/vm/jersey3/src/main/java/com/blazebit/expression/azure/vm/VirtualMachineDataFetcher.java new file mode 100644 index 0000000..f877a87 --- /dev/null +++ b/models/azure/vm/jersey3/src/main/java/com/blazebit/expression/azure/vm/VirtualMachineDataFetcher.java @@ -0,0 +1,68 @@ +/* + * Copyright 2019 - 2024 Blazebit. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.blazebit.expression.azure.vm; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import com.blazebit.expression.ExpressionInterpreter; +import com.blazebit.expression.azure.invoker.ApiClient; +import com.blazebit.expression.azure.invoker.ApiException; +import com.blazebit.expression.azure.subscription.AzureQueryConfig; +import com.blazebit.expression.azure.subscription.api.SubscriptionsApi; +import com.blazebit.expression.azure.subscription.model.Subscription; +import com.blazebit.expression.azure.subscription.model.SubscriptionListResult; +import com.blazebit.expression.azure.vm.api.VirtualMachinesApi; +import com.blazebit.expression.azure.vm.model.VirtualMachine; +import com.blazebit.expression.azure.vm.model.VirtualMachineListResult; +import com.blazebit.expression.spi.DataFetcher; + +/** + * @author Christian Beikov + * @since 1.0.0 + */ +public class VirtualMachineDataFetcher implements DataFetcher, Serializable { + + public static final VirtualMachineDataFetcher INSTANCE = new VirtualMachineDataFetcher(); + + private VirtualMachineDataFetcher() { + } + + @Override + public List fetch(ExpressionInterpreter.Context context) { + try { + ApiClient apiClient = context.getProperty( AzureQueryConfig.API_CLIENT ); + SubscriptionListResult subscriptionListResult = new SubscriptionsApi( apiClient ).subscriptionsList( "2022-12-01" ); + VirtualMachinesApi virtualMachinesApi = new VirtualMachinesApi( apiClient ); + List list = new ArrayList<>(); + for ( Subscription subscription : subscriptionListResult.getValue() ) { + VirtualMachineListResult virtualMachineListResult = virtualMachinesApi.virtualMachinesListAll( + "2024-03-01", + subscription.getSubscriptionId(), + null, + null, + null + ); + list.addAll(virtualMachineListResult.getValue()); + } + return list; + } catch (ApiException e) { + throw new RuntimeException( "Could not fetch virtual machine list", e ); + } + } +} diff --git a/persistence/src/main/java/com/blazebit/expression/persistence/PersistenceExpressionSerializer.java b/persistence/src/main/java/com/blazebit/expression/persistence/PersistenceExpressionSerializer.java index 50b9498..7ab8e9b 100644 --- a/persistence/src/main/java/com/blazebit/expression/persistence/PersistenceExpressionSerializer.java +++ b/persistence/src/main/java/com/blazebit/expression/persistence/PersistenceExpressionSerializer.java @@ -35,13 +35,16 @@ import com.blazebit.expression.ExpressionPredicate; import com.blazebit.expression.ExpressionSerializer; import com.blazebit.expression.ExpressionService; +import com.blazebit.expression.FromItem; import com.blazebit.expression.FunctionInvocation; import com.blazebit.expression.InPredicate; import com.blazebit.expression.IsEmptyPredicate; import com.blazebit.expression.IsNullPredicate; +import com.blazebit.expression.Join; import com.blazebit.expression.Literal; import com.blazebit.expression.Path; import com.blazebit.expression.Predicate; +import com.blazebit.expression.Query; import com.blazebit.expression.spi.DefaultResolvedLiteral; import com.blazebit.persistence.CriteriaBuilder; import com.blazebit.persistence.MultipleSubqueryInitiator; @@ -560,6 +563,21 @@ public Boolean visit(IsEmptyPredicate e) { return inlineIfConstant(e, startIndex, isConstant); } + @Override + public Boolean visit(Query e) { + throw new UnsupportedOperationException("No support for queries yet"); + } + + @Override + public Boolean visit(FromItem e) { + throw new UnsupportedOperationException("No support for queries yet"); + } + + @Override + public Boolean visit(Join e) { + throw new UnsupportedOperationException("No support for queries yet"); + } + /** * @author Christian Beikov * @since 1.0.0