diff --git a/config/alfresco/application-context.xml b/config/alfresco/application-context.xml
index 954291fef2..efe014a708 100644
--- a/config/alfresco/application-context.xml
+++ b/config/alfresco/application-context.xml
@@ -45,7 +45,6 @@
-
diff --git a/config/alfresco/cmis-api-context.xml b/config/alfresco/cmis-api-context.xml
index 7ead43bf1e..0bf97d9155 100644
--- a/config/alfresco/cmis-api-context.xml
+++ b/config/alfresco/cmis-api-context.xml
@@ -22,5 +22,11 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/config/alfresco/cmis-ws-context.xml b/config/alfresco/cmis-ws-context.xml
deleted file mode 100644
index 72c558545b..0000000000
--- a/config/alfresco/cmis-ws-context.xml
+++ /dev/null
@@ -1,218 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- org.alfresco.repo.cmis.ws.RepositoryServicePort
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- org.alfresco.repo.cmis.ws.NavigationServicePort
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- org.alfresco.repo.cmis.ws.ObjectServicePort
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ${server.transaction.mode.readOnly}
- ${server.transaction.mode.default}
-
-
-
-
-
-
- workspace://SpacesStore/app:company_home
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/config/alfresco/model/cmisModel.xml b/config/alfresco/model/cmisModel.xml
index e27ddc83ae..dda60d8698 100644
--- a/config/alfresco/model/cmisModel.xml
+++ b/config/alfresco/model/cmisModel.xml
@@ -35,9 +35,7 @@
true
true
false
-
- true
-
+
Is Major Version
@@ -46,9 +44,7 @@
true
false
false
-
- true
-
+
Is Latest Major Version
@@ -57,9 +53,7 @@
true
false
false
-
- true
-
+
Version Series Is Checked Out
@@ -79,9 +73,7 @@
true
false
false
-
- true
-
+
Version Series Checked Out Id
@@ -90,9 +82,7 @@
true
false
false
-
- true
-
+
Checkin Comment
@@ -101,9 +91,7 @@
true
false
false
-
- true
-
+
Content Stream Allowed
@@ -112,9 +100,7 @@
true
true
false
-
- true
-
+
Content Stream Length
@@ -135,7 +121,7 @@
false
false
- true
+ false
@@ -156,9 +142,7 @@
true
false
false
-
- true
-
+
@@ -189,9 +173,7 @@
true
false
true
-
- false
-
+
diff --git a/config/alfresco/template-services-context.xml b/config/alfresco/template-services-context.xml
index 2a8d26c0b8..7887d0c3cf 100644
--- a/config/alfresco/template-services-context.xml
+++ b/config/alfresco/template-services-context.xml
@@ -117,12 +117,6 @@
-
-
- urlencode
-
-
-
cropContent
diff --git a/source/java/org/alfresco/cmis/dictionary/BaseCMISTest.java b/source/java/org/alfresco/cmis/dictionary/BaseCMISTest.java
index f35afecc16..269e0e1d2e 100644
--- a/source/java/org/alfresco/cmis/dictionary/BaseCMISTest.java
+++ b/source/java/org/alfresco/cmis/dictionary/BaseCMISTest.java
@@ -24,14 +24,23 @@
*/
package org.alfresco.cmis.dictionary;
+import java.util.Date;
+
import javax.transaction.Status;
import javax.transaction.UserTransaction;
import junit.framework.TestCase;
+import org.alfresco.cmis.property.CMISPropertyService;
import org.alfresco.repo.security.authentication.AuthenticationComponent;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
+import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.dictionary.DictionaryService;
+import org.alfresco.service.cmr.model.FileFolderService;
+import org.alfresco.service.cmr.repository.NodeRef;
+import org.alfresco.service.cmr.repository.NodeService;
+import org.alfresco.service.cmr.repository.StoreRef;
+import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.transaction.TransactionService;
import org.alfresco.util.ApplicationContextHelper;
import org.springframework.context.ApplicationContext;
@@ -57,10 +66,29 @@ public abstract class BaseCMISTest extends TestCase
protected UserTransaction testTX;
+ protected CMISPropertyService cmisPropertyService;
+
+ protected NodeService nodeService;
+
+ protected NodeRef rootNodeRef;
+
+ protected FileFolderService fileFolderService;
+
+ protected ServiceRegistry serviceRegistry;
+
+ protected NamespaceService namespaceService;
+
public void setUp() throws Exception
{
+ serviceRegistry = (ServiceRegistry) ctx.getBean("ServiceRegistry");
+
cmisDictionaryService = (CMISDictionaryService) ctx.getBean("CMISDictionaryService");
+ cmisPropertyService = (CMISPropertyService) ctx.getBean("CMISPropertyService");
dictionaryService = (DictionaryService) ctx.getBean("dictionaryService");
+ nodeService = (NodeService) ctx.getBean("nodeService");
+ fileFolderService = (FileFolderService) ctx.getBean("fileFolderService");
+ namespaceService = (NamespaceService) ctx.getBean("namespaceService");
+
transactionService = (TransactionService) ctx.getBean("transactionComponent");
authenticationComponent = (AuthenticationComponent) ctx.getBean("authenticationComponent");
@@ -68,6 +96,10 @@ public abstract class BaseCMISTest extends TestCase
testTX = transactionService.getUserTransaction();
testTX.begin();
this.authenticationComponent.setSystemUserAsCurrentUser();
+
+ String storeName = "CMISTest-" + getName() + "-" + (new Date().getTime());
+ StoreRef storeRef = nodeService.createStore(StoreRef.PROTOCOL_WORKSPACE, storeName);
+ rootNodeRef = nodeService.getRootNode(storeRef);
}
diff --git a/source/java/org/alfresco/cmis/dictionary/CMISChoice.java b/source/java/org/alfresco/cmis/dictionary/CMISChoice.java
index 1f4489498d..a41823c04e 100644
--- a/source/java/org/alfresco/cmis/dictionary/CMISChoice.java
+++ b/source/java/org/alfresco/cmis/dictionary/CMISChoice.java
@@ -24,7 +24,9 @@
*/
package org.alfresco.cmis.dictionary;
+import java.io.Serializable;
import java.util.Collection;
+import java.util.HashSet;
/**
* Choice for property definitions
@@ -34,22 +36,37 @@ import java.util.Collection;
*/
public class CMISChoice
{
+ private String name;
+
+ Serializable value;
+
+ private int index;
+
+ private Collection choices = new HashSet();
+
+ public CMISChoice(String name, Serializable value, int index)
+ {
+ this.name = name;
+ this.value = value;
+ this.index = index;
+ }
+
/**
* Get the name of the choice
* @return
*/
public String getName()
{
- throw new UnsupportedOperationException();
+ return name;
}
/**
* Get the value when chosen
* @return
*/
- public CMISPropertyValue getValue()
+ public Serializable getValue()
{
- throw new UnsupportedOperationException();
+ return value;
}
/**
@@ -58,7 +75,7 @@ public class CMISChoice
*/
public int getIndex()
{
- throw new UnsupportedOperationException();
+ return index;
}
/**
@@ -67,6 +84,50 @@ public class CMISChoice
*/
public Collection getChildren()
{
- throw new UnsupportedOperationException();
+ return choices;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + index;
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ final CMISChoice other = (CMISChoice) obj;
+ if (index != other.index)
+ return false;
+ if (name == null)
+ {
+ if (other.name != null)
+ return false;
+ }
+ else if (!name.equals(other.name))
+ return false;
+ return true;
+ }
+
+ public String toString()
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append("[Choice ");
+ builder.append("name=").append(getName()).append(",");
+ builder.append("index=").append(getIndex()).append(",");
+ builder.append("value=").append(getValue()).append(",");
+ builder.append("children=").append(getChildren());
+ builder.append("]");
+ return builder.toString();
}
}
diff --git a/source/java/org/alfresco/cmis/dictionary/CMISDictionaryService.java b/source/java/org/alfresco/cmis/dictionary/CMISDictionaryService.java
index f858bb9a3f..91736c7a31 100644
--- a/source/java/org/alfresco/cmis/dictionary/CMISDictionaryService.java
+++ b/source/java/org/alfresco/cmis/dictionary/CMISDictionaryService.java
@@ -116,17 +116,25 @@ public class CMISDictionaryService
for (QName typeQName : alfrescoTypeQNames)
{
- if (CMISMapping.isValidCmisType(dictionaryService, typeQName))
+ if (CMISMapping.isValidCmisDocument(dictionaryService, typeQName))
{
- answer.add(CMISMapping.getCmisTypeId(typeQName));
+ answer.add(CMISMapping.getCmisTypeId(CMISScope.DOCUMENT, typeQName));
+ }
+ else if (CMISMapping.isValidCmisFolder(dictionaryService, typeQName))
+ {
+ answer.add(CMISMapping.getCmisTypeId(CMISScope.FOLDER, typeQName));
+ }
+ else if (typeQName.equals(CMISMapping.RELATIONSHIP_QNAME))
+ {
+ answer.add(CMISMapping.getCmisTypeId(CMISScope.RELATIONSHIP, typeQName));
}
}
for (QName associationName : alfrescoAssociationQNames)
{
- if (CMISMapping.isValidCmisAssociation(dictionaryService, associationName))
+ if (CMISMapping.isValidCmisRelationship(dictionaryService, associationName))
{
- answer.add(CMISMapping.getCmisTypeId(associationName));
+ answer.add(CMISMapping.getCmisTypeId(CMISScope.RELATIONSHIP, associationName));
}
}
@@ -142,37 +150,47 @@ public class CMISDictionaryService
*/
public CMISTypeDefinition getType(CMISTypeId typeId)
{
- // Types
- QName typeQName = CMISMapping.getTypeQname(typeId);
- TypeDefinition typeDefinition = dictionaryService.getType(typeQName);
- if (typeDefinition != null)
+ switch (typeId.getScope())
{
- if (CMISMapping.isValidCmisType(dictionaryService, typeQName))
+ case RELATIONSHIP:
+ // Associations
+ AssociationDefinition associationDefinition = dictionaryService.getAssociation(typeId.getQName());
+ if (associationDefinition != null)
{
- return new CMISTypeDefinition(dictionaryService, namespaceService, typeQName);
+ if (CMISMapping.isValidCmisRelationship(dictionaryService, typeId.getQName()))
+ {
+ return new CMISTypeDefinition(dictionaryService, namespaceService, typeId);
+ }
+ else
+ {
+ return null;
+ }
}
else
{
return null;
}
- }
-
- // Associations
- AssociationDefinition associationDefinition = dictionaryService.getAssociation(typeQName);
- if (associationDefinition != null)
- {
- if (CMISMapping.isValidCmisAssociation(dictionaryService, typeQName))
+ case DOCUMENT:
+ case FOLDER:
+ TypeDefinition typeDefinition = dictionaryService.getType(typeId.getQName());
+ if (typeDefinition != null)
{
- return new CMISTypeDefinition(dictionaryService, namespaceService, typeQName);
+ if (CMISMapping.isValidCmisType(dictionaryService, typeId.getQName()))
+ {
+ return new CMISTypeDefinition(dictionaryService, namespaceService, typeId);
+ }
+ else
+ {
+ return null;
+ }
}
else
{
return null;
}
+ default:
+ return null;
}
-
- // Unknown type
- return null;
}
/**
@@ -185,23 +203,33 @@ public class CMISDictionaryService
{
HashMap properties = new HashMap();
- QName typeQName = CMISMapping.getTypeQname(typeId);
- TypeDefinition typeDefinition = dictionaryService.getType(typeQName);
- if (typeDefinition != null)
+ switch (typeId.getScope())
{
- if (CMISMapping.isValidCmisType(dictionaryService, typeQName))
+ case RELATIONSHIP:
+ // Associations - only have CMIS properties
+ AssociationDefinition associationDefinition = dictionaryService.getAssociation(typeId.getQName());
+ if (associationDefinition != null)
{
- for (QName qname : typeDefinition.getProperties().keySet())
+ if (CMISMapping.isValidCmisRelationship(dictionaryService, typeId.getQName()))
{
- if (CMISMapping.getPropertyType(dictionaryService, qname) != null)
- {
- CMISPropertyDefinition cmisPropDefinition = new CMISPropertyDefinition(dictionaryService, namespaceService, qname);
- properties.put(cmisPropDefinition.getPropertyName(), cmisPropDefinition);
- }
+ return getPropertyDefinitions(CMISMapping.RELATIONSHIP_TYPE_ID);
}
- for (AspectDefinition aspect : typeDefinition.getDefaultAspects())
+ break;
+ }
+
+ if (!typeId.getQName().equals(CMISMapping.RELATIONSHIP_QNAME))
+ {
+ break;
+ }
+ // Fall through for CMISMapping.RELATIONSHIP_QNAME
+ case DOCUMENT:
+ case FOLDER:
+ TypeDefinition typeDefinition = dictionaryService.getType(typeId.getQName());
+ if (typeDefinition != null)
+ {
+ if (CMISMapping.isValidCmisDocumentOrFolder(dictionaryService, typeId.getQName()) || typeId.getQName().equals(CMISMapping.RELATIONSHIP_QNAME))
{
- for (QName qname : aspect.getProperties().keySet())
+ for (QName qname : typeDefinition.getProperties().keySet())
{
if (CMISMapping.getPropertyType(dictionaryService, qname) != null)
{
@@ -209,29 +237,34 @@ public class CMISDictionaryService
properties.put(cmisPropDefinition.getPropertyName(), cmisPropDefinition);
}
}
+ for (AspectDefinition aspect : typeDefinition.getDefaultAspects())
+ {
+ for (QName qname : aspect.getProperties().keySet())
+ {
+ if (CMISMapping.getPropertyType(dictionaryService, qname) != null)
+ {
+ CMISPropertyDefinition cmisPropDefinition = new CMISPropertyDefinition(dictionaryService, namespaceService, qname);
+ properties.put(cmisPropDefinition.getPropertyName(), cmisPropDefinition);
+ }
+ }
+ }
+
+ }
+ if (CMISMapping.isValidCmisDocumentOrFolder(dictionaryService, typeId.getQName()))
+ {
+ // Add CMIS properties if required
+ if (!CMISMapping.isCmisCoreType(typeId.getQName()))
+ {
+ properties.putAll(getPropertyDefinitions(typeId.getRootTypeId()));
+ }
}
}
- else
- {
- return properties;
- }
+ break;
+ case UNKNOWN:
+ default:
+ break;
}
- // Associations
- AssociationDefinition associationDefinition = dictionaryService.getAssociation(typeQName);
- if (associationDefinition != null)
- {
- if (CMISMapping.isValidCmisAssociation(dictionaryService, typeQName))
- {
- return getPropertyDefinitions(new CMISTypeId(CMISMapping.RELATIONSHIP_OBJECT_TYPE));
- }
- else
- {
- return properties;
- }
- }
-
- // Unknown type
return properties;
}
diff --git a/source/java/org/alfresco/cmis/dictionary/CMISDictionaryTest.java b/source/java/org/alfresco/cmis/dictionary/CMISDictionaryTest.java
index bdc770429d..9fd3f244c4 100644
--- a/source/java/org/alfresco/cmis/dictionary/CMISDictionaryTest.java
+++ b/source/java/org/alfresco/cmis/dictionary/CMISDictionaryTest.java
@@ -70,6 +70,16 @@ public class CMISDictionaryTest extends BaseCMISTest
System.out.println(proDef);
}
}
+
+
+ cmisDictionaryService.setStrict(false);
+ for (CMISTypeId name : cmisDictionaryService.getAllObjectTypeIds())
+ {
+ for (CMISPropertyDefinition proDef : cmisDictionaryService.getPropertyDefinitions(name).values())
+ {
+ System.out.println(proDef);
+ }
+ }
}
}
diff --git a/source/java/org/alfresco/cmis/dictionary/CMISMapping.java b/source/java/org/alfresco/cmis/dictionary/CMISMapping.java
index 77bd8cc8cb..80a8339fcd 100644
--- a/source/java/org/alfresco/cmis/dictionary/CMISMapping.java
+++ b/source/java/org/alfresco/cmis/dictionary/CMISMapping.java
@@ -88,11 +88,68 @@ public class CMISMapping
*/
public static QName RELATIONSHIP_QNAME = QName.createQName(CMIS_MODEL_URI, RELATIONSHIP_OBJECT_TYPE);
-
+ public static CMISTypeId DOCUMENT_TYPE_ID = new CMISTypeId(CMISScope.DOCUMENT, DOCUMENT_QNAME, DOCUMENT_OBJECT_TYPE);
+
+ public static CMISTypeId FOLDER_TYPE_ID = new CMISTypeId(CMISScope.FOLDER, FOLDER_QNAME, FOLDER_OBJECT_TYPE);
+
+ public static CMISTypeId RELATIONSHIP_TYPE_ID = new CMISTypeId(CMISScope.RELATIONSHIP, RELATIONSHIP_QNAME, RELATIONSHIP_OBJECT_TYPE);
+
+ // CMIS properties
+
+ public static String PROP_OBJECT_ID = "OBJECT_ID";
+
+ public static String PROP_URI = "URI";
+
+ public static String PROP_OBJECT_TYPE_ID = "OBJECT_TYPE_ID";
+
+ public static String PROP_CREATED_BY = "CREATED_BY";
+
+ public static String PROP_CREATION_DATE = "CREATION_DATE";
+
+ public static String PROP_LAST_MODIFIED_BY = "LAST_MODIFIED_BY";
+
+ public static String PROP_LAST_MODIFICATION_DATE = "LAST_MODIFICATION_DATE";
+
+ public static String PROP_CHANGE_TOKEN = "CHANGE_TOKEN";
+
+ public static String PROP_NAME = "NAME";
+
+ public static String PROP_IS_IMMUTABLE = "IS_IMMUTABLE";
+
+ public static String PROP_IS_LATEST_VERSION = "IS_LATEST_VERSION";
+
+ public static String PROP_IS_MAJOR_VERSION = "IS_MAJOR_VERSION";
+
+ public static String PROP_IS_LATEST_MAJOR_VERSION = "IS_LATEST_MAJOR_VERSION";
+
+ public static String PROP_VERSION_SERIES_IS_CHECKED_OUT = "VERSION_SERIES_IS_CHECKED_OUT";
+
+ public static String PROP_VERSION_SERIES_CHECKED_OUT_BY = "VERSION_SERIES_CHECKED_OUT_BY";
+
+ public static String PROP_VERSION_SERIES_CHECKED_OUT_ID = "VERSION_SERIES_CHECKED_OUT_ID";
+
+ public static String PROP_CHECKIN_COMMENT = "CHECKIN_COMMENT";
+
+ public static String PROP_CONTENT_STREAM_ALLOWED = "CONTENT_STREAM_ALLOWED";
+
+ public static String PROP_CONTENT_STREAM_LENGTH = "CONTENT_STREAM_LENGTH";
+
+ public static String PROP_CONTENT_STREAM_MIMETYPE = "CONTENT_STREAM_MIMETYPE";
+
+ public static String PROP_CONTENT_STREAM_FILENAME = "CONTENT_STREAM_FILENAME";
+
+ public static String PROP_CONTENT_STREAM_URI = "CONTENT_STREAM_URI";
+
+ public static String PROP_PARENT = "PARENT";
+
+ public static String PROP_ALLLOWED_CHILD_OBJECT_TYPES = "ALLLOWED_CHILD_OBJECT_TYPES";
+
+ public static String PROP_SOURCE_ID = "SOURCE_ID";
+
+ public static String PROP_TARGET_ID = "TARGET_ID";
// Mappings
// - no entry means no mapping and pass through as is
- private static HashMap cmisTypeIdToTypeQName = new HashMap();
private static HashMap qNameToCmisTypeId = new HashMap();
@@ -101,18 +158,15 @@ public class CMISMapping
private static HashMap alfrescoToCmisTypes = new HashMap();
private static HashMap alfrescoPropertyTypesToCimsPropertyTypes = new HashMap();
+
/**
* Set up mappings
*/
static
{
- cmisTypeIdToTypeQName.put(new CMISTypeId(DOCUMENT_OBJECT_TYPE), DOCUMENT_QNAME);
- cmisTypeIdToTypeQName.put(new CMISTypeId(FOLDER_OBJECT_TYPE), FOLDER_QNAME);
- cmisTypeIdToTypeQName.put(new CMISTypeId(RELATIONSHIP_OBJECT_TYPE), RELATIONSHIP_QNAME);
-
- qNameToCmisTypeId.put(DOCUMENT_QNAME, new CMISTypeId(DOCUMENT_OBJECT_TYPE));
- qNameToCmisTypeId.put(FOLDER_QNAME, new CMISTypeId(FOLDER_OBJECT_TYPE));
- qNameToCmisTypeId.put(RELATIONSHIP_QNAME, new CMISTypeId(RELATIONSHIP_OBJECT_TYPE));
+ qNameToCmisTypeId.put(DOCUMENT_QNAME, DOCUMENT_TYPE_ID);
+ qNameToCmisTypeId.put(FOLDER_QNAME, FOLDER_TYPE_ID);
+ qNameToCmisTypeId.put(RELATIONSHIP_QNAME, RELATIONSHIP_TYPE_ID);
cmisToAlfrecsoTypes.put(DOCUMENT_QNAME, ContentModel.TYPE_CONTENT);
cmisToAlfrecsoTypes.put(FOLDER_QNAME, ContentModel.TYPE_FOLDER);
@@ -120,7 +174,7 @@ public class CMISMapping
alfrescoToCmisTypes.put(ContentModel.TYPE_CONTENT, DOCUMENT_QNAME);
alfrescoToCmisTypes.put(ContentModel.TYPE_FOLDER, FOLDER_QNAME);
-
+
alfrescoPropertyTypesToCimsPropertyTypes.put(DataTypeDefinition.ANY, null);
alfrescoPropertyTypesToCimsPropertyTypes.put(DataTypeDefinition.ASSOC_REF, null);
alfrescoPropertyTypesToCimsPropertyTypes.put(DataTypeDefinition.BOOLEAN, CMISPropertyType.BOOLEAN);
@@ -139,7 +193,6 @@ public class CMISMapping
alfrescoPropertyTypesToCimsPropertyTypes.put(DataTypeDefinition.PATH, null);
alfrescoPropertyTypesToCimsPropertyTypes.put(DataTypeDefinition.QNAME, null);
alfrescoPropertyTypesToCimsPropertyTypes.put(DataTypeDefinition.TEXT, CMISPropertyType.STRING);
-
}
/**
@@ -159,12 +212,29 @@ public class CMISMapping
* @param typeQName
* @return
*/
- public static CMISTypeId getCmisTypeId(QName typeQName)
+ public static CMISTypeId getCmisTypeId(CMISScope scope, QName typeQName)
{
CMISTypeId typeId = qNameToCmisTypeId.get(typeQName);
if (typeId == null)
{
- return new CMISTypeId(typeQName.toString());
+ StringBuilder builder = new StringBuilder(128);
+ switch (scope)
+ {
+ case DOCUMENT:
+ builder.append("D");
+ break;
+ case FOLDER:
+ builder.append("F");
+ break;
+ case RELATIONSHIP:
+ builder.append("R");
+ break;
+ default:
+ builder.append("U");
+ break;
+ }
+ builder.append(typeQName.toString());
+ return new CMISTypeId(scope, typeQName, builder.toString());
}
else
{
@@ -172,25 +242,6 @@ public class CMISMapping
}
}
- /**
- * Given a type id - get the appropriate Alfresco QName
- *
- * @param typeId
- * @return
- */
- public static QName getTypeQname(CMISTypeId typeId)
- {
- QName typeQName = cmisTypeIdToTypeQName.get(typeId);
- if (typeQName != null)
- {
- return typeQName;
- }
- else
- {
- return QName.createQName(typeId.getTypeId());
- }
- }
-
/**
* Get the query name for Alfresco qname
*
@@ -216,14 +267,14 @@ public class CMISMapping
}
String resolvedPrefix = prefixes.iterator().next();
- builder.append(resolvedPrefix);
+ builder.append(resolvedPrefix.toUpperCase());
builder.append("_");
}
- builder.append(qname.getLocalName());
+ builder.append(qname.getLocalName().toUpperCase());
return builder.toString();
}
-
+
/**
* Is this a valid CMIS type The type must be a core CMIS type or extend cm:content or cm:folder The alfresco types
* cm:content and cm:folder are hidden by the CMIS types
@@ -234,22 +285,78 @@ public class CMISMapping
*/
public static boolean isValidCmisType(DictionaryService dictionaryService, QName typeQName)
{
- if (CMISMapping.isCmisCoreType(typeQName))
+ return isValidCmisFolder(dictionaryService, typeQName) || isValidCmisDocument(dictionaryService, typeQName) || isValidCmisRelationship(dictionaryService, typeQName);
+ }
+
+ /**
+ * Is this a valid cmis document or folder type (not a relationship)
+ *
+ * @param dictionaryService
+ * @param typeQName
+ * @return
+ */
+ public static boolean isValidCmisDocumentOrFolder(DictionaryService dictionaryService, QName typeQName)
+ {
+ return isValidCmisFolder(dictionaryService, typeQName) || isValidCmisDocument(dictionaryService, typeQName);
+ }
+
+ /**
+ * Is this a valid CMIS folder type?
+ *
+ * @param dictionaryService
+ * @param typeQName
+ * @return
+ */
+ public static boolean isValidCmisFolder(DictionaryService dictionaryService, QName typeQName)
+ {
+ if (typeQName == null)
+ {
+ return false;
+ }
+ if (typeQName.equals(FOLDER_QNAME))
{
return true;
}
- if (dictionaryService.isSubClass(typeQName, ContentModel.TYPE_CONTENT) || dictionaryService.isSubClass(typeQName, ContentModel.TYPE_FOLDER))
+ if (dictionaryService.isSubClass(typeQName, ContentModel.TYPE_FOLDER))
+ {
+ if (typeQName.equals(ContentModel.TYPE_FOLDER))
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Is this a valid CMIS document type?
+ *
+ * @param dictionaryService
+ * @param typeQName
+ * @return
+ */
+ public static boolean isValidCmisDocument(DictionaryService dictionaryService, QName typeQName)
+ {
+ if (typeQName == null)
+ {
+ return false;
+ }
+ if (typeQName.equals(DOCUMENT_QNAME))
+ {
+ return true;
+ }
+
+ if (dictionaryService.isSubClass(typeQName, ContentModel.TYPE_CONTENT))
{
if (typeQName.equals(ContentModel.TYPE_CONTENT))
{
return false;
}
- else if (typeQName.equals(ContentModel.TYPE_FOLDER))
- {
- return false;
- }
-
else
{
return true;
@@ -267,8 +374,16 @@ public class CMISMapping
* @param associationQName
* @return
*/
- public static boolean isValidCmisAssociation(DictionaryService dictionaryService, QName associationQName)
+ public static boolean isValidCmisRelationship(DictionaryService dictionaryService, QName associationQName)
{
+ if (associationQName == null)
+ {
+ return false;
+ }
+ if (associationQName.equals(RELATIONSHIP_QNAME))
+ {
+ return true;
+ }
AssociationDefinition associationDefinition = dictionaryService.getAssociation(associationQName);
if (associationDefinition == null)
{
@@ -278,11 +393,11 @@ public class CMISMapping
{
return false;
}
- if (!isValidCmisType(dictionaryService, getCmisType(associationDefinition.getSourceClass().getName())))
+ if (!isValidCmisDocumentOrFolder(dictionaryService, getCmisType(associationDefinition.getSourceClass().getName())))
{
return false;
}
- if (!isValidCmisType(dictionaryService, getCmisType(associationDefinition.getTargetClass().getName())))
+ if (!isValidCmisDocumentOrFolder(dictionaryService, getCmisType(associationDefinition.getTargetClass().getName())))
{
return false;
}
@@ -307,67 +422,159 @@ public class CMISMapping
}
/**
- * Get the root CMIS object (in the alfresco model) for any type.
+ * Get the CMIS property name from the property QName.
*
- * @param dictionaryService
- * @param typeQName
+ * @param namespaceService
+ * @param propertyQName
* @return
*/
- public static QName getCmisRootType(DictionaryService dictionaryService, QName typeQName)
- {
- if (isCmisCoreType(typeQName))
- {
- return typeQName;
- }
- if (dictionaryService.isSubClass(typeQName, ContentModel.TYPE_CONTENT))
- {
- return DOCUMENT_QNAME;
- }
- if (dictionaryService.isSubClass(typeQName, ContentModel.TYPE_FOLDER))
- {
- return FOLDER_QNAME;
- }
- if (isValidCmisAssociation(dictionaryService, typeQName))
- {
- return RELATIONSHIP_QNAME;
- }
- throw new UnsupportedOperationException();
-
- }
-
public static String getCmisPropertyName(NamespaceService namespaceService, QName propertyQName)
{
return buildPrefixEncodedString(namespaceService, propertyQName);
}
-
+
+ /**
+ * Get the CMIS property type for a property
+ *
+ * @param dictionaryService
+ * @param propertyQName
+ * @return
+ */
public static CMISPropertyType getPropertyType(DictionaryService dictionaryService, QName propertyQName)
{
PropertyDefinition propertyDefinition = dictionaryService.getProperty(propertyQName);
DataTypeDefinition dataTypeDefinition = propertyDefinition.getDataType();
QName dQName = dataTypeDefinition.getName();
- if(propertyQName.getNamespaceURI().equals(CMIS_MODEL_URI) && dQName.equals(DataTypeDefinition.QNAME))
+ if (propertyQName.getNamespaceURI().equals(CMIS_MODEL_URI) && dQName.equals(DataTypeDefinition.QNAME))
{
return CMISPropertyType.TYPE_ID;
}
return alfrescoPropertyTypesToCimsPropertyTypes.get(dQName);
-
+
}
-
+
+ /**
+ * Lookup a CMIS property name and get the Alfresco property QName
+ *
+ * @param dictionaryService
+ * @param namespaceService
+ * @param cmisPropertyName
+ * @return
+ */
public static QName getPropertyQName(DictionaryService dictionaryService, NamespaceService namespaceService, String cmisPropertyName)
{
// Try the cmis model first - it it matches we are done
QName cmisPropertyQName = QName.createQName(CMIS_MODEL_URI, cmisPropertyName);
- if(dictionaryService.getProperty(cmisPropertyQName) != null)
+ if (dictionaryService.getProperty(cmisPropertyQName) != null)
{
return cmisPropertyQName;
}
-
+
+ // Find prefix and property name - in upper case
+
int split = cmisPropertyName.indexOf('_');
String prefix = cmisPropertyName.substring(0, split);
- String localName = cmisPropertyName.substring(split+1);
-
- QName qname = QName.createQName(prefix, localName, namespaceService);
- return qname;
+ String localName = cmisPropertyName.substring(split + 1);
+
+ // Try lower case version first.
+
+ QName propertyQName = QName.createQName(prefix.toLowerCase(), localName.toLowerCase(), namespaceService);
+ if (dictionaryService.getProperty(propertyQName) != null)
+ {
+ return propertyQName;
+ }
+
+ // Full case insensitive hunt
+
+ for (String test : namespaceService.getPrefixes())
+ {
+ if (test.equalsIgnoreCase(prefix))
+ {
+ prefix = test;
+ break;
+ }
+ }
+ String uri = namespaceService.getNamespaceURI(prefix);
+
+ for (QName qname : dictionaryService.getAllProperties(null))
+ {
+ if (qname.getNamespaceURI().equals(uri))
+ {
+ if (qname.getLocalName().equalsIgnoreCase(localName))
+ {
+ return qname;
+ }
+ }
+ }
+
+ return null;
+
+ }
+
+ /**
+ * @param tableName
+ * @return
+ */
+ public static QName getAlfrescoClassQNameFromCmisTableName(DictionaryService dictionaryService, NamespaceService namespaceService, String tableName)
+ {
+ if (tableName.equals(DOCUMENT_TYPE_ID.getTypeId()))
+ {
+ return ContentModel.TYPE_CONTENT;
+ }
+ else if (tableName.equals(FOLDER_TYPE_ID.getTypeId()))
+ {
+ return ContentModel.TYPE_FOLDER;
+ }
+
+ // Find prefix and property name - in upper case
+
+ int split = tableName.indexOf('_');
+ String prefix = tableName.substring(0, split);
+ String localName = tableName.substring(split + 1);
+
+ // Try lower case version first.
+
+ QName classQName = QName.createQName(prefix.toLowerCase(), localName.toLowerCase(), namespaceService);
+ if (dictionaryService.getClass(classQName) != null)
+ {
+ return classQName;
+ }
+
+ // Full case insensitive hunt
+
+ for (String test : namespaceService.getPrefixes())
+ {
+ if (test.equalsIgnoreCase(prefix))
+ {
+ prefix = test;
+ break;
+ }
+ }
+ String uri = namespaceService.getNamespaceURI(prefix);
+
+ for (QName qname : dictionaryService.getAllTypes())
+ {
+ if (qname.getNamespaceURI().equals(uri))
+ {
+ if (qname.getLocalName().equalsIgnoreCase(localName))
+ {
+ return qname;
+ }
+ }
+ }
+ for (QName qname : dictionaryService.getAllAspects())
+ {
+ if (qname.getNamespaceURI().equals(uri))
+ {
+ if (qname.getLocalName().equalsIgnoreCase(localName))
+ {
+ return qname;
+ }
+ }
+ }
+
+ return null;
+
}
}
diff --git a/source/java/org/alfresco/cmis/dictionary/CMISPropertyDefinition.java b/source/java/org/alfresco/cmis/dictionary/CMISPropertyDefinition.java
index bc0fa9dff0..16a34902d6 100644
--- a/source/java/org/alfresco/cmis/dictionary/CMISPropertyDefinition.java
+++ b/source/java/org/alfresco/cmis/dictionary/CMISPropertyDefinition.java
@@ -28,6 +28,8 @@ import java.util.Collection;
import java.util.HashSet;
import org.alfresco.repo.dictionary.IndexTokenisationMode;
+import org.alfresco.repo.dictionary.constraint.ListOfValuesConstraint;
+import org.alfresco.repo.dictionary.constraint.StringLengthConstraint;
import org.alfresco.repo.search.impl.lucene.analysis.DateTimeAnalyser;
import org.alfresco.repo.search.impl.lucene.analysis.DoubleAnalyser;
import org.alfresco.repo.search.impl.lucene.analysis.FloatAnalyser;
@@ -35,6 +37,8 @@ import org.alfresco.repo.search.impl.lucene.analysis.IntegerAnalyser;
import org.alfresco.repo.search.impl.lucene.analysis.LongAnalyser;
import org.alfresco.repo.search.impl.lucene.analysis.PathAnalyser;
import org.alfresco.repo.search.impl.lucene.analysis.VerbatimAnalyser;
+import org.alfresco.service.cmr.dictionary.Constraint;
+import org.alfresco.service.cmr.dictionary.ConstraintDefinition;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
import org.alfresco.service.namespace.NamespaceService;
@@ -102,35 +106,61 @@ public class CMISPropertyDefinition
description = propDef.getDescription();
propertyType = CMISMapping.getPropertyType(dictionaryService, propertyQName);
cardinality = propDef.isMultiValued() ? CMISCardinality.MULTI_VALUED : CMISCardinality.SINGLE_VALUED;
+ for (ConstraintDefinition constraintDef : propDef.getConstraints())
+ {
+ Constraint constraint = constraintDef.getConstraint();
+ if (constraint instanceof ListOfValuesConstraint)
+ {
+ int position = 0;
+ ListOfValuesConstraint lovc = (ListOfValuesConstraint) constraint;
+ for (String allowed : lovc.getAllowedValues())
+ {
+ CMISChoice choice = new CMISChoice(allowed, allowed, position++);
+ choices.add(choice);
+ }
+ }
+ if (constraint instanceof StringLengthConstraint)
+ {
+ StringLengthConstraint slc = (StringLengthConstraint) constraint;
+ maximumLength = slc.getMaxLength();
+ }
+ }
required = propDef.isMandatory();
defaultValue = propDef.getDefaultValue();
updatability = propDef.isProtected() ? CMISUpdatability.READ_ONLY : CMISUpdatability.READ_AND_WRITE;
queryable = propDef.isIndexed();
- IndexTokenisationMode indexTokenisationMode = IndexTokenisationMode.TRUE;
- if(propDef.getIndexTokenisationMode() != null)
+ if (queryable)
{
- indexTokenisationMode = propDef.getIndexTokenisationMode();
- }
- switch (indexTokenisationMode)
- {
- case BOTH:
- case FALSE:
- orderable = true;
- break;
- case TRUE:
- default:
- String analyserClassName = propDef.getDataType().getAnalyserClassName();
- if (analyserClassName.equals(DateTimeAnalyser.class.getCanonicalName())
- || analyserClassName.equals(DoubleAnalyser.class.getCanonicalName()) || analyserClassName.equals(FloatAnalyser.class.getCanonicalName())
- || analyserClassName.equals(IntegerAnalyser.class.getCanonicalName()) || analyserClassName.equals(LongAnalyser.class.getCanonicalName())
- || analyserClassName.equals(PathAnalyser.class.getCanonicalName()) || analyserClassName.equals(VerbatimAnalyser.class.getCanonicalName()))
+ IndexTokenisationMode indexTokenisationMode = IndexTokenisationMode.TRUE;
+ if (propDef.getIndexTokenisationMode() != null)
{
+ indexTokenisationMode = propDef.getIndexTokenisationMode();
+ }
+ switch (indexTokenisationMode)
+ {
+ case BOTH:
+ case FALSE:
orderable = true;
+ break;
+ case TRUE:
+ default:
+ String analyserClassName = propDef.getDataType().getAnalyserClassName();
+ if (analyserClassName.equals(DateTimeAnalyser.class.getCanonicalName())
+ || analyserClassName.equals(DoubleAnalyser.class.getCanonicalName()) || analyserClassName.equals(FloatAnalyser.class.getCanonicalName())
+ || analyserClassName.equals(IntegerAnalyser.class.getCanonicalName()) || analyserClassName.equals(LongAnalyser.class.getCanonicalName())
+ || analyserClassName.equals(PathAnalyser.class.getCanonicalName()) || analyserClassName.equals(VerbatimAnalyser.class.getCanonicalName()))
+ {
+ orderable = true;
+ }
+ else
+ {
+ orderable = false;
+ }
}
- else
- {
- orderable = false;
- }
+ }
+ else
+ {
+ orderable = false;
}
}
@@ -138,6 +168,7 @@ public class CMISPropertyDefinition
/**
* Get the property name
+ *
* @return
*/
public String getPropertyName()
@@ -147,6 +178,7 @@ public class CMISPropertyDefinition
/**
* Get the display name
+ *
* @return
*/
public String getDisplayName()
@@ -156,6 +188,7 @@ public class CMISPropertyDefinition
/**
* Get the description
+ *
* @return
*/
public String getDescription()
@@ -165,6 +198,7 @@ public class CMISPropertyDefinition
/**
* Get the property type
+ *
* @return
*/
public CMISPropertyType getPropertyType()
@@ -174,6 +208,7 @@ public class CMISPropertyDefinition
/**
* Get the cardinality
+ *
* @return
*/
public CMISCardinality getCardinality()
@@ -182,8 +217,7 @@ public class CMISPropertyDefinition
}
/**
- * For variable length properties, get the maximum length allowed.
- * Unsupported.
+ * For variable length properties, get the maximum length allowed. Unsupported.
*
* @return
*/
@@ -213,8 +247,8 @@ public class CMISPropertyDefinition
}
/**
- * Get the choices available as values for this property
- * TODO: not implemented yet
+ * Get the choices available as values for this property TODO: not implemented yet
+ *
* @return
*/
public Collection getChioces()
@@ -224,6 +258,7 @@ public class CMISPropertyDefinition
/**
* Is this a choice where a user can enter other values (ie a list with common options)
+ *
* @return
*/
public boolean isOpenChioce()
@@ -233,6 +268,7 @@ public class CMISPropertyDefinition
/**
* Is this property required?
+ *
* @return
*/
public boolean isRequired()
@@ -252,6 +288,7 @@ public class CMISPropertyDefinition
/**
* Is this property updatable?
+ *
* @return
*/
public CMISUpdatability getUpdatability()
@@ -261,6 +298,7 @@ public class CMISPropertyDefinition
/**
* Is this property queryable?
+ *
* @return
*/
public boolean isQueryable()
@@ -270,13 +308,14 @@ public class CMISPropertyDefinition
/**
* Is this property orderable in queries?
+ *
* @return
*/
public boolean isOrderable()
{
return orderable;
}
-
+
public String toString()
{
StringBuilder builder = new StringBuilder();
@@ -299,5 +338,5 @@ public class CMISPropertyDefinition
builder.append("]");
return builder.toString();
}
-
+
}
diff --git a/source/java/org/alfresco/cmis/dictionary/CMISScope.java b/source/java/org/alfresco/cmis/dictionary/CMISScope.java
new file mode 100644
index 0000000000..2eeeab7b06
--- /dev/null
+++ b/source/java/org/alfresco/cmis/dictionary/CMISScope.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.cmis.dictionary;
+
+
+/**
+ * The scope for a CMIS name
+ *
+ * Alfresco has different name spaces for relationships and objects.
+ * This scope resolves any ambiguity.
+ * This ambiguity is resolved in the CMIS type id mapping.
+ *
+ * @author andyh
+ *
+ */
+public enum CMISScope
+{
+ OBJECT, RELATIONSHIP, DOCUMENT, FOLDER, POLICY, UNKNOWN;
+}
diff --git a/source/java/org/alfresco/cmis/dictionary/CMISTypeDefinition.java b/source/java/org/alfresco/cmis/dictionary/CMISTypeDefinition.java
index f970571c27..1b2b6be844 100644
--- a/source/java/org/alfresco/cmis/dictionary/CMISTypeDefinition.java
+++ b/source/java/org/alfresco/cmis/dictionary/CMISTypeDefinition.java
@@ -68,50 +68,68 @@ public class CMISTypeDefinition
private ArrayList allowedTargetTypes = new ArrayList(1);
- public CMISTypeDefinition(DictionaryService dictionaryService, NamespaceService namespaceService, QName typeQName)
+ public CMISTypeDefinition(DictionaryService dictionaryService, NamespaceService namespaceService, CMISTypeId typeId)
{
- isAssociation = (typeQName.equals(CMISMapping.RELATIONSHIP_QNAME) || (dictionaryService.getAssociation(typeQName) != null));
-
- if (isAssociation)
+ switch (typeId.getScope())
{
- AssociationDefinition associationDefinition = dictionaryService.getAssociation(typeQName);
+ case RELATIONSHIP:
+ AssociationDefinition associationDefinition = dictionaryService.getAssociation(typeId.getQName());
if (associationDefinition != null)
{
- objectTypeId = CMISMapping.getCmisTypeId(typeQName);
- objectTypeQueryName = CMISMapping.getQueryName(namespaceService, typeQName);
+ objectTypeId = typeId;
+ objectTypeQueryName = CMISMapping.getQueryName(namespaceService, typeId.getQName());
displayName = associationDefinition.getTitle();
- parentTypeId = CMISMapping.getCmisTypeId(CMISMapping.RELATIONSHIP_QNAME);
+ parentTypeId = CMISMapping.RELATIONSHIP_TYPE_ID;
rootTypeQueryName = CMISMapping.getQueryName(namespaceService, CMISMapping.RELATIONSHIP_QNAME);
description = associationDefinition.getDescription();
queryable = false;
versionable = false;
isAssociation = true;
- allowedSourceTypes.add(CMISMapping.getCmisTypeId(CMISMapping.getCmisType(associationDefinition.getSourceClass().getName())));
- allowedTargetTypes.add(CMISMapping.getCmisTypeId(CMISMapping.getCmisType(associationDefinition.getTargetClass().getName())));
+
+ QName sourceType = CMISMapping.getCmisType(associationDefinition.getSourceClass().getName());
+ if (CMISMapping.isValidCmisDocument(dictionaryService, sourceType))
+ {
+ allowedSourceTypes.add(CMISMapping.getCmisTypeId(CMISScope.DOCUMENT, sourceType));
+ }
+ else if (CMISMapping.isValidCmisFolder(dictionaryService, sourceType))
+ {
+ allowedSourceTypes.add(CMISMapping.getCmisTypeId(CMISScope.FOLDER, sourceType));
+ }
+
+ QName targetType = CMISMapping.getCmisType(associationDefinition.getTargetClass().getName());
+ if (CMISMapping.isValidCmisDocument(dictionaryService, targetType))
+ {
+ allowedTargetTypes.add(CMISMapping.getCmisTypeId(CMISScope.DOCUMENT, targetType));
+ }
+ else if (CMISMapping.isValidCmisFolder(dictionaryService, targetType))
+ {
+ allowedTargetTypes.add(CMISMapping.getCmisTypeId(CMISScope.FOLDER, targetType));
+ }
+
}
else
{
// TODO: Add CMIS Association mapping??
- TypeDefinition typeDefinition = dictionaryService.getType(typeQName);
- objectTypeId = CMISMapping.getCmisTypeId(typeQName);
- objectTypeQueryName = CMISMapping.getQueryName(namespaceService, typeQName);
+ TypeDefinition typeDefinition = dictionaryService.getType(typeId.getQName());
+ objectTypeId = typeId;
+ objectTypeQueryName = CMISMapping.getQueryName(namespaceService, typeId.getQName());
displayName = typeDefinition.getTitle();
- parentTypeId = CMISMapping.getCmisTypeId(CMISMapping.RELATIONSHIP_QNAME);
+ parentTypeId = CMISMapping.RELATIONSHIP_TYPE_ID;
rootTypeQueryName = CMISMapping.getQueryName(namespaceService, CMISMapping.RELATIONSHIP_QNAME);
description = typeDefinition.getDescription();
queryable = false;
versionable = false;
isAssociation = true;
}
- }
- else
- {
- TypeDefinition typeDefinition = dictionaryService.getType(typeQName);
+ break;
+ case DOCUMENT:
+ case FOLDER:
+ TypeDefinition typeDefinition = dictionaryService.getType(typeId.getQName());
if (typeDefinition != null)
{
- objectTypeId = CMISMapping.getCmisTypeId(typeQName);
+ objectTypeId = typeId;
- objectTypeQueryName = CMISMapping.getQueryName(namespaceService, typeQName);
+ objectTypeQueryName = CMISMapping.getQueryName(namespaceService, typeId.getQName());
displayName = typeDefinition.getTitle();
@@ -123,13 +141,17 @@ public class CMISTypeDefinition
}
else
{
- if (CMISMapping.isValidCmisType(dictionaryService, typeQName))
+ if (CMISMapping.isValidCmisDocument(dictionaryService, parentTypeQName))
{
- parentTypeId = CMISMapping.getCmisTypeId(parentTypeQName);
+ parentTypeId = CMISMapping.getCmisTypeId(CMISScope.DOCUMENT, parentTypeQName);
+ }
+ else if (CMISMapping.isValidCmisFolder(dictionaryService, parentTypeQName))
+ {
+ parentTypeId = CMISMapping.getCmisTypeId(CMISScope.FOLDER, parentTypeQName);
}
}
- rootTypeQueryName = CMISMapping.getQueryName(namespaceService, CMISMapping.getCmisRootType(dictionaryService, typeQName));
+ rootTypeQueryName = CMISMapping.getQueryName(namespaceService, typeId.getRootTypeId().getQName());
description = typeDefinition.getDescription();
@@ -147,8 +169,13 @@ public class CMISTypeDefinition
}
}
+ break;
+ case UNKNOWN:
+ default:
+ break;
}
+
}
/**
diff --git a/source/java/org/alfresco/cmis/dictionary/CMISTypeId.java b/source/java/org/alfresco/cmis/dictionary/CMISTypeId.java
index 610a8ceb40..d8928a618e 100644
--- a/source/java/org/alfresco/cmis/dictionary/CMISTypeId.java
+++ b/source/java/org/alfresco/cmis/dictionary/CMISTypeId.java
@@ -24,20 +24,83 @@
*/
package org.alfresco.cmis.dictionary;
-public class CMISTypeId implements CMISPropertyValue
+import java.io.Serializable;
+
+import org.alfresco.service.namespace.QName;
+
+/**
+ * A CMIS property type id
+ *
+ * @author andyh
+ *
+ */
+public class CMISTypeId implements Serializable
{
+ /**
+ *
+ */
+ private static final long serialVersionUID = -4709046883083948302L;
+
private String typeId;
-
- public CMISTypeId(String typeId)
+
+ private CMISScope scope;
+
+ private QName qName;
+
+ public CMISTypeId(CMISScope scope, QName qName, String typeId)
{
+ this.scope = scope;
+ this.qName = qName;
this.typeId = typeId;
}
+ /**
+ * Get the CMIS type id string
+ * @return
+ */
public String getTypeId()
{
return typeId;
}
-
+
+ /**
+ * Get the Alfresco model QName associated with the type
+ * @return
+ */
+ public QName getQName()
+ {
+ return qName;
+ }
+
+ /**
+ * Get the scope for the type (Doc, Folder, Relationship or unknown)
+ * @return
+ */
+ public CMISScope getScope()
+ {
+ return scope;
+ }
+
+ /**
+ * Get the root type id
+ * @return
+ */
+ public CMISTypeId getRootTypeId()
+ {
+ switch (scope)
+ {
+ case DOCUMENT:
+ return CMISMapping.DOCUMENT_TYPE_ID;
+ case FOLDER:
+ return CMISMapping.FOLDER_TYPE_ID;
+ case RELATIONSHIP:
+ return CMISMapping.RELATIONSHIP_TYPE_ID;
+ case UNKNOWN:
+ default:
+ return null;
+ }
+ }
+
public String toString()
{
return getTypeId();
@@ -71,6 +134,5 @@ public class CMISTypeId implements CMISPropertyValue
return false;
return true;
}
-
-
+
}
diff --git a/source/java/org/alfresco/cmis/property/AbstractGenericPropertyAccessor.java b/source/java/org/alfresco/cmis/property/AbstractGenericPropertyAccessor.java
new file mode 100644
index 0000000000..6ce39988a0
--- /dev/null
+++ b/source/java/org/alfresco/cmis/property/AbstractGenericPropertyAccessor.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.cmis.property;
+
+/**
+ * Base class for generic property accessors
+ *
+ * @author andyh
+ *
+ */
+public abstract class AbstractGenericPropertyAccessor extends AbstractPropertyAccessor implements GenericPropertyAccessor
+{
+
+
+}
diff --git a/source/java/org/alfresco/cmis/property/AbstractNamedPropertyAccessor.java b/source/java/org/alfresco/cmis/property/AbstractNamedPropertyAccessor.java
new file mode 100644
index 0000000000..1a8f5b6686
--- /dev/null
+++ b/source/java/org/alfresco/cmis/property/AbstractNamedPropertyAccessor.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.cmis.property;
+
+import org.alfresco.cmis.dictionary.CMISScope;
+
+/**
+ * Base class for named property accessors
+ *
+ * @author andyh
+ *
+ */
+public abstract class AbstractNamedPropertyAccessor extends AbstractPropertyAccessor implements NamedPropertyAccessor
+{
+ private String propertyName;
+
+ private CMISScope scope;
+
+ public String getPropertyName()
+ {
+ return propertyName;
+ }
+
+ public void setPropertyName(String propertyName)
+ {
+ this.propertyName = propertyName;
+ }
+
+ public CMISScope getScope()
+ {
+ return scope;
+ }
+
+ public void setScope(CMISScope scope)
+ {
+ this.scope = scope;
+ }
+}
diff --git a/source/java/org/alfresco/cmis/property/AbstractPropertyAccessor.java b/source/java/org/alfresco/cmis/property/AbstractPropertyAccessor.java
new file mode 100644
index 0000000000..551d47c70e
--- /dev/null
+++ b/source/java/org/alfresco/cmis/property/AbstractPropertyAccessor.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.cmis.property;
+
+import org.alfresco.service.ServiceRegistry;
+
+/**
+ * Base class for all property accessors - provides the service registry
+ *
+ * @author andyh
+ *
+ */
+public abstract class AbstractPropertyAccessor
+{
+ private ServiceRegistry serviceRegistry;
+
+ public void setServiceRegistry(ServiceRegistry serviceRegistry)
+ {
+ this.serviceRegistry = serviceRegistry;
+ }
+
+ public ServiceRegistry getServiceRegistry()
+ {
+ return serviceRegistry;
+ }
+
+}
diff --git a/source/java/org/alfresco/cmis/property/CMISPropertyService.java b/source/java/org/alfresco/cmis/property/CMISPropertyService.java
new file mode 100644
index 0000000000..5f2e8092e7
--- /dev/null
+++ b/source/java/org/alfresco/cmis/property/CMISPropertyService.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.cmis.property;
+
+import java.io.Serializable;
+import java.util.Map;
+
+import org.alfresco.service.cmr.repository.NodeRef;
+
+/**
+ * Public API to get and set CMIS properties
+ *
+ *
+ * @author andyh
+ *
+ */
+public interface CMISPropertyService
+{
+ /**
+ * Set a single property
+ * @param nodeRef
+ * @param propertyName
+ * @param value
+ */
+ public void setProperty(NodeRef nodeRef, String propertyName, Serializable value);
+
+ /**
+ * Set all properties
+ * @param nodeRef
+ * @param values
+ */
+ public void setProperties(NodeRef nodeRef, Map values);
+
+ /**
+ * Get a property value
+ * @param nodeRef
+ * @param propertyName
+ * @return
+ */
+ public Serializable getProperty(NodeRef nodeRef, String propertyName);
+
+ /**
+ * Get all property values for a node
+ * @param nodeRef
+ * @return
+ */
+ public Map getProperties(NodeRef nodeRef);
+
+
+}
diff --git a/source/java/org/alfresco/cmis/property/CMISPropertyServiceImpl.java b/source/java/org/alfresco/cmis/property/CMISPropertyServiceImpl.java
new file mode 100644
index 0000000000..a51c5685e6
--- /dev/null
+++ b/source/java/org/alfresco/cmis/property/CMISPropertyServiceImpl.java
@@ -0,0 +1,333 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.cmis.property;
+
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.alfresco.cmis.dictionary.CMISMapping;
+import org.alfresco.cmis.dictionary.CMISScope;
+import org.alfresco.model.ContentModel;
+import org.alfresco.service.ServiceRegistry;
+import org.alfresco.service.cmr.repository.NodeRef;
+import org.alfresco.service.namespace.QName;
+import org.springframework.beans.factory.InitializingBean;
+
+/**
+ * Mapping between Alfresco and CMIS property types
+ *
+ * @author andyh
+ */
+public class CMISPropertyServiceImpl implements CMISPropertyService, InitializingBean
+{
+ private HashMap namedPropertyAccessors = new HashMap();
+
+ private AbstractGenericPropertyAccessor genericPropertyAccessor;
+
+ private ServiceRegistry serviceRegistry;
+
+ private boolean strict = false;
+
+ public void setServiceRegistry(ServiceRegistry serviceRegistry)
+ {
+ this.serviceRegistry = serviceRegistry;
+ }
+
+ public boolean isStrict()
+ {
+ return strict;
+ }
+
+ public void setStrict(boolean strict)
+ {
+ this.strict = strict;
+ }
+
+ public Map getProperties(NodeRef nodeRef)
+ {
+ // Map
+ QName typeQName = CMISMapping.getCmisType(serviceRegistry.getNodeService().getType(nodeRef));
+ CMISScope scope;
+ if (CMISMapping.isValidCmisDocument(serviceRegistry.getDictionaryService(), typeQName))
+ {
+ scope = CMISScope.DOCUMENT;
+ }
+ else if (CMISMapping.isValidCmisFolder(serviceRegistry.getDictionaryService(), typeQName))
+ {
+ scope = CMISScope.FOLDER;
+ }
+ else
+ {
+ scope = null;
+ }
+
+ if (scope == null)
+ {
+ return Collections. emptyMap();
+ }
+
+ HashMap mapped = new HashMap();
+ if (!strict)
+ {
+ Map unmapped = serviceRegistry.getNodeService().getProperties(nodeRef);
+ for (QName propertyQName : unmapped.keySet())
+ {
+ String cmisPropertyName = CMISMapping.getCmisPropertyName(serviceRegistry.getNamespaceService(), propertyQName);
+ mapped.put(cmisPropertyName, unmapped.get(propertyQName));
+ }
+ }
+ // Add core
+ for (String cmisPropertyName : namedPropertyAccessors.keySet())
+ {
+ NamedPropertyAccessor accessor = namedPropertyAccessors.get(cmisPropertyName);
+ if ((accessor.getScope() == CMISScope.OBJECT) || accessor.getScope().equals(scope))
+ {
+ mapped.put(cmisPropertyName, accessor.getProperty(nodeRef));
+ // Could hide properties here ....
+ }
+ }
+ return mapped;
+ }
+
+ public Serializable getProperty(NodeRef nodeRef, String propertyName)
+ {
+
+ QName typeQName = CMISMapping.getCmisType(serviceRegistry.getNodeService().getType(nodeRef));
+ CMISScope scope;
+ if (CMISMapping.isValidCmisDocument(serviceRegistry.getDictionaryService(), typeQName))
+ {
+ scope = CMISScope.DOCUMENT;
+ }
+ else if (CMISMapping.isValidCmisFolder(serviceRegistry.getDictionaryService(), typeQName))
+ {
+ scope = CMISScope.FOLDER;
+ }
+ else
+ {
+ scope = null;
+ }
+
+ if (scope == null)
+ {
+ return null;
+ }
+
+ NamedPropertyAccessor accessor = namedPropertyAccessors.get(propertyName);
+ if (accessor != null)
+ {
+ if ((accessor.getScope() == CMISScope.OBJECT) || accessor.getScope().equals(scope))
+ {
+ return accessor.getProperty(nodeRef);
+ }
+ else
+ {
+ return null;
+ }
+ }
+ else
+ {
+ if (strict)
+ {
+ return null;
+ }
+ else
+ {
+ return genericPropertyAccessor.getProperty(nodeRef, propertyName);
+ }
+ }
+
+ }
+
+ public void setProperties(NodeRef nodeRef, Map values)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setProperty(NodeRef nodeRef, String propertyName, Serializable value)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void afterPropertiesSet() throws Exception
+ {
+ // Generic Alfresco mappings
+ genericPropertyAccessor = new MappingPropertyAccessor();
+ genericPropertyAccessor.setServiceRegistry(serviceRegistry);
+
+ // CMIS Object
+ addNamedPropertyAccessor(new ObjectIdPropertyAccessor());
+ addNamedPropertyAccessor(getFixedValuePropertyAccessor(CMISMapping.PROP_URI, null, CMISScope.OBJECT));
+ addNamedPropertyAccessor(getObjectTypeIdPropertyAccessor());
+ addNamedPropertyAccessor(getSimplePropertyAccessor(CMISMapping.PROP_CREATED_BY, ContentModel.PROP_CREATOR, CMISScope.OBJECT));
+ addNamedPropertyAccessor(getSimplePropertyAccessor(CMISMapping.PROP_CREATION_DATE, ContentModel.PROP_CREATED, CMISScope.OBJECT));
+ addNamedPropertyAccessor(getSimplePropertyAccessor(CMISMapping.PROP_LAST_MODIFIED_BY, ContentModel.PROP_MODIFIER, CMISScope.OBJECT));
+ addNamedPropertyAccessor(getSimplePropertyAccessor(CMISMapping.PROP_LAST_MODIFICATION_DATE, ContentModel.PROP_MODIFIED, CMISScope.OBJECT));
+ addNamedPropertyAccessor(getFixedValuePropertyAccessor(CMISMapping.PROP_CHANGE_TOKEN, null, CMISScope.OBJECT));
+
+ // CMIS Document and Folder
+ addNamedPropertyAccessor(getSimplePropertyAccessor(CMISMapping.PROP_NAME, ContentModel.PROP_NAME, CMISScope.OBJECT));
+
+ // CMIS Docuement
+ addNamedPropertyAccessor(getIsImmutablePropertyAccessor());
+ addNamedPropertyAccessor(getIsLatestVersionPropertyAccessor());
+ addNamedPropertyAccessor(getIsMajorVersionPropertyAccessor());
+ addNamedPropertyAccessor(getIsLatestMajorVersionPropertyAccessor());
+ addNamedPropertyAccessor(getVersionSeriesIsCheckedOutPropertyAccessor());
+ addNamedPropertyAccessor(getVersionSeriesCheckedOutByPropertyAccessor());
+ addNamedPropertyAccessor(getVersionSeriesCheckedOutIdPropertyAccessor());
+ addNamedPropertyAccessor(getCheckinCommentPropertyAccessor());
+ addNamedPropertyAccessor(getFixedValuePropertyAccessor(CMISMapping.PROP_CONTENT_STREAM_ALLOWED, Boolean.valueOf(true), CMISScope.DOCUMENT));
+ addNamedPropertyAccessor(getContentStreamLengthPropertyAccessor());
+ addNamedPropertyAccessor(getContentStreamMimetypePropertyAccessor());
+ addNamedPropertyAccessor(getSimplePropertyAccessor(CMISMapping.PROP_CONTENT_STREAM_FILENAME, ContentModel.PROP_NAME, CMISScope.DOCUMENT));
+ addNamedPropertyAccessor(getFixedValuePropertyAccessor(CMISMapping.PROP_CONTENT_STREAM_URI, null, CMISScope.DOCUMENT));
+
+ // CMIS Folder
+ addNamedPropertyAccessor(getParentPropertyAccessor());
+ addNamedPropertyAccessor(getFixedValuePropertyAccessor(CMISMapping.PROP_ALLLOWED_CHILD_OBJECT_TYPES, null, CMISScope.FOLDER));
+ }
+
+ public void addNamedPropertyAccessor(NamedPropertyAccessor namedPropertyAccessor)
+ {
+
+ namedPropertyAccessors.put(namedPropertyAccessor.getPropertyName(), namedPropertyAccessor);
+ }
+
+ public NamedPropertyAccessor getSimplePropertyAccessor(String propertyName, QName to, CMISScope scope)
+ {
+ SimplePropertyAccessor accessor = new SimplePropertyAccessor();
+ accessor.setServiceRegistry(serviceRegistry);
+ accessor.setPropertyName(propertyName);
+ accessor.setMapping(to.toString());
+ accessor.setScope(scope);
+ try
+ {
+ accessor.afterPropertiesSet();
+ }
+ catch (Exception e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return accessor;
+ }
+
+ public NamedPropertyAccessor getFixedValuePropertyAccessor(String propertyName, Serializable fixedValue, CMISScope scope)
+ {
+ FixedValuePropertyAccessor accessor = new FixedValuePropertyAccessor();
+ accessor.setServiceRegistry(serviceRegistry);
+ accessor.setPropertyName(propertyName);
+ accessor.setFixedValue(fixedValue);
+ accessor.setScope(scope);
+ return accessor;
+ }
+
+ public NamedPropertyAccessor getObjectTypeIdPropertyAccessor()
+ {
+ ObjectTypeIdPropertyAccessor accessor = new ObjectTypeIdPropertyAccessor();
+ accessor.setServiceRegistry(serviceRegistry);
+ return accessor;
+ }
+
+ public NamedPropertyAccessor getIsImmutablePropertyAccessor()
+ {
+ IsImmutablePropertyAccessor accessor = new IsImmutablePropertyAccessor();
+ accessor.setServiceRegistry(serviceRegistry);
+ return accessor;
+ }
+
+ public NamedPropertyAccessor getIsLatestVersionPropertyAccessor()
+ {
+ IsLatestVersionPropertyAccessor accessor = new IsLatestVersionPropertyAccessor();
+ accessor.setServiceRegistry(serviceRegistry);
+ return accessor;
+ }
+
+ public NamedPropertyAccessor getIsMajorVersionPropertyAccessor()
+ {
+ IsMajorVersionPropertyAccessor accessor = new IsMajorVersionPropertyAccessor();
+ accessor.setServiceRegistry(serviceRegistry);
+ return accessor;
+ }
+
+ public NamedPropertyAccessor getIsLatestMajorVersionPropertyAccessor()
+ {
+ IsLatestMajorVersionPropertyAccessor accessor = new IsLatestMajorVersionPropertyAccessor();
+ accessor.setServiceRegistry(serviceRegistry);
+ return accessor;
+ }
+
+ public NamedPropertyAccessor getVersionSeriesIsCheckedOutPropertyAccessor()
+ {
+ VersionSeriesIsCheckedOutPropertyAccessor accessor = new VersionSeriesIsCheckedOutPropertyAccessor();
+ accessor.setServiceRegistry(serviceRegistry);
+ return accessor;
+ }
+
+ public NamedPropertyAccessor getVersionSeriesCheckedOutByPropertyAccessor()
+ {
+ VersionSeriesCheckedOutByPropertyAccessor accessor = new VersionSeriesCheckedOutByPropertyAccessor();
+ accessor.setServiceRegistry(serviceRegistry);
+ return accessor;
+ }
+
+ public NamedPropertyAccessor getVersionSeriesCheckedOutIdPropertyAccessor()
+ {
+ VersionSeriesCheckedOutIdPropertyAccessor accessor = new VersionSeriesCheckedOutIdPropertyAccessor();
+ accessor.setServiceRegistry(serviceRegistry);
+ return accessor;
+ }
+
+ public NamedPropertyAccessor getCheckinCommentPropertyAccessor()
+ {
+ CheckinCommentPropertyAccessor accessor = new CheckinCommentPropertyAccessor();
+ accessor.setServiceRegistry(serviceRegistry);
+ return accessor;
+ }
+
+ public NamedPropertyAccessor getContentStreamLengthPropertyAccessor()
+ {
+ ContentStreamLengthPropertyAccessor accessor = new ContentStreamLengthPropertyAccessor();
+ accessor.setServiceRegistry(serviceRegistry);
+ return accessor;
+ }
+
+ public NamedPropertyAccessor getContentStreamMimetypePropertyAccessor()
+ {
+ ContentStreamMimetypePropertyAccessor accessor = new ContentStreamMimetypePropertyAccessor();
+ accessor.setServiceRegistry(serviceRegistry);
+ return accessor;
+ }
+
+ public NamedPropertyAccessor getParentPropertyAccessor()
+ {
+ ParentPropertyAccessor accessor = new ParentPropertyAccessor();
+ accessor.setServiceRegistry(serviceRegistry);
+ return accessor;
+ }
+
+}
diff --git a/source/java/org/alfresco/cmis/property/CMISPropertyServiceTest.java b/source/java/org/alfresco/cmis/property/CMISPropertyServiceTest.java
new file mode 100644
index 0000000000..cf36c6d0e0
--- /dev/null
+++ b/source/java/org/alfresco/cmis/property/CMISPropertyServiceTest.java
@@ -0,0 +1,749 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.cmis.property;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
+import org.alfresco.cmis.dictionary.BaseCMISTest;
+import org.alfresco.cmis.dictionary.CMISMapping;
+import org.alfresco.model.ContentModel;
+import org.alfresco.repo.version.VersionModel;
+import org.alfresco.service.cmr.lock.LockType;
+import org.alfresco.service.cmr.repository.ContentData;
+import org.alfresco.service.cmr.repository.ContentWriter;
+import org.alfresco.service.cmr.repository.NodeRef;
+import org.alfresco.service.cmr.version.Version;
+import org.alfresco.service.cmr.version.VersionType;
+
+public class CMISPropertyServiceTest extends BaseCMISTest
+{
+ public void testBasicFolder()
+ {
+ NodeRef folder = fileFolderService.create(rootNodeRef, "BaseFolder", ContentModel.TYPE_FOLDER).getNodeRef();
+ Map properties = cmisPropertyService.getProperties(folder);
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_ID), folder);
+ assertNull(properties.get(CMISMapping.PROP_URI));
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_TYPE_ID), CMISMapping.FOLDER_TYPE_ID);
+ assertEquals(properties.get(CMISMapping.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_CREATION_DATE));
+ assertEquals(properties.get(CMISMapping.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_LAST_MODIFICATION_DATE));
+ assertNull(properties.get(CMISMapping.PROP_CHANGE_TOKEN));
+
+ assertEquals(properties.get(CMISMapping.PROP_NAME), "BaseFolder");
+
+ assertNull(properties.get(CMISMapping.PROP_IS_IMMUTABLE));
+ assertNull(properties.get(CMISMapping.PROP_IS_LATEST_VERSION));
+ assertNull(properties.get(CMISMapping.PROP_IS_MAJOR_VERSION));
+ assertNull(properties.get(CMISMapping.PROP_IS_LATEST_MAJOR_VERSION));
+ assertNull(properties.get(CMISMapping.PROP_VERSION_SERIES_IS_CHECKED_OUT));
+ assertNull(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_BY));
+ assertNull(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_ID));
+ assertNull(properties.get(CMISMapping.PROP_CHECKIN_COMMENT));
+ assertNull(properties.get(CMISMapping.PROP_CONTENT_STREAM_ALLOWED));
+ assertNull(properties.get(CMISMapping.PROP_CONTENT_STREAM_LENGTH));
+ assertNull(properties.get(CMISMapping.PROP_CONTENT_STREAM_MIMETYPE));
+ assertNull(properties.get(CMISMapping.PROP_CONTENT_STREAM_FILENAME));
+ assertNull(properties.get(CMISMapping.PROP_CONTENT_STREAM_URI));
+
+ assertEquals(properties.get(CMISMapping.PROP_PARENT), rootNodeRef);
+ assertNull(properties.get(CMISMapping.PROP_ALLLOWED_CHILD_OBJECT_TYPES));
+
+ }
+
+ public void testBasicDocument()
+ {
+ NodeRef content = fileFolderService.create(rootNodeRef, "BaseContent", ContentModel.TYPE_CONTENT).getNodeRef();
+
+ Map properties = cmisPropertyService.getProperties(content);
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_ID), content);
+ assertNull(properties.get(CMISMapping.PROP_URI));
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_TYPE_ID), CMISMapping.DOCUMENT_TYPE_ID);
+ assertEquals(properties.get(CMISMapping.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_CREATION_DATE));
+ assertEquals(properties.get(CMISMapping.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_LAST_MODIFICATION_DATE));
+ assertNull(properties.get(CMISMapping.PROP_CHANGE_TOKEN));
+
+ assertEquals(properties.get(CMISMapping.PROP_NAME), "BaseContent");
+
+ assertEquals(properties.get(CMISMapping.PROP_IS_IMMUTABLE), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_VERSION), true);
+ assertEquals(properties.get(CMISMapping.PROP_IS_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_IS_CHECKED_OUT), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_BY), null);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_ID), null);
+ assertEquals(properties.get(CMISMapping.PROP_CHECKIN_COMMENT), null);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_ALLOWED), true);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_LENGTH), 0L);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_MIMETYPE), "application/octet-stream");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_FILENAME), "BaseContent");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_URI), null);
+
+ assertNull(properties.get(CMISMapping.PROP_PARENT));
+ assertNull(properties.get(CMISMapping.PROP_ALLLOWED_CHILD_OBJECT_TYPES));
+
+ }
+
+ public void testContentProperties()
+ {
+ NodeRef content = fileFolderService.create(rootNodeRef, "BaseContent", ContentModel.TYPE_CONTENT).getNodeRef();
+
+ Map properties = cmisPropertyService.getProperties(content);
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_ID), content);
+ assertNull(properties.get(CMISMapping.PROP_URI));
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_TYPE_ID), CMISMapping.DOCUMENT_TYPE_ID);
+ assertEquals(properties.get(CMISMapping.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_CREATION_DATE));
+ assertEquals(properties.get(CMISMapping.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_LAST_MODIFICATION_DATE));
+ assertNull(properties.get(CMISMapping.PROP_CHANGE_TOKEN));
+
+ assertEquals(properties.get(CMISMapping.PROP_NAME), "BaseContent");
+
+ assertEquals(properties.get(CMISMapping.PROP_IS_IMMUTABLE), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_VERSION), true);
+ assertEquals(properties.get(CMISMapping.PROP_IS_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_IS_CHECKED_OUT), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_BY), null);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_ID), null);
+ assertEquals(properties.get(CMISMapping.PROP_CHECKIN_COMMENT), null);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_ALLOWED), true);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_LENGTH), 0L);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_MIMETYPE), "application/octet-stream");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_FILENAME), "BaseContent");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_URI), null);
+
+ assertNull(properties.get(CMISMapping.PROP_PARENT));
+ assertNull(properties.get(CMISMapping.PROP_ALLLOWED_CHILD_OBJECT_TYPES));
+
+ ContentData contentData = new ContentData(null, "text/plain", 0L, "UTF-8", Locale.UK);
+
+ nodeService.setProperty(content, ContentModel.PROP_CONTENT, contentData);
+
+ ContentWriter writer = serviceRegistry.getContentService().getWriter(content, ContentModel.PROP_CONTENT, true);
+ writer.setEncoding("UTF-8");
+ writer.putContent("The quick brown fox jumped over the lazy dog and ate the Alfresco Tutorial, in pdf format, along with the following stop words; a an and are"
+ + " as at be but by for if in into is it no not of on or such that the their then there these they this to was will with: "
+ + " and random charcters \u00E0\u00EA\u00EE\u00F0\u00F1\u00F6\u00FB\u00FF");
+ long size = writer.getSize();
+
+ properties = cmisPropertyService.getProperties(content);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_ALLOWED), true);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_LENGTH), size);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_MIMETYPE), "text/plain");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_FILENAME), "BaseContent");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_URI), null);
+ }
+
+ public void testLock()
+ {
+ NodeRef content = fileFolderService.create(rootNodeRef, "BaseContent", ContentModel.TYPE_CONTENT).getNodeRef();
+
+ Map properties = cmisPropertyService.getProperties(content);
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_ID), content);
+ assertNull(properties.get(CMISMapping.PROP_URI));
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_TYPE_ID), CMISMapping.DOCUMENT_TYPE_ID);
+ assertEquals(properties.get(CMISMapping.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_CREATION_DATE));
+ assertEquals(properties.get(CMISMapping.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_LAST_MODIFICATION_DATE));
+ assertNull(properties.get(CMISMapping.PROP_CHANGE_TOKEN));
+
+ assertEquals(properties.get(CMISMapping.PROP_NAME), "BaseContent");
+
+ assertEquals(properties.get(CMISMapping.PROP_IS_IMMUTABLE), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_VERSION), true);
+ assertEquals(properties.get(CMISMapping.PROP_IS_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_IS_CHECKED_OUT), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_BY), null);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_ID), null);
+ assertEquals(properties.get(CMISMapping.PROP_CHECKIN_COMMENT), null);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_ALLOWED), true);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_LENGTH), 0L);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_MIMETYPE), "application/octet-stream");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_FILENAME), "BaseContent");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_URI), null);
+
+ assertNull(properties.get(CMISMapping.PROP_PARENT));
+ assertNull(properties.get(CMISMapping.PROP_ALLLOWED_CHILD_OBJECT_TYPES));
+
+ serviceRegistry.getLockService().lock(content, LockType.READ_ONLY_LOCK);
+
+ properties = cmisPropertyService.getProperties(content);
+ assertEquals(properties.get(CMISMapping.PROP_IS_IMMUTABLE), true);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_VERSION), true);
+ assertEquals(properties.get(CMISMapping.PROP_IS_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_IS_CHECKED_OUT), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_BY), null);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_ID), null);
+ assertEquals(properties.get(CMISMapping.PROP_CHECKIN_COMMENT), null);
+
+ serviceRegistry.getLockService().unlock(content);
+ properties = cmisPropertyService.getProperties(content);
+
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_ID), content);
+ assertNull(properties.get(CMISMapping.PROP_URI));
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_TYPE_ID), CMISMapping.DOCUMENT_TYPE_ID);
+ assertEquals(properties.get(CMISMapping.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_CREATION_DATE));
+ assertEquals(properties.get(CMISMapping.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_LAST_MODIFICATION_DATE));
+ assertNull(properties.get(CMISMapping.PROP_CHANGE_TOKEN));
+
+ assertEquals(properties.get(CMISMapping.PROP_NAME), "BaseContent");
+
+ assertEquals(properties.get(CMISMapping.PROP_IS_IMMUTABLE), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_VERSION), true);
+ assertEquals(properties.get(CMISMapping.PROP_IS_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_IS_CHECKED_OUT), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_BY), null);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_ID), null);
+ assertEquals(properties.get(CMISMapping.PROP_CHECKIN_COMMENT), null);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_ALLOWED), true);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_LENGTH), 0L);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_MIMETYPE), "application/octet-stream");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_FILENAME), "BaseContent");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_URI), null);
+
+ assertNull(properties.get(CMISMapping.PROP_PARENT));
+ assertNull(properties.get(CMISMapping.PROP_ALLLOWED_CHILD_OBJECT_TYPES));
+
+ }
+
+ public void testCheckOut()
+ {
+ NodeRef content = fileFolderService.create(rootNodeRef, "BaseContent", ContentModel.TYPE_CONTENT).getNodeRef();
+
+ Map properties = cmisPropertyService.getProperties(content);
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_ID), content);
+ assertNull(properties.get(CMISMapping.PROP_URI));
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_TYPE_ID), CMISMapping.DOCUMENT_TYPE_ID);
+ assertEquals(properties.get(CMISMapping.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_CREATION_DATE));
+ assertEquals(properties.get(CMISMapping.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_LAST_MODIFICATION_DATE));
+ assertNull(properties.get(CMISMapping.PROP_CHANGE_TOKEN));
+
+ assertEquals(properties.get(CMISMapping.PROP_NAME), "BaseContent");
+
+ assertEquals(properties.get(CMISMapping.PROP_IS_IMMUTABLE), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_VERSION), true);
+ assertEquals(properties.get(CMISMapping.PROP_IS_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_IS_CHECKED_OUT), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_BY), null);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_ID), null);
+ assertEquals(properties.get(CMISMapping.PROP_CHECKIN_COMMENT), null);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_ALLOWED), true);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_LENGTH), 0L);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_MIMETYPE), "application/octet-stream");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_FILENAME), "BaseContent");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_URI), null);
+
+ assertNull(properties.get(CMISMapping.PROP_PARENT));
+ assertNull(properties.get(CMISMapping.PROP_ALLLOWED_CHILD_OBJECT_TYPES));
+
+ NodeRef pwc = serviceRegistry.getCheckOutCheckInService().checkout(content);
+
+ properties = cmisPropertyService.getProperties(content);
+ assertEquals(properties.get(CMISMapping.PROP_IS_IMMUTABLE), true);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_VERSION), true);
+ assertEquals(properties.get(CMISMapping.PROP_IS_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_IS_CHECKED_OUT), true);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_BY), authenticationComponent.getCurrentUserName());
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_ID), pwc);
+ assertEquals(properties.get(CMISMapping.PROP_CHECKIN_COMMENT), null);
+
+ properties = cmisPropertyService.getProperties(pwc);
+
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_ID), pwc);
+ assertNull(properties.get(CMISMapping.PROP_URI));
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_TYPE_ID), CMISMapping.DOCUMENT_TYPE_ID);
+ assertEquals(properties.get(CMISMapping.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_CREATION_DATE));
+ assertEquals(properties.get(CMISMapping.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_LAST_MODIFICATION_DATE));
+ assertNull(properties.get(CMISMapping.PROP_CHANGE_TOKEN));
+
+ assertEquals(properties.get(CMISMapping.PROP_NAME), "BaseContent (Working Copy)");
+
+ assertEquals(properties.get(CMISMapping.PROP_IS_IMMUTABLE), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_IS_CHECKED_OUT), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_BY), null);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_ID), null);
+ assertEquals(properties.get(CMISMapping.PROP_CHECKIN_COMMENT), null);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_ALLOWED), true);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_LENGTH), 0L);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_MIMETYPE), "application/octet-stream");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_FILENAME), "BaseContent (Working Copy)");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_URI), null);
+
+ assertNull(properties.get(CMISMapping.PROP_PARENT));
+ assertNull(properties.get(CMISMapping.PROP_ALLLOWED_CHILD_OBJECT_TYPES));
+
+ serviceRegistry.getCheckOutCheckInService().cancelCheckout(pwc);
+
+ properties = cmisPropertyService.getProperties(content);
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_ID), content);
+ assertNull(properties.get(CMISMapping.PROP_URI));
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_TYPE_ID), CMISMapping.DOCUMENT_TYPE_ID);
+ assertEquals(properties.get(CMISMapping.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_CREATION_DATE));
+ assertEquals(properties.get(CMISMapping.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_LAST_MODIFICATION_DATE));
+ assertNull(properties.get(CMISMapping.PROP_CHANGE_TOKEN));
+
+ assertEquals(properties.get(CMISMapping.PROP_NAME), "BaseContent");
+
+ assertEquals(properties.get(CMISMapping.PROP_IS_IMMUTABLE), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_VERSION), true);
+ assertEquals(properties.get(CMISMapping.PROP_IS_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_IS_CHECKED_OUT), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_BY), null);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_ID), null);
+ assertEquals(properties.get(CMISMapping.PROP_CHECKIN_COMMENT), null);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_ALLOWED), true);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_LENGTH), 0L);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_MIMETYPE), "application/octet-stream");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_FILENAME), "BaseContent");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_URI), null);
+
+ assertNull(properties.get(CMISMapping.PROP_PARENT));
+ assertNull(properties.get(CMISMapping.PROP_ALLLOWED_CHILD_OBJECT_TYPES));
+
+ pwc = serviceRegistry.getCheckOutCheckInService().checkout(content);
+
+ properties = cmisPropertyService.getProperties(content);
+ assertEquals(properties.get(CMISMapping.PROP_IS_IMMUTABLE), true);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_VERSION), true);
+ assertEquals(properties.get(CMISMapping.PROP_IS_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_IS_CHECKED_OUT), true);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_BY), authenticationComponent.getCurrentUserName());
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_ID), pwc);
+ assertEquals(properties.get(CMISMapping.PROP_CHECKIN_COMMENT), null);
+
+ properties = cmisPropertyService.getProperties(pwc);
+
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_ID), pwc);
+ assertNull(properties.get(CMISMapping.PROP_URI));
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_TYPE_ID), CMISMapping.DOCUMENT_TYPE_ID);
+ assertEquals(properties.get(CMISMapping.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_CREATION_DATE));
+ assertEquals(properties.get(CMISMapping.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_LAST_MODIFICATION_DATE));
+ assertNull(properties.get(CMISMapping.PROP_CHANGE_TOKEN));
+
+ assertEquals(properties.get(CMISMapping.PROP_NAME), "BaseContent (Working Copy)");
+
+ assertEquals(properties.get(CMISMapping.PROP_IS_IMMUTABLE), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_IS_CHECKED_OUT), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_BY), null);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_ID), null);
+ assertEquals(properties.get(CMISMapping.PROP_CHECKIN_COMMENT), null);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_ALLOWED), true);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_LENGTH), 0L);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_MIMETYPE), "application/octet-stream");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_FILENAME), "BaseContent (Working Copy)");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_URI), null);
+
+ assertNull(properties.get(CMISMapping.PROP_PARENT));
+ assertNull(properties.get(CMISMapping.PROP_ALLLOWED_CHILD_OBJECT_TYPES));
+
+ serviceRegistry.getCheckOutCheckInService().checkin(pwc, null);
+
+ properties = cmisPropertyService.getProperties(content);
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_ID), content);
+ assertNull(properties.get(CMISMapping.PROP_URI));
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_TYPE_ID), CMISMapping.DOCUMENT_TYPE_ID);
+ assertEquals(properties.get(CMISMapping.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_CREATION_DATE));
+ assertEquals(properties.get(CMISMapping.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_LAST_MODIFICATION_DATE));
+ assertNull(properties.get(CMISMapping.PROP_CHANGE_TOKEN));
+
+ assertEquals(properties.get(CMISMapping.PROP_NAME), "BaseContent");
+
+ assertEquals(properties.get(CMISMapping.PROP_IS_IMMUTABLE), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_VERSION), true);
+ assertEquals(properties.get(CMISMapping.PROP_IS_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_IS_CHECKED_OUT), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_BY), null);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_ID), null);
+ assertEquals(properties.get(CMISMapping.PROP_CHECKIN_COMMENT), null);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_ALLOWED), true);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_LENGTH), 0L);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_MIMETYPE), "application/octet-stream");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_FILENAME), "BaseContent");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_URI), null);
+
+ assertNull(properties.get(CMISMapping.PROP_PARENT));
+ assertNull(properties.get(CMISMapping.PROP_ALLLOWED_CHILD_OBJECT_TYPES));
+
+ }
+
+ public void testVersioning()
+ {
+ NodeRef content = fileFolderService.create(rootNodeRef, "BaseContent", ContentModel.TYPE_CONTENT).getNodeRef();
+
+ Map properties = cmisPropertyService.getProperties(content);
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_ID), content);
+ assertNull(properties.get(CMISMapping.PROP_URI));
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_TYPE_ID), CMISMapping.DOCUMENT_TYPE_ID);
+ assertEquals(properties.get(CMISMapping.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_CREATION_DATE));
+ assertEquals(properties.get(CMISMapping.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_LAST_MODIFICATION_DATE));
+ assertNull(properties.get(CMISMapping.PROP_CHANGE_TOKEN));
+
+ assertEquals(properties.get(CMISMapping.PROP_NAME), "BaseContent");
+
+ assertEquals(properties.get(CMISMapping.PROP_IS_IMMUTABLE), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_VERSION), true);
+ assertEquals(properties.get(CMISMapping.PROP_IS_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_IS_CHECKED_OUT), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_BY), null);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_ID), null);
+ assertEquals(properties.get(CMISMapping.PROP_CHECKIN_COMMENT), null);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_ALLOWED), true);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_LENGTH), 0L);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_MIMETYPE), "application/octet-stream");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_FILENAME), "BaseContent");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_URI), null);
+
+ assertNull(properties.get(CMISMapping.PROP_PARENT));
+ assertNull(properties.get(CMISMapping.PROP_ALLLOWED_CHILD_OBJECT_TYPES));
+
+ nodeService.addAspect(content, ContentModel.ASPECT_VERSIONABLE, null);
+
+ properties = cmisPropertyService.getProperties(content);
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_ID), content);
+ assertNull(properties.get(CMISMapping.PROP_URI));
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_TYPE_ID), CMISMapping.DOCUMENT_TYPE_ID);
+ assertEquals(properties.get(CMISMapping.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_CREATION_DATE));
+ assertEquals(properties.get(CMISMapping.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_LAST_MODIFICATION_DATE));
+ assertNull(properties.get(CMISMapping.PROP_CHANGE_TOKEN));
+
+ assertEquals(properties.get(CMISMapping.PROP_NAME), "BaseContent");
+
+ assertEquals(properties.get(CMISMapping.PROP_IS_IMMUTABLE), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_VERSION), true);
+ assertEquals(properties.get(CMISMapping.PROP_IS_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_IS_CHECKED_OUT), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_BY), null);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_ID), null);
+ assertEquals(properties.get(CMISMapping.PROP_CHECKIN_COMMENT), null);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_ALLOWED), true);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_LENGTH), 0L);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_MIMETYPE), "application/octet-stream");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_FILENAME), "BaseContent");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_URI), null);
+
+ assertNull(properties.get(CMISMapping.PROP_PARENT));
+ assertNull(properties.get(CMISMapping.PROP_ALLLOWED_CHILD_OBJECT_TYPES));
+
+ NodeRef pwc = serviceRegistry.getCheckOutCheckInService().checkout(content);
+
+ properties = cmisPropertyService.getProperties(content);
+ assertEquals(properties.get(CMISMapping.PROP_IS_IMMUTABLE), true);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_VERSION), true);
+ assertEquals(properties.get(CMISMapping.PROP_IS_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_IS_CHECKED_OUT), true);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_BY), authenticationComponent.getCurrentUserName());
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_ID), pwc);
+ assertEquals(properties.get(CMISMapping.PROP_CHECKIN_COMMENT), null);
+
+ properties = cmisPropertyService.getProperties(pwc);
+
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_ID), pwc);
+ assertNull(properties.get(CMISMapping.PROP_URI));
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_TYPE_ID), CMISMapping.DOCUMENT_TYPE_ID);
+ assertEquals(properties.get(CMISMapping.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_CREATION_DATE));
+ assertEquals(properties.get(CMISMapping.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_LAST_MODIFICATION_DATE));
+ assertNull(properties.get(CMISMapping.PROP_CHANGE_TOKEN));
+
+ assertEquals(properties.get(CMISMapping.PROP_NAME), "BaseContent (Working Copy)");
+
+ assertEquals(properties.get(CMISMapping.PROP_IS_IMMUTABLE), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_IS_CHECKED_OUT), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_BY), null);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_ID), null);
+ assertEquals(properties.get(CMISMapping.PROP_CHECKIN_COMMENT), null);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_ALLOWED), true);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_LENGTH), 0L);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_MIMETYPE), "application/octet-stream");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_FILENAME), "BaseContent (Working Copy)");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_URI), null);
+
+ assertNull(properties.get(CMISMapping.PROP_PARENT));
+ assertNull(properties.get(CMISMapping.PROP_ALLLOWED_CHILD_OBJECT_TYPES));
+
+ serviceRegistry.getCheckOutCheckInService().cancelCheckout(pwc);
+
+ properties = cmisPropertyService.getProperties(content);
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_ID), content);
+ assertNull(properties.get(CMISMapping.PROP_URI));
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_TYPE_ID), CMISMapping.DOCUMENT_TYPE_ID);
+ assertEquals(properties.get(CMISMapping.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_CREATION_DATE));
+ assertEquals(properties.get(CMISMapping.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_LAST_MODIFICATION_DATE));
+ assertNull(properties.get(CMISMapping.PROP_CHANGE_TOKEN));
+
+ assertEquals(properties.get(CMISMapping.PROP_NAME), "BaseContent");
+
+ assertEquals(properties.get(CMISMapping.PROP_IS_IMMUTABLE), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_VERSION), true);
+ assertEquals(properties.get(CMISMapping.PROP_IS_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_IS_CHECKED_OUT), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_BY), null);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_ID), null);
+ assertEquals(properties.get(CMISMapping.PROP_CHECKIN_COMMENT), null);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_ALLOWED), true);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_LENGTH), 0L);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_MIMETYPE), "application/octet-stream");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_FILENAME), "BaseContent");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_URI), null);
+
+ assertNull(properties.get(CMISMapping.PROP_PARENT));
+ assertNull(properties.get(CMISMapping.PROP_ALLLOWED_CHILD_OBJECT_TYPES));
+
+ pwc = serviceRegistry.getCheckOutCheckInService().checkout(content);
+
+ properties = cmisPropertyService.getProperties(content);
+ assertEquals(properties.get(CMISMapping.PROP_IS_IMMUTABLE), true);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_VERSION), true);
+ assertEquals(properties.get(CMISMapping.PROP_IS_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_IS_CHECKED_OUT), true);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_BY), authenticationComponent.getCurrentUserName());
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_ID), pwc);
+ assertEquals(properties.get(CMISMapping.PROP_CHECKIN_COMMENT), null);
+
+ properties = cmisPropertyService.getProperties(pwc);
+
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_ID), pwc);
+ assertNull(properties.get(CMISMapping.PROP_URI));
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_TYPE_ID), CMISMapping.DOCUMENT_TYPE_ID);
+ assertEquals(properties.get(CMISMapping.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_CREATION_DATE));
+ assertEquals(properties.get(CMISMapping.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_LAST_MODIFICATION_DATE));
+ assertNull(properties.get(CMISMapping.PROP_CHANGE_TOKEN));
+
+ assertEquals(properties.get(CMISMapping.PROP_NAME), "BaseContent (Working Copy)");
+
+ assertEquals(properties.get(CMISMapping.PROP_IS_IMMUTABLE), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_IS_CHECKED_OUT), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_BY), null);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_ID), null);
+ assertEquals(properties.get(CMISMapping.PROP_CHECKIN_COMMENT), null);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_ALLOWED), true);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_LENGTH), 0L);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_MIMETYPE), "application/octet-stream");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_FILENAME), "BaseContent (Working Copy)");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_URI), null);
+
+ assertNull(properties.get(CMISMapping.PROP_PARENT));
+ assertNull(properties.get(CMISMapping.PROP_ALLLOWED_CHILD_OBJECT_TYPES));
+
+ Map versionProperties = new HashMap();
+ versionProperties.put(Version.PROP_DESCRIPTION, "Meep");
+ versionProperties.put(VersionModel.PROP_VERSION_TYPE, VersionType.MAJOR);
+ serviceRegistry.getCheckOutCheckInService().checkin(pwc, versionProperties);
+
+ properties = cmisPropertyService.getProperties(content);
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_ID), content);
+ assertNull(properties.get(CMISMapping.PROP_URI));
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_TYPE_ID), CMISMapping.DOCUMENT_TYPE_ID);
+ assertEquals(properties.get(CMISMapping.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_CREATION_DATE));
+ assertEquals(properties.get(CMISMapping.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_LAST_MODIFICATION_DATE));
+ assertNull(properties.get(CMISMapping.PROP_CHANGE_TOKEN));
+
+ assertEquals(properties.get(CMISMapping.PROP_NAME), "BaseContent");
+
+ assertEquals(properties.get(CMISMapping.PROP_IS_IMMUTABLE), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_VERSION), true);
+ assertEquals(properties.get(CMISMapping.PROP_IS_MAJOR_VERSION), true);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_MAJOR_VERSION), true);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_IS_CHECKED_OUT), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_BY), null);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_ID), null);
+ assertEquals(properties.get(CMISMapping.PROP_CHECKIN_COMMENT), "Meep");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_ALLOWED), true);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_LENGTH), 0L);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_MIMETYPE), "application/octet-stream");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_FILENAME), "BaseContent");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_URI), null);
+
+ assertNull(properties.get(CMISMapping.PROP_PARENT));
+ assertNull(properties.get(CMISMapping.PROP_ALLLOWED_CHILD_OBJECT_TYPES));
+
+ pwc = serviceRegistry.getCheckOutCheckInService().checkout(content);
+
+ properties = cmisPropertyService.getProperties(content);
+ assertEquals(properties.get(CMISMapping.PROP_IS_IMMUTABLE), true);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_VERSION), true);
+ assertEquals(properties.get(CMISMapping.PROP_IS_MAJOR_VERSION), true);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_MAJOR_VERSION), true);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_IS_CHECKED_OUT), true);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_BY), authenticationComponent.getCurrentUserName());
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_ID), pwc);
+ assertEquals(properties.get(CMISMapping.PROP_CHECKIN_COMMENT), "Meep");
+
+ properties = cmisPropertyService.getProperties(pwc);
+
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_ID), pwc);
+ assertNull(properties.get(CMISMapping.PROP_URI));
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_TYPE_ID), CMISMapping.DOCUMENT_TYPE_ID);
+ assertEquals(properties.get(CMISMapping.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_CREATION_DATE));
+ assertEquals(properties.get(CMISMapping.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_LAST_MODIFICATION_DATE));
+ assertNull(properties.get(CMISMapping.PROP_CHANGE_TOKEN));
+
+ assertEquals(properties.get(CMISMapping.PROP_NAME), "BaseContent (Working Copy)");
+
+ assertEquals(properties.get(CMISMapping.PROP_IS_IMMUTABLE), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_IS_CHECKED_OUT), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_BY), null);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_ID), null);
+ assertEquals(properties.get(CMISMapping.PROP_CHECKIN_COMMENT), null);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_ALLOWED), true);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_LENGTH), 0L);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_MIMETYPE), "application/octet-stream");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_FILENAME), "BaseContent (Working Copy)");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_URI), null);
+
+ assertNull(properties.get(CMISMapping.PROP_PARENT));
+ assertNull(properties.get(CMISMapping.PROP_ALLLOWED_CHILD_OBJECT_TYPES));
+
+ versionProperties = new HashMap();
+ versionProperties.put(Version.PROP_DESCRIPTION, "Woof");
+ versionProperties.put(VersionModel.PROP_VERSION_TYPE, VersionType.MINOR);
+ serviceRegistry.getCheckOutCheckInService().checkin(pwc, versionProperties);
+
+ properties = cmisPropertyService.getProperties(content);
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_ID), content);
+ assertNull(properties.get(CMISMapping.PROP_URI));
+ assertEquals(properties.get(CMISMapping.PROP_OBJECT_TYPE_ID), CMISMapping.DOCUMENT_TYPE_ID);
+ assertEquals(properties.get(CMISMapping.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_CREATION_DATE));
+ assertEquals(properties.get(CMISMapping.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(properties.get(CMISMapping.PROP_LAST_MODIFICATION_DATE));
+ assertNull(properties.get(CMISMapping.PROP_CHANGE_TOKEN));
+
+ assertEquals(properties.get(CMISMapping.PROP_NAME), "BaseContent");
+
+ assertEquals(properties.get(CMISMapping.PROP_IS_IMMUTABLE), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_VERSION), true);
+ assertEquals(properties.get(CMISMapping.PROP_IS_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_IS_LATEST_MAJOR_VERSION), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_IS_CHECKED_OUT), false);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_BY), null);
+ assertEquals(properties.get(CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_ID), null);
+ assertEquals(properties.get(CMISMapping.PROP_CHECKIN_COMMENT), "Woof");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_ALLOWED), true);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_LENGTH), 0L);
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_MIMETYPE), "application/octet-stream");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_FILENAME), "BaseContent");
+ assertEquals(properties.get(CMISMapping.PROP_CONTENT_STREAM_URI), null);
+
+ assertNull(properties.get(CMISMapping.PROP_PARENT));
+ assertNull(properties.get(CMISMapping.PROP_ALLLOWED_CHILD_OBJECT_TYPES));
+ }
+
+ public void testSinglePropertyFolderAccess()
+ {
+ NodeRef folder = fileFolderService.create(rootNodeRef, "BaseFolder", ContentModel.TYPE_FOLDER).getNodeRef();
+ assertEquals(cmisPropertyService.getProperty(folder, CMISMapping.PROP_OBJECT_ID), folder);
+ assertNull(cmisPropertyService.getProperty(folder, CMISMapping.PROP_URI));
+ assertEquals(cmisPropertyService.getProperty(folder, CMISMapping.PROP_OBJECT_TYPE_ID), CMISMapping.FOLDER_TYPE_ID);
+ assertEquals(cmisPropertyService.getProperty(folder, CMISMapping.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(cmisPropertyService.getProperty(folder, CMISMapping.PROP_CREATION_DATE));
+ assertEquals(cmisPropertyService.getProperty(folder, CMISMapping.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
+ assertNotNull(cmisPropertyService.getProperty(folder, CMISMapping.PROP_LAST_MODIFICATION_DATE));
+ assertNull(cmisPropertyService.getProperty(folder, CMISMapping.PROP_CHANGE_TOKEN));
+
+ assertEquals(cmisPropertyService.getProperty(folder, CMISMapping.PROP_NAME), "BaseFolder");
+
+ assertNull(cmisPropertyService.getProperty(folder, CMISMapping.PROP_IS_IMMUTABLE));
+ assertNull(cmisPropertyService.getProperty(folder, CMISMapping.PROP_IS_LATEST_VERSION));
+ assertNull(cmisPropertyService.getProperty(folder, CMISMapping.PROP_IS_MAJOR_VERSION));
+ assertNull(cmisPropertyService.getProperty(folder, CMISMapping.PROP_IS_LATEST_MAJOR_VERSION));
+ assertNull(cmisPropertyService.getProperty(folder, CMISMapping.PROP_VERSION_SERIES_IS_CHECKED_OUT));
+ assertNull(cmisPropertyService.getProperty(folder, CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_BY));
+ assertNull(cmisPropertyService.getProperty(folder, CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_ID));
+ assertNull(cmisPropertyService.getProperty(folder, CMISMapping.PROP_CHECKIN_COMMENT));
+ assertNull(cmisPropertyService.getProperty(folder, CMISMapping.PROP_CONTENT_STREAM_ALLOWED));
+ assertNull(cmisPropertyService.getProperty(folder, CMISMapping.PROP_CONTENT_STREAM_LENGTH));
+ assertNull(cmisPropertyService.getProperty(folder, CMISMapping.PROP_CONTENT_STREAM_MIMETYPE));
+ assertNull(cmisPropertyService.getProperty(folder, CMISMapping.PROP_CONTENT_STREAM_FILENAME));
+ assertNull(cmisPropertyService.getProperty(folder, CMISMapping.PROP_CONTENT_STREAM_URI));
+
+ assertEquals(cmisPropertyService.getProperty(folder, CMISMapping.PROP_PARENT), rootNodeRef);
+ assertNull(cmisPropertyService.getProperty(folder, CMISMapping.PROP_ALLLOWED_CHILD_OBJECT_TYPES));
+
+ assertEquals(cmisPropertyService.getProperty(folder, "CM_NAME"), "BaseFolder");
+ assertEquals(cmisPropertyService.getProperty(folder, "cm_name"), "BaseFolder");
+ }
+}
diff --git a/source/java/org/alfresco/cmis/property/CheckinCommentPropertyAccessor.java b/source/java/org/alfresco/cmis/property/CheckinCommentPropertyAccessor.java
new file mode 100644
index 0000000000..fcd47607c3
--- /dev/null
+++ b/source/java/org/alfresco/cmis/property/CheckinCommentPropertyAccessor.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.cmis.property;
+
+import java.io.Serializable;
+
+import org.alfresco.cmis.dictionary.CMISMapping;
+import org.alfresco.cmis.dictionary.CMISScope;
+import org.alfresco.service.cmr.repository.NodeRef;
+import org.alfresco.service.cmr.version.Version;
+
+/**
+ * Accesor for the CMIS Checkin Comment
+ *
+ * @author andyh
+ *
+ */
+public class CheckinCommentPropertyAccessor extends AbstractNamedPropertyAccessor
+{
+
+ public Serializable getProperty(NodeRef nodeRef)
+ {
+ Version version = getServiceRegistry().getVersionService().getCurrentVersion(nodeRef);
+ if(version != null)
+ {
+ return version.getDescription();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ @Override
+ public String getPropertyName()
+ {
+ return CMISMapping.PROP_CHECKIN_COMMENT;
+ }
+
+ @Override
+ public CMISScope getScope()
+ {
+ return CMISScope.DOCUMENT;
+ }
+
+}
diff --git a/source/java/org/alfresco/cmis/property/ContentStreamLengthPropertyAccessor.java b/source/java/org/alfresco/cmis/property/ContentStreamLengthPropertyAccessor.java
new file mode 100644
index 0000000000..24e456ca97
--- /dev/null
+++ b/source/java/org/alfresco/cmis/property/ContentStreamLengthPropertyAccessor.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.cmis.property;
+
+import java.io.Serializable;
+
+import org.alfresco.cmis.dictionary.CMISMapping;
+import org.alfresco.cmis.dictionary.CMISScope;
+import org.alfresco.model.ContentModel;
+import org.alfresco.service.cmr.repository.ContentData;
+import org.alfresco.service.cmr.repository.NodeRef;
+import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
+/**
+ * Accessor for CMIS content stream length property
+ *
+ * @author andyh
+ *
+ */
+public class ContentStreamLengthPropertyAccessor extends AbstractNamedPropertyAccessor
+{
+
+ public Serializable getProperty(NodeRef nodeRef)
+ {
+ Serializable value = getServiceRegistry().getNodeService().getProperty(nodeRef, ContentModel.PROP_CONTENT);
+ if (value != null)
+ {
+ ContentData contentData = DefaultTypeConverter.INSTANCE.convert(ContentData.class, value);
+ return contentData.getSize();
+ }
+ else
+ {
+ return 0L;
+ }
+
+ }
+
+ @Override
+ public String getPropertyName()
+ {
+ return CMISMapping.PROP_CONTENT_STREAM_LENGTH;
+ }
+
+ @Override
+ public CMISScope getScope()
+ {
+ return CMISScope.DOCUMENT;
+ }
+}
diff --git a/source/java/org/alfresco/cmis/property/ContentStreamMimetypePropertyAccessor.java b/source/java/org/alfresco/cmis/property/ContentStreamMimetypePropertyAccessor.java
new file mode 100644
index 0000000000..f37d786433
--- /dev/null
+++ b/source/java/org/alfresco/cmis/property/ContentStreamMimetypePropertyAccessor.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.cmis.property;
+
+import java.io.Serializable;
+
+import org.alfresco.cmis.dictionary.CMISMapping;
+import org.alfresco.cmis.dictionary.CMISScope;
+import org.alfresco.model.ContentModel;
+import org.alfresco.service.cmr.repository.ContentData;
+import org.alfresco.service.cmr.repository.NodeRef;
+import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
+
+/**
+ * Accessor for CMIS content stream mimetype property
+ *
+ * @author andyh
+ *
+ */
+public class ContentStreamMimetypePropertyAccessor extends AbstractNamedPropertyAccessor
+{
+
+ public Serializable getProperty(NodeRef nodeRef)
+ {
+ Serializable value = getServiceRegistry().getNodeService().getProperty(nodeRef, ContentModel.PROP_CONTENT);
+ if (value != null)
+ {
+ ContentData contentData = DefaultTypeConverter.INSTANCE.convert(ContentData.class, value);
+ return contentData.getMimetype();
+ }
+ else
+ {
+ return "";
+ }
+
+ }
+
+ @Override
+ public String getPropertyName()
+ {
+ return CMISMapping.PROP_CONTENT_STREAM_MIMETYPE;
+ }
+
+ @Override
+ public CMISScope getScope()
+ {
+ return CMISScope.DOCUMENT;
+ }
+
+}
diff --git a/source/java/org/alfresco/cmis/property/FixedValuePropertyAccessor.java b/source/java/org/alfresco/cmis/property/FixedValuePropertyAccessor.java
new file mode 100644
index 0000000000..994bf2fc58
--- /dev/null
+++ b/source/java/org/alfresco/cmis/property/FixedValuePropertyAccessor.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.cmis.property;
+
+import java.io.Serializable;
+
+import org.alfresco.service.cmr.repository.NodeRef;
+
+/**
+ * Property accessor for fixed value mapping (eg to null, true, etc)
+ *
+ * @author andyh
+ *
+ */
+public class FixedValuePropertyAccessor extends AbstractNamedPropertyAccessor
+{
+ Serializable fixedValue;
+
+ public Serializable getFixedValue()
+ {
+ return fixedValue;
+ }
+
+ public void setFixedValue(Serializable fixedValue)
+ {
+ this.fixedValue = fixedValue;
+ }
+
+ public Serializable getProperty(NodeRef nodeRef)
+ {
+ return fixedValue;
+ }
+
+}
diff --git a/source/java/org/alfresco/cmis/property/GenericPropertyAccessor.java b/source/java/org/alfresco/cmis/property/GenericPropertyAccessor.java
new file mode 100644
index 0000000000..55c482690e
--- /dev/null
+++ b/source/java/org/alfresco/cmis/property/GenericPropertyAccessor.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.cmis.property;
+
+import java.io.Serializable;
+
+import org.alfresco.service.cmr.repository.NodeRef;
+
+/**
+ * The API to access a property.
+ *
+ * @author andyh
+ *
+ */
+public interface GenericPropertyAccessor
+{
+ /**
+ * Get the property value
+ *
+ * @param nodeRef
+ * @param propertyName
+ * @return
+ */
+ public Serializable getProperty(NodeRef nodeRef, String propertyName);
+}
diff --git a/source/java/org/alfresco/cmis/property/IsImmutablePropertyAccessor.java b/source/java/org/alfresco/cmis/property/IsImmutablePropertyAccessor.java
new file mode 100644
index 0000000000..0a14eaacc6
--- /dev/null
+++ b/source/java/org/alfresco/cmis/property/IsImmutablePropertyAccessor.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.cmis.property;
+
+import java.io.Serializable;
+
+import org.alfresco.cmis.dictionary.CMISMapping;
+import org.alfresco.cmis.dictionary.CMISScope;
+import org.alfresco.model.ContentModel;
+import org.alfresco.service.cmr.lock.LockType;
+import org.alfresco.service.cmr.repository.NodeRef;
+import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
+
+/**
+ * Property accessor for CMIS is immutable property
+ * @author andyh
+ *
+ */
+public class IsImmutablePropertyAccessor extends AbstractNamedPropertyAccessor
+{
+
+ public Serializable getProperty(NodeRef nodeRef)
+ {
+ LockType type = getServiceRegistry().getLockService().getLockType(nodeRef);
+ if(type == LockType.READ_ONLY_LOCK)
+ {
+ return Boolean.valueOf(true);
+ }
+ Serializable value = getServiceRegistry().getNodeService().getProperty(nodeRef, ContentModel.PROP_AUTO_VERSION);
+ if(value != null)
+ {
+ Boolean autoVersion = DefaultTypeConverter.INSTANCE.convert(Boolean.class, value);
+ if(false == autoVersion.booleanValue())
+ {
+ return Boolean.valueOf(true);
+ }
+ }
+ return Boolean.valueOf(false);
+
+ }
+
+ @Override
+ public String getPropertyName()
+ {
+ return CMISMapping.PROP_IS_IMMUTABLE;
+ }
+
+ @Override
+ public CMISScope getScope()
+ {
+ return CMISScope.DOCUMENT;
+ }
+
+}
diff --git a/source/java/org/alfresco/cmis/property/IsLatestMajorVersionPropertyAccessor.java b/source/java/org/alfresco/cmis/property/IsLatestMajorVersionPropertyAccessor.java
new file mode 100644
index 0000000000..a7eb870516
--- /dev/null
+++ b/source/java/org/alfresco/cmis/property/IsLatestMajorVersionPropertyAccessor.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.cmis.property;
+
+import org.alfresco.cmis.dictionary.CMISMapping;
+
+/**
+ * Property accessor for CMIS is latest major version
+ *
+ * @author andyh
+ *
+ */
+public class IsLatestMajorVersionPropertyAccessor extends IsMajorVersionPropertyAccessor
+{
+ @Override
+ public String getPropertyName()
+ {
+ return CMISMapping.PROP_IS_LATEST_MAJOR_VERSION;
+ }
+}
diff --git a/source/java/org/alfresco/cmis/property/IsLatestVersionPropertyAccessor.java b/source/java/org/alfresco/cmis/property/IsLatestVersionPropertyAccessor.java
new file mode 100644
index 0000000000..5c3fd310fe
--- /dev/null
+++ b/source/java/org/alfresco/cmis/property/IsLatestVersionPropertyAccessor.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.cmis.property;
+
+import java.io.Serializable;
+
+import org.alfresco.cmis.dictionary.CMISMapping;
+import org.alfresco.cmis.dictionary.CMISScope;
+import org.alfresco.model.ContentModel;
+import org.alfresco.service.cmr.repository.NodeRef;
+
+/**
+ * Accesser for CMIS is latest version property
+ * @author andyh
+ *
+ */
+public class IsLatestVersionPropertyAccessor extends AbstractNamedPropertyAccessor
+{
+
+ public Serializable getProperty(NodeRef nodeRef)
+ {
+ return !getServiceRegistry().getNodeService().hasAspect(nodeRef, ContentModel.ASPECT_WORKING_COPY);
+ }
+
+ @Override
+ public String getPropertyName()
+ {
+ return CMISMapping.PROP_IS_LATEST_VERSION;
+ }
+
+ @Override
+ public CMISScope getScope()
+ {
+ return CMISScope.DOCUMENT;
+ }
+
+}
diff --git a/source/java/org/alfresco/cmis/property/IsMajorVersionPropertyAccessor.java b/source/java/org/alfresco/cmis/property/IsMajorVersionPropertyAccessor.java
new file mode 100644
index 0000000000..0866512534
--- /dev/null
+++ b/source/java/org/alfresco/cmis/property/IsMajorVersionPropertyAccessor.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.cmis.property;
+
+import java.io.Serializable;
+
+import org.alfresco.cmis.dictionary.CMISMapping;
+import org.alfresco.cmis.dictionary.CMISScope;
+import org.alfresco.model.ContentModel;
+import org.alfresco.service.cmr.repository.NodeRef;
+import org.alfresco.service.cmr.version.Version;
+import org.alfresco.service.cmr.version.VersionType;
+
+/**
+ * Accessor for CMIS is major version property
+ * @author andyh
+ *
+ */
+public class IsMajorVersionPropertyAccessor extends AbstractNamedPropertyAccessor
+{
+
+ public Serializable getProperty(NodeRef nodeRef)
+ {
+ if(getServiceRegistry().getNodeService().hasAspect(nodeRef, ContentModel.ASPECT_WORKING_COPY))
+ {
+ return false;
+ }
+ else
+ {
+ Version version = getServiceRegistry().getVersionService().getCurrentVersion(nodeRef);
+ if(version != null)
+ {
+ return (version.getVersionType() == VersionType.MAJOR);
+ }
+ else
+ {
+ return false;
+ }
+ }
+ }
+
+ @Override
+ public String getPropertyName()
+ {
+ return CMISMapping.PROP_IS_MAJOR_VERSION;
+ }
+
+ @Override
+ public CMISScope getScope()
+ {
+ return CMISScope.DOCUMENT;
+ }
+
+}
diff --git a/source/java/org/alfresco/cmis/property/MappingPropertyAccessor.java b/source/java/org/alfresco/cmis/property/MappingPropertyAccessor.java
new file mode 100644
index 0000000000..490c95b8fc
--- /dev/null
+++ b/source/java/org/alfresco/cmis/property/MappingPropertyAccessor.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.cmis.property;
+
+import java.io.Serializable;
+
+import org.alfresco.cmis.dictionary.CMISMapping;
+import org.alfresco.service.cmr.repository.NodeRef;
+import org.alfresco.service.namespace.QName;
+
+/**
+ * Generic mapping of CMIS style property names to Alfresco properties (for non CMIS properties)
+ * @author andyh
+ *
+ */
+public class MappingPropertyAccessor extends AbstractGenericPropertyAccessor
+{
+ public Serializable getProperty(NodeRef nodeRef, String propertyName)
+ {
+ QName propertyQname = CMISMapping.getPropertyQName(getServiceRegistry().getDictionaryService(), getServiceRegistry().getNamespaceService(), propertyName);
+ return getServiceRegistry().getNodeService().getProperty(nodeRef, propertyQname);
+ }
+
+}
diff --git a/source/java/org/alfresco/cmis/property/NamedPropertyAccessor.java b/source/java/org/alfresco/cmis/property/NamedPropertyAccessor.java
new file mode 100644
index 0000000000..9a415ca2e1
--- /dev/null
+++ b/source/java/org/alfresco/cmis/property/NamedPropertyAccessor.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.cmis.property;
+
+import java.io.Serializable;
+
+import org.alfresco.cmis.dictionary.CMISScope;
+import org.alfresco.service.cmr.repository.NodeRef;
+
+/**
+ * Named property accessor
+ *
+ * @author andyh
+ *
+ */
+public interface NamedPropertyAccessor
+{
+ /**
+ * Get the name of the CMIS property this accessor fetches
+ * @return
+ */
+ public String getPropertyName();
+
+ /**
+ * Get the property value
+ * @param nodeRef
+ * @return
+ */
+ public Serializable getProperty(NodeRef nodeRef);
+
+ /**
+ * To what types of objects does this property apply?
+ * @return
+ */
+ public CMISScope getScope();
+}
diff --git a/source/java/org/alfresco/cmis/property/ObjectIdPropertyAccessor.java b/source/java/org/alfresco/cmis/property/ObjectIdPropertyAccessor.java
new file mode 100644
index 0000000000..9319a3fc2d
--- /dev/null
+++ b/source/java/org/alfresco/cmis/property/ObjectIdPropertyAccessor.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.cmis.property;
+
+import java.io.Serializable;
+
+import org.alfresco.cmis.dictionary.CMISMapping;
+import org.alfresco.cmis.dictionary.CMISScope;
+import org.alfresco.service.cmr.repository.NodeRef;
+
+/**
+ * Get the CMIS object id property.
+ *
+ * @author andyh
+ *
+ */
+public class ObjectIdPropertyAccessor extends AbstractNamedPropertyAccessor
+{
+
+ public Serializable getProperty(NodeRef nodeRef)
+ {
+ return nodeRef;
+ }
+
+ @Override
+ public String getPropertyName()
+ {
+ return CMISMapping.PROP_OBJECT_ID;
+ }
+
+ @Override
+ public CMISScope getScope()
+ {
+ return CMISScope.OBJECT;
+ }
+
+
+
+}
diff --git a/source/java/org/alfresco/cmis/property/ObjectTypeIdPropertyAccessor.java b/source/java/org/alfresco/cmis/property/ObjectTypeIdPropertyAccessor.java
new file mode 100644
index 0000000000..f8dce8e877
--- /dev/null
+++ b/source/java/org/alfresco/cmis/property/ObjectTypeIdPropertyAccessor.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.cmis.property;
+
+import java.io.Serializable;
+
+import org.alfresco.cmis.dictionary.CMISMapping;
+import org.alfresco.cmis.dictionary.CMISScope;
+import org.alfresco.service.cmr.repository.NodeRef;
+import org.alfresco.service.namespace.QName;
+
+/**
+ * Get the CMIS object type id property
+ *
+ * @author andyh
+ *
+ */
+public class ObjectTypeIdPropertyAccessor extends AbstractNamedPropertyAccessor
+{
+
+ public Serializable getProperty(NodeRef nodeRef)
+ {
+ QName typeQName = CMISMapping.getCmisType(getServiceRegistry().getNodeService().getType(nodeRef));
+ CMISScope scope;
+ if(CMISMapping.isValidCmisDocument(getServiceRegistry().getDictionaryService(), typeQName))
+ {
+ scope = CMISScope.DOCUMENT;
+ }
+ else if(CMISMapping.isValidCmisFolder(getServiceRegistry().getDictionaryService(), typeQName))
+ {
+ scope = CMISScope.FOLDER;
+ }
+ else
+ {
+ scope = CMISScope.UNKNOWN;
+ }
+ return CMISMapping.getCmisTypeId(scope, typeQName);
+ }
+
+ @Override
+ public String getPropertyName()
+ {
+ return CMISMapping.PROP_OBJECT_TYPE_ID;
+ }
+
+
+ @Override
+ public CMISScope getScope()
+ {
+ return CMISScope.OBJECT;
+ }
+
+
+}
diff --git a/source/java/org/alfresco/cmis/property/ParentPropertyAccessor.java b/source/java/org/alfresco/cmis/property/ParentPropertyAccessor.java
new file mode 100644
index 0000000000..32307885e0
--- /dev/null
+++ b/source/java/org/alfresco/cmis/property/ParentPropertyAccessor.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.cmis.property;
+
+import java.io.Serializable;
+
+import org.alfresco.cmis.dictionary.CMISMapping;
+import org.alfresco.cmis.dictionary.CMISScope;
+import org.alfresco.service.cmr.repository.NodeRef;
+
+/**
+ * Get the CMIS parent property
+ *
+ * @author andyh
+ *
+ */
+public class ParentPropertyAccessor extends AbstractNamedPropertyAccessor
+{
+
+ public Serializable getProperty(NodeRef nodeRef)
+ {
+ return getServiceRegistry().getNodeService().getPrimaryParent(nodeRef).getParentRef();
+ }
+
+
+ @Override
+ public String getPropertyName()
+ {
+ return CMISMapping.PROP_PARENT;
+ }
+
+
+ @Override
+ public CMISScope getScope()
+ {
+ return CMISScope.FOLDER;
+ }
+}
diff --git a/source/java/org/alfresco/cmis/property/SimplePropertyAccessor.java b/source/java/org/alfresco/cmis/property/SimplePropertyAccessor.java
new file mode 100644
index 0000000000..65e1aecb78
--- /dev/null
+++ b/source/java/org/alfresco/cmis/property/SimplePropertyAccessor.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.cmis.property;
+
+import java.io.Serializable;
+
+import org.alfresco.service.cmr.repository.NodeRef;
+import org.alfresco.service.namespace.QName;
+import org.springframework.beans.factory.InitializingBean;
+
+/**
+ * A simple 1-1 property mapping from a CMIS property name to an alfresco property
+ * @author andyh
+ *
+ */
+public class SimplePropertyAccessor extends AbstractNamedPropertyAccessor implements InitializingBean
+{
+ private QName qname;
+
+ private String mapping;
+
+ public void setMapping(String mapping)
+ {
+ this.mapping = mapping;
+ }
+
+ public Serializable getProperty(NodeRef nodeRef)
+ {
+ return getServiceRegistry().getNodeService().getProperty(nodeRef, qname);
+ }
+
+ public void afterPropertiesSet() throws Exception
+ {
+ qname = QName.resolveToQName(getServiceRegistry().getNamespaceService(), mapping);
+ }
+
+}
diff --git a/source/java/org/alfresco/cmis/property/VersionSeriesCheckedOutByPropertyAccessor.java b/source/java/org/alfresco/cmis/property/VersionSeriesCheckedOutByPropertyAccessor.java
new file mode 100644
index 0000000000..8ee687b702
--- /dev/null
+++ b/source/java/org/alfresco/cmis/property/VersionSeriesCheckedOutByPropertyAccessor.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.cmis.property;
+
+import java.io.Serializable;
+
+import org.alfresco.cmis.dictionary.CMISMapping;
+import org.alfresco.cmis.dictionary.CMISScope;
+import org.alfresco.model.ContentModel;
+import org.alfresco.service.cmr.lock.LockType;
+import org.alfresco.service.cmr.repository.NodeRef;
+
+/**
+ * Get the CMIS version series checked out by property
+ * @author andyh
+ *
+ */
+public class VersionSeriesCheckedOutByPropertyAccessor extends AbstractNamedPropertyAccessor
+{
+
+ public Serializable getProperty(NodeRef nodeRef)
+ {
+ if (getServiceRegistry().getNodeService().hasAspect(nodeRef, ContentModel.ASPECT_WORKING_COPY))
+ {
+ return null;
+ }
+ else
+ {
+ LockType type = getServiceRegistry().getLockService().getLockType(nodeRef);
+ if (type == LockType.READ_ONLY_LOCK)
+ {
+ NodeRef wc = getServiceRegistry().getCheckOutCheckInService().getWorkingCopy(nodeRef);
+ if (wc != null)
+ {
+ return getServiceRegistry().getNodeService().getProperty(nodeRef, ContentModel.PROP_LOCK_OWNER);
+ }
+ else
+ {
+ return null;
+ }
+ }
+ else
+ {
+ return null;
+ }
+ }
+ }
+
+ @Override
+ public String getPropertyName()
+ {
+ return CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_BY;
+ }
+
+ @Override
+ public CMISScope getScope()
+ {
+ return CMISScope.DOCUMENT;
+ }
+}
diff --git a/source/java/org/alfresco/cmis/property/VersionSeriesCheckedOutIdPropertyAccessor.java b/source/java/org/alfresco/cmis/property/VersionSeriesCheckedOutIdPropertyAccessor.java
new file mode 100644
index 0000000000..9db8d642a3
--- /dev/null
+++ b/source/java/org/alfresco/cmis/property/VersionSeriesCheckedOutIdPropertyAccessor.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.cmis.property;
+
+import java.io.Serializable;
+
+import org.alfresco.cmis.dictionary.CMISMapping;
+import org.alfresco.cmis.dictionary.CMISScope;
+import org.alfresco.model.ContentModel;
+import org.alfresco.service.cmr.lock.LockType;
+import org.alfresco.service.cmr.repository.NodeRef;
+
+/**
+ * Get the CMIS version series checked out id property
+ * @author andyh
+ *
+ */
+public class VersionSeriesCheckedOutIdPropertyAccessor extends AbstractNamedPropertyAccessor
+{
+
+ public Serializable getProperty(NodeRef nodeRef)
+ {
+ if (getServiceRegistry().getNodeService().hasAspect(nodeRef, ContentModel.ASPECT_WORKING_COPY))
+ {
+ return null;
+ }
+ else
+ {
+ LockType type = getServiceRegistry().getLockService().getLockType(nodeRef);
+ if (type == LockType.READ_ONLY_LOCK)
+ {
+ return getServiceRegistry().getCheckOutCheckInService().getWorkingCopy(nodeRef);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ }
+
+ @Override
+ public String getPropertyName()
+ {
+ return CMISMapping.PROP_VERSION_SERIES_CHECKED_OUT_ID;
+ }
+
+ @Override
+ public CMISScope getScope()
+ {
+ return CMISScope.DOCUMENT;
+ }
+
+}
diff --git a/source/java/org/alfresco/cmis/property/VersionSeriesIsCheckedOutPropertyAccessor.java b/source/java/org/alfresco/cmis/property/VersionSeriesIsCheckedOutPropertyAccessor.java
new file mode 100644
index 0000000000..643a1ada5e
--- /dev/null
+++ b/source/java/org/alfresco/cmis/property/VersionSeriesIsCheckedOutPropertyAccessor.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.cmis.property;
+
+import java.io.Serializable;
+
+import org.alfresco.cmis.dictionary.CMISMapping;
+import org.alfresco.cmis.dictionary.CMISScope;
+import org.alfresco.model.ContentModel;
+import org.alfresco.service.cmr.lock.LockType;
+import org.alfresco.service.cmr.repository.NodeRef;
+
+/**
+ * Get the CMIS version series checked out property
+ * @author andyh
+ *
+ */
+public class VersionSeriesIsCheckedOutPropertyAccessor extends AbstractNamedPropertyAccessor
+{
+
+ public Serializable getProperty(NodeRef nodeRef)
+ {
+ if (getServiceRegistry().getNodeService().hasAspect(nodeRef, ContentModel.ASPECT_WORKING_COPY))
+ {
+ return false;
+ }
+ else
+ {
+ LockType type = getServiceRegistry().getLockService().getLockType(nodeRef);
+ if (type == LockType.READ_ONLY_LOCK)
+ {
+ NodeRef wc = getServiceRegistry().getCheckOutCheckInService().getWorkingCopy(nodeRef);
+ return (wc != null);
+ }
+ else
+ {
+ return false;
+ }
+ }
+ }
+
+ @Override
+ public String getPropertyName()
+ {
+ return CMISMapping.PROP_VERSION_SERIES_IS_CHECKED_OUT;
+ }
+
+ @Override
+ public CMISScope getScope()
+ {
+ return CMISScope.DOCUMENT;
+ }
+}
diff --git a/source/java/org/alfresco/cmis/search/CMISQueryException.java b/source/java/org/alfresco/cmis/search/CMISQueryException.java
new file mode 100644
index 0000000000..9ba62ec6dc
--- /dev/null
+++ b/source/java/org/alfresco/cmis/search/CMISQueryException.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.cmis.search;
+
+import org.alfresco.error.AlfrescoRuntimeException;
+
+/**
+ * @author andyh
+ *
+ */
+public class CMISQueryException extends AlfrescoRuntimeException
+{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 8281715613061152219L;
+
+ /**
+ * @param msgId
+ */
+ public CMISQueryException(String msgId)
+ {
+ super(msgId);
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @param msgId
+ * @param msgParams
+ */
+ public CMISQueryException(String msgId, Object[] msgParams)
+ {
+ super(msgId, msgParams);
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @param msgId
+ * @param cause
+ */
+ public CMISQueryException(String msgId, Throwable cause)
+ {
+ super(msgId, cause);
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @param msgId
+ * @param msgParams
+ * @param cause
+ */
+ public CMISQueryException(String msgId, Object[] msgParams, Throwable cause)
+ {
+ super(msgId, msgParams, cause);
+ // TODO Auto-generated constructor stub
+ }
+
+}
diff --git a/source/java/org/alfresco/cmis/search/QueryTest.java b/source/java/org/alfresco/cmis/search/QueryTest.java
new file mode 100644
index 0000000000..74e5e2a37e
--- /dev/null
+++ b/source/java/org/alfresco/cmis/search/QueryTest.java
@@ -0,0 +1,463 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.cmis.search;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.alfresco.cmis.dictionary.BaseCMISTest;
+import org.alfresco.cmis.dictionary.CMISCardinality;
+import org.alfresco.cmis.dictionary.CMISMapping;
+import org.alfresco.cmis.dictionary.CMISPropertyDefinition;
+import org.alfresco.cmis.dictionary.CMISScope;
+import org.alfresco.cmis.dictionary.CMISTypeId;
+import org.alfresco.repo.search.impl.parsers.CMISLexer;
+import org.alfresco.repo.search.impl.parsers.CMISParser;
+import org.alfresco.repo.search.impl.querymodel.Argument;
+import org.alfresco.repo.search.impl.querymodel.ArgumentDefinition;
+import org.alfresco.repo.search.impl.querymodel.Column;
+import org.alfresco.repo.search.impl.querymodel.Constraint;
+import org.alfresco.repo.search.impl.querymodel.Function;
+import org.alfresco.repo.search.impl.querymodel.JoinType;
+import org.alfresco.repo.search.impl.querymodel.QueryModelFactory;
+import org.alfresco.repo.search.impl.querymodel.Selector;
+import org.alfresco.repo.search.impl.querymodel.Source;
+import org.alfresco.repo.search.impl.querymodel.impl.functions.Equals;
+import org.alfresco.repo.search.impl.querymodel.impl.functions.Lower;
+import org.alfresco.repo.search.impl.querymodel.impl.functions.PropertyAccessor;
+import org.alfresco.repo.search.impl.querymodel.impl.functions.Score;
+import org.alfresco.repo.search.impl.querymodel.impl.functions.Upper;
+import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryModelFactory;
+import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
+import org.alfresco.service.namespace.QName;
+import org.antlr.runtime.ANTLRStringStream;
+import org.antlr.runtime.CharStream;
+import org.antlr.runtime.CommonTokenStream;
+import org.antlr.runtime.RecognitionException;
+import org.antlr.runtime.tree.CommonTree;
+
+/**
+ * @author andyh
+ */
+public class QueryTest extends BaseCMISTest
+{
+ public void testParse()
+ {
+ String input = "SELECT UPPER(1.0) AS WOOF FROM DOCUMENT_OBJECT_TYPE AS DOC LEFT OUTER JOIN FOLDER_OBJECT_TYPE AS FOLDER ON (DOC.NAME = FOLDER.NAME)";
+ CMISParser parser = null;
+ try
+ {
+ CharStream cs = new ANTLRStringStream(input);
+ CMISLexer lexer = new CMISLexer(cs);
+ CommonTokenStream tokens = new CommonTokenStream(lexer);
+ parser = new CMISParser(tokens);
+ CommonTree queryNode = (CommonTree) parser.query().getTree();
+ assertTrue(queryNode.getType() == CMISParser.QUERY);
+
+ QueryModelFactory factory = new LuceneQueryModelFactory();
+
+ CommonTree sourceNode = (CommonTree) queryNode.getFirstChildWithType(CMISParser.SOURCE);
+ Source s = buildSource(sourceNode, true, factory);
+ Map selectors = s.getSelectors();
+ ArrayList columns = buildColumns(queryNode, factory, selectors);
+
+ System.out.println(s);
+ System.out.println(selectors);
+ System.out.println(columns);
+ }
+ catch (RecognitionException e)
+ {
+ if (parser != null)
+ {
+ String[] tokenNames = parser.getTokenNames();
+ String hdr = parser.getErrorHeader(e);
+ String msg = parser.getErrorMessage(e, tokenNames);
+ throw new CMISQueryException(hdr + "\n" + msg, e);
+ }
+ }
+
+ }
+
+ private ArrayList buildColumns(CommonTree queryNode, QueryModelFactory factory, Map selectors)
+ {
+ ArrayList columns = new ArrayList();
+ CommonTree starNode = (CommonTree) queryNode.getFirstChildWithType(CMISParser.ALL_COLUMNS);
+ if (starNode != null)
+ {
+ for (Selector selector : selectors.values())
+ {
+ QName cmisType = CMISMapping.getCmisType(selector.getType());
+ CMISTypeId typeId = null;
+ if (CMISMapping.isValidCmisDocument(dictionaryService, cmisType))
+ {
+ typeId = CMISMapping.getCmisTypeId(CMISScope.DOCUMENT, cmisType);
+ }
+ else if (CMISMapping.isValidCmisFolder(dictionaryService, cmisType))
+ {
+ typeId = CMISMapping.getCmisTypeId(CMISScope.FOLDER, cmisType);
+ }
+ else
+ {
+ throw new CMISQueryException("Type unsupported in CMIS queries: " + selector.getAlias());
+ }
+ Map propDefs = cmisDictionaryService.getPropertyDefinitions(typeId);
+ for (CMISPropertyDefinition definition : propDefs.values())
+ {
+ if (definition.getCardinality() == CMISCardinality.SINGLE_VALUED)
+ {
+ Function function = factory.getFunction(PropertyAccessor.NAME);
+ QName propertyQName = CMISMapping.getPropertyQName(dictionaryService, serviceRegistry.getNamespaceService(), definition.getPropertyName());
+ Argument arg = factory.createPropertyArgument(PropertyAccessor.ARG_PROPERTY, selector.getAlias(), propertyQName);
+ List functionArguments = new ArrayList(1);
+ functionArguments.add(arg);
+ Column column = factory.createColumn(function, functionArguments, selector.getAlias() + "." + definition.getPropertyName());
+ columns.add(column);
+ }
+ }
+ }
+ }
+
+ CommonTree columnsNode = (CommonTree) queryNode.getFirstChildWithType(CMISParser.COLUMNS);
+ if (columnsNode != null)
+ {
+ CommonTree allColumnsNode = (CommonTree) columnsNode.getFirstChildWithType(CMISParser.ALL_COLUMNS);
+ if (allColumnsNode != null)
+ {
+ String qualifier = allColumnsNode.getChild(0).getText();
+ Selector selector = selectors.get(qualifier);
+ if (selector == null)
+ {
+ throw new CMISQueryException("No selector for " + qualifier + " in " + qualifier + ".*");
+ }
+ QName cmisType = CMISMapping.getCmisType(selector.getType());
+ CMISTypeId typeId = null;
+ if (CMISMapping.isValidCmisDocument(dictionaryService, cmisType))
+ {
+ typeId = CMISMapping.getCmisTypeId(CMISScope.DOCUMENT, cmisType);
+ }
+ else if (CMISMapping.isValidCmisFolder(dictionaryService, cmisType))
+ {
+ typeId = CMISMapping.getCmisTypeId(CMISScope.FOLDER, cmisType);
+ }
+ else
+ {
+ throw new CMISQueryException("Type unsupported in CMIS queries: " + selector.getAlias());
+ }
+ Map propDefs = cmisDictionaryService.getPropertyDefinitions(typeId);
+ for (CMISPropertyDefinition definition : propDefs.values())
+ {
+ if (definition.getCardinality() == CMISCardinality.SINGLE_VALUED)
+ {
+ Function function = factory.getFunction(PropertyAccessor.NAME);
+ QName propertyQName = CMISMapping.getPropertyQName(dictionaryService, serviceRegistry.getNamespaceService(), definition.getPropertyName());
+ Argument arg = factory.createPropertyArgument(PropertyAccessor.ARG_PROPERTY, selector.getAlias(), propertyQName);
+ List functionArguments = new ArrayList(1);
+ functionArguments.add(arg);
+ Column column = factory.createColumn(function, functionArguments, selector.getAlias() + "." + definition.getPropertyName());
+ columns.add(column);
+ }
+ }
+ }
+
+ CommonTree columnNode = (CommonTree) columnsNode.getFirstChildWithType(CMISParser.COLUMN);
+ if (columnNode != null)
+ {
+ CommonTree columnRefNode = (CommonTree) columnNode.getFirstChildWithType(CMISParser.COLUMN_REF);
+ if (columnRefNode != null)
+ {
+ String columnName = columnRefNode.getChild(0).getText();
+ String qualifier = "";
+ if (columnRefNode.getChildCount() > 1)
+ {
+ qualifier = columnRefNode.getChild(1).getText();
+ }
+ Selector selector = selectors.get(qualifier);
+ if (selector == null)
+ {
+ throw new CMISQueryException("No selector for " + qualifier);
+ }
+ QName cmisType = CMISMapping.getCmisType(selector.getType());
+ CMISTypeId typeId = null;
+ if (CMISMapping.isValidCmisDocument(dictionaryService, cmisType))
+ {
+ typeId = CMISMapping.getCmisTypeId(CMISScope.DOCUMENT, cmisType);
+ }
+ else if (CMISMapping.isValidCmisFolder(dictionaryService, cmisType))
+ {
+ typeId = CMISMapping.getCmisTypeId(CMISScope.FOLDER, cmisType);
+ }
+ else
+ {
+ throw new CMISQueryException("Type unsupported in CMIS queries: " + selector.getAlias());
+ }
+ CMISPropertyDefinition definition = cmisDictionaryService.getPropertyDefinition(typeId, columnName);
+
+ if (definition == null)
+ {
+ throw new CMISQueryException("Invalid column for " + CMISMapping.getQueryName(namespaceService, typeId.getQName()) + "." + columnName);
+ }
+
+ Function function = factory.getFunction(PropertyAccessor.NAME);
+ QName propertyQName = CMISMapping.getPropertyQName(dictionaryService, serviceRegistry.getNamespaceService(), definition.getPropertyName());
+ Argument arg = factory.createPropertyArgument(PropertyAccessor.ARG_PROPERTY, selector.getAlias(), propertyQName);
+ List functionArguments = new ArrayList(1);
+ functionArguments.add(arg);
+
+ String alias = (selector.getAlias().length() > 0) ? selector.getAlias() + "." + definition.getPropertyName() : definition.getPropertyName();
+ if (columnNode.getChildCount() > 1)
+ {
+ alias = columnNode.getChild(1).getText();
+ }
+
+ Column column = factory.createColumn(function, functionArguments, alias);
+ columns.add(column);
+
+ }
+
+ CommonTree functionNode = (CommonTree) columnNode.getFirstChildWithType(CMISParser.FUNCTION);
+ if (functionNode != null)
+ {
+ String functionName = getFunctionName((CommonTree) functionNode.getChild(0));
+ Function function = factory.getFunction(functionName);
+ Set definitions = function.getArgumentDefinitions();
+ List functionArguments = new ArrayList();
+
+ int childIndex = 1;
+ for (ArgumentDefinition definition : definitions)
+ {
+ if (functionNode.getChildCount() > childIndex)
+ {
+ CommonTree argNode = (CommonTree) functionNode.getChild(childIndex++);
+ if (argNode.getType() == CMISParser.COLUMN_REF)
+ {
+ Argument arg = buildColumnReference(definition.getName(), argNode, factory);
+ functionArguments.add(arg);
+ }
+ else if (argNode.getType() == CMISParser.ID)
+ {
+ Argument arg;
+ String id = argNode.getText();
+ if(selectors.containsKey(id))
+ {
+ arg = factory.createSelectorArgument(definition.getName(), id);
+ }
+ else
+ {
+ QName propertyQName = CMISMapping.getPropertyQName(dictionaryService, serviceRegistry.getNamespaceService(), id);
+ arg = factory.createPropertyArgument(definition.getName(), "", propertyQName);
+ }
+ functionArguments.add(arg);
+ }
+ else if(argNode.getType() == CMISParser.PARAMETER)
+ {
+ Argument arg = factory.createParameterArgument(definition.getName(), argNode.getText());
+ functionArguments.add(arg);
+ }
+ else if(argNode.getType() == CMISParser.NUMERIC_LITERAL)
+ {
+ CommonTree literalNode = (CommonTree) argNode.getChild(0);
+ if(literalNode.getType() == CMISParser.FLOATING_POINT_LITERAL)
+ {
+ QName type = DataTypeDefinition.DOUBLE;
+ Number value = Double.parseDouble(literalNode.getText());
+ if(value.floatValue() == value.doubleValue())
+ {
+ type = DataTypeDefinition.FLOAT;
+ value = Float.valueOf(value.floatValue());
+ }
+ Argument arg = factory.createLiteralArgument(definition.getName(), type, value);
+ functionArguments.add(arg);
+ }
+ else if(literalNode.getType() == CMISParser.DECIMAL_INTEGER_LITERAL)
+ {
+ QName type = DataTypeDefinition.LONG;
+ Number value = Long.parseLong(literalNode.getText());
+ if(value.intValue() == value.longValue())
+ {
+ type = DataTypeDefinition.INT;
+ value = Integer.valueOf(value.intValue());
+ }
+ Argument arg = factory.createLiteralArgument(definition.getName(), type, value);
+ functionArguments.add(arg);
+ }
+ else
+ {
+ throw new CMISQueryException("Invalid numeric literal "+literalNode.getText());
+ }
+ }
+ else if(argNode.getType() == CMISParser.STRING_LITERAL)
+ {
+ Argument arg = factory.createLiteralArgument(definition.getName(), DataTypeDefinition.TEXT, argNode.getChild(0).getText());
+ functionArguments.add(arg);
+ }
+ else
+ {
+ throw new CMISQueryException("Invalid query argument "+argNode.getText());
+ }
+ }
+ else
+ {
+ if (definition.isMandatory())
+ {
+ //throw new CMISQueryException("Insufficient aruments for function " + ((CommonTree) functionNode.getChild(0)).getText() );
+ break;
+ }
+ else
+ {
+ // ok
+ }
+ }
+ }
+
+ String alias = function.getName();
+ if (columnNode.getChildCount() > 1)
+ {
+ alias = columnNode.getChild(1).getText();
+ }
+
+ Column column = factory.createColumn(function, functionArguments, alias);
+ columns.add(column);
+ }
+
+ }
+ }
+
+ return columns;
+ }
+
+ @SuppressWarnings("unchecked")
+ private Source buildSource(CommonTree source, boolean supportJoins, QueryModelFactory factory)
+ {
+ if (source.getChildCount() == 1)
+ {
+ // single table reference
+ CommonTree singleTableNode = (CommonTree) source.getChild(0);
+ if (singleTableNode.getType() == CMISParser.TABLE)
+ {
+ if (!supportJoins)
+ {
+ throw new UnsupportedOperationException("Joins are not supported");
+ }
+ CommonTree tableSourceNode = (CommonTree) singleTableNode.getFirstChildWithType(CMISParser.SOURCE);
+ return buildSource(tableSourceNode, false, factory);
+
+ }
+ assertTrue(singleTableNode.getType() == CMISParser.TABLE_REF);
+ String tableName = singleTableNode.getChild(0).getText();
+ String alias = "";
+ if (singleTableNode.getChildCount() > 1)
+ {
+ alias = singleTableNode.getChild(1).getText();
+ }
+ QName classQName = CMISMapping.getAlfrescoClassQNameFromCmisTableName(dictionaryService, serviceRegistry.getNamespaceService(), tableName);
+ return factory.createSelector(classQName, alias);
+ }
+ else
+ {
+ if (!supportJoins)
+ {
+ throw new UnsupportedOperationException("Joins are not supported");
+ }
+ CommonTree singleTableNode = (CommonTree) source.getChild(0);
+ assertTrue(singleTableNode.getType() == CMISParser.TABLE_REF);
+ String tableName = singleTableNode.getChild(0).getText();
+ String alias = "";
+ if (singleTableNode.getChildCount() == 2)
+ {
+ alias = singleTableNode.getChild(1).getText();
+ }
+ QName classQName = CMISMapping.getAlfrescoClassQNameFromCmisTableName(dictionaryService, serviceRegistry.getNamespaceService(), tableName);
+ Source lhs = factory.createSelector(classQName, alias);
+
+ List list = (List) (source.getChildren());
+ for (CommonTree joinNode : list)
+ {
+ if (joinNode.getType() == CMISParser.JOIN)
+ {
+ CommonTree rhsSource = (CommonTree) joinNode.getFirstChildWithType(CMISParser.SOURCE);
+ Source rhs = buildSource(rhsSource, supportJoins, factory);
+
+ JoinType joinType = JoinType.INNER;
+ CommonTree joinTypeNode = (CommonTree) joinNode.getFirstChildWithType(CMISParser.LEFT);
+ if (joinTypeNode != null)
+ {
+ joinType = JoinType.LEFT;
+ }
+
+ Constraint joinCondition = null;
+ CommonTree joinConditionNode = (CommonTree) joinNode.getFirstChildWithType(CMISParser.ON);
+ if (joinConditionNode != null)
+ {
+ Argument arg1 = buildColumnReference(Equals.ARG_LHS, (CommonTree) joinConditionNode.getChild(0), factory);
+ String functionName = getFunctionName((CommonTree) joinConditionNode.getChild(1));
+ Argument arg2 = buildColumnReference(Equals.ARG_RHS, (CommonTree) joinConditionNode.getChild(2), factory);
+ Function function = factory.getFunction(functionName);
+ List functionArguments = new ArrayList(2);
+ functionArguments.add(arg1);
+ functionArguments.add(arg2);
+ joinCondition = factory.createFunctionalConstraint(function, functionArguments);
+ }
+
+ Source join = factory.createJoin(lhs, rhs, joinType, joinCondition);
+ lhs = join;
+ }
+ }
+
+ return lhs;
+
+ }
+ }
+
+ public Argument buildColumnReference(String argumentName, CommonTree columnReferenceNode, QueryModelFactory factory)
+ {
+ String cmisPropertyName = columnReferenceNode.getChild(0).getText();
+ String qualifer = "";
+ if (columnReferenceNode.getChildCount() > 1)
+ {
+ qualifer = columnReferenceNode.getChild(1).getText();
+ }
+ QName propertyQName = CMISMapping.getPropertyQName(dictionaryService, serviceRegistry.getNamespaceService(), cmisPropertyName);
+ return factory.createPropertyArgument(argumentName, qualifer, propertyQName);
+ }
+
+ public String getFunctionName(CommonTree functionNameNode)
+ {
+ switch (functionNameNode.getType())
+ {
+ case CMISParser.EQUALS:
+ return Equals.NAME;
+ case CMISParser.UPPER:
+ return Upper.NAME;
+ case CMISParser.SCORE:
+ return Score.NAME;
+ case CMISParser.LOWER:
+ return Lower.NAME;
+ default:
+ throw new CMISQueryException("Unknown function: " + functionNameNode.getText());
+ }
+ }
+}
diff --git a/source/java/org/alfresco/repo/jscript/ScriptNode.java b/source/java/org/alfresco/repo/jscript/ScriptNode.java
index bcd46cc6a4..f1fa468e8b 100644
--- a/source/java/org/alfresco/repo/jscript/ScriptNode.java
+++ b/source/java/org/alfresco/repo/jscript/ScriptNode.java
@@ -151,7 +151,7 @@ public class ScriptNode implements Serializable, Scopeable
/** The versions of this node */
private Scriptable versions = null;
-
+
/** The active workflows acting on this node */
private Scriptable activeWorkflows = null;
diff --git a/source/java/org/alfresco/repo/search/impl/lucene/ADMLuceneIndexerImpl.java b/source/java/org/alfresco/repo/search/impl/lucene/ADMLuceneIndexerImpl.java
index 05826a72ca..bb431efad8 100644
--- a/source/java/org/alfresco/repo/search/impl/lucene/ADMLuceneIndexerImpl.java
+++ b/source/java/org/alfresco/repo/search/impl/lucene/ADMLuceneIndexerImpl.java
@@ -48,6 +48,7 @@ import org.alfresco.i18n.I18NUtil;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.content.transform.ContentTransformer;
+import org.alfresco.repo.dictionary.IndexTokenisationMode;
import org.alfresco.repo.search.IndexerException;
import org.alfresco.repo.search.impl.lucene.analysis.DateTimeAnalyser;
import org.alfresco.repo.search.impl.lucene.fts.FTSIndexerAware;
@@ -105,7 +106,7 @@ public class ADMLuceneIndexerImpl extends AbstractLuceneIndexerImpl imp
* The node service we use to get information about nodes
*/
NodeService nodeService;
-
+
/**
* The tenant service we use for multi-tenancy
*/
@@ -148,7 +149,7 @@ public class ADMLuceneIndexerImpl extends AbstractLuceneIndexerImpl imp
{
this.nodeService = nodeService;
}
-
+
/**
* IOC setting of the tenant service
*
@@ -183,13 +184,12 @@ public class ADMLuceneIndexerImpl extends AbstractLuceneIndexerImpl imp
try
{
NodeRef childRef = relationshipRef.getChildRef();
- if(!childRef.getStoreRef().equals(store))
+ if (!childRef.getStoreRef().equals(store))
{
- throw new LuceneIndexException("Create node failed - node is not in the required store");
+ throw new LuceneIndexException("Create node failed - node is not in the required store");
}
// If we have the root node we delete all other root nodes first
- if ((relationshipRef.getParentRef() == null)
- && tenantService.getBaseName(childRef).equals(nodeService.getRootNode(childRef.getStoreRef())))
+ if ((relationshipRef.getParentRef() == null) && tenantService.getBaseName(childRef).equals(nodeService.getRootNode(childRef.getStoreRef())))
{
addRootNodesToDeletionList();
s_logger.warn("Detected root node addition: deleting all nodes from the index");
@@ -245,7 +245,7 @@ public class ADMLuceneIndexerImpl extends AbstractLuceneIndexerImpl imp
public void updateNode(NodeRef nodeRef) throws LuceneIndexException
{
nodeRef = tenantService.getName(nodeRef);
-
+
if (s_logger.isDebugEnabled())
{
s_logger.debug("Update node " + nodeRef);
@@ -253,9 +253,9 @@ public class ADMLuceneIndexerImpl extends AbstractLuceneIndexerImpl imp
checkAbleToDoWork(IndexUpdateStatus.SYNCRONOUS);
try
{
- if(!nodeRef.getStoreRef().equals(store))
+ if (!nodeRef.getStoreRef().equals(store))
{
- throw new LuceneIndexException("Update node failed - node is not in the required store");
+ throw new LuceneIndexException("Update node failed - node is not in the required store");
}
reindex(nodeRef, false);
}
@@ -275,9 +275,9 @@ public class ADMLuceneIndexerImpl extends AbstractLuceneIndexerImpl imp
checkAbleToDoWork(IndexUpdateStatus.SYNCRONOUS);
try
{
- if(!relationshipRef.getChildRef().getStoreRef().equals(store))
+ if (!relationshipRef.getChildRef().getStoreRef().equals(store))
{
- throw new LuceneIndexException("Delete node failed - node is not in the required store");
+ throw new LuceneIndexException("Delete node failed - node is not in the required store");
}
// The requires a reindex - a delete may remove too much from under this node - that also lives under
// other nodes via secondary associations. All the nodes below require reindex.
@@ -302,9 +302,9 @@ public class ADMLuceneIndexerImpl extends AbstractLuceneIndexerImpl imp
{
// TODO: Optimise
// reindex(relationshipRef.getParentRef());
- if(!relationshipRef.getChildRef().getStoreRef().equals(store))
+ if (!relationshipRef.getChildRef().getStoreRef().equals(store))
{
- throw new LuceneIndexException("Create child relationship failed - node is not in the required store");
+ throw new LuceneIndexException("Create child relationship failed - node is not in the required store");
}
reindex(relationshipRef.getChildRef(), true);
}
@@ -325,13 +325,13 @@ public class ADMLuceneIndexerImpl extends AbstractLuceneIndexerImpl imp
try
{
// TODO: Optimise
- if(!relationshipBeforeRef.getChildRef().getStoreRef().equals(store))
+ if (!relationshipBeforeRef.getChildRef().getStoreRef().equals(store))
{
- throw new LuceneIndexException("Update child relationship failed - node is not in the required store");
+ throw new LuceneIndexException("Update child relationship failed - node is not in the required store");
}
- if(!relationshipAfterRef.getChildRef().getStoreRef().equals(store))
+ if (!relationshipAfterRef.getChildRef().getStoreRef().equals(store))
{
- throw new LuceneIndexException("Update child relationship failed - node is not in the required store");
+ throw new LuceneIndexException("Update child relationship failed - node is not in the required store");
}
if (relationshipBeforeRef.getParentRef() != null)
{
@@ -355,9 +355,9 @@ public class ADMLuceneIndexerImpl extends AbstractLuceneIndexerImpl imp
checkAbleToDoWork(IndexUpdateStatus.SYNCRONOUS);
try
{
- if(!relationshipRef.getChildRef().getStoreRef().equals(store))
+ if (!relationshipRef.getChildRef().getStoreRef().equals(store))
{
- throw new LuceneIndexException("Delete child relationship failed - node is not in the required store");
+ throw new LuceneIndexException("Delete child relationship failed - node is not in the required store");
}
// TODO: Optimise
if (relationshipRef.getParentRef() != null)
@@ -741,7 +741,7 @@ public class ADMLuceneIndexerImpl extends AbstractLuceneIndexerImpl imp
boolean store = true;
boolean index = true;
- boolean tokenise = true;
+ IndexTokenisationMode tokenise = IndexTokenisationMode.TRUE;
boolean atomic = true;
boolean isContent = false;
boolean isMultiLingual = false;
@@ -753,7 +753,7 @@ public class ADMLuceneIndexerImpl extends AbstractLuceneIndexerImpl imp
{
index = propertyDef.isIndexed();
store = propertyDef.isStoredInIndex();
- tokenise = propertyDef.isTokenisedInIndex();
+ tokenise = propertyDef.getIndexTokenisationMode();
atomic = propertyDef.isIndexedAtomically();
isContent = propertyDef.getDataType().getName().equals(DataTypeDefinition.CONTENT);
isMultiLingual = propertyDef.getDataType().getName().equals(DataTypeDefinition.MLTEXT);
@@ -844,7 +844,8 @@ public class ADMLuceneIndexerImpl extends AbstractLuceneIndexerImpl imp
// log it
if (s_logger.isInfoEnabled())
{
- s_logger.info("Not indexed: No transformation: \n" + " source: " + reader + "\n" + " target: " + MimetypeMap.MIMETYPE_TEXT_PLAIN + " at "+nodeService.getPath(nodeRef));
+ s_logger.info("Not indexed: No transformation: \n"
+ + " source: " + reader + "\n" + " target: " + MimetypeMap.MIMETYPE_TEXT_PLAIN + " at " + nodeService.getPath(nodeRef));
}
// don't index from the reader
readerReady = false;
@@ -883,7 +884,7 @@ public class ADMLuceneIndexerImpl extends AbstractLuceneIndexerImpl imp
// log it
if (s_logger.isInfoEnabled())
{
- s_logger.info("Not indexed: Transformation failed at "+nodeService.getPath(nodeRef), e);
+ s_logger.info("Not indexed: Transformation failed at " + nodeService.getPath(nodeRef), e);
}
// don't index from the reader
readerReady = false;
@@ -930,7 +931,7 @@ public class ADMLuceneIndexerImpl extends AbstractLuceneIndexerImpl imp
if (s_logger.isInfoEnabled())
{
s_logger.info("Not indexed: Content Missing \n"
- + " node: " + nodeRef + " at "+nodeService.getPath(nodeRef)+ "\n" + " reader: " + reader + "\n" + " content exists: "
+ + " node: " + nodeRef + " at " + nodeService.getPath(nodeRef) + "\n" + " reader: " + reader + "\n" + " content exists: "
+ (reader == null ? " --- " : Boolean.toString(reader.exists())));
}
// not indexed: content missing
@@ -945,13 +946,17 @@ public class ADMLuceneIndexerImpl extends AbstractLuceneIndexerImpl imp
if (index)
{
- if (tokenise)
+ switch (tokenise)
{
+ case TRUE:
+ case BOTH:
+ default:
fieldIndex = Field.Index.TOKENIZED;
- }
- else
- {
+ break;
+ case FALSE:
fieldIndex = Field.Index.UN_TOKENIZED;
+ break;
+
}
}
else
@@ -995,15 +1000,26 @@ public class ADMLuceneIndexerImpl extends AbstractLuceneIndexerImpl imp
{
locale = I18NUtil.getLocale();
}
- if (tokenise)
+ StringBuilder builder;
+ switch (tokenise)
{
- StringBuilder builder = new StringBuilder();
+ default:
+ case TRUE:
+ builder = new StringBuilder();
builder.append("\u0000").append(locale.toString()).append("\u0000").append(strValue);
doc.add(new Field(attributeName, builder.toString(), fieldStore, fieldIndex, Field.TermVector.NO));
- }
- else
- {
+
+ break;
+ case FALSE:
doc.add(new Field(attributeName, strValue, fieldStore, fieldIndex, Field.TermVector.NO));
+ break;
+ case BOTH:
+ builder = new StringBuilder();
+ builder.append("\u0000").append(locale.toString()).append("\u0000").append(strValue);
+ doc.add(new Field(attributeName, builder.toString(), fieldStore, fieldIndex, Field.TermVector.NO));
+
+ doc.add(new Field(attributeName, strValue, fieldStore, fieldIndex, Field.TermVector.NO));
+ break;
}
}
else if (isDateTime)
@@ -1133,7 +1149,7 @@ public class ADMLuceneIndexerImpl extends AbstractLuceneIndexerImpl imp
{
// can be running in context of System user, hence use input nodeRef
catRef = tenantService.getName(nodeRef, catRef);
-
+
try
{
for (Path path : nodeService.getPaths(catRef, false))
diff --git a/source/java/org/alfresco/repo/search/impl/parsers/CMIS.g b/source/java/org/alfresco/repo/search/impl/parsers/CMIS.g
index 684bfb4914..5e15e49f45 100644
--- a/source/java/org/alfresco/repo/search/impl/parsers/CMIS.g
+++ b/source/java/org/alfresco/repo/search/impl/parsers/CMIS.g
@@ -45,8 +45,7 @@ tokens
COLUMNS;
COLUMN_REF;
QUALIFIER;
- STRING_FUNCTION;
- NUMERIC_FUNCTION;
+ FUNCTION;
SOURCE;
TABLE;
TABLE_REF;
@@ -69,6 +68,10 @@ tokens
STRING_LITERAL;
}
+@lexer::header{package org.alfresco.repo.search.impl.parsers;}
+
+@header {package org.alfresco.repo.search.impl.parsers;}
+
/*
* Instance methods and properties for the parser.
* Realisations of the parser should over-ride these as required
@@ -76,15 +79,66 @@ tokens
@members
{
- /**
- * CMIS strict
- */
+ private Stack paraphrases = new Stack();
+
+ /**
+ * CMIS strict
+ */
public boolean strict()
{
return true;
}
+
+ protected void mismatch(IntStream input, int ttype, BitSet follow) throws RecognitionException
+ {
+ throw new MismatchedTokenException(ttype, input);
+ }
+
+ public Object recoverFromMismatchedSet(IntStream input, RecognitionException e, BitSet follow) throws RecognitionException
+ {
+ throw e;
+ }
+
+ public String getErrorMessage(RecognitionException e, String[] tokenNames)
+ {
+ List stack = getRuleInvocationStack(e, this.getClass().getName());
+ String msg = null;
+ if(e instanceof NoViableAltException)
+ {
+ NoViableAltException nvae = (NoViableAltException)e;
+ msg = " no viable alt; token="+e.token+
+ " (decision="+nvae.decisionNumber+
+ " state "+nvae.stateNumber+")"+
+ " decision=<<"+nvae.grammarDecisionDescription+">>";
+ }
+ else
+ {
+ msg = super.getErrorMessage(e, tokenNames);
+ }
+ if(paraphrases.size() > 0)
+ {
+ String paraphrase = (String)paraphrases.peek();
+ msg = msg+" "+paraphrase;
+ }
+
+ return stack+" "+msg;
+ }
+
+ public String getTokenErrorDisplay(Token t)
+ {
+ return t.toString();
+ }
}
+@rulecatch
+{
+catch(RecognitionException e)
+{
+ throw e;
+}
+}
+
+
/**
* This is mostly a direct take fom the CMIS spec.
* The only significant chnanges are to remove left recursion which is not supported in antlr
@@ -92,12 +146,14 @@ tokens
* The top level rule for the parser
*/
query
- : SELECT selectList fromClause whereClause? orderByClause?
+ : SELECT selectList fromClause whereClause? orderByClause? EOF
-> ^(QUERY selectList fromClause whereClause? orderByClause?)
;
-selectList
+selectList
+ @init { paraphrases.push("in select list"); }
+ @after{ paraphrases.pop(); }
: STAR
-> ^(ALL_COLUMNS)
| selectSubList ( COMMA selectSubList )*
@@ -117,10 +173,8 @@ selectSubList
valueExpression
: columnReference
-> columnReference
- | stringValueFunction
- -> stringValueFunction
- | numericValueFunction
- -> numericValueFunction
+ | valueFunction
+ -> valueFunction
;
columnReference
@@ -137,15 +191,17 @@ multiValuedColumnReference
-> ^(COLUMN_REF multiValuedColumnName qualifier?)
;
-stringValueFunction
- : ( functionName=UPPER | functionName=LOWER ) LPAREN columnReference RPAREN
- -> ^(STRING_FUNCTION $functionName columnReference)
+valueFunction
+ : functionName=keyWordOrId LPAREN functionArgument* RPAREN
+ -> ^(FUNCTION $functionName functionArgument*)
;
-numericValueFunction
- : functionName=SCORE LPAREN qualifier? RPAREN
- -> ^(NUMERIC_FUNCTION $functionName qualifier?)
- ;
+functionArgument
+ : qualifier DOT columnName
+ -> ^(COLUMN_REF columnName qualifier)
+ | identifier
+ | literalOrParameterName
+ ;
qualifier
: (tableName) => tableName
@@ -155,6 +211,8 @@ qualifier
;
fromClause
+ @init { paraphrases.push("in from"); }
+ @after{ paraphrases.pop(); }
: FROM tableReference
-> tableReference
;
@@ -182,14 +240,14 @@ joinedTable
joinedTables
: singleTable joinedTable+
- -> singleTable joinedTable+
+ -> ^(SOURCE singleTable joinedTable+)
;
joinType
: INNER
-> INNER
| LEFT OUTER?
- -> LEFT OUTER?
+ -> LEFT
;
joinSpecification
@@ -202,6 +260,8 @@ joinSpecification
* Broken out the left recursion from the spec
*/
whereClause
+ @init { paraphrases.push("in where"); }
+ @after{ paraphrases.pop(); }
: WHERE searchOrCondition
-> searchOrCondition
;
@@ -321,6 +381,8 @@ folderPredicateArgs
;
orderByClause
+ @init { paraphrases.push("in order by"); }
+ @after{ paraphrases.pop(); }
: ORDER BY sortSpecification ( COMMA sortSpecification )*
-> ^(ORDER sortSpecification+)
;
diff --git a/source/java/org/alfresco/repo/search/impl/parsers/CMIS.tokens b/source/java/org/alfresco/repo/search/impl/parsers/CMIS.tokens
new file mode 100644
index 0000000000..eaf5076c5b
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/parsers/CMIS.tokens
@@ -0,0 +1,84 @@
+FUNCTION=10
+WHERE=44
+EXPONENT=82
+PRED_FTS=22
+STAR=30
+INNER=39
+ORDER=61
+DOUBLE_QUOTE=68
+NUMERIC_LITERAL=27
+PRED_COMPARISON=18
+CONTAINS=58
+TABLE=12
+SOURCE=11
+DOTDOT=74
+EQUALS=43
+NOT=47
+ID=67
+AND=46
+LPAREN=35
+LESSTHANOREQUALS=51
+AS=32
+SINGLE_QUOTE=76
+RPAREN=36
+TILDA=75
+PRED_LIKE=21
+STRING_LITERAL=28
+IN=53
+DECIMAL_NUMERAL=80
+FLOATING_POINT_LITERAL=69
+COMMA=31
+IS=55
+LEFT=40
+SIGNED_INTEGER=87
+PARAMETER=14
+COLUMN=6
+PLUS=78
+QUOTED_STRING=66
+ZERO_DIGIT=84
+DIGIT=81
+DOT=34
+COLUMN_REF=8
+SELECT=29
+LIKE=54
+GREATERTHAN=50
+DOTSTAR=33
+E=86
+OUTER=41
+BY=62
+LESSTHAN=49
+NON_ZERO_DIGIT=85
+ASC=63
+QUALIFIER=9
+CONJUNCTION=15
+NULL=56
+ON=42
+NOTEQUALS=48
+MINUS=79
+LIST=23
+PRED_DESCENDANT=25
+JOIN=38
+IN_FOLDER=59
+COLON=65
+GREATERTHANOREQUALS=52
+DISJUNCTION=16
+COLUMNS=7
+WS=83
+ANY=57
+SCORE=73
+NEGATION=17
+TABLE_REF=13
+SORT_SPECIFICATION=26
+IN_TREE=60
+OR=45
+PRED_CHILD=24
+PRED_EXISTS=20
+QUERY=4
+LOWER=72
+DECIMAL_INTEGER_LITERAL=70
+DESC=64
+ALL_COLUMNS=5
+FROM=37
+UPPER=71
+PRED_IN=19
+ESCAPED_SINGLE_QUOTE=77
diff --git a/source/java/org/alfresco/repo/search/impl/parsers/CMISLexer.java b/source/java/org/alfresco/repo/search/impl/parsers/CMISLexer.java
new file mode 100644
index 0000000000..25441d1cef
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/parsers/CMISLexer.java
@@ -0,0 +1,3353 @@
+// $ANTLR 3.1b1 W:\\workspace-cmis\\ANTLR\\CMIS.g 2008-07-08 14:37:53
+package org.alfresco.repo.search.impl.parsers;
+
+import org.antlr.runtime.*;
+import java.util.Stack;
+import java.util.List;
+import java.util.ArrayList;
+
+public class CMISLexer extends Lexer {
+ public static final int FUNCTION=10;
+ public static final int WHERE=44;
+ public static final int EXPONENT=82;
+ public static final int PRED_FTS=22;
+ public static final int STAR=30;
+ public static final int INNER=39;
+ public static final int ORDER=61;
+ public static final int DOUBLE_QUOTE=68;
+ public static final int NUMERIC_LITERAL=27;
+ public static final int PRED_COMPARISON=18;
+ public static final int CONTAINS=58;
+ public static final int TABLE=12;
+ public static final int SOURCE=11;
+ public static final int EQUALS=43;
+ public static final int DOTDOT=74;
+ public static final int NOT=47;
+ public static final int ID=67;
+ public static final int AND=46;
+ public static final int EOF=-1;
+ public static final int LPAREN=35;
+ public static final int LESSTHANOREQUALS=51;
+ public static final int AS=32;
+ public static final int SINGLE_QUOTE=76;
+ public static final int RPAREN=36;
+ public static final int TILDA=75;
+ public static final int PRED_LIKE=21;
+ public static final int STRING_LITERAL=28;
+ public static final int IN=53;
+ public static final int DECIMAL_NUMERAL=80;
+ public static final int FLOATING_POINT_LITERAL=69;
+ public static final int COMMA=31;
+ public static final int IS=55;
+ public static final int LEFT=40;
+ public static final int SIGNED_INTEGER=87;
+ public static final int PARAMETER=14;
+ public static final int COLUMN=6;
+ public static final int PLUS=78;
+ public static final int QUOTED_STRING=66;
+ public static final int ZERO_DIGIT=84;
+ public static final int DIGIT=81;
+ public static final int DOT=34;
+ public static final int COLUMN_REF=8;
+ public static final int SELECT=29;
+ public static final int LIKE=54;
+ public static final int DOTSTAR=33;
+ public static final int GREATERTHAN=50;
+ public static final int OUTER=41;
+ public static final int E=86;
+ public static final int LESSTHAN=49;
+ public static final int BY=62;
+ public static final int ASC=63;
+ public static final int NON_ZERO_DIGIT=85;
+ public static final int QUALIFIER=9;
+ public static final int CONJUNCTION=15;
+ public static final int NULL=56;
+ public static final int ON=42;
+ public static final int NOTEQUALS=48;
+ public static final int MINUS=79;
+ public static final int LIST=23;
+ public static final int PRED_DESCENDANT=25;
+ public static final int JOIN=38;
+ public static final int IN_FOLDER=59;
+ public static final int GREATERTHANOREQUALS=52;
+ public static final int COLON=65;
+ public static final int COLUMNS=7;
+ public static final int DISJUNCTION=16;
+ public static final int ANY=57;
+ public static final int WS=83;
+ public static final int SCORE=73;
+ public static final int NEGATION=17;
+ public static final int TABLE_REF=13;
+ public static final int SORT_SPECIFICATION=26;
+ public static final int IN_TREE=60;
+ public static final int OR=45;
+ public static final int PRED_CHILD=24;
+ public static final int PRED_EXISTS=20;
+ public static final int QUERY=4;
+ public static final int LOWER=72;
+ public static final int ALL_COLUMNS=5;
+ public static final int DESC=64;
+ public static final int DECIMAL_INTEGER_LITERAL=70;
+ public static final int FROM=37;
+ public static final int UPPER=71;
+ public static final int PRED_IN=19;
+ public static final int ESCAPED_SINGLE_QUOTE=77;
+
+ // delegates
+ // delegators
+
+ public CMISLexer() {;}
+ public CMISLexer(CharStream input) {
+ this(input, new RecognizerSharedState());
+ }
+ public CMISLexer(CharStream input, RecognizerSharedState state) {
+ super(input,state);
+
+ }
+ public String getGrammarFileName() { return "W:\\workspace-cmis\\ANTLR\\CMIS.g"; }
+
+ // $ANTLR start SELECT
+ public final void mSELECT() throws RecognitionException {
+ try {
+ int _type = SELECT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:499:8: ( ( 'S' | 's' ) ( 'E' | 'e' ) ( 'L' | 'l' ) ( 'E' | 'e' ) ( 'C' | 'c' ) ( 'T' | 't' ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:499:10: ( 'S' | 's' ) ( 'E' | 'e' ) ( 'L' | 'l' ) ( 'E' | 'e' ) ( 'C' | 'c' ) ( 'T' | 't' )
+ {
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end SELECT
+
+ // $ANTLR start AS
+ public final void mAS() throws RecognitionException {
+ try {
+ int _type = AS;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:500:4: ( ( 'A' | 'a' ) ( 'S' | 's' ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:500:6: ( 'A' | 'a' ) ( 'S' | 's' )
+ {
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end AS
+
+ // $ANTLR start UPPER
+ public final void mUPPER() throws RecognitionException {
+ try {
+ int _type = UPPER;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:501:7: ( ( 'U' | 'u' ) ( 'P' | 'p' ) ( 'P' | 'p' ) ( 'E' | 'e' ) ( 'R' | 'r' ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:501:9: ( 'U' | 'u' ) ( 'P' | 'p' ) ( 'P' | 'p' ) ( 'E' | 'e' ) ( 'R' | 'r' )
+ {
+ if ( input.LA(1)=='U'||input.LA(1)=='u' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='P'||input.LA(1)=='p' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='P'||input.LA(1)=='p' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end UPPER
+
+ // $ANTLR start LOWER
+ public final void mLOWER() throws RecognitionException {
+ try {
+ int _type = LOWER;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:502:7: ( ( 'L' | 'l' ) ( 'O' | 'o' ) ( 'W' | 'w' ) ( 'E' | 'e' ) ( 'R' | 'r' ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:502:9: ( 'L' | 'l' ) ( 'O' | 'o' ) ( 'W' | 'w' ) ( 'E' | 'e' ) ( 'R' | 'r' )
+ {
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='W'||input.LA(1)=='w' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end LOWER
+
+ // $ANTLR start FROM
+ public final void mFROM() throws RecognitionException {
+ try {
+ int _type = FROM;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:503:6: ( ( 'F' | 'f' ) ( 'R' | 'r' ) ( 'O' | 'o' ) ( 'M' | 'm' ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:503:8: ( 'F' | 'f' ) ( 'R' | 'r' ) ( 'O' | 'o' ) ( 'M' | 'm' )
+ {
+ if ( input.LA(1)=='F'||input.LA(1)=='f' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='M'||input.LA(1)=='m' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end FROM
+
+ // $ANTLR start JOIN
+ public final void mJOIN() throws RecognitionException {
+ try {
+ int _type = JOIN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:504:6: ( ( 'J' | 'j' ) ( 'O' | 'o' ) ( 'I' | 'i' ) ( 'N' | 'n' ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:504:8: ( 'J' | 'j' ) ( 'O' | 'o' ) ( 'I' | 'i' ) ( 'N' | 'n' )
+ {
+ if ( input.LA(1)=='J'||input.LA(1)=='j' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end JOIN
+
+ // $ANTLR start INNER
+ public final void mINNER() throws RecognitionException {
+ try {
+ int _type = INNER;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:505:7: ( ( 'I' | 'i' ) ( 'N' | 'n' ) ( 'N' | 'n' ) ( 'E' | 'e' ) ( 'R' | 'r' ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:505:9: ( 'I' | 'i' ) ( 'N' | 'n' ) ( 'N' | 'n' ) ( 'E' | 'e' ) ( 'R' | 'r' )
+ {
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end INNER
+
+ // $ANTLR start LEFT
+ public final void mLEFT() throws RecognitionException {
+ try {
+ int _type = LEFT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:506:6: ( ( 'L' | 'l' ) ( 'E' | 'e' ) ( 'F' | 'f' ) ( 'T' | 't' ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:506:8: ( 'L' | 'l' ) ( 'E' | 'e' ) ( 'F' | 'f' ) ( 'T' | 't' )
+ {
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='F'||input.LA(1)=='f' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end LEFT
+
+ // $ANTLR start OUTER
+ public final void mOUTER() throws RecognitionException {
+ try {
+ int _type = OUTER;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:507:7: ( ( 'O' | 'o' ) ( 'U' | 'u' ) ( 'T' | 't' ) ( 'E' | 'e' ) ( 'R' | 'r' ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:507:9: ( 'O' | 'o' ) ( 'U' | 'u' ) ( 'T' | 't' ) ( 'E' | 'e' ) ( 'R' | 'r' )
+ {
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='U'||input.LA(1)=='u' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end OUTER
+
+ // $ANTLR start ON
+ public final void mON() throws RecognitionException {
+ try {
+ int _type = ON;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:508:4: ( ( 'O' | 'o' ) ( 'N' | 'n' ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:508:6: ( 'O' | 'o' ) ( 'N' | 'n' )
+ {
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end ON
+
+ // $ANTLR start WHERE
+ public final void mWHERE() throws RecognitionException {
+ try {
+ int _type = WHERE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:509:7: ( ( 'W' | 'w' ) ( 'H' | 'h' ) ( 'E' | 'e' ) ( 'R' | 'r' ) ( 'E' | 'e' ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:509:9: ( 'W' | 'w' ) ( 'H' | 'h' ) ( 'E' | 'e' ) ( 'R' | 'r' ) ( 'E' | 'e' )
+ {
+ if ( input.LA(1)=='W'||input.LA(1)=='w' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='H'||input.LA(1)=='h' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end WHERE
+
+ // $ANTLR start OR
+ public final void mOR() throws RecognitionException {
+ try {
+ int _type = OR;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:510:4: ( ( 'O' | 'o' ) ( 'R' | 'r' ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:510:6: ( 'O' | 'o' ) ( 'R' | 'r' )
+ {
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end OR
+
+ // $ANTLR start AND
+ public final void mAND() throws RecognitionException {
+ try {
+ int _type = AND;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:511:5: ( ( 'A' | 'a' ) ( 'N' | 'n' ) ( 'D' | 'd' ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:511:7: ( 'A' | 'a' ) ( 'N' | 'n' ) ( 'D' | 'd' )
+ {
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='D'||input.LA(1)=='d' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end AND
+
+ // $ANTLR start NOT
+ public final void mNOT() throws RecognitionException {
+ try {
+ int _type = NOT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:512:5: ( ( 'N' | 'n' ) ( 'O' | 'o' ) ( 'T' | 't' ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:512:7: ( 'N' | 'n' ) ( 'O' | 'o' ) ( 'T' | 't' )
+ {
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end NOT
+
+ // $ANTLR start IN
+ public final void mIN() throws RecognitionException {
+ try {
+ int _type = IN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:513:4: ( ( 'I' | 'i' ) ( 'N' | 'n' ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:513:6: ( 'I' | 'i' ) ( 'N' | 'n' )
+ {
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end IN
+
+ // $ANTLR start LIKE
+ public final void mLIKE() throws RecognitionException {
+ try {
+ int _type = LIKE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:514:6: ( ( 'L' | 'l' ) ( 'I' | 'i' ) ( 'K' | 'k' ) ( 'E' | 'e' ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:514:8: ( 'L' | 'l' ) ( 'I' | 'i' ) ( 'K' | 'k' ) ( 'E' | 'e' )
+ {
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='K'||input.LA(1)=='k' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end LIKE
+
+ // $ANTLR start IS
+ public final void mIS() throws RecognitionException {
+ try {
+ int _type = IS;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:515:4: ( ( 'I' | 'i' ) ( 'S' | 's' ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:515:6: ( 'I' | 'i' ) ( 'S' | 's' )
+ {
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end IS
+
+ // $ANTLR start NULL
+ public final void mNULL() throws RecognitionException {
+ try {
+ int _type = NULL;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:516:6: ( ( 'N' | 'n' ) ( 'U' | 'u' ) ( 'L' | 'l' ) ( 'L' | 'l' ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:516:8: ( 'N' | 'n' ) ( 'U' | 'u' ) ( 'L' | 'l' ) ( 'L' | 'l' )
+ {
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='U'||input.LA(1)=='u' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end NULL
+
+ // $ANTLR start ANY
+ public final void mANY() throws RecognitionException {
+ try {
+ int _type = ANY;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:517:5: ( ( 'A' | 'a' ) ( 'N' | 'n' ) ( 'Y' | 'y' ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:517:7: ( 'A' | 'a' ) ( 'N' | 'n' ) ( 'Y' | 'y' )
+ {
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='Y'||input.LA(1)=='y' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end ANY
+
+ // $ANTLR start CONTAINS
+ public final void mCONTAINS() throws RecognitionException {
+ try {
+ int _type = CONTAINS;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:518:9: ( ( 'C' | 'c' ) ( 'O' | 'o' ) ( 'N' | 'n' ) ( 'T' | 't' ) ( 'A' | 'a' ) ( 'I' | 'i' ) ( 'N' | 'n' ) ( 'S' | 's' ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:518:11: ( 'C' | 'c' ) ( 'O' | 'o' ) ( 'N' | 'n' ) ( 'T' | 't' ) ( 'A' | 'a' ) ( 'I' | 'i' ) ( 'N' | 'n' ) ( 'S' | 's' )
+ {
+ if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end CONTAINS
+
+ // $ANTLR start IN_FOLDER
+ public final void mIN_FOLDER() throws RecognitionException {
+ try {
+ int _type = IN_FOLDER;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:520:2: ( ( 'I' | 'i' ) ( 'N' | 'n' ) '_' ( 'F' | 'f' ) ( 'O' | 'o' ) ( 'L' | 'l' ) ( 'D' | 'd' ) ( 'E' | 'e' ) ( 'R' | 'r' ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:520:4: ( 'I' | 'i' ) ( 'N' | 'n' ) '_' ( 'F' | 'f' ) ( 'O' | 'o' ) ( 'L' | 'l' ) ( 'D' | 'd' ) ( 'E' | 'e' ) ( 'R' | 'r' )
+ {
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ match('_');
+ if ( input.LA(1)=='F'||input.LA(1)=='f' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='D'||input.LA(1)=='d' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end IN_FOLDER
+
+ // $ANTLR start IN_TREE
+ public final void mIN_TREE() throws RecognitionException {
+ try {
+ int _type = IN_TREE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:521:9: ( ( 'I' | 'i' ) ( 'N' | 'n' ) '_' ( 'T' | 't' ) ( 'R' | 'r' ) ( 'E' | 'e' ) ( 'E' | 'e' ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:521:11: ( 'I' | 'i' ) ( 'N' | 'n' ) '_' ( 'T' | 't' ) ( 'R' | 'r' ) ( 'E' | 'e' ) ( 'E' | 'e' )
+ {
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ match('_');
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end IN_TREE
+
+ // $ANTLR start ORDER
+ public final void mORDER() throws RecognitionException {
+ try {
+ int _type = ORDER;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:522:7: ( ( 'O' | 'o' ) ( 'R' | 'r' ) ( 'D' | 'd' ) ( 'E' | 'e' ) ( 'R' | 'r' ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:522:9: ( 'O' | 'o' ) ( 'R' | 'r' ) ( 'D' | 'd' ) ( 'E' | 'e' ) ( 'R' | 'r' )
+ {
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='D'||input.LA(1)=='d' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end ORDER
+
+ // $ANTLR start BY
+ public final void mBY() throws RecognitionException {
+ try {
+ int _type = BY;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:523:4: ( ( 'B' | 'b' ) ( 'Y' | 'y' ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:523:6: ( 'B' | 'b' ) ( 'Y' | 'y' )
+ {
+ if ( input.LA(1)=='B'||input.LA(1)=='b' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='Y'||input.LA(1)=='y' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end BY
+
+ // $ANTLR start ASC
+ public final void mASC() throws RecognitionException {
+ try {
+ int _type = ASC;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:524:5: ( ( 'A' | 'a' ) ( 'S' | 's' ) ( 'C' | 'c' ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:524:7: ( 'A' | 'a' ) ( 'S' | 's' ) ( 'C' | 'c' )
+ {
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end ASC
+
+ // $ANTLR start DESC
+ public final void mDESC() throws RecognitionException {
+ try {
+ int _type = DESC;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:525:6: ( ( 'D' | 'd' ) ( 'E' | 'e' ) ( 'S' | 's' ) ( 'C' | 'c' ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:525:8: ( 'D' | 'd' ) ( 'E' | 'e' ) ( 'S' | 's' ) ( 'C' | 'c' )
+ {
+ if ( input.LA(1)=='D'||input.LA(1)=='d' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end DESC
+
+ // $ANTLR start SCORE
+ public final void mSCORE() throws RecognitionException {
+ try {
+ int _type = SCORE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:526:7: ( ( 'S' | 's' ) ( 'C' | 'c' ) ( 'O' | 'o' ) ( 'R' | 'r' ) ( 'E' | 'e' ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:526:9: ( 'S' | 's' ) ( 'C' | 'c' ) ( 'O' | 'o' ) ( 'R' | 'r' ) ( 'E' | 'e' )
+ {
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end SCORE
+
+ // $ANTLR start LPAREN
+ public final void mLPAREN() throws RecognitionException {
+ try {
+ int _type = LPAREN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:527:8: ( '(' )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:527:10: '('
+ {
+ match('(');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end LPAREN
+
+ // $ANTLR start RPAREN
+ public final void mRPAREN() throws RecognitionException {
+ try {
+ int _type = RPAREN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:528:8: ( ')' )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:528:10: ')'
+ {
+ match(')');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end RPAREN
+
+ // $ANTLR start STAR
+ public final void mSTAR() throws RecognitionException {
+ try {
+ int _type = STAR;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:529:6: ( '*' )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:529:8: '*'
+ {
+ match('*');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end STAR
+
+ // $ANTLR start COMMA
+ public final void mCOMMA() throws RecognitionException {
+ try {
+ int _type = COMMA;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:530:7: ( ',' )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:530:9: ','
+ {
+ match(',');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end COMMA
+
+ // $ANTLR start DOTSTAR
+ public final void mDOTSTAR() throws RecognitionException {
+ try {
+ int _type = DOTSTAR;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:531:9: ( '.*' )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:531:11: '.*'
+ {
+ match(".*");
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end DOTSTAR
+
+ // $ANTLR start DOT
+ public final void mDOT() throws RecognitionException {
+ try {
+ int _type = DOT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:532:5: ( '.' )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:532:7: '.'
+ {
+ match('.');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end DOT
+
+ // $ANTLR start DOTDOT
+ public final void mDOTDOT() throws RecognitionException {
+ try {
+ int _type = DOTDOT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:533:8: ( '..' )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:533:10: '..'
+ {
+ match("..");
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end DOTDOT
+
+ // $ANTLR start EQUALS
+ public final void mEQUALS() throws RecognitionException {
+ try {
+ int _type = EQUALS;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:534:9: ( '=' )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:534:11: '='
+ {
+ match('=');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end EQUALS
+
+ // $ANTLR start TILDA
+ public final void mTILDA() throws RecognitionException {
+ try {
+ int _type = TILDA;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:535:7: ( '~' )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:535:9: '~'
+ {
+ match('~');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end TILDA
+
+ // $ANTLR start NOTEQUALS
+ public final void mNOTEQUALS() throws RecognitionException {
+ try {
+ int _type = NOTEQUALS;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:537:2: ( '<>' )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:537:4: '<>'
+ {
+ match("<>");
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end NOTEQUALS
+
+ // $ANTLR start GREATERTHAN
+ public final void mGREATERTHAN() throws RecognitionException {
+ try {
+ int _type = GREATERTHAN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:539:2: ( '>' )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:539:4: '>'
+ {
+ match('>');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end GREATERTHAN
+
+ // $ANTLR start LESSTHAN
+ public final void mLESSTHAN() throws RecognitionException {
+ try {
+ int _type = LESSTHAN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:541:2: ( '<' )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:541:4: '<'
+ {
+ match('<');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end LESSTHAN
+
+ // $ANTLR start GREATERTHANOREQUALS
+ public final void mGREATERTHANOREQUALS() throws RecognitionException {
+ try {
+ int _type = GREATERTHANOREQUALS;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:543:2: ( '>=' )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:543:4: '>='
+ {
+ match(">=");
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end GREATERTHANOREQUALS
+
+ // $ANTLR start LESSTHANOREQUALS
+ public final void mLESSTHANOREQUALS() throws RecognitionException {
+ try {
+ int _type = LESSTHANOREQUALS;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:545:2: ( '<=' )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:545:4: '<='
+ {
+ match("<=");
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end LESSTHANOREQUALS
+
+ // $ANTLR start COLON
+ public final void mCOLON() throws RecognitionException {
+ try {
+ int _type = COLON;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:546:7: ( ':' )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:546:9: ':'
+ {
+ match(':');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end COLON
+
+ // $ANTLR start SINGLE_QUOTE
+ public final void mSINGLE_QUOTE() throws RecognitionException {
+ try {
+ int _type = SINGLE_QUOTE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:549:9: ( '\\'' )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:549:17: '\\''
+ {
+ match('\'');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end SINGLE_QUOTE
+
+ // $ANTLR start DOUBLE_QUOTE
+ public final void mDOUBLE_QUOTE() throws RecognitionException {
+ try {
+ int _type = DOUBLE_QUOTE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:552:2: ( '\"' )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:552:4: '\"'
+ {
+ match('\"');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end DOUBLE_QUOTE
+
+ // $ANTLR start QUOTED_STRING
+ public final void mQUOTED_STRING() throws RecognitionException {
+ try {
+ int _type = QUOTED_STRING;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:556:2: ( SINGLE_QUOTE (~ SINGLE_QUOTE | ESCAPED_SINGLE_QUOTE )* SINGLE_QUOTE )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:556:4: SINGLE_QUOTE (~ SINGLE_QUOTE | ESCAPED_SINGLE_QUOTE )* SINGLE_QUOTE
+ {
+ mSINGLE_QUOTE();
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:556:17: (~ SINGLE_QUOTE | ESCAPED_SINGLE_QUOTE )*
+ loop1:
+ do {
+ int alt1=3;
+ int LA1_0 = input.LA(1);
+
+ if ( (LA1_0=='\'') ) {
+ int LA1_1 = input.LA(2);
+
+ if ( (LA1_1=='\'') ) {
+ alt1=2;
+ }
+
+
+ }
+ else if ( ((LA1_0>='\u0000' && LA1_0<='&')||(LA1_0>='(' && LA1_0<='\uFFFE')) ) {
+ alt1=1;
+ }
+
+
+ switch (alt1) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:556:19: ~ SINGLE_QUOTE
+ {
+ if ( (input.LA(1)>='\u0000' && input.LA(1)<='K')||(input.LA(1)>='M' && input.LA(1)<='\uFFFE') ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:556:35: ESCAPED_SINGLE_QUOTE
+ {
+ mESCAPED_SINGLE_QUOTE();
+
+ }
+ break;
+
+ default :
+ break loop1;
+ }
+ } while (true);
+
+ mSINGLE_QUOTE();
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end QUOTED_STRING
+
+ // $ANTLR start DECIMAL_INTEGER_LITERAL
+ public final void mDECIMAL_INTEGER_LITERAL() throws RecognitionException {
+ try {
+ int _type = DECIMAL_INTEGER_LITERAL;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:564:9: ( ( PLUS | MINUS )? DECIMAL_NUMERAL )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:564:11: ( PLUS | MINUS )? DECIMAL_NUMERAL
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:564:11: ( PLUS | MINUS )?
+ int alt2=2;
+ int LA2_0 = input.LA(1);
+
+ if ( (LA2_0=='+'||LA2_0=='-') ) {
+ alt2=1;
+ }
+ switch (alt2) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:
+ {
+ if ( input.LA(1)=='+'||input.LA(1)=='-' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+ break;
+
+ }
+
+ mDECIMAL_NUMERAL();
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end DECIMAL_INTEGER_LITERAL
+
+ // $ANTLR start FLOATING_POINT_LITERAL
+ public final void mFLOATING_POINT_LITERAL() throws RecognitionException {
+ try {
+ int _type = FLOATING_POINT_LITERAL;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:571:2: ( ( DIGIT )+ DOT ( DIGIT )* ( EXPONENT )? | DOT ( DIGIT )+ ( EXPONENT )? | ( DIGIT )+ EXPONENT )
+ int alt9=3;
+ alt9 = dfa9.predict(input);
+ switch (alt9) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:571:4: ( DIGIT )+ DOT ( DIGIT )* ( EXPONENT )?
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:571:4: ( DIGIT )+
+ int cnt3=0;
+ loop3:
+ do {
+ int alt3=2;
+ int LA3_0 = input.LA(1);
+
+ if ( ((LA3_0>='0' && LA3_0<='9')) ) {
+ alt3=1;
+ }
+
+
+ switch (alt3) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:571:4: DIGIT
+ {
+ mDIGIT();
+
+ }
+ break;
+
+ default :
+ if ( cnt3 >= 1 ) break loop3;
+ EarlyExitException eee =
+ new EarlyExitException(3, input);
+ throw eee;
+ }
+ cnt3++;
+ } while (true);
+
+ mDOT();
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:571:15: ( DIGIT )*
+ loop4:
+ do {
+ int alt4=2;
+ int LA4_0 = input.LA(1);
+
+ if ( ((LA4_0>='0' && LA4_0<='9')) ) {
+ alt4=1;
+ }
+
+
+ switch (alt4) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:571:15: DIGIT
+ {
+ mDIGIT();
+
+ }
+ break;
+
+ default :
+ break loop4;
+ }
+ } while (true);
+
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:571:22: ( EXPONENT )?
+ int alt5=2;
+ int LA5_0 = input.LA(1);
+
+ if ( (LA5_0=='E'||LA5_0=='e') ) {
+ alt5=1;
+ }
+ switch (alt5) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:571:22: EXPONENT
+ {
+ mEXPONENT();
+
+ }
+ break;
+
+ }
+
+
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:572:4: DOT ( DIGIT )+ ( EXPONENT )?
+ {
+ mDOT();
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:572:8: ( DIGIT )+
+ int cnt6=0;
+ loop6:
+ do {
+ int alt6=2;
+ int LA6_0 = input.LA(1);
+
+ if ( ((LA6_0>='0' && LA6_0<='9')) ) {
+ alt6=1;
+ }
+
+
+ switch (alt6) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:572:8: DIGIT
+ {
+ mDIGIT();
+
+ }
+ break;
+
+ default :
+ if ( cnt6 >= 1 ) break loop6;
+ EarlyExitException eee =
+ new EarlyExitException(6, input);
+ throw eee;
+ }
+ cnt6++;
+ } while (true);
+
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:572:15: ( EXPONENT )?
+ int alt7=2;
+ int LA7_0 = input.LA(1);
+
+ if ( (LA7_0=='E'||LA7_0=='e') ) {
+ alt7=1;
+ }
+ switch (alt7) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:572:15: EXPONENT
+ {
+ mEXPONENT();
+
+ }
+ break;
+
+ }
+
+
+ }
+ break;
+ case 3 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:573:4: ( DIGIT )+ EXPONENT
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:573:4: ( DIGIT )+
+ int cnt8=0;
+ loop8:
+ do {
+ int alt8=2;
+ int LA8_0 = input.LA(1);
+
+ if ( ((LA8_0>='0' && LA8_0<='9')) ) {
+ alt8=1;
+ }
+
+
+ switch (alt8) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:573:4: DIGIT
+ {
+ mDIGIT();
+
+ }
+ break;
+
+ default :
+ if ( cnt8 >= 1 ) break loop8;
+ EarlyExitException eee =
+ new EarlyExitException(8, input);
+ throw eee;
+ }
+ cnt8++;
+ } while (true);
+
+ mEXPONENT();
+
+ }
+ break;
+
+ }
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end FLOATING_POINT_LITERAL
+
+ // $ANTLR start ID
+ public final void mID() throws RecognitionException {
+ try {
+ int _type = ID;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:577:4: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '0' | '_' | '$' | '#' )* )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:577:6: ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '0' | '_' | '$' | '#' )*
+ {
+ if ( (input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:577:29: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '0' | '_' | '$' | '#' )*
+ loop10:
+ do {
+ int alt10=2;
+ int LA10_0 = input.LA(1);
+
+ if ( ((LA10_0>='#' && LA10_0<='$')||LA10_0=='0'||(LA10_0>='A' && LA10_0<='Z')||LA10_0=='_'||(LA10_0>='a' && LA10_0<='z')) ) {
+ alt10=1;
+ }
+
+
+ switch (alt10) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:
+ {
+ if ( (input.LA(1)>='#' && input.LA(1)<='$')||input.LA(1)=='0'||(input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+ break;
+
+ default :
+ break loop10;
+ }
+ } while (true);
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end ID
+
+ // $ANTLR start WS
+ public final void mWS() throws RecognitionException {
+ try {
+ int _type = WS;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:578:4: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:578:6: ( ' ' | '\\t' | '\\r' | '\\n' )+
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:578:6: ( ' ' | '\\t' | '\\r' | '\\n' )+
+ int cnt11=0;
+ loop11:
+ do {
+ int alt11=2;
+ int LA11_0 = input.LA(1);
+
+ if ( ((LA11_0>='\t' && LA11_0<='\n')||LA11_0=='\r'||LA11_0==' ') ) {
+ alt11=1;
+ }
+
+
+ switch (alt11) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:
+ {
+ if ( (input.LA(1)>='\t' && input.LA(1)<='\n')||input.LA(1)=='\r'||input.LA(1)==' ' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+ break;
+
+ default :
+ if ( cnt11 >= 1 ) break loop11;
+ EarlyExitException eee =
+ new EarlyExitException(11, input);
+ throw eee;
+ }
+ cnt11++;
+ } while (true);
+
+ _channel = HIDDEN;
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end WS
+
+ // $ANTLR start ESCAPED_SINGLE_QUOTE
+ public final void mESCAPED_SINGLE_QUOTE() throws RecognitionException {
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:586:9: ( '\\'\\'' )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:586:17: '\\'\\''
+ {
+ match("\'\'");
+
+
+ }
+
+ }
+ finally {
+ }
+ }
+ // $ANTLR end ESCAPED_SINGLE_QUOTE
+
+ // $ANTLR start DECIMAL_NUMERAL
+ public final void mDECIMAL_NUMERAL() throws RecognitionException {
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:594:2: ( ZERO_DIGIT | NON_ZERO_DIGIT ( DIGIT )* )
+ int alt13=2;
+ int LA13_0 = input.LA(1);
+
+ if ( (LA13_0=='0') ) {
+ alt13=1;
+ }
+ else if ( ((LA13_0>='1' && LA13_0<='9')) ) {
+ alt13=2;
+ }
+ else {
+ NoViableAltException nvae =
+ new NoViableAltException("", 13, 0, input);
+
+ throw nvae;
+ }
+ switch (alt13) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:594:4: ZERO_DIGIT
+ {
+ mZERO_DIGIT();
+
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:595:4: NON_ZERO_DIGIT ( DIGIT )*
+ {
+ mNON_ZERO_DIGIT();
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:595:19: ( DIGIT )*
+ loop12:
+ do {
+ int alt12=2;
+ int LA12_0 = input.LA(1);
+
+ if ( ((LA12_0>='0' && LA12_0<='9')) ) {
+ alt12=1;
+ }
+
+
+ switch (alt12) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:595:19: DIGIT
+ {
+ mDIGIT();
+
+ }
+ break;
+
+ default :
+ break loop12;
+ }
+ } while (true);
+
+
+ }
+ break;
+
+ }
+ }
+ finally {
+ }
+ }
+ // $ANTLR end DECIMAL_NUMERAL
+
+ // $ANTLR start DIGIT
+ public final void mDIGIT() throws RecognitionException {
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:598:7: ( ZERO_DIGIT | NON_ZERO_DIGIT )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:
+ {
+ if ( (input.LA(1)>='0' && input.LA(1)<='9') ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ }
+ finally {
+ }
+ }
+ // $ANTLR end DIGIT
+
+ // $ANTLR start ZERO_DIGIT
+ public final void mZERO_DIGIT() throws RecognitionException {
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:601:2: ( '0' )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:601:4: '0'
+ {
+ match('0');
+
+ }
+
+ }
+ finally {
+ }
+ }
+ // $ANTLR end ZERO_DIGIT
+
+ // $ANTLR start NON_ZERO_DIGIT
+ public final void mNON_ZERO_DIGIT() throws RecognitionException {
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:604:2: ( '1' .. '9' )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:604:4: '1' .. '9'
+ {
+ matchRange('1','9');
+
+ }
+
+ }
+ finally {
+ }
+ }
+ // $ANTLR end NON_ZERO_DIGIT
+
+ // $ANTLR start PLUS
+ public final void mPLUS() throws RecognitionException {
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:606:6: ( '+' )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:606:8: '+'
+ {
+ match('+');
+
+ }
+
+ }
+ finally {
+ }
+ }
+ // $ANTLR end PLUS
+
+ // $ANTLR start MINUS
+ public final void mMINUS() throws RecognitionException {
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:608:7: ( '-' )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:608:9: '-'
+ {
+ match('-');
+
+ }
+
+ }
+ finally {
+ }
+ }
+ // $ANTLR end MINUS
+
+ // $ANTLR start E
+ public final void mE() throws RecognitionException {
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:611:3: ( ( 'e' | 'E' ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:611:5: ( 'e' | 'E' )
+ {
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ }
+ finally {
+ }
+ }
+ // $ANTLR end E
+
+ // $ANTLR start EXPONENT
+ public final void mEXPONENT() throws RecognitionException {
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:622:2: ( E SIGNED_INTEGER )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:622:4: E SIGNED_INTEGER
+ {
+ mE();
+ mSIGNED_INTEGER();
+
+ }
+
+ }
+ finally {
+ }
+ }
+ // $ANTLR end EXPONENT
+
+ // $ANTLR start SIGNED_INTEGER
+ public final void mSIGNED_INTEGER() throws RecognitionException {
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:626:2: ( ( PLUS | MINUS )? ( DIGIT )+ )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:626:4: ( PLUS | MINUS )? ( DIGIT )+
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:626:4: ( PLUS | MINUS )?
+ int alt14=2;
+ int LA14_0 = input.LA(1);
+
+ if ( (LA14_0=='+'||LA14_0=='-') ) {
+ alt14=1;
+ }
+ switch (alt14) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:
+ {
+ if ( input.LA(1)=='+'||input.LA(1)=='-' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+ break;
+
+ }
+
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:626:20: ( DIGIT )+
+ int cnt15=0;
+ loop15:
+ do {
+ int alt15=2;
+ int LA15_0 = input.LA(1);
+
+ if ( ((LA15_0>='0' && LA15_0<='9')) ) {
+ alt15=1;
+ }
+
+
+ switch (alt15) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:626:20: DIGIT
+ {
+ mDIGIT();
+
+ }
+ break;
+
+ default :
+ if ( cnt15 >= 1 ) break loop15;
+ EarlyExitException eee =
+ new EarlyExitException(15, input);
+ throw eee;
+ }
+ cnt15++;
+ } while (true);
+
+
+ }
+
+ }
+ finally {
+ }
+ }
+ // $ANTLR end SIGNED_INTEGER
+
+ public void mTokens() throws RecognitionException {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:8: ( SELECT | AS | UPPER | LOWER | FROM | JOIN | INNER | LEFT | OUTER | ON | WHERE | OR | AND | NOT | IN | LIKE | IS | NULL | ANY | CONTAINS | IN_FOLDER | IN_TREE | ORDER | BY | ASC | DESC | SCORE | LPAREN | RPAREN | STAR | COMMA | DOTSTAR | DOT | DOTDOT | EQUALS | TILDA | NOTEQUALS | GREATERTHAN | LESSTHAN | GREATERTHANOREQUALS | LESSTHANOREQUALS | COLON | SINGLE_QUOTE | DOUBLE_QUOTE | QUOTED_STRING | DECIMAL_INTEGER_LITERAL | FLOATING_POINT_LITERAL | ID | WS )
+ int alt16=49;
+ alt16 = dfa16.predict(input);
+ switch (alt16) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:10: SELECT
+ {
+ mSELECT();
+
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:17: AS
+ {
+ mAS();
+
+ }
+ break;
+ case 3 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:20: UPPER
+ {
+ mUPPER();
+
+ }
+ break;
+ case 4 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:26: LOWER
+ {
+ mLOWER();
+
+ }
+ break;
+ case 5 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:32: FROM
+ {
+ mFROM();
+
+ }
+ break;
+ case 6 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:37: JOIN
+ {
+ mJOIN();
+
+ }
+ break;
+ case 7 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:42: INNER
+ {
+ mINNER();
+
+ }
+ break;
+ case 8 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:48: LEFT
+ {
+ mLEFT();
+
+ }
+ break;
+ case 9 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:53: OUTER
+ {
+ mOUTER();
+
+ }
+ break;
+ case 10 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:59: ON
+ {
+ mON();
+
+ }
+ break;
+ case 11 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:62: WHERE
+ {
+ mWHERE();
+
+ }
+ break;
+ case 12 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:68: OR
+ {
+ mOR();
+
+ }
+ break;
+ case 13 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:71: AND
+ {
+ mAND();
+
+ }
+ break;
+ case 14 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:75: NOT
+ {
+ mNOT();
+
+ }
+ break;
+ case 15 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:79: IN
+ {
+ mIN();
+
+ }
+ break;
+ case 16 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:82: LIKE
+ {
+ mLIKE();
+
+ }
+ break;
+ case 17 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:87: IS
+ {
+ mIS();
+
+ }
+ break;
+ case 18 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:90: NULL
+ {
+ mNULL();
+
+ }
+ break;
+ case 19 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:95: ANY
+ {
+ mANY();
+
+ }
+ break;
+ case 20 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:99: CONTAINS
+ {
+ mCONTAINS();
+
+ }
+ break;
+ case 21 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:108: IN_FOLDER
+ {
+ mIN_FOLDER();
+
+ }
+ break;
+ case 22 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:118: IN_TREE
+ {
+ mIN_TREE();
+
+ }
+ break;
+ case 23 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:126: ORDER
+ {
+ mORDER();
+
+ }
+ break;
+ case 24 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:132: BY
+ {
+ mBY();
+
+ }
+ break;
+ case 25 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:135: ASC
+ {
+ mASC();
+
+ }
+ break;
+ case 26 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:139: DESC
+ {
+ mDESC();
+
+ }
+ break;
+ case 27 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:144: SCORE
+ {
+ mSCORE();
+
+ }
+ break;
+ case 28 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:150: LPAREN
+ {
+ mLPAREN();
+
+ }
+ break;
+ case 29 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:157: RPAREN
+ {
+ mRPAREN();
+
+ }
+ break;
+ case 30 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:164: STAR
+ {
+ mSTAR();
+
+ }
+ break;
+ case 31 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:169: COMMA
+ {
+ mCOMMA();
+
+ }
+ break;
+ case 32 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:175: DOTSTAR
+ {
+ mDOTSTAR();
+
+ }
+ break;
+ case 33 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:183: DOT
+ {
+ mDOT();
+
+ }
+ break;
+ case 34 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:187: DOTDOT
+ {
+ mDOTDOT();
+
+ }
+ break;
+ case 35 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:194: EQUALS
+ {
+ mEQUALS();
+
+ }
+ break;
+ case 36 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:201: TILDA
+ {
+ mTILDA();
+
+ }
+ break;
+ case 37 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:207: NOTEQUALS
+ {
+ mNOTEQUALS();
+
+ }
+ break;
+ case 38 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:217: GREATERTHAN
+ {
+ mGREATERTHAN();
+
+ }
+ break;
+ case 39 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:229: LESSTHAN
+ {
+ mLESSTHAN();
+
+ }
+ break;
+ case 40 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:238: GREATERTHANOREQUALS
+ {
+ mGREATERTHANOREQUALS();
+
+ }
+ break;
+ case 41 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:258: LESSTHANOREQUALS
+ {
+ mLESSTHANOREQUALS();
+
+ }
+ break;
+ case 42 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:275: COLON
+ {
+ mCOLON();
+
+ }
+ break;
+ case 43 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:281: SINGLE_QUOTE
+ {
+ mSINGLE_QUOTE();
+
+ }
+ break;
+ case 44 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:294: DOUBLE_QUOTE
+ {
+ mDOUBLE_QUOTE();
+
+ }
+ break;
+ case 45 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:307: QUOTED_STRING
+ {
+ mQUOTED_STRING();
+
+ }
+ break;
+ case 46 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:321: DECIMAL_INTEGER_LITERAL
+ {
+ mDECIMAL_INTEGER_LITERAL();
+
+ }
+ break;
+ case 47 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:345: FLOATING_POINT_LITERAL
+ {
+ mFLOATING_POINT_LITERAL();
+
+ }
+ break;
+ case 48 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:368: ID
+ {
+ mID();
+
+ }
+ break;
+ case 49 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:1:371: WS
+ {
+ mWS();
+
+ }
+ break;
+
+ }
+
+ }
+
+
+ protected DFA9 dfa9 = new DFA9(this);
+ protected DFA16 dfa16 = new DFA16(this);
+ static final String DFA9_eotS =
+ "\5\uffff";
+ static final String DFA9_eofS =
+ "\5\uffff";
+ static final String DFA9_minS =
+ "\2\56\3\uffff";
+ static final String DFA9_maxS =
+ "\1\71\1\145\3\uffff";
+ static final String DFA9_acceptS =
+ "\2\uffff\1\2\1\3\1\1";
+ static final String DFA9_specialS =
+ "\5\uffff}>";
+ static final String[] DFA9_transitionS = {
+ "\1\2\1\uffff\12\1",
+ "\1\4\1\uffff\12\1\13\uffff\1\3\37\uffff\1\3",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA9_eot = DFA.unpackEncodedString(DFA9_eotS);
+ static final short[] DFA9_eof = DFA.unpackEncodedString(DFA9_eofS);
+ static final char[] DFA9_min = DFA.unpackEncodedStringToUnsignedChars(DFA9_minS);
+ static final char[] DFA9_max = DFA.unpackEncodedStringToUnsignedChars(DFA9_maxS);
+ static final short[] DFA9_accept = DFA.unpackEncodedString(DFA9_acceptS);
+ static final short[] DFA9_special = DFA.unpackEncodedString(DFA9_specialS);
+ static final short[][] DFA9_transition;
+
+ static {
+ int numStates = DFA9_transitionS.length;
+ DFA9_transition = new short[numStates][];
+ for (int i=0; i";
+ static final String[] DFA16_transitionS = {
+ "\2\36\2\uffff\1\36\22\uffff\1\36\1\uffff\1\31\4\uffff\1\30"+
+ "\1\16\1\17\1\20\1\32\1\21\1\32\1\22\1\uffff\1\33\11\34\1\27"+
+ "\1\uffff\1\25\1\23\1\26\2\uffff\1\2\1\14\1\13\1\15\1\35\1\5"+
+ "\2\35\1\7\1\6\1\35\1\4\1\35\1\12\1\10\3\35\1\1\1\35\1\3\1\35"+
+ "\1\11\3\35\4\uffff\1\35\1\uffff\1\2\1\14\1\13\1\15\1\35\1\5"+
+ "\2\35\1\7\1\6\1\35\1\4\1\35\1\12\1\10\3\35\1\1\1\35\1\3\1\35"+
+ "\1\11\3\35\3\uffff\1\24",
+ "\1\40\1\uffff\1\37\35\uffff\1\40\1\uffff\1\37",
+ "\1\42\4\uffff\1\41\32\uffff\1\42\4\uffff\1\41",
+ "\1\43\37\uffff\1\43",
+ "\1\45\3\uffff\1\46\5\uffff\1\44\25\uffff\1\45\3\uffff\1\46"+
+ "\5\uffff\1\44",
+ "\1\47\37\uffff\1\47",
+ "\1\50\37\uffff\1\50",
+ "\1\51\4\uffff\1\52\32\uffff\1\51\4\uffff\1\52",
+ "\1\54\3\uffff\1\55\2\uffff\1\53\30\uffff\1\54\3\uffff\1\55"+
+ "\2\uffff\1\53",
+ "\1\56\37\uffff\1\56",
+ "\1\57\5\uffff\1\60\31\uffff\1\57\5\uffff\1\60",
+ "\1\61\37\uffff\1\61",
+ "\1\62\37\uffff\1\62",
+ "\1\63\37\uffff\1\63",
+ "",
+ "",
+ "",
+ "",
+ "\1\64\3\uffff\1\65\1\uffff\12\67",
+ "",
+ "",
+ "\1\71\1\70",
+ "\1\73",
+ "",
+ "\uffff\76",
+ "",
+ "",
+ "\1\67\1\uffff\12\67\13\uffff\1\67\37\uffff\1\67",
+ "\1\67\1\uffff\12\77\13\uffff\1\67\37\uffff\1\67",
+ "",
+ "",
+ "\1\100\37\uffff\1\100",
+ "\1\101\37\uffff\1\101",
+ "\2\35\13\uffff\1\35\20\uffff\2\35\1\102\27\35\4\uffff\1\35"+
+ "\1\uffff\2\35\1\102\27\35",
+ "\1\104\24\uffff\1\105\12\uffff\1\104\24\uffff\1\105",
+ "\1\106\37\uffff\1\106",
+ "\1\107\37\uffff\1\107",
+ "\1\110\37\uffff\1\110",
+ "\1\111\37\uffff\1\111",
+ "\1\112\37\uffff\1\112",
+ "\1\113\37\uffff\1\113",
+ "\2\35\13\uffff\1\35\20\uffff\15\35\1\114\14\35\4\uffff\1\115"+
+ "\1\uffff\15\35\1\114\14\35",
+ "\2\35\13\uffff\1\35\20\uffff\32\35\4\uffff\1\35\1\uffff\32"+
+ "\35",
+ "\1\120\37\uffff\1\120",
+ "\2\35\13\uffff\1\35\20\uffff\32\35\4\uffff\1\35\1\uffff\32"+
+ "\35",
+ "\2\35\13\uffff\1\35\20\uffff\3\35\1\122\26\35\4\uffff\1\35"+
+ "\1\uffff\3\35\1\122\26\35",
+ "\1\124\37\uffff\1\124",
+ "\1\125\37\uffff\1\125",
+ "\1\126\37\uffff\1\126",
+ "\1\127\37\uffff\1\127",
+ "\2\35\13\uffff\1\35\20\uffff\32\35\4\uffff\1\35\1\uffff\32"+
+ "\35",
+ "\1\131\37\uffff\1\131",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\67\1\uffff\12\77\13\uffff\1\67\37\uffff\1\67",
+ "\1\132\37\uffff\1\132",
+ "\1\133\37\uffff\1\133",
+ "\2\35\13\uffff\1\35\20\uffff\32\35\4\uffff\1\35\1\uffff\32"+
+ "\35",
+ "",
+ "\2\35\13\uffff\1\35\20\uffff\32\35\4\uffff\1\35\1\uffff\32"+
+ "\35",
+ "\2\35\13\uffff\1\35\20\uffff\32\35\4\uffff\1\35\1\uffff\32"+
+ "\35",
+ "\1\137\37\uffff\1\137",
+ "\1\140\37\uffff\1\140",
+ "\1\141\37\uffff\1\141",
+ "\1\142\37\uffff\1\142",
+ "\1\143\37\uffff\1\143",
+ "\1\144\37\uffff\1\144",
+ "\1\145\37\uffff\1\145",
+ "\1\146\15\uffff\1\147\21\uffff\1\146\15\uffff\1\147",
+ "",
+ "",
+ "\1\150\37\uffff\1\150",
+ "",
+ "\1\151\37\uffff\1\151",
+ "",
+ "\1\152\37\uffff\1\152",
+ "\2\35\13\uffff\1\35\20\uffff\32\35\4\uffff\1\35\1\uffff\32"+
+ "\35",
+ "\1\154\37\uffff\1\154",
+ "\1\155\37\uffff\1\155",
+ "",
+ "\1\156\37\uffff\1\156",
+ "\1\157\37\uffff\1\157",
+ "\1\160\37\uffff\1\160",
+ "",
+ "",
+ "",
+ "\1\161\37\uffff\1\161",
+ "\1\162\37\uffff\1\162",
+ "\2\35\13\uffff\1\35\20\uffff\32\35\4\uffff\1\35\1\uffff\32"+
+ "\35",
+ "\2\35\13\uffff\1\35\20\uffff\32\35\4\uffff\1\35\1\uffff\32"+
+ "\35",
+ "\2\35\13\uffff\1\35\20\uffff\32\35\4\uffff\1\35\1\uffff\32"+
+ "\35",
+ "\2\35\13\uffff\1\35\20\uffff\32\35\4\uffff\1\35\1\uffff\32"+
+ "\35",
+ "\1\167\37\uffff\1\167",
+ "\1\170\37\uffff\1\170",
+ "\1\171\37\uffff\1\171",
+ "\1\172\37\uffff\1\172",
+ "\1\173\37\uffff\1\173",
+ "\1\174\37\uffff\1\174",
+ "",
+ "\2\35\13\uffff\1\35\20\uffff\32\35\4\uffff\1\35\1\uffff\32"+
+ "\35",
+ "\1\176\37\uffff\1\176",
+ "\2\35\13\uffff\1\35\20\uffff\32\35\4\uffff\1\35\1\uffff\32"+
+ "\35",
+ "\1\u0080\37\uffff\1\u0080",
+ "\2\35\13\uffff\1\35\20\uffff\32\35\4\uffff\1\35\1\uffff\32"+
+ "\35",
+ "\2\35\13\uffff\1\35\20\uffff\32\35\4\uffff\1\35\1\uffff\32"+
+ "\35",
+ "\2\35\13\uffff\1\35\20\uffff\32\35\4\uffff\1\35\1\uffff\32"+
+ "\35",
+ "",
+ "",
+ "",
+ "",
+ "\2\35\13\uffff\1\35\20\uffff\32\35\4\uffff\1\35\1\uffff\32"+
+ "\35",
+ "\1\u0085\37\uffff\1\u0085",
+ "\1\u0086\37\uffff\1\u0086",
+ "\2\35\13\uffff\1\35\20\uffff\32\35\4\uffff\1\35\1\uffff\32"+
+ "\35",
+ "\2\35\13\uffff\1\35\20\uffff\32\35\4\uffff\1\35\1\uffff\32"+
+ "\35",
+ "\2\35\13\uffff\1\35\20\uffff\32\35\4\uffff\1\35\1\uffff\32"+
+ "\35",
+ "",
+ "\1\u008a\37\uffff\1\u008a",
+ "",
+ "\2\35\13\uffff\1\35\20\uffff\32\35\4\uffff\1\35\1\uffff\32"+
+ "\35",
+ "",
+ "",
+ "",
+ "",
+ "\1\u008c\37\uffff\1\u008c",
+ "\1\u008d\37\uffff\1\u008d",
+ "",
+ "",
+ "",
+ "\1\u008e\37\uffff\1\u008e",
+ "",
+ "\1\u008f\37\uffff\1\u008f",
+ "\2\35\13\uffff\1\35\20\uffff\32\35\4\uffff\1\35\1\uffff\32"+
+ "\35",
+ "\1\u0091\37\uffff\1\u0091",
+ "\1\u0092\37\uffff\1\u0092",
+ "",
+ "\2\35\13\uffff\1\35\20\uffff\32\35\4\uffff\1\35\1\uffff\32"+
+ "\35",
+ "\2\35\13\uffff\1\35\20\uffff\32\35\4\uffff\1\35\1\uffff\32"+
+ "\35",
+ "",
+ ""
+ };
+
+ static final short[] DFA16_eot = DFA.unpackEncodedString(DFA16_eotS);
+ static final short[] DFA16_eof = DFA.unpackEncodedString(DFA16_eofS);
+ static final char[] DFA16_min = DFA.unpackEncodedStringToUnsignedChars(DFA16_minS);
+ static final char[] DFA16_max = DFA.unpackEncodedStringToUnsignedChars(DFA16_maxS);
+ static final short[] DFA16_accept = DFA.unpackEncodedString(DFA16_acceptS);
+ static final short[] DFA16_special = DFA.unpackEncodedString(DFA16_specialS);
+ static final short[][] DFA16_transition;
+
+ static {
+ int numStates = DFA16_transitionS.length;
+ DFA16_transition = new short[numStates][];
+ for (int i=0; i", "", "", "", "QUERY", "ALL_COLUMNS", "COLUMN", "COLUMNS", "COLUMN_REF", "QUALIFIER", "FUNCTION", "SOURCE", "TABLE", "TABLE_REF", "PARAMETER", "CONJUNCTION", "DISJUNCTION", "NEGATION", "PRED_COMPARISON", "PRED_IN", "PRED_EXISTS", "PRED_LIKE", "PRED_FTS", "LIST", "PRED_CHILD", "PRED_DESCENDANT", "SORT_SPECIFICATION", "NUMERIC_LITERAL", "STRING_LITERAL", "SELECT", "STAR", "COMMA", "AS", "DOTSTAR", "DOT", "LPAREN", "RPAREN", "FROM", "JOIN", "INNER", "LEFT", "OUTER", "ON", "EQUALS", "WHERE", "OR", "AND", "NOT", "NOTEQUALS", "LESSTHAN", "GREATERTHAN", "LESSTHANOREQUALS", "GREATERTHANOREQUALS", "IN", "LIKE", "IS", "NULL", "ANY", "CONTAINS", "IN_FOLDER", "IN_TREE", "ORDER", "BY", "ASC", "DESC", "COLON", "QUOTED_STRING", "ID", "DOUBLE_QUOTE", "FLOATING_POINT_LITERAL", "DECIMAL_INTEGER_LITERAL", "UPPER", "LOWER", "SCORE", "DOTDOT", "TILDA", "SINGLE_QUOTE", "ESCAPED_SINGLE_QUOTE", "PLUS", "MINUS", "DECIMAL_NUMERAL", "DIGIT", "EXPONENT", "WS", "ZERO_DIGIT", "NON_ZERO_DIGIT", "E", "SIGNED_INTEGER"
+ };
+ public static final int FUNCTION=10;
+ public static final int WHERE=44;
+ public static final int EXPONENT=82;
+ public static final int PRED_FTS=22;
+ public static final int STAR=30;
+ public static final int INNER=39;
+ public static final int ORDER=61;
+ public static final int DOUBLE_QUOTE=68;
+ public static final int NUMERIC_LITERAL=27;
+ public static final int PRED_COMPARISON=18;
+ public static final int CONTAINS=58;
+ public static final int TABLE=12;
+ public static final int SOURCE=11;
+ public static final int DOTDOT=74;
+ public static final int EQUALS=43;
+ public static final int NOT=47;
+ public static final int ID=67;
+ public static final int AND=46;
+ public static final int EOF=-1;
+ public static final int LPAREN=35;
+ public static final int LESSTHANOREQUALS=51;
+ public static final int AS=32;
+ public static final int SINGLE_QUOTE=76;
+ public static final int RPAREN=36;
+ public static final int TILDA=75;
+ public static final int PRED_LIKE=21;
+ public static final int STRING_LITERAL=28;
+ public static final int IN=53;
+ public static final int DECIMAL_NUMERAL=80;
+ public static final int FLOATING_POINT_LITERAL=69;
+ public static final int COMMA=31;
+ public static final int IS=55;
+ public static final int LEFT=40;
+ public static final int SIGNED_INTEGER=87;
+ public static final int PARAMETER=14;
+ public static final int COLUMN=6;
+ public static final int PLUS=78;
+ public static final int QUOTED_STRING=66;
+ public static final int ZERO_DIGIT=84;
+ public static final int DIGIT=81;
+ public static final int DOT=34;
+ public static final int COLUMN_REF=8;
+ public static final int SELECT=29;
+ public static final int LIKE=54;
+ public static final int GREATERTHAN=50;
+ public static final int DOTSTAR=33;
+ public static final int E=86;
+ public static final int OUTER=41;
+ public static final int BY=62;
+ public static final int LESSTHAN=49;
+ public static final int NON_ZERO_DIGIT=85;
+ public static final int ASC=63;
+ public static final int QUALIFIER=9;
+ public static final int CONJUNCTION=15;
+ public static final int NULL=56;
+ public static final int ON=42;
+ public static final int NOTEQUALS=48;
+ public static final int MINUS=79;
+ public static final int LIST=23;
+ public static final int PRED_DESCENDANT=25;
+ public static final int JOIN=38;
+ public static final int IN_FOLDER=59;
+ public static final int COLON=65;
+ public static final int GREATERTHANOREQUALS=52;
+ public static final int DISJUNCTION=16;
+ public static final int COLUMNS=7;
+ public static final int WS=83;
+ public static final int ANY=57;
+ public static final int SCORE=73;
+ public static final int NEGATION=17;
+ public static final int TABLE_REF=13;
+ public static final int SORT_SPECIFICATION=26;
+ public static final int IN_TREE=60;
+ public static final int OR=45;
+ public static final int PRED_CHILD=24;
+ public static final int PRED_EXISTS=20;
+ public static final int QUERY=4;
+ public static final int LOWER=72;
+ public static final int DECIMAL_INTEGER_LITERAL=70;
+ public static final int DESC=64;
+ public static final int ALL_COLUMNS=5;
+ public static final int FROM=37;
+ public static final int UPPER=71;
+ public static final int PRED_IN=19;
+ public static final int ESCAPED_SINGLE_QUOTE=77;
+
+ // delegates
+ // delegators
+
+
+ public CMISParser(TokenStream input) {
+ this(input, new RecognizerSharedState());
+ }
+ public CMISParser(TokenStream input, RecognizerSharedState state) {
+ super(input, state);
+ }
+
+ protected TreeAdaptor adaptor = new CommonTreeAdaptor();
+
+ public void setTreeAdaptor(TreeAdaptor adaptor) {
+ this.adaptor = adaptor;
+ }
+ public TreeAdaptor getTreeAdaptor() {
+ return adaptor;
+ }
+
+ public String[] getTokenNames() { return CMISParser.tokenNames; }
+ public String getGrammarFileName() { return "W:\\workspace-cmis\\ANTLR\\CMIS.g"; }
+
+
+ private Stack paraphrases = new Stack();
+
+ /**
+ * CMIS strict
+ */
+ public boolean strict()
+ {
+ return true;
+ }
+
+ protected void mismatch(IntStream input, int ttype, BitSet follow) throws RecognitionException
+ {
+ throw new MismatchedTokenException(ttype, input);
+ }
+
+ public Object recoverFromMismatchedSet(IntStream input, RecognitionException e, BitSet follow) throws RecognitionException
+ {
+ throw e;
+ }
+
+ public String getErrorMessage(RecognitionException e, String[] tokenNames)
+ {
+ List stack = getRuleInvocationStack(e, this.getClass().getName());
+ String msg = null;
+ if(e instanceof NoViableAltException)
+ {
+ NoViableAltException nvae = (NoViableAltException)e;
+ msg = " no viable alt; token="+e.token+
+ " (decision="+nvae.decisionNumber+
+ " state "+nvae.stateNumber+")"+
+ " decision=<<"+nvae.grammarDecisionDescription+">>";
+ }
+ else
+ {
+ msg = super.getErrorMessage(e, tokenNames);
+ }
+ if(paraphrases.size() > 0)
+ {
+ String paraphrase = (String)paraphrases.peek();
+ msg = msg+" "+paraphrase;
+ }
+
+ return stack+" "+msg;
+ }
+
+ public String getTokenErrorDisplay(Token t)
+ {
+ return t.toString();
+ }
+
+
+ public static class query_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start query
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:142:1: query : SELECT selectList fromClause ( whereClause )? ( orderByClause )? EOF -> ^( QUERY selectList fromClause ( whereClause )? ( orderByClause )? ) ;
+ public final CMISParser.query_return query() throws RecognitionException {
+ CMISParser.query_return retval = new CMISParser.query_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token SELECT1=null;
+ Token EOF6=null;
+ CMISParser.selectList_return selectList2 = null;
+
+ CMISParser.fromClause_return fromClause3 = null;
+
+ CMISParser.whereClause_return whereClause4 = null;
+
+ CMISParser.orderByClause_return orderByClause5 = null;
+
+
+ Object SELECT1_tree=null;
+ Object EOF6_tree=null;
+ RewriteRuleTokenStream stream_EOF=new RewriteRuleTokenStream(adaptor,"token EOF");
+ RewriteRuleTokenStream stream_SELECT=new RewriteRuleTokenStream(adaptor,"token SELECT");
+ RewriteRuleSubtreeStream stream_whereClause=new RewriteRuleSubtreeStream(adaptor,"rule whereClause");
+ RewriteRuleSubtreeStream stream_orderByClause=new RewriteRuleSubtreeStream(adaptor,"rule orderByClause");
+ RewriteRuleSubtreeStream stream_selectList=new RewriteRuleSubtreeStream(adaptor,"rule selectList");
+ RewriteRuleSubtreeStream stream_fromClause=new RewriteRuleSubtreeStream(adaptor,"rule fromClause");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:149:2: ( SELECT selectList fromClause ( whereClause )? ( orderByClause )? EOF -> ^( QUERY selectList fromClause ( whereClause )? ( orderByClause )? ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:149:4: SELECT selectList fromClause ( whereClause )? ( orderByClause )? EOF
+ {
+ SELECT1=(Token)match(input,SELECT,FOLLOW_SELECT_in_query172); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_SELECT.add(SELECT1);
+
+ pushFollow(FOLLOW_selectList_in_query174);
+ selectList2=selectList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_selectList.add(selectList2.getTree());
+ pushFollow(FOLLOW_fromClause_in_query176);
+ fromClause3=fromClause();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_fromClause.add(fromClause3.getTree());
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:149:33: ( whereClause )?
+ int alt1=2;
+ int LA1_0 = input.LA(1);
+
+ if ( (LA1_0==WHERE) ) {
+ alt1=1;
+ }
+ switch (alt1) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:149:33: whereClause
+ {
+ pushFollow(FOLLOW_whereClause_in_query178);
+ whereClause4=whereClause();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_whereClause.add(whereClause4.getTree());
+
+ }
+ break;
+
+ }
+
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:149:46: ( orderByClause )?
+ int alt2=2;
+ int LA2_0 = input.LA(1);
+
+ if ( (LA2_0==ORDER) ) {
+ alt2=1;
+ }
+ switch (alt2) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:149:46: orderByClause
+ {
+ pushFollow(FOLLOW_orderByClause_in_query181);
+ orderByClause5=orderByClause();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_orderByClause.add(orderByClause5.getTree());
+
+ }
+ break;
+
+ }
+
+ EOF6=(Token)match(input,EOF,FOLLOW_EOF_in_query184); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_EOF.add(EOF6);
+
+
+
+ // AST REWRITE
+ // elements: selectList, orderByClause, whereClause, fromClause
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 150:3: -> ^( QUERY selectList fromClause ( whereClause )? ( orderByClause )? )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:150:6: ^( QUERY selectList fromClause ( whereClause )? ( orderByClause )? )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(QUERY, "QUERY"), root_1);
+
+ adaptor.addChild(root_1, stream_selectList.nextTree());
+ adaptor.addChild(root_1, stream_fromClause.nextTree());
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:150:36: ( whereClause )?
+ if ( stream_whereClause.hasNext() ) {
+ adaptor.addChild(root_1, stream_whereClause.nextTree());
+
+ }
+ stream_whereClause.reset();
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:150:49: ( orderByClause )?
+ if ( stream_orderByClause.hasNext() ) {
+ adaptor.addChild(root_1, stream_orderByClause.nextTree());
+
+ }
+ stream_orderByClause.reset();
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end query
+
+ public static class selectList_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start selectList
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:154:1: selectList : ( STAR -> ^( ALL_COLUMNS ) | selectSubList ( COMMA selectSubList )* -> ^( COLUMNS ( selectSubList )+ ) );
+ public final CMISParser.selectList_return selectList() throws RecognitionException {
+ CMISParser.selectList_return retval = new CMISParser.selectList_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token STAR7=null;
+ Token COMMA9=null;
+ CMISParser.selectSubList_return selectSubList8 = null;
+
+ CMISParser.selectSubList_return selectSubList10 = null;
+
+
+ Object STAR7_tree=null;
+ Object COMMA9_tree=null;
+ RewriteRuleTokenStream stream_STAR=new RewriteRuleTokenStream(adaptor,"token STAR");
+ RewriteRuleTokenStream stream_COMMA=new RewriteRuleTokenStream(adaptor,"token COMMA");
+ RewriteRuleSubtreeStream stream_selectSubList=new RewriteRuleSubtreeStream(adaptor,"rule selectSubList");
+ paraphrases.push("in select list");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:157:2: ( STAR -> ^( ALL_COLUMNS ) | selectSubList ( COMMA selectSubList )* -> ^( COLUMNS ( selectSubList )+ ) )
+ int alt4=2;
+ int LA4_0 = input.LA(1);
+
+ if ( (LA4_0==STAR) ) {
+ alt4=1;
+ }
+ else if ( (LA4_0==SELECT||LA4_0==AS||(LA4_0>=FROM && LA4_0<=ON)||(LA4_0>=WHERE && LA4_0<=NOT)||(LA4_0>=IN && LA4_0<=DESC)||(LA4_0>=ID && LA4_0<=DOUBLE_QUOTE)||(LA4_0>=UPPER && LA4_0<=SCORE)) ) {
+ alt4=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 4, 0, input);
+
+ throw nvae;
+ }
+ switch (alt4) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:157:4: STAR
+ {
+ STAR7=(Token)match(input,STAR,FOLLOW_STAR_in_selectList233); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_STAR.add(STAR7);
+
+
+
+ // AST REWRITE
+ // elements:
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 158:3: -> ^( ALL_COLUMNS )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:158:6: ^( ALL_COLUMNS )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(ALL_COLUMNS, "ALL_COLUMNS"), root_1);
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:159:5: selectSubList ( COMMA selectSubList )*
+ {
+ pushFollow(FOLLOW_selectSubList_in_selectList249);
+ selectSubList8=selectSubList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_selectSubList.add(selectSubList8.getTree());
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:159:19: ( COMMA selectSubList )*
+ loop3:
+ do {
+ int alt3=2;
+ int LA3_0 = input.LA(1);
+
+ if ( (LA3_0==COMMA) ) {
+ alt3=1;
+ }
+
+
+ switch (alt3) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:159:21: COMMA selectSubList
+ {
+ COMMA9=(Token)match(input,COMMA,FOLLOW_COMMA_in_selectList253); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_COMMA.add(COMMA9);
+
+ pushFollow(FOLLOW_selectSubList_in_selectList255);
+ selectSubList10=selectSubList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_selectSubList.add(selectSubList10.getTree());
+
+ }
+ break;
+
+ default :
+ break loop3;
+ }
+ } while (true);
+
+
+
+ // AST REWRITE
+ // elements: selectSubList
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 160:3: -> ^( COLUMNS ( selectSubList )+ )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:160:6: ^( COLUMNS ( selectSubList )+ )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(COLUMNS, "COLUMNS"), root_1);
+
+ if ( !(stream_selectSubList.hasNext()) ) {
+ throw new RewriteEarlyExitException();
+ }
+ while ( stream_selectSubList.hasNext() ) {
+ adaptor.addChild(root_1, stream_selectSubList.nextTree());
+
+ }
+ stream_selectSubList.reset();
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ if ( state.backtracking==0 ) {
+ paraphrases.pop();
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end selectList
+
+ public static class selectSubList_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start selectSubList
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:164:1: selectSubList : ( ( valueExpression )=> valueExpression ( ( AS )? columnName )? -> ^( COLUMN valueExpression ( columnName )? ) | qualifier DOTSTAR -> ^( ALL_COLUMNS qualifier ) | multiValuedColumnReference ->);
+ public final CMISParser.selectSubList_return selectSubList() throws RecognitionException {
+ CMISParser.selectSubList_return retval = new CMISParser.selectSubList_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token AS12=null;
+ Token DOTSTAR15=null;
+ CMISParser.valueExpression_return valueExpression11 = null;
+
+ CMISParser.columnName_return columnName13 = null;
+
+ CMISParser.qualifier_return qualifier14 = null;
+
+ CMISParser.multiValuedColumnReference_return multiValuedColumnReference16 = null;
+
+
+ Object AS12_tree=null;
+ Object DOTSTAR15_tree=null;
+ RewriteRuleTokenStream stream_AS=new RewriteRuleTokenStream(adaptor,"token AS");
+ RewriteRuleTokenStream stream_DOTSTAR=new RewriteRuleTokenStream(adaptor,"token DOTSTAR");
+ RewriteRuleSubtreeStream stream_valueExpression=new RewriteRuleSubtreeStream(adaptor,"rule valueExpression");
+ RewriteRuleSubtreeStream stream_multiValuedColumnReference=new RewriteRuleSubtreeStream(adaptor,"rule multiValuedColumnReference");
+ RewriteRuleSubtreeStream stream_columnName=new RewriteRuleSubtreeStream(adaptor,"rule columnName");
+ RewriteRuleSubtreeStream stream_qualifier=new RewriteRuleSubtreeStream(adaptor,"rule qualifier");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:165:2: ( ( valueExpression )=> valueExpression ( ( AS )? columnName )? -> ^( COLUMN valueExpression ( columnName )? ) | qualifier DOTSTAR -> ^( ALL_COLUMNS qualifier ) | multiValuedColumnReference ->)
+ int alt7=3;
+ int LA7_0 = input.LA(1);
+
+ if ( (LA7_0==ID) ) {
+ int LA7_1 = input.LA(2);
+
+ if ( (LA7_1==DOTSTAR) ) {
+ alt7=2;
+ }
+ else if ( (synpred1_CMIS()) ) {
+ alt7=1;
+ }
+ else if ( (true) ) {
+ alt7=3;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 7, 1, input);
+
+ throw nvae;
+ }
+ }
+ else if ( (LA7_0==DOUBLE_QUOTE) ) {
+ int LA7_2 = input.LA(2);
+
+ if ( (LA7_2==SELECT||LA7_2==AS||(LA7_2>=FROM && LA7_2<=ON)||(LA7_2>=WHERE && LA7_2<=NOT)||(LA7_2>=IN && LA7_2<=DESC)||(LA7_2>=UPPER && LA7_2<=SCORE)) ) {
+ int LA7_6 = input.LA(3);
+
+ if ( (LA7_6==DOUBLE_QUOTE) ) {
+ int LA7_8 = input.LA(4);
+
+ if ( (LA7_8==DOTSTAR) ) {
+ alt7=2;
+ }
+ else if ( (synpred1_CMIS()) ) {
+ alt7=1;
+ }
+ else if ( (true) ) {
+ alt7=3;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 7, 8, input);
+
+ throw nvae;
+ }
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 7, 6, input);
+
+ throw nvae;
+ }
+ }
+ else if ( (LA7_2==ID) ) {
+ int LA7_7 = input.LA(3);
+
+ if ( (LA7_7==DOUBLE_QUOTE) ) {
+ int LA7_8 = input.LA(4);
+
+ if ( (LA7_8==DOTSTAR) ) {
+ alt7=2;
+ }
+ else if ( (synpred1_CMIS()) ) {
+ alt7=1;
+ }
+ else if ( (true) ) {
+ alt7=3;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 7, 8, input);
+
+ throw nvae;
+ }
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 7, 7, input);
+
+ throw nvae;
+ }
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 7, 2, input);
+
+ throw nvae;
+ }
+ }
+ else if ( (LA7_0==SELECT||LA7_0==AS||(LA7_0>=FROM && LA7_0<=ON)||(LA7_0>=WHERE && LA7_0<=NOT)||(LA7_0>=IN && LA7_0<=DESC)||(LA7_0>=UPPER && LA7_0<=SCORE)) && (synpred1_CMIS())) {
+ alt7=1;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 7, 0, input);
+
+ throw nvae;
+ }
+ switch (alt7) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:165:4: ( valueExpression )=> valueExpression ( ( AS )? columnName )?
+ {
+ pushFollow(FOLLOW_valueExpression_in_selectSubList291);
+ valueExpression11=valueExpression();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_valueExpression.add(valueExpression11.getTree());
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:165:40: ( ( AS )? columnName )?
+ int alt6=2;
+ int LA6_0 = input.LA(1);
+
+ if ( (LA6_0==AS||(LA6_0>=ID && LA6_0<=DOUBLE_QUOTE)) ) {
+ alt6=1;
+ }
+ switch (alt6) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:165:42: ( AS )? columnName
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:165:42: ( AS )?
+ int alt5=2;
+ int LA5_0 = input.LA(1);
+
+ if ( (LA5_0==AS) ) {
+ alt5=1;
+ }
+ switch (alt5) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:165:42: AS
+ {
+ AS12=(Token)match(input,AS,FOLLOW_AS_in_selectSubList295); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_AS.add(AS12);
+
+
+ }
+ break;
+
+ }
+
+ pushFollow(FOLLOW_columnName_in_selectSubList298);
+ columnName13=columnName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_columnName.add(columnName13.getTree());
+
+ }
+ break;
+
+ }
+
+
+
+ // AST REWRITE
+ // elements: columnName, valueExpression
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 166:3: -> ^( COLUMN valueExpression ( columnName )? )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:166:6: ^( COLUMN valueExpression ( columnName )? )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(COLUMN, "COLUMN"), root_1);
+
+ adaptor.addChild(root_1, stream_valueExpression.nextTree());
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:166:31: ( columnName )?
+ if ( stream_columnName.hasNext() ) {
+ adaptor.addChild(root_1, stream_columnName.nextTree());
+
+ }
+ stream_columnName.reset();
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:167:4: qualifier DOTSTAR
+ {
+ pushFollow(FOLLOW_qualifier_in_selectSubList319);
+ qualifier14=qualifier();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_qualifier.add(qualifier14.getTree());
+ DOTSTAR15=(Token)match(input,DOTSTAR,FOLLOW_DOTSTAR_in_selectSubList321); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_DOTSTAR.add(DOTSTAR15);
+
+
+
+ // AST REWRITE
+ // elements: qualifier
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 168:3: -> ^( ALL_COLUMNS qualifier )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:168:6: ^( ALL_COLUMNS qualifier )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(ALL_COLUMNS, "ALL_COLUMNS"), root_1);
+
+ adaptor.addChild(root_1, stream_qualifier.nextTree());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+ break;
+ case 3 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:169:4: multiValuedColumnReference
+ {
+ pushFollow(FOLLOW_multiValuedColumnReference_in_selectSubList337);
+ multiValuedColumnReference16=multiValuedColumnReference();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_multiValuedColumnReference.add(multiValuedColumnReference16.getTree());
+
+
+ // AST REWRITE
+ // elements:
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 170:3: ->
+ {
+ root_0 = null;
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end selectSubList
+
+ public static class valueExpression_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start valueExpression
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:173:1: valueExpression : ( columnReference -> columnReference | valueFunction -> valueFunction );
+ public final CMISParser.valueExpression_return valueExpression() throws RecognitionException {
+ CMISParser.valueExpression_return retval = new CMISParser.valueExpression_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ CMISParser.columnReference_return columnReference17 = null;
+
+ CMISParser.valueFunction_return valueFunction18 = null;
+
+
+ RewriteRuleSubtreeStream stream_valueFunction=new RewriteRuleSubtreeStream(adaptor,"rule valueFunction");
+ RewriteRuleSubtreeStream stream_columnReference=new RewriteRuleSubtreeStream(adaptor,"rule columnReference");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:174:2: ( columnReference -> columnReference | valueFunction -> valueFunction )
+ int alt8=2;
+ switch ( input.LA(1) ) {
+ case ID:
+ {
+ int LA8_1 = input.LA(2);
+
+ if ( (LA8_1==EOF||(LA8_1>=COMMA && LA8_1<=AS)||LA8_1==DOT||LA8_1==FROM||LA8_1==EQUALS||(LA8_1>=NOTEQUALS && LA8_1<=GREATERTHANOREQUALS)||(LA8_1>=ID && LA8_1<=DOUBLE_QUOTE)) ) {
+ alt8=1;
+ }
+ else if ( (LA8_1==LPAREN) ) {
+ alt8=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 8, 1, input);
+
+ throw nvae;
+ }
+ }
+ break;
+ case DOUBLE_QUOTE:
+ {
+ alt8=1;
+ }
+ break;
+ case SELECT:
+ case AS:
+ case FROM:
+ case JOIN:
+ case INNER:
+ case LEFT:
+ case OUTER:
+ case ON:
+ case WHERE:
+ case OR:
+ case AND:
+ case NOT:
+ case IN:
+ case LIKE:
+ case IS:
+ case NULL:
+ case ANY:
+ case CONTAINS:
+ case IN_FOLDER:
+ case IN_TREE:
+ case ORDER:
+ case BY:
+ case ASC:
+ case DESC:
+ case UPPER:
+ case LOWER:
+ case SCORE:
+ {
+ alt8=2;
+ }
+ break;
+ default:
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 8, 0, input);
+
+ throw nvae;
+ }
+
+ switch (alt8) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:174:4: columnReference
+ {
+ pushFollow(FOLLOW_columnReference_in_valueExpression356);
+ columnReference17=columnReference();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_columnReference.add(columnReference17.getTree());
+
+
+ // AST REWRITE
+ // elements: columnReference
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 175:3: -> columnReference
+ {
+ adaptor.addChild(root_0, stream_columnReference.nextTree());
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:176:5: valueFunction
+ {
+ pushFollow(FOLLOW_valueFunction_in_valueExpression369);
+ valueFunction18=valueFunction();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_valueFunction.add(valueFunction18.getTree());
+
+
+ // AST REWRITE
+ // elements: valueFunction
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 177:3: -> valueFunction
+ {
+ adaptor.addChild(root_0, stream_valueFunction.nextTree());
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end valueExpression
+
+ public static class columnReference_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start columnReference
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:180:1: columnReference : ( qualifier DOT )? columnName -> ^( COLUMN_REF columnName ( qualifier )? ) ;
+ public final CMISParser.columnReference_return columnReference() throws RecognitionException {
+ CMISParser.columnReference_return retval = new CMISParser.columnReference_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token DOT20=null;
+ CMISParser.qualifier_return qualifier19 = null;
+
+ CMISParser.columnName_return columnName21 = null;
+
+
+ Object DOT20_tree=null;
+ RewriteRuleTokenStream stream_DOT=new RewriteRuleTokenStream(adaptor,"token DOT");
+ RewriteRuleSubtreeStream stream_columnName=new RewriteRuleSubtreeStream(adaptor,"rule columnName");
+ RewriteRuleSubtreeStream stream_qualifier=new RewriteRuleSubtreeStream(adaptor,"rule qualifier");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:181:2: ( ( qualifier DOT )? columnName -> ^( COLUMN_REF columnName ( qualifier )? ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:181:4: ( qualifier DOT )? columnName
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:181:4: ( qualifier DOT )?
+ int alt9=2;
+ int LA9_0 = input.LA(1);
+
+ if ( (LA9_0==ID) ) {
+ int LA9_1 = input.LA(2);
+
+ if ( (LA9_1==DOT) ) {
+ alt9=1;
+ }
+ }
+ else if ( (LA9_0==DOUBLE_QUOTE) ) {
+ int LA9_2 = input.LA(2);
+
+ if ( (LA9_2==SELECT||LA9_2==AS||(LA9_2>=FROM && LA9_2<=ON)||(LA9_2>=WHERE && LA9_2<=NOT)||(LA9_2>=IN && LA9_2<=DESC)||(LA9_2>=UPPER && LA9_2<=SCORE)) ) {
+ int LA9_5 = input.LA(3);
+
+ if ( (LA9_5==DOUBLE_QUOTE) ) {
+ int LA9_7 = input.LA(4);
+
+ if ( (LA9_7==DOT) ) {
+ alt9=1;
+ }
+ }
+ }
+ else if ( (LA9_2==ID) ) {
+ int LA9_6 = input.LA(3);
+
+ if ( (LA9_6==DOUBLE_QUOTE) ) {
+ int LA9_7 = input.LA(4);
+
+ if ( (LA9_7==DOT) ) {
+ alt9=1;
+ }
+ }
+ }
+ }
+ switch (alt9) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:181:6: qualifier DOT
+ {
+ pushFollow(FOLLOW_qualifier_in_columnReference392);
+ qualifier19=qualifier();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_qualifier.add(qualifier19.getTree());
+ DOT20=(Token)match(input,DOT,FOLLOW_DOT_in_columnReference394); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_DOT.add(DOT20);
+
+
+ }
+ break;
+
+ }
+
+ pushFollow(FOLLOW_columnName_in_columnReference399);
+ columnName21=columnName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_columnName.add(columnName21.getTree());
+
+
+ // AST REWRITE
+ // elements: qualifier, columnName
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 182:3: -> ^( COLUMN_REF columnName ( qualifier )? )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:182:6: ^( COLUMN_REF columnName ( qualifier )? )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(COLUMN_REF, "COLUMN_REF"), root_1);
+
+ adaptor.addChild(root_1, stream_columnName.nextTree());
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:182:30: ( qualifier )?
+ if ( stream_qualifier.hasNext() ) {
+ adaptor.addChild(root_1, stream_qualifier.nextTree());
+
+ }
+ stream_qualifier.reset();
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end columnReference
+
+ public static class multiValuedColumnReference_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start multiValuedColumnReference
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:189:1: multiValuedColumnReference : ( qualifier DOT )? multiValuedColumnName -> ^( COLUMN_REF multiValuedColumnName ( qualifier )? ) ;
+ public final CMISParser.multiValuedColumnReference_return multiValuedColumnReference() throws RecognitionException {
+ CMISParser.multiValuedColumnReference_return retval = new CMISParser.multiValuedColumnReference_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token DOT23=null;
+ CMISParser.qualifier_return qualifier22 = null;
+
+ CMISParser.multiValuedColumnName_return multiValuedColumnName24 = null;
+
+
+ Object DOT23_tree=null;
+ RewriteRuleTokenStream stream_DOT=new RewriteRuleTokenStream(adaptor,"token DOT");
+ RewriteRuleSubtreeStream stream_qualifier=new RewriteRuleSubtreeStream(adaptor,"rule qualifier");
+ RewriteRuleSubtreeStream stream_multiValuedColumnName=new RewriteRuleSubtreeStream(adaptor,"rule multiValuedColumnName");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:190:2: ( ( qualifier DOT )? multiValuedColumnName -> ^( COLUMN_REF multiValuedColumnName ( qualifier )? ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:190:10: ( qualifier DOT )? multiValuedColumnName
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:190:10: ( qualifier DOT )?
+ int alt10=2;
+ int LA10_0 = input.LA(1);
+
+ if ( (LA10_0==ID) ) {
+ int LA10_1 = input.LA(2);
+
+ if ( (LA10_1==DOT) ) {
+ alt10=1;
+ }
+ }
+ else if ( (LA10_0==DOUBLE_QUOTE) ) {
+ int LA10_2 = input.LA(2);
+
+ if ( (LA10_2==SELECT||LA10_2==AS||(LA10_2>=FROM && LA10_2<=ON)||(LA10_2>=WHERE && LA10_2<=NOT)||(LA10_2>=IN && LA10_2<=DESC)||(LA10_2>=UPPER && LA10_2<=SCORE)) ) {
+ int LA10_5 = input.LA(3);
+
+ if ( (LA10_5==DOUBLE_QUOTE) ) {
+ int LA10_7 = input.LA(4);
+
+ if ( (LA10_7==DOT) ) {
+ alt10=1;
+ }
+ }
+ }
+ else if ( (LA10_2==ID) ) {
+ int LA10_6 = input.LA(3);
+
+ if ( (LA10_6==DOUBLE_QUOTE) ) {
+ int LA10_7 = input.LA(4);
+
+ if ( (LA10_7==DOT) ) {
+ alt10=1;
+ }
+ }
+ }
+ }
+ switch (alt10) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:190:12: qualifier DOT
+ {
+ pushFollow(FOLLOW_qualifier_in_multiValuedColumnReference435);
+ qualifier22=qualifier();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_qualifier.add(qualifier22.getTree());
+ DOT23=(Token)match(input,DOT,FOLLOW_DOT_in_multiValuedColumnReference437); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_DOT.add(DOT23);
+
+
+ }
+ break;
+
+ }
+
+ pushFollow(FOLLOW_multiValuedColumnName_in_multiValuedColumnReference443);
+ multiValuedColumnName24=multiValuedColumnName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_multiValuedColumnName.add(multiValuedColumnName24.getTree());
+
+
+ // AST REWRITE
+ // elements: multiValuedColumnName, qualifier
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 191:3: -> ^( COLUMN_REF multiValuedColumnName ( qualifier )? )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:191:6: ^( COLUMN_REF multiValuedColumnName ( qualifier )? )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(COLUMN_REF, "COLUMN_REF"), root_1);
+
+ adaptor.addChild(root_1, stream_multiValuedColumnName.nextTree());
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:191:41: ( qualifier )?
+ if ( stream_qualifier.hasNext() ) {
+ adaptor.addChild(root_1, stream_qualifier.nextTree());
+
+ }
+ stream_qualifier.reset();
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end multiValuedColumnReference
+
+ public static class valueFunction_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start valueFunction
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:194:1: valueFunction : functionName= keyWordOrId LPAREN ( functionArgument )* RPAREN -> ^( FUNCTION $functionName ( functionArgument )* ) ;
+ public final CMISParser.valueFunction_return valueFunction() throws RecognitionException {
+ CMISParser.valueFunction_return retval = new CMISParser.valueFunction_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token LPAREN25=null;
+ Token RPAREN27=null;
+ CMISParser.keyWordOrId_return functionName = null;
+
+ CMISParser.functionArgument_return functionArgument26 = null;
+
+
+ Object LPAREN25_tree=null;
+ Object RPAREN27_tree=null;
+ RewriteRuleTokenStream stream_RPAREN=new RewriteRuleTokenStream(adaptor,"token RPAREN");
+ RewriteRuleTokenStream stream_LPAREN=new RewriteRuleTokenStream(adaptor,"token LPAREN");
+ RewriteRuleSubtreeStream stream_keyWordOrId=new RewriteRuleSubtreeStream(adaptor,"rule keyWordOrId");
+ RewriteRuleSubtreeStream stream_functionArgument=new RewriteRuleSubtreeStream(adaptor,"rule functionArgument");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:195:2: (functionName= keyWordOrId LPAREN ( functionArgument )* RPAREN -> ^( FUNCTION $functionName ( functionArgument )* ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:195:4: functionName= keyWordOrId LPAREN ( functionArgument )* RPAREN
+ {
+ pushFollow(FOLLOW_keyWordOrId_in_valueFunction470);
+ functionName=keyWordOrId();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_keyWordOrId.add(functionName.getTree());
+ LPAREN25=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_valueFunction472); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_LPAREN.add(LPAREN25);
+
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:195:36: ( functionArgument )*
+ loop11:
+ do {
+ int alt11=2;
+ int LA11_0 = input.LA(1);
+
+ if ( ((LA11_0>=COLON && LA11_0<=DECIMAL_INTEGER_LITERAL)) ) {
+ alt11=1;
+ }
+
+
+ switch (alt11) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:195:36: functionArgument
+ {
+ pushFollow(FOLLOW_functionArgument_in_valueFunction474);
+ functionArgument26=functionArgument();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_functionArgument.add(functionArgument26.getTree());
+
+ }
+ break;
+
+ default :
+ break loop11;
+ }
+ } while (true);
+
+ RPAREN27=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_valueFunction477); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN27);
+
+
+
+ // AST REWRITE
+ // elements: functionName, functionArgument
+ // token labels:
+ // rule labels: retval, functionName
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+ RewriteRuleSubtreeStream stream_functionName=new RewriteRuleSubtreeStream(adaptor,"token functionName",functionName!=null?functionName.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 196:3: -> ^( FUNCTION $functionName ( functionArgument )* )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:196:6: ^( FUNCTION $functionName ( functionArgument )* )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(FUNCTION, "FUNCTION"), root_1);
+
+ adaptor.addChild(root_1, stream_functionName.nextTree());
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:196:31: ( functionArgument )*
+ while ( stream_functionArgument.hasNext() ) {
+ adaptor.addChild(root_1, stream_functionArgument.nextTree());
+
+ }
+ stream_functionArgument.reset();
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end valueFunction
+
+ public static class functionArgument_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start functionArgument
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:199:1: functionArgument : ( qualifier DOT columnName -> ^( COLUMN_REF columnName qualifier ) | identifier | literalOrParameterName );
+ public final CMISParser.functionArgument_return functionArgument() throws RecognitionException {
+ CMISParser.functionArgument_return retval = new CMISParser.functionArgument_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token DOT29=null;
+ CMISParser.qualifier_return qualifier28 = null;
+
+ CMISParser.columnName_return columnName30 = null;
+
+ CMISParser.identifier_return identifier31 = null;
+
+ CMISParser.literalOrParameterName_return literalOrParameterName32 = null;
+
+
+ Object DOT29_tree=null;
+ RewriteRuleTokenStream stream_DOT=new RewriteRuleTokenStream(adaptor,"token DOT");
+ RewriteRuleSubtreeStream stream_columnName=new RewriteRuleSubtreeStream(adaptor,"rule columnName");
+ RewriteRuleSubtreeStream stream_qualifier=new RewriteRuleSubtreeStream(adaptor,"rule qualifier");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:200:5: ( qualifier DOT columnName -> ^( COLUMN_REF columnName qualifier ) | identifier | literalOrParameterName )
+ int alt12=3;
+ switch ( input.LA(1) ) {
+ case ID:
+ {
+ int LA12_1 = input.LA(2);
+
+ if ( (LA12_1==RPAREN||(LA12_1>=COLON && LA12_1<=DECIMAL_INTEGER_LITERAL)) ) {
+ alt12=2;
+ }
+ else if ( (LA12_1==DOT) ) {
+ alt12=1;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 12, 1, input);
+
+ throw nvae;
+ }
+ }
+ break;
+ case DOUBLE_QUOTE:
+ {
+ int LA12_2 = input.LA(2);
+
+ if ( (LA12_2==SELECT||LA12_2==AS||(LA12_2>=FROM && LA12_2<=ON)||(LA12_2>=WHERE && LA12_2<=NOT)||(LA12_2>=IN && LA12_2<=DESC)||(LA12_2>=UPPER && LA12_2<=SCORE)) ) {
+ int LA12_6 = input.LA(3);
+
+ if ( (LA12_6==DOUBLE_QUOTE) ) {
+ int LA12_8 = input.LA(4);
+
+ if ( (LA12_8==RPAREN||(LA12_8>=COLON && LA12_8<=DECIMAL_INTEGER_LITERAL)) ) {
+ alt12=2;
+ }
+ else if ( (LA12_8==DOT) ) {
+ alt12=1;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 12, 8, input);
+
+ throw nvae;
+ }
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 12, 6, input);
+
+ throw nvae;
+ }
+ }
+ else if ( (LA12_2==ID) ) {
+ int LA12_7 = input.LA(3);
+
+ if ( (LA12_7==DOUBLE_QUOTE) ) {
+ int LA12_8 = input.LA(4);
+
+ if ( (LA12_8==RPAREN||(LA12_8>=COLON && LA12_8<=DECIMAL_INTEGER_LITERAL)) ) {
+ alt12=2;
+ }
+ else if ( (LA12_8==DOT) ) {
+ alt12=1;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 12, 8, input);
+
+ throw nvae;
+ }
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 12, 7, input);
+
+ throw nvae;
+ }
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 12, 2, input);
+
+ throw nvae;
+ }
+ }
+ break;
+ case COLON:
+ case QUOTED_STRING:
+ case FLOATING_POINT_LITERAL:
+ case DECIMAL_INTEGER_LITERAL:
+ {
+ alt12=3;
+ }
+ break;
+ default:
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 12, 0, input);
+
+ throw nvae;
+ }
+
+ switch (alt12) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:200:9: qualifier DOT columnName
+ {
+ pushFollow(FOLLOW_qualifier_in_functionArgument508);
+ qualifier28=qualifier();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_qualifier.add(qualifier28.getTree());
+ DOT29=(Token)match(input,DOT,FOLLOW_DOT_in_functionArgument510); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_DOT.add(DOT29);
+
+ pushFollow(FOLLOW_columnName_in_functionArgument512);
+ columnName30=columnName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_columnName.add(columnName30.getTree());
+
+
+ // AST REWRITE
+ // elements: qualifier, columnName
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 201:5: -> ^( COLUMN_REF columnName qualifier )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:201:8: ^( COLUMN_REF columnName qualifier )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(COLUMN_REF, "COLUMN_REF"), root_1);
+
+ adaptor.addChild(root_1, stream_columnName.nextTree());
+ adaptor.addChild(root_1, stream_qualifier.nextTree());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:202:9: identifier
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_identifier_in_functionArgument536);
+ identifier31=identifier();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, identifier31.getTree());
+
+ }
+ break;
+ case 3 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:203:9: literalOrParameterName
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_literalOrParameterName_in_functionArgument546);
+ literalOrParameterName32=literalOrParameterName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, literalOrParameterName32.getTree());
+
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end functionArgument
+
+ public static class qualifier_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start qualifier
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:206:1: qualifier : ( ( tableName )=> tableName -> tableName | correlationName -> correlationName );
+ public final CMISParser.qualifier_return qualifier() throws RecognitionException {
+ CMISParser.qualifier_return retval = new CMISParser.qualifier_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ CMISParser.tableName_return tableName33 = null;
+
+ CMISParser.correlationName_return correlationName34 = null;
+
+
+ RewriteRuleSubtreeStream stream_correlationName=new RewriteRuleSubtreeStream(adaptor,"rule correlationName");
+ RewriteRuleSubtreeStream stream_tableName=new RewriteRuleSubtreeStream(adaptor,"rule tableName");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:207:2: ( ( tableName )=> tableName -> tableName | correlationName -> correlationName )
+ int alt13=2;
+ int LA13_0 = input.LA(1);
+
+ if ( (LA13_0==ID) ) {
+ int LA13_1 = input.LA(2);
+
+ if ( (synpred2_CMIS()) ) {
+ alt13=1;
+ }
+ else if ( (true) ) {
+ alt13=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 13, 1, input);
+
+ throw nvae;
+ }
+ }
+ else if ( (LA13_0==DOUBLE_QUOTE) ) {
+ int LA13_2 = input.LA(2);
+
+ if ( (LA13_2==SELECT||LA13_2==AS||(LA13_2>=FROM && LA13_2<=ON)||(LA13_2>=WHERE && LA13_2<=NOT)||(LA13_2>=IN && LA13_2<=DESC)||(LA13_2>=UPPER && LA13_2<=SCORE)) ) {
+ int LA13_5 = input.LA(3);
+
+ if ( (LA13_5==DOUBLE_QUOTE) ) {
+ int LA13_7 = input.LA(4);
+
+ if ( (synpred2_CMIS()) ) {
+ alt13=1;
+ }
+ else if ( (true) ) {
+ alt13=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 13, 7, input);
+
+ throw nvae;
+ }
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 13, 5, input);
+
+ throw nvae;
+ }
+ }
+ else if ( (LA13_2==ID) ) {
+ int LA13_6 = input.LA(3);
+
+ if ( (LA13_6==DOUBLE_QUOTE) ) {
+ int LA13_7 = input.LA(4);
+
+ if ( (synpred2_CMIS()) ) {
+ alt13=1;
+ }
+ else if ( (true) ) {
+ alt13=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 13, 7, input);
+
+ throw nvae;
+ }
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 13, 6, input);
+
+ throw nvae;
+ }
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 13, 2, input);
+
+ throw nvae;
+ }
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 13, 0, input);
+
+ throw nvae;
+ }
+ switch (alt13) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:207:4: ( tableName )=> tableName
+ {
+ pushFollow(FOLLOW_tableName_in_qualifier567);
+ tableName33=tableName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_tableName.add(tableName33.getTree());
+
+
+ // AST REWRITE
+ // elements: tableName
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 208:3: -> tableName
+ {
+ adaptor.addChild(root_0, stream_tableName.nextTree());
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:209:5: correlationName
+ {
+ pushFollow(FOLLOW_correlationName_in_qualifier579);
+ correlationName34=correlationName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_correlationName.add(correlationName34.getTree());
+
+
+ // AST REWRITE
+ // elements: correlationName
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 210:3: -> correlationName
+ {
+ adaptor.addChild(root_0, stream_correlationName.nextTree());
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end qualifier
+
+ public static class fromClause_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start fromClause
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:213:1: fromClause : FROM tableReference -> tableReference ;
+ public final CMISParser.fromClause_return fromClause() throws RecognitionException {
+ CMISParser.fromClause_return retval = new CMISParser.fromClause_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token FROM35=null;
+ CMISParser.tableReference_return tableReference36 = null;
+
+
+ Object FROM35_tree=null;
+ RewriteRuleTokenStream stream_FROM=new RewriteRuleTokenStream(adaptor,"token FROM");
+ RewriteRuleSubtreeStream stream_tableReference=new RewriteRuleSubtreeStream(adaptor,"rule tableReference");
+ paraphrases.push("in from");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:216:2: ( FROM tableReference -> tableReference )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:216:4: FROM tableReference
+ {
+ FROM35=(Token)match(input,FROM,FOLLOW_FROM_in_fromClause616); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_FROM.add(FROM35);
+
+ pushFollow(FOLLOW_tableReference_in_fromClause618);
+ tableReference36=tableReference();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_tableReference.add(tableReference36.getTree());
+
+
+ // AST REWRITE
+ // elements: tableReference
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 217:3: -> tableReference
+ {
+ adaptor.addChild(root_0, stream_tableReference.nextTree());
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ if ( state.backtracking==0 ) {
+ paraphrases.pop();
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end fromClause
+
+ public static class tableReference_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start tableReference
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:220:1: tableReference : singleTable ( ( joinedTable )=> joinedTable )* -> ^( SOURCE singleTable ( joinedTable )* ) ;
+ public final CMISParser.tableReference_return tableReference() throws RecognitionException {
+ CMISParser.tableReference_return retval = new CMISParser.tableReference_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ CMISParser.singleTable_return singleTable37 = null;
+
+ CMISParser.joinedTable_return joinedTable38 = null;
+
+
+ RewriteRuleSubtreeStream stream_singleTable=new RewriteRuleSubtreeStream(adaptor,"rule singleTable");
+ RewriteRuleSubtreeStream stream_joinedTable=new RewriteRuleSubtreeStream(adaptor,"rule joinedTable");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:221:2: ( singleTable ( ( joinedTable )=> joinedTable )* -> ^( SOURCE singleTable ( joinedTable )* ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:221:4: singleTable ( ( joinedTable )=> joinedTable )*
+ {
+ pushFollow(FOLLOW_singleTable_in_tableReference636);
+ singleTable37=singleTable();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_singleTable.add(singleTable37.getTree());
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:221:16: ( ( joinedTable )=> joinedTable )*
+ loop14:
+ do {
+ int alt14=2;
+ switch ( input.LA(1) ) {
+ case INNER:
+ {
+ int LA14_2 = input.LA(2);
+
+ if ( (synpred3_CMIS()) ) {
+ alt14=1;
+ }
+
+
+ }
+ break;
+ case LEFT:
+ {
+ int LA14_3 = input.LA(2);
+
+ if ( (synpred3_CMIS()) ) {
+ alt14=1;
+ }
+
+
+ }
+ break;
+ case JOIN:
+ {
+ int LA14_4 = input.LA(2);
+
+ if ( (synpred3_CMIS()) ) {
+ alt14=1;
+ }
+
+
+ }
+ break;
+
+ }
+
+ switch (alt14) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:221:17: ( joinedTable )=> joinedTable
+ {
+ pushFollow(FOLLOW_joinedTable_in_tableReference645);
+ joinedTable38=joinedTable();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_joinedTable.add(joinedTable38.getTree());
+
+ }
+ break;
+
+ default :
+ break loop14;
+ }
+ } while (true);
+
+
+
+ // AST REWRITE
+ // elements: joinedTable, singleTable
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 222:3: -> ^( SOURCE singleTable ( joinedTable )* )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:222:6: ^( SOURCE singleTable ( joinedTable )* )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(SOURCE, "SOURCE"), root_1);
+
+ adaptor.addChild(root_1, stream_singleTable.nextTree());
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:222:27: ( joinedTable )*
+ while ( stream_joinedTable.hasNext() ) {
+ adaptor.addChild(root_1, stream_joinedTable.nextTree());
+
+ }
+ stream_joinedTable.reset();
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end tableReference
+
+ public static class singleTable_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start singleTable
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:228:1: singleTable : ( tableName ( ( AS )? correlationName )? -> ^( TABLE_REF tableName ( correlationName )? ) | LPAREN joinedTables RPAREN -> ^( TABLE joinedTables ) );
+ public final CMISParser.singleTable_return singleTable() throws RecognitionException {
+ CMISParser.singleTable_return retval = new CMISParser.singleTable_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token AS40=null;
+ Token LPAREN42=null;
+ Token RPAREN44=null;
+ CMISParser.tableName_return tableName39 = null;
+
+ CMISParser.correlationName_return correlationName41 = null;
+
+ CMISParser.joinedTables_return joinedTables43 = null;
+
+
+ Object AS40_tree=null;
+ Object LPAREN42_tree=null;
+ Object RPAREN44_tree=null;
+ RewriteRuleTokenStream stream_AS=new RewriteRuleTokenStream(adaptor,"token AS");
+ RewriteRuleTokenStream stream_RPAREN=new RewriteRuleTokenStream(adaptor,"token RPAREN");
+ RewriteRuleTokenStream stream_LPAREN=new RewriteRuleTokenStream(adaptor,"token LPAREN");
+ RewriteRuleSubtreeStream stream_correlationName=new RewriteRuleSubtreeStream(adaptor,"rule correlationName");
+ RewriteRuleSubtreeStream stream_tableName=new RewriteRuleSubtreeStream(adaptor,"rule tableName");
+ RewriteRuleSubtreeStream stream_joinedTables=new RewriteRuleSubtreeStream(adaptor,"rule joinedTables");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:229:2: ( tableName ( ( AS )? correlationName )? -> ^( TABLE_REF tableName ( correlationName )? ) | LPAREN joinedTables RPAREN -> ^( TABLE joinedTables ) )
+ int alt17=2;
+ int LA17_0 = input.LA(1);
+
+ if ( ((LA17_0>=ID && LA17_0<=DOUBLE_QUOTE)) ) {
+ alt17=1;
+ }
+ else if ( (LA17_0==LPAREN) ) {
+ alt17=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 17, 0, input);
+
+ throw nvae;
+ }
+ switch (alt17) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:229:4: tableName ( ( AS )? correlationName )?
+ {
+ pushFollow(FOLLOW_tableName_in_singleTable674);
+ tableName39=tableName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_tableName.add(tableName39.getTree());
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:229:14: ( ( AS )? correlationName )?
+ int alt16=2;
+ int LA16_0 = input.LA(1);
+
+ if ( (LA16_0==AS||(LA16_0>=ID && LA16_0<=DOUBLE_QUOTE)) ) {
+ alt16=1;
+ }
+ switch (alt16) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:229:16: ( AS )? correlationName
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:229:16: ( AS )?
+ int alt15=2;
+ int LA15_0 = input.LA(1);
+
+ if ( (LA15_0==AS) ) {
+ alt15=1;
+ }
+ switch (alt15) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:229:16: AS
+ {
+ AS40=(Token)match(input,AS,FOLLOW_AS_in_singleTable678); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_AS.add(AS40);
+
+
+ }
+ break;
+
+ }
+
+ pushFollow(FOLLOW_correlationName_in_singleTable681);
+ correlationName41=correlationName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_correlationName.add(correlationName41.getTree());
+
+ }
+ break;
+
+ }
+
+
+
+ // AST REWRITE
+ // elements: tableName, correlationName
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 230:3: -> ^( TABLE_REF tableName ( correlationName )? )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:230:6: ^( TABLE_REF tableName ( correlationName )? )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(TABLE_REF, "TABLE_REF"), root_1);
+
+ adaptor.addChild(root_1, stream_tableName.nextTree());
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:230:28: ( correlationName )?
+ if ( stream_correlationName.hasNext() ) {
+ adaptor.addChild(root_1, stream_correlationName.nextTree());
+
+ }
+ stream_correlationName.reset();
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:231:4: LPAREN joinedTables RPAREN
+ {
+ LPAREN42=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_singleTable702); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_LPAREN.add(LPAREN42);
+
+ pushFollow(FOLLOW_joinedTables_in_singleTable704);
+ joinedTables43=joinedTables();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_joinedTables.add(joinedTables43.getTree());
+ RPAREN44=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_singleTable706); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN44);
+
+
+
+ // AST REWRITE
+ // elements: joinedTables
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 232:3: -> ^( TABLE joinedTables )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:232:6: ^( TABLE joinedTables )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(TABLE, "TABLE"), root_1);
+
+ adaptor.addChild(root_1, stream_joinedTables.nextTree());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end singleTable
+
+ public static class joinedTable_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start joinedTable
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:235:1: joinedTable : ( joinType )? JOIN tableReference ( ( joinSpecification )=> joinSpecification )? -> ^( JOIN tableReference ( joinType )? ( joinSpecification )? ) ;
+ public final CMISParser.joinedTable_return joinedTable() throws RecognitionException {
+ CMISParser.joinedTable_return retval = new CMISParser.joinedTable_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token JOIN46=null;
+ CMISParser.joinType_return joinType45 = null;
+
+ CMISParser.tableReference_return tableReference47 = null;
+
+ CMISParser.joinSpecification_return joinSpecification48 = null;
+
+
+ Object JOIN46_tree=null;
+ RewriteRuleTokenStream stream_JOIN=new RewriteRuleTokenStream(adaptor,"token JOIN");
+ RewriteRuleSubtreeStream stream_tableReference=new RewriteRuleSubtreeStream(adaptor,"rule tableReference");
+ RewriteRuleSubtreeStream stream_joinType=new RewriteRuleSubtreeStream(adaptor,"rule joinType");
+ RewriteRuleSubtreeStream stream_joinSpecification=new RewriteRuleSubtreeStream(adaptor,"rule joinSpecification");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:236:2: ( ( joinType )? JOIN tableReference ( ( joinSpecification )=> joinSpecification )? -> ^( JOIN tableReference ( joinType )? ( joinSpecification )? ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:236:4: ( joinType )? JOIN tableReference ( ( joinSpecification )=> joinSpecification )?
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:236:4: ( joinType )?
+ int alt18=2;
+ int LA18_0 = input.LA(1);
+
+ if ( ((LA18_0>=INNER && LA18_0<=LEFT)) ) {
+ alt18=1;
+ }
+ switch (alt18) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:236:4: joinType
+ {
+ pushFollow(FOLLOW_joinType_in_joinedTable728);
+ joinType45=joinType();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_joinType.add(joinType45.getTree());
+
+ }
+ break;
+
+ }
+
+ JOIN46=(Token)match(input,JOIN,FOLLOW_JOIN_in_joinedTable731); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_JOIN.add(JOIN46);
+
+ pushFollow(FOLLOW_tableReference_in_joinedTable733);
+ tableReference47=tableReference();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_tableReference.add(tableReference47.getTree());
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:236:34: ( ( joinSpecification )=> joinSpecification )?
+ int alt19=2;
+ int LA19_0 = input.LA(1);
+
+ if ( (LA19_0==ON) ) {
+ int LA19_1 = input.LA(2);
+
+ if ( (synpred4_CMIS()) ) {
+ alt19=1;
+ }
+ }
+ switch (alt19) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:236:35: ( joinSpecification )=> joinSpecification
+ {
+ pushFollow(FOLLOW_joinSpecification_in_joinedTable742);
+ joinSpecification48=joinSpecification();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_joinSpecification.add(joinSpecification48.getTree());
+
+ }
+ break;
+
+ }
+
+
+
+ // AST REWRITE
+ // elements: joinType, joinSpecification, JOIN, tableReference
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 237:3: -> ^( JOIN tableReference ( joinType )? ( joinSpecification )? )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:237:6: ^( JOIN tableReference ( joinType )? ( joinSpecification )? )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot(stream_JOIN.nextNode(), root_1);
+
+ adaptor.addChild(root_1, stream_tableReference.nextTree());
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:237:28: ( joinType )?
+ if ( stream_joinType.hasNext() ) {
+ adaptor.addChild(root_1, stream_joinType.nextTree());
+
+ }
+ stream_joinType.reset();
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:237:38: ( joinSpecification )?
+ if ( stream_joinSpecification.hasNext() ) {
+ adaptor.addChild(root_1, stream_joinSpecification.nextTree());
+
+ }
+ stream_joinSpecification.reset();
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end joinedTable
+
+ public static class joinedTables_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start joinedTables
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:241:1: joinedTables : singleTable ( joinedTable )+ -> ^( SOURCE singleTable ( joinedTable )+ ) ;
+ public final CMISParser.joinedTables_return joinedTables() throws RecognitionException {
+ CMISParser.joinedTables_return retval = new CMISParser.joinedTables_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ CMISParser.singleTable_return singleTable49 = null;
+
+ CMISParser.joinedTable_return joinedTable50 = null;
+
+
+ RewriteRuleSubtreeStream stream_singleTable=new RewriteRuleSubtreeStream(adaptor,"rule singleTable");
+ RewriteRuleSubtreeStream stream_joinedTable=new RewriteRuleSubtreeStream(adaptor,"rule joinedTable");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:242:2: ( singleTable ( joinedTable )+ -> ^( SOURCE singleTable ( joinedTable )+ ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:242:4: singleTable ( joinedTable )+
+ {
+ pushFollow(FOLLOW_singleTable_in_joinedTables773);
+ singleTable49=singleTable();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_singleTable.add(singleTable49.getTree());
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:242:16: ( joinedTable )+
+ int cnt20=0;
+ loop20:
+ do {
+ int alt20=2;
+ int LA20_0 = input.LA(1);
+
+ if ( ((LA20_0>=JOIN && LA20_0<=LEFT)) ) {
+ alt20=1;
+ }
+
+
+ switch (alt20) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:242:16: joinedTable
+ {
+ pushFollow(FOLLOW_joinedTable_in_joinedTables775);
+ joinedTable50=joinedTable();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_joinedTable.add(joinedTable50.getTree());
+
+ }
+ break;
+
+ default :
+ if ( cnt20 >= 1 ) break loop20;
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ EarlyExitException eee =
+ new EarlyExitException(20, input);
+ throw eee;
+ }
+ cnt20++;
+ } while (true);
+
+
+
+ // AST REWRITE
+ // elements: joinedTable, singleTable
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 243:3: -> ^( SOURCE singleTable ( joinedTable )+ )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:243:6: ^( SOURCE singleTable ( joinedTable )+ )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(SOURCE, "SOURCE"), root_1);
+
+ adaptor.addChild(root_1, stream_singleTable.nextTree());
+ if ( !(stream_joinedTable.hasNext()) ) {
+ throw new RewriteEarlyExitException();
+ }
+ while ( stream_joinedTable.hasNext() ) {
+ adaptor.addChild(root_1, stream_joinedTable.nextTree());
+
+ }
+ stream_joinedTable.reset();
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end joinedTables
+
+ public static class joinType_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start joinType
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:246:1: joinType : ( INNER -> INNER | LEFT ( OUTER )? -> LEFT );
+ public final CMISParser.joinType_return joinType() throws RecognitionException {
+ CMISParser.joinType_return retval = new CMISParser.joinType_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token INNER51=null;
+ Token LEFT52=null;
+ Token OUTER53=null;
+
+ Object INNER51_tree=null;
+ Object LEFT52_tree=null;
+ Object OUTER53_tree=null;
+ RewriteRuleTokenStream stream_OUTER=new RewriteRuleTokenStream(adaptor,"token OUTER");
+ RewriteRuleTokenStream stream_INNER=new RewriteRuleTokenStream(adaptor,"token INNER");
+ RewriteRuleTokenStream stream_LEFT=new RewriteRuleTokenStream(adaptor,"token LEFT");
+
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:247:2: ( INNER -> INNER | LEFT ( OUTER )? -> LEFT )
+ int alt22=2;
+ int LA22_0 = input.LA(1);
+
+ if ( (LA22_0==INNER) ) {
+ alt22=1;
+ }
+ else if ( (LA22_0==LEFT) ) {
+ alt22=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 22, 0, input);
+
+ throw nvae;
+ }
+ switch (alt22) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:247:4: INNER
+ {
+ INNER51=(Token)match(input,INNER,FOLLOW_INNER_in_joinType802); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_INNER.add(INNER51);
+
+
+
+ // AST REWRITE
+ // elements: INNER
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 248:3: -> INNER
+ {
+ adaptor.addChild(root_0, stream_INNER.nextNode());
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:249:5: LEFT ( OUTER )?
+ {
+ LEFT52=(Token)match(input,LEFT,FOLLOW_LEFT_in_joinType814); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_LEFT.add(LEFT52);
+
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:249:10: ( OUTER )?
+ int alt21=2;
+ int LA21_0 = input.LA(1);
+
+ if ( (LA21_0==OUTER) ) {
+ alt21=1;
+ }
+ switch (alt21) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:249:10: OUTER
+ {
+ OUTER53=(Token)match(input,OUTER,FOLLOW_OUTER_in_joinType816); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_OUTER.add(OUTER53);
+
+
+ }
+ break;
+
+ }
+
+
+
+ // AST REWRITE
+ // elements: LEFT
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 250:3: -> LEFT
+ {
+ adaptor.addChild(root_0, stream_LEFT.nextNode());
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end joinType
+
+ public static class joinSpecification_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start joinSpecification
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:253:1: joinSpecification : ON LPAREN lhs= columnReference EQUALS rhs= columnReference RPAREN -> ^( ON $lhs EQUALS $rhs) ;
+ public final CMISParser.joinSpecification_return joinSpecification() throws RecognitionException {
+ CMISParser.joinSpecification_return retval = new CMISParser.joinSpecification_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token ON54=null;
+ Token LPAREN55=null;
+ Token EQUALS56=null;
+ Token RPAREN57=null;
+ CMISParser.columnReference_return lhs = null;
+
+ CMISParser.columnReference_return rhs = null;
+
+
+ Object ON54_tree=null;
+ Object LPAREN55_tree=null;
+ Object EQUALS56_tree=null;
+ Object RPAREN57_tree=null;
+ RewriteRuleTokenStream stream_ON=new RewriteRuleTokenStream(adaptor,"token ON");
+ RewriteRuleTokenStream stream_RPAREN=new RewriteRuleTokenStream(adaptor,"token RPAREN");
+ RewriteRuleTokenStream stream_EQUALS=new RewriteRuleTokenStream(adaptor,"token EQUALS");
+ RewriteRuleTokenStream stream_LPAREN=new RewriteRuleTokenStream(adaptor,"token LPAREN");
+ RewriteRuleSubtreeStream stream_columnReference=new RewriteRuleSubtreeStream(adaptor,"rule columnReference");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:254:2: ( ON LPAREN lhs= columnReference EQUALS rhs= columnReference RPAREN -> ^( ON $lhs EQUALS $rhs) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:254:4: ON LPAREN lhs= columnReference EQUALS rhs= columnReference RPAREN
+ {
+ ON54=(Token)match(input,ON,FOLLOW_ON_in_joinSpecification836); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_ON.add(ON54);
+
+ LPAREN55=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_joinSpecification838); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_LPAREN.add(LPAREN55);
+
+ pushFollow(FOLLOW_columnReference_in_joinSpecification842);
+ lhs=columnReference();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_columnReference.add(lhs.getTree());
+ EQUALS56=(Token)match(input,EQUALS,FOLLOW_EQUALS_in_joinSpecification844); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_EQUALS.add(EQUALS56);
+
+ pushFollow(FOLLOW_columnReference_in_joinSpecification848);
+ rhs=columnReference();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_columnReference.add(rhs.getTree());
+ RPAREN57=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_joinSpecification850); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN57);
+
+
+
+ // AST REWRITE
+ // elements: EQUALS, ON, lhs, rhs
+ // token labels:
+ // rule labels: retval, rhs, lhs
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+ RewriteRuleSubtreeStream stream_rhs=new RewriteRuleSubtreeStream(adaptor,"token rhs",rhs!=null?rhs.tree:null);
+ RewriteRuleSubtreeStream stream_lhs=new RewriteRuleSubtreeStream(adaptor,"token lhs",lhs!=null?lhs.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 255:3: -> ^( ON $lhs EQUALS $rhs)
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:255:6: ^( ON $lhs EQUALS $rhs)
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot(stream_ON.nextNode(), root_1);
+
+ adaptor.addChild(root_1, stream_lhs.nextTree());
+ adaptor.addChild(root_1, stream_EQUALS.nextNode());
+ adaptor.addChild(root_1, stream_rhs.nextTree());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end joinSpecification
+
+ public static class whereClause_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start whereClause
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:262:1: whereClause : WHERE searchOrCondition -> searchOrCondition ;
+ public final CMISParser.whereClause_return whereClause() throws RecognitionException {
+ CMISParser.whereClause_return retval = new CMISParser.whereClause_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token WHERE58=null;
+ CMISParser.searchOrCondition_return searchOrCondition59 = null;
+
+
+ Object WHERE58_tree=null;
+ RewriteRuleTokenStream stream_WHERE=new RewriteRuleTokenStream(adaptor,"token WHERE");
+ RewriteRuleSubtreeStream stream_searchOrCondition=new RewriteRuleSubtreeStream(adaptor,"rule searchOrCondition");
+ paraphrases.push("in where");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:265:2: ( WHERE searchOrCondition -> searchOrCondition )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:265:4: WHERE searchOrCondition
+ {
+ WHERE58=(Token)match(input,WHERE,FOLLOW_WHERE_in_whereClause900); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_WHERE.add(WHERE58);
+
+ pushFollow(FOLLOW_searchOrCondition_in_whereClause902);
+ searchOrCondition59=searchOrCondition();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_searchOrCondition.add(searchOrCondition59.getTree());
+
+
+ // AST REWRITE
+ // elements: searchOrCondition
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 266:3: -> searchOrCondition
+ {
+ adaptor.addChild(root_0, stream_searchOrCondition.nextTree());
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ if ( state.backtracking==0 ) {
+ paraphrases.pop();
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end whereClause
+
+ public static class searchOrCondition_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start searchOrCondition
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:269:1: searchOrCondition : searchAndCondition ( OR searchAndCondition )* -> ^( DISJUNCTION ( searchAndCondition )+ ) ;
+ public final CMISParser.searchOrCondition_return searchOrCondition() throws RecognitionException {
+ CMISParser.searchOrCondition_return retval = new CMISParser.searchOrCondition_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token OR61=null;
+ CMISParser.searchAndCondition_return searchAndCondition60 = null;
+
+ CMISParser.searchAndCondition_return searchAndCondition62 = null;
+
+
+ Object OR61_tree=null;
+ RewriteRuleTokenStream stream_OR=new RewriteRuleTokenStream(adaptor,"token OR");
+ RewriteRuleSubtreeStream stream_searchAndCondition=new RewriteRuleSubtreeStream(adaptor,"rule searchAndCondition");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:273:2: ( searchAndCondition ( OR searchAndCondition )* -> ^( DISJUNCTION ( searchAndCondition )+ ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:273:4: searchAndCondition ( OR searchAndCondition )*
+ {
+ pushFollow(FOLLOW_searchAndCondition_in_searchOrCondition922);
+ searchAndCondition60=searchAndCondition();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_searchAndCondition.add(searchAndCondition60.getTree());
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:273:23: ( OR searchAndCondition )*
+ loop23:
+ do {
+ int alt23=2;
+ int LA23_0 = input.LA(1);
+
+ if ( (LA23_0==OR) ) {
+ alt23=1;
+ }
+
+
+ switch (alt23) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:273:24: OR searchAndCondition
+ {
+ OR61=(Token)match(input,OR,FOLLOW_OR_in_searchOrCondition925); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_OR.add(OR61);
+
+ pushFollow(FOLLOW_searchAndCondition_in_searchOrCondition927);
+ searchAndCondition62=searchAndCondition();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_searchAndCondition.add(searchAndCondition62.getTree());
+
+ }
+ break;
+
+ default :
+ break loop23;
+ }
+ } while (true);
+
+
+
+ // AST REWRITE
+ // elements: searchAndCondition
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 274:3: -> ^( DISJUNCTION ( searchAndCondition )+ )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:274:6: ^( DISJUNCTION ( searchAndCondition )+ )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(DISJUNCTION, "DISJUNCTION"), root_1);
+
+ if ( !(stream_searchAndCondition.hasNext()) ) {
+ throw new RewriteEarlyExitException();
+ }
+ while ( stream_searchAndCondition.hasNext() ) {
+ adaptor.addChild(root_1, stream_searchAndCondition.nextTree());
+
+ }
+ stream_searchAndCondition.reset();
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end searchOrCondition
+
+ public static class searchAndCondition_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start searchAndCondition
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:278:1: searchAndCondition : searchNotCondition ( AND searchNotCondition )* -> ^( CONJUNCTION ( searchNotCondition )+ ) ;
+ public final CMISParser.searchAndCondition_return searchAndCondition() throws RecognitionException {
+ CMISParser.searchAndCondition_return retval = new CMISParser.searchAndCondition_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token AND64=null;
+ CMISParser.searchNotCondition_return searchNotCondition63 = null;
+
+ CMISParser.searchNotCondition_return searchNotCondition65 = null;
+
+
+ Object AND64_tree=null;
+ RewriteRuleTokenStream stream_AND=new RewriteRuleTokenStream(adaptor,"token AND");
+ RewriteRuleSubtreeStream stream_searchNotCondition=new RewriteRuleSubtreeStream(adaptor,"rule searchNotCondition");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:282:2: ( searchNotCondition ( AND searchNotCondition )* -> ^( CONJUNCTION ( searchNotCondition )+ ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:282:4: searchNotCondition ( AND searchNotCondition )*
+ {
+ pushFollow(FOLLOW_searchNotCondition_in_searchAndCondition955);
+ searchNotCondition63=searchNotCondition();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_searchNotCondition.add(searchNotCondition63.getTree());
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:282:23: ( AND searchNotCondition )*
+ loop24:
+ do {
+ int alt24=2;
+ int LA24_0 = input.LA(1);
+
+ if ( (LA24_0==AND) ) {
+ alt24=1;
+ }
+
+
+ switch (alt24) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:282:24: AND searchNotCondition
+ {
+ AND64=(Token)match(input,AND,FOLLOW_AND_in_searchAndCondition958); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_AND.add(AND64);
+
+ pushFollow(FOLLOW_searchNotCondition_in_searchAndCondition960);
+ searchNotCondition65=searchNotCondition();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_searchNotCondition.add(searchNotCondition65.getTree());
+
+ }
+ break;
+
+ default :
+ break loop24;
+ }
+ } while (true);
+
+
+
+ // AST REWRITE
+ // elements: searchNotCondition
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 283:3: -> ^( CONJUNCTION ( searchNotCondition )+ )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:283:6: ^( CONJUNCTION ( searchNotCondition )+ )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(CONJUNCTION, "CONJUNCTION"), root_1);
+
+ if ( !(stream_searchNotCondition.hasNext()) ) {
+ throw new RewriteEarlyExitException();
+ }
+ while ( stream_searchNotCondition.hasNext() ) {
+ adaptor.addChild(root_1, stream_searchNotCondition.nextTree());
+
+ }
+ stream_searchNotCondition.reset();
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end searchAndCondition
+
+ public static class searchNotCondition_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start searchNotCondition
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:286:1: searchNotCondition : ( NOT searchTest -> ^( NEGATION searchTest ) | searchTest -> searchTest );
+ public final CMISParser.searchNotCondition_return searchNotCondition() throws RecognitionException {
+ CMISParser.searchNotCondition_return retval = new CMISParser.searchNotCondition_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token NOT66=null;
+ CMISParser.searchTest_return searchTest67 = null;
+
+ CMISParser.searchTest_return searchTest68 = null;
+
+
+ Object NOT66_tree=null;
+ RewriteRuleTokenStream stream_NOT=new RewriteRuleTokenStream(adaptor,"token NOT");
+ RewriteRuleSubtreeStream stream_searchTest=new RewriteRuleSubtreeStream(adaptor,"rule searchTest");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:287:2: ( NOT searchTest -> ^( NEGATION searchTest ) | searchTest -> searchTest )
+ int alt25=2;
+ alt25 = dfa25.predict(input);
+ switch (alt25) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:287:4: NOT searchTest
+ {
+ NOT66=(Token)match(input,NOT,FOLLOW_NOT_in_searchNotCondition987); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_NOT.add(NOT66);
+
+ pushFollow(FOLLOW_searchTest_in_searchNotCondition989);
+ searchTest67=searchTest();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_searchTest.add(searchTest67.getTree());
+
+
+ // AST REWRITE
+ // elements: searchTest
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 288:3: -> ^( NEGATION searchTest )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:288:6: ^( NEGATION searchTest )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(NEGATION, "NEGATION"), root_1);
+
+ adaptor.addChild(root_1, stream_searchTest.nextTree());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:289:4: searchTest
+ {
+ pushFollow(FOLLOW_searchTest_in_searchNotCondition1004);
+ searchTest68=searchTest();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_searchTest.add(searchTest68.getTree());
+
+
+ // AST REWRITE
+ // elements: searchTest
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 290:3: -> searchTest
+ {
+ adaptor.addChild(root_0, stream_searchTest.nextTree());
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end searchNotCondition
+
+ public static class searchTest_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start searchTest
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:293:1: searchTest : ( predicate -> predicate | LPAREN searchOrCondition RPAREN -> searchOrCondition );
+ public final CMISParser.searchTest_return searchTest() throws RecognitionException {
+ CMISParser.searchTest_return retval = new CMISParser.searchTest_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token LPAREN70=null;
+ Token RPAREN72=null;
+ CMISParser.predicate_return predicate69 = null;
+
+ CMISParser.searchOrCondition_return searchOrCondition71 = null;
+
+
+ Object LPAREN70_tree=null;
+ Object RPAREN72_tree=null;
+ RewriteRuleTokenStream stream_RPAREN=new RewriteRuleTokenStream(adaptor,"token RPAREN");
+ RewriteRuleTokenStream stream_LPAREN=new RewriteRuleTokenStream(adaptor,"token LPAREN");
+ RewriteRuleSubtreeStream stream_predicate=new RewriteRuleSubtreeStream(adaptor,"rule predicate");
+ RewriteRuleSubtreeStream stream_searchOrCondition=new RewriteRuleSubtreeStream(adaptor,"rule searchOrCondition");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:294:2: ( predicate -> predicate | LPAREN searchOrCondition RPAREN -> searchOrCondition )
+ int alt26=2;
+ int LA26_0 = input.LA(1);
+
+ if ( (LA26_0==SELECT||LA26_0==AS||(LA26_0>=FROM && LA26_0<=ON)||(LA26_0>=WHERE && LA26_0<=NOT)||(LA26_0>=IN && LA26_0<=SCORE)) ) {
+ alt26=1;
+ }
+ else if ( (LA26_0==LPAREN) ) {
+ alt26=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 26, 0, input);
+
+ throw nvae;
+ }
+ switch (alt26) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:294:4: predicate
+ {
+ pushFollow(FOLLOW_predicate_in_searchTest1022);
+ predicate69=predicate();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_predicate.add(predicate69.getTree());
+
+
+ // AST REWRITE
+ // elements: predicate
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 295:3: -> predicate
+ {
+ adaptor.addChild(root_0, stream_predicate.nextTree());
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:296:4: LPAREN searchOrCondition RPAREN
+ {
+ LPAREN70=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_searchTest1033); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_LPAREN.add(LPAREN70);
+
+ pushFollow(FOLLOW_searchOrCondition_in_searchTest1035);
+ searchOrCondition71=searchOrCondition();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_searchOrCondition.add(searchOrCondition71.getTree());
+ RPAREN72=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_searchTest1037); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN72);
+
+
+
+ // AST REWRITE
+ // elements: searchOrCondition
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 297:3: -> searchOrCondition
+ {
+ adaptor.addChild(root_0, stream_searchOrCondition.nextTree());
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end searchTest
+
+ public static class predicate_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start predicate
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:300:1: predicate : ( comparisonPredicate | inPredicate | likePredicate | nullPredicate | quantifiedComparisonPredicate | quantifiedInPredicate | textSearchPredicate | folderPredicate );
+ public final CMISParser.predicate_return predicate() throws RecognitionException {
+ CMISParser.predicate_return retval = new CMISParser.predicate_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ CMISParser.comparisonPredicate_return comparisonPredicate73 = null;
+
+ CMISParser.inPredicate_return inPredicate74 = null;
+
+ CMISParser.likePredicate_return likePredicate75 = null;
+
+ CMISParser.nullPredicate_return nullPredicate76 = null;
+
+ CMISParser.quantifiedComparisonPredicate_return quantifiedComparisonPredicate77 = null;
+
+ CMISParser.quantifiedInPredicate_return quantifiedInPredicate78 = null;
+
+ CMISParser.textSearchPredicate_return textSearchPredicate79 = null;
+
+ CMISParser.folderPredicate_return folderPredicate80 = null;
+
+
+
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:301:2: ( comparisonPredicate | inPredicate | likePredicate | nullPredicate | quantifiedComparisonPredicate | quantifiedInPredicate | textSearchPredicate | folderPredicate )
+ int alt27=8;
+ alt27 = dfa27.predict(input);
+ switch (alt27) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:301:4: comparisonPredicate
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_comparisonPredicate_in_predicate1054);
+ comparisonPredicate73=comparisonPredicate();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, comparisonPredicate73.getTree());
+
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:302:4: inPredicate
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_inPredicate_in_predicate1059);
+ inPredicate74=inPredicate();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, inPredicate74.getTree());
+
+ }
+ break;
+ case 3 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:303:4: likePredicate
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_likePredicate_in_predicate1064);
+ likePredicate75=likePredicate();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, likePredicate75.getTree());
+
+ }
+ break;
+ case 4 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:304:4: nullPredicate
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_nullPredicate_in_predicate1069);
+ nullPredicate76=nullPredicate();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, nullPredicate76.getTree());
+
+ }
+ break;
+ case 5 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:305:5: quantifiedComparisonPredicate
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_quantifiedComparisonPredicate_in_predicate1075);
+ quantifiedComparisonPredicate77=quantifiedComparisonPredicate();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, quantifiedComparisonPredicate77.getTree());
+
+ }
+ break;
+ case 6 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:306:4: quantifiedInPredicate
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_quantifiedInPredicate_in_predicate1080);
+ quantifiedInPredicate78=quantifiedInPredicate();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, quantifiedInPredicate78.getTree());
+
+ }
+ break;
+ case 7 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:307:4: textSearchPredicate
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_textSearchPredicate_in_predicate1085);
+ textSearchPredicate79=textSearchPredicate();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, textSearchPredicate79.getTree());
+
+ }
+ break;
+ case 8 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:308:4: folderPredicate
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_folderPredicate_in_predicate1090);
+ folderPredicate80=folderPredicate();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, folderPredicate80.getTree());
+
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end predicate
+
+ public static class comparisonPredicate_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start comparisonPredicate
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:311:1: comparisonPredicate : valueExpression compOp literalOrParameterName -> ^( PRED_COMPARISON ANY valueExpression compOp literalOrParameterName ) ;
+ public final CMISParser.comparisonPredicate_return comparisonPredicate() throws RecognitionException {
+ CMISParser.comparisonPredicate_return retval = new CMISParser.comparisonPredicate_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ CMISParser.valueExpression_return valueExpression81 = null;
+
+ CMISParser.compOp_return compOp82 = null;
+
+ CMISParser.literalOrParameterName_return literalOrParameterName83 = null;
+
+
+ RewriteRuleSubtreeStream stream_valueExpression=new RewriteRuleSubtreeStream(adaptor,"rule valueExpression");
+ RewriteRuleSubtreeStream stream_compOp=new RewriteRuleSubtreeStream(adaptor,"rule compOp");
+ RewriteRuleSubtreeStream stream_literalOrParameterName=new RewriteRuleSubtreeStream(adaptor,"rule literalOrParameterName");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:312:2: ( valueExpression compOp literalOrParameterName -> ^( PRED_COMPARISON ANY valueExpression compOp literalOrParameterName ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:312:4: valueExpression compOp literalOrParameterName
+ {
+ pushFollow(FOLLOW_valueExpression_in_comparisonPredicate1102);
+ valueExpression81=valueExpression();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_valueExpression.add(valueExpression81.getTree());
+ pushFollow(FOLLOW_compOp_in_comparisonPredicate1104);
+ compOp82=compOp();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_compOp.add(compOp82.getTree());
+ pushFollow(FOLLOW_literalOrParameterName_in_comparisonPredicate1106);
+ literalOrParameterName83=literalOrParameterName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_literalOrParameterName.add(literalOrParameterName83.getTree());
+
+
+ // AST REWRITE
+ // elements: compOp, valueExpression, literalOrParameterName
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 313:3: -> ^( PRED_COMPARISON ANY valueExpression compOp literalOrParameterName )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:313:6: ^( PRED_COMPARISON ANY valueExpression compOp literalOrParameterName )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(PRED_COMPARISON, "PRED_COMPARISON"), root_1);
+
+ adaptor.addChild(root_1, (Object)adaptor.create(ANY, "ANY"));
+ adaptor.addChild(root_1, stream_valueExpression.nextTree());
+ adaptor.addChild(root_1, stream_compOp.nextTree());
+ adaptor.addChild(root_1, stream_literalOrParameterName.nextTree());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end comparisonPredicate
+
+ public static class compOp_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start compOp
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:316:1: compOp : ( EQUALS | NOTEQUALS | LESSTHAN | GREATERTHAN | LESSTHANOREQUALS | GREATERTHANOREQUALS );
+ public final CMISParser.compOp_return compOp() throws RecognitionException {
+ CMISParser.compOp_return retval = new CMISParser.compOp_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token set84=null;
+
+ Object set84_tree=null;
+
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:317:2: ( EQUALS | NOTEQUALS | LESSTHAN | GREATERTHAN | LESSTHANOREQUALS | GREATERTHANOREQUALS )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:
+ {
+ root_0 = (Object)adaptor.nil();
+
+ set84=(Token)input.LT(1);
+ if ( input.LA(1)==EQUALS||(input.LA(1)>=NOTEQUALS && input.LA(1)<=GREATERTHANOREQUALS) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(set84));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end compOp
+
+ public static class literalOrParameterName_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start literalOrParameterName
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:325:1: literalOrParameterName : ( literal | parameterName );
+ public final CMISParser.literalOrParameterName_return literalOrParameterName() throws RecognitionException {
+ CMISParser.literalOrParameterName_return retval = new CMISParser.literalOrParameterName_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ CMISParser.literal_return literal85 = null;
+
+ CMISParser.parameterName_return parameterName86 = null;
+
+
+
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:326:2: ( literal | parameterName )
+ int alt28=2;
+ int LA28_0 = input.LA(1);
+
+ if ( (LA28_0==QUOTED_STRING||(LA28_0>=FLOATING_POINT_LITERAL && LA28_0<=DECIMAL_INTEGER_LITERAL)) ) {
+ alt28=1;
+ }
+ else if ( (LA28_0==COLON) ) {
+ alt28=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 28, 0, input);
+
+ throw nvae;
+ }
+ switch (alt28) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:326:4: literal
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_literal_in_literalOrParameterName1172);
+ literal85=literal();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, literal85.getTree());
+
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:327:4: parameterName
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_parameterName_in_literalOrParameterName1177);
+ parameterName86=parameterName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, parameterName86.getTree());
+
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end literalOrParameterName
+
+ public static class literal_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start literal
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:330:1: literal : ( signedNumericLiteral | characterStringLiteral );
+ public final CMISParser.literal_return literal() throws RecognitionException {
+ CMISParser.literal_return retval = new CMISParser.literal_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ CMISParser.signedNumericLiteral_return signedNumericLiteral87 = null;
+
+ CMISParser.characterStringLiteral_return characterStringLiteral88 = null;
+
+
+
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:331:2: ( signedNumericLiteral | characterStringLiteral )
+ int alt29=2;
+ int LA29_0 = input.LA(1);
+
+ if ( ((LA29_0>=FLOATING_POINT_LITERAL && LA29_0<=DECIMAL_INTEGER_LITERAL)) ) {
+ alt29=1;
+ }
+ else if ( (LA29_0==QUOTED_STRING) ) {
+ alt29=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 29, 0, input);
+
+ throw nvae;
+ }
+ switch (alt29) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:331:4: signedNumericLiteral
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_signedNumericLiteral_in_literal1190);
+ signedNumericLiteral87=signedNumericLiteral();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, signedNumericLiteral87.getTree());
+
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:332:4: characterStringLiteral
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_characterStringLiteral_in_literal1195);
+ characterStringLiteral88=characterStringLiteral();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, characterStringLiteral88.getTree());
+
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end literal
+
+ public static class inPredicate_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start inPredicate
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:335:1: inPredicate : columnReference ( NOT )? IN LPAREN inValueList RPAREN -> ^( PRED_IN ANY columnReference ( NOT )? inValueList ) ;
+ public final CMISParser.inPredicate_return inPredicate() throws RecognitionException {
+ CMISParser.inPredicate_return retval = new CMISParser.inPredicate_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token NOT90=null;
+ Token IN91=null;
+ Token LPAREN92=null;
+ Token RPAREN94=null;
+ CMISParser.columnReference_return columnReference89 = null;
+
+ CMISParser.inValueList_return inValueList93 = null;
+
+
+ Object NOT90_tree=null;
+ Object IN91_tree=null;
+ Object LPAREN92_tree=null;
+ Object RPAREN94_tree=null;
+ RewriteRuleTokenStream stream_RPAREN=new RewriteRuleTokenStream(adaptor,"token RPAREN");
+ RewriteRuleTokenStream stream_IN=new RewriteRuleTokenStream(adaptor,"token IN");
+ RewriteRuleTokenStream stream_NOT=new RewriteRuleTokenStream(adaptor,"token NOT");
+ RewriteRuleTokenStream stream_LPAREN=new RewriteRuleTokenStream(adaptor,"token LPAREN");
+ RewriteRuleSubtreeStream stream_columnReference=new RewriteRuleSubtreeStream(adaptor,"rule columnReference");
+ RewriteRuleSubtreeStream stream_inValueList=new RewriteRuleSubtreeStream(adaptor,"rule inValueList");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:336:2: ( columnReference ( NOT )? IN LPAREN inValueList RPAREN -> ^( PRED_IN ANY columnReference ( NOT )? inValueList ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:336:4: columnReference ( NOT )? IN LPAREN inValueList RPAREN
+ {
+ pushFollow(FOLLOW_columnReference_in_inPredicate1207);
+ columnReference89=columnReference();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_columnReference.add(columnReference89.getTree());
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:336:20: ( NOT )?
+ int alt30=2;
+ int LA30_0 = input.LA(1);
+
+ if ( (LA30_0==NOT) ) {
+ alt30=1;
+ }
+ switch (alt30) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:336:20: NOT
+ {
+ NOT90=(Token)match(input,NOT,FOLLOW_NOT_in_inPredicate1209); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_NOT.add(NOT90);
+
+
+ }
+ break;
+
+ }
+
+ IN91=(Token)match(input,IN,FOLLOW_IN_in_inPredicate1212); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_IN.add(IN91);
+
+ LPAREN92=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_inPredicate1214); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_LPAREN.add(LPAREN92);
+
+ pushFollow(FOLLOW_inValueList_in_inPredicate1216);
+ inValueList93=inValueList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_inValueList.add(inValueList93.getTree());
+ RPAREN94=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_inPredicate1218); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN94);
+
+
+
+ // AST REWRITE
+ // elements: NOT, columnReference, inValueList
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 337:3: -> ^( PRED_IN ANY columnReference ( NOT )? inValueList )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:337:6: ^( PRED_IN ANY columnReference ( NOT )? inValueList )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(PRED_IN, "PRED_IN"), root_1);
+
+ adaptor.addChild(root_1, (Object)adaptor.create(ANY, "ANY"));
+ adaptor.addChild(root_1, stream_columnReference.nextTree());
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:337:36: ( NOT )?
+ if ( stream_NOT.hasNext() ) {
+ adaptor.addChild(root_1, stream_NOT.nextNode());
+
+ }
+ stream_NOT.reset();
+ adaptor.addChild(root_1, stream_inValueList.nextTree());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end inPredicate
+
+ public static class inValueList_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start inValueList
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:340:1: inValueList : literalOrParameterName ( COMMA literalOrParameterName )* -> ^( LIST ( literalOrParameterName )+ ) ;
+ public final CMISParser.inValueList_return inValueList() throws RecognitionException {
+ CMISParser.inValueList_return retval = new CMISParser.inValueList_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token COMMA96=null;
+ CMISParser.literalOrParameterName_return literalOrParameterName95 = null;
+
+ CMISParser.literalOrParameterName_return literalOrParameterName97 = null;
+
+
+ Object COMMA96_tree=null;
+ RewriteRuleTokenStream stream_COMMA=new RewriteRuleTokenStream(adaptor,"token COMMA");
+ RewriteRuleSubtreeStream stream_literalOrParameterName=new RewriteRuleSubtreeStream(adaptor,"rule literalOrParameterName");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:341:2: ( literalOrParameterName ( COMMA literalOrParameterName )* -> ^( LIST ( literalOrParameterName )+ ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:341:4: literalOrParameterName ( COMMA literalOrParameterName )*
+ {
+ pushFollow(FOLLOW_literalOrParameterName_in_inValueList1247);
+ literalOrParameterName95=literalOrParameterName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_literalOrParameterName.add(literalOrParameterName95.getTree());
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:341:27: ( COMMA literalOrParameterName )*
+ loop31:
+ do {
+ int alt31=2;
+ int LA31_0 = input.LA(1);
+
+ if ( (LA31_0==COMMA) ) {
+ alt31=1;
+ }
+
+
+ switch (alt31) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:341:28: COMMA literalOrParameterName
+ {
+ COMMA96=(Token)match(input,COMMA,FOLLOW_COMMA_in_inValueList1250); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_COMMA.add(COMMA96);
+
+ pushFollow(FOLLOW_literalOrParameterName_in_inValueList1252);
+ literalOrParameterName97=literalOrParameterName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_literalOrParameterName.add(literalOrParameterName97.getTree());
+
+ }
+ break;
+
+ default :
+ break loop31;
+ }
+ } while (true);
+
+
+
+ // AST REWRITE
+ // elements: literalOrParameterName
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 342:3: -> ^( LIST ( literalOrParameterName )+ )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:342:6: ^( LIST ( literalOrParameterName )+ )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(LIST, "LIST"), root_1);
+
+ if ( !(stream_literalOrParameterName.hasNext()) ) {
+ throw new RewriteEarlyExitException();
+ }
+ while ( stream_literalOrParameterName.hasNext() ) {
+ adaptor.addChild(root_1, stream_literalOrParameterName.nextTree());
+
+ }
+ stream_literalOrParameterName.reset();
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end inValueList
+
+ public static class likePredicate_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start likePredicate
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:345:1: likePredicate : columnReference ( NOT )? LIKE characterStringLiteral -> ^( PRED_LIKE columnReference ( NOT )? characterStringLiteral ) ;
+ public final CMISParser.likePredicate_return likePredicate() throws RecognitionException {
+ CMISParser.likePredicate_return retval = new CMISParser.likePredicate_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token NOT99=null;
+ Token LIKE100=null;
+ CMISParser.columnReference_return columnReference98 = null;
+
+ CMISParser.characterStringLiteral_return characterStringLiteral101 = null;
+
+
+ Object NOT99_tree=null;
+ Object LIKE100_tree=null;
+ RewriteRuleTokenStream stream_NOT=new RewriteRuleTokenStream(adaptor,"token NOT");
+ RewriteRuleTokenStream stream_LIKE=new RewriteRuleTokenStream(adaptor,"token LIKE");
+ RewriteRuleSubtreeStream stream_columnReference=new RewriteRuleSubtreeStream(adaptor,"rule columnReference");
+ RewriteRuleSubtreeStream stream_characterStringLiteral=new RewriteRuleSubtreeStream(adaptor,"rule characterStringLiteral");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:346:2: ( columnReference ( NOT )? LIKE characterStringLiteral -> ^( PRED_LIKE columnReference ( NOT )? characterStringLiteral ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:346:4: columnReference ( NOT )? LIKE characterStringLiteral
+ {
+ pushFollow(FOLLOW_columnReference_in_likePredicate1278);
+ columnReference98=columnReference();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_columnReference.add(columnReference98.getTree());
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:346:20: ( NOT )?
+ int alt32=2;
+ int LA32_0 = input.LA(1);
+
+ if ( (LA32_0==NOT) ) {
+ alt32=1;
+ }
+ switch (alt32) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:346:20: NOT
+ {
+ NOT99=(Token)match(input,NOT,FOLLOW_NOT_in_likePredicate1280); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_NOT.add(NOT99);
+
+
+ }
+ break;
+
+ }
+
+ LIKE100=(Token)match(input,LIKE,FOLLOW_LIKE_in_likePredicate1283); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_LIKE.add(LIKE100);
+
+ pushFollow(FOLLOW_characterStringLiteral_in_likePredicate1285);
+ characterStringLiteral101=characterStringLiteral();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_characterStringLiteral.add(characterStringLiteral101.getTree());
+
+
+ // AST REWRITE
+ // elements: characterStringLiteral, columnReference, NOT
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 347:3: -> ^( PRED_LIKE columnReference ( NOT )? characterStringLiteral )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:347:6: ^( PRED_LIKE columnReference ( NOT )? characterStringLiteral )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(PRED_LIKE, "PRED_LIKE"), root_1);
+
+ adaptor.addChild(root_1, stream_columnReference.nextTree());
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:347:34: ( NOT )?
+ if ( stream_NOT.hasNext() ) {
+ adaptor.addChild(root_1, stream_NOT.nextNode());
+
+ }
+ stream_NOT.reset();
+ adaptor.addChild(root_1, stream_characterStringLiteral.nextTree());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end likePredicate
+
+ public static class nullPredicate_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start nullPredicate
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:350:1: nullPredicate : ( ( columnReference )=> columnReference | multiValuedColumnReference ) IS ( NOT )? NULL -> ^( PRED_EXISTS columnReference ( NOT )? ) ;
+ public final CMISParser.nullPredicate_return nullPredicate() throws RecognitionException {
+ CMISParser.nullPredicate_return retval = new CMISParser.nullPredicate_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token IS104=null;
+ Token NOT105=null;
+ Token NULL106=null;
+ CMISParser.columnReference_return columnReference102 = null;
+
+ CMISParser.multiValuedColumnReference_return multiValuedColumnReference103 = null;
+
+
+ Object IS104_tree=null;
+ Object NOT105_tree=null;
+ Object NULL106_tree=null;
+ RewriteRuleTokenStream stream_NOT=new RewriteRuleTokenStream(adaptor,"token NOT");
+ RewriteRuleTokenStream stream_IS=new RewriteRuleTokenStream(adaptor,"token IS");
+ RewriteRuleTokenStream stream_NULL=new RewriteRuleTokenStream(adaptor,"token NULL");
+ RewriteRuleSubtreeStream stream_columnReference=new RewriteRuleSubtreeStream(adaptor,"rule columnReference");
+ RewriteRuleSubtreeStream stream_multiValuedColumnReference=new RewriteRuleSubtreeStream(adaptor,"rule multiValuedColumnReference");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:351:2: ( ( ( columnReference )=> columnReference | multiValuedColumnReference ) IS ( NOT )? NULL -> ^( PRED_EXISTS columnReference ( NOT )? ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:351:4: ( ( columnReference )=> columnReference | multiValuedColumnReference ) IS ( NOT )? NULL
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:351:4: ( ( columnReference )=> columnReference | multiValuedColumnReference )
+ int alt33=2;
+ int LA33_0 = input.LA(1);
+
+ if ( (LA33_0==ID) ) {
+ int LA33_1 = input.LA(2);
+
+ if ( (synpred5_CMIS()) ) {
+ alt33=1;
+ }
+ else if ( (true) ) {
+ alt33=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 33, 1, input);
+
+ throw nvae;
+ }
+ }
+ else if ( (LA33_0==DOUBLE_QUOTE) ) {
+ int LA33_2 = input.LA(2);
+
+ if ( (LA33_2==SELECT||LA33_2==AS||(LA33_2>=FROM && LA33_2<=ON)||(LA33_2>=WHERE && LA33_2<=NOT)||(LA33_2>=IN && LA33_2<=DESC)||(LA33_2>=UPPER && LA33_2<=SCORE)) ) {
+ int LA33_5 = input.LA(3);
+
+ if ( (LA33_5==DOUBLE_QUOTE) ) {
+ int LA33_7 = input.LA(4);
+
+ if ( (synpred5_CMIS()) ) {
+ alt33=1;
+ }
+ else if ( (true) ) {
+ alt33=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 33, 7, input);
+
+ throw nvae;
+ }
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 33, 5, input);
+
+ throw nvae;
+ }
+ }
+ else if ( (LA33_2==ID) ) {
+ int LA33_6 = input.LA(3);
+
+ if ( (LA33_6==DOUBLE_QUOTE) ) {
+ int LA33_7 = input.LA(4);
+
+ if ( (synpred5_CMIS()) ) {
+ alt33=1;
+ }
+ else if ( (true) ) {
+ alt33=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 33, 7, input);
+
+ throw nvae;
+ }
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 33, 6, input);
+
+ throw nvae;
+ }
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 33, 2, input);
+
+ throw nvae;
+ }
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 33, 0, input);
+
+ throw nvae;
+ }
+ switch (alt33) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:351:6: ( columnReference )=> columnReference
+ {
+ pushFollow(FOLLOW_columnReference_in_nullPredicate1319);
+ columnReference102=columnReference();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_columnReference.add(columnReference102.getTree());
+
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:351:44: multiValuedColumnReference
+ {
+ pushFollow(FOLLOW_multiValuedColumnReference_in_nullPredicate1323);
+ multiValuedColumnReference103=multiValuedColumnReference();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_multiValuedColumnReference.add(multiValuedColumnReference103.getTree());
+
+ }
+ break;
+
+ }
+
+ IS104=(Token)match(input,IS,FOLLOW_IS_in_nullPredicate1326); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_IS.add(IS104);
+
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:351:75: ( NOT )?
+ int alt34=2;
+ int LA34_0 = input.LA(1);
+
+ if ( (LA34_0==NOT) ) {
+ alt34=1;
+ }
+ switch (alt34) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:351:75: NOT
+ {
+ NOT105=(Token)match(input,NOT,FOLLOW_NOT_in_nullPredicate1328); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_NOT.add(NOT105);
+
+
+ }
+ break;
+
+ }
+
+ NULL106=(Token)match(input,NULL,FOLLOW_NULL_in_nullPredicate1331); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_NULL.add(NULL106);
+
+
+
+ // AST REWRITE
+ // elements: NOT, columnReference
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 352:3: -> ^( PRED_EXISTS columnReference ( NOT )? )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:352:6: ^( PRED_EXISTS columnReference ( NOT )? )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(PRED_EXISTS, "PRED_EXISTS"), root_1);
+
+ adaptor.addChild(root_1, stream_columnReference.nextTree());
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:352:36: ( NOT )?
+ if ( stream_NOT.hasNext() ) {
+ adaptor.addChild(root_1, stream_NOT.nextNode());
+
+ }
+ stream_NOT.reset();
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end nullPredicate
+
+ public static class quantifiedComparisonPredicate_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start quantifiedComparisonPredicate
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:355:1: quantifiedComparisonPredicate : literalOrParameterName compOp ANY multiValuedColumnReference -> ^( PRED_COMPARISON ANY literalOrParameterName compOp multiValuedColumnReference ) ;
+ public final CMISParser.quantifiedComparisonPredicate_return quantifiedComparisonPredicate() throws RecognitionException {
+ CMISParser.quantifiedComparisonPredicate_return retval = new CMISParser.quantifiedComparisonPredicate_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token ANY109=null;
+ CMISParser.literalOrParameterName_return literalOrParameterName107 = null;
+
+ CMISParser.compOp_return compOp108 = null;
+
+ CMISParser.multiValuedColumnReference_return multiValuedColumnReference110 = null;
+
+
+ Object ANY109_tree=null;
+ RewriteRuleTokenStream stream_ANY=new RewriteRuleTokenStream(adaptor,"token ANY");
+ RewriteRuleSubtreeStream stream_compOp=new RewriteRuleSubtreeStream(adaptor,"rule compOp");
+ RewriteRuleSubtreeStream stream_literalOrParameterName=new RewriteRuleSubtreeStream(adaptor,"rule literalOrParameterName");
+ RewriteRuleSubtreeStream stream_multiValuedColumnReference=new RewriteRuleSubtreeStream(adaptor,"rule multiValuedColumnReference");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:356:2: ( literalOrParameterName compOp ANY multiValuedColumnReference -> ^( PRED_COMPARISON ANY literalOrParameterName compOp multiValuedColumnReference ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:356:4: literalOrParameterName compOp ANY multiValuedColumnReference
+ {
+ pushFollow(FOLLOW_literalOrParameterName_in_quantifiedComparisonPredicate1356);
+ literalOrParameterName107=literalOrParameterName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_literalOrParameterName.add(literalOrParameterName107.getTree());
+ pushFollow(FOLLOW_compOp_in_quantifiedComparisonPredicate1358);
+ compOp108=compOp();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_compOp.add(compOp108.getTree());
+ ANY109=(Token)match(input,ANY,FOLLOW_ANY_in_quantifiedComparisonPredicate1360); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_ANY.add(ANY109);
+
+ pushFollow(FOLLOW_multiValuedColumnReference_in_quantifiedComparisonPredicate1362);
+ multiValuedColumnReference110=multiValuedColumnReference();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_multiValuedColumnReference.add(multiValuedColumnReference110.getTree());
+
+
+ // AST REWRITE
+ // elements: ANY, multiValuedColumnReference, compOp, literalOrParameterName
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 357:2: -> ^( PRED_COMPARISON ANY literalOrParameterName compOp multiValuedColumnReference )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:357:5: ^( PRED_COMPARISON ANY literalOrParameterName compOp multiValuedColumnReference )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(PRED_COMPARISON, "PRED_COMPARISON"), root_1);
+
+ adaptor.addChild(root_1, stream_ANY.nextNode());
+ adaptor.addChild(root_1, stream_literalOrParameterName.nextTree());
+ adaptor.addChild(root_1, stream_compOp.nextTree());
+ adaptor.addChild(root_1, stream_multiValuedColumnReference.nextTree());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end quantifiedComparisonPredicate
+
+ public static class quantifiedInPredicate_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start quantifiedInPredicate
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:361:1: quantifiedInPredicate : ANY multiValuedColumnReference ( NOT )? IN LPAREN inValueList RPAREN -> ^( PRED_IN ANY multiValuedColumnReference ( NOT )? inValueList ) ;
+ public final CMISParser.quantifiedInPredicate_return quantifiedInPredicate() throws RecognitionException {
+ CMISParser.quantifiedInPredicate_return retval = new CMISParser.quantifiedInPredicate_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token ANY111=null;
+ Token NOT113=null;
+ Token IN114=null;
+ Token LPAREN115=null;
+ Token RPAREN117=null;
+ CMISParser.multiValuedColumnReference_return multiValuedColumnReference112 = null;
+
+ CMISParser.inValueList_return inValueList116 = null;
+
+
+ Object ANY111_tree=null;
+ Object NOT113_tree=null;
+ Object IN114_tree=null;
+ Object LPAREN115_tree=null;
+ Object RPAREN117_tree=null;
+ RewriteRuleTokenStream stream_RPAREN=new RewriteRuleTokenStream(adaptor,"token RPAREN");
+ RewriteRuleTokenStream stream_ANY=new RewriteRuleTokenStream(adaptor,"token ANY");
+ RewriteRuleTokenStream stream_IN=new RewriteRuleTokenStream(adaptor,"token IN");
+ RewriteRuleTokenStream stream_NOT=new RewriteRuleTokenStream(adaptor,"token NOT");
+ RewriteRuleTokenStream stream_LPAREN=new RewriteRuleTokenStream(adaptor,"token LPAREN");
+ RewriteRuleSubtreeStream stream_multiValuedColumnReference=new RewriteRuleSubtreeStream(adaptor,"rule multiValuedColumnReference");
+ RewriteRuleSubtreeStream stream_inValueList=new RewriteRuleSubtreeStream(adaptor,"rule inValueList");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:362:2: ( ANY multiValuedColumnReference ( NOT )? IN LPAREN inValueList RPAREN -> ^( PRED_IN ANY multiValuedColumnReference ( NOT )? inValueList ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:362:4: ANY multiValuedColumnReference ( NOT )? IN LPAREN inValueList RPAREN
+ {
+ ANY111=(Token)match(input,ANY,FOLLOW_ANY_in_quantifiedInPredicate1391); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_ANY.add(ANY111);
+
+ pushFollow(FOLLOW_multiValuedColumnReference_in_quantifiedInPredicate1393);
+ multiValuedColumnReference112=multiValuedColumnReference();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_multiValuedColumnReference.add(multiValuedColumnReference112.getTree());
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:362:35: ( NOT )?
+ int alt35=2;
+ int LA35_0 = input.LA(1);
+
+ if ( (LA35_0==NOT) ) {
+ alt35=1;
+ }
+ switch (alt35) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:362:35: NOT
+ {
+ NOT113=(Token)match(input,NOT,FOLLOW_NOT_in_quantifiedInPredicate1395); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_NOT.add(NOT113);
+
+
+ }
+ break;
+
+ }
+
+ IN114=(Token)match(input,IN,FOLLOW_IN_in_quantifiedInPredicate1398); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_IN.add(IN114);
+
+ LPAREN115=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_quantifiedInPredicate1401); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_LPAREN.add(LPAREN115);
+
+ pushFollow(FOLLOW_inValueList_in_quantifiedInPredicate1403);
+ inValueList116=inValueList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_inValueList.add(inValueList116.getTree());
+ RPAREN117=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_quantifiedInPredicate1405); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN117);
+
+
+
+ // AST REWRITE
+ // elements: inValueList, multiValuedColumnReference, ANY, NOT
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 363:3: -> ^( PRED_IN ANY multiValuedColumnReference ( NOT )? inValueList )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:363:6: ^( PRED_IN ANY multiValuedColumnReference ( NOT )? inValueList )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(PRED_IN, "PRED_IN"), root_1);
+
+ adaptor.addChild(root_1, stream_ANY.nextNode());
+ adaptor.addChild(root_1, stream_multiValuedColumnReference.nextTree());
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:363:47: ( NOT )?
+ if ( stream_NOT.hasNext() ) {
+ adaptor.addChild(root_1, stream_NOT.nextNode());
+
+ }
+ stream_NOT.reset();
+ adaptor.addChild(root_1, stream_inValueList.nextTree());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end quantifiedInPredicate
+
+ public static class textSearchPredicate_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start textSearchPredicate
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:366:1: textSearchPredicate : CONTAINS LPAREN ( qualifier COMMA | COMMA )? textSearchExpression RPAREN -> ^( PRED_FTS textSearchExpression qualifier ) ;
+ public final CMISParser.textSearchPredicate_return textSearchPredicate() throws RecognitionException {
+ CMISParser.textSearchPredicate_return retval = new CMISParser.textSearchPredicate_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token CONTAINS118=null;
+ Token LPAREN119=null;
+ Token COMMA121=null;
+ Token COMMA122=null;
+ Token RPAREN124=null;
+ CMISParser.qualifier_return qualifier120 = null;
+
+ CMISParser.textSearchExpression_return textSearchExpression123 = null;
+
+
+ Object CONTAINS118_tree=null;
+ Object LPAREN119_tree=null;
+ Object COMMA121_tree=null;
+ Object COMMA122_tree=null;
+ Object RPAREN124_tree=null;
+ RewriteRuleTokenStream stream_RPAREN=new RewriteRuleTokenStream(adaptor,"token RPAREN");
+ RewriteRuleTokenStream stream_COMMA=new RewriteRuleTokenStream(adaptor,"token COMMA");
+ RewriteRuleTokenStream stream_CONTAINS=new RewriteRuleTokenStream(adaptor,"token CONTAINS");
+ RewriteRuleTokenStream stream_LPAREN=new RewriteRuleTokenStream(adaptor,"token LPAREN");
+ RewriteRuleSubtreeStream stream_qualifier=new RewriteRuleSubtreeStream(adaptor,"rule qualifier");
+ RewriteRuleSubtreeStream stream_textSearchExpression=new RewriteRuleSubtreeStream(adaptor,"rule textSearchExpression");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:367:2: ( CONTAINS LPAREN ( qualifier COMMA | COMMA )? textSearchExpression RPAREN -> ^( PRED_FTS textSearchExpression qualifier ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:367:4: CONTAINS LPAREN ( qualifier COMMA | COMMA )? textSearchExpression RPAREN
+ {
+ CONTAINS118=(Token)match(input,CONTAINS,FOLLOW_CONTAINS_in_textSearchPredicate1434); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_CONTAINS.add(CONTAINS118);
+
+ LPAREN119=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_textSearchPredicate1436); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_LPAREN.add(LPAREN119);
+
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:367:20: ( qualifier COMMA | COMMA )?
+ int alt36=3;
+ int LA36_0 = input.LA(1);
+
+ if ( ((LA36_0>=ID && LA36_0<=DOUBLE_QUOTE)) ) {
+ alt36=1;
+ }
+ else if ( (LA36_0==COMMA) ) {
+ alt36=2;
+ }
+ switch (alt36) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:367:21: qualifier COMMA
+ {
+ pushFollow(FOLLOW_qualifier_in_textSearchPredicate1439);
+ qualifier120=qualifier();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_qualifier.add(qualifier120.getTree());
+ COMMA121=(Token)match(input,COMMA,FOLLOW_COMMA_in_textSearchPredicate1441); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_COMMA.add(COMMA121);
+
+
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:367:39: COMMA
+ {
+ COMMA122=(Token)match(input,COMMA,FOLLOW_COMMA_in_textSearchPredicate1445); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_COMMA.add(COMMA122);
+
+
+ }
+ break;
+
+ }
+
+ pushFollow(FOLLOW_textSearchExpression_in_textSearchPredicate1449);
+ textSearchExpression123=textSearchExpression();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_textSearchExpression.add(textSearchExpression123.getTree());
+ RPAREN124=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_textSearchPredicate1451); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN124);
+
+
+
+ // AST REWRITE
+ // elements: qualifier, textSearchExpression
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 368:3: -> ^( PRED_FTS textSearchExpression qualifier )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:368:6: ^( PRED_FTS textSearchExpression qualifier )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(PRED_FTS, "PRED_FTS"), root_1);
+
+ adaptor.addChild(root_1, stream_textSearchExpression.nextTree());
+ adaptor.addChild(root_1, stream_qualifier.nextTree());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end textSearchPredicate
+
+ public static class folderPredicate_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start folderPredicate
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:371:1: folderPredicate : ( IN_FOLDER folderPredicateArgs -> ^( PRED_CHILD folderPredicateArgs ) | IN_TREE folderPredicateArgs -> ^( PRED_DESCENDANT folderPredicateArgs ) );
+ public final CMISParser.folderPredicate_return folderPredicate() throws RecognitionException {
+ CMISParser.folderPredicate_return retval = new CMISParser.folderPredicate_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token IN_FOLDER125=null;
+ Token IN_TREE127=null;
+ CMISParser.folderPredicateArgs_return folderPredicateArgs126 = null;
+
+ CMISParser.folderPredicateArgs_return folderPredicateArgs128 = null;
+
+
+ Object IN_FOLDER125_tree=null;
+ Object IN_TREE127_tree=null;
+ RewriteRuleTokenStream stream_IN_TREE=new RewriteRuleTokenStream(adaptor,"token IN_TREE");
+ RewriteRuleTokenStream stream_IN_FOLDER=new RewriteRuleTokenStream(adaptor,"token IN_FOLDER");
+ RewriteRuleSubtreeStream stream_folderPredicateArgs=new RewriteRuleSubtreeStream(adaptor,"rule folderPredicateArgs");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:372:2: ( IN_FOLDER folderPredicateArgs -> ^( PRED_CHILD folderPredicateArgs ) | IN_TREE folderPredicateArgs -> ^( PRED_DESCENDANT folderPredicateArgs ) )
+ int alt37=2;
+ int LA37_0 = input.LA(1);
+
+ if ( (LA37_0==IN_FOLDER) ) {
+ alt37=1;
+ }
+ else if ( (LA37_0==IN_TREE) ) {
+ alt37=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 37, 0, input);
+
+ throw nvae;
+ }
+ switch (alt37) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:372:4: IN_FOLDER folderPredicateArgs
+ {
+ IN_FOLDER125=(Token)match(input,IN_FOLDER,FOLLOW_IN_FOLDER_in_folderPredicate1475); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_IN_FOLDER.add(IN_FOLDER125);
+
+ pushFollow(FOLLOW_folderPredicateArgs_in_folderPredicate1478);
+ folderPredicateArgs126=folderPredicateArgs();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_folderPredicateArgs.add(folderPredicateArgs126.getTree());
+
+
+ // AST REWRITE
+ // elements: folderPredicateArgs
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 373:3: -> ^( PRED_CHILD folderPredicateArgs )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:373:6: ^( PRED_CHILD folderPredicateArgs )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(PRED_CHILD, "PRED_CHILD"), root_1);
+
+ adaptor.addChild(root_1, stream_folderPredicateArgs.nextTree());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:374:10: IN_TREE folderPredicateArgs
+ {
+ IN_TREE127=(Token)match(input,IN_TREE,FOLLOW_IN_TREE_in_folderPredicate1499); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_IN_TREE.add(IN_TREE127);
+
+ pushFollow(FOLLOW_folderPredicateArgs_in_folderPredicate1501);
+ folderPredicateArgs128=folderPredicateArgs();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_folderPredicateArgs.add(folderPredicateArgs128.getTree());
+
+
+ // AST REWRITE
+ // elements: folderPredicateArgs
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 375:3: -> ^( PRED_DESCENDANT folderPredicateArgs )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:375:6: ^( PRED_DESCENDANT folderPredicateArgs )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(PRED_DESCENDANT, "PRED_DESCENDANT"), root_1);
+
+ adaptor.addChild(root_1, stream_folderPredicateArgs.nextTree());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end folderPredicate
+
+ public static class folderPredicateArgs_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start folderPredicateArgs
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:378:1: folderPredicateArgs : LPAREN ( qualifier COMMA | COMMA )? folderId RPAREN -> folderId ( qualifier )? ;
+ public final CMISParser.folderPredicateArgs_return folderPredicateArgs() throws RecognitionException {
+ CMISParser.folderPredicateArgs_return retval = new CMISParser.folderPredicateArgs_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token LPAREN129=null;
+ Token COMMA131=null;
+ Token COMMA132=null;
+ Token RPAREN134=null;
+ CMISParser.qualifier_return qualifier130 = null;
+
+ CMISParser.folderId_return folderId133 = null;
+
+
+ Object LPAREN129_tree=null;
+ Object COMMA131_tree=null;
+ Object COMMA132_tree=null;
+ Object RPAREN134_tree=null;
+ RewriteRuleTokenStream stream_RPAREN=new RewriteRuleTokenStream(adaptor,"token RPAREN");
+ RewriteRuleTokenStream stream_COMMA=new RewriteRuleTokenStream(adaptor,"token COMMA");
+ RewriteRuleTokenStream stream_LPAREN=new RewriteRuleTokenStream(adaptor,"token LPAREN");
+ RewriteRuleSubtreeStream stream_qualifier=new RewriteRuleSubtreeStream(adaptor,"rule qualifier");
+ RewriteRuleSubtreeStream stream_folderId=new RewriteRuleSubtreeStream(adaptor,"rule folderId");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:379:2: ( LPAREN ( qualifier COMMA | COMMA )? folderId RPAREN -> folderId ( qualifier )? )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:379:4: LPAREN ( qualifier COMMA | COMMA )? folderId RPAREN
+ {
+ LPAREN129=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_folderPredicateArgs1523); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_LPAREN.add(LPAREN129);
+
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:379:11: ( qualifier COMMA | COMMA )?
+ int alt38=3;
+ int LA38_0 = input.LA(1);
+
+ if ( ((LA38_0>=ID && LA38_0<=DOUBLE_QUOTE)) ) {
+ alt38=1;
+ }
+ else if ( (LA38_0==COMMA) ) {
+ alt38=2;
+ }
+ switch (alt38) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:379:12: qualifier COMMA
+ {
+ pushFollow(FOLLOW_qualifier_in_folderPredicateArgs1526);
+ qualifier130=qualifier();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_qualifier.add(qualifier130.getTree());
+ COMMA131=(Token)match(input,COMMA,FOLLOW_COMMA_in_folderPredicateArgs1528); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_COMMA.add(COMMA131);
+
+
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:379:30: COMMA
+ {
+ COMMA132=(Token)match(input,COMMA,FOLLOW_COMMA_in_folderPredicateArgs1532); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_COMMA.add(COMMA132);
+
+
+ }
+ break;
+
+ }
+
+ pushFollow(FOLLOW_folderId_in_folderPredicateArgs1536);
+ folderId133=folderId();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_folderId.add(folderId133.getTree());
+ RPAREN134=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_folderPredicateArgs1538); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN134);
+
+
+
+ // AST REWRITE
+ // elements: qualifier, folderId
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 380:3: -> folderId ( qualifier )?
+ {
+ adaptor.addChild(root_0, stream_folderId.nextTree());
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:380:15: ( qualifier )?
+ if ( stream_qualifier.hasNext() ) {
+ adaptor.addChild(root_0, stream_qualifier.nextTree());
+
+ }
+ stream_qualifier.reset();
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end folderPredicateArgs
+
+ public static class orderByClause_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start orderByClause
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:383:1: orderByClause : ORDER BY sortSpecification ( COMMA sortSpecification )* -> ^( ORDER ( sortSpecification )+ ) ;
+ public final CMISParser.orderByClause_return orderByClause() throws RecognitionException {
+ CMISParser.orderByClause_return retval = new CMISParser.orderByClause_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token ORDER135=null;
+ Token BY136=null;
+ Token COMMA138=null;
+ CMISParser.sortSpecification_return sortSpecification137 = null;
+
+ CMISParser.sortSpecification_return sortSpecification139 = null;
+
+
+ Object ORDER135_tree=null;
+ Object BY136_tree=null;
+ Object COMMA138_tree=null;
+ RewriteRuleTokenStream stream_BY=new RewriteRuleTokenStream(adaptor,"token BY");
+ RewriteRuleTokenStream stream_ORDER=new RewriteRuleTokenStream(adaptor,"token ORDER");
+ RewriteRuleTokenStream stream_COMMA=new RewriteRuleTokenStream(adaptor,"token COMMA");
+ RewriteRuleSubtreeStream stream_sortSpecification=new RewriteRuleSubtreeStream(adaptor,"rule sortSpecification");
+ paraphrases.push("in order by");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:386:2: ( ORDER BY sortSpecification ( COMMA sortSpecification )* -> ^( ORDER ( sortSpecification )+ ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:386:4: ORDER BY sortSpecification ( COMMA sortSpecification )*
+ {
+ ORDER135=(Token)match(input,ORDER,FOLLOW_ORDER_in_orderByClause1577); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_ORDER.add(ORDER135);
+
+ BY136=(Token)match(input,BY,FOLLOW_BY_in_orderByClause1579); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_BY.add(BY136);
+
+ pushFollow(FOLLOW_sortSpecification_in_orderByClause1581);
+ sortSpecification137=sortSpecification();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_sortSpecification.add(sortSpecification137.getTree());
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:386:31: ( COMMA sortSpecification )*
+ loop39:
+ do {
+ int alt39=2;
+ int LA39_0 = input.LA(1);
+
+ if ( (LA39_0==COMMA) ) {
+ alt39=1;
+ }
+
+
+ switch (alt39) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:386:33: COMMA sortSpecification
+ {
+ COMMA138=(Token)match(input,COMMA,FOLLOW_COMMA_in_orderByClause1585); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_COMMA.add(COMMA138);
+
+ pushFollow(FOLLOW_sortSpecification_in_orderByClause1587);
+ sortSpecification139=sortSpecification();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_sortSpecification.add(sortSpecification139.getTree());
+
+ }
+ break;
+
+ default :
+ break loop39;
+ }
+ } while (true);
+
+
+
+ // AST REWRITE
+ // elements: ORDER, sortSpecification
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 387:3: -> ^( ORDER ( sortSpecification )+ )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:387:6: ^( ORDER ( sortSpecification )+ )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot(stream_ORDER.nextNode(), root_1);
+
+ if ( !(stream_sortSpecification.hasNext()) ) {
+ throw new RewriteEarlyExitException();
+ }
+ while ( stream_sortSpecification.hasNext() ) {
+ adaptor.addChild(root_1, stream_sortSpecification.nextTree());
+
+ }
+ stream_sortSpecification.reset();
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ if ( state.backtracking==0 ) {
+ paraphrases.pop();
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end orderByClause
+
+ public static class sortSpecification_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start sortSpecification
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:390:1: sortSpecification : ( columnName -> ^( SORT_SPECIFICATION columnName ASC ) | columnName (by= ASC | by= DESC ) -> ^( SORT_SPECIFICATION columnName $by) );
+ public final CMISParser.sortSpecification_return sortSpecification() throws RecognitionException {
+ CMISParser.sortSpecification_return retval = new CMISParser.sortSpecification_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token by=null;
+ CMISParser.columnName_return columnName140 = null;
+
+ CMISParser.columnName_return columnName141 = null;
+
+
+ Object by_tree=null;
+ RewriteRuleTokenStream stream_ASC=new RewriteRuleTokenStream(adaptor,"token ASC");
+ RewriteRuleTokenStream stream_DESC=new RewriteRuleTokenStream(adaptor,"token DESC");
+ RewriteRuleSubtreeStream stream_columnName=new RewriteRuleSubtreeStream(adaptor,"rule columnName");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:391:2: ( columnName -> ^( SORT_SPECIFICATION columnName ASC ) | columnName (by= ASC | by= DESC ) -> ^( SORT_SPECIFICATION columnName $by) )
+ int alt41=2;
+ int LA41_0 = input.LA(1);
+
+ if ( (LA41_0==ID) ) {
+ int LA41_1 = input.LA(2);
+
+ if ( (LA41_1==EOF||LA41_1==COMMA) ) {
+ alt41=1;
+ }
+ else if ( ((LA41_1>=ASC && LA41_1<=DESC)) ) {
+ alt41=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 41, 1, input);
+
+ throw nvae;
+ }
+ }
+ else if ( (LA41_0==DOUBLE_QUOTE) ) {
+ int LA41_2 = input.LA(2);
+
+ if ( (LA41_2==SELECT||LA41_2==AS||(LA41_2>=FROM && LA41_2<=ON)||(LA41_2>=WHERE && LA41_2<=NOT)||(LA41_2>=IN && LA41_2<=DESC)||(LA41_2>=UPPER && LA41_2<=SCORE)) ) {
+ int LA41_5 = input.LA(3);
+
+ if ( (LA41_5==DOUBLE_QUOTE) ) {
+ int LA41_7 = input.LA(4);
+
+ if ( (LA41_7==EOF||LA41_7==COMMA) ) {
+ alt41=1;
+ }
+ else if ( ((LA41_7>=ASC && LA41_7<=DESC)) ) {
+ alt41=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 41, 7, input);
+
+ throw nvae;
+ }
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 41, 5, input);
+
+ throw nvae;
+ }
+ }
+ else if ( (LA41_2==ID) ) {
+ int LA41_6 = input.LA(3);
+
+ if ( (LA41_6==DOUBLE_QUOTE) ) {
+ int LA41_7 = input.LA(4);
+
+ if ( (LA41_7==EOF||LA41_7==COMMA) ) {
+ alt41=1;
+ }
+ else if ( ((LA41_7>=ASC && LA41_7<=DESC)) ) {
+ alt41=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 41, 7, input);
+
+ throw nvae;
+ }
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 41, 6, input);
+
+ throw nvae;
+ }
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 41, 2, input);
+
+ throw nvae;
+ }
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 41, 0, input);
+
+ throw nvae;
+ }
+ switch (alt41) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:391:4: columnName
+ {
+ pushFollow(FOLLOW_columnName_in_sortSpecification1613);
+ columnName140=columnName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_columnName.add(columnName140.getTree());
+
+
+ // AST REWRITE
+ // elements: columnName
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 392:3: -> ^( SORT_SPECIFICATION columnName ASC )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:392:6: ^( SORT_SPECIFICATION columnName ASC )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(SORT_SPECIFICATION, "SORT_SPECIFICATION"), root_1);
+
+ adaptor.addChild(root_1, stream_columnName.nextTree());
+ adaptor.addChild(root_1, (Object)adaptor.create(ASC, "ASC"));
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:393:4: columnName (by= ASC | by= DESC )
+ {
+ pushFollow(FOLLOW_columnName_in_sortSpecification1631);
+ columnName141=columnName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_columnName.add(columnName141.getTree());
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:393:15: (by= ASC | by= DESC )
+ int alt40=2;
+ int LA40_0 = input.LA(1);
+
+ if ( (LA40_0==ASC) ) {
+ alt40=1;
+ }
+ else if ( (LA40_0==DESC) ) {
+ alt40=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 40, 0, input);
+
+ throw nvae;
+ }
+ switch (alt40) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:393:17: by= ASC
+ {
+ by=(Token)match(input,ASC,FOLLOW_ASC_in_sortSpecification1637); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_ASC.add(by);
+
+
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:393:26: by= DESC
+ {
+ by=(Token)match(input,DESC,FOLLOW_DESC_in_sortSpecification1643); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_DESC.add(by);
+
+
+ }
+ break;
+
+ }
+
+
+
+ // AST REWRITE
+ // elements: columnName, by
+ // token labels: by
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleTokenStream stream_by=new RewriteRuleTokenStream(adaptor,"token by",by);
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 394:3: -> ^( SORT_SPECIFICATION columnName $by)
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:394:6: ^( SORT_SPECIFICATION columnName $by)
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(SORT_SPECIFICATION, "SORT_SPECIFICATION"), root_1);
+
+ adaptor.addChild(root_1, stream_columnName.nextTree());
+ adaptor.addChild(root_1, stream_by.nextNode());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end sortSpecification
+
+ public static class correlationName_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start correlationName
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:397:1: correlationName : identifier ;
+ public final CMISParser.correlationName_return correlationName() throws RecognitionException {
+ CMISParser.correlationName_return retval = new CMISParser.correlationName_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ CMISParser.identifier_return identifier142 = null;
+
+
+
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:398:2: ( identifier )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:398:4: identifier
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_identifier_in_correlationName1670);
+ identifier142=identifier();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, identifier142.getTree());
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end correlationName
+
+ public static class tableName_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start tableName
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:405:1: tableName : identifier -> identifier ;
+ public final CMISParser.tableName_return tableName() throws RecognitionException {
+ CMISParser.tableName_return retval = new CMISParser.tableName_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ CMISParser.identifier_return identifier143 = null;
+
+
+ RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:406:2: ( identifier -> identifier )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:406:4: identifier
+ {
+ pushFollow(FOLLOW_identifier_in_tableName1684);
+ identifier143=identifier();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_identifier.add(identifier143.getTree());
+
+
+ // AST REWRITE
+ // elements: identifier
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 407:3: -> identifier
+ {
+ adaptor.addChild(root_0, stream_identifier.nextTree());
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end tableName
+
+ public static class columnName_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start columnName
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:410:1: columnName : identifier -> identifier ;
+ public final CMISParser.columnName_return columnName() throws RecognitionException {
+ CMISParser.columnName_return retval = new CMISParser.columnName_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ CMISParser.identifier_return identifier144 = null;
+
+
+ RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:411:2: ( identifier -> identifier )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:411:4: identifier
+ {
+ pushFollow(FOLLOW_identifier_in_columnName1702);
+ identifier144=identifier();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_identifier.add(identifier144.getTree());
+
+
+ // AST REWRITE
+ // elements: identifier
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 412:3: -> identifier
+ {
+ adaptor.addChild(root_0, stream_identifier.nextTree());
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end columnName
+
+ public static class multiValuedColumnName_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start multiValuedColumnName
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:415:1: multiValuedColumnName : identifier -> identifier ;
+ public final CMISParser.multiValuedColumnName_return multiValuedColumnName() throws RecognitionException {
+ CMISParser.multiValuedColumnName_return retval = new CMISParser.multiValuedColumnName_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ CMISParser.identifier_return identifier145 = null;
+
+
+ RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:416:2: ( identifier -> identifier )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:416:4: identifier
+ {
+ pushFollow(FOLLOW_identifier_in_multiValuedColumnName1721);
+ identifier145=identifier();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_identifier.add(identifier145.getTree());
+
+
+ // AST REWRITE
+ // elements: identifier
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 417:3: -> identifier
+ {
+ adaptor.addChild(root_0, stream_identifier.nextTree());
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end multiValuedColumnName
+
+ public static class parameterName_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start parameterName
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:420:1: parameterName : COLON identifier -> ^( PARAMETER identifier ) ;
+ public final CMISParser.parameterName_return parameterName() throws RecognitionException {
+ CMISParser.parameterName_return retval = new CMISParser.parameterName_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token COLON146=null;
+ CMISParser.identifier_return identifier147 = null;
+
+
+ Object COLON146_tree=null;
+ RewriteRuleTokenStream stream_COLON=new RewriteRuleTokenStream(adaptor,"token COLON");
+ RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:421:2: ( COLON identifier -> ^( PARAMETER identifier ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:421:4: COLON identifier
+ {
+ COLON146=(Token)match(input,COLON,FOLLOW_COLON_in_parameterName1739); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_COLON.add(COLON146);
+
+ pushFollow(FOLLOW_identifier_in_parameterName1741);
+ identifier147=identifier();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_identifier.add(identifier147.getTree());
+
+
+ // AST REWRITE
+ // elements: identifier
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 422:3: -> ^( PARAMETER identifier )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:422:6: ^( PARAMETER identifier )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(PARAMETER, "PARAMETER"), root_1);
+
+ adaptor.addChild(root_1, stream_identifier.nextTree());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end parameterName
+
+ public static class folderId_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start folderId
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:425:1: folderId : characterStringLiteral -> characterStringLiteral ;
+ public final CMISParser.folderId_return folderId() throws RecognitionException {
+ CMISParser.folderId_return retval = new CMISParser.folderId_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ CMISParser.characterStringLiteral_return characterStringLiteral148 = null;
+
+
+ RewriteRuleSubtreeStream stream_characterStringLiteral=new RewriteRuleSubtreeStream(adaptor,"rule characterStringLiteral");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:426:3: ( characterStringLiteral -> characterStringLiteral )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:426:5: characterStringLiteral
+ {
+ pushFollow(FOLLOW_characterStringLiteral_in_folderId1764);
+ characterStringLiteral148=characterStringLiteral();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_characterStringLiteral.add(characterStringLiteral148.getTree());
+
+
+ // AST REWRITE
+ // elements: characterStringLiteral
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 427:4: -> characterStringLiteral
+ {
+ adaptor.addChild(root_0, stream_characterStringLiteral.nextTree());
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end folderId
+
+ public static class textSearchExpression_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start textSearchExpression
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:430:1: textSearchExpression : QUOTED_STRING ;
+ public final CMISParser.textSearchExpression_return textSearchExpression() throws RecognitionException {
+ CMISParser.textSearchExpression_return retval = new CMISParser.textSearchExpression_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token QUOTED_STRING149=null;
+
+ Object QUOTED_STRING149_tree=null;
+
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:431:2: ( QUOTED_STRING )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:431:4: QUOTED_STRING
+ {
+ root_0 = (Object)adaptor.nil();
+
+ QUOTED_STRING149=(Token)match(input,QUOTED_STRING,FOLLOW_QUOTED_STRING_in_textSearchExpression1785); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ QUOTED_STRING149_tree = (Object)adaptor.create(QUOTED_STRING149);
+ adaptor.addChild(root_0, QUOTED_STRING149_tree);
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end textSearchExpression
+
+ public static class identifier_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start identifier
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:434:1: identifier : ( ID -> ID | DOUBLE_QUOTE keyWordOrId DOUBLE_QUOTE -> ^( keyWordOrId ) );
+ public final CMISParser.identifier_return identifier() throws RecognitionException {
+ CMISParser.identifier_return retval = new CMISParser.identifier_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token ID150=null;
+ Token DOUBLE_QUOTE151=null;
+ Token DOUBLE_QUOTE153=null;
+ CMISParser.keyWordOrId_return keyWordOrId152 = null;
+
+
+ Object ID150_tree=null;
+ Object DOUBLE_QUOTE151_tree=null;
+ Object DOUBLE_QUOTE153_tree=null;
+ RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID");
+ RewriteRuleTokenStream stream_DOUBLE_QUOTE=new RewriteRuleTokenStream(adaptor,"token DOUBLE_QUOTE");
+ RewriteRuleSubtreeStream stream_keyWordOrId=new RewriteRuleSubtreeStream(adaptor,"rule keyWordOrId");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:435:2: ( ID -> ID | DOUBLE_QUOTE keyWordOrId DOUBLE_QUOTE -> ^( keyWordOrId ) )
+ int alt42=2;
+ int LA42_0 = input.LA(1);
+
+ if ( (LA42_0==ID) ) {
+ alt42=1;
+ }
+ else if ( (LA42_0==DOUBLE_QUOTE) ) {
+ alt42=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 42, 0, input);
+
+ throw nvae;
+ }
+ switch (alt42) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:435:4: ID
+ {
+ ID150=(Token)match(input,ID,FOLLOW_ID_in_identifier1797); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_ID.add(ID150);
+
+
+
+ // AST REWRITE
+ // elements: ID
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 436:3: -> ID
+ {
+ adaptor.addChild(root_0, stream_ID.nextNode());
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:437:4: DOUBLE_QUOTE keyWordOrId DOUBLE_QUOTE
+ {
+ DOUBLE_QUOTE151=(Token)match(input,DOUBLE_QUOTE,FOLLOW_DOUBLE_QUOTE_in_identifier1808); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_DOUBLE_QUOTE.add(DOUBLE_QUOTE151);
+
+ pushFollow(FOLLOW_keyWordOrId_in_identifier1810);
+ keyWordOrId152=keyWordOrId();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_keyWordOrId.add(keyWordOrId152.getTree());
+ DOUBLE_QUOTE153=(Token)match(input,DOUBLE_QUOTE,FOLLOW_DOUBLE_QUOTE_in_identifier1812); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_DOUBLE_QUOTE.add(DOUBLE_QUOTE153);
+
+
+
+ // AST REWRITE
+ // elements: keyWordOrId
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 438:3: -> ^( keyWordOrId )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:438:6: ^( keyWordOrId )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot(stream_keyWordOrId.nextNode(), root_1);
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end identifier
+
+ public static class signedNumericLiteral_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start signedNumericLiteral
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:441:1: signedNumericLiteral : ( FLOATING_POINT_LITERAL -> ^( NUMERIC_LITERAL FLOATING_POINT_LITERAL ) | integerLiteral -> integerLiteral );
+ public final CMISParser.signedNumericLiteral_return signedNumericLiteral() throws RecognitionException {
+ CMISParser.signedNumericLiteral_return retval = new CMISParser.signedNumericLiteral_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token FLOATING_POINT_LITERAL154=null;
+ CMISParser.integerLiteral_return integerLiteral155 = null;
+
+
+ Object FLOATING_POINT_LITERAL154_tree=null;
+ RewriteRuleTokenStream stream_FLOATING_POINT_LITERAL=new RewriteRuleTokenStream(adaptor,"token FLOATING_POINT_LITERAL");
+ RewriteRuleSubtreeStream stream_integerLiteral=new RewriteRuleSubtreeStream(adaptor,"rule integerLiteral");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:442:2: ( FLOATING_POINT_LITERAL -> ^( NUMERIC_LITERAL FLOATING_POINT_LITERAL ) | integerLiteral -> integerLiteral )
+ int alt43=2;
+ int LA43_0 = input.LA(1);
+
+ if ( (LA43_0==FLOATING_POINT_LITERAL) ) {
+ alt43=1;
+ }
+ else if ( (LA43_0==DECIMAL_INTEGER_LITERAL) ) {
+ alt43=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 43, 0, input);
+
+ throw nvae;
+ }
+ switch (alt43) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:442:4: FLOATING_POINT_LITERAL
+ {
+ FLOATING_POINT_LITERAL154=(Token)match(input,FLOATING_POINT_LITERAL,FOLLOW_FLOATING_POINT_LITERAL_in_signedNumericLiteral1832); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_FLOATING_POINT_LITERAL.add(FLOATING_POINT_LITERAL154);
+
+
+
+ // AST REWRITE
+ // elements: FLOATING_POINT_LITERAL
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 443:3: -> ^( NUMERIC_LITERAL FLOATING_POINT_LITERAL )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:443:6: ^( NUMERIC_LITERAL FLOATING_POINT_LITERAL )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(NUMERIC_LITERAL, "NUMERIC_LITERAL"), root_1);
+
+ adaptor.addChild(root_1, stream_FLOATING_POINT_LITERAL.nextNode());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:444:4: integerLiteral
+ {
+ pushFollow(FOLLOW_integerLiteral_in_signedNumericLiteral1847);
+ integerLiteral155=integerLiteral();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_integerLiteral.add(integerLiteral155.getTree());
+
+
+ // AST REWRITE
+ // elements: integerLiteral
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 445:3: -> integerLiteral
+ {
+ adaptor.addChild(root_0, stream_integerLiteral.nextTree());
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end signedNumericLiteral
+
+ public static class integerLiteral_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start integerLiteral
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:448:1: integerLiteral : DECIMAL_INTEGER_LITERAL -> ^( NUMERIC_LITERAL DECIMAL_INTEGER_LITERAL ) ;
+ public final CMISParser.integerLiteral_return integerLiteral() throws RecognitionException {
+ CMISParser.integerLiteral_return retval = new CMISParser.integerLiteral_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token DECIMAL_INTEGER_LITERAL156=null;
+
+ Object DECIMAL_INTEGER_LITERAL156_tree=null;
+ RewriteRuleTokenStream stream_DECIMAL_INTEGER_LITERAL=new RewriteRuleTokenStream(adaptor,"token DECIMAL_INTEGER_LITERAL");
+
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:449:2: ( DECIMAL_INTEGER_LITERAL -> ^( NUMERIC_LITERAL DECIMAL_INTEGER_LITERAL ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:449:4: DECIMAL_INTEGER_LITERAL
+ {
+ DECIMAL_INTEGER_LITERAL156=(Token)match(input,DECIMAL_INTEGER_LITERAL,FOLLOW_DECIMAL_INTEGER_LITERAL_in_integerLiteral1866); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_DECIMAL_INTEGER_LITERAL.add(DECIMAL_INTEGER_LITERAL156);
+
+
+
+ // AST REWRITE
+ // elements: DECIMAL_INTEGER_LITERAL
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 450:3: -> ^( NUMERIC_LITERAL DECIMAL_INTEGER_LITERAL )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:450:6: ^( NUMERIC_LITERAL DECIMAL_INTEGER_LITERAL )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(NUMERIC_LITERAL, "NUMERIC_LITERAL"), root_1);
+
+ adaptor.addChild(root_1, stream_DECIMAL_INTEGER_LITERAL.nextNode());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end integerLiteral
+
+ public static class characterStringLiteral_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start characterStringLiteral
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:453:1: characterStringLiteral : QUOTED_STRING -> ^( STRING_LITERAL QUOTED_STRING ) ;
+ public final CMISParser.characterStringLiteral_return characterStringLiteral() throws RecognitionException {
+ CMISParser.characterStringLiteral_return retval = new CMISParser.characterStringLiteral_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token QUOTED_STRING157=null;
+
+ Object QUOTED_STRING157_tree=null;
+ RewriteRuleTokenStream stream_QUOTED_STRING=new RewriteRuleTokenStream(adaptor,"token QUOTED_STRING");
+
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:454:2: ( QUOTED_STRING -> ^( STRING_LITERAL QUOTED_STRING ) )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:454:4: QUOTED_STRING
+ {
+ QUOTED_STRING157=(Token)match(input,QUOTED_STRING,FOLLOW_QUOTED_STRING_in_characterStringLiteral1889); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_QUOTED_STRING.add(QUOTED_STRING157);
+
+
+
+ // AST REWRITE
+ // elements: QUOTED_STRING
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 455:3: -> ^( STRING_LITERAL QUOTED_STRING )
+ {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:455:6: ^( STRING_LITERAL QUOTED_STRING )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(STRING_LITERAL, "STRING_LITERAL"), root_1);
+
+ adaptor.addChild(root_1, stream_QUOTED_STRING.nextNode());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end characterStringLiteral
+
+ public static class keyWord_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start keyWord
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:459:1: keyWord : ( SELECT | AS | UPPER | LOWER | FROM | JOIN | INNER | LEFT | OUTER | ON | WHERE | OR | AND | NOT | IN | LIKE | IS | NULL | ANY | CONTAINS | IN_FOLDER | IN_TREE | ORDER | BY | ASC | DESC | SCORE );
+ public final CMISParser.keyWord_return keyWord() throws RecognitionException {
+ CMISParser.keyWord_return retval = new CMISParser.keyWord_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token set158=null;
+
+ Object set158_tree=null;
+
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:459:9: ( SELECT | AS | UPPER | LOWER | FROM | JOIN | INNER | LEFT | OUTER | ON | WHERE | OR | AND | NOT | IN | LIKE | IS | NULL | ANY | CONTAINS | IN_FOLDER | IN_TREE | ORDER | BY | ASC | DESC | SCORE )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:
+ {
+ root_0 = (Object)adaptor.nil();
+
+ set158=(Token)input.LT(1);
+ if ( input.LA(1)==SELECT||input.LA(1)==AS||(input.LA(1)>=FROM && input.LA(1)<=ON)||(input.LA(1)>=WHERE && input.LA(1)<=NOT)||(input.LA(1)>=IN && input.LA(1)<=DESC)||(input.LA(1)>=UPPER && input.LA(1)<=SCORE) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(set158));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end keyWord
+
+ public static class keyWordOrId_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start keyWordOrId
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:488:1: keyWordOrId : ( keyWord -> keyWord | ID -> ID );
+ public final CMISParser.keyWordOrId_return keyWordOrId() throws RecognitionException {
+ CMISParser.keyWordOrId_return retval = new CMISParser.keyWordOrId_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token ID160=null;
+ CMISParser.keyWord_return keyWord159 = null;
+
+
+ Object ID160_tree=null;
+ RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID");
+ RewriteRuleSubtreeStream stream_keyWord=new RewriteRuleSubtreeStream(adaptor,"rule keyWord");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:489:2: ( keyWord -> keyWord | ID -> ID )
+ int alt44=2;
+ int LA44_0 = input.LA(1);
+
+ if ( (LA44_0==SELECT||LA44_0==AS||(LA44_0>=FROM && LA44_0<=ON)||(LA44_0>=WHERE && LA44_0<=NOT)||(LA44_0>=IN && LA44_0<=DESC)||(LA44_0>=UPPER && LA44_0<=SCORE)) ) {
+ alt44=1;
+ }
+ else if ( (LA44_0==ID) ) {
+ alt44=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 44, 0, input);
+
+ throw nvae;
+ }
+ switch (alt44) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:489:4: keyWord
+ {
+ pushFollow(FOLLOW_keyWord_in_keyWordOrId2098);
+ keyWord159=keyWord();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_keyWord.add(keyWord159.getTree());
+
+
+ // AST REWRITE
+ // elements: keyWord
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 490:3: -> keyWord
+ {
+ adaptor.addChild(root_0, stream_keyWord.nextTree());
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:491:4: ID
+ {
+ ID160=(Token)match(input,ID,FOLLOW_ID_in_keyWordOrId2110); if (state.failed) return retval;
+ if ( state.backtracking==0 ) stream_ID.add(ID160);
+
+
+
+ // AST REWRITE
+ // elements: ID
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( state.backtracking==0 ) {
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 492:3: -> ID
+ {
+ adaptor.addChild(root_0, stream_ID.nextNode());
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;}
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+
+ catch(RecognitionException e)
+ {
+ throw e;
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end keyWordOrId
+
+ // $ANTLR start synpred1_CMIS
+ public final void synpred1_CMIS_fragment() throws RecognitionException {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:165:4: ( valueExpression )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:165:5: valueExpression
+ {
+ pushFollow(FOLLOW_valueExpression_in_synpred1_CMIS287);
+ valueExpression();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred1_CMIS
+
+ // $ANTLR start synpred2_CMIS
+ public final void synpred2_CMIS_fragment() throws RecognitionException {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:207:4: ( tableName )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:207:5: tableName
+ {
+ pushFollow(FOLLOW_tableName_in_synpred2_CMIS562);
+ tableName();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred2_CMIS
+
+ // $ANTLR start synpred3_CMIS
+ public final void synpred3_CMIS_fragment() throws RecognitionException {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:221:17: ( joinedTable )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:221:18: joinedTable
+ {
+ pushFollow(FOLLOW_joinedTable_in_synpred3_CMIS640);
+ joinedTable();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred3_CMIS
+
+ // $ANTLR start synpred4_CMIS
+ public final void synpred4_CMIS_fragment() throws RecognitionException {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:236:35: ( joinSpecification )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:236:36: joinSpecification
+ {
+ pushFollow(FOLLOW_joinSpecification_in_synpred4_CMIS737);
+ joinSpecification();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred4_CMIS
+
+ // $ANTLR start synpred5_CMIS
+ public final void synpred5_CMIS_fragment() throws RecognitionException {
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:351:6: ( columnReference )
+ // W:\\workspace-cmis\\ANTLR\\CMIS.g:351:7: columnReference
+ {
+ pushFollow(FOLLOW_columnReference_in_synpred5_CMIS1315);
+ columnReference();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred5_CMIS
+
+ // Delegated rules
+
+ public final boolean synpred2_CMIS() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred2_CMIS_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred4_CMIS() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred4_CMIS_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred3_CMIS() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred3_CMIS_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred5_CMIS() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred5_CMIS_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred1_CMIS() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred1_CMIS_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+
+
+ protected DFA25 dfa25 = new DFA25(this);
+ protected DFA27 dfa27 = new DFA27(this);
+ static final String DFA25_eotS =
+ "\31\uffff";
+ static final String DFA25_eofS =
+ "\31\uffff";
+ static final String DFA25_minS =
+ "\2\35\2\uffff\1\35\1\42\1\35\3\44\2\103\2\104\1\44\1\35\1\44\1"+
+ "\35\1\42\4\104\2\44";
+ static final String DFA25_maxS =
+ "\2\111\2\uffff\1\111\1\106\1\111\3\106\4\104\1\106\1\111\1\106"+
+ "\1\111\1\106\4\104\2\106";
+ static final String DFA25_acceptS =
+ "\2\uffff\1\2\1\1\25\uffff";
+ static final String DFA25_specialS =
+ "\31\uffff}>";
+ static final String[] DFA25_transitionS = {
+ "\1\2\2\uffff\1\2\2\uffff\1\2\1\uffff\6\2\1\uffff\3\2\1\1\5"+
+ "\uffff\25\2",
+ "\1\3\2\uffff\1\3\2\uffff\1\4\1\uffff\6\3\1\uffff\4\3\5\uffff"+
+ "\25\3",
+ "",
+ "",
+ "\1\3\2\uffff\1\3\2\uffff\1\3\1\2\6\3\1\uffff\4\3\5\uffff\14"+
+ "\3\1\12\1\11\1\5\1\6\1\7\1\10\3\3",
+ "\1\13\1\3\1\2\6\uffff\1\3\3\uffff\11\3\11\uffff\6\2",
+ "\1\14\2\uffff\1\14\4\uffff\6\14\1\uffff\4\14\5\uffff\14\14"+
+ "\2\uffff\1\15\3\uffff\3\14",
+ "\1\2\6\uffff\1\3\4\uffff\5\3\14\uffff\6\2",
+ "\1\2\6\uffff\1\3\4\uffff\5\3\14\uffff\6\2",
+ "\1\2\6\uffff\1\3\4\uffff\5\3\14\uffff\6\2",
+ "\1\16\1\17",
+ "\1\20\1\21",
+ "\1\22",
+ "\1\22",
+ "\1\2\6\uffff\1\3\4\uffff\5\3\14\uffff\6\2",
+ "\1\23\2\uffff\1\23\4\uffff\6\23\1\uffff\4\23\5\uffff\14\23"+
+ "\2\uffff\1\24\3\uffff\3\23",
+ "\1\2\6\uffff\1\3\3\uffff\11\3\11\uffff\6\2",
+ "\1\25\2\uffff\1\25\4\uffff\6\25\1\uffff\4\25\5\uffff\14\25"+
+ "\2\uffff\1\26\3\uffff\3\25",
+ "\1\13\1\uffff\1\2\6\uffff\1\3\3\uffff\11\3\11\uffff\6\2",
+ "\1\27",
+ "\1\27",
+ "\1\30",
+ "\1\30",
+ "\1\2\6\uffff\1\3\4\uffff\5\3\14\uffff\6\2",
+ "\1\2\6\uffff\1\3\3\uffff\11\3\11\uffff\6\2"
+ };
+
+ static final short[] DFA25_eot = DFA.unpackEncodedString(DFA25_eotS);
+ static final short[] DFA25_eof = DFA.unpackEncodedString(DFA25_eofS);
+ static final char[] DFA25_min = DFA.unpackEncodedStringToUnsignedChars(DFA25_minS);
+ static final char[] DFA25_max = DFA.unpackEncodedStringToUnsignedChars(DFA25_maxS);
+ static final short[] DFA25_accept = DFA.unpackEncodedString(DFA25_acceptS);
+ static final short[] DFA25_special = DFA.unpackEncodedString(DFA25_specialS);
+ static final short[][] DFA25_transition;
+
+ static {
+ int numStates = DFA25_transitionS.length;
+ DFA25_transition = new short[numStates][];
+ for (int i=0; i ^( NEGATION searchTest ) | searchTest -> searchTest );";
+ }
+ }
+ static final String DFA27_eotS =
+ "\61\uffff";
+ static final String DFA27_eofS =
+ "\46\uffff\1\32\2\uffff\1\36\2\uffff\1\36\4\uffff";
+ static final String DFA27_minS =
+ "\1\35\1\42\1\35\1\43\1\uffff\3\43\1\uffff\1\65\2\uffff\1\103\1"+
+ "\uffff\2\104\1\uffff\3\37\1\53\1\35\1\42\1\37\1\35\1\44\1\uffff"+
+ "\1\37\1\35\1\44\1\uffff\1\37\1\35\1\44\4\104\1\44\2\104\1\44\2\104"+
+ "\1\44\1\53\3\37";
+ static final String DFA27_maxS =
+ "\1\111\1\67\1\111\1\104\1\uffff\3\43\1\uffff\1\66\2\uffff\1\104"+
+ "\1\uffff\2\104\1\uffff\3\106\1\67\1\111\1\67\1\106\1\111\1\106\1"+
+ "\uffff\1\106\1\111\1\106\1\uffff\1\106\1\111\1\106\4\104\1\75\2"+
+ "\104\1\75\2\104\1\75\1\67\3\106";
+ static final String DFA27_acceptS =
+ "\4\uffff\1\5\3\uffff\1\1\1\uffff\1\2\1\3\1\uffff\1\4\2\uffff\1"+
+ "\6\11\uffff\1\7\3\uffff\1\10\22\uffff";
+ static final String DFA27_specialS =
+ "\61\uffff}>";
+ static final String[] DFA27_transitionS = {
+ "\1\10\2\uffff\1\10\4\uffff\6\10\1\uffff\4\10\5\uffff\4\10\1"+
+ "\3\1\5\1\6\1\7\4\10\2\4\1\1\1\2\2\4\3\10",
+ "\1\14\1\10\7\uffff\1\10\3\uffff\1\11\5\10\1\12\1\13\1\15",
+ "\1\16\2\uffff\1\16\4\uffff\6\16\1\uffff\4\16\5\uffff\14\16"+
+ "\2\uffff\1\17\3\uffff\3\16",
+ "\1\10\37\uffff\2\20",
+ "",
+ "\1\21",
+ "\1\22",
+ "\1\23",
+ "",
+ "\1\12\1\13",
+ "",
+ "",
+ "\1\24\1\25",
+ "",
+ "\1\26",
+ "\1\26",
+ "",
+ "\1\32\4\uffff\1\10\34\uffff\1\10\1\31\1\27\1\30\2\10",
+ "\1\36\4\uffff\1\10\34\uffff\1\10\1\35\1\33\1\34\2\10",
+ "\1\36\4\uffff\1\10\34\uffff\1\10\1\41\1\37\1\40\2\10",
+ "\1\10\3\uffff\1\11\5\10\1\12\1\13\1\15",
+ "\1\42\2\uffff\1\42\4\uffff\6\42\1\uffff\4\42\5\uffff\14\42"+
+ "\2\uffff\1\43\3\uffff\3\42",
+ "\1\14\10\uffff\1\10\3\uffff\1\11\5\10\1\12\1\13\1\15",
+ "\1\32\2\uffff\1\10\1\uffff\1\10\34\uffff\6\10",
+ "\1\44\2\uffff\1\44\4\uffff\6\44\1\uffff\4\44\5\uffff\14\44"+
+ "\2\uffff\1\45\3\uffff\3\44",
+ "\1\46\34\uffff\6\10",
+ "",
+ "\1\36\2\uffff\1\10\1\uffff\1\10\34\uffff\6\10",
+ "\1\47\2\uffff\1\47\4\uffff\6\47\1\uffff\4\47\5\uffff\14\47"+
+ "\2\uffff\1\50\3\uffff\3\47",
+ "\1\51\34\uffff\6\10",
+ "",
+ "\1\36\2\uffff\1\10\1\uffff\1\10\34\uffff\6\10",
+ "\1\52\2\uffff\1\52\4\uffff\6\52\1\uffff\4\52\5\uffff\14\52"+
+ "\2\uffff\1\53\3\uffff\3\52",
+ "\1\54\34\uffff\6\10",
+ "\1\55",
+ "\1\55",
+ "\1\56",
+ "\1\56",
+ "\1\32\6\uffff\1\10\1\uffff\2\32\1\uffff\5\10\10\uffff\1\32",
+ "\1\57",
+ "\1\57",
+ "\1\36\6\uffff\1\10\1\uffff\2\36\1\uffff\5\10\10\uffff\1\36",
+ "\1\60",
+ "\1\60",
+ "\1\36\6\uffff\1\10\1\uffff\2\36\1\uffff\5\10\10\uffff\1\36",
+ "\1\10\3\uffff\1\11\5\10\1\12\1\13\1\15",
+ "\1\32\2\uffff\1\10\1\uffff\1\10\34\uffff\6\10",
+ "\1\36\2\uffff\1\10\1\uffff\1\10\34\uffff\6\10",
+ "\1\36\2\uffff\1\10\1\uffff\1\10\34\uffff\6\10"
+ };
+
+ static final short[] DFA27_eot = DFA.unpackEncodedString(DFA27_eotS);
+ static final short[] DFA27_eof = DFA.unpackEncodedString(DFA27_eofS);
+ static final char[] DFA27_min = DFA.unpackEncodedStringToUnsignedChars(DFA27_minS);
+ static final char[] DFA27_max = DFA.unpackEncodedStringToUnsignedChars(DFA27_maxS);
+ static final short[] DFA27_accept = DFA.unpackEncodedString(DFA27_acceptS);
+ static final short[] DFA27_special = DFA.unpackEncodedString(DFA27_specialS);
+ static final short[][] DFA27_transition;
+
+ static {
+ int numStates = DFA27_transitionS.length;
+ DFA27_transition = new short[numStates][];
+ for (int i=0; i ^(FIELD_CONJUNCTION ftsFieldGroupExplicitDisjunction+)
| ftsFieldGroupExplicitDisjunction (ftsFieldGroupExplicitDisjunction)*
-> ^(FIELD_DISJUNCTION ftsFieldGroupExplicitDisjunction+)
diff --git a/source/java/org/alfresco/repo/search/impl/parsers/FTS.tokens b/source/java/org/alfresco/repo/search/impl/parsers/FTS.tokens
new file mode 100644
index 0000000000..4adf08a891
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/parsers/FTS.tokens
@@ -0,0 +1,36 @@
+TERM=8
+STAR=33
+FG_PROXIMITY=20
+CONJUNCTION=6
+FG_TERM=16
+EXACT_TERM=9
+FIELD_GROUP=15
+INWORD=38
+FIELD_DISJUNCTION=12
+DOTDOT=34
+NOT=37
+FG_EXACT_TERM=17
+MINUS=25
+ID=36
+AND=24
+FTSWORD=29
+LPAREN=26
+PHRASE=10
+COLON=28
+DISJUNCTION=5
+RPAREN=27
+TILDA=32
+FTS=4
+WS=39
+FG_SYNONYM=19
+NEGATION=7
+FTSPHRASE=31
+FIELD_CONJUNCTION=13
+OR=23
+PLUS=30
+DOT=35
+COLUMN_REF=22
+FG_RANGE=21
+SYNONYM=11
+FG_PHRASE=18
+FIELD_NEGATION=14
diff --git a/source/java/org/alfresco/repo/search/impl/parsers/FTSLexer.java b/source/java/org/alfresco/repo/search/impl/parsers/FTSLexer.java
new file mode 100644
index 0000000000..20b7899bef
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/parsers/FTSLexer.java
@@ -0,0 +1,861 @@
+// $ANTLR 3.1b1 W:\\workspace-cmis\\ANTLR\\FTS.g 2008-07-03 14:45:12
+package org.alfresco.repo.search.impl.parsers;
+
+import org.antlr.runtime.*;
+import java.util.Stack;
+import java.util.List;
+import java.util.ArrayList;
+
+public class FTSLexer extends Lexer {
+ public static final int TERM=8;
+ public static final int STAR=33;
+ public static final int FG_PROXIMITY=20;
+ public static final int CONJUNCTION=6;
+ public static final int FG_TERM=16;
+ public static final int EXACT_TERM=9;
+ public static final int FIELD_GROUP=15;
+ public static final int INWORD=38;
+ public static final int FIELD_DISJUNCTION=12;
+ public static final int DOTDOT=34;
+ public static final int NOT=37;
+ public static final int FG_EXACT_TERM=17;
+ public static final int MINUS=25;
+ public static final int ID=36;
+ public static final int AND=24;
+ public static final int EOF=-1;
+ public static final int PHRASE=10;
+ public static final int LPAREN=26;
+ public static final int FTSWORD=29;
+ public static final int COLON=28;
+ public static final int DISJUNCTION=5;
+ public static final int RPAREN=27;
+ public static final int FTS=4;
+ public static final int TILDA=32;
+ public static final int FG_SYNONYM=19;
+ public static final int WS=39;
+ public static final int NEGATION=7;
+ public static final int FTSPHRASE=31;
+ public static final int FIELD_CONJUNCTION=13;
+ public static final int OR=23;
+ public static final int PLUS=30;
+ public static final int DOT=35;
+ public static final int COLUMN_REF=22;
+ public static final int SYNONYM=11;
+ public static final int FG_RANGE=21;
+ public static final int FG_PHRASE=18;
+ public static final int FIELD_NEGATION=14;
+
+ // delegates
+ // delegators
+
+ public FTSLexer() {;}
+ public FTSLexer(CharStream input) {
+ this(input, new RecognizerSharedState());
+ }
+ public FTSLexer(CharStream input, RecognizerSharedState state) {
+ super(input,state);
+
+ }
+ public String getGrammarFileName() { return "W:\\workspace-cmis\\ANTLR\\FTS.g"; }
+
+ // $ANTLR start OR
+ public final void mOR() throws RecognitionException {
+ try {
+ int _type = OR;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:234:4: ( ( 'O' | 'o' ) ( 'R' | 'r' ) )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:234:6: ( 'O' | 'o' ) ( 'R' | 'r' )
+ {
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end OR
+
+ // $ANTLR start AND
+ public final void mAND() throws RecognitionException {
+ try {
+ int _type = AND;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:235:5: ( ( 'A' | 'a' ) ( 'N' | 'n' ) ( 'D' | 'd' ) )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:235:7: ( 'A' | 'a' ) ( 'N' | 'n' ) ( 'D' | 'd' )
+ {
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='D'||input.LA(1)=='d' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end AND
+
+ // $ANTLR start NOT
+ public final void mNOT() throws RecognitionException {
+ try {
+ int _type = NOT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:236:5: ( ( 'N' | 'n' ) ( 'O' | 'o' ) ( 'T' | 't' ) )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:236:7: ( 'N' | 'n' ) ( 'O' | 'o' ) ( 'T' | 't' )
+ {
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end NOT
+
+ // $ANTLR start TILDA
+ public final void mTILDA() throws RecognitionException {
+ try {
+ int _type = TILDA;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:237:7: ( '~' )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:237:9: '~'
+ {
+ match('~');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end TILDA
+
+ // $ANTLR start LPAREN
+ public final void mLPAREN() throws RecognitionException {
+ try {
+ int _type = LPAREN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:238:8: ( '(' )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:238:10: '('
+ {
+ match('(');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end LPAREN
+
+ // $ANTLR start RPAREN
+ public final void mRPAREN() throws RecognitionException {
+ try {
+ int _type = RPAREN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:239:8: ( ')' )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:239:10: ')'
+ {
+ match(')');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end RPAREN
+
+ // $ANTLR start PLUS
+ public final void mPLUS() throws RecognitionException {
+ try {
+ int _type = PLUS;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:240:6: ( '+' )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:240:8: '+'
+ {
+ match('+');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end PLUS
+
+ // $ANTLR start MINUS
+ public final void mMINUS() throws RecognitionException {
+ try {
+ int _type = MINUS;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:241:7: ( '-' )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:241:9: '-'
+ {
+ match('-');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end MINUS
+
+ // $ANTLR start COLON
+ public final void mCOLON() throws RecognitionException {
+ try {
+ int _type = COLON;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:242:7: ( ':' )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:242:9: ':'
+ {
+ match(':');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end COLON
+
+ // $ANTLR start STAR
+ public final void mSTAR() throws RecognitionException {
+ try {
+ int _type = STAR;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:243:6: ( '*' )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:243:8: '*'
+ {
+ match('*');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end STAR
+
+ // $ANTLR start DOTDOT
+ public final void mDOTDOT() throws RecognitionException {
+ try {
+ int _type = DOTDOT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:244:8: ( '..' )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:244:10: '..'
+ {
+ match("..");
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end DOTDOT
+
+ // $ANTLR start DOT
+ public final void mDOT() throws RecognitionException {
+ try {
+ int _type = DOT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:245:5: ( '.' )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:245:7: '.'
+ {
+ match('.');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end DOT
+
+ // $ANTLR start FTSWORD
+ public final void mFTSWORD() throws RecognitionException {
+ try {
+ int _type = FTSWORD;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:247:9: ( ( INWORD )+ )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:247:12: ( INWORD )+
+ {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:247:12: ( INWORD )+
+ int cnt1=0;
+ loop1:
+ do {
+ int alt1=2;
+ int LA1_0 = input.LA(1);
+
+ if ( ((LA1_0>='0' && LA1_0<='9')||(LA1_0>='A' && LA1_0<='Z')||(LA1_0>='a' && LA1_0<='z')||(LA1_0>='\u00C0' && LA1_0<='\u00D6')||(LA1_0>='\u00D8' && LA1_0<='\u00F6')||(LA1_0>='\u00F8' && LA1_0<='\u1FFF')||(LA1_0>='\u3040' && LA1_0<='\u318F')||(LA1_0>='\u3300' && LA1_0<='\u337F')||(LA1_0>='\u3400' && LA1_0<='\u3D2D')||(LA1_0>='\u4E00' && LA1_0<='\u9FFF')||(LA1_0>='\uAC00' && LA1_0<='\uD7AF')||(LA1_0>='\uF900' && LA1_0<='\uFAFF')) ) {
+ alt1=1;
+ }
+
+
+ switch (alt1) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:247:12: INWORD
+ {
+ mINWORD();
+
+ }
+ break;
+
+ default :
+ if ( cnt1 >= 1 ) break loop1;
+ EarlyExitException eee =
+ new EarlyExitException(1, input);
+ throw eee;
+ }
+ cnt1++;
+ } while (true);
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end FTSWORD
+
+ // $ANTLR start INWORD
+ public final void mINWORD() throws RecognitionException {
+ try {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:250:8: ( '\\u0041' .. '\\u005A' | '\\u0061' .. '\\u007A' | '\\u00C0' .. '\\u00D6' | '\\u00D8' .. '\\u00F6' | '\\u00F8' .. '\\u00FF' | '\\u0100' .. '\\u1FFF' | '\\u3040' .. '\\u318F' | '\\u3300' .. '\\u337F' | '\\u3400' .. '\\u3D2D' | '\\u4E00' .. '\\u9FFF' | '\\uF900' .. '\\uFAFF' | '\\uAC00' .. '\\uD7AF' | '\\u0030' .. '\\u0039' | '\\u0660' .. '\\u0669' | '\\u06F0' .. '\\u06F9' | '\\u0966' .. '\\u096F' | '\\u09E6' .. '\\u09EF' | '\\u0A66' .. '\\u0A6F' | '\\u0AE6' .. '\\u0AEF' | '\\u0B66' .. '\\u0B6F' | '\\u0BE7' .. '\\u0BEF' | '\\u0C66' .. '\\u0C6F' | '\\u0CE6' .. '\\u0CEF' | '\\u0D66' .. '\\u0D6F' | '\\u0E50' .. '\\u0E59' | '\\u0ED0' .. '\\u0ED9' | '\\u1040' .. '\\u1049' )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:
+ {
+ if ( (input.LA(1)>='0' && input.LA(1)<='9')||(input.LA(1)>='A' && input.LA(1)<='Z')||(input.LA(1)>='a' && input.LA(1)<='z')||(input.LA(1)>='\u00C0' && input.LA(1)<='\u00D6')||(input.LA(1)>='\u00D8' && input.LA(1)<='\u00F6')||(input.LA(1)>='\u00F8' && input.LA(1)<='\u1FFF')||(input.LA(1)>='\u3040' && input.LA(1)<='\u318F')||(input.LA(1)>='\u3300' && input.LA(1)<='\u337F')||(input.LA(1)>='\u3400' && input.LA(1)<='\u3D2D')||(input.LA(1)>='\u4E00' && input.LA(1)<='\u9FFF')||(input.LA(1)>='\uAC00' && input.LA(1)<='\uD7AF')||(input.LA(1)>='\uF900' && input.LA(1)<='\uFAFF') ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ }
+ finally {
+ }
+ }
+ // $ANTLR end INWORD
+
+ // $ANTLR start FTSPHRASE
+ public final void mFTSPHRASE() throws RecognitionException {
+ try {
+ int _type = FTSPHRASE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:280:2: ( '\"' (~ '\"' | '\"\"' )* '\"' )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:280:4: '\"' (~ '\"' | '\"\"' )* '\"'
+ {
+ match('\"');
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:280:8: (~ '\"' | '\"\"' )*
+ loop2:
+ do {
+ int alt2=3;
+ int LA2_0 = input.LA(1);
+
+ if ( (LA2_0=='\"') ) {
+ int LA2_1 = input.LA(2);
+
+ if ( (LA2_1=='\"') ) {
+ alt2=2;
+ }
+
+
+ }
+ else if ( ((LA2_0>='\u0000' && LA2_0<='!')||(LA2_0>='#' && LA2_0<='\uFFFE')) ) {
+ alt2=1;
+ }
+
+
+ switch (alt2) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:280:9: ~ '\"'
+ {
+ if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='\uFFFE') ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:280:16: '\"\"'
+ {
+ match("\"\"");
+
+
+ }
+ break;
+
+ default :
+ break loop2;
+ }
+ } while (true);
+
+ match('\"');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end FTSPHRASE
+
+ // $ANTLR start ID
+ public final void mID() throws RecognitionException {
+ try {
+ int _type = ID;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:282:4: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '0' | '_' | '$' | '#' )* )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:282:6: ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '0' | '_' | '$' | '#' )*
+ {
+ if ( (input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:282:29: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '0' | '_' | '$' | '#' )*
+ loop3:
+ do {
+ int alt3=2;
+ int LA3_0 = input.LA(1);
+
+ if ( ((LA3_0>='#' && LA3_0<='$')||LA3_0=='0'||(LA3_0>='A' && LA3_0<='Z')||LA3_0=='_'||(LA3_0>='a' && LA3_0<='z')) ) {
+ alt3=1;
+ }
+
+
+ switch (alt3) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:
+ {
+ if ( (input.LA(1)>='#' && input.LA(1)<='$')||input.LA(1)=='0'||(input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+ break;
+
+ default :
+ break loop3;
+ }
+ } while (true);
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end ID
+
+ // $ANTLR start WS
+ public final void mWS() throws RecognitionException {
+ try {
+ int _type = WS;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:284:4: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:284:6: ( ' ' | '\\t' | '\\r' | '\\n' )+
+ {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:284:6: ( ' ' | '\\t' | '\\r' | '\\n' )+
+ int cnt4=0;
+ loop4:
+ do {
+ int alt4=2;
+ int LA4_0 = input.LA(1);
+
+ if ( ((LA4_0>='\t' && LA4_0<='\n')||LA4_0=='\r'||LA4_0==' ') ) {
+ alt4=1;
+ }
+
+
+ switch (alt4) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:
+ {
+ if ( (input.LA(1)>='\t' && input.LA(1)<='\n')||input.LA(1)=='\r'||input.LA(1)==' ' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+ break;
+
+ default :
+ if ( cnt4 >= 1 ) break loop4;
+ EarlyExitException eee =
+ new EarlyExitException(4, input);
+ throw eee;
+ }
+ cnt4++;
+ } while (true);
+
+ _channel = HIDDEN;
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end WS
+
+ public void mTokens() throws RecognitionException {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:1:8: ( OR | AND | NOT | TILDA | LPAREN | RPAREN | PLUS | MINUS | COLON | STAR | DOTDOT | DOT | FTSWORD | FTSPHRASE | ID | WS )
+ int alt5=16;
+ alt5 = dfa5.predict(input);
+ switch (alt5) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:1:10: OR
+ {
+ mOR();
+
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:1:13: AND
+ {
+ mAND();
+
+ }
+ break;
+ case 3 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:1:17: NOT
+ {
+ mNOT();
+
+ }
+ break;
+ case 4 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:1:21: TILDA
+ {
+ mTILDA();
+
+ }
+ break;
+ case 5 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:1:27: LPAREN
+ {
+ mLPAREN();
+
+ }
+ break;
+ case 6 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:1:34: RPAREN
+ {
+ mRPAREN();
+
+ }
+ break;
+ case 7 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:1:41: PLUS
+ {
+ mPLUS();
+
+ }
+ break;
+ case 8 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:1:46: MINUS
+ {
+ mMINUS();
+
+ }
+ break;
+ case 9 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:1:52: COLON
+ {
+ mCOLON();
+
+ }
+ break;
+ case 10 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:1:58: STAR
+ {
+ mSTAR();
+
+ }
+ break;
+ case 11 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:1:63: DOTDOT
+ {
+ mDOTDOT();
+
+ }
+ break;
+ case 12 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:1:70: DOT
+ {
+ mDOT();
+
+ }
+ break;
+ case 13 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:1:74: FTSWORD
+ {
+ mFTSWORD();
+
+ }
+ break;
+ case 14 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:1:82: FTSPHRASE
+ {
+ mFTSPHRASE();
+
+ }
+ break;
+ case 15 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:1:92: ID
+ {
+ mID();
+
+ }
+ break;
+ case 16 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:1:95: WS
+ {
+ mWS();
+
+ }
+ break;
+
+ }
+
+ }
+
+
+ protected DFA5 dfa5 = new DFA5(this);
+ static final String DFA5_eotS =
+ "\1\uffff\3\16\7\uffff\1\26\1\16\4\uffff\1\27\3\16\3\uffff\1\32"+
+ "\1\33\2\uffff";
+ static final String DFA5_eofS =
+ "\34\uffff";
+ static final String DFA5_minS =
+ "\1\11\3\43\7\uffff\1\56\1\43\4\uffff\4\43\3\uffff\2\43\2\uffff";
+ static final String DFA5_maxS =
+ "\1\ufaff\3\172\7\uffff\1\56\1\172\4\uffff\1\ufaff\3\172\3\uffff"+
+ "\2\ufaff\2\uffff";
+ static final String DFA5_acceptS =
+ "\4\uffff\1\4\1\5\1\6\1\7\1\10\1\11\1\12\2\uffff\1\16\1\15\1\17"+
+ "\1\20\4\uffff\1\13\1\14\1\1\2\uffff\1\2\1\3";
+ static final String DFA5_specialS =
+ "\34\uffff}>";
+ static final String[] DFA5_transitionS = {
+ "\2\20\2\uffff\1\20\22\uffff\1\20\1\uffff\1\15\5\uffff\1\5\1"+
+ "\6\1\12\1\7\1\uffff\1\10\1\13\1\uffff\12\16\1\11\6\uffff\1\2"+
+ "\14\14\1\3\1\1\13\14\4\uffff\1\17\1\uffff\1\2\14\14\1\3\1\1"+
+ "\13\14\3\uffff\1\4\101\uffff\27\16\1\uffff\37\16\1\uffff\u1f08"+
+ "\16\u1040\uffff\u0150\16\u0170\uffff\u0080\16\u0080\uffff\u092e"+
+ "\16\u10d2\uffff\u5200\16\u0c00\uffff\u2bb0\16\u2150\uffff\u0200"+
+ "\16",
+ "\2\17\13\uffff\1\22\20\uffff\21\22\1\21\10\22\4\uffff\1\17"+
+ "\1\uffff\21\22\1\21\10\22",
+ "\2\17\13\uffff\1\22\20\uffff\15\22\1\23\14\22\4\uffff\1\17"+
+ "\1\uffff\15\22\1\23\14\22",
+ "\2\17\13\uffff\1\22\20\uffff\16\22\1\24\13\22\4\uffff\1\17"+
+ "\1\uffff\16\22\1\24\13\22",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\25",
+ "\2\17\13\uffff\1\22\20\uffff\32\22\4\uffff\1\17\1\uffff\32"+
+ "\22",
+ "",
+ "",
+ "",
+ "",
+ "\2\17\13\uffff\1\22\11\16\7\uffff\32\22\4\uffff\1\17\1\uffff"+
+ "\32\22\105\uffff\27\16\1\uffff\37\16\1\uffff\u1f08\16\u1040"+
+ "\uffff\u0150\16\u0170\uffff\u0080\16\u0080\uffff\u092e\16\u10d2"+
+ "\uffff\u5200\16\u0c00\uffff\u2bb0\16\u2150\uffff\u0200\16",
+ "\2\17\13\uffff\1\22\20\uffff\32\22\4\uffff\1\17\1\uffff\32"+
+ "\22",
+ "\2\17\13\uffff\1\22\20\uffff\3\22\1\30\26\22\4\uffff\1\17"+
+ "\1\uffff\3\22\1\30\26\22",
+ "\2\17\13\uffff\1\22\20\uffff\23\22\1\31\6\22\4\uffff\1\17"+
+ "\1\uffff\23\22\1\31\6\22",
+ "",
+ "",
+ "",
+ "\2\17\13\uffff\1\22\11\16\7\uffff\32\22\4\uffff\1\17\1\uffff"+
+ "\32\22\105\uffff\27\16\1\uffff\37\16\1\uffff\u1f08\16\u1040"+
+ "\uffff\u0150\16\u0170\uffff\u0080\16\u0080\uffff\u092e\16\u10d2"+
+ "\uffff\u5200\16\u0c00\uffff\u2bb0\16\u2150\uffff\u0200\16",
+ "\2\17\13\uffff\1\22\11\16\7\uffff\32\22\4\uffff\1\17\1\uffff"+
+ "\32\22\105\uffff\27\16\1\uffff\37\16\1\uffff\u1f08\16\u1040"+
+ "\uffff\u0150\16\u0170\uffff\u0080\16\u0080\uffff\u092e\16\u10d2"+
+ "\uffff\u5200\16\u0c00\uffff\u2bb0\16\u2150\uffff\u0200\16",
+ "",
+ ""
+ };
+
+ static final short[] DFA5_eot = DFA.unpackEncodedString(DFA5_eotS);
+ static final short[] DFA5_eof = DFA.unpackEncodedString(DFA5_eofS);
+ static final char[] DFA5_min = DFA.unpackEncodedStringToUnsignedChars(DFA5_minS);
+ static final char[] DFA5_max = DFA.unpackEncodedStringToUnsignedChars(DFA5_maxS);
+ static final short[] DFA5_accept = DFA.unpackEncodedString(DFA5_acceptS);
+ static final short[] DFA5_special = DFA.unpackEncodedString(DFA5_specialS);
+ static final short[][] DFA5_transition;
+
+ static {
+ int numStates = DFA5_transitionS.length;
+ DFA5_transition = new short[numStates][];
+ for (int i=0; i", "", "", "", "FTS", "DISJUNCTION", "CONJUNCTION", "NEGATION", "TERM", "EXACT_TERM", "PHRASE", "SYNONYM", "FIELD_DISJUNCTION", "FIELD_CONJUNCTION", "FIELD_NEGATION", "FIELD_GROUP", "FG_TERM", "FG_EXACT_TERM", "FG_PHRASE", "FG_SYNONYM", "FG_PROXIMITY", "FG_RANGE", "COLUMN_REF", "OR", "AND", "MINUS", "LPAREN", "RPAREN", "COLON", "FTSWORD", "PLUS", "FTSPHRASE", "TILDA", "STAR", "DOTDOT", "DOT", "ID", "NOT", "INWORD", "WS"
+ };
+ public static final int TERM=8;
+ public static final int STAR=33;
+ public static final int FG_PROXIMITY=20;
+ public static final int CONJUNCTION=6;
+ public static final int FG_TERM=16;
+ public static final int EXACT_TERM=9;
+ public static final int FIELD_GROUP=15;
+ public static final int INWORD=38;
+ public static final int FIELD_DISJUNCTION=12;
+ public static final int DOTDOT=34;
+ public static final int NOT=37;
+ public static final int FG_EXACT_TERM=17;
+ public static final int MINUS=25;
+ public static final int ID=36;
+ public static final int AND=24;
+ public static final int EOF=-1;
+ public static final int FTSWORD=29;
+ public static final int LPAREN=26;
+ public static final int PHRASE=10;
+ public static final int COLON=28;
+ public static final int DISJUNCTION=5;
+ public static final int RPAREN=27;
+ public static final int TILDA=32;
+ public static final int FTS=4;
+ public static final int WS=39;
+ public static final int FG_SYNONYM=19;
+ public static final int NEGATION=7;
+ public static final int FTSPHRASE=31;
+ public static final int FIELD_CONJUNCTION=13;
+ public static final int OR=23;
+ public static final int PLUS=30;
+ public static final int DOT=35;
+ public static final int COLUMN_REF=22;
+ public static final int FG_RANGE=21;
+ public static final int SYNONYM=11;
+ public static final int FG_PHRASE=18;
+ public static final int FIELD_NEGATION=14;
+
+ // delegates
+ // delegators
+
+
+ public FTSParser(TokenStream input) {
+ this(input, new RecognizerSharedState());
+ }
+ public FTSParser(TokenStream input, RecognizerSharedState state) {
+ super(input, state);
+ }
+
+ protected TreeAdaptor adaptor = new CommonTreeAdaptor();
+
+ public void setTreeAdaptor(TreeAdaptor adaptor) {
+ this.adaptor = adaptor;
+ }
+ public TreeAdaptor getTreeAdaptor() {
+ return adaptor;
+ }
+
+ public String[] getTokenNames() { return FTSParser.tokenNames; }
+ public String getGrammarFileName() { return "W:\\workspace-cmis\\ANTLR\\FTS.g"; }
+
+
+
+ public boolean defaultConjunction()
+ {
+ return true;
+ }
+
+ public boolean defaultFieldConjunction()
+ {
+ return true;
+ }
+
+
+
+
+ public static class fts_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start fts
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:85:1: fts : ftsImplicitConjunctionOrDisjunction -> ftsImplicitConjunctionOrDisjunction ;
+ public final FTSParser.fts_return fts() throws RecognitionException {
+ FTSParser.fts_return retval = new FTSParser.fts_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ FTSParser.ftsImplicitConjunctionOrDisjunction_return ftsImplicitConjunctionOrDisjunction1 = null;
+
+
+ RewriteRuleSubtreeStream stream_ftsImplicitConjunctionOrDisjunction=new RewriteRuleSubtreeStream(adaptor,"rule ftsImplicitConjunctionOrDisjunction");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:85:5: ( ftsImplicitConjunctionOrDisjunction -> ftsImplicitConjunctionOrDisjunction )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:85:8: ftsImplicitConjunctionOrDisjunction
+ {
+ pushFollow(FOLLOW_ftsImplicitConjunctionOrDisjunction_in_fts135);
+ ftsImplicitConjunctionOrDisjunction1=ftsImplicitConjunctionOrDisjunction();
+
+ state._fsp--;
+
+ stream_ftsImplicitConjunctionOrDisjunction.add(ftsImplicitConjunctionOrDisjunction1.getTree());
+
+
+ // AST REWRITE
+ // elements: ftsImplicitConjunctionOrDisjunction
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 86:3: -> ftsImplicitConjunctionOrDisjunction
+ {
+ adaptor.addChild(root_0, stream_ftsImplicitConjunctionOrDisjunction.nextTree());
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+
+ retval.stop = input.LT(-1);
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end fts
+
+ public static class ftsImplicitConjunctionOrDisjunction_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start ftsImplicitConjunctionOrDisjunction
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:89:1: ftsImplicitConjunctionOrDisjunction : ({...}? ftsExplicitDisjunction ( ftsExplicitDisjunction )* -> ^( CONJUNCTION ( ftsExplicitDisjunction )+ ) | ftsExplicitDisjunction ( ftsExplicitDisjunction )* -> ^( DISJUNCTION ( ftsExplicitDisjunction )+ ) );
+ public final FTSParser.ftsImplicitConjunctionOrDisjunction_return ftsImplicitConjunctionOrDisjunction() throws RecognitionException {
+ FTSParser.ftsImplicitConjunctionOrDisjunction_return retval = new FTSParser.ftsImplicitConjunctionOrDisjunction_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ FTSParser.ftsExplicitDisjunction_return ftsExplicitDisjunction2 = null;
+
+ FTSParser.ftsExplicitDisjunction_return ftsExplicitDisjunction3 = null;
+
+ FTSParser.ftsExplicitDisjunction_return ftsExplicitDisjunction4 = null;
+
+ FTSParser.ftsExplicitDisjunction_return ftsExplicitDisjunction5 = null;
+
+
+ RewriteRuleSubtreeStream stream_ftsExplicitDisjunction=new RewriteRuleSubtreeStream(adaptor,"rule ftsExplicitDisjunction");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:90:2: ({...}? ftsExplicitDisjunction ( ftsExplicitDisjunction )* -> ^( CONJUNCTION ( ftsExplicitDisjunction )+ ) | ftsExplicitDisjunction ( ftsExplicitDisjunction )* -> ^( DISJUNCTION ( ftsExplicitDisjunction )+ ) )
+ int alt3=2;
+ alt3 = dfa3.predict(input);
+ switch (alt3) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:90:4: {...}? ftsExplicitDisjunction ( ftsExplicitDisjunction )*
+ {
+ if ( !(defaultConjunction()) ) {
+ throw new FailedPredicateException(input, "ftsImplicitConjunctionOrDisjunction", "defaultConjunction()");
+ }
+ pushFollow(FOLLOW_ftsExplicitDisjunction_in_ftsImplicitConjunctionOrDisjunction157);
+ ftsExplicitDisjunction2=ftsExplicitDisjunction();
+
+ state._fsp--;
+
+ stream_ftsExplicitDisjunction.add(ftsExplicitDisjunction2.getTree());
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:90:51: ( ftsExplicitDisjunction )*
+ loop1:
+ do {
+ int alt1=2;
+ int LA1_0 = input.LA(1);
+
+ if ( ((LA1_0>=MINUS && LA1_0<=LPAREN)||(LA1_0>=FTSWORD && LA1_0<=TILDA)||LA1_0==ID) ) {
+ alt1=1;
+ }
+
+
+ switch (alt1) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:90:52: ftsExplicitDisjunction
+ {
+ pushFollow(FOLLOW_ftsExplicitDisjunction_in_ftsImplicitConjunctionOrDisjunction160);
+ ftsExplicitDisjunction3=ftsExplicitDisjunction();
+
+ state._fsp--;
+
+ stream_ftsExplicitDisjunction.add(ftsExplicitDisjunction3.getTree());
+
+ }
+ break;
+
+ default :
+ break loop1;
+ }
+ } while (true);
+
+
+
+ // AST REWRITE
+ // elements: ftsExplicitDisjunction
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 91:3: -> ^( CONJUNCTION ( ftsExplicitDisjunction )+ )
+ {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:91:6: ^( CONJUNCTION ( ftsExplicitDisjunction )+ )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(CONJUNCTION, "CONJUNCTION"), root_1);
+
+ if ( !(stream_ftsExplicitDisjunction.hasNext()) ) {
+ throw new RewriteEarlyExitException();
+ }
+ while ( stream_ftsExplicitDisjunction.hasNext() ) {
+ adaptor.addChild(root_1, stream_ftsExplicitDisjunction.nextTree());
+
+ }
+ stream_ftsExplicitDisjunction.reset();
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:92:5: ftsExplicitDisjunction ( ftsExplicitDisjunction )*
+ {
+ pushFollow(FOLLOW_ftsExplicitDisjunction_in_ftsImplicitConjunctionOrDisjunction179);
+ ftsExplicitDisjunction4=ftsExplicitDisjunction();
+
+ state._fsp--;
+
+ stream_ftsExplicitDisjunction.add(ftsExplicitDisjunction4.getTree());
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:92:28: ( ftsExplicitDisjunction )*
+ loop2:
+ do {
+ int alt2=2;
+ int LA2_0 = input.LA(1);
+
+ if ( ((LA2_0>=MINUS && LA2_0<=LPAREN)||(LA2_0>=FTSWORD && LA2_0<=TILDA)||LA2_0==ID) ) {
+ alt2=1;
+ }
+
+
+ switch (alt2) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:92:29: ftsExplicitDisjunction
+ {
+ pushFollow(FOLLOW_ftsExplicitDisjunction_in_ftsImplicitConjunctionOrDisjunction182);
+ ftsExplicitDisjunction5=ftsExplicitDisjunction();
+
+ state._fsp--;
+
+ stream_ftsExplicitDisjunction.add(ftsExplicitDisjunction5.getTree());
+
+ }
+ break;
+
+ default :
+ break loop2;
+ }
+ } while (true);
+
+
+
+ // AST REWRITE
+ // elements: ftsExplicitDisjunction
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 93:3: -> ^( DISJUNCTION ( ftsExplicitDisjunction )+ )
+ {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:93:6: ^( DISJUNCTION ( ftsExplicitDisjunction )+ )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(DISJUNCTION, "DISJUNCTION"), root_1);
+
+ if ( !(stream_ftsExplicitDisjunction.hasNext()) ) {
+ throw new RewriteEarlyExitException();
+ }
+ while ( stream_ftsExplicitDisjunction.hasNext() ) {
+ adaptor.addChild(root_1, stream_ftsExplicitDisjunction.nextTree());
+
+ }
+ stream_ftsExplicitDisjunction.reset();
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end ftsImplicitConjunctionOrDisjunction
+
+ public static class ftsExplicitDisjunction_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start ftsExplicitDisjunction
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:96:1: ftsExplicitDisjunction : ftsExplictConjunction ( OR ftsExplictConjunction )* -> ^( DISJUNCTION ( ftsExplictConjunction )+ ) ;
+ public final FTSParser.ftsExplicitDisjunction_return ftsExplicitDisjunction() throws RecognitionException {
+ FTSParser.ftsExplicitDisjunction_return retval = new FTSParser.ftsExplicitDisjunction_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token OR7=null;
+ FTSParser.ftsExplictConjunction_return ftsExplictConjunction6 = null;
+
+ FTSParser.ftsExplictConjunction_return ftsExplictConjunction8 = null;
+
+
+ Object OR7_tree=null;
+ RewriteRuleTokenStream stream_OR=new RewriteRuleTokenStream(adaptor,"token OR");
+ RewriteRuleSubtreeStream stream_ftsExplictConjunction=new RewriteRuleSubtreeStream(adaptor,"rule ftsExplictConjunction");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:97:2: ( ftsExplictConjunction ( OR ftsExplictConjunction )* -> ^( DISJUNCTION ( ftsExplictConjunction )+ ) )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:97:4: ftsExplictConjunction ( OR ftsExplictConjunction )*
+ {
+ pushFollow(FOLLOW_ftsExplictConjunction_in_ftsExplicitDisjunction207);
+ ftsExplictConjunction6=ftsExplictConjunction();
+
+ state._fsp--;
+
+ stream_ftsExplictConjunction.add(ftsExplictConjunction6.getTree());
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:97:26: ( OR ftsExplictConjunction )*
+ loop4:
+ do {
+ int alt4=2;
+ int LA4_0 = input.LA(1);
+
+ if ( (LA4_0==OR) ) {
+ alt4=1;
+ }
+
+
+ switch (alt4) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:97:27: OR ftsExplictConjunction
+ {
+ OR7=(Token)match(input,OR,FOLLOW_OR_in_ftsExplicitDisjunction210);
+ stream_OR.add(OR7);
+
+ pushFollow(FOLLOW_ftsExplictConjunction_in_ftsExplicitDisjunction212);
+ ftsExplictConjunction8=ftsExplictConjunction();
+
+ state._fsp--;
+
+ stream_ftsExplictConjunction.add(ftsExplictConjunction8.getTree());
+
+ }
+ break;
+
+ default :
+ break loop4;
+ }
+ } while (true);
+
+
+
+ // AST REWRITE
+ // elements: ftsExplictConjunction
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 98:3: -> ^( DISJUNCTION ( ftsExplictConjunction )+ )
+ {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:98:6: ^( DISJUNCTION ( ftsExplictConjunction )+ )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(DISJUNCTION, "DISJUNCTION"), root_1);
+
+ if ( !(stream_ftsExplictConjunction.hasNext()) ) {
+ throw new RewriteEarlyExitException();
+ }
+ while ( stream_ftsExplictConjunction.hasNext() ) {
+ adaptor.addChild(root_1, stream_ftsExplictConjunction.nextTree());
+
+ }
+ stream_ftsExplictConjunction.reset();
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+
+ retval.stop = input.LT(-1);
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end ftsExplicitDisjunction
+
+ public static class ftsExplictConjunction_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start ftsExplictConjunction
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:101:1: ftsExplictConjunction : ftsNot ( AND ftsNot )* -> ^( CONJUNCTION ftsNot ) ;
+ public final FTSParser.ftsExplictConjunction_return ftsExplictConjunction() throws RecognitionException {
+ FTSParser.ftsExplictConjunction_return retval = new FTSParser.ftsExplictConjunction_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token AND10=null;
+ FTSParser.ftsNot_return ftsNot9 = null;
+
+ FTSParser.ftsNot_return ftsNot11 = null;
+
+
+ Object AND10_tree=null;
+ RewriteRuleTokenStream stream_AND=new RewriteRuleTokenStream(adaptor,"token AND");
+ RewriteRuleSubtreeStream stream_ftsNot=new RewriteRuleSubtreeStream(adaptor,"rule ftsNot");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:102:2: ( ftsNot ( AND ftsNot )* -> ^( CONJUNCTION ftsNot ) )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:102:4: ftsNot ( AND ftsNot )*
+ {
+ pushFollow(FOLLOW_ftsNot_in_ftsExplictConjunction237);
+ ftsNot9=ftsNot();
+
+ state._fsp--;
+
+ stream_ftsNot.add(ftsNot9.getTree());
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:102:11: ( AND ftsNot )*
+ loop5:
+ do {
+ int alt5=2;
+ int LA5_0 = input.LA(1);
+
+ if ( (LA5_0==AND) ) {
+ alt5=1;
+ }
+
+
+ switch (alt5) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:102:12: AND ftsNot
+ {
+ AND10=(Token)match(input,AND,FOLLOW_AND_in_ftsExplictConjunction240);
+ stream_AND.add(AND10);
+
+ pushFollow(FOLLOW_ftsNot_in_ftsExplictConjunction242);
+ ftsNot11=ftsNot();
+
+ state._fsp--;
+
+ stream_ftsNot.add(ftsNot11.getTree());
+
+ }
+ break;
+
+ default :
+ break loop5;
+ }
+ } while (true);
+
+
+
+ // AST REWRITE
+ // elements: ftsNot
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 103:3: -> ^( CONJUNCTION ftsNot )
+ {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:103:6: ^( CONJUNCTION ftsNot )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(CONJUNCTION, "CONJUNCTION"), root_1);
+
+ adaptor.addChild(root_1, stream_ftsNot.nextTree());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+
+ retval.stop = input.LT(-1);
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end ftsExplictConjunction
+
+ public static class ftsNot_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start ftsNot
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:107:1: ftsNot : ( MINUS ftsTest -> ^( NEGATION ftsTest ) | ftsTest -> ftsTest );
+ public final FTSParser.ftsNot_return ftsNot() throws RecognitionException {
+ FTSParser.ftsNot_return retval = new FTSParser.ftsNot_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token MINUS12=null;
+ FTSParser.ftsTest_return ftsTest13 = null;
+
+ FTSParser.ftsTest_return ftsTest14 = null;
+
+
+ Object MINUS12_tree=null;
+ RewriteRuleTokenStream stream_MINUS=new RewriteRuleTokenStream(adaptor,"token MINUS");
+ RewriteRuleSubtreeStream stream_ftsTest=new RewriteRuleSubtreeStream(adaptor,"rule ftsTest");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:107:9: ( MINUS ftsTest -> ^( NEGATION ftsTest ) | ftsTest -> ftsTest )
+ int alt6=2;
+ int LA6_0 = input.LA(1);
+
+ if ( (LA6_0==MINUS) ) {
+ alt6=1;
+ }
+ else if ( (LA6_0==LPAREN||(LA6_0>=FTSWORD && LA6_0<=TILDA)||LA6_0==ID) ) {
+ alt6=2;
+ }
+ else {
+ NoViableAltException nvae =
+ new NoViableAltException("", 6, 0, input);
+
+ throw nvae;
+ }
+ switch (alt6) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:107:11: MINUS ftsTest
+ {
+ MINUS12=(Token)match(input,MINUS,FOLLOW_MINUS_in_ftsNot268);
+ stream_MINUS.add(MINUS12);
+
+ pushFollow(FOLLOW_ftsTest_in_ftsNot270);
+ ftsTest13=ftsTest();
+
+ state._fsp--;
+
+ stream_ftsTest.add(ftsTest13.getTree());
+
+
+ // AST REWRITE
+ // elements: ftsTest
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 108:3: -> ^( NEGATION ftsTest )
+ {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:108:6: ^( NEGATION ftsTest )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(NEGATION, "NEGATION"), root_1);
+
+ adaptor.addChild(root_1, stream_ftsTest.nextTree());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:109:4: ftsTest
+ {
+ pushFollow(FOLLOW_ftsTest_in_ftsNot285);
+ ftsTest14=ftsTest();
+
+ state._fsp--;
+
+ stream_ftsTest.add(ftsTest14.getTree());
+
+
+ // AST REWRITE
+ // elements: ftsTest
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 110:3: -> ftsTest
+ {
+ adaptor.addChild(root_0, stream_ftsTest.nextTree());
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end ftsNot
+
+ public static class ftsTest_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start ftsTest
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:113:1: ftsTest : ( ftsTerm -> ^( TERM ftsTerm ) | ftsExactTerm -> ^( EXACT_TERM ftsExactTerm ) | ftsPhrase -> ^( PHRASE ftsPhrase ) | ftsSynonym -> ^( SYNONYM ftsSynonym ) | ftsFieldGroupProximity -> ^( FG_PROXIMITY ftsFieldGroupProximity ) | ftsFieldGroupRange -> ^( FG_RANGE ftsFieldGroupRange ) | ftsFieldGroup | LPAREN ftsImplicitConjunctionOrDisjunction RPAREN -> ftsImplicitConjunctionOrDisjunction );
+ public final FTSParser.ftsTest_return ftsTest() throws RecognitionException {
+ FTSParser.ftsTest_return retval = new FTSParser.ftsTest_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token LPAREN22=null;
+ Token RPAREN24=null;
+ FTSParser.ftsTerm_return ftsTerm15 = null;
+
+ FTSParser.ftsExactTerm_return ftsExactTerm16 = null;
+
+ FTSParser.ftsPhrase_return ftsPhrase17 = null;
+
+ FTSParser.ftsSynonym_return ftsSynonym18 = null;
+
+ FTSParser.ftsFieldGroupProximity_return ftsFieldGroupProximity19 = null;
+
+ FTSParser.ftsFieldGroupRange_return ftsFieldGroupRange20 = null;
+
+ FTSParser.ftsFieldGroup_return ftsFieldGroup21 = null;
+
+ FTSParser.ftsImplicitConjunctionOrDisjunction_return ftsImplicitConjunctionOrDisjunction23 = null;
+
+
+ Object LPAREN22_tree=null;
+ Object RPAREN24_tree=null;
+ RewriteRuleTokenStream stream_RPAREN=new RewriteRuleTokenStream(adaptor,"token RPAREN");
+ RewriteRuleTokenStream stream_LPAREN=new RewriteRuleTokenStream(adaptor,"token LPAREN");
+ RewriteRuleSubtreeStream stream_ftsFieldGroupRange=new RewriteRuleSubtreeStream(adaptor,"rule ftsFieldGroupRange");
+ RewriteRuleSubtreeStream stream_ftsTerm=new RewriteRuleSubtreeStream(adaptor,"rule ftsTerm");
+ RewriteRuleSubtreeStream stream_ftsExactTerm=new RewriteRuleSubtreeStream(adaptor,"rule ftsExactTerm");
+ RewriteRuleSubtreeStream stream_ftsImplicitConjunctionOrDisjunction=new RewriteRuleSubtreeStream(adaptor,"rule ftsImplicitConjunctionOrDisjunction");
+ RewriteRuleSubtreeStream stream_ftsPhrase=new RewriteRuleSubtreeStream(adaptor,"rule ftsPhrase");
+ RewriteRuleSubtreeStream stream_ftsSynonym=new RewriteRuleSubtreeStream(adaptor,"rule ftsSynonym");
+ RewriteRuleSubtreeStream stream_ftsFieldGroupProximity=new RewriteRuleSubtreeStream(adaptor,"rule ftsFieldGroupProximity");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:113:9: ( ftsTerm -> ^( TERM ftsTerm ) | ftsExactTerm -> ^( EXACT_TERM ftsExactTerm ) | ftsPhrase -> ^( PHRASE ftsPhrase ) | ftsSynonym -> ^( SYNONYM ftsSynonym ) | ftsFieldGroupProximity -> ^( FG_PROXIMITY ftsFieldGroupProximity ) | ftsFieldGroupRange -> ^( FG_RANGE ftsFieldGroupRange ) | ftsFieldGroup | LPAREN ftsImplicitConjunctionOrDisjunction RPAREN -> ftsImplicitConjunctionOrDisjunction )
+ int alt7=8;
+ alt7 = dfa7.predict(input);
+ switch (alt7) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:113:11: ftsTerm
+ {
+ pushFollow(FOLLOW_ftsTerm_in_ftsTest301);
+ ftsTerm15=ftsTerm();
+
+ state._fsp--;
+
+ stream_ftsTerm.add(ftsTerm15.getTree());
+
+
+ // AST REWRITE
+ // elements: ftsTerm
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 114:3: -> ^( TERM ftsTerm )
+ {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:114:6: ^( TERM ftsTerm )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(TERM, "TERM"), root_1);
+
+ adaptor.addChild(root_1, stream_ftsTerm.nextTree());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:115:4: ftsExactTerm
+ {
+ pushFollow(FOLLOW_ftsExactTerm_in_ftsTest316);
+ ftsExactTerm16=ftsExactTerm();
+
+ state._fsp--;
+
+ stream_ftsExactTerm.add(ftsExactTerm16.getTree());
+
+
+ // AST REWRITE
+ // elements: ftsExactTerm
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 116:3: -> ^( EXACT_TERM ftsExactTerm )
+ {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:116:6: ^( EXACT_TERM ftsExactTerm )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(EXACT_TERM, "EXACT_TERM"), root_1);
+
+ adaptor.addChild(root_1, stream_ftsExactTerm.nextTree());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+ break;
+ case 3 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:117:17: ftsPhrase
+ {
+ pushFollow(FOLLOW_ftsPhrase_in_ftsTest344);
+ ftsPhrase17=ftsPhrase();
+
+ state._fsp--;
+
+ stream_ftsPhrase.add(ftsPhrase17.getTree());
+
+
+ // AST REWRITE
+ // elements: ftsPhrase
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 118:10: -> ^( PHRASE ftsPhrase )
+ {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:118:13: ^( PHRASE ftsPhrase )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(PHRASE, "PHRASE"), root_1);
+
+ adaptor.addChild(root_1, stream_ftsPhrase.nextTree());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+ break;
+ case 4 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:119:17: ftsSynonym
+ {
+ pushFollow(FOLLOW_ftsSynonym_in_ftsTest379);
+ ftsSynonym18=ftsSynonym();
+
+ state._fsp--;
+
+ stream_ftsSynonym.add(ftsSynonym18.getTree());
+
+
+ // AST REWRITE
+ // elements: ftsSynonym
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 120:10: -> ^( SYNONYM ftsSynonym )
+ {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:120:13: ^( SYNONYM ftsSynonym )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(SYNONYM, "SYNONYM"), root_1);
+
+ adaptor.addChild(root_1, stream_ftsSynonym.nextTree());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+ break;
+ case 5 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:121:11: ftsFieldGroupProximity
+ {
+ pushFollow(FOLLOW_ftsFieldGroupProximity_in_ftsTest408);
+ ftsFieldGroupProximity19=ftsFieldGroupProximity();
+
+ state._fsp--;
+
+ stream_ftsFieldGroupProximity.add(ftsFieldGroupProximity19.getTree());
+
+
+ // AST REWRITE
+ // elements: ftsFieldGroupProximity
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 122:10: -> ^( FG_PROXIMITY ftsFieldGroupProximity )
+ {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:122:13: ^( FG_PROXIMITY ftsFieldGroupProximity )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(FG_PROXIMITY, "FG_PROXIMITY"), root_1);
+
+ adaptor.addChild(root_1, stream_ftsFieldGroupProximity.nextTree());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+ break;
+ case 6 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:123:12: ftsFieldGroupRange
+ {
+ pushFollow(FOLLOW_ftsFieldGroupRange_in_ftsTest440);
+ ftsFieldGroupRange20=ftsFieldGroupRange();
+
+ state._fsp--;
+
+ stream_ftsFieldGroupRange.add(ftsFieldGroupRange20.getTree());
+
+
+ // AST REWRITE
+ // elements: ftsFieldGroupRange
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 124:10: -> ^( FG_RANGE ftsFieldGroupRange )
+ {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:124:13: ^( FG_RANGE ftsFieldGroupRange )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(FG_RANGE, "FG_RANGE"), root_1);
+
+ adaptor.addChild(root_1, stream_ftsFieldGroupRange.nextTree());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+ break;
+ case 7 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:125:11: ftsFieldGroup
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_ftsFieldGroup_in_ftsTest469);
+ ftsFieldGroup21=ftsFieldGroup();
+
+ state._fsp--;
+
+ adaptor.addChild(root_0, ftsFieldGroup21.getTree());
+
+ }
+ break;
+ case 8 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:126:4: LPAREN ftsImplicitConjunctionOrDisjunction RPAREN
+ {
+ LPAREN22=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_ftsTest478);
+ stream_LPAREN.add(LPAREN22);
+
+ pushFollow(FOLLOW_ftsImplicitConjunctionOrDisjunction_in_ftsTest480);
+ ftsImplicitConjunctionOrDisjunction23=ftsImplicitConjunctionOrDisjunction();
+
+ state._fsp--;
+
+ stream_ftsImplicitConjunctionOrDisjunction.add(ftsImplicitConjunctionOrDisjunction23.getTree());
+ RPAREN24=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_ftsTest482);
+ stream_RPAREN.add(RPAREN24);
+
+
+
+ // AST REWRITE
+ // elements: ftsImplicitConjunctionOrDisjunction
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 127:3: -> ftsImplicitConjunctionOrDisjunction
+ {
+ adaptor.addChild(root_0, stream_ftsImplicitConjunctionOrDisjunction.nextTree());
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end ftsTest
+
+ public static class ftsTerm_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start ftsTerm
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:130:1: ftsTerm : ( columnReference COLON )? FTSWORD -> FTSWORD ( columnReference )? ;
+ public final FTSParser.ftsTerm_return ftsTerm() throws RecognitionException {
+ FTSParser.ftsTerm_return retval = new FTSParser.ftsTerm_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token COLON26=null;
+ Token FTSWORD27=null;
+ FTSParser.columnReference_return columnReference25 = null;
+
+
+ Object COLON26_tree=null;
+ Object FTSWORD27_tree=null;
+ RewriteRuleTokenStream stream_COLON=new RewriteRuleTokenStream(adaptor,"token COLON");
+ RewriteRuleTokenStream stream_FTSWORD=new RewriteRuleTokenStream(adaptor,"token FTSWORD");
+ RewriteRuleSubtreeStream stream_columnReference=new RewriteRuleSubtreeStream(adaptor,"rule columnReference");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:131:2: ( ( columnReference COLON )? FTSWORD -> FTSWORD ( columnReference )? )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:131:4: ( columnReference COLON )? FTSWORD
+ {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:131:4: ( columnReference COLON )?
+ int alt8=2;
+ int LA8_0 = input.LA(1);
+
+ if ( (LA8_0==ID) ) {
+ alt8=1;
+ }
+ switch (alt8) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:131:5: columnReference COLON
+ {
+ pushFollow(FOLLOW_columnReference_in_ftsTerm500);
+ columnReference25=columnReference();
+
+ state._fsp--;
+
+ stream_columnReference.add(columnReference25.getTree());
+ COLON26=(Token)match(input,COLON,FOLLOW_COLON_in_ftsTerm502);
+ stream_COLON.add(COLON26);
+
+
+ }
+ break;
+
+ }
+
+ FTSWORD27=(Token)match(input,FTSWORD,FOLLOW_FTSWORD_in_ftsTerm506);
+ stream_FTSWORD.add(FTSWORD27);
+
+
+
+ // AST REWRITE
+ // elements: FTSWORD, columnReference
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 132:3: -> FTSWORD ( columnReference )?
+ {
+ adaptor.addChild(root_0, stream_FTSWORD.nextNode());
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:132:14: ( columnReference )?
+ if ( stream_columnReference.hasNext() ) {
+ adaptor.addChild(root_0, stream_columnReference.nextTree());
+
+ }
+ stream_columnReference.reset();
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+
+ retval.stop = input.LT(-1);
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end ftsTerm
+
+ public static class ftsExactTerm_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start ftsExactTerm
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:135:1: ftsExactTerm : PLUS ftsTerm -> ftsTerm ;
+ public final FTSParser.ftsExactTerm_return ftsExactTerm() throws RecognitionException {
+ FTSParser.ftsExactTerm_return retval = new FTSParser.ftsExactTerm_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token PLUS28=null;
+ FTSParser.ftsTerm_return ftsTerm29 = null;
+
+
+ Object PLUS28_tree=null;
+ RewriteRuleTokenStream stream_PLUS=new RewriteRuleTokenStream(adaptor,"token PLUS");
+ RewriteRuleSubtreeStream stream_ftsTerm=new RewriteRuleSubtreeStream(adaptor,"rule ftsTerm");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:136:2: ( PLUS ftsTerm -> ftsTerm )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:136:4: PLUS ftsTerm
+ {
+ PLUS28=(Token)match(input,PLUS,FOLLOW_PLUS_in_ftsExactTerm527);
+ stream_PLUS.add(PLUS28);
+
+ pushFollow(FOLLOW_ftsTerm_in_ftsExactTerm529);
+ ftsTerm29=ftsTerm();
+
+ state._fsp--;
+
+ stream_ftsTerm.add(ftsTerm29.getTree());
+
+
+ // AST REWRITE
+ // elements: ftsTerm
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 137:3: -> ftsTerm
+ {
+ adaptor.addChild(root_0, stream_ftsTerm.nextTree());
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+
+ retval.stop = input.LT(-1);
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end ftsExactTerm
+
+ public static class ftsPhrase_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start ftsPhrase
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:140:1: ftsPhrase : ( columnReference COLON )? FTSPHRASE -> FTSPHRASE ( columnReference )? ;
+ public final FTSParser.ftsPhrase_return ftsPhrase() throws RecognitionException {
+ FTSParser.ftsPhrase_return retval = new FTSParser.ftsPhrase_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token COLON31=null;
+ Token FTSPHRASE32=null;
+ FTSParser.columnReference_return columnReference30 = null;
+
+
+ Object COLON31_tree=null;
+ Object FTSPHRASE32_tree=null;
+ RewriteRuleTokenStream stream_COLON=new RewriteRuleTokenStream(adaptor,"token COLON");
+ RewriteRuleTokenStream stream_FTSPHRASE=new RewriteRuleTokenStream(adaptor,"token FTSPHRASE");
+ RewriteRuleSubtreeStream stream_columnReference=new RewriteRuleSubtreeStream(adaptor,"rule columnReference");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:141:2: ( ( columnReference COLON )? FTSPHRASE -> FTSPHRASE ( columnReference )? )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:141:6: ( columnReference COLON )? FTSPHRASE
+ {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:141:6: ( columnReference COLON )?
+ int alt9=2;
+ int LA9_0 = input.LA(1);
+
+ if ( (LA9_0==ID) ) {
+ alt9=1;
+ }
+ switch (alt9) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:141:7: columnReference COLON
+ {
+ pushFollow(FOLLOW_columnReference_in_ftsPhrase550);
+ columnReference30=columnReference();
+
+ state._fsp--;
+
+ stream_columnReference.add(columnReference30.getTree());
+ COLON31=(Token)match(input,COLON,FOLLOW_COLON_in_ftsPhrase552);
+ stream_COLON.add(COLON31);
+
+
+ }
+ break;
+
+ }
+
+ FTSPHRASE32=(Token)match(input,FTSPHRASE,FOLLOW_FTSPHRASE_in_ftsPhrase556);
+ stream_FTSPHRASE.add(FTSPHRASE32);
+
+
+
+ // AST REWRITE
+ // elements: columnReference, FTSPHRASE
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 142:3: -> FTSPHRASE ( columnReference )?
+ {
+ adaptor.addChild(root_0, stream_FTSPHRASE.nextNode());
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:142:16: ( columnReference )?
+ if ( stream_columnReference.hasNext() ) {
+ adaptor.addChild(root_0, stream_columnReference.nextTree());
+
+ }
+ stream_columnReference.reset();
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+
+ retval.stop = input.LT(-1);
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end ftsPhrase
+
+ public static class ftsSynonym_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start ftsSynonym
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:145:1: ftsSynonym : TILDA ftsTerm -> ftsTerm ;
+ public final FTSParser.ftsSynonym_return ftsSynonym() throws RecognitionException {
+ FTSParser.ftsSynonym_return retval = new FTSParser.ftsSynonym_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token TILDA33=null;
+ FTSParser.ftsTerm_return ftsTerm34 = null;
+
+
+ Object TILDA33_tree=null;
+ RewriteRuleTokenStream stream_TILDA=new RewriteRuleTokenStream(adaptor,"token TILDA");
+ RewriteRuleSubtreeStream stream_ftsTerm=new RewriteRuleSubtreeStream(adaptor,"rule ftsTerm");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:146:2: ( TILDA ftsTerm -> ftsTerm )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:146:4: TILDA ftsTerm
+ {
+ TILDA33=(Token)match(input,TILDA,FOLLOW_TILDA_in_ftsSynonym577);
+ stream_TILDA.add(TILDA33);
+
+ pushFollow(FOLLOW_ftsTerm_in_ftsSynonym579);
+ ftsTerm34=ftsTerm();
+
+ state._fsp--;
+
+ stream_ftsTerm.add(ftsTerm34.getTree());
+
+
+ // AST REWRITE
+ // elements: ftsTerm
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 147:3: -> ftsTerm
+ {
+ adaptor.addChild(root_0, stream_ftsTerm.nextTree());
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+
+ retval.stop = input.LT(-1);
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end ftsSynonym
+
+ public static class ftsFieldGroup_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start ftsFieldGroup
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:151:1: ftsFieldGroup : columnReference COLON LPAREN ftsFieldGroupImplicitConjunctionOrDisjunction RPAREN -> ^( FIELD_GROUP columnReference ftsFieldGroupImplicitConjunctionOrDisjunction ) ;
+ public final FTSParser.ftsFieldGroup_return ftsFieldGroup() throws RecognitionException {
+ FTSParser.ftsFieldGroup_return retval = new FTSParser.ftsFieldGroup_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token COLON36=null;
+ Token LPAREN37=null;
+ Token RPAREN39=null;
+ FTSParser.columnReference_return columnReference35 = null;
+
+ FTSParser.ftsFieldGroupImplicitConjunctionOrDisjunction_return ftsFieldGroupImplicitConjunctionOrDisjunction38 = null;
+
+
+ Object COLON36_tree=null;
+ Object LPAREN37_tree=null;
+ Object RPAREN39_tree=null;
+ RewriteRuleTokenStream stream_COLON=new RewriteRuleTokenStream(adaptor,"token COLON");
+ RewriteRuleTokenStream stream_RPAREN=new RewriteRuleTokenStream(adaptor,"token RPAREN");
+ RewriteRuleTokenStream stream_LPAREN=new RewriteRuleTokenStream(adaptor,"token LPAREN");
+ RewriteRuleSubtreeStream stream_columnReference=new RewriteRuleSubtreeStream(adaptor,"rule columnReference");
+ RewriteRuleSubtreeStream stream_ftsFieldGroupImplicitConjunctionOrDisjunction=new RewriteRuleSubtreeStream(adaptor,"rule ftsFieldGroupImplicitConjunctionOrDisjunction");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:152:2: ( columnReference COLON LPAREN ftsFieldGroupImplicitConjunctionOrDisjunction RPAREN -> ^( FIELD_GROUP columnReference ftsFieldGroupImplicitConjunctionOrDisjunction ) )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:152:4: columnReference COLON LPAREN ftsFieldGroupImplicitConjunctionOrDisjunction RPAREN
+ {
+ pushFollow(FOLLOW_columnReference_in_ftsFieldGroup598);
+ columnReference35=columnReference();
+
+ state._fsp--;
+
+ stream_columnReference.add(columnReference35.getTree());
+ COLON36=(Token)match(input,COLON,FOLLOW_COLON_in_ftsFieldGroup600);
+ stream_COLON.add(COLON36);
+
+ LPAREN37=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_ftsFieldGroup602);
+ stream_LPAREN.add(LPAREN37);
+
+ pushFollow(FOLLOW_ftsFieldGroupImplicitConjunctionOrDisjunction_in_ftsFieldGroup604);
+ ftsFieldGroupImplicitConjunctionOrDisjunction38=ftsFieldGroupImplicitConjunctionOrDisjunction();
+
+ state._fsp--;
+
+ stream_ftsFieldGroupImplicitConjunctionOrDisjunction.add(ftsFieldGroupImplicitConjunctionOrDisjunction38.getTree());
+ RPAREN39=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_ftsFieldGroup606);
+ stream_RPAREN.add(RPAREN39);
+
+
+
+ // AST REWRITE
+ // elements: columnReference, ftsFieldGroupImplicitConjunctionOrDisjunction
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 153:3: -> ^( FIELD_GROUP columnReference ftsFieldGroupImplicitConjunctionOrDisjunction )
+ {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:153:6: ^( FIELD_GROUP columnReference ftsFieldGroupImplicitConjunctionOrDisjunction )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(FIELD_GROUP, "FIELD_GROUP"), root_1);
+
+ adaptor.addChild(root_1, stream_columnReference.nextTree());
+ adaptor.addChild(root_1, stream_ftsFieldGroupImplicitConjunctionOrDisjunction.nextTree());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+
+ retval.stop = input.LT(-1);
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end ftsFieldGroup
+
+ public static class ftsFieldGroupImplicitConjunctionOrDisjunction_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start ftsFieldGroupImplicitConjunctionOrDisjunction
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:156:1: ftsFieldGroupImplicitConjunctionOrDisjunction : ({...}? ftsFieldGroupExplicitDisjunction ( ftsFieldGroupExplicitDisjunction )* -> ^( FIELD_CONJUNCTION ( ftsFieldGroupExplicitDisjunction )+ ) | ftsFieldGroupExplicitDisjunction ( ftsFieldGroupExplicitDisjunction )* -> ^( FIELD_DISJUNCTION ( ftsFieldGroupExplicitDisjunction )+ ) );
+ public final FTSParser.ftsFieldGroupImplicitConjunctionOrDisjunction_return ftsFieldGroupImplicitConjunctionOrDisjunction() throws RecognitionException {
+ FTSParser.ftsFieldGroupImplicitConjunctionOrDisjunction_return retval = new FTSParser.ftsFieldGroupImplicitConjunctionOrDisjunction_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ FTSParser.ftsFieldGroupExplicitDisjunction_return ftsFieldGroupExplicitDisjunction40 = null;
+
+ FTSParser.ftsFieldGroupExplicitDisjunction_return ftsFieldGroupExplicitDisjunction41 = null;
+
+ FTSParser.ftsFieldGroupExplicitDisjunction_return ftsFieldGroupExplicitDisjunction42 = null;
+
+ FTSParser.ftsFieldGroupExplicitDisjunction_return ftsFieldGroupExplicitDisjunction43 = null;
+
+
+ RewriteRuleSubtreeStream stream_ftsFieldGroupExplicitDisjunction=new RewriteRuleSubtreeStream(adaptor,"rule ftsFieldGroupExplicitDisjunction");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:157:2: ({...}? ftsFieldGroupExplicitDisjunction ( ftsFieldGroupExplicitDisjunction )* -> ^( FIELD_CONJUNCTION ( ftsFieldGroupExplicitDisjunction )+ ) | ftsFieldGroupExplicitDisjunction ( ftsFieldGroupExplicitDisjunction )* -> ^( FIELD_DISJUNCTION ( ftsFieldGroupExplicitDisjunction )+ ) )
+ int alt12=2;
+ switch ( input.LA(1) ) {
+ case MINUS:
+ {
+ int LA12_1 = input.LA(2);
+
+ if ( (defaultFieldConjunction()) ) {
+ alt12=1;
+ }
+ else if ( (true) ) {
+ alt12=2;
+ }
+ else {
+ NoViableAltException nvae =
+ new NoViableAltException("", 12, 1, input);
+
+ throw nvae;
+ }
+ }
+ break;
+ case FTSWORD:
+ {
+ int LA12_2 = input.LA(2);
+
+ if ( (defaultFieldConjunction()) ) {
+ alt12=1;
+ }
+ else if ( (true) ) {
+ alt12=2;
+ }
+ else {
+ NoViableAltException nvae =
+ new NoViableAltException("", 12, 2, input);
+
+ throw nvae;
+ }
+ }
+ break;
+ case PLUS:
+ {
+ int LA12_3 = input.LA(2);
+
+ if ( (defaultFieldConjunction()) ) {
+ alt12=1;
+ }
+ else if ( (true) ) {
+ alt12=2;
+ }
+ else {
+ NoViableAltException nvae =
+ new NoViableAltException("", 12, 3, input);
+
+ throw nvae;
+ }
+ }
+ break;
+ case FTSPHRASE:
+ {
+ int LA12_4 = input.LA(2);
+
+ if ( (defaultFieldConjunction()) ) {
+ alt12=1;
+ }
+ else if ( (true) ) {
+ alt12=2;
+ }
+ else {
+ NoViableAltException nvae =
+ new NoViableAltException("", 12, 4, input);
+
+ throw nvae;
+ }
+ }
+ break;
+ case TILDA:
+ {
+ int LA12_5 = input.LA(2);
+
+ if ( (defaultFieldConjunction()) ) {
+ alt12=1;
+ }
+ else if ( (true) ) {
+ alt12=2;
+ }
+ else {
+ NoViableAltException nvae =
+ new NoViableAltException("", 12, 5, input);
+
+ throw nvae;
+ }
+ }
+ break;
+ case LPAREN:
+ {
+ int LA12_6 = input.LA(2);
+
+ if ( (defaultFieldConjunction()) ) {
+ alt12=1;
+ }
+ else if ( (true) ) {
+ alt12=2;
+ }
+ else {
+ NoViableAltException nvae =
+ new NoViableAltException("", 12, 6, input);
+
+ throw nvae;
+ }
+ }
+ break;
+ default:
+ NoViableAltException nvae =
+ new NoViableAltException("", 12, 0, input);
+
+ throw nvae;
+ }
+
+ switch (alt12) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:157:4: {...}? ftsFieldGroupExplicitDisjunction ( ftsFieldGroupExplicitDisjunction )*
+ {
+ if ( !(defaultFieldConjunction()) ) {
+ throw new FailedPredicateException(input, "ftsFieldGroupImplicitConjunctionOrDisjunction", "defaultFieldConjunction()");
+ }
+ pushFollow(FOLLOW_ftsFieldGroupExplicitDisjunction_in_ftsFieldGroupImplicitConjunctionOrDisjunction632);
+ ftsFieldGroupExplicitDisjunction40=ftsFieldGroupExplicitDisjunction();
+
+ state._fsp--;
+
+ stream_ftsFieldGroupExplicitDisjunction.add(ftsFieldGroupExplicitDisjunction40.getTree());
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:157:66: ( ftsFieldGroupExplicitDisjunction )*
+ loop10:
+ do {
+ int alt10=2;
+ int LA10_0 = input.LA(1);
+
+ if ( ((LA10_0>=MINUS && LA10_0<=LPAREN)||(LA10_0>=FTSWORD && LA10_0<=TILDA)) ) {
+ alt10=1;
+ }
+
+
+ switch (alt10) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:157:67: ftsFieldGroupExplicitDisjunction
+ {
+ pushFollow(FOLLOW_ftsFieldGroupExplicitDisjunction_in_ftsFieldGroupImplicitConjunctionOrDisjunction635);
+ ftsFieldGroupExplicitDisjunction41=ftsFieldGroupExplicitDisjunction();
+
+ state._fsp--;
+
+ stream_ftsFieldGroupExplicitDisjunction.add(ftsFieldGroupExplicitDisjunction41.getTree());
+
+ }
+ break;
+
+ default :
+ break loop10;
+ }
+ } while (true);
+
+
+
+ // AST REWRITE
+ // elements: ftsFieldGroupExplicitDisjunction
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 158:3: -> ^( FIELD_CONJUNCTION ( ftsFieldGroupExplicitDisjunction )+ )
+ {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:158:6: ^( FIELD_CONJUNCTION ( ftsFieldGroupExplicitDisjunction )+ )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(FIELD_CONJUNCTION, "FIELD_CONJUNCTION"), root_1);
+
+ if ( !(stream_ftsFieldGroupExplicitDisjunction.hasNext()) ) {
+ throw new RewriteEarlyExitException();
+ }
+ while ( stream_ftsFieldGroupExplicitDisjunction.hasNext() ) {
+ adaptor.addChild(root_1, stream_ftsFieldGroupExplicitDisjunction.nextTree());
+
+ }
+ stream_ftsFieldGroupExplicitDisjunction.reset();
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:159:4: ftsFieldGroupExplicitDisjunction ( ftsFieldGroupExplicitDisjunction )*
+ {
+ pushFollow(FOLLOW_ftsFieldGroupExplicitDisjunction_in_ftsFieldGroupImplicitConjunctionOrDisjunction653);
+ ftsFieldGroupExplicitDisjunction42=ftsFieldGroupExplicitDisjunction();
+
+ state._fsp--;
+
+ stream_ftsFieldGroupExplicitDisjunction.add(ftsFieldGroupExplicitDisjunction42.getTree());
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:159:37: ( ftsFieldGroupExplicitDisjunction )*
+ loop11:
+ do {
+ int alt11=2;
+ int LA11_0 = input.LA(1);
+
+ if ( ((LA11_0>=MINUS && LA11_0<=LPAREN)||(LA11_0>=FTSWORD && LA11_0<=TILDA)) ) {
+ alt11=1;
+ }
+
+
+ switch (alt11) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:159:38: ftsFieldGroupExplicitDisjunction
+ {
+ pushFollow(FOLLOW_ftsFieldGroupExplicitDisjunction_in_ftsFieldGroupImplicitConjunctionOrDisjunction656);
+ ftsFieldGroupExplicitDisjunction43=ftsFieldGroupExplicitDisjunction();
+
+ state._fsp--;
+
+ stream_ftsFieldGroupExplicitDisjunction.add(ftsFieldGroupExplicitDisjunction43.getTree());
+
+ }
+ break;
+
+ default :
+ break loop11;
+ }
+ } while (true);
+
+
+
+ // AST REWRITE
+ // elements: ftsFieldGroupExplicitDisjunction
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 160:3: -> ^( FIELD_DISJUNCTION ( ftsFieldGroupExplicitDisjunction )+ )
+ {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:160:6: ^( FIELD_DISJUNCTION ( ftsFieldGroupExplicitDisjunction )+ )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(FIELD_DISJUNCTION, "FIELD_DISJUNCTION"), root_1);
+
+ if ( !(stream_ftsFieldGroupExplicitDisjunction.hasNext()) ) {
+ throw new RewriteEarlyExitException();
+ }
+ while ( stream_ftsFieldGroupExplicitDisjunction.hasNext() ) {
+ adaptor.addChild(root_1, stream_ftsFieldGroupExplicitDisjunction.nextTree());
+
+ }
+ stream_ftsFieldGroupExplicitDisjunction.reset();
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end ftsFieldGroupImplicitConjunctionOrDisjunction
+
+ public static class ftsFieldGroupExplicitDisjunction_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start ftsFieldGroupExplicitDisjunction
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:163:1: ftsFieldGroupExplicitDisjunction : ftsFieldGroupExplictConjunction ( OR ftsFieldGroupExplictConjunction )* -> ^( FIELD_DISJUNCTION ( ftsFieldGroupExplictConjunction )+ ) ;
+ public final FTSParser.ftsFieldGroupExplicitDisjunction_return ftsFieldGroupExplicitDisjunction() throws RecognitionException {
+ FTSParser.ftsFieldGroupExplicitDisjunction_return retval = new FTSParser.ftsFieldGroupExplicitDisjunction_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token OR45=null;
+ FTSParser.ftsFieldGroupExplictConjunction_return ftsFieldGroupExplictConjunction44 = null;
+
+ FTSParser.ftsFieldGroupExplictConjunction_return ftsFieldGroupExplictConjunction46 = null;
+
+
+ Object OR45_tree=null;
+ RewriteRuleTokenStream stream_OR=new RewriteRuleTokenStream(adaptor,"token OR");
+ RewriteRuleSubtreeStream stream_ftsFieldGroupExplictConjunction=new RewriteRuleSubtreeStream(adaptor,"rule ftsFieldGroupExplictConjunction");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:164:2: ( ftsFieldGroupExplictConjunction ( OR ftsFieldGroupExplictConjunction )* -> ^( FIELD_DISJUNCTION ( ftsFieldGroupExplictConjunction )+ ) )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:164:4: ftsFieldGroupExplictConjunction ( OR ftsFieldGroupExplictConjunction )*
+ {
+ pushFollow(FOLLOW_ftsFieldGroupExplictConjunction_in_ftsFieldGroupExplicitDisjunction681);
+ ftsFieldGroupExplictConjunction44=ftsFieldGroupExplictConjunction();
+
+ state._fsp--;
+
+ stream_ftsFieldGroupExplictConjunction.add(ftsFieldGroupExplictConjunction44.getTree());
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:164:36: ( OR ftsFieldGroupExplictConjunction )*
+ loop13:
+ do {
+ int alt13=2;
+ int LA13_0 = input.LA(1);
+
+ if ( (LA13_0==OR) ) {
+ alt13=1;
+ }
+
+
+ switch (alt13) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:164:37: OR ftsFieldGroupExplictConjunction
+ {
+ OR45=(Token)match(input,OR,FOLLOW_OR_in_ftsFieldGroupExplicitDisjunction684);
+ stream_OR.add(OR45);
+
+ pushFollow(FOLLOW_ftsFieldGroupExplictConjunction_in_ftsFieldGroupExplicitDisjunction686);
+ ftsFieldGroupExplictConjunction46=ftsFieldGroupExplictConjunction();
+
+ state._fsp--;
+
+ stream_ftsFieldGroupExplictConjunction.add(ftsFieldGroupExplictConjunction46.getTree());
+
+ }
+ break;
+
+ default :
+ break loop13;
+ }
+ } while (true);
+
+
+
+ // AST REWRITE
+ // elements: ftsFieldGroupExplictConjunction
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 165:3: -> ^( FIELD_DISJUNCTION ( ftsFieldGroupExplictConjunction )+ )
+ {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:165:6: ^( FIELD_DISJUNCTION ( ftsFieldGroupExplictConjunction )+ )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(FIELD_DISJUNCTION, "FIELD_DISJUNCTION"), root_1);
+
+ if ( !(stream_ftsFieldGroupExplictConjunction.hasNext()) ) {
+ throw new RewriteEarlyExitException();
+ }
+ while ( stream_ftsFieldGroupExplictConjunction.hasNext() ) {
+ adaptor.addChild(root_1, stream_ftsFieldGroupExplictConjunction.nextTree());
+
+ }
+ stream_ftsFieldGroupExplictConjunction.reset();
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+
+ retval.stop = input.LT(-1);
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end ftsFieldGroupExplicitDisjunction
+
+ public static class ftsFieldGroupExplictConjunction_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start ftsFieldGroupExplictConjunction
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:168:1: ftsFieldGroupExplictConjunction : ftsFieldGroupNot ( AND ftsFieldGroupNot )* -> ^( FIELD_CONJUNCTION ( ftsFieldGroupNot )+ ) ;
+ public final FTSParser.ftsFieldGroupExplictConjunction_return ftsFieldGroupExplictConjunction() throws RecognitionException {
+ FTSParser.ftsFieldGroupExplictConjunction_return retval = new FTSParser.ftsFieldGroupExplictConjunction_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token AND48=null;
+ FTSParser.ftsFieldGroupNot_return ftsFieldGroupNot47 = null;
+
+ FTSParser.ftsFieldGroupNot_return ftsFieldGroupNot49 = null;
+
+
+ Object AND48_tree=null;
+ RewriteRuleTokenStream stream_AND=new RewriteRuleTokenStream(adaptor,"token AND");
+ RewriteRuleSubtreeStream stream_ftsFieldGroupNot=new RewriteRuleSubtreeStream(adaptor,"rule ftsFieldGroupNot");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:169:2: ( ftsFieldGroupNot ( AND ftsFieldGroupNot )* -> ^( FIELD_CONJUNCTION ( ftsFieldGroupNot )+ ) )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:169:4: ftsFieldGroupNot ( AND ftsFieldGroupNot )*
+ {
+ pushFollow(FOLLOW_ftsFieldGroupNot_in_ftsFieldGroupExplictConjunction711);
+ ftsFieldGroupNot47=ftsFieldGroupNot();
+
+ state._fsp--;
+
+ stream_ftsFieldGroupNot.add(ftsFieldGroupNot47.getTree());
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:169:21: ( AND ftsFieldGroupNot )*
+ loop14:
+ do {
+ int alt14=2;
+ int LA14_0 = input.LA(1);
+
+ if ( (LA14_0==AND) ) {
+ alt14=1;
+ }
+
+
+ switch (alt14) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:169:22: AND ftsFieldGroupNot
+ {
+ AND48=(Token)match(input,AND,FOLLOW_AND_in_ftsFieldGroupExplictConjunction714);
+ stream_AND.add(AND48);
+
+ pushFollow(FOLLOW_ftsFieldGroupNot_in_ftsFieldGroupExplictConjunction716);
+ ftsFieldGroupNot49=ftsFieldGroupNot();
+
+ state._fsp--;
+
+ stream_ftsFieldGroupNot.add(ftsFieldGroupNot49.getTree());
+
+ }
+ break;
+
+ default :
+ break loop14;
+ }
+ } while (true);
+
+
+
+ // AST REWRITE
+ // elements: ftsFieldGroupNot
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 170:3: -> ^( FIELD_CONJUNCTION ( ftsFieldGroupNot )+ )
+ {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:170:6: ^( FIELD_CONJUNCTION ( ftsFieldGroupNot )+ )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(FIELD_CONJUNCTION, "FIELD_CONJUNCTION"), root_1);
+
+ if ( !(stream_ftsFieldGroupNot.hasNext()) ) {
+ throw new RewriteEarlyExitException();
+ }
+ while ( stream_ftsFieldGroupNot.hasNext() ) {
+ adaptor.addChild(root_1, stream_ftsFieldGroupNot.nextTree());
+
+ }
+ stream_ftsFieldGroupNot.reset();
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+
+ retval.stop = input.LT(-1);
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end ftsFieldGroupExplictConjunction
+
+ public static class ftsFieldGroupNot_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start ftsFieldGroupNot
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:174:1: ftsFieldGroupNot : ( MINUS ftsFieldGroupTest -> FIELD_NEGATION ftsFieldGroupTest | ftsFieldGroupTest -> ftsFieldGroupTest );
+ public final FTSParser.ftsFieldGroupNot_return ftsFieldGroupNot() throws RecognitionException {
+ FTSParser.ftsFieldGroupNot_return retval = new FTSParser.ftsFieldGroupNot_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token MINUS50=null;
+ FTSParser.ftsFieldGroupTest_return ftsFieldGroupTest51 = null;
+
+ FTSParser.ftsFieldGroupTest_return ftsFieldGroupTest52 = null;
+
+
+ Object MINUS50_tree=null;
+ RewriteRuleTokenStream stream_MINUS=new RewriteRuleTokenStream(adaptor,"token MINUS");
+ RewriteRuleSubtreeStream stream_ftsFieldGroupTest=new RewriteRuleSubtreeStream(adaptor,"rule ftsFieldGroupTest");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:174:19: ( MINUS ftsFieldGroupTest -> FIELD_NEGATION ftsFieldGroupTest | ftsFieldGroupTest -> ftsFieldGroupTest )
+ int alt15=2;
+ int LA15_0 = input.LA(1);
+
+ if ( (LA15_0==MINUS) ) {
+ alt15=1;
+ }
+ else if ( (LA15_0==LPAREN||(LA15_0>=FTSWORD && LA15_0<=TILDA)) ) {
+ alt15=2;
+ }
+ else {
+ NoViableAltException nvae =
+ new NoViableAltException("", 15, 0, input);
+
+ throw nvae;
+ }
+ switch (alt15) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:174:21: MINUS ftsFieldGroupTest
+ {
+ MINUS50=(Token)match(input,MINUS,FOLLOW_MINUS_in_ftsFieldGroupNot743);
+ stream_MINUS.add(MINUS50);
+
+ pushFollow(FOLLOW_ftsFieldGroupTest_in_ftsFieldGroupNot745);
+ ftsFieldGroupTest51=ftsFieldGroupTest();
+
+ state._fsp--;
+
+ stream_ftsFieldGroupTest.add(ftsFieldGroupTest51.getTree());
+
+
+ // AST REWRITE
+ // elements: ftsFieldGroupTest
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 175:4: -> FIELD_NEGATION ftsFieldGroupTest
+ {
+ adaptor.addChild(root_0, (Object)adaptor.create(FIELD_NEGATION, "FIELD_NEGATION"));
+ adaptor.addChild(root_0, stream_ftsFieldGroupTest.nextTree());
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:176:5: ftsFieldGroupTest
+ {
+ pushFollow(FOLLOW_ftsFieldGroupTest_in_ftsFieldGroupNot760);
+ ftsFieldGroupTest52=ftsFieldGroupTest();
+
+ state._fsp--;
+
+ stream_ftsFieldGroupTest.add(ftsFieldGroupTest52.getTree());
+
+
+ // AST REWRITE
+ // elements: ftsFieldGroupTest
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 177:4: -> ftsFieldGroupTest
+ {
+ adaptor.addChild(root_0, stream_ftsFieldGroupTest.nextTree());
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end ftsFieldGroupNot
+
+ public static class ftsFieldGroupTest_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start ftsFieldGroupTest
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:181:1: ftsFieldGroupTest : ( ftsFieldGroupTerm -> ^( FG_TERM ftsFieldGroupTerm ) | ftsFieldGroupExactTerm -> ^( FG_EXACT_TERM ftsFieldGroupExactTerm ) | ftsFieldGroupPhrase -> ^( FG_PHRASE ftsFieldGroupPhrase ) | ftsFieldGroupSynonym -> ^( FG_SYNONYM ftsFieldGroupSynonym ) | ftsFieldGroupProximity -> ^( FG_PROXIMITY ftsFieldGroupProximity ) | ftsFieldGroupRange -> ^( FG_RANGE ftsFieldGroupRange ) | LPAREN ftsFieldGroupImplicitConjunctionOrDisjunction RPAREN -> ftsFieldGroupImplicitConjunctionOrDisjunction );
+ public final FTSParser.ftsFieldGroupTest_return ftsFieldGroupTest() throws RecognitionException {
+ FTSParser.ftsFieldGroupTest_return retval = new FTSParser.ftsFieldGroupTest_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token LPAREN59=null;
+ Token RPAREN61=null;
+ FTSParser.ftsFieldGroupTerm_return ftsFieldGroupTerm53 = null;
+
+ FTSParser.ftsFieldGroupExactTerm_return ftsFieldGroupExactTerm54 = null;
+
+ FTSParser.ftsFieldGroupPhrase_return ftsFieldGroupPhrase55 = null;
+
+ FTSParser.ftsFieldGroupSynonym_return ftsFieldGroupSynonym56 = null;
+
+ FTSParser.ftsFieldGroupProximity_return ftsFieldGroupProximity57 = null;
+
+ FTSParser.ftsFieldGroupRange_return ftsFieldGroupRange58 = null;
+
+ FTSParser.ftsFieldGroupImplicitConjunctionOrDisjunction_return ftsFieldGroupImplicitConjunctionOrDisjunction60 = null;
+
+
+ Object LPAREN59_tree=null;
+ Object RPAREN61_tree=null;
+ RewriteRuleTokenStream stream_RPAREN=new RewriteRuleTokenStream(adaptor,"token RPAREN");
+ RewriteRuleTokenStream stream_LPAREN=new RewriteRuleTokenStream(adaptor,"token LPAREN");
+ RewriteRuleSubtreeStream stream_ftsFieldGroupRange=new RewriteRuleSubtreeStream(adaptor,"rule ftsFieldGroupRange");
+ RewriteRuleSubtreeStream stream_ftsFieldGroupPhrase=new RewriteRuleSubtreeStream(adaptor,"rule ftsFieldGroupPhrase");
+ RewriteRuleSubtreeStream stream_ftsFieldGroupImplicitConjunctionOrDisjunction=new RewriteRuleSubtreeStream(adaptor,"rule ftsFieldGroupImplicitConjunctionOrDisjunction");
+ RewriteRuleSubtreeStream stream_ftsFieldGroupTerm=new RewriteRuleSubtreeStream(adaptor,"rule ftsFieldGroupTerm");
+ RewriteRuleSubtreeStream stream_ftsFieldGroupSynonym=new RewriteRuleSubtreeStream(adaptor,"rule ftsFieldGroupSynonym");
+ RewriteRuleSubtreeStream stream_ftsFieldGroupExactTerm=new RewriteRuleSubtreeStream(adaptor,"rule ftsFieldGroupExactTerm");
+ RewriteRuleSubtreeStream stream_ftsFieldGroupProximity=new RewriteRuleSubtreeStream(adaptor,"rule ftsFieldGroupProximity");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:182:2: ( ftsFieldGroupTerm -> ^( FG_TERM ftsFieldGroupTerm ) | ftsFieldGroupExactTerm -> ^( FG_EXACT_TERM ftsFieldGroupExactTerm ) | ftsFieldGroupPhrase -> ^( FG_PHRASE ftsFieldGroupPhrase ) | ftsFieldGroupSynonym -> ^( FG_SYNONYM ftsFieldGroupSynonym ) | ftsFieldGroupProximity -> ^( FG_PROXIMITY ftsFieldGroupProximity ) | ftsFieldGroupRange -> ^( FG_RANGE ftsFieldGroupRange ) | LPAREN ftsFieldGroupImplicitConjunctionOrDisjunction RPAREN -> ftsFieldGroupImplicitConjunctionOrDisjunction )
+ int alt16=7;
+ switch ( input.LA(1) ) {
+ case FTSWORD:
+ {
+ switch ( input.LA(2) ) {
+ case STAR:
+ {
+ alt16=5;
+ }
+ break;
+ case OR:
+ case AND:
+ case MINUS:
+ case LPAREN:
+ case RPAREN:
+ case FTSWORD:
+ case PLUS:
+ case FTSPHRASE:
+ case TILDA:
+ {
+ alt16=1;
+ }
+ break;
+ case DOTDOT:
+ {
+ alt16=6;
+ }
+ break;
+ default:
+ NoViableAltException nvae =
+ new NoViableAltException("", 16, 1, input);
+
+ throw nvae;
+ }
+
+ }
+ break;
+ case PLUS:
+ {
+ alt16=2;
+ }
+ break;
+ case FTSPHRASE:
+ {
+ alt16=3;
+ }
+ break;
+ case TILDA:
+ {
+ alt16=4;
+ }
+ break;
+ case LPAREN:
+ {
+ alt16=7;
+ }
+ break;
+ default:
+ NoViableAltException nvae =
+ new NoViableAltException("", 16, 0, input);
+
+ throw nvae;
+ }
+
+ switch (alt16) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:182:4: ftsFieldGroupTerm
+ {
+ pushFollow(FOLLOW_ftsFieldGroupTerm_in_ftsFieldGroupTest779);
+ ftsFieldGroupTerm53=ftsFieldGroupTerm();
+
+ state._fsp--;
+
+ stream_ftsFieldGroupTerm.add(ftsFieldGroupTerm53.getTree());
+
+
+ // AST REWRITE
+ // elements: ftsFieldGroupTerm
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 183:3: -> ^( FG_TERM ftsFieldGroupTerm )
+ {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:183:6: ^( FG_TERM ftsFieldGroupTerm )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(FG_TERM, "FG_TERM"), root_1);
+
+ adaptor.addChild(root_1, stream_ftsFieldGroupTerm.nextTree());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+ break;
+ case 2 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:184:4: ftsFieldGroupExactTerm
+ {
+ pushFollow(FOLLOW_ftsFieldGroupExactTerm_in_ftsFieldGroupTest794);
+ ftsFieldGroupExactTerm54=ftsFieldGroupExactTerm();
+
+ state._fsp--;
+
+ stream_ftsFieldGroupExactTerm.add(ftsFieldGroupExactTerm54.getTree());
+
+
+ // AST REWRITE
+ // elements: ftsFieldGroupExactTerm
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 185:3: -> ^( FG_EXACT_TERM ftsFieldGroupExactTerm )
+ {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:185:6: ^( FG_EXACT_TERM ftsFieldGroupExactTerm )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(FG_EXACT_TERM, "FG_EXACT_TERM"), root_1);
+
+ adaptor.addChild(root_1, stream_ftsFieldGroupExactTerm.nextTree());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+ break;
+ case 3 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:186:4: ftsFieldGroupPhrase
+ {
+ pushFollow(FOLLOW_ftsFieldGroupPhrase_in_ftsFieldGroupTest810);
+ ftsFieldGroupPhrase55=ftsFieldGroupPhrase();
+
+ state._fsp--;
+
+ stream_ftsFieldGroupPhrase.add(ftsFieldGroupPhrase55.getTree());
+
+
+ // AST REWRITE
+ // elements: ftsFieldGroupPhrase
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 187:3: -> ^( FG_PHRASE ftsFieldGroupPhrase )
+ {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:187:6: ^( FG_PHRASE ftsFieldGroupPhrase )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(FG_PHRASE, "FG_PHRASE"), root_1);
+
+ adaptor.addChild(root_1, stream_ftsFieldGroupPhrase.nextTree());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+ break;
+ case 4 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:188:4: ftsFieldGroupSynonym
+ {
+ pushFollow(FOLLOW_ftsFieldGroupSynonym_in_ftsFieldGroupTest825);
+ ftsFieldGroupSynonym56=ftsFieldGroupSynonym();
+
+ state._fsp--;
+
+ stream_ftsFieldGroupSynonym.add(ftsFieldGroupSynonym56.getTree());
+
+
+ // AST REWRITE
+ // elements: ftsFieldGroupSynonym
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 189:3: -> ^( FG_SYNONYM ftsFieldGroupSynonym )
+ {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:189:6: ^( FG_SYNONYM ftsFieldGroupSynonym )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(FG_SYNONYM, "FG_SYNONYM"), root_1);
+
+ adaptor.addChild(root_1, stream_ftsFieldGroupSynonym.nextTree());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+ break;
+ case 5 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:190:10: ftsFieldGroupProximity
+ {
+ pushFollow(FOLLOW_ftsFieldGroupProximity_in_ftsFieldGroupTest846);
+ ftsFieldGroupProximity57=ftsFieldGroupProximity();
+
+ state._fsp--;
+
+ stream_ftsFieldGroupProximity.add(ftsFieldGroupProximity57.getTree());
+
+
+ // AST REWRITE
+ // elements: ftsFieldGroupProximity
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 191:3: -> ^( FG_PROXIMITY ftsFieldGroupProximity )
+ {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:191:6: ^( FG_PROXIMITY ftsFieldGroupProximity )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(FG_PROXIMITY, "FG_PROXIMITY"), root_1);
+
+ adaptor.addChild(root_1, stream_ftsFieldGroupProximity.nextTree());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+ break;
+ case 6 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:192:12: ftsFieldGroupRange
+ {
+ pushFollow(FOLLOW_ftsFieldGroupRange_in_ftsFieldGroupTest871);
+ ftsFieldGroupRange58=ftsFieldGroupRange();
+
+ state._fsp--;
+
+ stream_ftsFieldGroupRange.add(ftsFieldGroupRange58.getTree());
+
+
+ // AST REWRITE
+ // elements: ftsFieldGroupRange
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 193:10: -> ^( FG_RANGE ftsFieldGroupRange )
+ {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:193:13: ^( FG_RANGE ftsFieldGroupRange )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(FG_RANGE, "FG_RANGE"), root_1);
+
+ adaptor.addChild(root_1, stream_ftsFieldGroupRange.nextTree());
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+ break;
+ case 7 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:194:4: LPAREN ftsFieldGroupImplicitConjunctionOrDisjunction RPAREN
+ {
+ LPAREN59=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_ftsFieldGroupTest893);
+ stream_LPAREN.add(LPAREN59);
+
+ pushFollow(FOLLOW_ftsFieldGroupImplicitConjunctionOrDisjunction_in_ftsFieldGroupTest895);
+ ftsFieldGroupImplicitConjunctionOrDisjunction60=ftsFieldGroupImplicitConjunctionOrDisjunction();
+
+ state._fsp--;
+
+ stream_ftsFieldGroupImplicitConjunctionOrDisjunction.add(ftsFieldGroupImplicitConjunctionOrDisjunction60.getTree());
+ RPAREN61=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_ftsFieldGroupTest897);
+ stream_RPAREN.add(RPAREN61);
+
+
+
+ // AST REWRITE
+ // elements: ftsFieldGroupImplicitConjunctionOrDisjunction
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 195:3: -> ftsFieldGroupImplicitConjunctionOrDisjunction
+ {
+ adaptor.addChild(root_0, stream_ftsFieldGroupImplicitConjunctionOrDisjunction.nextTree());
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end ftsFieldGroupTest
+
+ public static class ftsFieldGroupTerm_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start ftsFieldGroupTerm
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:198:1: ftsFieldGroupTerm : FTSWORD ;
+ public final FTSParser.ftsFieldGroupTerm_return ftsFieldGroupTerm() throws RecognitionException {
+ FTSParser.ftsFieldGroupTerm_return retval = new FTSParser.ftsFieldGroupTerm_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token FTSWORD62=null;
+
+ Object FTSWORD62_tree=null;
+
+ try {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:199:2: ( FTSWORD )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:199:4: FTSWORD
+ {
+ root_0 = (Object)adaptor.nil();
+
+ FTSWORD62=(Token)match(input,FTSWORD,FOLLOW_FTSWORD_in_ftsFieldGroupTerm915);
+ FTSWORD62_tree = (Object)adaptor.create(FTSWORD62);
+ adaptor.addChild(root_0, FTSWORD62_tree);
+
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end ftsFieldGroupTerm
+
+ public static class ftsFieldGroupExactTerm_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start ftsFieldGroupExactTerm
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:202:1: ftsFieldGroupExactTerm : PLUS ftsFieldGroupTerm -> ftsFieldGroupTerm ;
+ public final FTSParser.ftsFieldGroupExactTerm_return ftsFieldGroupExactTerm() throws RecognitionException {
+ FTSParser.ftsFieldGroupExactTerm_return retval = new FTSParser.ftsFieldGroupExactTerm_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token PLUS63=null;
+ FTSParser.ftsFieldGroupTerm_return ftsFieldGroupTerm64 = null;
+
+
+ Object PLUS63_tree=null;
+ RewriteRuleTokenStream stream_PLUS=new RewriteRuleTokenStream(adaptor,"token PLUS");
+ RewriteRuleSubtreeStream stream_ftsFieldGroupTerm=new RewriteRuleSubtreeStream(adaptor,"rule ftsFieldGroupTerm");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:203:2: ( PLUS ftsFieldGroupTerm -> ftsFieldGroupTerm )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:203:4: PLUS ftsFieldGroupTerm
+ {
+ PLUS63=(Token)match(input,PLUS,FOLLOW_PLUS_in_ftsFieldGroupExactTerm927);
+ stream_PLUS.add(PLUS63);
+
+ pushFollow(FOLLOW_ftsFieldGroupTerm_in_ftsFieldGroupExactTerm929);
+ ftsFieldGroupTerm64=ftsFieldGroupTerm();
+
+ state._fsp--;
+
+ stream_ftsFieldGroupTerm.add(ftsFieldGroupTerm64.getTree());
+
+
+ // AST REWRITE
+ // elements: ftsFieldGroupTerm
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 204:3: -> ftsFieldGroupTerm
+ {
+ adaptor.addChild(root_0, stream_ftsFieldGroupTerm.nextTree());
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+
+ retval.stop = input.LT(-1);
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end ftsFieldGroupExactTerm
+
+ public static class ftsFieldGroupPhrase_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start ftsFieldGroupPhrase
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:207:1: ftsFieldGroupPhrase : FTSPHRASE ;
+ public final FTSParser.ftsFieldGroupPhrase_return ftsFieldGroupPhrase() throws RecognitionException {
+ FTSParser.ftsFieldGroupPhrase_return retval = new FTSParser.ftsFieldGroupPhrase_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token FTSPHRASE65=null;
+
+ Object FTSPHRASE65_tree=null;
+
+ try {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:208:2: ( FTSPHRASE )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:208:6: FTSPHRASE
+ {
+ root_0 = (Object)adaptor.nil();
+
+ FTSPHRASE65=(Token)match(input,FTSPHRASE,FOLLOW_FTSPHRASE_in_ftsFieldGroupPhrase949);
+ FTSPHRASE65_tree = (Object)adaptor.create(FTSPHRASE65);
+ adaptor.addChild(root_0, FTSPHRASE65_tree);
+
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end ftsFieldGroupPhrase
+
+ public static class ftsFieldGroupSynonym_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start ftsFieldGroupSynonym
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:211:1: ftsFieldGroupSynonym : TILDA ftsFieldGroupTerm -> ftsFieldGroupTerm ;
+ public final FTSParser.ftsFieldGroupSynonym_return ftsFieldGroupSynonym() throws RecognitionException {
+ FTSParser.ftsFieldGroupSynonym_return retval = new FTSParser.ftsFieldGroupSynonym_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token TILDA66=null;
+ FTSParser.ftsFieldGroupTerm_return ftsFieldGroupTerm67 = null;
+
+
+ Object TILDA66_tree=null;
+ RewriteRuleTokenStream stream_TILDA=new RewriteRuleTokenStream(adaptor,"token TILDA");
+ RewriteRuleSubtreeStream stream_ftsFieldGroupTerm=new RewriteRuleSubtreeStream(adaptor,"rule ftsFieldGroupTerm");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:212:2: ( TILDA ftsFieldGroupTerm -> ftsFieldGroupTerm )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:212:4: TILDA ftsFieldGroupTerm
+ {
+ TILDA66=(Token)match(input,TILDA,FOLLOW_TILDA_in_ftsFieldGroupSynonym961);
+ stream_TILDA.add(TILDA66);
+
+ pushFollow(FOLLOW_ftsFieldGroupTerm_in_ftsFieldGroupSynonym963);
+ ftsFieldGroupTerm67=ftsFieldGroupTerm();
+
+ state._fsp--;
+
+ stream_ftsFieldGroupTerm.add(ftsFieldGroupTerm67.getTree());
+
+
+ // AST REWRITE
+ // elements: ftsFieldGroupTerm
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 213:3: -> ftsFieldGroupTerm
+ {
+ adaptor.addChild(root_0, stream_ftsFieldGroupTerm.nextTree());
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+
+ retval.stop = input.LT(-1);
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end ftsFieldGroupSynonym
+
+ public static class ftsFieldGroupProximity_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start ftsFieldGroupProximity
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:216:1: ftsFieldGroupProximity : ftsFieldGroupTerm STAR ftsFieldGroupTerm -> ftsFieldGroupTerm ftsFieldGroupTerm ;
+ public final FTSParser.ftsFieldGroupProximity_return ftsFieldGroupProximity() throws RecognitionException {
+ FTSParser.ftsFieldGroupProximity_return retval = new FTSParser.ftsFieldGroupProximity_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token STAR69=null;
+ FTSParser.ftsFieldGroupTerm_return ftsFieldGroupTerm68 = null;
+
+ FTSParser.ftsFieldGroupTerm_return ftsFieldGroupTerm70 = null;
+
+
+ Object STAR69_tree=null;
+ RewriteRuleTokenStream stream_STAR=new RewriteRuleTokenStream(adaptor,"token STAR");
+ RewriteRuleSubtreeStream stream_ftsFieldGroupTerm=new RewriteRuleSubtreeStream(adaptor,"rule ftsFieldGroupTerm");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:217:2: ( ftsFieldGroupTerm STAR ftsFieldGroupTerm -> ftsFieldGroupTerm ftsFieldGroupTerm )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:217:4: ftsFieldGroupTerm STAR ftsFieldGroupTerm
+ {
+ pushFollow(FOLLOW_ftsFieldGroupTerm_in_ftsFieldGroupProximity981);
+ ftsFieldGroupTerm68=ftsFieldGroupTerm();
+
+ state._fsp--;
+
+ stream_ftsFieldGroupTerm.add(ftsFieldGroupTerm68.getTree());
+ STAR69=(Token)match(input,STAR,FOLLOW_STAR_in_ftsFieldGroupProximity983);
+ stream_STAR.add(STAR69);
+
+ pushFollow(FOLLOW_ftsFieldGroupTerm_in_ftsFieldGroupProximity985);
+ ftsFieldGroupTerm70=ftsFieldGroupTerm();
+
+ state._fsp--;
+
+ stream_ftsFieldGroupTerm.add(ftsFieldGroupTerm70.getTree());
+
+
+ // AST REWRITE
+ // elements: ftsFieldGroupTerm, ftsFieldGroupTerm
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 218:3: -> ftsFieldGroupTerm ftsFieldGroupTerm
+ {
+ adaptor.addChild(root_0, stream_ftsFieldGroupTerm.nextTree());
+ adaptor.addChild(root_0, stream_ftsFieldGroupTerm.nextTree());
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+
+ retval.stop = input.LT(-1);
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end ftsFieldGroupProximity
+
+ public static class ftsFieldGroupRange_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start ftsFieldGroupRange
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:221:1: ftsFieldGroupRange : ftsFieldGroupTerm DOTDOT ftsFieldGroupTerm -> ftsFieldGroupTerm ftsFieldGroupTerm ;
+ public final FTSParser.ftsFieldGroupRange_return ftsFieldGroupRange() throws RecognitionException {
+ FTSParser.ftsFieldGroupRange_return retval = new FTSParser.ftsFieldGroupRange_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token DOTDOT72=null;
+ FTSParser.ftsFieldGroupTerm_return ftsFieldGroupTerm71 = null;
+
+ FTSParser.ftsFieldGroupTerm_return ftsFieldGroupTerm73 = null;
+
+
+ Object DOTDOT72_tree=null;
+ RewriteRuleTokenStream stream_DOTDOT=new RewriteRuleTokenStream(adaptor,"token DOTDOT");
+ RewriteRuleSubtreeStream stream_ftsFieldGroupTerm=new RewriteRuleSubtreeStream(adaptor,"rule ftsFieldGroupTerm");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:221:19: ( ftsFieldGroupTerm DOTDOT ftsFieldGroupTerm -> ftsFieldGroupTerm ftsFieldGroupTerm )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:221:21: ftsFieldGroupTerm DOTDOT ftsFieldGroupTerm
+ {
+ pushFollow(FOLLOW_ftsFieldGroupTerm_in_ftsFieldGroupRange1003);
+ ftsFieldGroupTerm71=ftsFieldGroupTerm();
+
+ state._fsp--;
+
+ stream_ftsFieldGroupTerm.add(ftsFieldGroupTerm71.getTree());
+ DOTDOT72=(Token)match(input,DOTDOT,FOLLOW_DOTDOT_in_ftsFieldGroupRange1005);
+ stream_DOTDOT.add(DOTDOT72);
+
+ pushFollow(FOLLOW_ftsFieldGroupTerm_in_ftsFieldGroupRange1007);
+ ftsFieldGroupTerm73=ftsFieldGroupTerm();
+
+ state._fsp--;
+
+ stream_ftsFieldGroupTerm.add(ftsFieldGroupTerm73.getTree());
+
+
+ // AST REWRITE
+ // elements: ftsFieldGroupTerm, ftsFieldGroupTerm
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 222:3: -> ftsFieldGroupTerm ftsFieldGroupTerm
+ {
+ adaptor.addChild(root_0, stream_ftsFieldGroupTerm.nextTree());
+ adaptor.addChild(root_0, stream_ftsFieldGroupTerm.nextTree());
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+
+ retval.stop = input.LT(-1);
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end ftsFieldGroupRange
+
+ public static class columnReference_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start columnReference
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:225:1: columnReference : (qualifier= identifier DOT )? name= identifier -> ^( COLUMN_REF $name ( $qualifier)? ) ;
+ public final FTSParser.columnReference_return columnReference() throws RecognitionException {
+ FTSParser.columnReference_return retval = new FTSParser.columnReference_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token DOT74=null;
+ FTSParser.identifier_return qualifier = null;
+
+ FTSParser.identifier_return name = null;
+
+
+ Object DOT74_tree=null;
+ RewriteRuleTokenStream stream_DOT=new RewriteRuleTokenStream(adaptor,"token DOT");
+ RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
+ try {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:226:2: ( (qualifier= identifier DOT )? name= identifier -> ^( COLUMN_REF $name ( $qualifier)? ) )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:226:4: (qualifier= identifier DOT )? name= identifier
+ {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:226:4: (qualifier= identifier DOT )?
+ int alt17=2;
+ int LA17_0 = input.LA(1);
+
+ if ( (LA17_0==ID) ) {
+ int LA17_1 = input.LA(2);
+
+ if ( (LA17_1==DOT) ) {
+ alt17=1;
+ }
+ }
+ switch (alt17) {
+ case 1 :
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:226:6: qualifier= identifier DOT
+ {
+ pushFollow(FOLLOW_identifier_in_columnReference1031);
+ qualifier=identifier();
+
+ state._fsp--;
+
+ stream_identifier.add(qualifier.getTree());
+ DOT74=(Token)match(input,DOT,FOLLOW_DOT_in_columnReference1033);
+ stream_DOT.add(DOT74);
+
+
+ }
+ break;
+
+ }
+
+ pushFollow(FOLLOW_identifier_in_columnReference1040);
+ name=identifier();
+
+ state._fsp--;
+
+ stream_identifier.add(name.getTree());
+
+
+ // AST REWRITE
+ // elements: name, qualifier
+ // token labels:
+ // rule labels: retval, name, qualifier
+ // token list labels:
+ // rule list labels:
+ retval.tree = root_0;
+ RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+ RewriteRuleSubtreeStream stream_name=new RewriteRuleSubtreeStream(adaptor,"token name",name!=null?name.tree:null);
+ RewriteRuleSubtreeStream stream_qualifier=new RewriteRuleSubtreeStream(adaptor,"token qualifier",qualifier!=null?qualifier.tree:null);
+
+ root_0 = (Object)adaptor.nil();
+ // 227:3: -> ^( COLUMN_REF $name ( $qualifier)? )
+ {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:227:6: ^( COLUMN_REF $name ( $qualifier)? )
+ {
+ Object root_1 = (Object)adaptor.nil();
+ root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(COLUMN_REF, "COLUMN_REF"), root_1);
+
+ adaptor.addChild(root_1, stream_name.nextTree());
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:227:25: ( $qualifier)?
+ if ( stream_qualifier.hasNext() ) {
+ adaptor.addChild(root_1, stream_qualifier.nextTree());
+
+ }
+ stream_qualifier.reset();
+
+ adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;retval.tree = root_0;
+ }
+
+ retval.stop = input.LT(-1);
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end columnReference
+
+ public static class identifier_return extends ParserRuleReturnScope {
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start identifier
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:230:1: identifier : ID ;
+ public final FTSParser.identifier_return identifier() throws RecognitionException {
+ FTSParser.identifier_return retval = new FTSParser.identifier_return();
+ retval.start = input.LT(1);
+
+ Object root_0 = null;
+
+ Token ID75=null;
+
+ Object ID75_tree=null;
+
+ try {
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:231:2: ( ID )
+ // W:\\workspace-cmis\\ANTLR\\FTS.g:231:4: ID
+ {
+ root_0 = (Object)adaptor.nil();
+
+ ID75=(Token)match(input,ID,FOLLOW_ID_in_identifier1067);
+ ID75_tree = (Object)adaptor.create(ID75);
+ adaptor.addChild(root_0, ID75_tree);
+
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ }
+ return retval;
+ }
+ // $ANTLR end identifier
+
+ // Delegated rules
+
+
+ protected DFA3 dfa3 = new DFA3(this);
+ protected DFA7 dfa7 = new DFA7(this);
+ static final String DFA3_eotS =
+ "\12\uffff";
+ static final String DFA3_eofS =
+ "\12\uffff";
+ static final String DFA3_minS =
+ "\1\31\7\0\2\uffff";
+ static final String DFA3_maxS =
+ "\1\44\7\0\2\uffff";
+ static final String DFA3_acceptS =
+ "\10\uffff\1\1\1\2";
+ static final String DFA3_specialS =
+ "\1\uffff\1\0\1\1\1\2\1\3\1\4\1\5\1\6\2\uffff}>";
+ static final String[] DFA3_transitionS = {
+ "\1\1\1\7\2\uffff\1\3\1\4\1\5\1\6\3\uffff\1\2",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "",
+ ""
+ };
+
+ static final short[] DFA3_eot = DFA.unpackEncodedString(DFA3_eotS);
+ static final short[] DFA3_eof = DFA.unpackEncodedString(DFA3_eofS);
+ static final char[] DFA3_min = DFA.unpackEncodedStringToUnsignedChars(DFA3_minS);
+ static final char[] DFA3_max = DFA.unpackEncodedStringToUnsignedChars(DFA3_maxS);
+ static final short[] DFA3_accept = DFA.unpackEncodedString(DFA3_acceptS);
+ static final short[] DFA3_special = DFA.unpackEncodedString(DFA3_specialS);
+ static final short[][] DFA3_transition;
+
+ static {
+ int numStates = DFA3_transitionS.length;
+ DFA3_transition = new short[numStates][];
+ for (int i=0; i ^( CONJUNCTION ( ftsExplicitDisjunction )+ ) | ftsExplicitDisjunction ( ftsExplicitDisjunction )* -> ^( DISJUNCTION ( ftsExplicitDisjunction )+ ) );";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA3_1 = input.LA(1);
+
+
+ int index3_1 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (defaultConjunction()) ) {s = 8;}
+
+ else if ( (true) ) {s = 9;}
+
+
+ input.seek(index3_1);
+ if ( s>=0 ) return s;
+ break;
+ case 1 :
+ int LA3_2 = input.LA(1);
+
+
+ int index3_2 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (defaultConjunction()) ) {s = 8;}
+
+ else if ( (true) ) {s = 9;}
+
+
+ input.seek(index3_2);
+ if ( s>=0 ) return s;
+ break;
+ case 2 :
+ int LA3_3 = input.LA(1);
+
+
+ int index3_3 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (defaultConjunction()) ) {s = 8;}
+
+ else if ( (true) ) {s = 9;}
+
+
+ input.seek(index3_3);
+ if ( s>=0 ) return s;
+ break;
+ case 3 :
+ int LA3_4 = input.LA(1);
+
+
+ int index3_4 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (defaultConjunction()) ) {s = 8;}
+
+ else if ( (true) ) {s = 9;}
+
+
+ input.seek(index3_4);
+ if ( s>=0 ) return s;
+ break;
+ case 4 :
+ int LA3_5 = input.LA(1);
+
+
+ int index3_5 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (defaultConjunction()) ) {s = 8;}
+
+ else if ( (true) ) {s = 9;}
+
+
+ input.seek(index3_5);
+ if ( s>=0 ) return s;
+ break;
+ case 5 :
+ int LA3_6 = input.LA(1);
+
+
+ int index3_6 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (defaultConjunction()) ) {s = 8;}
+
+ else if ( (true) ) {s = 9;}
+
+
+ input.seek(index3_6);
+ if ( s>=0 ) return s;
+ break;
+ case 6 :
+ int LA3_7 = input.LA(1);
+
+
+ int index3_7 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (defaultConjunction()) ) {s = 8;}
+
+ else if ( (true) ) {s = 9;}
+
+
+ input.seek(index3_7);
+ if ( s>=0 ) return s;
+ break;
+ }
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 3, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA7_eotS =
+ "\16\uffff";
+ static final String DFA7_eofS =
+ "\2\uffff\1\11\13\uffff";
+ static final String DFA7_minS =
+ "\1\32\1\34\1\27\4\uffff\1\44\1\32\3\uffff\1\34\1\uffff";
+ static final String DFA7_maxS =
+ "\1\44\1\43\1\44\4\uffff\1\44\1\37\3\uffff\1\34\1\uffff";
+ static final String DFA7_acceptS =
+ "\3\uffff\1\2\1\3\1\4\1\10\2\uffff\1\1\1\5\1\6\1\uffff\1\7";
+ static final String DFA7_specialS =
+ "\16\uffff}>";
+ static final String[] DFA7_transitionS = {
+ "\1\6\2\uffff\1\2\1\3\1\4\1\5\3\uffff\1\1",
+ "\1\10\6\uffff\1\7",
+ "\5\11\1\uffff\4\11\1\12\1\13\1\uffff\1\11",
+ "",
+ "",
+ "",
+ "",
+ "\1\14",
+ "\1\15\2\uffff\1\11\1\uffff\1\4",
+ "",
+ "",
+ "",
+ "\1\10",
+ ""
+ };
+
+ static final short[] DFA7_eot = DFA.unpackEncodedString(DFA7_eotS);
+ static final short[] DFA7_eof = DFA.unpackEncodedString(DFA7_eofS);
+ static final char[] DFA7_min = DFA.unpackEncodedStringToUnsignedChars(DFA7_minS);
+ static final char[] DFA7_max = DFA.unpackEncodedStringToUnsignedChars(DFA7_maxS);
+ static final short[] DFA7_accept = DFA.unpackEncodedString(DFA7_acceptS);
+ static final short[] DFA7_special = DFA.unpackEncodedString(DFA7_specialS);
+ static final short[][] DFA7_transition;
+
+ static {
+ int numStates = DFA7_transitionS.length;
+ DFA7_transition = new short[numStates][];
+ for (int i=0; i ^( TERM ftsTerm ) | ftsExactTerm -> ^( EXACT_TERM ftsExactTerm ) | ftsPhrase -> ^( PHRASE ftsPhrase ) | ftsSynonym -> ^( SYNONYM ftsSynonym ) | ftsFieldGroupProximity -> ^( FG_PROXIMITY ftsFieldGroupProximity ) | ftsFieldGroupRange -> ^( FG_RANGE ftsFieldGroupRange ) | ftsFieldGroup | LPAREN ftsImplicitConjunctionOrDisjunction RPAREN -> ftsImplicitConjunctionOrDisjunction );";
+ }
+ }
+
+
+ public static final BitSet FOLLOW_ftsImplicitConjunctionOrDisjunction_in_fts135 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ftsExplicitDisjunction_in_ftsImplicitConjunctionOrDisjunction157 = new BitSet(new long[]{0x00000011E6000000L});
+ public static final BitSet FOLLOW_ftsExplicitDisjunction_in_ftsImplicitConjunctionOrDisjunction160 = new BitSet(new long[]{0x00000011E6000002L});
+ public static final BitSet FOLLOW_ftsExplicitDisjunction_in_ftsImplicitConjunctionOrDisjunction179 = new BitSet(new long[]{0x00000011E6000000L});
+ public static final BitSet FOLLOW_ftsExplicitDisjunction_in_ftsImplicitConjunctionOrDisjunction182 = new BitSet(new long[]{0x00000011E6000002L});
+ public static final BitSet FOLLOW_ftsExplictConjunction_in_ftsExplicitDisjunction207 = new BitSet(new long[]{0x0000000000800002L});
+ public static final BitSet FOLLOW_OR_in_ftsExplicitDisjunction210 = new BitSet(new long[]{0x00000011E6800000L});
+ public static final BitSet FOLLOW_ftsExplictConjunction_in_ftsExplicitDisjunction212 = new BitSet(new long[]{0x0000000000800002L});
+ public static final BitSet FOLLOW_ftsNot_in_ftsExplictConjunction237 = new BitSet(new long[]{0x0000000001000002L});
+ public static final BitSet FOLLOW_AND_in_ftsExplictConjunction240 = new BitSet(new long[]{0x00000011E7000000L});
+ public static final BitSet FOLLOW_ftsNot_in_ftsExplictConjunction242 = new BitSet(new long[]{0x0000000001000002L});
+ public static final BitSet FOLLOW_MINUS_in_ftsNot268 = new BitSet(new long[]{0x00000011E6000000L});
+ public static final BitSet FOLLOW_ftsTest_in_ftsNot270 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ftsTest_in_ftsNot285 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ftsTerm_in_ftsTest301 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ftsExactTerm_in_ftsTest316 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ftsPhrase_in_ftsTest344 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ftsSynonym_in_ftsTest379 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ftsFieldGroupProximity_in_ftsTest408 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ftsFieldGroupRange_in_ftsTest440 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ftsFieldGroup_in_ftsTest469 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LPAREN_in_ftsTest478 = new BitSet(new long[]{0x00000011E6000000L});
+ public static final BitSet FOLLOW_ftsImplicitConjunctionOrDisjunction_in_ftsTest480 = new BitSet(new long[]{0x0000000008000000L});
+ public static final BitSet FOLLOW_RPAREN_in_ftsTest482 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_columnReference_in_ftsTerm500 = new BitSet(new long[]{0x0000000010000000L});
+ public static final BitSet FOLLOW_COLON_in_ftsTerm502 = new BitSet(new long[]{0x0000000020000000L});
+ public static final BitSet FOLLOW_FTSWORD_in_ftsTerm506 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_PLUS_in_ftsExactTerm527 = new BitSet(new long[]{0x0000001020000000L});
+ public static final BitSet FOLLOW_ftsTerm_in_ftsExactTerm529 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_columnReference_in_ftsPhrase550 = new BitSet(new long[]{0x0000000010000000L});
+ public static final BitSet FOLLOW_COLON_in_ftsPhrase552 = new BitSet(new long[]{0x0000000080000000L});
+ public static final BitSet FOLLOW_FTSPHRASE_in_ftsPhrase556 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_TILDA_in_ftsSynonym577 = new BitSet(new long[]{0x0000001020000000L});
+ public static final BitSet FOLLOW_ftsTerm_in_ftsSynonym579 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_columnReference_in_ftsFieldGroup598 = new BitSet(new long[]{0x0000000010000000L});
+ public static final BitSet FOLLOW_COLON_in_ftsFieldGroup600 = new BitSet(new long[]{0x0000000004000000L});
+ public static final BitSet FOLLOW_LPAREN_in_ftsFieldGroup602 = new BitSet(new long[]{0x00000001EE000000L});
+ public static final BitSet FOLLOW_ftsFieldGroupImplicitConjunctionOrDisjunction_in_ftsFieldGroup604 = new BitSet(new long[]{0x0000000008000000L});
+ public static final BitSet FOLLOW_RPAREN_in_ftsFieldGroup606 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ftsFieldGroupExplicitDisjunction_in_ftsFieldGroupImplicitConjunctionOrDisjunction632 = new BitSet(new long[]{0x00000001E6000000L});
+ public static final BitSet FOLLOW_ftsFieldGroupExplicitDisjunction_in_ftsFieldGroupImplicitConjunctionOrDisjunction635 = new BitSet(new long[]{0x00000001E6000002L});
+ public static final BitSet FOLLOW_ftsFieldGroupExplicitDisjunction_in_ftsFieldGroupImplicitConjunctionOrDisjunction653 = new BitSet(new long[]{0x00000001E6000000L});
+ public static final BitSet FOLLOW_ftsFieldGroupExplicitDisjunction_in_ftsFieldGroupImplicitConjunctionOrDisjunction656 = new BitSet(new long[]{0x00000001E6000002L});
+ public static final BitSet FOLLOW_ftsFieldGroupExplictConjunction_in_ftsFieldGroupExplicitDisjunction681 = new BitSet(new long[]{0x0000000000800002L});
+ public static final BitSet FOLLOW_OR_in_ftsFieldGroupExplicitDisjunction684 = new BitSet(new long[]{0x00000001E6800000L});
+ public static final BitSet FOLLOW_ftsFieldGroupExplictConjunction_in_ftsFieldGroupExplicitDisjunction686 = new BitSet(new long[]{0x0000000000800002L});
+ public static final BitSet FOLLOW_ftsFieldGroupNot_in_ftsFieldGroupExplictConjunction711 = new BitSet(new long[]{0x0000000001000002L});
+ public static final BitSet FOLLOW_AND_in_ftsFieldGroupExplictConjunction714 = new BitSet(new long[]{0x00000001E7000000L});
+ public static final BitSet FOLLOW_ftsFieldGroupNot_in_ftsFieldGroupExplictConjunction716 = new BitSet(new long[]{0x0000000001000002L});
+ public static final BitSet FOLLOW_MINUS_in_ftsFieldGroupNot743 = new BitSet(new long[]{0x00000001E6000000L});
+ public static final BitSet FOLLOW_ftsFieldGroupTest_in_ftsFieldGroupNot745 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ftsFieldGroupTest_in_ftsFieldGroupNot760 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ftsFieldGroupTerm_in_ftsFieldGroupTest779 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ftsFieldGroupExactTerm_in_ftsFieldGroupTest794 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ftsFieldGroupPhrase_in_ftsFieldGroupTest810 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ftsFieldGroupSynonym_in_ftsFieldGroupTest825 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ftsFieldGroupProximity_in_ftsFieldGroupTest846 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ftsFieldGroupRange_in_ftsFieldGroupTest871 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LPAREN_in_ftsFieldGroupTest893 = new BitSet(new long[]{0x00000001EE000000L});
+ public static final BitSet FOLLOW_ftsFieldGroupImplicitConjunctionOrDisjunction_in_ftsFieldGroupTest895 = new BitSet(new long[]{0x0000000008000000L});
+ public static final BitSet FOLLOW_RPAREN_in_ftsFieldGroupTest897 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_FTSWORD_in_ftsFieldGroupTerm915 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_PLUS_in_ftsFieldGroupExactTerm927 = new BitSet(new long[]{0x0000000020000000L});
+ public static final BitSet FOLLOW_ftsFieldGroupTerm_in_ftsFieldGroupExactTerm929 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_FTSPHRASE_in_ftsFieldGroupPhrase949 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_TILDA_in_ftsFieldGroupSynonym961 = new BitSet(new long[]{0x0000000020000000L});
+ public static final BitSet FOLLOW_ftsFieldGroupTerm_in_ftsFieldGroupSynonym963 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ftsFieldGroupTerm_in_ftsFieldGroupProximity981 = new BitSet(new long[]{0x0000000200000000L});
+ public static final BitSet FOLLOW_STAR_in_ftsFieldGroupProximity983 = new BitSet(new long[]{0x0000000020000000L});
+ public static final BitSet FOLLOW_ftsFieldGroupTerm_in_ftsFieldGroupProximity985 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ftsFieldGroupTerm_in_ftsFieldGroupRange1003 = new BitSet(new long[]{0x0000000400000000L});
+ public static final BitSet FOLLOW_DOTDOT_in_ftsFieldGroupRange1005 = new BitSet(new long[]{0x0000000020000000L});
+ public static final BitSet FOLLOW_ftsFieldGroupTerm_in_ftsFieldGroupRange1007 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_identifier_in_columnReference1031 = new BitSet(new long[]{0x0000000800000000L});
+ public static final BitSet FOLLOW_DOT_in_columnReference1033 = new BitSet(new long[]{0x0000001000000000L});
+ public static final BitSet FOLLOW_identifier_in_columnReference1040 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ID_in_identifier1067 = new BitSet(new long[]{0x0000000000000002L});
+
+}
\ No newline at end of file
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/Argument.java b/source/java/org/alfresco/repo/search/impl/querymodel/Argument.java
new file mode 100644
index 0000000000..b3f3ac8da9
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/Argument.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel;
+
+import java.io.Serializable;
+
+/**
+ * An argument to a function
+ *
+ * @author andyh
+ *
+ */
+public interface Argument
+{
+ public String getName();
+
+ public Serializable getValue();
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/ArgumentDefinition.java b/source/java/org/alfresco/repo/search/impl/querymodel/ArgumentDefinition.java
new file mode 100644
index 0000000000..0d4c131f89
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/ArgumentDefinition.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel;
+
+import org.alfresco.service.namespace.QName;
+
+/**
+ * @author andyh
+ *
+ */
+public interface ArgumentDefinition
+{
+ public String getName();
+
+ public QName getType();
+
+ public Multiplicity getMutiplicity();
+
+ public boolean isMandatory();
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/Column.java b/source/java/org/alfresco/repo/search/impl/querymodel/Column.java
new file mode 100644
index 0000000000..1e155426a7
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/Column.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel;
+
+
+
+/**
+ * @author andyh
+ *
+ */
+public interface Column extends FunctionInvokation
+{
+ /**
+ * Get the column alias.
+ *
+ * @return
+ */
+ public String getAlias();
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/Conjunction.java b/source/java/org/alfresco/repo/search/impl/querymodel/Conjunction.java
new file mode 100644
index 0000000000..4499a3429c
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/Conjunction.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel;
+
+import java.util.List;
+
+/**
+ * @author andyh
+ *
+ */
+public interface Conjunction extends Constraint
+{
+ /**
+ * Get the list of constraints which must all be met
+ * @return
+ */
+ public List getConstraints();
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/Constraint.java b/source/java/org/alfresco/repo/search/impl/querymodel/Constraint.java
new file mode 100644
index 0000000000..1663d64554
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/Constraint.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel;
+
+/**
+ * A constraint
+ *
+ * @author andyh
+ *
+ */
+public interface Constraint
+{
+ public boolean evaluate();
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/Disjunction.java b/source/java/org/alfresco/repo/search/impl/querymodel/Disjunction.java
new file mode 100644
index 0000000000..2397d84c9f
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/Disjunction.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel;
+
+import java.util.List;
+
+/**
+ * @author andyh
+ *
+ */
+public interface Disjunction extends Constraint
+{
+ /**
+ * Get the list of constraints for which at least one must be met.
+ *
+ * @return
+ */
+ public List getConstraints();
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/DynamicArgument.java b/source/java/org/alfresco/repo/search/impl/querymodel/DynamicArgument.java
new file mode 100644
index 0000000000..c126f294c8
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/DynamicArgument.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel;
+
+/**
+ * A dynamic argument (e.g. non-literal and not a parameter)
+ *
+ * @author andyh
+ *
+ */
+public interface DynamicArgument extends Argument
+{
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/Function.java b/source/java/org/alfresco/repo/search/impl/querymodel/Function.java
new file mode 100644
index 0000000000..1aade95cda
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/Function.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel;
+
+import java.io.Serializable;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import org.alfresco.service.namespace.QName;
+
+/**
+ * @author andyh
+ */
+public interface Function
+{
+ /**
+ * Evaluation a function
+ *
+ * @param args
+ * @return
+ */
+ public Serializable getValue(Set args);
+
+ /**
+ * Get the return type for the function
+ *
+ * @return
+ */
+ public QName getReturnType();
+
+ /**
+ * Get the function name
+ *
+ * @return
+ */
+ public String getName();
+
+ /**
+ * Get the argument Definitions
+ * @return
+ */
+ public LinkedHashSet getArgumentDefinitions();
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/FunctionInvokation.java b/source/java/org/alfresco/repo/search/impl/querymodel/FunctionInvokation.java
new file mode 100644
index 0000000000..156038d714
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/FunctionInvokation.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel;
+
+import java.util.List;
+
+/**
+ * @author andyh
+ */
+public interface FunctionInvokation
+{
+ /**
+ * Get the function
+ *
+ * @return
+ */
+ public Function getFunction();
+
+ /**
+ * Get the functions arguments.
+ *
+ * @return
+ */
+ public List getFunctionArguments();
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/FunctionalConstraint.java b/source/java/org/alfresco/repo/search/impl/querymodel/FunctionalConstraint.java
new file mode 100644
index 0000000000..307b50e654
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/FunctionalConstraint.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel;
+
+
+/**
+ * A constraint defined by a function that returns a boolean value.
+ *
+ * @author andyh
+ */
+public interface FunctionalConstraint extends Constraint, FunctionInvokation
+{
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/Join.java b/source/java/org/alfresco/repo/search/impl/querymodel/Join.java
new file mode 100644
index 0000000000..6aadfc74d3
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/Join.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel;
+
+/**
+ * @author andyh
+ *
+ */
+public interface Join extends Source
+{
+ /**
+ * The source for the left hand side of the join
+ * @return
+ */
+ public Source getLeft();
+
+ /**
+ * The source for the right hand side of the join
+ * @return
+ */
+ public Source getRight();
+
+ /**
+ * Get the join type
+ * @return
+ */
+ public JoinType getJoinType();
+
+ /**
+ * Get the join condition.
+ * Not all constraints are valid join conditions
+ * @return
+ */
+ public Constraint getJoinCondition();
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/JoinType.java b/source/java/org/alfresco/repo/search/impl/querymodel/JoinType.java
new file mode 100644
index 0000000000..77aadbca25
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/JoinType.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel;
+
+/**
+ * @author andyh
+ *
+ */
+public enum JoinType
+{
+ /**
+ * Inner join
+ */
+ INNER,
+ /**
+ * Left (outer) join
+ */
+ LEFT,
+ /**
+ * Right (outer) join
+ */
+ RIGHT
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/LiteralArgument.java b/source/java/org/alfresco/repo/search/impl/querymodel/LiteralArgument.java
new file mode 100644
index 0000000000..dd196b31cb
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/LiteralArgument.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel;
+
+import java.io.Serializable;
+
+import org.alfresco.service.namespace.QName;
+
+/**
+ * @author andyh
+ */
+public interface LiteralArgument extends StaticArgument
+{
+ public QName getType();
+
+ public Serializable getValue();
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/Multiplicity.java b/source/java/org/alfresco/repo/search/impl/querymodel/Multiplicity.java
new file mode 100644
index 0000000000..67cc8762a1
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/Multiplicity.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel;
+
+/**
+ * @author andyh
+ */
+public enum Multiplicity
+{
+ SINGLE_VALUED, MULTI_VALUED, ANY;
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/Negation.java b/source/java/org/alfresco/repo/search/impl/querymodel/Negation.java
new file mode 100644
index 0000000000..ee51ff0df1
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/Negation.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel;
+
+/**
+ * @author andyh
+ *
+ */
+public interface Negation extends Constraint
+{
+ /**
+ * Get the constraint to be negated.
+ * @return
+ */
+ public Constraint getConstraint();
+}
diff --git a/source/java/org/alfresco/cmis/dictionary/CMISPropertyValue.java b/source/java/org/alfresco/repo/search/impl/querymodel/Order.java
similarity index 88%
rename from source/java/org/alfresco/cmis/dictionary/CMISPropertyValue.java
rename to source/java/org/alfresco/repo/search/impl/querymodel/Order.java
index a2868c4b52..c9c679353d 100644
--- a/source/java/org/alfresco/cmis/dictionary/CMISPropertyValue.java
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/Order.java
@@ -22,9 +22,13 @@
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
-package org.alfresco.cmis.dictionary;
+package org.alfresco.repo.search.impl.querymodel;
-public interface CMISPropertyValue
+/**
+ * @author andyh
+ *
+ */
+public enum Order
{
-
+ ASCENDING, DESCENDING;
}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/Ordering.java b/source/java/org/alfresco/repo/search/impl/querymodel/Ordering.java
new file mode 100644
index 0000000000..2cfd9726c6
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/Ordering.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel;
+
+/**
+ * @author andyh
+ *
+ */
+public interface Ordering
+{
+ public DynamicArgument getArgument();
+
+ public Order getOrder();
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/ParameterArgument.java b/source/java/org/alfresco/repo/search/impl/querymodel/ParameterArgument.java
new file mode 100644
index 0000000000..d0d44aa258
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/ParameterArgument.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel;
+
+/**
+ * @author andyh
+ */
+public interface ParameterArgument extends StaticArgument
+{
+ public String getParameterName();
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/PropertyArgument.java b/source/java/org/alfresco/repo/search/impl/querymodel/PropertyArgument.java
new file mode 100644
index 0000000000..f15bdfe80f
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/PropertyArgument.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel;
+
+import org.alfresco.service.namespace.QName;
+
+/**
+ * @author andyh
+ */
+public interface PropertyArgument extends DynamicArgument
+{
+ public String getSelector();
+
+ public QName getPropertyName();
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/Query.java b/source/java/org/alfresco/repo/search/impl/querymodel/Query.java
new file mode 100644
index 0000000000..cd72c24cac
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/Query.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel;
+
+import java.util.List;
+
+/**
+ * @author andyh
+ *
+ */
+public interface Query
+{
+ /**
+ * Get the columns to return from the query
+ *
+ * This may not be null and must contain at least one entry.
+ * "*" "A.*" etc column specifications are not supported.
+ * These should have been previously expanded between any query parse and building the query model.
+ *
+ * @return
+ */
+ public List getColumns();
+
+ /**
+ * Get the constraints for the query.
+ * This is as defined - with no hoisting etc.
+ * Hoisting is the problem of the implementation layer.
+ *
+ * May be null for unconstrained.
+ *
+ * @return
+ */
+ public Constraint getConstraint();
+
+ /**
+ * Get any orderings (may be an empty list or null)
+ *
+ * @return
+ */
+ public List getOrderings();
+
+ /**
+ * Get the source for the query
+ * Must not be null.
+ * @return
+ */
+ public Source getSource();
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/QueryModelFactory.java b/source/java/org/alfresco/repo/search/impl/querymodel/QueryModelFactory.java
new file mode 100644
index 0000000000..7d478307db
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/QueryModelFactory.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel;
+
+import java.io.Serializable;
+import java.util.List;
+
+import org.alfresco.service.namespace.QName;
+
+/**
+ * @author andyh
+ */
+public interface QueryModelFactory
+{
+ public Query createQuery(List columns, Source source, Constraint constraint, List orderings);
+
+ public Selector createSelector(QName classQName, String alias);
+
+ public Join createJoin(Source left, Source right, JoinType joinType, Constraint joinCondition);
+
+ public Constraint createConjunction(List constraints);
+
+ public Constraint createDisjunction(List constraints);
+
+ public Constraint createNegation(Constraint constraint);
+
+ public Constraint createFunctionalConstraint(Function function, List functionArguments);
+
+ public Column createColumn(Function function, List functionArguments, String alias);
+
+ public LiteralArgument createLiteralArgument(String name, QName type, Serializable value);
+
+ public Ordering createOrdering(DynamicArgument argument, Order order);
+
+ public ParameterArgument createParameterArgument(String name, String parameterName);
+
+ public PropertyArgument createPropertyArgument(String name, String selectorAlias, QName propertyName);
+
+ public SelectorArgument createSelectorArgument(String name, String selectorAlias);
+
+ public Function getFunction(String functionName);
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/Selector.java b/source/java/org/alfresco/repo/search/impl/querymodel/Selector.java
new file mode 100644
index 0000000000..fa72f3d24b
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/Selector.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel;
+
+import org.alfresco.service.namespace.QName;
+
+/**
+ * @author andyh
+ *
+ */
+public interface Selector extends Source
+{
+ /**
+ * The qname of the type or aspect to select
+ * @return
+ */
+ public QName getType();
+
+ /**
+ * The alias or name for the selector
+ * This must be unique across all selectors in the query
+ *
+ * @return
+ */
+ public String getAlias();
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/SelectorArgument.java b/source/java/org/alfresco/repo/search/impl/querymodel/SelectorArgument.java
new file mode 100644
index 0000000000..e06b0a8bdc
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/SelectorArgument.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel;
+
+/**
+ * @author andyh
+ *
+ */
+public interface SelectorArgument extends StaticArgument
+{
+ public String getSelector();
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/Source.java b/source/java/org/alfresco/repo/search/impl/querymodel/Source.java
new file mode 100644
index 0000000000..aa7cd5b438
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/Source.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel;
+
+import java.util.Map;
+
+/**
+ * @author andyh
+ *
+ */
+public interface Source
+{
+ public Map getSelectors();
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/StaticArgument.java b/source/java/org/alfresco/repo/search/impl/querymodel/StaticArgument.java
new file mode 100644
index 0000000000..101619ce05
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/StaticArgument.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel;
+
+/**
+ * @author andyh
+ *
+ */
+public interface StaticArgument extends Argument
+{
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseArgument.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseArgument.java
new file mode 100644
index 0000000000..1b5d09ae41
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseArgument.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl;
+
+import org.alfresco.repo.search.impl.querymodel.Argument;
+
+/**
+ * @author andyh
+ *
+ */
+public abstract class BaseArgument implements Argument
+{
+ private String name;
+
+
+ public BaseArgument(String name)
+ {
+ this.name = name;
+ }
+
+ /* (non-Javadoc)
+ * @see org.alfresco.repo.search.impl.querymodel.Argument#getName()
+ */
+ public String getName()
+ {
+ return name;
+ }
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseArgumentDefinition.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseArgumentDefinition.java
new file mode 100644
index 0000000000..83d942581e
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseArgumentDefinition.java
@@ -0,0 +1,134 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl;
+
+import org.alfresco.repo.search.impl.querymodel.ArgumentDefinition;
+import org.alfresco.repo.search.impl.querymodel.Multiplicity;
+import org.alfresco.service.namespace.QName;
+
+/**
+ * @author andyh
+ */
+public class BaseArgumentDefinition implements ArgumentDefinition
+{
+ private Multiplicity multiplicity;
+
+ private String name;
+
+ private QName type;
+
+ private boolean mandatory;
+
+ public BaseArgumentDefinition(Multiplicity multiplicity, String name, QName type, boolean mandatory)
+ {
+ this.multiplicity = multiplicity;
+ this.name = name;
+ this.type = type;
+ this.mandatory = mandatory;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.alfresco.repo.search.impl.querymodel.ArgumentDefinition#getMutiplicity()
+ */
+ public Multiplicity getMutiplicity()
+ {
+ return multiplicity;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.alfresco.repo.search.impl.querymodel.ArgumentDefinition#getName()
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.alfresco.repo.search.impl.querymodel.ArgumentDefinition#getType()
+ */
+ public QName getType()
+ {
+ return type;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.alfresco.repo.search.impl.querymodel.ArgumentDefinition#isMandatory()
+ */
+ public boolean isMandatory()
+ {
+ return mandatory;
+ }
+
+ public String toString()
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append("BaseArgumentDefinition[");
+ builder.append("name=").append(getName()).append(", ");
+ builder.append("multiplicity=").append(getMutiplicity()).append(", ");
+ builder.append("mandatory=").append(isMandatory()).append(", ");
+ builder.append("type=").append(getType());
+ builder.append("] ");
+ return builder.toString();
+ }
+
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ final BaseArgumentDefinition other = (BaseArgumentDefinition) obj;
+ if (name == null)
+ {
+ if (other.name != null)
+ return false;
+ }
+ else if (!name.equals(other.name))
+ return false;
+ return true;
+ }
+
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseColumn.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseColumn.java
new file mode 100644
index 0000000000..a7dab4d8db
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseColumn.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl;
+
+import java.util.List;
+
+import org.alfresco.repo.search.impl.querymodel.Argument;
+import org.alfresco.repo.search.impl.querymodel.Column;
+import org.alfresco.repo.search.impl.querymodel.Function;
+
+/**
+ * @author andyh
+ *
+ */
+public class BaseColumn implements Column
+{
+ private String alias;
+
+ private Function function;
+
+ private List functionArguments;
+
+ public BaseColumn(Function function, List functionArguments, String alias)
+ {
+ this.function = function;
+ this.functionArguments = functionArguments;
+ this.alias = alias;
+ }
+
+ /* (non-Javadoc)
+ * @see org.alfresco.repo.search.impl.querymodel.Column#getAlias()
+ */
+ public String getAlias()
+ {
+ return alias;
+ }
+
+ /* (non-Javadoc)
+ * @see org.alfresco.repo.search.impl.querymodel.FunctionInvokation#getFunction()
+ */
+ public Function getFunction()
+ {
+ return function;
+ }
+
+ /* (non-Javadoc)
+ * @see org.alfresco.repo.search.impl.querymodel.FunctionInvokation#getFunctionArguments()
+ */
+ public List getFunctionArguments()
+ {
+ return functionArguments;
+ }
+
+ public String toString()
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append("BaseColumn[");
+ builder.append("Alias=").append(getAlias()).append(", ");
+ builder.append("Function=").append(getFunction()).append(", ");
+ builder.append("FunctionArguments=").append(getFunctionArguments());
+ builder.append("]");
+ return builder.toString();
+ }
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseDynamicArgument.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseDynamicArgument.java
new file mode 100644
index 0000000000..5cf88cb923
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseDynamicArgument.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl;
+
+import org.alfresco.repo.search.impl.querymodel.DynamicArgument;
+
+/**
+ * @author andyh
+ *
+ */
+public abstract class BaseDynamicArgument extends BaseArgument implements DynamicArgument
+{
+
+ /**
+ * @param name
+ */
+ public BaseDynamicArgument(String name)
+ {
+ super(name);
+ }
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseFunction.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseFunction.java
new file mode 100644
index 0000000000..4d102cfa24
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseFunction.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl;
+
+import java.util.LinkedHashSet;
+
+import org.alfresco.repo.search.impl.querymodel.ArgumentDefinition;
+import org.alfresco.repo.search.impl.querymodel.Function;
+import org.alfresco.service.namespace.QName;
+
+/**
+ * @author andyh
+ */
+public abstract class BaseFunction implements Function
+{
+
+ private String name;
+
+ private QName returnType;
+
+ private LinkedHashSet argumentDefinitions;
+
+ public BaseFunction(String name, QName returnType, LinkedHashSet argumentDefinitions)
+ {
+ this.name = name;
+ this.returnType = returnType;
+ this.argumentDefinitions = argumentDefinitions;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.alfresco.repo.search.impl.querymodel.Function#getArgumentDefinitions()
+ */
+ public LinkedHashSet getArgumentDefinitions()
+ {
+ return argumentDefinitions;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.alfresco.repo.search.impl.querymodel.Function#getName()
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.alfresco.repo.search.impl.querymodel.Function#getReturnType()
+ */
+ public QName getReturnType()
+ {
+ return returnType;
+ }
+
+
+ public String toString()
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append("BaseFunction[");
+ builder.append("Name="+getName()).append(", ");
+ builder.append("Return type="+getReturnType()).append(", ");
+ builder.append("ArgumentDefinitions="+getArgumentDefinitions());
+ builder.append("]");
+ return builder.toString();
+ }
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseFunctionalConstraint.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseFunctionalConstraint.java
new file mode 100644
index 0000000000..a13eb258f4
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseFunctionalConstraint.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl;
+
+import java.util.List;
+
+import org.alfresco.repo.search.impl.querymodel.Argument;
+import org.alfresco.repo.search.impl.querymodel.Function;
+import org.alfresco.repo.search.impl.querymodel.FunctionalConstraint;
+
+/**
+ * @author andyh
+ *
+ */
+public class BaseFunctionalConstraint implements FunctionalConstraint
+{
+ private Function function;
+
+ private List arguments;
+
+ public BaseFunctionalConstraint(Function function, List arguments)
+ {
+ this.function = function;
+ this.arguments = arguments;
+ }
+
+ /* (non-Javadoc)
+ * @see org.alfresco.repo.search.impl.querymodel.Constraint#evaluate()
+ */
+ public boolean evaluate()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ /* (non-Javadoc)
+ * @see org.alfresco.repo.search.impl.querymodel.FunctionInvokation#getFunction()
+ */
+ public Function getFunction()
+ {
+ return function;
+ }
+
+ /* (non-Javadoc)
+ * @see org.alfresco.repo.search.impl.querymodel.FunctionInvokation#getFunctionArguments()
+ */
+ public List getFunctionArguments()
+ {
+ return arguments;
+ }
+
+ public String toString()
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append("BaseFunctionalConstraint[");
+ builder.append("Function="+getFunction()).append(", ");
+ builder.append("Arguments="+getFunctionArguments());
+ builder.append("]");
+ return builder.toString();
+ }
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseJoin.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseJoin.java
new file mode 100644
index 0000000000..2e262abc5e
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseJoin.java
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.alfresco.repo.search.impl.querymodel.Constraint;
+import org.alfresco.repo.search.impl.querymodel.Join;
+import org.alfresco.repo.search.impl.querymodel.JoinType;
+import org.alfresco.repo.search.impl.querymodel.Selector;
+import org.alfresco.repo.search.impl.querymodel.Source;
+
+/**
+ * @author andyh
+ */
+public class BaseJoin implements Join
+{
+ private Constraint joinConstraint;
+
+ private JoinType joinType;
+
+ private Source left;
+
+ private Source right;
+
+ public BaseJoin(Source left, Source right, JoinType joinType, Constraint joinConstraint)
+ {
+ this.left = left;
+ this.right = right;
+ this.joinType = joinType;
+ this.joinConstraint = joinConstraint;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.alfresco.repo.search.impl.querymodel.Join#getJoinCondition()
+ */
+ public Constraint getJoinCondition()
+ {
+ return joinConstraint;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.alfresco.repo.search.impl.querymodel.Join#getJoinType()
+ */
+ public JoinType getJoinType()
+ {
+ return joinType;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.alfresco.repo.search.impl.querymodel.Join#getLeft()
+ */
+ public Source getLeft()
+ {
+ return left;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.alfresco.repo.search.impl.querymodel.Join#getRight()
+ */
+ public Source getRight()
+ {
+ return right;
+ }
+
+ public String toString()
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append("BaseJoin[");
+ builder.append("Left=" + getLeft()).append(", ");
+ builder.append("Right=" + getRight()).append(", ");
+ builder.append("JoinType=" + getJoinType()).append(", ");
+ builder.append("Condition=" + getJoinCondition());
+ builder.append("]");
+ return builder.toString();
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.alfresco.repo.search.impl.querymodel.Source#getSelectorNames()
+ */
+ public Map getSelectors()
+ {
+ HashMap answer = new HashMap();
+ Map leftSelectors = left.getSelectors();
+ for(String selectorName : leftSelectors.keySet())
+ {
+ Selector selector = leftSelectors.get(selectorName);
+ if(answer.put(selectorName, selector) != null)
+ {
+ throw new DuplicateSelectorNameException("There is a duplicate selector name for "+selectorName);
+ }
+ }
+ Map rightSelectors = right.getSelectors();
+ for(String selectorName : rightSelectors.keySet())
+ {
+ Selector selector = rightSelectors.get(selectorName);
+ if(answer.put(selectorName, selector) != null)
+ {
+ throw new DuplicateSelectorNameException("There is a duplicate selector name for "+selectorName);
+ }
+ }
+ return answer;
+ }
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseLiteralArgument.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseLiteralArgument.java
new file mode 100644
index 0000000000..b80d2d4008
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseLiteralArgument.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl;
+
+import java.io.Serializable;
+
+import org.alfresco.repo.search.impl.querymodel.LiteralArgument;
+import org.alfresco.service.namespace.QName;
+
+/**
+ * @author andyh
+ *
+ */
+public class BaseLiteralArgument extends BaseStaticArgument implements LiteralArgument
+{
+ private QName type;
+
+ private Serializable value;
+
+ public BaseLiteralArgument(String name, QName type, Serializable value)
+ {
+ super(name);
+ this.type = type;
+ this.value = value;
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.alfresco.repo.search.impl.querymodel.LiteralArgument#getValue()
+ */
+ public Serializable getValue()
+ {
+ return value;
+ }
+
+ /* (non-Javadoc)
+ * @see org.alfresco.repo.search.impl.querymodel.LiteralArgument#getType()
+ */
+ public QName getType()
+ {
+ return type;
+ }
+
+ public String toString()
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append("BaseLiteralArgument[");
+ builder.append("name=").append(getName()).append(", ");
+ builder.append("type=").append(getType()).append(", ");
+ builder.append("value=").append(getValue()).append(", ");
+ builder.append("]");
+ return builder.toString();
+ }
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseParameterArgument.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseParameterArgument.java
new file mode 100644
index 0000000000..f522541b04
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseParameterArgument.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl;
+
+import java.io.Serializable;
+
+import org.alfresco.repo.search.impl.querymodel.ParameterArgument;
+
+/**
+ * @author andyh
+ *
+ */
+public class BaseParameterArgument extends BaseStaticArgument implements ParameterArgument
+{
+ private String parameterName;
+
+ /**
+ * @param name
+ */
+ public BaseParameterArgument(String name, String parameterName)
+ {
+ super(name);
+ this.parameterName = parameterName;
+ }
+
+ /* (non-Javadoc)
+ * @see org.alfresco.repo.search.impl.querymodel.ParameterArgument#getParameterName()
+ */
+ public String getParameterName()
+ {
+ return parameterName;
+ }
+
+ /* (non-Javadoc)
+ * @see org.alfresco.repo.search.impl.querymodel.Argument#getValue()
+ */
+ public Serializable getValue()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String toString()
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append("BaseParameterArgument[");
+ builder.append("name=").append(getName()).append(", ");
+ builder.append("parameterName=").append(getParameterName());
+ builder.append("]");
+ return builder.toString();
+ }
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/BasePropertyArgument.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/BasePropertyArgument.java
new file mode 100644
index 0000000000..45889c377b
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/BasePropertyArgument.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl;
+
+import java.io.Serializable;
+
+import org.alfresco.repo.search.impl.querymodel.PropertyArgument;
+import org.alfresco.service.namespace.QName;
+
+/**
+ * @author andyh
+ */
+public class BasePropertyArgument extends BaseDynamicArgument implements PropertyArgument
+{
+ private QName propertyName;
+
+ private String selector;
+
+ /**
+ * @param name
+ */
+ public BasePropertyArgument(String name, String selector, QName propertyName)
+ {
+ super(name);
+ this.selector = selector;
+ this.propertyName = propertyName;
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.alfresco.repo.search.impl.querymodel.PropertyArgument#getSelector()
+ */
+ public String getSelector()
+ {
+ return selector;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.alfresco.repo.search.impl.querymodel.PropertyArgument#getPropertyName()
+ */
+ public QName getPropertyName()
+ {
+ return propertyName;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.alfresco.repo.search.impl.querymodel.Argument#getValue()
+ */
+ public Serializable getValue()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String toString()
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append("BasePropertyArgument[");
+ builder.append("name=").append(getName()).append(", ");
+ builder.append("selector=").append(getSelector()).append(", ");
+ builder.append("propertName=").append(getPropertyName()).append(", ");
+ builder.append("]");
+ return builder.toString();
+ }
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseSelector.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseSelector.java
new file mode 100644
index 0000000000..697f3b2cc6
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseSelector.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.alfresco.repo.search.impl.querymodel.Selector;
+import org.alfresco.service.namespace.QName;
+
+/**
+ * @author andyh
+ */
+public class BaseSelector implements Selector
+{
+ private QName type;
+
+ private String alias;
+
+ public BaseSelector(QName type, String alias)
+ {
+ this.type = type;
+ this.alias = alias;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.alfresco.repo.search.impl.querymodel.Selector#getAlias()
+ */
+ public String getAlias()
+ {
+ return alias;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.alfresco.repo.search.impl.querymodel.Selector#getType()
+ */
+ public QName getType()
+ {
+ return type;
+ }
+
+ public String toString()
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append("BaseSelector[");
+ builder.append("alias=").append(getAlias()).append(", ");
+ builder.append("type=").append(getType());
+ builder.append("]");
+ return builder.toString();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.alfresco.repo.search.impl.querymodel.Source#getSelectorNames()
+ */
+ public Map getSelectors()
+ {
+ HashMap answer = new HashMap();
+ answer.put(getAlias(), this);
+ return answer;
+ }
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseSelectorArgument.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseSelectorArgument.java
new file mode 100644
index 0000000000..dbae43657e
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseSelectorArgument.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl;
+
+import java.io.Serializable;
+
+import org.alfresco.repo.search.impl.querymodel.SelectorArgument;
+
+/**
+ * @author andyh
+ *
+ */
+public class BaseSelectorArgument extends BaseStaticArgument implements SelectorArgument
+{
+
+ private String selector;
+
+ /**
+ * @param name
+ */
+ public BaseSelectorArgument(String name, String selector)
+ {
+ super(name);
+ this.selector = selector;
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.alfresco.repo.search.impl.querymodel.SelectorArgument#getSelector()
+ */
+ public String getSelector()
+ {
+ return selector;
+ }
+
+
+
+ /* (non-Javadoc)
+ * @see org.alfresco.repo.search.impl.querymodel.Argument#getValue()
+ */
+ public Serializable getValue()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+
+ public String toString()
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append("BaseSelectorArgument[");
+ builder.append("name=").append(getName()).append(", ");
+ builder.append("selector=").append(getSelector());
+ builder.append("]");
+ return builder.toString();
+ }
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseStaticArgument.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseStaticArgument.java
new file mode 100644
index 0000000000..cae791414f
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/BaseStaticArgument.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl;
+
+import org.alfresco.repo.search.impl.querymodel.StaticArgument;
+
+/**
+ * @author andyh
+ *
+ */
+public abstract class BaseStaticArgument extends BaseArgument implements StaticArgument
+{
+
+ /**
+ * @param name
+ */
+ public BaseStaticArgument(String name)
+ {
+ super(name);
+ }
+
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/DuplicateSelectorNameException.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/DuplicateSelectorNameException.java
new file mode 100644
index 0000000000..fc6ca51406
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/DuplicateSelectorNameException.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl;
+
+import org.alfresco.error.AlfrescoRuntimeException;
+
+/**
+ * @author andyh
+ *
+ */
+public class DuplicateSelectorNameException extends AlfrescoRuntimeException
+{
+
+ /**
+ * @param msgId
+ * @param msgParams
+ * @param cause
+ */
+ public DuplicateSelectorNameException(String msgId, Object[] msgParams, Throwable cause)
+ {
+ super(msgId, msgParams, cause);
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @param msgId
+ * @param msgParams
+ */
+ public DuplicateSelectorNameException(String msgId, Object[] msgParams)
+ {
+ super(msgId, msgParams);
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @param msgId
+ * @param cause
+ */
+ public DuplicateSelectorNameException(String msgId, Throwable cause)
+ {
+ super(msgId, cause);
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @param msgId
+ */
+ public DuplicateSelectorNameException(String msgId)
+ {
+ super(msgId);
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 3163974668059624874L;
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/functions/Equals.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/functions/Equals.java
new file mode 100644
index 0000000000..ac2a73f276
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/functions/Equals.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl.functions;
+
+import java.io.Serializable;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import org.alfresco.repo.search.impl.querymodel.Argument;
+import org.alfresco.repo.search.impl.querymodel.ArgumentDefinition;
+import org.alfresco.repo.search.impl.querymodel.Multiplicity;
+import org.alfresco.repo.search.impl.querymodel.impl.BaseArgumentDefinition;
+import org.alfresco.repo.search.impl.querymodel.impl.BaseFunction;
+import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
+
+/**
+ * @author andyh
+ *
+ */
+public class Equals extends BaseFunction
+{
+ public final static String NAME = "Equals";
+
+ public final static String ARG_LHS = "LHS";
+
+ public final static String ARG_RHS = "RHS";
+
+ public static LinkedHashSet args;
+
+ static
+ {
+ args = new LinkedHashSet();
+ args.add(new BaseArgumentDefinition(Multiplicity.ANY, ARG_LHS, DataTypeDefinition.ANY, true));
+ args.add(new BaseArgumentDefinition(Multiplicity.ANY, ARG_RHS, DataTypeDefinition.ANY, true));
+ }
+
+ /**
+ * @param name
+ * @param returnType
+ * @param argumentDefinitions
+ */
+ public Equals()
+ {
+ super(NAME, DataTypeDefinition.BOOLEAN, args);
+ }
+
+ /* (non-Javadoc)
+ * @see org.alfresco.repo.search.impl.querymodel.Function#getValue(java.util.Set)
+ */
+ public Serializable getValue(Set args)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/functions/Lower.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/functions/Lower.java
new file mode 100644
index 0000000000..127eaab8ea
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/functions/Lower.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl.functions;
+
+import java.io.Serializable;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import org.alfresco.repo.search.impl.querymodel.Argument;
+import org.alfresco.repo.search.impl.querymodel.ArgumentDefinition;
+import org.alfresco.repo.search.impl.querymodel.Multiplicity;
+import org.alfresco.repo.search.impl.querymodel.impl.BaseArgumentDefinition;
+import org.alfresco.repo.search.impl.querymodel.impl.BaseFunction;
+import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
+
+/**
+ * @author andyh
+ */
+public class Lower extends BaseFunction
+{
+ public final static String NAME = "Lower";
+
+ public final static String ARG_PROPERTY = "Arg";
+
+ public static LinkedHashSet args;
+
+ static
+ {
+ args = new LinkedHashSet();
+ args.add(new BaseArgumentDefinition(Multiplicity.SINGLE_VALUED, ARG_PROPERTY, DataTypeDefinition.ANY, true));
+ }
+
+ /**
+ * @param name
+ * @param returnType
+ * @param argumentDefinitions
+ */
+ public Lower()
+ {
+ super(NAME, DataTypeDefinition.TEXT, args);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.alfresco.repo.search.impl.querymodel.Function#getValue(java.util.Set)
+ */
+ public Serializable getValue(Set args)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/functions/PropertyAccessor.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/functions/PropertyAccessor.java
new file mode 100644
index 0000000000..cf62303a75
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/functions/PropertyAccessor.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl.functions;
+
+import java.io.Serializable;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import org.alfresco.repo.search.impl.querymodel.Argument;
+import org.alfresco.repo.search.impl.querymodel.ArgumentDefinition;
+import org.alfresco.repo.search.impl.querymodel.Multiplicity;
+import org.alfresco.repo.search.impl.querymodel.impl.BaseArgumentDefinition;
+import org.alfresco.repo.search.impl.querymodel.impl.BaseFunction;
+import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
+
+/**
+ * @author andyh
+ */
+public class PropertyAccessor extends BaseFunction
+{
+ public final static String NAME = "Upper";
+
+ public final static String ARG_PROPERTY = "Arg";
+
+ public static LinkedHashSet args;
+
+ static
+ {
+ args = new LinkedHashSet();
+ args.add(new BaseArgumentDefinition(Multiplicity.SINGLE_VALUED, ARG_PROPERTY, DataTypeDefinition.ANY, true));
+ }
+
+ /**
+ * @param name
+ * @param returnType
+ * @param argumentDefinitions
+ */
+ public PropertyAccessor()
+ {
+ super(NAME, DataTypeDefinition.ANY, args);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.alfresco.repo.search.impl.querymodel.Function#getValue(java.util.Set)
+ */
+ public Serializable getValue(Set args)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/functions/Score.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/functions/Score.java
new file mode 100644
index 0000000000..2d0e9896f9
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/functions/Score.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl.functions;
+
+import java.io.Serializable;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import org.alfresco.repo.search.impl.querymodel.Argument;
+import org.alfresco.repo.search.impl.querymodel.ArgumentDefinition;
+import org.alfresco.repo.search.impl.querymodel.Multiplicity;
+import org.alfresco.repo.search.impl.querymodel.impl.BaseArgumentDefinition;
+import org.alfresco.repo.search.impl.querymodel.impl.BaseFunction;
+import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
+
+/**
+ * @author andyh
+ */
+public class Score extends BaseFunction
+{
+ public final static String NAME = "Score";
+
+ public final static String ARG_PROPERTY = "Qualifier";
+
+ public static LinkedHashSet args;
+
+ static
+ {
+ args = new LinkedHashSet();
+ args.add(new BaseArgumentDefinition(Multiplicity.SINGLE_VALUED, ARG_PROPERTY, DataTypeDefinition.ANY, true));
+ }
+
+ /**
+ * @param name
+ * @param returnType
+ * @param argumentDefinitions
+ */
+ public Score()
+ {
+ super(NAME, DataTypeDefinition.FLOAT, args);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.alfresco.repo.search.impl.querymodel.Function#getValue(java.util.Set)
+ */
+ public Serializable getValue(Set args)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/functions/Upper.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/functions/Upper.java
new file mode 100644
index 0000000000..0347ca3465
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/functions/Upper.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl.functions;
+
+import java.io.Serializable;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import org.alfresco.repo.search.impl.querymodel.Argument;
+import org.alfresco.repo.search.impl.querymodel.ArgumentDefinition;
+import org.alfresco.repo.search.impl.querymodel.Multiplicity;
+import org.alfresco.repo.search.impl.querymodel.impl.BaseArgumentDefinition;
+import org.alfresco.repo.search.impl.querymodel.impl.BaseFunction;
+import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
+
+/**
+ * @author andyh
+ */
+public class Upper extends BaseFunction
+{
+ public final static String NAME = "Upper";
+
+ public final static String ARG_PROPERTY = "Arg";
+
+ public static LinkedHashSet args;
+
+ static
+ {
+ args = new LinkedHashSet();
+ args.add(new BaseArgumentDefinition(Multiplicity.SINGLE_VALUED, ARG_PROPERTY, DataTypeDefinition.ANY, true));
+ }
+
+ /**
+ * @param name
+ * @param returnType
+ * @param argumentDefinitions
+ */
+ public Upper()
+ {
+ super(NAME, DataTypeDefinition.TEXT, args);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.alfresco.repo.search.impl.querymodel.Function#getValue(java.util.Set)
+ */
+ public Serializable getValue(Set args)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/LuceneColumn.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/LuceneColumn.java
new file mode 100644
index 0000000000..9a5bec4677
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/LuceneColumn.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl.lucene;
+
+import java.util.List;
+
+import org.alfresco.repo.search.impl.querymodel.Argument;
+import org.alfresco.repo.search.impl.querymodel.Function;
+import org.alfresco.repo.search.impl.querymodel.impl.BaseColumn;
+
+/**
+ * @author andyh
+ *
+ */
+public class LuceneColumn extends BaseColumn
+{
+
+ /**
+ * @param function
+ * @param functionArguments
+ * @param alias
+ */
+ public LuceneColumn(Function function, List functionArguments, String alias)
+ {
+ super(function, functionArguments, alias);
+ // TODO Auto-generated constructor stub
+ }
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/LuceneFunctionalConstraint.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/LuceneFunctionalConstraint.java
new file mode 100644
index 0000000000..fa99bb534c
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/LuceneFunctionalConstraint.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl.lucene;
+
+import java.util.List;
+
+import org.alfresco.repo.search.impl.querymodel.Argument;
+import org.alfresco.repo.search.impl.querymodel.Function;
+import org.alfresco.repo.search.impl.querymodel.impl.BaseFunctionalConstraint;
+
+/**
+ * @author andyh
+ *
+ */
+public class LuceneFunctionalConstraint extends BaseFunctionalConstraint
+{
+
+ /**
+ * @param function
+ * @param arguments
+ */
+ public LuceneFunctionalConstraint(Function function, List arguments)
+ {
+ super(function, arguments);
+ }
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/LuceneJoin.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/LuceneJoin.java
new file mode 100644
index 0000000000..fc3c7a1a73
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/LuceneJoin.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl.lucene;
+
+import org.alfresco.repo.search.impl.querymodel.Constraint;
+import org.alfresco.repo.search.impl.querymodel.JoinType;
+import org.alfresco.repo.search.impl.querymodel.Source;
+import org.alfresco.repo.search.impl.querymodel.impl.BaseJoin;
+
+/**
+ * @author andyh
+ *
+ */
+public class LuceneJoin extends BaseJoin
+{
+
+ /**
+ * @param left
+ * @param right
+ * @param joinType
+ * @param joinConstraint
+ */
+ public LuceneJoin(Source left, Source right, JoinType joinType, Constraint joinConstraint)
+ {
+ super(left, right, joinType, joinConstraint);
+ // TODO Auto-generated constructor stub
+ }
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/LuceneLiteralArgument.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/LuceneLiteralArgument.java
new file mode 100644
index 0000000000..93d11bd0f6
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/LuceneLiteralArgument.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl.lucene;
+
+import java.io.Serializable;
+
+import org.alfresco.repo.search.impl.querymodel.impl.BaseLiteralArgument;
+import org.alfresco.service.namespace.QName;
+
+/**
+ * @author andyh
+ *
+ */
+public class LuceneLiteralArgument extends BaseLiteralArgument
+{
+
+ /**
+ * @param name
+ * @param type
+ * @param value
+ */
+ public LuceneLiteralArgument(String name, QName type, Serializable value)
+ {
+ super(name, type, value);
+ }
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/LuceneParameterArgument.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/LuceneParameterArgument.java
new file mode 100644
index 0000000000..c71539191b
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/LuceneParameterArgument.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl.lucene;
+
+import org.alfresco.repo.search.impl.querymodel.impl.BaseParameterArgument;
+
+/**
+ * @author andyh
+ *
+ */
+public class LuceneParameterArgument extends BaseParameterArgument
+{
+
+ /**
+ * @param name
+ * @param parameterName
+ */
+ public LuceneParameterArgument(String name, String parameterName)
+ {
+ super(name, parameterName);
+ // TODO Auto-generated constructor stub
+ }
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/LucenePropertyArgument.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/LucenePropertyArgument.java
new file mode 100644
index 0000000000..e24c909a68
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/LucenePropertyArgument.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl.lucene;
+
+import org.alfresco.repo.search.impl.querymodel.impl.BasePropertyArgument;
+import org.alfresco.service.namespace.QName;
+
+/**
+ * @author andyh
+ *
+ */
+public class LucenePropertyArgument extends BasePropertyArgument
+{
+
+ /**
+ * @param name
+ * @param propertyName
+ */
+ public LucenePropertyArgument(String name, String selector, QName propertyName)
+ {
+ super(name, selector, propertyName);
+ }
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/LuceneQueryModelFactory.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/LuceneQueryModelFactory.java
new file mode 100644
index 0000000000..4e50ee61de
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/LuceneQueryModelFactory.java
@@ -0,0 +1,197 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl.lucene;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.List;
+
+import org.alfresco.repo.search.impl.querymodel.Argument;
+import org.alfresco.repo.search.impl.querymodel.Column;
+import org.alfresco.repo.search.impl.querymodel.Constraint;
+import org.alfresco.repo.search.impl.querymodel.DynamicArgument;
+import org.alfresco.repo.search.impl.querymodel.Function;
+import org.alfresco.repo.search.impl.querymodel.Join;
+import org.alfresco.repo.search.impl.querymodel.JoinType;
+import org.alfresco.repo.search.impl.querymodel.LiteralArgument;
+import org.alfresco.repo.search.impl.querymodel.Order;
+import org.alfresco.repo.search.impl.querymodel.Ordering;
+import org.alfresco.repo.search.impl.querymodel.ParameterArgument;
+import org.alfresco.repo.search.impl.querymodel.PropertyArgument;
+import org.alfresco.repo.search.impl.querymodel.Query;
+import org.alfresco.repo.search.impl.querymodel.QueryModelFactory;
+import org.alfresco.repo.search.impl.querymodel.Selector;
+import org.alfresco.repo.search.impl.querymodel.SelectorArgument;
+import org.alfresco.repo.search.impl.querymodel.Source;
+import org.alfresco.repo.search.impl.querymodel.impl.functions.Equals;
+import org.alfresco.repo.search.impl.querymodel.impl.functions.Lower;
+import org.alfresco.repo.search.impl.querymodel.impl.functions.PropertyAccessor;
+import org.alfresco.repo.search.impl.querymodel.impl.functions.Score;
+import org.alfresco.repo.search.impl.querymodel.impl.functions.Upper;
+import org.alfresco.repo.search.impl.querymodel.impl.lucene.functions.LuceneEquals;
+import org.alfresco.repo.search.impl.querymodel.impl.lucene.functions.LuceneLower;
+import org.alfresco.repo.search.impl.querymodel.impl.lucene.functions.LucenePropertyAccessor;
+import org.alfresco.repo.search.impl.querymodel.impl.lucene.functions.LuceneScore;
+import org.alfresco.repo.search.impl.querymodel.impl.lucene.functions.LuceneUpper;
+import org.alfresco.service.namespace.QName;
+
+/**
+ * @author andyh
+ *
+ */
+public class LuceneQueryModelFactory implements QueryModelFactory
+{
+ public static HashMap functions = new HashMap ();
+
+ static
+ {
+ functions.put(Equals.NAME, new LuceneEquals());
+ functions.put(PropertyAccessor.NAME, new LucenePropertyAccessor());
+ functions.put(Score.NAME, new LuceneScore());
+ functions.put(Upper.NAME, new LuceneUpper());
+ functions.put(Lower.NAME, new LuceneLower());
+ }
+
+ /* (non-Javadoc)
+ * @see org.alfresco.repo.search.impl.querymodel.QueryModelFactory#createColumn(org.alfresco.repo.search.impl.querymodel.Function, java.util.List, java.lang.String)
+ */
+ public Column createColumn(Function function, List functionArguments, String alias)
+ {
+ return new LuceneColumn(function, functionArguments, alias);
+ }
+
+ /* (non-Javadoc)
+ * @see org.alfresco.repo.search.impl.querymodel.QueryModelFactory#createConjunction(java.util.List)
+ */
+ public Constraint createConjunction(List constraints)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ /* (non-Javadoc)
+ * @see org.alfresco.repo.search.impl.querymodel.QueryModelFactory#createDisjunction(java.util.List)
+ */
+ public Constraint createDisjunction(List constraints)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ /* (non-Javadoc)
+ * @see org.alfresco.repo.search.impl.querymodel.QueryModelFactory#createFunctionalConstraint(org.alfresco.repo.search.impl.querymodel.Function, java.util.List)
+ */
+ public Constraint createFunctionalConstraint(Function function, List functionArguments)
+ {
+ return new LuceneFunctionalConstraint(function, functionArguments);
+ }
+
+ /* (non-Javadoc)
+ * @see org.alfresco.repo.search.impl.querymodel.QueryModelFactory#createJoin(org.alfresco.repo.search.impl.querymodel.Source, org.alfresco.repo.search.impl.querymodel.Source, org.alfresco.repo.search.impl.querymodel.JoinType, org.alfresco.repo.search.impl.querymodel.Constraint)
+ */
+ public Join createJoin(Source left, Source right, JoinType joinType, Constraint joinCondition)
+ {
+ return new LuceneJoin(left, right, joinType, joinCondition);
+ }
+
+ /* (non-Javadoc)
+ * @see org.alfresco.repo.search.impl.querymodel.QueryModelFactory#createLiteralArgument(java.lang.String, org.alfresco.service.namespace.QName, java.io.Serializable)
+ */
+ public LiteralArgument createLiteralArgument(String name, QName type, Serializable value)
+ {
+ return new LuceneLiteralArgument(name, type, value);
+ }
+
+ /* (non-Javadoc)
+ * @see org.alfresco.repo.search.impl.querymodel.QueryModelFactory#createNegation(org.alfresco.repo.search.impl.querymodel.Constraint)
+ */
+ public Constraint createNegation(Constraint constraint)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ /* (non-Javadoc)
+ * @see org.alfresco.repo.search.impl.querymodel.QueryModelFactory#createOrdering(org.alfresco.repo.search.impl.querymodel.DynamicArgument, org.alfresco.repo.search.impl.querymodel.Order)
+ */
+ public Ordering createOrdering(DynamicArgument argument, Order order)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ /* (non-Javadoc)
+ * @see org.alfresco.repo.search.impl.querymodel.QueryModelFactory#createParameterArgument(java.lang.String, java.lang.String)
+ */
+ public ParameterArgument createParameterArgument(String name, String parameterName)
+ {
+ return new LuceneParameterArgument(name, parameterName);
+ }
+
+ /* (non-Javadoc)
+ * @see org.alfresco.repo.search.impl.querymodel.QueryModelFactory#createPropertyArgument(java.lang.String, org.alfresco.service.namespace.QName)
+ */
+ public PropertyArgument createPropertyArgument(String name, String selector, QName propertyName)
+ {
+ return new LucenePropertyArgument(name, selector, propertyName);
+ }
+
+ /* (non-Javadoc)
+ * @see org.alfresco.repo.search.impl.querymodel.QueryModelFactory#createQuery(java.util.List, org.alfresco.repo.search.impl.querymodel.Source, org.alfresco.repo.search.impl.querymodel.Constraint, java.util.List)
+ */
+ public Query createQuery(List columns, Source source, Constraint constraint, List orderings)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ /* (non-Javadoc)
+ * @see org.alfresco.repo.search.impl.querymodel.QueryModelFactory#createSelector(org.alfresco.service.namespace.QName, java.lang.String)
+ */
+ public Selector createSelector(QName classQName, String alias)
+ {
+ return new LuceneSelector(classQName, alias);
+ }
+
+ /* (non-Javadoc)
+ * @see org.alfresco.repo.search.impl.querymodel.QueryModelFactory#getFunction(java.lang.String)
+ */
+ public Function getFunction(String functionName)
+ {
+ Function function = functions.get(functionName);
+ if(function != null)
+ {
+ return function;
+ }
+ else
+ {
+ throw new UnsupportedOperationException("Missing function "+functionName);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.alfresco.repo.search.impl.querymodel.QueryModelFactory#createSelectorArgument(java.lang.String, java.lang.String)
+ */
+ public SelectorArgument createSelectorArgument(String name, String selectorAlias)
+ {
+ return new LuceneSelectorArgument(name, selectorAlias);
+ }
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/LuceneSelector.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/LuceneSelector.java
new file mode 100644
index 0000000000..a2f91d807b
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/LuceneSelector.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl.lucene;
+
+import org.alfresco.repo.search.impl.querymodel.impl.BaseSelector;
+import org.alfresco.service.namespace.QName;
+
+/**
+ * @author andyh
+ *
+ */
+public class LuceneSelector extends BaseSelector
+{
+
+ /**
+ * @param alias
+ * @param type
+ */
+ public LuceneSelector(QName type, String alias)
+ {
+ super(type, alias);
+ }
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/LuceneSelectorArgument.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/LuceneSelectorArgument.java
new file mode 100644
index 0000000000..354048d560
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/LuceneSelectorArgument.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl.lucene;
+
+import org.alfresco.repo.search.impl.querymodel.impl.BaseSelectorArgument;
+
+/**
+ * @author andyh
+ *
+ */
+public class LuceneSelectorArgument extends BaseSelectorArgument
+{
+
+ /**
+ * @param name
+ * @param selector
+ */
+ public LuceneSelectorArgument(String name, String selector)
+ {
+ super(name, selector);
+ // TODO Auto-generated constructor stub
+ }
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/functions/LuceneEquals.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/functions/LuceneEquals.java
new file mode 100644
index 0000000000..4595a2d5b8
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/functions/LuceneEquals.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl.lucene.functions;
+
+import org.alfresco.repo.search.impl.querymodel.impl.functions.Equals;
+
+/**
+ * @author andyh
+ *
+ */
+public class LuceneEquals extends Equals
+{
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/functions/LuceneLower.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/functions/LuceneLower.java
new file mode 100644
index 0000000000..f8ab946efd
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/functions/LuceneLower.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl.lucene.functions;
+
+import org.alfresco.repo.search.impl.querymodel.impl.functions.Lower;
+
+/**
+ * @author andyh
+ *
+ */
+public class LuceneLower extends Lower
+{
+
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/functions/LucenePropertyAccessor.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/functions/LucenePropertyAccessor.java
new file mode 100644
index 0000000000..87b9273f6b
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/functions/LucenePropertyAccessor.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl.lucene.functions;
+
+import org.alfresco.repo.search.impl.querymodel.impl.functions.PropertyAccessor;
+
+/**
+ * @author andyh
+ */
+public class LucenePropertyAccessor extends PropertyAccessor
+{
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/functions/LuceneScore.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/functions/LuceneScore.java
new file mode 100644
index 0000000000..52a4d8cfa6
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/functions/LuceneScore.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl.lucene.functions;
+
+import org.alfresco.repo.search.impl.querymodel.impl.functions.Score;
+
+/**
+ * @author andyh
+ *
+ */
+public class LuceneScore extends Score
+{
+
+
+}
diff --git a/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/functions/LuceneUpper.java b/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/functions/LuceneUpper.java
new file mode 100644
index 0000000000..20c728eb58
--- /dev/null
+++ b/source/java/org/alfresco/repo/search/impl/querymodel/impl/lucene/functions/LuceneUpper.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.search.impl.querymodel.impl.lucene.functions;
+
+import org.alfresco.repo.search.impl.querymodel.impl.functions.Upper;
+
+/**
+ * @author andyh
+ *
+ */
+public class LuceneUpper extends Upper
+{
+
+}
diff --git a/source/java/org/alfresco/repo/version/common/VersionHistoryImpl.java b/source/java/org/alfresco/repo/version/common/VersionHistoryImpl.java
index 00c02750e0..e69cd5970d 100644
--- a/source/java/org/alfresco/repo/version/common/VersionHistoryImpl.java
+++ b/source/java/org/alfresco/repo/version/common/VersionHistoryImpl.java
@@ -225,11 +225,11 @@ public class VersionHistoryImpl implements VersionHistory
*/
public static class VersionComparator implements Comparator, Serializable
{
- private static final long serialVersionUID = 6227528170880231770L;
+ private static final long serialVersionUID = 6227528170880231770L;
- public int compare(Version v1, Version v2)
+ public int compare(Version v1, Version v2)
{
- return v2.getCreatedDate().compareTo(v1.getCreatedDate());
+ return v2.getCreatedDate().compareTo(v1.getCreatedDate());
}
}