summaryrefslogtreecommitdiffstats
path: root/petascope/src
diff options
context:
space:
mode:
authorConstantin <jucovschi@gmail.com>2010-06-02 20:11:10 +0200
committerConstantin <jucovschi@gmail.com>2010-06-02 20:11:10 +0200
commit93b5abce94b65529df95670dd45260bc469e120b (patch)
treeb82ce43668fc6053e88d2ec4cc4a91e7527cbd4b /petascope/src
parent26c676d01aa3995556d83fbee6a84f87a51915a9 (diff)
parent40e12c6af9d05c3413efaf535c35c625b736cbb9 (diff)
downloadrasdaman-upstream-93b5abce94b65529df95670dd45260bc469e120b.tar.gz
rasdaman-upstream-93b5abce94b65529df95670dd45260bc469e120b.tar.xz
rasdaman-upstream-93b5abce94b65529df95670dd45260bc469e120b.zip
Merge branch 'master' of git://kahlua/petascope
Diffstat (limited to 'petascope/src')
-rw-r--r--petascope/src/log4j.properties34
-rw-r--r--petascope/src/petascope/ConfigManager.java227
-rw-r--r--petascope/src/petascope/PetascopeInterface.java632
-rw-r--r--petascope/src/petascope/PetascopeXmlNamespaceMapper.java63
-rw-r--r--petascope/src/petascope/wcps/grammar/AxisIterator.java50
-rw-r--r--petascope/src/petascope/wcps/grammar/AxisIteratorList.java68
-rw-r--r--petascope/src/petascope/wcps/grammar/BooleanExpr.java57
-rw-r--r--petascope/src/petascope/wcps/grammar/BooleanScalarExpr.java105
-rw-r--r--petascope/src/petascope/wcps/grammar/CastExpr.java48
-rw-r--r--petascope/src/petascope/wcps/grammar/ComplexConst.java51
-rw-r--r--petascope/src/petascope/wcps/grammar/CondenseExpr.java41
-rw-r--r--petascope/src/petascope/wcps/grammar/CondenseOperation.java58
-rw-r--r--petascope/src/petascope/wcps/grammar/ConstantList.java54
-rw-r--r--petascope/src/petascope/wcps/grammar/CoverageConstantExpr.java52
-rw-r--r--petascope/src/petascope/wcps/grammar/CoverageConstructorExpr.java52
-rw-r--r--petascope/src/petascope/wcps/grammar/CoverageExpr.java121
-rw-r--r--petascope/src/petascope/wcps/grammar/CoverageList.java62
-rw-r--r--petascope/src/petascope/wcps/grammar/CrsList.java58
-rw-r--r--petascope/src/petascope/wcps/grammar/CrsTransformExpr.java50
-rw-r--r--petascope/src/petascope/wcps/grammar/DimensionIntervalElement.java60
-rw-r--r--petascope/src/petascope/wcps/grammar/DimensionIntervalExpr.java60
-rw-r--r--petascope/src/petascope/wcps/grammar/DimensionIntervalList.java54
-rw-r--r--petascope/src/petascope/wcps/grammar/DimensionPointElement.java59
-rw-r--r--petascope/src/petascope/wcps/grammar/DimensionPointList.java54
-rw-r--r--petascope/src/petascope/wcps/grammar/DomainExpr.java47
-rw-r--r--petascope/src/petascope/wcps/grammar/EncodedCoverageExpr.java77
-rw-r--r--petascope/src/petascope/wcps/grammar/ExponentialExpr.java47
-rw-r--r--petascope/src/petascope/wcps/grammar/ExtendExpr.java42
-rw-r--r--petascope/src/petascope/wcps/grammar/FieldInterpolationElement.java44
-rw-r--r--petascope/src/petascope/wcps/grammar/FieldInterpolationList.java54
-rw-r--r--petascope/src/petascope/wcps/grammar/ForClause.java40
-rw-r--r--petascope/src/petascope/wcps/grammar/ForClauseElements.java60
-rw-r--r--petascope/src/petascope/wcps/grammar/GeneralCondenseExpr.java67
-rw-r--r--petascope/src/petascope/wcps/grammar/IParseTreeNode.java31
-rw-r--r--petascope/src/petascope/wcps/grammar/ImageCrsDomainMetadataExpr.java45
-rw-r--r--petascope/src/petascope/wcps/grammar/IndexExpr.java69
-rw-r--r--petascope/src/petascope/wcps/grammar/InterpolationMethod.java45
-rw-r--r--petascope/src/petascope/wcps/grammar/InterpolationMethodList.java53
-rw-r--r--petascope/src/petascope/wcps/grammar/IntervalExpr.java56
-rw-r--r--petascope/src/petascope/wcps/grammar/MetaDataExpr.java90
-rw-r--r--petascope/src/petascope/wcps/grammar/NumericScalarExpr.java121
-rw-r--r--petascope/src/petascope/wcps/grammar/ProcessingExpr.java40
-rw-r--r--petascope/src/petascope/wcps/grammar/RangeConstructorExpr.java59
-rw-r--r--petascope/src/petascope/wcps/grammar/RangeConstructorTerm.java48
-rw-r--r--petascope/src/petascope/wcps/grammar/RangeExpr.java53
-rw-r--r--petascope/src/petascope/wcps/grammar/RangeExprList.java54
-rw-r--r--petascope/src/petascope/wcps/grammar/ReduceExpr.java44
-rw-r--r--petascope/src/petascope/wcps/grammar/ReturnClause.java40
-rw-r--r--petascope/src/petascope/wcps/grammar/ScalarExpr.java40
-rw-r--r--petascope/src/petascope/wcps/grammar/ScaleExpr.java57
-rw-r--r--petascope/src/petascope/wcps/grammar/SelectExpr.java52
-rw-r--r--petascope/src/petascope/wcps/grammar/SetMetaDataExpr.java118
-rw-r--r--petascope/src/petascope/wcps/grammar/SliceExpr.java42
-rw-r--r--petascope/src/petascope/wcps/grammar/StoreExpr.java40
-rw-r--r--petascope/src/petascope/wcps/grammar/StringScalarExpr.java58
-rw-r--r--petascope/src/petascope/wcps/grammar/SubsetExpr.java40
-rw-r--r--petascope/src/petascope/wcps/grammar/TrigonometricExpr.java47
-rw-r--r--petascope/src/petascope/wcps/grammar/TrimExpr.java42
-rw-r--r--petascope/src/petascope/wcps/grammar/VariableList.java60
-rw-r--r--petascope/src/petascope/wcps/grammar/WCPSRequest.java76
-rw-r--r--petascope/src/petascope/wcps/grammar/WhereClause.java38
-rw-r--r--petascope/src/petascope/wcps/grammar/wcps.g500
-rw-r--r--petascope/src/petascope/wcps/grammar/wcpsLexer.java8464
-rw-r--r--petascope/src/petascope/wcps/grammar/wcpsParser.java18359
-rw-r--r--petascope/src/petascope/wcps/grammar/wcps_no_actions.g491
-rw-r--r--petascope/src/petascope/wcps/server/cli/f_grammar.java60
-rw-r--r--petascope/src/petascope/wcps/server/cli/grammar.java65
-rw-r--r--petascope/src/petascope/wcps/server/cli/xml.java155
-rw-r--r--petascope/src/petascope/wcps/server/core/AxisIterator.java111
-rw-r--r--petascope/src/petascope/wcps/server/core/AxisName.java57
-rw-r--r--petascope/src/petascope/wcps/server/core/BinaryOperationCoverageExpr.java125
-rw-r--r--petascope/src/petascope/wcps/server/core/BooleanScalarExpr.java138
-rw-r--r--petascope/src/petascope/wcps/server/core/CellDomainElement.java79
-rw-r--r--petascope/src/petascope/wcps/server/core/ComplexConstant.java121
-rw-r--r--petascope/src/petascope/wcps/server/core/CondenseOperation.java73
-rw-r--r--petascope/src/petascope/wcps/server/core/CondenseScalarExpr.java98
-rw-r--r--petascope/src/petascope/wcps/server/core/ConstantCoverageExpr.java164
-rw-r--r--petascope/src/petascope/wcps/server/core/ConstantList.java104
-rw-r--r--petascope/src/petascope/wcps/server/core/ConstructCoverageExpr.java161
-rw-r--r--petascope/src/petascope/wcps/server/core/CoverageExpr.java179
-rw-r--r--petascope/src/petascope/wcps/server/core/CoverageExprPairType.java103
-rw-r--r--petascope/src/petascope/wcps/server/core/CoverageInfo.java168
-rw-r--r--petascope/src/petascope/wcps/server/core/CoverageIterator.java94
-rw-r--r--petascope/src/petascope/wcps/server/core/Crs.java124
-rw-r--r--petascope/src/petascope/wcps/server/core/CrsTransformCoverageExpr.java42
-rw-r--r--petascope/src/petascope/wcps/server/core/DbMetadataSource.java1174
-rw-r--r--petascope/src/petascope/wcps/server/core/DimensionIntervalElement.java221
-rw-r--r--petascope/src/petascope/wcps/server/core/DimensionIntervalList.java55
-rw-r--r--petascope/src/petascope/wcps/server/core/DimensionPointElement.java130
-rw-r--r--petascope/src/petascope/wcps/server/core/DomainElement.java193
-rw-r--r--petascope/src/petascope/wcps/server/core/DynamicMetadataSource.java105
-rw-r--r--petascope/src/petascope/wcps/server/core/EncodeDataExpr.java96
-rw-r--r--petascope/src/petascope/wcps/server/core/ExtendCoverageExpr.java132
-rw-r--r--petascope/src/petascope/wcps/server/core/FieldInterpolationElement.java79
-rw-r--r--petascope/src/petascope/wcps/server/core/FieldName.java52
-rw-r--r--petascope/src/petascope/wcps/server/core/ICoverageInfo.java27
-rw-r--r--petascope/src/petascope/wcps/server/core/IDynamicMetadataSource.java33
-rw-r--r--petascope/src/petascope/wcps/server/core/IMetadataSource.java44
-rw-r--r--petascope/src/petascope/wcps/server/core/IRasNode.java27
-rw-r--r--petascope/src/petascope/wcps/server/core/InducedOperationCoverageExpr.java88
-rw-r--r--petascope/src/petascope/wcps/server/core/InterpolationMethod.java84
-rw-r--r--petascope/src/petascope/wcps/server/core/Metadata.java704
-rw-r--r--petascope/src/petascope/wcps/server/core/MetadataScalarExpr.java37
-rw-r--r--petascope/src/petascope/wcps/server/core/NumericScalarExpr.java173
-rw-r--r--petascope/src/petascope/wcps/server/core/ProcessCoveragesRequest.java252
-rw-r--r--petascope/src/petascope/wcps/server/core/RangeComponent.java87
-rw-r--r--petascope/src/petascope/wcps/server/core/RangeCoverageExpr.java83
-rw-r--r--petascope/src/petascope/wcps/server/core/RangeElement.java163
-rw-r--r--petascope/src/petascope/wcps/server/core/RangeField.java54
-rw-r--r--petascope/src/petascope/wcps/server/core/ReduceScalarExpr.java68
-rw-r--r--petascope/src/petascope/wcps/server/core/SDU.java191
-rw-r--r--petascope/src/petascope/wcps/server/core/ScalarExpr.java171
-rw-r--r--petascope/src/petascope/wcps/server/core/ScaleCoverageExpr.java149
-rw-r--r--petascope/src/petascope/wcps/server/core/SetMetadataCoverageExpr.java42
-rw-r--r--petascope/src/petascope/wcps/server/core/SliceCoverageExpr.java131
-rw-r--r--petascope/src/petascope/wcps/server/core/StringScalarExpr.java63
-rw-r--r--petascope/src/petascope/wcps/server/core/SubsetOperationCoverageExpr.java70
-rw-r--r--petascope/src/petascope/wcps/server/core/TrimCoverageExpr.java133
-rw-r--r--petascope/src/petascope/wcps/server/core/UnaryOperationCoverageExpr.java153
-rw-r--r--petascope/src/petascope/wcps/server/core/VariableReference.java56
-rw-r--r--petascope/src/petascope/wcps/server/core/WCPS.java184
-rw-r--r--petascope/src/petascope/wcps/server/core/Wgs84Crs.java123
-rw-r--r--petascope/src/petascope/wcps/server/core/XmlQuery.java236
-rw-r--r--petascope/src/petascope/wcps/server/exceptions/InvalidCrsException.java29
-rw-r--r--petascope/src/petascope/wcps/server/exceptions/InvalidMetadataException.java36
-rw-r--r--petascope/src/petascope/wcps/server/exceptions/InvalidWcpsRequestException.java38
-rw-r--r--petascope/src/petascope/wcps/server/exceptions/ResourceException.java40
-rw-r--r--petascope/src/petascope/wcps/server/exceptions/WCPSException.java39
-rw-r--r--petascope/src/petascope/wcps/server/servlet/WCPSServlet.java257
-rw-r--r--petascope/src/petascope/wcps/server/test/FullTestsOnline.java380
-rw-r--r--petascope/src/petascope/wcps/server/test/GrammarTest.java123
-rw-r--r--petascope/src/petascope/wcps/server/test/GrammarTestOnline.java204
-rw-r--r--petascope/src/petascope/wcps/server/test/XmlTestOnline.java204
-rw-r--r--petascope/src/petascope/wcs/server/WcsServer.java249
-rw-r--r--petascope/src/petascope/wcs/server/cli/CLI.java179
-rw-r--r--petascope/src/petascope/wcs/server/core/TimeString.java223
-rw-r--r--petascope/src/petascope/wcs/server/core/convertGetCoverage.java498
-rw-r--r--petascope/src/petascope/wcs/server/core/executeDescribeCoverage.java275
-rw-r--r--petascope/src/petascope/wcs/server/core/executeGetCapabilities.java295
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/ActionNotSupportedException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/BadResponseHandlerException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/InputOutputException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/InternalComponentException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/InternalSqlException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/InvalidParameterValueException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/InvalidPropertyValueException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/InvalidRequestException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/InvalidServiceConfigurationException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/InvalidTemporalMetadataException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/MaliciousQueryException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/MissingParameterValueException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/MultiBandImagesNotSupportedException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/NoApplicableCodeException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/NodeParsingNotImplementedException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/NotEnoughStorageException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/RasdamanRequestFailedException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/RasdamanUnavailableException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/ServletConnectionException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/UnsupportedCombinationException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/WCSException.java148
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/WcsRuntimeException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/XmlNotValidException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/XmlStructuresException.java41
-rw-r--r--petascope/src/petascope/wcs2/schemas/Examples/requestDescribeCoverage.xml8
-rw-r--r--petascope/src/petascope/wcs2/schemas/Examples/requestGetCapabilities.xml10
-rw-r--r--petascope/src/petascope/wcs2/schemas/Examples/requestGetCoverage.xml18
-rw-r--r--petascope/src/petascope/wcs2/schemas/Examples/responseDescribeCoverage.xml37
-rw-r--r--petascope/src/petascope/wcs2/schemas/Examples/responseGetCapabilities.xml60
-rw-r--r--petascope/src/petascope/wcs2/schemas/Examples/responseGetCoverage.xml40
-rw-r--r--petascope/src/petascope/wcs2/schemas/Examples/wcsDescribeCoverage.xml57
-rw-r--r--petascope/src/petascope/wcs2/schemas/Examples/wcsGetCapabilities.xml125
-rw-r--r--petascope/src/petascope/wcs2/schemas/Examples/wcsGetCoverage.xml57
-rw-r--r--petascope/src/petascope/wcs2/schemas/SchemaServlet.java96
-rw-r--r--petascope/src/petascope/wcs2/schemas/gml/Examples/2dIdentityConversion.xml16
-rw-r--r--petascope/src/petascope/wcs2/schemas/gml/Examples/2dIdentityMethod.xml22
-rw-r--r--petascope/src/petascope/wcs2/schemas/gml/Examples/exampleRangeStructure.xml35
-rw-r--r--petascope/src/petascope/wcs2/schemas/gml/Examples/exampleRectifiedGridCoverage.xml56
-rw-r--r--petascope/src/petascope/wcs2/schemas/gml/Examples/exampleReferenceablGridCoverage.xml60
-rw-r--r--petascope/src/petascope/wcs2/schemas/gml/gmlwcsAll.xsd21
-rw-r--r--petascope/src/petascope/wcs2/schemas/gml/wcsCoverage.xsd160
-rw-r--r--petascope/src/petascope/wcs2/schemas/gml/wcsDataTypeIdentifiers.xml111
-rw-r--r--petascope/src/petascope/wcs2/schemas/gml/wcsGrids.xsd156
-rw-r--r--petascope/src/petascope/wcs2/schemas/wcsAll.xsd21
-rw-r--r--petascope/src/petascope/wcs2/schemas/wcsCommon.xsd87
-rw-r--r--petascope/src/petascope/wcs2/schemas/wcsDescribeCoverage.xsd73
-rw-r--r--petascope/src/petascope/wcs2/schemas/wcsExtensions.xml125
-rw-r--r--petascope/src/petascope/wcs2/schemas/wcsGetCapabilities.xsd56
-rw-r--r--petascope/src/petascope/wcs2/schemas/wcsGetCoverage.xsd88
-rw-r--r--petascope/src/petascope/wcs2/server/Wcs2Server.java119
-rw-r--r--petascope/src/petascope/wcs2/server/ops/DescribeCoverage.java203
-rw-r--r--petascope/src/petascope/wcs2/server/ops/GetCapabilities.java84
-rw-r--r--petascope/src/petascope/wcs2/server/ops/GetCoverage.java528
-rw-r--r--petascope/src/petascope/wcs2/server/ops/WcsOperation.java35
-rw-r--r--petascope/src/petascope/wcs2/server/templates/DescribeCoverageTemplate.xml38
-rw-r--r--petascope/src/petascope/wcs2/server/templates/GetCapabilitiesTemplate.xml92
-rw-r--r--petascope/src/petascope/wcs2/server/templates/GetCoverageTemplate.xml38
-rw-r--r--petascope/src/petascope/wcs2/server/templates/WcsNamespaceContext.java58
-rw-r--r--petascope/src/petascope/wcst/server/WcstServer.java249
-rw-r--r--petascope/src/petascope/wcst/server/servlet/wcstServlet.java161
-rw-r--r--petascope/src/petascope/wcst/transaction/ServiceFirewall.java52
-rw-r--r--petascope/src/petascope/wcst/transaction/executeAsyncTransaction.java162
-rw-r--r--petascope/src/petascope/wcst/transaction/executeTransaction.java1152
-rw-r--r--petascope/src/petascope/wcst/transaction/tools/RasdamanUtils.java472
-rw-r--r--petascope/src/petascope/wcst/transaction/tools/TestRasdamanUtils.java202
-rw-r--r--petascope/src/petascope/wps/server/WpsServer.java126
-rw-r--r--petascope/src/petascope/wps/templates/DescribeProcess.xml77
-rw-r--r--petascope/src/petascope/wps/templates/GetCapabilities.xml65
207 files changed, 49772 insertions, 0 deletions
diff --git a/petascope/src/log4j.properties b/petascope/src/log4j.properties
new file mode 100644
index 0000000..b394c5f
--- /dev/null
+++ b/petascope/src/log4j.properties
@@ -0,0 +1,34 @@
+# =============================================================
+# ------------------- petascope log configuration ------------
+# =============================================================
+#
+# This is the configuration file for the log4j-based petascope logging.
+#
+# =============================================================
+# ------------------- log output configuration ---------------
+# =============================================================
+
+# The rootLogger option defines where the log output should go.
+# Log4j uses appender to direct the output to a specific target.
+# By default deegree logs to the console (appender: stdout)
+log4j.rootLogger=INFO, stdout
+# To also log into a logfile (example below):
+#log4j.rootLogger=INFO, logfile, stdout
+
+# Below is the configuration of the log appender. The format of
+# the log messages is configured with the ConversionPattern option.
+# see http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PatternLayout.html
+
+# =============== console output appender =====================
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=[%d{HH:mm:ss}] %5p: [%c{1}] %m%n
+
+# =================== common logging =========================
+# The log level for all classes that are not configured below.
+log4j.logger.petascope=INFO
+
+log4j.logger.petascope.wcps=DEBUG
+log4j.logger.petascope.wcst=DEBUG
+log4j.logger.petascope.wcs=DEBUG
+log4j.logger.petascope.wcs2=TRACE \ No newline at end of file
diff --git a/petascope/src/petascope/ConfigManager.java b/petascope/src/petascope/ConfigManager.java
new file mode 100644
index 0000000..01b0261
--- /dev/null
+++ b/petascope/src/petascope/ConfigManager.java
@@ -0,0 +1,227 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope;
+
+//~--- JDK imports ------------------------------------------------------------
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+
+import java.io.InputStream;
+import java.net.URI;
+import java.util.Properties;
+import javax.servlet.ServletException;
+import org.apache.commons.io.IOUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import petascope.wcs2.server.templates.WcsNamespaceContext;
+
+/**
+ * Configuration Manager class: a single entry point for all server settings.
+ * Implements the singleton design pattern.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class ConfigManager {
+
+ private static Logger LOG = LoggerFactory.getLogger(ConfigManager.class);
+
+ /* Major version number. This is the first release (1). */
+ private final static String MAJOR = "1";
+ /* Minor version number. v2 adds the reference implementation of WCS 2.0.
+ v3 adds WGS84 handling in WCPS requests, and v4 adds a WPS implementation. */
+ private final static String MINOR = "4";
+ /* Bug-fix count. We have a hack: every WCPS response is written to disk. */
+ private final static String BUGFIX = "11-hack";
+
+ /* Petascope 1.2.0 contains WCS 1.1.0, WCS 2.0, WCS-T 1.0.0 and WCPS 1.0.0 */
+ public final static String PETASCOPE_VERSION = MAJOR + "." + MINOR + "." + BUGFIX;
+ /* Settings variables */
+ public static String WCST_LANGUAGE;
+ public static String WCST_VERSION;
+ public static String RASDAMAN_URL;
+ public static String RASDAMAN_DATABASE;
+ public static String METADATA_DRIVER;
+ public static String METADATA_URL;
+ public static String METADATA_USER;
+ public static String METADATA_PASS;
+ public static boolean CCIP_HACK = false;
+
+ /* WCS 2.0 variables */
+ public static String WCS2_GET_CAPABILITIES_TEMPLATE;
+ public static String WCS2_DESCRIBE_COVERAGE_TEMPLATE;
+ public static String WCS2_GET_COVERAGE_TEMPLATE;
+ public static String WCS2_SCHEMA_URL;
+
+ /* This URL gets initialized automatically when the first request is received.
+ * Its value is used in the Capabilities response */
+ public static String PETASCOPE_SERVLET_URL;
+
+ /* WCS-T Settings. Overridden by user-preferences in <code>settings.properties</code> */
+ public static String WCST_DEFAULT_INTERPOLATION = "none";
+ public static String WCST_DEFAULT_NULL_RESISTANCE = "none";
+ public static String WCST_DEFAULT_DATATYPE = "unsigned char";
+ /* Singleton instance */
+ private static ConfigManager instance;
+ private static Properties props;
+
+ /**
+ * Private constructor. Use <i>getInstance()</i>.
+ *
+ * @param settingsPath Path to the settings properties file
+ * @param servletRoot Path to the root folder where the servlet is deployed
+ */
+ private ConfigManager(String settingsPath, String servletRoot) throws ServletException {
+ props = new Properties();
+ try {
+ LOG.info("Loading settings from file: " + settingsPath);
+ props.load(new FileInputStream(settingsPath));
+ initSettings(servletRoot);
+ } catch (IOException e) {
+ LOG.error("Failed to load settings. Stack trace: " + e);
+ throw new ServletException("Failed to load settings file.");
+ }
+ }
+
+ /**
+ * Returns the instance of the ConfigManager. If no such instance exists,
+ * it creates one with the specified settings file.
+ *
+ * @param settingsPath Path to the settings file
+ * @param servletRoot Path to the deployed servlet root
+ * @return instance of the ConfigManager class
+ */
+ public static ConfigManager getInstance(String settingsPath, String servletRoot) throws ServletException {
+ if (instance == null) {
+ instance = new ConfigManager(settingsPath, servletRoot);
+ }
+
+ return instance;
+ }
+
+ public static ConfigManager getInstance() {
+ if (instance == null) {
+ throw new RuntimeException("Could not initialize the ConfigManager "
+ + "because no settings file path was provided.");
+ }
+ return instance;
+ }
+
+ /**
+ * Return a setting value from the settings file
+ *
+ * @param key Key of the setting
+ * @return String value, or the empty string in case the key does not exist
+ */
+ private String get(String key) {
+ String result = "";
+
+ if (props.containsKey(key)) {
+ result = props.getProperty(key);
+ }
+
+ return result;
+ }
+
+ private void initSettings(String servletRoot) {
+ WCST_LANGUAGE = get("wcst_language");
+ WCST_VERSION = get("wcst_version");
+ RASDAMAN_DATABASE = get("rasdaman_database");
+ RASDAMAN_URL = get("rasdaman_url");
+ METADATA_DRIVER = get("metadata_driver");
+ METADATA_URL = get("metadata_url");
+ METADATA_USER = get("metadata_user");
+ METADATA_PASS = get("metadata_pass");
+
+ CCIP_HACK = Boolean.parseBoolean(get("ccip_version"));
+
+ try {
+ URI desc = WcsNamespaceContext.class.getResource("DescribeCoverageTemplate.xml").toURI();
+ URI getcov = WcsNamespaceContext.class.getResource("GetCoverageTemplate.xml").toURI();
+ URI getcap = WcsNamespaceContext.class.getResource("GetCapabilitiesTemplate.xml").toURI();
+ WCS2_GET_CAPABILITIES_TEMPLATE = loadFile(getcap);
+ WCS2_DESCRIBE_COVERAGE_TEMPLATE = loadFile(desc);
+ WCS2_GET_COVERAGE_TEMPLATE = loadFile(getcov);
+ WCS2_SCHEMA_URL = get("wcs2_schema_url");
+
+ } catch (Exception e) {
+ LOG.warn("Could not read XML template files for WCS 2.0. Therefore, WCS 2.0 will be unable to start.");
+ }
+
+ /* User preferences override default values for WCS-T */
+ String tmp = get("default_interpolation");
+ if (tmp.length() > 0) {
+ WCST_DEFAULT_INTERPOLATION = tmp;
+ }
+ tmp = get("default_null_resistance");
+ if (tmp.length() > 0) {
+ WCST_DEFAULT_NULL_RESISTANCE = tmp;
+ }
+ tmp = get("default_datatype");
+ if (tmp.length() > 0) {
+ WCST_DEFAULT_DATATYPE = tmp;
+ }
+
+ LOG.info("---------------------------");
+ if (CCIP_HACK) {
+ LOG.info("-----------CCIP------------");
+ }
+ LOG.info("---------------------------");
+
+// log("Print Log: " + PRINT_LOG);
+ LOG.info(" *** PETASCOPE *** ");
+ LOG.info("Rasdaman URL: " + RASDAMAN_URL);
+ LOG.info("Rasdaman DB: " + RASDAMAN_DATABASE);
+ LOG.info("Metadata Driver: " + METADATA_DRIVER);
+ LOG.info("Metadata URL: " + METADATA_URL);
+ LOG.info("Metadata Username: " + METADATA_USER);
+// LOG.info("Metadata Password: " + METADATA_PASS);
+ LOG.info(" *** WCS-T *** ");
+ LOG.info("WCS-T Language: " + WCST_LANGUAGE);
+ LOG.info("WCS-T Version: " + WCST_VERSION);
+ LOG.info("WCS-T Default Interpolation: " + WCST_DEFAULT_INTERPOLATION);
+ LOG.info("WCS-T Default Null Resistance: " + WCST_DEFAULT_NULL_RESISTANCE);
+ LOG.info("WCS-T Default Datatype: " + WCST_DEFAULT_DATATYPE);
+ LOG.info(" *** WCS 2.0 *** ");
+ LOG.trace("Get Capabilities Template: " + WCS2_GET_CAPABILITIES_TEMPLATE.substring(0, 100));
+ LOG.trace("Describe Coverage Template: " + WCS2_DESCRIBE_COVERAGE_TEMPLATE.substring(0, 100));
+ LOG.trace("Get Capabilities Template: " + WCS2_GET_COVERAGE_TEMPLATE.substring(0, 100));
+ LOG.info("---------------------------");
+ }
+
+ private String loadFile(URI fileUri) throws IOException {
+ InputStream is = null;
+ String contents = null;
+ try {
+ LOG.debug("Loading file: " + fileUri);
+ File f = new File(fileUri);
+ is = new FileInputStream(f);
+ contents = IOUtils.toString(is);
+ } finally {
+ try {
+ is.close();
+ } catch (IOException ex) {
+ }
+ }
+ return contents;
+ }
+}
diff --git a/petascope/src/petascope/PetascopeInterface.java b/petascope/src/petascope/PetascopeInterface.java
new file mode 100644
index 0000000..5b2b2d0
--- /dev/null
+++ b/petascope/src/petascope/PetascopeInterface.java
@@ -0,0 +1,632 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope;
+
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
+import java.lang.String;
+import java.net.URISyntaxException;
+import java.net.URLDecoder;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Level;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.bind.JAXBException;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+import net.opengis.ows.v_1_0_0.ExceptionReport;
+import org.antlr.runtime.RecognitionException;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.log4j.PropertyConfigurator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xml.sax.SAXException;
+import petascope.wcps.server.core.DbMetadataSource;
+import petascope.wcps.server.core.ProcessCoveragesRequest;
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.ResourceException;
+import petascope.wcps.server.core.WCPS;
+import petascope.wcps.server.exceptions.WCPSException;
+import petascope.wcs.server.exceptions.WCSException;
+import petascope.wcs.server.WcsServer;
+import petascope.wcs.server.exceptions.InputOutputException;
+import petascope.wcs.server.exceptions.InternalComponentException;
+import petascope.wcs.server.exceptions.InvalidRequestException;
+import petascope.wcs.server.exceptions.NoApplicableCodeException;
+import petascope.wcs.server.exceptions.ServletConnectionException;
+import petascope.wcs.server.exceptions.WcsRuntimeException;
+import petascope.wcs.server.exceptions.XmlNotValidException;
+import petascope.wcs2.server.Wcs2Server;
+import petascope.wcs2.server.templates.WcsNamespaceContext;
+import petascope.wcst.server.WcstServer;
+import petascope.wps.server.WpsServer;
+
+/** This servlet is a unified entry-point for all the PetaScope services.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class PetascopeInterface extends HttpServlet {
+
+ private static Logger LOG = LoggerFactory.getLogger(PetascopeInterface.class);
+ private DbMetadataSource metadataSource;
+
+ /* Xml documents utils */
+ DocumentBuilder builder = null;
+ XPathFactory xpathFactory = XPathFactory.newInstance();
+ /* Path to the settings file, in the web archive */
+ private String relativeSettingsPath = "/settings.properties";
+ // path to the default HTML response of the interface servlet
+ private String usageFilePath = "/templates/interface-servlet.html";
+ // String containing the HTML code for the default response
+ private String usageMessage;
+ /* Instance of WcsServer-T service */
+ private WcstServer wcst;
+ /* Instance of WCPS service */
+ private WCPS wcps;
+ /* Instance of WcsServer service */
+ private WcsServer wcs;
+ private Wcs2Server wcs2;
+
+ /* Initialize the various services: WCPS, WcsServer and WcsServer-T */
+ @Override
+ public void init() throws ServletException {
+
+ LOG.info("-----------------------------------------------");
+ LOG.info(" PetaScope {} starting ...", ConfigManager.PETASCOPE_VERSION);
+ LOG.info("-----------------------------------------------");
+
+ // Initialize the singleton configuration manager. Now all classes can read the settings.
+ String settingsPath = getServletContext().getRealPath(relativeSettingsPath);
+ ConfigManager config = ConfigManager.getInstance(settingsPath, getServletContext().getRealPath("/"));
+
+ // Initialize the logging system
+ PropertyConfigurator.configure(getServletContext().getRealPath("/log4j.properties"));
+
+
+ // Read servlet HTML usage message from disk
+ try {
+ usageFilePath = getServletContext().getRealPath(usageFilePath);
+ usageMessage = FileUtils.readFileToString(new File(usageFilePath));
+ } catch (IOException e) {
+ LOG.error("Could not read default servlet HTML response. Stack trace: {}", e);
+ throw new ServletException("Could not read interface servlet HTML response", e);
+ }
+
+ /* Initialize WCPS Service */
+ try {
+ LOG.info("WCPS: initializing metadata database");
+ metadataSource =
+ new DbMetadataSource(ConfigManager.METADATA_DRIVER,
+ ConfigManager.METADATA_URL,
+ ConfigManager.METADATA_USER,
+ ConfigManager.METADATA_PASS, false);
+
+ LOG.debug("WCPS: initializing WCPS core");
+ wcps = new WCPS(metadataSource);
+
+ LOG.info("WCPS: initialization complete");
+ } catch (ParserConfigurationException e) {
+ LOG.error("Stack trace: {}", e);
+ throw new ServletException("Fatal: WCPS initialization error", e);
+ } catch (WCPSException e) {
+ LOG.error("Stack trace: {}", e);
+ throw new ServletException("Fatal: WCPS initialization error", e);
+ }
+
+ /* Initialize WCS Service */
+ try {
+ LOG.info("WCS Initialization ...");
+ wcs = new WcsServer(settingsPath, metadataSource);
+ LOG.info("WCS: Initialization complete.");
+ } catch (Exception e) {
+ LOG.error("Stack trace: {}", e);
+ throw new ServletException("Fatal: WCS initialization error", e);
+ }
+
+ /* Initialize WCS 2.0 Service */
+ try {
+ LOG.info("WCS 2.0 Initialization ...");
+ wcs2 = new Wcs2Server(settingsPath, metadataSource);
+ LOG.info("WCS 2.0: Initialization complete.");
+ } catch (Exception e) {
+ LOG.error("Stack trace: {}", e);
+ throw new ServletException("Fatal: WCS 2.0 initialization error", e);
+ }
+
+ /* Initialize WCS-T Service */
+ try {
+ LOG.info("WCS-T: Initializing ...");
+ wcst = new WcstServer(metadataSource);
+ LOG.info("WCS-T: Initialization complete.");
+ } catch (WCSException e) {
+ LOG.error("Stack trace: {}", e);
+ throw new ServletException("Fatal: WCS-T initialization error", e);
+ }
+
+ /* Initialize XML parsing for request redirection */
+ try {
+ DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
+ domFactory.setNamespaceAware(true); // never forget this!
+ builder = domFactory.newDocumentBuilder();
+ } catch (Exception e) {
+ LOG.error("Stack trace: {}", e);
+ throw new ServletException("Fatal: Error initializing XML parser", e);
+ }
+
+ LOG.info("-----------------------------------------------");
+ LOG.info(" PetaScope {} successfully started ", ConfigManager.PETASCOPE_VERSION);
+ LOG.info("-----------------------------------------------");
+ }
+
+ /* Build a dictionary of parameter names and values, given a request string */
+ private Map<String, String> buildParameterDictionary(String request) {
+ HashMap<String, String> map = new HashMap<String, String>(3);
+ if (request == null) {
+ return map;
+ }
+
+ String[] pairs = request.split("&");
+ String key = null, val = null;
+ int pos = -1;
+ for (int i = 0; i < pairs.length; i++) {
+ pos = pairs[i].indexOf("=");
+ if (pos != -1) {
+ key = pairs[i].substring(0, pos);
+ val = pairs[i].substring(pos + 1, pairs[i].length());
+ map.put(key, val);
+ }
+ }
+
+ return map;
+ }
+
+ /* URL-decode a string, if needed */
+ private String urldecode(String encodedText, String contentType) throws UnsupportedEncodingException {
+ if (encodedText == null) {
+ return null;
+ }
+ String decoded = encodedText;
+ LOG.trace("Found URL encoded text: {}", encodedText);
+ if (contentType != null && contentType.equals("application/x-www-form-urlencoded") && encodedText.indexOf(" ") == -1) {
+ decoded = URLDecoder.decode(encodedText, "UTF-8");
+ }
+ LOG.trace("Returning decoded text: {}", decoded);
+ return decoded;
+ }
+
+ /* Respond to Post requests just like in the case of Get requests */
+ @Override
+ public void doPost(HttpServletRequest httpRequest, HttpServletResponse httpResponse) {
+ /* Init the Petascope URL automatically, for GetCapabilities response */
+ if (ConfigManager.PETASCOPE_SERVLET_URL == null) {
+ ConfigManager.PETASCOPE_SERVLET_URL = httpRequest.getRequestURL().toString();
+ }
+ /* Treat POST requests just like GET requests */
+ doGet(httpRequest, httpResponse);
+ }
+
+ /* Handle Get requests. This function delegates the request to the service
+ specified in the request by the "service" parameter. */
+ @Override
+ public void doGet(HttpServletRequest httpRequest, HttpServletResponse httpResponse) {
+ String request = null, requestBody = null;
+
+ /* Init the Petascope URL automatically, for GetCapabilities response */
+ if (ConfigManager.PETASCOPE_SERVLET_URL == null) {
+ ConfigManager.PETASCOPE_SERVLET_URL = httpRequest.getRequestURL().toString();
+ }
+
+ /* List all available coverages, to make sure metadata is available */
+ try {
+ LOG.debug("PetaScope coverages: " + metadataSource.coverages());
+ } catch (ResourceException e) {
+ }
+
+ /* Process the request */
+
+ try {
+ try {
+ requestBody = IOUtils.toString(httpRequest.getReader());
+
+ LOG.trace("POST Request length: " + httpRequest.getContentLength());
+ LOG.trace("POST request body: \n------START REQUEST--------\n"
+ + requestBody + "\n------END REQUEST------\n");
+
+ Map<String, String> params = buildParameterDictionary(requestBody);
+ LOG.trace("Request parameters: {}", params);
+ request = urldecode(params.get("request"), httpRequest.getContentType());
+
+ // WPS 1.0.0 GET interface processing
+ if ((httpRequest.getParameter("Service") != null) && (httpRequest.getParameter("Service").equalsIgnoreCase("WPS"))) {
+ WpsServer wpsServer = new WpsServer(httpResponse, httpRequest);
+ request = wpsServer.request;
+ }
+
+ // To preserve compatibility with previous client versions, we allow
+ // GET requests with parameter "query"
+ String request2 = null;
+ request2 = httpRequest.getParameter("query");
+ if (request2 == null) {
+ request2 = urldecode(params.get("query"), httpRequest.getContentType());
+ }
+ if (request2 != null) {
+ LOG.debug("Received Abstract Syntax Request via GET: \n\t\t{}", request2);
+ request2 = ProcessCoveragesRequest.abstractQueryToXmlQuery(request2);
+ }
+ if (request == null && request2 != null) {
+ request = request2;
+ }
+
+ // Empty request ?
+ if (request == null && (requestBody == null || requestBody.length() == 0)) {
+ printUsage(httpResponse, request);
+ return;
+ }
+
+ // No parameters, just XML in the request body
+ if (request == null && requestBody != null && requestBody.length() > 0) {
+ request = urldecode(requestBody, httpRequest.getContentType());
+
+// if (request.matches(" *<.*") == false)
+// {
+// handleUnknownRequest(request, httpResponse);
+// return;
+// }
+ }
+
+ LOG.debug("Petascope Request: \n------START REQUEST--------\n"
+ + request + "\n------END REQUEST------\n");
+
+ Document doc = builder.parse(IOUtils.toInputStream(request));
+ Element rootElem = doc.getDocumentElement();
+ String root = rootElem.getTagName();
+ LOG.debug("Root Element name: {}", root);
+
+ String version = "1.1.0";
+ try {
+ XPath xpath = xpathFactory.newXPath();
+ xpath.setNamespaceContext(new WcsNamespaceContext());
+ String query = "/*/@version";
+ version = (String) xpath.evaluate(query, doc, XPathConstants.STRING);
+ } catch (XPathExpressionException e) {
+ LOG.warn("The root XML node has no attribute called \"version\"");
+ }
+
+
+ /* The next request types are defined in the WcsServer standard, and
+ are common to all the PetaScope services. */
+ if (root.endsWith("GetCapabilities")) {
+ if (version.startsWith("2")) {
+ handleGetCapabilities2(request, httpResponse);
+ } else {
+ handleGetCapabilities(request, httpResponse);
+ }
+ } else if (root.endsWith("DescribeCoverage")) {
+ if (version.startsWith("2")) {
+ handleDescribeCoverage2(request, httpResponse);
+ } else {
+ handleDescribeCoverage(request, httpResponse);
+ }
+ } else if (root.endsWith("GetCoverage")) {
+ if (version.startsWith("2")) {
+ handleGetCoverage2(request, httpResponse);
+ } else {
+ handleGetCoverage(request, httpResponse);
+ }
+ } else /* ProcessCoverages is defined in the WCPS extension to WcsServer */
+ if (root.endsWith("ProcessCoveragesRequest")) {
+ handleProcessCoverages(request, httpResponse);
+ } else /* Transaction is defined in the WcsServer-T extension to WcsServer */
+ if (root.endsWith("Transaction")) {
+ handleTransaction(request, httpResponse);
+ } else /* Print Error Message */ {
+ handleUnknownRequest(request, httpResponse);
+ }
+ } catch (IOException e) {
+ throw new ServletConnectionException(e.getMessage(), e);
+ } catch (RecognitionException e) {
+ throw new InvalidRequestException(e.getMessage(), e);
+ } catch (SAXException e) {
+ throw new InvalidRequestException(e.getMessage(), e);
+ } catch (WCSException e) {
+ throw e;
+ } catch (Exception e) {
+ // Finally, cast all other exceptions into a WCSException
+ LOG.error("Runtime error : {}", e.getMessage());
+ throw new WcsRuntimeException(e.getMessage(), e);
+ }
+ } // And catch all WCSExceptions, to display to the client
+ catch (WCSException e) {
+ printError(httpResponse, request, e);
+ }
+ }
+
+ private void printUsage(HttpServletResponse httpResponse,
+ String request) throws IOException {
+ PrintWriter out = httpResponse.getWriter();
+ httpResponse.setContentType("text/html");
+ out.write(usageMessage);
+ out.flush();
+ }
+
+ private void printError(HttpServletResponse response,
+ String message, Exception e) {
+ PrintWriter out;
+ try {
+ out = new PrintWriter(response.getOutputStream());
+ } catch (IOException e1) {
+ LOG.error("Could not print exception because of IO error. Stack trace:", e1);
+ return;
+ }
+
+ LOG.error("Error stack trace:", e);
+ if (e instanceof WCSException) {
+ // We can send an error report
+ String output = exceptionToXml((WCSException) e);
+ response.setContentType("text/xml; charset=utf-8");
+ out.println(output);
+ out.close();
+ } else {
+ LOG.trace("setting response mimetype to text/html; charset=utf-8");
+ response.setContentType("text/html; charset=utf-8");
+ LOG.trace("returning the following error message.", e);
+ LOG.trace("end of error message");
+
+ out.println(
+ "<html><head><title>PetaScope</title></head><body>");
+ out.println("<h1>An error has occured</h1>");
+ out.println("<p>" + message + "</p>");
+ out.println("<p>Stack trace:<br/><small>");
+ e.printStackTrace(out);
+ out.println("</small></p></body></html>");
+ out.close();
+ LOG.trace("done with error");
+ }
+
+ }
+
+ private void handleUnknownRequest(String request, HttpServletResponse httpResponse) {
+ request = "'" + request + "'";
+ WCSException e = new NoApplicableCodeException("Could not understand request " + request);
+ printError(httpResponse, request, e);
+ }
+
+ private String exceptionReportToXml(ExceptionReport report) {
+ String output = null;
+ try {
+ javax.xml.bind.JAXBContext jaxbCtx = javax.xml.bind.JAXBContext.newInstance(report.getClass().getPackage().getName());
+ javax.xml.bind.Marshaller marshaller = jaxbCtx.createMarshaller();
+ marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_ENCODING, "UTF-8"); //NOI18N
+ marshaller.setProperty("jaxb.formatted.output", true);
+ marshaller.setProperty("jaxb.schemaLocation",
+ "http://www.opengis.net/ows http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd");
+ marshaller.setProperty("com.sun.xml.bind.namespacePrefixMapper", new PetascopeXmlNamespaceMapper());
+ StringWriter strWriter = new StringWriter();
+ marshaller.marshal(report, strWriter);
+ output = strWriter.toString();
+ System.err.println(output);
+ LOG.debug("Done marshalling Error Report.");
+ } catch (JAXBException e2) {
+ LOG.error("Stack trace: {}", e2);
+ LOG.error("Error stack trace: " + e2);
+ }
+ return output;
+ }
+
+ private String exceptionToXml(WCSException e) {
+ return exceptionReportToXml(e.getReport());
+ }
+
+ /**
+ * GetCapabilities of WCS 1.1
+ * @param request
+ * @param httpResponse
+ * @throws WCSException
+ */
+ private void handleGetCapabilities(String request, HttpServletResponse httpResponse) throws WCSException {
+ String output = wcs.GetCapabilities(request);
+ PrintWriter out;
+ try {
+ out = httpResponse.getWriter();
+ httpResponse.setContentType("text/xml; charset=utf-8");
+ out.write(output);
+ out.flush();
+ out.close();
+ } catch (IOException e) {
+ throw new InputOutputException(e.getMessage(), e);
+ }
+ }
+
+ /**
+ * GetCapabilities of WCS 2.0
+ * @param request
+ * @param httpResponse
+ * @throws WCSException
+ */
+ private void handleGetCapabilities2(String request, HttpServletResponse httpResponse) throws WCSException {
+ String output = wcs2.GetCapabilities(request);
+ PrintWriter out;
+ try {
+ out = httpResponse.getWriter();
+ httpResponse.setContentType("text/xml; charset=utf-8");
+ out.write(output);
+ out.flush();
+ out.close();
+ } catch (IOException e) {
+ throw new InputOutputException(e.getMessage(), e);
+ }
+ }
+
+ /**
+ * DescribeCoverage for WCS 1.1
+ * @param request
+ * @param httpResponse
+ * @throws WCSException
+ */
+ private void handleDescribeCoverage(String request, HttpServletResponse httpResponse) throws WCSException {
+ String output = wcs.DescribeCoverage(request);
+ PrintWriter out;
+ try {
+ out = httpResponse.getWriter();
+ httpResponse.setContentType("text/xml; charset=utf-8");
+ out.write(output);
+ out.flush();
+ out.close();
+ } catch (IOException e) {
+ throw new InputOutputException(e.getMessage(), e);
+ }
+ }
+
+ /**
+ * Describe Coverage for WCS 2.0
+ * @param request
+ * @param httpResponse
+ * @throws WCSException
+ */
+ private void handleDescribeCoverage2(String request, HttpServletResponse httpResponse) throws WCSException {
+ String output = wcs2.DescribeCoverage(request);
+ PrintWriter out;
+ try {
+ out = httpResponse.getWriter();
+ httpResponse.setContentType("text/xml; charset=utf-8");
+ out.write(output);
+ out.flush();
+ out.close();
+ } catch (IOException e) {
+ throw new InputOutputException(e.getMessage(), e);
+ }
+ }
+
+ private void handleGetCoverage(String request, HttpServletResponse httpResponse) throws WCSException, InvalidCrsException {
+ String xmlRequest = wcs.GetCoverage(request, wcps);
+ LOG.debug("Received GetCoverage Request: \n{}", xmlRequest);
+ // Redirect the request to WCPS
+ handleProcessCoverages(xmlRequest, httpResponse);
+ }
+
+ private void handleGetCoverage2(String request, HttpServletResponse httpResponse) throws WCSException {
+ String output = wcs2.GetCoverage(request);
+ PrintWriter out;
+ try {
+ out = httpResponse.getWriter();
+ httpResponse.setContentType("text/xml; charset=utf-8");
+ out.write(output);
+ out.flush();
+ out.close();
+ } catch (IOException e) {
+ throw new InputOutputException(e.getMessage(), e);
+ }
+ }
+
+ private void handleProcessCoverages(String xmlRequest, HttpServletResponse response) throws WCSException, InvalidCrsException {
+ OutputStream webOut = null;
+ try {
+ LOG.debug("Received a ProcessCoverages request: \n{}", xmlRequest);
+
+ LOG.debug("WCPS: preparing request");
+ ProcessCoveragesRequest processCoverageRequest =
+ wcps.pcPrepare(ConfigManager.RASDAMAN_URL, ConfigManager.RASDAMAN_DATABASE,
+ IOUtils.toInputStream(xmlRequest));
+
+ String query = processCoverageRequest.getRasqlQuery();
+ String mime = processCoverageRequest.getMime();
+
+ LOG.debug("Resulting RasQL query: [{}] {}", mime, query);
+
+ LOG.trace("WCPS: executing request");
+
+ List<byte[]> results = processCoverageRequest.execute();
+
+ LOG.debug("WCPS: setting response mimetype to " + mime);
+ response.setContentType(mime);
+ LOG.trace("WCPS: returning response");
+ webOut = response.getOutputStream();
+ if (results.size() > 0) {
+ webOut.write(results.get(0));
+
+ if (ConfigManager.CCIP_HACK == true) {
+ try {
+ String dir = getServletContext().getRealPath("/");
+ File f = new File(dir + "image.jpeg");
+
+ LOG.info("HACK: Writing image to: " + f.getAbsolutePath());
+ {
+ OutputStream os = new DataOutputStream(new FileOutputStream(f, false));
+ os.write(results.get(0));
+ os.close();
+ LOG.info("HACK: Wrote image successfully !");
+ }
+ } catch (Exception e) {
+ LOG.warn("Error while evaluating CCIP hack: '{}'", e.getMessage());
+ }
+ }
+ } else {
+ LOG.warn("WCPS: Warning! No result returned from rasql query.");
+ }
+
+ LOG.debug("WCPS: done");
+ } catch (WCPSException e) {
+ throw new InternalComponentException(e.getMessage(), e);
+ } catch (SAXException e) {
+ throw new XmlNotValidException(e.getMessage(), e);
+ } catch (IOException e) {
+ throw new InputOutputException(e.getMessage(), e);
+ } finally {
+ if (webOut != null) {
+ try {
+ webOut.close();
+ } catch (IOException e) {
+ }
+ }
+ }
+ }
+
+ private void handleTransaction(String request, HttpServletResponse httpResponse) throws WCSException {
+ try {
+ String outputXml = wcst.Transaction(request);
+ PrintWriter out = new PrintWriter(httpResponse.getOutputStream());
+ httpResponse.setContentType("text/xml; charset=utf-8");
+ out.write(outputXml);
+ out.flush();
+ } catch (IOException e) {
+ throw new InputOutputException(e.getMessage(), e);
+ }
+ }
+}
diff --git a/petascope/src/petascope/PetascopeXmlNamespaceMapper.java b/petascope/src/petascope/PetascopeXmlNamespaceMapper.java
new file mode 100644
index 0000000..ccda1cb
--- /dev/null
+++ b/petascope/src/petascope/PetascopeXmlNamespaceMapper.java
@@ -0,0 +1,63 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope;
+
+//~--- JDK imports ------------------------------------------------------------
+import com.sun.xml.bind.marshaller.NamespacePrefixMapper;
+
+public class PetascopeXmlNamespaceMapper extends NamespacePrefixMapper {
+
+ @Override
+ public String getPreferredPrefix(String uri, String id, boolean req) {
+ if (uri.equals("") || uri.equals("http://www.opengis.net/wcs/1.1")) {
+ return "wcs";
+ }
+ if (uri.equals("http://www.w3.org/2001/SMIL20/Language")) {
+ return "smil1";
+ }
+ if (uri.equals("http://www.w3.org/2001/SMIL20/")) {
+ return "smil20";
+ }
+ if (uri.equals("http://www.opengis.net/gml")) {
+ return "gml";
+ }
+ if (uri.equals("http://www.w3.org/1999/xlink")) {
+ return "xlink";
+ }
+ if (uri.equals("http://www.opengis.net/wcs/1.1/ows")) {
+ return "owcs";
+ }
+ if (uri.equals("http://www.opengis.net/ows")
+ || uri.equals("http://www.opengis.net/ows/1.1")) {
+ return "ows";
+ }
+ if (uri.equals("http://www.w3.org/2001/XMLSchema-instance")) {
+ return "xsd";
+ }
+ if (uri.equals("http://www.opengis.net/wcs/1.1/wcst")) {
+ return "wcst";
+ }
+
+ return null;
+
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/AxisIterator.java b/petascope/src/petascope/wcps/grammar/AxisIterator.java
new file mode 100644
index 0000000..95c9f03
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/AxisIterator.java
@@ -0,0 +1,50 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * AxisIterator
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class AxisIterator implements IParseTreeNode {
+
+ String axis;
+ IntervalExpr interval;
+ String var;
+
+ public AxisIterator(String var, String axis, IntervalExpr interval) {
+ this.var = var;
+ this.axis = axis;
+ this.interval = interval;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ result += "<iteratorVar>" + var + "</iteratorVar>";
+ result += "<axis>" + axis + "</axis>";
+ result += interval.toXML();
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/AxisIteratorList.java b/petascope/src/petascope/wcps/grammar/AxisIteratorList.java
new file mode 100644
index 0000000..bc76560
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/AxisIteratorList.java
@@ -0,0 +1,68 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * AxisIteratorList
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class AxisIteratorList implements IParseTreeNode {
+
+ private AxisIterator it;
+ private AxisIteratorList next;
+ private String tag;
+
+ public AxisIteratorList(AxisIterator it) {
+ this.it = it;
+ next = null;
+ tag = "";
+ }
+
+ public AxisIteratorList(AxisIterator it, AxisIteratorList n) {
+ this.it = it;
+ next = n;
+ tag = "";
+ }
+
+ public void setTag(String tag) {
+ this.tag = tag;
+ }
+
+ public String toXML() {
+ String result = "";
+ String tag1 = "<" + tag + ">";
+ String tag2 = "</" + tag + ">";
+
+ if (tag.equals("")) {
+ tag1 = tag2 = "";
+ }
+
+ if (next != null) {
+ next.setTag(tag);
+ result += next.toXML();
+ }
+ result += tag1 + it.toXML() + tag2;
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/BooleanExpr.java b/petascope/src/petascope/wcps/grammar/BooleanExpr.java
new file mode 100644
index 0000000..ee359f7
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/BooleanExpr.java
@@ -0,0 +1,57 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * BooleanExpr
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class BooleanExpr implements IParseTreeNode {
+
+ IParseTreeNode e1, e2;
+ String op;
+
+ public BooleanExpr(String op, CoverageExpr cov) {
+ this.op = op;
+ e1 = cov;
+ }
+
+ public BooleanExpr(String op, CoverageExpr cov, IndexExpr i) {
+ this.op = op;
+ e1 = cov;
+ e2 = i;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ if (op.equalsIgnoreCase("not")) {
+ result = e1.toXML();
+ } else if (op.equalsIgnoreCase("bit")) {
+ result = e1.toXML() + e2.toXML();
+ }
+
+ result = "<" + op + ">" + result + "</" + op + ">";
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/BooleanScalarExpr.java b/petascope/src/petascope/wcps/grammar/BooleanScalarExpr.java
new file mode 100644
index 0000000..641659a
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/BooleanScalarExpr.java
@@ -0,0 +1,105 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * BooleanScalarExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class BooleanScalarExpr implements IParseTreeNode {
+
+ String booleanConstant;
+ IParseTreeNode left, right;
+ BooleanScalarExpr leftBooleanScalarExpr, rightBooleanScalarExpr;
+ NumericScalarExpr leftNumericScalar, rightNumericScalar;
+ String node1, node2;
+ String op;
+
+ public BooleanScalarExpr(String bc) {
+ op = null;
+ booleanConstant = bc;
+ }
+
+ public BooleanScalarExpr(String op, BooleanScalarExpr be) {
+ this.op = op;
+ left = be;
+ }
+
+ public BooleanScalarExpr(String op, BooleanScalarExpr lbe, BooleanScalarExpr rbe) {
+ this.op = op;
+ left = lbe;
+ right = rbe;
+ }
+
+ public BooleanScalarExpr(String op, NumericScalarExpr left, NumericScalarExpr right) {
+ this.op = op;
+ this.left = left;
+ this.right = right;
+ }
+
+ public BooleanScalarExpr(String op, StringScalarExpr e1, StringScalarExpr e2) {
+ this.op = op;
+ left = e1;
+ right = e2;
+ }
+
+ public String toXML() {
+ if (op == null) {
+ return "<booleanConstant>" + booleanConstant + "</booleanConstant>";
+ } else if (op.equals("not")) {
+ return "<booleanNot>" + left.toXML() + "</booleanNot>";
+ } else {
+ if (this.left != null) {
+ node1 = this.left.toXML();
+ }
+
+ if (this.right != null) {
+ node2 = this.right.toXML();
+ }
+
+ if (op.equals("and")) {
+ op = "booleanAnd";
+ } else if (op.equals("or")) {
+ op = "booleanOr";
+ } else if (op.equals("xor")) {
+ op = "booleanXor";
+
+ } else if (op.equals("equals")) {
+ op = "booleanEqualNumeric";
+ } else if (op.equals("notEqual")) {
+ op = "booleanNotEqualNumeric";
+ } else if (op.equals("lessThan")) {
+ op = "booleanLessThan";
+ } else if (op.equals("greaterThan")) {
+ op = "booleanGreaterThan";
+ } else if (op.equals("lessOrEqual")) {
+ op = "booleanLessOrEqual";
+ } else if (op.equals("greaterOrEqual")) {
+ op = "booleanGreaterOrEqual";
+ }
+
+ return "<" + op + ">" + node1 + node2 + "</" + op + ">";
+ }
+
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/CastExpr.java b/petascope/src/petascope/wcps/grammar/CastExpr.java
new file mode 100644
index 0000000..86bbf80
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/CastExpr.java
@@ -0,0 +1,48 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * CastExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class CastExpr implements IParseTreeNode {
+
+ String castType;
+ CoverageExpr coverageExpr;
+
+ public CastExpr(CoverageExpr ce, String ct) {
+ castType = ct;
+ coverageExpr = ce;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ result += "<cast>";
+ result += coverageExpr.toXML();
+ result += "<type>" + castType + "</type>";
+ result += "</cast>";
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/ComplexConst.java b/petascope/src/petascope/wcps/grammar/ComplexConst.java
new file mode 100644
index 0000000..306aad4
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/ComplexConst.java
@@ -0,0 +1,51 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * ComplexConst
+ * @author: Andrei Aiordachioaie
+ */
+public class ComplexConst {
+
+ String re, im;
+
+ /**
+ * ComplexLit constructor comment.
+ */
+ public ComplexConst() {
+ super();
+ }
+
+ public ComplexConst(String val) {
+ int pos = val.indexOf("+i", 0);
+
+ if (pos != -1) {
+ re = val.substring(0, pos - 1);
+ im = val.substring(pos + 2, val.length());
+ }
+ }
+
+ public String toXML() {
+ return "<complexConstant><re>" + re + "</re><im>" + im + "</im></complexConstant";
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/CondenseExpr.java b/petascope/src/petascope/wcps/grammar/CondenseExpr.java
new file mode 100644
index 0000000..1abb422
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/CondenseExpr.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * CondenseExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class CondenseExpr implements IParseTreeNode {
+
+ IParseTreeNode expr;
+ String fun;
+
+ public CondenseExpr(IParseTreeNode re) {
+ expr = re;
+ }
+
+ public String toXML() {
+ return expr.toXML();
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/CondenseOperation.java b/petascope/src/petascope/wcps/grammar/CondenseOperation.java
new file mode 100644
index 0000000..fd3f48e
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/CondenseOperation.java
@@ -0,0 +1,58 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * CondenseOperationType
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class CondenseOperation implements IParseTreeNode {
+
+ String op;
+
+ public CondenseOperation(String op) {
+ this.op = op;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ if (op.equalsIgnoreCase("+")) {
+ result = "opPlus";
+ } else if (op.equalsIgnoreCase("*")) {
+ result = "opMult";
+ } else if (op.equalsIgnoreCase("max")) {
+ result = "opMax";
+ } else if (op.equalsIgnoreCase("min")) {
+ result = "opMin";
+ } else if (op.equalsIgnoreCase("and")) {
+ result = "opAnd";
+ } else if (op.equalsIgnoreCase("or")) {
+ result = "opOr";
+ }
+
+ result = "<" + result + "/>";
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/ConstantList.java b/petascope/src/petascope/wcps/grammar/ConstantList.java
new file mode 100644
index 0000000..5f7bad5
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/ConstantList.java
@@ -0,0 +1,54 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+import java.util.*;
+
+/**
+ * ConstantList
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class ConstantList implements IParseTreeNode {
+
+ LinkedList<String> list;
+
+ public ConstantList(String val) {
+ list = new LinkedList<String>();
+ list.add(val);
+ }
+
+ public void add(String val) {
+ list.add(val);
+ }
+
+ public String toXML() {
+ String result = "";
+ Iterator<String> it = list.iterator();
+
+ while (it.hasNext()) {
+ result += "<value>" + it.next() + "</value>";
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/CoverageConstantExpr.java b/petascope/src/petascope/wcps/grammar/CoverageConstantExpr.java
new file mode 100644
index 0000000..0dd9f8c
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/CoverageConstantExpr.java
@@ -0,0 +1,52 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * CoverageConstantExpr
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class CoverageConstantExpr implements IParseTreeNode {
+
+ AxisIteratorList alist;
+ ConstantList clist;
+ String name;
+
+ public CoverageConstantExpr(String name, AxisIteratorList alist, ConstantList clist) {
+ this.name = name;
+ this.alist = alist;
+ alist.setTag("axisIterator");
+ this.clist = clist;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ result += "<name>" + name + "</name>";
+ result += alist.toXML();
+ result += clist.toXML();
+
+ result = "<const>" + result + "</const>";
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/CoverageConstructorExpr.java b/petascope/src/petascope/wcps/grammar/CoverageConstructorExpr.java
new file mode 100644
index 0000000..6d45238
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/CoverageConstructorExpr.java
@@ -0,0 +1,52 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * CoverageConstructorExpr
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class CoverageConstructorExpr implements IParseTreeNode {
+
+ AxisIteratorList alist;
+ ScalarExpr expr;
+ String name;
+
+ public CoverageConstructorExpr(String name, AxisIteratorList alist, ScalarExpr expr) {
+ this.name = name;
+ this.alist = alist;
+ alist.setTag("axisIterator");
+ this.expr = expr;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ result += "<name>" + name + "</name>";
+ result += alist.toXML();
+ result += expr.toXML();
+
+ result = "<construct>" + result + "</construct>";
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/CoverageExpr.java b/petascope/src/petascope/wcps/grammar/CoverageExpr.java
new file mode 100644
index 0000000..6c38675
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/CoverageExpr.java
@@ -0,0 +1,121 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * CoverageExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class CoverageExpr implements IParseTreeNode {
+
+ String coverageName;
+ IParseTreeNode expr, e1, e2;
+ String function;
+ String op;
+
+ public CoverageExpr(IParseTreeNode n) {
+ expr = n;
+ function = "child";
+ }
+
+ public CoverageExpr(String n) {
+ coverageName = n;
+ function = "coverage";
+ }
+
+ /* Unary Induced Expressions */
+ public CoverageExpr(String op, CoverageExpr ce) {
+ expr = ce;
+ function = "unaryOp";
+ this.op = op;
+ }
+
+ public CoverageExpr(String op, CoverageExpr e1, CoverageExpr e2) {
+ function = "binaryOp";
+ this.op = op;
+ this.e1 = e1;
+ this.e2 = e2;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ if (function.equals("coverage")) {
+ result = "<coverage>" + coverageName + "</coverage>";
+ } else if (function.equals("binaryOp")) {
+ formatOperation();
+ result = "<" + op + ">" + e1.toXML() + e2.toXML() + "</" + op + ">";
+ } else if (function.equals("unaryOp")) {
+ formatOperation();
+ if (op.equals("plus")) {
+ op = "unaryPlus";
+ }
+ if (op.equals("minus")) {
+ op = "unaryMinus";
+ }
+ result = "<" + op + ">" + expr.toXML() + "</" + op + ">";
+ } else if (function.equals("child")) {
+ result = expr.toXML();
+ }
+
+ return result;
+ }
+
+ private void formatOperation() {
+ if (op.equals("+")) {
+ op = "plus";
+ }
+ if (op.equals("-")) {
+ op = "minus";
+ }
+ if (op.equals("*")) {
+ op = "mult";
+ }
+ if (op.equals("/")) {
+ op = "div";
+ }
+
+ // AND, OR, XOR stay the same
+
+ if (op.equals("=")) {
+ op = "equals";
+ }
+ if (op.equals("<")) {
+ op = "lessThan";
+ }
+ if (op.equals(">")) {
+ op = "greaterThan";
+ }
+ if (op.equals("<=")) {
+ op = "lessOrEqual";
+ }
+ if (op.equals(">=")) {
+ op = "greaterOrEqual";
+ }
+ if (op.equals("!=")) {
+ op = "notEqual";
+ }
+
+ // OVERLAY stays the same
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/CoverageList.java b/petascope/src/petascope/wcps/grammar/CoverageList.java
new file mode 100644
index 0000000..18ae542
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/CoverageList.java
@@ -0,0 +1,62 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * CoverageList class represents a CoverageList.
+ * Creation date: (3/3/2003 2:52:55 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class CoverageList implements IParseTreeNode {
+
+ private String coverageName;
+ private CoverageList next;
+
+ public CoverageList(String c) {
+ coverageName = c;
+ next = null;
+ }
+
+ public CoverageList(String c, CoverageList l) {
+ coverageName = c;
+ next = l;
+ }
+
+ public String toXML() {
+ String result = "<coverageName>" + coverageName + "</coverageName>";
+
+ if (next != null) {
+ result += next.toXML();
+ }
+
+ return result;
+ }
+
+ public String toString() {
+ String result = coverageName;
+ if (next != null) {
+ result += next.toString();
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/CrsList.java b/petascope/src/petascope/wcps/grammar/CrsList.java
new file mode 100644
index 0000000..4af5903
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/CrsList.java
@@ -0,0 +1,58 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+import java.util.*;
+
+/**
+ * CrsList
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class CrsList implements IParseTreeNode {
+
+ LinkedList<String> list;
+
+ public CrsList() {
+ list = new LinkedList<String>();
+ }
+
+ public CrsList(String crs) {
+ list = new LinkedList<String>();
+ list.add(crs);
+ }
+
+ public void add(String crs) {
+ list.add(crs);
+ }
+
+ public String toXML() {
+ String result = "";
+ Iterator<String> it = list.iterator();
+
+ while (it.hasNext()) {
+ result += "<crs>" + it.next() + "</crs>";
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/CrsTransformExpr.java b/petascope/src/petascope/wcps/grammar/CrsTransformExpr.java
new file mode 100644
index 0000000..f77c8a7
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/CrsTransformExpr.java
@@ -0,0 +1,50 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * CrsTransformExpr
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class CrsTransformExpr implements IParseTreeNode {
+
+ IParseTreeNode e1, e2, e3;
+
+ public CrsTransformExpr(CoverageExpr expr, DimensionIntervalList list1,
+ FieldInterpolationList list2) {
+ e1 = expr;
+ e2 = list1;
+ e3 = list2;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ result += e1.toXML();
+ result += e2.toXML();
+ result += e3.toXML();
+
+ result = "<crsTransform>" + result + "</crsTransform>";
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/DimensionIntervalElement.java b/petascope/src/petascope/wcps/grammar/DimensionIntervalElement.java
new file mode 100644
index 0000000..3037dc5
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/DimensionIntervalElement.java
@@ -0,0 +1,60 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * DimensionIntervalElement
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class DimensionIntervalElement implements IParseTreeNode {
+
+ String axis;
+ String crs;
+ DimensionIntervalExpr expr;
+
+ public DimensionIntervalElement(String a) {
+ axis = a;
+ }
+
+ public void setCrs(String c) {
+ crs = c;
+ }
+
+ public void setIntervalExpr(DimensionIntervalExpr e) {
+ expr = e;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ result += "<axis>" + axis + "</axis>";
+
+ if (crs != null) {
+ result += "<srsName>" + crs + "</srsName>";
+ }
+
+ result += expr.toXML();
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/DimensionIntervalExpr.java b/petascope/src/petascope/wcps/grammar/DimensionIntervalExpr.java
new file mode 100644
index 0000000..2036041
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/DimensionIntervalExpr.java
@@ -0,0 +1,60 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * DimensionIntervalExpr
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class DimensionIntervalExpr implements IParseTreeNode {
+
+ IParseTreeNode e1, e2;
+ String fun;
+ String str;
+
+ public DimensionIntervalExpr(ScalarExpr exp1, ScalarExpr exp2) {
+ fun = "scalars";
+ e1 = exp1;
+ e2 = exp2;
+ }
+
+ public DimensionIntervalExpr(String cov, String axis, String crs) {
+ fun = "domain metadata";
+ str = "<coverage>" + cov + "</coverage>";
+ str += "<axis>" + axis + "</axis>";
+ str += "<crs>" + crs + "</crs>";
+ }
+
+ public String toXML() {
+ String result = "";
+
+ if (fun.equals("scalars")) {
+ result += "<lowerBound>" + e1.toXML() + "</lowerBound>";
+ result += "<upperBound>" + e2.toXML() + "</upperBound>";
+ } else if (fun.equals("domain metadata")) {
+ result = str;
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/DimensionIntervalList.java b/petascope/src/petascope/wcps/grammar/DimensionIntervalList.java
new file mode 100644
index 0000000..5a98f25
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/DimensionIntervalList.java
@@ -0,0 +1,54 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+import java.util.*;
+
+/**
+ * DimensionIntervalList
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class DimensionIntervalList implements IParseTreeNode {
+
+ LinkedList<DimensionIntervalElement> list;
+
+ public DimensionIntervalList(DimensionIntervalElement e) {
+ list = new LinkedList();
+ list.add(e);
+ }
+
+ public void add(DimensionIntervalElement meth) {
+ list.add(meth);
+ }
+
+ public String toXML() {
+ String result = "";
+ Iterator<DimensionIntervalElement> it = list.iterator();
+
+ while (it.hasNext()) {
+ result += it.next().toXML();
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/DimensionPointElement.java b/petascope/src/petascope/wcps/grammar/DimensionPointElement.java
new file mode 100644
index 0000000..70f9c57
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/DimensionPointElement.java
@@ -0,0 +1,59 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * DimensionPointElement
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class DimensionPointElement implements IParseTreeNode {
+
+ String axis;
+ String crs;
+ ScalarExpr point;
+
+ public DimensionPointElement(String a, ScalarExpr dp) {
+ axis = a;
+ point = dp;
+ }
+
+ public DimensionPointElement(String a, String c, ScalarExpr dp) {
+ axis = a;
+ crs = c;
+ point = dp;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ result += "<axis>" + axis + "</axis>";
+
+ if (crs != null) {
+ result += "<srsName>" + crs + "</srsName>";
+ }
+
+ result += "<slicingPosition>" + point.toXML() + "</slicingPosition>";
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/DimensionPointList.java b/petascope/src/petascope/wcps/grammar/DimensionPointList.java
new file mode 100644
index 0000000..d07a233
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/DimensionPointList.java
@@ -0,0 +1,54 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+import java.util.*;
+
+/**
+ * DimensionPointList
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class DimensionPointList implements IParseTreeNode {
+
+ LinkedList<DimensionPointElement> list;
+
+ public DimensionPointList(DimensionPointElement e) {
+ list = new LinkedList();
+ list.add(e);
+ }
+
+ public void add(DimensionPointElement meth) {
+ list.add(meth);
+ }
+
+ public String toXML() {
+ String result = "";
+ Iterator<DimensionPointElement> it = list.iterator();
+
+ while (it.hasNext()) {
+ result += it.next().toXML();
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/DomainExpr.java b/petascope/src/petascope/wcps/grammar/DomainExpr.java
new file mode 100644
index 0000000..f8c6e91
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/DomainExpr.java
@@ -0,0 +1,47 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * DomainExpr
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class DomainExpr implements IParseTreeNode {
+
+ String var, axis, crs;
+
+ public DomainExpr(String v, String a, String c) {
+ var = v;
+ axis = a;
+ crs = c;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ result += "<coverage>" + var + "</coverage>";
+ result += "<axis>" + axis + "</axis>";
+ result += "<crs>" + crs + "</crs>";
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/EncodedCoverageExpr.java b/petascope/src/petascope/wcps/grammar/EncodedCoverageExpr.java
new file mode 100644
index 0000000..7eb615f
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/EncodedCoverageExpr.java
@@ -0,0 +1,77 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * EncodedCoverageExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class EncodedCoverageExpr implements IParseTreeNode {
+
+ CoverageExpr expr;
+ String extraParams;
+ String format;
+ boolean store;
+
+ public EncodedCoverageExpr(CoverageExpr ce, String fn) {
+ expr = ce;
+ // remove double quotes
+ if (fn.getBytes()[0] == '"' && fn.getBytes()[fn.length() - 1] == '"') {
+ format = fn.substring(1, fn.length() - 1);
+ } else {
+ format = fn;
+ }
+
+ extraParams = null;
+ store = false;
+ }
+
+ public void setParams(String params) {
+ extraParams = params;
+ }
+
+ public void setStoreFlag() {
+ store = true;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ if (store) {
+ result = "<encode store=\"true\">";
+ } else {
+ result = "<encode store=\"false\">";
+ }
+
+ result += expr.toXML();
+ result += "<format>" + format + "</format>";
+
+ if (extraParams != null) {
+ result += "<extraParameters>" + extraParams + "</extraParameters>";
+ }
+
+ result += "</encode>";
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/ExponentialExpr.java b/petascope/src/petascope/wcps/grammar/ExponentialExpr.java
new file mode 100644
index 0000000..e661624
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/ExponentialExpr.java
@@ -0,0 +1,47 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * ExponentialExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class ExponentialExpr implements IParseTreeNode {
+
+ CoverageExpr coverageExpr;
+ String expOperator;
+
+ public ExponentialExpr(String op, CoverageExpr ce) {
+ expOperator = op;
+ coverageExpr = ce;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ result += "<" + expOperator + ">";
+ result += coverageExpr.toXML();
+ result += "</" + expOperator + ">";
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/ExtendExpr.java b/petascope/src/petascope/wcps/grammar/ExtendExpr.java
new file mode 100644
index 0000000..ec94989
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/ExtendExpr.java
@@ -0,0 +1,42 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * ExtendExpr
+ * Creation date: (8/2/2008)
+ * @author: Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class ExtendExpr implements IParseTreeNode {
+
+ CoverageExpr coverageExpr;
+ DimensionIntervalList intervalList;
+
+ public ExtendExpr(CoverageExpr ce, DimensionIntervalList apl) {
+ coverageExpr = ce;
+ intervalList = apl;
+ }
+
+ public String toXML() {
+ return "<extend>" + coverageExpr.toXML() + intervalList.toXML() + "</extend>";
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/FieldInterpolationElement.java b/petascope/src/petascope/wcps/grammar/FieldInterpolationElement.java
new file mode 100644
index 0000000..8499496
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/FieldInterpolationElement.java
@@ -0,0 +1,44 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * FieldInterpolationElement
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class FieldInterpolationElement implements IParseTreeNode {
+
+ String name;
+ IParseTreeNode node;
+
+ public FieldInterpolationElement(String name, InterpolationMethod method) {
+ this.name = name;
+ node = method;
+ }
+
+ public String toXML() {
+ String result = "<name>" + name + "</name>" + node.toXML();
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/FieldInterpolationList.java b/petascope/src/petascope/wcps/grammar/FieldInterpolationList.java
new file mode 100644
index 0000000..ea5f021
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/FieldInterpolationList.java
@@ -0,0 +1,54 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+import java.util.*;
+
+/**
+ * FieldInterpolationList
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class FieldInterpolationList implements IParseTreeNode {
+
+ LinkedList<FieldInterpolationElement> list;
+
+ public FieldInterpolationList(FieldInterpolationElement e) {
+ list = new LinkedList();
+ list.add(e);
+ }
+
+ public void add(FieldInterpolationElement meth) {
+ list.add(meth);
+ }
+
+ public String toXML() {
+ String result = "";
+ Iterator<FieldInterpolationElement> it = list.iterator();
+
+ while (it.hasNext()) {
+ result += it.next().toXML();
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/ForClause.java b/petascope/src/petascope/wcps/grammar/ForClause.java
new file mode 100644
index 0000000..6cbdf8d
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/ForClause.java
@@ -0,0 +1,40 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * ForClause
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class ForClause implements IParseTreeNode {
+
+ ForClauseElements forClauseElements;
+
+ public ForClause(ForClauseElements fce) {
+ forClauseElements = fce;
+ }
+
+ public String toXML() {
+ return forClauseElements.toXML();
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/ForClauseElements.java b/petascope/src/petascope/wcps/grammar/ForClauseElements.java
new file mode 100644
index 0000000..a152348
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/ForClauseElements.java
@@ -0,0 +1,60 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * ForClauseElements
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class ForClauseElements implements IParseTreeNode {
+
+ CoverageList coverageList;
+ ForClauseElements next;
+ String var;
+
+ public ForClauseElements(String v, CoverageList c) {
+ var = v;
+ coverageList = c;
+ }
+
+ public ForClauseElements(String v, CoverageList c, ForClauseElements next) {
+ var = v;
+ coverageList = c;
+ this.next = next;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ result += "<coverageIterator>";
+ result += "<iteratorVar>" + var + "</iteratorVar>";
+ result += coverageList.toXML();
+ result += "</coverageIterator>";
+
+ if (next != null) {
+ result += next.toXML();
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/GeneralCondenseExpr.java b/petascope/src/petascope/wcps/grammar/GeneralCondenseExpr.java
new file mode 100644
index 0000000..a5d8dcd
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/GeneralCondenseExpr.java
@@ -0,0 +1,67 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * GeneralCondenseExpr
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class GeneralCondenseExpr implements IParseTreeNode {
+
+ AxisIteratorList alist;
+ CondenseOperation op;
+ CoverageExpr using;
+ BooleanScalarExpr where;
+
+ public GeneralCondenseExpr(CondenseOperation op, AxisIteratorList al) {
+ this.op = op;
+ alist = al;
+ alist.setTag("iterator");
+ where = null;
+ using = null;
+ }
+
+ public void setWhere(BooleanScalarExpr bse) {
+ where = bse;
+ }
+
+ public void setUsing(CoverageExpr se) {
+ using = se;
+ }
+
+ public String toXML() {
+ String result = "<condense>";
+
+ result += op.toXML();
+ result += alist.toXML();
+
+ if (where != null) {
+ result += "<where>" + where.toXML() + "</where>";
+ }
+
+ result += using.toXML();
+ result += "</condense>";
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/IParseTreeNode.java b/petascope/src/petascope/wcps/grammar/IParseTreeNode.java
new file mode 100644
index 0000000..8dd44ad
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/IParseTreeNode.java
@@ -0,0 +1,31 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/* Author: Sorin Stancu-Mara
+Date: 7 FEB 2007
+Interface that all nodes implement to simplify some of the complex nodes
+ */
+public interface IParseTreeNode {
+
+ public String toXML();
+}
diff --git a/petascope/src/petascope/wcps/grammar/ImageCrsDomainMetadataExpr.java b/petascope/src/petascope/wcps/grammar/ImageCrsDomainMetadataExpr.java
new file mode 100644
index 0000000..9cb4e9c
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/ImageCrsDomainMetadataExpr.java
@@ -0,0 +1,45 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * ImageCrsDomainMetadataExpr Group
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class ImageCrsDomainMetadataExpr implements IParseTreeNode {
+
+ String axis;
+ CoverageExpr cov;
+ NumericScalarExpr n1, n2;
+
+ public ImageCrsDomainMetadataExpr(String covName, String axis) {
+ this.cov = new CoverageExpr(covName);
+ this.axis = axis;
+ }
+
+ public String toXML() {
+ String result = cov.toXML() + "<axis>" + axis + "</axis>";
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/IndexExpr.java b/petascope/src/petascope/wcps/grammar/IndexExpr.java
new file mode 100644
index 0000000..bb95b88
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/IndexExpr.java
@@ -0,0 +1,69 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * IndexExpr
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class IndexExpr implements IParseTreeNode {
+
+ String constant;
+ IParseTreeNode e1, e2;
+ String function;
+ String op;
+
+ public IndexExpr(String constant) {
+ function = "constant";
+ this.constant = constant;
+ }
+
+ public IndexExpr(String op, NumericScalarExpr e1) {
+ this.op = op;
+ this.e1 = e1;
+ function = "op1";
+ }
+
+ public IndexExpr(String op, IndexExpr e1, IndexExpr e2) {
+ this.op = op;
+ this.e1 = e1;
+ this.e2 = e2;
+ function = "op2";
+ }
+
+ public String toXML() {
+ String result = "";
+ String tag1 = "<" + op + ">",
+ tag2 = "</" + op + ">";
+
+ if (function.equals("constant")) {
+ result = "<numericConstant>" + constant + "</numericConstant>";
+ } else if (function.equals("op1")) {
+ result = tag1 + e1.toXML() + tag2;
+ } else if (function.equals("op2")) {
+ result = tag1 + e1.toXML() + e2.toXML() + tag2;
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/InterpolationMethod.java b/petascope/src/petascope/wcps/grammar/InterpolationMethod.java
new file mode 100644
index 0000000..0377ed1
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/InterpolationMethod.java
@@ -0,0 +1,45 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * InterpolationMethod
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class InterpolationMethod implements IParseTreeNode {
+
+ String interp, resistance;
+
+ public InterpolationMethod(String interp, String resist) {
+ this.interp = interp;
+ this.resistance = resist;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ result += "<interpolationMethod>" + interp + "</interpolationMethod>";
+ result += "<nullResistance>" + resistance + "</nullResistance>";
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/InterpolationMethodList.java b/petascope/src/petascope/wcps/grammar/InterpolationMethodList.java
new file mode 100644
index 0000000..2f0d6fe
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/InterpolationMethodList.java
@@ -0,0 +1,53 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+import java.util.*;
+
+/**
+ * InterpolationMethodList
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class InterpolationMethodList implements IParseTreeNode {
+
+ LinkedList<InterpolationMethod> list;
+
+ public InterpolationMethodList() {
+ list = new LinkedList();
+ }
+
+ public void add(InterpolationMethod meth) {
+ list.add(meth);
+ }
+
+ public String toXML() {
+ String result = "";
+ Iterator<InterpolationMethod> it = list.iterator();
+
+ while (it.hasNext()) {
+ result += it.next().toXML();
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/IntervalExpr.java b/petascope/src/petascope/wcps/grammar/IntervalExpr.java
new file mode 100644
index 0000000..9bd251a
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/IntervalExpr.java
@@ -0,0 +1,56 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * IntervalExpr
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class IntervalExpr implements IParseTreeNode {
+
+ IParseTreeNode e1, e2;
+ String function;
+
+ public IntervalExpr(IndexExpr n1, IndexExpr n2) {
+ this.e1 = n1;
+ this.e2 = n2;
+ function = "two indexes";
+ }
+
+ public IntervalExpr(String coverage, String axis) {
+ function = "crs metadata";
+ this.e1 = new ImageCrsDomainMetadataExpr(coverage, axis);
+ }
+
+ public String toXML() {
+ String result = "";
+
+ if (function.equals("two indexes")) {
+ result = e1.toXML() + e2.toXML();
+ } else if (function.equals("crs metadata")) {
+ result = e1.toXML();
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/MetaDataExpr.java b/petascope/src/petascope/wcps/grammar/MetaDataExpr.java
new file mode 100644
index 0000000..7cd39a0
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/MetaDataExpr.java
@@ -0,0 +1,90 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * MetaDataExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class MetaDataExpr implements IParseTreeNode {
+
+ CoverageExpr expr;
+ String field;
+ String function;
+ IParseTreeNode param;
+
+ public MetaDataExpr(DomainExpr dom) {
+ function = "domain";
+ param = dom;
+ }
+
+ // Identifier, ImageCRS, ImageCRSDomain, CrsSet, NullSet
+ public MetaDataExpr(String op, CoverageExpr expr) {
+ function = op;
+ this.expr = expr;
+ }
+
+ // ImageCRSDomain, interpolationDefault, interpolationSet
+ public MetaDataExpr(String op, CoverageExpr expr, String str) {
+ function = op;
+ this.expr = expr;
+ this.field = str;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ if (function.equalsIgnoreCase("imageCrsDomain")) {
+ result += "<imageCrsDomain>";
+ result += expr.toXML();
+
+ if (field != null) {
+ result += "<axis>" + field + "</axis>";
+ }
+
+ result += "</imageCrsDomain>";
+ } else if (function.equalsIgnoreCase("domain")) {
+ result = "<DomainMetadata>" + param.toXML() + "</DomainMetadata>";
+ } else if (function.equalsIgnoreCase("interpolationDefault")) {
+ result += "<interpolationDefault>";
+ result += expr.toXML();
+ result += "<name>" + param + "</param>";
+ result += "</interpolationDefault>";
+ } else if (function.equalsIgnoreCase("interpolationSet")) {
+ result += "<interpolationSet>";
+ result += expr.toXML();
+ result += "<name>" + param + "</param>";
+ result += "</interpolationSet>";
+ } else if (function.equalsIgnoreCase("identifier")
+ || function.equalsIgnoreCase("imageCRS") || function.equalsIgnoreCase("crsSet")
+ || function.equalsIgnoreCase("nullSet")) {
+ result += "<" + function + ">";
+ result += expr.toXML();
+ result += "</" + function + ">";
+ } else {
+ System.err.println("Unknown MetadataExpr operation: " + function);
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/NumericScalarExpr.java b/petascope/src/petascope/wcps/grammar/NumericScalarExpr.java
new file mode 100644
index 0000000..731cf2c
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/NumericScalarExpr.java
@@ -0,0 +1,121 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * NumericScalarExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class NumericScalarExpr implements IParseTreeNode {
+
+ CondenseExpr condense;
+ String constValue;
+ String function;
+ NumericScalarExpr leftNumericScalarExpr, rightNumericScalarExpr;
+
+ public NumericScalarExpr(CondenseExpr c) {
+ condense = c;
+ function = "condense";
+ }
+
+ public NumericScalarExpr(String val) {
+ if (val.contains("+i")) {
+ ComplexConst cc = new ComplexConst(val);
+
+ constValue = cc.toXML();
+ function = "complexConstant";
+ } else {
+ constValue = val;
+ function = "numericConstant";
+ }
+ }
+
+ public NumericScalarExpr(String op, NumericScalarExpr expr) {
+ leftNumericScalarExpr = expr;
+
+ if (op.equals("-")) {
+ function = "numericUnaryMinus";
+ } else
+ if (op.equals("sqrt")) {
+ function = "numericSqrt";
+ } else
+ if (op.equals("abs")) {
+ function = "numericAbs";
+ } else {
+ System.err.println("Unary Operator " + op + " is not recognized!");
+ }
+ }
+
+ public NumericScalarExpr(String varOp, String varName) {
+ if (varOp.equals("var")) {
+ function = "variableRef";
+ constValue = varName;
+ } else {
+ System.err.println("Internal error: this should have been a variable name:" + varName);
+ }
+ }
+
+ public NumericScalarExpr(String op, NumericScalarExpr lbe, NumericScalarExpr rbe) {
+ leftNumericScalarExpr = lbe;
+ rightNumericScalarExpr = rbe;
+
+ if (op.equals("+")) {
+ function = "numericAdd";
+ } else if (op.equals("-")) {
+ function = "numericMinus";
+ } else if (op.equals("*")) {
+ function = "numericMult";
+ } else if (op.equals("/")) {
+ function = "numericDiv";
+ } else {
+ System.err.println("Operator " + op + " is not recognized!");
+ }
+ }
+
+ public String toXML() {
+ String result;
+
+ if (function.equals("complexConstant")) {
+ return constValue;
+ }
+ if (function.equals("condense")) {
+ return condense.toXML();
+ }
+
+ result = "<" + function + ">";
+
+ if (function.equals("numericConstant") || function.equals("variableRef")) {
+ result += constValue;
+ } else {
+ result += leftNumericScalarExpr.toXML();
+
+ if (rightNumericScalarExpr != null) {
+ result += rightNumericScalarExpr.toXML();
+ }
+ }
+
+ result += "</" + function + ">";
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/ProcessingExpr.java b/petascope/src/petascope/wcps/grammar/ProcessingExpr.java
new file mode 100644
index 0000000..c7aacd3
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/ProcessingExpr.java
@@ -0,0 +1,40 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * ProcessingExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class ProcessingExpr implements IParseTreeNode {
+
+ IParseTreeNode expr;
+
+ public ProcessingExpr(IParseTreeNode e) {
+ expr = e;
+ }
+
+ public String toXML() {
+ return expr.toXML();
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/RangeConstructorExpr.java b/petascope/src/petascope/wcps/grammar/RangeConstructorExpr.java
new file mode 100644
index 0000000..9bd4612
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/RangeConstructorExpr.java
@@ -0,0 +1,59 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+import java.util.*;
+
+/**
+ * RangeConstructorExpr
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class RangeConstructorExpr implements IParseTreeNode {
+
+ LinkedList<RangeConstructorTerm> list;
+
+ public RangeConstructorExpr() {
+ list = new LinkedList();
+ }
+
+ public RangeConstructorExpr(String field, CoverageExpr expr) {
+ this();
+ add(field, expr);
+ }
+
+ public void add(String field, CoverageExpr expr) {
+ list.add(new RangeConstructorTerm(field, expr));
+ }
+
+ public String toXML() {
+ String result = "";
+ Iterator<RangeConstructorTerm> it = list.iterator();
+
+ while (it.hasNext()) {
+ result += it.next().toXML();
+ }
+
+ result = "<rangeConstructor>" + result + "</rangeConstructor>";
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/RangeConstructorTerm.java b/petascope/src/petascope/wcps/grammar/RangeConstructorTerm.java
new file mode 100644
index 0000000..3cc2a4a
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/RangeConstructorTerm.java
@@ -0,0 +1,48 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * RangeConstructorTerm, part of a RangeConstructorExpr
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class RangeConstructorTerm implements IParseTreeNode {
+
+ CoverageExpr expr;
+ String field;
+
+ public RangeConstructorTerm(String f, CoverageExpr c) {
+ field = f;
+ expr = c;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ result += "<field>" + field + "</field>";
+ result += expr.toXML();
+
+ result = "<component>" + result + "</component>";
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/RangeExpr.java b/petascope/src/petascope/wcps/grammar/RangeExpr.java
new file mode 100644
index 0000000..227de44
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/RangeExpr.java
@@ -0,0 +1,53 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * RangeExpr
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class RangeExpr implements IParseTreeNode {
+
+ String xml;
+
+ public RangeExpr() {
+ this.xml = "";
+ }
+
+ public RangeExpr(String field, ScalarExpr expr) {
+ this();
+ add(field, expr);
+ }
+
+ public void add(String field, ScalarExpr expr) {
+ String tmp = "";
+
+ tmp += "<field>" + field + "</field>";
+ tmp += expr.toXML();
+ xml += "<component>" + tmp + "</component>";
+ }
+
+ public String toXML() {
+ return xml;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/RangeExprList.java b/petascope/src/petascope/wcps/grammar/RangeExprList.java
new file mode 100644
index 0000000..68046ca
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/RangeExprList.java
@@ -0,0 +1,54 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+import java.util.*;
+
+/**
+ * RangeExprList
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class RangeExprList implements IParseTreeNode {
+
+ LinkedList<RangeExpr> list;
+
+ public RangeExprList() {
+ list = new LinkedList();
+ }
+
+ public void add(RangeExpr expr) {
+ list.add(expr);
+ }
+
+ public String toXML() {
+ String result = "";
+
+ Iterator<RangeExpr> it = list.iterator();
+
+ while (it.hasNext()) {
+ result += "<null>" + it.next().toXML() + "</null>";
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/ReduceExpr.java b/petascope/src/petascope/wcps/grammar/ReduceExpr.java
new file mode 100644
index 0000000..3a14b75
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/ReduceExpr.java
@@ -0,0 +1,44 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * ReduceExpr
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class ReduceExpr implements IParseTreeNode {
+
+ CoverageExpr expr;
+ String op;
+
+ public ReduceExpr(String op, CoverageExpr e) {
+ this.op = op;
+ this.expr = e;
+ }
+
+ public String toXML() {
+ String result = "<reduce><" + op + ">" + expr.toXML() + "</" + op + "></reduce>";
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/ReturnClause.java b/petascope/src/petascope/wcps/grammar/ReturnClause.java
new file mode 100644
index 0000000..f2c1503
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/ReturnClause.java
@@ -0,0 +1,40 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * ReturnClause
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class ReturnClause implements IParseTreeNode {
+
+ IParseTreeNode expr;
+
+ public ReturnClause(IParseTreeNode e) {
+ expr = e;
+ }
+
+ public String toXML() {
+ return expr.toXML();
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/ScalarExpr.java b/petascope/src/petascope/wcps/grammar/ScalarExpr.java
new file mode 100644
index 0000000..4ed4204
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/ScalarExpr.java
@@ -0,0 +1,40 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * ScalarExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class ScalarExpr implements IParseTreeNode {
+
+ IParseTreeNode expr;
+
+ public ScalarExpr(IParseTreeNode e) {
+ expr = e;
+ }
+
+ public String toXML() {
+ return expr.toXML();
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/ScaleExpr.java b/petascope/src/petascope/wcps/grammar/ScaleExpr.java
new file mode 100644
index 0000000..ce533dc
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/ScaleExpr.java
@@ -0,0 +1,57 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * ScaleExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class ScaleExpr implements IParseTreeNode {
+
+ CoverageExpr coverageExpr;
+ FieldInterpolationList interpMethods;
+ DimensionIntervalList intervalList;
+
+ public ScaleExpr(CoverageExpr ce, DimensionIntervalList ail)
+ {
+ coverageExpr = ce;
+ intervalList = ail;
+ }
+
+ public void addInterpolationList(FieldInterpolationList iml)
+ {
+ interpMethods = iml;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ result += coverageExpr.toXML() + intervalList.toXML();
+ if (interpMethods != null)
+ result += interpMethods.toXML();
+
+ result = "<scale>" + result + "</scale>";
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/SelectExpr.java b/petascope/src/petascope/wcps/grammar/SelectExpr.java
new file mode 100644
index 0000000..4322eb3
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/SelectExpr.java
@@ -0,0 +1,52 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * SelectExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class SelectExpr implements IParseTreeNode {
+
+ CoverageExpr coverageExpr;
+ String field;
+
+ public SelectExpr(CoverageExpr ce, String se) {
+ coverageExpr = ce;
+ field = se;
+ }
+
+ public SelectExpr(CoverageExpr ce, int no) {
+ coverageExpr = ce;
+ field = String.valueOf(no);
+ }
+
+ public String toXML() {
+ String result = "<fieldSelect>";
+
+ result += coverageExpr.toXML();
+ result += "<field><name>" + field + "</name></field>";
+ result += "</fieldSelect>";
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/SetMetaDataExpr.java b/petascope/src/petascope/wcps/grammar/SetMetaDataExpr.java
new file mode 100644
index 0000000..16dccdb
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/SetMetaDataExpr.java
@@ -0,0 +1,118 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * SetMetaDataExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class SetMetaDataExpr implements IParseTreeNode {
+
+ CoverageExpr expr;
+ String field;
+ String function;
+ IParseTreeNode param;
+
+ // Set Crs Set
+ public SetMetaDataExpr(String op, CoverageExpr expr, CrsList clist) {
+ function = op;
+ this.expr = expr;
+ this.param = clist;
+ }
+
+ // Set Null Set
+ public SetMetaDataExpr(String op, CoverageExpr expr, RangeExprList param) {
+ function = op;
+ this.expr = expr;
+ this.param = param;
+ }
+
+ // Set Identifier
+ public SetMetaDataExpr(String op, CoverageExpr expr, String constant) {
+ function = op;
+ this.expr = expr;
+ this.field = constant;
+ }
+
+ // Set Interpolation Default
+ public SetMetaDataExpr(String op, CoverageExpr expr, InterpolationMethod param,
+ String field) {
+ function = op;
+ this.expr = expr;
+ this.param = param;
+ this.field = field;
+ }
+
+ // Set Interpolation Set
+ public SetMetaDataExpr(String op, CoverageExpr expr, InterpolationMethodList param,
+ String field) {
+ function = op;
+ this.expr = expr;
+ this.param = param;
+ this.field = field;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ if (function.equalsIgnoreCase("setIdentifier")) {
+ result += "<identifier>" + field + "</identifier>";
+ result += expr.toXML();
+
+ result = "<setIdentifier>" + result + "</setIdentifier>";
+ } else if (function.equalsIgnoreCase("setCrsSet")) {
+ result += expr.toXML();
+
+ if (param != null) {
+ result += param.toXML();
+ }
+
+ result = "<setCrsSet>" + result + "</setCrsSet>";
+ } else if (function.equalsIgnoreCase("setNullSet")) {
+ result += expr.toXML();
+
+ if (param != null) {
+ result += param.toXML();
+ }
+
+ result = "<setNullSet>" + result + "</setNullSet>";
+ } else if (function.equalsIgnoreCase("setInterpolationDefault")) {
+ result += expr.toXML();
+ result += "<field>" + field + "</field>";
+ result += param.toXML();
+
+ result = "<setInterpolationDefault>" + result
+ + "</setInterpolationDefault>";
+ } else if (function.equalsIgnoreCase("setInterpolationSet")) {
+ result += expr.toXML();
+ result += "<field>" + field + "</field>";
+ result += param.toXML();
+
+ result = "<setInterpolationSet>" + result + "</setInterpolationSet>";
+ } else {
+ System.err.println("Unknown SetMetadataExpr operation: " + function);
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/SliceExpr.java b/petascope/src/petascope/wcps/grammar/SliceExpr.java
new file mode 100644
index 0000000..72b1e08
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/SliceExpr.java
@@ -0,0 +1,42 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * SliceExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class SliceExpr implements IParseTreeNode {
+
+ CoverageExpr expr;
+ DimensionPointList list;
+
+ public SliceExpr(CoverageExpr ce, DimensionPointList apl) {
+ expr = ce;
+ list = apl;
+ }
+
+ public String toXML() {
+ return "<slice>" + expr.toXML() + list.toXML() + "</slice>";
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/StoreExpr.java b/petascope/src/petascope/wcps/grammar/StoreExpr.java
new file mode 100644
index 0000000..de86441
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/StoreExpr.java
@@ -0,0 +1,40 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/*
+Author: Sorin Stancu-Mara, Andrei Aiordachioaie
+Date: 7 Feb 2007
+ */
+public class StoreExpr implements IParseTreeNode {
+
+ private EncodedCoverageExpr expr;
+
+ public StoreExpr(EncodedCoverageExpr e) {
+ expr = e;
+ expr.setStoreFlag();
+ }
+
+ public String toXML() {
+ return expr.toXML();
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/StringScalarExpr.java b/petascope/src/petascope/wcps/grammar/StringScalarExpr.java
new file mode 100644
index 0000000..2571c12
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/StringScalarExpr.java
@@ -0,0 +1,58 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * @author: Andrei Aiordachioaie
+ */
+public class StringScalarExpr implements IParseTreeNode {
+
+ CoverageExpr cov;
+ String function;
+ String op;
+ String val;
+
+ public StringScalarExpr(String val) {
+ this.val = val;
+ this.function = "stringConstant";
+ }
+
+ public StringScalarExpr(String op, CoverageExpr cov) {
+ this.cov = cov;
+ function = "stringIdentifier";
+ this.op = op;
+ }
+
+ public String toXML() {
+ String result = "<" + function + ">";
+
+ if (function.equals("stringConstant")) {
+ result += val;
+ } else if (function.equals("stringIdentifier")) {
+ result += cov.toXML();
+ }
+
+ result += "</" + function + ">";
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/SubsetExpr.java b/petascope/src/petascope/wcps/grammar/SubsetExpr.java
new file mode 100644
index 0000000..8cc6a24
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/SubsetExpr.java
@@ -0,0 +1,40 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * SubsetExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class SubsetExpr implements IParseTreeNode {
+
+ IParseTreeNode expr;
+
+ public SubsetExpr(IParseTreeNode e) {
+ expr = e;
+ }
+
+ public String toXML() {
+ return expr.toXML();
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/TrigonometricExpr.java b/petascope/src/petascope/wcps/grammar/TrigonometricExpr.java
new file mode 100644
index 0000000..5cdbb8c
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/TrigonometricExpr.java
@@ -0,0 +1,47 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * TrigonometricExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara
+ */
+public class TrigonometricExpr implements IParseTreeNode {
+
+ CoverageExpr coverageExpr;
+ String trigOperator;
+
+ public TrigonometricExpr(String op, CoverageExpr ce) {
+ trigOperator = op;
+ coverageExpr = ce;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ result += "<" + trigOperator + ">";
+ result += coverageExpr.toXML();
+ result += "</" + trigOperator + ">";
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/TrimExpr.java b/petascope/src/petascope/wcps/grammar/TrimExpr.java
new file mode 100644
index 0000000..885f21e
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/TrimExpr.java
@@ -0,0 +1,42 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * TrimExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class TrimExpr implements IParseTreeNode {
+
+ CoverageExpr expr;
+ DimensionIntervalList list;
+
+ public TrimExpr(CoverageExpr ce, DimensionIntervalList al) {
+ expr = ce;
+ list = al;
+ }
+
+ public String toXML() {
+ return "<trim>" + expr.toXML() + list.toXML() + "</trim>";
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/VariableList.java b/petascope/src/petascope/wcps/grammar/VariableList.java
new file mode 100644
index 0000000..dd33fda
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/VariableList.java
@@ -0,0 +1,60 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/*Author: Sorin Stancu-Mara, Andrei Aiordachioaie
+ * Date: 8 Feb 2008
+ */
+public class VariableList implements IParseTreeNode {
+
+ String axisType, iteratorName;
+ String lo, hi;
+ VariableList next;
+
+ public VariableList(String type, String name, String lo, String hi) {
+ axisType = type;
+ iteratorName = name;
+ this.lo = lo;
+ this.hi = hi;
+ next = null;
+ }
+
+ public VariableList(String type, String name, String lo, String hi, VariableList next) {
+ axisType = type;
+ iteratorName = name;
+ this.lo = lo;
+ this.hi = hi;
+ this.next = next;
+ }
+
+ public String toXML() {
+ String result = "<axisIterator><axisType>" + axisType + "</axisType>"
+ + "<iteratorVar>" + iteratorName + "</iteratorVar>" + "<coord>"
+ + lo + "</coord>" + "<coord>" + hi + "</coord></axisIterator>";
+
+ if (next != null) {
+ result += next.toXML();
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/WCPSRequest.java b/petascope/src/petascope/wcps/grammar/WCPSRequest.java
new file mode 100644
index 0000000..5e3fc63
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/WCPSRequest.java
@@ -0,0 +1,76 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * WCPSRequest class represents a WCPSRequest.
+ * Creation date: (3/3/2003 2:52:55 AM)
+ * @author: *, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class WCPSRequest implements IParseTreeNode {
+
+ private ForClause forClause;
+ private ReturnClause returnClause;
+ private WhereClause whereClause;
+
+ public WCPSRequest() {
+ super();
+ }
+
+ public WCPSRequest(ForClauseElements f) {
+ forClause = new ForClause(f);
+ whereClause = null;
+ returnClause = null;
+ }
+
+ public void setWhere(WhereClause w) {
+ whereClause = w;
+ }
+
+ public void setReturn(ReturnClause r) {
+ returnClause = r;
+ }
+
+ public String toXML() {
+ String result = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
+
+ result +=
+ "<ProcessCoveragesRequest xmlns=\"http://www.opengis.net/wcps/1.0\" service=\"WCPS\" "
+ + "version=\"1.0.0\">\n";
+ result += "<query><xmlSyntax>";
+
+ result += forClause.toXML();
+
+ if (whereClause != null) {
+ result += whereClause.toXML();
+ }
+
+ if (returnClause != null) {
+ result += returnClause.toXML();
+ }
+
+ result += "</xmlSyntax></query>";
+ result += "</ProcessCoveragesRequest>";
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/WhereClause.java b/petascope/src/petascope/wcps/grammar/WhereClause.java
new file mode 100644
index 0000000..bc4c897
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/WhereClause.java
@@ -0,0 +1,38 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/* Author: Sorin Stancu-Mara, Andrei Aiordachioaie
+Date: 7 Feb 2007
+ */
+public class WhereClause implements IParseTreeNode {
+
+ private BooleanScalarExpr expr;
+
+ public WhereClause(BooleanScalarExpr e) {
+ expr = e;
+ }
+
+ public String toXML() {
+ return "<where>" + expr.toXML() + "</where>";
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/wcps.g b/petascope/src/petascope/wcps/grammar/wcps.g
new file mode 100644
index 0000000..f00d1b5
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/wcps.g
@@ -0,0 +1,500 @@
+/*
+Author: Sorin Stancu-Mara, Andrei Aiordachioaie
+History:
+07 02 2007 smsorin Updated to WCPS 1.0.0
+27 01 2009 smsorin Moved to ANTLR
+11 02 2009 andreia Updated to new grammar (spec 08-068r2)
+13 02 2009 andreia Fixed small bugs in grammar. Now it can fully compile.
+21 04 2009 andreia Removed comments.
+04 05 2009 andreia Fixed bugs in integer declaration.
+19 05 2009 andreia Fixed some other weird bugs. Grammar passes all tests now.
+28 05 2009 andreia Updated class actions names.
+02 06 2009 andreia Removed brackets around "and" binary operator in CoverageExpr
+03 06 2009 andreia Complex expressions introduced in the "using" clause of general condense operations
+05 08 2009 andreia Fixed definition of integer and floating-point numbers.
+31 03 2010 andreia Added "sqrt" operation for scalar expressions
+*/
+grammar wcps;
+options{
+backtrack=true;
+memoize=true;
+k=2;
+language=Java;
+output=AST;
+}
+@header
+{package petascope.wcps.grammar;}
+@lexer::header
+{package petascope.wcps.grammar;}
+
+/* Parser Rules */
+
+wcpsRequest returns[WCPSRequest value]
+ : e1=forClause { $value= new WCPSRequest($e1.value); }
+ (e2=whereClause { $value.setWhere($e2.value); } )?
+ e3=returnClause { $value.setReturn($e3.value); }
+ ;
+forClause returns[ForClauseElements value]
+ : FOR v=coverageVariable IN LPAREN list=coverageList RPAREN
+ { $value = new ForClauseElements($v.value, $list.value); }
+ (COMMA v=coverageVariable IN LPAREN list=coverageList RPAREN
+ { $value = new ForClauseElements($v.value, $list.value, $value); })*
+ ;
+whereClause returns[WhereClause value]
+ : WHERE e1=booleanScalarExpr { $value = new WhereClause($e1.value); }
+ ;
+returnClause returns[ReturnClause value]
+ : RETURN e1=processingExpr { $value = new ReturnClause($e1.value); }
+ ;
+coverageList returns[CoverageList value]
+ : cname=coverageName { $value = new CoverageList($cname.value); }
+ (COMMA next=coverageName { $value = new CoverageList($next.value, $value); })*
+ ;
+processingExpr returns[ProcessingExpr value]
+ : e1=encodedCoverageExpr { $value = new ProcessingExpr($e1.value); }
+ | e2=storeExpr { $value = new ProcessingExpr($e2.value); }
+ | e3=scalarExpr { $value = new ProcessingExpr($e3.value); }
+ ;
+encodedCoverageExpr returns[EncodedCoverageExpr value]
+ : ENCODE LPAREN cov=coverageExpr COMMA format=stringConstant { $value = new EncodedCoverageExpr($cov.value, $format.text); }
+ (COMMA params=stringConstant { $value.setParams($params.text); })? RPAREN
+ ;
+storeExpr returns[StoreExpr value]
+ : STORE LPAREN e1=encodedCoverageExpr RPAREN { $value = new StoreExpr($e1.value); }
+ ;
+coverageExpr returns[CoverageExpr value]
+ : e1=coverageLogicTerm { $value = $e1.value; }
+ (op=(OR|XOR) e2=coverageLogicTerm { $value = new CoverageExpr($op.text, $value, $e2.value); } )*
+ ;
+coverageLogicTerm returns[CoverageExpr value]
+ : e1=coverageLogicFactor { $value = $e1.value; }
+ (op=AND e2=coverageLogicFactor { $value = new CoverageExpr($op.text, $value, $e2.value); } )*
+ ;
+coverageLogicFactor returns[CoverageExpr value]
+ : e1=coverageArithmeticExpr {$value = $e1.value;}
+ (op=(EQUALS|NOTEQUALS|LT|GT|LTE|GTE) e2=coverageArithmeticExpr { $value = new CoverageExpr($op.text, $e1.value, $e2.value); } )?
+ ;
+coverageArithmeticExpr returns[CoverageExpr value]
+ : e1=coverageArithmeticTerm {$value = $e1.value; }
+ (op=(PLUS|MINUS) e2=coverageArithmeticTerm { $value = new CoverageExpr($op.text, $value, $e2.value); } )*
+ ;
+coverageArithmeticTerm returns[CoverageExpr value]
+ : e1=coverageArithmeticFactor {$value = $e1.value; }
+ (op=(MULT|DIVIDE) e2=coverageArithmeticFactor { $value = new CoverageExpr($op.text, $value, $e2.value); } )*
+ ;
+coverageArithmeticFactor returns[CoverageExpr value]
+ : e1=coverageValue { $value = $e1.value; }
+ (op=OVERLAY e2=coverageValue { $value = new CoverageExpr($op.text, $value, $e2.value); } )*
+ ;
+coverageValue returns[CoverageExpr value]
+ : e5=subsetExpr { $value = new CoverageExpr($e5.value); }
+ | e2=unaryInducedExpr { $value = $e2.value; }
+ | e4=scaleExpr { $value = new CoverageExpr($e4.value); }
+ | e3=crsTransformExpr { $value = new CoverageExpr($e3.value); }
+ | e1=coverageAtom { $value = $e1.value; }
+ ;
+coverageAtom returns[CoverageExpr value]
+ : e2=scalarExpr { $value = new CoverageExpr($e2.value); }
+ | e1=coverageVariable { $value = new CoverageExpr($e1.value); }
+ | LPAREN e7=coverageExpr RPAREN { $value = new CoverageExpr($e7.value); }
+ | e3=coverageConstantExpr { $value = new CoverageExpr($e3.value); }
+ | e4=coverageConstructorExpr { $value = new CoverageExpr($e4.value); }
+ | e5=setMetaDataExpr { $value = new CoverageExpr($e5.value); }
+ | e6=rangeConstructorExpr { $value = new CoverageExpr($e6.value); }
+ ;
+scalarExpr returns[ScalarExpr value]
+ : e1=metaDataExpr { $value = new ScalarExpr($e1.value); }
+ | e2=condenseExpr { $value = new ScalarExpr($e2.value); }
+ | e3=booleanScalarExpr { $value = new ScalarExpr($e3.value); }
+ | e4=numericScalarExpr { $value = new ScalarExpr($e4.value); }
+ | e5=stringScalarExpr { $value = new ScalarExpr($e5.value); }
+ | LPAREN e6=scalarExpr RPAREN { $value = $e6.value; }
+ ;
+metaDataExpr returns[MetaDataExpr value]
+ : op=IDENTIFIER LPAREN e1=coverageExpr RPAREN { $value = new MetaDataExpr($op.text, $e1.value); }
+ | op=IMAGECRS LPAREN e1=coverageExpr RPAREN { $value = new MetaDataExpr($op.text, $e1.value); }
+ | op=IMAGECRSDOMAIN LPAREN e1=coverageExpr (COMMA e2=axisName)? RPAREN { $value = new MetaDataExpr($op.text, $e1.value, $e2.value); }
+ | op=CRSSET LPAREN e1=coverageExpr RPAREN { $value = new MetaDataExpr($op.text, $e1.value); }
+ | de=domainExpr { $value = new MetaDataExpr($de.value); }
+ | op=NULLSET LPAREN e1=coverageExpr RPAREN { $value = new MetaDataExpr($op.text,$e1.value); }
+ | op=INTERPOLATIONDEFAULT LPAREN e1=coverageExpr COMMA f1=fieldName RPAREN { $value = new MetaDataExpr($op.text, $e1.value, $f1.value); }
+ | op=INTERPOLATIONSET LPAREN e1=coverageExpr COMMA f1=fieldName RPAREN { $value = new MetaDataExpr($op.text, $e1.value, $f1.value); }
+ ;
+domainExpr returns[DomainExpr value]
+ : DOMAIN LPAREN var=coverageVariable COMMA axis=axisName COMMA crs=crsName RPAREN { $value = new DomainExpr($var.value, $axis.value, $crs.value); }
+ ;
+condenseExpr returns[CondenseExpr value]
+ : e1=reduceExpr { $value = new CondenseExpr($e1.value); }
+ | e2=generalCondenseExpr { $value = new CondenseExpr($e2.value); }
+ ;
+reduceExpr returns[ReduceExpr value]
+ : op=(ALL|SOME|COUNT|ADD|AVG|MIN|MAX) LPAREN e1=coverageExpr RPAREN { $value = new ReduceExpr($op.text, $e1.value); }
+ ;
+generalCondenseExpr returns[GeneralCondenseExpr value]
+ : CONDENSE op=condenseOpType OVER ail=axisIteratorList { $value = new GeneralCondenseExpr($op.value, $ail.value); }
+ (WHERE cond=booleanScalarExpr { $value.setWhere($cond.value); })?
+ USING ce=coverageExpr { $value.setUsing($ce.value); }
+ ;
+axisIteratorList returns[AxisIteratorList value]
+ : vn=variableName an=axisName LPAREN ie=intervalExpr RPAREN
+ { $value = new AxisIteratorList(new AxisIterator($vn.value, $an.value, $ie.value)); }
+ (COMMA vn2=variableName an2=axisName LPAREN ie2=intervalExpr RPAREN
+ { $value = new AxisIteratorList(new AxisIterator($vn2.value, $an2.value, $ie2.value), $value); })*
+ ;
+intervalExpr returns[IntervalExpr value]
+ : lo=indexExpr COLON hi=indexExpr
+ { $value = new IntervalExpr($lo.value, $hi.value); }
+ | IMAGECRSDOMAIN LPAREN e1=coverageName COMMA e2=axisName RPAREN
+ { $value = new IntervalExpr($e1.value, $e2.value); }
+ ;
+coverageConstantExpr returns[CoverageConstantExpr value]
+ : COVERAGE aname=coverageName OVER iter=axisIteratorList VALUE LIST LT values=constantList GT
+ { $value = new CoverageConstantExpr($aname.value, $iter.value, $values.value); }
+ ;
+constantList returns[ConstantList value]
+ : c=constant { $value = new ConstantList($c.value); } (SEMICOLON c=constant { $value.add($c.value); })*
+ ;
+coverageConstructorExpr returns[CoverageConstructorExpr value]
+ : COVERAGE coverage=coverageName OVER ail=axisIteratorList VALUES se=scalarExpr
+ { $value = new CoverageConstructorExpr($coverage.value, $ail.value, $se.value); }
+ ;
+setMetaDataExpr returns[SetMetaDataExpr value]
+ : op=SETIDENTIFIER LPAREN s=stringConstant COMMA e1=coverageExpr RPAREN
+ { $value = new SetMetaDataExpr($op.text, $e1.value, $s.value); }
+ | op=SETCRSSET LPAREN e1=coverageExpr COMMA crs=crsList RPAREN
+ { $value = new SetMetaDataExpr($op.text, $e1.value, $crs.value); }
+ | op=SETNULLSET LPAREN e1=coverageExpr COMMA rel=rangeExprList RPAREN
+ { $value = new SetMetaDataExpr($op.text, $e1.value, $rel.value); }
+ | op=SETINTERPOLATIONDEFAULT LPAREN e1=coverageExpr COMMA fn=fieldName COMMA im=interpolationMethod RPAREN
+ { $value = new SetMetaDataExpr($op.text, $e1.value, $im.value, $fn.value); }
+ | op=SETINTERPOLATIONSET LPAREN e1=coverageExpr COMMA fn=fieldName COMMA iml=interpolationMethodList RPAREN
+ { $value = new SetMetaDataExpr($op.text, $e1.value, $iml.value, $fn.value); }
+ ;
+crsList returns[CrsList value]
+ : LBRACE {$value = new CrsList();} (crs=crsName { $value.add($crs.value); } (COMMA crs=crsName { $value.add($crs.value); })* )? RBRACE
+ ;
+rangeExprList returns[RangeExprList value]
+ : LBRACE { $value = new RangeExprList(); } (re1=rangeExpr { $value.add($re1.value); } (COMMA re2=rangeExpr { $value.add($re2.value); })* )? RBRACE
+ ;
+interpolationMethodList returns[InterpolationMethodList value]
+ : LBRACE {$value = new InterpolationMethodList();} (e=interpolationMethod { $value.add($e.value); } (COMMA e=interpolationMethod { $value.add($e.value); })*)? RBRACE
+ ;
+rangeExpr returns[RangeExpr value]
+ : STRUCT LBRACE { $value=new RangeExpr(); }
+ (field=fieldName COLON expr=scalarExpr { $value.add($field.value, $expr.value); }
+ (COMMA field=fieldName COLON expr=scalarExpr { $value.add($field.value, $expr.value); })*
+ )? RBRACE
+ ;
+rangeConstructorExpr returns[RangeConstructorExpr value]
+ : (STRUCT)? LBRACE field=fieldName COLON expr=coverageExpr { $value = new RangeConstructorExpr($field.value, $expr.value); }
+ (SEMICOLON field=fieldName COLON expr=coverageExpr { $value.add($field.value, $expr.value); })* RBRACE
+ ;
+crsTransformExpr returns[CrsTransformExpr value]
+ : CRSTRANSFORM LPAREN e1=coverageExpr COMMA dcl=dimensionIntervalList COMMA fil=fieldInterpolationList RPAREN
+ { $value = new CrsTransformExpr($e1.value, $dcl.value, $fil.value); }
+ ;
+fieldInterpolationList returns[FieldInterpolationList value]
+ : LBRACE elem=fieldInterpolationElement { $value = new FieldInterpolationList($elem.value); }
+ (COMMA elem=fieldInterpolationElement { $value.add($elem.value); }) * RBRACE
+ ;
+fieldInterpolationElement returns[FieldInterpolationElement value]
+ : aname=fieldName method=interpolationMethod { $value = new FieldInterpolationElement($aname.value, $method.value); }
+ ;
+unaryInducedExpr returns[CoverageExpr value]
+ : e6=fieldExpr { $value = new CoverageExpr($e6.value); }
+ | e1=unaryArithmeticExpr { $value = $e1.value; }
+ | e2=exponentialExpr { $value = new CoverageExpr($e2.value); }
+ | e3=trigonometricExpr { $value = new CoverageExpr($e3.value); }
+ | e4=booleanExpr { $value = new CoverageExpr($e4.value); }
+ | e5=castExpr { $value = new CoverageExpr($e5.value); }
+ | e7=rangeConstructorExpr { $value = new CoverageExpr($e7.value); }
+ ;
+unaryArithmeticExpr returns[CoverageExpr value]
+ : op=(MINUS|PLUS) e1=coverageAtom { $value = new CoverageExpr($op.text, $e1.value); }
+ | op=(SQRT|ABS|RE|IM) LPAREN e2=coverageExpr RPAREN { $value = new CoverageExpr($op.text, $e2.value); }
+ ;
+exponentialExpr returns[ExponentialExpr value]
+ : op=(EXP|LOG|LN) LPAREN e1=coverageExpr RPAREN { $value = new ExponentialExpr($op.text, $e1.value); }
+ ;
+trigonometricExpr returns[TrigonometricExpr value]
+ : op=(SIN|COS|TAN|SINH|COSH|TANH|ARCSIN|ARCCOS|ARCTAN) LPAREN e1=coverageExpr RPAREN { $value = new TrigonometricExpr($op.text, $e1.value); }
+ ;
+booleanExpr returns[BooleanExpr value]
+ : op=NOT e1=coverageExpr { $value = new BooleanExpr($op.text, $e1.value); }
+ | op=BIT LPAREN e1=coverageExpr COMMA e2=indexExpr RPAREN { $value = new BooleanExpr($op.text, $e1.value, $e2.value); }
+ ;
+indexExpr returns[IndexExpr value]
+ : e1=indexTerm { $value = $e1.value; }
+ (op=(PLUS|MINUS) e2=indexTerm { $value = new IndexExpr($op.text, $value, $e2.value); })*
+ ;
+indexTerm returns[IndexExpr value]
+ : e1=indexFactor { $value = $e1.value; }
+ ((op=(MULT|DIVIDE) e2=indexFactor { $value = new IndexExpr($op.text, $value, $e2.value); } ))*
+ ;
+indexFactor returns[IndexExpr value]
+ : e=INTEGERCONSTANT { $value = new IndexExpr($e.text); }
+ | op=ROUND LPAREN e1=numericScalarExpr RPAREN { $value = new IndexExpr($op.text, $e1.value); }
+ | (LPAREN e2=indexExpr RPAREN { $value = $e2.value; } )
+ ;
+stringScalarExpr returns[StringScalarExpr value]
+// The first rule should be "metaDataExpr", but currently only a variable "identifier" is allowed.
+ : op=IDENTIFIER LPAREN e1=coverageExpr RPAREN { $value = new StringScalarExpr($op.text, $e1.value); }
+ | e=STRING { $value = new StringScalarExpr($e.text); }
+ ;
+scaleExpr returns[ScaleExpr value]
+ : SCALE LPAREN e1=coverageExpr COMMA dil=dimensionIntervalList { $value = new ScaleExpr($e1.value, $dil.value); }
+ (COMMA fil=fieldInterpolationList {$value.addInterpolationList($fil.value); } )?
+ RPAREN
+
+ ;
+subsetExpr returns[SubsetExpr value]
+ : e1=trimExpr { $value = new SubsetExpr($e1.value); }
+ | e2=sliceExpr { $value = new SubsetExpr($e2.value); }
+ | e3=extendExpr { $value = new SubsetExpr($e3.value); }
+ ;
+trimExpr returns[TrimExpr value]
+ : e1=coverageAtom LBRACKET dil=dimensionIntervalList RBRACKET { $value = new TrimExpr($e1.value, $dil.value); }
+ | TRIM LPAREN e2=coverageExpr COMMA LBRACE dil=dimensionIntervalList RBRACE RPAREN { $value = new TrimExpr($e2.value, $dil.value); }
+ ;
+sliceExpr returns[SliceExpr value]
+ : e1=coverageAtom LBRACKET dpl=dimensionPointList RBRACKET { $value = new SliceExpr($e1.value, $dpl.value); }
+ | SLICE LPAREN e2=coverageExpr COMMA LBRACE dpl=dimensionPointList RBRACE RPAREN { $value = new SliceExpr($e2.value, $dpl.value); }
+ ;
+extendExpr returns[ExtendExpr value]
+ : EXTEND LPAREN e1=coverageExpr COMMA dil=dimensionIntervalList RPAREN { $value = new ExtendExpr($e1.value, $dil.value); }
+ ;
+castExpr returns[CastExpr value]
+ : LPAREN e1=rangeType RPAREN e2=coverageExpr { $value = new CastExpr($e2.value, $e1.value); }
+ ;
+rangeType returns[String value]
+ : type=(BOOLEAN|CHAR|SHORT|LONG|FLOAT|DOUBLE|COMPLEX|COMPLEX2) { $value = new String($type.text); }
+ | UNSIGNED type=(CHAR|SHORT|LONG) { $value = new String("unsigned " + $type.text); }
+ ;
+fieldExpr returns[SelectExpr value]
+ : e1=coverageAtom DOT e2=fieldName { $value = new SelectExpr($e1.value, $e2.value); }
+ ;
+// NOTE: The following boolean rules are equivalent to the grammar rules in document 08-068r2
+// They have been rewritten in order to prioritize the boolean operators
+booleanScalarExpr returns[BooleanScalarExpr value]
+ : e1=booleanScalarTerm { $value = $e1.value; }
+ (op=(OR|XOR) e2=booleanScalarTerm { $value = new BooleanScalarExpr($op.text, $value, $e2.value);})*
+ ;
+booleanScalarTerm returns[BooleanScalarExpr value]
+ : e1=booleanScalarNegation { $value = $e1.value; }
+ (op=AND e2=booleanScalarNegation { $value = new BooleanScalarExpr($op.text, $value, $e2.value); } )*
+ ;
+booleanScalarNegation returns[BooleanScalarExpr value]
+ : e1=booleanScalarAtom { $value = $e1.value; }
+ | op=NOT e1=booleanScalarAtom { $value = new BooleanScalarExpr($op.text, $e1.value); }
+ ;
+booleanScalarAtom returns[BooleanScalarExpr value]
+ : LPAREN e1=booleanScalarExpr RPAREN { $value = $e1.value; }
+ | s1=stringScalarExpr cop=compOp s2=stringScalarExpr { $value = new BooleanScalarExpr($cop.value, $s1.value, $s2.value); }
+ | n1=numericScalarExpr cop=compOp n2=numericScalarExpr { $value = new BooleanScalarExpr($cop.value, $n1.value, $n2.value); }
+ | e=BOOLEANCONSTANT { $value = new BooleanScalarExpr($e.text); }
+ ;
+numericScalarExpr returns[NumericScalarExpr value]
+ : e1=numericScalarTerm {$value = $e1.value; }
+ (op=(PLUS|MINUS) e2=numericScalarTerm { $value = new NumericScalarExpr($op.text, $value, $e2.value); })*
+ ;
+numericScalarTerm returns[NumericScalarExpr value]
+ : e1=numericScalarFactor { $value = $e1.value; }
+ (op=(MULT|DIVIDE) e2=numericScalarFactor { $value = new NumericScalarExpr($op.text, $value, $e2.value); })*
+ ;
+numericScalarFactor returns[NumericScalarExpr value]
+ : LPAREN e1=numericScalarExpr RPAREN { $value = $e1.value; }
+ | op=MINUS e10=numericScalarFactor { $value = new NumericScalarExpr($op.text, $e10.value); }
+ | op=ABS LPAREN e12=numericScalarExpr RPAREN { $value = new NumericScalarExpr($op.text, $e12.value); }
+ | op=SQRT LPAREN e11=numericScalarExpr RPAREN { $value = new NumericScalarExpr($op.text, $e11.value); }
+ | op=ROUND LPAREN e1=numericScalarExpr RPAREN { $value = new NumericScalarExpr($op.text, $e1.value); }
+ | e=INTEGERCONSTANT { $value = new NumericScalarExpr($e.text); }
+ | e=FLOATCONSTANT { $value = new NumericScalarExpr($e.text); }
+ | e2=complexConstant { $value = new NumericScalarExpr($e2.value); }
+ | e3=condenseExpr { $value = new NumericScalarExpr($e3.value); }
+ | e4=variableName { $value = new NumericScalarExpr("var", $e4.value); }
+ ;
+compOp returns[String value]
+ : EQUALS { $value = new String("equals"); }
+ | NOTEQUALS { $value = new String("notEqual"); }
+ | LT { $value = new String("lessThan"); }
+ | GT { $value = new String("greaterThan"); }
+ | LTE { $value = new String("lessOrEqual"); }
+ | GTE { $value = new String("greaterOrEqual"); }
+ ;
+dimensionIntervalList returns[DimensionIntervalList value]
+ : elem=dimensionIntervalElement { $value = new DimensionIntervalList($elem.value); }
+ (COMMA elem=dimensionIntervalElement { $value.add($elem.value); })*
+ ;
+dimensionIntervalElement returns[DimensionIntervalElement value]
+ : aname=axisName { $value = new DimensionIntervalElement($aname.value); } (COLON crs=crsName {$value.setCrs($crs.value); })?
+ LPAREN die=dimensionIntervalExpr RPAREN { $value.setIntervalExpr($die.value); }
+ ;
+dimensionIntervalExpr returns[DimensionIntervalExpr value]
+ : e1=scalarExpr COLON e2=scalarExpr { $value = new DimensionIntervalExpr($e1.value, $e2.value); }
+ | DOMAIN LPAREN e3=coverageName COLON e4=axisName COLON e5=crsName RPAREN { $value = new DimensionIntervalExpr($e3.value, $e4.value, $e5.value); }
+ ;
+dimensionPointList returns[DimensionPointList value]
+ : elem1=dimensionPointElement { $value = new DimensionPointList($elem1.value); }
+ (COMMA elem2=dimensionPointElement { $value.add($elem2.value); })*
+ ;
+dimensionPointElement returns[DimensionPointElement value]
+ : aname=axisName LPAREN dpe=dimensionPoint RPAREN { $value = new DimensionPointElement($aname.value, $dpe.value); }
+ | aname=axisName COLON crs=crsName LPAREN dpe=dimensionPoint RPAREN { $value = new DimensionPointElement($aname.value, $crs.value, $dpe.value); }
+ ;
+dimensionPoint returns[ScalarExpr value]
+ : e1=scalarExpr { $value = $e1.value; }
+ ;
+interpolationMethod returns[InterpolationMethod value]
+ : LPAREN type=interpolationType COLON res=nullResistence RPAREN { $value = new InterpolationMethod($type.value, $res.value); }
+ ;
+interpolationType returns[String value]
+ : type=(NEAREST|LINEAR|QUADRATIC|CUBIC) { $value = new String($type.text); }
+ ;
+nullResistence returns[String value]
+ : resistance=(FULL|NONE|HALF|OTHER) { $value = new String($resistance.text); }
+ ;
+condenseOpType returns[CondenseOperation value]
+ : op=(PLUS|MULT|MAX|MIN|AND|OR) { $value = new CondenseOperation($op.text); }
+ ;
+fieldName returns[String value]
+ : name { $value = new String($name.value);}
+ ;
+constant returns[String value]
+ : e=(STRING|BOOLEANCONSTANT|INTEGERCONSTANT|FLOATCONSTANT) { $value = $e.text; }
+ | e1=complexConstant { $value = $e1.value; }
+ ;
+complexConstant returns[String value]
+ : LPAREN re1=FLOATCONSTANT COMMA im1=FLOATCONSTANT RPAREN { $value = new String($re1.text +"+i"+$im1.text); }
+ ;
+stringConstant returns[String value]
+ : s=STRING { $value = $s.text; }
+ ;
+name returns[String value]
+ : var=(NAME | STRING | INTEGERCONSTANT) { $value = $var.text; }
+ ;
+crsName returns[String value]
+ : s=stringConstant { $value = $s.value; }
+ ;
+axisName returns[String value]
+ : type1=name { $value = new String($type1.value); }
+ ;
+variableName returns[String value]
+ : var=VARIABLE_DOLLAR { $value = new String($var.text); }
+ ;
+coverageVariable returns[String value]
+ : var=NAME { $value = $var.text; }
+ ;
+coverageName returns[String value]
+ : name { $value = $name.value; }
+ ;
+
+
+/* Lexer rules */
+PLUS: '+';
+MINUS: '-';
+DIVIDE: '/';
+MULT: '*';
+EQUALS: '=';
+NOTEQUALS: '!=';
+LT: '<';
+GT: '>';
+LTE: '<=';
+GTE: '>=';
+DOT: '.';
+LPAREN: '(';
+RPAREN: ')';
+LBRACKET: '[';
+RBRACKET: ']';
+LBRACE: '{';
+RBRACE: '}';
+COMMA: ',';
+COLON: ':';
+SEMICOLON: ';';
+FOR: ('f'|'F')('o'|'O')('r'|'R');
+IN: ('i'|'I')('n'|'N');
+WHERE: ('w'|'W')('h'|'H')('e'|'E')('r'|'R')('e'|'E');
+RETURN: ('r'|'R')('e'|'E')('t'|'T')('u'|'U')('r'|'R')('n'|'N');
+STORE: ('s'|'S')('t'|'T')('o'|'O')('r'|'R')('e'|'E');
+ENCODE: ('e'|'E')('n'|'N')('c'|'C')('o'|'O')('d'|'D')('e'|'E');
+SQRT: ('s'|'S')('q'|'Q')('r'|'R')('t'|'T');
+SIN: ('s'|'S')('i'|'I')('n'|'N');
+COS: ('c'|'C')('o'|'O')('s'|'S');
+TAN: ('t'|'T')('a'|'A')('n'|'N');
+SINH: ('s'|'S')('i'|'I')('n'|'N')('h'|'H');
+COSH: ('c'|'C')('o'|'O')('s'|'S')('h'|'H');
+TANH: ('t'|'T')('a'|'A')('n'|'N')('h'|'H');
+ARCSIN: ('a'|'A')('r'|'R')('c'|'C')('s'|'S')('i'|'I')('n'|'N');
+ARCCOS: ('a'|'A')('r'|'R')('c'|'C')('c'|'C')('o'|'O')('s'|'S');
+ARCTAN: ('a'|'A')('r'|'R')('c'|'C')('t'|'T')('a'|'A')('n'|'N');
+EXP: ('e'|'E')('x'|'X')('p'|'P');
+LN: ('l'|'L')('n'|'N');
+LOG: ('l'|'L')('o'|'O')('g'|'G');
+ROUND: ('r'|'R')('o'|'O')('u'|'U')('n'|'N')('d'|'D');
+ABS: ('a'|'A')('b'|'B')('s'|'S');
+OVERLAY: ('o'|'O')('v'|'V')('e'|'E')('r'|'R')('l'|'L')('a'|'A')('y'|'Y');
+STRUCT: ('s'|'S')('t'|'T')('r'|'R')('u'|'U')('c'|'C')('t'|'T');
+RE: ('r'|'R')('e'|'E');
+IM: ('i'|'I')('m'|'M');
+AND: ('a'|'A')('n'|'N')('d'|'D');
+OR: ('o'|'O')('r'|'R');
+XOR: ('x'|'X')('o'|'O')('r'|'R');
+NOT: ('n'|'N')('o'|'O')('t'|'T');
+IDENTIFIER: ('i'|'I')('d'|'D')('e'|'E')('n'|'N')('t'|'T')('i'|'I')('f'|'F')('i'|'I')('e'|'E')('r'|'R');
+IMAGECRS: ('i'|'I')('m'|'M')('a'|'A')('g'|'G')('e'|'E')('c'|'C')('r'|'R')('s'|'S');
+IMAGECRSDOMAIN: ('i'|'I')('m'|'M')('a'|'A')('g'|'G')('e'|'E')('c'|'C')('r'|'R')('s'|'S')('d'|'D')('o'|'O')('m'|'M')('a'|'A')('i'|'I')('n'|'N');
+CRSSET: ('c'|'C')('r'|'R')('s'|'S')('s'|'S')('e'|'E')('t'|'T');
+DOMAIN: ('d'|'D')('o'|'O')('m'|'M')('a'|'A')('i'|'I')('n'|'N');
+NULLSET: ('n'|'N')('u'|'U')('l'|'L')('l'|'L')('s'|'S')('e'|'E')('t'|'T');
+NULLDEFAULT: ('n'|'N')('u'|'U')('l'|'L')('l'|'L')('d'|'D')('e'|'E')('f'|'F')('a'|'A')('u'|'U')('l'|'L')('t'|'T');
+INTERPOLATIONDEFAULT: ('i'|'I')('n'|'N')('t'|'T')('e'|'E')('r'|'R')('p'|'P')('o'|'O')('l'|'L')('a'|'A')('t'|'T')('i'|'I')('o'|'O')('n'|'N')('d'|'D')('e'|'E')('f'|'F')('a'|'A')('u'|'U')('l'|'L')('t'|'T');
+INTERPOLATIONSET: ('i'|'I')('n'|'N')('t'|'T')('e'|'E')('r'|'R')('p'|'P')('o'|'O')('l'|'L')('a'|'A')('t'|'T')('i'|'I')('o'|'O')('n'|'N')('s'|'S')('e'|'E')('t'|'T');
+SETIDENTIFIER: ('s'|'S')('e'|'E')('t'|'T')('i'|'I')('d'|'D')('e'|'E')('n'|'N')('t'|'T')('i'|'I')('f'|'F')('i'|'I')('e'|'E')('r'|'R');
+SETNULLSET: ('s'|'S')('e'|'E')('t'|'T')('n'|'N')('u'|'U')('l'|'L')('l'|'L')('s'|'S')('e'|'E')('t'|'T');
+SETINTERPOLATIONDEFAULT: ('s'|'S')('e'|'E')('t'|'T')('i'|'I')('n'|'N')('t'|'T')('e'|'E')('r'|'R')('p'|'P')('o'|'O')('l'|'L')('a'|'A')('t'|'T')('i'|'I')('o'|'O')('n'|'N')('d'|'D')('e'|'E')('f'|'F')('a'|'A')('u'|'U')('l'|'L')('t'|'T');
+SETINTERPOLATIONSET:('s'|'S')('e'|'E')('t'|'T')('i'|'I')('n'|'N')('t'|'T')('e'|'E')('r'|'R')('p'|'P')('o'|'O')('l'|'L')('a'|'A')('t'|'T')('i'|'I')('o'|'O')('n'|'N')('s'|'S')('e'|'E')('t'|'T');
+SETCRSSET: ('s'|'S')('e'|'E')('t'|'T')('c'|'C')('r'|'R')('s'|'S')('s'|'S')('e'|'E')('t'|'T');
+TRIM: ('t'|'T')('r'|'R')('i'|'I')('m'|'M');
+SLICE: ('s'|'S')('l'|'L')('i'|'I')('c'|'C')('e'|'E');
+EXTEND: ('e'|'E')('x'|'X')('t'|'T')('e'|'E')('n'|'N')('d'|'D');
+SCALE: ('s'|'S')('c'|'C')('a'|'A')('l'|'L')('e'|'E');
+CRSTRANSFORM: ('c'|'C')('r'|'R')('s'|'S')('t'|'T')('r'|'R')('a'|'A')('n'|'N')('s'|'S')('f'|'F')('o'|'O')('r'|'R')('m'|'M');
+COUNT: ('c'|'C')('o'|'O')('u'|'U')('n'|'N')('t'|'T');
+ADD: ('a'|'A')('d'|'D')('d'|'D');
+AVG: ('a'|'A')('v'|'V')('g'|'G');
+MAX: ('m'|'M')('a'|'A')('x'|'X');
+MIN: ('m'|'M')('i'|'I')('n'|'N');
+SOME: ('s'|'S')('o'|'O')('m'|'M')('e'|'E');
+ALL: ('a'|'A')('l'|'L')('l'|'L');
+COVERAGE: ('c'|'C')('o'|'O')('v'|'V')('e'|'E')('r'|'R')('a'|'A')('g'|'G')('e'|'E');
+OVER: ('o'|'O')('v'|'V')('e'|'E')('r'|'R');
+VALUE: ('v'|'V')('a'|'A')('l'|'L')('u'|'U')('e'|'E');
+VALUES: ('v'|'V')('a'|'A')('l'|'L')('u'|'U')('e'|'E')('s'|'S');
+LIST: ('l'|'L')('i'|'I')('s'|'S')('t'|'T');
+CONDENSE: ('c'|'C')('o'|'O')('n'|'N')('d'|'D')('e'|'E')('n'|'N')('s'|'S')('e'|'E');
+USING: ('u'|'U')('s'|'S')('i'|'I')('n'|'N')('g'|'G');
+NEAREST: ('n'|'N')('e'|'E')('a'|'A')('r'|'R')('e'|'E')('s'|'S')('t'|'T');
+LINEAR: ('l'|'L')('i'|'I')('n'|'N')('e'|'E')('a'|'A')('r'|'R');
+QUADRATIC: ('q'|'Q')('u'|'U')('a'|'A')('d'|'D')('r'|'R')('a'|'A')('t'|'T')('i'|'I')('c'|'C');
+CUBIC: ('c'|'C')('u'|'U')('b'|'B')('i'|'I')('c'|'C');
+FULL: ('f'|'F')('u'|'U')('l'|'L')('l'|'L');
+NONE: ('n'|'N')('o'|'O')('n'|'N')('e'|'E');
+HALF: ('h'|'H')('a'|'A')('l'|'L')('f'|'F');
+OTHER: ('o'|'O')('t'|'T')('h'|'H')('e'|'E')('r'|'R');
+PHI: ('p'|'P')('h'|'H')('i'|'I');
+BIT: ('b'|'B')('i'|'I')('t'|'T');
+UNSIGNED: ('u'|'U')('n'|'N')('s'|'S')('i'|'I')('g'|'G')('n'|'N')('e'|'E')('d'|'D');
+BOOLEAN: ('b'|'B')('o'|'O')('o'|'O')('l'|'L')('e'|'E')('a'|'A')('n'|'N');
+CHAR: ('c'|'C')('h'|'H')('a'|'A')('r'|'R');
+SHORT: ('s'|'S')('h'|'H')('o'|'O')('r'|'R')('t'|'T');
+LONG: ('l'|'L')('o'|'O')('n'|'N')('g'|'G');
+FLOAT: ('f'|'F')('l'|'L')('o'|'O')('a'|'A')('t'|'T');
+DOUBLE: ('d'|'D')('o'|'O')('u'|'U')('b'|'B')('l'|'L')('e'|'E');
+COMPLEX: ('c'|'C')('o'|'O')('m'|'M')('p'|'P')('l'|'L')('e'|'E')('x'|'X');
+COMPLEX2: ('c'|'C')('o'|'O')('m'|'M')('p'|'P')('l'|'L')('e'|'E')('x'|'X')'2';
+BOOLEANCONSTANT: (('t'|'T')('r'|'R')('u'|'U')('e'|'E'))|(('f'|'F')('a'|'A')('l'|'L')('s'|'S')('e'|'E'));
+INTEGERCONSTANT: (PLUS|MINUS)? ('0'..'9')+;
+FLOATCONSTANT: INTEGERCONSTANT ('.')('0'..'9'+)(('e'|'E')(('-'|'+')?)('0'..'9'+))?;
+STRING: '"' ( options {greedy=false;} : . )* '"' {setText(getText().substring(1, getText().length()-1));};
+NAME: ('a'..'z'|'A'..'Z'|'_')(('a'..'z'|'A'..'Z'|'0'..'9'|'_')*);
+VARIABLE_DOLLAR: '$'(('a'..'z'|'A'..'Z'|'0'..'9'|'_')*) {setText(getText().substring(1, getText().length())); } ;
+WHITESPACE: (' ' | '\t' | '\r' | '\n' | '\u000C')+ { skip(); } ;
diff --git a/petascope/src/petascope/wcps/grammar/wcpsLexer.java b/petascope/src/petascope/wcps/grammar/wcpsLexer.java
new file mode 100644
index 0000000..317089c
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/wcpsLexer.java
@@ -0,0 +1,8464 @@
+// $ANTLR 3.2 Sep 23, 2009 12:02:23 src/petascope/wcps/grammar/wcps.g 2010-04-29 23:04:42
+package petascope.wcps.grammar;
+
+import org.antlr.runtime.*;
+import java.util.Stack;
+import java.util.List;
+import java.util.ArrayList;
+
+public class wcpsLexer extends Lexer {
+ public static final int IMAGECRS=28;
+ public static final int LT=18;
+ public static final int LN=66;
+ public static final int LOG=65;
+ public static final int CHAR=88;
+ public static final int COMPLEX=93;
+ public static final int SETINTERPOLATIONDEFAULT=54;
+ public static final int COUNT=37;
+ public static final int EQUALS=16;
+ public static final int COSH=71;
+ public static final int NOT=76;
+ public static final int INTEGERCONSTANT=78;
+ public static final int EOF=-1;
+ public static final int SINH=70;
+ public static final int LBRACKET=82;
+ public static final int RPAREN=7;
+ public static final int TANH=72;
+ public static final int LINEAR=100;
+ public static final int NAME=107;
+ public static final int FULL=103;
+ public static final int SIN=67;
+ public static final int USING=44;
+ public static final int EXP=64;
+ public static final int COS=68;
+ public static final int TAN=69;
+ public static final int RETURN=10;
+ public static final int DOUBLE=92;
+ public static final int NULLDEFAULT=109;
+ public static final int STORE=12;
+ public static final int DIVIDE=25;
+ public static final int BOOLEANCONSTANT=97;
+ public static final int RBRACE=57;
+ public static final int SETNULLSET=53;
+ public static final int CONDENSE=42;
+ public static final int WHITESPACE=111;
+ public static final int SEMICOLON=49;
+ public static final int VALUE=47;
+ public static final int MULT=24;
+ public static final int LIST=48;
+ public static final int COMPLEX2=94;
+ public static final int ABS=61;
+ public static final int CRSSET=30;
+ public static final int SCALE=81;
+ public static final int VARIABLE_DOLLAR=108;
+ public static final int FLOATCONSTANT=98;
+ public static final int IMAGECRSDOMAIN=29;
+ public static final int NONE=104;
+ public static final int OR=13;
+ public static final int TRIM=84;
+ public static final int GT=19;
+ public static final int ROUND=79;
+ public static final int QUADRATIC=101;
+ public static final int ENCODE=11;
+ public static final int PHI=110;
+ public static final int OVER=43;
+ public static final int COVERAGE=46;
+ public static final int WHERE=9;
+ public static final int RE=62;
+ public static final int OVERLAY=26;
+ public static final int GTE=21;
+ public static final int LBRACE=56;
+ public static final int MAX=41;
+ public static final int INTERPOLATIONDEFAULT=32;
+ public static final int FOR=4;
+ public static final int FLOAT=91;
+ public static final int SLICE=85;
+ public static final int AND=15;
+ public static final int LTE=20;
+ public static final int LPAREN=6;
+ public static final int EXTEND=86;
+ public static final int IM=63;
+ public static final int BOOLEAN=87;
+ public static final int IN=5;
+ public static final int COMMA=8;
+ public static final int AVG=39;
+ public static final int IDENTIFIER=27;
+ public static final int SOME=36;
+ public static final int ALL=35;
+ public static final int ARCSIN=73;
+ public static final int PLUS=22;
+ public static final int ARCCOS=74;
+ public static final int RBRACKET=83;
+ public static final int DOT=96;
+ public static final int ADD=38;
+ public static final int SETIDENTIFIER=51;
+ public static final int XOR=14;
+ public static final int SETINTERPOLATIONSET=55;
+ public static final int OTHER=106;
+ public static final int VALUES=50;
+ public static final int ARCTAN=75;
+ public static final int NOTEQUALS=17;
+ public static final int SHORT=89;
+ public static final int STRUCT=58;
+ public static final int MIN=40;
+ public static final int SQRT=60;
+ public static final int MINUS=23;
+ public static final int CRSTRANSFORM=59;
+ public static final int DOMAIN=34;
+ public static final int COLON=45;
+ public static final int CUBIC=102;
+ public static final int UNSIGNED=95;
+ public static final int NULLSET=31;
+ public static final int BIT=77;
+ public static final int LONG=90;
+ public static final int INTERPOLATIONSET=33;
+ public static final int SETCRSSET=52;
+ public static final int HALF=105;
+ public static final int STRING=80;
+ public static final int NEAREST=99;
+
+ // delegates
+ // delegators
+
+ public wcpsLexer() {;}
+ public wcpsLexer(CharStream input) {
+ this(input, new RecognizerSharedState());
+ }
+ public wcpsLexer(CharStream input, RecognizerSharedState state) {
+ super(input,state);
+
+ }
+ public String getGrammarFileName() { return "src/petascope/wcps/grammar/wcps.g"; }
+
+ // $ANTLR start "PLUS"
+ public final void mPLUS() throws RecognitionException {
+ try {
+ int _type = PLUS;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:393:5: ( '+' )
+ // src/petascope/wcps/grammar/wcps.g:393: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;
+ // src/petascope/wcps/grammar/wcps.g:394:6: ( '-' )
+ // src/petascope/wcps/grammar/wcps.g:394:9: '-'
+ {
+ match('-');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "MINUS"
+
+ // $ANTLR start "DIVIDE"
+ public final void mDIVIDE() throws RecognitionException {
+ try {
+ int _type = DIVIDE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:395:7: ( '/' )
+ // src/petascope/wcps/grammar/wcps.g:395:9: '/'
+ {
+ match('/');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "DIVIDE"
+
+ // $ANTLR start "MULT"
+ public final void mMULT() throws RecognitionException {
+ try {
+ int _type = MULT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:396:5: ( '*' )
+ // src/petascope/wcps/grammar/wcps.g:396:7: '*'
+ {
+ match('*');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "MULT"
+
+ // $ANTLR start "EQUALS"
+ public final void mEQUALS() throws RecognitionException {
+ try {
+ int _type = EQUALS;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:397:7: ( '=' )
+ // src/petascope/wcps/grammar/wcps.g:397:9: '='
+ {
+ match('=');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "EQUALS"
+
+ // $ANTLR start "NOTEQUALS"
+ public final void mNOTEQUALS() throws RecognitionException {
+ try {
+ int _type = NOTEQUALS;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:398:10: ( '!=' )
+ // src/petascope/wcps/grammar/wcps.g:398:12: '!='
+ {
+ match("!=");
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "NOTEQUALS"
+
+ // $ANTLR start "LT"
+ public final void mLT() throws RecognitionException {
+ try {
+ int _type = LT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:399:3: ( '<' )
+ // src/petascope/wcps/grammar/wcps.g:399:5: '<'
+ {
+ match('<');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "LT"
+
+ // $ANTLR start "GT"
+ public final void mGT() throws RecognitionException {
+ try {
+ int _type = GT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:400:3: ( '>' )
+ // src/petascope/wcps/grammar/wcps.g:400:5: '>'
+ {
+ match('>');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "GT"
+
+ // $ANTLR start "LTE"
+ public final void mLTE() throws RecognitionException {
+ try {
+ int _type = LTE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:401:4: ( '<=' )
+ // src/petascope/wcps/grammar/wcps.g:401:6: '<='
+ {
+ match("<=");
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "LTE"
+
+ // $ANTLR start "GTE"
+ public final void mGTE() throws RecognitionException {
+ try {
+ int _type = GTE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:402:4: ( '>=' )
+ // src/petascope/wcps/grammar/wcps.g:402:6: '>='
+ {
+ match(">=");
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "GTE"
+
+ // $ANTLR start "DOT"
+ public final void mDOT() throws RecognitionException {
+ try {
+ int _type = DOT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:403:4: ( '.' )
+ // src/petascope/wcps/grammar/wcps.g:403:6: '.'
+ {
+ match('.');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "DOT"
+
+ // $ANTLR start "LPAREN"
+ public final void mLPAREN() throws RecognitionException {
+ try {
+ int _type = LPAREN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:404:7: ( '(' )
+ // src/petascope/wcps/grammar/wcps.g:404:9: '('
+ {
+ 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;
+ // src/petascope/wcps/grammar/wcps.g:405:7: ( ')' )
+ // src/petascope/wcps/grammar/wcps.g:405:9: ')'
+ {
+ match(')');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "RPAREN"
+
+ // $ANTLR start "LBRACKET"
+ public final void mLBRACKET() throws RecognitionException {
+ try {
+ int _type = LBRACKET;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:406:9: ( '[' )
+ // src/petascope/wcps/grammar/wcps.g:406:11: '['
+ {
+ match('[');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "LBRACKET"
+
+ // $ANTLR start "RBRACKET"
+ public final void mRBRACKET() throws RecognitionException {
+ try {
+ int _type = RBRACKET;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:407:9: ( ']' )
+ // src/petascope/wcps/grammar/wcps.g:407:11: ']'
+ {
+ match(']');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "RBRACKET"
+
+ // $ANTLR start "LBRACE"
+ public final void mLBRACE() throws RecognitionException {
+ try {
+ int _type = LBRACE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:408:7: ( '{' )
+ // src/petascope/wcps/grammar/wcps.g:408:9: '{'
+ {
+ match('{');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "LBRACE"
+
+ // $ANTLR start "RBRACE"
+ public final void mRBRACE() throws RecognitionException {
+ try {
+ int _type = RBRACE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:409:7: ( '}' )
+ // src/petascope/wcps/grammar/wcps.g:409:9: '}'
+ {
+ match('}');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "RBRACE"
+
+ // $ANTLR start "COMMA"
+ public final void mCOMMA() throws RecognitionException {
+ try {
+ int _type = COMMA;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:410:6: ( ',' )
+ // src/petascope/wcps/grammar/wcps.g:410:8: ','
+ {
+ match(',');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "COMMA"
+
+ // $ANTLR start "COLON"
+ public final void mCOLON() throws RecognitionException {
+ try {
+ int _type = COLON;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:411:6: ( ':' )
+ // src/petascope/wcps/grammar/wcps.g:411:8: ':'
+ {
+ match(':');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "COLON"
+
+ // $ANTLR start "SEMICOLON"
+ public final void mSEMICOLON() throws RecognitionException {
+ try {
+ int _type = SEMICOLON;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:412:10: ( ';' )
+ // src/petascope/wcps/grammar/wcps.g:412:12: ';'
+ {
+ match(';');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "SEMICOLON"
+
+ // $ANTLR start "FOR"
+ public final void mFOR() throws RecognitionException {
+ try {
+ int _type = FOR;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:413:4: ( ( 'f' | 'F' ) ( 'o' | 'O' ) ( 'r' | 'R' ) )
+ // src/petascope/wcps/grammar/wcps.g:413:6: ( 'f' | 'F' ) ( 'o' | 'O' ) ( 'r' | 'R' )
+ {
+ 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)=='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 "FOR"
+
+ // $ANTLR start "IN"
+ public final void mIN() throws RecognitionException {
+ try {
+ int _type = IN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:414:3: ( ( 'i' | 'I' ) ( 'n' | 'N' ) )
+ // src/petascope/wcps/grammar/wcps.g:414:5: ( '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 "WHERE"
+ public final void mWHERE() throws RecognitionException {
+ try {
+ int _type = WHERE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:415:6: ( ( 'w' | 'W' ) ( 'h' | 'H' ) ( 'e' | 'E' ) ( 'r' | 'R' ) ( 'e' | 'E' ) )
+ // src/petascope/wcps/grammar/wcps.g:415:8: ( '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 "RETURN"
+ public final void mRETURN() throws RecognitionException {
+ try {
+ int _type = RETURN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:416:7: ( ( 'r' | 'R' ) ( 'e' | 'E' ) ( 't' | 'T' ) ( 'u' | 'U' ) ( 'r' | 'R' ) ( 'n' | 'N' ) )
+ // src/petascope/wcps/grammar/wcps.g:416:9: ( 'r' | 'R' ) ( 'e' | 'E' ) ( 't' | 'T' ) ( 'u' | 'U' ) ( 'r' | 'R' ) ( 'n' | 'N' )
+ {
+ 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)=='T'||input.LA(1)=='t' ) {
+ 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)=='R'||input.LA(1)=='r' ) {
+ 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 "RETURN"
+
+ // $ANTLR start "STORE"
+ public final void mSTORE() throws RecognitionException {
+ try {
+ int _type = STORE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:417:6: ( ( 's' | 'S' ) ( 't' | 'T' ) ( 'o' | 'O' ) ( 'r' | 'R' ) ( 'e' | 'E' ) )
+ // src/petascope/wcps/grammar/wcps.g:417:8: ( 's' | 'S' ) ( 't' | 'T' ) ( '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)=='T'||input.LA(1)=='t' ) {
+ 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 "STORE"
+
+ // $ANTLR start "ENCODE"
+ public final void mENCODE() throws RecognitionException {
+ try {
+ int _type = ENCODE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:418:7: ( ( 'e' | 'E' ) ( 'n' | 'N' ) ( 'c' | 'C' ) ( 'o' | 'O' ) ( 'd' | 'D' ) ( 'e' | 'E' ) )
+ // src/petascope/wcps/grammar/wcps.g:418:9: ( 'e' | 'E' ) ( 'n' | 'N' ) ( 'c' | 'C' ) ( 'o' | 'O' ) ( 'd' | 'D' ) ( 'e' | 'E' )
+ {
+ 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)=='N'||input.LA(1)=='n' ) {
+ 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)=='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;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "ENCODE"
+
+ // $ANTLR start "SQRT"
+ public final void mSQRT() throws RecognitionException {
+ try {
+ int _type = SQRT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:419:5: ( ( 's' | 'S' ) ( 'q' | 'Q' ) ( 'r' | 'R' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:419:7: ( 's' | 'S' ) ( 'q' | 'Q' ) ( 'r' | 'R' ) ( '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)=='Q'||input.LA(1)=='q' ) {
+ 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)=='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 "SQRT"
+
+ // $ANTLR start "SIN"
+ public final void mSIN() throws RecognitionException {
+ try {
+ int _type = SIN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:420:4: ( ( 's' | 'S' ) ( 'i' | 'I' ) ( 'n' | 'N' ) )
+ // src/petascope/wcps/grammar/wcps.g:420:6: ( 's' | 'S' ) ( 'i' | 'I' ) ( 'n' | 'N' )
+ {
+ 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)=='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 "SIN"
+
+ // $ANTLR start "COS"
+ public final void mCOS() throws RecognitionException {
+ try {
+ int _type = COS;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:421:4: ( ( 'c' | 'C' ) ( 'o' | 'O' ) ( 's' | 'S' ) )
+ // src/petascope/wcps/grammar/wcps.g:421:6: ( 'c' | 'C' ) ( 'o' | 'O' ) ( '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)=='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 "COS"
+
+ // $ANTLR start "TAN"
+ public final void mTAN() throws RecognitionException {
+ try {
+ int _type = TAN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:422:4: ( ( 't' | 'T' ) ( 'a' | 'A' ) ( 'n' | 'N' ) )
+ // src/petascope/wcps/grammar/wcps.g:422:6: ( 't' | 'T' ) ( 'a' | 'A' ) ( 'n' | 'N' )
+ {
+ 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)=='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 "TAN"
+
+ // $ANTLR start "SINH"
+ public final void mSINH() throws RecognitionException {
+ try {
+ int _type = SINH;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:423:5: ( ( 's' | 'S' ) ( 'i' | 'I' ) ( 'n' | 'N' ) ( 'h' | 'H' ) )
+ // src/petascope/wcps/grammar/wcps.g:423:7: ( 's' | 'S' ) ( 'i' | 'I' ) ( 'n' | 'N' ) ( 'h' | 'H' )
+ {
+ 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)=='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)=='H'||input.LA(1)=='h' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "SINH"
+
+ // $ANTLR start "COSH"
+ public final void mCOSH() throws RecognitionException {
+ try {
+ int _type = COSH;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:424:5: ( ( 'c' | 'C' ) ( 'o' | 'O' ) ( 's' | 'S' ) ( 'h' | 'H' ) )
+ // src/petascope/wcps/grammar/wcps.g:424:7: ( 'c' | 'C' ) ( 'o' | 'O' ) ( 's' | 'S' ) ( 'h' | 'H' )
+ {
+ 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)=='S'||input.LA(1)=='s' ) {
+ 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;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "COSH"
+
+ // $ANTLR start "TANH"
+ public final void mTANH() throws RecognitionException {
+ try {
+ int _type = TANH;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:425:5: ( ( 't' | 'T' ) ( 'a' | 'A' ) ( 'n' | 'N' ) ( 'h' | 'H' ) )
+ // src/petascope/wcps/grammar/wcps.g:425:7: ( 't' | 'T' ) ( 'a' | 'A' ) ( 'n' | 'N' ) ( 'h' | 'H' )
+ {
+ 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)=='N'||input.LA(1)=='n' ) {
+ 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;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "TANH"
+
+ // $ANTLR start "ARCSIN"
+ public final void mARCSIN() throws RecognitionException {
+ try {
+ int _type = ARCSIN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:426:7: ( ( 'a' | 'A' ) ( 'r' | 'R' ) ( 'c' | 'C' ) ( 's' | 'S' ) ( 'i' | 'I' ) ( 'n' | 'N' ) )
+ // src/petascope/wcps/grammar/wcps.g:426:9: ( 'a' | 'A' ) ( 'r' | 'R' ) ( 'c' | 'C' ) ( 's' | 'S' ) ( 'i' | 'I' ) ( 'n' | 'N' )
+ {
+ 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)=='R'||input.LA(1)=='r' ) {
+ 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)=='S'||input.LA(1)=='s' ) {
+ 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 "ARCSIN"
+
+ // $ANTLR start "ARCCOS"
+ public final void mARCCOS() throws RecognitionException {
+ try {
+ int _type = ARCCOS;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:427:7: ( ( 'a' | 'A' ) ( 'r' | 'R' ) ( 'c' | 'C' ) ( 'c' | 'C' ) ( 'o' | 'O' ) ( 's' | 'S' ) )
+ // src/petascope/wcps/grammar/wcps.g:427:9: ( 'a' | 'A' ) ( 'r' | 'R' ) ( 'c' | 'C' ) ( 'c' | 'C' ) ( 'o' | 'O' ) ( '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)=='R'||input.LA(1)=='r' ) {
+ 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)=='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)=='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 "ARCCOS"
+
+ // $ANTLR start "ARCTAN"
+ public final void mARCTAN() throws RecognitionException {
+ try {
+ int _type = ARCTAN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:428:7: ( ( 'a' | 'A' ) ( 'r' | 'R' ) ( 'c' | 'C' ) ( 't' | 'T' ) ( 'a' | 'A' ) ( 'n' | 'N' ) )
+ // src/petascope/wcps/grammar/wcps.g:428:9: ( 'a' | 'A' ) ( 'r' | 'R' ) ( 'c' | 'C' ) ( 't' | 'T' ) ( 'a' | 'A' ) ( 'n' | 'N' )
+ {
+ 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)=='R'||input.LA(1)=='r' ) {
+ 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;}
+
+ 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;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "ARCTAN"
+
+ // $ANTLR start "EXP"
+ public final void mEXP() throws RecognitionException {
+ try {
+ int _type = EXP;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:429:4: ( ( 'e' | 'E' ) ( 'x' | 'X' ) ( 'p' | 'P' ) )
+ // src/petascope/wcps/grammar/wcps.g:429:6: ( 'e' | 'E' ) ( 'x' | 'X' ) ( 'p' | 'P' )
+ {
+ 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)=='X'||input.LA(1)=='x' ) {
+ 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;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "EXP"
+
+ // $ANTLR start "LN"
+ public final void mLN() throws RecognitionException {
+ try {
+ int _type = LN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:430:3: ( ( 'l' | 'L' ) ( 'n' | 'N' ) )
+ // src/petascope/wcps/grammar/wcps.g:430:5: ( 'l' | 'L' ) ( 'n' | 'N' )
+ {
+ 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)=='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 "LN"
+
+ // $ANTLR start "LOG"
+ public final void mLOG() throws RecognitionException {
+ try {
+ int _type = LOG;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:431:4: ( ( 'l' | 'L' ) ( 'o' | 'O' ) ( 'g' | 'G' ) )
+ // src/petascope/wcps/grammar/wcps.g:431:6: ( 'l' | 'L' ) ( 'o' | 'O' ) ( 'g' | 'G' )
+ {
+ 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)=='G'||input.LA(1)=='g' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "LOG"
+
+ // $ANTLR start "ROUND"
+ public final void mROUND() throws RecognitionException {
+ try {
+ int _type = ROUND;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:432:6: ( ( 'r' | 'R' ) ( 'o' | 'O' ) ( 'u' | 'U' ) ( 'n' | 'N' ) ( 'd' | 'D' ) )
+ // src/petascope/wcps/grammar/wcps.g:432:8: ( 'r' | 'R' ) ( 'o' | 'O' ) ( 'u' | 'U' ) ( 'n' | 'N' ) ( 'd' | 'D' )
+ {
+ 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)=='U'||input.LA(1)=='u' ) {
+ 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 "ROUND"
+
+ // $ANTLR start "ABS"
+ public final void mABS() throws RecognitionException {
+ try {
+ int _type = ABS;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:433:4: ( ( 'a' | 'A' ) ( 'b' | 'B' ) ( 's' | 'S' ) )
+ // src/petascope/wcps/grammar/wcps.g:433:6: ( 'a' | 'A' ) ( 'b' | 'B' ) ( '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)=='B'||input.LA(1)=='b' ) {
+ 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 "ABS"
+
+ // $ANTLR start "OVERLAY"
+ public final void mOVERLAY() throws RecognitionException {
+ try {
+ int _type = OVERLAY;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:434:8: ( ( 'o' | 'O' ) ( 'v' | 'V' ) ( 'e' | 'E' ) ( 'r' | 'R' ) ( 'l' | 'L' ) ( 'a' | 'A' ) ( 'y' | 'Y' ) )
+ // src/petascope/wcps/grammar/wcps.g:434:10: ( 'o' | 'O' ) ( 'v' | 'V' ) ( 'e' | 'E' ) ( 'r' | 'R' ) ( 'l' | 'L' ) ( 'a' | 'A' ) ( 'y' | 'Y' )
+ {
+ 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)=='V'||input.LA(1)=='v' ) {
+ 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)=='L'||input.LA(1)=='l' ) {
+ 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)=='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 "OVERLAY"
+
+ // $ANTLR start "STRUCT"
+ public final void mSTRUCT() throws RecognitionException {
+ try {
+ int _type = STRUCT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:435:7: ( ( 's' | 'S' ) ( 't' | 'T' ) ( 'r' | 'R' ) ( 'u' | 'U' ) ( 'c' | 'C' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:435:9: ( 's' | 'S' ) ( 't' | 'T' ) ( 'r' | 'R' ) ( 'u' | 'U' ) ( '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)=='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)=='U'||input.LA(1)=='u' ) {
+ 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 "STRUCT"
+
+ // $ANTLR start "RE"
+ public final void mRE() throws RecognitionException {
+ try {
+ int _type = RE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:436:3: ( ( 'r' | 'R' ) ( 'e' | 'E' ) )
+ // src/petascope/wcps/grammar/wcps.g:436:5: ( 'r' | 'R' ) ( 'e' | 'E' )
+ {
+ 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 "RE"
+
+ // $ANTLR start "IM"
+ public final void mIM() throws RecognitionException {
+ try {
+ int _type = IM;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:437:3: ( ( 'i' | 'I' ) ( 'm' | 'M' ) )
+ // src/petascope/wcps/grammar/wcps.g:437:5: ( 'i' | 'I' ) ( 'm' | 'M' )
+ {
+ 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)=='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 "IM"
+
+ // $ANTLR start "AND"
+ public final void mAND() throws RecognitionException {
+ try {
+ int _type = AND;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:438:4: ( ( 'a' | 'A' ) ( 'n' | 'N' ) ( 'd' | 'D' ) )
+ // src/petascope/wcps/grammar/wcps.g:438:6: ( '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 "OR"
+ public final void mOR() throws RecognitionException {
+ try {
+ int _type = OR;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:439:3: ( ( 'o' | 'O' ) ( 'r' | 'R' ) )
+ // src/petascope/wcps/grammar/wcps.g:439:5: ( '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 "XOR"
+ public final void mXOR() throws RecognitionException {
+ try {
+ int _type = XOR;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:440:4: ( ( 'x' | 'X' ) ( 'o' | 'O' ) ( 'r' | 'R' ) )
+ // src/petascope/wcps/grammar/wcps.g:440:6: ( 'x' | 'X' ) ( 'o' | 'O' ) ( 'r' | 'R' )
+ {
+ if ( input.LA(1)=='X'||input.LA(1)=='x' ) {
+ 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;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "XOR"
+
+ // $ANTLR start "NOT"
+ public final void mNOT() throws RecognitionException {
+ try {
+ int _type = NOT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:441:4: ( ( 'n' | 'N' ) ( 'o' | 'O' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:441:6: ( '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 "IDENTIFIER"
+ public final void mIDENTIFIER() throws RecognitionException {
+ try {
+ int _type = IDENTIFIER;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:442:11: ( ( 'i' | 'I' ) ( 'd' | 'D' ) ( 'e' | 'E' ) ( 'n' | 'N' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'f' | 'F' ) ( 'i' | 'I' ) ( 'e' | 'E' ) ( 'r' | 'R' ) )
+ // src/petascope/wcps/grammar/wcps.g:442:13: ( 'i' | 'I' ) ( 'd' | 'D' ) ( 'e' | 'E' ) ( 'n' | 'N' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'f' | 'F' ) ( 'i' | 'I' ) ( '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)=='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)=='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)=='I'||input.LA(1)=='i' ) {
+ 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)=='I'||input.LA(1)=='i' ) {
+ 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 "IDENTIFIER"
+
+ // $ANTLR start "IMAGECRS"
+ public final void mIMAGECRS() throws RecognitionException {
+ try {
+ int _type = IMAGECRS;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:443:9: ( ( 'i' | 'I' ) ( 'm' | 'M' ) ( 'a' | 'A' ) ( 'g' | 'G' ) ( 'e' | 'E' ) ( 'c' | 'C' ) ( 'r' | 'R' ) ( 's' | 'S' ) )
+ // src/petascope/wcps/grammar/wcps.g:443:11: ( 'i' | 'I' ) ( 'm' | 'M' ) ( 'a' | 'A' ) ( 'g' | 'G' ) ( 'e' | 'E' ) ( 'c' | 'C' ) ( 'r' | 'R' ) ( '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)=='M'||input.LA(1)=='m' ) {
+ 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)=='G'||input.LA(1)=='g' ) {
+ 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)=='R'||input.LA(1)=='r' ) {
+ 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 "IMAGECRS"
+
+ // $ANTLR start "IMAGECRSDOMAIN"
+ public final void mIMAGECRSDOMAIN() throws RecognitionException {
+ try {
+ int _type = IMAGECRSDOMAIN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:444:15: ( ( 'i' | 'I' ) ( 'm' | 'M' ) ( 'a' | 'A' ) ( 'g' | 'G' ) ( 'e' | 'E' ) ( 'c' | 'C' ) ( 'r' | 'R' ) ( 's' | 'S' ) ( 'd' | 'D' ) ( 'o' | 'O' ) ( 'm' | 'M' ) ( 'a' | 'A' ) ( 'i' | 'I' ) ( 'n' | 'N' ) )
+ // src/petascope/wcps/grammar/wcps.g:444:17: ( 'i' | 'I' ) ( 'm' | 'M' ) ( 'a' | 'A' ) ( 'g' | 'G' ) ( 'e' | 'E' ) ( 'c' | 'C' ) ( 'r' | 'R' ) ( 's' | 'S' ) ( 'd' | 'D' ) ( 'o' | 'O' ) ( 'm' | 'M' ) ( 'a' | 'A' ) ( '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)=='M'||input.LA(1)=='m' ) {
+ 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)=='G'||input.LA(1)=='g' ) {
+ 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)=='R'||input.LA(1)=='r' ) {
+ 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)=='D'||input.LA(1)=='d' ) {
+ 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;}
+
+ 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;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "IMAGECRSDOMAIN"
+
+ // $ANTLR start "CRSSET"
+ public final void mCRSSET() throws RecognitionException {
+ try {
+ int _type = CRSSET;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:445:7: ( ( 'c' | 'C' ) ( 'r' | 'R' ) ( 's' | 'S' ) ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:445:9: ( 'c' | 'C' ) ( 'r' | 'R' ) ( 's' | 'S' ) ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' )
+ {
+ 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)=='R'||input.LA(1)=='r' ) {
+ 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)=='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)=='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 "CRSSET"
+
+ // $ANTLR start "DOMAIN"
+ public final void mDOMAIN() throws RecognitionException {
+ try {
+ int _type = DOMAIN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:446:7: ( ( 'd' | 'D' ) ( 'o' | 'O' ) ( 'm' | 'M' ) ( 'a' | 'A' ) ( 'i' | 'I' ) ( 'n' | 'N' ) )
+ // src/petascope/wcps/grammar/wcps.g:446:9: ( 'd' | 'D' ) ( 'o' | 'O' ) ( 'm' | 'M' ) ( 'a' | 'A' ) ( 'i' | 'I' ) ( 'n' | 'N' )
+ {
+ 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)=='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;}
+
+ 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;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "DOMAIN"
+
+ // $ANTLR start "NULLSET"
+ public final void mNULLSET() throws RecognitionException {
+ try {
+ int _type = NULLSET;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:447:8: ( ( 'n' | 'N' ) ( 'u' | 'U' ) ( 'l' | 'L' ) ( 'l' | 'L' ) ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:447:10: ( 'n' | 'N' ) ( 'u' | 'U' ) ( 'l' | 'L' ) ( 'l' | 'L' ) ( 's' | 'S' ) ( 'e' | 'E' ) ( '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)=='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;}
+
+ 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)=='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 "NULLSET"
+
+ // $ANTLR start "NULLDEFAULT"
+ public final void mNULLDEFAULT() throws RecognitionException {
+ try {
+ int _type = NULLDEFAULT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:448:12: ( ( 'n' | 'N' ) ( 'u' | 'U' ) ( 'l' | 'L' ) ( 'l' | 'L' ) ( 'd' | 'D' ) ( 'e' | 'E' ) ( 'f' | 'F' ) ( 'a' | 'A' ) ( 'u' | 'U' ) ( 'l' | 'L' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:448:14: ( 'n' | 'N' ) ( 'u' | 'U' ) ( 'l' | 'L' ) ( 'l' | 'L' ) ( 'd' | 'D' ) ( 'e' | 'E' ) ( 'f' | 'F' ) ( 'a' | 'A' ) ( 'u' | 'U' ) ( 'l' | 'L' ) ( '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)=='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;}
+
+ 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)=='F'||input.LA(1)=='f' ) {
+ 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)=='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)=='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 "NULLDEFAULT"
+
+ // $ANTLR start "INTERPOLATIONDEFAULT"
+ public final void mINTERPOLATIONDEFAULT() throws RecognitionException {
+ try {
+ int _type = INTERPOLATIONDEFAULT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:449:21: ( ( 'i' | 'I' ) ( 'n' | 'N' ) ( 't' | 'T' ) ( 'e' | 'E' ) ( 'r' | 'R' ) ( 'p' | 'P' ) ( 'o' | 'O' ) ( 'l' | 'L' ) ( 'a' | 'A' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'o' | 'O' ) ( 'n' | 'N' ) ( 'd' | 'D' ) ( 'e' | 'E' ) ( 'f' | 'F' ) ( 'a' | 'A' ) ( 'u' | 'U' ) ( 'l' | 'L' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:449:23: ( 'i' | 'I' ) ( 'n' | 'N' ) ( 't' | 'T' ) ( 'e' | 'E' ) ( 'r' | 'R' ) ( 'p' | 'P' ) ( 'o' | 'O' ) ( 'l' | 'L' ) ( 'a' | 'A' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'o' | 'O' ) ( 'n' | 'N' ) ( 'd' | 'D' ) ( 'e' | 'E' ) ( 'f' | 'F' ) ( 'a' | 'A' ) ( 'u' | 'U' ) ( 'l' | 'L' ) ( 't' | 'T' )
+ {
+ 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)=='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;}
+
+ 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)=='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)=='A'||input.LA(1)=='a' ) {
+ 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)=='I'||input.LA(1)=='i' ) {
+ 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)=='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)=='F'||input.LA(1)=='f' ) {
+ 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)=='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)=='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 "INTERPOLATIONDEFAULT"
+
+ // $ANTLR start "INTERPOLATIONSET"
+ public final void mINTERPOLATIONSET() throws RecognitionException {
+ try {
+ int _type = INTERPOLATIONSET;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:450:17: ( ( 'i' | 'I' ) ( 'n' | 'N' ) ( 't' | 'T' ) ( 'e' | 'E' ) ( 'r' | 'R' ) ( 'p' | 'P' ) ( 'o' | 'O' ) ( 'l' | 'L' ) ( 'a' | 'A' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'o' | 'O' ) ( 'n' | 'N' ) ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:450:19: ( 'i' | 'I' ) ( 'n' | 'N' ) ( 't' | 'T' ) ( 'e' | 'E' ) ( 'r' | 'R' ) ( 'p' | 'P' ) ( 'o' | 'O' ) ( 'l' | 'L' ) ( 'a' | 'A' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'o' | 'O' ) ( 'n' | 'N' ) ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' )
+ {
+ 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)=='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;}
+
+ 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)=='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)=='A'||input.LA(1)=='a' ) {
+ 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)=='I'||input.LA(1)=='i' ) {
+ 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)=='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)=='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 "INTERPOLATIONSET"
+
+ // $ANTLR start "SETIDENTIFIER"
+ public final void mSETIDENTIFIER() throws RecognitionException {
+ try {
+ int _type = SETIDENTIFIER;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:451:14: ( ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'd' | 'D' ) ( 'e' | 'E' ) ( 'n' | 'N' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'f' | 'F' ) ( 'i' | 'I' ) ( 'e' | 'E' ) ( 'r' | 'R' ) )
+ // src/petascope/wcps/grammar/wcps.g:451:16: ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'd' | 'D' ) ( 'e' | 'E' ) ( 'n' | 'N' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'f' | 'F' ) ( 'i' | 'I' ) ( 'e' | 'E' ) ( 'r' | 'R' )
+ {
+ 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)=='T'||input.LA(1)=='t' ) {
+ 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)=='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)=='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)=='I'||input.LA(1)=='i' ) {
+ 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)=='I'||input.LA(1)=='i' ) {
+ 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 "SETIDENTIFIER"
+
+ // $ANTLR start "SETNULLSET"
+ public final void mSETNULLSET() throws RecognitionException {
+ try {
+ int _type = SETNULLSET;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:452:11: ( ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) ( 'n' | 'N' ) ( 'u' | 'U' ) ( 'l' | 'L' ) ( 'l' | 'L' ) ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:452:13: ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) ( 'n' | 'N' ) ( 'u' | 'U' ) ( 'l' | 'L' ) ( 'l' | 'L' ) ( 's' | 'S' ) ( 'e' | 'E' ) ( '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)=='T'||input.LA(1)=='t' ) {
+ 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)=='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;}
+
+ 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)=='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 "SETNULLSET"
+
+ // $ANTLR start "SETINTERPOLATIONDEFAULT"
+ public final void mSETINTERPOLATIONDEFAULT() throws RecognitionException {
+ try {
+ int _type = SETINTERPOLATIONDEFAULT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:453:24: ( ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'n' | 'N' ) ( 't' | 'T' ) ( 'e' | 'E' ) ( 'r' | 'R' ) ( 'p' | 'P' ) ( 'o' | 'O' ) ( 'l' | 'L' ) ( 'a' | 'A' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'o' | 'O' ) ( 'n' | 'N' ) ( 'd' | 'D' ) ( 'e' | 'E' ) ( 'f' | 'F' ) ( 'a' | 'A' ) ( 'u' | 'U' ) ( 'l' | 'L' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:453:26: ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'n' | 'N' ) ( 't' | 'T' ) ( 'e' | 'E' ) ( 'r' | 'R' ) ( 'p' | 'P' ) ( 'o' | 'O' ) ( 'l' | 'L' ) ( 'a' | 'A' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'o' | 'O' ) ( 'n' | 'N' ) ( 'd' | 'D' ) ( 'e' | 'E' ) ( 'f' | 'F' ) ( 'a' | 'A' ) ( 'u' | 'U' ) ( 'l' | 'L' ) ( '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)=='T'||input.LA(1)=='t' ) {
+ 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)=='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;}
+
+ 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)=='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)=='A'||input.LA(1)=='a' ) {
+ 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)=='I'||input.LA(1)=='i' ) {
+ 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)=='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)=='F'||input.LA(1)=='f' ) {
+ 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)=='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)=='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 "SETINTERPOLATIONDEFAULT"
+
+ // $ANTLR start "SETINTERPOLATIONSET"
+ public final void mSETINTERPOLATIONSET() throws RecognitionException {
+ try {
+ int _type = SETINTERPOLATIONSET;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:454:20: ( ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'n' | 'N' ) ( 't' | 'T' ) ( 'e' | 'E' ) ( 'r' | 'R' ) ( 'p' | 'P' ) ( 'o' | 'O' ) ( 'l' | 'L' ) ( 'a' | 'A' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'o' | 'O' ) ( 'n' | 'N' ) ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:454:21: ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'n' | 'N' ) ( 't' | 'T' ) ( 'e' | 'E' ) ( 'r' | 'R' ) ( 'p' | 'P' ) ( 'o' | 'O' ) ( 'l' | 'L' ) ( 'a' | 'A' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'o' | 'O' ) ( 'n' | 'N' ) ( 's' | 'S' ) ( 'e' | 'E' ) ( '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)=='T'||input.LA(1)=='t' ) {
+ 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)=='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;}
+
+ 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)=='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)=='A'||input.LA(1)=='a' ) {
+ 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)=='I'||input.LA(1)=='i' ) {
+ 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)=='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)=='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 "SETINTERPOLATIONSET"
+
+ // $ANTLR start "SETCRSSET"
+ public final void mSETCRSSET() throws RecognitionException {
+ try {
+ int _type = SETCRSSET;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:455:10: ( ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) ( 'c' | 'C' ) ( 'r' | 'R' ) ( 's' | 'S' ) ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:455:12: ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) ( 'c' | 'C' ) ( 'r' | 'R' ) ( 's' | 'S' ) ( 's' | 'S' ) ( 'e' | 'E' ) ( '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)=='T'||input.LA(1)=='t' ) {
+ 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)=='R'||input.LA(1)=='r' ) {
+ 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)=='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)=='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 "SETCRSSET"
+
+ // $ANTLR start "TRIM"
+ public final void mTRIM() throws RecognitionException {
+ try {
+ int _type = TRIM;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:456:5: ( ( 't' | 'T' ) ( 'r' | 'R' ) ( 'i' | 'I' ) ( 'm' | 'M' ) )
+ // src/petascope/wcps/grammar/wcps.g:456:7: ( 't' | 'T' ) ( 'r' | 'R' ) ( 'i' | 'I' ) ( 'm' | 'M' )
+ {
+ 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)=='I'||input.LA(1)=='i' ) {
+ 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 "TRIM"
+
+ // $ANTLR start "SLICE"
+ public final void mSLICE() throws RecognitionException {
+ try {
+ int _type = SLICE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:457:6: ( ( 's' | 'S' ) ( 'l' | 'L' ) ( 'i' | 'I' ) ( 'c' | 'C' ) ( 'e' | 'E' ) )
+ // src/petascope/wcps/grammar/wcps.g:457:8: ( 's' | 'S' ) ( 'l' | 'L' ) ( 'i' | 'I' ) ( 'c' | 'C' ) ( '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)=='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)=='C'||input.LA(1)=='c' ) {
+ 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 "SLICE"
+
+ // $ANTLR start "EXTEND"
+ public final void mEXTEND() throws RecognitionException {
+ try {
+ int _type = EXTEND;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:458:7: ( ( 'e' | 'E' ) ( 'x' | 'X' ) ( 't' | 'T' ) ( 'e' | 'E' ) ( 'n' | 'N' ) ( 'd' | 'D' ) )
+ // src/petascope/wcps/grammar/wcps.g:458:9: ( 'e' | 'E' ) ( 'x' | 'X' ) ( 't' | 'T' ) ( 'e' | 'E' ) ( 'n' | 'N' ) ( 'd' | 'D' )
+ {
+ 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)=='X'||input.LA(1)=='x' ) {
+ 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)=='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 "EXTEND"
+
+ // $ANTLR start "SCALE"
+ public final void mSCALE() throws RecognitionException {
+ try {
+ int _type = SCALE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:459:6: ( ( 's' | 'S' ) ( 'c' | 'C' ) ( 'a' | 'A' ) ( 'l' | 'L' ) ( 'e' | 'E' ) )
+ // src/petascope/wcps/grammar/wcps.g:459:8: ( 's' | 'S' ) ( 'c' | 'C' ) ( 'a' | 'A' ) ( 'l' | 'L' ) ( '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)=='A'||input.LA(1)=='a' ) {
+ 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;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "SCALE"
+
+ // $ANTLR start "CRSTRANSFORM"
+ public final void mCRSTRANSFORM() throws RecognitionException {
+ try {
+ int _type = CRSTRANSFORM;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:460:13: ( ( 'c' | 'C' ) ( 'r' | 'R' ) ( 's' | 'S' ) ( 't' | 'T' ) ( 'r' | 'R' ) ( 'a' | 'A' ) ( 'n' | 'N' ) ( 's' | 'S' ) ( 'f' | 'F' ) ( 'o' | 'O' ) ( 'r' | 'R' ) ( 'm' | 'M' ) )
+ // src/petascope/wcps/grammar/wcps.g:460:15: ( 'c' | 'C' ) ( 'r' | 'R' ) ( 's' | 'S' ) ( 't' | 'T' ) ( 'r' | 'R' ) ( 'a' | 'A' ) ( 'n' | 'N' ) ( 's' | 'S' ) ( 'f' | 'F' ) ( 'o' | 'O' ) ( 'r' | 'R' ) ( 'm' | 'M' )
+ {
+ 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)=='R'||input.LA(1)=='r' ) {
+ 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)=='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)=='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)=='S'||input.LA(1)=='s' ) {
+ 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)=='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)=='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 "CRSTRANSFORM"
+
+ // $ANTLR start "COUNT"
+ public final void mCOUNT() throws RecognitionException {
+ try {
+ int _type = COUNT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:461:6: ( ( 'c' | 'C' ) ( 'o' | 'O' ) ( 'u' | 'U' ) ( 'n' | 'N' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:461:8: ( 'c' | 'C' ) ( 'o' | 'O' ) ( 'u' | 'U' ) ( 'n' | 'N' ) ( 't' | 'T' )
+ {
+ 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)=='U'||input.LA(1)=='u' ) {
+ 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;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "COUNT"
+
+ // $ANTLR start "ADD"
+ public final void mADD() throws RecognitionException {
+ try {
+ int _type = ADD;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:462:4: ( ( 'a' | 'A' ) ( 'd' | 'D' ) ( 'd' | 'D' ) )
+ // src/petascope/wcps/grammar/wcps.g:462:6: ( 'a' | 'A' ) ( 'd' | 'D' ) ( '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)=='D'||input.LA(1)=='d' ) {
+ 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 "ADD"
+
+ // $ANTLR start "AVG"
+ public final void mAVG() throws RecognitionException {
+ try {
+ int _type = AVG;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:463:4: ( ( 'a' | 'A' ) ( 'v' | 'V' ) ( 'g' | 'G' ) )
+ // src/petascope/wcps/grammar/wcps.g:463:6: ( 'a' | 'A' ) ( 'v' | 'V' ) ( 'g' | 'G' )
+ {
+ 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)=='V'||input.LA(1)=='v' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='G'||input.LA(1)=='g' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "AVG"
+
+ // $ANTLR start "MAX"
+ public final void mMAX() throws RecognitionException {
+ try {
+ int _type = MAX;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:464:4: ( ( 'm' | 'M' ) ( 'a' | 'A' ) ( 'x' | 'X' ) )
+ // src/petascope/wcps/grammar/wcps.g:464:6: ( 'm' | 'M' ) ( 'a' | 'A' ) ( 'x' | 'X' )
+ {
+ if ( input.LA(1)=='M'||input.LA(1)=='m' ) {
+ 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)=='X'||input.LA(1)=='x' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "MAX"
+
+ // $ANTLR start "MIN"
+ public final void mMIN() throws RecognitionException {
+ try {
+ int _type = MIN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:465:4: ( ( 'm' | 'M' ) ( 'i' | 'I' ) ( 'n' | 'N' ) )
+ // src/petascope/wcps/grammar/wcps.g:465:6: ( 'm' | 'M' ) ( 'i' | 'I' ) ( 'n' | 'N' )
+ {
+ if ( input.LA(1)=='M'||input.LA(1)=='m' ) {
+ 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 "MIN"
+
+ // $ANTLR start "SOME"
+ public final void mSOME() throws RecognitionException {
+ try {
+ int _type = SOME;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:466:5: ( ( 's' | 'S' ) ( 'o' | 'O' ) ( 'm' | 'M' ) ( 'e' | 'E' ) )
+ // src/petascope/wcps/grammar/wcps.g:466:7: ( 's' | 'S' ) ( 'o' | 'O' ) ( 'm' | 'M' ) ( '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)=='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;}
+
+ 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 "SOME"
+
+ // $ANTLR start "ALL"
+ public final void mALL() throws RecognitionException {
+ try {
+ int _type = ALL;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:467:4: ( ( 'a' | 'A' ) ( 'l' | 'L' ) ( 'l' | 'L' ) )
+ // src/petascope/wcps/grammar/wcps.g:467:6: ( 'a' | 'A' ) ( 'l' | 'L' ) ( 'l' | 'L' )
+ {
+ 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)=='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 "ALL"
+
+ // $ANTLR start "COVERAGE"
+ public final void mCOVERAGE() throws RecognitionException {
+ try {
+ int _type = COVERAGE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:468:9: ( ( 'c' | 'C' ) ( 'o' | 'O' ) ( 'v' | 'V' ) ( 'e' | 'E' ) ( 'r' | 'R' ) ( 'a' | 'A' ) ( 'g' | 'G' ) ( 'e' | 'E' ) )
+ // src/petascope/wcps/grammar/wcps.g:468:11: ( 'c' | 'C' ) ( 'o' | 'O' ) ( 'v' | 'V' ) ( 'e' | 'E' ) ( 'r' | 'R' ) ( 'a' | 'A' ) ( 'g' | 'G' ) ( 'e' | 'E' )
+ {
+ 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)=='V'||input.LA(1)=='v' ) {
+ 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)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='G'||input.LA(1)=='g' ) {
+ 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 "COVERAGE"
+
+ // $ANTLR start "OVER"
+ public final void mOVER() throws RecognitionException {
+ try {
+ int _type = OVER;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:469:5: ( ( 'o' | 'O' ) ( 'v' | 'V' ) ( 'e' | 'E' ) ( 'r' | 'R' ) )
+ // src/petascope/wcps/grammar/wcps.g:469:7: ( 'o' | 'O' ) ( 'v' | 'V' ) ( '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)=='V'||input.LA(1)=='v' ) {
+ 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 "OVER"
+
+ // $ANTLR start "VALUE"
+ public final void mVALUE() throws RecognitionException {
+ try {
+ int _type = VALUE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:470:6: ( ( 'v' | 'V' ) ( 'a' | 'A' ) ( 'l' | 'L' ) ( 'u' | 'U' ) ( 'e' | 'E' ) )
+ // src/petascope/wcps/grammar/wcps.g:470:8: ( 'v' | 'V' ) ( 'a' | 'A' ) ( 'l' | 'L' ) ( 'u' | 'U' ) ( 'e' | 'E' )
+ {
+ if ( input.LA(1)=='V'||input.LA(1)=='v' ) {
+ 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)=='L'||input.LA(1)=='l' ) {
+ 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)=='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 "VALUE"
+
+ // $ANTLR start "VALUES"
+ public final void mVALUES() throws RecognitionException {
+ try {
+ int _type = VALUES;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:471:7: ( ( 'v' | 'V' ) ( 'a' | 'A' ) ( 'l' | 'L' ) ( 'u' | 'U' ) ( 'e' | 'E' ) ( 's' | 'S' ) )
+ // src/petascope/wcps/grammar/wcps.g:471:9: ( 'v' | 'V' ) ( 'a' | 'A' ) ( 'l' | 'L' ) ( 'u' | 'U' ) ( 'e' | 'E' ) ( 's' | 'S' )
+ {
+ if ( input.LA(1)=='V'||input.LA(1)=='v' ) {
+ 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)=='L'||input.LA(1)=='l' ) {
+ 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)=='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;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "VALUES"
+
+ // $ANTLR start "LIST"
+ public final void mLIST() throws RecognitionException {
+ try {
+ int _type = LIST;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:472:5: ( ( 'l' | 'L' ) ( 'i' | 'I' ) ( 's' | 'S' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:472:7: ( 'l' | 'L' ) ( 'i' | 'I' ) ( 's' | 'S' ) ( '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)=='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;}
+
+ 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 "LIST"
+
+ // $ANTLR start "CONDENSE"
+ public final void mCONDENSE() throws RecognitionException {
+ try {
+ int _type = CONDENSE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:473:9: ( ( 'c' | 'C' ) ( 'o' | 'O' ) ( 'n' | 'N' ) ( 'd' | 'D' ) ( 'e' | 'E' ) ( 'n' | 'N' ) ( 's' | 'S' ) ( 'e' | 'E' ) )
+ // src/petascope/wcps/grammar/wcps.g:473:11: ( 'c' | 'C' ) ( 'o' | 'O' ) ( 'n' | 'N' ) ( 'd' | 'D' ) ( 'e' | 'E' ) ( 'n' | 'N' ) ( 's' | 'S' ) ( 'e' | 'E' )
+ {
+ 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)=='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)=='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;}
+
+ 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 "CONDENSE"
+
+ // $ANTLR start "USING"
+ public final void mUSING() throws RecognitionException {
+ try {
+ int _type = USING;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:474:6: ( ( 'u' | 'U' ) ( 's' | 'S' ) ( 'i' | 'I' ) ( 'n' | 'N' ) ( 'g' | 'G' ) )
+ // src/petascope/wcps/grammar/wcps.g:474:8: ( 'u' | 'U' ) ( 's' | 'S' ) ( 'i' | 'I' ) ( 'n' | 'N' ) ( 'g' | 'G' )
+ {
+ 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)=='S'||input.LA(1)=='s' ) {
+ 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)=='G'||input.LA(1)=='g' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "USING"
+
+ // $ANTLR start "NEAREST"
+ public final void mNEAREST() throws RecognitionException {
+ try {
+ int _type = NEAREST;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:475:8: ( ( 'n' | 'N' ) ( 'e' | 'E' ) ( 'a' | 'A' ) ( 'r' | 'R' ) ( 'e' | 'E' ) ( 's' | 'S' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:475:10: ( 'n' | 'N' ) ( 'e' | 'E' ) ( 'a' | 'A' ) ( 'r' | 'R' ) ( 'e' | 'E' ) ( 's' | 'S' ) ( '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)=='E'||input.LA(1)=='e' ) {
+ 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)=='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)=='S'||input.LA(1)=='s' ) {
+ 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 "NEAREST"
+
+ // $ANTLR start "LINEAR"
+ public final void mLINEAR() throws RecognitionException {
+ try {
+ int _type = LINEAR;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:476:7: ( ( 'l' | 'L' ) ( 'i' | 'I' ) ( 'n' | 'N' ) ( 'e' | 'E' ) ( 'a' | 'A' ) ( 'r' | 'R' ) )
+ // src/petascope/wcps/grammar/wcps.g:476:9: ( 'l' | 'L' ) ( 'i' | 'I' ) ( 'n' | 'N' ) ( 'e' | 'E' ) ( 'a' | 'A' ) ( '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)=='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)=='E'||input.LA(1)=='e' ) {
+ 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)=='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 "LINEAR"
+
+ // $ANTLR start "QUADRATIC"
+ public final void mQUADRATIC() throws RecognitionException {
+ try {
+ int _type = QUADRATIC;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:477:10: ( ( 'q' | 'Q' ) ( 'u' | 'U' ) ( 'a' | 'A' ) ( 'd' | 'D' ) ( 'r' | 'R' ) ( 'a' | 'A' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'c' | 'C' ) )
+ // src/petascope/wcps/grammar/wcps.g:477:12: ( 'q' | 'Q' ) ( 'u' | 'U' ) ( 'a' | 'A' ) ( 'd' | 'D' ) ( 'r' | 'R' ) ( 'a' | 'A' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'c' | 'C' )
+ {
+ if ( input.LA(1)=='Q'||input.LA(1)=='q' ) {
+ 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)=='A'||input.LA(1)=='a' ) {
+ 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)=='R'||input.LA(1)=='r' ) {
+ 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)=='T'||input.LA(1)=='t' ) {
+ 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)=='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 "QUADRATIC"
+
+ // $ANTLR start "CUBIC"
+ public final void mCUBIC() throws RecognitionException {
+ try {
+ int _type = CUBIC;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:478:6: ( ( 'c' | 'C' ) ( 'u' | 'U' ) ( 'b' | 'B' ) ( 'i' | 'I' ) ( 'c' | 'C' ) )
+ // src/petascope/wcps/grammar/wcps.g:478:8: ( 'c' | 'C' ) ( 'u' | 'U' ) ( 'b' | 'B' ) ( 'i' | 'I' ) ( 'c' | 'C' )
+ {
+ 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)=='U'||input.LA(1)=='u' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ 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)=='I'||input.LA(1)=='i' ) {
+ 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 "CUBIC"
+
+ // $ANTLR start "FULL"
+ public final void mFULL() throws RecognitionException {
+ try {
+ int _type = FULL;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:479:5: ( ( 'f' | 'F' ) ( 'u' | 'U' ) ( 'l' | 'L' ) ( 'l' | 'L' ) )
+ // src/petascope/wcps/grammar/wcps.g:479:7: ( 'f' | 'F' ) ( 'u' | 'U' ) ( 'l' | 'L' ) ( 'l' | 'L' )
+ {
+ 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)=='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 "FULL"
+
+ // $ANTLR start "NONE"
+ public final void mNONE() throws RecognitionException {
+ try {
+ int _type = NONE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:480:5: ( ( 'n' | 'N' ) ( 'o' | 'O' ) ( 'n' | 'N' ) ( 'e' | 'E' ) )
+ // src/petascope/wcps/grammar/wcps.g:480:7: ( 'n' | 'N' ) ( 'o' | 'O' ) ( 'n' | 'N' ) ( 'e' | 'E' )
+ {
+ 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)=='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;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "NONE"
+
+ // $ANTLR start "HALF"
+ public final void mHALF() throws RecognitionException {
+ try {
+ int _type = HALF;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:481:5: ( ( 'h' | 'H' ) ( 'a' | 'A' ) ( 'l' | 'L' ) ( 'f' | 'F' ) )
+ // src/petascope/wcps/grammar/wcps.g:481:7: ( 'h' | 'H' ) ( 'a' | 'A' ) ( 'l' | 'L' ) ( 'f' | 'F' )
+ {
+ 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)=='A'||input.LA(1)=='a' ) {
+ 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)=='F'||input.LA(1)=='f' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "HALF"
+
+ // $ANTLR start "OTHER"
+ public final void mOTHER() throws RecognitionException {
+ try {
+ int _type = OTHER;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:482:6: ( ( 'o' | 'O' ) ( 't' | 'T' ) ( 'h' | 'H' ) ( 'e' | 'E' ) ( 'r' | 'R' ) )
+ // src/petascope/wcps/grammar/wcps.g:482:8: ( 'o' | 'O' ) ( 't' | 'T' ) ( 'h' | 'H' ) ( '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)=='T'||input.LA(1)=='t' ) {
+ 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;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "OTHER"
+
+ // $ANTLR start "PHI"
+ public final void mPHI() throws RecognitionException {
+ try {
+ int _type = PHI;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:483:4: ( ( 'p' | 'P' ) ( 'h' | 'H' ) ( 'i' | 'I' ) )
+ // src/petascope/wcps/grammar/wcps.g:483:6: ( 'p' | 'P' ) ( 'h' | 'H' ) ( 'i' | 'I' )
+ {
+ 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)=='H'||input.LA(1)=='h' ) {
+ 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;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "PHI"
+
+ // $ANTLR start "BIT"
+ public final void mBIT() throws RecognitionException {
+ try {
+ int _type = BIT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:484:4: ( ( 'b' | 'B' ) ( 'i' | 'I' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:484:6: ( 'b' | 'B' ) ( 'i' | 'I' ) ( 't' | 'T' )
+ {
+ 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)=='I'||input.LA(1)=='i' ) {
+ 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 "BIT"
+
+ // $ANTLR start "UNSIGNED"
+ public final void mUNSIGNED() throws RecognitionException {
+ try {
+ int _type = UNSIGNED;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:485:9: ( ( 'u' | 'U' ) ( 'n' | 'N' ) ( 's' | 'S' ) ( 'i' | 'I' ) ( 'g' | 'G' ) ( 'n' | 'N' ) ( 'e' | 'E' ) ( 'd' | 'D' ) )
+ // src/petascope/wcps/grammar/wcps.g:485:11: ( 'u' | 'U' ) ( 'n' | 'N' ) ( 's' | 'S' ) ( 'i' | 'I' ) ( 'g' | 'G' ) ( 'n' | 'N' ) ( 'e' | 'E' ) ( 'd' | 'D' )
+ {
+ 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)=='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;}
+
+ 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)=='G'||input.LA(1)=='g' ) {
+ 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)=='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 "UNSIGNED"
+
+ // $ANTLR start "BOOLEAN"
+ public final void mBOOLEAN() throws RecognitionException {
+ try {
+ int _type = BOOLEAN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:486:8: ( ( 'b' | 'B' ) ( 'o' | 'O' ) ( 'o' | 'O' ) ( 'l' | 'L' ) ( 'e' | 'E' ) ( 'a' | 'A' ) ( 'n' | 'N' ) )
+ // src/petascope/wcps/grammar/wcps.g:486:10: ( 'b' | 'B' ) ( 'o' | 'O' ) ( 'o' | 'O' ) ( 'l' | 'L' ) ( 'e' | 'E' ) ( 'a' | 'A' ) ( 'n' | 'N' )
+ {
+ 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)=='O'||input.LA(1)=='o' ) {
+ 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)=='E'||input.LA(1)=='e' ) {
+ 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)=='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 "BOOLEAN"
+
+ // $ANTLR start "CHAR"
+ public final void mCHAR() throws RecognitionException {
+ try {
+ int _type = CHAR;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:487:5: ( ( 'c' | 'C' ) ( 'h' | 'H' ) ( 'a' | 'A' ) ( 'r' | 'R' ) )
+ // src/petascope/wcps/grammar/wcps.g:487:7: ( 'c' | 'C' ) ( 'h' | 'H' ) ( 'a' | 'A' ) ( 'r' | 'R' )
+ {
+ 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)=='H'||input.LA(1)=='h' ) {
+ 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)=='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 "CHAR"
+
+ // $ANTLR start "SHORT"
+ public final void mSHORT() throws RecognitionException {
+ try {
+ int _type = SHORT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:488:6: ( ( 's' | 'S' ) ( 'h' | 'H' ) ( 'o' | 'O' ) ( 'r' | 'R' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:488:8: ( 's' | 'S' ) ( 'h' | 'H' ) ( 'o' | 'O' ) ( 'r' | 'R' ) ( '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)=='H'||input.LA(1)=='h' ) {
+ 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)=='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 "SHORT"
+
+ // $ANTLR start "LONG"
+ public final void mLONG() throws RecognitionException {
+ try {
+ int _type = LONG;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:489:5: ( ( 'l' | 'L' ) ( 'o' | 'O' ) ( 'n' | 'N' ) ( 'g' | 'G' ) )
+ // src/petascope/wcps/grammar/wcps.g:489:7: ( 'l' | 'L' ) ( 'o' | 'O' ) ( 'n' | 'N' ) ( 'g' | 'G' )
+ {
+ 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)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='G'||input.LA(1)=='g' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "LONG"
+
+ // $ANTLR start "FLOAT"
+ public final void mFLOAT() throws RecognitionException {
+ try {
+ int _type = FLOAT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:490:6: ( ( 'f' | 'F' ) ( 'l' | 'L' ) ( 'o' | 'O' ) ( 'a' | 'A' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:490:8: ( 'f' | 'F' ) ( 'l' | 'L' ) ( 'o' | 'O' ) ( 'a' | 'A' ) ( 't' | 'T' )
+ {
+ 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)=='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)=='A'||input.LA(1)=='a' ) {
+ 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 "FLOAT"
+
+ // $ANTLR start "DOUBLE"
+ public final void mDOUBLE() throws RecognitionException {
+ try {
+ int _type = DOUBLE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:491:7: ( ( 'd' | 'D' ) ( 'o' | 'O' ) ( 'u' | 'U' ) ( 'b' | 'B' ) ( 'l' | 'L' ) ( 'e' | 'E' ) )
+ // src/petascope/wcps/grammar/wcps.g:491:9: ( 'd' | 'D' ) ( 'o' | 'O' ) ( 'u' | 'U' ) ( 'b' | 'B' ) ( 'l' | 'L' ) ( 'e' | 'E' )
+ {
+ 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)=='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)=='B'||input.LA(1)=='b' ) {
+ 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;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "DOUBLE"
+
+ // $ANTLR start "COMPLEX"
+ public final void mCOMPLEX() throws RecognitionException {
+ try {
+ int _type = COMPLEX;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:492:8: ( ( 'c' | 'C' ) ( 'o' | 'O' ) ( 'm' | 'M' ) ( 'p' | 'P' ) ( 'l' | 'L' ) ( 'e' | 'E' ) ( 'x' | 'X' ) )
+ // src/petascope/wcps/grammar/wcps.g:492:10: ( 'c' | 'C' ) ( 'o' | 'O' ) ( 'm' | 'M' ) ( 'p' | 'P' ) ( 'l' | 'L' ) ( 'e' | 'E' ) ( 'x' | 'X' )
+ {
+ 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)=='M'||input.LA(1)=='m' ) {
+ 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)=='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)=='X'||input.LA(1)=='x' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "COMPLEX"
+
+ // $ANTLR start "COMPLEX2"
+ public final void mCOMPLEX2() throws RecognitionException {
+ try {
+ int _type = COMPLEX2;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:493:9: ( ( 'c' | 'C' ) ( 'o' | 'O' ) ( 'm' | 'M' ) ( 'p' | 'P' ) ( 'l' | 'L' ) ( 'e' | 'E' ) ( 'x' | 'X' ) '2' )
+ // src/petascope/wcps/grammar/wcps.g:493:11: ( 'c' | 'C' ) ( 'o' | 'O' ) ( 'm' | 'M' ) ( 'p' | 'P' ) ( 'l' | 'L' ) ( 'e' | 'E' ) ( 'x' | 'X' ) '2'
+ {
+ 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)=='M'||input.LA(1)=='m' ) {
+ 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)=='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)=='X'||input.LA(1)=='x' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ match('2');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "COMPLEX2"
+
+ // $ANTLR start "BOOLEANCONSTANT"
+ public final void mBOOLEANCONSTANT() throws RecognitionException {
+ try {
+ int _type = BOOLEANCONSTANT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:494:16: ( ( ( 't' | 'T' ) ( 'r' | 'R' ) ( 'u' | 'U' ) ( 'e' | 'E' ) ) | ( ( 'f' | 'F' ) ( 'a' | 'A' ) ( 'l' | 'L' ) ( 's' | 'S' ) ( 'e' | 'E' ) ) )
+ int alt1=2;
+ int LA1_0 = input.LA(1);
+
+ if ( (LA1_0=='T'||LA1_0=='t') ) {
+ alt1=1;
+ }
+ else if ( (LA1_0=='F'||LA1_0=='f') ) {
+ alt1=2;
+ }
+ else {
+ NoViableAltException nvae =
+ new NoViableAltException("", 1, 0, input);
+
+ throw nvae;
+ }
+ switch (alt1) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:494:18: ( ( 't' | 'T' ) ( 'r' | 'R' ) ( 'u' | 'U' ) ( 'e' | 'E' ) )
+ {
+ // src/petascope/wcps/grammar/wcps.g:494:18: ( ( 't' | 'T' ) ( 'r' | 'R' ) ( 'u' | 'U' ) ( 'e' | 'E' ) )
+ // src/petascope/wcps/grammar/wcps.g:494:19: ( 't' | 'T' ) ( 'r' | 'R' ) ( 'u' | 'U' ) ( 'e' | 'E' )
+ {
+ 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)=='U'||input.LA(1)=='u' ) {
+ 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;}
+
+
+ }
+
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:494:57: ( ( 'f' | 'F' ) ( 'a' | 'A' ) ( 'l' | 'L' ) ( 's' | 'S' ) ( 'e' | 'E' ) )
+ {
+ // src/petascope/wcps/grammar/wcps.g:494:57: ( ( 'f' | 'F' ) ( 'a' | 'A' ) ( 'l' | 'L' ) ( 's' | 'S' ) ( 'e' | 'E' ) )
+ // src/petascope/wcps/grammar/wcps.g:494:58: ( 'f' | 'F' ) ( 'a' | 'A' ) ( 'l' | 'L' ) ( 's' | 'S' ) ( 'e' | 'E' )
+ {
+ 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)=='A'||input.LA(1)=='a' ) {
+ 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)=='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;}
+
+
+ }
+
+
+ }
+ break;
+
+ }
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "BOOLEANCONSTANT"
+
+ // $ANTLR start "INTEGERCONSTANT"
+ public final void mINTEGERCONSTANT() throws RecognitionException {
+ try {
+ int _type = INTEGERCONSTANT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:495:16: ( ( PLUS | MINUS )? ( '0' .. '9' )+ )
+ // src/petascope/wcps/grammar/wcps.g:495:19: ( PLUS | MINUS )? ( '0' .. '9' )+
+ {
+ // src/petascope/wcps/grammar/wcps.g:495:19: ( PLUS | MINUS )?
+ int alt2=2;
+ int LA2_0 = input.LA(1);
+
+ if ( (LA2_0=='+'||LA2_0=='-') ) {
+ alt2=1;
+ }
+ switch (alt2) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:
+ {
+ if ( input.LA(1)=='+'||input.LA(1)=='-' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+ break;
+
+ }
+
+ // src/petascope/wcps/grammar/wcps.g:495:33: ( '0' .. '9' )+
+ 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 :
+ // src/petascope/wcps/grammar/wcps.g:495:34: '0' .. '9'
+ {
+ matchRange('0','9');
+
+ }
+ break;
+
+ default :
+ if ( cnt3 >= 1 ) break loop3;
+ EarlyExitException eee =
+ new EarlyExitException(3, input);
+ throw eee;
+ }
+ cnt3++;
+ } while (true);
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "INTEGERCONSTANT"
+
+ // $ANTLR start "FLOATCONSTANT"
+ public final void mFLOATCONSTANT() throws RecognitionException {
+ try {
+ int _type = FLOATCONSTANT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:496:14: ( INTEGERCONSTANT ( '.' ) ( ( '0' .. '9' )+ ) ( ( 'e' | 'E' ) ( ( '-' | '+' )? ) ( ( '0' .. '9' )+ ) )? )
+ // src/petascope/wcps/grammar/wcps.g:496:16: INTEGERCONSTANT ( '.' ) ( ( '0' .. '9' )+ ) ( ( 'e' | 'E' ) ( ( '-' | '+' )? ) ( ( '0' .. '9' )+ ) )?
+ {
+ mINTEGERCONSTANT();
+ // src/petascope/wcps/grammar/wcps.g:496:32: ( '.' )
+ // src/petascope/wcps/grammar/wcps.g:496:33: '.'
+ {
+ match('.');
+
+ }
+
+ // src/petascope/wcps/grammar/wcps.g:496:37: ( ( '0' .. '9' )+ )
+ // src/petascope/wcps/grammar/wcps.g:496:38: ( '0' .. '9' )+
+ {
+ // src/petascope/wcps/grammar/wcps.g:496:38: ( '0' .. '9' )+
+ int cnt4=0;
+ loop4:
+ do {
+ int alt4=2;
+ int LA4_0 = input.LA(1);
+
+ if ( ((LA4_0>='0' && LA4_0<='9')) ) {
+ alt4=1;
+ }
+
+
+ switch (alt4) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:496:38: '0' .. '9'
+ {
+ matchRange('0','9');
+
+ }
+ break;
+
+ default :
+ if ( cnt4 >= 1 ) break loop4;
+ EarlyExitException eee =
+ new EarlyExitException(4, input);
+ throw eee;
+ }
+ cnt4++;
+ } while (true);
+
+
+ }
+
+ // src/petascope/wcps/grammar/wcps.g:496:48: ( ( 'e' | 'E' ) ( ( '-' | '+' )? ) ( ( '0' .. '9' )+ ) )?
+ int alt7=2;
+ int LA7_0 = input.LA(1);
+
+ if ( (LA7_0=='E'||LA7_0=='e') ) {
+ alt7=1;
+ }
+ switch (alt7) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:496:49: ( 'e' | 'E' ) ( ( '-' | '+' )? ) ( ( '0' .. '9' )+ )
+ {
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ // src/petascope/wcps/grammar/wcps.g:496:58: ( ( '-' | '+' )? )
+ // src/petascope/wcps/grammar/wcps.g:496:59: ( '-' | '+' )?
+ {
+ // src/petascope/wcps/grammar/wcps.g:496:59: ( '-' | '+' )?
+ int alt5=2;
+ int LA5_0 = input.LA(1);
+
+ if ( (LA5_0=='+'||LA5_0=='-') ) {
+ alt5=1;
+ }
+ switch (alt5) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:
+ {
+ if ( input.LA(1)=='+'||input.LA(1)=='-' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+ break;
+
+ }
+
+
+ }
+
+ // src/petascope/wcps/grammar/wcps.g:496:70: ( ( '0' .. '9' )+ )
+ // src/petascope/wcps/grammar/wcps.g:496:71: ( '0' .. '9' )+
+ {
+ // src/petascope/wcps/grammar/wcps.g:496:71: ( '0' .. '9' )+
+ 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 :
+ // src/petascope/wcps/grammar/wcps.g:496:71: '0' .. '9'
+ {
+ matchRange('0','9');
+
+ }
+ break;
+
+ default :
+ if ( cnt6 >= 1 ) break loop6;
+ EarlyExitException eee =
+ new EarlyExitException(6, input);
+ throw eee;
+ }
+ cnt6++;
+ } while (true);
+
+
+ }
+
+
+ }
+ break;
+
+ }
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "FLOATCONSTANT"
+
+ // $ANTLR start "STRING"
+ public final void mSTRING() throws RecognitionException {
+ try {
+ int _type = STRING;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:497:7: ( '\"' ( options {greedy=false; } : . )* '\"' )
+ // src/petascope/wcps/grammar/wcps.g:497:9: '\"' ( options {greedy=false; } : . )* '\"'
+ {
+ match('\"');
+ // src/petascope/wcps/grammar/wcps.g:497:13: ( options {greedy=false; } : . )*
+ loop8:
+ do {
+ int alt8=2;
+ int LA8_0 = input.LA(1);
+
+ if ( (LA8_0=='\"') ) {
+ alt8=2;
+ }
+ else if ( ((LA8_0>='\u0000' && LA8_0<='!')||(LA8_0>='#' && LA8_0<='\uFFFF')) ) {
+ alt8=1;
+ }
+
+
+ switch (alt8) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:497:41: .
+ {
+ matchAny();
+
+ }
+ break;
+
+ default :
+ break loop8;
+ }
+ } while (true);
+
+ match('\"');
+ setText(getText().substring(1, getText().length()-1));
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "STRING"
+
+ // $ANTLR start "NAME"
+ public final void mNAME() throws RecognitionException {
+ try {
+ int _type = NAME;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:498:5: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* ) )
+ // src/petascope/wcps/grammar/wcps.g:498:7: ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* )
+ {
+ 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;}
+
+ // src/petascope/wcps/grammar/wcps.g:498:30: ( ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* )
+ // src/petascope/wcps/grammar/wcps.g:498:31: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )*
+ {
+ // src/petascope/wcps/grammar/wcps.g:498:31: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )*
+ loop9:
+ do {
+ int alt9=2;
+ int LA9_0 = input.LA(1);
+
+ if ( ((LA9_0>='0' && LA9_0<='9')||(LA9_0>='A' && LA9_0<='Z')||LA9_0=='_'||(LA9_0>='a' && LA9_0<='z')) ) {
+ alt9=1;
+ }
+
+
+ switch (alt9) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:
+ {
+ if ( (input.LA(1)>='0' && input.LA(1)<='9')||(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 loop9;
+ }
+ } while (true);
+
+
+ }
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "NAME"
+
+ // $ANTLR start "VARIABLE_DOLLAR"
+ public final void mVARIABLE_DOLLAR() throws RecognitionException {
+ try {
+ int _type = VARIABLE_DOLLAR;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:499:16: ( '$' ( ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* ) )
+ // src/petascope/wcps/grammar/wcps.g:499:18: '$' ( ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* )
+ {
+ match('$');
+ // src/petascope/wcps/grammar/wcps.g:499:21: ( ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* )
+ // src/petascope/wcps/grammar/wcps.g:499:22: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )*
+ {
+ // src/petascope/wcps/grammar/wcps.g:499:22: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )*
+ loop10:
+ do {
+ int alt10=2;
+ int LA10_0 = input.LA(1);
+
+ if ( ((LA10_0>='0' && LA10_0<='9')||(LA10_0>='A' && LA10_0<='Z')||LA10_0=='_'||(LA10_0>='a' && LA10_0<='z')) ) {
+ alt10=1;
+ }
+
+
+ switch (alt10) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:
+ {
+ if ( (input.LA(1)>='0' && input.LA(1)<='9')||(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);
+
+
+ }
+
+ setText(getText().substring(1, getText().length()));
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "VARIABLE_DOLLAR"
+
+ // $ANTLR start "WHITESPACE"
+ public final void mWHITESPACE() throws RecognitionException {
+ try {
+ int _type = WHITESPACE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:500:11: ( ( ' ' | '\\t' | '\\r' | '\\n' | '\\u000C' )+ )
+ // src/petascope/wcps/grammar/wcps.g:500:13: ( ' ' | '\\t' | '\\r' | '\\n' | '\\u000C' )+
+ {
+ // src/petascope/wcps/grammar/wcps.g:500:13: ( ' ' | '\\t' | '\\r' | '\\n' | '\\u000C' )+
+ int cnt11=0;
+ loop11:
+ do {
+ int alt11=2;
+ int LA11_0 = input.LA(1);
+
+ if ( ((LA11_0>='\t' && LA11_0<='\n')||(LA11_0>='\f' && LA11_0<='\r')||LA11_0==' ') ) {
+ alt11=1;
+ }
+
+
+ switch (alt11) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:
+ {
+ if ( (input.LA(1)>='\t' && input.LA(1)<='\n')||(input.LA(1)>='\f' && 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);
+
+ skip();
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "WHITESPACE"
+
+ public void mTokens() throws RecognitionException {
+ // src/petascope/wcps/grammar/wcps.g:1:8: ( PLUS | MINUS | DIVIDE | MULT | EQUALS | NOTEQUALS | LT | GT | LTE | GTE | DOT | LPAREN | RPAREN | LBRACKET | RBRACKET | LBRACE | RBRACE | COMMA | COLON | SEMICOLON | FOR | IN | WHERE | RETURN | STORE | ENCODE | SQRT | SIN | COS | TAN | SINH | COSH | TANH | ARCSIN | ARCCOS | ARCTAN | EXP | LN | LOG | ROUND | ABS | OVERLAY | STRUCT | RE | IM | AND | OR | XOR | NOT | IDENTIFIER | IMAGECRS | IMAGECRSDOMAIN | CRSSET | DOMAIN | NULLSET | NULLDEFAULT | INTERPOLATIONDEFAULT | INTERPOLATIONSET | SETIDENTIFIER | SETNULLSET | SETINTERPOLATIONDEFAULT | SETINTERPOLATIONSET | SETCRSSET | TRIM | SLICE | EXTEND | SCALE | CRSTRANSFORM | COUNT | ADD | AVG | MAX | MIN | SOME | ALL | COVERAGE | OVER | VALUE | VALUES | LIST | CONDENSE | USING | NEAREST | LINEAR | QUADRATIC | CUBIC | FULL | NONE | HALF | OTHER | PHI | BIT | UNSIGNED | BOOLEAN | CHAR | SHORT | LONG | FLOAT | DOUBLE | COMPLEX | COMPLEX2 | BOOLEANCONSTANT | INTEGERCONSTANT | FLOATCONSTANT | STRING | NAME | VARIABLE_DOLLAR | WHITESPACE )
+ int alt12=108;
+ alt12 = dfa12.predict(input);
+ switch (alt12) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:1:10: PLUS
+ {
+ mPLUS();
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:1:15: MINUS
+ {
+ mMINUS();
+
+ }
+ break;
+ case 3 :
+ // src/petascope/wcps/grammar/wcps.g:1:21: DIVIDE
+ {
+ mDIVIDE();
+
+ }
+ break;
+ case 4 :
+ // src/petascope/wcps/grammar/wcps.g:1:28: MULT
+ {
+ mMULT();
+
+ }
+ break;
+ case 5 :
+ // src/petascope/wcps/grammar/wcps.g:1:33: EQUALS
+ {
+ mEQUALS();
+
+ }
+ break;
+ case 6 :
+ // src/petascope/wcps/grammar/wcps.g:1:40: NOTEQUALS
+ {
+ mNOTEQUALS();
+
+ }
+ break;
+ case 7 :
+ // src/petascope/wcps/grammar/wcps.g:1:50: LT
+ {
+ mLT();
+
+ }
+ break;
+ case 8 :
+ // src/petascope/wcps/grammar/wcps.g:1:53: GT
+ {
+ mGT();
+
+ }
+ break;
+ case 9 :
+ // src/petascope/wcps/grammar/wcps.g:1:56: LTE
+ {
+ mLTE();
+
+ }
+ break;
+ case 10 :
+ // src/petascope/wcps/grammar/wcps.g:1:60: GTE
+ {
+ mGTE();
+
+ }
+ break;
+ case 11 :
+ // src/petascope/wcps/grammar/wcps.g:1:64: DOT
+ {
+ mDOT();
+
+ }
+ break;
+ case 12 :
+ // src/petascope/wcps/grammar/wcps.g:1:68: LPAREN
+ {
+ mLPAREN();
+
+ }
+ break;
+ case 13 :
+ // src/petascope/wcps/grammar/wcps.g:1:75: RPAREN
+ {
+ mRPAREN();
+
+ }
+ break;
+ case 14 :
+ // src/petascope/wcps/grammar/wcps.g:1:82: LBRACKET
+ {
+ mLBRACKET();
+
+ }
+ break;
+ case 15 :
+ // src/petascope/wcps/grammar/wcps.g:1:91: RBRACKET
+ {
+ mRBRACKET();
+
+ }
+ break;
+ case 16 :
+ // src/petascope/wcps/grammar/wcps.g:1:100: LBRACE
+ {
+ mLBRACE();
+
+ }
+ break;
+ case 17 :
+ // src/petascope/wcps/grammar/wcps.g:1:107: RBRACE
+ {
+ mRBRACE();
+
+ }
+ break;
+ case 18 :
+ // src/petascope/wcps/grammar/wcps.g:1:114: COMMA
+ {
+ mCOMMA();
+
+ }
+ break;
+ case 19 :
+ // src/petascope/wcps/grammar/wcps.g:1:120: COLON
+ {
+ mCOLON();
+
+ }
+ break;
+ case 20 :
+ // src/petascope/wcps/grammar/wcps.g:1:126: SEMICOLON
+ {
+ mSEMICOLON();
+
+ }
+ break;
+ case 21 :
+ // src/petascope/wcps/grammar/wcps.g:1:136: FOR
+ {
+ mFOR();
+
+ }
+ break;
+ case 22 :
+ // src/petascope/wcps/grammar/wcps.g:1:140: IN
+ {
+ mIN();
+
+ }
+ break;
+ case 23 :
+ // src/petascope/wcps/grammar/wcps.g:1:143: WHERE
+ {
+ mWHERE();
+
+ }
+ break;
+ case 24 :
+ // src/petascope/wcps/grammar/wcps.g:1:149: RETURN
+ {
+ mRETURN();
+
+ }
+ break;
+ case 25 :
+ // src/petascope/wcps/grammar/wcps.g:1:156: STORE
+ {
+ mSTORE();
+
+ }
+ break;
+ case 26 :
+ // src/petascope/wcps/grammar/wcps.g:1:162: ENCODE
+ {
+ mENCODE();
+
+ }
+ break;
+ case 27 :
+ // src/petascope/wcps/grammar/wcps.g:1:169: SQRT
+ {
+ mSQRT();
+
+ }
+ break;
+ case 28 :
+ // src/petascope/wcps/grammar/wcps.g:1:174: SIN
+ {
+ mSIN();
+
+ }
+ break;
+ case 29 :
+ // src/petascope/wcps/grammar/wcps.g:1:178: COS
+ {
+ mCOS();
+
+ }
+ break;
+ case 30 :
+ // src/petascope/wcps/grammar/wcps.g:1:182: TAN
+ {
+ mTAN();
+
+ }
+ break;
+ case 31 :
+ // src/petascope/wcps/grammar/wcps.g:1:186: SINH
+ {
+ mSINH();
+
+ }
+ break;
+ case 32 :
+ // src/petascope/wcps/grammar/wcps.g:1:191: COSH
+ {
+ mCOSH();
+
+ }
+ break;
+ case 33 :
+ // src/petascope/wcps/grammar/wcps.g:1:196: TANH
+ {
+ mTANH();
+
+ }
+ break;
+ case 34 :
+ // src/petascope/wcps/grammar/wcps.g:1:201: ARCSIN
+ {
+ mARCSIN();
+
+ }
+ break;
+ case 35 :
+ // src/petascope/wcps/grammar/wcps.g:1:208: ARCCOS
+ {
+ mARCCOS();
+
+ }
+ break;
+ case 36 :
+ // src/petascope/wcps/grammar/wcps.g:1:215: ARCTAN
+ {
+ mARCTAN();
+
+ }
+ break;
+ case 37 :
+ // src/petascope/wcps/grammar/wcps.g:1:222: EXP
+ {
+ mEXP();
+
+ }
+ break;
+ case 38 :
+ // src/petascope/wcps/grammar/wcps.g:1:226: LN
+ {
+ mLN();
+
+ }
+ break;
+ case 39 :
+ // src/petascope/wcps/grammar/wcps.g:1:229: LOG
+ {
+ mLOG();
+
+ }
+ break;
+ case 40 :
+ // src/petascope/wcps/grammar/wcps.g:1:233: ROUND
+ {
+ mROUND();
+
+ }
+ break;
+ case 41 :
+ // src/petascope/wcps/grammar/wcps.g:1:239: ABS
+ {
+ mABS();
+
+ }
+ break;
+ case 42 :
+ // src/petascope/wcps/grammar/wcps.g:1:243: OVERLAY
+ {
+ mOVERLAY();
+
+ }
+ break;
+ case 43 :
+ // src/petascope/wcps/grammar/wcps.g:1:251: STRUCT
+ {
+ mSTRUCT();
+
+ }
+ break;
+ case 44 :
+ // src/petascope/wcps/grammar/wcps.g:1:258: RE
+ {
+ mRE();
+
+ }
+ break;
+ case 45 :
+ // src/petascope/wcps/grammar/wcps.g:1:261: IM
+ {
+ mIM();
+
+ }
+ break;
+ case 46 :
+ // src/petascope/wcps/grammar/wcps.g:1:264: AND
+ {
+ mAND();
+
+ }
+ break;
+ case 47 :
+ // src/petascope/wcps/grammar/wcps.g:1:268: OR
+ {
+ mOR();
+
+ }
+ break;
+ case 48 :
+ // src/petascope/wcps/grammar/wcps.g:1:271: XOR
+ {
+ mXOR();
+
+ }
+ break;
+ case 49 :
+ // src/petascope/wcps/grammar/wcps.g:1:275: NOT
+ {
+ mNOT();
+
+ }
+ break;
+ case 50 :
+ // src/petascope/wcps/grammar/wcps.g:1:279: IDENTIFIER
+ {
+ mIDENTIFIER();
+
+ }
+ break;
+ case 51 :
+ // src/petascope/wcps/grammar/wcps.g:1:290: IMAGECRS
+ {
+ mIMAGECRS();
+
+ }
+ break;
+ case 52 :
+ // src/petascope/wcps/grammar/wcps.g:1:299: IMAGECRSDOMAIN
+ {
+ mIMAGECRSDOMAIN();
+
+ }
+ break;
+ case 53 :
+ // src/petascope/wcps/grammar/wcps.g:1:314: CRSSET
+ {
+ mCRSSET();
+
+ }
+ break;
+ case 54 :
+ // src/petascope/wcps/grammar/wcps.g:1:321: DOMAIN
+ {
+ mDOMAIN();
+
+ }
+ break;
+ case 55 :
+ // src/petascope/wcps/grammar/wcps.g:1:328: NULLSET
+ {
+ mNULLSET();
+
+ }
+ break;
+ case 56 :
+ // src/petascope/wcps/grammar/wcps.g:1:336: NULLDEFAULT
+ {
+ mNULLDEFAULT();
+
+ }
+ break;
+ case 57 :
+ // src/petascope/wcps/grammar/wcps.g:1:348: INTERPOLATIONDEFAULT
+ {
+ mINTERPOLATIONDEFAULT();
+
+ }
+ break;
+ case 58 :
+ // src/petascope/wcps/grammar/wcps.g:1:369: INTERPOLATIONSET
+ {
+ mINTERPOLATIONSET();
+
+ }
+ break;
+ case 59 :
+ // src/petascope/wcps/grammar/wcps.g:1:386: SETIDENTIFIER
+ {
+ mSETIDENTIFIER();
+
+ }
+ break;
+ case 60 :
+ // src/petascope/wcps/grammar/wcps.g:1:400: SETNULLSET
+ {
+ mSETNULLSET();
+
+ }
+ break;
+ case 61 :
+ // src/petascope/wcps/grammar/wcps.g:1:411: SETINTERPOLATIONDEFAULT
+ {
+ mSETINTERPOLATIONDEFAULT();
+
+ }
+ break;
+ case 62 :
+ // src/petascope/wcps/grammar/wcps.g:1:435: SETINTERPOLATIONSET
+ {
+ mSETINTERPOLATIONSET();
+
+ }
+ break;
+ case 63 :
+ // src/petascope/wcps/grammar/wcps.g:1:455: SETCRSSET
+ {
+ mSETCRSSET();
+
+ }
+ break;
+ case 64 :
+ // src/petascope/wcps/grammar/wcps.g:1:465: TRIM
+ {
+ mTRIM();
+
+ }
+ break;
+ case 65 :
+ // src/petascope/wcps/grammar/wcps.g:1:470: SLICE
+ {
+ mSLICE();
+
+ }
+ break;
+ case 66 :
+ // src/petascope/wcps/grammar/wcps.g:1:476: EXTEND
+ {
+ mEXTEND();
+
+ }
+ break;
+ case 67 :
+ // src/petascope/wcps/grammar/wcps.g:1:483: SCALE
+ {
+ mSCALE();
+
+ }
+ break;
+ case 68 :
+ // src/petascope/wcps/grammar/wcps.g:1:489: CRSTRANSFORM
+ {
+ mCRSTRANSFORM();
+
+ }
+ break;
+ case 69 :
+ // src/petascope/wcps/grammar/wcps.g:1:502: COUNT
+ {
+ mCOUNT();
+
+ }
+ break;
+ case 70 :
+ // src/petascope/wcps/grammar/wcps.g:1:508: ADD
+ {
+ mADD();
+
+ }
+ break;
+ case 71 :
+ // src/petascope/wcps/grammar/wcps.g:1:512: AVG
+ {
+ mAVG();
+
+ }
+ break;
+ case 72 :
+ // src/petascope/wcps/grammar/wcps.g:1:516: MAX
+ {
+ mMAX();
+
+ }
+ break;
+ case 73 :
+ // src/petascope/wcps/grammar/wcps.g:1:520: MIN
+ {
+ mMIN();
+
+ }
+ break;
+ case 74 :
+ // src/petascope/wcps/grammar/wcps.g:1:524: SOME
+ {
+ mSOME();
+
+ }
+ break;
+ case 75 :
+ // src/petascope/wcps/grammar/wcps.g:1:529: ALL
+ {
+ mALL();
+
+ }
+ break;
+ case 76 :
+ // src/petascope/wcps/grammar/wcps.g:1:533: COVERAGE
+ {
+ mCOVERAGE();
+
+ }
+ break;
+ case 77 :
+ // src/petascope/wcps/grammar/wcps.g:1:542: OVER
+ {
+ mOVER();
+
+ }
+ break;
+ case 78 :
+ // src/petascope/wcps/grammar/wcps.g:1:547: VALUE
+ {
+ mVALUE();
+
+ }
+ break;
+ case 79 :
+ // src/petascope/wcps/grammar/wcps.g:1:553: VALUES
+ {
+ mVALUES();
+
+ }
+ break;
+ case 80 :
+ // src/petascope/wcps/grammar/wcps.g:1:560: LIST
+ {
+ mLIST();
+
+ }
+ break;
+ case 81 :
+ // src/petascope/wcps/grammar/wcps.g:1:565: CONDENSE
+ {
+ mCONDENSE();
+
+ }
+ break;
+ case 82 :
+ // src/petascope/wcps/grammar/wcps.g:1:574: USING
+ {
+ mUSING();
+
+ }
+ break;
+ case 83 :
+ // src/petascope/wcps/grammar/wcps.g:1:580: NEAREST
+ {
+ mNEAREST();
+
+ }
+ break;
+ case 84 :
+ // src/petascope/wcps/grammar/wcps.g:1:588: LINEAR
+ {
+ mLINEAR();
+
+ }
+ break;
+ case 85 :
+ // src/petascope/wcps/grammar/wcps.g:1:595: QUADRATIC
+ {
+ mQUADRATIC();
+
+ }
+ break;
+ case 86 :
+ // src/petascope/wcps/grammar/wcps.g:1:605: CUBIC
+ {
+ mCUBIC();
+
+ }
+ break;
+ case 87 :
+ // src/petascope/wcps/grammar/wcps.g:1:611: FULL
+ {
+ mFULL();
+
+ }
+ break;
+ case 88 :
+ // src/petascope/wcps/grammar/wcps.g:1:616: NONE
+ {
+ mNONE();
+
+ }
+ break;
+ case 89 :
+ // src/petascope/wcps/grammar/wcps.g:1:621: HALF
+ {
+ mHALF();
+
+ }
+ break;
+ case 90 :
+ // src/petascope/wcps/grammar/wcps.g:1:626: OTHER
+ {
+ mOTHER();
+
+ }
+ break;
+ case 91 :
+ // src/petascope/wcps/grammar/wcps.g:1:632: PHI
+ {
+ mPHI();
+
+ }
+ break;
+ case 92 :
+ // src/petascope/wcps/grammar/wcps.g:1:636: BIT
+ {
+ mBIT();
+
+ }
+ break;
+ case 93 :
+ // src/petascope/wcps/grammar/wcps.g:1:640: UNSIGNED
+ {
+ mUNSIGNED();
+
+ }
+ break;
+ case 94 :
+ // src/petascope/wcps/grammar/wcps.g:1:649: BOOLEAN
+ {
+ mBOOLEAN();
+
+ }
+ break;
+ case 95 :
+ // src/petascope/wcps/grammar/wcps.g:1:657: CHAR
+ {
+ mCHAR();
+
+ }
+ break;
+ case 96 :
+ // src/petascope/wcps/grammar/wcps.g:1:662: SHORT
+ {
+ mSHORT();
+
+ }
+ break;
+ case 97 :
+ // src/petascope/wcps/grammar/wcps.g:1:668: LONG
+ {
+ mLONG();
+
+ }
+ break;
+ case 98 :
+ // src/petascope/wcps/grammar/wcps.g:1:673: FLOAT
+ {
+ mFLOAT();
+
+ }
+ break;
+ case 99 :
+ // src/petascope/wcps/grammar/wcps.g:1:679: DOUBLE
+ {
+ mDOUBLE();
+
+ }
+ break;
+ case 100 :
+ // src/petascope/wcps/grammar/wcps.g:1:686: COMPLEX
+ {
+ mCOMPLEX();
+
+ }
+ break;
+ case 101 :
+ // src/petascope/wcps/grammar/wcps.g:1:694: COMPLEX2
+ {
+ mCOMPLEX2();
+
+ }
+ break;
+ case 102 :
+ // src/petascope/wcps/grammar/wcps.g:1:703: BOOLEANCONSTANT
+ {
+ mBOOLEANCONSTANT();
+
+ }
+ break;
+ case 103 :
+ // src/petascope/wcps/grammar/wcps.g:1:719: INTEGERCONSTANT
+ {
+ mINTEGERCONSTANT();
+
+ }
+ break;
+ case 104 :
+ // src/petascope/wcps/grammar/wcps.g:1:735: FLOATCONSTANT
+ {
+ mFLOATCONSTANT();
+
+ }
+ break;
+ case 105 :
+ // src/petascope/wcps/grammar/wcps.g:1:749: STRING
+ {
+ mSTRING();
+
+ }
+ break;
+ case 106 :
+ // src/petascope/wcps/grammar/wcps.g:1:756: NAME
+ {
+ mNAME();
+
+ }
+ break;
+ case 107 :
+ // src/petascope/wcps/grammar/wcps.g:1:761: VARIABLE_DOLLAR
+ {
+ mVARIABLE_DOLLAR();
+
+ }
+ break;
+ case 108 :
+ // src/petascope/wcps/grammar/wcps.g:1:777: WHITESPACE
+ {
+ mWHITESPACE();
+
+ }
+ break;
+
+ }
+
+ }
+
+
+ protected DFA12 dfa12 = new DFA12(this);
+ static final String DFA12_eotS =
+ "\1\uffff\1\55\1\56\4\uffff\1\60\1\62\12\uffff\25\52\1\150\12\uffff"+
+ "\4\52\1\157\1\161\2\52\1\165\27\52\1\u0094\3\52\1\u009a\20\52\2"+
+ "\uffff\1\u00ad\4\52\1\uffff\1\52\1\uffff\3\52\1\uffff\4\52\1\u00bb"+
+ "\6\52\1\u00c4\1\52\1\u00c7\7\52\1\u00d1\3\52\1\u00d7\1\u00d8\1\u00d9"+
+ "\1\u00da\1\u00db\1\uffff\1\u00dc\4\52\1\uffff\1\52\1\u00e2\1\u00e3"+
+ "\5\52\1\u00e9\1\u00ea\5\52\1\u00f0\1\u00f1\1\52\1\uffff\1\u00f3"+
+ "\12\52\1\u00fe\1\u00ff\1\uffff\5\52\1\u0106\2\52\1\uffff\1\52\1"+
+ "\u010a\1\uffff\7\52\1\u0112\1\u0113\1\uffff\1\u0114\1\u0115\3\52"+
+ "\6\uffff\1\u0119\1\u011a\1\52\1\u011d\1\52\2\uffff\1\u011f\4\52"+
+ "\2\uffff\4\52\1\u0129\2\uffff\1\52\1\uffff\1\u012b\1\u0115\3\52"+
+ "\1\u012f\1\52\1\u0131\1\u0132\1\52\2\uffff\4\52\1\u0138\1\u0139"+
+ "\1\uffff\1\u013a\2\52\1\uffff\1\u013d\5\52\1\u0143\4\uffff\3\52"+
+ "\2\uffff\2\52\1\uffff\1\u0149\1\uffff\5\52\1\u0150\1\u0151\2\52"+
+ "\1\uffff\1\52\1\uffff\3\52\1\uffff\1\u0158\2\uffff\1\u0159\4\52"+
+ "\3\uffff\1\u015e\1\u015f\1\uffff\3\52\1\u0163\1\52\1\uffff\1\u0165"+
+ "\1\u0166\1\u0167\1\u0168\1\52\1\uffff\3\52\1\u016d\1\u016e\1\u016f"+
+ "\2\uffff\6\52\2\uffff\4\52\2\uffff\2\52\1\u017d\1\uffff\1\52\4\uffff"+
+ "\1\u017f\1\u0180\1\52\1\u0182\3\uffff\2\52\1\u0185\1\52\1\u0188"+
+ "\5\52\1\u018e\1\u018f\1\u0190\1\uffff\1\52\2\uffff\1\52\1\uffff"+
+ "\1\u0193\1\52\1\uffff\2\52\1\uffff\4\52\1\u019b\3\uffff\2\52\1\uffff"+
+ "\1\u019e\2\52\1\u01a1\2\52\1\u01a4\1\uffff\2\52\1\uffff\2\52\1\uffff"+
+ "\2\52\1\uffff\1\52\1\u01ac\4\52\1\u01b1\1\uffff\2\52\1\u01b5\1\52"+
+ "\1\uffff\2\52\1\u01b9\1\uffff\3\52\1\uffff\2\52\1\u01bf\2\52\1\uffff"+
+ "\7\52\1\u01ca\1\u01cb\1\52\2\uffff\2\52\1\u01cf\1\uffff";
+ static final String DFA12_eofS =
+ "\u01d0\uffff";
+ static final String DFA12_minS =
+ "\1\11\2\60\4\uffff\2\75\12\uffff\1\101\1\104\1\110\1\105\1\103\1"+
+ "\116\1\110\1\101\1\102\1\111\1\122\1\117\1\105\1\117\2\101\1\116"+
+ "\1\125\1\101\1\110\1\111\1\56\12\uffff\1\122\1\114\1\117\1\114\2"+
+ "\60\2\105\1\60\1\125\1\117\1\122\1\116\1\124\1\111\1\101\1\115\1"+
+ "\117\1\103\1\120\1\115\1\123\1\102\1\101\1\116\1\111\1\103\1\123"+
+ "\2\104\1\107\1\114\1\60\1\107\1\116\1\105\1\60\1\110\1\122\1\116"+
+ "\1\114\1\101\1\115\1\130\1\116\1\114\1\111\1\123\1\101\1\114\1\111"+
+ "\1\124\1\117\2\uffff\1\60\1\114\1\101\1\123\1\105\1\uffff\1\107"+
+ "\1\uffff\1\116\1\122\1\125\1\uffff\1\116\1\122\1\125\1\124\1\60"+
+ "\2\103\1\114\1\105\1\122\1\117\1\60\1\105\1\60\1\116\1\105\1\104"+
+ "\1\120\1\123\1\111\1\122\1\60\1\115\1\105\1\103\5\60\1\uffff\1\60"+
+ "\1\107\1\124\1\105\1\122\1\uffff\1\105\2\60\1\105\1\114\1\122\1"+
+ "\101\1\102\2\60\1\125\1\116\1\111\1\104\1\106\2\60\1\114\1\uffff"+
+ "\1\60\1\124\1\105\1\122\1\105\1\124\1\105\1\122\1\104\1\105\1\103"+
+ "\2\60\1\uffff\1\104\1\125\1\122\2\105\1\60\1\124\1\104\1\uffff\1"+
+ "\116\1\60\1\uffff\1\124\1\122\1\105\1\114\1\105\1\122\1\103\2\60"+
+ "\1\uffff\2\60\1\111\1\117\1\101\6\uffff\2\60\1\101\1\60\1\122\2"+
+ "\uffff\1\60\1\104\1\105\1\111\1\114\2\uffff\1\105\2\107\1\122\1"+
+ "\60\2\uffff\1\105\1\uffff\2\60\1\120\1\103\1\111\1\60\1\116\2\60"+
+ "\1\124\2\uffff\1\105\1\124\1\114\1\123\2\60\1\uffff\1\60\1\105\1"+
+ "\104\1\uffff\1\60\1\101\1\116\1\105\1\124\1\101\1\60\4\uffff\1\116"+
+ "\1\123\1\116\2\uffff\1\122\1\101\1\uffff\1\60\1\uffff\2\105\1\123"+
+ "\1\116\1\105\2\60\1\116\1\101\1\uffff\1\101\1\uffff\1\117\1\122"+
+ "\1\106\1\uffff\1\60\2\uffff\1\60\1\116\1\105\1\114\1\123\3\uffff"+
+ "\2\60\1\uffff\1\107\1\123\1\130\1\60\1\116\1\uffff\4\60\1\131\1"+
+ "\uffff\1\124\1\106\1\124\3\60\2\uffff\1\105\1\124\1\116\1\114\1"+
+ "\123\1\111\2\uffff\1\124\1\122\1\123\1\105\2\uffff\2\105\1\60\1"+
+ "\uffff\1\123\4\uffff\2\60\1\101\1\60\3\uffff\1\104\1\111\1\60\1"+
+ "\101\1\60\1\105\1\111\1\120\1\105\1\124\3\60\1\uffff\1\106\2\uffff"+
+ "\1\125\1\uffff\1\60\1\103\1\uffff\1\124\1\117\1\uffff\1\122\1\106"+
+ "\1\117\1\124\1\60\3\uffff\1\117\1\114\1\uffff\1\60\1\111\1\115\1"+
+ "\60\1\111\1\114\1\60\1\uffff\1\122\1\124\1\uffff\1\117\1\101\1\uffff"+
+ "\1\105\1\101\1\uffff\1\115\1\60\1\116\1\111\1\122\1\124\1\60\1\uffff"+
+ "\1\104\1\116\1\60\1\111\1\uffff\2\105\1\60\1\uffff\1\117\1\106\1"+
+ "\124\1\uffff\1\116\1\101\1\60\1\104\1\125\1\uffff\2\105\1\114\1"+
+ "\106\2\124\1\101\2\60\1\125\2\uffff\1\114\1\124\1\60\1\uffff";
+ static final String DFA12_maxS =
+ "\1\175\2\71\4\uffff\2\75\12\uffff\1\165\1\156\1\150\1\157\1\164"+
+ "\1\170\1\165\1\162\1\166\1\157\1\166\1\157\1\165\1\157\1\151\1\141"+
+ "\1\163\1\165\1\141\1\150\1\157\1\71\12\uffff\1\162\1\154\1\157\1"+
+ "\154\2\172\2\145\1\172\1\165\2\162\1\156\1\164\1\151\1\141\1\155"+
+ "\1\157\1\143\1\164\1\166\1\163\1\142\1\141\1\156\1\165\1\143\1\163"+
+ "\2\144\1\147\1\154\1\172\1\156\1\163\1\145\1\172\1\150\1\162\1\164"+
+ "\1\154\1\141\1\165\1\170\1\156\1\154\1\151\1\163\1\141\1\154\1\151"+
+ "\1\164\1\157\2\uffff\1\172\1\154\1\141\1\163\1\145\1\uffff\1\147"+
+ "\1\uffff\1\156\1\162\1\165\1\uffff\1\156\1\162\1\165\1\164\1\172"+
+ "\1\156\1\143\1\154\1\145\1\162\1\157\1\172\1\145\1\172\1\156\1\145"+
+ "\1\144\1\160\1\164\1\151\1\162\1\172\1\155\1\145\1\164\5\172\1\uffff"+
+ "\1\172\1\147\1\164\1\145\1\162\1\uffff\1\145\2\172\1\145\1\154\1"+
+ "\162\1\141\1\142\2\172\1\165\1\156\1\151\1\144\1\146\2\172\1\154"+
+ "\1\uffff\1\172\1\164\1\145\1\162\1\145\1\164\1\145\1\162\1\144\1"+
+ "\145\1\143\2\172\1\uffff\1\156\1\165\1\162\2\145\1\172\1\164\1\144"+
+ "\1\uffff\1\156\1\172\1\uffff\1\164\1\162\1\145\1\154\1\145\1\162"+
+ "\1\143\2\172\1\uffff\2\172\1\151\1\157\1\141\6\uffff\2\172\1\141"+
+ "\1\172\1\162\2\uffff\1\172\1\163\1\145\1\151\1\154\2\uffff\1\145"+
+ "\2\147\1\162\1\172\2\uffff\1\145\1\uffff\2\172\1\160\1\143\1\151"+
+ "\1\172\1\156\2\172\1\164\2\uffff\1\145\1\164\1\154\1\163\2\172\1"+
+ "\uffff\1\172\1\145\1\144\1\uffff\1\172\1\141\1\156\1\145\1\164\1"+
+ "\141\1\172\4\uffff\1\156\1\163\1\156\2\uffff\1\162\1\141\1\uffff"+
+ "\1\172\1\uffff\2\145\1\163\1\156\1\145\2\172\1\156\1\141\1\uffff"+
+ "\1\141\1\uffff\1\157\1\162\1\146\1\uffff\1\172\2\uffff\1\172\1\156"+
+ "\1\145\1\154\1\163\3\uffff\2\172\1\uffff\1\147\1\163\1\170\1\172"+
+ "\1\156\1\uffff\4\172\1\171\1\uffff\1\164\1\146\1\164\3\172\2\uffff"+
+ "\1\145\1\164\1\156\1\154\1\163\1\151\2\uffff\1\164\1\162\1\163\1"+
+ "\145\2\uffff\2\145\1\172\1\uffff\1\163\4\uffff\2\172\1\141\1\172"+
+ "\3\uffff\1\144\1\151\1\172\1\141\1\172\1\145\1\151\1\160\1\145\1"+
+ "\164\3\172\1\uffff\1\146\2\uffff\1\165\1\uffff\1\172\1\143\1\uffff"+
+ "\1\164\1\157\1\uffff\1\162\1\146\1\157\1\164\1\172\3\uffff\1\157"+
+ "\1\154\1\uffff\1\172\1\151\1\155\1\172\1\151\1\154\1\172\1\uffff"+
+ "\1\162\1\164\1\uffff\1\157\1\141\1\uffff\1\145\1\141\1\uffff\1\155"+
+ "\1\172\1\156\1\151\1\162\1\164\1\172\1\uffff\1\163\1\156\1\172\1"+
+ "\151\1\uffff\2\145\1\172\1\uffff\1\157\1\146\1\164\1\uffff\1\156"+
+ "\1\141\1\172\1\163\1\165\1\uffff\2\145\1\154\1\146\2\164\1\141\2"+
+ "\172\1\165\2\uffff\1\154\1\164\1\172\1\uffff";
+ static final String DFA12_acceptS =
+ "\3\uffff\1\3\1\4\1\5\1\6\2\uffff\1\13\1\14\1\15\1\16\1\17\1\20\1"+
+ "\21\1\22\1\23\1\24\26\uffff\1\151\1\152\1\153\1\154\1\1\1\2\1\11"+
+ "\1\7\1\12\1\10\65\uffff\1\147\1\150\5\uffff\1\26\1\uffff\1\55\3"+
+ "\uffff\1\54\36\uffff\1\46\5\uffff\1\57\22\uffff\1\25\15\uffff\1"+
+ "\34\10\uffff\1\45\2\uffff\1\35\11\uffff\1\36\5\uffff\1\51\1\56\1"+
+ "\106\1\107\1\113\1\47\5\uffff\1\60\1\61\5\uffff\1\110\1\111\5\uffff"+
+ "\1\133\1\134\1\uffff\1\127\12\uffff\1\33\1\37\6\uffff\1\112\3\uffff"+
+ "\1\40\7\uffff\1\137\1\41\1\100\1\146\3\uffff\1\141\1\120\2\uffff"+
+ "\1\115\1\uffff\1\130\11\uffff\1\131\1\uffff\1\142\3\uffff\1\27\1"+
+ "\uffff\1\50\1\31\5\uffff\1\101\1\103\1\140\2\uffff\1\105\5\uffff"+
+ "\1\126\5\uffff\1\132\6\uffff\1\116\1\122\6\uffff\1\30\1\53\4\uffff"+
+ "\1\32\1\102\3\uffff\1\65\1\uffff\1\42\1\43\1\44\1\124\4\uffff\1"+
+ "\66\1\143\1\117\15\uffff\1\144\1\uffff\1\52\1\67\1\uffff\1\123\2"+
+ "\uffff\1\136\2\uffff\1\63\5\uffff\1\114\1\121\1\145\2\uffff\1\135"+
+ "\7\uffff\1\77\2\uffff\1\125\2\uffff\1\62\2\uffff\1\74\7\uffff\1"+
+ "\70\4\uffff\1\104\3\uffff\1\73\3\uffff\1\64\5\uffff\1\72\12\uffff"+
+ "\1\76\1\71\3\uffff\1\75";
+ static final String DFA12_specialS =
+ "\u01d0\uffff}>";
+ static final String[] DFA12_transitionS = {
+ "\2\54\1\uffff\2\54\22\uffff\1\54\1\6\1\51\1\uffff\1\53\3\uffff"+
+ "\1\12\1\13\1\4\1\1\1\20\1\2\1\11\1\3\12\50\1\21\1\22\1\7\1\5"+
+ "\1\10\2\uffff\1\33\1\47\1\31\1\40\1\30\1\23\1\52\1\45\1\24\2"+
+ "\52\1\34\1\41\1\37\1\35\1\46\1\44\1\26\1\27\1\32\1\43\1\42\1"+
+ "\25\1\36\2\52\1\14\1\uffff\1\15\1\uffff\1\52\1\uffff\1\33\1"+
+ "\47\1\31\1\40\1\30\1\23\1\52\1\45\1\24\2\52\1\34\1\41\1\37\1"+
+ "\35\1\46\1\44\1\26\1\27\1\32\1\43\1\42\1\25\1\36\2\52\1\16\1"+
+ "\uffff\1\17",
+ "\12\50",
+ "\12\50",
+ "",
+ "",
+ "",
+ "",
+ "\1\57",
+ "\1\61",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\66\12\uffff\1\65\2\uffff\1\63\5\uffff\1\64\13\uffff\1\66"+
+ "\12\uffff\1\65\2\uffff\1\63\5\uffff\1\64",
+ "\1\71\10\uffff\1\70\1\67\25\uffff\1\71\10\uffff\1\70\1\67",
+ "\1\72\37\uffff\1\72",
+ "\1\73\11\uffff\1\74\25\uffff\1\73\11\uffff\1\74",
+ "\1\102\1\uffff\1\100\2\uffff\1\104\1\77\2\uffff\1\101\2\uffff"+
+ "\1\103\1\uffff\1\76\2\uffff\1\75\16\uffff\1\102\1\uffff\1\100"+
+ "\2\uffff\1\104\1\77\2\uffff\1\101\2\uffff\1\103\1\uffff\1\76"+
+ "\2\uffff\1\75",
+ "\1\105\11\uffff\1\106\25\uffff\1\105\11\uffff\1\106",
+ "\1\112\6\uffff\1\107\2\uffff\1\110\2\uffff\1\111\22\uffff\1"+
+ "\112\6\uffff\1\107\2\uffff\1\110\2\uffff\1\111",
+ "\1\113\20\uffff\1\114\16\uffff\1\113\20\uffff\1\114",
+ "\1\116\1\uffff\1\120\7\uffff\1\122\1\uffff\1\117\3\uffff\1"+
+ "\115\3\uffff\1\121\13\uffff\1\116\1\uffff\1\120\7\uffff\1\122"+
+ "\1\uffff\1\117\3\uffff\1\115\3\uffff\1\121",
+ "\1\125\4\uffff\1\123\1\124\31\uffff\1\125\4\uffff\1\123\1\124",
+ "\1\127\1\uffff\1\130\1\uffff\1\126\33\uffff\1\127\1\uffff\1"+
+ "\130\1\uffff\1\126",
+ "\1\131\37\uffff\1\131",
+ "\1\134\11\uffff\1\132\5\uffff\1\133\17\uffff\1\134\11\uffff"+
+ "\1\132\5\uffff\1\133",
+ "\1\135\37\uffff\1\135",
+ "\1\136\7\uffff\1\137\27\uffff\1\136\7\uffff\1\137",
+ "\1\140\37\uffff\1\140",
+ "\1\142\4\uffff\1\141\32\uffff\1\142\4\uffff\1\141",
+ "\1\143\37\uffff\1\143",
+ "\1\144\37\uffff\1\144",
+ "\1\145\37\uffff\1\145",
+ "\1\146\5\uffff\1\147\31\uffff\1\146\5\uffff\1\147",
+ "\1\151\1\uffff\12\50",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\152\37\uffff\1\152",
+ "\1\153\37\uffff\1\153",
+ "\1\154\37\uffff\1\154",
+ "\1\155\37\uffff\1\155",
+ "\12\52\7\uffff\23\52\1\156\6\52\4\uffff\1\52\1\uffff\23\52"+
+ "\1\156\6\52",
+ "\12\52\7\uffff\1\160\31\52\4\uffff\1\52\1\uffff\1\160\31\52",
+ "\1\162\37\uffff\1\162",
+ "\1\163\37\uffff\1\163",
+ "\12\52\7\uffff\23\52\1\164\6\52\4\uffff\1\52\1\uffff\23\52"+
+ "\1\164\6\52",
+ "\1\166\37\uffff\1\166",
+ "\1\167\2\uffff\1\170\34\uffff\1\167\2\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",
+ "\1\175\37\uffff\1\175",
+ "\1\176\37\uffff\1\176",
+ "\1\177\37\uffff\1\177",
+ "\1\u0080\37\uffff\1\u0080",
+ "\1\u0081\3\uffff\1\u0082\33\uffff\1\u0081\3\uffff\1\u0082",
+ "\1\u0087\1\u0086\4\uffff\1\u0083\1\uffff\1\u0084\1\u0085\26"+
+ "\uffff\1\u0087\1\u0086\4\uffff\1\u0083\1\uffff\1\u0084\1\u0085",
+ "\1\u0088\37\uffff\1\u0088",
+ "\1\u0089\37\uffff\1\u0089",
+ "\1\u008a\37\uffff\1\u008a",
+ "\1\u008b\37\uffff\1\u008b",
+ "\1\u008c\13\uffff\1\u008d\23\uffff\1\u008c\13\uffff\1\u008d",
+ "\1\u008e\37\uffff\1\u008e",
+ "\1\u008f\37\uffff\1\u008f",
+ "\1\u0090\37\uffff\1\u0090",
+ "\1\u0091\37\uffff\1\u0091",
+ "\1\u0092\37\uffff\1\u0092",
+ "\1\u0093\37\uffff\1\u0093",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u0095\6\uffff\1\u0096\30\uffff\1\u0095\6\uffff\1\u0096",
+ "\1\u0098\4\uffff\1\u0097\32\uffff\1\u0098\4\uffff\1\u0097",
+ "\1\u0099\37\uffff\1\u0099",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u009b\37\uffff\1\u009b",
+ "\1\u009c\37\uffff\1\u009c",
+ "\1\u009e\5\uffff\1\u009d\31\uffff\1\u009e\5\uffff\1\u009d",
+ "\1\u009f\37\uffff\1\u009f",
+ "\1\u00a0\37\uffff\1\u00a0",
+ "\1\u00a1\7\uffff\1\u00a2\27\uffff\1\u00a1\7\uffff\1\u00a2",
+ "\1\u00a3\37\uffff\1\u00a3",
+ "\1\u00a4\37\uffff\1\u00a4",
+ "\1\u00a5\37\uffff\1\u00a5",
+ "\1\u00a6\37\uffff\1\u00a6",
+ "\1\u00a7\37\uffff\1\u00a7",
+ "\1\u00a8\37\uffff\1\u00a8",
+ "\1\u00a9\37\uffff\1\u00a9",
+ "\1\u00aa\37\uffff\1\u00aa",
+ "\1\u00ab\37\uffff\1\u00ab",
+ "\1\u00ac\37\uffff\1\u00ac",
+ "",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u00ae\37\uffff\1\u00ae",
+ "\1\u00af\37\uffff\1\u00af",
+ "\1\u00b0\37\uffff\1\u00b0",
+ "\1\u00b1\37\uffff\1\u00b1",
+ "",
+ "\1\u00b2\37\uffff\1\u00b2",
+ "",
+ "\1\u00b3\37\uffff\1\u00b3",
+ "\1\u00b4\37\uffff\1\u00b4",
+ "\1\u00b5\37\uffff\1\u00b5",
+ "",
+ "\1\u00b6\37\uffff\1\u00b6",
+ "\1\u00b7\37\uffff\1\u00b7",
+ "\1\u00b8\37\uffff\1\u00b8",
+ "\1\u00b9\37\uffff\1\u00b9",
+ "\12\52\7\uffff\7\52\1\u00ba\22\52\4\uffff\1\52\1\uffff\7\52"+
+ "\1\u00ba\22\52",
+ "\1\u00be\5\uffff\1\u00bc\4\uffff\1\u00bd\24\uffff\1\u00be\5"+
+ "\uffff\1\u00bc\4\uffff\1\u00bd",
+ "\1\u00bf\37\uffff\1\u00bf",
+ "\1\u00c0\37\uffff\1\u00c0",
+ "\1\u00c1\37\uffff\1\u00c1",
+ "\1\u00c2\37\uffff\1\u00c2",
+ "\1\u00c3\37\uffff\1\u00c3",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u00c5\37\uffff\1\u00c5",
+ "\12\52\7\uffff\7\52\1\u00c6\22\52\4\uffff\1\52\1\uffff\7\52"+
+ "\1\u00c6\22\52",
+ "\1\u00c8\37\uffff\1\u00c8",
+ "\1\u00c9\37\uffff\1\u00c9",
+ "\1\u00ca\37\uffff\1\u00ca",
+ "\1\u00cb\37\uffff\1\u00cb",
+ "\1\u00cc\1\u00cd\36\uffff\1\u00cc\1\u00cd",
+ "\1\u00ce\37\uffff\1\u00ce",
+ "\1\u00cf\37\uffff\1\u00cf",
+ "\12\52\7\uffff\7\52\1\u00d0\22\52\4\uffff\1\52\1\uffff\7\52"+
+ "\1\u00d0\22\52",
+ "\1\u00d2\37\uffff\1\u00d2",
+ "\1\u00d3\37\uffff\1\u00d3",
+ "\1\u00d5\17\uffff\1\u00d4\1\u00d6\16\uffff\1\u00d5\17\uffff"+
+ "\1\u00d4\1\u00d6",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u00dd\37\uffff\1\u00dd",
+ "\1\u00de\37\uffff\1\u00de",
+ "\1\u00df\37\uffff\1\u00df",
+ "\1\u00e0\37\uffff\1\u00e0",
+ "",
+ "\1\u00e1\37\uffff\1\u00e1",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u00e4\37\uffff\1\u00e4",
+ "\1\u00e5\37\uffff\1\u00e5",
+ "\1\u00e6\37\uffff\1\u00e6",
+ "\1\u00e7\37\uffff\1\u00e7",
+ "\1\u00e8\37\uffff\1\u00e8",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u00eb\37\uffff\1\u00eb",
+ "\1\u00ec\37\uffff\1\u00ec",
+ "\1\u00ed\37\uffff\1\u00ed",
+ "\1\u00ee\37\uffff\1\u00ee",
+ "\1\u00ef\37\uffff\1\u00ef",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u00f2\37\uffff\1\u00f2",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u00f4\37\uffff\1\u00f4",
+ "\1\u00f5\37\uffff\1\u00f5",
+ "\1\u00f6\37\uffff\1\u00f6",
+ "\1\u00f7\37\uffff\1\u00f7",
+ "\1\u00f8\37\uffff\1\u00f8",
+ "\1\u00f9\37\uffff\1\u00f9",
+ "\1\u00fa\37\uffff\1\u00fa",
+ "\1\u00fb\37\uffff\1\u00fb",
+ "\1\u00fc\37\uffff\1\u00fc",
+ "\1\u00fd\37\uffff\1\u00fd",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "\1\u0100\11\uffff\1\u0101\25\uffff\1\u0100\11\uffff\1\u0101",
+ "\1\u0102\37\uffff\1\u0102",
+ "\1\u0103\37\uffff\1\u0103",
+ "\1\u0104\37\uffff\1\u0104",
+ "\1\u0105\37\uffff\1\u0105",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u0107\37\uffff\1\u0107",
+ "\1\u0108\37\uffff\1\u0108",
+ "",
+ "\1\u0109\37\uffff\1\u0109",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "\1\u010b\37\uffff\1\u010b",
+ "\1\u010c\37\uffff\1\u010c",
+ "\1\u010d\37\uffff\1\u010d",
+ "\1\u010e\37\uffff\1\u010e",
+ "\1\u010f\37\uffff\1\u010f",
+ "\1\u0110\37\uffff\1\u0110",
+ "\1\u0111\37\uffff\1\u0111",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u0116\37\uffff\1\u0116",
+ "\1\u0117\37\uffff\1\u0117",
+ "\1\u0118\37\uffff\1\u0118",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u011b\37\uffff\1\u011b",
+ "\12\52\7\uffff\13\52\1\u011c\16\52\4\uffff\1\52\1\uffff\13"+
+ "\52\1\u011c\16\52",
+ "\1\u011e\37\uffff\1\u011e",
+ "",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u0121\16\uffff\1\u0120\20\uffff\1\u0121\16\uffff\1\u0120",
+ "\1\u0122\37\uffff\1\u0122",
+ "\1\u0123\37\uffff\1\u0123",
+ "\1\u0124\37\uffff\1\u0124",
+ "",
+ "",
+ "\1\u0125\37\uffff\1\u0125",
+ "\1\u0126\37\uffff\1\u0126",
+ "\1\u0127\37\uffff\1\u0127",
+ "\1\u0128\37\uffff\1\u0128",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "",
+ "\1\u012a\37\uffff\1\u012a",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u012c\37\uffff\1\u012c",
+ "\1\u012d\37\uffff\1\u012d",
+ "\1\u012e\37\uffff\1\u012e",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u0130\37\uffff\1\u0130",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u0133\37\uffff\1\u0133",
+ "",
+ "",
+ "\1\u0134\37\uffff\1\u0134",
+ "\1\u0135\37\uffff\1\u0135",
+ "\1\u0136\37\uffff\1\u0136",
+ "\1\u0137\37\uffff\1\u0137",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u013b\37\uffff\1\u013b",
+ "\1\u013c\37\uffff\1\u013c",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u013e\37\uffff\1\u013e",
+ "\1\u013f\37\uffff\1\u013f",
+ "\1\u0140\37\uffff\1\u0140",
+ "\1\u0141\37\uffff\1\u0141",
+ "\1\u0142\37\uffff\1\u0142",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "",
+ "",
+ "",
+ "\1\u0144\37\uffff\1\u0144",
+ "\1\u0145\37\uffff\1\u0145",
+ "\1\u0146\37\uffff\1\u0146",
+ "",
+ "",
+ "\1\u0147\37\uffff\1\u0147",
+ "\1\u0148\37\uffff\1\u0148",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "\1\u014a\37\uffff\1\u014a",
+ "\1\u014b\37\uffff\1\u014b",
+ "\1\u014c\37\uffff\1\u014c",
+ "\1\u014d\37\uffff\1\u014d",
+ "\1\u014e\37\uffff\1\u014e",
+ "\12\52\7\uffff\22\52\1\u014f\7\52\4\uffff\1\52\1\uffff\22\52"+
+ "\1\u014f\7\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u0152\37\uffff\1\u0152",
+ "\1\u0153\37\uffff\1\u0153",
+ "",
+ "\1\u0154\37\uffff\1\u0154",
+ "",
+ "\1\u0155\37\uffff\1\u0155",
+ "\1\u0156\37\uffff\1\u0156",
+ "\1\u0157\37\uffff\1\u0157",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u015a\37\uffff\1\u015a",
+ "\1\u015b\37\uffff\1\u015b",
+ "\1\u015c\37\uffff\1\u015c",
+ "\1\u015d\37\uffff\1\u015d",
+ "",
+ "",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "\1\u0160\37\uffff\1\u0160",
+ "\1\u0161\37\uffff\1\u0161",
+ "\1\u0162\37\uffff\1\u0162",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u0164\37\uffff\1\u0164",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u0169\37\uffff\1\u0169",
+ "",
+ "\1\u016a\37\uffff\1\u016a",
+ "\1\u016b\37\uffff\1\u016b",
+ "\1\u016c\37\uffff\1\u016c",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "",
+ "\1\u0170\37\uffff\1\u0170",
+ "\1\u0171\37\uffff\1\u0171",
+ "\1\u0172\37\uffff\1\u0172",
+ "\1\u0173\37\uffff\1\u0173",
+ "\1\u0174\37\uffff\1\u0174",
+ "\1\u0175\37\uffff\1\u0175",
+ "",
+ "",
+ "\1\u0176\37\uffff\1\u0176",
+ "\1\u0177\37\uffff\1\u0177",
+ "\1\u0178\37\uffff\1\u0178",
+ "\1\u0179\37\uffff\1\u0179",
+ "",
+ "",
+ "\1\u017a\37\uffff\1\u017a",
+ "\1\u017b\37\uffff\1\u017b",
+ "\2\52\1\u017c\7\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "\1\u017e\37\uffff\1\u017e",
+ "",
+ "",
+ "",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u0181\37\uffff\1\u0181",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "",
+ "",
+ "\1\u0183\37\uffff\1\u0183",
+ "\1\u0184\37\uffff\1\u0184",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u0186\37\uffff\1\u0186",
+ "\12\52\7\uffff\3\52\1\u0187\26\52\4\uffff\1\52\1\uffff\3\52"+
+ "\1\u0187\26\52",
+ "\1\u0189\37\uffff\1\u0189",
+ "\1\u018a\37\uffff\1\u018a",
+ "\1\u018b\37\uffff\1\u018b",
+ "\1\u018c\37\uffff\1\u018c",
+ "\1\u018d\37\uffff\1\u018d",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "\1\u0191\37\uffff\1\u0191",
+ "",
+ "",
+ "\1\u0192\37\uffff\1\u0192",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u0194\37\uffff\1\u0194",
+ "",
+ "\1\u0195\37\uffff\1\u0195",
+ "\1\u0196\37\uffff\1\u0196",
+ "",
+ "\1\u0197\37\uffff\1\u0197",
+ "\1\u0198\37\uffff\1\u0198",
+ "\1\u0199\37\uffff\1\u0199",
+ "\1\u019a\37\uffff\1\u019a",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "",
+ "",
+ "\1\u019c\37\uffff\1\u019c",
+ "\1\u019d\37\uffff\1\u019d",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u019f\37\uffff\1\u019f",
+ "\1\u01a0\37\uffff\1\u01a0",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u01a2\37\uffff\1\u01a2",
+ "\1\u01a3\37\uffff\1\u01a3",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "\1\u01a5\37\uffff\1\u01a5",
+ "\1\u01a6\37\uffff\1\u01a6",
+ "",
+ "\1\u01a7\37\uffff\1\u01a7",
+ "\1\u01a8\37\uffff\1\u01a8",
+ "",
+ "\1\u01a9\37\uffff\1\u01a9",
+ "\1\u01aa\37\uffff\1\u01aa",
+ "",
+ "\1\u01ab\37\uffff\1\u01ab",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u01ad\37\uffff\1\u01ad",
+ "\1\u01ae\37\uffff\1\u01ae",
+ "\1\u01af\37\uffff\1\u01af",
+ "\1\u01b0\37\uffff\1\u01b0",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "\1\u01b2\16\uffff\1\u01b3\20\uffff\1\u01b2\16\uffff\1\u01b3",
+ "\1\u01b4\37\uffff\1\u01b4",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u01b6\37\uffff\1\u01b6",
+ "",
+ "\1\u01b7\37\uffff\1\u01b7",
+ "\1\u01b8\37\uffff\1\u01b8",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "\1\u01ba\37\uffff\1\u01ba",
+ "\1\u01bb\37\uffff\1\u01bb",
+ "\1\u01bc\37\uffff\1\u01bc",
+ "",
+ "\1\u01bd\37\uffff\1\u01bd",
+ "\1\u01be\37\uffff\1\u01be",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u01c0\16\uffff\1\u01c1\20\uffff\1\u01c0\16\uffff\1\u01c1",
+ "\1\u01c2\37\uffff\1\u01c2",
+ "",
+ "\1\u01c3\37\uffff\1\u01c3",
+ "\1\u01c4\37\uffff\1\u01c4",
+ "\1\u01c5\37\uffff\1\u01c5",
+ "\1\u01c6\37\uffff\1\u01c6",
+ "\1\u01c7\37\uffff\1\u01c7",
+ "\1\u01c8\37\uffff\1\u01c8",
+ "\1\u01c9\37\uffff\1\u01c9",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u01cc\37\uffff\1\u01cc",
+ "",
+ "",
+ "\1\u01cd\37\uffff\1\u01cd",
+ "\1\u01ce\37\uffff\1\u01ce",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ ""
+ };
+
+ static final short[] DFA12_eot = DFA.unpackEncodedString(DFA12_eotS);
+ static final short[] DFA12_eof = DFA.unpackEncodedString(DFA12_eofS);
+ static final char[] DFA12_min = DFA.unpackEncodedStringToUnsignedChars(DFA12_minS);
+ static final char[] DFA12_max = DFA.unpackEncodedStringToUnsignedChars(DFA12_maxS);
+ static final short[] DFA12_accept = DFA.unpackEncodedString(DFA12_acceptS);
+ static final short[] DFA12_special = DFA.unpackEncodedString(DFA12_specialS);
+ static final short[][] DFA12_transition;
+
+ static {
+ int numStates = DFA12_transitionS.length;
+ DFA12_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA12_transition[i] = DFA.unpackEncodedString(DFA12_transitionS[i]);
+ }
+ }
+
+ class DFA12 extends DFA {
+
+ public DFA12(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 12;
+ this.eot = DFA12_eot;
+ this.eof = DFA12_eof;
+ this.min = DFA12_min;
+ this.max = DFA12_max;
+ this.accept = DFA12_accept;
+ this.special = DFA12_special;
+ this.transition = DFA12_transition;
+ }
+ public String getDescription() {
+ return "1:1: Tokens : ( PLUS | MINUS | DIVIDE | MULT | EQUALS | NOTEQUALS | LT | GT | LTE | GTE | DOT | LPAREN | RPAREN | LBRACKET | RBRACKET | LBRACE | RBRACE | COMMA | COLON | SEMICOLON | FOR | IN | WHERE | RETURN | STORE | ENCODE | SQRT | SIN | COS | TAN | SINH | COSH | TANH | ARCSIN | ARCCOS | ARCTAN | EXP | LN | LOG | ROUND | ABS | OVERLAY | STRUCT | RE | IM | AND | OR | XOR | NOT | IDENTIFIER | IMAGECRS | IMAGECRSDOMAIN | CRSSET | DOMAIN | NULLSET | NULLDEFAULT | INTERPOLATIONDEFAULT | INTERPOLATIONSET | SETIDENTIFIER | SETNULLSET | SETINTERPOLATIONDEFAULT | SETINTERPOLATIONSET | SETCRSSET | TRIM | SLICE | EXTEND | SCALE | CRSTRANSFORM | COUNT | ADD | AVG | MAX | MIN | SOME | ALL | COVERAGE | OVER | VALUE | VALUES | LIST | CONDENSE | USING | NEAREST | LINEAR | QUADRATIC | CUBIC | FULL | NONE | HALF | OTHER | PHI | BIT | UNSIGNED | BOOLEAN | CHAR | SHORT | LONG | FLOAT | DOUBLE | COMPLEX | COMPLEX2 | BOOLEANCONSTANT | INTEGERCONSTANT | FLOATCONSTANT | STRING | NAME | VARIABLE_DOLLAR | WHITESPACE );";
+ }
+ }
+
+
+} \ No newline at end of file
diff --git a/petascope/src/petascope/wcps/grammar/wcpsParser.java b/petascope/src/petascope/wcps/grammar/wcpsParser.java
new file mode 100644
index 0000000..27f75f8
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/wcpsParser.java
@@ -0,0 +1,18359 @@
+// $ANTLR 3.2 Sep 23, 2009 12:02:23 src/petascope/wcps/grammar/wcps.g 2010-04-29 23:04:40
+package petascope.wcps.grammar;
+
+import org.antlr.runtime.*;
+import java.util.Stack;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+
+import org.antlr.runtime.tree.*;
+
+public class wcpsParser extends Parser {
+ public static final String[] tokenNames = new String[] {
+ "<invalid>", "<EOR>", "<DOWN>", "<UP>", "FOR", "IN", "LPAREN", "RPAREN", "COMMA", "WHERE", "RETURN", "ENCODE", "STORE", "OR", "XOR", "AND", "EQUALS", "NOTEQUALS", "LT", "GT", "LTE", "GTE", "PLUS", "MINUS", "MULT", "DIVIDE", "OVERLAY", "IDENTIFIER", "IMAGECRS", "IMAGECRSDOMAIN", "CRSSET", "NULLSET", "INTERPOLATIONDEFAULT", "INTERPOLATIONSET", "DOMAIN", "ALL", "SOME", "COUNT", "ADD", "AVG", "MIN", "MAX", "CONDENSE", "OVER", "USING", "COLON", "COVERAGE", "VALUE", "LIST", "SEMICOLON", "VALUES", "SETIDENTIFIER", "SETCRSSET", "SETNULLSET", "SETINTERPOLATIONDEFAULT", "SETINTERPOLATIONSET", "LBRACE", "RBRACE", "STRUCT", "CRSTRANSFORM", "SQRT", "ABS", "RE", "IM", "EXP", "LOG", "LN", "SIN", "COS", "TAN", "SINH", "COSH", "TANH", "ARCSIN", "ARCCOS", "ARCTAN", "NOT", "BIT", "INTEGERCONSTANT", "ROUND", "STRING", "SCALE", "LBRACKET", "RBRACKET", "TRIM", "SLICE", "EXTEND", "BOOLEAN", "CHAR", "SHORT", "LONG", "FLOAT", "DOUBLE", "COMPLEX", "COMPLEX2", "UNSIGNED", "DOT", "BOOLEANCONSTANT", "FLOATCONSTANT", "NEAREST", "LINEAR", "QUADRATIC", "CUBIC", "FULL", "NONE", "HALF", "OTHER", "NAME", "VARIABLE_DOLLAR", "NULLDEFAULT", "PHI", "WHITESPACE"
+ };
+ public static final int IMAGECRS=28;
+ public static final int LT=18;
+ public static final int LN=66;
+ public static final int LOG=65;
+ public static final int CHAR=88;
+ public static final int COMPLEX=93;
+ public static final int SETINTERPOLATIONDEFAULT=54;
+ public static final int COUNT=37;
+ public static final int EQUALS=16;
+ public static final int COSH=71;
+ public static final int NOT=76;
+ public static final int INTEGERCONSTANT=78;
+ public static final int EOF=-1;
+ public static final int SINH=70;
+ public static final int LBRACKET=82;
+ public static final int RPAREN=7;
+ public static final int NAME=107;
+ public static final int LINEAR=100;
+ public static final int TANH=72;
+ public static final int FULL=103;
+ public static final int USING=44;
+ public static final int SIN=67;
+ public static final int EXP=64;
+ public static final int COS=68;
+ public static final int TAN=69;
+ public static final int RETURN=10;
+ public static final int DOUBLE=92;
+ public static final int NULLDEFAULT=109;
+ public static final int DIVIDE=25;
+ public static final int STORE=12;
+ public static final int BOOLEANCONSTANT=97;
+ public static final int RBRACE=57;
+ public static final int SETNULLSET=53;
+ public static final int CONDENSE=42;
+ public static final int WHITESPACE=111;
+ public static final int SEMICOLON=49;
+ public static final int MULT=24;
+ public static final int VALUE=47;
+ public static final int LIST=48;
+ public static final int COMPLEX2=94;
+ public static final int ABS=61;
+ public static final int CRSSET=30;
+ public static final int SCALE=81;
+ public static final int VARIABLE_DOLLAR=108;
+ public static final int FLOATCONSTANT=98;
+ public static final int IMAGECRSDOMAIN=29;
+ public static final int NONE=104;
+ public static final int OR=13;
+ public static final int TRIM=84;
+ public static final int GT=19;
+ public static final int ROUND=79;
+ public static final int QUADRATIC=101;
+ public static final int ENCODE=11;
+ public static final int PHI=110;
+ public static final int OVER=43;
+ public static final int COVERAGE=46;
+ public static final int WHERE=9;
+ public static final int RE=62;
+ public static final int OVERLAY=26;
+ public static final int GTE=21;
+ public static final int LBRACE=56;
+ public static final int MAX=41;
+ public static final int INTERPOLATIONDEFAULT=32;
+ public static final int FOR=4;
+ public static final int FLOAT=91;
+ public static final int SLICE=85;
+ public static final int AND=15;
+ public static final int LTE=20;
+ public static final int LPAREN=6;
+ public static final int EXTEND=86;
+ public static final int IM=63;
+ public static final int BOOLEAN=87;
+ public static final int IN=5;
+ public static final int COMMA=8;
+ public static final int AVG=39;
+ public static final int IDENTIFIER=27;
+ public static final int SOME=36;
+ public static final int ALL=35;
+ public static final int ARCSIN=73;
+ public static final int PLUS=22;
+ public static final int ARCCOS=74;
+ public static final int RBRACKET=83;
+ public static final int DOT=96;
+ public static final int ADD=38;
+ public static final int SETIDENTIFIER=51;
+ public static final int XOR=14;
+ public static final int SETINTERPOLATIONSET=55;
+ public static final int OTHER=106;
+ public static final int VALUES=50;
+ public static final int ARCTAN=75;
+ public static final int NOTEQUALS=17;
+ public static final int STRUCT=58;
+ public static final int SHORT=89;
+ public static final int MIN=40;
+ public static final int MINUS=23;
+ public static final int SQRT=60;
+ public static final int DOMAIN=34;
+ public static final int CRSTRANSFORM=59;
+ public static final int COLON=45;
+ public static final int CUBIC=102;
+ public static final int UNSIGNED=95;
+ public static final int NULLSET=31;
+ public static final int BIT=77;
+ public static final int INTERPOLATIONSET=33;
+ public static final int LONG=90;
+ public static final int SETCRSSET=52;
+ public static final int HALF=105;
+ public static final int STRING=80;
+ public static final int NEAREST=99;
+
+ // delegates
+ // delegators
+
+
+ public wcpsParser(TokenStream input) {
+ this(input, new RecognizerSharedState());
+ }
+ public wcpsParser(TokenStream input, RecognizerSharedState state) {
+ super(input, state);
+ this.state.ruleMemo = new HashMap[241+1];
+
+
+ }
+
+ protected TreeAdaptor adaptor = new CommonTreeAdaptor();
+
+ public void setTreeAdaptor(TreeAdaptor adaptor) {
+ this.adaptor = adaptor;
+ }
+ public TreeAdaptor getTreeAdaptor() {
+ return adaptor;
+ }
+
+ public String[] getTokenNames() { return wcpsParser.tokenNames; }
+ public String getGrammarFileName() { return "src/petascope/wcps/grammar/wcps.g"; }
+
+
+ public static class wcpsRequest_return extends ParserRuleReturnScope {
+ public WCPSRequest value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "wcpsRequest"
+ // src/petascope/wcps/grammar/wcps.g:32:1: wcpsRequest returns [WCPSRequest value] : e1= forClause (e2= whereClause )? e3= returnClause ;
+ public final wcpsParser.wcpsRequest_return wcpsRequest() throws RecognitionException {
+ wcpsParser.wcpsRequest_return retval = new wcpsParser.wcpsRequest_return();
+ retval.start = input.LT(1);
+ int wcpsRequest_StartIndex = input.index();
+ Object root_0 = null;
+
+ wcpsParser.forClause_return e1 = null;
+
+ wcpsParser.whereClause_return e2 = null;
+
+ wcpsParser.returnClause_return e3 = null;
+
+
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 1) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:33:2: (e1= forClause (e2= whereClause )? e3= returnClause )
+ // src/petascope/wcps/grammar/wcps.g:33:4: e1= forClause (e2= whereClause )? e3= returnClause
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_forClause_in_wcpsRequest63);
+ e1=forClause();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new WCPSRequest((e1!=null?e1.value:null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:34:3: (e2= whereClause )?
+ int alt1=2;
+ int LA1_0 = input.LA(1);
+
+ if ( (LA1_0==WHERE) ) {
+ alt1=1;
+ }
+ switch (alt1) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:34:4: e2= whereClause
+ {
+ pushFollow(FOLLOW_whereClause_in_wcpsRequest72);
+ e2=whereClause();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.setWhere((e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+
+ }
+
+ pushFollow(FOLLOW_returnClause_in_wcpsRequest83);
+ e3=returnClause();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e3.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.setReturn((e3!=null?e3.value:null));
+ }
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 1, wcpsRequest_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "wcpsRequest"
+
+ public static class forClause_return extends ParserRuleReturnScope {
+ public ForClauseElements value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "forClause"
+ // src/petascope/wcps/grammar/wcps.g:37:1: forClause returns [ForClauseElements value] : FOR v= coverageVariable IN LPAREN list= coverageList RPAREN ( COMMA v= coverageVariable IN LPAREN list= coverageList RPAREN )* ;
+ public final wcpsParser.forClause_return forClause() throws RecognitionException {
+ wcpsParser.forClause_return retval = new wcpsParser.forClause_return();
+ retval.start = input.LT(1);
+ int forClause_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token FOR1=null;
+ Token IN2=null;
+ Token LPAREN3=null;
+ Token RPAREN4=null;
+ Token COMMA5=null;
+ Token IN6=null;
+ Token LPAREN7=null;
+ Token RPAREN8=null;
+ wcpsParser.coverageVariable_return v = null;
+
+ wcpsParser.coverageList_return list = null;
+
+
+ Object FOR1_tree=null;
+ Object IN2_tree=null;
+ Object LPAREN3_tree=null;
+ Object RPAREN4_tree=null;
+ Object COMMA5_tree=null;
+ Object IN6_tree=null;
+ Object LPAREN7_tree=null;
+ Object RPAREN8_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 2) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:38:2: ( FOR v= coverageVariable IN LPAREN list= coverageList RPAREN ( COMMA v= coverageVariable IN LPAREN list= coverageList RPAREN )* )
+ // src/petascope/wcps/grammar/wcps.g:38:4: FOR v= coverageVariable IN LPAREN list= coverageList RPAREN ( COMMA v= coverageVariable IN LPAREN list= coverageList RPAREN )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ FOR1=(Token)match(input,FOR,FOLLOW_FOR_in_forClause98); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ FOR1_tree = (Object)adaptor.create(FOR1);
+ adaptor.addChild(root_0, FOR1_tree);
+ }
+ pushFollow(FOLLOW_coverageVariable_in_forClause102);
+ v=coverageVariable();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, v.getTree());
+ IN2=(Token)match(input,IN,FOLLOW_IN_in_forClause104); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ IN2_tree = (Object)adaptor.create(IN2);
+ adaptor.addChild(root_0, IN2_tree);
+ }
+ LPAREN3=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_forClause106); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN3_tree = (Object)adaptor.create(LPAREN3);
+ adaptor.addChild(root_0, LPAREN3_tree);
+ }
+ pushFollow(FOLLOW_coverageList_in_forClause110);
+ list=coverageList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, list.getTree());
+ RPAREN4=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_forClause112); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN4_tree = (Object)adaptor.create(RPAREN4);
+ adaptor.addChild(root_0, RPAREN4_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new ForClauseElements((v!=null?v.value:null), (list!=null?list.value:null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:40:4: ( COMMA v= coverageVariable IN LPAREN list= coverageList RPAREN )*
+ loop2:
+ do {
+ int alt2=2;
+ int LA2_0 = input.LA(1);
+
+ if ( (LA2_0==COMMA) ) {
+ alt2=1;
+ }
+
+
+ switch (alt2) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:40:5: COMMA v= coverageVariable IN LPAREN list= coverageList RPAREN
+ {
+ COMMA5=(Token)match(input,COMMA,FOLLOW_COMMA_in_forClause122); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA5_tree = (Object)adaptor.create(COMMA5);
+ adaptor.addChild(root_0, COMMA5_tree);
+ }
+ pushFollow(FOLLOW_coverageVariable_in_forClause126);
+ v=coverageVariable();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, v.getTree());
+ IN6=(Token)match(input,IN,FOLLOW_IN_in_forClause128); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ IN6_tree = (Object)adaptor.create(IN6);
+ adaptor.addChild(root_0, IN6_tree);
+ }
+ LPAREN7=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_forClause130); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN7_tree = (Object)adaptor.create(LPAREN7);
+ adaptor.addChild(root_0, LPAREN7_tree);
+ }
+ pushFollow(FOLLOW_coverageList_in_forClause134);
+ list=coverageList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, list.getTree());
+ RPAREN8=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_forClause136); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN8_tree = (Object)adaptor.create(RPAREN8);
+ adaptor.addChild(root_0, RPAREN8_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new ForClauseElements((v!=null?v.value:null), (list!=null?list.value:null), retval.value);
+ }
+
+ }
+ break;
+
+ default :
+ break loop2;
+ }
+ } while (true);
+
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 2, forClause_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "forClause"
+
+ public static class whereClause_return extends ParserRuleReturnScope {
+ public WhereClause value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "whereClause"
+ // src/petascope/wcps/grammar/wcps.g:43:1: whereClause returns [WhereClause value] : WHERE e1= booleanScalarExpr ;
+ public final wcpsParser.whereClause_return whereClause() throws RecognitionException {
+ wcpsParser.whereClause_return retval = new wcpsParser.whereClause_return();
+ retval.start = input.LT(1);
+ int whereClause_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token WHERE9=null;
+ wcpsParser.booleanScalarExpr_return e1 = null;
+
+
+ Object WHERE9_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 3) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:44:2: ( WHERE e1= booleanScalarExpr )
+ // src/petascope/wcps/grammar/wcps.g:44:4: WHERE e1= booleanScalarExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ WHERE9=(Token)match(input,WHERE,FOLLOW_WHERE_in_whereClause157); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ WHERE9_tree = (Object)adaptor.create(WHERE9);
+ adaptor.addChild(root_0, WHERE9_tree);
+ }
+ pushFollow(FOLLOW_booleanScalarExpr_in_whereClause161);
+ e1=booleanScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new WhereClause((e1!=null?e1.value:null));
+ }
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 3, whereClause_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "whereClause"
+
+ public static class returnClause_return extends ParserRuleReturnScope {
+ public ReturnClause value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "returnClause"
+ // src/petascope/wcps/grammar/wcps.g:46:1: returnClause returns [ReturnClause value] : RETURN e1= processingExpr ;
+ public final wcpsParser.returnClause_return returnClause() throws RecognitionException {
+ wcpsParser.returnClause_return retval = new wcpsParser.returnClause_return();
+ retval.start = input.LT(1);
+ int returnClause_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token RETURN10=null;
+ wcpsParser.processingExpr_return e1 = null;
+
+
+ Object RETURN10_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 4) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:47:2: ( RETURN e1= processingExpr )
+ // src/petascope/wcps/grammar/wcps.g:47:4: RETURN e1= processingExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ RETURN10=(Token)match(input,RETURN,FOLLOW_RETURN_in_returnClause176); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RETURN10_tree = (Object)adaptor.create(RETURN10);
+ adaptor.addChild(root_0, RETURN10_tree);
+ }
+ pushFollow(FOLLOW_processingExpr_in_returnClause180);
+ e1=processingExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new ReturnClause((e1!=null?e1.value:null));
+ }
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 4, returnClause_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "returnClause"
+
+ public static class coverageList_return extends ParserRuleReturnScope {
+ public CoverageList value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "coverageList"
+ // src/petascope/wcps/grammar/wcps.g:49:1: coverageList returns [CoverageList value] : cname= coverageName ( COMMA next= coverageName )* ;
+ public final wcpsParser.coverageList_return coverageList() throws RecognitionException {
+ wcpsParser.coverageList_return retval = new wcpsParser.coverageList_return();
+ retval.start = input.LT(1);
+ int coverageList_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token COMMA11=null;
+ wcpsParser.coverageName_return cname = null;
+
+ wcpsParser.coverageName_return next = null;
+
+
+ Object COMMA11_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 5) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:50:2: (cname= coverageName ( COMMA next= coverageName )* )
+ // src/petascope/wcps/grammar/wcps.g:50:4: cname= coverageName ( COMMA next= coverageName )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_coverageName_in_coverageList197);
+ cname=coverageName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, cname.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageList((cname!=null?cname.value:null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:51:3: ( COMMA next= coverageName )*
+ loop3:
+ do {
+ int alt3=2;
+ int LA3_0 = input.LA(1);
+
+ if ( (LA3_0==COMMA) ) {
+ alt3=1;
+ }
+
+
+ switch (alt3) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:51:4: COMMA next= coverageName
+ {
+ COMMA11=(Token)match(input,COMMA,FOLLOW_COMMA_in_coverageList204); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA11_tree = (Object)adaptor.create(COMMA11);
+ adaptor.addChild(root_0, COMMA11_tree);
+ }
+ pushFollow(FOLLOW_coverageName_in_coverageList208);
+ next=coverageName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, next.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageList((next!=null?next.value:null), retval.value);
+ }
+
+ }
+ break;
+
+ default :
+ break loop3;
+ }
+ } while (true);
+
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 5, coverageList_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "coverageList"
+
+ public static class processingExpr_return extends ParserRuleReturnScope {
+ public ProcessingExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "processingExpr"
+ // src/petascope/wcps/grammar/wcps.g:53:1: processingExpr returns [ProcessingExpr value] : (e1= encodedCoverageExpr | e2= storeExpr | e3= scalarExpr );
+ public final wcpsParser.processingExpr_return processingExpr() throws RecognitionException {
+ wcpsParser.processingExpr_return retval = new wcpsParser.processingExpr_return();
+ retval.start = input.LT(1);
+ int processingExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ wcpsParser.encodedCoverageExpr_return e1 = null;
+
+ wcpsParser.storeExpr_return e2 = null;
+
+ wcpsParser.scalarExpr_return e3 = null;
+
+
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 6) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:54:5: (e1= encodedCoverageExpr | e2= storeExpr | e3= scalarExpr )
+ int alt4=3;
+ alt4 = dfa4.predict(input);
+ switch (alt4) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:54:7: e1= encodedCoverageExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_encodedCoverageExpr_in_processingExpr230);
+ e1=encodedCoverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new ProcessingExpr((e1!=null?e1.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:55:7: e2= storeExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_storeExpr_in_processingExpr242);
+ e2=storeExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new ProcessingExpr((e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+ case 3 :
+ // src/petascope/wcps/grammar/wcps.g:56:7: e3= scalarExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_scalarExpr_in_processingExpr254);
+ e3=scalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e3.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new ProcessingExpr((e3!=null?e3.value:null));
+ }
+
+ }
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 6, processingExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "processingExpr"
+
+ public static class encodedCoverageExpr_return extends ParserRuleReturnScope {
+ public EncodedCoverageExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "encodedCoverageExpr"
+ // src/petascope/wcps/grammar/wcps.g:58:1: encodedCoverageExpr returns [EncodedCoverageExpr value] : ENCODE LPAREN cov= coverageExpr COMMA format= stringConstant ( COMMA params= stringConstant )? RPAREN ;
+ public final wcpsParser.encodedCoverageExpr_return encodedCoverageExpr() throws RecognitionException {
+ wcpsParser.encodedCoverageExpr_return retval = new wcpsParser.encodedCoverageExpr_return();
+ retval.start = input.LT(1);
+ int encodedCoverageExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token ENCODE12=null;
+ Token LPAREN13=null;
+ Token COMMA14=null;
+ Token COMMA15=null;
+ Token RPAREN16=null;
+ wcpsParser.coverageExpr_return cov = null;
+
+ wcpsParser.stringConstant_return format = null;
+
+ wcpsParser.stringConstant_return params = null;
+
+
+ Object ENCODE12_tree=null;
+ Object LPAREN13_tree=null;
+ Object COMMA14_tree=null;
+ Object COMMA15_tree=null;
+ Object RPAREN16_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 7) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:59:2: ( ENCODE LPAREN cov= coverageExpr COMMA format= stringConstant ( COMMA params= stringConstant )? RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:59:4: ENCODE LPAREN cov= coverageExpr COMMA format= stringConstant ( COMMA params= stringConstant )? RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ ENCODE12=(Token)match(input,ENCODE,FOLLOW_ENCODE_in_encodedCoverageExpr272); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ ENCODE12_tree = (Object)adaptor.create(ENCODE12);
+ adaptor.addChild(root_0, ENCODE12_tree);
+ }
+ LPAREN13=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_encodedCoverageExpr274); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN13_tree = (Object)adaptor.create(LPAREN13);
+ adaptor.addChild(root_0, LPAREN13_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_encodedCoverageExpr278);
+ cov=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, cov.getTree());
+ COMMA14=(Token)match(input,COMMA,FOLLOW_COMMA_in_encodedCoverageExpr280); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA14_tree = (Object)adaptor.create(COMMA14);
+ adaptor.addChild(root_0, COMMA14_tree);
+ }
+ pushFollow(FOLLOW_stringConstant_in_encodedCoverageExpr284);
+ format=stringConstant();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, format.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new EncodedCoverageExpr((cov!=null?cov.value:null), (format!=null?input.toString(format.start,format.stop):null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:60:3: ( COMMA params= stringConstant )?
+ int alt5=2;
+ int LA5_0 = input.LA(1);
+
+ if ( (LA5_0==COMMA) ) {
+ alt5=1;
+ }
+ switch (alt5) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:60:4: COMMA params= stringConstant
+ {
+ COMMA15=(Token)match(input,COMMA,FOLLOW_COMMA_in_encodedCoverageExpr291); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA15_tree = (Object)adaptor.create(COMMA15);
+ adaptor.addChild(root_0, COMMA15_tree);
+ }
+ pushFollow(FOLLOW_stringConstant_in_encodedCoverageExpr295);
+ params=stringConstant();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, params.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.setParams((params!=null?input.toString(params.start,params.stop):null));
+ }
+
+ }
+ break;
+
+ }
+
+ RPAREN16=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_encodedCoverageExpr302); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN16_tree = (Object)adaptor.create(RPAREN16);
+ adaptor.addChild(root_0, RPAREN16_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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 7, encodedCoverageExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "encodedCoverageExpr"
+
+ public static class storeExpr_return extends ParserRuleReturnScope {
+ public StoreExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "storeExpr"
+ // src/petascope/wcps/grammar/wcps.g:62:1: storeExpr returns [StoreExpr value] : STORE LPAREN e1= encodedCoverageExpr RPAREN ;
+ public final wcpsParser.storeExpr_return storeExpr() throws RecognitionException {
+ wcpsParser.storeExpr_return retval = new wcpsParser.storeExpr_return();
+ retval.start = input.LT(1);
+ int storeExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token STORE17=null;
+ Token LPAREN18=null;
+ Token RPAREN19=null;
+ wcpsParser.encodedCoverageExpr_return e1 = null;
+
+
+ Object STORE17_tree=null;
+ Object LPAREN18_tree=null;
+ Object RPAREN19_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 8) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:63:5: ( STORE LPAREN e1= encodedCoverageExpr RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:63:7: STORE LPAREN e1= encodedCoverageExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ STORE17=(Token)match(input,STORE,FOLLOW_STORE_in_storeExpr319); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ STORE17_tree = (Object)adaptor.create(STORE17);
+ adaptor.addChild(root_0, STORE17_tree);
+ }
+ LPAREN18=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_storeExpr321); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN18_tree = (Object)adaptor.create(LPAREN18);
+ adaptor.addChild(root_0, LPAREN18_tree);
+ }
+ pushFollow(FOLLOW_encodedCoverageExpr_in_storeExpr325);
+ e1=encodedCoverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ RPAREN19=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_storeExpr327); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN19_tree = (Object)adaptor.create(RPAREN19);
+ adaptor.addChild(root_0, RPAREN19_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new StoreExpr((e1!=null?e1.value:null));
+ }
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 8, storeExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "storeExpr"
+
+ public static class coverageExpr_return extends ParserRuleReturnScope {
+ public CoverageExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "coverageExpr"
+ // src/petascope/wcps/grammar/wcps.g:65:1: coverageExpr returns [CoverageExpr value] : e1= coverageLogicTerm (op= ( OR | XOR ) e2= coverageLogicTerm )* ;
+ public final wcpsParser.coverageExpr_return coverageExpr() throws RecognitionException {
+ wcpsParser.coverageExpr_return retval = new wcpsParser.coverageExpr_return();
+ retval.start = input.LT(1);
+ int coverageExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ wcpsParser.coverageLogicTerm_return e1 = null;
+
+ wcpsParser.coverageLogicTerm_return e2 = null;
+
+
+ Object op_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 9) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:66:5: (e1= coverageLogicTerm (op= ( OR | XOR ) e2= coverageLogicTerm )* )
+ // src/petascope/wcps/grammar/wcps.g:66:7: e1= coverageLogicTerm (op= ( OR | XOR ) e2= coverageLogicTerm )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_coverageLogicTerm_in_coverageExpr350);
+ e1=coverageLogicTerm();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+ // src/petascope/wcps/grammar/wcps.g:67:9: (op= ( OR | XOR ) e2= coverageLogicTerm )*
+ loop6:
+ do {
+ int alt6=2;
+ alt6 = dfa6.predict(input);
+ switch (alt6) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:67:10: op= ( OR | XOR ) e2= coverageLogicTerm
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=OR && input.LA(1)<=XOR) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_coverageLogicTerm_in_coverageExpr374);
+ e2=coverageLogicTerm();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((op!=null?op.getText():null), retval.value, (e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop6;
+ }
+ } while (true);
+
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 9, coverageExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "coverageExpr"
+
+ public static class coverageLogicTerm_return extends ParserRuleReturnScope {
+ public CoverageExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "coverageLogicTerm"
+ // src/petascope/wcps/grammar/wcps.g:69:1: coverageLogicTerm returns [CoverageExpr value] : e1= coverageLogicFactor (op= AND e2= coverageLogicFactor )* ;
+ public final wcpsParser.coverageLogicTerm_return coverageLogicTerm() throws RecognitionException {
+ wcpsParser.coverageLogicTerm_return retval = new wcpsParser.coverageLogicTerm_return();
+ retval.start = input.LT(1);
+ int coverageLogicTerm_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ wcpsParser.coverageLogicFactor_return e1 = null;
+
+ wcpsParser.coverageLogicFactor_return e2 = null;
+
+
+ Object op_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 10) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:70:5: (e1= coverageLogicFactor (op= AND e2= coverageLogicFactor )* )
+ // src/petascope/wcps/grammar/wcps.g:70:7: e1= coverageLogicFactor (op= AND e2= coverageLogicFactor )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_coverageLogicFactor_in_coverageLogicTerm400);
+ e1=coverageLogicFactor();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+ // src/petascope/wcps/grammar/wcps.g:71:9: (op= AND e2= coverageLogicFactor )*
+ loop7:
+ do {
+ int alt7=2;
+ alt7 = dfa7.predict(input);
+ switch (alt7) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:71:10: op= AND e2= coverageLogicFactor
+ {
+ op=(Token)match(input,AND,FOLLOW_AND_in_coverageLogicTerm416); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ pushFollow(FOLLOW_coverageLogicFactor_in_coverageLogicTerm420);
+ e2=coverageLogicFactor();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((op!=null?op.getText():null), retval.value, (e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop7;
+ }
+ } while (true);
+
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 10, coverageLogicTerm_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "coverageLogicTerm"
+
+ public static class coverageLogicFactor_return extends ParserRuleReturnScope {
+ public CoverageExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "coverageLogicFactor"
+ // src/petascope/wcps/grammar/wcps.g:73:1: coverageLogicFactor returns [CoverageExpr value] : e1= coverageArithmeticExpr (op= ( EQUALS | NOTEQUALS | LT | GT | LTE | GTE ) e2= coverageArithmeticExpr )? ;
+ public final wcpsParser.coverageLogicFactor_return coverageLogicFactor() throws RecognitionException {
+ wcpsParser.coverageLogicFactor_return retval = new wcpsParser.coverageLogicFactor_return();
+ retval.start = input.LT(1);
+ int coverageLogicFactor_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ wcpsParser.coverageArithmeticExpr_return e1 = null;
+
+ wcpsParser.coverageArithmeticExpr_return e2 = null;
+
+
+ Object op_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 11) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:74:5: (e1= coverageArithmeticExpr (op= ( EQUALS | NOTEQUALS | LT | GT | LTE | GTE ) e2= coverageArithmeticExpr )? )
+ // src/petascope/wcps/grammar/wcps.g:74:7: e1= coverageArithmeticExpr (op= ( EQUALS | NOTEQUALS | LT | GT | LTE | GTE ) e2= coverageArithmeticExpr )?
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_coverageArithmeticExpr_in_coverageLogicFactor447);
+ e1=coverageArithmeticExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+ // src/petascope/wcps/grammar/wcps.g:75:9: (op= ( EQUALS | NOTEQUALS | LT | GT | LTE | GTE ) e2= coverageArithmeticExpr )?
+ int alt8=2;
+ alt8 = dfa8.predict(input);
+ switch (alt8) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:75:10: op= ( EQUALS | NOTEQUALS | LT | GT | LTE | GTE ) e2= coverageArithmeticExpr
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=EQUALS && input.LA(1)<=GTE) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_coverageArithmeticExpr_in_coverageLogicFactor479);
+ e2=coverageArithmeticExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((op!=null?op.getText():null), (e1!=null?e1.value:null), (e2!=null?e2.value:null));
+ }
+
+ }
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 11, coverageLogicFactor_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "coverageLogicFactor"
+
+ public static class coverageArithmeticExpr_return extends ParserRuleReturnScope {
+ public CoverageExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "coverageArithmeticExpr"
+ // src/petascope/wcps/grammar/wcps.g:77:1: coverageArithmeticExpr returns [CoverageExpr value] : e1= coverageArithmeticTerm (op= ( PLUS | MINUS ) e2= coverageArithmeticTerm )* ;
+ public final wcpsParser.coverageArithmeticExpr_return coverageArithmeticExpr() throws RecognitionException {
+ wcpsParser.coverageArithmeticExpr_return retval = new wcpsParser.coverageArithmeticExpr_return();
+ retval.start = input.LT(1);
+ int coverageArithmeticExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ wcpsParser.coverageArithmeticTerm_return e1 = null;
+
+ wcpsParser.coverageArithmeticTerm_return e2 = null;
+
+
+ Object op_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 12) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:78:5: (e1= coverageArithmeticTerm (op= ( PLUS | MINUS ) e2= coverageArithmeticTerm )* )
+ // src/petascope/wcps/grammar/wcps.g:78:7: e1= coverageArithmeticTerm (op= ( PLUS | MINUS ) e2= coverageArithmeticTerm )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_coverageArithmeticTerm_in_coverageArithmeticExpr507);
+ e1=coverageArithmeticTerm();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+ // src/petascope/wcps/grammar/wcps.g:79:9: (op= ( PLUS | MINUS ) e2= coverageArithmeticTerm )*
+ loop9:
+ do {
+ int alt9=2;
+ alt9 = dfa9.predict(input);
+ switch (alt9) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:79:10: op= ( PLUS | MINUS ) e2= coverageArithmeticTerm
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=PLUS && input.LA(1)<=MINUS) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_coverageArithmeticTerm_in_coverageArithmeticExpr531);
+ e2=coverageArithmeticTerm();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((op!=null?op.getText():null), retval.value, (e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop9;
+ }
+ } while (true);
+
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 12, coverageArithmeticExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "coverageArithmeticExpr"
+
+ public static class coverageArithmeticTerm_return extends ParserRuleReturnScope {
+ public CoverageExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "coverageArithmeticTerm"
+ // src/petascope/wcps/grammar/wcps.g:81:1: coverageArithmeticTerm returns [CoverageExpr value] : e1= coverageArithmeticFactor (op= ( MULT | DIVIDE ) e2= coverageArithmeticFactor )* ;
+ public final wcpsParser.coverageArithmeticTerm_return coverageArithmeticTerm() throws RecognitionException {
+ wcpsParser.coverageArithmeticTerm_return retval = new wcpsParser.coverageArithmeticTerm_return();
+ retval.start = input.LT(1);
+ int coverageArithmeticTerm_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ wcpsParser.coverageArithmeticFactor_return e1 = null;
+
+ wcpsParser.coverageArithmeticFactor_return e2 = null;
+
+
+ Object op_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 13) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:82:5: (e1= coverageArithmeticFactor (op= ( MULT | DIVIDE ) e2= coverageArithmeticFactor )* )
+ // src/petascope/wcps/grammar/wcps.g:82:9: e1= coverageArithmeticFactor (op= ( MULT | DIVIDE ) e2= coverageArithmeticFactor )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_coverageArithmeticFactor_in_coverageArithmeticTerm559);
+ e1=coverageArithmeticFactor();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+ // src/petascope/wcps/grammar/wcps.g:83:9: (op= ( MULT | DIVIDE ) e2= coverageArithmeticFactor )*
+ loop10:
+ do {
+ int alt10=2;
+ alt10 = dfa10.predict(input);
+ switch (alt10) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:83:10: op= ( MULT | DIVIDE ) e2= coverageArithmeticFactor
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=MULT && input.LA(1)<=DIVIDE) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_coverageArithmeticFactor_in_coverageArithmeticTerm582);
+ e2=coverageArithmeticFactor();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((op!=null?op.getText():null), retval.value, (e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop10;
+ }
+ } while (true);
+
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 13, coverageArithmeticTerm_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "coverageArithmeticTerm"
+
+ public static class coverageArithmeticFactor_return extends ParserRuleReturnScope {
+ public CoverageExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "coverageArithmeticFactor"
+ // src/petascope/wcps/grammar/wcps.g:85:1: coverageArithmeticFactor returns [CoverageExpr value] : e1= coverageValue (op= OVERLAY e2= coverageValue )* ;
+ public final wcpsParser.coverageArithmeticFactor_return coverageArithmeticFactor() throws RecognitionException {
+ wcpsParser.coverageArithmeticFactor_return retval = new wcpsParser.coverageArithmeticFactor_return();
+ retval.start = input.LT(1);
+ int coverageArithmeticFactor_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ wcpsParser.coverageValue_return e1 = null;
+
+ wcpsParser.coverageValue_return e2 = null;
+
+
+ Object op_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 14) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:86:5: (e1= coverageValue (op= OVERLAY e2= coverageValue )* )
+ // src/petascope/wcps/grammar/wcps.g:86:7: e1= coverageValue (op= OVERLAY e2= coverageValue )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_coverageValue_in_coverageArithmeticFactor610);
+ e1=coverageValue();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+ // src/petascope/wcps/grammar/wcps.g:87:9: (op= OVERLAY e2= coverageValue )*
+ loop11:
+ do {
+ int alt11=2;
+ alt11 = dfa11.predict(input);
+ switch (alt11) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:87:10: op= OVERLAY e2= coverageValue
+ {
+ op=(Token)match(input,OVERLAY,FOLLOW_OVERLAY_in_coverageArithmeticFactor625); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ pushFollow(FOLLOW_coverageValue_in_coverageArithmeticFactor629);
+ e2=coverageValue();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((op!=null?op.getText():null), retval.value, (e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop11;
+ }
+ } while (true);
+
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 14, coverageArithmeticFactor_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "coverageArithmeticFactor"
+
+ public static class coverageValue_return extends ParserRuleReturnScope {
+ public CoverageExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "coverageValue"
+ // src/petascope/wcps/grammar/wcps.g:89:1: coverageValue returns [CoverageExpr value] : (e5= subsetExpr | e2= unaryInducedExpr | e4= scaleExpr | e3= crsTransformExpr | e1= coverageAtom );
+ public final wcpsParser.coverageValue_return coverageValue() throws RecognitionException {
+ wcpsParser.coverageValue_return retval = new wcpsParser.coverageValue_return();
+ retval.start = input.LT(1);
+ int coverageValue_StartIndex = input.index();
+ Object root_0 = null;
+
+ wcpsParser.subsetExpr_return e5 = null;
+
+ wcpsParser.unaryInducedExpr_return e2 = null;
+
+ wcpsParser.scaleExpr_return e4 = null;
+
+ wcpsParser.crsTransformExpr_return e3 = null;
+
+ wcpsParser.coverageAtom_return e1 = null;
+
+
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 15) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:90:5: (e5= subsetExpr | e2= unaryInducedExpr | e4= scaleExpr | e3= crsTransformExpr | e1= coverageAtom )
+ int alt12=5;
+ alt12 = dfa12.predict(input);
+ switch (alt12) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:90:7: e5= subsetExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_subsetExpr_in_coverageValue655);
+ e5=subsetExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e5.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e5!=null?e5.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:91:7: e2= unaryInducedExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_unaryInducedExpr_in_coverageValue668);
+ e2=unaryInducedExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e2!=null?e2.value:null);
+ }
+
+ }
+ break;
+ case 3 :
+ // src/petascope/wcps/grammar/wcps.g:92:7: e4= scaleExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_scaleExpr_in_coverageValue680);
+ e4=scaleExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e4.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e4!=null?e4.value:null));
+ }
+
+ }
+ break;
+ case 4 :
+ // src/petascope/wcps/grammar/wcps.g:93:7: e3= crsTransformExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_crsTransformExpr_in_coverageValue692);
+ e3=crsTransformExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e3.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e3!=null?e3.value:null));
+ }
+
+ }
+ break;
+ case 5 :
+ // src/petascope/wcps/grammar/wcps.g:94:7: e1= coverageAtom
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_coverageAtom_in_coverageValue704);
+ e1=coverageAtom();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+
+ }
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 15, coverageValue_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "coverageValue"
+
+ public static class coverageAtom_return extends ParserRuleReturnScope {
+ public CoverageExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "coverageAtom"
+ // src/petascope/wcps/grammar/wcps.g:96:1: coverageAtom returns [CoverageExpr value] : (e2= scalarExpr | e1= coverageVariable | LPAREN e7= coverageExpr RPAREN | e3= coverageConstantExpr | e4= coverageConstructorExpr | e5= setMetaDataExpr | e6= rangeConstructorExpr );
+ public final wcpsParser.coverageAtom_return coverageAtom() throws RecognitionException {
+ wcpsParser.coverageAtom_return retval = new wcpsParser.coverageAtom_return();
+ retval.start = input.LT(1);
+ int coverageAtom_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token LPAREN20=null;
+ Token RPAREN21=null;
+ wcpsParser.scalarExpr_return e2 = null;
+
+ wcpsParser.coverageVariable_return e1 = null;
+
+ wcpsParser.coverageExpr_return e7 = null;
+
+ wcpsParser.coverageConstantExpr_return e3 = null;
+
+ wcpsParser.coverageConstructorExpr_return e4 = null;
+
+ wcpsParser.setMetaDataExpr_return e5 = null;
+
+ wcpsParser.rangeConstructorExpr_return e6 = null;
+
+
+ Object LPAREN20_tree=null;
+ Object RPAREN21_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 16) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:97:5: (e2= scalarExpr | e1= coverageVariable | LPAREN e7= coverageExpr RPAREN | e3= coverageConstantExpr | e4= coverageConstructorExpr | e5= setMetaDataExpr | e6= rangeConstructorExpr )
+ int alt13=7;
+ alt13 = dfa13.predict(input);
+ switch (alt13) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:97:7: e2= scalarExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_scalarExpr_in_coverageAtom727);
+ e2=scalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:98:7: e1= coverageVariable
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_coverageVariable_in_coverageAtom739);
+ e1=coverageVariable();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e1!=null?e1.value:null));
+ }
+
+ }
+ break;
+ case 3 :
+ // src/petascope/wcps/grammar/wcps.g:99:7: LPAREN e7= coverageExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ LPAREN20=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_coverageAtom749); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN20_tree = (Object)adaptor.create(LPAREN20);
+ adaptor.addChild(root_0, LPAREN20_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_coverageAtom753);
+ e7=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e7.getTree());
+ RPAREN21=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_coverageAtom755); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN21_tree = (Object)adaptor.create(RPAREN21);
+ adaptor.addChild(root_0, RPAREN21_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e7!=null?e7.value:null));
+ }
+
+ }
+ break;
+ case 4 :
+ // src/petascope/wcps/grammar/wcps.g:100:7: e3= coverageConstantExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_coverageConstantExpr_in_coverageAtom768);
+ e3=coverageConstantExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e3.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e3!=null?e3.value:null));
+ }
+
+ }
+ break;
+ case 5 :
+ // src/petascope/wcps/grammar/wcps.g:101:7: e4= coverageConstructorExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_coverageConstructorExpr_in_coverageAtom780);
+ e4=coverageConstructorExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e4.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e4!=null?e4.value:null));
+ }
+
+ }
+ break;
+ case 6 :
+ // src/petascope/wcps/grammar/wcps.g:102:7: e5= setMetaDataExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_setMetaDataExpr_in_coverageAtom793);
+ e5=setMetaDataExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e5.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e5!=null?e5.value:null));
+ }
+
+ }
+ break;
+ case 7 :
+ // src/petascope/wcps/grammar/wcps.g:103:7: e6= rangeConstructorExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_rangeConstructorExpr_in_coverageAtom806);
+ e6=rangeConstructorExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e6.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e6!=null?e6.value:null));
+ }
+
+ }
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 16, coverageAtom_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "coverageAtom"
+
+ public static class scalarExpr_return extends ParserRuleReturnScope {
+ public ScalarExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "scalarExpr"
+ // src/petascope/wcps/grammar/wcps.g:105:1: scalarExpr returns [ScalarExpr value] : (e1= metaDataExpr | e2= condenseExpr | e3= booleanScalarExpr | e4= numericScalarExpr | e5= stringScalarExpr | LPAREN e6= scalarExpr RPAREN );
+ public final wcpsParser.scalarExpr_return scalarExpr() throws RecognitionException {
+ wcpsParser.scalarExpr_return retval = new wcpsParser.scalarExpr_return();
+ retval.start = input.LT(1);
+ int scalarExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token LPAREN22=null;
+ Token RPAREN23=null;
+ wcpsParser.metaDataExpr_return e1 = null;
+
+ wcpsParser.condenseExpr_return e2 = null;
+
+ wcpsParser.booleanScalarExpr_return e3 = null;
+
+ wcpsParser.numericScalarExpr_return e4 = null;
+
+ wcpsParser.stringScalarExpr_return e5 = null;
+
+ wcpsParser.scalarExpr_return e6 = null;
+
+
+ Object LPAREN22_tree=null;
+ Object RPAREN23_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 17) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:106:5: (e1= metaDataExpr | e2= condenseExpr | e3= booleanScalarExpr | e4= numericScalarExpr | e5= stringScalarExpr | LPAREN e6= scalarExpr RPAREN )
+ int alt14=6;
+ alt14 = dfa14.predict(input);
+ switch (alt14) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:106:7: e1= metaDataExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_metaDataExpr_in_scalarExpr830);
+ e1=metaDataExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new ScalarExpr((e1!=null?e1.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:107:7: e2= condenseExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_condenseExpr_in_scalarExpr843);
+ e2=condenseExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new ScalarExpr((e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+ case 3 :
+ // src/petascope/wcps/grammar/wcps.g:108:7: e3= booleanScalarExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_booleanScalarExpr_in_scalarExpr856);
+ e3=booleanScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e3.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new ScalarExpr((e3!=null?e3.value:null));
+ }
+
+ }
+ break;
+ case 4 :
+ // src/petascope/wcps/grammar/wcps.g:109:7: e4= numericScalarExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_numericScalarExpr_in_scalarExpr870);
+ e4=numericScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e4.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new ScalarExpr((e4!=null?e4.value:null));
+ }
+
+ }
+ break;
+ case 5 :
+ // src/petascope/wcps/grammar/wcps.g:110:7: e5= stringScalarExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_stringScalarExpr_in_scalarExpr883);
+ e5=stringScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e5.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new ScalarExpr((e5!=null?e5.value:null));
+ }
+
+ }
+ break;
+ case 6 :
+ // src/petascope/wcps/grammar/wcps.g:111:7: LPAREN e6= scalarExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ LPAREN22=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_scalarExpr894); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN22_tree = (Object)adaptor.create(LPAREN22);
+ adaptor.addChild(root_0, LPAREN22_tree);
+ }
+ pushFollow(FOLLOW_scalarExpr_in_scalarExpr898);
+ e6=scalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e6.getTree());
+ RPAREN23=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_scalarExpr900); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN23_tree = (Object)adaptor.create(RPAREN23);
+ adaptor.addChild(root_0, RPAREN23_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = (e6!=null?e6.value:null);
+ }
+
+ }
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 17, scalarExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "scalarExpr"
+
+ public static class metaDataExpr_return extends ParserRuleReturnScope {
+ public MetaDataExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "metaDataExpr"
+ // src/petascope/wcps/grammar/wcps.g:113:1: metaDataExpr returns [MetaDataExpr value] : (op= IDENTIFIER LPAREN e1= coverageExpr RPAREN | op= IMAGECRS LPAREN e1= coverageExpr RPAREN | op= IMAGECRSDOMAIN LPAREN e1= coverageExpr ( COMMA e2= axisName )? RPAREN | op= CRSSET LPAREN e1= coverageExpr RPAREN | de= domainExpr | op= NULLSET LPAREN e1= coverageExpr RPAREN | op= INTERPOLATIONDEFAULT LPAREN e1= coverageExpr COMMA f1= fieldName RPAREN | op= INTERPOLATIONSET LPAREN e1= coverageExpr COMMA f1= fieldName RPAREN );
+ public final wcpsParser.metaDataExpr_return metaDataExpr() throws RecognitionException {
+ wcpsParser.metaDataExpr_return retval = new wcpsParser.metaDataExpr_return();
+ retval.start = input.LT(1);
+ int metaDataExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ Token LPAREN24=null;
+ Token RPAREN25=null;
+ Token LPAREN26=null;
+ Token RPAREN27=null;
+ Token LPAREN28=null;
+ Token COMMA29=null;
+ Token RPAREN30=null;
+ Token LPAREN31=null;
+ Token RPAREN32=null;
+ Token LPAREN33=null;
+ Token RPAREN34=null;
+ Token LPAREN35=null;
+ Token COMMA36=null;
+ Token RPAREN37=null;
+ Token LPAREN38=null;
+ Token COMMA39=null;
+ Token RPAREN40=null;
+ wcpsParser.coverageExpr_return e1 = null;
+
+ wcpsParser.axisName_return e2 = null;
+
+ wcpsParser.domainExpr_return de = null;
+
+ wcpsParser.fieldName_return f1 = null;
+
+
+ Object op_tree=null;
+ Object LPAREN24_tree=null;
+ Object RPAREN25_tree=null;
+ Object LPAREN26_tree=null;
+ Object RPAREN27_tree=null;
+ Object LPAREN28_tree=null;
+ Object COMMA29_tree=null;
+ Object RPAREN30_tree=null;
+ Object LPAREN31_tree=null;
+ Object RPAREN32_tree=null;
+ Object LPAREN33_tree=null;
+ Object RPAREN34_tree=null;
+ Object LPAREN35_tree=null;
+ Object COMMA36_tree=null;
+ Object RPAREN37_tree=null;
+ Object LPAREN38_tree=null;
+ Object COMMA39_tree=null;
+ Object RPAREN40_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 18) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:114:5: (op= IDENTIFIER LPAREN e1= coverageExpr RPAREN | op= IMAGECRS LPAREN e1= coverageExpr RPAREN | op= IMAGECRSDOMAIN LPAREN e1= coverageExpr ( COMMA e2= axisName )? RPAREN | op= CRSSET LPAREN e1= coverageExpr RPAREN | de= domainExpr | op= NULLSET LPAREN e1= coverageExpr RPAREN | op= INTERPOLATIONDEFAULT LPAREN e1= coverageExpr COMMA f1= fieldName RPAREN | op= INTERPOLATIONSET LPAREN e1= coverageExpr COMMA f1= fieldName RPAREN )
+ int alt16=8;
+ switch ( input.LA(1) ) {
+ case IDENTIFIER:
+ {
+ alt16=1;
+ }
+ break;
+ case IMAGECRS:
+ {
+ alt16=2;
+ }
+ break;
+ case IMAGECRSDOMAIN:
+ {
+ alt16=3;
+ }
+ break;
+ case CRSSET:
+ {
+ alt16=4;
+ }
+ break;
+ case DOMAIN:
+ {
+ alt16=5;
+ }
+ break;
+ case NULLSET:
+ {
+ alt16=6;
+ }
+ break;
+ case INTERPOLATIONDEFAULT:
+ {
+ alt16=7;
+ }
+ break;
+ case INTERPOLATIONSET:
+ {
+ alt16=8;
+ }
+ break;
+ default:
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 16, 0, input);
+
+ throw nvae;
+ }
+
+ switch (alt16) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:114:7: op= IDENTIFIER LPAREN e1= coverageExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_metaDataExpr924); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN24=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_metaDataExpr926); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN24_tree = (Object)adaptor.create(LPAREN24);
+ adaptor.addChild(root_0, LPAREN24_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_metaDataExpr930);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ RPAREN25=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_metaDataExpr932); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN25_tree = (Object)adaptor.create(RPAREN25);
+ adaptor.addChild(root_0, RPAREN25_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new MetaDataExpr((op!=null?op.getText():null), (e1!=null?e1.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:115:7: op= IMAGECRS LPAREN e1= coverageExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,IMAGECRS,FOLLOW_IMAGECRS_in_metaDataExpr944); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN26=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_metaDataExpr946); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN26_tree = (Object)adaptor.create(LPAREN26);
+ adaptor.addChild(root_0, LPAREN26_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_metaDataExpr950);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ RPAREN27=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_metaDataExpr952); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN27_tree = (Object)adaptor.create(RPAREN27);
+ adaptor.addChild(root_0, RPAREN27_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new MetaDataExpr((op!=null?op.getText():null), (e1!=null?e1.value:null));
+ }
+
+ }
+ break;
+ case 3 :
+ // src/petascope/wcps/grammar/wcps.g:116:7: op= IMAGECRSDOMAIN LPAREN e1= coverageExpr ( COMMA e2= axisName )? RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,IMAGECRSDOMAIN,FOLLOW_IMAGECRSDOMAIN_in_metaDataExpr964); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN28=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_metaDataExpr966); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN28_tree = (Object)adaptor.create(LPAREN28);
+ adaptor.addChild(root_0, LPAREN28_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_metaDataExpr970);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ // src/petascope/wcps/grammar/wcps.g:116:48: ( COMMA e2= axisName )?
+ int alt15=2;
+ int LA15_0 = input.LA(1);
+
+ if ( (LA15_0==COMMA) ) {
+ alt15=1;
+ }
+ switch (alt15) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:116:49: COMMA e2= axisName
+ {
+ COMMA29=(Token)match(input,COMMA,FOLLOW_COMMA_in_metaDataExpr973); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA29_tree = (Object)adaptor.create(COMMA29);
+ adaptor.addChild(root_0, COMMA29_tree);
+ }
+ pushFollow(FOLLOW_axisName_in_metaDataExpr977);
+ e2=axisName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+
+ }
+ break;
+
+ }
+
+ RPAREN30=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_metaDataExpr981); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN30_tree = (Object)adaptor.create(RPAREN30);
+ adaptor.addChild(root_0, RPAREN30_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new MetaDataExpr((op!=null?op.getText():null), (e1!=null?e1.value:null), (e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+ case 4 :
+ // src/petascope/wcps/grammar/wcps.g:117:7: op= CRSSET LPAREN e1= coverageExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,CRSSET,FOLLOW_CRSSET_in_metaDataExpr993); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN31=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_metaDataExpr995); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN31_tree = (Object)adaptor.create(LPAREN31);
+ adaptor.addChild(root_0, LPAREN31_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_metaDataExpr999);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ RPAREN32=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_metaDataExpr1001); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN32_tree = (Object)adaptor.create(RPAREN32);
+ adaptor.addChild(root_0, RPAREN32_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new MetaDataExpr((op!=null?op.getText():null), (e1!=null?e1.value:null));
+ }
+
+ }
+ break;
+ case 5 :
+ // src/petascope/wcps/grammar/wcps.g:118:7: de= domainExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_domainExpr_in_metaDataExpr1013);
+ de=domainExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, de.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new MetaDataExpr((de!=null?de.value:null));
+ }
+
+ }
+ break;
+ case 6 :
+ // src/petascope/wcps/grammar/wcps.g:119:7: op= NULLSET LPAREN e1= coverageExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,NULLSET,FOLLOW_NULLSET_in_metaDataExpr1025); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN33=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_metaDataExpr1027); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN33_tree = (Object)adaptor.create(LPAREN33);
+ adaptor.addChild(root_0, LPAREN33_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_metaDataExpr1031);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ RPAREN34=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_metaDataExpr1033); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN34_tree = (Object)adaptor.create(RPAREN34);
+ adaptor.addChild(root_0, RPAREN34_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new MetaDataExpr((op!=null?op.getText():null),(e1!=null?e1.value:null));
+ }
+
+ }
+ break;
+ case 7 :
+ // src/petascope/wcps/grammar/wcps.g:120:7: op= INTERPOLATIONDEFAULT LPAREN e1= coverageExpr COMMA f1= fieldName RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,INTERPOLATIONDEFAULT,FOLLOW_INTERPOLATIONDEFAULT_in_metaDataExpr1045); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN35=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_metaDataExpr1047); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN35_tree = (Object)adaptor.create(LPAREN35);
+ adaptor.addChild(root_0, LPAREN35_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_metaDataExpr1051);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ COMMA36=(Token)match(input,COMMA,FOLLOW_COMMA_in_metaDataExpr1053); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA36_tree = (Object)adaptor.create(COMMA36);
+ adaptor.addChild(root_0, COMMA36_tree);
+ }
+ pushFollow(FOLLOW_fieldName_in_metaDataExpr1057);
+ f1=fieldName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, f1.getTree());
+ RPAREN37=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_metaDataExpr1059); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN37_tree = (Object)adaptor.create(RPAREN37);
+ adaptor.addChild(root_0, RPAREN37_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new MetaDataExpr((op!=null?op.getText():null), (e1!=null?e1.value:null), (f1!=null?f1.value:null));
+ }
+
+ }
+ break;
+ case 8 :
+ // src/petascope/wcps/grammar/wcps.g:121:7: op= INTERPOLATIONSET LPAREN e1= coverageExpr COMMA f1= fieldName RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,INTERPOLATIONSET,FOLLOW_INTERPOLATIONSET_in_metaDataExpr1071); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN38=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_metaDataExpr1073); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN38_tree = (Object)adaptor.create(LPAREN38);
+ adaptor.addChild(root_0, LPAREN38_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_metaDataExpr1077);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ COMMA39=(Token)match(input,COMMA,FOLLOW_COMMA_in_metaDataExpr1079); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA39_tree = (Object)adaptor.create(COMMA39);
+ adaptor.addChild(root_0, COMMA39_tree);
+ }
+ pushFollow(FOLLOW_fieldName_in_metaDataExpr1083);
+ f1=fieldName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, f1.getTree());
+ RPAREN40=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_metaDataExpr1085); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN40_tree = (Object)adaptor.create(RPAREN40);
+ adaptor.addChild(root_0, RPAREN40_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new MetaDataExpr((op!=null?op.getText():null), (e1!=null?e1.value:null), (f1!=null?f1.value:null));
+ }
+
+ }
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 18, metaDataExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "metaDataExpr"
+
+ public static class domainExpr_return extends ParserRuleReturnScope {
+ public DomainExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "domainExpr"
+ // src/petascope/wcps/grammar/wcps.g:123:1: domainExpr returns [DomainExpr value] : DOMAIN LPAREN var= coverageVariable COMMA axis= axisName COMMA crs= crsName RPAREN ;
+ public final wcpsParser.domainExpr_return domainExpr() throws RecognitionException {
+ wcpsParser.domainExpr_return retval = new wcpsParser.domainExpr_return();
+ retval.start = input.LT(1);
+ int domainExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token DOMAIN41=null;
+ Token LPAREN42=null;
+ Token COMMA43=null;
+ Token COMMA44=null;
+ Token RPAREN45=null;
+ wcpsParser.coverageVariable_return var = null;
+
+ wcpsParser.axisName_return axis = null;
+
+ wcpsParser.crsName_return crs = null;
+
+
+ Object DOMAIN41_tree=null;
+ Object LPAREN42_tree=null;
+ Object COMMA43_tree=null;
+ Object COMMA44_tree=null;
+ Object RPAREN45_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 19) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:124:2: ( DOMAIN LPAREN var= coverageVariable COMMA axis= axisName COMMA crs= crsName RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:124:4: DOMAIN LPAREN var= coverageVariable COMMA axis= axisName COMMA crs= crsName RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ DOMAIN41=(Token)match(input,DOMAIN,FOLLOW_DOMAIN_in_domainExpr1104); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ DOMAIN41_tree = (Object)adaptor.create(DOMAIN41);
+ adaptor.addChild(root_0, DOMAIN41_tree);
+ }
+ LPAREN42=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_domainExpr1106); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN42_tree = (Object)adaptor.create(LPAREN42);
+ adaptor.addChild(root_0, LPAREN42_tree);
+ }
+ pushFollow(FOLLOW_coverageVariable_in_domainExpr1110);
+ var=coverageVariable();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, var.getTree());
+ COMMA43=(Token)match(input,COMMA,FOLLOW_COMMA_in_domainExpr1112); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA43_tree = (Object)adaptor.create(COMMA43);
+ adaptor.addChild(root_0, COMMA43_tree);
+ }
+ pushFollow(FOLLOW_axisName_in_domainExpr1116);
+ axis=axisName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, axis.getTree());
+ COMMA44=(Token)match(input,COMMA,FOLLOW_COMMA_in_domainExpr1118); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA44_tree = (Object)adaptor.create(COMMA44);
+ adaptor.addChild(root_0, COMMA44_tree);
+ }
+ pushFollow(FOLLOW_crsName_in_domainExpr1122);
+ crs=crsName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, crs.getTree());
+ RPAREN45=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_domainExpr1124); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN45_tree = (Object)adaptor.create(RPAREN45);
+ adaptor.addChild(root_0, RPAREN45_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new DomainExpr((var!=null?var.value:null), (axis!=null?axis.value:null), (crs!=null?crs.value:null));
+ }
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 19, domainExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "domainExpr"
+
+ public static class condenseExpr_return extends ParserRuleReturnScope {
+ public CondenseExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "condenseExpr"
+ // src/petascope/wcps/grammar/wcps.g:126:1: condenseExpr returns [CondenseExpr value] : (e1= reduceExpr | e2= generalCondenseExpr );
+ public final wcpsParser.condenseExpr_return condenseExpr() throws RecognitionException {
+ wcpsParser.condenseExpr_return retval = new wcpsParser.condenseExpr_return();
+ retval.start = input.LT(1);
+ int condenseExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ wcpsParser.reduceExpr_return e1 = null;
+
+ wcpsParser.generalCondenseExpr_return e2 = null;
+
+
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 20) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:127:2: (e1= reduceExpr | e2= generalCondenseExpr )
+ int alt17=2;
+ int LA17_0 = input.LA(1);
+
+ if ( ((LA17_0>=ALL && LA17_0<=MAX)) ) {
+ alt17=1;
+ }
+ else if ( (LA17_0==CONDENSE) ) {
+ 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 :
+ // src/petascope/wcps/grammar/wcps.g:127:4: e1= reduceExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_reduceExpr_in_condenseExpr1141);
+ e1=reduceExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CondenseExpr((e1!=null?e1.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:128:4: e2= generalCondenseExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_generalCondenseExpr_in_condenseExpr1150);
+ e2=generalCondenseExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CondenseExpr((e2!=null?e2.value:null));
+ }
+
+ }
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 20, condenseExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "condenseExpr"
+
+ public static class reduceExpr_return extends ParserRuleReturnScope {
+ public ReduceExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "reduceExpr"
+ // src/petascope/wcps/grammar/wcps.g:130:1: reduceExpr returns [ReduceExpr value] : op= ( ALL | SOME | COUNT | ADD | AVG | MIN | MAX ) LPAREN e1= coverageExpr RPAREN ;
+ public final wcpsParser.reduceExpr_return reduceExpr() throws RecognitionException {
+ wcpsParser.reduceExpr_return retval = new wcpsParser.reduceExpr_return();
+ retval.start = input.LT(1);
+ int reduceExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ Token LPAREN46=null;
+ Token RPAREN47=null;
+ wcpsParser.coverageExpr_return e1 = null;
+
+
+ Object op_tree=null;
+ Object LPAREN46_tree=null;
+ Object RPAREN47_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 21) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:131:2: (op= ( ALL | SOME | COUNT | ADD | AVG | MIN | MAX ) LPAREN e1= coverageExpr RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:131:4: op= ( ALL | SOME | COUNT | ADD | AVG | MIN | MAX ) LPAREN e1= coverageExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=ALL && input.LA(1)<=MAX) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ LPAREN46=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_reduceExpr1183); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN46_tree = (Object)adaptor.create(LPAREN46);
+ adaptor.addChild(root_0, LPAREN46_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_reduceExpr1187);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ RPAREN47=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_reduceExpr1189); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN47_tree = (Object)adaptor.create(RPAREN47);
+ adaptor.addChild(root_0, RPAREN47_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new ReduceExpr((op!=null?op.getText():null), (e1!=null?e1.value:null));
+ }
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 21, reduceExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "reduceExpr"
+
+ public static class generalCondenseExpr_return extends ParserRuleReturnScope {
+ public GeneralCondenseExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "generalCondenseExpr"
+ // src/petascope/wcps/grammar/wcps.g:133:1: generalCondenseExpr returns [GeneralCondenseExpr value] : CONDENSE op= condenseOpType OVER ail= axisIteratorList ( WHERE cond= booleanScalarExpr )? USING ce= coverageExpr ;
+ public final wcpsParser.generalCondenseExpr_return generalCondenseExpr() throws RecognitionException {
+ wcpsParser.generalCondenseExpr_return retval = new wcpsParser.generalCondenseExpr_return();
+ retval.start = input.LT(1);
+ int generalCondenseExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token CONDENSE48=null;
+ Token OVER49=null;
+ Token WHERE50=null;
+ Token USING51=null;
+ wcpsParser.condenseOpType_return op = null;
+
+ wcpsParser.axisIteratorList_return ail = null;
+
+ wcpsParser.booleanScalarExpr_return cond = null;
+
+ wcpsParser.coverageExpr_return ce = null;
+
+
+ Object CONDENSE48_tree=null;
+ Object OVER49_tree=null;
+ Object WHERE50_tree=null;
+ Object USING51_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 22) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:134:2: ( CONDENSE op= condenseOpType OVER ail= axisIteratorList ( WHERE cond= booleanScalarExpr )? USING ce= coverageExpr )
+ // src/petascope/wcps/grammar/wcps.g:134:4: CONDENSE op= condenseOpType OVER ail= axisIteratorList ( WHERE cond= booleanScalarExpr )? USING ce= coverageExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ CONDENSE48=(Token)match(input,CONDENSE,FOLLOW_CONDENSE_in_generalCondenseExpr1204); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ CONDENSE48_tree = (Object)adaptor.create(CONDENSE48);
+ adaptor.addChild(root_0, CONDENSE48_tree);
+ }
+ pushFollow(FOLLOW_condenseOpType_in_generalCondenseExpr1208);
+ op=condenseOpType();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, op.getTree());
+ OVER49=(Token)match(input,OVER,FOLLOW_OVER_in_generalCondenseExpr1210); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ OVER49_tree = (Object)adaptor.create(OVER49);
+ adaptor.addChild(root_0, OVER49_tree);
+ }
+ pushFollow(FOLLOW_axisIteratorList_in_generalCondenseExpr1214);
+ ail=axisIteratorList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, ail.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new GeneralCondenseExpr((op!=null?op.value:null), (ail!=null?ail.value:null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:135:3: ( WHERE cond= booleanScalarExpr )?
+ int alt18=2;
+ int LA18_0 = input.LA(1);
+
+ if ( (LA18_0==WHERE) ) {
+ alt18=1;
+ }
+ switch (alt18) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:135:4: WHERE cond= booleanScalarExpr
+ {
+ WHERE50=(Token)match(input,WHERE,FOLLOW_WHERE_in_generalCondenseExpr1221); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ WHERE50_tree = (Object)adaptor.create(WHERE50);
+ adaptor.addChild(root_0, WHERE50_tree);
+ }
+ pushFollow(FOLLOW_booleanScalarExpr_in_generalCondenseExpr1225);
+ cond=booleanScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, cond.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.setWhere((cond!=null?cond.value:null));
+ }
+
+ }
+ break;
+
+ }
+
+ USING51=(Token)match(input,USING,FOLLOW_USING_in_generalCondenseExpr1233); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ USING51_tree = (Object)adaptor.create(USING51);
+ adaptor.addChild(root_0, USING51_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_generalCondenseExpr1237);
+ ce=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, ce.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.setUsing((ce!=null?ce.value:null));
+ }
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 22, generalCondenseExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "generalCondenseExpr"
+
+ public static class axisIteratorList_return extends ParserRuleReturnScope {
+ public AxisIteratorList value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "axisIteratorList"
+ // src/petascope/wcps/grammar/wcps.g:138:1: axisIteratorList returns [AxisIteratorList value] : vn= variableName an= axisName LPAREN ie= intervalExpr RPAREN ( COMMA vn2= variableName an2= axisName LPAREN ie2= intervalExpr RPAREN )* ;
+ public final wcpsParser.axisIteratorList_return axisIteratorList() throws RecognitionException {
+ wcpsParser.axisIteratorList_return retval = new wcpsParser.axisIteratorList_return();
+ retval.start = input.LT(1);
+ int axisIteratorList_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token LPAREN52=null;
+ Token RPAREN53=null;
+ Token COMMA54=null;
+ Token LPAREN55=null;
+ Token RPAREN56=null;
+ wcpsParser.variableName_return vn = null;
+
+ wcpsParser.axisName_return an = null;
+
+ wcpsParser.intervalExpr_return ie = null;
+
+ wcpsParser.variableName_return vn2 = null;
+
+ wcpsParser.axisName_return an2 = null;
+
+ wcpsParser.intervalExpr_return ie2 = null;
+
+
+ Object LPAREN52_tree=null;
+ Object RPAREN53_tree=null;
+ Object COMMA54_tree=null;
+ Object LPAREN55_tree=null;
+ Object RPAREN56_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 23) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:139:2: (vn= variableName an= axisName LPAREN ie= intervalExpr RPAREN ( COMMA vn2= variableName an2= axisName LPAREN ie2= intervalExpr RPAREN )* )
+ // src/petascope/wcps/grammar/wcps.g:139:4: vn= variableName an= axisName LPAREN ie= intervalExpr RPAREN ( COMMA vn2= variableName an2= axisName LPAREN ie2= intervalExpr RPAREN )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_variableName_in_axisIteratorList1254);
+ vn=variableName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, vn.getTree());
+ pushFollow(FOLLOW_axisName_in_axisIteratorList1258);
+ an=axisName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, an.getTree());
+ LPAREN52=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_axisIteratorList1260); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN52_tree = (Object)adaptor.create(LPAREN52);
+ adaptor.addChild(root_0, LPAREN52_tree);
+ }
+ pushFollow(FOLLOW_intervalExpr_in_axisIteratorList1264);
+ ie=intervalExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, ie.getTree());
+ RPAREN53=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_axisIteratorList1266); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN53_tree = (Object)adaptor.create(RPAREN53);
+ adaptor.addChild(root_0, RPAREN53_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new AxisIteratorList(new AxisIterator((vn!=null?vn.value:null), (an!=null?an.value:null), (ie!=null?ie.value:null)));
+ }
+ // src/petascope/wcps/grammar/wcps.g:141:2: ( COMMA vn2= variableName an2= axisName LPAREN ie2= intervalExpr RPAREN )*
+ loop19:
+ do {
+ int alt19=2;
+ int LA19_0 = input.LA(1);
+
+ if ( (LA19_0==COMMA) ) {
+ alt19=1;
+ }
+
+
+ switch (alt19) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:141:3: COMMA vn2= variableName an2= axisName LPAREN ie2= intervalExpr RPAREN
+ {
+ COMMA54=(Token)match(input,COMMA,FOLLOW_COMMA_in_axisIteratorList1274); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA54_tree = (Object)adaptor.create(COMMA54);
+ adaptor.addChild(root_0, COMMA54_tree);
+ }
+ pushFollow(FOLLOW_variableName_in_axisIteratorList1278);
+ vn2=variableName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, vn2.getTree());
+ pushFollow(FOLLOW_axisName_in_axisIteratorList1282);
+ an2=axisName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, an2.getTree());
+ LPAREN55=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_axisIteratorList1284); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN55_tree = (Object)adaptor.create(LPAREN55);
+ adaptor.addChild(root_0, LPAREN55_tree);
+ }
+ pushFollow(FOLLOW_intervalExpr_in_axisIteratorList1288);
+ ie2=intervalExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, ie2.getTree());
+ RPAREN56=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_axisIteratorList1290); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN56_tree = (Object)adaptor.create(RPAREN56);
+ adaptor.addChild(root_0, RPAREN56_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new AxisIteratorList(new AxisIterator((vn2!=null?vn2.value:null), (an2!=null?an2.value:null), (ie2!=null?ie2.value:null)), retval.value);
+ }
+
+ }
+ break;
+
+ default :
+ break loop19;
+ }
+ } while (true);
+
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 23, axisIteratorList_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "axisIteratorList"
+
+ public static class intervalExpr_return extends ParserRuleReturnScope {
+ public IntervalExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "intervalExpr"
+ // src/petascope/wcps/grammar/wcps.g:144:1: intervalExpr returns [IntervalExpr value] : (lo= indexExpr COLON hi= indexExpr | IMAGECRSDOMAIN LPAREN e1= coverageName COMMA e2= axisName RPAREN );
+ public final wcpsParser.intervalExpr_return intervalExpr() throws RecognitionException {
+ wcpsParser.intervalExpr_return retval = new wcpsParser.intervalExpr_return();
+ retval.start = input.LT(1);
+ int intervalExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token COLON57=null;
+ Token IMAGECRSDOMAIN58=null;
+ Token LPAREN59=null;
+ Token COMMA60=null;
+ Token RPAREN61=null;
+ wcpsParser.indexExpr_return lo = null;
+
+ wcpsParser.indexExpr_return hi = null;
+
+ wcpsParser.coverageName_return e1 = null;
+
+ wcpsParser.axisName_return e2 = null;
+
+
+ Object COLON57_tree=null;
+ Object IMAGECRSDOMAIN58_tree=null;
+ Object LPAREN59_tree=null;
+ Object COMMA60_tree=null;
+ Object RPAREN61_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 24) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:145:5: (lo= indexExpr COLON hi= indexExpr | IMAGECRSDOMAIN LPAREN e1= coverageName COMMA e2= axisName RPAREN )
+ int alt20=2;
+ int LA20_0 = input.LA(1);
+
+ if ( (LA20_0==LPAREN||(LA20_0>=INTEGERCONSTANT && LA20_0<=ROUND)) ) {
+ alt20=1;
+ }
+ else if ( (LA20_0==IMAGECRSDOMAIN) ) {
+ alt20=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 20, 0, input);
+
+ throw nvae;
+ }
+ switch (alt20) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:145:7: lo= indexExpr COLON hi= indexExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_indexExpr_in_intervalExpr1314);
+ lo=indexExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, lo.getTree());
+ COLON57=(Token)match(input,COLON,FOLLOW_COLON_in_intervalExpr1316); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COLON57_tree = (Object)adaptor.create(COLON57);
+ adaptor.addChild(root_0, COLON57_tree);
+ }
+ pushFollow(FOLLOW_indexExpr_in_intervalExpr1320);
+ hi=indexExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, hi.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new IntervalExpr((lo!=null?lo.value:null), (hi!=null?hi.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:147:7: IMAGECRSDOMAIN LPAREN e1= coverageName COMMA e2= axisName RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ IMAGECRSDOMAIN58=(Token)match(input,IMAGECRSDOMAIN,FOLLOW_IMAGECRSDOMAIN_in_intervalExpr1335); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ IMAGECRSDOMAIN58_tree = (Object)adaptor.create(IMAGECRSDOMAIN58);
+ adaptor.addChild(root_0, IMAGECRSDOMAIN58_tree);
+ }
+ LPAREN59=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_intervalExpr1337); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN59_tree = (Object)adaptor.create(LPAREN59);
+ adaptor.addChild(root_0, LPAREN59_tree);
+ }
+ pushFollow(FOLLOW_coverageName_in_intervalExpr1341);
+ e1=coverageName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ COMMA60=(Token)match(input,COMMA,FOLLOW_COMMA_in_intervalExpr1343); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA60_tree = (Object)adaptor.create(COMMA60);
+ adaptor.addChild(root_0, COMMA60_tree);
+ }
+ pushFollow(FOLLOW_axisName_in_intervalExpr1347);
+ e2=axisName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ RPAREN61=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_intervalExpr1349); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN61_tree = (Object)adaptor.create(RPAREN61);
+ adaptor.addChild(root_0, RPAREN61_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new IntervalExpr((e1!=null?e1.value:null), (e2!=null?e2.value:null));
+ }
+
+ }
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 24, intervalExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "intervalExpr"
+
+ public static class coverageConstantExpr_return extends ParserRuleReturnScope {
+ public CoverageConstantExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "coverageConstantExpr"
+ // src/petascope/wcps/grammar/wcps.g:150:1: coverageConstantExpr returns [CoverageConstantExpr value] : COVERAGE aname= coverageName OVER iter= axisIteratorList VALUE LIST LT values= constantList GT ;
+ public final wcpsParser.coverageConstantExpr_return coverageConstantExpr() throws RecognitionException {
+ wcpsParser.coverageConstantExpr_return retval = new wcpsParser.coverageConstantExpr_return();
+ retval.start = input.LT(1);
+ int coverageConstantExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token COVERAGE62=null;
+ Token OVER63=null;
+ Token VALUE64=null;
+ Token LIST65=null;
+ Token LT66=null;
+ Token GT67=null;
+ wcpsParser.coverageName_return aname = null;
+
+ wcpsParser.axisIteratorList_return iter = null;
+
+ wcpsParser.constantList_return values = null;
+
+
+ Object COVERAGE62_tree=null;
+ Object OVER63_tree=null;
+ Object VALUE64_tree=null;
+ Object LIST65_tree=null;
+ Object LT66_tree=null;
+ Object GT67_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 25) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:151:5: ( COVERAGE aname= coverageName OVER iter= axisIteratorList VALUE LIST LT values= constantList GT )
+ // src/petascope/wcps/grammar/wcps.g:151:7: COVERAGE aname= coverageName OVER iter= axisIteratorList VALUE LIST LT values= constantList GT
+ {
+ root_0 = (Object)adaptor.nil();
+
+ COVERAGE62=(Token)match(input,COVERAGE,FOLLOW_COVERAGE_in_coverageConstantExpr1375); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COVERAGE62_tree = (Object)adaptor.create(COVERAGE62);
+ adaptor.addChild(root_0, COVERAGE62_tree);
+ }
+ pushFollow(FOLLOW_coverageName_in_coverageConstantExpr1379);
+ aname=coverageName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, aname.getTree());
+ OVER63=(Token)match(input,OVER,FOLLOW_OVER_in_coverageConstantExpr1381); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ OVER63_tree = (Object)adaptor.create(OVER63);
+ adaptor.addChild(root_0, OVER63_tree);
+ }
+ pushFollow(FOLLOW_axisIteratorList_in_coverageConstantExpr1385);
+ iter=axisIteratorList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, iter.getTree());
+ VALUE64=(Token)match(input,VALUE,FOLLOW_VALUE_in_coverageConstantExpr1387); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ VALUE64_tree = (Object)adaptor.create(VALUE64);
+ adaptor.addChild(root_0, VALUE64_tree);
+ }
+ LIST65=(Token)match(input,LIST,FOLLOW_LIST_in_coverageConstantExpr1389); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LIST65_tree = (Object)adaptor.create(LIST65);
+ adaptor.addChild(root_0, LIST65_tree);
+ }
+ LT66=(Token)match(input,LT,FOLLOW_LT_in_coverageConstantExpr1391); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LT66_tree = (Object)adaptor.create(LT66);
+ adaptor.addChild(root_0, LT66_tree);
+ }
+ pushFollow(FOLLOW_constantList_in_coverageConstantExpr1395);
+ values=constantList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, values.getTree());
+ GT67=(Token)match(input,GT,FOLLOW_GT_in_coverageConstantExpr1397); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ GT67_tree = (Object)adaptor.create(GT67);
+ adaptor.addChild(root_0, GT67_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageConstantExpr((aname!=null?aname.value:null), (iter!=null?iter.value:null), (values!=null?values.value:null));
+ }
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 25, coverageConstantExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "coverageConstantExpr"
+
+ public static class constantList_return extends ParserRuleReturnScope {
+ public ConstantList value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "constantList"
+ // src/petascope/wcps/grammar/wcps.g:154:1: constantList returns [ConstantList value] : c= constant ( SEMICOLON c= constant )* ;
+ public final wcpsParser.constantList_return constantList() throws RecognitionException {
+ wcpsParser.constantList_return retval = new wcpsParser.constantList_return();
+ retval.start = input.LT(1);
+ int constantList_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token SEMICOLON68=null;
+ wcpsParser.constant_return c = null;
+
+
+ Object SEMICOLON68_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 26) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:155:5: (c= constant ( SEMICOLON c= constant )* )
+ // src/petascope/wcps/grammar/wcps.g:155:7: c= constant ( SEMICOLON c= constant )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_constant_in_constantList1428);
+ c=constant();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, c.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new ConstantList((c!=null?c.value:null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:155:59: ( SEMICOLON c= constant )*
+ loop21:
+ do {
+ int alt21=2;
+ int LA21_0 = input.LA(1);
+
+ if ( (LA21_0==SEMICOLON) ) {
+ alt21=1;
+ }
+
+
+ switch (alt21) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:155:60: SEMICOLON c= constant
+ {
+ SEMICOLON68=(Token)match(input,SEMICOLON,FOLLOW_SEMICOLON_in_constantList1433); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ SEMICOLON68_tree = (Object)adaptor.create(SEMICOLON68);
+ adaptor.addChild(root_0, SEMICOLON68_tree);
+ }
+ pushFollow(FOLLOW_constant_in_constantList1437);
+ c=constant();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, c.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.add((c!=null?c.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop21;
+ }
+ } while (true);
+
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 26, constantList_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "constantList"
+
+ public static class coverageConstructorExpr_return extends ParserRuleReturnScope {
+ public CoverageConstructorExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "coverageConstructorExpr"
+ // src/petascope/wcps/grammar/wcps.g:157:1: coverageConstructorExpr returns [CoverageConstructorExpr value] : COVERAGE coverage= coverageName OVER ail= axisIteratorList VALUES se= scalarExpr ;
+ public final wcpsParser.coverageConstructorExpr_return coverageConstructorExpr() throws RecognitionException {
+ wcpsParser.coverageConstructorExpr_return retval = new wcpsParser.coverageConstructorExpr_return();
+ retval.start = input.LT(1);
+ int coverageConstructorExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token COVERAGE69=null;
+ Token OVER70=null;
+ Token VALUES71=null;
+ wcpsParser.coverageName_return coverage = null;
+
+ wcpsParser.axisIteratorList_return ail = null;
+
+ wcpsParser.scalarExpr_return se = null;
+
+
+ Object COVERAGE69_tree=null;
+ Object OVER70_tree=null;
+ Object VALUES71_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 27) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:158:2: ( COVERAGE coverage= coverageName OVER ail= axisIteratorList VALUES se= scalarExpr )
+ // src/petascope/wcps/grammar/wcps.g:158:4: COVERAGE coverage= coverageName OVER ail= axisIteratorList VALUES se= scalarExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ COVERAGE69=(Token)match(input,COVERAGE,FOLLOW_COVERAGE_in_coverageConstructorExpr1457); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COVERAGE69_tree = (Object)adaptor.create(COVERAGE69);
+ adaptor.addChild(root_0, COVERAGE69_tree);
+ }
+ pushFollow(FOLLOW_coverageName_in_coverageConstructorExpr1461);
+ coverage=coverageName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, coverage.getTree());
+ OVER70=(Token)match(input,OVER,FOLLOW_OVER_in_coverageConstructorExpr1463); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ OVER70_tree = (Object)adaptor.create(OVER70);
+ adaptor.addChild(root_0, OVER70_tree);
+ }
+ pushFollow(FOLLOW_axisIteratorList_in_coverageConstructorExpr1467);
+ ail=axisIteratorList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, ail.getTree());
+ VALUES71=(Token)match(input,VALUES,FOLLOW_VALUES_in_coverageConstructorExpr1469); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ VALUES71_tree = (Object)adaptor.create(VALUES71);
+ adaptor.addChild(root_0, VALUES71_tree);
+ }
+ pushFollow(FOLLOW_scalarExpr_in_coverageConstructorExpr1473);
+ se=scalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, se.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageConstructorExpr((coverage!=null?coverage.value:null), (ail!=null?ail.value:null), (se!=null?se.value:null));
+ }
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 27, coverageConstructorExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "coverageConstructorExpr"
+
+ public static class setMetaDataExpr_return extends ParserRuleReturnScope {
+ public SetMetaDataExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "setMetaDataExpr"
+ // src/petascope/wcps/grammar/wcps.g:161:1: setMetaDataExpr returns [SetMetaDataExpr value] : (op= SETIDENTIFIER LPAREN s= stringConstant COMMA e1= coverageExpr RPAREN | op= SETCRSSET LPAREN e1= coverageExpr COMMA crs= crsList RPAREN | op= SETNULLSET LPAREN e1= coverageExpr COMMA rel= rangeExprList RPAREN | op= SETINTERPOLATIONDEFAULT LPAREN e1= coverageExpr COMMA fn= fieldName COMMA im= interpolationMethod RPAREN | op= SETINTERPOLATIONSET LPAREN e1= coverageExpr COMMA fn= fieldName COMMA iml= interpolationMethodList RPAREN );
+ public final wcpsParser.setMetaDataExpr_return setMetaDataExpr() throws RecognitionException {
+ wcpsParser.setMetaDataExpr_return retval = new wcpsParser.setMetaDataExpr_return();
+ retval.start = input.LT(1);
+ int setMetaDataExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ Token LPAREN72=null;
+ Token COMMA73=null;
+ Token RPAREN74=null;
+ Token LPAREN75=null;
+ Token COMMA76=null;
+ Token RPAREN77=null;
+ Token LPAREN78=null;
+ Token COMMA79=null;
+ Token RPAREN80=null;
+ Token LPAREN81=null;
+ Token COMMA82=null;
+ Token COMMA83=null;
+ Token RPAREN84=null;
+ Token LPAREN85=null;
+ Token COMMA86=null;
+ Token COMMA87=null;
+ Token RPAREN88=null;
+ wcpsParser.stringConstant_return s = null;
+
+ wcpsParser.coverageExpr_return e1 = null;
+
+ wcpsParser.crsList_return crs = null;
+
+ wcpsParser.rangeExprList_return rel = null;
+
+ wcpsParser.fieldName_return fn = null;
+
+ wcpsParser.interpolationMethod_return im = null;
+
+ wcpsParser.interpolationMethodList_return iml = null;
+
+
+ Object op_tree=null;
+ Object LPAREN72_tree=null;
+ Object COMMA73_tree=null;
+ Object RPAREN74_tree=null;
+ Object LPAREN75_tree=null;
+ Object COMMA76_tree=null;
+ Object RPAREN77_tree=null;
+ Object LPAREN78_tree=null;
+ Object COMMA79_tree=null;
+ Object RPAREN80_tree=null;
+ Object LPAREN81_tree=null;
+ Object COMMA82_tree=null;
+ Object COMMA83_tree=null;
+ Object RPAREN84_tree=null;
+ Object LPAREN85_tree=null;
+ Object COMMA86_tree=null;
+ Object COMMA87_tree=null;
+ Object RPAREN88_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 28) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:162:5: (op= SETIDENTIFIER LPAREN s= stringConstant COMMA e1= coverageExpr RPAREN | op= SETCRSSET LPAREN e1= coverageExpr COMMA crs= crsList RPAREN | op= SETNULLSET LPAREN e1= coverageExpr COMMA rel= rangeExprList RPAREN | op= SETINTERPOLATIONDEFAULT LPAREN e1= coverageExpr COMMA fn= fieldName COMMA im= interpolationMethod RPAREN | op= SETINTERPOLATIONSET LPAREN e1= coverageExpr COMMA fn= fieldName COMMA iml= interpolationMethodList RPAREN )
+ int alt22=5;
+ switch ( input.LA(1) ) {
+ case SETIDENTIFIER:
+ {
+ alt22=1;
+ }
+ break;
+ case SETCRSSET:
+ {
+ alt22=2;
+ }
+ break;
+ case SETNULLSET:
+ {
+ alt22=3;
+ }
+ break;
+ case SETINTERPOLATIONDEFAULT:
+ {
+ alt22=4;
+ }
+ break;
+ case SETINTERPOLATIONSET:
+ {
+ alt22=5;
+ }
+ break;
+ default:
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 22, 0, input);
+
+ throw nvae;
+ }
+
+ switch (alt22) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:162:7: op= SETIDENTIFIER LPAREN s= stringConstant COMMA e1= coverageExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,SETIDENTIFIER,FOLLOW_SETIDENTIFIER_in_setMetaDataExpr1495); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN72=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_setMetaDataExpr1497); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN72_tree = (Object)adaptor.create(LPAREN72);
+ adaptor.addChild(root_0, LPAREN72_tree);
+ }
+ pushFollow(FOLLOW_stringConstant_in_setMetaDataExpr1501);
+ s=stringConstant();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, s.getTree());
+ COMMA73=(Token)match(input,COMMA,FOLLOW_COMMA_in_setMetaDataExpr1503); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA73_tree = (Object)adaptor.create(COMMA73);
+ adaptor.addChild(root_0, COMMA73_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_setMetaDataExpr1507);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ RPAREN74=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_setMetaDataExpr1509); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN74_tree = (Object)adaptor.create(RPAREN74);
+ adaptor.addChild(root_0, RPAREN74_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new SetMetaDataExpr((op!=null?op.getText():null), (e1!=null?e1.value:null), (s!=null?s.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:164:7: op= SETCRSSET LPAREN e1= coverageExpr COMMA crs= crsList RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,SETCRSSET,FOLLOW_SETCRSSET_in_setMetaDataExpr1522); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN75=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_setMetaDataExpr1524); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN75_tree = (Object)adaptor.create(LPAREN75);
+ adaptor.addChild(root_0, LPAREN75_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_setMetaDataExpr1528);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ COMMA76=(Token)match(input,COMMA,FOLLOW_COMMA_in_setMetaDataExpr1530); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA76_tree = (Object)adaptor.create(COMMA76);
+ adaptor.addChild(root_0, COMMA76_tree);
+ }
+ pushFollow(FOLLOW_crsList_in_setMetaDataExpr1534);
+ crs=crsList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, crs.getTree());
+ RPAREN77=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_setMetaDataExpr1536); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN77_tree = (Object)adaptor.create(RPAREN77);
+ adaptor.addChild(root_0, RPAREN77_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new SetMetaDataExpr((op!=null?op.getText():null), (e1!=null?e1.value:null), (crs!=null?crs.value:null));
+ }
+
+ }
+ break;
+ case 3 :
+ // src/petascope/wcps/grammar/wcps.g:166:7: op= SETNULLSET LPAREN e1= coverageExpr COMMA rel= rangeExprList RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,SETNULLSET,FOLLOW_SETNULLSET_in_setMetaDataExpr1553); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN78=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_setMetaDataExpr1555); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN78_tree = (Object)adaptor.create(LPAREN78);
+ adaptor.addChild(root_0, LPAREN78_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_setMetaDataExpr1559);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ COMMA79=(Token)match(input,COMMA,FOLLOW_COMMA_in_setMetaDataExpr1561); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA79_tree = (Object)adaptor.create(COMMA79);
+ adaptor.addChild(root_0, COMMA79_tree);
+ }
+ pushFollow(FOLLOW_rangeExprList_in_setMetaDataExpr1565);
+ rel=rangeExprList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, rel.getTree());
+ RPAREN80=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_setMetaDataExpr1567); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN80_tree = (Object)adaptor.create(RPAREN80);
+ adaptor.addChild(root_0, RPAREN80_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new SetMetaDataExpr((op!=null?op.getText():null), (e1!=null?e1.value:null), (rel!=null?rel.value:null));
+ }
+
+ }
+ break;
+ case 4 :
+ // src/petascope/wcps/grammar/wcps.g:168:7: op= SETINTERPOLATIONDEFAULT LPAREN e1= coverageExpr COMMA fn= fieldName COMMA im= interpolationMethod RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,SETINTERPOLATIONDEFAULT,FOLLOW_SETINTERPOLATIONDEFAULT_in_setMetaDataExpr1584); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN81=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_setMetaDataExpr1586); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN81_tree = (Object)adaptor.create(LPAREN81);
+ adaptor.addChild(root_0, LPAREN81_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_setMetaDataExpr1590);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ COMMA82=(Token)match(input,COMMA,FOLLOW_COMMA_in_setMetaDataExpr1592); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA82_tree = (Object)adaptor.create(COMMA82);
+ adaptor.addChild(root_0, COMMA82_tree);
+ }
+ pushFollow(FOLLOW_fieldName_in_setMetaDataExpr1596);
+ fn=fieldName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, fn.getTree());
+ COMMA83=(Token)match(input,COMMA,FOLLOW_COMMA_in_setMetaDataExpr1598); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA83_tree = (Object)adaptor.create(COMMA83);
+ adaptor.addChild(root_0, COMMA83_tree);
+ }
+ pushFollow(FOLLOW_interpolationMethod_in_setMetaDataExpr1602);
+ im=interpolationMethod();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, im.getTree());
+ RPAREN84=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_setMetaDataExpr1604); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN84_tree = (Object)adaptor.create(RPAREN84);
+ adaptor.addChild(root_0, RPAREN84_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new SetMetaDataExpr((op!=null?op.getText():null), (e1!=null?e1.value:null), (im!=null?im.value:null), (fn!=null?fn.value:null));
+ }
+
+ }
+ break;
+ case 5 :
+ // src/petascope/wcps/grammar/wcps.g:170:7: op= SETINTERPOLATIONSET LPAREN e1= coverageExpr COMMA fn= fieldName COMMA iml= interpolationMethodList RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,SETINTERPOLATIONSET,FOLLOW_SETINTERPOLATIONSET_in_setMetaDataExpr1624); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN85=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_setMetaDataExpr1626); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN85_tree = (Object)adaptor.create(LPAREN85);
+ adaptor.addChild(root_0, LPAREN85_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_setMetaDataExpr1630);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ COMMA86=(Token)match(input,COMMA,FOLLOW_COMMA_in_setMetaDataExpr1632); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA86_tree = (Object)adaptor.create(COMMA86);
+ adaptor.addChild(root_0, COMMA86_tree);
+ }
+ pushFollow(FOLLOW_fieldName_in_setMetaDataExpr1636);
+ fn=fieldName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, fn.getTree());
+ COMMA87=(Token)match(input,COMMA,FOLLOW_COMMA_in_setMetaDataExpr1638); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA87_tree = (Object)adaptor.create(COMMA87);
+ adaptor.addChild(root_0, COMMA87_tree);
+ }
+ pushFollow(FOLLOW_interpolationMethodList_in_setMetaDataExpr1642);
+ iml=interpolationMethodList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, iml.getTree());
+ RPAREN88=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_setMetaDataExpr1644); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN88_tree = (Object)adaptor.create(RPAREN88);
+ adaptor.addChild(root_0, RPAREN88_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new SetMetaDataExpr((op!=null?op.getText():null), (e1!=null?e1.value:null), (iml!=null?iml.value:null), (fn!=null?fn.value:null));
+ }
+
+ }
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 28, setMetaDataExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "setMetaDataExpr"
+
+ public static class crsList_return extends ParserRuleReturnScope {
+ public CrsList value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "crsList"
+ // src/petascope/wcps/grammar/wcps.g:173:1: crsList returns [CrsList value] : LBRACE (crs= crsName ( COMMA crs= crsName )* )? RBRACE ;
+ public final wcpsParser.crsList_return crsList() throws RecognitionException {
+ wcpsParser.crsList_return retval = new wcpsParser.crsList_return();
+ retval.start = input.LT(1);
+ int crsList_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token LBRACE89=null;
+ Token COMMA90=null;
+ Token RBRACE91=null;
+ wcpsParser.crsName_return crs = null;
+
+
+ Object LBRACE89_tree=null;
+ Object COMMA90_tree=null;
+ Object RBRACE91_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 29) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:174:5: ( LBRACE (crs= crsName ( COMMA crs= crsName )* )? RBRACE )
+ // src/petascope/wcps/grammar/wcps.g:174:7: LBRACE (crs= crsName ( COMMA crs= crsName )* )? RBRACE
+ {
+ root_0 = (Object)adaptor.nil();
+
+ LBRACE89=(Token)match(input,LBRACE,FOLLOW_LBRACE_in_crsList1673); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LBRACE89_tree = (Object)adaptor.create(LBRACE89);
+ adaptor.addChild(root_0, LBRACE89_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new CrsList();
+ }
+ // src/petascope/wcps/grammar/wcps.g:174:40: (crs= crsName ( COMMA crs= crsName )* )?
+ int alt24=2;
+ int LA24_0 = input.LA(1);
+
+ if ( (LA24_0==STRING) ) {
+ alt24=1;
+ }
+ switch (alt24) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:174:41: crs= crsName ( COMMA crs= crsName )*
+ {
+ pushFollow(FOLLOW_crsName_in_crsList1680);
+ crs=crsName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, crs.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.add((crs!=null?crs.value:null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:174:81: ( COMMA crs= crsName )*
+ loop23:
+ do {
+ int alt23=2;
+ int LA23_0 = input.LA(1);
+
+ if ( (LA23_0==COMMA) ) {
+ alt23=1;
+ }
+
+
+ switch (alt23) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:174:82: COMMA crs= crsName
+ {
+ COMMA90=(Token)match(input,COMMA,FOLLOW_COMMA_in_crsList1685); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA90_tree = (Object)adaptor.create(COMMA90);
+ adaptor.addChild(root_0, COMMA90_tree);
+ }
+ pushFollow(FOLLOW_crsName_in_crsList1689);
+ crs=crsName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, crs.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.add((crs!=null?crs.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop23;
+ }
+ } while (true);
+
+
+ }
+ break;
+
+ }
+
+ RBRACE91=(Token)match(input,RBRACE,FOLLOW_RBRACE_in_crsList1698); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RBRACE91_tree = (Object)adaptor.create(RBRACE91);
+ adaptor.addChild(root_0, RBRACE91_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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 29, crsList_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "crsList"
+
+ public static class rangeExprList_return extends ParserRuleReturnScope {
+ public RangeExprList value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "rangeExprList"
+ // src/petascope/wcps/grammar/wcps.g:176:1: rangeExprList returns [RangeExprList value] : LBRACE (re1= rangeExpr ( COMMA re2= rangeExpr )* )? RBRACE ;
+ public final wcpsParser.rangeExprList_return rangeExprList() throws RecognitionException {
+ wcpsParser.rangeExprList_return retval = new wcpsParser.rangeExprList_return();
+ retval.start = input.LT(1);
+ int rangeExprList_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token LBRACE92=null;
+ Token COMMA93=null;
+ Token RBRACE94=null;
+ wcpsParser.rangeExpr_return re1 = null;
+
+ wcpsParser.rangeExpr_return re2 = null;
+
+
+ Object LBRACE92_tree=null;
+ Object COMMA93_tree=null;
+ Object RBRACE94_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 30) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:177:5: ( LBRACE (re1= rangeExpr ( COMMA re2= rangeExpr )* )? RBRACE )
+ // src/petascope/wcps/grammar/wcps.g:177:7: LBRACE (re1= rangeExpr ( COMMA re2= rangeExpr )* )? RBRACE
+ {
+ root_0 = (Object)adaptor.nil();
+
+ LBRACE92=(Token)match(input,LBRACE,FOLLOW_LBRACE_in_rangeExprList1717); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LBRACE92_tree = (Object)adaptor.create(LBRACE92);
+ adaptor.addChild(root_0, LBRACE92_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new RangeExprList();
+ }
+ // src/petascope/wcps/grammar/wcps.g:177:48: (re1= rangeExpr ( COMMA re2= rangeExpr )* )?
+ int alt26=2;
+ int LA26_0 = input.LA(1);
+
+ if ( (LA26_0==STRUCT) ) {
+ alt26=1;
+ }
+ switch (alt26) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:177:49: re1= rangeExpr ( COMMA re2= rangeExpr )*
+ {
+ pushFollow(FOLLOW_rangeExpr_in_rangeExprList1724);
+ re1=rangeExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, re1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.add((re1!=null?re1.value:null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:177:91: ( COMMA re2= rangeExpr )*
+ loop25:
+ do {
+ int alt25=2;
+ int LA25_0 = input.LA(1);
+
+ if ( (LA25_0==COMMA) ) {
+ alt25=1;
+ }
+
+
+ switch (alt25) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:177:92: COMMA re2= rangeExpr
+ {
+ COMMA93=(Token)match(input,COMMA,FOLLOW_COMMA_in_rangeExprList1729); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA93_tree = (Object)adaptor.create(COMMA93);
+ adaptor.addChild(root_0, COMMA93_tree);
+ }
+ pushFollow(FOLLOW_rangeExpr_in_rangeExprList1733);
+ re2=rangeExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, re2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.add((re2!=null?re2.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop25;
+ }
+ } while (true);
+
+
+ }
+ break;
+
+ }
+
+ RBRACE94=(Token)match(input,RBRACE,FOLLOW_RBRACE_in_rangeExprList1742); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RBRACE94_tree = (Object)adaptor.create(RBRACE94);
+ adaptor.addChild(root_0, RBRACE94_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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 30, rangeExprList_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "rangeExprList"
+
+ public static class interpolationMethodList_return extends ParserRuleReturnScope {
+ public InterpolationMethodList value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "interpolationMethodList"
+ // src/petascope/wcps/grammar/wcps.g:179:1: interpolationMethodList returns [InterpolationMethodList value] : LBRACE (e= interpolationMethod ( COMMA e= interpolationMethod )* )? RBRACE ;
+ public final wcpsParser.interpolationMethodList_return interpolationMethodList() throws RecognitionException {
+ wcpsParser.interpolationMethodList_return retval = new wcpsParser.interpolationMethodList_return();
+ retval.start = input.LT(1);
+ int interpolationMethodList_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token LBRACE95=null;
+ Token COMMA96=null;
+ Token RBRACE97=null;
+ wcpsParser.interpolationMethod_return e = null;
+
+
+ Object LBRACE95_tree=null;
+ Object COMMA96_tree=null;
+ Object RBRACE97_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 31) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:180:2: ( LBRACE (e= interpolationMethod ( COMMA e= interpolationMethod )* )? RBRACE )
+ // src/petascope/wcps/grammar/wcps.g:180:4: LBRACE (e= interpolationMethod ( COMMA e= interpolationMethod )* )? RBRACE
+ {
+ root_0 = (Object)adaptor.nil();
+
+ LBRACE95=(Token)match(input,LBRACE,FOLLOW_LBRACE_in_interpolationMethodList1758); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LBRACE95_tree = (Object)adaptor.create(LBRACE95);
+ adaptor.addChild(root_0, LBRACE95_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new InterpolationMethodList();
+ }
+ // src/petascope/wcps/grammar/wcps.g:180:53: (e= interpolationMethod ( COMMA e= interpolationMethod )* )?
+ int alt28=2;
+ int LA28_0 = input.LA(1);
+
+ if ( (LA28_0==LPAREN) ) {
+ alt28=1;
+ }
+ switch (alt28) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:180:54: e= interpolationMethod ( COMMA e= interpolationMethod )*
+ {
+ pushFollow(FOLLOW_interpolationMethod_in_interpolationMethodList1765);
+ e=interpolationMethod();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.add((e!=null?e.value:null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:180:102: ( COMMA e= interpolationMethod )*
+ loop27:
+ do {
+ int alt27=2;
+ int LA27_0 = input.LA(1);
+
+ if ( (LA27_0==COMMA) ) {
+ alt27=1;
+ }
+
+
+ switch (alt27) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:180:103: COMMA e= interpolationMethod
+ {
+ COMMA96=(Token)match(input,COMMA,FOLLOW_COMMA_in_interpolationMethodList1770); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA96_tree = (Object)adaptor.create(COMMA96);
+ adaptor.addChild(root_0, COMMA96_tree);
+ }
+ pushFollow(FOLLOW_interpolationMethod_in_interpolationMethodList1774);
+ e=interpolationMethod();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.add((e!=null?e.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop27;
+ }
+ } while (true);
+
+
+ }
+ break;
+
+ }
+
+ RBRACE97=(Token)match(input,RBRACE,FOLLOW_RBRACE_in_interpolationMethodList1782); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RBRACE97_tree = (Object)adaptor.create(RBRACE97);
+ adaptor.addChild(root_0, RBRACE97_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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 31, interpolationMethodList_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "interpolationMethodList"
+
+ public static class rangeExpr_return extends ParserRuleReturnScope {
+ public RangeExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "rangeExpr"
+ // src/petascope/wcps/grammar/wcps.g:182:1: rangeExpr returns [RangeExpr value] : STRUCT LBRACE (field= fieldName COLON expr= scalarExpr ( COMMA field= fieldName COLON expr= scalarExpr )* )? RBRACE ;
+ public final wcpsParser.rangeExpr_return rangeExpr() throws RecognitionException {
+ wcpsParser.rangeExpr_return retval = new wcpsParser.rangeExpr_return();
+ retval.start = input.LT(1);
+ int rangeExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token STRUCT98=null;
+ Token LBRACE99=null;
+ Token COLON100=null;
+ Token COMMA101=null;
+ Token COLON102=null;
+ Token RBRACE103=null;
+ wcpsParser.fieldName_return field = null;
+
+ wcpsParser.scalarExpr_return expr = null;
+
+
+ Object STRUCT98_tree=null;
+ Object LBRACE99_tree=null;
+ Object COLON100_tree=null;
+ Object COMMA101_tree=null;
+ Object COLON102_tree=null;
+ Object RBRACE103_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 32) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:183:2: ( STRUCT LBRACE (field= fieldName COLON expr= scalarExpr ( COMMA field= fieldName COLON expr= scalarExpr )* )? RBRACE )
+ // src/petascope/wcps/grammar/wcps.g:183:4: STRUCT LBRACE (field= fieldName COLON expr= scalarExpr ( COMMA field= fieldName COLON expr= scalarExpr )* )? RBRACE
+ {
+ root_0 = (Object)adaptor.nil();
+
+ STRUCT98=(Token)match(input,STRUCT,FOLLOW_STRUCT_in_rangeExpr1795); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ STRUCT98_tree = (Object)adaptor.create(STRUCT98);
+ adaptor.addChild(root_0, STRUCT98_tree);
+ }
+ LBRACE99=(Token)match(input,LBRACE,FOLLOW_LBRACE_in_rangeExpr1797); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LBRACE99_tree = (Object)adaptor.create(LBRACE99);
+ adaptor.addChild(root_0, LBRACE99_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value =new RangeExpr();
+ }
+ // src/petascope/wcps/grammar/wcps.g:184:2: (field= fieldName COLON expr= scalarExpr ( COMMA field= fieldName COLON expr= scalarExpr )* )?
+ int alt30=2;
+ int LA30_0 = input.LA(1);
+
+ if ( (LA30_0==INTEGERCONSTANT||LA30_0==STRING||LA30_0==NAME) ) {
+ alt30=1;
+ }
+ switch (alt30) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:184:3: field= fieldName COLON expr= scalarExpr ( COMMA field= fieldName COLON expr= scalarExpr )*
+ {
+ pushFollow(FOLLOW_fieldName_in_rangeExpr1805);
+ field=fieldName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, field.getTree());
+ COLON100=(Token)match(input,COLON,FOLLOW_COLON_in_rangeExpr1807); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COLON100_tree = (Object)adaptor.create(COLON100);
+ adaptor.addChild(root_0, COLON100_tree);
+ }
+ pushFollow(FOLLOW_scalarExpr_in_rangeExpr1811);
+ expr=scalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, expr.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.add((field!=null?field.value:null), (expr!=null?expr.value:null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:185:3: ( COMMA field= fieldName COLON expr= scalarExpr )*
+ loop29:
+ do {
+ int alt29=2;
+ int LA29_0 = input.LA(1);
+
+ if ( (LA29_0==COMMA) ) {
+ alt29=1;
+ }
+
+
+ switch (alt29) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:185:4: COMMA field= fieldName COLON expr= scalarExpr
+ {
+ COMMA101=(Token)match(input,COMMA,FOLLOW_COMMA_in_rangeExpr1818); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA101_tree = (Object)adaptor.create(COMMA101);
+ adaptor.addChild(root_0, COMMA101_tree);
+ }
+ pushFollow(FOLLOW_fieldName_in_rangeExpr1822);
+ field=fieldName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, field.getTree());
+ COLON102=(Token)match(input,COLON,FOLLOW_COLON_in_rangeExpr1824); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COLON102_tree = (Object)adaptor.create(COLON102);
+ adaptor.addChild(root_0, COLON102_tree);
+ }
+ pushFollow(FOLLOW_scalarExpr_in_rangeExpr1828);
+ expr=scalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, expr.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.add((field!=null?field.value:null), (expr!=null?expr.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop29;
+ }
+ } while (true);
+
+
+ }
+ break;
+
+ }
+
+ RBRACE103=(Token)match(input,RBRACE,FOLLOW_RBRACE_in_rangeExpr1839); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RBRACE103_tree = (Object)adaptor.create(RBRACE103);
+ adaptor.addChild(root_0, RBRACE103_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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 32, rangeExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "rangeExpr"
+
+ public static class rangeConstructorExpr_return extends ParserRuleReturnScope {
+ public RangeConstructorExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "rangeConstructorExpr"
+ // src/petascope/wcps/grammar/wcps.g:188:1: rangeConstructorExpr returns [RangeConstructorExpr value] : ( STRUCT )? LBRACE field= fieldName COLON expr= coverageExpr ( SEMICOLON field= fieldName COLON expr= coverageExpr )* RBRACE ;
+ public final wcpsParser.rangeConstructorExpr_return rangeConstructorExpr() throws RecognitionException {
+ wcpsParser.rangeConstructorExpr_return retval = new wcpsParser.rangeConstructorExpr_return();
+ retval.start = input.LT(1);
+ int rangeConstructorExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token STRUCT104=null;
+ Token LBRACE105=null;
+ Token COLON106=null;
+ Token SEMICOLON107=null;
+ Token COLON108=null;
+ Token RBRACE109=null;
+ wcpsParser.fieldName_return field = null;
+
+ wcpsParser.coverageExpr_return expr = null;
+
+
+ Object STRUCT104_tree=null;
+ Object LBRACE105_tree=null;
+ Object COLON106_tree=null;
+ Object SEMICOLON107_tree=null;
+ Object COLON108_tree=null;
+ Object RBRACE109_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 33) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:189:5: ( ( STRUCT )? LBRACE field= fieldName COLON expr= coverageExpr ( SEMICOLON field= fieldName COLON expr= coverageExpr )* RBRACE )
+ // src/petascope/wcps/grammar/wcps.g:189:7: ( STRUCT )? LBRACE field= fieldName COLON expr= coverageExpr ( SEMICOLON field= fieldName COLON expr= coverageExpr )* RBRACE
+ {
+ root_0 = (Object)adaptor.nil();
+
+ // src/petascope/wcps/grammar/wcps.g:189:7: ( STRUCT )?
+ int alt31=2;
+ int LA31_0 = input.LA(1);
+
+ if ( (LA31_0==STRUCT) ) {
+ alt31=1;
+ }
+ switch (alt31) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:189:8: STRUCT
+ {
+ STRUCT104=(Token)match(input,STRUCT,FOLLOW_STRUCT_in_rangeConstructorExpr1856); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ STRUCT104_tree = (Object)adaptor.create(STRUCT104);
+ adaptor.addChild(root_0, STRUCT104_tree);
+ }
+
+ }
+ break;
+
+ }
+
+ LBRACE105=(Token)match(input,LBRACE,FOLLOW_LBRACE_in_rangeConstructorExpr1860); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LBRACE105_tree = (Object)adaptor.create(LBRACE105);
+ adaptor.addChild(root_0, LBRACE105_tree);
+ }
+ pushFollow(FOLLOW_fieldName_in_rangeConstructorExpr1864);
+ field=fieldName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, field.getTree());
+ COLON106=(Token)match(input,COLON,FOLLOW_COLON_in_rangeConstructorExpr1866); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COLON106_tree = (Object)adaptor.create(COLON106);
+ adaptor.addChild(root_0, COLON106_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_rangeConstructorExpr1870);
+ expr=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, expr.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new RangeConstructorExpr((field!=null?field.value:null), (expr!=null?expr.value:null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:190:9: ( SEMICOLON field= fieldName COLON expr= coverageExpr )*
+ loop32:
+ do {
+ int alt32=2;
+ int LA32_0 = input.LA(1);
+
+ if ( (LA32_0==SEMICOLON) ) {
+ alt32=1;
+ }
+
+
+ switch (alt32) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:190:10: SEMICOLON field= fieldName COLON expr= coverageExpr
+ {
+ SEMICOLON107=(Token)match(input,SEMICOLON,FOLLOW_SEMICOLON_in_rangeConstructorExpr1883); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ SEMICOLON107_tree = (Object)adaptor.create(SEMICOLON107);
+ adaptor.addChild(root_0, SEMICOLON107_tree);
+ }
+ pushFollow(FOLLOW_fieldName_in_rangeConstructorExpr1887);
+ field=fieldName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, field.getTree());
+ COLON108=(Token)match(input,COLON,FOLLOW_COLON_in_rangeConstructorExpr1889); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COLON108_tree = (Object)adaptor.create(COLON108);
+ adaptor.addChild(root_0, COLON108_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_rangeConstructorExpr1893);
+ expr=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, expr.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.add((field!=null?field.value:null), (expr!=null?expr.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop32;
+ }
+ } while (true);
+
+ RBRACE109=(Token)match(input,RBRACE,FOLLOW_RBRACE_in_rangeConstructorExpr1899); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RBRACE109_tree = (Object)adaptor.create(RBRACE109);
+ adaptor.addChild(root_0, RBRACE109_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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 33, rangeConstructorExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "rangeConstructorExpr"
+
+ public static class crsTransformExpr_return extends ParserRuleReturnScope {
+ public CrsTransformExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "crsTransformExpr"
+ // src/petascope/wcps/grammar/wcps.g:192:1: crsTransformExpr returns [CrsTransformExpr value] : CRSTRANSFORM LPAREN e1= coverageExpr COMMA dcl= dimensionIntervalList COMMA fil= fieldInterpolationList RPAREN ;
+ public final wcpsParser.crsTransformExpr_return crsTransformExpr() throws RecognitionException {
+ wcpsParser.crsTransformExpr_return retval = new wcpsParser.crsTransformExpr_return();
+ retval.start = input.LT(1);
+ int crsTransformExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token CRSTRANSFORM110=null;
+ Token LPAREN111=null;
+ Token COMMA112=null;
+ Token COMMA113=null;
+ Token RPAREN114=null;
+ wcpsParser.coverageExpr_return e1 = null;
+
+ wcpsParser.dimensionIntervalList_return dcl = null;
+
+ wcpsParser.fieldInterpolationList_return fil = null;
+
+
+ Object CRSTRANSFORM110_tree=null;
+ Object LPAREN111_tree=null;
+ Object COMMA112_tree=null;
+ Object COMMA113_tree=null;
+ Object RPAREN114_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 34) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:193:2: ( CRSTRANSFORM LPAREN e1= coverageExpr COMMA dcl= dimensionIntervalList COMMA fil= fieldInterpolationList RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:193:4: CRSTRANSFORM LPAREN e1= coverageExpr COMMA dcl= dimensionIntervalList COMMA fil= fieldInterpolationList RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ CRSTRANSFORM110=(Token)match(input,CRSTRANSFORM,FOLLOW_CRSTRANSFORM_in_crsTransformExpr1915); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ CRSTRANSFORM110_tree = (Object)adaptor.create(CRSTRANSFORM110);
+ adaptor.addChild(root_0, CRSTRANSFORM110_tree);
+ }
+ LPAREN111=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_crsTransformExpr1917); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN111_tree = (Object)adaptor.create(LPAREN111);
+ adaptor.addChild(root_0, LPAREN111_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_crsTransformExpr1921);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ COMMA112=(Token)match(input,COMMA,FOLLOW_COMMA_in_crsTransformExpr1923); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA112_tree = (Object)adaptor.create(COMMA112);
+ adaptor.addChild(root_0, COMMA112_tree);
+ }
+ pushFollow(FOLLOW_dimensionIntervalList_in_crsTransformExpr1927);
+ dcl=dimensionIntervalList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, dcl.getTree());
+ COMMA113=(Token)match(input,COMMA,FOLLOW_COMMA_in_crsTransformExpr1929); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA113_tree = (Object)adaptor.create(COMMA113);
+ adaptor.addChild(root_0, COMMA113_tree);
+ }
+ pushFollow(FOLLOW_fieldInterpolationList_in_crsTransformExpr1933);
+ fil=fieldInterpolationList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, fil.getTree());
+ RPAREN114=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_crsTransformExpr1935); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN114_tree = (Object)adaptor.create(RPAREN114);
+ adaptor.addChild(root_0, RPAREN114_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new CrsTransformExpr((e1!=null?e1.value:null), (dcl!=null?dcl.value:null), (fil!=null?fil.value:null));
+ }
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 34, crsTransformExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "crsTransformExpr"
+
+ public static class fieldInterpolationList_return extends ParserRuleReturnScope {
+ public FieldInterpolationList value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "fieldInterpolationList"
+ // src/petascope/wcps/grammar/wcps.g:196:1: fieldInterpolationList returns [FieldInterpolationList value] : LBRACE elem= fieldInterpolationElement ( COMMA elem= fieldInterpolationElement )* RBRACE ;
+ public final wcpsParser.fieldInterpolationList_return fieldInterpolationList() throws RecognitionException {
+ wcpsParser.fieldInterpolationList_return retval = new wcpsParser.fieldInterpolationList_return();
+ retval.start = input.LT(1);
+ int fieldInterpolationList_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token LBRACE115=null;
+ Token COMMA116=null;
+ Token RBRACE117=null;
+ wcpsParser.fieldInterpolationElement_return elem = null;
+
+
+ Object LBRACE115_tree=null;
+ Object COMMA116_tree=null;
+ Object RBRACE117_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 35) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:197:2: ( LBRACE elem= fieldInterpolationElement ( COMMA elem= fieldInterpolationElement )* RBRACE )
+ // src/petascope/wcps/grammar/wcps.g:197:4: LBRACE elem= fieldInterpolationElement ( COMMA elem= fieldInterpolationElement )* RBRACE
+ {
+ root_0 = (Object)adaptor.nil();
+
+ LBRACE115=(Token)match(input,LBRACE,FOLLOW_LBRACE_in_fieldInterpolationList1952); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LBRACE115_tree = (Object)adaptor.create(LBRACE115);
+ adaptor.addChild(root_0, LBRACE115_tree);
+ }
+ pushFollow(FOLLOW_fieldInterpolationElement_in_fieldInterpolationList1956);
+ elem=fieldInterpolationElement();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, elem.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new FieldInterpolationList((elem!=null?elem.value:null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:198:3: ( COMMA elem= fieldInterpolationElement )*
+ loop33:
+ do {
+ int alt33=2;
+ int LA33_0 = input.LA(1);
+
+ if ( (LA33_0==COMMA) ) {
+ alt33=1;
+ }
+
+
+ switch (alt33) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:198:4: COMMA elem= fieldInterpolationElement
+ {
+ COMMA116=(Token)match(input,COMMA,FOLLOW_COMMA_in_fieldInterpolationList1963); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA116_tree = (Object)adaptor.create(COMMA116);
+ adaptor.addChild(root_0, COMMA116_tree);
+ }
+ pushFollow(FOLLOW_fieldInterpolationElement_in_fieldInterpolationList1967);
+ elem=fieldInterpolationElement();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, elem.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.add((elem!=null?elem.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop33;
+ }
+ } while (true);
+
+ RBRACE117=(Token)match(input,RBRACE,FOLLOW_RBRACE_in_fieldInterpolationList1974); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RBRACE117_tree = (Object)adaptor.create(RBRACE117);
+ adaptor.addChild(root_0, RBRACE117_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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 35, fieldInterpolationList_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "fieldInterpolationList"
+
+ public static class fieldInterpolationElement_return extends ParserRuleReturnScope {
+ public FieldInterpolationElement value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "fieldInterpolationElement"
+ // src/petascope/wcps/grammar/wcps.g:200:1: fieldInterpolationElement returns [FieldInterpolationElement value] : aname= fieldName method= interpolationMethod ;
+ public final wcpsParser.fieldInterpolationElement_return fieldInterpolationElement() throws RecognitionException {
+ wcpsParser.fieldInterpolationElement_return retval = new wcpsParser.fieldInterpolationElement_return();
+ retval.start = input.LT(1);
+ int fieldInterpolationElement_StartIndex = input.index();
+ Object root_0 = null;
+
+ wcpsParser.fieldName_return aname = null;
+
+ wcpsParser.interpolationMethod_return method = null;
+
+
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 36) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:201:2: (aname= fieldName method= interpolationMethod )
+ // src/petascope/wcps/grammar/wcps.g:201:4: aname= fieldName method= interpolationMethod
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_fieldName_in_fieldInterpolationElement1989);
+ aname=fieldName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, aname.getTree());
+ pushFollow(FOLLOW_interpolationMethod_in_fieldInterpolationElement1993);
+ method=interpolationMethod();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, method.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new FieldInterpolationElement((aname!=null?aname.value:null), (method!=null?method.value:null));
+ }
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 36, fieldInterpolationElement_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "fieldInterpolationElement"
+
+ public static class unaryInducedExpr_return extends ParserRuleReturnScope {
+ public CoverageExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "unaryInducedExpr"
+ // src/petascope/wcps/grammar/wcps.g:203:1: unaryInducedExpr returns [CoverageExpr value] : (e6= fieldExpr | e1= unaryArithmeticExpr | e2= exponentialExpr | e3= trigonometricExpr | e4= booleanExpr | e5= castExpr | e7= rangeConstructorExpr );
+ public final wcpsParser.unaryInducedExpr_return unaryInducedExpr() throws RecognitionException {
+ wcpsParser.unaryInducedExpr_return retval = new wcpsParser.unaryInducedExpr_return();
+ retval.start = input.LT(1);
+ int unaryInducedExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ wcpsParser.fieldExpr_return e6 = null;
+
+ wcpsParser.unaryArithmeticExpr_return e1 = null;
+
+ wcpsParser.exponentialExpr_return e2 = null;
+
+ wcpsParser.trigonometricExpr_return e3 = null;
+
+ wcpsParser.booleanExpr_return e4 = null;
+
+ wcpsParser.castExpr_return e5 = null;
+
+ wcpsParser.rangeConstructorExpr_return e7 = null;
+
+
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 37) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:204:5: (e6= fieldExpr | e1= unaryArithmeticExpr | e2= exponentialExpr | e3= trigonometricExpr | e4= booleanExpr | e5= castExpr | e7= rangeConstructorExpr )
+ int alt34=7;
+ alt34 = dfa34.predict(input);
+ switch (alt34) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:204:7: e6= fieldExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_fieldExpr_in_unaryInducedExpr2013);
+ e6=fieldExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e6.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e6!=null?e6.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:205:4: e1= unaryArithmeticExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_unaryArithmeticExpr_in_unaryInducedExpr2022);
+ e1=unaryArithmeticExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+
+ }
+ break;
+ case 3 :
+ // src/petascope/wcps/grammar/wcps.g:206:7: e2= exponentialExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_exponentialExpr_in_unaryInducedExpr2034);
+ e2=exponentialExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+ case 4 :
+ // src/petascope/wcps/grammar/wcps.g:207:7: e3= trigonometricExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_trigonometricExpr_in_unaryInducedExpr2046);
+ e3=trigonometricExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e3.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e3!=null?e3.value:null));
+ }
+
+ }
+ break;
+ case 5 :
+ // src/petascope/wcps/grammar/wcps.g:208:7: e4= booleanExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_booleanExpr_in_unaryInducedExpr2058);
+ e4=booleanExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e4.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e4!=null?e4.value:null));
+ }
+
+ }
+ break;
+ case 6 :
+ // src/petascope/wcps/grammar/wcps.g:209:7: e5= castExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_castExpr_in_unaryInducedExpr2070);
+ e5=castExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e5.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e5!=null?e5.value:null));
+ }
+
+ }
+ break;
+ case 7 :
+ // src/petascope/wcps/grammar/wcps.g:210:7: e7= rangeConstructorExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_rangeConstructorExpr_in_unaryInducedExpr2082);
+ e7=rangeConstructorExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e7.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e7!=null?e7.value:null));
+ }
+
+ }
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 37, unaryInducedExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "unaryInducedExpr"
+
+ public static class unaryArithmeticExpr_return extends ParserRuleReturnScope {
+ public CoverageExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "unaryArithmeticExpr"
+ // src/petascope/wcps/grammar/wcps.g:212:1: unaryArithmeticExpr returns [CoverageExpr value] : (op= ( MINUS | PLUS ) e1= coverageAtom | op= ( SQRT | ABS | RE | IM ) LPAREN e2= coverageExpr RPAREN );
+ public final wcpsParser.unaryArithmeticExpr_return unaryArithmeticExpr() throws RecognitionException {
+ wcpsParser.unaryArithmeticExpr_return retval = new wcpsParser.unaryArithmeticExpr_return();
+ retval.start = input.LT(1);
+ int unaryArithmeticExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ Token LPAREN118=null;
+ Token RPAREN119=null;
+ wcpsParser.coverageAtom_return e1 = null;
+
+ wcpsParser.coverageExpr_return e2 = null;
+
+
+ Object op_tree=null;
+ Object LPAREN118_tree=null;
+ Object RPAREN119_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 38) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:213:5: (op= ( MINUS | PLUS ) e1= coverageAtom | op= ( SQRT | ABS | RE | IM ) LPAREN e2= coverageExpr RPAREN )
+ int alt35=2;
+ int LA35_0 = input.LA(1);
+
+ if ( ((LA35_0>=PLUS && LA35_0<=MINUS)) ) {
+ alt35=1;
+ }
+ else if ( ((LA35_0>=SQRT && LA35_0<=IM)) ) {
+ alt35=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 35, 0, input);
+
+ throw nvae;
+ }
+ switch (alt35) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:213:7: op= ( MINUS | PLUS ) e1= coverageAtom
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=PLUS && input.LA(1)<=MINUS) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_coverageAtom_in_unaryArithmeticExpr2113);
+ e1=coverageAtom();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((op!=null?op.getText():null), (e1!=null?e1.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:214:7: op= ( SQRT | ABS | RE | IM ) LPAREN e2= coverageExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=SQRT && input.LA(1)<=IM) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ LPAREN118=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_unaryArithmeticExpr2135); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN118_tree = (Object)adaptor.create(LPAREN118);
+ adaptor.addChild(root_0, LPAREN118_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_unaryArithmeticExpr2139);
+ e2=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ RPAREN119=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_unaryArithmeticExpr2141); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN119_tree = (Object)adaptor.create(RPAREN119);
+ adaptor.addChild(root_0, RPAREN119_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((op!=null?op.getText():null), (e2!=null?e2.value:null));
+ }
+
+ }
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 38, unaryArithmeticExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "unaryArithmeticExpr"
+
+ public static class exponentialExpr_return extends ParserRuleReturnScope {
+ public ExponentialExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "exponentialExpr"
+ // src/petascope/wcps/grammar/wcps.g:216:1: exponentialExpr returns [ExponentialExpr value] : op= ( EXP | LOG | LN ) LPAREN e1= coverageExpr RPAREN ;
+ public final wcpsParser.exponentialExpr_return exponentialExpr() throws RecognitionException {
+ wcpsParser.exponentialExpr_return retval = new wcpsParser.exponentialExpr_return();
+ retval.start = input.LT(1);
+ int exponentialExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ Token LPAREN120=null;
+ Token RPAREN121=null;
+ wcpsParser.coverageExpr_return e1 = null;
+
+
+ Object op_tree=null;
+ Object LPAREN120_tree=null;
+ Object RPAREN121_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 39) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:217:5: (op= ( EXP | LOG | LN ) LPAREN e1= coverageExpr RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:217:7: op= ( EXP | LOG | LN ) LPAREN e1= coverageExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=EXP && input.LA(1)<=LN) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ LPAREN120=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_exponentialExpr2172); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN120_tree = (Object)adaptor.create(LPAREN120);
+ adaptor.addChild(root_0, LPAREN120_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_exponentialExpr2176);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ RPAREN121=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_exponentialExpr2178); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN121_tree = (Object)adaptor.create(RPAREN121);
+ adaptor.addChild(root_0, RPAREN121_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new ExponentialExpr((op!=null?op.getText():null), (e1!=null?e1.value:null));
+ }
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 39, exponentialExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "exponentialExpr"
+
+ public static class trigonometricExpr_return extends ParserRuleReturnScope {
+ public TrigonometricExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "trigonometricExpr"
+ // src/petascope/wcps/grammar/wcps.g:219:1: trigonometricExpr returns [TrigonometricExpr value] : op= ( SIN | COS | TAN | SINH | COSH | TANH | ARCSIN | ARCCOS | ARCTAN ) LPAREN e1= coverageExpr RPAREN ;
+ public final wcpsParser.trigonometricExpr_return trigonometricExpr() throws RecognitionException {
+ wcpsParser.trigonometricExpr_return retval = new wcpsParser.trigonometricExpr_return();
+ retval.start = input.LT(1);
+ int trigonometricExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ Token LPAREN122=null;
+ Token RPAREN123=null;
+ wcpsParser.coverageExpr_return e1 = null;
+
+
+ Object op_tree=null;
+ Object LPAREN122_tree=null;
+ Object RPAREN123_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 40) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:220:5: (op= ( SIN | COS | TAN | SINH | COSH | TANH | ARCSIN | ARCCOS | ARCTAN ) LPAREN e1= coverageExpr RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:220:7: op= ( SIN | COS | TAN | SINH | COSH | TANH | ARCSIN | ARCCOS | ARCTAN ) LPAREN e1= coverageExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=SIN && input.LA(1)<=ARCTAN) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ LPAREN122=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_trigonometricExpr2221); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN122_tree = (Object)adaptor.create(LPAREN122);
+ adaptor.addChild(root_0, LPAREN122_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_trigonometricExpr2225);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ RPAREN123=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_trigonometricExpr2227); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN123_tree = (Object)adaptor.create(RPAREN123);
+ adaptor.addChild(root_0, RPAREN123_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new TrigonometricExpr((op!=null?op.getText():null), (e1!=null?e1.value:null));
+ }
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 40, trigonometricExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "trigonometricExpr"
+
+ public static class booleanExpr_return extends ParserRuleReturnScope {
+ public BooleanExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "booleanExpr"
+ // src/petascope/wcps/grammar/wcps.g:222:1: booleanExpr returns [BooleanExpr value] : (op= NOT e1= coverageExpr | op= BIT LPAREN e1= coverageExpr COMMA e2= indexExpr RPAREN );
+ public final wcpsParser.booleanExpr_return booleanExpr() throws RecognitionException {
+ wcpsParser.booleanExpr_return retval = new wcpsParser.booleanExpr_return();
+ retval.start = input.LT(1);
+ int booleanExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ Token LPAREN124=null;
+ Token COMMA125=null;
+ Token RPAREN126=null;
+ wcpsParser.coverageExpr_return e1 = null;
+
+ wcpsParser.indexExpr_return e2 = null;
+
+
+ Object op_tree=null;
+ Object LPAREN124_tree=null;
+ Object COMMA125_tree=null;
+ Object RPAREN126_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 41) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:223:5: (op= NOT e1= coverageExpr | op= BIT LPAREN e1= coverageExpr COMMA e2= indexExpr RPAREN )
+ int alt36=2;
+ int LA36_0 = input.LA(1);
+
+ if ( (LA36_0==NOT) ) {
+ alt36=1;
+ }
+ else if ( (LA36_0==BIT) ) {
+ alt36=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 36, 0, input);
+
+ throw nvae;
+ }
+ switch (alt36) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:223:7: op= NOT e1= coverageExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,NOT,FOLLOW_NOT_in_booleanExpr2250); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_booleanExpr2254);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new BooleanExpr((op!=null?op.getText():null), (e1!=null?e1.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:224:7: op= BIT LPAREN e1= coverageExpr COMMA e2= indexExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,BIT,FOLLOW_BIT_in_booleanExpr2266); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN124=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_booleanExpr2268); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN124_tree = (Object)adaptor.create(LPAREN124);
+ adaptor.addChild(root_0, LPAREN124_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_booleanExpr2272);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ COMMA125=(Token)match(input,COMMA,FOLLOW_COMMA_in_booleanExpr2274); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA125_tree = (Object)adaptor.create(COMMA125);
+ adaptor.addChild(root_0, COMMA125_tree);
+ }
+ pushFollow(FOLLOW_indexExpr_in_booleanExpr2278);
+ e2=indexExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ RPAREN126=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_booleanExpr2280); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN126_tree = (Object)adaptor.create(RPAREN126);
+ adaptor.addChild(root_0, RPAREN126_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new BooleanExpr((op!=null?op.getText():null), (e1!=null?e1.value:null), (e2!=null?e2.value:null));
+ }
+
+ }
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 41, booleanExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "booleanExpr"
+
+ public static class indexExpr_return extends ParserRuleReturnScope {
+ public IndexExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "indexExpr"
+ // src/petascope/wcps/grammar/wcps.g:226:1: indexExpr returns [IndexExpr value] : e1= indexTerm (op= ( PLUS | MINUS ) e2= indexTerm )* ;
+ public final wcpsParser.indexExpr_return indexExpr() throws RecognitionException {
+ wcpsParser.indexExpr_return retval = new wcpsParser.indexExpr_return();
+ retval.start = input.LT(1);
+ int indexExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ wcpsParser.indexTerm_return e1 = null;
+
+ wcpsParser.indexTerm_return e2 = null;
+
+
+ Object op_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 42) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:227:5: (e1= indexTerm (op= ( PLUS | MINUS ) e2= indexTerm )* )
+ // src/petascope/wcps/grammar/wcps.g:227:7: e1= indexTerm (op= ( PLUS | MINUS ) e2= indexTerm )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_indexTerm_in_indexExpr2303);
+ e1=indexTerm();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+ // src/petascope/wcps/grammar/wcps.g:228:3: (op= ( PLUS | MINUS ) e2= indexTerm )*
+ loop37:
+ do {
+ int alt37=2;
+ int LA37_0 = input.LA(1);
+
+ if ( ((LA37_0>=PLUS && LA37_0<=MINUS)) ) {
+ alt37=1;
+ }
+
+
+ switch (alt37) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:228:4: op= ( PLUS | MINUS ) e2= indexTerm
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=PLUS && input.LA(1)<=MINUS) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_indexTerm_in_indexExpr2321);
+ e2=indexTerm();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new IndexExpr((op!=null?op.getText():null), retval.value, (e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop37;
+ }
+ } while (true);
+
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 42, indexExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "indexExpr"
+
+ public static class indexTerm_return extends ParserRuleReturnScope {
+ public IndexExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "indexTerm"
+ // src/petascope/wcps/grammar/wcps.g:230:1: indexTerm returns [IndexExpr value] : e1= indexFactor ( (op= ( MULT | DIVIDE ) e2= indexFactor ) )* ;
+ public final wcpsParser.indexTerm_return indexTerm() throws RecognitionException {
+ wcpsParser.indexTerm_return retval = new wcpsParser.indexTerm_return();
+ retval.start = input.LT(1);
+ int indexTerm_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ wcpsParser.indexFactor_return e1 = null;
+
+ wcpsParser.indexFactor_return e2 = null;
+
+
+ Object op_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 43) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:231:5: (e1= indexFactor ( (op= ( MULT | DIVIDE ) e2= indexFactor ) )* )
+ // src/petascope/wcps/grammar/wcps.g:231:7: e1= indexFactor ( (op= ( MULT | DIVIDE ) e2= indexFactor ) )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_indexFactor_in_indexTerm2346);
+ e1=indexFactor();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+ // src/petascope/wcps/grammar/wcps.g:232:6: ( (op= ( MULT | DIVIDE ) e2= indexFactor ) )*
+ loop38:
+ do {
+ int alt38=2;
+ int LA38_0 = input.LA(1);
+
+ if ( ((LA38_0>=MULT && LA38_0<=DIVIDE)) ) {
+ alt38=1;
+ }
+
+
+ switch (alt38) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:232:7: (op= ( MULT | DIVIDE ) e2= indexFactor )
+ {
+ // src/petascope/wcps/grammar/wcps.g:232:7: (op= ( MULT | DIVIDE ) e2= indexFactor )
+ // src/petascope/wcps/grammar/wcps.g:232:8: op= ( MULT | DIVIDE ) e2= indexFactor
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=MULT && input.LA(1)<=DIVIDE) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_indexFactor_in_indexTerm2367);
+ e2=indexFactor();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new IndexExpr((op!=null?op.getText():null), retval.value, (e2!=null?e2.value:null));
+ }
+
+ }
+
+
+ }
+ break;
+
+ default :
+ break loop38;
+ }
+ } while (true);
+
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 43, indexTerm_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "indexTerm"
+
+ public static class indexFactor_return extends ParserRuleReturnScope {
+ public IndexExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "indexFactor"
+ // src/petascope/wcps/grammar/wcps.g:234:1: indexFactor returns [IndexExpr value] : (e= INTEGERCONSTANT | op= ROUND LPAREN e1= numericScalarExpr RPAREN | ( LPAREN e2= indexExpr RPAREN ) );
+ public final wcpsParser.indexFactor_return indexFactor() throws RecognitionException {
+ wcpsParser.indexFactor_return retval = new wcpsParser.indexFactor_return();
+ retval.start = input.LT(1);
+ int indexFactor_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token e=null;
+ Token op=null;
+ Token LPAREN127=null;
+ Token RPAREN128=null;
+ Token LPAREN129=null;
+ Token RPAREN130=null;
+ wcpsParser.numericScalarExpr_return e1 = null;
+
+ wcpsParser.indexExpr_return e2 = null;
+
+
+ Object e_tree=null;
+ Object op_tree=null;
+ Object LPAREN127_tree=null;
+ Object RPAREN128_tree=null;
+ Object LPAREN129_tree=null;
+ Object RPAREN130_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 44) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:235:5: (e= INTEGERCONSTANT | op= ROUND LPAREN e1= numericScalarExpr RPAREN | ( LPAREN e2= indexExpr RPAREN ) )
+ int alt39=3;
+ switch ( input.LA(1) ) {
+ case INTEGERCONSTANT:
+ {
+ alt39=1;
+ }
+ break;
+ case ROUND:
+ {
+ alt39=2;
+ }
+ break;
+ case LPAREN:
+ {
+ alt39=3;
+ }
+ break;
+ default:
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 39, 0, input);
+
+ throw nvae;
+ }
+
+ switch (alt39) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:235:7: e= INTEGERCONSTANT
+ {
+ root_0 = (Object)adaptor.nil();
+
+ e=(Token)match(input,INTEGERCONSTANT,FOLLOW_INTEGERCONSTANT_in_indexFactor2394); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ e_tree = (Object)adaptor.create(e);
+ adaptor.addChild(root_0, e_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new IndexExpr((e!=null?e.getText():null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:236:7: op= ROUND LPAREN e1= numericScalarExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,ROUND,FOLLOW_ROUND_in_indexFactor2407); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN127=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_indexFactor2409); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN127_tree = (Object)adaptor.create(LPAREN127);
+ adaptor.addChild(root_0, LPAREN127_tree);
+ }
+ pushFollow(FOLLOW_numericScalarExpr_in_indexFactor2413);
+ e1=numericScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ RPAREN128=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_indexFactor2415); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN128_tree = (Object)adaptor.create(RPAREN128);
+ adaptor.addChild(root_0, RPAREN128_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new IndexExpr((op!=null?op.getText():null), (e1!=null?e1.value:null));
+ }
+
+ }
+ break;
+ case 3 :
+ // src/petascope/wcps/grammar/wcps.g:237:7: ( LPAREN e2= indexExpr RPAREN )
+ {
+ root_0 = (Object)adaptor.nil();
+
+ // src/petascope/wcps/grammar/wcps.g:237:7: ( LPAREN e2= indexExpr RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:237:8: LPAREN e2= indexExpr RPAREN
+ {
+ LPAREN129=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_indexFactor2427); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN129_tree = (Object)adaptor.create(LPAREN129);
+ adaptor.addChild(root_0, LPAREN129_tree);
+ }
+ pushFollow(FOLLOW_indexExpr_in_indexFactor2431);
+ e2=indexExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ RPAREN130=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_indexFactor2433); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN130_tree = (Object)adaptor.create(RPAREN130);
+ adaptor.addChild(root_0, RPAREN130_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = (e2!=null?e2.value:null);
+ }
+
+ }
+
+
+ }
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 44, indexFactor_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "indexFactor"
+
+ public static class stringScalarExpr_return extends ParserRuleReturnScope {
+ public StringScalarExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "stringScalarExpr"
+ // src/petascope/wcps/grammar/wcps.g:239:1: stringScalarExpr returns [StringScalarExpr value] : (op= IDENTIFIER LPAREN e1= coverageExpr RPAREN | e= STRING );
+ public final wcpsParser.stringScalarExpr_return stringScalarExpr() throws RecognitionException {
+ wcpsParser.stringScalarExpr_return retval = new wcpsParser.stringScalarExpr_return();
+ retval.start = input.LT(1);
+ int stringScalarExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ Token e=null;
+ Token LPAREN131=null;
+ Token RPAREN132=null;
+ wcpsParser.coverageExpr_return e1 = null;
+
+
+ Object op_tree=null;
+ Object e_tree=null;
+ Object LPAREN131_tree=null;
+ Object RPAREN132_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 45) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:241:5: (op= IDENTIFIER LPAREN e1= coverageExpr RPAREN | e= STRING )
+ int alt40=2;
+ int LA40_0 = input.LA(1);
+
+ if ( (LA40_0==IDENTIFIER) ) {
+ alt40=1;
+ }
+ else if ( (LA40_0==STRING) ) {
+ 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 :
+ // src/petascope/wcps/grammar/wcps.g:241:7: op= IDENTIFIER LPAREN e1= coverageExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_stringScalarExpr2460); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN131=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_stringScalarExpr2462); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN131_tree = (Object)adaptor.create(LPAREN131);
+ adaptor.addChild(root_0, LPAREN131_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_stringScalarExpr2466);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ RPAREN132=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_stringScalarExpr2468); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN132_tree = (Object)adaptor.create(RPAREN132);
+ adaptor.addChild(root_0, RPAREN132_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new StringScalarExpr((op!=null?op.getText():null), (e1!=null?e1.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:242:7: e= STRING
+ {
+ root_0 = (Object)adaptor.nil();
+
+ e=(Token)match(input,STRING,FOLLOW_STRING_in_stringScalarExpr2481); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ e_tree = (Object)adaptor.create(e);
+ adaptor.addChild(root_0, e_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new StringScalarExpr((e!=null?e.getText():null));
+ }
+
+ }
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 45, stringScalarExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "stringScalarExpr"
+
+ public static class scaleExpr_return extends ParserRuleReturnScope {
+ public ScaleExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "scaleExpr"
+ // src/petascope/wcps/grammar/wcps.g:244:1: scaleExpr returns [ScaleExpr value] : SCALE LPAREN e1= coverageExpr COMMA dil= dimensionIntervalList ( COMMA fil= fieldInterpolationList )? RPAREN ;
+ public final wcpsParser.scaleExpr_return scaleExpr() throws RecognitionException {
+ wcpsParser.scaleExpr_return retval = new wcpsParser.scaleExpr_return();
+ retval.start = input.LT(1);
+ int scaleExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token SCALE133=null;
+ Token LPAREN134=null;
+ Token COMMA135=null;
+ Token COMMA136=null;
+ Token RPAREN137=null;
+ wcpsParser.coverageExpr_return e1 = null;
+
+ wcpsParser.dimensionIntervalList_return dil = null;
+
+ wcpsParser.fieldInterpolationList_return fil = null;
+
+
+ Object SCALE133_tree=null;
+ Object LPAREN134_tree=null;
+ Object COMMA135_tree=null;
+ Object COMMA136_tree=null;
+ Object RPAREN137_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 46) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:245:2: ( SCALE LPAREN e1= coverageExpr COMMA dil= dimensionIntervalList ( COMMA fil= fieldInterpolationList )? RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:245:4: SCALE LPAREN e1= coverageExpr COMMA dil= dimensionIntervalList ( COMMA fil= fieldInterpolationList )? RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ SCALE133=(Token)match(input,SCALE,FOLLOW_SCALE_in_scaleExpr2499); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ SCALE133_tree = (Object)adaptor.create(SCALE133);
+ adaptor.addChild(root_0, SCALE133_tree);
+ }
+ LPAREN134=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_scaleExpr2501); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN134_tree = (Object)adaptor.create(LPAREN134);
+ adaptor.addChild(root_0, LPAREN134_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_scaleExpr2505);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ COMMA135=(Token)match(input,COMMA,FOLLOW_COMMA_in_scaleExpr2507); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA135_tree = (Object)adaptor.create(COMMA135);
+ adaptor.addChild(root_0, COMMA135_tree);
+ }
+ pushFollow(FOLLOW_dimensionIntervalList_in_scaleExpr2511);
+ dil=dimensionIntervalList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, dil.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new ScaleExpr((e1!=null?e1.value:null), (dil!=null?dil.value:null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:246:13: ( COMMA fil= fieldInterpolationList )?
+ int alt41=2;
+ int LA41_0 = input.LA(1);
+
+ if ( (LA41_0==COMMA) ) {
+ alt41=1;
+ }
+ switch (alt41) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:246:14: COMMA fil= fieldInterpolationList
+ {
+ COMMA136=(Token)match(input,COMMA,FOLLOW_COMMA_in_scaleExpr2528); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA136_tree = (Object)adaptor.create(COMMA136);
+ adaptor.addChild(root_0, COMMA136_tree);
+ }
+ pushFollow(FOLLOW_fieldInterpolationList_in_scaleExpr2532);
+ fil=fieldInterpolationList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, fil.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.addInterpolationList((fil!=null?fil.value:null));
+ }
+
+ }
+ break;
+
+ }
+
+ RPAREN137=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_scaleExpr2557); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN137_tree = (Object)adaptor.create(RPAREN137);
+ adaptor.addChild(root_0, RPAREN137_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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 46, scaleExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "scaleExpr"
+
+ public static class subsetExpr_return extends ParserRuleReturnScope {
+ public SubsetExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "subsetExpr"
+ // src/petascope/wcps/grammar/wcps.g:250:1: subsetExpr returns [SubsetExpr value] : (e1= trimExpr | e2= sliceExpr | e3= extendExpr );
+ public final wcpsParser.subsetExpr_return subsetExpr() throws RecognitionException {
+ wcpsParser.subsetExpr_return retval = new wcpsParser.subsetExpr_return();
+ retval.start = input.LT(1);
+ int subsetExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ wcpsParser.trimExpr_return e1 = null;
+
+ wcpsParser.sliceExpr_return e2 = null;
+
+ wcpsParser.extendExpr_return e3 = null;
+
+
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 47) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:251:2: (e1= trimExpr | e2= sliceExpr | e3= extendExpr )
+ int alt42=3;
+ alt42 = dfa42.predict(input);
+ switch (alt42) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:251:4: e1= trimExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_trimExpr_in_subsetExpr2575);
+ e1=trimExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new SubsetExpr((e1!=null?e1.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:252:4: e2= sliceExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_sliceExpr_in_subsetExpr2584);
+ e2=sliceExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new SubsetExpr((e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+ case 3 :
+ // src/petascope/wcps/grammar/wcps.g:253:4: e3= extendExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_extendExpr_in_subsetExpr2593);
+ e3=extendExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e3.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new SubsetExpr((e3!=null?e3.value:null));
+ }
+
+ }
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 47, subsetExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "subsetExpr"
+
+ public static class trimExpr_return extends ParserRuleReturnScope {
+ public TrimExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "trimExpr"
+ // src/petascope/wcps/grammar/wcps.g:255:1: trimExpr returns [TrimExpr value] : (e1= coverageAtom LBRACKET dil= dimensionIntervalList RBRACKET | TRIM LPAREN e2= coverageExpr COMMA LBRACE dil= dimensionIntervalList RBRACE RPAREN );
+ public final wcpsParser.trimExpr_return trimExpr() throws RecognitionException {
+ wcpsParser.trimExpr_return retval = new wcpsParser.trimExpr_return();
+ retval.start = input.LT(1);
+ int trimExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token LBRACKET138=null;
+ Token RBRACKET139=null;
+ Token TRIM140=null;
+ Token LPAREN141=null;
+ Token COMMA142=null;
+ Token LBRACE143=null;
+ Token RBRACE144=null;
+ Token RPAREN145=null;
+ wcpsParser.coverageAtom_return e1 = null;
+
+ wcpsParser.dimensionIntervalList_return dil = null;
+
+ wcpsParser.coverageExpr_return e2 = null;
+
+
+ Object LBRACKET138_tree=null;
+ Object RBRACKET139_tree=null;
+ Object TRIM140_tree=null;
+ Object LPAREN141_tree=null;
+ Object COMMA142_tree=null;
+ Object LBRACE143_tree=null;
+ Object RBRACE144_tree=null;
+ Object RPAREN145_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 48) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:256:2: (e1= coverageAtom LBRACKET dil= dimensionIntervalList RBRACKET | TRIM LPAREN e2= coverageExpr COMMA LBRACE dil= dimensionIntervalList RBRACE RPAREN )
+ int alt43=2;
+ alt43 = dfa43.predict(input);
+ switch (alt43) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:256:4: e1= coverageAtom LBRACKET dil= dimensionIntervalList RBRACKET
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_coverageAtom_in_trimExpr2610);
+ e1=coverageAtom();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ LBRACKET138=(Token)match(input,LBRACKET,FOLLOW_LBRACKET_in_trimExpr2612); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LBRACKET138_tree = (Object)adaptor.create(LBRACKET138);
+ adaptor.addChild(root_0, LBRACKET138_tree);
+ }
+ pushFollow(FOLLOW_dimensionIntervalList_in_trimExpr2616);
+ dil=dimensionIntervalList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, dil.getTree());
+ RBRACKET139=(Token)match(input,RBRACKET,FOLLOW_RBRACKET_in_trimExpr2618); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RBRACKET139_tree = (Object)adaptor.create(RBRACKET139);
+ adaptor.addChild(root_0, RBRACKET139_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new TrimExpr((e1!=null?e1.value:null), (dil!=null?dil.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:257:6: TRIM LPAREN e2= coverageExpr COMMA LBRACE dil= dimensionIntervalList RBRACE RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ TRIM140=(Token)match(input,TRIM,FOLLOW_TRIM_in_trimExpr2627); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ TRIM140_tree = (Object)adaptor.create(TRIM140);
+ adaptor.addChild(root_0, TRIM140_tree);
+ }
+ LPAREN141=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_trimExpr2629); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN141_tree = (Object)adaptor.create(LPAREN141);
+ adaptor.addChild(root_0, LPAREN141_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_trimExpr2633);
+ e2=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ COMMA142=(Token)match(input,COMMA,FOLLOW_COMMA_in_trimExpr2635); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA142_tree = (Object)adaptor.create(COMMA142);
+ adaptor.addChild(root_0, COMMA142_tree);
+ }
+ LBRACE143=(Token)match(input,LBRACE,FOLLOW_LBRACE_in_trimExpr2637); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LBRACE143_tree = (Object)adaptor.create(LBRACE143);
+ adaptor.addChild(root_0, LBRACE143_tree);
+ }
+ pushFollow(FOLLOW_dimensionIntervalList_in_trimExpr2641);
+ dil=dimensionIntervalList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, dil.getTree());
+ RBRACE144=(Token)match(input,RBRACE,FOLLOW_RBRACE_in_trimExpr2643); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RBRACE144_tree = (Object)adaptor.create(RBRACE144);
+ adaptor.addChild(root_0, RBRACE144_tree);
+ }
+ RPAREN145=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_trimExpr2645); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN145_tree = (Object)adaptor.create(RPAREN145);
+ adaptor.addChild(root_0, RPAREN145_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new TrimExpr((e2!=null?e2.value:null), (dil!=null?dil.value:null));
+ }
+
+ }
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 48, trimExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "trimExpr"
+
+ public static class sliceExpr_return extends ParserRuleReturnScope {
+ public SliceExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "sliceExpr"
+ // src/petascope/wcps/grammar/wcps.g:259:1: sliceExpr returns [SliceExpr value] : (e1= coverageAtom LBRACKET dpl= dimensionPointList RBRACKET | SLICE LPAREN e2= coverageExpr COMMA LBRACE dpl= dimensionPointList RBRACE RPAREN );
+ public final wcpsParser.sliceExpr_return sliceExpr() throws RecognitionException {
+ wcpsParser.sliceExpr_return retval = new wcpsParser.sliceExpr_return();
+ retval.start = input.LT(1);
+ int sliceExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token LBRACKET146=null;
+ Token RBRACKET147=null;
+ Token SLICE148=null;
+ Token LPAREN149=null;
+ Token COMMA150=null;
+ Token LBRACE151=null;
+ Token RBRACE152=null;
+ Token RPAREN153=null;
+ wcpsParser.coverageAtom_return e1 = null;
+
+ wcpsParser.dimensionPointList_return dpl = null;
+
+ wcpsParser.coverageExpr_return e2 = null;
+
+
+ Object LBRACKET146_tree=null;
+ Object RBRACKET147_tree=null;
+ Object SLICE148_tree=null;
+ Object LPAREN149_tree=null;
+ Object COMMA150_tree=null;
+ Object LBRACE151_tree=null;
+ Object RBRACE152_tree=null;
+ Object RPAREN153_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 49) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:260:2: (e1= coverageAtom LBRACKET dpl= dimensionPointList RBRACKET | SLICE LPAREN e2= coverageExpr COMMA LBRACE dpl= dimensionPointList RBRACE RPAREN )
+ int alt44=2;
+ alt44 = dfa44.predict(input);
+ switch (alt44) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:260:4: e1= coverageAtom LBRACKET dpl= dimensionPointList RBRACKET
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_coverageAtom_in_sliceExpr2662);
+ e1=coverageAtom();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ LBRACKET146=(Token)match(input,LBRACKET,FOLLOW_LBRACKET_in_sliceExpr2664); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LBRACKET146_tree = (Object)adaptor.create(LBRACKET146);
+ adaptor.addChild(root_0, LBRACKET146_tree);
+ }
+ pushFollow(FOLLOW_dimensionPointList_in_sliceExpr2668);
+ dpl=dimensionPointList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, dpl.getTree());
+ RBRACKET147=(Token)match(input,RBRACKET,FOLLOW_RBRACKET_in_sliceExpr2670); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RBRACKET147_tree = (Object)adaptor.create(RBRACKET147);
+ adaptor.addChild(root_0, RBRACKET147_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new SliceExpr((e1!=null?e1.value:null), (dpl!=null?dpl.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:261:4: SLICE LPAREN e2= coverageExpr COMMA LBRACE dpl= dimensionPointList RBRACE RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ SLICE148=(Token)match(input,SLICE,FOLLOW_SLICE_in_sliceExpr2677); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ SLICE148_tree = (Object)adaptor.create(SLICE148);
+ adaptor.addChild(root_0, SLICE148_tree);
+ }
+ LPAREN149=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_sliceExpr2679); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN149_tree = (Object)adaptor.create(LPAREN149);
+ adaptor.addChild(root_0, LPAREN149_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_sliceExpr2683);
+ e2=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ COMMA150=(Token)match(input,COMMA,FOLLOW_COMMA_in_sliceExpr2685); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA150_tree = (Object)adaptor.create(COMMA150);
+ adaptor.addChild(root_0, COMMA150_tree);
+ }
+ LBRACE151=(Token)match(input,LBRACE,FOLLOW_LBRACE_in_sliceExpr2687); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LBRACE151_tree = (Object)adaptor.create(LBRACE151);
+ adaptor.addChild(root_0, LBRACE151_tree);
+ }
+ pushFollow(FOLLOW_dimensionPointList_in_sliceExpr2691);
+ dpl=dimensionPointList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, dpl.getTree());
+ RBRACE152=(Token)match(input,RBRACE,FOLLOW_RBRACE_in_sliceExpr2693); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RBRACE152_tree = (Object)adaptor.create(RBRACE152);
+ adaptor.addChild(root_0, RBRACE152_tree);
+ }
+ RPAREN153=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_sliceExpr2695); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN153_tree = (Object)adaptor.create(RPAREN153);
+ adaptor.addChild(root_0, RPAREN153_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new SliceExpr((e2!=null?e2.value:null), (dpl!=null?dpl.value:null));
+ }
+
+ }
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 49, sliceExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "sliceExpr"
+
+ public static class extendExpr_return extends ParserRuleReturnScope {
+ public ExtendExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "extendExpr"
+ // src/petascope/wcps/grammar/wcps.g:263:1: extendExpr returns [ExtendExpr value] : EXTEND LPAREN e1= coverageExpr COMMA dil= dimensionIntervalList RPAREN ;
+ public final wcpsParser.extendExpr_return extendExpr() throws RecognitionException {
+ wcpsParser.extendExpr_return retval = new wcpsParser.extendExpr_return();
+ retval.start = input.LT(1);
+ int extendExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token EXTEND154=null;
+ Token LPAREN155=null;
+ Token COMMA156=null;
+ Token RPAREN157=null;
+ wcpsParser.coverageExpr_return e1 = null;
+
+ wcpsParser.dimensionIntervalList_return dil = null;
+
+
+ Object EXTEND154_tree=null;
+ Object LPAREN155_tree=null;
+ Object COMMA156_tree=null;
+ Object RPAREN157_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 50) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:264:2: ( EXTEND LPAREN e1= coverageExpr COMMA dil= dimensionIntervalList RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:264:4: EXTEND LPAREN e1= coverageExpr COMMA dil= dimensionIntervalList RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ EXTEND154=(Token)match(input,EXTEND,FOLLOW_EXTEND_in_extendExpr2710); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ EXTEND154_tree = (Object)adaptor.create(EXTEND154);
+ adaptor.addChild(root_0, EXTEND154_tree);
+ }
+ LPAREN155=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_extendExpr2712); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN155_tree = (Object)adaptor.create(LPAREN155);
+ adaptor.addChild(root_0, LPAREN155_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_extendExpr2716);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ COMMA156=(Token)match(input,COMMA,FOLLOW_COMMA_in_extendExpr2718); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA156_tree = (Object)adaptor.create(COMMA156);
+ adaptor.addChild(root_0, COMMA156_tree);
+ }
+ pushFollow(FOLLOW_dimensionIntervalList_in_extendExpr2722);
+ dil=dimensionIntervalList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, dil.getTree());
+ RPAREN157=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_extendExpr2724); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN157_tree = (Object)adaptor.create(RPAREN157);
+ adaptor.addChild(root_0, RPAREN157_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new ExtendExpr((e1!=null?e1.value:null), (dil!=null?dil.value:null));
+ }
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 50, extendExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "extendExpr"
+
+ public static class castExpr_return extends ParserRuleReturnScope {
+ public CastExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "castExpr"
+ // src/petascope/wcps/grammar/wcps.g:266:1: castExpr returns [CastExpr value] : LPAREN e1= rangeType RPAREN e2= coverageExpr ;
+ public final wcpsParser.castExpr_return castExpr() throws RecognitionException {
+ wcpsParser.castExpr_return retval = new wcpsParser.castExpr_return();
+ retval.start = input.LT(1);
+ int castExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token LPAREN158=null;
+ Token RPAREN159=null;
+ wcpsParser.rangeType_return e1 = null;
+
+ wcpsParser.coverageExpr_return e2 = null;
+
+
+ Object LPAREN158_tree=null;
+ Object RPAREN159_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 51) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:267:5: ( LPAREN e1= rangeType RPAREN e2= coverageExpr )
+ // src/petascope/wcps/grammar/wcps.g:267:7: LPAREN e1= rangeType RPAREN e2= coverageExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ LPAREN158=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_castExpr2742); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN158_tree = (Object)adaptor.create(LPAREN158);
+ adaptor.addChild(root_0, LPAREN158_tree);
+ }
+ pushFollow(FOLLOW_rangeType_in_castExpr2746);
+ e1=rangeType();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ RPAREN159=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_castExpr2748); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN159_tree = (Object)adaptor.create(RPAREN159);
+ adaptor.addChild(root_0, RPAREN159_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_castExpr2752);
+ e2=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CastExpr((e2!=null?e2.value:null), (e1!=null?e1.value:null));
+ }
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 51, castExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "castExpr"
+
+ public static class rangeType_return extends ParserRuleReturnScope {
+ public String value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "rangeType"
+ // src/petascope/wcps/grammar/wcps.g:269:1: rangeType returns [String value] : (type= ( BOOLEAN | CHAR | SHORT | LONG | FLOAT | DOUBLE | COMPLEX | COMPLEX2 ) | UNSIGNED type= ( CHAR | SHORT | LONG ) );
+ public final wcpsParser.rangeType_return rangeType() throws RecognitionException {
+ wcpsParser.rangeType_return retval = new wcpsParser.rangeType_return();
+ retval.start = input.LT(1);
+ int rangeType_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token type=null;
+ Token UNSIGNED160=null;
+
+ Object type_tree=null;
+ Object UNSIGNED160_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 52) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:270:5: (type= ( BOOLEAN | CHAR | SHORT | LONG | FLOAT | DOUBLE | COMPLEX | COMPLEX2 ) | UNSIGNED type= ( CHAR | SHORT | LONG ) )
+ int alt45=2;
+ int LA45_0 = input.LA(1);
+
+ if ( ((LA45_0>=BOOLEAN && LA45_0<=COMPLEX2)) ) {
+ alt45=1;
+ }
+ else if ( (LA45_0==UNSIGNED) ) {
+ alt45=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 45, 0, input);
+
+ throw nvae;
+ }
+ switch (alt45) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:270:7: type= ( BOOLEAN | CHAR | SHORT | LONG | FLOAT | DOUBLE | COMPLEX | COMPLEX2 )
+ {
+ root_0 = (Object)adaptor.nil();
+
+ type=(Token)input.LT(1);
+ if ( (input.LA(1)>=BOOLEAN && input.LA(1)<=COMPLEX2) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(type));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ if ( state.backtracking==0 ) {
+ retval.value = new String((type!=null?type.getText():null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:271:7: UNSIGNED type= ( CHAR | SHORT | LONG )
+ {
+ root_0 = (Object)adaptor.nil();
+
+ UNSIGNED160=(Token)match(input,UNSIGNED,FOLLOW_UNSIGNED_in_rangeType2801); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ UNSIGNED160_tree = (Object)adaptor.create(UNSIGNED160);
+ adaptor.addChild(root_0, UNSIGNED160_tree);
+ }
+ type=(Token)input.LT(1);
+ if ( (input.LA(1)>=CHAR && input.LA(1)<=LONG) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(type));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ if ( state.backtracking==0 ) {
+ retval.value = new String("unsigned " + (type!=null?type.getText():null));
+ }
+
+ }
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 52, rangeType_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "rangeType"
+
+ public static class fieldExpr_return extends ParserRuleReturnScope {
+ public SelectExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "fieldExpr"
+ // src/petascope/wcps/grammar/wcps.g:273:1: fieldExpr returns [SelectExpr value] : e1= coverageAtom DOT e2= fieldName ;
+ public final wcpsParser.fieldExpr_return fieldExpr() throws RecognitionException {
+ wcpsParser.fieldExpr_return retval = new wcpsParser.fieldExpr_return();
+ retval.start = input.LT(1);
+ int fieldExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token DOT161=null;
+ wcpsParser.coverageAtom_return e1 = null;
+
+ wcpsParser.fieldName_return e2 = null;
+
+
+ Object DOT161_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 53) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:274:5: (e1= coverageAtom DOT e2= fieldName )
+ // src/petascope/wcps/grammar/wcps.g:274:7: e1= coverageAtom DOT e2= fieldName
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_coverageAtom_in_fieldExpr2834);
+ e1=coverageAtom();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ DOT161=(Token)match(input,DOT,FOLLOW_DOT_in_fieldExpr2836); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ DOT161_tree = (Object)adaptor.create(DOT161);
+ adaptor.addChild(root_0, DOT161_tree);
+ }
+ pushFollow(FOLLOW_fieldName_in_fieldExpr2840);
+ e2=fieldName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new SelectExpr((e1!=null?e1.value:null), (e2!=null?e2.value:null));
+ }
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 53, fieldExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "fieldExpr"
+
+ public static class booleanScalarExpr_return extends ParserRuleReturnScope {
+ public BooleanScalarExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "booleanScalarExpr"
+ // src/petascope/wcps/grammar/wcps.g:278:1: booleanScalarExpr returns [BooleanScalarExpr value] : e1= booleanScalarTerm (op= ( OR | XOR ) e2= booleanScalarTerm )* ;
+ public final wcpsParser.booleanScalarExpr_return booleanScalarExpr() throws RecognitionException {
+ wcpsParser.booleanScalarExpr_return retval = new wcpsParser.booleanScalarExpr_return();
+ retval.start = input.LT(1);
+ int booleanScalarExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ wcpsParser.booleanScalarTerm_return e1 = null;
+
+ wcpsParser.booleanScalarTerm_return e2 = null;
+
+
+ Object op_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 54) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:279:5: (e1= booleanScalarTerm (op= ( OR | XOR ) e2= booleanScalarTerm )* )
+ // src/petascope/wcps/grammar/wcps.g:279:7: e1= booleanScalarTerm (op= ( OR | XOR ) e2= booleanScalarTerm )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_booleanScalarTerm_in_booleanScalarExpr2865);
+ e1=booleanScalarTerm();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+ // src/petascope/wcps/grammar/wcps.g:280:7: (op= ( OR | XOR ) e2= booleanScalarTerm )*
+ loop46:
+ do {
+ int alt46=2;
+ alt46 = dfa46.predict(input);
+ switch (alt46) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:280:8: op= ( OR | XOR ) e2= booleanScalarTerm
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=OR && input.LA(1)<=XOR) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_booleanScalarTerm_in_booleanScalarExpr2886);
+ e2=booleanScalarTerm();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new BooleanScalarExpr((op!=null?op.getText():null), retval.value, (e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop46;
+ }
+ } while (true);
+
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 54, booleanScalarExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "booleanScalarExpr"
+
+ public static class booleanScalarTerm_return extends ParserRuleReturnScope {
+ public BooleanScalarExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "booleanScalarTerm"
+ // src/petascope/wcps/grammar/wcps.g:282:1: booleanScalarTerm returns [BooleanScalarExpr value] : e1= booleanScalarNegation (op= AND e2= booleanScalarNegation )* ;
+ public final wcpsParser.booleanScalarTerm_return booleanScalarTerm() throws RecognitionException {
+ wcpsParser.booleanScalarTerm_return retval = new wcpsParser.booleanScalarTerm_return();
+ retval.start = input.LT(1);
+ int booleanScalarTerm_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ wcpsParser.booleanScalarNegation_return e1 = null;
+
+ wcpsParser.booleanScalarNegation_return e2 = null;
+
+
+ Object op_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 55) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:283:2: (e1= booleanScalarNegation (op= AND e2= booleanScalarNegation )* )
+ // src/petascope/wcps/grammar/wcps.g:283:4: e1= booleanScalarNegation (op= AND e2= booleanScalarNegation )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_booleanScalarNegation_in_booleanScalarTerm2908);
+ e1=booleanScalarNegation();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+ // src/petascope/wcps/grammar/wcps.g:284:4: (op= AND e2= booleanScalarNegation )*
+ loop47:
+ do {
+ int alt47=2;
+ alt47 = dfa47.predict(input);
+ switch (alt47) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:284:5: op= AND e2= booleanScalarNegation
+ {
+ op=(Token)match(input,AND,FOLLOW_AND_in_booleanScalarTerm2918); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ pushFollow(FOLLOW_booleanScalarNegation_in_booleanScalarTerm2922);
+ e2=booleanScalarNegation();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new BooleanScalarExpr((op!=null?op.getText():null), retval.value, (e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop47;
+ }
+ } while (true);
+
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 55, booleanScalarTerm_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "booleanScalarTerm"
+
+ public static class booleanScalarNegation_return extends ParserRuleReturnScope {
+ public BooleanScalarExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "booleanScalarNegation"
+ // src/petascope/wcps/grammar/wcps.g:286:1: booleanScalarNegation returns [BooleanScalarExpr value] : (e1= booleanScalarAtom | op= NOT e1= booleanScalarAtom );
+ public final wcpsParser.booleanScalarNegation_return booleanScalarNegation() throws RecognitionException {
+ wcpsParser.booleanScalarNegation_return retval = new wcpsParser.booleanScalarNegation_return();
+ retval.start = input.LT(1);
+ int booleanScalarNegation_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ wcpsParser.booleanScalarAtom_return e1 = null;
+
+
+ Object op_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 56) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:287:2: (e1= booleanScalarAtom | op= NOT e1= booleanScalarAtom )
+ int alt48=2;
+ alt48 = dfa48.predict(input);
+ switch (alt48) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:287:4: e1= booleanScalarAtom
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_booleanScalarAtom_in_booleanScalarNegation2943);
+ e1=booleanScalarAtom();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:288:4: op= NOT e1= booleanScalarAtom
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,NOT,FOLLOW_NOT_in_booleanScalarNegation2952); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ pushFollow(FOLLOW_booleanScalarAtom_in_booleanScalarNegation2956);
+ e1=booleanScalarAtom();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new BooleanScalarExpr((op!=null?op.getText():null), (e1!=null?e1.value:null));
+ }
+
+ }
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 56, booleanScalarNegation_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "booleanScalarNegation"
+
+ public static class booleanScalarAtom_return extends ParserRuleReturnScope {
+ public BooleanScalarExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "booleanScalarAtom"
+ // src/petascope/wcps/grammar/wcps.g:290:1: booleanScalarAtom returns [BooleanScalarExpr value] : ( LPAREN e1= booleanScalarExpr RPAREN | s1= stringScalarExpr cop= compOp s2= stringScalarExpr | n1= numericScalarExpr cop= compOp n2= numericScalarExpr | e= BOOLEANCONSTANT );
+ public final wcpsParser.booleanScalarAtom_return booleanScalarAtom() throws RecognitionException {
+ wcpsParser.booleanScalarAtom_return retval = new wcpsParser.booleanScalarAtom_return();
+ retval.start = input.LT(1);
+ int booleanScalarAtom_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token e=null;
+ Token LPAREN162=null;
+ Token RPAREN163=null;
+ wcpsParser.booleanScalarExpr_return e1 = null;
+
+ wcpsParser.stringScalarExpr_return s1 = null;
+
+ wcpsParser.compOp_return cop = null;
+
+ wcpsParser.stringScalarExpr_return s2 = null;
+
+ wcpsParser.numericScalarExpr_return n1 = null;
+
+ wcpsParser.numericScalarExpr_return n2 = null;
+
+
+ Object e_tree=null;
+ Object LPAREN162_tree=null;
+ Object RPAREN163_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 57) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:291:2: ( LPAREN e1= booleanScalarExpr RPAREN | s1= stringScalarExpr cop= compOp s2= stringScalarExpr | n1= numericScalarExpr cop= compOp n2= numericScalarExpr | e= BOOLEANCONSTANT )
+ int alt49=4;
+ alt49 = dfa49.predict(input);
+ switch (alt49) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:291:4: LPAREN e1= booleanScalarExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ LPAREN162=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_booleanScalarAtom2971); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN162_tree = (Object)adaptor.create(LPAREN162);
+ adaptor.addChild(root_0, LPAREN162_tree);
+ }
+ pushFollow(FOLLOW_booleanScalarExpr_in_booleanScalarAtom2975);
+ e1=booleanScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ RPAREN163=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_booleanScalarAtom2977); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN163_tree = (Object)adaptor.create(RPAREN163);
+ adaptor.addChild(root_0, RPAREN163_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:292:4: s1= stringScalarExpr cop= compOp s2= stringScalarExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_stringScalarExpr_in_booleanScalarAtom2986);
+ s1=stringScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, s1.getTree());
+ pushFollow(FOLLOW_compOp_in_booleanScalarAtom2990);
+ cop=compOp();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, cop.getTree());
+ pushFollow(FOLLOW_stringScalarExpr_in_booleanScalarAtom2994);
+ s2=stringScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, s2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new BooleanScalarExpr((cop!=null?cop.value:null), (s1!=null?s1.value:null), (s2!=null?s2.value:null));
+ }
+
+ }
+ break;
+ case 3 :
+ // src/petascope/wcps/grammar/wcps.g:293:4: n1= numericScalarExpr cop= compOp n2= numericScalarExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_numericScalarExpr_in_booleanScalarAtom3004);
+ n1=numericScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, n1.getTree());
+ pushFollow(FOLLOW_compOp_in_booleanScalarAtom3008);
+ cop=compOp();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, cop.getTree());
+ pushFollow(FOLLOW_numericScalarExpr_in_booleanScalarAtom3012);
+ n2=numericScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, n2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new BooleanScalarExpr((cop!=null?cop.value:null), (n1!=null?n1.value:null), (n2!=null?n2.value:null));
+ }
+
+ }
+ break;
+ case 4 :
+ // src/petascope/wcps/grammar/wcps.g:294:4: e= BOOLEANCONSTANT
+ {
+ root_0 = (Object)adaptor.nil();
+
+ e=(Token)match(input,BOOLEANCONSTANT,FOLLOW_BOOLEANCONSTANT_in_booleanScalarAtom3022); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ e_tree = (Object)adaptor.create(e);
+ adaptor.addChild(root_0, e_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new BooleanScalarExpr((e!=null?e.getText():null));
+ }
+
+ }
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 57, booleanScalarAtom_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "booleanScalarAtom"
+
+ public static class numericScalarExpr_return extends ParserRuleReturnScope {
+ public NumericScalarExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "numericScalarExpr"
+ // src/petascope/wcps/grammar/wcps.g:296:1: numericScalarExpr returns [NumericScalarExpr value] : e1= numericScalarTerm (op= ( PLUS | MINUS ) e2= numericScalarTerm )* ;
+ public final wcpsParser.numericScalarExpr_return numericScalarExpr() throws RecognitionException {
+ wcpsParser.numericScalarExpr_return retval = new wcpsParser.numericScalarExpr_return();
+ retval.start = input.LT(1);
+ int numericScalarExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ wcpsParser.numericScalarTerm_return e1 = null;
+
+ wcpsParser.numericScalarTerm_return e2 = null;
+
+
+ Object op_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 58) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:297:2: (e1= numericScalarTerm (op= ( PLUS | MINUS ) e2= numericScalarTerm )* )
+ // src/petascope/wcps/grammar/wcps.g:297:4: e1= numericScalarTerm (op= ( PLUS | MINUS ) e2= numericScalarTerm )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_numericScalarTerm_in_numericScalarExpr3039);
+ e1=numericScalarTerm();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+ // src/petascope/wcps/grammar/wcps.g:298:4: (op= ( PLUS | MINUS ) e2= numericScalarTerm )*
+ loop50:
+ do {
+ int alt50=2;
+ alt50 = dfa50.predict(input);
+ switch (alt50) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:298:5: op= ( PLUS | MINUS ) e2= numericScalarTerm
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=PLUS && input.LA(1)<=MINUS) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_numericScalarTerm_in_numericScalarExpr3057);
+ e2=numericScalarTerm();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new NumericScalarExpr((op!=null?op.getText():null), retval.value, (e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop50;
+ }
+ } while (true);
+
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 58, numericScalarExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "numericScalarExpr"
+
+ public static class numericScalarTerm_return extends ParserRuleReturnScope {
+ public NumericScalarExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "numericScalarTerm"
+ // src/petascope/wcps/grammar/wcps.g:300:1: numericScalarTerm returns [NumericScalarExpr value] : e1= numericScalarFactor (op= ( MULT | DIVIDE ) e2= numericScalarFactor )* ;
+ public final wcpsParser.numericScalarTerm_return numericScalarTerm() throws RecognitionException {
+ wcpsParser.numericScalarTerm_return retval = new wcpsParser.numericScalarTerm_return();
+ retval.start = input.LT(1);
+ int numericScalarTerm_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ wcpsParser.numericScalarFactor_return e1 = null;
+
+ wcpsParser.numericScalarFactor_return e2 = null;
+
+
+ Object op_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 59) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:301:2: (e1= numericScalarFactor (op= ( MULT | DIVIDE ) e2= numericScalarFactor )* )
+ // src/petascope/wcps/grammar/wcps.g:301:4: e1= numericScalarFactor (op= ( MULT | DIVIDE ) e2= numericScalarFactor )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_numericScalarFactor_in_numericScalarTerm3076);
+ e1=numericScalarFactor();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+ // src/petascope/wcps/grammar/wcps.g:302:3: (op= ( MULT | DIVIDE ) e2= numericScalarFactor )*
+ loop51:
+ do {
+ int alt51=2;
+ alt51 = dfa51.predict(input);
+ switch (alt51) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:302:4: op= ( MULT | DIVIDE ) e2= numericScalarFactor
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=MULT && input.LA(1)<=DIVIDE) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_numericScalarFactor_in_numericScalarTerm3093);
+ e2=numericScalarFactor();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new NumericScalarExpr((op!=null?op.getText():null), retval.value, (e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop51;
+ }
+ } while (true);
+
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 59, numericScalarTerm_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "numericScalarTerm"
+
+ public static class numericScalarFactor_return extends ParserRuleReturnScope {
+ public NumericScalarExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "numericScalarFactor"
+ // src/petascope/wcps/grammar/wcps.g:304:1: numericScalarFactor returns [NumericScalarExpr value] : ( LPAREN e1= numericScalarExpr RPAREN | op= MINUS e10= numericScalarFactor | op= ABS LPAREN e12= numericScalarExpr RPAREN | op= SQRT LPAREN e11= numericScalarExpr RPAREN | op= ROUND LPAREN e1= numericScalarExpr RPAREN | e= INTEGERCONSTANT | e= FLOATCONSTANT | e2= complexConstant | e3= condenseExpr | e4= variableName );
+ public final wcpsParser.numericScalarFactor_return numericScalarFactor() throws RecognitionException {
+ wcpsParser.numericScalarFactor_return retval = new wcpsParser.numericScalarFactor_return();
+ retval.start = input.LT(1);
+ int numericScalarFactor_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ Token e=null;
+ Token LPAREN164=null;
+ Token RPAREN165=null;
+ Token LPAREN166=null;
+ Token RPAREN167=null;
+ Token LPAREN168=null;
+ Token RPAREN169=null;
+ Token LPAREN170=null;
+ Token RPAREN171=null;
+ wcpsParser.numericScalarExpr_return e1 = null;
+
+ wcpsParser.numericScalarFactor_return e10 = null;
+
+ wcpsParser.numericScalarExpr_return e12 = null;
+
+ wcpsParser.numericScalarExpr_return e11 = null;
+
+ wcpsParser.complexConstant_return e2 = null;
+
+ wcpsParser.condenseExpr_return e3 = null;
+
+ wcpsParser.variableName_return e4 = null;
+
+
+ Object op_tree=null;
+ Object e_tree=null;
+ Object LPAREN164_tree=null;
+ Object RPAREN165_tree=null;
+ Object LPAREN166_tree=null;
+ Object RPAREN167_tree=null;
+ Object LPAREN168_tree=null;
+ Object RPAREN169_tree=null;
+ Object LPAREN170_tree=null;
+ Object RPAREN171_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 60) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:305:5: ( LPAREN e1= numericScalarExpr RPAREN | op= MINUS e10= numericScalarFactor | op= ABS LPAREN e12= numericScalarExpr RPAREN | op= SQRT LPAREN e11= numericScalarExpr RPAREN | op= ROUND LPAREN e1= numericScalarExpr RPAREN | e= INTEGERCONSTANT | e= FLOATCONSTANT | e2= complexConstant | e3= condenseExpr | e4= variableName )
+ int alt52=10;
+ alt52 = dfa52.predict(input);
+ switch (alt52) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:305:7: LPAREN e1= numericScalarExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ LPAREN164=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_numericScalarFactor3113); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN164_tree = (Object)adaptor.create(LPAREN164);
+ adaptor.addChild(root_0, LPAREN164_tree);
+ }
+ pushFollow(FOLLOW_numericScalarExpr_in_numericScalarFactor3117);
+ e1=numericScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ RPAREN165=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_numericScalarFactor3119); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN165_tree = (Object)adaptor.create(RPAREN165);
+ adaptor.addChild(root_0, RPAREN165_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:306:7: op= MINUS e10= numericScalarFactor
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,MINUS,FOLLOW_MINUS_in_numericScalarFactor3131); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ pushFollow(FOLLOW_numericScalarFactor_in_numericScalarFactor3135);
+ e10=numericScalarFactor();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e10.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new NumericScalarExpr((op!=null?op.getText():null), (e10!=null?e10.value:null));
+ }
+
+ }
+ break;
+ case 3 :
+ // src/petascope/wcps/grammar/wcps.g:307:7: op= ABS LPAREN e12= numericScalarExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,ABS,FOLLOW_ABS_in_numericScalarFactor3147); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN166=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_numericScalarFactor3149); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN166_tree = (Object)adaptor.create(LPAREN166);
+ adaptor.addChild(root_0, LPAREN166_tree);
+ }
+ pushFollow(FOLLOW_numericScalarExpr_in_numericScalarFactor3153);
+ e12=numericScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e12.getTree());
+ RPAREN167=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_numericScalarFactor3155); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN167_tree = (Object)adaptor.create(RPAREN167);
+ adaptor.addChild(root_0, RPAREN167_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new NumericScalarExpr((op!=null?op.getText():null), (e12!=null?e12.value:null));
+ }
+
+ }
+ break;
+ case 4 :
+ // src/petascope/wcps/grammar/wcps.g:308:7: op= SQRT LPAREN e11= numericScalarExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,SQRT,FOLLOW_SQRT_in_numericScalarFactor3167); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN168=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_numericScalarFactor3169); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN168_tree = (Object)adaptor.create(LPAREN168);
+ adaptor.addChild(root_0, LPAREN168_tree);
+ }
+ pushFollow(FOLLOW_numericScalarExpr_in_numericScalarFactor3173);
+ e11=numericScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e11.getTree());
+ RPAREN169=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_numericScalarFactor3175); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN169_tree = (Object)adaptor.create(RPAREN169);
+ adaptor.addChild(root_0, RPAREN169_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new NumericScalarExpr((op!=null?op.getText():null), (e11!=null?e11.value:null));
+ }
+
+ }
+ break;
+ case 5 :
+ // src/petascope/wcps/grammar/wcps.g:309:7: op= ROUND LPAREN e1= numericScalarExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,ROUND,FOLLOW_ROUND_in_numericScalarFactor3187); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN170=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_numericScalarFactor3189); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN170_tree = (Object)adaptor.create(LPAREN170);
+ adaptor.addChild(root_0, LPAREN170_tree);
+ }
+ pushFollow(FOLLOW_numericScalarExpr_in_numericScalarFactor3193);
+ e1=numericScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ RPAREN171=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_numericScalarFactor3195); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN171_tree = (Object)adaptor.create(RPAREN171);
+ adaptor.addChild(root_0, RPAREN171_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new NumericScalarExpr((op!=null?op.getText():null), (e1!=null?e1.value:null));
+ }
+
+ }
+ break;
+ case 6 :
+ // src/petascope/wcps/grammar/wcps.g:310:7: e= INTEGERCONSTANT
+ {
+ root_0 = (Object)adaptor.nil();
+
+ e=(Token)match(input,INTEGERCONSTANT,FOLLOW_INTEGERCONSTANT_in_numericScalarFactor3207); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ e_tree = (Object)adaptor.create(e);
+ adaptor.addChild(root_0, e_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new NumericScalarExpr((e!=null?e.getText():null));
+ }
+
+ }
+ break;
+ case 7 :
+ // src/petascope/wcps/grammar/wcps.g:311:7: e= FLOATCONSTANT
+ {
+ root_0 = (Object)adaptor.nil();
+
+ e=(Token)match(input,FLOATCONSTANT,FOLLOW_FLOATCONSTANT_in_numericScalarFactor3219); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ e_tree = (Object)adaptor.create(e);
+ adaptor.addChild(root_0, e_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new NumericScalarExpr((e!=null?e.getText():null));
+ }
+
+ }
+ break;
+ case 8 :
+ // src/petascope/wcps/grammar/wcps.g:312:7: e2= complexConstant
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_complexConstant_in_numericScalarFactor3231);
+ e2=complexConstant();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new NumericScalarExpr((e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+ case 9 :
+ // src/petascope/wcps/grammar/wcps.g:313:7: e3= condenseExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_condenseExpr_in_numericScalarFactor3243);
+ e3=condenseExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e3.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new NumericScalarExpr((e3!=null?e3.value:null));
+ }
+
+ }
+ break;
+ case 10 :
+ // src/petascope/wcps/grammar/wcps.g:314:7: e4= variableName
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_variableName_in_numericScalarFactor3255);
+ e4=variableName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e4.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new NumericScalarExpr("var", (e4!=null?e4.value:null));
+ }
+
+ }
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 60, numericScalarFactor_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "numericScalarFactor"
+
+ public static class compOp_return extends ParserRuleReturnScope {
+ public String value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "compOp"
+ // src/petascope/wcps/grammar/wcps.g:316:1: compOp returns [String value] : ( EQUALS | NOTEQUALS | LT | GT | LTE | GTE );
+ public final wcpsParser.compOp_return compOp() throws RecognitionException {
+ wcpsParser.compOp_return retval = new wcpsParser.compOp_return();
+ retval.start = input.LT(1);
+ int compOp_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token EQUALS172=null;
+ Token NOTEQUALS173=null;
+ Token LT174=null;
+ Token GT175=null;
+ Token LTE176=null;
+ Token GTE177=null;
+
+ Object EQUALS172_tree=null;
+ Object NOTEQUALS173_tree=null;
+ Object LT174_tree=null;
+ Object GT175_tree=null;
+ Object LTE176_tree=null;
+ Object GTE177_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 61) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:317:2: ( EQUALS | NOTEQUALS | LT | GT | LTE | GTE )
+ int alt53=6;
+ switch ( input.LA(1) ) {
+ case EQUALS:
+ {
+ alt53=1;
+ }
+ break;
+ case NOTEQUALS:
+ {
+ alt53=2;
+ }
+ break;
+ case LT:
+ {
+ alt53=3;
+ }
+ break;
+ case GT:
+ {
+ alt53=4;
+ }
+ break;
+ case LTE:
+ {
+ alt53=5;
+ }
+ break;
+ case GTE:
+ {
+ alt53=6;
+ }
+ break;
+ default:
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 53, 0, input);
+
+ throw nvae;
+ }
+
+ switch (alt53) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:317:4: EQUALS
+ {
+ root_0 = (Object)adaptor.nil();
+
+ EQUALS172=(Token)match(input,EQUALS,FOLLOW_EQUALS_in_compOp3273); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ EQUALS172_tree = (Object)adaptor.create(EQUALS172);
+ adaptor.addChild(root_0, EQUALS172_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new String("equals");
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:318:4: NOTEQUALS
+ {
+ root_0 = (Object)adaptor.nil();
+
+ NOTEQUALS173=(Token)match(input,NOTEQUALS,FOLLOW_NOTEQUALS_in_compOp3280); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ NOTEQUALS173_tree = (Object)adaptor.create(NOTEQUALS173);
+ adaptor.addChild(root_0, NOTEQUALS173_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new String("notEqual");
+ }
+
+ }
+ break;
+ case 3 :
+ // src/petascope/wcps/grammar/wcps.g:319:4: LT
+ {
+ root_0 = (Object)adaptor.nil();
+
+ LT174=(Token)match(input,LT,FOLLOW_LT_in_compOp3287); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LT174_tree = (Object)adaptor.create(LT174);
+ adaptor.addChild(root_0, LT174_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new String("lessThan");
+ }
+
+ }
+ break;
+ case 4 :
+ // src/petascope/wcps/grammar/wcps.g:320:4: GT
+ {
+ root_0 = (Object)adaptor.nil();
+
+ GT175=(Token)match(input,GT,FOLLOW_GT_in_compOp3294); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ GT175_tree = (Object)adaptor.create(GT175);
+ adaptor.addChild(root_0, GT175_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new String("greaterThan");
+ }
+
+ }
+ break;
+ case 5 :
+ // src/petascope/wcps/grammar/wcps.g:321:4: LTE
+ {
+ root_0 = (Object)adaptor.nil();
+
+ LTE176=(Token)match(input,LTE,FOLLOW_LTE_in_compOp3301); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LTE176_tree = (Object)adaptor.create(LTE176);
+ adaptor.addChild(root_0, LTE176_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new String("lessOrEqual");
+ }
+
+ }
+ break;
+ case 6 :
+ // src/petascope/wcps/grammar/wcps.g:322:4: GTE
+ {
+ root_0 = (Object)adaptor.nil();
+
+ GTE177=(Token)match(input,GTE,FOLLOW_GTE_in_compOp3308); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ GTE177_tree = (Object)adaptor.create(GTE177);
+ adaptor.addChild(root_0, GTE177_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new String("greaterOrEqual");
+ }
+
+ }
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 61, compOp_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "compOp"
+
+ public static class dimensionIntervalList_return extends ParserRuleReturnScope {
+ public DimensionIntervalList value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "dimensionIntervalList"
+ // src/petascope/wcps/grammar/wcps.g:324:1: dimensionIntervalList returns [DimensionIntervalList value] : elem= dimensionIntervalElement ( COMMA elem= dimensionIntervalElement )* ;
+ public final wcpsParser.dimensionIntervalList_return dimensionIntervalList() throws RecognitionException {
+ wcpsParser.dimensionIntervalList_return retval = new wcpsParser.dimensionIntervalList_return();
+ retval.start = input.LT(1);
+ int dimensionIntervalList_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token COMMA178=null;
+ wcpsParser.dimensionIntervalElement_return elem = null;
+
+
+ Object COMMA178_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 62) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:325:5: (elem= dimensionIntervalElement ( COMMA elem= dimensionIntervalElement )* )
+ // src/petascope/wcps/grammar/wcps.g:325:7: elem= dimensionIntervalElement ( COMMA elem= dimensionIntervalElement )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_dimensionIntervalElement_in_dimensionIntervalList3328);
+ elem=dimensionIntervalElement();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, elem.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new DimensionIntervalList((elem!=null?elem.value:null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:326:9: ( COMMA elem= dimensionIntervalElement )*
+ loop54:
+ do {
+ int alt54=2;
+ int LA54_0 = input.LA(1);
+
+ if ( (LA54_0==COMMA) ) {
+ int LA54_1 = input.LA(2);
+
+ if ( (LA54_1==INTEGERCONSTANT||LA54_1==STRING||LA54_1==NAME) ) {
+ alt54=1;
+ }
+
+
+ }
+
+
+ switch (alt54) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:326:10: COMMA elem= dimensionIntervalElement
+ {
+ COMMA178=(Token)match(input,COMMA,FOLLOW_COMMA_in_dimensionIntervalList3341); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA178_tree = (Object)adaptor.create(COMMA178);
+ adaptor.addChild(root_0, COMMA178_tree);
+ }
+ pushFollow(FOLLOW_dimensionIntervalElement_in_dimensionIntervalList3345);
+ elem=dimensionIntervalElement();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, elem.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.add((elem!=null?elem.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop54;
+ }
+ } while (true);
+
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 62, dimensionIntervalList_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "dimensionIntervalList"
+
+ public static class dimensionIntervalElement_return extends ParserRuleReturnScope {
+ public DimensionIntervalElement value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "dimensionIntervalElement"
+ // src/petascope/wcps/grammar/wcps.g:328:1: dimensionIntervalElement returns [DimensionIntervalElement value] : aname= axisName ( COLON crs= crsName )? LPAREN die= dimensionIntervalExpr RPAREN ;
+ public final wcpsParser.dimensionIntervalElement_return dimensionIntervalElement() throws RecognitionException {
+ wcpsParser.dimensionIntervalElement_return retval = new wcpsParser.dimensionIntervalElement_return();
+ retval.start = input.LT(1);
+ int dimensionIntervalElement_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token COLON179=null;
+ Token LPAREN180=null;
+ Token RPAREN181=null;
+ wcpsParser.axisName_return aname = null;
+
+ wcpsParser.crsName_return crs = null;
+
+ wcpsParser.dimensionIntervalExpr_return die = null;
+
+
+ Object COLON179_tree=null;
+ Object LPAREN180_tree=null;
+ Object RPAREN181_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 63) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:329:5: (aname= axisName ( COLON crs= crsName )? LPAREN die= dimensionIntervalExpr RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:329:7: aname= axisName ( COLON crs= crsName )? LPAREN die= dimensionIntervalExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_axisName_in_dimensionIntervalElement3370);
+ aname=axisName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, aname.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new DimensionIntervalElement((aname!=null?aname.value:null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:329:79: ( COLON crs= crsName )?
+ int alt55=2;
+ int LA55_0 = input.LA(1);
+
+ if ( (LA55_0==COLON) ) {
+ alt55=1;
+ }
+ switch (alt55) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:329:80: COLON crs= crsName
+ {
+ COLON179=(Token)match(input,COLON,FOLLOW_COLON_in_dimensionIntervalElement3375); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COLON179_tree = (Object)adaptor.create(COLON179);
+ adaptor.addChild(root_0, COLON179_tree);
+ }
+ pushFollow(FOLLOW_crsName_in_dimensionIntervalElement3379);
+ crs=crsName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, crs.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.setCrs((crs!=null?crs.value:null));
+ }
+
+ }
+ break;
+
+ }
+
+ LPAREN180=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_dimensionIntervalElement3390); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN180_tree = (Object)adaptor.create(LPAREN180);
+ adaptor.addChild(root_0, LPAREN180_tree);
+ }
+ pushFollow(FOLLOW_dimensionIntervalExpr_in_dimensionIntervalElement3394);
+ die=dimensionIntervalExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, die.getTree());
+ RPAREN181=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_dimensionIntervalElement3396); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN181_tree = (Object)adaptor.create(RPAREN181);
+ adaptor.addChild(root_0, RPAREN181_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value.setIntervalExpr((die!=null?die.value:null));
+ }
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 63, dimensionIntervalElement_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "dimensionIntervalElement"
+
+ public static class dimensionIntervalExpr_return extends ParserRuleReturnScope {
+ public DimensionIntervalExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "dimensionIntervalExpr"
+ // src/petascope/wcps/grammar/wcps.g:332:1: dimensionIntervalExpr returns [DimensionIntervalExpr value] : (e1= scalarExpr COLON e2= scalarExpr | DOMAIN LPAREN e3= coverageName COLON e4= axisName COLON e5= crsName RPAREN );
+ public final wcpsParser.dimensionIntervalExpr_return dimensionIntervalExpr() throws RecognitionException {
+ wcpsParser.dimensionIntervalExpr_return retval = new wcpsParser.dimensionIntervalExpr_return();
+ retval.start = input.LT(1);
+ int dimensionIntervalExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token COLON182=null;
+ Token DOMAIN183=null;
+ Token LPAREN184=null;
+ Token COLON185=null;
+ Token COLON186=null;
+ Token RPAREN187=null;
+ wcpsParser.scalarExpr_return e1 = null;
+
+ wcpsParser.scalarExpr_return e2 = null;
+
+ wcpsParser.coverageName_return e3 = null;
+
+ wcpsParser.axisName_return e4 = null;
+
+ wcpsParser.crsName_return e5 = null;
+
+
+ Object COLON182_tree=null;
+ Object DOMAIN183_tree=null;
+ Object LPAREN184_tree=null;
+ Object COLON185_tree=null;
+ Object COLON186_tree=null;
+ Object RPAREN187_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 64) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:333:5: (e1= scalarExpr COLON e2= scalarExpr | DOMAIN LPAREN e3= coverageName COLON e4= axisName COLON e5= crsName RPAREN )
+ int alt56=2;
+ alt56 = dfa56.predict(input);
+ switch (alt56) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:333:7: e1= scalarExpr COLON e2= scalarExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_scalarExpr_in_dimensionIntervalExpr3419);
+ e1=scalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ COLON182=(Token)match(input,COLON,FOLLOW_COLON_in_dimensionIntervalExpr3421); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COLON182_tree = (Object)adaptor.create(COLON182);
+ adaptor.addChild(root_0, COLON182_tree);
+ }
+ pushFollow(FOLLOW_scalarExpr_in_dimensionIntervalExpr3425);
+ e2=scalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new DimensionIntervalExpr((e1!=null?e1.value:null), (e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:334:7: DOMAIN LPAREN e3= coverageName COLON e4= axisName COLON e5= crsName RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ DOMAIN183=(Token)match(input,DOMAIN,FOLLOW_DOMAIN_in_dimensionIntervalExpr3435); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ DOMAIN183_tree = (Object)adaptor.create(DOMAIN183);
+ adaptor.addChild(root_0, DOMAIN183_tree);
+ }
+ LPAREN184=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_dimensionIntervalExpr3437); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN184_tree = (Object)adaptor.create(LPAREN184);
+ adaptor.addChild(root_0, LPAREN184_tree);
+ }
+ pushFollow(FOLLOW_coverageName_in_dimensionIntervalExpr3441);
+ e3=coverageName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e3.getTree());
+ COLON185=(Token)match(input,COLON,FOLLOW_COLON_in_dimensionIntervalExpr3443); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COLON185_tree = (Object)adaptor.create(COLON185);
+ adaptor.addChild(root_0, COLON185_tree);
+ }
+ pushFollow(FOLLOW_axisName_in_dimensionIntervalExpr3447);
+ e4=axisName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e4.getTree());
+ COLON186=(Token)match(input,COLON,FOLLOW_COLON_in_dimensionIntervalExpr3449); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COLON186_tree = (Object)adaptor.create(COLON186);
+ adaptor.addChild(root_0, COLON186_tree);
+ }
+ pushFollow(FOLLOW_crsName_in_dimensionIntervalExpr3453);
+ e5=crsName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e5.getTree());
+ RPAREN187=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_dimensionIntervalExpr3455); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN187_tree = (Object)adaptor.create(RPAREN187);
+ adaptor.addChild(root_0, RPAREN187_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new DimensionIntervalExpr((e3!=null?e3.value:null), (e4!=null?e4.value:null), (e5!=null?e5.value:null));
+ }
+
+ }
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 64, dimensionIntervalExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "dimensionIntervalExpr"
+
+ public static class dimensionPointList_return extends ParserRuleReturnScope {
+ public DimensionPointList value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "dimensionPointList"
+ // src/petascope/wcps/grammar/wcps.g:336:1: dimensionPointList returns [DimensionPointList value] : elem1= dimensionPointElement ( COMMA elem2= dimensionPointElement )* ;
+ public final wcpsParser.dimensionPointList_return dimensionPointList() throws RecognitionException {
+ wcpsParser.dimensionPointList_return retval = new wcpsParser.dimensionPointList_return();
+ retval.start = input.LT(1);
+ int dimensionPointList_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token COMMA188=null;
+ wcpsParser.dimensionPointElement_return elem1 = null;
+
+ wcpsParser.dimensionPointElement_return elem2 = null;
+
+
+ Object COMMA188_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 65) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:337:5: (elem1= dimensionPointElement ( COMMA elem2= dimensionPointElement )* )
+ // src/petascope/wcps/grammar/wcps.g:337:7: elem1= dimensionPointElement ( COMMA elem2= dimensionPointElement )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_dimensionPointElement_in_dimensionPointList3478);
+ elem1=dimensionPointElement();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, elem1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new DimensionPointList((elem1!=null?elem1.value:null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:338:6: ( COMMA elem2= dimensionPointElement )*
+ loop57:
+ do {
+ int alt57=2;
+ int LA57_0 = input.LA(1);
+
+ if ( (LA57_0==COMMA) ) {
+ alt57=1;
+ }
+
+
+ switch (alt57) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:338:7: COMMA elem2= dimensionPointElement
+ {
+ COMMA188=(Token)match(input,COMMA,FOLLOW_COMMA_in_dimensionPointList3488); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA188_tree = (Object)adaptor.create(COMMA188);
+ adaptor.addChild(root_0, COMMA188_tree);
+ }
+ pushFollow(FOLLOW_dimensionPointElement_in_dimensionPointList3492);
+ elem2=dimensionPointElement();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, elem2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.add((elem2!=null?elem2.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop57;
+ }
+ } while (true);
+
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 65, dimensionPointList_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "dimensionPointList"
+
+ public static class dimensionPointElement_return extends ParserRuleReturnScope {
+ public DimensionPointElement value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "dimensionPointElement"
+ // src/petascope/wcps/grammar/wcps.g:340:1: dimensionPointElement returns [DimensionPointElement value] : (aname= axisName LPAREN dpe= dimensionPoint RPAREN | aname= axisName COLON crs= crsName LPAREN dpe= dimensionPoint RPAREN );
+ public final wcpsParser.dimensionPointElement_return dimensionPointElement() throws RecognitionException {
+ wcpsParser.dimensionPointElement_return retval = new wcpsParser.dimensionPointElement_return();
+ retval.start = input.LT(1);
+ int dimensionPointElement_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token LPAREN189=null;
+ Token RPAREN190=null;
+ Token COLON191=null;
+ Token LPAREN192=null;
+ Token RPAREN193=null;
+ wcpsParser.axisName_return aname = null;
+
+ wcpsParser.dimensionPoint_return dpe = null;
+
+ wcpsParser.crsName_return crs = null;
+
+
+ Object LPAREN189_tree=null;
+ Object RPAREN190_tree=null;
+ Object COLON191_tree=null;
+ Object LPAREN192_tree=null;
+ Object RPAREN193_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 66) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:341:5: (aname= axisName LPAREN dpe= dimensionPoint RPAREN | aname= axisName COLON crs= crsName LPAREN dpe= dimensionPoint RPAREN )
+ int alt58=2;
+ int LA58_0 = input.LA(1);
+
+ if ( (LA58_0==INTEGERCONSTANT||LA58_0==STRING||LA58_0==NAME) ) {
+ int LA58_1 = input.LA(2);
+
+ if ( (LA58_1==LPAREN) ) {
+ alt58=1;
+ }
+ else if ( (LA58_1==COLON) ) {
+ alt58=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 58, 1, input);
+
+ throw nvae;
+ }
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 58, 0, input);
+
+ throw nvae;
+ }
+ switch (alt58) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:341:7: aname= axisName LPAREN dpe= dimensionPoint RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_axisName_in_dimensionPointElement3517);
+ aname=axisName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, aname.getTree());
+ LPAREN189=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_dimensionPointElement3519); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN189_tree = (Object)adaptor.create(LPAREN189);
+ adaptor.addChild(root_0, LPAREN189_tree);
+ }
+ pushFollow(FOLLOW_dimensionPoint_in_dimensionPointElement3523);
+ dpe=dimensionPoint();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, dpe.getTree());
+ RPAREN190=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_dimensionPointElement3525); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN190_tree = (Object)adaptor.create(RPAREN190);
+ adaptor.addChild(root_0, RPAREN190_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new DimensionPointElement((aname!=null?aname.value:null), (dpe!=null?dpe.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:342:7: aname= axisName COLON crs= crsName LPAREN dpe= dimensionPoint RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_axisName_in_dimensionPointElement3537);
+ aname=axisName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, aname.getTree());
+ COLON191=(Token)match(input,COLON,FOLLOW_COLON_in_dimensionPointElement3539); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COLON191_tree = (Object)adaptor.create(COLON191);
+ adaptor.addChild(root_0, COLON191_tree);
+ }
+ pushFollow(FOLLOW_crsName_in_dimensionPointElement3543);
+ crs=crsName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, crs.getTree());
+ LPAREN192=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_dimensionPointElement3545); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN192_tree = (Object)adaptor.create(LPAREN192);
+ adaptor.addChild(root_0, LPAREN192_tree);
+ }
+ pushFollow(FOLLOW_dimensionPoint_in_dimensionPointElement3549);
+ dpe=dimensionPoint();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, dpe.getTree());
+ RPAREN193=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_dimensionPointElement3551); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN193_tree = (Object)adaptor.create(RPAREN193);
+ adaptor.addChild(root_0, RPAREN193_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new DimensionPointElement((aname!=null?aname.value:null), (crs!=null?crs.value:null), (dpe!=null?dpe.value:null));
+ }
+
+ }
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 66, dimensionPointElement_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "dimensionPointElement"
+
+ public static class dimensionPoint_return extends ParserRuleReturnScope {
+ public ScalarExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "dimensionPoint"
+ // src/petascope/wcps/grammar/wcps.g:344:1: dimensionPoint returns [ScalarExpr value] : e1= scalarExpr ;
+ public final wcpsParser.dimensionPoint_return dimensionPoint() throws RecognitionException {
+ wcpsParser.dimensionPoint_return retval = new wcpsParser.dimensionPoint_return();
+ retval.start = input.LT(1);
+ int dimensionPoint_StartIndex = input.index();
+ Object root_0 = null;
+
+ wcpsParser.scalarExpr_return e1 = null;
+
+
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 67) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:345:5: (e1= scalarExpr )
+ // src/petascope/wcps/grammar/wcps.g:345:7: e1= scalarExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_scalarExpr_in_dimensionPoint3574);
+ e1=scalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 67, dimensionPoint_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "dimensionPoint"
+
+ public static class interpolationMethod_return extends ParserRuleReturnScope {
+ public InterpolationMethod value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "interpolationMethod"
+ // src/petascope/wcps/grammar/wcps.g:347:1: interpolationMethod returns [InterpolationMethod value] : LPAREN type= interpolationType COLON res= nullResistence RPAREN ;
+ public final wcpsParser.interpolationMethod_return interpolationMethod() throws RecognitionException {
+ wcpsParser.interpolationMethod_return retval = new wcpsParser.interpolationMethod_return();
+ retval.start = input.LT(1);
+ int interpolationMethod_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token LPAREN194=null;
+ Token COLON195=null;
+ Token RPAREN196=null;
+ wcpsParser.interpolationType_return type = null;
+
+ wcpsParser.nullResistence_return res = null;
+
+
+ Object LPAREN194_tree=null;
+ Object COLON195_tree=null;
+ Object RPAREN196_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 68) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:348:2: ( LPAREN type= interpolationType COLON res= nullResistence RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:348:4: LPAREN type= interpolationType COLON res= nullResistence RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ LPAREN194=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_interpolationMethod3592); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN194_tree = (Object)adaptor.create(LPAREN194);
+ adaptor.addChild(root_0, LPAREN194_tree);
+ }
+ pushFollow(FOLLOW_interpolationType_in_interpolationMethod3596);
+ type=interpolationType();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, type.getTree());
+ COLON195=(Token)match(input,COLON,FOLLOW_COLON_in_interpolationMethod3598); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COLON195_tree = (Object)adaptor.create(COLON195);
+ adaptor.addChild(root_0, COLON195_tree);
+ }
+ pushFollow(FOLLOW_nullResistence_in_interpolationMethod3602);
+ res=nullResistence();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, res.getTree());
+ RPAREN196=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_interpolationMethod3604); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN196_tree = (Object)adaptor.create(RPAREN196);
+ adaptor.addChild(root_0, RPAREN196_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new InterpolationMethod((type!=null?type.value:null), (res!=null?res.value:null));
+ }
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 68, interpolationMethod_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "interpolationMethod"
+
+ public static class interpolationType_return extends ParserRuleReturnScope {
+ public String value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "interpolationType"
+ // src/petascope/wcps/grammar/wcps.g:350:1: interpolationType returns [String value] : type= ( NEAREST | LINEAR | QUADRATIC | CUBIC ) ;
+ public final wcpsParser.interpolationType_return interpolationType() throws RecognitionException {
+ wcpsParser.interpolationType_return retval = new wcpsParser.interpolationType_return();
+ retval.start = input.LT(1);
+ int interpolationType_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token type=null;
+
+ Object type_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 69) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:351:2: (type= ( NEAREST | LINEAR | QUADRATIC | CUBIC ) )
+ // src/petascope/wcps/grammar/wcps.g:351:4: type= ( NEAREST | LINEAR | QUADRATIC | CUBIC )
+ {
+ root_0 = (Object)adaptor.nil();
+
+ type=(Token)input.LT(1);
+ if ( (input.LA(1)>=NEAREST && input.LA(1)<=CUBIC) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(type));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ if ( state.backtracking==0 ) {
+ retval.value = new String((type!=null?type.getText():null));
+ }
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 69, interpolationType_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "interpolationType"
+
+ public static class nullResistence_return extends ParserRuleReturnScope {
+ public String value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "nullResistence"
+ // src/petascope/wcps/grammar/wcps.g:353:1: nullResistence returns [String value] : resistance= ( FULL | NONE | HALF | OTHER ) ;
+ public final wcpsParser.nullResistence_return nullResistence() throws RecognitionException {
+ wcpsParser.nullResistence_return retval = new wcpsParser.nullResistence_return();
+ retval.start = input.LT(1);
+ int nullResistence_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token resistance=null;
+
+ Object resistance_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 70) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:354:2: (resistance= ( FULL | NONE | HALF | OTHER ) )
+ // src/petascope/wcps/grammar/wcps.g:354:4: resistance= ( FULL | NONE | HALF | OTHER )
+ {
+ root_0 = (Object)adaptor.nil();
+
+ resistance=(Token)input.LT(1);
+ if ( (input.LA(1)>=FULL && input.LA(1)<=OTHER) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(resistance));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ if ( state.backtracking==0 ) {
+ retval.value = new String((resistance!=null?resistance.getText():null));
+ }
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 70, nullResistence_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "nullResistence"
+
+ public static class condenseOpType_return extends ParserRuleReturnScope {
+ public CondenseOperation value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "condenseOpType"
+ // src/petascope/wcps/grammar/wcps.g:356:1: condenseOpType returns [CondenseOperation value] : op= ( PLUS | MULT | MAX | MIN | AND | OR ) ;
+ public final wcpsParser.condenseOpType_return condenseOpType() throws RecognitionException {
+ wcpsParser.condenseOpType_return retval = new wcpsParser.condenseOpType_return();
+ retval.start = input.LT(1);
+ int condenseOpType_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+
+ Object op_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 71) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:357:2: (op= ( PLUS | MULT | MAX | MIN | AND | OR ) )
+ // src/petascope/wcps/grammar/wcps.g:357:4: op= ( PLUS | MULT | MAX | MIN | AND | OR )
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)input.LT(1);
+ if ( input.LA(1)==OR||input.LA(1)==AND||input.LA(1)==PLUS||input.LA(1)==MULT||(input.LA(1)>=MIN && input.LA(1)<=MAX) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ if ( state.backtracking==0 ) {
+ retval.value = new CondenseOperation((op!=null?op.getText():null));
+ }
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 71, condenseOpType_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "condenseOpType"
+
+ public static class fieldName_return extends ParserRuleReturnScope {
+ public String value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "fieldName"
+ // src/petascope/wcps/grammar/wcps.g:359:1: fieldName returns [String value] : name ;
+ public final wcpsParser.fieldName_return fieldName() throws RecognitionException {
+ wcpsParser.fieldName_return retval = new wcpsParser.fieldName_return();
+ retval.start = input.LT(1);
+ int fieldName_StartIndex = input.index();
+ Object root_0 = null;
+
+ wcpsParser.name_return name197 = null;
+
+
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 72) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:360:2: ( name )
+ // src/petascope/wcps/grammar/wcps.g:360:4: name
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_name_in_fieldName3698);
+ name197=name();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, name197.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new String((name197!=null?name197.value:null));
+ }
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 72, fieldName_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "fieldName"
+
+ public static class constant_return extends ParserRuleReturnScope {
+ public String value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "constant"
+ // src/petascope/wcps/grammar/wcps.g:362:1: constant returns [String value] : (e= ( STRING | BOOLEANCONSTANT | INTEGERCONSTANT | FLOATCONSTANT ) | e1= complexConstant );
+ public final wcpsParser.constant_return constant() throws RecognitionException {
+ wcpsParser.constant_return retval = new wcpsParser.constant_return();
+ retval.start = input.LT(1);
+ int constant_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token e=null;
+ wcpsParser.complexConstant_return e1 = null;
+
+
+ Object e_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 73) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:363:2: (e= ( STRING | BOOLEANCONSTANT | INTEGERCONSTANT | FLOATCONSTANT ) | e1= complexConstant )
+ int alt59=2;
+ int LA59_0 = input.LA(1);
+
+ if ( (LA59_0==INTEGERCONSTANT||LA59_0==STRING||(LA59_0>=BOOLEANCONSTANT && LA59_0<=FLOATCONSTANT)) ) {
+ alt59=1;
+ }
+ else if ( (LA59_0==LPAREN) ) {
+ alt59=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 59, 0, input);
+
+ throw nvae;
+ }
+ switch (alt59) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:363:4: e= ( STRING | BOOLEANCONSTANT | INTEGERCONSTANT | FLOATCONSTANT )
+ {
+ root_0 = (Object)adaptor.nil();
+
+ e=(Token)input.LT(1);
+ if ( input.LA(1)==INTEGERCONSTANT||input.LA(1)==STRING||(input.LA(1)>=BOOLEANCONSTANT && input.LA(1)<=FLOATCONSTANT) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(e));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ if ( state.backtracking==0 ) {
+ retval.value = (e!=null?e.getText():null);
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:364:4: e1= complexConstant
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_complexConstant_in_constant3732);
+ e1=complexConstant();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+
+ }
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 73, constant_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "constant"
+
+ public static class complexConstant_return extends ParserRuleReturnScope {
+ public String value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "complexConstant"
+ // src/petascope/wcps/grammar/wcps.g:366:1: complexConstant returns [String value] : LPAREN re1= FLOATCONSTANT COMMA im1= FLOATCONSTANT RPAREN ;
+ public final wcpsParser.complexConstant_return complexConstant() throws RecognitionException {
+ wcpsParser.complexConstant_return retval = new wcpsParser.complexConstant_return();
+ retval.start = input.LT(1);
+ int complexConstant_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token re1=null;
+ Token im1=null;
+ Token LPAREN198=null;
+ Token COMMA199=null;
+ Token RPAREN200=null;
+
+ Object re1_tree=null;
+ Object im1_tree=null;
+ Object LPAREN198_tree=null;
+ Object COMMA199_tree=null;
+ Object RPAREN200_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 74) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:367:2: ( LPAREN re1= FLOATCONSTANT COMMA im1= FLOATCONSTANT RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:367:4: LPAREN re1= FLOATCONSTANT COMMA im1= FLOATCONSTANT RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ LPAREN198=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_complexConstant3747); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN198_tree = (Object)adaptor.create(LPAREN198);
+ adaptor.addChild(root_0, LPAREN198_tree);
+ }
+ re1=(Token)match(input,FLOATCONSTANT,FOLLOW_FLOATCONSTANT_in_complexConstant3751); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ re1_tree = (Object)adaptor.create(re1);
+ adaptor.addChild(root_0, re1_tree);
+ }
+ COMMA199=(Token)match(input,COMMA,FOLLOW_COMMA_in_complexConstant3753); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA199_tree = (Object)adaptor.create(COMMA199);
+ adaptor.addChild(root_0, COMMA199_tree);
+ }
+ im1=(Token)match(input,FLOATCONSTANT,FOLLOW_FLOATCONSTANT_in_complexConstant3757); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ im1_tree = (Object)adaptor.create(im1);
+ adaptor.addChild(root_0, im1_tree);
+ }
+ RPAREN200=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_complexConstant3759); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN200_tree = (Object)adaptor.create(RPAREN200);
+ adaptor.addChild(root_0, RPAREN200_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new String((re1!=null?re1.getText():null) +"+i"+(im1!=null?im1.getText():null));
+ }
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 74, complexConstant_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "complexConstant"
+
+ public static class stringConstant_return extends ParserRuleReturnScope {
+ public String value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "stringConstant"
+ // src/petascope/wcps/grammar/wcps.g:369:1: stringConstant returns [String value] : s= STRING ;
+ public final wcpsParser.stringConstant_return stringConstant() throws RecognitionException {
+ wcpsParser.stringConstant_return retval = new wcpsParser.stringConstant_return();
+ retval.start = input.LT(1);
+ int stringConstant_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token s=null;
+
+ Object s_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 75) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:370:2: (s= STRING )
+ // src/petascope/wcps/grammar/wcps.g:370:4: s= STRING
+ {
+ root_0 = (Object)adaptor.nil();
+
+ s=(Token)match(input,STRING,FOLLOW_STRING_in_stringConstant3776); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ s_tree = (Object)adaptor.create(s);
+ adaptor.addChild(root_0, s_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = (s!=null?s.getText():null);
+ }
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 75, stringConstant_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "stringConstant"
+
+ public static class name_return extends ParserRuleReturnScope {
+ public String value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "name"
+ // src/petascope/wcps/grammar/wcps.g:372:1: name returns [String value] : var= ( NAME | STRING | INTEGERCONSTANT ) ;
+ public final wcpsParser.name_return name() throws RecognitionException {
+ wcpsParser.name_return retval = new wcpsParser.name_return();
+ retval.start = input.LT(1);
+ int name_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token var=null;
+
+ Object var_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 76) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:373:2: (var= ( NAME | STRING | INTEGERCONSTANT ) )
+ // src/petascope/wcps/grammar/wcps.g:373:4: var= ( NAME | STRING | INTEGERCONSTANT )
+ {
+ root_0 = (Object)adaptor.nil();
+
+ var=(Token)input.LT(1);
+ if ( input.LA(1)==INTEGERCONSTANT||input.LA(1)==STRING||input.LA(1)==NAME ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(var));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ if ( state.backtracking==0 ) {
+ retval.value = (var!=null?var.getText():null);
+ }
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 76, name_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "name"
+
+ public static class crsName_return extends ParserRuleReturnScope {
+ public String value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "crsName"
+ // src/petascope/wcps/grammar/wcps.g:375:1: crsName returns [String value] : s= stringConstant ;
+ public final wcpsParser.crsName_return crsName() throws RecognitionException {
+ wcpsParser.crsName_return retval = new wcpsParser.crsName_return();
+ retval.start = input.LT(1);
+ int crsName_StartIndex = input.index();
+ Object root_0 = null;
+
+ wcpsParser.stringConstant_return s = null;
+
+
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 77) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:376:2: (s= stringConstant )
+ // src/petascope/wcps/grammar/wcps.g:376:4: s= stringConstant
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_stringConstant_in_crsName3820);
+ s=stringConstant();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, s.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (s!=null?s.value:null);
+ }
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 77, crsName_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "crsName"
+
+ public static class axisName_return extends ParserRuleReturnScope {
+ public String value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "axisName"
+ // src/petascope/wcps/grammar/wcps.g:378:1: axisName returns [String value] : type1= name ;
+ public final wcpsParser.axisName_return axisName() throws RecognitionException {
+ wcpsParser.axisName_return retval = new wcpsParser.axisName_return();
+ retval.start = input.LT(1);
+ int axisName_StartIndex = input.index();
+ Object root_0 = null;
+
+ wcpsParser.name_return type1 = null;
+
+
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 78) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:379:2: (type1= name )
+ // src/petascope/wcps/grammar/wcps.g:379:4: type1= name
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_name_in_axisName3837);
+ type1=name();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, type1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new String((type1!=null?type1.value:null));
+ }
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 78, axisName_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "axisName"
+
+ public static class variableName_return extends ParserRuleReturnScope {
+ public String value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "variableName"
+ // src/petascope/wcps/grammar/wcps.g:381:1: variableName returns [String value] : var= VARIABLE_DOLLAR ;
+ public final wcpsParser.variableName_return variableName() throws RecognitionException {
+ wcpsParser.variableName_return retval = new wcpsParser.variableName_return();
+ retval.start = input.LT(1);
+ int variableName_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token var=null;
+
+ Object var_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 79) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:382:2: (var= VARIABLE_DOLLAR )
+ // src/petascope/wcps/grammar/wcps.g:382:4: var= VARIABLE_DOLLAR
+ {
+ root_0 = (Object)adaptor.nil();
+
+ var=(Token)match(input,VARIABLE_DOLLAR,FOLLOW_VARIABLE_DOLLAR_in_variableName3854); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ var_tree = (Object)adaptor.create(var);
+ adaptor.addChild(root_0, var_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new String((var!=null?var.getText():null));
+ }
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 79, variableName_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "variableName"
+
+ public static class coverageVariable_return extends ParserRuleReturnScope {
+ public String value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "coverageVariable"
+ // src/petascope/wcps/grammar/wcps.g:384:1: coverageVariable returns [String value] : var= NAME ;
+ public final wcpsParser.coverageVariable_return coverageVariable() throws RecognitionException {
+ wcpsParser.coverageVariable_return retval = new wcpsParser.coverageVariable_return();
+ retval.start = input.LT(1);
+ int coverageVariable_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token var=null;
+
+ Object var_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 80) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:385:2: (var= NAME )
+ // src/petascope/wcps/grammar/wcps.g:385:4: var= NAME
+ {
+ root_0 = (Object)adaptor.nil();
+
+ var=(Token)match(input,NAME,FOLLOW_NAME_in_coverageVariable3871); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ var_tree = (Object)adaptor.create(var);
+ adaptor.addChild(root_0, var_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = (var!=null?var.getText():null);
+ }
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 80, coverageVariable_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "coverageVariable"
+
+ public static class coverageName_return extends ParserRuleReturnScope {
+ public String value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "coverageName"
+ // src/petascope/wcps/grammar/wcps.g:387:1: coverageName returns [String value] : name ;
+ public final wcpsParser.coverageName_return coverageName() throws RecognitionException {
+ wcpsParser.coverageName_return retval = new wcpsParser.coverageName_return();
+ retval.start = input.LT(1);
+ int coverageName_StartIndex = input.index();
+ Object root_0 = null;
+
+ wcpsParser.name_return name201 = null;
+
+
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 81) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:388:2: ( name )
+ // src/petascope/wcps/grammar/wcps.g:388:4: name
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_name_in_coverageName3886);
+ name201=name();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, name201.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (name201!=null?name201.value:null);
+ }
+
+ }
+
+ 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 re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 81, coverageName_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "coverageName"
+
+ // $ANTLR start synpred8_wcps
+ public final void synpred8_wcps_fragment() throws RecognitionException {
+ Token op=null;
+ wcpsParser.coverageLogicTerm_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:67:10: (op= ( OR | XOR ) e2= coverageLogicTerm )
+ // src/petascope/wcps/grammar/wcps.g:67:10: op= ( OR | XOR ) e2= coverageLogicTerm
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=OR && input.LA(1)<=XOR) ) {
+ input.consume();
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return ;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_coverageLogicTerm_in_synpred8_wcps374);
+ e2=coverageLogicTerm();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred8_wcps
+
+ // $ANTLR start synpred9_wcps
+ public final void synpred9_wcps_fragment() throws RecognitionException {
+ Token op=null;
+ wcpsParser.coverageLogicFactor_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:71:10: (op= AND e2= coverageLogicFactor )
+ // src/petascope/wcps/grammar/wcps.g:71:10: op= AND e2= coverageLogicFactor
+ {
+ op=(Token)match(input,AND,FOLLOW_AND_in_synpred9_wcps416); if (state.failed) return ;
+ pushFollow(FOLLOW_coverageLogicFactor_in_synpred9_wcps420);
+ e2=coverageLogicFactor();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred9_wcps
+
+ // $ANTLR start synpred15_wcps
+ public final void synpred15_wcps_fragment() throws RecognitionException {
+ Token op=null;
+ wcpsParser.coverageArithmeticExpr_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:75:10: (op= ( EQUALS | NOTEQUALS | LT | GT | LTE | GTE ) e2= coverageArithmeticExpr )
+ // src/petascope/wcps/grammar/wcps.g:75:10: op= ( EQUALS | NOTEQUALS | LT | GT | LTE | GTE ) e2= coverageArithmeticExpr
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=EQUALS && input.LA(1)<=GTE) ) {
+ input.consume();
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return ;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_coverageArithmeticExpr_in_synpred15_wcps479);
+ e2=coverageArithmeticExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred15_wcps
+
+ // $ANTLR start synpred17_wcps
+ public final void synpred17_wcps_fragment() throws RecognitionException {
+ Token op=null;
+ wcpsParser.coverageArithmeticTerm_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:79:10: (op= ( PLUS | MINUS ) e2= coverageArithmeticTerm )
+ // src/petascope/wcps/grammar/wcps.g:79:10: op= ( PLUS | MINUS ) e2= coverageArithmeticTerm
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=PLUS && input.LA(1)<=MINUS) ) {
+ input.consume();
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return ;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_coverageArithmeticTerm_in_synpred17_wcps531);
+ e2=coverageArithmeticTerm();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred17_wcps
+
+ // $ANTLR start synpred19_wcps
+ public final void synpred19_wcps_fragment() throws RecognitionException {
+ Token op=null;
+ wcpsParser.coverageArithmeticFactor_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:83:10: (op= ( MULT | DIVIDE ) e2= coverageArithmeticFactor )
+ // src/petascope/wcps/grammar/wcps.g:83:10: op= ( MULT | DIVIDE ) e2= coverageArithmeticFactor
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=MULT && input.LA(1)<=DIVIDE) ) {
+ input.consume();
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return ;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_coverageArithmeticFactor_in_synpred19_wcps582);
+ e2=coverageArithmeticFactor();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred19_wcps
+
+ // $ANTLR start synpred20_wcps
+ public final void synpred20_wcps_fragment() throws RecognitionException {
+ Token op=null;
+ wcpsParser.coverageValue_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:87:10: (op= OVERLAY e2= coverageValue )
+ // src/petascope/wcps/grammar/wcps.g:87:10: op= OVERLAY e2= coverageValue
+ {
+ op=(Token)match(input,OVERLAY,FOLLOW_OVERLAY_in_synpred20_wcps625); if (state.failed) return ;
+ pushFollow(FOLLOW_coverageValue_in_synpred20_wcps629);
+ e2=coverageValue();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred20_wcps
+
+ // $ANTLR start synpred21_wcps
+ public final void synpred21_wcps_fragment() throws RecognitionException {
+ wcpsParser.subsetExpr_return e5 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:90:7: (e5= subsetExpr )
+ // src/petascope/wcps/grammar/wcps.g:90:7: e5= subsetExpr
+ {
+ pushFollow(FOLLOW_subsetExpr_in_synpred21_wcps655);
+ e5=subsetExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred21_wcps
+
+ // $ANTLR start synpred22_wcps
+ public final void synpred22_wcps_fragment() throws RecognitionException {
+ wcpsParser.unaryInducedExpr_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:91:7: (e2= unaryInducedExpr )
+ // src/petascope/wcps/grammar/wcps.g:91:7: e2= unaryInducedExpr
+ {
+ pushFollow(FOLLOW_unaryInducedExpr_in_synpred22_wcps668);
+ e2=unaryInducedExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred22_wcps
+
+ // $ANTLR start synpred25_wcps
+ public final void synpred25_wcps_fragment() throws RecognitionException {
+ wcpsParser.scalarExpr_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:97:7: (e2= scalarExpr )
+ // src/petascope/wcps/grammar/wcps.g:97:7: e2= scalarExpr
+ {
+ pushFollow(FOLLOW_scalarExpr_in_synpred25_wcps727);
+ e2=scalarExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred25_wcps
+
+ // $ANTLR start synpred27_wcps
+ public final void synpred27_wcps_fragment() throws RecognitionException {
+ wcpsParser.coverageExpr_return e7 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:99:7: ( LPAREN e7= coverageExpr RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:99:7: LPAREN e7= coverageExpr RPAREN
+ {
+ match(input,LPAREN,FOLLOW_LPAREN_in_synpred27_wcps749); if (state.failed) return ;
+ pushFollow(FOLLOW_coverageExpr_in_synpred27_wcps753);
+ e7=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+ match(input,RPAREN,FOLLOW_RPAREN_in_synpred27_wcps755); if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred27_wcps
+
+ // $ANTLR start synpred28_wcps
+ public final void synpred28_wcps_fragment() throws RecognitionException {
+ wcpsParser.coverageConstantExpr_return e3 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:100:7: (e3= coverageConstantExpr )
+ // src/petascope/wcps/grammar/wcps.g:100:7: e3= coverageConstantExpr
+ {
+ pushFollow(FOLLOW_coverageConstantExpr_in_synpred28_wcps768);
+ e3=coverageConstantExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred28_wcps
+
+ // $ANTLR start synpred29_wcps
+ public final void synpred29_wcps_fragment() throws RecognitionException {
+ wcpsParser.coverageConstructorExpr_return e4 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:101:7: (e4= coverageConstructorExpr )
+ // src/petascope/wcps/grammar/wcps.g:101:7: e4= coverageConstructorExpr
+ {
+ pushFollow(FOLLOW_coverageConstructorExpr_in_synpred29_wcps780);
+ e4=coverageConstructorExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred29_wcps
+
+ // $ANTLR start synpred31_wcps
+ public final void synpred31_wcps_fragment() throws RecognitionException {
+ wcpsParser.metaDataExpr_return e1 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:106:7: (e1= metaDataExpr )
+ // src/petascope/wcps/grammar/wcps.g:106:7: e1= metaDataExpr
+ {
+ pushFollow(FOLLOW_metaDataExpr_in_synpred31_wcps830);
+ e1=metaDataExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred31_wcps
+
+ // $ANTLR start synpred32_wcps
+ public final void synpred32_wcps_fragment() throws RecognitionException {
+ wcpsParser.condenseExpr_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:107:7: (e2= condenseExpr )
+ // src/petascope/wcps/grammar/wcps.g:107:7: e2= condenseExpr
+ {
+ pushFollow(FOLLOW_condenseExpr_in_synpred32_wcps843);
+ e2=condenseExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred32_wcps
+
+ // $ANTLR start synpred33_wcps
+ public final void synpred33_wcps_fragment() throws RecognitionException {
+ wcpsParser.booleanScalarExpr_return e3 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:108:7: (e3= booleanScalarExpr )
+ // src/petascope/wcps/grammar/wcps.g:108:7: e3= booleanScalarExpr
+ {
+ pushFollow(FOLLOW_booleanScalarExpr_in_synpred33_wcps856);
+ e3=booleanScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred33_wcps
+
+ // $ANTLR start synpred34_wcps
+ public final void synpred34_wcps_fragment() throws RecognitionException {
+ wcpsParser.numericScalarExpr_return e4 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:109:7: (e4= numericScalarExpr )
+ // src/petascope/wcps/grammar/wcps.g:109:7: e4= numericScalarExpr
+ {
+ pushFollow(FOLLOW_numericScalarExpr_in_synpred34_wcps870);
+ e4=numericScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred34_wcps
+
+ // $ANTLR start synpred35_wcps
+ public final void synpred35_wcps_fragment() throws RecognitionException {
+ wcpsParser.stringScalarExpr_return e5 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:110:7: (e5= stringScalarExpr )
+ // src/petascope/wcps/grammar/wcps.g:110:7: e5= stringScalarExpr
+ {
+ pushFollow(FOLLOW_stringScalarExpr_in_synpred35_wcps883);
+ e5=stringScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred35_wcps
+
+ // $ANTLR start synpred70_wcps
+ public final void synpred70_wcps_fragment() throws RecognitionException {
+ wcpsParser.fieldExpr_return e6 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:204:7: (e6= fieldExpr )
+ // src/petascope/wcps/grammar/wcps.g:204:7: e6= fieldExpr
+ {
+ pushFollow(FOLLOW_fieldExpr_in_synpred70_wcps2013);
+ e6=fieldExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred70_wcps
+
+ // $ANTLR start synpred71_wcps
+ public final void synpred71_wcps_fragment() throws RecognitionException {
+ wcpsParser.unaryArithmeticExpr_return e1 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:205:4: (e1= unaryArithmeticExpr )
+ // src/petascope/wcps/grammar/wcps.g:205:4: e1= unaryArithmeticExpr
+ {
+ pushFollow(FOLLOW_unaryArithmeticExpr_in_synpred71_wcps2022);
+ e1=unaryArithmeticExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred71_wcps
+
+ // $ANTLR start synpred74_wcps
+ public final void synpred74_wcps_fragment() throws RecognitionException {
+ wcpsParser.booleanExpr_return e4 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:208:7: (e4= booleanExpr )
+ // src/petascope/wcps/grammar/wcps.g:208:7: e4= booleanExpr
+ {
+ pushFollow(FOLLOW_booleanExpr_in_synpred74_wcps2058);
+ e4=booleanExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred74_wcps
+
+ // $ANTLR start synpred100_wcps
+ public final void synpred100_wcps_fragment() throws RecognitionException {
+ wcpsParser.trimExpr_return e1 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:251:4: (e1= trimExpr )
+ // src/petascope/wcps/grammar/wcps.g:251:4: e1= trimExpr
+ {
+ pushFollow(FOLLOW_trimExpr_in_synpred100_wcps2575);
+ e1=trimExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred100_wcps
+
+ // $ANTLR start synpred101_wcps
+ public final void synpred101_wcps_fragment() throws RecognitionException {
+ wcpsParser.sliceExpr_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:252:4: (e2= sliceExpr )
+ // src/petascope/wcps/grammar/wcps.g:252:4: e2= sliceExpr
+ {
+ pushFollow(FOLLOW_sliceExpr_in_synpred101_wcps2584);
+ e2=sliceExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred101_wcps
+
+ // $ANTLR start synpred115_wcps
+ public final void synpred115_wcps_fragment() throws RecognitionException {
+ Token op=null;
+ wcpsParser.booleanScalarTerm_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:280:8: (op= ( OR | XOR ) e2= booleanScalarTerm )
+ // src/petascope/wcps/grammar/wcps.g:280:8: op= ( OR | XOR ) e2= booleanScalarTerm
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=OR && input.LA(1)<=XOR) ) {
+ input.consume();
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return ;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_booleanScalarTerm_in_synpred115_wcps2886);
+ e2=booleanScalarTerm();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred115_wcps
+
+ // $ANTLR start synpred116_wcps
+ public final void synpred116_wcps_fragment() throws RecognitionException {
+ Token op=null;
+ wcpsParser.booleanScalarNegation_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:284:5: (op= AND e2= booleanScalarNegation )
+ // src/petascope/wcps/grammar/wcps.g:284:5: op= AND e2= booleanScalarNegation
+ {
+ op=(Token)match(input,AND,FOLLOW_AND_in_synpred116_wcps2918); if (state.failed) return ;
+ pushFollow(FOLLOW_booleanScalarNegation_in_synpred116_wcps2922);
+ e2=booleanScalarNegation();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred116_wcps
+
+ // $ANTLR start synpred118_wcps
+ public final void synpred118_wcps_fragment() throws RecognitionException {
+ wcpsParser.booleanScalarExpr_return e1 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:291:4: ( LPAREN e1= booleanScalarExpr RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:291:4: LPAREN e1= booleanScalarExpr RPAREN
+ {
+ match(input,LPAREN,FOLLOW_LPAREN_in_synpred118_wcps2971); if (state.failed) return ;
+ pushFollow(FOLLOW_booleanScalarExpr_in_synpred118_wcps2975);
+ e1=booleanScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+ match(input,RPAREN,FOLLOW_RPAREN_in_synpred118_wcps2977); if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred118_wcps
+
+ // $ANTLR start synpred120_wcps
+ public final void synpred120_wcps_fragment() throws RecognitionException {
+ wcpsParser.numericScalarExpr_return n1 = null;
+
+ wcpsParser.compOp_return cop = null;
+
+ wcpsParser.numericScalarExpr_return n2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:293:4: (n1= numericScalarExpr cop= compOp n2= numericScalarExpr )
+ // src/petascope/wcps/grammar/wcps.g:293:4: n1= numericScalarExpr cop= compOp n2= numericScalarExpr
+ {
+ pushFollow(FOLLOW_numericScalarExpr_in_synpred120_wcps3004);
+ n1=numericScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+ pushFollow(FOLLOW_compOp_in_synpred120_wcps3008);
+ cop=compOp();
+
+ state._fsp--;
+ if (state.failed) return ;
+ pushFollow(FOLLOW_numericScalarExpr_in_synpred120_wcps3012);
+ n2=numericScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred120_wcps
+
+ // $ANTLR start synpred122_wcps
+ public final void synpred122_wcps_fragment() throws RecognitionException {
+ Token op=null;
+ wcpsParser.numericScalarTerm_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:298:5: (op= ( PLUS | MINUS ) e2= numericScalarTerm )
+ // src/petascope/wcps/grammar/wcps.g:298:5: op= ( PLUS | MINUS ) e2= numericScalarTerm
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=PLUS && input.LA(1)<=MINUS) ) {
+ input.consume();
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return ;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_numericScalarTerm_in_synpred122_wcps3057);
+ e2=numericScalarTerm();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred122_wcps
+
+ // $ANTLR start synpred124_wcps
+ public final void synpred124_wcps_fragment() throws RecognitionException {
+ Token op=null;
+ wcpsParser.numericScalarFactor_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:302:4: (op= ( MULT | DIVIDE ) e2= numericScalarFactor )
+ // src/petascope/wcps/grammar/wcps.g:302:4: op= ( MULT | DIVIDE ) e2= numericScalarFactor
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=MULT && input.LA(1)<=DIVIDE) ) {
+ input.consume();
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return ;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_numericScalarFactor_in_synpred124_wcps3093);
+ e2=numericScalarFactor();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred124_wcps
+
+ // $ANTLR start synpred125_wcps
+ public final void synpred125_wcps_fragment() throws RecognitionException {
+ wcpsParser.numericScalarExpr_return e1 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:305:7: ( LPAREN e1= numericScalarExpr RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:305:7: LPAREN e1= numericScalarExpr RPAREN
+ {
+ match(input,LPAREN,FOLLOW_LPAREN_in_synpred125_wcps3113); if (state.failed) return ;
+ pushFollow(FOLLOW_numericScalarExpr_in_synpred125_wcps3117);
+ e1=numericScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+ match(input,RPAREN,FOLLOW_RPAREN_in_synpred125_wcps3119); if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred125_wcps
+
+ // $ANTLR start synpred132_wcps
+ public final void synpred132_wcps_fragment() throws RecognitionException {
+ wcpsParser.complexConstant_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:312:7: (e2= complexConstant )
+ // src/petascope/wcps/grammar/wcps.g:312:7: e2= complexConstant
+ {
+ pushFollow(FOLLOW_complexConstant_in_synpred132_wcps3231);
+ e2=complexConstant();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred132_wcps
+
+ // $ANTLR start synpred141_wcps
+ public final void synpred141_wcps_fragment() throws RecognitionException {
+ wcpsParser.scalarExpr_return e1 = null;
+
+ wcpsParser.scalarExpr_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:333:7: (e1= scalarExpr COLON e2= scalarExpr )
+ // src/petascope/wcps/grammar/wcps.g:333:7: e1= scalarExpr COLON e2= scalarExpr
+ {
+ pushFollow(FOLLOW_scalarExpr_in_synpred141_wcps3419);
+ e1=scalarExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+ match(input,COLON,FOLLOW_COLON_in_synpred141_wcps3421); if (state.failed) return ;
+ pushFollow(FOLLOW_scalarExpr_in_synpred141_wcps3425);
+ e2=scalarExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred141_wcps
+
+ // Delegated rules
+
+ public final boolean synpred70_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred70_wcps_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 synpred9_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred9_wcps_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 synpred15_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred15_wcps_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 synpred17_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred17_wcps_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 synpred125_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred125_wcps_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 synpred19_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred19_wcps_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 synpred32_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred32_wcps_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 synpred31_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred31_wcps_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 synpred21_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred21_wcps_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 synpred101_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred101_wcps_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 synpred118_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred118_wcps_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 synpred115_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred115_wcps_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 synpred132_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred132_wcps_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 synpred141_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred141_wcps_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 synpred122_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred122_wcps_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 synpred74_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred74_wcps_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 synpred20_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred20_wcps_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 synpred33_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred33_wcps_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 synpred27_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred27_wcps_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 synpred22_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred22_wcps_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 synpred28_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred28_wcps_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 synpred29_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred29_wcps_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 synpred100_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred100_wcps_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 synpred25_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred25_wcps_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 synpred35_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred35_wcps_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 synpred71_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred71_wcps_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 synpred34_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred34_wcps_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 synpred124_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred124_wcps_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 synpred8_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred8_wcps_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 synpred116_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred116_wcps_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 synpred120_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred120_wcps_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 DFA4 dfa4 = new DFA4(this);
+ protected DFA6 dfa6 = new DFA6(this);
+ protected DFA7 dfa7 = new DFA7(this);
+ protected DFA8 dfa8 = new DFA8(this);
+ protected DFA9 dfa9 = new DFA9(this);
+ protected DFA10 dfa10 = new DFA10(this);
+ protected DFA11 dfa11 = new DFA11(this);
+ protected DFA12 dfa12 = new DFA12(this);
+ protected DFA13 dfa13 = new DFA13(this);
+ protected DFA14 dfa14 = new DFA14(this);
+ protected DFA34 dfa34 = new DFA34(this);
+ protected DFA42 dfa42 = new DFA42(this);
+ protected DFA43 dfa43 = new DFA43(this);
+ protected DFA44 dfa44 = new DFA44(this);
+ protected DFA46 dfa46 = new DFA46(this);
+ protected DFA47 dfa47 = new DFA47(this);
+ protected DFA48 dfa48 = new DFA48(this);
+ protected DFA49 dfa49 = new DFA49(this);
+ protected DFA50 dfa50 = new DFA50(this);
+ protected DFA51 dfa51 = new DFA51(this);
+ protected DFA52 dfa52 = new DFA52(this);
+ protected DFA56 dfa56 = new DFA56(this);
+ static final String DFA4_eotS =
+ "\30\uffff";
+ static final String DFA4_eofS =
+ "\30\uffff";
+ static final String DFA4_minS =
+ "\1\6\27\uffff";
+ static final String DFA4_maxS =
+ "\1\154\27\uffff";
+ static final String DFA4_acceptS =
+ "\1\uffff\1\1\1\2\1\3\24\uffff";
+ static final String DFA4_specialS =
+ "\30\uffff}>";
+ static final String[] DFA4_transitionS = {
+ "\1\3\4\uffff\1\1\1\2\12\uffff\1\3\3\uffff\20\3\21\uffff\2\3"+
+ "\16\uffff\1\3\1\uffff\3\3\20\uffff\2\3\11\uffff\1\3",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA4_eot = DFA.unpackEncodedString(DFA4_eotS);
+ static final short[] DFA4_eof = DFA.unpackEncodedString(DFA4_eofS);
+ static final char[] DFA4_min = DFA.unpackEncodedStringToUnsignedChars(DFA4_minS);
+ static final char[] DFA4_max = DFA.unpackEncodedStringToUnsignedChars(DFA4_maxS);
+ static final short[] DFA4_accept = DFA.unpackEncodedString(DFA4_acceptS);
+ static final short[] DFA4_special = DFA.unpackEncodedString(DFA4_specialS);
+ static final short[][] DFA4_transition;
+
+ static {
+ int numStates = DFA4_transitionS.length;
+ DFA4_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA4_transition[i] = DFA.unpackEncodedString(DFA4_transitionS[i]);
+ }
+ }
+
+ class DFA4 extends DFA {
+
+ public DFA4(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 4;
+ this.eot = DFA4_eot;
+ this.eof = DFA4_eof;
+ this.min = DFA4_min;
+ this.max = DFA4_max;
+ this.accept = DFA4_accept;
+ this.special = DFA4_special;
+ this.transition = DFA4_transition;
+ }
+ public String getDescription() {
+ return "53:1: processingExpr returns [ProcessingExpr value] : (e1= encodedCoverageExpr | e2= storeExpr | e3= scalarExpr );";
+ }
+ }
+ static final String DFA6_eotS =
+ "\77\uffff";
+ static final String DFA6_eofS =
+ "\1\1\76\uffff";
+ static final String DFA6_minS =
+ "\1\7\10\uffff\1\0\65\uffff";
+ static final String DFA6_maxS =
+ "\1\140\10\uffff\1\0\65\uffff";
+ static final String DFA6_acceptS =
+ "\1\uffff\1\2\74\uffff\1\1";
+ static final String DFA6_specialS =
+ "\11\uffff\1\0\65\uffff}>";
+ static final String[] DFA6_transitionS = {
+ "\2\1\1\uffff\1\1\2\uffff\2\11\14\1\21\uffff\2\1\3\uffff\1\1"+
+ "\7\uffff\1\1\30\uffff\1\1\15\uffff\1\1",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA6_eot = DFA.unpackEncodedString(DFA6_eotS);
+ static final short[] DFA6_eof = DFA.unpackEncodedString(DFA6_eofS);
+ static final char[] DFA6_min = DFA.unpackEncodedStringToUnsignedChars(DFA6_minS);
+ static final char[] DFA6_max = DFA.unpackEncodedStringToUnsignedChars(DFA6_maxS);
+ static final short[] DFA6_accept = DFA.unpackEncodedString(DFA6_acceptS);
+ static final short[] DFA6_special = DFA.unpackEncodedString(DFA6_specialS);
+ static final short[][] DFA6_transition;
+
+ static {
+ int numStates = DFA6_transitionS.length;
+ DFA6_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA6_transition[i] = DFA.unpackEncodedString(DFA6_transitionS[i]);
+ }
+ }
+
+ class DFA6 extends DFA {
+
+ public DFA6(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 6;
+ this.eot = DFA6_eot;
+ this.eof = DFA6_eof;
+ this.min = DFA6_min;
+ this.max = DFA6_max;
+ this.accept = DFA6_accept;
+ this.special = DFA6_special;
+ this.transition = DFA6_transition;
+ }
+ public String getDescription() {
+ return "()* loopback of 67:9: (op= ( OR | XOR ) e2= coverageLogicTerm )*";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA6_9 = input.LA(1);
+
+
+ int index6_9 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred8_wcps()) ) {s = 62;}
+
+ else if ( (true) ) {s = 1;}
+
+
+ input.seek(index6_9);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 6, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA7_eotS =
+ "\77\uffff";
+ static final String DFA7_eofS =
+ "\1\1\76\uffff";
+ static final String DFA7_minS =
+ "\1\7\10\uffff\1\0\65\uffff";
+ static final String DFA7_maxS =
+ "\1\140\10\uffff\1\0\65\uffff";
+ static final String DFA7_acceptS =
+ "\1\uffff\1\2\74\uffff\1\1";
+ static final String DFA7_specialS =
+ "\11\uffff\1\0\65\uffff}>";
+ static final String[] DFA7_transitionS = {
+ "\2\1\1\uffff\1\1\2\uffff\2\1\1\11\13\1\21\uffff\2\1\3\uffff"+
+ "\1\1\7\uffff\1\1\30\uffff\1\1\15\uffff\1\1",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ 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<numStates; i++) {
+ DFA7_transition[i] = DFA.unpackEncodedString(DFA7_transitionS[i]);
+ }
+ }
+
+ class DFA7 extends DFA {
+
+ public DFA7(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 7;
+ this.eot = DFA7_eot;
+ this.eof = DFA7_eof;
+ this.min = DFA7_min;
+ this.max = DFA7_max;
+ this.accept = DFA7_accept;
+ this.special = DFA7_special;
+ this.transition = DFA7_transition;
+ }
+ public String getDescription() {
+ return "()* loopback of 71:9: (op= AND e2= coverageLogicFactor )*";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA7_9 = input.LA(1);
+
+
+ int index7_9 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred9_wcps()) ) {s = 62;}
+
+ else if ( (true) ) {s = 1;}
+
+
+ input.seek(index7_9);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 7, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA8_eotS =
+ "\u0107\uffff";
+ static final String DFA8_eofS =
+ "\1\2\u0106\uffff";
+ static final String DFA8_minS =
+ "\1\7\1\0\14\uffff\5\0\u00f4\uffff";
+ static final String DFA8_maxS =
+ "\1\140\1\0\14\uffff\5\0\u00f4\uffff";
+ static final String DFA8_acceptS =
+ "\2\uffff\1\2\73\uffff\1\1\u00c8\uffff";
+ static final String DFA8_specialS =
+ "\1\uffff\1\0\14\uffff\1\1\1\2\1\3\1\4\1\5\u00f4\uffff}>";
+ static final String[] DFA8_transitionS = {
+ "\2\2\1\uffff\1\2\2\uffff\3\2\1\1\1\16\1\17\1\20\1\21\1\22\5"+
+ "\2\21\uffff\2\2\3\uffff\1\2\7\uffff\1\2\30\uffff\1\2\15\uffff"+
+ "\1\2",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA8_eot = DFA.unpackEncodedString(DFA8_eotS);
+ static final short[] DFA8_eof = DFA.unpackEncodedString(DFA8_eofS);
+ static final char[] DFA8_min = DFA.unpackEncodedStringToUnsignedChars(DFA8_minS);
+ static final char[] DFA8_max = DFA.unpackEncodedStringToUnsignedChars(DFA8_maxS);
+ static final short[] DFA8_accept = DFA.unpackEncodedString(DFA8_acceptS);
+ static final short[] DFA8_special = DFA.unpackEncodedString(DFA8_specialS);
+ static final short[][] DFA8_transition;
+
+ static {
+ int numStates = DFA8_transitionS.length;
+ DFA8_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA8_transition[i] = DFA.unpackEncodedString(DFA8_transitionS[i]);
+ }
+ }
+
+ class DFA8 extends DFA {
+
+ public DFA8(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 8;
+ this.eot = DFA8_eot;
+ this.eof = DFA8_eof;
+ this.min = DFA8_min;
+ this.max = DFA8_max;
+ this.accept = DFA8_accept;
+ this.special = DFA8_special;
+ this.transition = DFA8_transition;
+ }
+ public String getDescription() {
+ return "75:9: (op= ( EQUALS | NOTEQUALS | LT | GT | LTE | GTE ) e2= coverageArithmeticExpr )?";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA8_1 = input.LA(1);
+
+
+ int index8_1 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred15_wcps()) ) {s = 62;}
+
+ else if ( (true) ) {s = 2;}
+
+
+ input.seek(index8_1);
+ if ( s>=0 ) return s;
+ break;
+ case 1 :
+ int LA8_14 = input.LA(1);
+
+
+ int index8_14 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred15_wcps()) ) {s = 62;}
+
+ else if ( (true) ) {s = 2;}
+
+
+ input.seek(index8_14);
+ if ( s>=0 ) return s;
+ break;
+ case 2 :
+ int LA8_15 = input.LA(1);
+
+
+ int index8_15 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred15_wcps()) ) {s = 62;}
+
+ else if ( (true) ) {s = 2;}
+
+
+ input.seek(index8_15);
+ if ( s>=0 ) return s;
+ break;
+ case 3 :
+ int LA8_16 = input.LA(1);
+
+
+ int index8_16 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred15_wcps()) ) {s = 62;}
+
+ else if ( (true) ) {s = 2;}
+
+
+ input.seek(index8_16);
+ if ( s>=0 ) return s;
+ break;
+ case 4 :
+ int LA8_17 = input.LA(1);
+
+
+ int index8_17 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred15_wcps()) ) {s = 62;}
+
+ else if ( (true) ) {s = 2;}
+
+
+ input.seek(index8_17);
+ if ( s>=0 ) return s;
+ break;
+ case 5 :
+ int LA8_18 = input.LA(1);
+
+
+ int index8_18 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred15_wcps()) ) {s = 62;}
+
+ else if ( (true) ) {s = 2;}
+
+
+ input.seek(index8_18);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 8, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA9_eotS =
+ "\77\uffff";
+ static final String DFA9_eofS =
+ "\1\1\76\uffff";
+ static final String DFA9_minS =
+ "\1\7\10\uffff\1\0\65\uffff";
+ static final String DFA9_maxS =
+ "\1\140\10\uffff\1\0\65\uffff";
+ static final String DFA9_acceptS =
+ "\1\uffff\1\2\74\uffff\1\1";
+ static final String DFA9_specialS =
+ "\11\uffff\1\0\65\uffff}>";
+ static final String[] DFA9_transitionS = {
+ "\2\1\1\uffff\1\1\2\uffff\11\1\2\11\3\1\21\uffff\2\1\3\uffff"+
+ "\1\1\7\uffff\1\1\30\uffff\1\1\15\uffff\1\1",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ 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<numStates; i++) {
+ DFA9_transition[i] = DFA.unpackEncodedString(DFA9_transitionS[i]);
+ }
+ }
+
+ class DFA9 extends DFA {
+
+ public DFA9(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 9;
+ this.eot = DFA9_eot;
+ this.eof = DFA9_eof;
+ this.min = DFA9_min;
+ this.max = DFA9_max;
+ this.accept = DFA9_accept;
+ this.special = DFA9_special;
+ this.transition = DFA9_transition;
+ }
+ public String getDescription() {
+ return "()* loopback of 79:9: (op= ( PLUS | MINUS ) e2= coverageArithmeticTerm )*";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA9_9 = input.LA(1);
+
+
+ int index9_9 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred17_wcps()) ) {s = 62;}
+
+ else if ( (true) ) {s = 1;}
+
+
+ input.seek(index9_9);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 9, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA10_eotS =
+ "\77\uffff";
+ static final String DFA10_eofS =
+ "\1\1\76\uffff";
+ static final String DFA10_minS =
+ "\1\7\10\uffff\1\0\65\uffff";
+ static final String DFA10_maxS =
+ "\1\140\10\uffff\1\0\65\uffff";
+ static final String DFA10_acceptS =
+ "\1\uffff\1\2\74\uffff\1\1";
+ static final String DFA10_specialS =
+ "\11\uffff\1\0\65\uffff}>";
+ static final String[] DFA10_transitionS = {
+ "\2\1\1\uffff\1\1\2\uffff\13\1\2\11\1\1\21\uffff\2\1\3\uffff"+
+ "\1\1\7\uffff\1\1\30\uffff\1\1\15\uffff\1\1",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA10_eot = DFA.unpackEncodedString(DFA10_eotS);
+ static final short[] DFA10_eof = DFA.unpackEncodedString(DFA10_eofS);
+ static final char[] DFA10_min = DFA.unpackEncodedStringToUnsignedChars(DFA10_minS);
+ static final char[] DFA10_max = DFA.unpackEncodedStringToUnsignedChars(DFA10_maxS);
+ static final short[] DFA10_accept = DFA.unpackEncodedString(DFA10_acceptS);
+ static final short[] DFA10_special = DFA.unpackEncodedString(DFA10_specialS);
+ static final short[][] DFA10_transition;
+
+ static {
+ int numStates = DFA10_transitionS.length;
+ DFA10_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA10_transition[i] = DFA.unpackEncodedString(DFA10_transitionS[i]);
+ }
+ }
+
+ class DFA10 extends DFA {
+
+ public DFA10(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 10;
+ this.eot = DFA10_eot;
+ this.eof = DFA10_eof;
+ this.min = DFA10_min;
+ this.max = DFA10_max;
+ this.accept = DFA10_accept;
+ this.special = DFA10_special;
+ this.transition = DFA10_transition;
+ }
+ public String getDescription() {
+ return "()* loopback of 83:9: (op= ( MULT | DIVIDE ) e2= coverageArithmeticFactor )*";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA10_9 = input.LA(1);
+
+
+ int index10_9 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred19_wcps()) ) {s = 62;}
+
+ else if ( (true) ) {s = 1;}
+
+
+ input.seek(index10_9);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 10, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA11_eotS =
+ "\77\uffff";
+ static final String DFA11_eofS =
+ "\1\1\76\uffff";
+ static final String DFA11_minS =
+ "\1\7\10\uffff\1\0\65\uffff";
+ static final String DFA11_maxS =
+ "\1\140\10\uffff\1\0\65\uffff";
+ static final String DFA11_acceptS =
+ "\1\uffff\1\2\74\uffff\1\1";
+ static final String DFA11_specialS =
+ "\11\uffff\1\0\65\uffff}>";
+ static final String[] DFA11_transitionS = {
+ "\2\1\1\uffff\1\1\2\uffff\15\1\1\11\21\uffff\2\1\3\uffff\1\1"+
+ "\7\uffff\1\1\30\uffff\1\1\15\uffff\1\1",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA11_eot = DFA.unpackEncodedString(DFA11_eotS);
+ static final short[] DFA11_eof = DFA.unpackEncodedString(DFA11_eofS);
+ static final char[] DFA11_min = DFA.unpackEncodedStringToUnsignedChars(DFA11_minS);
+ static final char[] DFA11_max = DFA.unpackEncodedStringToUnsignedChars(DFA11_maxS);
+ static final short[] DFA11_accept = DFA.unpackEncodedString(DFA11_acceptS);
+ static final short[] DFA11_special = DFA.unpackEncodedString(DFA11_specialS);
+ static final short[][] DFA11_transition;
+
+ static {
+ int numStates = DFA11_transitionS.length;
+ DFA11_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA11_transition[i] = DFA.unpackEncodedString(DFA11_transitionS[i]);
+ }
+ }
+
+ class DFA11 extends DFA {
+
+ public DFA11(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 11;
+ this.eot = DFA11_eot;
+ this.eof = DFA11_eof;
+ this.min = DFA11_min;
+ this.max = DFA11_max;
+ this.accept = DFA11_accept;
+ this.special = DFA11_special;
+ this.transition = DFA11_transition;
+ }
+ public String getDescription() {
+ return "()* loopback of 87:9: (op= OVERLAY e2= coverageValue )*";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA11_9 = input.LA(1);
+
+
+ int index11_9 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred20_wcps()) ) {s = 62;}
+
+ else if ( (true) ) {s = 1;}
+
+
+ input.seek(index11_9);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 11, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA12_eotS =
+ "\52\uffff";
+ static final String DFA12_eofS =
+ "\52\uffff";
+ static final String DFA12_minS =
+ "\1\6\36\0\13\uffff";
+ static final String DFA12_maxS =
+ "\1\154\36\0\13\uffff";
+ static final String DFA12_acceptS =
+ "\37\uffff\1\1\2\uffff\1\2\4\uffff\1\3\1\4\1\5";
+ static final String DFA12_specialS =
+ "\1\uffff\1\0\1\1\1\2\1\3\1\4\1\5\1\6\1\7\1\10\1\11\1\12\1\13\1\14"+
+ "\1\15\1\16\1\17\1\20\1\21\1\22\1\23\1\24\1\25\1\26\1\27\1\30\1\31"+
+ "\1\32\1\33\1\34\1\35\13\uffff}>";
+ static final String[] DFA12_transitionS = {
+ "\1\13\17\uffff\1\42\1\15\3\uffff\1\1\1\2\1\3\1\4\1\6\1\7\1\10"+
+ "\1\5\7\11\1\12\3\uffff\1\27\4\uffff\1\30\1\31\1\32\1\33\1\34"+
+ "\1\36\1\uffff\1\35\1\50\1\17\1\16\16\42\1\25\1\42\1\21\1\20"+
+ "\1\14\1\47\2\uffff\3\37\12\uffff\1\24\1\22\10\uffff\1\26\1\23",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA12_eot = DFA.unpackEncodedString(DFA12_eotS);
+ static final short[] DFA12_eof = DFA.unpackEncodedString(DFA12_eofS);
+ static final char[] DFA12_min = DFA.unpackEncodedStringToUnsignedChars(DFA12_minS);
+ static final char[] DFA12_max = DFA.unpackEncodedStringToUnsignedChars(DFA12_maxS);
+ static final short[] DFA12_accept = DFA.unpackEncodedString(DFA12_acceptS);
+ static final short[] DFA12_special = DFA.unpackEncodedString(DFA12_specialS);
+ static final short[][] DFA12_transition;
+
+ static {
+ int numStates = DFA12_transitionS.length;
+ DFA12_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA12_transition[i] = DFA.unpackEncodedString(DFA12_transitionS[i]);
+ }
+ }
+
+ class DFA12 extends DFA {
+
+ public DFA12(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 12;
+ this.eot = DFA12_eot;
+ this.eof = DFA12_eof;
+ this.min = DFA12_min;
+ this.max = DFA12_max;
+ this.accept = DFA12_accept;
+ this.special = DFA12_special;
+ this.transition = DFA12_transition;
+ }
+ public String getDescription() {
+ return "89:1: coverageValue returns [CoverageExpr value] : (e5= subsetExpr | e2= unaryInducedExpr | e4= scaleExpr | e3= crsTransformExpr | e1= coverageAtom );";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA12_1 = input.LA(1);
+
+
+ int index12_1 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_1);
+ if ( s>=0 ) return s;
+ break;
+ case 1 :
+ int LA12_2 = input.LA(1);
+
+
+ int index12_2 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_2);
+ if ( s>=0 ) return s;
+ break;
+ case 2 :
+ int LA12_3 = input.LA(1);
+
+
+ int index12_3 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_3);
+ if ( s>=0 ) return s;
+ break;
+ case 3 :
+ int LA12_4 = input.LA(1);
+
+
+ int index12_4 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_4);
+ if ( s>=0 ) return s;
+ break;
+ case 4 :
+ int LA12_5 = input.LA(1);
+
+
+ int index12_5 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_5);
+ if ( s>=0 ) return s;
+ break;
+ case 5 :
+ int LA12_6 = input.LA(1);
+
+
+ int index12_6 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_6);
+ if ( s>=0 ) return s;
+ break;
+ case 6 :
+ int LA12_7 = input.LA(1);
+
+
+ int index12_7 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_7);
+ if ( s>=0 ) return s;
+ break;
+ case 7 :
+ int LA12_8 = input.LA(1);
+
+
+ int index12_8 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_8);
+ if ( s>=0 ) return s;
+ break;
+ case 8 :
+ int LA12_9 = input.LA(1);
+
+
+ int index12_9 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_9);
+ if ( s>=0 ) return s;
+ break;
+ case 9 :
+ int LA12_10 = input.LA(1);
+
+
+ int index12_10 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_10);
+ if ( s>=0 ) return s;
+ break;
+ case 10 :
+ int LA12_11 = input.LA(1);
+
+
+ int index12_11 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_11);
+ if ( s>=0 ) return s;
+ break;
+ case 11 :
+ int LA12_12 = input.LA(1);
+
+
+ int index12_12 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_12);
+ if ( s>=0 ) return s;
+ break;
+ case 12 :
+ int LA12_13 = input.LA(1);
+
+
+ int index12_13 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_13);
+ if ( s>=0 ) return s;
+ break;
+ case 13 :
+ int LA12_14 = input.LA(1);
+
+
+ int index12_14 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_14);
+ if ( s>=0 ) return s;
+ break;
+ case 14 :
+ int LA12_15 = input.LA(1);
+
+
+ int index12_15 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_15);
+ if ( s>=0 ) return s;
+ break;
+ case 15 :
+ int LA12_16 = input.LA(1);
+
+
+ int index12_16 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_16);
+ if ( s>=0 ) return s;
+ break;
+ case 16 :
+ int LA12_17 = input.LA(1);
+
+
+ int index12_17 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_17);
+ if ( s>=0 ) return s;
+ break;
+ case 17 :
+ int LA12_18 = input.LA(1);
+
+
+ int index12_18 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_18);
+ if ( s>=0 ) return s;
+ break;
+ case 18 :
+ int LA12_19 = input.LA(1);
+
+
+ int index12_19 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_19);
+ if ( s>=0 ) return s;
+ break;
+ case 19 :
+ int LA12_20 = input.LA(1);
+
+
+ int index12_20 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_20);
+ if ( s>=0 ) return s;
+ break;
+ case 20 :
+ int LA12_21 = input.LA(1);
+
+
+ int index12_21 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_21);
+ if ( s>=0 ) return s;
+ break;
+ case 21 :
+ int LA12_22 = input.LA(1);
+
+
+ int index12_22 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_22);
+ if ( s>=0 ) return s;
+ break;
+ case 22 :
+ int LA12_23 = input.LA(1);
+
+
+ int index12_23 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_23);
+ if ( s>=0 ) return s;
+ break;
+ case 23 :
+ int LA12_24 = input.LA(1);
+
+
+ int index12_24 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_24);
+ if ( s>=0 ) return s;
+ break;
+ case 24 :
+ int LA12_25 = input.LA(1);
+
+
+ int index12_25 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_25);
+ if ( s>=0 ) return s;
+ break;
+ case 25 :
+ int LA12_26 = input.LA(1);
+
+
+ int index12_26 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_26);
+ if ( s>=0 ) return s;
+ break;
+ case 26 :
+ int LA12_27 = input.LA(1);
+
+
+ int index12_27 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_27);
+ if ( s>=0 ) return s;
+ break;
+ case 27 :
+ int LA12_28 = input.LA(1);
+
+
+ int index12_28 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_28);
+ if ( s>=0 ) return s;
+ break;
+ case 28 :
+ int LA12_29 = input.LA(1);
+
+
+ int index12_29 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_29);
+ if ( s>=0 ) return s;
+ break;
+ case 29 :
+ int LA12_30 = input.LA(1);
+
+
+ int index12_30 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_30);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 12, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA13_eotS =
+ "\112\uffff";
+ static final String DFA13_eofS =
+ "\112\uffff";
+ static final String DFA13_minS =
+ "\1\6\12\uffff\1\6\13\uffff\1\116\7\uffff\25\0\23\uffff\1\0\2\uffff";
+ static final String DFA13_maxS =
+ "\1\154\12\uffff\1\154\13\uffff\1\153\7\uffff\25\0\23\uffff\1\0\2"+
+ "\uffff";
+ static final String DFA13_acceptS =
+ "\1\uffff\1\1\24\uffff\1\2\1\uffff\1\6\4\uffff\1\7\26\uffff\1\3\23"+
+ "\uffff\1\4\1\5";
+ static final String DFA13_specialS =
+ "\37\uffff\1\0\1\1\1\2\1\3\1\4\1\5\1\6\1\7\1\10\1\11\1\12\1\13\1"+
+ "\14\1\15\1\16\1\17\1\20\1\21\1\22\1\23\1\24\23\uffff\1\25\2\uffff}>";
+ static final String[] DFA13_transitionS = {
+ "\1\13\20\uffff\1\1\3\uffff\20\1\3\uffff\1\27\4\uffff\5\30\1"+
+ "\35\1\uffff\1\35\1\uffff\2\1\16\uffff\1\1\1\uffff\3\1\20\uffff"+
+ "\2\1\10\uffff\1\26\1\1",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\52\17\uffff\1\64\1\54\3\uffff\1\40\1\41\1\42\1\43\1\45\1"+
+ "\46\1\47\1\44\7\50\1\51\3\uffff\1\64\4\uffff\6\64\1\uffff\2"+
+ "\64\1\56\1\55\16\64\1\63\1\64\1\60\1\57\1\53\1\64\2\uffff\3"+
+ "\64\12\uffff\1\62\1\37\10\uffff\1\64\1\61",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\107\1\uffff\1\107\32\uffff\1\107",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "",
+ ""
+ };
+
+ static final short[] DFA13_eot = DFA.unpackEncodedString(DFA13_eotS);
+ static final short[] DFA13_eof = DFA.unpackEncodedString(DFA13_eofS);
+ static final char[] DFA13_min = DFA.unpackEncodedStringToUnsignedChars(DFA13_minS);
+ static final char[] DFA13_max = DFA.unpackEncodedStringToUnsignedChars(DFA13_maxS);
+ static final short[] DFA13_accept = DFA.unpackEncodedString(DFA13_acceptS);
+ static final short[] DFA13_special = DFA.unpackEncodedString(DFA13_specialS);
+ static final short[][] DFA13_transition;
+
+ static {
+ int numStates = DFA13_transitionS.length;
+ DFA13_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA13_transition[i] = DFA.unpackEncodedString(DFA13_transitionS[i]);
+ }
+ }
+
+ class DFA13 extends DFA {
+
+ public DFA13(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 13;
+ this.eot = DFA13_eot;
+ this.eof = DFA13_eof;
+ this.min = DFA13_min;
+ this.max = DFA13_max;
+ this.accept = DFA13_accept;
+ this.special = DFA13_special;
+ this.transition = DFA13_transition;
+ }
+ public String getDescription() {
+ return "96:1: coverageAtom returns [CoverageExpr value] : (e2= scalarExpr | e1= coverageVariable | LPAREN e7= coverageExpr RPAREN | e3= coverageConstantExpr | e4= coverageConstructorExpr | e5= setMetaDataExpr | e6= rangeConstructorExpr );";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA13_31 = input.LA(1);
+
+
+ int index13_31 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_31);
+ if ( s>=0 ) return s;
+ break;
+ case 1 :
+ int LA13_32 = input.LA(1);
+
+
+ int index13_32 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_32);
+ if ( s>=0 ) return s;
+ break;
+ case 2 :
+ int LA13_33 = input.LA(1);
+
+
+ int index13_33 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_33);
+ if ( s>=0 ) return s;
+ break;
+ case 3 :
+ int LA13_34 = input.LA(1);
+
+
+ int index13_34 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_34);
+ if ( s>=0 ) return s;
+ break;
+ case 4 :
+ int LA13_35 = input.LA(1);
+
+
+ int index13_35 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_35);
+ if ( s>=0 ) return s;
+ break;
+ case 5 :
+ int LA13_36 = input.LA(1);
+
+
+ int index13_36 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_36);
+ if ( s>=0 ) return s;
+ break;
+ case 6 :
+ int LA13_37 = input.LA(1);
+
+
+ int index13_37 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_37);
+ if ( s>=0 ) return s;
+ break;
+ case 7 :
+ int LA13_38 = input.LA(1);
+
+
+ int index13_38 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_38);
+ if ( s>=0 ) return s;
+ break;
+ case 8 :
+ int LA13_39 = input.LA(1);
+
+
+ int index13_39 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_39);
+ if ( s>=0 ) return s;
+ break;
+ case 9 :
+ int LA13_40 = input.LA(1);
+
+
+ int index13_40 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_40);
+ if ( s>=0 ) return s;
+ break;
+ case 10 :
+ int LA13_41 = input.LA(1);
+
+
+ int index13_41 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_41);
+ if ( s>=0 ) return s;
+ break;
+ case 11 :
+ int LA13_42 = input.LA(1);
+
+
+ int index13_42 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_42);
+ if ( s>=0 ) return s;
+ break;
+ case 12 :
+ int LA13_43 = input.LA(1);
+
+
+ int index13_43 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_43);
+ if ( s>=0 ) return s;
+ break;
+ case 13 :
+ int LA13_44 = input.LA(1);
+
+
+ int index13_44 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_44);
+ if ( s>=0 ) return s;
+ break;
+ case 14 :
+ int LA13_45 = input.LA(1);
+
+
+ int index13_45 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_45);
+ if ( s>=0 ) return s;
+ break;
+ case 15 :
+ int LA13_46 = input.LA(1);
+
+
+ int index13_46 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_46);
+ if ( s>=0 ) return s;
+ break;
+ case 16 :
+ int LA13_47 = input.LA(1);
+
+
+ int index13_47 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_47);
+ if ( s>=0 ) return s;
+ break;
+ case 17 :
+ int LA13_48 = input.LA(1);
+
+
+ int index13_48 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_48);
+ if ( s>=0 ) return s;
+ break;
+ case 18 :
+ int LA13_49 = input.LA(1);
+
+
+ int index13_49 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_49);
+ if ( s>=0 ) return s;
+ break;
+ case 19 :
+ int LA13_50 = input.LA(1);
+
+
+ int index13_50 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_50);
+ if ( s>=0 ) return s;
+ break;
+ case 20 :
+ int LA13_51 = input.LA(1);
+
+
+ int index13_51 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_51);
+ if ( s>=0 ) return s;
+ break;
+ case 21 :
+ int LA13_71 = input.LA(1);
+
+
+ int index13_71 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred28_wcps()) ) {s = 72;}
+
+ else if ( (synpred29_wcps()) ) {s = 73;}
+
+
+ input.seek(index13_71);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 13, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA14_eotS =
+ "\u0091\uffff";
+ static final String DFA14_eofS =
+ "\14\uffff\1\56\u0084\uffff";
+ static final String DFA14_minS =
+ "\2\6\7\uffff\1\6\1\15\1\6\1\7\4\6\3\0\2\uffff\16\0\7\uffff\3\0\4"+
+ "\uffff\1\0\4\uffff\5\0\7\uffff\15\0\101\uffff";
+ static final String DFA14_maxS =
+ "\1\154\1\6\7\uffff\1\6\1\51\1\154\1\140\1\154\3\6\3\0\2\uffff\16"+
+ "\0\7\uffff\3\0\4\uffff\1\0\4\uffff\5\0\7\uffff\15\0\101\uffff";
+ static final String DFA14_acceptS =
+ "\2\uffff\1\1\21\uffff\1\3\17\uffff\1\6\11\uffff\1\5\66\uffff\1\4"+
+ "\52\uffff\1\2";
+ static final String DFA14_specialS =
+ "\21\uffff\1\0\1\1\1\2\2\uffff\1\3\1\4\1\5\1\6\1\7\1\10\1\11\1\12"+
+ "\1\13\1\14\1\15\1\16\1\17\1\20\7\uffff\1\21\1\22\1\23\4\uffff\1"+
+ "\24\4\uffff\1\25\1\26\1\27\1\30\1\31\7\uffff\1\32\1\33\1\34\1\35"+
+ "\1\36\1\37\1\40\1\41\1\42\1\43\1\44\1\45\1\46\101\uffff}>";
+ static final String[] DFA14_transitionS = {
+ "\1\13\20\uffff\1\15\3\uffff\1\1\7\2\7\11\1\12\21\uffff\1\17"+
+ "\1\16\16\uffff\1\24\1\uffff\1\21\1\20\1\14\20\uffff\1\24\1\22"+
+ "\11\uffff\1\23",
+ "\1\26",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\27",
+ "\1\30\1\uffff\1\30\6\uffff\1\30\1\uffff\1\30\17\uffff\2\30",
+ "\1\32\20\uffff\1\33\3\uffff\1\43\7\44\7\40\1\41\21\uffff\1"+
+ "\35\1\34\16\uffff\1\55\1\uffff\1\37\1\36\1\53\20\uffff\1\54"+
+ "\1\31\11\uffff\1\42",
+ "\2\56\1\uffff\1\56\2\uffff\3\56\1\62\1\67\1\70\1\71\1\72\1"+
+ "\73\5\56\21\uffff\2\56\3\uffff\1\56\7\uffff\1\56\30\uffff\1"+
+ "\56\15\uffff\1\56",
+ "\1\103\20\uffff\1\104\13\uffff\7\112\1\113\21\uffff\1\106\1"+
+ "\105\20\uffff\1\110\1\107\22\uffff\1\111\11\uffff\1\114",
+ "\1\115",
+ "\1\116",
+ "\1\117",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "",
+ "",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA14_eot = DFA.unpackEncodedString(DFA14_eotS);
+ static final short[] DFA14_eof = DFA.unpackEncodedString(DFA14_eofS);
+ static final char[] DFA14_min = DFA.unpackEncodedStringToUnsignedChars(DFA14_minS);
+ static final char[] DFA14_max = DFA.unpackEncodedStringToUnsignedChars(DFA14_maxS);
+ static final short[] DFA14_accept = DFA.unpackEncodedString(DFA14_acceptS);
+ static final short[] DFA14_special = DFA.unpackEncodedString(DFA14_specialS);
+ static final short[][] DFA14_transition;
+
+ static {
+ int numStates = DFA14_transitionS.length;
+ DFA14_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA14_transition[i] = DFA.unpackEncodedString(DFA14_transitionS[i]);
+ }
+ }
+
+ class DFA14 extends DFA {
+
+ public DFA14(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 14;
+ this.eot = DFA14_eot;
+ this.eof = DFA14_eof;
+ this.min = DFA14_min;
+ this.max = DFA14_max;
+ this.accept = DFA14_accept;
+ this.special = DFA14_special;
+ this.transition = DFA14_transition;
+ }
+ public String getDescription() {
+ return "105:1: scalarExpr returns [ScalarExpr value] : (e1= metaDataExpr | e2= condenseExpr | e3= booleanScalarExpr | e4= numericScalarExpr | e5= stringScalarExpr | LPAREN e6= scalarExpr RPAREN );";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA14_17 = input.LA(1);
+
+
+ int index14_17 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_17);
+ if ( s>=0 ) return s;
+ break;
+ case 1 :
+ int LA14_18 = input.LA(1);
+
+
+ int index14_18 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_18);
+ if ( s>=0 ) return s;
+ break;
+ case 2 :
+ int LA14_19 = input.LA(1);
+
+
+ int index14_19 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_19);
+ if ( s>=0 ) return s;
+ break;
+ case 3 :
+ int LA14_22 = input.LA(1);
+
+
+ int index14_22 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred31_wcps()) ) {s = 2;}
+
+ else if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred35_wcps()) ) {s = 46;}
+
+
+ input.seek(index14_22);
+ if ( s>=0 ) return s;
+ break;
+ case 4 :
+ int LA14_23 = input.LA(1);
+
+
+ int index14_23 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred32_wcps()) ) {s = 144;}
+
+ else if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_23);
+ if ( s>=0 ) return s;
+ break;
+ case 5 :
+ int LA14_24 = input.LA(1);
+
+
+ int index14_24 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred32_wcps()) ) {s = 144;}
+
+ else if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_24);
+ if ( s>=0 ) return s;
+ break;
+ case 6 :
+ int LA14_25 = input.LA(1);
+
+
+ int index14_25 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+ else if ( (true) ) {s = 36;}
+
+
+ input.seek(index14_25);
+ if ( s>=0 ) return s;
+ break;
+ case 7 :
+ int LA14_26 = input.LA(1);
+
+
+ int index14_26 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+ else if ( (true) ) {s = 36;}
+
+
+ input.seek(index14_26);
+ if ( s>=0 ) return s;
+ break;
+ case 8 :
+ int LA14_27 = input.LA(1);
+
+
+ int index14_27 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+ else if ( (true) ) {s = 36;}
+
+
+ input.seek(index14_27);
+ if ( s>=0 ) return s;
+ break;
+ case 9 :
+ int LA14_28 = input.LA(1);
+
+
+ int index14_28 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+ else if ( (true) ) {s = 36;}
+
+
+ input.seek(index14_28);
+ if ( s>=0 ) return s;
+ break;
+ case 10 :
+ int LA14_29 = input.LA(1);
+
+
+ int index14_29 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+ else if ( (true) ) {s = 36;}
+
+
+ input.seek(index14_29);
+ if ( s>=0 ) return s;
+ break;
+ case 11 :
+ int LA14_30 = input.LA(1);
+
+
+ int index14_30 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+ else if ( (true) ) {s = 36;}
+
+
+ input.seek(index14_30);
+ if ( s>=0 ) return s;
+ break;
+ case 12 :
+ int LA14_31 = input.LA(1);
+
+
+ int index14_31 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+ else if ( (true) ) {s = 36;}
+
+
+ input.seek(index14_31);
+ if ( s>=0 ) return s;
+ break;
+ case 13 :
+ int LA14_32 = input.LA(1);
+
+
+ int index14_32 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+ else if ( (true) ) {s = 36;}
+
+
+ input.seek(index14_32);
+ if ( s>=0 ) return s;
+ break;
+ case 14 :
+ int LA14_33 = input.LA(1);
+
+
+ int index14_33 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+ else if ( (true) ) {s = 36;}
+
+
+ input.seek(index14_33);
+ if ( s>=0 ) return s;
+ break;
+ case 15 :
+ int LA14_34 = input.LA(1);
+
+
+ int index14_34 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+ else if ( (true) ) {s = 36;}
+
+
+ input.seek(index14_34);
+ if ( s>=0 ) return s;
+ break;
+ case 16 :
+ int LA14_35 = input.LA(1);
+
+
+ int index14_35 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (true) ) {s = 36;}
+
+
+ input.seek(index14_35);
+ if ( s>=0 ) return s;
+ break;
+ case 17 :
+ int LA14_43 = input.LA(1);
+
+
+ int index14_43 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (true) ) {s = 36;}
+
+
+ input.seek(index14_43);
+ if ( s>=0 ) return s;
+ break;
+ case 18 :
+ int LA14_44 = input.LA(1);
+
+
+ int index14_44 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (true) ) {s = 36;}
+
+
+ input.seek(index14_44);
+ if ( s>=0 ) return s;
+ break;
+ case 19 :
+ int LA14_45 = input.LA(1);
+
+
+ int index14_45 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (true) ) {s = 36;}
+
+
+ input.seek(index14_45);
+ if ( s>=0 ) return s;
+ break;
+ case 20 :
+ int LA14_50 = input.LA(1);
+
+
+ int index14_50 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred35_wcps()) ) {s = 46;}
+
+
+ input.seek(index14_50);
+ if ( s>=0 ) return s;
+ break;
+ case 21 :
+ int LA14_55 = input.LA(1);
+
+
+ int index14_55 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred35_wcps()) ) {s = 46;}
+
+
+ input.seek(index14_55);
+ if ( s>=0 ) return s;
+ break;
+ case 22 :
+ int LA14_56 = input.LA(1);
+
+
+ int index14_56 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred35_wcps()) ) {s = 46;}
+
+
+ input.seek(index14_56);
+ if ( s>=0 ) return s;
+ break;
+ case 23 :
+ int LA14_57 = input.LA(1);
+
+
+ int index14_57 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred35_wcps()) ) {s = 46;}
+
+
+ input.seek(index14_57);
+ if ( s>=0 ) return s;
+ break;
+ case 24 :
+ int LA14_58 = input.LA(1);
+
+
+ int index14_58 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred35_wcps()) ) {s = 46;}
+
+
+ input.seek(index14_58);
+ if ( s>=0 ) return s;
+ break;
+ case 25 :
+ int LA14_59 = input.LA(1);
+
+
+ int index14_59 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred35_wcps()) ) {s = 46;}
+
+
+ input.seek(index14_59);
+ if ( s>=0 ) return s;
+ break;
+ case 26 :
+ int LA14_67 = input.LA(1);
+
+
+ int index14_67 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_67);
+ if ( s>=0 ) return s;
+ break;
+ case 27 :
+ int LA14_68 = input.LA(1);
+
+
+ int index14_68 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_68);
+ if ( s>=0 ) return s;
+ break;
+ case 28 :
+ int LA14_69 = input.LA(1);
+
+
+ int index14_69 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_69);
+ if ( s>=0 ) return s;
+ break;
+ case 29 :
+ int LA14_70 = input.LA(1);
+
+
+ int index14_70 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_70);
+ if ( s>=0 ) return s;
+ break;
+ case 30 :
+ int LA14_71 = input.LA(1);
+
+
+ int index14_71 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_71);
+ if ( s>=0 ) return s;
+ break;
+ case 31 :
+ int LA14_72 = input.LA(1);
+
+
+ int index14_72 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_72);
+ if ( s>=0 ) return s;
+ break;
+ case 32 :
+ int LA14_73 = input.LA(1);
+
+
+ int index14_73 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_73);
+ if ( s>=0 ) return s;
+ break;
+ case 33 :
+ int LA14_74 = input.LA(1);
+
+
+ int index14_74 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_74);
+ if ( s>=0 ) return s;
+ break;
+ case 34 :
+ int LA14_75 = input.LA(1);
+
+
+ int index14_75 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_75);
+ if ( s>=0 ) return s;
+ break;
+ case 35 :
+ int LA14_76 = input.LA(1);
+
+
+ int index14_76 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_76);
+ if ( s>=0 ) return s;
+ break;
+ case 36 :
+ int LA14_77 = input.LA(1);
+
+
+ int index14_77 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_77);
+ if ( s>=0 ) return s;
+ break;
+ case 37 :
+ int LA14_78 = input.LA(1);
+
+
+ int index14_78 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_78);
+ if ( s>=0 ) return s;
+ break;
+ case 38 :
+ int LA14_79 = input.LA(1);
+
+
+ int index14_79 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_79);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 14, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA34_eotS =
+ "\u0099\uffff";
+ static final String DFA34_eofS =
+ "\u0099\uffff";
+ static final String DFA34_minS =
+ "\1\6\12\uffff\1\6\1\uffff\3\6\5\uffff\1\6\7\uffff\1\70\1\116\57"+
+ "\uffff\12\0\24\uffff\3\0\7\uffff\14\0\24\uffff\2\0\1\uffff";
+ static final String DFA34_maxS =
+ "\1\154\12\uffff\1\154\1\uffff\1\154\2\6\5\uffff\1\154\7\uffff\1"+
+ "\70\1\153\57\uffff\12\0\24\uffff\3\0\7\uffff\14\0\24\uffff\2\0\1"+
+ "\uffff";
+ static final String DFA34_acceptS =
+ "\1\uffff\1\1\35\uffff\1\2\1\uffff\1\3\1\4\1\5\16\uffff\1\6\145\uffff"+
+ "\1\7";
+ static final String DFA34_specialS =
+ "\116\uffff\1\0\1\1\1\2\1\3\1\4\1\5\1\6\1\7\1\10\1\11\24\uffff\1"+
+ "\12\1\13\1\14\7\uffff\1\15\1\16\1\17\1\20\1\21\1\22\1\23\1\24\1"+
+ "\25\1\26\1\27\1\30\24\uffff\1\31\1\32\1\uffff}>";
+ static final String[] DFA34_transitionS = {
+ "\1\13\17\uffff\1\37\1\15\3\uffff\20\1\3\uffff\1\1\4\uffff\5"+
+ "\1\1\36\1\uffff\1\35\1\uffff\1\17\1\16\2\37\3\41\11\42\1\25"+
+ "\1\43\3\1\20\uffff\2\1\10\uffff\2\1",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\1\17\uffff\2\1\3\uffff\20\1\3\uffff\1\1\4\uffff\6\1\1\uffff"+
+ "\30\1\2\uffff\3\1\11\62\1\uffff\2\1\10\uffff\2\1",
+ "",
+ "\1\116\20\uffff\1\117\3\uffff\10\37\7\125\1\126\3\uffff\1\37"+
+ "\4\uffff\6\37\1\uffff\1\37\1\uffff\1\121\1\120\16\uffff\1\37"+
+ "\1\uffff\1\123\1\122\1\37\20\uffff\1\37\1\124\10\uffff\1\37"+
+ "\1\127",
+ "\1\154",
+ "\1\155",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\170\17\uffff\1\43\1\172\3\uffff\1\156\7\43\7\166\1\167\3"+
+ "\uffff\1\43\4\uffff\6\43\1\uffff\2\43\1\174\1\173\20\43\1\176"+
+ "\1\175\1\171\1\43\2\uffff\3\43\12\uffff\1\u0081\1\177\10\uffff"+
+ "\1\43\1\u0080",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\u0096",
+ "\1\u0097\1\uffff\1\u0097\32\uffff\1\u0097",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "\1\uffff",
+ ""
+ };
+
+ static final short[] DFA34_eot = DFA.unpackEncodedString(DFA34_eotS);
+ static final short[] DFA34_eof = DFA.unpackEncodedString(DFA34_eofS);
+ static final char[] DFA34_min = DFA.unpackEncodedStringToUnsignedChars(DFA34_minS);
+ static final char[] DFA34_max = DFA.unpackEncodedStringToUnsignedChars(DFA34_maxS);
+ static final short[] DFA34_accept = DFA.unpackEncodedString(DFA34_acceptS);
+ static final short[] DFA34_special = DFA.unpackEncodedString(DFA34_specialS);
+ static final short[][] DFA34_transition;
+
+ static {
+ int numStates = DFA34_transitionS.length;
+ DFA34_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA34_transition[i] = DFA.unpackEncodedString(DFA34_transitionS[i]);
+ }
+ }
+
+ class DFA34 extends DFA {
+
+ public DFA34(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 34;
+ this.eot = DFA34_eot;
+ this.eof = DFA34_eof;
+ this.min = DFA34_min;
+ this.max = DFA34_max;
+ this.accept = DFA34_accept;
+ this.special = DFA34_special;
+ this.transition = DFA34_transition;
+ }
+ public String getDescription() {
+ return "203:1: unaryInducedExpr returns [CoverageExpr value] : (e6= fieldExpr | e1= unaryArithmeticExpr | e2= exponentialExpr | e3= trigonometricExpr | e4= booleanExpr | e5= castExpr | e7= rangeConstructorExpr );";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA34_78 = input.LA(1);
+
+
+ int index34_78 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred71_wcps()) ) {s = 31;}
+
+
+ input.seek(index34_78);
+ if ( s>=0 ) return s;
+ break;
+ case 1 :
+ int LA34_79 = input.LA(1);
+
+
+ int index34_79 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred71_wcps()) ) {s = 31;}
+
+
+ input.seek(index34_79);
+ if ( s>=0 ) return s;
+ break;
+ case 2 :
+ int LA34_80 = input.LA(1);
+
+
+ int index34_80 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred71_wcps()) ) {s = 31;}
+
+
+ input.seek(index34_80);
+ if ( s>=0 ) return s;
+ break;
+ case 3 :
+ int LA34_81 = input.LA(1);
+
+
+ int index34_81 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred71_wcps()) ) {s = 31;}
+
+
+ input.seek(index34_81);
+ if ( s>=0 ) return s;
+ break;
+ case 4 :
+ int LA34_82 = input.LA(1);
+
+
+ int index34_82 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred71_wcps()) ) {s = 31;}
+
+
+ input.seek(index34_82);
+ if ( s>=0 ) return s;
+ break;
+ case 5 :
+ int LA34_83 = input.LA(1);
+
+
+ int index34_83 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred71_wcps()) ) {s = 31;}
+
+
+ input.seek(index34_83);
+ if ( s>=0 ) return s;
+ break;
+ case 6 :
+ int LA34_84 = input.LA(1);
+
+
+ int index34_84 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred71_wcps()) ) {s = 31;}
+
+
+ input.seek(index34_84);
+ if ( s>=0 ) return s;
+ break;
+ case 7 :
+ int LA34_85 = input.LA(1);
+
+
+ int index34_85 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred71_wcps()) ) {s = 31;}
+
+
+ input.seek(index34_85);
+ if ( s>=0 ) return s;
+ break;
+ case 8 :
+ int LA34_86 = input.LA(1);
+
+
+ int index34_86 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred71_wcps()) ) {s = 31;}
+
+
+ input.seek(index34_86);
+ if ( s>=0 ) return s;
+ break;
+ case 9 :
+ int LA34_87 = input.LA(1);
+
+
+ int index34_87 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred71_wcps()) ) {s = 31;}
+
+
+ input.seek(index34_87);
+ if ( s>=0 ) return s;
+ break;
+ case 10 :
+ int LA34_108 = input.LA(1);
+
+
+ int index34_108 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred71_wcps()) ) {s = 31;}
+
+
+ input.seek(index34_108);
+ if ( s>=0 ) return s;
+ break;
+ case 11 :
+ int LA34_109 = input.LA(1);
+
+
+ int index34_109 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred71_wcps()) ) {s = 31;}
+
+
+ input.seek(index34_109);
+ if ( s>=0 ) return s;
+ break;
+ case 12 :
+ int LA34_110 = input.LA(1);
+
+
+ int index34_110 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred74_wcps()) ) {s = 35;}
+
+
+ input.seek(index34_110);
+ if ( s>=0 ) return s;
+ break;
+ case 13 :
+ int LA34_118 = input.LA(1);
+
+
+ int index34_118 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred74_wcps()) ) {s = 35;}
+
+
+ input.seek(index34_118);
+ if ( s>=0 ) return s;
+ break;
+ case 14 :
+ int LA34_119 = input.LA(1);
+
+
+ int index34_119 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred74_wcps()) ) {s = 35;}
+
+
+ input.seek(index34_119);
+ if ( s>=0 ) return s;
+ break;
+ case 15 :
+ int LA34_120 = input.LA(1);
+
+
+ int index34_120 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred74_wcps()) ) {s = 35;}
+
+
+ input.seek(index34_120);
+ if ( s>=0 ) return s;
+ break;
+ case 16 :
+ int LA34_121 = input.LA(1);
+
+
+ int index34_121 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred74_wcps()) ) {s = 35;}
+
+
+ input.seek(index34_121);
+ if ( s>=0 ) return s;
+ break;
+ case 17 :
+ int LA34_122 = input.LA(1);
+
+
+ int index34_122 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred74_wcps()) ) {s = 35;}
+
+
+ input.seek(index34_122);
+ if ( s>=0 ) return s;
+ break;
+ case 18 :
+ int LA34_123 = input.LA(1);
+
+
+ int index34_123 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred74_wcps()) ) {s = 35;}
+
+
+ input.seek(index34_123);
+ if ( s>=0 ) return s;
+ break;
+ case 19 :
+ int LA34_124 = input.LA(1);
+
+
+ int index34_124 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred74_wcps()) ) {s = 35;}
+
+
+ input.seek(index34_124);
+ if ( s>=0 ) return s;
+ break;
+ case 20 :
+ int LA34_125 = input.LA(1);
+
+
+ int index34_125 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred74_wcps()) ) {s = 35;}
+
+
+ input.seek(index34_125);
+ if ( s>=0 ) return s;
+ break;
+ case 21 :
+ int LA34_126 = input.LA(1);
+
+
+ int index34_126 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred74_wcps()) ) {s = 35;}
+
+
+ input.seek(index34_126);
+ if ( s>=0 ) return s;
+ break;
+ case 22 :
+ int LA34_127 = input.LA(1);
+
+
+ int index34_127 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred74_wcps()) ) {s = 35;}
+
+
+ input.seek(index34_127);
+ if ( s>=0 ) return s;
+ break;
+ case 23 :
+ int LA34_128 = input.LA(1);
+
+
+ int index34_128 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred74_wcps()) ) {s = 35;}
+
+
+ input.seek(index34_128);
+ if ( s>=0 ) return s;
+ break;
+ case 24 :
+ int LA34_129 = input.LA(1);
+
+
+ int index34_129 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred74_wcps()) ) {s = 35;}
+
+
+ input.seek(index34_129);
+ if ( s>=0 ) return s;
+ break;
+ case 25 :
+ int LA34_150 = input.LA(1);
+
+
+ int index34_150 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (true) ) {s = 152;}
+
+
+ input.seek(index34_150);
+ if ( s>=0 ) return s;
+ break;
+ case 26 :
+ int LA34_151 = input.LA(1);
+
+
+ int index34_151 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (true) ) {s = 152;}
+
+
+ input.seek(index34_151);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 34, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA42_eotS =
+ "\u009c\uffff";
+ static final String DFA42_eofS =
+ "\u009c\uffff";
+ static final String DFA42_minS =
+ "\12\6\1\15\1\6\1\20\4\6\3\20\1\15\1\6\1\122\1\116\5\6\1\70\1\116"+
+ "\3\uffff\172\0";
+ static final String DFA42_maxS =
+ "\1\154\11\6\1\51\1\154\1\122\1\154\3\6\4\122\1\154\1\122\1\153\5"+
+ "\6\1\70\1\153\3\uffff\172\0";
+ static final String DFA42_acceptS =
+ "\37\uffff\1\1\1\2\1\3\172\uffff";
+ static final String DFA42_specialS =
+ "\42\uffff\1\0\1\1\1\2\1\3\1\4\1\5\1\6\1\7\1\10\1\11\1\12\1\13\1"+
+ "\14\1\15\1\16\1\17\1\20\1\21\1\22\1\23\1\24\1\25\1\26\1\27\1\30"+
+ "\1\31\1\32\1\33\1\34\1\35\1\36\1\37\1\40\1\41\1\42\1\43\1\44\1\45"+
+ "\1\46\1\47\1\50\1\51\1\52\1\53\1\54\1\55\1\56\1\57\1\60\1\61\1\62"+
+ "\1\63\1\64\1\65\1\66\1\67\1\70\1\71\1\72\1\73\1\74\1\75\1\76\1\77"+
+ "\1\100\1\101\1\102\1\103\1\104\1\105\1\106\1\107\1\110\1\111\1\112"+
+ "\1\113\1\114\1\115\1\116\1\117\1\120\1\121\1\122\1\123\1\124\1\125"+
+ "\1\126\1\127\1\130\1\131\1\132\1\133\1\134\1\135\1\136\1\137\1\140"+
+ "\1\141\1\142\1\143\1\144\1\145\1\146\1\147\1\150\1\151\1\152\1\153"+
+ "\1\154\1\155\1\156\1\157\1\160\1\161\1\162\1\163\1\164\1\165\1\166"+
+ "\1\167\1\170\1\171}>";
+ static final String[] DFA42_transitionS = {
+ "\1\13\20\uffff\1\15\3\uffff\1\1\1\2\1\3\1\4\1\6\1\7\1\10\1\5"+
+ "\7\11\1\12\3\uffff\1\27\4\uffff\1\30\1\31\1\32\1\33\1\34\1\36"+
+ "\1\uffff\1\35\1\uffff\1\17\1\16\16\uffff\1\25\1\uffff\1\21\1"+
+ "\20\1\14\3\uffff\1\37\1\40\1\41\12\uffff\1\24\1\22\10\uffff"+
+ "\1\26\1\23",
+ "\1\42",
+ "\1\43",
+ "\1\44",
+ "\1\45",
+ "\1\46",
+ "\1\47",
+ "\1\50",
+ "\1\51",
+ "\1\52",
+ "\1\53\1\uffff\1\53\6\uffff\1\53\1\uffff\1\53\17\uffff\2\53",
+ "\1\55\17\uffff\1\115\1\56\3\uffff\1\66\1\72\1\73\1\74\1\76"+
+ "\1\77\1\100\1\75\7\63\1\64\3\uffff\1\102\4\uffff\1\103\1\104"+
+ "\1\105\1\106\1\107\1\111\1\uffff\1\110\1\123\1\60\1\57\2\116"+
+ "\3\117\11\120\1\71\1\121\1\62\1\61\1\67\1\122\2\uffff\1\112"+
+ "\1\113\1\114\12\uffff\1\70\1\54\10\uffff\1\101\1\65",
+ "\1\124\1\125\1\126\1\127\1\130\1\131\74\uffff\1\132",
+ "\1\133\20\uffff\1\134\13\uffff\7\142\1\143\21\uffff\1\136\1"+
+ "\135\20\uffff\1\140\1\137\22\uffff\1\141\11\uffff\1\144",
+ "\1\145",
+ "\1\146",
+ "\1\147",
+ "\1\152\1\153\1\154\1\155\1\156\1\157\2\151\2\150\70\uffff\1"+
+ "\160",
+ "\1\164\1\165\1\166\1\167\1\170\1\171\2\162\2\161\70\uffff\1"+
+ "\163",
+ "\1\175\1\176\1\177\1\u0080\1\u0081\1\u0082\2\173\2\172\70\uffff"+
+ "\1\174",
+ "\2\u0084\1\u0083\102\uffff\1\u0085",
+ "\1\u0086\20\uffff\1\u0089\3\uffff\1\u0087\7\uffff\7\u008f\1"+
+ "\u0090\21\uffff\1\u008b\1\u008a\20\uffff\1\u008d\1\u008c\1\u0088"+
+ "\20\uffff\1\u0092\1\u008e\11\uffff\1\u0091",
+ "\1\u0093",
+ "\1\u0094\1\uffff\1\u0094\32\uffff\1\u0094",
+ "\1\u0095",
+ "\1\u0096",
+ "\1\u0097",
+ "\1\u0098",
+ "\1\u0099",
+ "\1\u009a",
+ "\1\u009b\1\uffff\1\u009b\32\uffff\1\u009b",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff"
+ };
+
+ static final short[] DFA42_eot = DFA.unpackEncodedString(DFA42_eotS);
+ static final short[] DFA42_eof = DFA.unpackEncodedString(DFA42_eofS);
+ static final char[] DFA42_min = DFA.unpackEncodedStringToUnsignedChars(DFA42_minS);
+ static final char[] DFA42_max = DFA.unpackEncodedStringToUnsignedChars(DFA42_maxS);
+ static final short[] DFA42_accept = DFA.unpackEncodedString(DFA42_acceptS);
+ static final short[] DFA42_special = DFA.unpackEncodedString(DFA42_specialS);
+ static final short[][] DFA42_transition;
+
+ static {
+ int numStates = DFA42_transitionS.length;
+ DFA42_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA42_transition[i] = DFA.unpackEncodedString(DFA42_transitionS[i]);
+ }
+ }
+
+ class DFA42 extends DFA {
+
+ public DFA42(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 42;
+ this.eot = DFA42_eot;
+ this.eof = DFA42_eof;
+ this.min = DFA42_min;
+ this.max = DFA42_max;
+ this.accept = DFA42_accept;
+ this.special = DFA42_special;
+ this.transition = DFA42_transition;
+ }
+ public String getDescription() {
+ return "250:1: subsetExpr returns [SubsetExpr value] : (e1= trimExpr | e2= sliceExpr | e3= extendExpr );";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA42_34 = input.LA(1);
+
+
+ int index42_34 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_34);
+ if ( s>=0 ) return s;
+ break;
+ case 1 :
+ int LA42_35 = input.LA(1);
+
+
+ int index42_35 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_35);
+ if ( s>=0 ) return s;
+ break;
+ case 2 :
+ int LA42_36 = input.LA(1);
+
+
+ int index42_36 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_36);
+ if ( s>=0 ) return s;
+ break;
+ case 3 :
+ int LA42_37 = input.LA(1);
+
+
+ int index42_37 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_37);
+ if ( s>=0 ) return s;
+ break;
+ case 4 :
+ int LA42_38 = input.LA(1);
+
+
+ int index42_38 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_38);
+ if ( s>=0 ) return s;
+ break;
+ case 5 :
+ int LA42_39 = input.LA(1);
+
+
+ int index42_39 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_39);
+ if ( s>=0 ) return s;
+ break;
+ case 6 :
+ int LA42_40 = input.LA(1);
+
+
+ int index42_40 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_40);
+ if ( s>=0 ) return s;
+ break;
+ case 7 :
+ int LA42_41 = input.LA(1);
+
+
+ int index42_41 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_41);
+ if ( s>=0 ) return s;
+ break;
+ case 8 :
+ int LA42_42 = input.LA(1);
+
+
+ int index42_42 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_42);
+ if ( s>=0 ) return s;
+ break;
+ case 9 :
+ int LA42_43 = input.LA(1);
+
+
+ int index42_43 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_43);
+ if ( s>=0 ) return s;
+ break;
+ case 10 :
+ int LA42_44 = input.LA(1);
+
+
+ int index42_44 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_44);
+ if ( s>=0 ) return s;
+ break;
+ case 11 :
+ int LA42_45 = input.LA(1);
+
+
+ int index42_45 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_45);
+ if ( s>=0 ) return s;
+ break;
+ case 12 :
+ int LA42_46 = input.LA(1);
+
+
+ int index42_46 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_46);
+ if ( s>=0 ) return s;
+ break;
+ case 13 :
+ int LA42_47 = input.LA(1);
+
+
+ int index42_47 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_47);
+ if ( s>=0 ) return s;
+ break;
+ case 14 :
+ int LA42_48 = input.LA(1);
+
+
+ int index42_48 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_48);
+ if ( s>=0 ) return s;
+ break;
+ case 15 :
+ int LA42_49 = input.LA(1);
+
+
+ int index42_49 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_49);
+ if ( s>=0 ) return s;
+ break;
+ case 16 :
+ int LA42_50 = input.LA(1);
+
+
+ int index42_50 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_50);
+ if ( s>=0 ) return s;
+ break;
+ case 17 :
+ int LA42_51 = input.LA(1);
+
+
+ int index42_51 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_51);
+ if ( s>=0 ) return s;
+ break;
+ case 18 :
+ int LA42_52 = input.LA(1);
+
+
+ int index42_52 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_52);
+ if ( s>=0 ) return s;
+ break;
+ case 19 :
+ int LA42_53 = input.LA(1);
+
+
+ int index42_53 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_53);
+ if ( s>=0 ) return s;
+ break;
+ case 20 :
+ int LA42_54 = input.LA(1);
+
+
+ int index42_54 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_54);
+ if ( s>=0 ) return s;
+ break;
+ case 21 :
+ int LA42_55 = input.LA(1);
+
+
+ int index42_55 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_55);
+ if ( s>=0 ) return s;
+ break;
+ case 22 :
+ int LA42_56 = input.LA(1);
+
+
+ int index42_56 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_56);
+ if ( s>=0 ) return s;
+ break;
+ case 23 :
+ int LA42_57 = input.LA(1);
+
+
+ int index42_57 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_57);
+ if ( s>=0 ) return s;
+ break;
+ case 24 :
+ int LA42_58 = input.LA(1);
+
+
+ int index42_58 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_58);
+ if ( s>=0 ) return s;
+ break;
+ case 25 :
+ int LA42_59 = input.LA(1);
+
+
+ int index42_59 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_59);
+ if ( s>=0 ) return s;
+ break;
+ case 26 :
+ int LA42_60 = input.LA(1);
+
+
+ int index42_60 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_60);
+ if ( s>=0 ) return s;
+ break;
+ case 27 :
+ int LA42_61 = input.LA(1);
+
+
+ int index42_61 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_61);
+ if ( s>=0 ) return s;
+ break;
+ case 28 :
+ int LA42_62 = input.LA(1);
+
+
+ int index42_62 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_62);
+ if ( s>=0 ) return s;
+ break;
+ case 29 :
+ int LA42_63 = input.LA(1);
+
+
+ int index42_63 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_63);
+ if ( s>=0 ) return s;
+ break;
+ case 30 :
+ int LA42_64 = input.LA(1);
+
+
+ int index42_64 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_64);
+ if ( s>=0 ) return s;
+ break;
+ case 31 :
+ int LA42_65 = input.LA(1);
+
+
+ int index42_65 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_65);
+ if ( s>=0 ) return s;
+ break;
+ case 32 :
+ int LA42_66 = input.LA(1);
+
+
+ int index42_66 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_66);
+ if ( s>=0 ) return s;
+ break;
+ case 33 :
+ int LA42_67 = input.LA(1);
+
+
+ int index42_67 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_67);
+ if ( s>=0 ) return s;
+ break;
+ case 34 :
+ int LA42_68 = input.LA(1);
+
+
+ int index42_68 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_68);
+ if ( s>=0 ) return s;
+ break;
+ case 35 :
+ int LA42_69 = input.LA(1);
+
+
+ int index42_69 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_69);
+ if ( s>=0 ) return s;
+ break;
+ case 36 :
+ int LA42_70 = input.LA(1);
+
+
+ int index42_70 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_70);
+ if ( s>=0 ) return s;
+ break;
+ case 37 :
+ int LA42_71 = input.LA(1);
+
+
+ int index42_71 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_71);
+ if ( s>=0 ) return s;
+ break;
+ case 38 :
+ int LA42_72 = input.LA(1);
+
+
+ int index42_72 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_72);
+ if ( s>=0 ) return s;
+ break;
+ case 39 :
+ int LA42_73 = input.LA(1);
+
+
+ int index42_73 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_73);
+ if ( s>=0 ) return s;
+ break;
+ case 40 :
+ int LA42_74 = input.LA(1);
+
+
+ int index42_74 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_74);
+ if ( s>=0 ) return s;
+ break;
+ case 41 :
+ int LA42_75 = input.LA(1);
+
+
+ int index42_75 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_75);
+ if ( s>=0 ) return s;
+ break;
+ case 42 :
+ int LA42_76 = input.LA(1);
+
+
+ int index42_76 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_76);
+ if ( s>=0 ) return s;
+ break;
+ case 43 :
+ int LA42_77 = input.LA(1);
+
+
+ int index42_77 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_77);
+ if ( s>=0 ) return s;
+ break;
+ case 44 :
+ int LA42_78 = input.LA(1);
+
+
+ int index42_78 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_78);
+ if ( s>=0 ) return s;
+ break;
+ case 45 :
+ int LA42_79 = input.LA(1);
+
+
+ int index42_79 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_79);
+ if ( s>=0 ) return s;
+ break;
+ case 46 :
+ int LA42_80 = input.LA(1);
+
+
+ int index42_80 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_80);
+ if ( s>=0 ) return s;
+ break;
+ case 47 :
+ int LA42_81 = input.LA(1);
+
+
+ int index42_81 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_81);
+ if ( s>=0 ) return s;
+ break;
+ case 48 :
+ int LA42_82 = input.LA(1);
+
+
+ int index42_82 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_82);
+ if ( s>=0 ) return s;
+ break;
+ case 49 :
+ int LA42_83 = input.LA(1);
+
+
+ int index42_83 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_83);
+ if ( s>=0 ) return s;
+ break;
+ case 50 :
+ int LA42_84 = input.LA(1);
+
+
+ int index42_84 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_84);
+ if ( s>=0 ) return s;
+ break;
+ case 51 :
+ int LA42_85 = input.LA(1);
+
+
+ int index42_85 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_85);
+ if ( s>=0 ) return s;
+ break;
+ case 52 :
+ int LA42_86 = input.LA(1);
+
+
+ int index42_86 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_86);
+ if ( s>=0 ) return s;
+ break;
+ case 53 :
+ int LA42_87 = input.LA(1);
+
+
+ int index42_87 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_87);
+ if ( s>=0 ) return s;
+ break;
+ case 54 :
+ int LA42_88 = input.LA(1);
+
+
+ int index42_88 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_88);
+ if ( s>=0 ) return s;
+ break;
+ case 55 :
+ int LA42_89 = input.LA(1);
+
+
+ int index42_89 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_89);
+ if ( s>=0 ) return s;
+ break;
+ case 56 :
+ int LA42_90 = input.LA(1);
+
+
+ int index42_90 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_90);
+ if ( s>=0 ) return s;
+ break;
+ case 57 :
+ int LA42_91 = input.LA(1);
+
+
+ int index42_91 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_91);
+ if ( s>=0 ) return s;
+ break;
+ case 58 :
+ int LA42_92 = input.LA(1);
+
+
+ int index42_92 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_92);
+ if ( s>=0 ) return s;
+ break;
+ case 59 :
+ int LA42_93 = input.LA(1);
+
+
+ int index42_93 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_93);
+ if ( s>=0 ) return s;
+ break;
+ case 60 :
+ int LA42_94 = input.LA(1);
+
+
+ int index42_94 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_94);
+ if ( s>=0 ) return s;
+ break;
+ case 61 :
+ int LA42_95 = input.LA(1);
+
+
+ int index42_95 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_95);
+ if ( s>=0 ) return s;
+ break;
+ case 62 :
+ int LA42_96 = input.LA(1);
+
+
+ int index42_96 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_96);
+ if ( s>=0 ) return s;
+ break;
+ case 63 :
+ int LA42_97 = input.LA(1);
+
+
+ int index42_97 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_97);
+ if ( s>=0 ) return s;
+ break;
+ case 64 :
+ int LA42_98 = input.LA(1);
+
+
+ int index42_98 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_98);
+ if ( s>=0 ) return s;
+ break;
+ case 65 :
+ int LA42_99 = input.LA(1);
+
+
+ int index42_99 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_99);
+ if ( s>=0 ) return s;
+ break;
+ case 66 :
+ int LA42_100 = input.LA(1);
+
+
+ int index42_100 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_100);
+ if ( s>=0 ) return s;
+ break;
+ case 67 :
+ int LA42_101 = input.LA(1);
+
+
+ int index42_101 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_101);
+ if ( s>=0 ) return s;
+ break;
+ case 68 :
+ int LA42_102 = input.LA(1);
+
+
+ int index42_102 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_102);
+ if ( s>=0 ) return s;
+ break;
+ case 69 :
+ int LA42_103 = input.LA(1);
+
+
+ int index42_103 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_103);
+ if ( s>=0 ) return s;
+ break;
+ case 70 :
+ int LA42_104 = input.LA(1);
+
+
+ int index42_104 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_104);
+ if ( s>=0 ) return s;
+ break;
+ case 71 :
+ int LA42_105 = input.LA(1);
+
+
+ int index42_105 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_105);
+ if ( s>=0 ) return s;
+ break;
+ case 72 :
+ int LA42_106 = input.LA(1);
+
+
+ int index42_106 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_106);
+ if ( s>=0 ) return s;
+ break;
+ case 73 :
+ int LA42_107 = input.LA(1);
+
+
+ int index42_107 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_107);
+ if ( s>=0 ) return s;
+ break;
+ case 74 :
+ int LA42_108 = input.LA(1);
+
+
+ int index42_108 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_108);
+ if ( s>=0 ) return s;
+ break;
+ case 75 :
+ int LA42_109 = input.LA(1);
+
+
+ int index42_109 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_109);
+ if ( s>=0 ) return s;
+ break;
+ case 76 :
+ int LA42_110 = input.LA(1);
+
+
+ int index42_110 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_110);
+ if ( s>=0 ) return s;
+ break;
+ case 77 :
+ int LA42_111 = input.LA(1);
+
+
+ int index42_111 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_111);
+ if ( s>=0 ) return s;
+ break;
+ case 78 :
+ int LA42_112 = input.LA(1);
+
+
+ int index42_112 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_112);
+ if ( s>=0 ) return s;
+ break;
+ case 79 :
+ int LA42_113 = input.LA(1);
+
+
+ int index42_113 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_113);
+ if ( s>=0 ) return s;
+ break;
+ case 80 :
+ int LA42_114 = input.LA(1);
+
+
+ int index42_114 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_114);
+ if ( s>=0 ) return s;
+ break;
+ case 81 :
+ int LA42_115 = input.LA(1);
+
+
+ int index42_115 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_115);
+ if ( s>=0 ) return s;
+ break;
+ case 82 :
+ int LA42_116 = input.LA(1);
+
+
+ int index42_116 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_116);
+ if ( s>=0 ) return s;
+ break;
+ case 83 :
+ int LA42_117 = input.LA(1);
+
+
+ int index42_117 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_117);
+ if ( s>=0 ) return s;
+ break;
+ case 84 :
+ int LA42_118 = input.LA(1);
+
+
+ int index42_118 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_118);
+ if ( s>=0 ) return s;
+ break;
+ case 85 :
+ int LA42_119 = input.LA(1);
+
+
+ int index42_119 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_119);
+ if ( s>=0 ) return s;
+ break;
+ case 86 :
+ int LA42_120 = input.LA(1);
+
+
+ int index42_120 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_120);
+ if ( s>=0 ) return s;
+ break;
+ case 87 :
+ int LA42_121 = input.LA(1);
+
+
+ int index42_121 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_121);
+ if ( s>=0 ) return s;
+ break;
+ case 88 :
+ int LA42_122 = input.LA(1);
+
+
+ int index42_122 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_122);
+ if ( s>=0 ) return s;
+ break;
+ case 89 :
+ int LA42_123 = input.LA(1);
+
+
+ int index42_123 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_123);
+ if ( s>=0 ) return s;
+ break;
+ case 90 :
+ int LA42_124 = input.LA(1);
+
+
+ int index42_124 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_124);
+ if ( s>=0 ) return s;
+ break;
+ case 91 :
+ int LA42_125 = input.LA(1);
+
+
+ int index42_125 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_125);
+ if ( s>=0 ) return s;
+ break;
+ case 92 :
+ int LA42_126 = input.LA(1);
+
+
+ int index42_126 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_126);
+ if ( s>=0 ) return s;
+ break;
+ case 93 :
+ int LA42_127 = input.LA(1);
+
+
+ int index42_127 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_127);
+ if ( s>=0 ) return s;
+ break;
+ case 94 :
+ int LA42_128 = input.LA(1);
+
+
+ int index42_128 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_128);
+ if ( s>=0 ) return s;
+ break;
+ case 95 :
+ int LA42_129 = input.LA(1);
+
+
+ int index42_129 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_129);
+ if ( s>=0 ) return s;
+ break;
+ case 96 :
+ int LA42_130 = input.LA(1);
+
+
+ int index42_130 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_130);
+ if ( s>=0 ) return s;
+ break;
+ case 97 :
+ int LA42_131 = input.LA(1);
+
+
+ int index42_131 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_131);
+ if ( s>=0 ) return s;
+ break;
+ case 98 :
+ int LA42_132 = input.LA(1);
+
+
+ int index42_132 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_132);
+ if ( s>=0 ) return s;
+ break;
+ case 99 :
+ int LA42_133 = input.LA(1);
+
+
+ int index42_133 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_133);
+ if ( s>=0 ) return s;
+ break;
+ case 100 :
+ int LA42_134 = input.LA(1);
+
+
+ int index42_134 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_134);
+ if ( s>=0 ) return s;
+ break;
+ case 101 :
+ int LA42_135 = input.LA(1);
+
+
+ int index42_135 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_135);
+ if ( s>=0 ) return s;
+ break;
+ case 102 :
+ int LA42_136 = input.LA(1);
+
+
+ int index42_136 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_136);
+ if ( s>=0 ) return s;
+ break;
+ case 103 :
+ int LA42_137 = input.LA(1);
+
+
+ int index42_137 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_137);
+ if ( s>=0 ) return s;
+ break;
+ case 104 :
+ int LA42_138 = input.LA(1);
+
+
+ int index42_138 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_138);
+ if ( s>=0 ) return s;
+ break;
+ case 105 :
+ int LA42_139 = input.LA(1);
+
+
+ int index42_139 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_139);
+ if ( s>=0 ) return s;
+ break;
+ case 106 :
+ int LA42_140 = input.LA(1);
+
+
+ int index42_140 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_140);
+ if ( s>=0 ) return s;
+ break;
+ case 107 :
+ int LA42_141 = input.LA(1);
+
+
+ int index42_141 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_141);
+ if ( s>=0 ) return s;
+ break;
+ case 108 :
+ int LA42_142 = input.LA(1);
+
+
+ int index42_142 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_142);
+ if ( s>=0 ) return s;
+ break;
+ case 109 :
+ int LA42_143 = input.LA(1);
+
+
+ int index42_143 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_143);
+ if ( s>=0 ) return s;
+ break;
+ case 110 :
+ int LA42_144 = input.LA(1);
+
+
+ int index42_144 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_144);
+ if ( s>=0 ) return s;
+ break;
+ case 111 :
+ int LA42_145 = input.LA(1);
+
+
+ int index42_145 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_145);
+ if ( s>=0 ) return s;
+ break;
+ case 112 :
+ int LA42_146 = input.LA(1);
+
+
+ int index42_146 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_146);
+ if ( s>=0 ) return s;
+ break;
+ case 113 :
+ int LA42_147 = input.LA(1);
+
+
+ int index42_147 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_147);
+ if ( s>=0 ) return s;
+ break;
+ case 114 :
+ int LA42_148 = input.LA(1);
+
+
+ int index42_148 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_148);
+ if ( s>=0 ) return s;
+ break;
+ case 115 :
+ int LA42_149 = input.LA(1);
+
+
+ int index42_149 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_149);
+ if ( s>=0 ) return s;
+ break;
+ case 116 :
+ int LA42_150 = input.LA(1);
+
+
+ int index42_150 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_150);
+ if ( s>=0 ) return s;
+ break;
+ case 117 :
+ int LA42_151 = input.LA(1);
+
+
+ int index42_151 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_151);
+ if ( s>=0 ) return s;
+ break;
+ case 118 :
+ int LA42_152 = input.LA(1);
+
+
+ int index42_152 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_152);
+ if ( s>=0 ) return s;
+ break;
+ case 119 :
+ int LA42_153 = input.LA(1);
+
+
+ int index42_153 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_153);
+ if ( s>=0 ) return s;
+ break;
+ case 120 :
+ int LA42_154 = input.LA(1);
+
+
+ int index42_154 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_154);
+ if ( s>=0 ) return s;
+ break;
+ case 121 :
+ int LA42_155 = input.LA(1);
+
+
+ int index42_155 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_155);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 42, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA43_eotS =
+ "\40\uffff";
+ static final String DFA43_eofS =
+ "\40\uffff";
+ static final String DFA43_minS =
+ "\1\6\37\uffff";
+ static final String DFA43_maxS =
+ "\1\154\37\uffff";
+ static final String DFA43_acceptS =
+ "\1\uffff\1\1\35\uffff\1\2";
+ static final String DFA43_specialS =
+ "\40\uffff}>";
+ static final String[] DFA43_transitionS = {
+ "\1\1\20\uffff\1\1\3\uffff\20\1\3\uffff\1\1\4\uffff\6\1\1\uffff"+
+ "\1\1\1\uffff\2\1\16\uffff\1\1\1\uffff\3\1\3\uffff\1\37\14\uffff"+
+ "\2\1\10\uffff\2\1",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA43_eot = DFA.unpackEncodedString(DFA43_eotS);
+ static final short[] DFA43_eof = DFA.unpackEncodedString(DFA43_eofS);
+ static final char[] DFA43_min = DFA.unpackEncodedStringToUnsignedChars(DFA43_minS);
+ static final char[] DFA43_max = DFA.unpackEncodedStringToUnsignedChars(DFA43_maxS);
+ static final short[] DFA43_accept = DFA.unpackEncodedString(DFA43_acceptS);
+ static final short[] DFA43_special = DFA.unpackEncodedString(DFA43_specialS);
+ static final short[][] DFA43_transition;
+
+ static {
+ int numStates = DFA43_transitionS.length;
+ DFA43_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA43_transition[i] = DFA.unpackEncodedString(DFA43_transitionS[i]);
+ }
+ }
+
+ class DFA43 extends DFA {
+
+ public DFA43(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 43;
+ this.eot = DFA43_eot;
+ this.eof = DFA43_eof;
+ this.min = DFA43_min;
+ this.max = DFA43_max;
+ this.accept = DFA43_accept;
+ this.special = DFA43_special;
+ this.transition = DFA43_transition;
+ }
+ public String getDescription() {
+ return "255:1: trimExpr returns [TrimExpr value] : (e1= coverageAtom LBRACKET dil= dimensionIntervalList RBRACKET | TRIM LPAREN e2= coverageExpr COMMA LBRACE dil= dimensionIntervalList RBRACE RPAREN );";
+ }
+ }
+ static final String DFA44_eotS =
+ "\40\uffff";
+ static final String DFA44_eofS =
+ "\40\uffff";
+ static final String DFA44_minS =
+ "\1\6\37\uffff";
+ static final String DFA44_maxS =
+ "\1\154\37\uffff";
+ static final String DFA44_acceptS =
+ "\1\uffff\1\1\35\uffff\1\2";
+ static final String DFA44_specialS =
+ "\40\uffff}>";
+ static final String[] DFA44_transitionS = {
+ "\1\1\20\uffff\1\1\3\uffff\20\1\3\uffff\1\1\4\uffff\6\1\1\uffff"+
+ "\1\1\1\uffff\2\1\16\uffff\1\1\1\uffff\3\1\4\uffff\1\37\13\uffff"+
+ "\2\1\10\uffff\2\1",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA44_eot = DFA.unpackEncodedString(DFA44_eotS);
+ static final short[] DFA44_eof = DFA.unpackEncodedString(DFA44_eofS);
+ static final char[] DFA44_min = DFA.unpackEncodedStringToUnsignedChars(DFA44_minS);
+ static final char[] DFA44_max = DFA.unpackEncodedStringToUnsignedChars(DFA44_maxS);
+ static final short[] DFA44_accept = DFA.unpackEncodedString(DFA44_acceptS);
+ static final short[] DFA44_special = DFA.unpackEncodedString(DFA44_specialS);
+ static final short[][] DFA44_transition;
+
+ static {
+ int numStates = DFA44_transitionS.length;
+ DFA44_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA44_transition[i] = DFA.unpackEncodedString(DFA44_transitionS[i]);
+ }
+ }
+
+ class DFA44 extends DFA {
+
+ public DFA44(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 44;
+ this.eot = DFA44_eot;
+ this.eof = DFA44_eof;
+ this.min = DFA44_min;
+ this.max = DFA44_max;
+ this.accept = DFA44_accept;
+ this.special = DFA44_special;
+ this.transition = DFA44_transition;
+ }
+ public String getDescription() {
+ return "259:1: sliceExpr returns [SliceExpr value] : (e1= coverageAtom LBRACKET dpl= dimensionPointList RBRACKET | SLICE LPAREN e2= coverageExpr COMMA LBRACE dpl= dimensionPointList RBRACE RPAREN );";
+ }
+ }
+ static final String DFA46_eotS =
+ "\77\uffff";
+ static final String DFA46_eofS =
+ "\1\1\76\uffff";
+ static final String DFA46_minS =
+ "\1\7\7\uffff\1\0\66\uffff";
+ static final String DFA46_maxS =
+ "\1\140\7\uffff\1\0\66\uffff";
+ static final String DFA46_acceptS =
+ "\1\uffff\1\2\74\uffff\1\1";
+ static final String DFA46_specialS =
+ "\10\uffff\1\0\66\uffff}>";
+ static final String[] DFA46_transitionS = {
+ "\2\1\1\uffff\1\1\2\uffff\2\10\14\1\21\uffff\2\1\3\uffff\1\1"+
+ "\7\uffff\1\1\30\uffff\1\1\15\uffff\1\1",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA46_eot = DFA.unpackEncodedString(DFA46_eotS);
+ static final short[] DFA46_eof = DFA.unpackEncodedString(DFA46_eofS);
+ static final char[] DFA46_min = DFA.unpackEncodedStringToUnsignedChars(DFA46_minS);
+ static final char[] DFA46_max = DFA.unpackEncodedStringToUnsignedChars(DFA46_maxS);
+ static final short[] DFA46_accept = DFA.unpackEncodedString(DFA46_acceptS);
+ static final short[] DFA46_special = DFA.unpackEncodedString(DFA46_specialS);
+ static final short[][] DFA46_transition;
+
+ static {
+ int numStates = DFA46_transitionS.length;
+ DFA46_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA46_transition[i] = DFA.unpackEncodedString(DFA46_transitionS[i]);
+ }
+ }
+
+ class DFA46 extends DFA {
+
+ public DFA46(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 46;
+ this.eot = DFA46_eot;
+ this.eof = DFA46_eof;
+ this.min = DFA46_min;
+ this.max = DFA46_max;
+ this.accept = DFA46_accept;
+ this.special = DFA46_special;
+ this.transition = DFA46_transition;
+ }
+ public String getDescription() {
+ return "()* loopback of 280:7: (op= ( OR | XOR ) e2= booleanScalarTerm )*";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA46_8 = input.LA(1);
+
+
+ int index46_8 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred115_wcps()) ) {s = 62;}
+
+ else if ( (true) ) {s = 1;}
+
+
+ input.seek(index46_8);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 46, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA47_eotS =
+ "\77\uffff";
+ static final String DFA47_eofS =
+ "\1\1\76\uffff";
+ static final String DFA47_minS =
+ "\1\7\7\uffff\1\0\66\uffff";
+ static final String DFA47_maxS =
+ "\1\140\7\uffff\1\0\66\uffff";
+ static final String DFA47_acceptS =
+ "\1\uffff\1\2\74\uffff\1\1";
+ static final String DFA47_specialS =
+ "\10\uffff\1\0\66\uffff}>";
+ static final String[] DFA47_transitionS = {
+ "\2\1\1\uffff\1\1\2\uffff\2\1\1\10\13\1\21\uffff\2\1\3\uffff"+
+ "\1\1\7\uffff\1\1\30\uffff\1\1\15\uffff\1\1",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA47_eot = DFA.unpackEncodedString(DFA47_eotS);
+ static final short[] DFA47_eof = DFA.unpackEncodedString(DFA47_eofS);
+ static final char[] DFA47_min = DFA.unpackEncodedStringToUnsignedChars(DFA47_minS);
+ static final char[] DFA47_max = DFA.unpackEncodedStringToUnsignedChars(DFA47_maxS);
+ static final short[] DFA47_accept = DFA.unpackEncodedString(DFA47_acceptS);
+ static final short[] DFA47_special = DFA.unpackEncodedString(DFA47_specialS);
+ static final short[][] DFA47_transition;
+
+ static {
+ int numStates = DFA47_transitionS.length;
+ DFA47_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA47_transition[i] = DFA.unpackEncodedString(DFA47_transitionS[i]);
+ }
+ }
+
+ class DFA47 extends DFA {
+
+ public DFA47(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 47;
+ this.eot = DFA47_eot;
+ this.eof = DFA47_eof;
+ this.min = DFA47_min;
+ this.max = DFA47_max;
+ this.accept = DFA47_accept;
+ this.special = DFA47_special;
+ this.transition = DFA47_transition;
+ }
+ public String getDescription() {
+ return "()* loopback of 284:4: (op= AND e2= booleanScalarNegation )*";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA47_8 = input.LA(1);
+
+
+ int index47_8 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred116_wcps()) ) {s = 62;}
+
+ else if ( (true) ) {s = 1;}
+
+
+ input.seek(index47_8);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 47, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA48_eotS =
+ "\17\uffff";
+ static final String DFA48_eofS =
+ "\17\uffff";
+ static final String DFA48_minS =
+ "\1\6\16\uffff";
+ static final String DFA48_maxS =
+ "\1\154\16\uffff";
+ static final String DFA48_acceptS =
+ "\1\uffff\1\1\14\uffff\1\2";
+ static final String DFA48_specialS =
+ "\17\uffff}>";
+ static final String[] DFA48_transitionS = {
+ "\1\1\20\uffff\1\1\3\uffff\1\1\7\uffff\10\1\21\uffff\2\1\16\uffff"+
+ "\1\16\1\uffff\3\1\20\uffff\2\1\11\uffff\1\1",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA48_eot = DFA.unpackEncodedString(DFA48_eotS);
+ static final short[] DFA48_eof = DFA.unpackEncodedString(DFA48_eofS);
+ static final char[] DFA48_min = DFA.unpackEncodedStringToUnsignedChars(DFA48_minS);
+ static final char[] DFA48_max = DFA.unpackEncodedStringToUnsignedChars(DFA48_maxS);
+ static final short[] DFA48_accept = DFA.unpackEncodedString(DFA48_acceptS);
+ static final short[] DFA48_special = DFA.unpackEncodedString(DFA48_specialS);
+ static final short[][] DFA48_transition;
+
+ static {
+ int numStates = DFA48_transitionS.length;
+ DFA48_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA48_transition[i] = DFA.unpackEncodedString(DFA48_transitionS[i]);
+ }
+ }
+
+ class DFA48 extends DFA {
+
+ public DFA48(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 48;
+ this.eot = DFA48_eot;
+ this.eof = DFA48_eof;
+ this.min = DFA48_min;
+ this.max = DFA48_max;
+ this.accept = DFA48_accept;
+ this.special = DFA48_special;
+ this.transition = DFA48_transition;
+ }
+ public String getDescription() {
+ return "286:1: booleanScalarNegation returns [BooleanScalarExpr value] : (e1= booleanScalarAtom | op= NOT e1= booleanScalarAtom );";
+ }
+ }
+ static final String DFA49_eotS =
+ "\34\uffff";
+ static final String DFA49_eofS =
+ "\34\uffff";
+ static final String DFA49_minS =
+ "\2\6\14\uffff\12\0\4\uffff";
+ static final String DFA49_maxS =
+ "\2\154\14\uffff\12\0\4\uffff";
+ static final String DFA49_acceptS =
+ "\2\uffff\1\2\1\uffff\1\3\10\uffff\1\4\12\uffff\1\1\3\uffff";
+ static final String DFA49_specialS =
+ "\16\uffff\1\0\1\1\1\2\1\3\1\4\1\5\1\6\1\7\1\10\1\11\4\uffff}>";
+ static final String[] DFA49_transitionS = {
+ "\1\1\20\uffff\1\4\3\uffff\1\2\7\uffff\10\4\21\uffff\2\4\20\uffff"+
+ "\2\4\1\2\20\uffff\1\15\1\4\11\uffff\1\4",
+ "\1\17\20\uffff\1\20\3\uffff\1\30\7\uffff\7\25\1\26\21\uffff"+
+ "\1\22\1\21\16\uffff\1\30\1\uffff\1\24\1\23\1\30\20\uffff\1\30"+
+ "\1\16\11\uffff\1\27",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA49_eot = DFA.unpackEncodedString(DFA49_eotS);
+ static final short[] DFA49_eof = DFA.unpackEncodedString(DFA49_eofS);
+ static final char[] DFA49_min = DFA.unpackEncodedStringToUnsignedChars(DFA49_minS);
+ static final char[] DFA49_max = DFA.unpackEncodedStringToUnsignedChars(DFA49_maxS);
+ static final short[] DFA49_accept = DFA.unpackEncodedString(DFA49_acceptS);
+ static final short[] DFA49_special = DFA.unpackEncodedString(DFA49_specialS);
+ static final short[][] DFA49_transition;
+
+ static {
+ int numStates = DFA49_transitionS.length;
+ DFA49_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA49_transition[i] = DFA.unpackEncodedString(DFA49_transitionS[i]);
+ }
+ }
+
+ class DFA49 extends DFA {
+
+ public DFA49(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 49;
+ this.eot = DFA49_eot;
+ this.eof = DFA49_eof;
+ this.min = DFA49_min;
+ this.max = DFA49_max;
+ this.accept = DFA49_accept;
+ this.special = DFA49_special;
+ this.transition = DFA49_transition;
+ }
+ public String getDescription() {
+ return "290:1: booleanScalarAtom returns [BooleanScalarExpr value] : ( LPAREN e1= booleanScalarExpr RPAREN | s1= stringScalarExpr cop= compOp s2= stringScalarExpr | n1= numericScalarExpr cop= compOp n2= numericScalarExpr | e= BOOLEANCONSTANT );";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA49_14 = input.LA(1);
+
+
+ int index49_14 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred118_wcps()) ) {s = 24;}
+
+ else if ( (synpred120_wcps()) ) {s = 4;}
+
+
+ input.seek(index49_14);
+ if ( s>=0 ) return s;
+ break;
+ case 1 :
+ int LA49_15 = input.LA(1);
+
+
+ int index49_15 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred118_wcps()) ) {s = 24;}
+
+ else if ( (synpred120_wcps()) ) {s = 4;}
+
+
+ input.seek(index49_15);
+ if ( s>=0 ) return s;
+ break;
+ case 2 :
+ int LA49_16 = input.LA(1);
+
+
+ int index49_16 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred118_wcps()) ) {s = 24;}
+
+ else if ( (synpred120_wcps()) ) {s = 4;}
+
+
+ input.seek(index49_16);
+ if ( s>=0 ) return s;
+ break;
+ case 3 :
+ int LA49_17 = input.LA(1);
+
+
+ int index49_17 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred118_wcps()) ) {s = 24;}
+
+ else if ( (synpred120_wcps()) ) {s = 4;}
+
+
+ input.seek(index49_17);
+ if ( s>=0 ) return s;
+ break;
+ case 4 :
+ int LA49_18 = input.LA(1);
+
+
+ int index49_18 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred118_wcps()) ) {s = 24;}
+
+ else if ( (synpred120_wcps()) ) {s = 4;}
+
+
+ input.seek(index49_18);
+ if ( s>=0 ) return s;
+ break;
+ case 5 :
+ int LA49_19 = input.LA(1);
+
+
+ int index49_19 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred118_wcps()) ) {s = 24;}
+
+ else if ( (synpred120_wcps()) ) {s = 4;}
+
+
+ input.seek(index49_19);
+ if ( s>=0 ) return s;
+ break;
+ case 6 :
+ int LA49_20 = input.LA(1);
+
+
+ int index49_20 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred118_wcps()) ) {s = 24;}
+
+ else if ( (synpred120_wcps()) ) {s = 4;}
+
+
+ input.seek(index49_20);
+ if ( s>=0 ) return s;
+ break;
+ case 7 :
+ int LA49_21 = input.LA(1);
+
+
+ int index49_21 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred118_wcps()) ) {s = 24;}
+
+ else if ( (synpred120_wcps()) ) {s = 4;}
+
+
+ input.seek(index49_21);
+ if ( s>=0 ) return s;
+ break;
+ case 8 :
+ int LA49_22 = input.LA(1);
+
+
+ int index49_22 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred118_wcps()) ) {s = 24;}
+
+ else if ( (synpred120_wcps()) ) {s = 4;}
+
+
+ input.seek(index49_22);
+ if ( s>=0 ) return s;
+ break;
+ case 9 :
+ int LA49_23 = input.LA(1);
+
+
+ int index49_23 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred118_wcps()) ) {s = 24;}
+
+ else if ( (synpred120_wcps()) ) {s = 4;}
+
+
+ input.seek(index49_23);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 49, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA50_eotS =
+ "\77\uffff";
+ static final String DFA50_eofS =
+ "\1\1\76\uffff";
+ static final String DFA50_minS =
+ "\1\7\3\uffff\1\0\72\uffff";
+ static final String DFA50_maxS =
+ "\1\140\3\uffff\1\0\72\uffff";
+ static final String DFA50_acceptS =
+ "\1\uffff\1\2\74\uffff\1\1";
+ static final String DFA50_specialS =
+ "\4\uffff\1\0\72\uffff}>";
+ static final String[] DFA50_transitionS = {
+ "\2\1\1\uffff\1\1\2\uffff\11\1\2\4\3\1\21\uffff\2\1\3\uffff\1"+
+ "\1\7\uffff\1\1\30\uffff\1\1\15\uffff\1\1",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA50_eot = DFA.unpackEncodedString(DFA50_eotS);
+ static final short[] DFA50_eof = DFA.unpackEncodedString(DFA50_eofS);
+ static final char[] DFA50_min = DFA.unpackEncodedStringToUnsignedChars(DFA50_minS);
+ static final char[] DFA50_max = DFA.unpackEncodedStringToUnsignedChars(DFA50_maxS);
+ static final short[] DFA50_accept = DFA.unpackEncodedString(DFA50_acceptS);
+ static final short[] DFA50_special = DFA.unpackEncodedString(DFA50_specialS);
+ static final short[][] DFA50_transition;
+
+ static {
+ int numStates = DFA50_transitionS.length;
+ DFA50_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA50_transition[i] = DFA.unpackEncodedString(DFA50_transitionS[i]);
+ }
+ }
+
+ class DFA50 extends DFA {
+
+ public DFA50(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 50;
+ this.eot = DFA50_eot;
+ this.eof = DFA50_eof;
+ this.min = DFA50_min;
+ this.max = DFA50_max;
+ this.accept = DFA50_accept;
+ this.special = DFA50_special;
+ this.transition = DFA50_transition;
+ }
+ public String getDescription() {
+ return "()* loopback of 298:4: (op= ( PLUS | MINUS ) e2= numericScalarTerm )*";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA50_4 = input.LA(1);
+
+
+ int index50_4 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred122_wcps()) ) {s = 62;}
+
+ else if ( (true) ) {s = 1;}
+
+
+ input.seek(index50_4);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 50, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA51_eotS =
+ "\77\uffff";
+ static final String DFA51_eofS =
+ "\1\1\76\uffff";
+ static final String DFA51_minS =
+ "\1\7\3\uffff\1\0\72\uffff";
+ static final String DFA51_maxS =
+ "\1\140\3\uffff\1\0\72\uffff";
+ static final String DFA51_acceptS =
+ "\1\uffff\1\2\74\uffff\1\1";
+ static final String DFA51_specialS =
+ "\4\uffff\1\0\72\uffff}>";
+ static final String[] DFA51_transitionS = {
+ "\2\1\1\uffff\1\1\2\uffff\13\1\2\4\1\1\21\uffff\2\1\3\uffff\1"+
+ "\1\7\uffff\1\1\30\uffff\1\1\15\uffff\1\1",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA51_eot = DFA.unpackEncodedString(DFA51_eotS);
+ static final short[] DFA51_eof = DFA.unpackEncodedString(DFA51_eofS);
+ static final char[] DFA51_min = DFA.unpackEncodedStringToUnsignedChars(DFA51_minS);
+ static final char[] DFA51_max = DFA.unpackEncodedStringToUnsignedChars(DFA51_maxS);
+ static final short[] DFA51_accept = DFA.unpackEncodedString(DFA51_acceptS);
+ static final short[] DFA51_special = DFA.unpackEncodedString(DFA51_specialS);
+ static final short[][] DFA51_transition;
+
+ static {
+ int numStates = DFA51_transitionS.length;
+ DFA51_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA51_transition[i] = DFA.unpackEncodedString(DFA51_transitionS[i]);
+ }
+ }
+
+ class DFA51 extends DFA {
+
+ public DFA51(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 51;
+ this.eot = DFA51_eot;
+ this.eof = DFA51_eof;
+ this.min = DFA51_min;
+ this.max = DFA51_max;
+ this.accept = DFA51_accept;
+ this.special = DFA51_special;
+ this.transition = DFA51_transition;
+ }
+ public String getDescription() {
+ return "()* loopback of 302:3: (op= ( MULT | DIVIDE ) e2= numericScalarFactor )*";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA51_4 = input.LA(1);
+
+
+ int index51_4 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred124_wcps()) ) {s = 62;}
+
+ else if ( (true) ) {s = 1;}
+
+
+ input.seek(index51_4);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 51, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA52_eotS =
+ "\26\uffff";
+ static final String DFA52_eofS =
+ "\26\uffff";
+ static final String DFA52_minS =
+ "\2\6\11\uffff\1\0\12\uffff";
+ static final String DFA52_maxS =
+ "\2\154\11\uffff\1\0\12\uffff";
+ static final String DFA52_acceptS =
+ "\2\uffff\1\2\1\3\1\4\1\5\1\6\1\7\1\11\1\uffff\1\12\1\uffff\1\1\10"+
+ "\uffff\1\10";
+ static final String DFA52_specialS =
+ "\13\uffff\1\0\12\uffff}>";
+ static final String[] DFA52_transitionS = {
+ "\1\1\20\uffff\1\2\13\uffff\10\10\21\uffff\1\4\1\3\20\uffff\1"+
+ "\6\1\5\22\uffff\1\7\11\uffff\1\12",
+ "\1\14\20\uffff\1\14\13\uffff\10\14\21\uffff\2\14\20\uffff\2"+
+ "\14\22\uffff\1\13\11\uffff\1\14",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA52_eot = DFA.unpackEncodedString(DFA52_eotS);
+ static final short[] DFA52_eof = DFA.unpackEncodedString(DFA52_eofS);
+ static final char[] DFA52_min = DFA.unpackEncodedStringToUnsignedChars(DFA52_minS);
+ static final char[] DFA52_max = DFA.unpackEncodedStringToUnsignedChars(DFA52_maxS);
+ static final short[] DFA52_accept = DFA.unpackEncodedString(DFA52_acceptS);
+ static final short[] DFA52_special = DFA.unpackEncodedString(DFA52_specialS);
+ static final short[][] DFA52_transition;
+
+ static {
+ int numStates = DFA52_transitionS.length;
+ DFA52_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA52_transition[i] = DFA.unpackEncodedString(DFA52_transitionS[i]);
+ }
+ }
+
+ class DFA52 extends DFA {
+
+ public DFA52(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 52;
+ this.eot = DFA52_eot;
+ this.eof = DFA52_eof;
+ this.min = DFA52_min;
+ this.max = DFA52_max;
+ this.accept = DFA52_accept;
+ this.special = DFA52_special;
+ this.transition = DFA52_transition;
+ }
+ public String getDescription() {
+ return "304:1: numericScalarFactor returns [NumericScalarExpr value] : ( LPAREN e1= numericScalarExpr RPAREN | op= MINUS e10= numericScalarFactor | op= ABS LPAREN e12= numericScalarExpr RPAREN | op= SQRT LPAREN e11= numericScalarExpr RPAREN | op= ROUND LPAREN e1= numericScalarExpr RPAREN | e= INTEGERCONSTANT | e= FLOATCONSTANT | e2= complexConstant | e3= condenseExpr | e4= variableName );";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA52_11 = input.LA(1);
+
+
+ int index52_11 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred125_wcps()) ) {s = 12;}
+
+ else if ( (synpred132_wcps()) ) {s = 21;}
+
+
+ input.seek(index52_11);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 52, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA56_eotS =
+ "\30\uffff";
+ static final String DFA56_eofS =
+ "\30\uffff";
+ static final String DFA56_minS =
+ "\1\6\4\uffff\1\6\20\uffff\1\0\1\uffff";
+ static final String DFA56_maxS =
+ "\1\154\4\uffff\1\6\20\uffff\1\0\1\uffff";
+ static final String DFA56_acceptS =
+ "\1\uffff\1\1\25\uffff\1\2";
+ static final String DFA56_specialS =
+ "\26\uffff\1\0\1\uffff}>";
+ static final String[] DFA56_transitionS = {
+ "\1\1\20\uffff\1\1\3\uffff\7\1\1\5\10\1\21\uffff\2\1\16\uffff"+
+ "\1\1\1\uffff\3\1\20\uffff\2\1\11\uffff\1\1",
+ "",
+ "",
+ "",
+ "",
+ "\1\26",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ ""
+ };
+
+ static final short[] DFA56_eot = DFA.unpackEncodedString(DFA56_eotS);
+ static final short[] DFA56_eof = DFA.unpackEncodedString(DFA56_eofS);
+ static final char[] DFA56_min = DFA.unpackEncodedStringToUnsignedChars(DFA56_minS);
+ static final char[] DFA56_max = DFA.unpackEncodedStringToUnsignedChars(DFA56_maxS);
+ static final short[] DFA56_accept = DFA.unpackEncodedString(DFA56_acceptS);
+ static final short[] DFA56_special = DFA.unpackEncodedString(DFA56_specialS);
+ static final short[][] DFA56_transition;
+
+ static {
+ int numStates = DFA56_transitionS.length;
+ DFA56_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA56_transition[i] = DFA.unpackEncodedString(DFA56_transitionS[i]);
+ }
+ }
+
+ class DFA56 extends DFA {
+
+ public DFA56(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 56;
+ this.eot = DFA56_eot;
+ this.eof = DFA56_eof;
+ this.min = DFA56_min;
+ this.max = DFA56_max;
+ this.accept = DFA56_accept;
+ this.special = DFA56_special;
+ this.transition = DFA56_transition;
+ }
+ public String getDescription() {
+ return "332:1: dimensionIntervalExpr returns [DimensionIntervalExpr value] : (e1= scalarExpr COLON e2= scalarExpr | DOMAIN LPAREN e3= coverageName COLON e4= axisName COLON e5= crsName RPAREN );";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA56_22 = input.LA(1);
+
+
+ int index56_22 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred141_wcps()) ) {s = 1;}
+
+ else if ( (true) ) {s = 23;}
+
+
+ input.seek(index56_22);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 56, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+
+
+ public static final BitSet FOLLOW_forClause_in_wcpsRequest63 = new BitSet(new long[]{0x0000000000000600L});
+ public static final BitSet FOLLOW_whereClause_in_wcpsRequest72 = new BitSet(new long[]{0x0000000000000600L});
+ public static final BitSet FOLLOW_returnClause_in_wcpsRequest83 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_FOR_in_forClause98 = new BitSet(new long[]{0x0000000000000000L,0x0000080000000000L});
+ public static final BitSet FOLLOW_coverageVariable_in_forClause102 = new BitSet(new long[]{0x0000000000000020L});
+ public static final BitSet FOLLOW_IN_in_forClause104 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_forClause106 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_coverageList_in_forClause110 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_forClause112 = new BitSet(new long[]{0x0000000000000102L});
+ public static final BitSet FOLLOW_COMMA_in_forClause122 = new BitSet(new long[]{0x0000000000000000L,0x0000080000000000L});
+ public static final BitSet FOLLOW_coverageVariable_in_forClause126 = new BitSet(new long[]{0x0000000000000020L});
+ public static final BitSet FOLLOW_IN_in_forClause128 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_forClause130 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_coverageList_in_forClause134 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_forClause136 = new BitSet(new long[]{0x0000000000000102L});
+ public static final BitSet FOLLOW_WHERE_in_whereClause157 = new BitSet(new long[]{0x300007F808800040L,0x000010060001D000L});
+ public static final BitSet FOLLOW_booleanScalarExpr_in_whereClause161 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_RETURN_in_returnClause176 = new BitSet(new long[]{0x300007FFF8801840L,0x000010060001D000L});
+ public static final BitSet FOLLOW_processingExpr_in_returnClause180 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_coverageName_in_coverageList197 = new BitSet(new long[]{0x0000000000000102L});
+ public static final BitSet FOLLOW_COMMA_in_coverageList204 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_coverageName_in_coverageList208 = new BitSet(new long[]{0x0000000000000102L});
+ public static final BitSet FOLLOW_encodedCoverageExpr_in_processingExpr230 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_storeExpr_in_processingExpr242 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_scalarExpr_in_processingExpr254 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ENCODE_in_encodedCoverageExpr272 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_encodedCoverageExpr274 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_encodedCoverageExpr278 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_encodedCoverageExpr280 = new BitSet(new long[]{0x0000000000000000L,0x0000000000010000L});
+ public static final BitSet FOLLOW_stringConstant_in_encodedCoverageExpr284 = new BitSet(new long[]{0x0000000000000180L});
+ public static final BitSet FOLLOW_COMMA_in_encodedCoverageExpr291 = new BitSet(new long[]{0x0000000000000000L,0x0000000000010000L});
+ public static final BitSet FOLLOW_stringConstant_in_encodedCoverageExpr295 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_encodedCoverageExpr302 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_STORE_in_storeExpr319 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_storeExpr321 = new BitSet(new long[]{0x0000000000000800L});
+ public static final BitSet FOLLOW_encodedCoverageExpr_in_storeExpr325 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_storeExpr327 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_coverageLogicTerm_in_coverageExpr350 = new BitSet(new long[]{0x0000000000006002L});
+ public static final BitSet FOLLOW_set_in_coverageExpr366 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageLogicTerm_in_coverageExpr374 = new BitSet(new long[]{0x0000000000006002L});
+ public static final BitSet FOLLOW_coverageLogicFactor_in_coverageLogicTerm400 = new BitSet(new long[]{0x0000000000008002L});
+ public static final BitSet FOLLOW_AND_in_coverageLogicTerm416 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageLogicFactor_in_coverageLogicTerm420 = new BitSet(new long[]{0x0000000000008002L});
+ public static final BitSet FOLLOW_coverageArithmeticExpr_in_coverageLogicFactor447 = new BitSet(new long[]{0x00000000003F0002L});
+ public static final BitSet FOLLOW_set_in_coverageLogicFactor463 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageArithmeticExpr_in_coverageLogicFactor479 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_coverageArithmeticTerm_in_coverageArithmeticExpr507 = new BitSet(new long[]{0x0000000000C00002L});
+ public static final BitSet FOLLOW_set_in_coverageArithmeticExpr523 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageArithmeticTerm_in_coverageArithmeticExpr531 = new BitSet(new long[]{0x0000000000C00002L});
+ public static final BitSet FOLLOW_coverageArithmeticFactor_in_coverageArithmeticTerm559 = new BitSet(new long[]{0x0000000003000002L});
+ public static final BitSet FOLLOW_set_in_coverageArithmeticTerm574 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageArithmeticFactor_in_coverageArithmeticTerm582 = new BitSet(new long[]{0x0000000003000002L});
+ public static final BitSet FOLLOW_coverageValue_in_coverageArithmeticFactor610 = new BitSet(new long[]{0x0000000004000002L});
+ public static final BitSet FOLLOW_OVERLAY_in_coverageArithmeticFactor625 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageValue_in_coverageArithmeticFactor629 = new BitSet(new long[]{0x0000000004000002L});
+ public static final BitSet FOLLOW_subsetExpr_in_coverageValue655 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_unaryInducedExpr_in_coverageValue668 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_scaleExpr_in_coverageValue680 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_crsTransformExpr_in_coverageValue692 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_coverageAtom_in_coverageValue704 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_scalarExpr_in_coverageAtom727 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_coverageVariable_in_coverageAtom739 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LPAREN_in_coverageAtom749 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_coverageAtom753 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_coverageAtom755 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_coverageConstantExpr_in_coverageAtom768 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_coverageConstructorExpr_in_coverageAtom780 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_setMetaDataExpr_in_coverageAtom793 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_rangeConstructorExpr_in_coverageAtom806 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_metaDataExpr_in_scalarExpr830 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_condenseExpr_in_scalarExpr843 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_booleanScalarExpr_in_scalarExpr856 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_numericScalarExpr_in_scalarExpr870 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_stringScalarExpr_in_scalarExpr883 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LPAREN_in_scalarExpr894 = new BitSet(new long[]{0x300007FFF8801840L,0x000010060001D000L});
+ public static final BitSet FOLLOW_scalarExpr_in_scalarExpr898 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_scalarExpr900 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_IDENTIFIER_in_metaDataExpr924 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_metaDataExpr926 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_metaDataExpr930 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_metaDataExpr932 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_IMAGECRS_in_metaDataExpr944 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_metaDataExpr946 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_metaDataExpr950 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_metaDataExpr952 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_IMAGECRSDOMAIN_in_metaDataExpr964 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_metaDataExpr966 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_metaDataExpr970 = new BitSet(new long[]{0x0000000000000180L});
+ public static final BitSet FOLLOW_COMMA_in_metaDataExpr973 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_axisName_in_metaDataExpr977 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_metaDataExpr981 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_CRSSET_in_metaDataExpr993 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_metaDataExpr995 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_metaDataExpr999 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_metaDataExpr1001 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_domainExpr_in_metaDataExpr1013 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_NULLSET_in_metaDataExpr1025 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_metaDataExpr1027 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_metaDataExpr1031 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_metaDataExpr1033 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_INTERPOLATIONDEFAULT_in_metaDataExpr1045 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_metaDataExpr1047 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_metaDataExpr1051 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_metaDataExpr1053 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_fieldName_in_metaDataExpr1057 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_metaDataExpr1059 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_INTERPOLATIONSET_in_metaDataExpr1071 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_metaDataExpr1073 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_metaDataExpr1077 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_metaDataExpr1079 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_fieldName_in_metaDataExpr1083 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_metaDataExpr1085 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_DOMAIN_in_domainExpr1104 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_domainExpr1106 = new BitSet(new long[]{0x0000000000000000L,0x0000080000000000L});
+ public static final BitSet FOLLOW_coverageVariable_in_domainExpr1110 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_domainExpr1112 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_axisName_in_domainExpr1116 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_domainExpr1118 = new BitSet(new long[]{0x0000000000000000L,0x0000000000010000L});
+ public static final BitSet FOLLOW_crsName_in_domainExpr1122 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_domainExpr1124 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_reduceExpr_in_condenseExpr1141 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_generalCondenseExpr_in_condenseExpr1150 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_reduceExpr1167 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_reduceExpr1183 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_reduceExpr1187 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_reduceExpr1189 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_CONDENSE_in_generalCondenseExpr1204 = new BitSet(new long[]{0x000003000140A000L});
+ public static final BitSet FOLLOW_condenseOpType_in_generalCondenseExpr1208 = new BitSet(new long[]{0x0000080000000000L});
+ public static final BitSet FOLLOW_OVER_in_generalCondenseExpr1210 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_axisIteratorList_in_generalCondenseExpr1214 = new BitSet(new long[]{0x0000100000000200L});
+ public static final BitSet FOLLOW_WHERE_in_generalCondenseExpr1221 = new BitSet(new long[]{0x300007F808800040L,0x000010060001D000L});
+ public static final BitSet FOLLOW_booleanScalarExpr_in_generalCondenseExpr1225 = new BitSet(new long[]{0x0000100000000000L});
+ public static final BitSet FOLLOW_USING_in_generalCondenseExpr1233 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_generalCondenseExpr1237 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_variableName_in_axisIteratorList1254 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_axisName_in_axisIteratorList1258 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_axisIteratorList1260 = new BitSet(new long[]{0x0000000020000040L,0x000000000000C000L});
+ public static final BitSet FOLLOW_intervalExpr_in_axisIteratorList1264 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_axisIteratorList1266 = new BitSet(new long[]{0x0000000000000102L});
+ public static final BitSet FOLLOW_COMMA_in_axisIteratorList1274 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_variableName_in_axisIteratorList1278 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_axisName_in_axisIteratorList1282 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_axisIteratorList1284 = new BitSet(new long[]{0x0000000020000040L,0x000000000000C000L});
+ public static final BitSet FOLLOW_intervalExpr_in_axisIteratorList1288 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_axisIteratorList1290 = new BitSet(new long[]{0x0000000000000102L});
+ public static final BitSet FOLLOW_indexExpr_in_intervalExpr1314 = new BitSet(new long[]{0x0000200000000000L});
+ public static final BitSet FOLLOW_COLON_in_intervalExpr1316 = new BitSet(new long[]{0x0000000000000040L,0x000000000000C000L});
+ public static final BitSet FOLLOW_indexExpr_in_intervalExpr1320 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_IMAGECRSDOMAIN_in_intervalExpr1335 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_intervalExpr1337 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_coverageName_in_intervalExpr1341 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_intervalExpr1343 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_axisName_in_intervalExpr1347 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_intervalExpr1349 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_COVERAGE_in_coverageConstantExpr1375 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_coverageName_in_coverageConstantExpr1379 = new BitSet(new long[]{0x0000080000000000L});
+ public static final BitSet FOLLOW_OVER_in_coverageConstantExpr1381 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_axisIteratorList_in_coverageConstantExpr1385 = new BitSet(new long[]{0x0000800000000000L});
+ public static final BitSet FOLLOW_VALUE_in_coverageConstantExpr1387 = new BitSet(new long[]{0x0001000000000000L});
+ public static final BitSet FOLLOW_LIST_in_coverageConstantExpr1389 = new BitSet(new long[]{0x0000000000040000L});
+ public static final BitSet FOLLOW_LT_in_coverageConstantExpr1391 = new BitSet(new long[]{0x0000000000000040L,0x0000000600014000L});
+ public static final BitSet FOLLOW_constantList_in_coverageConstantExpr1395 = new BitSet(new long[]{0x0000000000080000L});
+ public static final BitSet FOLLOW_GT_in_coverageConstantExpr1397 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_constant_in_constantList1428 = new BitSet(new long[]{0x0002000000000002L});
+ public static final BitSet FOLLOW_SEMICOLON_in_constantList1433 = new BitSet(new long[]{0x0000000000000040L,0x0000000600014000L});
+ public static final BitSet FOLLOW_constant_in_constantList1437 = new BitSet(new long[]{0x0002000000000002L});
+ public static final BitSet FOLLOW_COVERAGE_in_coverageConstructorExpr1457 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_coverageName_in_coverageConstructorExpr1461 = new BitSet(new long[]{0x0000080000000000L});
+ public static final BitSet FOLLOW_OVER_in_coverageConstructorExpr1463 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_axisIteratorList_in_coverageConstructorExpr1467 = new BitSet(new long[]{0x0004000000000000L});
+ public static final BitSet FOLLOW_VALUES_in_coverageConstructorExpr1469 = new BitSet(new long[]{0x300007FFF8801840L,0x000010060001D000L});
+ public static final BitSet FOLLOW_scalarExpr_in_coverageConstructorExpr1473 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_SETIDENTIFIER_in_setMetaDataExpr1495 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_setMetaDataExpr1497 = new BitSet(new long[]{0x0000000000000000L,0x0000000000010000L});
+ public static final BitSet FOLLOW_stringConstant_in_setMetaDataExpr1501 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_setMetaDataExpr1503 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_setMetaDataExpr1507 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_setMetaDataExpr1509 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_SETCRSSET_in_setMetaDataExpr1522 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_setMetaDataExpr1524 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_setMetaDataExpr1528 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_setMetaDataExpr1530 = new BitSet(new long[]{0x0100000000000000L});
+ public static final BitSet FOLLOW_crsList_in_setMetaDataExpr1534 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_setMetaDataExpr1536 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_SETNULLSET_in_setMetaDataExpr1553 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_setMetaDataExpr1555 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_setMetaDataExpr1559 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_setMetaDataExpr1561 = new BitSet(new long[]{0x0100000000000000L});
+ public static final BitSet FOLLOW_rangeExprList_in_setMetaDataExpr1565 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_setMetaDataExpr1567 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_SETINTERPOLATIONDEFAULT_in_setMetaDataExpr1584 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_setMetaDataExpr1586 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_setMetaDataExpr1590 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_setMetaDataExpr1592 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_fieldName_in_setMetaDataExpr1596 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_setMetaDataExpr1598 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_interpolationMethod_in_setMetaDataExpr1602 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_setMetaDataExpr1604 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_SETINTERPOLATIONSET_in_setMetaDataExpr1624 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_setMetaDataExpr1626 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_setMetaDataExpr1630 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_setMetaDataExpr1632 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_fieldName_in_setMetaDataExpr1636 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_setMetaDataExpr1638 = new BitSet(new long[]{0x0100000000000000L});
+ public static final BitSet FOLLOW_interpolationMethodList_in_setMetaDataExpr1642 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_setMetaDataExpr1644 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LBRACE_in_crsList1673 = new BitSet(new long[]{0x0200000000000000L,0x0000000000010000L});
+ public static final BitSet FOLLOW_crsName_in_crsList1680 = new BitSet(new long[]{0x0200000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_crsList1685 = new BitSet(new long[]{0x0000000000000000L,0x0000000000010000L});
+ public static final BitSet FOLLOW_crsName_in_crsList1689 = new BitSet(new long[]{0x0200000000000100L});
+ public static final BitSet FOLLOW_RBRACE_in_crsList1698 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LBRACE_in_rangeExprList1717 = new BitSet(new long[]{0x0600000000000000L});
+ public static final BitSet FOLLOW_rangeExpr_in_rangeExprList1724 = new BitSet(new long[]{0x0200000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_rangeExprList1729 = new BitSet(new long[]{0x0400000000000000L});
+ public static final BitSet FOLLOW_rangeExpr_in_rangeExprList1733 = new BitSet(new long[]{0x0200000000000100L});
+ public static final BitSet FOLLOW_RBRACE_in_rangeExprList1742 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LBRACE_in_interpolationMethodList1758 = new BitSet(new long[]{0x0200000000000040L});
+ public static final BitSet FOLLOW_interpolationMethod_in_interpolationMethodList1765 = new BitSet(new long[]{0x0200000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_interpolationMethodList1770 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_interpolationMethod_in_interpolationMethodList1774 = new BitSet(new long[]{0x0200000000000100L});
+ public static final BitSet FOLLOW_RBRACE_in_interpolationMethodList1782 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_STRUCT_in_rangeExpr1795 = new BitSet(new long[]{0x0100000000000000L});
+ public static final BitSet FOLLOW_LBRACE_in_rangeExpr1797 = new BitSet(new long[]{0x0200000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_fieldName_in_rangeExpr1805 = new BitSet(new long[]{0x0000200000000000L});
+ public static final BitSet FOLLOW_COLON_in_rangeExpr1807 = new BitSet(new long[]{0x300007FFF8801840L,0x000010060001D000L});
+ public static final BitSet FOLLOW_scalarExpr_in_rangeExpr1811 = new BitSet(new long[]{0x0200000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_rangeExpr1818 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_fieldName_in_rangeExpr1822 = new BitSet(new long[]{0x0000200000000000L});
+ public static final BitSet FOLLOW_COLON_in_rangeExpr1824 = new BitSet(new long[]{0x300007FFF8801840L,0x000010060001D000L});
+ public static final BitSet FOLLOW_scalarExpr_in_rangeExpr1828 = new BitSet(new long[]{0x0200000000000100L});
+ public static final BitSet FOLLOW_RBRACE_in_rangeExpr1839 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_STRUCT_in_rangeConstructorExpr1856 = new BitSet(new long[]{0x0100000000000000L});
+ public static final BitSet FOLLOW_LBRACE_in_rangeConstructorExpr1860 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_fieldName_in_rangeConstructorExpr1864 = new BitSet(new long[]{0x0000200000000000L});
+ public static final BitSet FOLLOW_COLON_in_rangeConstructorExpr1866 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_rangeConstructorExpr1870 = new BitSet(new long[]{0x0202000000000000L});
+ public static final BitSet FOLLOW_SEMICOLON_in_rangeConstructorExpr1883 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_fieldName_in_rangeConstructorExpr1887 = new BitSet(new long[]{0x0000200000000000L});
+ public static final BitSet FOLLOW_COLON_in_rangeConstructorExpr1889 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_rangeConstructorExpr1893 = new BitSet(new long[]{0x0202000000000000L});
+ public static final BitSet FOLLOW_RBRACE_in_rangeConstructorExpr1899 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_CRSTRANSFORM_in_crsTransformExpr1915 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_crsTransformExpr1917 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_crsTransformExpr1921 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_crsTransformExpr1923 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_dimensionIntervalList_in_crsTransformExpr1927 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_crsTransformExpr1929 = new BitSet(new long[]{0x0100000000000000L});
+ public static final BitSet FOLLOW_fieldInterpolationList_in_crsTransformExpr1933 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_crsTransformExpr1935 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LBRACE_in_fieldInterpolationList1952 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_fieldInterpolationElement_in_fieldInterpolationList1956 = new BitSet(new long[]{0x0200000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_fieldInterpolationList1963 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_fieldInterpolationElement_in_fieldInterpolationList1967 = new BitSet(new long[]{0x0200000000000100L});
+ public static final BitSet FOLLOW_RBRACE_in_fieldInterpolationList1974 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_fieldName_in_fieldInterpolationElement1989 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_interpolationMethod_in_fieldInterpolationElement1993 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_fieldExpr_in_unaryInducedExpr2013 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_unaryArithmeticExpr_in_unaryInducedExpr2022 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_exponentialExpr_in_unaryInducedExpr2034 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_trigonometricExpr_in_unaryInducedExpr2046 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_booleanExpr_in_unaryInducedExpr2058 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_castExpr_in_unaryInducedExpr2070 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_rangeConstructorExpr_in_unaryInducedExpr2082 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_unaryArithmeticExpr2105 = new BitSet(new long[]{0x35F847FFF8801840L,0x000018060001D000L});
+ public static final BitSet FOLLOW_coverageAtom_in_unaryArithmeticExpr2113 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_unaryArithmeticExpr2125 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_unaryArithmeticExpr2135 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_unaryArithmeticExpr2139 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_unaryArithmeticExpr2141 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_exponentialExpr2164 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_exponentialExpr2172 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_exponentialExpr2176 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_exponentialExpr2178 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_trigonometricExpr2201 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_trigonometricExpr2221 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_trigonometricExpr2225 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_trigonometricExpr2227 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_NOT_in_booleanExpr2250 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_booleanExpr2254 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_BIT_in_booleanExpr2266 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_booleanExpr2268 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_booleanExpr2272 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_booleanExpr2274 = new BitSet(new long[]{0x0000000000000040L,0x000000000000C000L});
+ public static final BitSet FOLLOW_indexExpr_in_booleanExpr2278 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_booleanExpr2280 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_indexTerm_in_indexExpr2303 = new BitSet(new long[]{0x0000000000C00002L});
+ public static final BitSet FOLLOW_set_in_indexExpr2313 = new BitSet(new long[]{0x0000000000000040L,0x000000000000C000L});
+ public static final BitSet FOLLOW_indexTerm_in_indexExpr2321 = new BitSet(new long[]{0x0000000000C00002L});
+ public static final BitSet FOLLOW_indexFactor_in_indexTerm2346 = new BitSet(new long[]{0x0000000003000002L});
+ public static final BitSet FOLLOW_set_in_indexTerm2359 = new BitSet(new long[]{0x0000000000000040L,0x000000000000C000L});
+ public static final BitSet FOLLOW_indexFactor_in_indexTerm2367 = new BitSet(new long[]{0x0000000003000002L});
+ public static final BitSet FOLLOW_INTEGERCONSTANT_in_indexFactor2394 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ROUND_in_indexFactor2407 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_indexFactor2409 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_numericScalarExpr_in_indexFactor2413 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_indexFactor2415 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LPAREN_in_indexFactor2427 = new BitSet(new long[]{0x0000000000000040L,0x000000000000C000L});
+ public static final BitSet FOLLOW_indexExpr_in_indexFactor2431 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_indexFactor2433 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_IDENTIFIER_in_stringScalarExpr2460 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_stringScalarExpr2462 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_stringScalarExpr2466 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_stringScalarExpr2468 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_STRING_in_stringScalarExpr2481 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_SCALE_in_scaleExpr2499 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_scaleExpr2501 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_scaleExpr2505 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_scaleExpr2507 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_dimensionIntervalList_in_scaleExpr2511 = new BitSet(new long[]{0x0000000000000180L});
+ public static final BitSet FOLLOW_COMMA_in_scaleExpr2528 = new BitSet(new long[]{0x0100000000000000L});
+ public static final BitSet FOLLOW_fieldInterpolationList_in_scaleExpr2532 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_scaleExpr2557 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_trimExpr_in_subsetExpr2575 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_sliceExpr_in_subsetExpr2584 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_extendExpr_in_subsetExpr2593 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_coverageAtom_in_trimExpr2610 = new BitSet(new long[]{0x0000000000000000L,0x0000000000040000L});
+ public static final BitSet FOLLOW_LBRACKET_in_trimExpr2612 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_dimensionIntervalList_in_trimExpr2616 = new BitSet(new long[]{0x0000000000000000L,0x0000000000080000L});
+ public static final BitSet FOLLOW_RBRACKET_in_trimExpr2618 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_TRIM_in_trimExpr2627 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_trimExpr2629 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_trimExpr2633 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_trimExpr2635 = new BitSet(new long[]{0x0100000000000000L});
+ public static final BitSet FOLLOW_LBRACE_in_trimExpr2637 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_dimensionIntervalList_in_trimExpr2641 = new BitSet(new long[]{0x0200000000000000L});
+ public static final BitSet FOLLOW_RBRACE_in_trimExpr2643 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_trimExpr2645 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_coverageAtom_in_sliceExpr2662 = new BitSet(new long[]{0x0000000000000000L,0x0000000000040000L});
+ public static final BitSet FOLLOW_LBRACKET_in_sliceExpr2664 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_dimensionPointList_in_sliceExpr2668 = new BitSet(new long[]{0x0000000000000000L,0x0000000000080000L});
+ public static final BitSet FOLLOW_RBRACKET_in_sliceExpr2670 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_SLICE_in_sliceExpr2677 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_sliceExpr2679 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_sliceExpr2683 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_sliceExpr2685 = new BitSet(new long[]{0x0100000000000000L});
+ public static final BitSet FOLLOW_LBRACE_in_sliceExpr2687 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_dimensionPointList_in_sliceExpr2691 = new BitSet(new long[]{0x0200000000000000L});
+ public static final BitSet FOLLOW_RBRACE_in_sliceExpr2693 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_sliceExpr2695 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_EXTEND_in_extendExpr2710 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_extendExpr2712 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_extendExpr2716 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_extendExpr2718 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_dimensionIntervalList_in_extendExpr2722 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_extendExpr2724 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LPAREN_in_castExpr2742 = new BitSet(new long[]{0x0000000000000000L,0x00000000FF800000L});
+ public static final BitSet FOLLOW_rangeType_in_castExpr2746 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_castExpr2748 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_castExpr2752 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_rangeType2775 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_UNSIGNED_in_rangeType2801 = new BitSet(new long[]{0x0000000000000000L,0x0000000007000000L});
+ public static final BitSet FOLLOW_set_in_rangeType2805 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_coverageAtom_in_fieldExpr2834 = new BitSet(new long[]{0x0000000000000000L,0x0000000100000000L});
+ public static final BitSet FOLLOW_DOT_in_fieldExpr2836 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_fieldName_in_fieldExpr2840 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_booleanScalarTerm_in_booleanScalarExpr2865 = new BitSet(new long[]{0x0000000000006002L});
+ public static final BitSet FOLLOW_set_in_booleanScalarExpr2878 = new BitSet(new long[]{0x300007F808800040L,0x000010060001D000L});
+ public static final BitSet FOLLOW_booleanScalarTerm_in_booleanScalarExpr2886 = new BitSet(new long[]{0x0000000000006002L});
+ public static final BitSet FOLLOW_booleanScalarNegation_in_booleanScalarTerm2908 = new BitSet(new long[]{0x0000000000008002L});
+ public static final BitSet FOLLOW_AND_in_booleanScalarTerm2918 = new BitSet(new long[]{0x300007F808800040L,0x000010060001D000L});
+ public static final BitSet FOLLOW_booleanScalarNegation_in_booleanScalarTerm2922 = new BitSet(new long[]{0x0000000000008002L});
+ public static final BitSet FOLLOW_booleanScalarAtom_in_booleanScalarNegation2943 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_NOT_in_booleanScalarNegation2952 = new BitSet(new long[]{0x300007F808800040L,0x000010060001C000L});
+ public static final BitSet FOLLOW_booleanScalarAtom_in_booleanScalarNegation2956 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LPAREN_in_booleanScalarAtom2971 = new BitSet(new long[]{0x300007F808800040L,0x000010060001D000L});
+ public static final BitSet FOLLOW_booleanScalarExpr_in_booleanScalarAtom2975 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_booleanScalarAtom2977 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_stringScalarExpr_in_booleanScalarAtom2986 = new BitSet(new long[]{0x00000000003F0000L});
+ public static final BitSet FOLLOW_compOp_in_booleanScalarAtom2990 = new BitSet(new long[]{0x0000000008000000L,0x0000000000010000L});
+ public static final BitSet FOLLOW_stringScalarExpr_in_booleanScalarAtom2994 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_numericScalarExpr_in_booleanScalarAtom3004 = new BitSet(new long[]{0x00000000003F0000L});
+ public static final BitSet FOLLOW_compOp_in_booleanScalarAtom3008 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_numericScalarExpr_in_booleanScalarAtom3012 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_BOOLEANCONSTANT_in_booleanScalarAtom3022 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_numericScalarTerm_in_numericScalarExpr3039 = new BitSet(new long[]{0x0000000000C00002L});
+ public static final BitSet FOLLOW_set_in_numericScalarExpr3049 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_numericScalarTerm_in_numericScalarExpr3057 = new BitSet(new long[]{0x0000000000C00002L});
+ public static final BitSet FOLLOW_numericScalarFactor_in_numericScalarTerm3076 = new BitSet(new long[]{0x0000000003000002L});
+ public static final BitSet FOLLOW_set_in_numericScalarTerm3085 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_numericScalarFactor_in_numericScalarTerm3093 = new BitSet(new long[]{0x0000000003000002L});
+ public static final BitSet FOLLOW_LPAREN_in_numericScalarFactor3113 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_numericScalarExpr_in_numericScalarFactor3117 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_numericScalarFactor3119 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_MINUS_in_numericScalarFactor3131 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_numericScalarFactor_in_numericScalarFactor3135 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ABS_in_numericScalarFactor3147 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_numericScalarFactor3149 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_numericScalarExpr_in_numericScalarFactor3153 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_numericScalarFactor3155 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_SQRT_in_numericScalarFactor3167 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_numericScalarFactor3169 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_numericScalarExpr_in_numericScalarFactor3173 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_numericScalarFactor3175 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ROUND_in_numericScalarFactor3187 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_numericScalarFactor3189 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_numericScalarExpr_in_numericScalarFactor3193 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_numericScalarFactor3195 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_INTEGERCONSTANT_in_numericScalarFactor3207 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_FLOATCONSTANT_in_numericScalarFactor3219 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_complexConstant_in_numericScalarFactor3231 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_condenseExpr_in_numericScalarFactor3243 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_variableName_in_numericScalarFactor3255 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_EQUALS_in_compOp3273 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_NOTEQUALS_in_compOp3280 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LT_in_compOp3287 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_GT_in_compOp3294 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LTE_in_compOp3301 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_GTE_in_compOp3308 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_dimensionIntervalElement_in_dimensionIntervalList3328 = new BitSet(new long[]{0x0000000000000102L});
+ public static final BitSet FOLLOW_COMMA_in_dimensionIntervalList3341 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_dimensionIntervalElement_in_dimensionIntervalList3345 = new BitSet(new long[]{0x0000000000000102L});
+ public static final BitSet FOLLOW_axisName_in_dimensionIntervalElement3370 = new BitSet(new long[]{0x0000200000000040L});
+ public static final BitSet FOLLOW_COLON_in_dimensionIntervalElement3375 = new BitSet(new long[]{0x0000000000000000L,0x0000000000010000L});
+ public static final BitSet FOLLOW_crsName_in_dimensionIntervalElement3379 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_dimensionIntervalElement3390 = new BitSet(new long[]{0x300007FFF8801840L,0x000010060001D000L});
+ public static final BitSet FOLLOW_dimensionIntervalExpr_in_dimensionIntervalElement3394 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_dimensionIntervalElement3396 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_scalarExpr_in_dimensionIntervalExpr3419 = new BitSet(new long[]{0x0000200000000000L});
+ public static final BitSet FOLLOW_COLON_in_dimensionIntervalExpr3421 = new BitSet(new long[]{0x300007FFF8801840L,0x000010060001D000L});
+ public static final BitSet FOLLOW_scalarExpr_in_dimensionIntervalExpr3425 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_DOMAIN_in_dimensionIntervalExpr3435 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_dimensionIntervalExpr3437 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_coverageName_in_dimensionIntervalExpr3441 = new BitSet(new long[]{0x0000200000000000L});
+ public static final BitSet FOLLOW_COLON_in_dimensionIntervalExpr3443 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_axisName_in_dimensionIntervalExpr3447 = new BitSet(new long[]{0x0000200000000000L});
+ public static final BitSet FOLLOW_COLON_in_dimensionIntervalExpr3449 = new BitSet(new long[]{0x0000000000000000L,0x0000000000010000L});
+ public static final BitSet FOLLOW_crsName_in_dimensionIntervalExpr3453 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_dimensionIntervalExpr3455 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_dimensionPointElement_in_dimensionPointList3478 = new BitSet(new long[]{0x0000000000000102L});
+ public static final BitSet FOLLOW_COMMA_in_dimensionPointList3488 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_dimensionPointElement_in_dimensionPointList3492 = new BitSet(new long[]{0x0000000000000102L});
+ public static final BitSet FOLLOW_axisName_in_dimensionPointElement3517 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_dimensionPointElement3519 = new BitSet(new long[]{0x300007FFF8801840L,0x000010060001D000L});
+ public static final BitSet FOLLOW_dimensionPoint_in_dimensionPointElement3523 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_dimensionPointElement3525 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_axisName_in_dimensionPointElement3537 = new BitSet(new long[]{0x0000200000000000L});
+ public static final BitSet FOLLOW_COLON_in_dimensionPointElement3539 = new BitSet(new long[]{0x0000000000000000L,0x0000000000010000L});
+ public static final BitSet FOLLOW_crsName_in_dimensionPointElement3543 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_dimensionPointElement3545 = new BitSet(new long[]{0x300007FFF8801840L,0x000010060001D000L});
+ public static final BitSet FOLLOW_dimensionPoint_in_dimensionPointElement3549 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_dimensionPointElement3551 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_scalarExpr_in_dimensionPoint3574 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LPAREN_in_interpolationMethod3592 = new BitSet(new long[]{0x0000000000000000L,0x0000007800000000L});
+ public static final BitSet FOLLOW_interpolationType_in_interpolationMethod3596 = new BitSet(new long[]{0x0000200000000000L});
+ public static final BitSet FOLLOW_COLON_in_interpolationMethod3598 = new BitSet(new long[]{0x0000000000000000L,0x0000078000000000L});
+ public static final BitSet FOLLOW_nullResistence_in_interpolationMethod3602 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_interpolationMethod3604 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_interpolationType3621 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_nullResistence3646 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_condenseOpType3671 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_name_in_fieldName3698 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_constant3715 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_complexConstant_in_constant3732 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LPAREN_in_complexConstant3747 = new BitSet(new long[]{0x0000000000000000L,0x0000000400000000L});
+ public static final BitSet FOLLOW_FLOATCONSTANT_in_complexConstant3751 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_complexConstant3753 = new BitSet(new long[]{0x0000000000000000L,0x0000000400000000L});
+ public static final BitSet FOLLOW_FLOATCONSTANT_in_complexConstant3757 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_complexConstant3759 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_STRING_in_stringConstant3776 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_name3793 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_stringConstant_in_crsName3820 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_name_in_axisName3837 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_VARIABLE_DOLLAR_in_variableName3854 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_NAME_in_coverageVariable3871 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_name_in_coverageName3886 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_synpred8_wcps366 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageLogicTerm_in_synpred8_wcps374 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_AND_in_synpred9_wcps416 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageLogicFactor_in_synpred9_wcps420 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_synpred15_wcps463 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageArithmeticExpr_in_synpred15_wcps479 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_synpred17_wcps523 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageArithmeticTerm_in_synpred17_wcps531 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_synpred19_wcps574 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageArithmeticFactor_in_synpred19_wcps582 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_OVERLAY_in_synpred20_wcps625 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageValue_in_synpred20_wcps629 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_subsetExpr_in_synpred21_wcps655 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_unaryInducedExpr_in_synpred22_wcps668 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_scalarExpr_in_synpred25_wcps727 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LPAREN_in_synpred27_wcps749 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_synpred27_wcps753 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_synpred27_wcps755 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_coverageConstantExpr_in_synpred28_wcps768 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_coverageConstructorExpr_in_synpred29_wcps780 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_metaDataExpr_in_synpred31_wcps830 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_condenseExpr_in_synpred32_wcps843 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_booleanScalarExpr_in_synpred33_wcps856 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_numericScalarExpr_in_synpred34_wcps870 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_stringScalarExpr_in_synpred35_wcps883 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_fieldExpr_in_synpred70_wcps2013 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_unaryArithmeticExpr_in_synpred71_wcps2022 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_booleanExpr_in_synpred74_wcps2058 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_trimExpr_in_synpred100_wcps2575 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_sliceExpr_in_synpred101_wcps2584 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_synpred115_wcps2878 = new BitSet(new long[]{0x300007F808800040L,0x000010060001D000L});
+ public static final BitSet FOLLOW_booleanScalarTerm_in_synpred115_wcps2886 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_AND_in_synpred116_wcps2918 = new BitSet(new long[]{0x300007F808800040L,0x000010060001D000L});
+ public static final BitSet FOLLOW_booleanScalarNegation_in_synpred116_wcps2922 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LPAREN_in_synpred118_wcps2971 = new BitSet(new long[]{0x300007F808800040L,0x000010060001D000L});
+ public static final BitSet FOLLOW_booleanScalarExpr_in_synpred118_wcps2975 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_synpred118_wcps2977 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_numericScalarExpr_in_synpred120_wcps3004 = new BitSet(new long[]{0x00000000003F0000L});
+ public static final BitSet FOLLOW_compOp_in_synpred120_wcps3008 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_numericScalarExpr_in_synpred120_wcps3012 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_synpred122_wcps3049 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_numericScalarTerm_in_synpred122_wcps3057 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_synpred124_wcps3085 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_numericScalarFactor_in_synpred124_wcps3093 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LPAREN_in_synpred125_wcps3113 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_numericScalarExpr_in_synpred125_wcps3117 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_synpred125_wcps3119 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_complexConstant_in_synpred132_wcps3231 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_scalarExpr_in_synpred141_wcps3419 = new BitSet(new long[]{0x0000200000000000L});
+ public static final BitSet FOLLOW_COLON_in_synpred141_wcps3421 = new BitSet(new long[]{0x300007FFF8801840L,0x000010060001D000L});
+ public static final BitSet FOLLOW_scalarExpr_in_synpred141_wcps3425 = new BitSet(new long[]{0x0000000000000002L});
+
+} \ No newline at end of file
diff --git a/petascope/src/petascope/wcps/grammar/wcps_no_actions.g b/petascope/src/petascope/wcps/grammar/wcps_no_actions.g
new file mode 100644
index 0000000..331ea0b
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/wcps_no_actions.g
@@ -0,0 +1,491 @@
+/*
+Author: Sorin Stancu-Mara, Andrei Aiordachioaie
+History:
+07 02 2007 smsorin Updated to WCPS 1.0.0
+27 01 2009 smsorin Moved to ANTLR
+11 02 2009 andreia Updated to new grammar (spec 08-068r2)
+13 02 2009 andreia Fixed small bugs in grammar. Now it can fully compile.
+21 04 2009 andreia Removed comments.
+04 05 2009 andreia Fixed bugs in integer declaration.
+19 05 2009 andreia Fixed some other weird bugs. Grammar passes all tests now.
+28 05 2009 andreia Updated class actions names.
+02 06 2009 andreia Removed brackets around "and" binary operator in CoverageExpr
+03 06 2009 andreia Complex expressions introduced in the "using" clause of general condense operations
+05 08 2009 andreia Fixed definition of integer and floating-point numbers.
+*/
+grammar wcps_no_actions;
+options{
+backtrack=true;
+memoize=true;
+k=2;
+language=Java;
+output=AST;
+}
+
+/* Parser Rules */
+
+wcpsRequest
+ : e1=forClause
+ (e2=whereClause )?
+ e3=returnClause
+ ;
+forClause
+ : FOR v=coverageVariable IN LPAREN list=coverageList RPAREN
+
+ (COMMA v=coverageVariable IN LPAREN list=coverageList RPAREN
+ )*
+ ;
+whereClause
+ : WHERE e1=booleanScalarExpr
+ ;
+returnClause
+ : RETURN e1=processingExpr
+ ;
+coverageList
+ : cname=coverageName
+ (COMMA next=coverageName )*
+ ;
+processingExpr
+ : e1=encodedCoverageExpr
+ | e2=storeExpr
+ | e3=scalarExpr
+ ;
+encodedCoverageExpr
+ : ENCODE LPAREN cov=coverageExpr COMMA format=stringConstant
+ (COMMA params=stringConstant )? RPAREN
+ ;
+storeExpr
+ : STORE LPAREN e1=encodedCoverageExpr RPAREN
+ ;
+coverageExpr
+ : e1=coverageLogicTerm
+ (op=(OR|XOR) e2=coverageLogicTerm )*
+ ;
+coverageLogicTerm
+ : e1=coverageLogicFactor
+ (op=AND e2=coverageLogicFactor )*
+ ;
+coverageLogicFactor
+ : e1=coverageArithmeticExpr
+ (op=(EQUALS|NOTEQUALS|LT|GT|LTE|GTE) e2=coverageArithmeticExpr )?
+ ;
+coverageArithmeticExpr
+ : e1=coverageArithmeticTerm
+ (op=(PLUS|MINUS) e2=coverageArithmeticTerm )*
+ ;
+coverageArithmeticTerm
+ : e1=coverageArithmeticFactor
+ (op=(MULT|DIVIDE) e2=coverageArithmeticFactor )*
+ ;
+coverageArithmeticFactor
+ : e1=coverageValue
+ (op=OVERLAY e2=coverageValue )*
+ ;
+coverageValue
+ : e5=subsetExpr
+ | e2=unaryInducedExpr
+ | e4=scaleExpr
+ | e3=crsTransformExpr
+ | e1=coverageAtom
+ ;
+coverageAtom
+ : e2=scalarExpr
+ | e1=coverageVariable
+ | LPAREN e7=coverageExpr RPAREN
+ | e3=coverageConstantExpr
+ | e4=coverageConstructorExpr
+ | e5=setMetaDataExpr
+ | e6=rangeConstructorExpr
+ ;
+scalarExpr
+ : e1=metaDataExpr
+ | e2=condenseExpr
+ | e3=booleanScalarExpr
+ | e4=numericScalarExpr
+ | e5=stringScalarExpr
+ | LPAREN e6=scalarExpr RPAREN
+ ;
+metaDataExpr
+ : op=IDENTIFIER LPAREN e1=coverageExpr RPAREN
+ | op=IMAGECRS LPAREN e1=coverageExpr RPAREN
+ | op=IMAGECRSDOMAIN LPAREN e1=coverageExpr (COMMA e2=axisName)? RPAREN
+ | op=CRSSET LPAREN e1=coverageExpr RPAREN
+ | de=domainExpr
+ | op=NULLSET LPAREN e1=coverageExpr RPAREN
+ | op=INTERPOLATIONDEFAULT LPAREN e1=coverageExpr COMMA f1=fieldName RPAREN
+ | op=INTERPOLATIONSET LPAREN e1=coverageExpr COMMA f1=fieldName RPAREN
+ ;
+domainExpr
+ : DOMAIN LPAREN var=coverageVariable COMMA axis=axisName COMMA crs=crsName RPAREN
+ ;
+condenseExpr
+ : e1=reduceExpr
+ | e2=generalCondenseExpr
+ ;
+reduceExpr
+ : op=(ALL|SOME|COUNT|ADD|AVG|MIN|MAX) LPAREN e1=coverageExpr RPAREN
+ ;
+generalCondenseExpr
+ : CONDENSE op=condenseOpType OVER ail=axisIteratorList
+ (WHERE cond=booleanScalarExpr )?
+ (USING ce=coverageExpr)
+ ;
+axisIteratorList
+ : vn=variableName an=axisName LPAREN ie=intervalExpr RPAREN
+
+ (COMMA vn2=variableName an2=axisName LPAREN ie2=intervalExpr RPAREN
+ )*
+ ;
+intervalExpr
+ : lo=indexExpr COLON hi=indexExpr
+
+ | IMAGECRSDOMAIN LPAREN e1=coverageName COMMA e2=axisName RPAREN
+
+ ;
+coverageConstantExpr
+ : COVERAGE aname=coverageName OVER iter=axisIteratorList VALUE LIST LT values=constantList GT
+
+ ;
+constantList
+ : c=constant (SEMICOLON c=constant )*
+ ;
+coverageConstructorExpr
+ : COVERAGE coverage=coverageName OVER ail=axisIteratorList VALUES se=scalarExpr
+
+ ;
+setMetaDataExpr
+ : op=SETIDENTIFIER LPAREN s=stringConstant COMMA e1=coverageExpr RPAREN
+
+ | op=SETCRSSET LPAREN e1=coverageExpr COMMA crs=crsList RPAREN
+
+ | op=SETNULLSET LPAREN e1=coverageExpr COMMA rel=rangeExprList RPAREN
+
+ | op=SETINTERPOLATIONDEFAULT LPAREN e1=coverageExpr COMMA fn=fieldName COMMA im=interpolationMethod RPAREN
+
+ | op=SETINTERPOLATIONSET LPAREN e1=coverageExpr COMMA fn=fieldName COMMA iml=interpolationMethodList RPAREN
+
+ ;
+crsList
+ : LBRACE (crs=crsName (COMMA crs=crsName )* )? RBRACE
+ ;
+rangeExprList
+ : LBRACE (re1=rangeExpr (COMMA re2=rangeExpr )* )? RBRACE
+ ;
+interpolationMethodList
+ : LBRACE (e=interpolationMethod (COMMA e=interpolationMethod )*)? RBRACE
+ ;
+rangeExpr
+ : STRUCT LBRACE
+ (field=fieldName COLON expr=scalarExpr
+ (COLON field=fieldName COLON expr=scalarExpr )*
+ )? RBRACE
+ ;
+rangeConstructorExpr
+ : (STRUCT)? LBRACE field=fieldName COLON expr=coverageExpr
+ (SEMICOLON field=fieldName COLON expr=coverageExpr )* RBRACE
+ ;
+crsTransformExpr
+ : CRSTRANSFORM LPAREN e1=coverageExpr COMMA dcl=dimensionIntervalList COMMA fil=fieldInterpolationList RPAREN
+
+ ;
+fieldInterpolationList
+ : LBRACE elem=fieldInterpolationElement
+ (COMMA elem=fieldInterpolationElement ) * RBRACE
+ ;
+fieldInterpolationElement
+ : aname=fieldName method=interpolationMethod
+ ;
+unaryInducedExpr
+ : e6=fieldExpr
+ | e1=unaryArithmeticExpr
+ | e2=exponentialExpr
+ | e3=trigonometricExpr
+ | e4=booleanExpr
+ | e5=castExpr
+ | e7=rangeConstructorExpr
+ ;
+unaryArithmeticExpr
+ : op=(MINUS|PLUS) e1=coverageAtom
+ | op=(SQRT|ABS|RE|IM) LPAREN e2=coverageExpr RPAREN
+ ;
+exponentialExpr
+ : op=(EXP|LOG|LN) LPAREN e1=coverageExpr RPAREN
+ ;
+trigonometricExpr
+ : op=(SIN|COS|TAN|SINH|COSH|TANH|ARCSIN|ARCCOS|ARCTAN) LPAREN e1=coverageExpr RPAREN
+ ;
+booleanExpr
+ : op=NOT e1=coverageExpr
+ | op=BIT LPAREN e1=coverageExpr COMMA e2=indexExpr RPAREN
+ ;
+indexExpr
+ : e1=indexTerm
+ (op=(PLUS|MINUS) e2=indexTerm )*
+ ;
+indexTerm
+ : e1=indexFactor
+ ((op=(MULT|DIVIDE) e2=indexFactor ))*
+ ;
+indexFactor
+ : e=INTEGERCONSTANT
+ | op=ROUND LPAREN e1=numericScalarExpr RPAREN
+ | (LPAREN e2=indexExpr RPAREN )
+ ;
+stringScalarExpr
+// The first rule should be "metaDataExpr", but currently only a variable "identifier" is allowed.
+ : op=IDENTIFIER LPAREN e1=coverageExpr RPAREN
+ | e=STRING
+ ;
+scaleExpr
+ : SCALE LPAREN e1=coverageExpr COMMA dil=dimensionIntervalList COMMA fil=fieldInterpolationList RPAREN
+
+ ;
+subsetExpr
+ : e1=trimExpr
+ | e2=sliceExpr
+ | e3=extendExpr
+ ;
+trimExpr
+ : e1=coverageAtom LBRACKET dil=dimensionIntervalList RBRACKET
+ | TRIM LPAREN e2=coverageExpr COMMA LBRACE dil=dimensionIntervalList RBRACE RPAREN
+ ;
+sliceExpr
+ : e1=coverageAtom LBRACKET dpl=dimensionPointList RBRACKET
+ | SLICE LPAREN e2=coverageExpr COMMA LBRACE dpl=dimensionPointList RBRACE RPAREN
+ ;
+extendExpr
+ : EXTEND LPAREN e1=coverageExpr COMMA dil=dimensionIntervalList RPAREN
+ ;
+castExpr
+ : LPAREN e1=rangeType RPAREN e2=coverageExpr
+ ;
+rangeType
+ : type=(BOOLEAN|CHAR|SHORT|LONG|FLOAT|DOUBLE|COMPLEX|COMPLEX2)
+ | UNSIGNED type=(CHAR|SHORT|LONG)
+ ;
+fieldExpr
+ : e1=coverageAtom DOT e2=fieldName
+ ;
+// NOTE: The following boolean rules are equivalent to the grammar rules in document 08-068r2
+// They have been rewritten in order to prioritize the boolean operators
+booleanScalarExpr
+ : e1=booleanScalarTerm
+ (op=(OR|XOR) e2=booleanScalarTerm )*
+ ;
+booleanScalarTerm
+ : e1=booleanScalarNegation
+ (op=AND e2=booleanScalarNegation )*
+ ;
+booleanScalarNegation
+ : e1=booleanScalarAtom
+ | op=NOT e1=booleanScalarAtom
+ ;
+booleanScalarAtom
+ : LPAREN e1=booleanScalarExpr RPAREN
+ | s1=stringScalarExpr cop=compOp s2=stringScalarExpr
+ | n1=numericScalarExpr cop=compOp n2=numericScalarExpr
+ | e=BOOLEANCONSTANT
+ ;
+numericScalarExpr
+ : e1=numericScalarTerm
+ (op=(PLUS|MINUS) e2=numericScalarTerm )*
+ ;
+numericScalarTerm
+ : e1=numericScalarFactor
+ (op=(MULT|DIVIDE) e2=numericScalarFactor )*
+ ;
+numericScalarFactor
+ : LPAREN e1=numericScalarExpr RPAREN
+ | op=MINUS e10=numericScalarFactor
+ | op=ROUND LPAREN e1=numericScalarExpr RPAREN
+ | e=INTEGERCONSTANT
+ | e=FLOATCONSTANT
+ | e2=complexConstant
+ | e3=condenseExpr
+ | e4=variableName
+ ;
+compOp
+ : EQUALS
+ | NOTEQUALS
+ | LT
+ | GT
+ | LTE
+ | GTE
+ ;
+dimensionIntervalList
+ : elem=dimensionIntervalElement
+ (COMMA elem=dimensionIntervalElement )*
+ ;
+dimensionIntervalElement
+ : aname=axisName (COLON crs=crsName )?
+ LPAREN die=dimensionIntervalExpr RPAREN
+ ;
+dimensionIntervalExpr
+ : e1=scalarExpr COLON e2=scalarExpr
+ | DOMAIN LPAREN e3=coverageName COLON e4=axisName COLON e5=crsName RPAREN
+ ;
+dimensionPointList
+ : elem1=dimensionPointElement
+ (COMMA elem2=dimensionPointElement )*
+ ;
+dimensionPointElement
+ : aname=axisName LPAREN dpe=dimensionPoint RPAREN
+ | aname=axisName COLON crs=crsName LPAREN dpe=dimensionPoint RPAREN
+ ;
+dimensionPoint
+ : e1=scalarExpr
+ ;
+interpolationMethod
+ : LPAREN type=interpolationType COLON res=nullResistence RPAREN
+ ;
+interpolationType
+ : type=(NEAREST|LINEAR|QUADRATIC|CUBIC)
+ ;
+nullResistence
+ : resistance=(FULL|NONE|HALF|OTHER)
+ ;
+condenseOpType
+ : op=(PLUS|MULT|MAX|MIN|AND|OR)
+ ;
+fieldName
+ : name
+ ;
+constant
+ : e=(STRING|BOOLEANCONSTANT|INTEGERCONSTANT|FLOATCONSTANT)
+ | e1=complexConstant
+ ;
+complexConstant
+ : LPAREN re1=FLOATCONSTANT COMMA im1=FLOATCONSTANT RPAREN
+ ;
+stringConstant
+ : s=STRING
+ ;
+name
+ : var=(NAME | STRING | INTEGERCONSTANT)
+ ;
+crsName
+ : s=stringConstant
+ ;
+axisName
+ : type1=name
+ ;
+variableName
+ : var=VARIABLE_DOLLAR
+ ;
+coverageVariable
+ : var=NAME
+ ;
+coverageName
+ : name
+ ;
+
+
+/* Lexer rules */
+PLUS: '+';
+MINUS: '-';
+DIVIDE: '/';
+MULT: '*';
+EQUALS: '=';
+NOTEQUALS: '!=';
+LT: '<';
+GT: '>';
+LTE: '<=';
+GTE: '>=';
+DOT: '.';
+LPAREN: '(';
+RPAREN: ')';
+LBRACKET: '[';
+RBRACKET: ']';
+LBRACE: '{';
+RBRACE: '}';
+COMMA: ',';
+COLON: ':';
+SEMICOLON: ';';
+FOR: ('f'|'F')('o'|'O')('r'|'R');
+IN: ('i'|'I')('n'|'N');
+WHERE: ('w'|'W')('h'|'H')('e'|'E')('r'|'R')('e'|'E');
+RETURN: ('r'|'R')('e'|'E')('t'|'T')('u'|'U')('r'|'R')('n'|'N');
+STORE: ('s'|'S')('t'|'T')('o'|'O')('r'|'R')('e'|'E');
+ENCODE: ('e'|'E')('n'|'N')('c'|'C')('o'|'O')('d'|'D')('e'|'E');
+SQRT: ('s'|'S')('q'|'Q')('r'|'R')('t'|'T');
+SIN: ('s'|'S')('i'|'I')('n'|'N');
+COS: ('c'|'C')('o'|'O')('s'|'S');
+TAN: ('t'|'T')('a'|'A')('n'|'N');
+SINH: ('s'|'S')('i'|'I')('n'|'N')('h'|'H');
+COSH: ('c'|'C')('o'|'O')('s'|'S')('h'|'H');
+TANH: ('t'|'T')('a'|'A')('n'|'N')('h'|'H');
+ARCSIN: ('a'|'A')('r'|'R')('c'|'C')('s'|'S')('i'|'I')('n'|'N');
+ARCCOS: ('a'|'A')('r'|'R')('c'|'C')('c'|'C')('o'|'O')('s'|'S');
+ARCTAN: ('a'|'A')('r'|'R')('c'|'C')('t'|'T')('a'|'A')('n'|'N');
+EXP: ('e'|'E')('x'|'X')('p'|'P');
+LN: ('l'|'L')('n'|'N');
+LOG: ('l'|'L')('o'|'O')('g'|'G');
+ROUND: ('r'|'R')('o'|'O')('u'|'U')('n'|'N')('d'|'D');
+ABS: ('a'|'A')('b'|'B')('s'|'S');
+OVERLAY: ('o'|'O')('v'|'V')('e'|'E')('r'|'R')('l'|'L')('a'|'A')('y'|'Y');
+STRUCT: ('s'|'S')('t'|'T')('r'|'R')('u'|'U')('c'|'C')('t'|'T');
+RE: ('r'|'R')('e'|'E');
+IM: ('i'|'I')('m'|'M');
+AND: ('a'|'A')('n'|'N')('d'|'D');
+OR: ('o'|'O')('r'|'R');
+XOR: ('x'|'X')('o'|'O')('r'|'R');
+NOT: ('n'|'N')('o'|'O')('t'|'T');
+IDENTIFIER: ('i'|'I')('d'|'D')('e'|'E')('n'|'N')('t'|'T')('i'|'I')('f'|'F')('i'|'I')('e'|'E')('r'|'R');
+IMAGECRS: ('i'|'I')('m'|'M')('a'|'A')('g'|'G')('e'|'E')('c'|'C')('r'|'R')('s'|'S');
+IMAGECRSDOMAIN: ('i'|'I')('m'|'M')('a'|'A')('g'|'G')('e'|'E')('c'|'C')('r'|'R')('s'|'S')('d'|'D')('o'|'O')('m'|'M')('a'|'A')('i'|'I')('n'|'N');
+CRSSET: ('c'|'C')('r'|'R')('s'|'S')('s'|'S')('e'|'E')('t'|'T');
+DOMAIN: ('d'|'D')('o'|'O')('m'|'M')('a'|'A')('i'|'I')('n'|'N');
+NULLSET: ('n'|'N')('u'|'U')('l'|'L')('l'|'L')('s'|'S')('e'|'E')('t'|'T');
+NULLDEFAULT: ('n'|'N')('u'|'U')('l'|'L')('l'|'L')('d'|'D')('e'|'E')('f'|'F')('a'|'A')('u'|'U')('l'|'L')('t'|'T');
+INTERPOLATIONDEFAULT: ('i'|'I')('n'|'N')('t'|'T')('e'|'E')('r'|'R')('p'|'P')('o'|'O')('l'|'L')('a'|'A')('t'|'T')('i'|'I')('o'|'O')('n'|'N')('d'|'D')('e'|'E')('f'|'F')('a'|'A')('u'|'U')('l'|'L')('t'|'T');
+INTERPOLATIONSET: ('i'|'I')('n'|'N')('t'|'T')('e'|'E')('r'|'R')('p'|'P')('o'|'O')('l'|'L')('a'|'A')('t'|'T')('i'|'I')('o'|'O')('n'|'N')('s'|'S')('e'|'E')('t'|'T');
+SETIDENTIFIER: ('s'|'S')('e'|'E')('t'|'T')('i'|'I')('d'|'D')('e'|'E')('n'|'N')('t'|'T')('i'|'I')('f'|'F')('i'|'I')('e'|'E')('r'|'R');
+SETNULLSET: ('s'|'S')('e'|'E')('t'|'T')('n'|'N')('u'|'U')('l'|'L')('l'|'L')('s'|'S')('e'|'E')('t'|'T');
+SETINTERPOLATIONDEFAULT: ('s'|'S')('e'|'E')('t'|'T')('i'|'I')('n'|'N')('t'|'T')('e'|'E')('r'|'R')('p'|'P')('o'|'O')('l'|'L')('a'|'A')('t'|'T')('i'|'I')('o'|'O')('n'|'N')('d'|'D')('e'|'E')('f'|'F')('a'|'A')('u'|'U')('l'|'L')('t'|'T');
+SETINTERPOLATIONSET:('s'|'S')('e'|'E')('t'|'T')('i'|'I')('n'|'N')('t'|'T')('e'|'E')('r'|'R')('p'|'P')('o'|'O')('l'|'L')('a'|'A')('t'|'T')('i'|'I')('o'|'O')('n'|'N')('s'|'S')('e'|'E')('t'|'T');
+SETCRSSET: ('s'|'S')('e'|'E')('t'|'T')('c'|'C')('r'|'R')('s'|'S')('s'|'S')('e'|'E')('t'|'T');
+TRIM: ('t'|'T')('r'|'R')('i'|'I')('m'|'M');
+SLICE: ('s'|'S')('l'|'L')('i'|'I')('c'|'C')('e'|'E');
+EXTEND: ('e'|'E')('x'|'X')('t'|'T')('e'|'E')('n'|'N')('d'|'D');
+SCALE: ('s'|'S')('c'|'C')('a'|'A')('l'|'L')('e'|'E');
+CRSTRANSFORM: ('c'|'C')('r'|'R')('s'|'S')('t'|'T')('r'|'R')('a'|'A')('n'|'N')('s'|'S')('f'|'F')('o'|'O')('r'|'R')('m'|'M');
+COUNT: ('c'|'C')('o'|'O')('u'|'U')('n'|'N')('t'|'T');
+ADD: ('a'|'A')('d'|'D')('d'|'D');
+AVG: ('a'|'A')('v'|'V')('g'|'G');
+MAX: ('m'|'M')('a'|'A')('x'|'X');
+MIN: ('m'|'M')('i'|'I')('n'|'N');
+SOME: ('s'|'S')('o'|'O')('m'|'M')('e'|'E');
+ALL: ('a'|'A')('l'|'L')('l'|'L');
+COVERAGE: ('c'|'C')('o'|'O')('v'|'V')('e'|'E')('r'|'R')('a'|'A')('g'|'G')('e'|'E');
+OVER: ('o'|'O')('v'|'V')('e'|'E')('r'|'R');
+VALUE: ('v'|'V')('a'|'A')('l'|'L')('u'|'U')('e'|'E');
+VALUES: ('v'|'V')('a'|'A')('l'|'L')('u'|'U')('e'|'E')('s'|'S');
+LIST: ('l'|'L')('i'|'I')('s'|'S')('t'|'T');
+CONDENSE: ('c'|'C')('o'|'O')('n'|'N')('d'|'D')('e'|'E')('n'|'N')('s'|'S')('e'|'E');
+USING: ('u'|'U')('s'|'S')('i'|'I')('n'|'N')('g'|'G');
+NEAREST: ('n'|'N')('e'|'E')('a'|'A')('r'|'R')('e'|'E')('s'|'S')('t'|'T');
+LINEAR: ('l'|'L')('i'|'I')('n'|'N')('e'|'E')('a'|'A')('r'|'R');
+QUADRATIC: ('q'|'Q')('u'|'U')('a'|'A')('d'|'D')('r'|'R')('a'|'A')('t'|'T')('i'|'I')('c'|'C');
+CUBIC: ('c'|'C')('u'|'U')('b'|'B')('i'|'I')('c'|'C');
+FULL: ('f'|'F')('u'|'U')('l'|'L')('l'|'L');
+NONE: ('n'|'N')('o'|'O')('n'|'N')('e'|'E');
+HALF: ('h'|'H')('a'|'A')('l'|'L')('f'|'F');
+OTHER: ('o'|'O')('t'|'T')('h'|'H')('e'|'E')('r'|'R');
+PHI: ('p'|'P')('h'|'H')('i'|'I');
+BIT: ('b'|'B')('i'|'I')('t'|'T');
+UNSIGNED: ('u'|'U')('n'|'N')('s'|'S')('i'|'I')('g'|'G')('n'|'N')('e'|'E')('d'|'D');
+BOOLEAN: ('b'|'B')('o'|'O')('o'|'O')('l'|'L')('e'|'E')('a'|'A')('n'|'N');
+CHAR: ('c'|'C')('h'|'H')('a'|'A')('r'|'R');
+SHORT: ('s'|'S')('h'|'H')('o'|'O')('r'|'R')('t'|'T');
+LONG: ('l'|'L')('o'|'O')('n'|'N')('g'|'G');
+FLOAT: ('f'|'F')('l'|'L')('o'|'O')('a'|'A')('t'|'T');
+DOUBLE: ('d'|'D')('o'|'O')('u'|'U')('b'|'B')('l'|'L')('e'|'E');
+COMPLEX: ('c'|'C')('o'|'O')('m'|'M')('p'|'P')('l'|'L')('e'|'E')('x'|'X');
+COMPLEX2: ('c'|'C')('o'|'O')('m'|'M')('p'|'P')('l'|'L')('e'|'E')('x'|'X')'2';
+BOOLEANCONSTANT: (('t'|'T')('r'|'R')('u'|'U')('e'|'E'))|(('f'|'F')('a'|'A')('l'|'L')('s'|'S')('e'|'E'));
+INTEGERCONSTANT: (PLUS|MINUS)? ('0'..'9')+;
+FLOATCONSTANT: INTEGERCONSTANT ('.')('0'..'9'+)(('e'|'E')(('-'|'+')?)('0'..'9'+))?;
+STRING: '"' ( options {greedy=false;} : . )* '"' {setText(getText().substring(1, getText().length()-1));};
+NAME: ('a'..'z'|'A'..'Z'|'_')(('a'..'z'|'A'..'Z'|'0'..'9'|'_')*);
+VARIABLE_DOLLAR: '$'(('a'..'z'|'A'..'Z'|'0'..'9'|'_')*) {setText(getText().substring(1, getText().length())); } ;
+WHITESPACE: (' ' | '\t' | '\r' | '\n' | '\u000C')+ { skip(); } ;
diff --git a/petascope/src/petascope/wcps/server/cli/f_grammar.java b/petascope/src/petascope/wcps/server/cli/f_grammar.java
new file mode 100644
index 0000000..79dfca8
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/cli/f_grammar.java
@@ -0,0 +1,60 @@
+package petascope.wcps.server.cli;
+
+import petascope.wcps.grammar.*;
+import petascope.wcps.grammar.wcpsParser.*;
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import org.antlr.runtime.ANTLRInputStream;
+import org.antlr.runtime.CommonTokenStream;
+import org.antlr.runtime.RecognitionException;
+import org.apache.commons.io.FileUtils;
+
+/** Test the WCPS grammar parser (generated by ANTLR).
+ * Input the path that contains an Abstract Syntax query.
+ * Outputs the corresponding XML tree.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class f_grammar {
+
+ private static String query;
+ private static String path;
+
+ public static void main(String[] args) throws RecognitionException, IOException {
+ if (args.length != 1) {
+ System.err.println("AbstractGrammarGen: no parameter to specify input file !");
+ path = "test/test-tmp/29.test";
+ query = FileUtils.readFileToString(new File(path));
+ } else {
+ path = args[0];
+ query = FileUtils.readFileToString(new File(path));
+ }
+
+ System.out.println("Running with the following query: " + query);
+
+ String xmlString = runQuery(query);
+ System.out.println("Output XML: \n****************\n" + xmlString);
+
+ System.exit(0);
+
+ }
+
+ public static String runQuery(String query) throws IOException, RecognitionException {
+ InputStream stream = new ByteArrayInputStream(query.getBytes()); // defaults to ISO-1
+ ANTLRInputStream inputStream = new ANTLRInputStream(stream);
+// wcpsLexer lexer = new wcpsLexer( inputStream );
+ wcpsLexer lexer = new wcpsLexer(inputStream);
+
+ CommonTokenStream tokenStream = new CommonTokenStream(lexer);
+// wcpsParser parser = new wcpsParser(tokenStream);
+ wcpsParser parser = new wcpsParser(tokenStream);
+
+ wcpsRequest_return rrequest = parser.wcpsRequest();
+ WCPSRequest request = rrequest.value;
+
+ String result = request.toXML();
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/cli/grammar.java b/petascope/src/petascope/wcps/server/cli/grammar.java
new file mode 100644
index 0000000..bc053dc
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/cli/grammar.java
@@ -0,0 +1,65 @@
+package petascope.wcps.server.cli;
+
+import petascope.wcps.grammar.*;
+import petascope.wcps.grammar.wcpsParser.*;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import org.antlr.runtime.ANTLRInputStream;
+import org.antlr.runtime.CommonTokenStream;
+import org.antlr.runtime.RecognitionException;
+
+/** Test the WCPS grammar parser (generated by ANTLR).
+ * Input an Abstract Syntax query.
+ * Outputs the corresponding XML tree.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class grammar {
+
+ static String query;
+
+ public static void main(String[] args) throws RecognitionException, IOException {
+ if (args.length != 1) {
+ System.err.println("AbstractGrammarGen: no query as parameter !");
+// query = "for a in (rgb) return " +
+// "condense + over $x x(1:10), $y y(25:75) " +
+// "using $x * (a[x($x), y($y)]).red";
+ query = "for c in (rgb) return encode(c[x:\"CRS:1\"(1:200)], \"jpeg\")";
+ } else {
+ query = args[0];
+ }
+
+ System.out.println("Running with the following query: " + query);
+
+ String xmlString = convertAbstractQueryToXml(query);
+ System.out.println("Output XML: \n****************\n" + xmlString);
+
+ System.exit(0);
+
+ }
+
+ /** Converts a WCPS abstract syntax query to an XML query
+ *
+ * @param query Abstract Syntax query
+ * @return String XML query
+ * @throws java.io.IOException
+ * @throws org.antlr.runtime.RecognitionException
+ */
+ public static String convertAbstractQueryToXml(String query) throws IOException, RecognitionException {
+ InputStream stream = new ByteArrayInputStream(query.getBytes()); // defaults to ISO-1
+ ANTLRInputStream inputStream = new ANTLRInputStream(stream);
+// wcpsLexer lexer = new wcpsLexer( inputStream );
+ wcpsLexer lexer = new wcpsLexer(inputStream);
+
+ CommonTokenStream tokenStream = new CommonTokenStream(lexer);
+// wcpsParser parser = new wcpsParser(tokenStream);
+ wcpsParser parser = new wcpsParser(tokenStream);
+
+ wcpsRequest_return rrequest = parser.wcpsRequest();
+ WCPSRequest request = rrequest.value;
+
+ String result = request.toXML();
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/cli/xml.java b/petascope/src/petascope/wcps/server/cli/xml.java
new file mode 100644
index 0000000..e115c8e
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/cli/xml.java
@@ -0,0 +1,155 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.cli;
+
+import petascope.wcps.server.core.DbMetadataSource;
+import petascope.wcps.server.core.ProcessCoveragesRequest;
+import petascope.wcps.server.core.WCPS;
+
+import java.io.File;
+import java.io.FileInputStream;
+
+import java.io.StringReader;
+import java.util.Properties;
+import org.xml.sax.InputSource;
+
+/**
+ * This is a small application around the WCPS core. It takes XML requests as files and runs them
+ * through WCPS. The resulting radaman queries are displayed, but not executed. This is very useful
+ * for testing whether your metadata is valid.
+ */
+public class xml {
+
+ private static WCPS wcps;
+ private static DbMetadataSource metadataSource;
+
+ private static void initMetadata() {
+ File cwd = new File(".");
+ System.out.println("Working in " + cwd.getAbsolutePath());
+ String pcSchemaFileName =
+ // "src/conf/" +
+ "xml" + File.separator + "ogc" + File.separator + "wcps"
+ + File.separator + "1.0.0" + File.separator + "wcpsProcessCoverages.xsd";
+ File pcSchemaFile = new File(pcSchemaFileName);
+
+ if (!pcSchemaFile.exists()) {
+ System.err.println("WCPS: could not find the WCPS ProcessCoverage schema ("
+ + pcSchemaFileName + ")");
+ System.exit(1);
+ }
+
+ metadataSource = null;
+
+ try {
+ Properties dbParams = new Properties();
+
+ dbParams.load(new FileInputStream("settings.properties"));
+ metadataSource =
+ new DbMetadataSource(dbParams.getProperty("metadata_driver"),
+ dbParams.getProperty("metadata_url"),
+ dbParams.getProperty("metadata_user"),
+ dbParams.getProperty("metadata_pass"), false);
+ wcps = new WCPS(pcSchemaFile, metadataSource);
+ } catch (Exception e) {
+ System.err.println("WCPS: could not initialize WCPS:");
+ e.printStackTrace(System.err);
+ System.exit(1);
+ }
+ }
+
+ public static void main(String[] args) {
+ if (args.length < 1) {
+ System.err.println("WCPS CLI: no input files");
+
+ System.err.println("\nWCPS CLI Usage: java wcps.server.cli.xml input.xml");
+ System.err.println("Where input.xml contains a ProcessCoverages Request ");
+// System.exit(1);
+
+ args = new String[1];
+ args[0] = "test/testcases-wcps_dollar/25.test.xml";
+ }
+ if (args.length > 1) {
+ System.err.println("WCPS: no input files");
+ System.exit(1);
+ }
+
+ initMetadata();
+
+ for (int i = 0; i < args.length; i++) {
+ File fileIn = null;
+ InputSource is = null;
+
+ try {
+ fileIn = new File(args[i]);
+ is = new InputSource(new FileInputStream(fileIn));
+ } catch (Exception fnfe) {
+ System.err.println("WCPS: " + args[i]
+ + ": no such file or directory" + fnfe);
+ System.exit(1);
+ }
+
+
+ String result = processCoverage(is, i);
+ if (result != null) {
+ System.out.println(result);
+ } else {
+ System.err.println("WCPS: " + args[i] + " failed");
+ System.exit(1);
+ }
+ }
+
+ metadataSource.close();
+ System.exit(0);
+
+ }
+
+ private static String processCoverage(InputSource is, int i) {
+ String result = null;
+
+ try {
+ ProcessCoveragesRequest r = wcps.pcPrepare("http://kahlua.eecs.jacobs-university.de:9001",
+ "RASSERVICE", is);
+ System.err.println("Request " + i);
+ String rasql = r.getRasqlQuery();
+ String mime = r.getMime();
+// result = "[" + mime + "] " + rasql;
+ result = rasql;
+ } catch (Exception e) {
+ System.err.println("WCPS: request " + i
+ + " failed with the following exception:");
+ e.printStackTrace(System.err);
+ }
+
+ return result;
+ }
+
+ /** Converts a WCPS XML query into a RasQL query string **/
+ public static String convertXmlToRasql(String query) {
+ String rasql = null;
+ if (metadataSource == null) {
+ initMetadata();
+ }
+ InputSource is = new InputSource(new StringReader(query));
+ rasql = processCoverage(is, 1);
+ return rasql;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/AxisIterator.java b/petascope/src/petascope/wcps/server/core/AxisIterator.java
new file mode 100644
index 0000000..7421448
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/AxisIterator.java
@@ -0,0 +1,111 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import java.math.BigInteger;
+import org.w3c.dom.*;
+
+public class AxisIterator implements IRasNode {
+
+ private String var, varTranslation;
+ private AxisName axis;
+ private NumericScalarExpr hi, lo;
+
+ public AxisIterator(Node node, XmlQuery xq, String newIteratorName) throws WCPSException, InvalidCrsException {
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+ System.err.println("Trying to parse AxisIterator ");
+
+ while (node != null) {
+ String nodeName = node.getNodeName();
+
+ if (nodeName.equals("iteratorVar")) {
+ var = node.getTextContent();
+ // This variable will be referenced later on. Translate it.
+ xq.addReferenceVariable(var, newIteratorName);
+ varTranslation = xq.getReferenceVariableName(var);
+ } else if (nodeName.equals("axis")) {
+ axis = new AxisName(node, xq);
+ } else {
+ // Should contain the limits
+ // TODO: Implement ImageCrsDomainMetadataType class
+ if (lo == null) {
+ lo = new NumericScalarExpr(node, xq);
+ } else if (hi == null) {
+ hi = new NumericScalarExpr(node, xq);
+ } else {
+ throw new WCPSException("Unknown node in AxisIterator: " + nodeName);
+ }
+ }
+
+ node = node.getNextSibling();
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+ }
+ }
+
+ public String toRasQL() {
+ String result = varTranslation + " in [" + lo.toRasQL() + ":" + hi.toRasQL() + "]";
+ return result;
+ }
+
+ /** Sets a new name for the iterator variable, to be used in the rasql query**/
+ public void setVariableTranslation(String newName) {
+ varTranslation = newName;
+ }
+
+ /** Return the Higher bound for the axis iterator.
+ * This only works for constant expressions.
+ * TODO: implement arbitrary expressions.
+ * @return BigInteger
+ */
+ public BigInteger getHigh() {
+ return SDU.str2integer(hi.toRasQL()).get(0);
+ }
+
+ /** Return the Lower bound for the axis iterator.
+ * This only works for constant expressions.
+ * TODO: implement arbitrary expressions.
+ * @return BIgInteger
+ */
+ public BigInteger getLow() {
+ return SDU.str2integer(lo.toRasQL()).get(0);
+ }
+
+ /* Return the variable name used in this axis */
+ public String getVar() {
+ return var;
+ }
+
+ public String getAxisType() {
+ return axis.toRasQL();
+ }
+
+ /* Returns the m-interval that this axis iterates over in a string form */
+ public String getInterval() {
+ return lo.toRasQL() + ":" + hi.toRasQL();
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/AxisName.java b/petascope/src/petascope/wcps/server/core/AxisName.java
new file mode 100644
index 0000000..5dd14e5
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/AxisName.java
@@ -0,0 +1,57 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.WCPSException;
+import java.util.Collection;
+import org.w3c.dom.*;
+
+public class AxisName implements IRasNode {
+
+ private String name;
+
+ public AxisName(Node node, XmlQuery xq) throws WCPSException {
+ System.err.println("Trying axis node: " + node.getNodeName());
+
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ if (node != null && node.getNodeName().equals("axis")) {
+ String axis = node.getTextContent();
+ // validate axis name
+ IDynamicMetadataSource meta = xq.getMetadataSource();
+ Collection<String> axisNames = meta.getAxisNames();
+ if (axisNames.contains(axis)) {
+ this.name = axis;
+ } else {
+ throw new WCPSException("Unknown axis name " + axis);
+ }
+ } else {
+ throw new WCPSException("Could not find an axis node !");
+ }
+ }
+
+ public String toRasQL() {
+ return name;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/BinaryOperationCoverageExpr.java b/petascope/src/petascope/wcps/server/core/BinaryOperationCoverageExpr.java
new file mode 100644
index 0000000..2d1fb96
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/BinaryOperationCoverageExpr.java
@@ -0,0 +1,125 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+public class BinaryOperationCoverageExpr implements IRasNode, ICoverageInfo {
+
+ private IRasNode first, second;
+ private CoverageExprPairType pair;
+ private CoverageInfo info;
+ private String operation;
+
+ public BinaryOperationCoverageExpr(Node node, XmlQuery xq)
+ throws WCPSException, InvalidCrsException {
+ String nodeName = node.getNodeName();
+
+ System.err.println("Trying to parse binary operation: " + nodeName);
+ boolean okay = false; // will be true if the node is recognized
+
+ if (nodeName.equals("plus")) {
+ operation = "+";
+ okay = true;
+ }
+
+ if (nodeName.equals("minus")) {
+ operation = "-";
+ okay = true;
+ }
+
+ if (nodeName.equals("mult")) {
+ operation = "*";
+ okay = true;
+ }
+
+ if (nodeName.equals("div")) {
+ operation = "/";
+ okay = true;
+ }
+
+ if (nodeName.equals("and") || nodeName.equals("or") || nodeName.equals("xor")) {
+ operation = nodeName;
+ okay = true;
+ }
+
+ if (nodeName.equals("equals")) {
+ operation = "=";
+ okay = true;
+ }
+
+ if (nodeName.equals("lessThan")) {
+ operation = "<";
+ okay = true;
+ }
+
+ if (nodeName.equals("greaterThan")) {
+ operation = ">";
+ okay = true;
+ }
+
+ if (nodeName.equals("lessOrEqual")) {
+ operation = "<=";
+ okay = true;
+ }
+
+ if (nodeName.equals("greaterOrEqual")) {
+ operation = ">=";
+ okay = true;
+ }
+
+ if (nodeName.equals("notEqual")) {
+ operation = "!=";
+ okay = true;
+ }
+
+ if (nodeName.equals("overlay")) {
+ operation = "overlay";
+ okay = true;
+ }
+
+ if (!okay) {
+ throw new WCPSException("Unexpected binary operation : " + nodeName);
+ }
+
+ Node operand = node.getFirstChild();
+
+ while (operand.getNodeName().equals("#text")) {
+ operand = operand.getNextSibling();
+ }
+
+ pair = new CoverageExprPairType(operand, xq);
+ info = new CoverageInfo(((ICoverageInfo) pair).getCoverageInfo());
+ first = pair.getFirst();
+ second = pair.getSecond();
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return info;
+ }
+
+ public String toRasQL() {
+ return "((" + first.toRasQL() + ")" + operation + "(" + second.toRasQL() + "))";
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/BooleanScalarExpr.java b/petascope/src/petascope/wcps/server/core/BooleanScalarExpr.java
new file mode 100644
index 0000000..1cbe079
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/BooleanScalarExpr.java
@@ -0,0 +1,138 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+public class BooleanScalarExpr implements IRasNode {
+
+ private IRasNode first, second;
+ private String op;
+ private boolean simple; // true if the expression is just a value
+ private String value;
+
+ public BooleanScalarExpr(Node node, XmlQuery xq) throws WCPSException, InvalidCrsException {
+ if (node == null) {
+ throw new WCPSException("Unexpected null node !");
+ }
+
+ String nodeName = node.getNodeName();
+
+ simple = false;
+
+ System.err.println("Parsing boolean scalar operation ...");
+
+ if (nodeName.equals("booleanConstant")) {
+ simple = true;
+ value = node.getFirstChild().getNodeValue();
+ } else if (nodeName.equals("booleanAnd")
+ || nodeName.equals("booleanOr")
+ || nodeName.equals("booleanXor")
+ || nodeName.equals("booleanLessThan")
+ || nodeName.equals("booleanLessOrEqual")
+ || nodeName.equals("booleanGreaterThan")
+ || nodeName.equals("booleanGreaterOrEqual")
+ || nodeName.equals("booleanEqualNumeric")
+ || nodeName.equals("booleanNotEqualNumeric")
+ || nodeName.equals("booleanEqualString")
+ || nodeName.equals("booleanNotEqualString")) {
+ // Logical operations
+ if (nodeName.equals("booleanAnd")
+ || nodeName.equals("booleanOr")
+ || nodeName.equals("booleanXor")) {
+ // Remove the "boolean" in front
+ op = nodeName.substring(7).toLowerCase();
+
+ Node child = node.getFirstChild();
+
+ first = new BooleanScalarExpr(child, xq);
+ child = child.getNextSibling();
+ second = new BooleanScalarExpr(child, xq);
+ } else // Boolean Comparison operations between numbers or strings
+ {
+ if (nodeName.equals("booleanLessThan") || nodeName.equals("booleanLessOrEqual")
+ || nodeName.equals("booleanGreaterThan") || nodeName.equals("booleanGreaterOrEqual")
+ || nodeName.equals("booleanEqualNumeric") || nodeName.equals("booleanNotEqualNumeric")) {
+ if (nodeName.equals("booleanLessThan")) {
+ op = "<";
+ }
+ if (nodeName.equals("booleanLessOrEqual")) {
+ op = "<=";
+ }
+ if (nodeName.equals("booleanGreaterThan")) {
+ op = ">";
+ }
+ if (nodeName.equals("booleanGreaterOrEqual")) {
+ op = ">=";
+ }
+ if (nodeName.equals("booleanEqualNumeric")) {
+ op = "=";
+ }
+ if (nodeName.equals("booleanNotEqualNumeric")) {
+ op = "!=";
+ }
+
+ Node child = node.getFirstChild();
+
+ first = new NumericScalarExpr(child, xq);
+ child = child.getNextSibling();
+ second = new NumericScalarExpr(child, xq);
+ } else {
+ if (nodeName.equals("booleanEqualString")) {
+ op = "=";
+ }
+ if (nodeName.equals("booleanNotEqualString")) {
+ op = "!=";
+ }
+
+ Node child = node.getFirstChild();
+
+ first = new StringScalarExpr(child, xq);
+ child = child.getNextSibling();
+ second = new StringScalarExpr(child, xq);
+ }
+ }
+
+ } else if (nodeName.equals("booleanNot")) {
+ op = "not";
+ first = new BooleanScalarExpr(node.getFirstChild(), xq);
+ } else {
+ throw new WCPSException("Unexpected Binary Expression node : "
+ + node.getNodeName());
+ }
+ System.err.println("*** Boolean Scalar Expr SUCCESS: " + node.getNodeName());
+ }
+
+ public String toRasQL() {
+ if (simple) {
+ return value;
+ }
+
+ if (op.equals("not")) {
+ return "not(" + first.toRasQL() + ")";
+ }
+
+ return "(" + first.toRasQL() + ")" + op + "(" + second.toRasQL() + ")";
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/CellDomainElement.java b/petascope/src/petascope/wcps/server/core/CellDomainElement.java
new file mode 100644
index 0000000..f5e069f
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/CellDomainElement.java
@@ -0,0 +1,79 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidMetadataException;
+import java.math.BigInteger;
+
+//A coverage axis in pixel coordinates. See the WCPS standard.
+public class CellDomainElement implements Cloneable {
+
+ private BigInteger hi;
+ private BigInteger lo;
+
+ public CellDomainElement(BigInteger lo, BigInteger hi) throws InvalidMetadataException {
+ if ((lo == null) || (hi == null)) {
+ throw new InvalidMetadataException(
+ "Invalid cell domain element: Bounds may not be null");
+ }
+
+ if (lo.compareTo(hi) == 1) {
+ throw new InvalidMetadataException(
+ "Invalid cell domain element: Lower bound cannot be larger than upper bound");
+ }
+
+ this.lo = lo;
+ this.hi = hi;
+
+ }
+
+ public CellDomainElement clone() {
+ try {
+ return new CellDomainElement(BigInteger.ZERO.add(lo),
+ BigInteger.ZERO.add(hi));
+ } catch (InvalidMetadataException ime) {
+ throw new RuntimeException(
+ "Invalid metadata while cloning CellDomainElement. This is a software bug in WCPS.",
+ ime);
+ }
+
+ }
+
+ public boolean equals(CellDomainElement cde) {
+ return lo.equals(cde.lo) && hi.equals(cde.hi);
+
+ }
+
+ public BigInteger getHi() {
+ return hi;
+
+ }
+
+ public BigInteger getLo() {
+ return lo;
+ }
+
+ public String toString() {
+ String result = "CellDomainElement [" + lo + ", " + hi + "]";
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/ComplexConstant.java b/petascope/src/petascope/wcps/server/core/ComplexConstant.java
new file mode 100644
index 0000000..2d7312c
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/ComplexConstant.java
@@ -0,0 +1,121 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+public class ComplexConstant implements IRasNode {
+
+ private String re, im;
+
+ public ComplexConstant(String str) throws WCPSException {
+ boolean ok = true;
+ // We only accept the following String representation of a complex number: {re,im}
+ if (str.startsWith("{") && str.endsWith("}")) {
+ str = str.substring(1, str.length() - 2);
+ if (str.indexOf(",") != -1 && str.lastIndexOf(",") != str.indexOf(",")) {
+ int comma = str.indexOf(",");
+ re = str.substring(0, comma - 1);
+ im = str.substring(comma + 1, str.length() - comma - 1);
+ } else {
+ ok = false;
+ }
+ } else {
+ ok = false;
+ }
+ if (ok == false) {
+ throw new WCPSException("Could not parse Complex Constant !");
+ }
+
+ // parse the real part
+ try {
+ Integer real = Integer.parseInt(re);
+ } catch (NumberFormatException e) {
+ try {
+ Float real = Float.parseFloat(re);
+ } catch (NumberFormatException e2) {
+ throw new WCPSException("Could not parse float or integer "
+ + "number for real part of complex number:" + re);
+ }
+ }
+ // parse the imaginary part
+ try {
+ Integer imag = Integer.parseInt(im);
+ } catch (NumberFormatException e) {
+ try {
+ Float imag = Float.parseFloat(im);
+ } catch (NumberFormatException e2) {
+ throw new WCPSException("Could not parse float or integer "
+ + "number for imaginary part of complex number" + im);
+ }
+ }
+ }
+
+ public ComplexConstant(Node node, XmlQuery xq) throws WCPSException {
+ System.err.println("Parsing complex constant: " + node.getNodeName());
+
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ while (node != null) {
+ String name = node.getNodeName();
+ if (name.equals("re")) {
+ re = node.getNodeValue();
+ } else if (name.equals("im")) {
+ im = node.getNodeValue();
+ } else {
+ throw new WCPSException("Unknown node while processing complex constant: " + name);
+ }
+
+ node = node.getNextSibling();
+ }
+
+ // parse the real part
+ try {
+ Integer real = Integer.parseInt(re);
+ } catch (NumberFormatException e) {
+ try {
+ Float real = Float.parseFloat(re);
+ } catch (NumberFormatException e2) {
+ throw new WCPSException("Could not parse float or integer "
+ + "number for real part of complex number:" + re);
+ }
+ }
+ // parse the imaginary part
+ try {
+ Integer imag = Integer.parseInt(im);
+ } catch (NumberFormatException e) {
+ try {
+ Float imag = Float.parseFloat(im);
+ } catch (NumberFormatException e2) {
+ throw new WCPSException("Could not parse float or integer "
+ + "number for imaginary part of complex number" + im);
+ }
+ }
+ }
+
+ public String toRasQL() {
+ return "complex ( " + re + ", " + im + " ) ";
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/CondenseOperation.java b/petascope/src/petascope/wcps/server/core/CondenseOperation.java
new file mode 100644
index 0000000..08ac95c
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/CondenseOperation.java
@@ -0,0 +1,73 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+public class CondenseOperation implements IRasNode {
+
+ private String name;
+
+ public CondenseOperation(Node node, XmlQuery xq) throws WCPSException {
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ System.err.println("Parsing condense Operation: " + node.getNodeName());
+
+ String text = node.getNodeName();
+ this.name = formatOperation(text);
+
+ if (name == null) {
+ throw new WCPSException("Unknown condense operation: " + text);
+ }
+ }
+
+ private String formatOperation(String name) {
+ String shortOp = null;
+ if (name.equals("opPlus")) {
+ shortOp = "+";
+ }
+ if (name.equals("opMult")) {
+ shortOp = "*";
+ }
+ if (name.equals("opMin")) {
+ shortOp = "min";
+ }
+ if (name.equals("opMax")) {
+ shortOp = "max";
+ }
+ if (name.equals("opAnd")) {
+ shortOp = "and";
+ }
+ if (name.equals("opOr")) {
+ shortOp = "or";
+ }
+
+ return shortOp;
+ }
+
+ public String toRasQL() {
+ return name;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/CondenseScalarExpr.java b/petascope/src/petascope/wcps/server/core/CondenseScalarExpr.java
new file mode 100644
index 0000000..d983b1c
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/CondenseScalarExpr.java
@@ -0,0 +1,98 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import java.util.Vector;
+import org.w3c.dom.*;
+
+public class CondenseScalarExpr implements IRasNode {
+
+ private CondenseOperation op;
+ private Vector<AxisIterator> iterators;
+ private IRasNode using;
+ private IRasNode where;
+ private String axisIteratorString;
+ private String newIteratorName;
+
+ public CondenseScalarExpr(Node node, XmlQuery xq) throws WCPSException, InvalidCrsException {
+ if (node.getNodeName().equals("condense")) {
+ node = node.getFirstChild();
+ }
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ iterators = new Vector();
+ newIteratorName = xq.registerNewExpressionWithVariables();
+ System.err.println("Parsing Condense Scalar Expression: " + node.getNodeName());
+
+ while (node != null) {
+ String name = node.getNodeName();
+ if (op == null) {
+ op = new CondenseOperation(node, xq);
+ } else if (name.equals("iterator")) {
+ AxisIterator it = new AxisIterator(node.getFirstChild(), xq, newIteratorName);
+ iterators.add(it);
+ } else if (name.equals("where")) {
+ where = new BooleanScalarExpr(node.getFirstChild(), xq);
+ } else {
+ using = new CoverageExpr(node, xq);
+ }
+
+ node = node.getNextSibling();
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+ }
+
+ buildAxisIteratorDomain();
+ }
+
+ public String toRasQL() {
+ String result = "condense " + op.toRasQL() + " over ";
+ result += axisIteratorString;
+ if (where != null) {
+ result += where.toRasQL();
+ }
+ result += " using " + using.toRasQL();
+ return result;
+ }
+
+ /* Concatenates all the AxisIterators into one large multi-dimensional object,
+ * that will be used to build to RasQL query */
+ private void buildAxisIteratorDomain() {
+ axisIteratorString = "";
+ axisIteratorString += newIteratorName + " in [";
+
+ for (int i = 0; i < iterators.size(); i++) {
+ if (i > 0) {
+ axisIteratorString += ", ";
+ }
+ AxisIterator ai = iterators.elementAt(i);
+ axisIteratorString += ai.getInterval();
+ }
+
+ axisIteratorString += "]";
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/ConstantCoverageExpr.java b/petascope/src/petascope/wcps/server/core/ConstantCoverageExpr.java
new file mode 100644
index 0000000..6bdb4ae
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/ConstantCoverageExpr.java
@@ -0,0 +1,164 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import petascope.wcps.server.exceptions.InvalidMetadataException;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Vector;
+import org.w3c.dom.*;
+
+public class ConstantCoverageExpr implements IRasNode, ICoverageInfo {
+
+ private String covName;
+ private Vector<AxisIterator> iterators;
+ private ConstantList valueList;
+ private CoverageInfo info;
+ private String axisIteratorString;
+ private int requiredListSize = 1;
+
+ public ConstantCoverageExpr(Node node, XmlQuery xq)
+ throws WCPSException, InvalidCrsException {
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ iterators = new Vector();
+ System.err.println("Parsing Constant Coverage Expr: " + node.getNodeName());
+
+ while (node != null) {
+ String name = node.getNodeName();
+ if (name.equals("name")) {
+ covName = node.getTextContent();
+ } else if (name.equals("axisIterator")) {
+ AxisIterator it = new AxisIterator(node.getFirstChild(), xq, "temp");
+ iterators.add(it);
+ } else {
+ valueList = new ConstantList(node, xq);
+ node = valueList.getLastNode();
+ }
+
+ node = node.getNextSibling();
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+ }
+
+ buildMetadata(xq);
+ buildAxisIteratorDomain();
+
+ // Sanity check: dimensions should match number of constants in the list
+ if (valueList.getSize() != requiredListSize) {
+ throw new WCPSException("The number of constants in the list do "
+ + "not match the dimensions specified !");
+ }
+ // Sanity check: metadata should have already been build
+ if (info == null) {
+ throw new WCPSException("Could not build constant coverage metadata !!!");
+ }
+ }
+
+ public String toRasQL() {
+ String result = "< ";
+ result += axisIteratorString + " ";
+ result += valueList.toRasQL();
+ result += ">";
+
+ return result;
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return info;
+ }
+
+ /* Concatenates all the AxisIterators into one large multi-dimensional object,
+ * that will be used to build to RasQL query. Also counts how many elements
+ * fit in the specified dimensions. */
+ private void buildAxisIteratorDomain() {
+ requiredListSize = 1;
+ axisIteratorString = "";
+ axisIteratorString += "[";
+
+ for (int i = 0; i < iterators.size(); i++) {
+ if (i > 0) {
+ axisIteratorString += ", ";
+ }
+ AxisIterator ai = iterators.elementAt(i);
+ axisIteratorString += ai.getInterval();
+ requiredListSize *= (ai.getHigh().intValue() - ai.getLow().intValue() + 1);
+ }
+
+ axisIteratorString += "]";
+
+ System.err.println("Axes for ConstantCoverage tell us that the constant"
+ + "list should have exactly " + requiredListSize + " elements !");
+ }
+
+ /** Builds full metadata for the newly constructed coverage **/
+ private void buildMetadata(XmlQuery xq) throws WCPSException {
+ List<CellDomainElement> cellDomainList = new LinkedList<CellDomainElement>();
+ List<RangeElement> rangeList = new LinkedList<RangeElement>();
+ HashSet<String> nullSet = new HashSet<String>();
+ String nullDefault = "0";
+ nullSet.add(nullDefault);
+ HashSet<InterpolationMethod> interpolationSet = new HashSet<InterpolationMethod>();
+ InterpolationMethod interpolationDefault = new InterpolationMethod("none", "none");
+ interpolationSet.add(interpolationDefault);
+ String coverageName = covName;
+ List<DomainElement> domainList = new LinkedList<DomainElement>();
+
+ Iterator<AxisIterator> i = iterators.iterator();
+ while (i.hasNext()) {
+ // Build domain metadata
+ AxisIterator ai = i.next();
+ cellDomainList.add(new CellDomainElement(ai.getLow(), ai.getHigh()));
+ String axisName = ai.getVar();
+ String axisType = ai.getAxisType();
+ String crs = DomainElement.WGS84_CRS;
+ HashSet<String> crsset = new HashSet<String>();
+ crsset.add(crs);
+ DomainElement domain = new DomainElement(axisName, axisType,
+ ai.getLow().doubleValue(), ai.getHigh().doubleValue(),
+ null, null, crsset, xq.getMetadataSource().getAxisNames());
+ domainList.add(domain);
+ }
+ // TODO: check element datatypes and their consistency
+ // "unsigned int" is default datatype
+ rangeList.add(new RangeElement("dynamic_type", "unsigned int"));
+
+ try {
+ Metadata metadata = new Metadata(cellDomainList, rangeList, nullSet,
+ nullDefault, interpolationSet, interpolationDefault,
+ coverageName, domainList, null);
+ // Let the top-level query know the full metadata about us
+ xq.getMetadataSource().addDynamicMetadata(covName, metadata);
+ info = new CoverageInfo(metadata);
+ } catch (InvalidMetadataException e) {
+ throw new WCPSException("Could not build coverage '" + covName
+ + "' metadata !", e);
+ }
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/ConstantList.java b/petascope/src/petascope/wcps/server/core/ConstantList.java
new file mode 100644
index 0000000..cbbff16
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/ConstantList.java
@@ -0,0 +1,104 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.WCPSException;
+import java.math.BigInteger;
+import java.util.ArrayList;
+import org.w3c.dom.*;
+
+public class ConstantList implements IRasNode {
+
+ private ArrayList<String> list;
+ private String val;
+ private Node lastNode;
+
+ public ConstantList(Node node, XmlQuery xq) throws WCPSException {
+ list = new ArrayList<String>();
+
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+ System.err.println("Trying to parse ConstantList ");
+
+ while (node != null) {
+ String nodeName = node.getNodeName();
+
+ if (nodeName.equals("value")) {
+ val = node.getTextContent();
+ checkConstant(val);
+ list.add(val);
+ lastNode = node;
+ } else {
+ throw new WCPSException("Unknown node in ConstantList: " + nodeName);
+ }
+
+ node = node.getNextSibling();
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+ }
+
+ System.err.println("Parsed constant list with " + list.size() + " elements !");
+ }
+
+ private void checkConstant(String val) throws WCPSException {
+ boolean ok = false;
+ try {
+ Integer.parseInt(val);
+ ok = true;
+ } catch (NumberFormatException e1) {
+ }
+ try {
+ Float.parseFloat(val);
+ ok = true;
+ } catch (NumberFormatException e2) {
+ }
+ try {
+ new ComplexConstant(val);
+ ok = true;
+ } catch (WCPSException e1) {
+ }
+
+ if (ok == false) {
+ throw new WCPSException("'" + val + "' is not an integer, float, or complex constant !");
+ }
+ }
+
+ public String toRasQL() {
+ String result = list.get(0);
+ for (int i = 1; i < list.size(); i++) {
+ result += ", " + list.get(i);
+ }
+ return result;
+ }
+
+ /** Size of all elements in the constant list **/
+ public int getSize() {
+ return list.size();
+ }
+
+ /** Return the last node of the constant list. **/
+ public Node getLastNode() {
+ return lastNode;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/ConstructCoverageExpr.java b/petascope/src/petascope/wcps/server/core/ConstructCoverageExpr.java
new file mode 100644
index 0000000..89343e8
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/ConstructCoverageExpr.java
@@ -0,0 +1,161 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import petascope.wcps.server.exceptions.InvalidMetadataException;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Vector;
+import org.w3c.dom.*;
+
+public class ConstructCoverageExpr implements IRasNode, ICoverageInfo {
+
+ private String covName;
+ private Vector<AxisIterator> iterators;
+ private IRasNode values;
+ private CoverageInfo info;
+ private String axisIteratorString;
+ private String newIteratorName;
+
+ public ConstructCoverageExpr(Node node, XmlQuery xq)
+ throws WCPSException, InvalidCrsException {
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ iterators = new Vector();
+ System.err.println("Parsing Construct Coverage Expr: " + node.getNodeName());
+ newIteratorName = xq.registerNewExpressionWithVariables();
+
+ while (node != null) {
+ String name = node.getNodeName();
+ if (name.equals("name")) {
+ covName = node.getTextContent();
+ } else if (name.equals("axisIterator")) {
+ AxisIterator it = new AxisIterator(node.getFirstChild(), xq, newIteratorName);
+ iterators.add(it);
+ // Top level structures need to know about these iterators
+ CoverageIterator dyn = new CoverageIterator(it.getVar(), covName);
+ xq.addDynamicCoverageIterator(dyn);
+ } else {
+ /* The iterator is probably used in the "values" section,
+ * so send the iterator to the top-level query */
+ if (covName != null && iterators.size() > 0) {
+ buildMetadata(xq);
+ } else {
+ throw new WCPSException("Cannot build coverage metadata !!!");
+ }
+ // And only then start parsing the "values" section
+ values = new ScalarExpr(node, xq);
+ }
+
+ node = node.getNextSibling();
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+ }
+
+ buildAxisIteratorDomain();
+
+ // Sanity check: metadata should have already been build
+ if (info == null) {
+ throw new WCPSException("Could not build coverage metadata !!!");
+ }
+ }
+
+ public String toRasQL() {
+ String result = "marray ";
+ result += axisIteratorString;
+ result += " values " + values.toRasQL();
+
+ return result;
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return info;
+ }
+
+ /* Concatenates all the AxisIterators into one large multi-dimensional object,
+ * that will be used to build to RasQL query */
+ private void buildAxisIteratorDomain() {
+ axisIteratorString = "";
+ axisIteratorString += newIteratorName + " in [";
+
+ for (int i = 0; i < iterators.size(); i++) {
+ if (i > 0) {
+ axisIteratorString += ", ";
+ }
+ AxisIterator ai = iterators.elementAt(i);
+ axisIteratorString += ai.getInterval();
+ }
+
+ axisIteratorString += "]";
+ }
+
+ /** Builds full metadata for the newly constructed coverage **/
+ private void buildMetadata(XmlQuery xq) throws WCPSException {
+ List<CellDomainElement> cellDomainList = new LinkedList<CellDomainElement>();
+ List<RangeElement> rangeList = new LinkedList<RangeElement>();
+ HashSet<String> nullSet = new HashSet<String>();
+ String nullDefault = "0";
+ nullSet.add(nullDefault);
+ HashSet<InterpolationMethod> interpolationSet = new HashSet<InterpolationMethod>();
+ InterpolationMethod interpolationDefault = new InterpolationMethod("none", "none");
+ interpolationSet.add(interpolationDefault);
+ String coverageName = covName;
+ List<DomainElement> domainList = new LinkedList<DomainElement>();
+
+ Iterator<AxisIterator> i = iterators.iterator();
+ while (i.hasNext()) {
+ // Build domain metadata
+ AxisIterator ai = i.next();
+ cellDomainList.add(new CellDomainElement(ai.getLow(), ai.getHigh()));
+ String axisName = ai.getVar();
+ String axisType = ai.getAxisType();
+ String crs = DomainElement.WGS84_CRS;
+ HashSet<String> crsset = new HashSet<String>();
+ crsset.add(crs);
+ DomainElement domain = new DomainElement(axisName, axisType,
+ ai.getLow().doubleValue(), ai.getHigh().doubleValue(),
+ null, null, crsset, xq.getMetadataSource().getAxisNames());
+ domainList.add(domain);
+ }
+ // "unsigned int" is default datatype
+ rangeList.add(new RangeElement("dynamic_type", "unsigned int"));
+
+ try {
+ Metadata metadata = new Metadata(cellDomainList, rangeList, nullSet,
+ nullDefault, interpolationSet, interpolationDefault,
+ coverageName, domainList, null);
+ // Let the top-level query know the full metadata about us
+ xq.getMetadataSource().addDynamicMetadata(covName, metadata);
+ info = new CoverageInfo(metadata);
+ } catch (InvalidMetadataException e) {
+ throw new WCPSException("Could not build coverage '" + covName
+ + "' metadata !", e);
+ }
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/CoverageExpr.java b/petascope/src/petascope/wcps/server/core/CoverageExpr.java
new file mode 100644
index 0000000..d9d9c70
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/CoverageExpr.java
@@ -0,0 +1,179 @@
+ /*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+import java.util.Iterator;
+
+public class CoverageExpr implements IRasNode, ICoverageInfo {
+
+ private IRasNode child;
+ private String childInfo;
+ private CoverageInfo info;
+ private boolean scalarExpr = false;
+// private String var;
+ private boolean simpleCoverage; // True is the coverage is just a string
+
+ public CoverageExpr(Node node, XmlQuery xq) throws WCPSException, InvalidCrsException {
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ if (node == null) {
+ throw new WCPSException("CoverageExprType parsing error!");
+ }
+
+ String nodeName = node.getNodeName();
+
+ simpleCoverage = false;
+ System.err.println("CoverageExprType: node " + nodeName);
+
+ if (nodeName.equals("coverage")) {
+ simpleCoverage = true;
+ childInfo = node.getFirstChild().getNodeValue();
+
+ if (!xq.isIteratorDefined(childInfo)) {
+ throw new WCPSException("Iterator " + childInfo + " not defined!");
+ }
+
+ Iterator<String> coverages = xq.getCoverages(childInfo);
+
+ info = new CoverageInfo(xq.getMetadataSource().read(coverages.next()));
+
+ while (coverages.hasNext()) { // Check if all the coverages are compatible
+ CoverageInfo tmp = new CoverageInfo(
+ xq.getMetadataSource().read(
+ coverages.next()));
+
+ if (!tmp.isCompatible(info)) {
+ throw new WCPSException(
+ "Incompatible coverages within the same iterator");
+ }
+ }
+
+ System.err.println("Found simple coverage definition: " + childInfo + ", "
+ + info.toString());
+ } else if (nodeName.equals("crsTransform")) {
+ // TODO: implement CrsTransform class
+ child = new CrsTransformCoverageExpr(node, xq);
+ } else if (nodeName.equals("scale")) {
+ // TODO: implement class ScaleCoverageExprType
+ child = new ScaleCoverageExpr(node, xq);
+ } else if (nodeName.equals("construct")) {
+ child = new ConstructCoverageExpr(node.getFirstChild(), xq);
+ } else if (nodeName.equals("const")) {
+ child = new ConstantCoverageExpr(node.getFirstChild(), xq);
+ } // else if (nodeName.equals("variableRef"))
+ // {
+ // child = new VariableReference(node, xq);
+ // }
+ else { // Try one of the groups
+ child = null;
+
+ if (child == null) {
+ try {
+ child = new SetMetadataCoverageExpr(node, xq);
+ System.err.println("Matched set metadata operation.");
+ } catch (WCPSException e) {
+ System.err.println("Failed to match set metadata operation: "
+ + e.toString() + "\nRetrying");
+ child = null;
+ }
+ }
+
+ if (child == null) {
+ try {
+ child = new InducedOperationCoverageExpr(node, xq);
+ System.err.println("Matched induced coverage expression operation.");
+ } catch (WCPSException e) {
+ System.err.println("Failed to match induced coverage expression operation: "
+ + e.toString() + "\nRetrying");
+ child = null;
+ if (e.getMessage().equals("Method not implemented")) {
+ throw e;
+ }
+ }
+ }
+
+ if (child == null) {
+ try {
+ child = new SubsetOperationCoverageExpr(node, xq);
+ System.err.println("Matched subset operation.");
+ } catch (WCPSException e) {
+ System.err.println("Failed to match subset operation: "
+ + "\nRetrying");
+ child = null;
+ }
+ }
+
+ if (child == null) {
+ try {
+ child = new ScalarExpr(node, xq);
+ this.scalarExpr = true;
+ System.err.println("Matched scalar expression.");
+ } catch (WCPSException e) {
+ System.err.println("Failed to match scalar expression: "
+ + "\nRetrying");
+ child = null;
+ }
+ }
+ }
+
+ if (!simpleCoverage && (child == null)) {
+ throw new WCPSException("Invalid coverage Expression, next node: "
+ + node.getNodeName());
+ }
+
+ if (info == null) {
+ System.err.println(node.getNodeName());
+ info = new CoverageInfo(((ICoverageInfo) child).getCoverageInfo());
+ }
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return info;
+ }
+
+ public boolean isScalarExpr()
+ {
+ return scalarExpr;
+ }
+
+ public ScalarExpr getScalarExpr()
+ {
+ ScalarExpr r = null;
+ if (scalarExpr)
+ r = (ScalarExpr) child;
+ return r;
+ }
+
+ public String toRasQL() {
+ if (simpleCoverage) {
+ return childInfo;
+ } else {
+ return child.toRasQL();
+ }
+ }
+};
diff --git a/petascope/src/petascope/wcps/server/core/CoverageExprPairType.java b/petascope/src/petascope/wcps/server/core/CoverageExprPairType.java
new file mode 100644
index 0000000..d52e74c
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/CoverageExprPairType.java
@@ -0,0 +1,103 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+public class CoverageExprPairType implements IRasNode, ICoverageInfo {
+
+ private IRasNode first, second;
+ private CoverageInfo info;
+ private boolean ok = false;
+
+ public CoverageExprPairType(Node node, XmlQuery xq)
+ throws WCPSException, InvalidCrsException {
+ String nodeName = node.getNodeName();
+
+ System.err.println("Trying to parse a coverage expression pair ... Starting at node "
+ + nodeName);
+
+ // Combination 1: CoverageExprType + ScalarExprType
+ if (ok == false) {
+ try {
+ first = new CoverageExpr(node, xq);
+ second = new ScalarExpr(node.getNextSibling(), xq);
+ info = new CoverageInfo(((ICoverageInfo) first).getCoverageInfo());
+ ok = true;
+ } catch (WCPSException e) {
+ System.err.println("Failed to parse CoverageExprType + ScalarExprType!");
+ }
+ }
+
+ // Combination 2: ScalarExprType + CoverageExprType
+ if (ok == false) {
+ try {
+ first = new ScalarExpr(node, xq);
+ second = new CoverageExpr(node.getNextSibling(), xq);
+ info = new CoverageInfo(((ICoverageInfo) second).getCoverageInfo());
+ ok = true;
+ } catch (WCPSException e) {
+ System.err.println("Failed to parse ScalarExprType + CoverageExprType!");
+ }
+ }
+
+ // Combination 3: CoverageExprType + CoverageExprType
+ if (ok == false) {
+ try {
+ first = new CoverageExpr(node, xq);
+ second = new CoverageExpr(node.getNextSibling(), xq);
+ info = new CoverageInfo(((ICoverageInfo) first).getCoverageInfo());
+ ok = true;
+ } catch (WCPSException e) {
+ System.err.println("Failed to parse a CoverageExprType + CoverageExprType!");
+ }
+ }
+
+
+
+ if (ok == false) {
+ throw new WCPSException("Could not parse a coverage expression pair !");
+ }
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return info;
+ }
+
+ public String toRasQL() {
+ if (ok == true) {
+ return first.toRasQL() + second.toRasQL();
+ } else {
+ return " error ";
+ }
+ }
+
+ public IRasNode getFirst() {
+ return first;
+ }
+
+ public IRasNode getSecond() {
+ return second;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/CoverageInfo.java b/petascope/src/petascope/wcps/server/core/CoverageInfo.java
new file mode 100644
index 0000000..d5eb447
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/CoverageInfo.java
@@ -0,0 +1,168 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.WCPSException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+public class CoverageInfo {
+
+ private List<CellDomainElement> cellDomains;
+ private List<DomainElement> domains;
+ private String coverageName;
+
+ public CoverageInfo(CoverageInfo other) {
+ cellDomains = new ArrayList<CellDomainElement>();
+ domains = new ArrayList<DomainElement>();
+ int N = other.getNumDimensions();
+
+ for (int i = 0; i < N; ++i) {
+ cellDomains.add(other.getCellDomainElement(i));
+ domains.add(other.getDomainElement(i));
+ }
+
+ coverageName = other.getCoverageName();
+ }
+
+ public CoverageInfo(Metadata m) {
+ cellDomains = new ArrayList<CellDomainElement>();
+ domains = new ArrayList<DomainElement>();
+ Iterator<CellDomainElement> itcde = m.getCellDomainIterator();
+
+ while (itcde.hasNext()) {
+ cellDomains.add(itcde.next());
+ }
+
+ Iterator<DomainElement> itde = m.getDomainIterator();
+
+ while (itde.hasNext()) {
+ domains.add(itde.next());
+ }
+
+ coverageName = m.getCoverageName();
+ }
+
+ public boolean isCompatible(CoverageInfo other) {
+ if (getNumDimensions() != other.getNumDimensions()) {
+ System.err.println("The number of dimensions doesn't match");
+ return false;
+ }
+
+ {
+ Iterator<CellDomainElement> it = cellDomains.iterator();
+ int index = 0;
+
+ while (it.hasNext()) {
+ CellDomainElement me, you;
+
+ me = it.next();
+ you = other.getCellDomainElement(index++);
+
+ if (!me.getHi().equals(you.getHi())) {
+ System.err.println("High values don't match: "
+ + me.getHi().toString() + ", "
+ + you.getHi().toString());
+ return false;
+ }
+
+ if (!me.getLo().equals(you.getLo())) {
+ System.err.println("Low values don't match: "
+ + me.getLo().toString() + ", "
+ + you.getLo().toString());
+ return false;
+ }
+ }
+ }
+ {
+ Iterator<DomainElement> it = domains.iterator();
+ int index = 0;
+
+ while (it.hasNext()) {
+ DomainElement me, you;
+
+ me = it.next();
+ you = other.getDomainElement(index++);
+
+ if (!me.getName().equals(you.getName())) {
+ System.err.println("Domain element names don't match: '"
+ + me.getName() + "' and '"
+ + you.getName() + "'.");
+ return false;
+ }
+
+ // if (me.getName() != you.getName()) return false;
+ }
+ }
+ return true;
+ }
+
+ int getNumDimensions() {
+ return cellDomains.size();
+ }
+
+ public CellDomainElement getCellDomainElement(int dim) {
+ return cellDomains.get(dim);
+ }
+
+ public DomainElement getDomainElement(int dim) {
+ return domains.get(dim);
+ }
+
+ public String getCoverageName() {
+ return coverageName;
+ }
+
+ public void removeDimension(int dim) {
+ cellDomains.remove(dim);
+ domains.remove(dim);
+ }
+
+ public void setDimension(int dim, CellDomainElement cde, DomainElement de) {
+ cellDomains.set(dim, cde);
+ domains.set(dim, de);
+ }
+
+ public void setCellDimension(int dim, CellDomainElement cde) {
+ cellDomains.set(dim, cde);
+ }
+
+ public int getDomainIndexByName(String name) throws WCPSException {
+ System.err.println("Searching for Domain name : " + name);
+ System.err.println("Available domain names are: " + domains.toString());
+
+ Iterator<DomainElement> it = domains.iterator();
+ int index = 0;
+
+ while (it.hasNext()) {
+ if (name.equals(it.next().getName())) {
+ return index;
+ }
+
+ index++;
+ }
+
+ System.err.println("ERROR: Axis name not found: " + name);
+ throw new WCPSException("Domain name not found: " + name);
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/CoverageIterator.java b/petascope/src/petascope/wcps/server/core/CoverageIterator.java
new file mode 100644
index 0000000..570295e
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/CoverageIterator.java
@@ -0,0 +1,94 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.ResourceException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+public class CoverageIterator implements IRasNode {
+
+ private List<String> coverageNames;
+ private String iteratorName;
+ private boolean dynamic = false; // created from a Construct Coverage expr?
+
+ public CoverageIterator(Node x, XmlQuery xq) throws WCPSException {
+ IDynamicMetadataSource source = xq.getMetadataSource();
+ coverageNames = new ArrayList<String>();
+ if (!x.getNodeName().equals("coverageIterator")) {
+ throw new WCPSException("Invalid cast from " + x.getNodeName()
+ + " XML node to CoverageIterator node");
+ }
+
+ Node it = x.getFirstChild();
+ while (it != null) {
+ if (it.getNodeName().equals("#text")) {
+ it = it.getNextSibling();
+ continue;
+ }
+
+ if (it.getNodeName().equals("iteratorVar")) {
+ iteratorName = it.getFirstChild().getNodeValue();
+ System.err.println("*** Iterator variable : " + iteratorName);
+ } else if (it.getNodeName().equals("coverageName")) {
+ String cn = it.getFirstChild().getNodeValue();
+ System.err.println("*** Coverage reference : " + cn);
+ try {
+ if (!source.coverages().contains(cn)) {
+ throw new WCPSException("Unknown coverage " + cn);
+ }
+ } catch (ResourceException e) {
+ throw new WCPSException(
+ "Cannot load coverage information!", e);
+ }
+
+ coverageNames.add(cn);
+ }
+
+ it = it.getNextSibling();
+ }
+ }
+
+ public CoverageIterator(String iterator, String coverage) throws WCPSException {
+ coverageNames = new ArrayList<String>();
+ iteratorName = iterator;
+ coverageNames.add(coverage);
+ this.dynamic = true;
+ }
+
+ public Iterator<String> getCoverages() {
+ return coverageNames.iterator();
+ }
+
+ public String getIteratorName() {
+ return iteratorName;
+ }
+
+ public String toRasQL() {
+ // TODO(andreia) : How to translate multiple coverages?
+ return coverageNames.get(0) + " AS " + iteratorName;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/Crs.java b/petascope/src/petascope/wcps/server/core/Crs.java
new file mode 100644
index 0000000..e83bed7
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/Crs.java
@@ -0,0 +1,124 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import java.util.Iterator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcs.server.exceptions.NoApplicableCodeException;
+
+public class Crs implements IRasNode {
+
+ Logger LOG = LoggerFactory.getLogger(Crs.class);
+ private String crsName;
+
+ public Crs(Node node, XmlQuery xq) throws WCPSException, InvalidCrsException {
+ System.err.println("Parsing crs name ...");
+
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ if (node != null && node.getNodeName().equals("srsName")) {
+ String val = node.getTextContent();
+ this.crsName = val;
+ if (crsName.equals(DomainElement.IMAGE_CRS) || crsName.equals(DomainElement.WGS84_CRS)) {
+ System.err.println("Found CRS: " + crsName);
+ } else {
+ throw new InvalidCrsException("Invalid CRS: '" + crsName + "'");
+ }
+ } else {
+ throw new WCPSException("Could not find a 'srsName' node !");
+ }
+ }
+
+ /***
+ * Converts an array of 4 coordinates (bounding box) expressed in the
+ * current CRS to pixel coordinates.
+ * @param u2 Left-most X point (CRS coordinate)
+ * @param u3 Right-most X point (CRS coordinate)
+ * @param v2 Lower-most Y point (CRS coordinate)
+ * @param v3 Upper-most Y point (CRS coordinate)
+ * @return array of integers, pixel coordinates that represent the given CRS
+ * coordinates.
+ */
+ public long[] convertToPixelCoordinates(Metadata meta, String axisName, Double u2, Double u3, Double v2, Double v3) throws NoApplicableCodeException {
+ Wgs84Crs crs = meta.getCrs();
+ long px0 = -1, px1 = -1, py0 = -1, py1 = -1;
+ // Convert bounding box values to pixel coordinates
+ if (crsName.equals(DomainElement.WGS84_CRS)) {
+ LOG.trace("Converting WGS84 axis {} interval to pixel coordinates ...", axisName);
+ /* Image coordinates */
+ Iterator<CellDomainElement> it = meta.getCellDomainIterator();
+ CellDomainElement X = it.next();
+ CellDomainElement Y = it.next();
+ if (X == null || Y == null) {
+ LOG.error("Could not find the X or Y axis for coverage: " + meta.getCoverageName());
+ throw new NoApplicableCodeException("Could not find the X or Y axis for coverage: " + meta.getCoverageName());
+ }
+ int x0 = X.getLo().intValue();
+ int x1 = X.getHi().intValue();
+ int y0 = Y.getLo().intValue();
+ int y1 = Y.getHi().intValue();
+
+ LOG.trace("Pixel Coordinates: X01 (" + x0 + "," + x1 + ") + Y01 (" + y0 + "," + y1 + ")");
+ /* CRS span */
+ double x2 = crs.getLow1();
+ double y2 = crs.getLow2();
+ double x3 = crs.getHigh1();
+ double y3 = crs.getHigh2();
+ LOG.trace("CRS Coordinates: X23 (" + x2 + "," + x3 + ") + Y23 (" + y2 + "," + y3 + ")");
+ /* For WGS84, the offset = (# pixels)/(CRS span) */
+ double oX = crs.getOffset1();
+ double oY = crs.getOffset2();
+
+ /* The actual conversion is below: */
+ if (axisName.equals("X")) {
+ px0 = Math.round((u2 - x2) / oX) + x0;
+ px1 = Math.round((u3 - u2) / oX) + px0;
+ LOG.debug("CRS Coordinates on axis X: U23 (" + u2 + "," + u3 + ")");
+ LOG.debug("Pixel Coordinates on axis X: U01 (" + px0 + "," + px1 + ") ");
+ }
+ if (axisName.equals("Y")) {
+ py0 = Math.round((y3 - v3) / oY) + y0;
+ py1 = Math.round((v3 - v2) / oY) + py0;
+ LOG.debug("CRS Coordinates on axis Y: V23 (" + v2 + "," + v3 + ")");
+ LOG.debug("Pixel Coordinates on axis Y: V01 (" + py0 + "," + py1 + ")");
+ }
+
+ }
+ long[] longCoord = {px0, px1, py0, py1};
+
+ return longCoord;
+ }
+
+ public String toRasQL() {
+ return crsName;
+ }
+
+ public String getName() {
+ return crsName;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/CrsTransformCoverageExpr.java b/petascope/src/petascope/wcps/server/core/CrsTransformCoverageExpr.java
new file mode 100644
index 0000000..42f900c
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/CrsTransformCoverageExpr.java
@@ -0,0 +1,42 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+//TODO(smsorin): how do we do combine this ?
+public class CrsTransformCoverageExpr implements IRasNode, ICoverageInfo {
+
+ public CrsTransformCoverageExpr(Node node, XmlQuery xq)
+ throws WCPSException {
+ throw new WCPSException("Method not implemented");
+ }
+
+ public String toRasQL() {
+ return "";
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return null;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/DbMetadataSource.java b/petascope/src/petascope/wcps/server/core/DbMetadataSource.java
new file mode 100644
index 0000000..90d6a77
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/DbMetadataSource.java
@@ -0,0 +1,1174 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+//~--- JDK imports ------------------------------------------------------------
+import petascope.wcps.server.exceptions.ResourceException;
+import petascope.wcps.server.exceptions.InvalidWcpsRequestException;
+import petascope.wcps.server.exceptions.InvalidMetadataException;
+import java.math.BigInteger;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Savepoint;
+import java.sql.Statement;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Vector;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The DbMetadataSource is a IMetadataSource that uses a relational database. It
+ * keeps a global connection which is reused on future requests, as well as between
+ * threads. Before each read, the connection is verified to be valid, and
+ * recreated if necessary. This IMetadataSource is not particularly efficient,
+ * because it accesses the database at least once for every read. To increase
+ * efficiency, wrap a CachedMetadataSource around this one.
+ *
+ */
+public class DbMetadataSource implements IMetadataSource {
+
+ private static Logger LOG = LoggerFactory.getLogger(DbMetadataSource.class);
+
+ /* Status variables */
+ private boolean initializing;
+ private boolean checkAtInit;
+
+ /* Contents of static tables */
+ private Map<Integer, String> axisTypes;
+ private Map<Integer, String> crss;
+ private Map<Integer, String> dataTypes;
+ private Map<Integer, String> interpolationTypes;
+ private Map<Integer, String> nullResistances;
+ private Map<String, String> supportedFormats;
+
+ /* Contents of static tables (reversed, for easy access if you
+ know the something's name and want to find out its id) */
+ private Map<String, Integer> revAxisTypes;
+ private Map<String, Integer> revCrss;
+ private Map<String, Integer> revDataTypes;
+ private Map<String, Integer> revInterpolationTypes;
+ private Map<String, Integer> revNullResistances;
+ private Map<String, String> revSupportedFormats; // Not used
+
+ /* Database access info */
+ private String driver;
+ private String pass;
+ private String url;
+ private String user;
+
+ /* Global database key variables */
+ private Connection conn;
+ private Savepoint savepoint;
+ private String query;
+
+ public DbMetadataSource(String driver, String url, String user, String pass) throws ResourceException, InvalidMetadataException {
+ this(driver, url, user, pass, true);
+ }
+
+ public DbMetadataSource(String driver, String url, String user, String pass, boolean checkAtInit) throws ResourceException, InvalidMetadataException {
+ try {
+ this.driver = driver;
+ Class.forName(driver).newInstance();
+ } catch (ClassNotFoundException e) {
+ throw new ResourceException("Metadata database error: Could not find JDBC driver: " + driver, e);
+ } catch (InstantiationException e) {
+ throw new ResourceException("Metadata database error: Could not instantiate JDBC driver: " + driver, e);
+ } catch (IllegalAccessException e) {
+ throw new ResourceException("Metadata database error: Access denied to JDBC driver: " + driver, e);
+ }
+
+ this.driver = driver;
+ this.url = url;
+ this.user = user;
+ this.pass = pass;
+ Statement s = null;
+
+ try {
+
+ /* Read contents of static metadata tables */
+ ensureConnection();
+
+ axisTypes = new HashMap<Integer, String>();
+ revAxisTypes = new HashMap<String, Integer>();
+ s = conn.createStatement();
+ ResultSet r = s.executeQuery("SELECT id, axisType FROM PS_AxisType");
+
+ while (r.next()) {
+ axisTypes.put(r.getInt("id"), r.getString("axisType"));
+ revAxisTypes.put(r.getString("axisType"), r.getInt("id"));
+ }
+
+ dataTypes = new HashMap<Integer, String>();
+ revDataTypes = new HashMap<String, Integer>();
+ r = s.executeQuery("SELECT id, dataType FROM PS_Datatype");
+
+ while (r.next()) {
+ dataTypes.put(r.getInt("id"), r.getString("dataType"));
+ revDataTypes.put(r.getString("dataType"), r.getInt("id"));
+ }
+
+ interpolationTypes = new HashMap<Integer, String>();
+ revInterpolationTypes = new HashMap<String, Integer>();
+ r = s.executeQuery("SELECT id, interpolationType FROM PS_InterpolationType");
+
+ while (r.next()) {
+ interpolationTypes.put(r.getInt("id"), r.getString("interpolationType"));
+ revInterpolationTypes.put(r.getString("interpolationType"), r.getInt("id"));
+ }
+
+ nullResistances = new HashMap<Integer, String>();
+ revNullResistances = new HashMap<String, Integer>();
+ r = s.executeQuery("SELECT id, nullResistance FROM PS_NullResistance");
+
+ while (r.next()) {
+ nullResistances.put(r.getInt("id"), r.getString("nullResistance"));
+ revNullResistances.put(r.getString("nullResistance"), r.getInt("id"));
+ }
+
+ crss = new HashMap<Integer, String>();
+ revCrss = new HashMap<String, Integer>();
+ r = s.executeQuery("SELECT id, name FROM PS_Crs");
+
+ while (r.next()) {
+ crss.put(r.getInt("id"), r.getString("name"));
+ revCrss.put(r.getString("name"), r.getInt("id"));
+ }
+
+ supportedFormats = new HashMap<String, String>();
+ revSupportedFormats = new HashMap<String, String>();
+ r = s.executeQuery("SELECT name, mimetype FROM PS_Format");
+
+ while (r.next()) {
+ supportedFormats.put(r.getString("name"), r.getString("mimetype"));
+ revSupportedFormats.put(r.getString("mimetype"), r.getString("name"));
+ }
+
+ s.close();
+
+ /* Debug checks for reverse static tables */
+// log(revAxisTypes.toString());
+// log(revCrss.toString());
+// log(revDataTypes.toString());
+// log(revInterpolationTypes.toString());
+// log(revNullResistances.toString());
+// log(revSupportedFormats.toString());
+
+ /* Check Metadata consistency at startup, if needed */
+ this.checkAtInit = checkAtInit;
+
+ if (checkAtInit) {
+ initializing = true;
+ boolean coveragesOk = false;
+
+ while (!coveragesOk) {
+ try {
+ Iterator<String> coverages = coverages().iterator();
+
+ while (coverages.hasNext()) {
+ read(coverages.next());
+ }
+ } catch (InvalidWcpsRequestException ire) {
+ throw (InvalidMetadataException) ire.getCause();
+ }
+
+ coveragesOk = true;
+ }
+
+ initializing = false;
+ }
+
+ } catch (SQLException sqle) {
+ if (s != null) {
+ try {
+ s.close();
+ } catch (SQLException e) {
+ }
+ }
+
+ close();
+
+ throw new ResourceException("Metadata database error", sqle);
+ }
+
+ }
+
+ public void close() {
+ if (conn != null) {
+ try {
+ conn.close();
+ } catch (SQLException sqle) {
+ }
+ conn = null;
+ }
+ }
+
+ /* List all available coverages */
+ @Override
+ public Set<String> coverages() throws ResourceException {
+ Statement s = null;
+ Set<String> coverages;
+
+ try {
+ ensureConnection();
+ s = conn.createStatement();
+
+ ResultSet r = s.executeQuery("SELECT name FROM PS_Coverage");
+
+ coverages = new HashSet<String>(r.getFetchSize());
+
+ while (r.next()) {
+ coverages.add(r.getString("name"));
+ }
+
+ s.close();
+
+ return coverages;
+ } catch (SQLException sqle) {
+ if (s != null) {
+ try {
+ s.close();
+ } catch (SQLException f) {
+ }
+ }
+
+ close();
+
+ throw new ResourceException("Metadata database error", sqle);
+ }
+
+ }
+
+ @Override
+ public String formatToMimetype(String format) {
+ return supportedFormats.get(format);
+ }
+
+ @Override
+ public Metadata read(String coverageName) throws InvalidWcpsRequestException, ResourceException {
+ LOG.debug("Reading metadata for coverage '{}'", coverageName);
+
+ if ((coverageName == null) || coverageName.equals("")) {
+ throw new InvalidWcpsRequestException("Cannot retrieve coverage with null or empty name");
+ }
+
+ Statement s = null;
+
+ try {
+ ensureConnection();
+ s = conn.createStatement();
+
+ ResultSet r = s.executeQuery("SELECT id, nullDefault, interpolationTypeDefault, nullResistanceDefault FROM PS_Coverage WHERE name = '" + coverageName + "'");
+
+ if (!r.next()) {
+ throw new InvalidWcpsRequestException("Coverage '" + coverageName + "' is not served by this server");
+ }
+
+ int coverage = r.getInt("id");
+ String nullDefault = r.getString("nullDefault");
+ String interpolationTypeDefault = interpolationTypes.get(r.getInt("interpolationTypeDefault"));
+ String nullResistanceDefault = nullResistances.get(r.getInt("nullResistanceDefault"));
+
+ r = s.executeQuery("SELECT lo, hi FROM PS_CellDomain WHERE coverage = '" + coverage + "' ORDER BY i ASC");
+ CellDomainElement X = null, Y = null, cell;
+ boolean twoDCoverage = true;
+ List<CellDomainElement> cellDomain = new ArrayList<CellDomainElement>(r.getFetchSize());
+
+ while (r.next()) {
+ cell = new CellDomainElement(BigInteger.valueOf(r.getInt("lo")), BigInteger.valueOf(r.getInt("hi")));
+ cellDomain.add(cell);
+ if (X == null) {
+ X = cell;
+ } else if (X != null && Y == null) {
+ Y = cell;
+ } else {
+ twoDCoverage = false;
+ }
+ }
+ if (X == null || Y == null) {
+ twoDCoverage = false;
+ }
+
+ r = s.executeQuery("SELECT name, type FROM PS_Range WHERE coverage = '" + coverage + "' ORDER BY i ASC");
+ List<RangeElement> range = new ArrayList<RangeElement>(r.getFetchSize());
+
+ while (r.next()) {
+ range.add(new RangeElement(r.getString("name"), dataTypes.get(r.getInt("type"))));
+ }
+
+ r = s.executeQuery("SELECT interpolationType, nullResistance FROM PS_InterpolationSet WHERE coverage = '" + coverage + "'");
+ Set<InterpolationMethod> interpolationSet = new HashSet<InterpolationMethod>(r.getFetchSize());
+
+ while (r.next()) {
+ interpolationSet.add(new InterpolationMethod(interpolationTypes.get(r.getInt("interpolationType")), nullResistances.get(r.getInt("nullResistance"))));
+ }
+
+ r = s.executeQuery("SELECT nullValue FROM PS_NullSet WHERE coverage = '" + coverage + "'");
+ Set<String> nullSet = new HashSet<String>(r.getFetchSize());
+
+ while (r.next()) {
+ nullSet.add(r.getString("nullValue"));
+ }
+
+ r = s.executeQuery("SELECT id, name, type, numLo, numHi, strLo, strHi FROM PS_Domain WHERE coverage = '" + coverage + "' ORDER BY i ASC");
+ List<DomainElement> domain = new ArrayList<DomainElement>(r.getFetchSize());
+ Statement ss = conn.createStatement();
+
+ while (r.next()) {
+ String strLo = r.getString("strLo");
+ String strHi = r.getString("strHi");
+
+ Double numLo = r.getDouble("numLo");
+
+ if (r.wasNull()) {
+ numLo = null;
+ }
+
+ Double numHi = r.getDouble("numHi");
+
+ if (r.wasNull()) {
+ numHi = null;
+ }
+
+ ResultSet rr = ss.executeQuery("SELECT crs FROM PS_CrsSet WHERE axis = '" + r.getInt("id") + "'");
+ Set<String> crsSet = new HashSet<String>(rr.getFetchSize());
+
+ while (rr.next()) {
+ crsSet.add(crss.get(rr.getInt("crs")));
+ }
+
+ DomainElement d = new DomainElement(r.getString("name"), axisTypes.get(r.getInt("type")),
+ numLo, numHi, strLo, strHi, crsSet, axisTypes.values());
+ domain.add(d);
+ }
+
+ String abstr = "";
+ String title = "";
+ String keywords = "";
+ r = s.executeQuery("SELECT title, abstract, keywords FROM PS_Descriptions WHERE coverage = '" + coverage + "'");
+ if (r.next()) {
+ abstr = r.getString("abstract");
+ title = r.getString("title");
+ keywords = r.getString("keywords");
+ }
+
+ /* WGS84 is the only CRS we understand (except IMAGE_CRS, of course) */
+ Wgs84Crs crs = null;
+ Double l1 = 0.0, l2 = 0.0, h1 = 0.0, h2 = 0.0;
+ Double o1 = null, o2 = null;
+ r = s.executeQuery("SELECT * FROM PS_CrsDetails WHERE coverage = '" + coverage + "'");
+ if (r.next()) {
+ /* Domain extent */
+ int x0 = X.getLo().intValue();
+ int y0 = Y.getLo().intValue();
+ int x1 = X.getHi().intValue();
+ int y1 = Y.getHi().intValue();
+ /* CRS Bounding box */
+ l1 = r.getDouble("low1");
+ l2 = r.getDouble("low2");
+ h1 = r.getDouble("high1");
+ h2 = r.getDouble("high2");
+ String off1 = r.getString("offset1");
+ String off2 = r.getString("offset2");
+ if (off1 != null) {
+ o1 = Double.parseDouble(off1);
+ }
+ if (off2 != null) {
+ o2 = Double.parseDouble(off2);
+ }
+ /* Compute axis offsets if not predefined */
+ if (o1 == null && o2 == null) {
+ o1 = (h1 - l1) / (double) (x1 - x0);
+ o2 = (h2 - l2) / (double) (y1 - y0);
+ LOG.debug("Calculated CRS axis offsets. For X: {}, for Y: {}", o1, o2);
+ LOG.debug(X.toString());
+ LOG.debug(Y.toString());
+ }
+ /* Only store CRS information if coverage is 2-D */
+ if (twoDCoverage == true) {
+ crs = new Wgs84Crs(l1, h1, l2, h2, o1, o2);
+ LOG.trace("Found CRS : ", crs.toString());
+ } else {
+ LOG.warn("Found CRS '{}', but coverage is not 2-dimensional. "
+ + "Ignoring CRS information.", crs.toString());
+ }
+ } else if (twoDCoverage) {
+ LOG.warn(" WGS84 bounding box missing for 2-D coverage '" + coverageName + "'...");
+ }
+
+ /* Done with SQL statements */
+ s.close();
+
+ /* Build the complete metadata object */
+ Metadata meta = new Metadata(cellDomain, range, nullSet, nullDefault, interpolationSet,
+ new InterpolationMethod(interpolationTypeDefault, nullResistanceDefault),
+ coverageName, domain, crs, title, abstr, keywords);
+ meta.setCoverageId(coverage);
+ return meta;
+ } catch (InvalidMetadataException ime) {
+ if (checkAtInit && !initializing) {
+ throw new ResourceException("Previously valid metadata is now invalid. The metadata for coverage '" + coverageName + "' has been modified incorrectly.", ime);
+ } else {
+ throw new InvalidWcpsRequestException("Coverage '" + coverageName + "' has invalid metadata", ime);
+ }
+ } catch (SQLException sqle) {
+ if (s != null) {
+ try {
+ s.close();
+ } catch (SQLException f) {
+ }
+ }
+
+ close();
+
+ throw new ResourceException("Metadata database error", sqle);
+ }
+
+ }
+
+ /** Write a coverage's metadata to the database. This function can be used
+ * for both inserting new coverages and updating coverage metadata.
+ *
+ * @param meta Metadata container for the information to be stored in the metadata database
+ * @param commit Boolean value, specifying if we want to commit immediately or not
+ */
+ private void write(Metadata meta, boolean commit) throws ResourceException {
+ String coverageName = meta.getCoverageName();
+ if (existsCoverageName(coverageName)) {
+ updateCoverageMetadata(meta, commit);
+ } else {
+ insertNewCoverageMetadata(meta, commit);
+ }
+ }
+
+ public void delete(Metadata meta, boolean commit) throws ResourceException {
+ String coverageName = meta.getCoverageName();
+ if (existsCoverageName(coverageName) == false) {
+ throw new ResourceException("Cannot delete inexistent coverage: " + coverageName);
+ }
+
+ /* Delete main coverage entry from "PS_Coverage". Auxiliary metadata are
+ * automatically deleted by the DB (via CASCADING) on
+ * deletion of the main entry in ps_coverage */
+ Statement s = null;
+ try {
+ s = conn.createStatement();
+ setQuery("DELETE FROM PS_Coverage WHERE name = '" + coverageName + "'");
+ int count = s.executeUpdate(query);
+ LOG.trace("Affected rows: " + count);
+ s.close();
+
+ if (commit) {
+ commitAndClose();
+ }
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ try {
+ s.close();
+ } catch (Exception e) {
+ }
+ }
+ }
+
+ /**
+ * Check if there is metadata available for a given coverage name
+ * @param name coverage name
+ * @return true is coverage already exists
+ */
+ public boolean existsCoverageName(String name) {
+ boolean result = false;
+ Statement s = null;
+ try {
+ s = conn.createStatement();
+ setQuery("SELECT * FROM PS_Coverage WHERE name = '" + name + "'");
+ ResultSet r = s.executeQuery(query);
+ if (r.next()) {
+ result = true;
+ } else {
+ result = false;
+ }
+ s.close();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ try {
+ s.close();
+ } catch (Exception e) {
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Check if there exists a coverage with a given ID in the metadata database.
+ * @param id coverage id
+ * @return true is coverage already exists
+ */
+ private boolean existsCoverageId(int id) {
+ boolean result = false;
+ Statement s = null;
+ try {
+ s = conn.createStatement();
+ ResultSet r = s.executeQuery(
+ "SELECT * FROM PS_Coverage WHERE id = '" + id + "'");
+ if (r.next()) {
+ result = true;
+ } else {
+ result = false;
+ }
+ s.close();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ try {
+ s.close();
+ } catch (Exception e) {
+ }
+ }
+ System.out.println("Coverage with ID " + id + (result == false ? " does not " : "") + " exists.");
+ return result;
+ }
+
+ /** Update metadata for an existing coverage. All information may change (including
+ * name), but the ID of the tuple in PS_Coverage will stay the same.
+ *
+ * @param meta Metadata object, container of the new information.
+ * @param commit True if we want to commit immediately, false to delay commit indefinitely
+ */
+ public void updateCoverageMetadata(Metadata meta, boolean commit) throws ResourceException {
+ Statement s = null;
+ int coverageId = meta.getCoverageId();
+ int count = -1;
+ String coverageName = meta.getCoverageName();
+
+ try {
+ ensureConnection();
+ s = conn.createStatement();
+
+ String name = coverageName;
+ String nulldefault = meta.getNullDefault();
+ int interpolatiotypendefault = revInterpolationTypes.get(meta.getInterpolationDefault());
+ int nullresistancedefault = revNullResistances.get(meta.getNullResistanceDefault());
+
+ // Table PS_Coverage
+ setQuery("UPDATE PS_Coverage SET "
+ + "(name, nullDefault, interpolationTypeDefault, nullResistanceDefault) "
+ + " = ('" + name + "', '" + nulldefault + "', '"
+ + interpolatiotypendefault + "', '" + nullresistancedefault + "')"
+ + " WHERE id='" + coverageId + "'");
+ count = s.executeUpdate(query);
+ if (count <= 0) {
+ throw new SQLException("Could not update table PS_Coverage.");
+ }
+
+ // Table PS_CellDomain
+ /* Delete old data */
+ setQuery("DELETE FROM PS_CellDomain WHERE coverage='" + coverageId + "'");
+ count = s.executeUpdate(query);
+ if (count <= 0) {
+ throw new SQLException("Could not delete old entries from table PS_CellDomain.");
+ }
+ /* Insert new data */
+ Iterator<CellDomainElement> cellIt = meta.getCellDomainIterator();
+ int i = 0;
+ while (cellIt.hasNext()) {
+ CellDomainElement cell = cellIt.next();
+ setQuery("INSERT INTO PS_CellDomain (coverage, i, lo, hi) VALUES "
+ + " ('" + coverageId + "', '" + i + "', '" + cell.getLo() + "', '"
+ + cell.getHi() + "')");
+ if (s.executeUpdate(query) <= 0) {
+ throw new SQLException("Could not insert axis " + i + " for coverage "
+ + coverageName + "( id " + coverageId + ") into table PS_CellDomain");
+ }
+ i++;
+ }
+
+ // Table PS_Range
+ /* Delete old data */
+ setQuery("DELETE FROM PS_Range WHERE coverage='" + coverageId + "'");
+ count = s.executeUpdate(query);
+ if (count <= 0) {
+ throw new SQLException("Could not delete old entries from table PS_Range.");
+ }
+ /* Insert new data */
+ Iterator<RangeElement> rangeIt = meta.getRangeIterator();
+ i = 0;
+ while (rangeIt.hasNext()) {
+ RangeElement range = rangeIt.next();
+ System.out.println(range);
+ int dataType = revDataTypes.get(range.getType());
+ setQuery("INSERT INTO PS_Range (coverage, i, name, type) VALUES "
+ + " ('" + coverageId + "', '" + i + "', '" + range.getName() + "', '"
+ + dataType + "')");
+ if (s.executeUpdate(query) <= 0) {
+ throw new SQLException("Could not insert range " + range.getName()
+ + "( id " + i + " ) for coverage "
+ + coverageName + "( id " + coverageId + ") into table PS_Range");
+ }
+ i++;
+ }
+
+ // Table PS_InterpolationSet
+ /* Delete old data */
+ setQuery("DELETE FROM PS_InterpolationSet WHERE coverage='" + coverageId + "'");
+ count = s.executeUpdate(query);
+ if (count <= 0) {
+ throw new SQLException("Could not delete old entries from table PS_InterpolationSet.");
+ }
+ /* Insert new data */
+ Iterator<InterpolationMethod> methodIt = meta.getInterpolationMethodIterator();
+ i = 0;
+ while (methodIt.hasNext()) {
+ InterpolationMethod method = methodIt.next();
+ int interp = revInterpolationTypes.get(method.getInterpolationType());
+ int nullRes = revNullResistances.get(method.getNullResistance());
+ setQuery("INSERT INTO PS_InterpolationSet (coverage, interpolationType, nullResistance) VALUES "
+ + " ('" + coverageId + "', '" + interp + "', '" + nullRes + "')");
+ if (s.executeUpdate(query) <= 0) {
+ throw new SQLException("Could not insert interpolation method (" + method.getInterpolationType()
+ + ", " + method.getNullResistance() + " ) for coverage "
+ + coverageName + "( id " + coverageId + ") into table PS_InterpolationSet");
+ }
+ i++;
+ }
+
+ // Table PS_NullSet
+ /* Delete old data */
+ setQuery("DELETE FROM PS_NullSet WHERE coverage='" + coverageId + "'");
+ count = s.executeUpdate(query);
+ if (count <= 0) {
+ throw new SQLException("Could not delete old entries from table PS_NullSet.");
+ }
+ /* Insert new data */
+ Iterator<String> nullIt = meta.getNullSetIterator();
+ while (nullIt.hasNext()) {
+ String nullValue = nullIt.next();
+ setQuery("INSERT INTO PS_NullSet (coverage, nullValue) VALUES "
+ + " ('" + coverageId + "', '" + nullValue + "')");
+ if (s.executeUpdate(query) <= 0) {
+ throw new SQLException("Could not insert null value '" + nullValue
+ + "' for coverage " + coverageName + "( id " + coverageId
+ + ") into table PS_NullSet");
+ }
+ }
+
+ // Tables PS_Domain and PS_CrsSet
+ /* Delete old data */
+ setQuery("SELECT * FROM PS_Domain WHERE coverage='" + coverageId + "'");
+ ResultSet r1 = s.executeQuery(query);
+ Vector axes = new Vector(5);
+ while (r1.next()) {
+ int axisId = r1.getInt("id");
+ axes.add((Integer) axisId);
+ }
+ System.out.println(axes);
+ for (i = 0; i < axes.size(); i++) {
+ int axisId = ((Integer) axes.elementAt(i)).intValue();
+ setQuery("DELETE FROM PS_CrsSet WHERE axis='" + axisId + "'");
+ count = s.executeUpdate(query);
+ /* Do not worry about inexisting entries in CRS Sets: this implementation
+ does not really use CRSs. */
+// if (count <= 0)
+// throw new SQLException("Could not delete old entries from table PS_CrsSet.");
+
+ }
+
+ setQuery("DELETE FROM PS_Domain WHERE coverage='" + coverageId + "'");
+ count = s.executeUpdate(query);
+ if (count <= 0) {
+ throw new SQLException("Could not delete old entries from table PS_Domain.");
+ }
+ /* Insert new data */
+ Iterator<DomainElement> domIt = meta.getDomainIterator();
+ i = 0;
+ while (domIt.hasNext()) {
+ // Table PS_Domain
+ DomainElement dom = domIt.next();
+ int axisType = revAxisTypes.get(dom.getType());
+ Double numLo = dom.getNumLo();
+ Double numHi = dom.getNumHi();
+ String sNumLo = numLo == null ? "null" : "'" + numLo.toString() + "'";
+ String sNumHi = numHi == null ? "null" : "'" + numHi.toString() + "'";
+ String strLo = dom.getStrLo();
+ String strHi = dom.getStrHi();
+ if (strLo != null && strLo.equals("null") == false) {
+ strLo = "'" + strLo + "'";
+ }
+ if (strHi != null && strHi.equals("null") == false) {
+ strHi = "'" + strHi + "'";
+ }
+
+ String sqlQuery = "INSERT INTO PS_Domain "
+ + "(coverage, i, name, type, numLo, numHi, strLo, strHi) VALUES "
+ + "('" + coverageId + "', '" + i + "', '" + dom.getName() + "', '"
+ + axisType + "', " + sNumLo + ", " + sNumHi
+ + ", " + strLo + ", " + strHi + ")";
+ /* Need to get ID of the newly inserted tuple. Postgres has a cool construct (RETURNING),
+ * but we can also fall-back to another generic JDBC driver */
+ int axisId = -1;
+ if (driver.equals("org.postgresql.Driver")) {
+ /* RETURNING clause is not standard SQL, only PostgreSQL understands it*/
+ setQuery(sqlQuery + " RETURNING id");
+
+ ResultSet r = s.executeQuery(query);
+ if (r.next() == false) {
+ throw new SQLException("Could not insert domain element (i = " + i
+ + ", name=" + dom.getName() + ", type=" + dom.getType()
+ + ", numLo=" + dom.getNumLo() + ", numHi=" + dom.getNumHi()
+ + ", strLo=" + dom.getStrLo() + ", strHi=" + dom.getStrHi()
+ + ") for coverage " + coverageName + "( id " + coverageId
+ + ") into table PS_Domain");
+ }
+ /* Retrieve the ID of the newly inserted tuple (PS_Domain) */
+ axisId = r.getInt("id");
+ } else {
+ /* Fallback to specific driver support on returning autogenerated keys. */
+ String[] keys = new String[1];
+ keys[0] = "id";
+ int c = s.executeUpdate(sqlQuery, keys);
+ if (c <= 0) {
+ throw new SQLException("Could not insert domain element (i = " + i
+ + ", name=" + dom.getName() + ", type=" + dom.getType()
+ + ", numLo=" + dom.getNumLo() + ", numHi=" + dom.getNumHi()
+ + ", strLo=" + dom.getStrLo() + ", strHi=" + dom.getStrHi()
+ + ") for coverage " + coverageName + "( id " + coverageId
+ + ") into table PS_Domain");
+ }
+ /* Retrieve the ID of the newly inserted tuple (PS_Domain) */
+ ResultSet rr = s.getGeneratedKeys();
+ if (rr.next() == false) {
+ throw new SQLException("Could not retrieve ID of the newly insterted tuple in table PS_Domain.");
+ }
+ axisId = rr.getInt("id");
+ }
+ /* check ID */
+ if (axisId < 0) {
+ throw new SQLException("Generated ID (" + axisId
+ + ") for the tuple in PS_Domain is not valid !");
+ }
+
+ /* Increment axis number */
+ i++;
+
+ // Table PS_CrsSet
+ Set<String> crsSet = dom.getCrsSet();
+ System.out.println(crsSet);
+ Iterator<String> crsIt = crsSet.iterator();
+ while (crsIt.hasNext()) {
+ String crs = crsIt.next();
+ int crsId = revCrss.get(crs);
+ setQuery("INSERT INTO PS_CrsSet (axis, crs) VALUES "
+ + "('" + axisId + "', '" + crsId + "')");
+ if (s.executeUpdate(query) <= 0) {
+ throw new SQLException("Could not insert Crs " + crs
+ + "for axis =" + axisId + " in table PS_CrsSet");
+ }
+ }
+ }
+
+ // Table PS_Descriptions
+ /* Delete old data */
+ setQuery("DELETE FROM PS_Descriptions WHERE coverage='" + coverageId + "'");
+ count = s.executeUpdate(query);
+ /* Coverage descriptions are not essential, do not throw an error if missing */
+// if (count <= 0)
+// throw new SQLException("Could not delete old data from table PS_Descriptions");
+ /* Insert new data */
+ String title = meta.getTitle();
+ String abstr = meta.getAbstract();
+ String keywords = meta.getKeywords();
+ if (title != null) {
+ title = "'" + title + "'";
+ }
+ if (abstr != null) {
+ abstr = "'" + abstr + "'";
+ }
+ if (keywords != null) {
+ keywords = "'" + keywords + "'";
+ }
+ setQuery("INSERT INTO PS_Descriptions (coverage, title, abstract, keywords)"
+ + " VALUES ('" + coverageId + "', " + title + ", " + abstr + ", " + keywords + ")");
+ if (s.executeUpdate(query) <= 0) {
+ throw new SQLException("Could not insert descriptive metadata in table "
+ + "PS_Descriptions for coverage " + coverageName + " (ID " + coverageId + ")");
+ }
+
+
+ s.close();
+
+ if (commit) {
+ commitAndClose();
+ }
+ } catch (SQLException sqle) {
+ /* Abort this transaction */
+ try {
+ if (s != null) {
+ s.close();
+ }
+ abortAndClose();
+ } catch (SQLException f) {
+ }
+
+ throw new ResourceException("Metadata database error", sqle);
+ }
+ }
+
+ /** Insert metadata for a new coverage.
+ *
+ * @param meta Metadata object, container of information
+ * @param commit Boolean value, specifying if we want to commit immediately or not
+ */
+ public void insertNewCoverageMetadata(Metadata meta, boolean commit) throws ResourceException {
+ Statement s = null;
+ String coverageName = meta.getCoverageName();
+ int coverageId = -1;
+
+ try {
+ ensureConnection();
+ s = conn.createStatement();
+
+ String name = coverageName;
+ /* FIXME: Table PS_COVERAGE: nullValue and CRS fields not USED !!! */
+// String nullvalue = "";
+// String crs = "";
+ String nulldefault = meta.getNullDefault();
+ int interpolatiotypendefault = revInterpolationTypes.get(meta.getInterpolationDefault());
+ int nullresistancedefault = revNullResistances.get(meta.getNullResistanceDefault());
+
+ // Table PS_Coverage
+ String sqlQuery = "INSERT INTO PS_Coverage "
+ + "(name, nullDefault, interpolationTypeDefault, nullResistanceDefault) "
+ + " VALUES ('" + name + "', '" + nulldefault + "', '"
+ + interpolatiotypendefault + "', '" + nullresistancedefault + "')";
+ /* Need to get ID of the newly inserted tuple. Postgres has a cool construct (RETURNING),
+ * but we can also fall-back to another generic JDBC driver */
+ if (driver.equals("org.postgresql.Driver")) {
+ /* RETURNING clause is not standard SQL, only PostgreSQL understands it*/
+ setQuery(sqlQuery + " RETURNING id");
+
+ ResultSet r = s.executeQuery(query);
+ if (r.next() == false) {
+ throw new SQLException("Could not insert new coverage in table PS_Coverage.");
+ }
+ /* Retrieve the ID of the newly inserted tuple (PS_Coverage) */
+ coverageId = r.getInt("id");
+ } else {
+ /* Fallback to specific driver support on returning autogenerated keys. */
+ String[] keys = new String[1];
+ keys[0] = "id";
+ int c = s.executeUpdate(sqlQuery, keys);
+ if (c <= 0) {
+ throw new SQLException("Could not insert new coverage in table PS_Coverage.");
+ }
+ /* Retrieve the ID of the newly inserted tuple (PS_Coverage) */
+ ResultSet rr = s.getGeneratedKeys();
+ if (rr.next() == false) {
+ throw new SQLException("Could not retrieve ID of the newly insterted tuple in table PS_Coverage.");
+ }
+ coverageId = rr.getInt("id");
+ }
+ /* check ID */
+ if (coverageId < 0) {
+ throw new SQLException("Generated ID (" + coverageId
+ + ") for the tuple in PS_Coverage is not valid !");
+ }
+
+ // Table PS_CellDomain
+ Iterator<CellDomainElement> cellIt = meta.getCellDomainIterator();
+ int i = 0;
+ while (cellIt.hasNext()) {
+ CellDomainElement cell = cellIt.next();
+ setQuery("INSERT INTO PS_CellDomain (coverage, i, lo, hi) VALUES "
+ + " ('" + coverageId + "', '" + i + "', '" + cell.getLo() + "', '"
+ + cell.getHi() + "')");
+ if (s.executeUpdate(query) <= 0) {
+ throw new SQLException("Could not insert axis " + i + " for coverage "
+ + coverageName + "( id " + coverageId + ") into table PS_CellDomain");
+ }
+ i++;
+ }
+
+ // Table PS_Range
+ Iterator<RangeElement> rangeIt = meta.getRangeIterator();
+ i = 0;
+ while (rangeIt.hasNext()) {
+ RangeElement range = rangeIt.next();
+ System.out.println(range);
+ int dataType = revDataTypes.get(range.getType());
+ setQuery("INSERT INTO PS_Range (coverage, i, name, type) VALUES "
+ + " ('" + coverageId + "', '" + i + "', '" + range.getName() + "', '"
+ + dataType + "')");
+ if (s.executeUpdate(query) <= 0) {
+ throw new SQLException("Could not insert range " + range.getName()
+ + "( id " + i + " ) for coverage "
+ + coverageName + "( id " + coverageId + ") into table PS_Range");
+ }
+ i++;
+ }
+
+ // Table PS_InterpolationSet
+ Iterator<InterpolationMethod> methodIt = meta.getInterpolationMethodIterator();
+ i = 0;
+ while (methodIt.hasNext()) {
+ InterpolationMethod method = methodIt.next();
+ int interp = revInterpolationTypes.get(method.getInterpolationType());
+ int nullRes = revNullResistances.get(method.getNullResistance());
+ setQuery("INSERT INTO PS_InterpolationSet (coverage, interpolationType, nullResistance) VALUES "
+ + " ('" + coverageId + "', '" + interp + "', '" + nullRes + "')");
+ if (s.executeUpdate(query) <= 0) {
+ throw new SQLException("Could not insert interpolation method (" + method.getInterpolationType()
+ + ", " + method.getNullResistance() + " ) for coverage "
+ + coverageName + "( id " + coverageId + ") into table PS_InterpolationSet");
+ }
+ i++;
+ }
+
+ // Table PS_NullSet
+ Iterator<String> nullIt = meta.getNullSetIterator();
+ while (nullIt.hasNext()) {
+ String nullValue = nullIt.next();
+ setQuery("INSERT INTO PS_NullSet (coverage, nullValue) VALUES "
+ + " ('" + coverageId + "', '" + nullValue + "')");
+ if (s.executeUpdate(query) <= 0) {
+ throw new SQLException("Could not insert null value '" + nullValue
+ + "' for coverage " + coverageName + "( id " + coverageId
+ + ") into table PS_NullSet");
+ }
+ }
+
+ Iterator<DomainElement> domIt = meta.getDomainIterator();
+ i = 0;
+ while (domIt.hasNext()) {
+ // Table PS_Domain
+ DomainElement dom = domIt.next();
+ int axisType = revAxisTypes.get(dom.getType());
+ Double numLo = dom.getNumLo();
+ Double numHi = dom.getNumHi();
+ String sNumLo = numLo == null ? "null" : "'" + numLo.toString() + "'";
+ String sNumHi = numHi == null ? "null" : "'" + numHi.toString() + "'";
+ String strLo = dom.getStrLo();
+ String strHi = dom.getStrHi();
+ if (strLo != null && strLo.equals("null") == false) {
+ strLo = "'" + strLo + "'";
+ }
+ if (strHi != null && strHi.equals("null") == false) {
+ strHi = "'" + strHi + "'";
+ }
+
+ sqlQuery = "INSERT INTO PS_Domain "
+ + "(coverage, i, name, type, numLo, numHi, strLo, strHi) VALUES "
+ + "('" + coverageId + "', '" + i + "', '" + dom.getName() + "', '"
+ + axisType + "', " + sNumLo + ", " + sNumHi
+ + ", " + strLo + ", " + strHi + ")";
+ /* Need to get ID of the newly inserted tuple. Postgres has a cool construct (RETURNING),
+ * but we can also fall-back to another generic JDBC driver */
+ int axisId = -1;
+ if (driver.equals("org.postgresql.Driver")) {
+ /* RETURNING clause is not standard SQL, only PostgreSQL understands it*/
+ setQuery(sqlQuery + " RETURNING id");
+
+ ResultSet r = s.executeQuery(query);
+ if (r.next() == false) {
+ throw new SQLException("Could not insert domain element (i = " + i
+ + ", name=" + dom.getName() + ", type=" + dom.getType()
+ + ", numLo=" + dom.getNumLo() + ", numHi=" + dom.getNumHi()
+ + ", strLo=" + dom.getStrLo() + ", strHi=" + dom.getStrHi()
+ + ") for coverage " + coverageName + "( id " + coverageId
+ + ") into table PS_Domain");
+ }
+ /* Retrieve the ID of the newly inserted tuple (PS_Domain) */
+ axisId = r.getInt("id");
+ } else {
+ /* Fallback to specific driver support on returning autogenerated keys. */
+ String[] keys = new String[1];
+ keys[0] = "id";
+ int c = s.executeUpdate(sqlQuery, keys);
+ if (c <= 0) {
+ throw new SQLException("Could not insert domain element (i = " + i
+ + ", name=" + dom.getName() + ", type=" + dom.getType()
+ + ", numLo=" + dom.getNumLo() + ", numHi=" + dom.getNumHi()
+ + ", strLo=" + dom.getStrLo() + ", strHi=" + dom.getStrHi()
+ + ") for coverage " + coverageName + "( id " + coverageId
+ + ") into table PS_Domain");
+ }
+ /* Retrieve the ID of the newly inserted tuple (PS_Domain) */
+ ResultSet rr = s.getGeneratedKeys();
+ if (rr.next() == false) {
+ throw new SQLException("Could not retrieve ID of the newly insterted tuple in table PS_Domain.");
+ }
+ axisId = rr.getInt("id");
+ }
+ /* check ID */
+ if (axisId < 0) {
+ throw new SQLException("Generated ID (" + axisId
+ + ") for the tuple in PS_Domain is not valid !");
+ }
+
+ /* Increment axis number */
+ i++;
+
+ // Table PS_CrsSet
+ Set<String> crsSet = dom.getCrsSet();
+ Iterator<String> crsIt = crsSet.iterator();
+ while (crsIt.hasNext()) {
+ String crs = crsIt.next();
+ int crsId = revCrss.get(crs);
+ setQuery("INSERT INTO PS_CrsSet (axis, crs) VALUES "
+ + "('" + axisId + "', '" + crsId + "')");
+ if (s.executeUpdate(query) <= 0) {
+ throw new SQLException("Could not insert Crs " + crs
+ + "for axis =" + axisId + " in table PS_CrsSet");
+ }
+ }
+ }
+
+ // Table PS_Descriptions
+ String title = meta.getTitle();
+ String abstr = meta.getAbstract();
+ String keywords = meta.getKeywords();
+ if (title != null) {
+ title = "'" + title + "'";
+ }
+ if (abstr != null) {
+ abstr = "'" + abstr + "'";
+ }
+ if (keywords != null) {
+ keywords = "'" + keywords + "'";
+ }
+ setQuery("INSERT INTO PS_Descriptions (coverage, title, abstract, keywords)"
+ + " VALUES ('" + coverageId + "', " + title + ", " + abstr + ", " + keywords + ")");
+ if (s.executeUpdate(query) <= 0) {
+ throw new SQLException("Could not insert descriptive metadata in table "
+ + "PS_Descriptions for coverage " + coverageName + " (ID " + coverageId + ")");
+ }
+
+ s.close();
+
+ if (commit) {
+ commitAndClose();
+ }
+ } catch (SQLException sqle) {
+ /* Abort this transaction */
+ try {
+ if (s != null) {
+ s.close();
+ }
+ abortAndClose();
+ } catch (SQLException f) {
+ }
+
+ throw new ResourceException("Metadata database error", sqle);
+ }
+
+ }
+
+ public void ensureConnection() throws SQLException {
+ synchronized (this) {
+ LOG.trace("Ensuring connection is valid...");
+// if( connection == null || !connection.isValid( CONNECTION_TIMEOUT ) ) { // Not implemented by PostgreSQL yet.
+ if ((conn == null) || conn.isClosed()) {
+ LOG.trace("*** Opening new DB connection !");
+ close();
+ openConnection();
+ LOG.trace("*** ok.");
+// try { throw new Exception(""); } catch (Exception e) {e.printStackTrace();}
+ }
+ }
+
+ }
+
+ public void openConnection() throws SQLException {
+ conn = DriverManager.getConnection(url, user, pass);
+ conn.setAutoCommit(false);
+ savepoint = conn.setSavepoint();
+ }
+
+ public void abortAndClose() throws SQLException {
+ if (conn != null) {
+ conn.rollback(savepoint);
+ conn.close();
+ conn = null;
+ }
+ }
+
+ public void commitAndClose() throws SQLException {
+ if (conn != null) {
+ conn.commit();
+ conn.close();
+ conn = null;
+ }
+ }
+
+ @Override
+ public Collection<String> getAxisNames() {
+ return axisTypes.values();
+ }
+
+ /* Logging function for SQL queries. */
+ private void setQuery(String q) {
+ this.query = q;
+ LOG.trace("SQL Query: {}", q);
+ }
+
+ /* Returns the available formatToMimetype formats, as stored in the metadata database */
+ public String[] getMimetypesList() {
+ return supportedFormats.values().toArray(new String[1]);
+ }
+
+ /* Translate a mime-type to a format name, if known to rasdaman. */
+ public String mimetypeToFormat(String mime) {
+ LOG.debug(revSupportedFormats.toString());
+ return revSupportedFormats.get(mime);
+ }
+
+ /**
+ * @return the dataTypes
+ */
+ public Collection<String> getDataTypes() {
+ return dataTypes.values();
+ }
+
+ /**
+ * @return the interpolationTypes
+ */
+ public Collection<String> getInterpolationTypes() {
+ return interpolationTypes.values();
+ }
+
+ /**
+ * @return the nullResistances
+ */
+ public Collection<String> getNullResistances() {
+ return nullResistances.values();
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/DimensionIntervalElement.java b/petascope/src/petascope/wcps/server/core/DimensionIntervalElement.java
new file mode 100644
index 0000000..e2aeef2
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/DimensionIntervalElement.java
@@ -0,0 +1,221 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+import petascope.wcs.server.exceptions.NoApplicableCodeException;
+
+public class DimensionIntervalElement implements IRasNode, ICoverageInfo {
+
+ Logger LOG = LoggerFactory.getLogger(DimensionIntervalElement.class);
+ private IRasNode child;
+ private CoverageInfo info = null;
+ private AxisName axis;
+ private Crs crs;
+ private ScalarExpr domain1, domain2; // lower and upper bound, or "DomainMetadataExprType" and null
+ private long coord1, coord2;
+ private int counter = 0; // counter for the domain vars
+ private Metadata meta = null; // metadata about the current coverage
+ private boolean finished = false;
+ private Node nextNode;
+ private boolean transformedCoordinates = false;
+
+ /**
+ * Constructs an element of a dimension interval.
+ * @param node XML Node
+ * @param xq WCPS Xml Query object
+ * @param covInfo CoverageInfo object about the Trim parent object
+ * @throws WCPSException
+ */
+ public DimensionIntervalElement(Node node, XmlQuery xq, CoverageInfo covInfo)
+ throws WCPSException, InvalidCrsException {
+
+ if (covInfo.getCoverageName() != null) {
+ // Add WGS84 CRS information from coverage metadata, may be useful
+ // for converting geo-coordinates to pixel-coordinates
+ String coverageName = covInfo.getCoverageName();
+ meta = xq.getMetadataSource().read(coverageName);
+ }
+
+ System.err.println("Trying to parse DimensionIntervalElement expression...");
+ String name;
+
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ while (node != null && finished == false) {
+ if (node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ continue;
+ }
+
+ name = node.getNodeName();
+ System.err.println("Current node is " + name);
+
+ // Try Axis
+ try {
+ axis = new AxisName(node, xq);
+ node = node.getNextSibling();
+ continue;
+ } catch (WCPSException e) {
+ System.err.println("Failed to parse an axis!");
+ }
+
+ // Try CRS name
+ try {
+ crs = new Crs(node, xq);
+ node = node.getNextSibling();
+ if (axis == null) {
+ throw new WCPSException("Expected Axis node before CRS !");
+ }
+ continue;
+ } catch (WCPSException e) {
+ System.err.println("Failed to parse a crs!");
+ }
+
+ // TODO: how to implement DomainMetadataExpr ?
+
+// // Try last thing
+// try
+// {
+// domain1 = new DomainMetadataExprType(node, xq);
+// counter = 1;
+// continue;
+// }
+// catch (WCPSException e)
+// {
+// System.err.println("Failed to parse domain metadata!");
+// }
+
+ // Then it must be a pair of nodes "lowerBound" + "upperBound"
+ if (node.getNodeName().equals("lowerBound")) {
+ counter = 2;
+ domain1 = new ScalarExpr(node.getFirstChild(), xq);
+ if (axis == null) {
+ throw new WCPSException("Expected <axis> node before <lowerBound> !");
+ }
+ } else if (node.getNodeName().equals("upperBound")) {
+ counter = 2;
+ domain2 = new ScalarExpr(node.getFirstChild(), xq);
+ if (axis == null) {
+ throw new WCPSException("Expected <lowerBound> node before <upperBound> !");
+ }
+ } else {
+ throw new WCPSException("Unexpected node: " + node.getFirstChild().getNodeName());
+ }
+
+ if (axis != null && counter == 1 && domain1 != null) {
+ finished = true;
+ }
+ if (axis != null && counter == 2 && domain1 != null && domain2 != null) {
+ finished = true;
+ }
+
+ if (finished == true) {
+ nextNode = node.getNextSibling();
+ }
+
+ node = node.getNextSibling();
+ }
+
+ if (finished == true) {
+ convertToPixelCoordinates();
+ }
+ }
+
+
+ /* If input coordinates are geo-, convert them to pixel coordinates. */
+ private void convertToPixelCoordinates() {
+ if (meta.getCrs() == null && crs != null && crs.getName().equals(DomainElement.WGS84_CRS)) {
+ throw new RuntimeException("Coverage '" + meta.getCoverageName()
+ + "' is not georeferenced with 'EPSG:4326' coordinate system.");
+ }
+ if (counter == 2 && crs != null && domain1.isSingleValue() && domain2.isSingleValue()) {
+ if (crs.getName().equals(DomainElement.WGS84_CRS)) {
+ LOG.debug("CRS is '{}' and should be equal to '{}'", crs.getName(), DomainElement.WGS84_CRS);
+ try {
+ this.transformedCoordinates = true;
+ // Convert to pixel coordinates
+ Double val1 = domain1.getSingleValue();
+ Double val2 = domain2.getSingleValue();
+ String axisName = axis.toRasQL().toUpperCase();
+ if (axisName.equals("X")) {
+ long[] pCoord = crs.convertToPixelCoordinates(meta, "X", val1, val2, null, null);
+ coord1 = pCoord[0];
+ coord2 = pCoord[1];
+ }
+ if (axisName.equals("Y")) {
+ long[] pCoord = crs.convertToPixelCoordinates(meta, "Y", null, null, val1, val2);
+ coord1 = pCoord[2];
+ coord2 = pCoord[3];
+ }
+ } catch (NoApplicableCodeException e) {
+ this.transformedCoordinates = false;
+ LOG.error("Error while transforming geo-coordinates to pixel coordinates."
+ + "The metadata is probably not valid.");
+ }
+ }
+ }
+ }
+
+ /* Not used */
+ public String toRasQL() {
+ return "<DimensionIntervalElement Not Converted to RasQL>";
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return info;
+ }
+
+ public Node getNextNode() {
+ return nextNode;
+ }
+
+ public String getAxisName() {
+ return this.axis.toRasQL();
+ }
+
+ public String getAxisCoords() {
+ return this.domain1.toRasQL() + " : " + this.domain2.toRasQL();
+ }
+
+ public String getLowCoord() {
+ if (transformedCoordinates) {
+ return String.valueOf(coord1);
+ } else {
+ return this.domain1.toRasQL();
+ }
+ }
+
+ public String getHighCoord() {
+ if (transformedCoordinates) {
+ return String.valueOf(coord2);
+ } else {
+ return this.domain2.toRasQL();
+ }
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/DimensionIntervalList.java b/petascope/src/petascope/wcps/server/core/DimensionIntervalList.java
new file mode 100644
index 0000000..94e477c
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/DimensionIntervalList.java
@@ -0,0 +1,55 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import java.util.ArrayList;
+import java.util.List;
+import org.w3c.dom.*;
+
+public class DimensionIntervalList {
+
+ private ArrayList<IRasNode> list;
+
+ public DimensionIntervalList(Node node, XmlQuery xq, CoverageInfo info)
+ throws WCPSException, InvalidCrsException {
+ System.err.println("Parsing a Dimension Interval List ...");
+
+ while (node != null) {
+ list = new ArrayList<IRasNode>();
+ try {
+ System.err.println("Parsing one dimension interval element ...");
+ DimensionIntervalElement elem = new DimensionIntervalElement(node, xq, info);
+ node = elem.getNextNode();
+ list.add(elem);
+ } catch (WCPSException e) {
+ System.err.println("Failed to parse this dimension interval element !");
+ System.err.println("Current node: " + node);
+ }
+ }
+ }
+
+ public List getAxisList() {
+ return list;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/DimensionPointElement.java b/petascope/src/petascope/wcps/server/core/DimensionPointElement.java
new file mode 100644
index 0000000..b29dd8e
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/DimensionPointElement.java
@@ -0,0 +1,130 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+public class DimensionPointElement implements IRasNode {
+
+ private IRasNode domain, child;
+ private AxisName axis;
+ private Crs crs;
+ private boolean finished = false;
+ private Node nextNode;
+
+ public DimensionPointElement(Node node, XmlQuery xq)
+ throws WCPSException, InvalidCrsException {
+ System.err.println("Trying to parse DimensionPointElement expression...");
+ String name;
+
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ while (node != null && finished == false) {
+ if (node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ continue;
+ }
+
+ name = node.getNodeName();
+ System.err.println("Current node is " + name);
+
+ // Try Axis
+ try {
+ axis = new AxisName(node, xq);
+ node = node.getNextSibling();
+ continue;
+ } catch (WCPSException e) {
+ System.err.println("Failed to parse an axis!");
+ }
+
+ // Try CRS name
+ try {
+ crs = new Crs(node, xq);
+ node = node.getNextSibling();
+ if (axis == null) {
+ throw new WCPSException("Expected Axis node before CRS !");
+ }
+ continue;
+ } catch (WCPSException e) {
+ System.err.println("Failed to parse a crs!");
+ }
+
+ // TODO: how to implement DomainMetadataExpr ?
+
+// // Try last thing
+// try
+// {
+// domain1 = new DomainMetadataExprType(node, xq);
+// counter = 1;
+// continue;
+// }
+// catch (WCPSException e)
+// {
+// System.err.println("Failed to parse domain metadata!");
+// }
+
+ // Then it must be a "slicingPosition"
+ if (node.getNodeName().equals("slicingPosition")) {
+ domain = new ScalarExpr(node.getFirstChild(), xq);
+ if (axis == null) {
+ throw new WCPSException("Expected <axis> node before <slicingPosition> !");
+ }
+ } else {
+ throw new WCPSException("Unexpected node: " + node.getFirstChild().getNodeName());
+ }
+
+ if (axis != null && domain != null) {
+ finished = true;
+ }
+
+ if (finished == true) {
+ nextNode = node.getNextSibling();
+ }
+
+ node = node.getNextSibling();
+ }
+ }
+
+ public String toRasQL() {
+ return child.toRasQL();
+ }
+
+ public Node getNextNode() {
+ return nextNode;
+ }
+
+ public String getAxisName() {
+ return this.axis.toRasQL();
+ }
+
+ public String getCrsName() {
+ return this.crs.toRasQL();
+ }
+
+ public String getSlicingPosition() {
+ return this.domain.toRasQL();
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/DomainElement.java b/petascope/src/petascope/wcps/server/core/DomainElement.java
new file mode 100644
index 0000000..3bb18f1
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/DomainElement.java
@@ -0,0 +1,193 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidMetadataException;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+/**
+ * This is an axis in geographic coordinates. See the WCPS standard.
+ */
+public class DomainElement implements Cloneable {
+
+ public static final String WGS84_CRS = "EPSG:4326";
+ public static final String IMAGE_CRS = "CRS:1";
+ private Set<String> crss;
+ private String name;
+ private Double numHi;
+ private Double numLo;
+ private String strHi;
+ private String strLo;
+ private String type;
+ private Collection<String> allowedAxes;
+
+ public DomainElement(String name, String type, Double numLo, Double numHi, String strLo,
+ String strHi, Set<String> crss, Collection<String> axes)
+ throws InvalidMetadataException {
+ this.allowedAxes = axes;
+
+ if ((name == null) || (type == null)) {
+ throw new InvalidMetadataException(
+ "Invalid domain element: Element name and type cannot be null");
+ }
+
+ if (name.equals("")) {
+ throw new InvalidMetadataException(
+ "Invalid domain element: Element name cannot be empty");
+ }
+
+ if (allowedAxes.contains(type) == false) {
+ throw new InvalidMetadataException(
+ "Invalid domain element: Invalid element type: " + type
+ + ". Allowed element types are: " + allowedAxes.toString());
+ }
+
+ if ((numLo != null) && (numHi != null) && (strLo == null) && (strHi == null)) {
+ if (numLo.compareTo(numHi) == 1) {
+ throw new InvalidMetadataException(
+ "Invalid domain element: Lower integer bound cannot be larger than upper integer bound");
+ }
+
+ this.numLo = numLo;
+ this.numHi = numHi;
+ } else if ((strLo != null) && (numHi != null) && (numLo == null) && (numHi == null)) {
+ if (strLo.equals("") || strHi.equals("")) {
+ throw new InvalidMetadataException(
+ "Invalid domain element: String bounds cannot be empty");
+ }
+
+ this.strLo = strLo;
+ this.strHi = strHi;
+ } else {
+ /* Allow both sources of info for time-axes */
+ if (type.equals("t")) {
+ this.strLo = strLo;
+ this.strHi = strHi;
+ this.numLo = numLo;
+ this.numHi = numHi;
+ } else {
+ throw new InvalidMetadataException(
+ "Invalid domain element: Integer bounds must both be non-null if string bounds are null, and vice versa at "
+ + name + ":" + type);
+ }
+ }
+
+ if ((type.equals("x") || type.equals("y")) && (numLo == null)) {
+ throw new InvalidMetadataException(
+ "Invalid domain element: A spatial axis must have integer extent");
+ } else if (type.equals("temporal") && (strLo == null)) {
+ throw new InvalidMetadataException(
+ "Invalid domain element: A temporal axis must have string extent");
+ } else if (type.equals("t") && (numLo == null) || (numHi == null)) {
+ throw new InvalidMetadataException("Invalid domain element: A \"t\" axis must have integer extent and optionally, string extent");
+ }
+
+ this.name = name;
+ this.type = type;
+
+ if ((crss == null) || !crss.contains(IMAGE_CRS)) {
+// throw new InvalidMetadataException(
+// "Invalid domain element: CRS set does not contain image CRS '"
+// + IMAGE_CRS + "'");
+ crss.add(IMAGE_CRS);
+ }
+
+ this.crss = crss;
+
+ }
+
+ @Override
+ public DomainElement clone() {
+ Set<String> c = new HashSet<String>(crss.size());
+ Iterator<String> i = crss.iterator();
+
+ while (i.hasNext()) {
+ c.add(new String(i.next()));
+ }
+
+ try {
+ String newName = name == null ? null : new String(name);
+ String newType = type == null ? null : new String(type);
+ Double newNumLo = numLo == null ? null : new Double(numLo);
+ Double newNumHi = numHi == null ? null : new Double(numHi);
+ String newStrLo = strLo == null ? null : new String(strLo);
+ String newStrHi = strHi == null ? null : new String(strHi);
+ return new DomainElement(newName, newType, newNumLo, newNumHi, newStrLo, newStrHi, c, allowedAxes);
+ } catch (InvalidMetadataException ime) {
+ throw new RuntimeException(
+ "Invalid metadata while cloning DomainElement. This is a software bug in WCPS.",
+ ime);
+ }
+
+ }
+
+ public boolean equals(DomainElement de) {
+ if ((numLo == null) && (de.numLo == null)) {
+ return strLo.equals(de.strLo) && strHi.equals(strHi)
+ && name.equals(de.name) && type.equals(de.type);
+ } else if ((strLo == null) && (de.strLo == null)) {
+ return numLo.equals(de.numLo) && numHi.equals(numHi)
+ && name.equals(de.name) && type.equals(de.type);
+ } else {
+ return false;
+ }
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public Double getNumHi() {
+ return numHi;
+ }
+
+ public Double getNumLo() {
+ return numLo;
+ }
+
+ public String getStrHi() {
+ return strHi;
+ }
+
+ public String getStrLo() {
+ return strLo;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public Set<String> getCrsSet() {
+ return crss;
+ }
+
+ @Override
+ public String toString() {
+ String d = "Domain Element { Name: '" + name + "', Type: '" + type
+ + "', NumLow: '" + numLo + "', NumHi: '" + numHi + "', StrLow: '"
+ + strLo + "', StrHi: '" + strHi + "', CrsSet: '" + crss + "'}";
+ return d;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/DynamicMetadataSource.java b/petascope/src/petascope/wcps/server/core/DynamicMetadataSource.java
new file mode 100644
index 0000000..2918f84
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/DynamicMetadataSource.java
@@ -0,0 +1,105 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.ResourceException;
+import petascope.wcps.server.exceptions.InvalidWcpsRequestException;
+import petascope.wcps.server.exceptions.InvalidMetadataException;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * A IMetadataSource that allows WCPS to store information about on-the-fly
+ * constructed coverages (for example Construct Coverage expr).
+ * Needs another MetadataSource as a backend, to retrieve metadata about
+ * static coverages.
+ */
+public class DynamicMetadataSource implements IDynamicMetadataSource {
+ // Static coverages, served by the server at all times
+
+ private Set<String> staticCoverageNames;
+ // Dynamic coverages, built on-the-fly in a query
+ private Set<String> dynamicCoverageNames;
+ // Union of static and dynamic coverages
+ private Set<String> allCoverageNames;
+ // Metadata information for all available coverages
+ private Map<String, Metadata> metadata;
+ // Other metadata class that serves as backend
+ private IMetadataSource metadataSource;
+
+ public DynamicMetadataSource(IMetadataSource metadataSource)
+ throws ResourceException, InvalidMetadataException {
+ this.metadataSource = metadataSource;
+ staticCoverageNames = metadataSource.coverages();
+ dynamicCoverageNames = new HashSet<String>();
+ allCoverageNames = staticCoverageNames;
+ metadata = new HashMap<String, Metadata>();
+
+ // Init metadata for static coverages
+ Iterator<String> i = staticCoverageNames.iterator();
+ try {
+ while (i.hasNext()) {
+ String coverage = i.next();
+ metadata.put(coverage, metadataSource.read(coverage));
+ }
+ } catch (InvalidWcpsRequestException ire) {
+ throw (InvalidMetadataException) ire.getCause();
+ }
+ }
+
+ public Set<String> coverages() throws ResourceException {
+ return metadataSource.coverages();
+ }
+
+ public String formatToMimetype(String format) {
+ return metadataSource.formatToMimetype(format);
+ }
+
+ public Metadata read(String coverageName) throws InvalidWcpsRequestException, ResourceException {
+ if ((coverageName == null) || coverageName.equals("")) {
+ throw new InvalidWcpsRequestException(
+ "Cannot retrieve coverage with null or empty name");
+ }
+
+ if (!this.coverages().contains(coverageName)) {
+ throw new InvalidWcpsRequestException("Coverage '" + coverageName
+ + "' is not served by this server");
+ }
+
+ return metadataSource.read(coverageName);
+ }
+
+ public void addDynamicMetadata(String coverageName, Metadata meta) {
+ metadata.put(coverageName, meta);
+ dynamicCoverageNames.add(coverageName);
+ allCoverageNames = staticCoverageNames;
+ allCoverageNames.addAll(dynamicCoverageNames);
+ }
+
+ public Collection<String> getAxisNames() {
+ return metadataSource.getAxisNames();
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/EncodeDataExpr.java b/petascope/src/petascope/wcps/server/core/EncodeDataExpr.java
new file mode 100644
index 0000000..2ed58ac
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/EncodeDataExpr.java
@@ -0,0 +1,96 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+// This is the equivalent of the "ProcessingExprType" complex XML type.
+public class EncodeDataExpr implements IRasNode {
+
+ private IRasNode coverageExprType;
+ private String extraParams;
+ private String format;
+ private String mime;
+ private Boolean store;
+
+ public EncodeDataExpr(Node node, XmlQuery request) throws WCPSException, InvalidCrsException {
+ Node child;
+ String nodeName;
+
+ for (child = node.getFirstChild(); child != null; child = child.getNextSibling()) {
+ nodeName = child.getNodeName();
+
+ if (nodeName.equals("#text")) {
+ continue;
+ }
+
+ System.err.println("Encode : node : " + child.getNodeName());
+
+ if (nodeName.equals("format")) {
+ format = child.getFirstChild().getNodeValue();
+ mime = request.getMetadataSource().formatToMimetype(format);
+ continue;
+ }
+
+ if (nodeName.equals("extraParameters")) {
+ extraParams = child.getFirstChild().getNodeValue();
+ continue;
+ }
+
+ coverageExprType = new CoverageExpr(child, request);
+ }
+
+ Node _store = node.getAttributes().getNamedItem("store");
+
+ if (_store != null) {
+ store = _store.getNodeValue().equals("true");
+ }
+ }
+
+ public String getMime() {
+ return mime;
+ }
+
+ public String toRasQL() {
+ // TODO: cjucovschi - implement store
+
+ String result;
+
+ if (format.equals("raw")) {
+ result = coverageExprType.toRasQL();
+ } else {
+ result = format + "(" + coverageExprType.toRasQL();
+
+ if (extraParams != null) {
+ extraParams = '"' + extraParams + '"';
+ result = result + ", " + extraParams;
+ }
+
+ result = result + ")";
+ }
+
+ System.err.println("Returning EncodeExpression:" + result);
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/ExtendCoverageExpr.java b/petascope/src/petascope/wcps/server/core/ExtendCoverageExpr.java
new file mode 100644
index 0000000..a711742
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/ExtendCoverageExpr.java
@@ -0,0 +1,132 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import org.w3c.dom.*;
+
+public class ExtendCoverageExpr implements IRasNode, ICoverageInfo {
+
+ private List<DimensionIntervalElement> axisList;
+ private CoverageExpr coverageExprType;
+ private CoverageInfo coverageInfo;
+ private String[] dim;
+ private int dims;
+ private DimensionIntervalElement elem;
+
+ public ExtendCoverageExpr(Node node, XmlQuery xq) throws WCPSException, InvalidCrsException {
+
+ Node child, axisNode;
+ String nodeName;
+
+ axisList = new ArrayList<DimensionIntervalElement>();
+
+ child = node.getFirstChild();
+ while (child != null) {
+ nodeName = child.getNodeName();
+
+ if (nodeName.equals("#text")) {
+ child = child.getNextSibling();
+ continue;
+ }
+
+ try {
+ System.err.println("Trying out an CoverageExprType group...");
+ coverageExprType = new CoverageExpr(child, xq);
+ coverageInfo = coverageExprType.getCoverageInfo();
+ child = child.getNextSibling();
+ continue;
+ } catch (WCPSException e) {
+ System.err.println("This was no CoverageExprType: " + nodeName);
+ }
+
+ try {
+ // Start a new axis and save it
+ elem = new DimensionIntervalElement(child, xq, coverageInfo);
+ axisList.add(elem);
+ child = elem.getNextNode();
+ continue;
+ } catch (WCPSException e) {
+ System.err.println("This was no Dimension Interval ELement: " + child.getNodeName());
+ }
+
+ // else unknown element
+ throw new WCPSException("Unknown node for ExtendCoverage expression:" + child.getNodeName());
+ }
+
+ dims = coverageInfo.getNumDimensions();
+ dim = new String[dims];
+
+ for (int j = 0; j < dims; ++j) {
+ dim[j] = "*:*";
+ }
+
+
+ Iterator<DimensionIntervalElement> i = axisList.iterator();
+ DimensionIntervalElement axis;
+ int axisId;
+ int axisLo, axisHi;
+
+ while (i.hasNext()) {
+ axis = i.next();
+ axisId = coverageInfo.getDomainIndexByName(axis.getAxisName());
+ System.out.println("Axis ID: " + axisId);
+ System.out.println("Axis name: " + axis.getAxisName());
+ System.out.print("Axis coords: ");
+
+ axisLo = Integer.parseInt(axis.getLowCoord());
+ axisHi = Integer.parseInt(axis.getHighCoord());
+ dim[axisId] = axisLo + ":" + axisHi;
+ coverageInfo.setCellDimension(
+ axisId,
+ new CellDomainElement(
+ BigInteger.valueOf(axisLo), BigInteger.valueOf(axisHi)));
+ }
+
+
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return coverageInfo;
+ }
+
+ public String toRasQL() {
+ String result = "extend(" + coverageExprType.toRasQL() + ",[";
+
+ for (int j = 0; j < dims; ++j) {
+ if (j > 0) {
+ result += ",";
+ }
+
+ result += dim[j];
+ }
+
+ result += "])";
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/FieldInterpolationElement.java b/petascope/src/petascope/wcps/server/core/FieldInterpolationElement.java
new file mode 100644
index 0000000..74af1cf
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/FieldInterpolationElement.java
@@ -0,0 +1,79 @@
+ /*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+import petascope.wcps.server.exceptions.InvalidWcpsRequestException;
+
+public class FieldInterpolationElement implements IRasNode {
+
+ private FieldName name;
+ private InterpolationMethod interp;
+ private Node nextNode;
+
+ public FieldInterpolationElement(Node node, XmlQuery xq) throws WCPSException {
+
+ throw new InvalidWcpsRequestException("Currently, our implementation does not allow specifying " +
+ "interpolation methods or null resistances for the scale operation.");
+
+ /*
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ if (node == null) {
+ throw new WCPSException("FieldInterpolationElementType parsing error!");
+ }
+
+ while (node != null)
+ {
+ String nodeName = node.getNodeName();
+ while (node.getNodeName().equals("#text"))
+ node = node.getNextSibling();
+
+ if (nodeName.equals("name")) {
+ this.name = new FieldName(node, xq);
+ node = node.getNextSibling();
+ continue;
+ }
+ else
+ {
+ interp = new InterpolationMethod(node, xq);
+ node = interp.getNextNode();
+ }
+ }
+ nextNode = node;
+
+ */
+ }
+
+ public Node getNextNode()
+ {
+ return nextNode;
+ }
+
+ public String toRasQL() {
+ // Since we only accept the default rasdaman interpolation methods, we do not need to specify it further
+ return "";
+ }
+};
diff --git a/petascope/src/petascope/wcps/server/core/FieldName.java b/petascope/src/petascope/wcps/server/core/FieldName.java
new file mode 100644
index 0000000..0f6f71d
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/FieldName.java
@@ -0,0 +1,52 @@
+ /*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+public class FieldName implements IRasNode {
+
+ private String name;
+
+ public FieldName(Node node, XmlQuery xq) throws WCPSException {
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ if (node == null) {
+ throw new WCPSException("FieldNameType parsing error!");
+ }
+
+ String nodeName = node.getNodeName();
+
+ if (nodeName.equals("name")) {
+ this.name = node.getTextContent();
+
+ System.err.println("Found field name: " + name);
+ }
+ }
+
+ public String toRasQL() {
+ return this.name;
+ }
+};
diff --git a/petascope/src/petascope/wcps/server/core/ICoverageInfo.java b/petascope/src/petascope/wcps/server/core/ICoverageInfo.java
new file mode 100644
index 0000000..b3aa956
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/ICoverageInfo.java
@@ -0,0 +1,27 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+interface ICoverageInfo {
+
+ public CoverageInfo getCoverageInfo();
+}
diff --git a/petascope/src/petascope/wcps/server/core/IDynamicMetadataSource.java b/petascope/src/petascope/wcps/server/core/IDynamicMetadataSource.java
new file mode 100644
index 0000000..31e82a4
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/IDynamicMetadataSource.java
@@ -0,0 +1,33 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+/**
+ * A IDynamicMetadataSource is an IMetadataSource that can also add information
+ * about new coverages on-the-fly. This is useful for queries that construct
+ * new coverages (see ConstructCoverage expression) but are not stored in the
+ * database.
+ */
+public interface IDynamicMetadataSource extends IMetadataSource {
+
+ public void addDynamicMetadata(String coverageName, Metadata meta);
+}
diff --git a/petascope/src/petascope/wcps/server/core/IMetadataSource.java b/petascope/src/petascope/wcps/server/core/IMetadataSource.java
new file mode 100644
index 0000000..fb01453
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/IMetadataSource.java
@@ -0,0 +1,44 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.ResourceException;
+import petascope.wcps.server.exceptions.InvalidWcpsRequestException;
+import java.util.Collection;
+import java.util.Set;
+
+/**
+ * A IMetadataSource is anything that can read metadata for a given coverage
+ * name. It must be able to list all coverages which it knows, return Metadata
+ * for each one, and also map a format (e.g. "png") to its formatToMimetype
+ * (e.g. "image/png").
+ */
+public interface IMetadataSource {
+
+ public Set<String> coverages() throws ResourceException;
+
+ public String formatToMimetype(String format);
+
+ public Metadata read(String coverageName) throws InvalidWcpsRequestException, ResourceException;
+
+ public Collection<String> getAxisNames();
+}
diff --git a/petascope/src/petascope/wcps/server/core/IRasNode.java b/petascope/src/petascope/wcps/server/core/IRasNode.java
new file mode 100644
index 0000000..8bf7aae
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/IRasNode.java
@@ -0,0 +1,27 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+interface IRasNode {
+
+ public String toRasQL();
+}
diff --git a/petascope/src/petascope/wcps/server/core/InducedOperationCoverageExpr.java b/petascope/src/petascope/wcps/server/core/InducedOperationCoverageExpr.java
new file mode 100644
index 0000000..4e20c4c
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/InducedOperationCoverageExpr.java
@@ -0,0 +1,88 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+public class InducedOperationCoverageExpr implements IRasNode, ICoverageInfo {
+
+ private IRasNode child;
+ private CoverageInfo info;
+ private String operation = "";
+
+ public InducedOperationCoverageExpr(Node node, XmlQuery xq)
+ throws WCPSException, InvalidCrsException {
+ String nodeName = node.getNodeName();
+
+ System.err.println("Trying induced operation: " + nodeName);
+ boolean okay = false; // will be true if the node is recognized
+
+ if (nodeName.equals("rangeConstructor")) {
+ operation = nodeName;
+ child = new RangeCoverageExpr(node, xq);
+ info = new CoverageInfo((((ICoverageInfo) child).getCoverageInfo()));
+ } else { // Try one of the groups
+ child = null;
+
+ if (child == null) {
+ try {
+ child = new UnaryOperationCoverageExpr(node, xq);
+ info = new CoverageInfo((((ICoverageInfo) child).getCoverageInfo()));
+ System.err.println("*** Induced Operation SUCCESS: " + node.getNodeName());
+ } catch (WCPSException e) {
+ System.err.println("InducedOperation failed: " + node.getNodeName());
+ child = null;
+ if (e.getMessage().equals("Method not implemented")) {
+ throw e;
+ }
+ }
+ }
+
+ if (child == null) {
+ try {
+ child = new BinaryOperationCoverageExpr(node, xq);
+ info = new CoverageInfo((((ICoverageInfo) child).getCoverageInfo()));
+ System.err.println("*** Binary Operation SUCCESS: " + node.getNodeName());
+ } catch (WCPSException e) {
+ System.err.println("Binary operation failed: " + node.getNodeName());
+ child = null;
+ }
+ }
+
+ if (child == null) {
+ throw new WCPSException("Invalid induced coverage expression, next node: "
+ + node.getNodeName());
+ }
+ }
+
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return info;
+ }
+
+ public String toRasQL() {
+ return child.toRasQL();
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/InterpolationMethod.java b/petascope/src/petascope/wcps/server/core/InterpolationMethod.java
new file mode 100644
index 0000000..9b1cf65
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/InterpolationMethod.java
@@ -0,0 +1,84 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+//A pair of an interpolation type and a null resistance. See the WCPS standard for an explanation of these.
+import petascope.wcps.server.exceptions.InvalidMetadataException;
+
+public class InterpolationMethod implements Cloneable {
+
+ private String interpolationType;
+ private String nullResistance;
+
+ public InterpolationMethod(String interpolationType, String nullResistance)
+ throws InvalidMetadataException {
+ if ((interpolationType == null)
+ || !(interpolationType.equals("nearest") || interpolationType.equals("linear")
+ || interpolationType.equals("cubic")
+ || interpolationType.equals("quadratic")
+ || interpolationType.equals("none"))) {
+ throw new InvalidMetadataException("Invalid interpolation method: "
+ + interpolationType
+ + " is not a legal interpolation type");
+ }
+
+ this.interpolationType = interpolationType;
+
+ if ((nullResistance == null)
+ || !(nullResistance.equals("full") || nullResistance.equals("none")
+ || nullResistance.equals("half") || nullResistance.equals("other"))) {
+ throw new InvalidMetadataException("Invalid interpolation method: "
+ + nullResistance
+ + " is not a legal null resistance");
+ }
+
+ this.nullResistance = nullResistance;
+
+ }
+
+ public InterpolationMethod clone() {
+ try {
+ return new InterpolationMethod(interpolationType, nullResistance);
+ } catch (InvalidMetadataException ime) {
+ throw new RuntimeException(
+ "Invalid metadata while cloning InterpolationMethod. This is a software bug in WCPS.",
+ ime);
+ }
+
+ }
+
+ public boolean equals(InterpolationMethod im) {
+ return interpolationType.equals(im.interpolationType)
+ && nullResistance.equals(im.nullResistance);
+
+ }
+
+ public String getInterpolationType() {
+ return interpolationType;
+
+ }
+
+ public String getNullResistance() {
+ return nullResistance;
+
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/Metadata.java b/petascope/src/petascope/wcps/server/core/Metadata.java
new file mode 100644
index 0000000..21dd264
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/Metadata.java
@@ -0,0 +1,704 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+//~--- JDK imports ------------------------------------------------------------
+import petascope.wcps.server.exceptions.InvalidMetadataException;
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import petascope.wcs.server.core.TimeString;
+
+/**
+ * This class implements WCPS metadata. For information on what each field
+ * means, see the WCPS standard. This class provides extensive error cheching
+ * and well as various utility functions.
+ */
+public class Metadata implements Cloneable {
+
+ private List<CellDomainElement> cellDomain;
+ private String coverageName;
+ private int coverageId = -1; // Used when reading metadata from the DB
+ private List<DomainElement> domain;
+ private InterpolationMethod interpolationDefault;
+ private Set<InterpolationMethod> interpolationSet;
+ private String nullDefault;
+ private Set<String> nullSet;
+ private List<RangeElement> range;
+ private String titleStr = "";
+ private String abstractStr = "";
+ private String keywordsStr = "";
+ private Wgs84Crs crs = null;
+ private CellDomainElement cellX, cellY, cellT;
+ private DomainElement domX, domY, domT;
+
+ public Metadata(List<CellDomainElement> cellDomain, List<RangeElement> range, Set<String> nullSet, String nullDefault, Set<InterpolationMethod> interpolationSet, InterpolationMethod interpolationDefault, String coverageName, List<DomainElement> domain, Wgs84Crs crs, String title, String abstr, String keywords) throws InvalidMetadataException {
+ this(cellDomain, range, nullSet, nullDefault, interpolationSet, interpolationDefault, coverageName, domain, crs);
+ this.titleStr = title;
+ this.abstractStr = abstr;
+ this.keywordsStr = keywords;
+ }
+
+ public Metadata(List<CellDomainElement> cellDomain, List<RangeElement> range, Set<String> nullSet, String nullDefault, Set<InterpolationMethod> interpolationSet, InterpolationMethod interpolationDefault, String coverageName, List<DomainElement> domain, Wgs84Crs crs) throws InvalidMetadataException {
+ if ((cellDomain == null) || (range == null) || (coverageName == null) || (nullSet == null) || (interpolationSet == null)) {
+ throw new InvalidMetadataException("Cell domain, range list, "
+ + "coverage name, null set, and interpolation set cannot be null for coverage " + coverageName);
+ }
+
+ if (cellDomain.size() == 0) {
+ throw new InvalidMetadataException("Invalid cell domain: At least "
+ + "one element is required for coverage " + coverageName);
+ }
+
+ this.cellDomain = cellDomain;
+
+ if (range.size() == 0) {
+ throw new InvalidMetadataException("At least one range element is "
+ + "required for coverage " + coverageName);
+ }
+
+ this.range = new ArrayList<RangeElement>(range.size());
+ Iterator<RangeElement> ir = range.iterator();
+
+ while (ir.hasNext()) {
+ RangeElement next = ir.next();
+ Iterator<RangeElement> j = this.range.iterator();
+
+ while (j.hasNext()) {
+ if (j.next().getName().equals(next.getName())) {
+ throw new InvalidMetadataException("Duplicate range element"
+ + " name encountered for coverage " + coverageName);
+ }
+ }
+
+ this.range.add(next);
+ }
+
+ if (nullSet.size() == 0) {
+ throw new InvalidMetadataException("Invalid null set: At least one "
+ + "null value is required for coverage " + coverageName);
+ }
+
+ if (nullDefault == null) {
+ throw new InvalidMetadataException("Invalid null default: Null "
+ + "default cannot be null for coverage " + coverageName);
+ }
+
+ if (!nullSet.contains(nullDefault)) {
+ throw new InvalidMetadataException("Invalid null default: Default "
+ + "null value " + nullDefault + " is not part of the null set"
+ + " for coverage " + coverageName);
+ }
+
+ Iterator<String> ns = nullSet.iterator();
+
+ while (ns.hasNext()) {
+ String nullVal = ns.next();
+ List<String> nulls = SDU.str2string(nullVal);
+
+ if (nulls.size() != range.size()) {
+ throw new InvalidMetadataException("Invalid null value: "
+ + nullVal + " must have " + range.size() + " axes "
+ + "according to the range specified for coverage " + coverageName);
+ }
+
+ Iterator<String> i = nulls.iterator();
+ Iterator<RangeElement> j = range.iterator();
+
+ while (j.hasNext()) {
+ RangeElement re = j.next();
+
+ if (re.isBoolean()) {
+ SDU.str2boolean(i.next());
+ } else if (re.isIntegral()) {
+ SDU.str2integer(i.next());
+ } else if (re.isFloating()) {
+ SDU.str2double(i.next());
+ } else if (re.isComplex()) {
+ SDU.str2complex(i.next());
+ }
+ }
+ }
+
+ this.nullSet = nullSet;
+ this.nullDefault = nullDefault;
+
+ if (interpolationSet.size() == 0) {
+ throw new InvalidMetadataException("Invalid interpolation set: "
+ + "At least one interpolation method is required for "
+ + "coverage " + coverageName);
+ }
+
+ if (interpolationDefault == null) {
+ interpolationDefault = new InterpolationMethod("none", "none");
+ }
+
+ boolean defaultContainedInSet = false;
+ Iterator<InterpolationMethod> is = interpolationSet.iterator();
+
+ while (is.hasNext()) {
+ if (interpolationDefault.equals(is.next())) {
+ defaultContainedInSet = true;
+ }
+ }
+
+ if (!defaultContainedInSet) {
+ throw new InvalidMetadataException("Invalid interpolation default:"
+ + " Default interpolation method ("
+ + interpolationDefault.getInterpolationType() + ","
+ + interpolationDefault.getNullResistance() + ") is not part "
+ + "of the interpolation set for coverage " + coverageName);
+ }
+
+ this.interpolationSet = interpolationSet;
+ this.interpolationDefault = interpolationDefault;
+ this.crs = crs;
+
+ this.coverageName = coverageName;
+
+ if (domain != null) {
+ if (domain.size() != cellDomain.size()) {
+ throw new InvalidMetadataException("Domain and cell domain "
+ + "must have equal number of elements for coverage " + coverageName);
+ }
+
+ this.domain = new ArrayList<DomainElement>(domain.size());
+ Iterator<DomainElement> i = domain.iterator();
+ Iterator<CellDomainElement> ci = cellDomain.iterator();
+
+ while (i.hasNext() && ci.hasNext()) {
+ DomainElement next = i.next();
+ CellDomainElement cell = ci.next();
+ Iterator<DomainElement> j = this.domain.iterator();
+ if (next.getType().equals("x")) {
+ cellX = cell;
+ }
+ if (next.getType().equals("y")) {
+ cellY = cell;
+ }
+ if (next.getType().equals("t") // || next.getType().equals("temporal")
+ ) {
+ cellT = cell;
+ domT = next;
+ }
+
+ while (j.hasNext()) {
+ DomainElement previous = j.next();
+
+ // don't compare same objects
+ if (next == previous) {
+ continue;
+ }
+
+ if (previous.getName().equals(next.getName())) {
+ throw new InvalidMetadataException("Duplicate domain "
+ + "element name encountered for coverage " + coverageName);
+ }
+
+ if (previous.getType().equals("temporal") && next.getType().equals("temporal")) {
+ throw new InvalidMetadataException("Domain can contain"
+ + " at most one temporal axis for coverage " + coverageName);
+ }
+
+ if (previous.getType().equals("elevation") && next.getType().equals("elevation")) {
+ throw new InvalidMetadataException("Domain can contain"
+ + " at most one elevation axis for coverage " + coverageName);
+ }
+
+ if (previous.getType().equals("x") && next.getType().equals("x")) {
+ throw new InvalidMetadataException("Domain can contain"
+ + " at most one x axis for coverage " + coverageName);
+ }
+
+ if (previous.getType().equals("y") && next.getType().equals("y")) {
+ throw new InvalidMetadataException("Domain can contain"
+ + " at most one y axis for coverage " + coverageName);
+ }
+
+ if (next.getType().equals("x")) {
+ boolean l = false;
+ Iterator<DomainElement> k = domain.iterator();
+
+ while (k.hasNext()) {
+ if (k.next().getType().equals("y")) {
+ l = true;
+ }
+ }
+
+ if (l == false) {
+ throw new InvalidMetadataException("If domain "
+ + "contains a x axis, it must contain a y "
+ + "axis as well for coverage " + coverageName);
+ }
+ } else if (next.getType().equals("y")) {
+ boolean l = false;
+ Iterator<DomainElement> k = domain.iterator();
+
+ while (k.hasNext()) {
+ if (k.next().getType().equals("x")) {
+ l = true;
+ }
+ }
+
+ if (l == false) {
+ throw new InvalidMetadataException("If domain "
+ + "contains a y axis, it must contain a x "
+ + "axis as well for coverage " + coverageName);
+ }
+ }
+ }
+
+ this.domain.add(next);
+ }
+ }
+
+ }
+
+ @Override
+ public Metadata clone() {
+ try {
+ List<CellDomainElement> cd = new ArrayList<CellDomainElement>(cellDomain.size());
+ Iterator<CellDomainElement> i = cellDomain.iterator();
+
+ while (i.hasNext()) {
+ cd.add(i.next().clone());
+ }
+
+ List<RangeElement> r = new ArrayList<RangeElement>(range.size());
+ Iterator<RangeElement> j = range.iterator();
+
+ while (j.hasNext()) {
+ r.add(j.next().clone());
+ }
+
+ List<DomainElement> d = new ArrayList<DomainElement>(domain.size());
+ Iterator<DomainElement> k = domain.iterator();
+
+ while (k.hasNext()) {
+ d.add(k.next().clone());
+ }
+
+ Set<String> ns = new HashSet<String>(nullSet.size());
+ Iterator<String> l = nullSet.iterator();
+
+ while (l.hasNext()) {
+ ns.add(new String(l.next()));
+ }
+
+ Set<InterpolationMethod> is = new HashSet<InterpolationMethod>(interpolationSet.size());
+ Iterator<InterpolationMethod> m = interpolationSet.iterator();
+
+ while (m.hasNext()) {
+ is.add(m.next().clone());
+ }
+
+ return new Metadata(cd, r, ns, new String(nullDefault), is, interpolationDefault.clone(), new String(coverageName), d, crs, getAbstract(), getTitle(), getKeywords());
+ } catch (InvalidMetadataException ime) {
+ throw new RuntimeException("Invalid metadata while cloning "
+ + "Metadata. This is a software bug in WCPS.", ime);
+ }
+
+ }
+
+// public CellDomainElement getCellDomain( int index ) {
+//
+// return cellDomain.get( index );
+//
+// }
+ protected void setCoverageId(int id) {
+ this.coverageId = id;
+ }
+
+ public int getCoverageId() {
+ return coverageId;
+ }
+
+ public String getCoverageName() {
+ return coverageName;
+ }
+
+ public String getAbstract() {
+ return abstractStr;
+ }
+
+ public String getTitle() {
+ return titleStr;
+ }
+
+ public String getKeywords() {
+ return keywordsStr;
+ }
+
+ public Iterator<CellDomainElement> getCellDomainIterator() {
+ return cellDomain.iterator();
+
+ }
+
+ public Iterator<DomainElement> getDomainIterator() {
+ return domain.iterator();
+ }
+
+ public Iterator<RangeElement> getRangeIterator() {
+ return range.iterator();
+ }
+
+ public Iterator<InterpolationMethod> getInterpolationMethodIterator() {
+ return interpolationSet.iterator();
+ }
+
+// public Iterator<CrsName> getCrsSetIterator()
+// {
+// return crsset.iterator();
+// }
+ public Iterator<String> getNullSetIterator() {
+ return nullSet.iterator();
+ }
+
+ public int getDimension() {
+ return cellDomain.size();
+ }
+
+ public int getDomainIndexByName(String name) {
+ Iterator<DomainElement> i = domain.iterator();
+
+ for (int index = 0; i.hasNext(); index++) {
+ if (i.next().getName().equals(name)) {
+ return index;
+ }
+ }
+
+ return -1;
+ }
+
+ public DomainElement getDomainByName(String name) {
+ Iterator<DomainElement> i = domain.iterator();
+
+ for (int index = 0; i.hasNext(); index++) {
+ DomainElement dom = i.next();
+ if (dom.getName().equals(name)) {
+ return dom;
+ }
+ }
+
+ return null;
+ }
+
+ public String getNullDefault() {
+ return nullDefault;
+
+ }
+
+ public Set<String> getNullSet() {
+ return nullSet;
+
+ }
+
+ public boolean isRangeBoolean() {
+ Iterator<RangeElement> i = range.iterator();
+
+ while (i.hasNext()) {
+ if (!i.next().isBoolean()) {
+ return false;
+ }
+ }
+
+ return true;
+
+ }
+
+ public boolean isRangeComplex() {
+ Iterator<RangeElement> i = range.iterator();
+
+ while (i.hasNext()) {
+ if (!i.next().isComplex()) {
+ return false;
+ }
+ }
+
+ return true;
+
+ }
+
+ public boolean isRangeIntegral() {
+ Iterator<RangeElement> i = range.iterator();
+
+ while (i.hasNext()) {
+ if (!i.next().isIntegral()) {
+ return false;
+ }
+ }
+
+ return true;
+
+ }
+
+ public boolean isRangeFloating() {
+ Iterator<RangeElement> i = range.iterator();
+
+ while (i.hasNext()) {
+ if (!i.next().isFloating()) {
+ return false;
+ }
+ }
+
+ return true;
+
+ }
+
+ public boolean isRangeNumeric() {
+ Iterator<RangeElement> i = range.iterator();
+
+ while (i.hasNext()) {
+ if (!i.next().isNumeric()) {
+ return false;
+ }
+ }
+
+ return true;
+
+ }
+
+ public void setCoverageName(String coverageName) throws InvalidMetadataException {
+ if (coverageName == null) {
+ throw new InvalidMetadataException("Metadata transformation: Coverage name cannot be null");
+ }
+
+ this.coverageName = coverageName;
+
+ }
+
+// public void setCrs( String crs ) throws InvalidMetadataException {
+//
+// if( crs == null ) {
+// throw new InvalidMetadataException( "Metadata transformation: CRS cannot be null" );
+// }
+// if( !(crs.equals( "" ) || crs.startsWith( "urn:ogc:def:crs:EPSG::" )) ) {
+// throw new InvalidMetadataException( "Metadata transformation: Invalid CRS" );
+// }
+// this.crs = crs;
+//
+// }
+// public void setInterpolationMethodList( List<String> interpolationMethodList ) throws InvalidMetadataException {
+//
+// this.interpolationMethodList = interpolationMethodList;
+// Iterator<String> is = interpolationMethodList.iterator();
+// while( is.hasNext() ) {
+// String next = is.next();
+// if( !(next.equals( "nearest neighbor" ) || next.equals( "bilinear" ) || next.equals( "bicubic" ) || next.equals( "lost area" ) || next.equals( "barycentric" )) ) {
+// throw new InvalidMetadataException( "Metadata transformation: Invalid interpolation method" );
+// }
+// }
+//
+// }
+// public void setNullValue( String nullValue ) {
+//
+// this.nullValue = nullValue;
+//
+// }
+ public void setRangeType(String type) throws InvalidMetadataException {
+ Iterator<RangeElement> i = range.iterator();
+
+ while (i.hasNext()) {
+ i.next().setType(type);
+ }
+
+ }
+
+// public void setRangeType( List<String> types ) throws InvalidMetadataException {
+//
+// if( types.size() != range.size() ) {
+// throw new InvalidMetadataException( "Invalid range type: New type has " + types.size() + " elements, but range has " + range.size() + " elements" );
+// }
+// Iterator<RangeElement> i = range.iterator();
+// Iterator<String> j = types.iterator();
+// while( i.hasNext() ) {
+// i.next().setType( j.next() );
+// }
+//
+// }
+// public void updateCellDomain( int index, BigInteger lo, BigInteger hi ) throws InvalidMetadataException {
+//
+// cellDomain.set( index, new CellDomainElement( lo, hi ) );
+//
+// }
+// public void updateDomain( int index, Double numLo, Double numHi, String strLo, String strHi ) throws InvalidMetadataException {
+//
+// DomainElement old = domain.get( index );
+// domain.set( index, new DomainElement( old.getName(), old.getType(), numLo, numHi, strLo, strHi ) );
+//
+// }
+ public void updateNulls(Set<String> nullSet, String nullDefault) throws InvalidMetadataException {
+ if (nullSet.size() == 0) {
+ throw new InvalidMetadataException("Invalid null set: At least one null value is required");
+ }
+
+ if (nullDefault == null) {
+ nullDefault = "0";
+ }
+
+ if (!nullSet.contains(nullDefault)) {
+ throw new InvalidMetadataException("Invalid null default: Default null value " + nullDefault + " is not part of the null set");
+ }
+
+ this.nullSet = nullSet;
+ this.nullDefault = nullDefault;
+
+ }
+
+ public String getInterpolationDefault() {
+ return interpolationDefault.getInterpolationType();
+ }
+
+ public String getNullResistanceDefault() {
+ return interpolationDefault.getNullResistance();
+ }
+
+ public Wgs84Crs getCrs() {
+ return crs;
+ }
+
+ /**
+ * @return the X if it exists
+ */
+ public CellDomainElement getXCellDomain() {
+ return cellX;
+ }
+
+ /**
+ * @return the Y if it exists
+ */
+ public CellDomainElement getYCellDomain() {
+ return cellY;
+ }
+
+ /**
+ * @return the T if it exists
+ */
+ public CellDomainElement getTCellDomain() {
+ return cellT;
+ }
+
+ /**
+ * @param titleStr the titleStr to set
+ */
+ public void setTitle(String titleStr) {
+ this.titleStr = titleStr;
+ }
+
+ /**
+ * @param abstractStr the abstractStr to set
+ */
+ public void setAbstract(String abstractStr) {
+ this.abstractStr = abstractStr;
+ }
+
+ /**
+ * @param keywordsStr the keywordsStr to set
+ */
+ public void setKeywords(String keywordsStr) {
+ this.keywordsStr = keywordsStr;
+ }
+
+ /**
+ * @param cellDomain the cellDomain to set
+ */
+ public void setCellDomain(List<CellDomainElement> cellDomain) {
+ this.cellDomain = cellDomain;
+ }
+
+ /**
+ * @param domain the domain to set
+ */
+ public void setDomain(List<DomainElement> domain) {
+ this.domain = domain;
+ }
+
+ /**
+ * @param range the range to set
+ */
+ public void setRange(List<RangeElement> range) {
+ this.range = range;
+ }
+
+ /**
+ * @param interpolationSet the interpolationSet to set
+ */
+ public void setInterpolationSet(Set<InterpolationMethod> interpolationSet) {
+ this.interpolationSet = interpolationSet;
+ }
+
+ /**
+ * @param interpolationDefault the interpolationDefault to set
+ */
+ public void setDefaultInterpolation(InterpolationMethod interpolationDefault) {
+ this.interpolationDefault = interpolationDefault;
+ }
+
+ /**
+ * Returns the maximal time position of the current coverage in ISO 8601 format, as string.
+ * If there is no time-axis, returns null
+ */
+ public String getTimePeriodBeginning() {
+ if (domT == null) {
+ return null;
+ }
+ return domT.getStrLo();
+ }
+
+ /**
+ * Returns the minimal time position of the current coverage in ISO 8601 format, as string.
+ * If there is no time-axis, returns null
+ */
+ public String getTimePeriodEnd() {
+ if (domT == null) {
+ return null;
+ }
+ return domT.getStrHi();
+ }
+
+ /**
+ * Returns the time span of the current coverage, as described in the metadata (in miliseconds).
+ * If there is no metadata, returns -1.
+ * Note that this function returns the absolute difference. It is the administrator's
+ * responsibility to make sure that the metadata values are correct.
+ */
+ public long getTimeSpan() {
+ if (domT == null) {
+ return -1;
+ }
+ long result = TimeString.difference(getTimePeriodEnd(), getTimePeriodBeginning());
+ return Math.abs(result);
+ }
+
+ /* Returns the difference between the maximum and the minimum time axis index.
+ Returns -1 if there is no metadata. */
+ public long getTimeIndexesSpan() {
+ if (cellT == null) {
+ return -1;
+ }
+ BigInteger big = cellT.getHi().subtract(cellT.getLo());
+ return big.longValue();
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/MetadataScalarExpr.java b/petascope/src/petascope/wcps/server/core/MetadataScalarExpr.java
new file mode 100644
index 0000000..233242d
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/MetadataScalarExpr.java
@@ -0,0 +1,37 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+// TODO: implement class MetadataScalarExprType
+public class MetadataScalarExpr implements IRasNode {
+
+ public MetadataScalarExpr(Node node, XmlQuery xq) throws WCPSException {
+ throw new WCPSException("Method not yet implemented !");
+ }
+
+ public String toRasQL() {
+ return "";
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/NumericScalarExpr.java b/petascope/src/petascope/wcps/server/core/NumericScalarExpr.java
new file mode 100644
index 0000000..30ef3da
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/NumericScalarExpr.java
@@ -0,0 +1,173 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+public class NumericScalarExpr implements IRasNode {
+
+ private IRasNode first, second;
+ private String op, value;
+ private boolean twoChildren;
+ private double dvalue;
+
+ public NumericScalarExpr(Node node, XmlQuery xq) throws WCPSException, InvalidCrsException {
+ twoChildren = false;
+ String nodeName = node.getNodeName();
+
+ op = "";
+
+ System.err.println("Trying to parse numeric scalar expression ...");
+
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ if (nodeName.equals("numericConstant")) {
+ twoChildren = false;
+ op = code(nodeName);
+ value = node.getFirstChild().getNodeValue();
+ try {
+ dvalue = Double.parseDouble(value);
+ } catch (NumberFormatException e) {
+ throw new WCPSException("Could not understand constant: " + value);
+ }
+ } else if (nodeName.equals("complexConstant")
+ || nodeName.equals("condense")
+ || nodeName.equals("reduce")) {
+ op = code(nodeName);
+ twoChildren = false;
+ if (nodeName.equals("complexConstant")) {
+ first = new ComplexConstant(node, xq);
+ }
+ if (nodeName.equals("condense")) {
+ first = new CondenseScalarExpr(node, xq);
+ }
+ if (nodeName.equals("reduce")) {
+ first = new ReduceScalarExpr(node, xq);
+ }
+ } else if (nodeName.equals("numericUnaryMinus")
+ || nodeName.equals("numericSqrt")
+ || nodeName.equals("numericAbs")) {
+ op = code(nodeName);
+ twoChildren = false;
+ first = new NumericScalarExpr(node.getFirstChild(), xq);
+ } else if (nodeName.equals("numericAdd")
+ || nodeName.equals("numericMinus")
+ || nodeName.equals("numericMult")
+ || nodeName.equals("numericDiv")) {
+ try {
+ op = code(nodeName);
+ twoChildren = true;
+ Node child = node.getFirstChild();
+ first = new NumericScalarExpr(child, xq);
+ second = new NumericScalarExpr(child.getNextSibling(), xq);
+ } catch (WCPSException e) {
+ System.err.println("Failed to parse a numeric expression pair !");
+ }
+ } else if (nodeName.equals("variableRef")) {
+ try {
+ op = code(nodeName);
+ twoChildren = false;
+ first = new VariableReference(node, xq);
+ System.err.println("Matched variable reference: " + first.toRasQL());
+ } catch (WCPSException e) {
+ System.err.println("Failed to match variable reference: "
+ + e.toString());
+ }
+ } else {
+ throw new WCPSException("Unexpected Numeric Scalar Expression node : "
+ + node.getNodeName());
+ }
+ }
+
+ public String toRasQL() {
+ String result = "";
+ if (twoChildren == false)
+ {
+ if (op.equals("variable")) {
+ result = first.toRasQL();
+ } else if (op.equals("value")) {
+ result = value;
+ } else if (op.equals("-")) {
+ result = "-" + first.toRasQL();
+ } else if (op.equals("sqrt")) {
+ result = "sqrt(" + first.toRasQL() + ")";
+ } else if (op.equals("child")) {
+ result = first.toRasQL();
+ } else if (op.equals("abs")) {
+ result = "abs(" + first.toRasQL() + ")";
+ }
+ }else if (twoChildren == true) {
+ result = "(" + first.toRasQL() + ")" + op
+ + "(" + second.toRasQL() + ")";
+ } else {
+ return " error ";
+ }
+
+ return result;
+ }
+
+ private String code(String name) {
+ String op = "";
+ if (name.equals("numericConstant")) {
+ op = "value";
+ }
+ if (name.equals("numericUnaryMinus") || name.equals("numericMinus")) {
+ op = "-";
+ }
+ if (name.equals("numericAdd")) {
+ op = "+";
+ }
+ if (name.equals("numericMult")) {
+ op = "*";
+ }
+ if (name.equals("numericDiv")) {
+ op = "/";
+ }
+ if (name.equals("numericSqrt")) {
+ op = "sqrt";
+ }
+ if (name.equals("numericAbs")) {
+ op = "abs";
+ }
+ if (name.equals("condense") || name.equals("reduce")
+ || name.equals("complexConstant")) {
+ op = "child";
+ }
+ if (name.equals("variableRef")) {
+ op = "variable";
+ }
+
+ return op;
+ }
+
+ public boolean isSingleValue() {
+ return op.equals("value");
+ }
+
+ public double getSingleValue() {
+ return dvalue;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/ProcessCoveragesRequest.java b/petascope/src/petascope/wcps/server/core/ProcessCoveragesRequest.java
new file mode 100644
index 0000000..36840cc
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/ProcessCoveragesRequest.java
@@ -0,0 +1,252 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.ResourceException;
+import petascope.wcps.server.exceptions.WCPSException;
+import petascope.wcps.server.exceptions.InvalidWcpsRequestException;
+import petascope.wcps.grammar.WCPSRequest;
+import petascope.wcps.grammar.wcpsLexer;
+import petascope.wcps.grammar.wcpsParser;
+import petascope.wcps.grammar.wcpsParser.wcpsRequest_return;
+import java.io.IOException;
+import java.io.StringReader;
+import org.antlr.runtime.RecognitionException;
+import org.odmg.DBag;
+import org.odmg.Database;
+import org.odmg.Implementation;
+import org.odmg.ODMGException;
+import org.odmg.OQLQuery;
+import org.odmg.QueryException;
+import org.odmg.Transaction;
+
+import org.w3c.dom.*;
+
+import org.xml.sax.SAXException;
+import rasj.RasGMArray;
+import rasj.RasImplementation;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import org.antlr.runtime.ANTLRStringStream;
+import org.antlr.runtime.CharStream;
+import org.antlr.runtime.CommonTokenStream;
+import org.xml.sax.InputSource;
+
+/** A WCPS ProcessCoveragesRequest request provides a (just one) rasdaman query, that it executes.
+ *
+ * Internally, it relies on XmlRequest, which computes the RasQL query.
+ *
+ */
+public class ProcessCoveragesRequest {
+
+ private String database;
+ private IDynamicMetadataSource source;
+ private String url;
+ private WCPS wcps;
+ private String rasqlQuery;
+ private String mime;
+ private XmlQuery xmlQuery;
+
+ public ProcessCoveragesRequest(String url, String database, Node node, IDynamicMetadataSource source, WCPS wcps)
+ throws WCPSException, InvalidWcpsRequestException, ResourceException, SAXException, IOException, InvalidCrsException {
+ super();
+ this.source = source;
+ this.url = url;
+ this.database = database;
+ this.wcps = wcps;
+ Node child = node.getFirstChild();
+ this.rasqlQuery = null;
+
+ System.err.println("Parsing ProcessCoveragesRequest node: " + child.getNodeName());
+
+ if (child.getNodeName().equals("ProcessCoveragesRequest") == false) {
+ throw new WCPSException("The document contains an unrecognized node : "
+ + child.getNodeName());
+ }
+
+ child = child.getFirstChild();
+ while (child.getNodeName().equals("#text")) {
+ child = child.getNextSibling();
+ }
+
+ if (child.getNodeName().equals("query") == false) {
+ throw new WCPSException("Could not find node <query>: " + child.getNodeName());
+ }
+
+ // "child" is now the node <query>.
+ Node queryNode = child.getFirstChild();
+ while (queryNode.getNodeName().equals("#text")) {
+ queryNode = queryNode.getNextSibling();
+ }
+
+ /**
+ * The following code is essential. It handles the two cases:
+ * 1) the xml contains an <xmlSyntax> request
+ * 2) the xml contains an <abstractSyntax> request
+ */
+ if (queryNode.getNodeName().equals("xmlSyntax")) {
+ System.err.println("Found XML Syntax query");
+ this.xmlQuery = new XmlQuery(this.source);
+ xmlQuery.startParsing(queryNode);
+ } else if (queryNode.getNodeName().equals("abstractSyntax")) {
+ try {
+ String abstractQuery = queryNode.getFirstChild().getNodeValue();
+ System.err.println("Found Abstract Syntax query: " + abstractQuery);
+ String xmlString = abstractQueryToXmlQuery(abstractQuery);
+ InputSource xmlStringSource = new InputSource(new StringReader(xmlString));
+ System.err.println("Coverted the Abstract syntax query to an XML query:");
+ System.err.println("***********************************************");
+ System.err.println(xmlString);
+ System.err.println("***********************************************");
+ ProcessCoveragesRequest newRequest = wcps.pcPrepare(url, database, xmlStringSource);
+ this.xmlQuery = newRequest.getXmlRequestStructure();
+ } catch (RecognitionException e) {
+ throw new WCPSException("Abstract Syntax query is invalid: "
+ + e.getMessage());
+ }
+ } else {
+ throw new WCPSException("Error ! Unexpected node: " + queryNode.getNodeName());
+ }
+
+ // If everything went well, we now have a proper value for "xmlQuery"
+ this.rasqlQuery = xmlQuery.toRasQL();
+ System.err.println("Final RasQL query: " + rasqlQuery);
+ this.mime = xmlQuery.getMimeType();
+ }
+
+ public static String abstractQueryToXmlQuery(String abstractQuery) throws RecognitionException {
+ CharStream cs = new ANTLRStringStream(abstractQuery);
+ wcpsLexer lexer = new wcpsLexer(cs);
+ CommonTokenStream tokens = new CommonTokenStream();
+ tokens.setTokenSource(lexer);
+ wcpsParser parser = new wcpsParser(tokens);
+ wcpsRequest_return rrequest = parser.wcpsRequest();
+ WCPSRequest request = rrequest.value;
+ String xmlRequest = request.toXML();
+
+ return xmlRequest;
+ }
+
+ public String getMime() {
+ return mime;
+ }
+
+ private XmlQuery getXmlRequestStructure() {
+ return xmlQuery;
+ }
+
+ public String getRasqlQuery() {
+ return this.rasqlQuery;
+ }
+
+ public List<byte[]> execute() throws ResourceException {
+ ArrayList<byte[]> results = new ArrayList<byte[]>();
+
+ if (this.rasqlQuery != null) {
+ Implementation impl = new RasImplementation(url);
+ Database db = impl.newDatabase();
+
+ try {
+ db.open(database, Database.OPEN_READ_ONLY);
+ } catch (ODMGException odmge) {
+ try {
+ db.close();
+ } catch (ODMGException e) {
+ }
+
+ throw new ResourceException("Could not connect to rasdaman at "
+ + url + ", database "
+ + database, odmge);
+ }
+
+ Transaction tr = impl.newTransaction();
+
+ tr.begin();
+ OQLQuery q = impl.newOQLQuery();
+ DBag resultSet;
+
+ try {
+ q.create(this.getRasqlQuery());
+ resultSet = (DBag) q.execute();
+
+ if (resultSet != null) {
+ Iterator resultIterator = resultSet.iterator();
+
+ while (resultIterator.hasNext()) {
+ Object current = resultIterator.next();
+
+ try {
+ RasGMArray resultArray =
+ (RasGMArray) current;
+
+ results.add(resultArray.getArray());
+ } catch (ClassCastException e) { // not a RasGMarray
+ if (!mime.equals("text/plain")) {
+ throw new ResourceException(
+ "Incompatible mime and data type!");
+ }
+
+ System.err.println("result="
+ + current.toString());
+ results.add(current.toString().getBytes());
+
+ }
+
+
+ /*
+ * if (mime.equals("text/plain")) {
+ * System.err.println("dataType is :" + resultArray.getBaseTypeSchema().toString());
+ * }
+ */
+
+ }
+ }
+ } catch (QueryException qe) {
+ tr.commit();
+
+ try {
+ db.close();
+ } catch (ODMGException odmge) {
+ }
+
+ throw new ResourceException("Could not evaluate rasdaman query: '"
+ + getRasqlQuery() + "'. Cause: " + qe.getMessage(), qe);
+ }
+
+ tr.commit();
+
+ try {
+ db.close();
+ } catch (ODMGException odmge) {
+ }
+ }
+
+ if (mime.equals("text/plain")) {
+ }
+
+ return results;
+
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/RangeComponent.java b/petascope/src/petascope/wcps/server/core/RangeComponent.java
new file mode 100644
index 0000000..c94698c
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/RangeComponent.java
@@ -0,0 +1,87 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+import petascope.wcps.server.exceptions.InvalidCrsException;
+
+
+/**
+ * This is a component of a RangeStructure.
+ * @author Andrei Aiordachioaie
+ */
+public class RangeComponent implements IRasNode, ICoverageInfo {
+
+ private String field = null;
+ private CoverageInfo info = null;
+ private CoverageExpr expr = null;
+
+ public RangeComponent(Node node, XmlQuery xq)
+ throws WCPSException {
+
+ String nodeName = node.getNodeName();
+ if (nodeName.equals("component"))
+ node = node.getFirstChild();
+
+ while (node != null)
+ {
+ nodeName = node.getNodeName();
+ if (nodeName.equals("#text"))
+ {
+ node = node.getNextSibling();
+ continue;
+ }
+
+ if (nodeName.equals("field"))
+ this.field = node.getTextContent();
+ else
+ try
+ {
+ this.expr = new CoverageExpr(node, xq);
+ this.info = expr.getCoverageInfo();
+ }
+ catch (InvalidCrsException e2)
+ {}
+ catch (WCPSException e)
+ {
+ System.err.println("Could not match CoverageExpr inside RangeExpr. Next node: " + nodeName);
+ throw e;
+ }
+
+ node = node.getNextSibling();
+ }
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return info;
+ }
+
+ public String toRasQL() {
+ String result = "";
+
+ if (this.expr != null)
+ result = expr.toRasQL();
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/RangeCoverageExpr.java b/petascope/src/petascope/wcps/server/core/RangeCoverageExpr.java
new file mode 100644
index 0000000..2be4d61
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/RangeCoverageExpr.java
@@ -0,0 +1,83 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.WCPSException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import org.w3c.dom.*;
+
+public class RangeCoverageExpr implements IRasNode, ICoverageInfo {
+
+ private IRasNode child;
+ private CoverageInfo info = null;
+ List<IRasNode> components;
+
+ public RangeCoverageExpr(Node node, XmlQuery xq)
+ throws WCPSException {
+
+ components = new ArrayList<IRasNode>();
+
+ if (node.getNodeName().equals("rangeConstructor"))
+ node = node.getFirstChild();
+
+ if (node.getNodeName().equals("#text"))
+ node = node.getNextSibling();
+
+ String nodeName = node.getNodeName();
+ System.err.println("Trying to parse a range coverage expression... Starting at node "
+ + nodeName);
+
+ while (node != null) {
+ if (node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ continue;
+ }
+ if (node.getNodeName().equals("component")) {
+ RangeComponent elem = new RangeComponent(node, xq);
+ info = elem.getCoverageInfo();
+ components.add(elem);
+ }
+
+ node = node.getNextSibling();
+ }
+
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ // FIXME: Returns currently only the info for the last range component
+ return info;
+ }
+
+ public String toRasQL() {
+ String result = "";
+ int length = components.size();
+ for (int i = 0; i < length - 1; i++)
+ result += components.get(i).toRasQL() + ",";
+ result += components.get(length - 1).toRasQL();
+
+ result = "{ " + result + " }";
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/RangeElement.java b/petascope/src/petascope/wcps/server/core/RangeElement.java
new file mode 100644
index 0000000..29df3b6
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/RangeElement.java
@@ -0,0 +1,163 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+//A single component of a coverage's range. See the WCPS standard for more information.
+import petascope.wcps.server.exceptions.InvalidMetadataException;
+
+public class RangeElement implements Cloneable {
+
+ private String name;
+ private String type;
+
+ public RangeElement(String name, String type) throws InvalidMetadataException {
+ if ((name == null) || (type == null)) {
+ throw new InvalidMetadataException(
+ "Invalid range element: Element name and type cannot be null");
+ }
+
+ if (name.equals("")) {
+ throw new InvalidMetadataException(
+ "Invalid range element: Element name cannot be empty");
+ }
+
+ if (!(type.equals("boolean") || type.equals("char") || type.equals("unsigned char")
+ || type.equals("short") || type.equals("unsigned short") || type.equals("int")
+ || type.equals("unsigned int") || type.equals("long")
+ || type.equals("unsigned long") || type.equals("float")
+ || type.equals("double") || type.equals("complex") || type.equals("complex2"))) {
+ throw new InvalidMetadataException(
+ "Invalid range element: Invalid element type:" + type);
+ }
+
+ this.name = name;
+ this.type = type;
+
+ }
+
+ public RangeElement clone() {
+ try {
+ return new RangeElement(new String(name), new String(type));
+ } catch (InvalidMetadataException ime) {
+ throw new RuntimeException(
+ "Invalid metadata while cloning RangeElement. This is a software bug in WCPS.",
+ ime);
+ }
+
+ }
+
+ public boolean equals(RangeElement re) {
+ return name.equals(re.type);
+
+ }
+
+ public String getName() {
+ return name;
+
+ }
+
+ public String getType() {
+ return type;
+
+ }
+
+ public boolean isBoolean() {
+ return type.equals("boolean");
+
+ }
+
+ public static boolean isBoolean(String type) {
+ return type.equals("boolean");
+
+ }
+
+ public boolean isComplex() {
+ return type.equals("complex") || type.equals("complex2");
+
+ }
+
+ public static boolean isComplex(String type) {
+ return type.equals("complex") || type.equals("complex2");
+
+ }
+
+ public boolean isIntegral() {
+ return type.equals("char") || type.equals("short") || type.equals("unsigned short")
+ || type.equals("int") || type.equals("unsigned int") || type.equals("long")
+ || type.equals("unsigend long");
+
+ }
+
+ public static boolean isIntegral(String type) {
+ return type.equals("char") || type.equals("short") || type.equals("unsigned short")
+ || type.equals("int") || type.equals("unsigned int") || type.equals("long")
+ || type.equals("unsigend long");
+
+ }
+
+ public boolean isFloating() {
+ return type.equals("float") || type.equals("double");
+
+ }
+
+ public static boolean isFloating(String type) {
+ return type.equals("float") || type.equals("double");
+
+ }
+
+ public boolean isNumeric() {
+ return type.equals("char") || type.equals("short") || type.equals("unsigned short")
+ || type.equals("int") || type.equals("unsigned int") || type.equals("long")
+ || type.equals("unsigend long") || type.equals("float")
+ || type.equals("double") || type.equals("complex")
+ || type.equals("complex2");
+
+ }
+
+ public static boolean isNumeric(String type) {
+ return type.equals("char") || type.equals("short") || type.equals("unsigned short")
+ || type.equals("int") || type.equals("unsigned int") || type.equals("long")
+ || type.equals("unsigend long") || type.equals("float")
+ || type.equals("double") || type.equals("complex")
+ || type.equals("complex2");
+
+ }
+
+ public void setType(String type) throws InvalidMetadataException {
+ if (!(type.equals("boolean") || type.equals("char") || type.equals("unsigned char")
+ || type.equals("short") || type.equals("unsigned short") || type.equals("int")
+ || type.equals("unsigned int") || type.equals("long")
+ || type.equals("unsigned long") || type.equals("float")
+ || type.equals("double") || type.equals("complex") || type.equals("complex2"))) {
+ throw new InvalidMetadataException(
+ "Invalid range element: Invalid element type:" + type);
+ }
+
+ this.type = type;
+
+ }
+
+ public String toString() {
+ String r = "Range Element { Name '" + name + "', Type '" + type + "'}";
+ return r;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/RangeField.java b/petascope/src/petascope/wcps/server/core/RangeField.java
new file mode 100644
index 0000000..9256661
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/RangeField.java
@@ -0,0 +1,54 @@
+ /*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+import java.util.Iterator;
+
+public class RangeField implements IRasNode {
+
+ private String type;
+
+ public RangeField(Node node, XmlQuery xq) throws WCPSException {
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ if (node == null) {
+ throw new WCPSException("RangeFieldType parsing error!");
+ }
+
+ String nodeName = node.getNodeName();
+
+ if (nodeName.equals("type")) {
+ this.type = node.getTextContent();
+
+ System.err.println("Found range field type: " + type);
+ }
+ }
+
+ public String toRasQL() {
+ return this.type;
+ }
+};
diff --git a/petascope/src/petascope/wcps/server/core/ReduceScalarExpr.java b/petascope/src/petascope/wcps/server/core/ReduceScalarExpr.java
new file mode 100644
index 0000000..d7e343c
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/ReduceScalarExpr.java
@@ -0,0 +1,68 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+public class ReduceScalarExpr implements IRasNode {
+
+ CoverageExpr expr;
+ String op;
+
+ public ReduceScalarExpr(Node node, XmlQuery xq) throws WCPSException, InvalidCrsException {
+ if (node.getNodeName().equals("reduce")) {
+ node = node.getFirstChild();
+ }
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ System.err.println("Trying to parse ReduceScalarExpr ");
+ String nodeName = node.getNodeName();
+
+ if (nodeName.equals("all") || nodeName.equals("some") || nodeName.equals("count")
+ || nodeName.equals("add") || nodeName.equals("avg") || nodeName.equals("min")
+ || nodeName.equals("max")) {
+ op = nodeName;
+
+ if (!op.equals("all") && !op.equals("some")) {
+ op = op + "_cells";
+ }
+
+ node = node.getFirstChild();
+
+ while ((node != null) && (node.getNodeName().equals("#text"))) {
+ node = node.getNextSibling();
+ }
+
+ expr = new CoverageExpr(node, xq);
+ } else {
+ throw new WCPSException("invalid ReduceScalarExprType node : " + nodeName);
+ }
+ }
+
+ public String toRasQL() {
+ return op + "(" + expr.toRasQL() + ")";
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/SDU.java b/petascope/src/petascope/wcps/server/core/SDU.java
new file mode 100644
index 0000000..e69ecb2
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/SDU.java
@@ -0,0 +1,191 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+//~--- non-JDK imports --------------------------------------------------------
+import org.apache.commons.math.complex.Complex;
+
+//~--- JDK imports ------------------------------------------------------------
+
+import java.math.BigInteger;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * This is a static utility class, which provides encoding and decoding of various datatypes
+ * from/to strings. It also handles packing and unpacking of structures.
+ */
+public class SDU {
+
+ public static String boolean2str(List<Boolean> boolea) {
+ List<String> strings = new ArrayList<String>(boolea.size());
+ Iterator<Boolean> i = boolea.iterator();
+
+ while (i.hasNext()) {
+ strings.add(i.next().toString());
+ }
+
+ return string2str(strings);
+
+ }
+
+ public static String complex2str(List<Complex> complex) {
+ List<String> strings = new ArrayList<String>(complex.size());
+ Iterator<Complex> i = complex.iterator();
+
+ while (i.hasNext()) {
+ Complex c = i.next();
+
+ strings.add(c.getReal() + "#" + c.getImaginary());
+ }
+
+ return string2str(strings);
+
+ }
+
+ public static String double2str(List<Double> doubl) {
+ List<String> strings = new ArrayList<String>(doubl.size());
+ Iterator<Double> i = doubl.iterator();
+
+ while (i.hasNext()) {
+ strings.add(i.next().toString());
+ }
+
+ return string2str(strings);
+
+ }
+
+ public static String integer2str(List<BigInteger> integer) {
+ List<String> strings = new ArrayList<String>(integer.size());
+ Iterator<BigInteger> i = integer.iterator();
+
+ while (i.hasNext()) {
+ strings.add(i.next().toString());
+ }
+
+ return string2str(strings);
+
+ }
+
+ public static List<Boolean> str2boolean(String string) {
+ List<String> strings = str2string(string);
+
+ List<Boolean> booleans = new ArrayList<Boolean>(strings.size());
+ Iterator<String> i = strings.iterator();
+
+ while (i.hasNext()) {
+ booleans.add(new Boolean(i.next().equals("true")));
+ }
+
+ return booleans;
+
+ }
+
+ public static List<Complex> str2complex(String string) {
+ List<String> strings = str2string(string);
+
+ List<Complex> complexes = new ArrayList<Complex>(strings.size());
+ Iterator<String> i = strings.iterator();
+
+ while (i.hasNext()) {
+ String[] complex = i.next().split("#");
+
+ complexes.add(new Complex(new Double(complex[0]), new Double(complex[1])));
+ }
+
+ return complexes;
+
+ }
+
+ public static List<Double> str2double(String string) {
+ List<String> strings = str2string(string);
+
+ List<Double> doubles = new ArrayList<Double>(strings.size());
+ Iterator<String> i = strings.iterator();
+
+ while (i.hasNext()) {
+ doubles.add(new Double(i.next()));
+ }
+
+ return doubles;
+
+ }
+
+ public static List<BigInteger> str2integer(String string) {
+ List<String> strings = str2string(string);
+
+ List<BigInteger> integers = new ArrayList<BigInteger>(strings.size());
+ Iterator<String> i = strings.iterator();
+
+ while (i.hasNext()) {
+ integers.add(new BigInteger(i.next()));
+ }
+
+ return integers;
+
+ }
+
+ public static List<String> str2string(String string) {
+ List<String> strings;
+
+ if (string.startsWith("{") && string.contains(",") && string.endsWith("}")) {
+ String[] components = string.substring(1, string.length() - 1).split(",");
+
+ strings = new ArrayList<String>(components.length);
+
+ for (int i = 0; i < components.length; i++) {
+ strings.add(new String(components[i]));
+ }
+
+ return strings;
+ } else {
+ strings = new ArrayList<String>(1);
+ strings.add(new String(string));
+
+ return strings;
+ }
+
+ }
+
+ public static String string2str(List<String> strin) {
+ if (strin == null) {
+ return null;
+ }
+ if (strin.size() == 0) {
+ return "";
+ }
+
+ String string = "{";
+ Iterator<String> i = strin.iterator();
+
+ while (i.hasNext()) {
+ string += i.next() + (i.hasNext()
+ ? ","
+ : "}");
+ }
+
+ return string;
+
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/ScalarExpr.java b/petascope/src/petascope/wcps/server/core/ScalarExpr.java
new file mode 100644
index 0000000..0ec20b6
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/ScalarExpr.java
@@ -0,0 +1,171 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import petascope.wcps.server.exceptions.InvalidMetadataException;
+import java.math.BigInteger;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import org.w3c.dom.*;
+
+public class ScalarExpr implements IRasNode, ICoverageInfo {
+
+ private IRasNode child;
+ private CoverageInfo info;
+ private boolean singleNumericValue = false;
+ private double dvalue;
+
+ public ScalarExpr(Node node, XmlQuery xq) throws WCPSException, InvalidCrsException {
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ // Try one of the groups
+ child = null;
+
+// TODO: Implement class MetadataScalarExprType
+// MetadataScalarExprType
+ if (child == null) {
+ try {
+ child = new MetadataScalarExpr(node, xq);
+ System.err.println("Matched metadata scalar expression.");
+ } catch (WCPSException e) {
+ System.err.println("Failed to match metadata scalar expression: "
+ + e.toString() + "\nRetrying");
+ child = null;
+ }
+ }
+
+// BooleanScalarExprType
+ if (child == null) {
+ try {
+ child = new BooleanScalarExpr(node, xq);
+ System.err.println("Matched boolean scalar expression.");
+ } catch (WCPSException e) {
+ System.err.println("Failed to match boolean scalar expression : "
+ + e.toString() + "\nRetrying");
+ child = null;
+ }
+ }
+
+// NumericScalarExprType
+ if (child == null) {
+ try {
+ child = new NumericScalarExpr(node, xq);
+ singleNumericValue = ((NumericScalarExpr) child).isSingleValue();
+ dvalue = ((NumericScalarExpr) child).getSingleValue();
+ System.err.println("Matched numeric scalar expression.");
+ } catch (WCPSException e) {
+ System.err.println("Failed to match numeric scalar expression : "
+ + e.toString() + "\nRetrying");
+ child = null;
+ }
+ }
+
+// ReduceScalarExprType
+ if (child == null) {
+ try {
+ child = new ReduceScalarExpr(node, xq);
+ System.err.println("Matched reduce scalar expression.");
+ } catch (WCPSException e) {
+ System.err.println("Failed to match reduce scalar expression: "
+ + e.toString() + "\nRetrying");
+ child = null;
+ }
+ }
+
+// StringScalarExprType
+ if (child == null) {
+ try {
+ child = new StringScalarExpr(node, xq);
+ System.err.println("Matched string scalar expression.");
+ } catch (WCPSException e) {
+ System.err.println("Failed to match string scalar expression: "
+ + e.toString() + "\nRetrying");
+ child = null;
+ }
+ }
+
+ // Error check
+ if (child == null) {
+ throw new WCPSException("Invalid coverage Expression, next node: "
+ + node.getNodeName());
+ }
+
+ Metadata meta = createScalarExprMetadata(xq);
+ info = new CoverageInfo(meta);
+ }
+
+ public String toRasQL() {
+ return child.toRasQL();
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return info;
+ }
+
+ /** Builds full metadata for the newly constructed coverage **/
+ private Metadata createScalarExprMetadata(XmlQuery xq) throws WCPSException {
+ List<CellDomainElement> cellDomainList = new LinkedList<CellDomainElement>();
+ List<RangeElement> rangeList = new LinkedList<RangeElement>();
+ HashSet<String> nullSet = new HashSet<String>();
+ String nullDefault = "0";
+ nullSet.add(nullDefault);
+ HashSet<InterpolationMethod> interpolationSet = new HashSet<InterpolationMethod>();
+ InterpolationMethod interpolationDefault = new InterpolationMethod("none", "none");
+ interpolationSet.add(interpolationDefault);
+ String coverageName = "scalarExpr";
+ List<DomainElement> domainList = new LinkedList<DomainElement>();
+
+ // Build domain metadata
+ cellDomainList.add(new CellDomainElement(new BigInteger("1"), new BigInteger("1")));
+ String crs = DomainElement.IMAGE_CRS;
+ HashSet<String> crsset = new HashSet<String>();
+ crsset.add(crs);
+ Collection<String> allowedAxes = xq.getMetadataSource().getAxisNames();
+ DomainElement domain = new DomainElement("x", "x", 1.0, 1.0, null, null, crsset, allowedAxes);
+ domainList.add(domain);
+ // "unsigned int" is default datatype
+ rangeList.add(new RangeElement("dynamic_type", "unsigned int"));
+
+ try {
+ Metadata metadata = new Metadata(cellDomainList, rangeList, nullSet,
+ nullDefault, interpolationSet, interpolationDefault,
+ coverageName, domainList, null);
+ return metadata;
+ } catch (InvalidMetadataException e) {
+ throw new WCPSException("Could not build metadata for scalar expression !", e);
+ }
+ }
+
+ public boolean isSingleValue() {
+ return singleNumericValue;
+ }
+
+ public double getSingleValue() {
+ return dvalue;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/ScaleCoverageExpr.java b/petascope/src/petascope/wcps/server/core/ScaleCoverageExpr.java
new file mode 100644
index 0000000..feb7e3f
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/ScaleCoverageExpr.java
@@ -0,0 +1,149 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+import petascope.wcps.server.exceptions.InvalidWcpsRequestException;
+
+
+public class ScaleCoverageExpr implements IRasNode, ICoverageInfo {
+
+ private List<DimensionIntervalElement> axisList;
+ private CoverageExpr coverageExprType;
+ private CoverageInfo coverageInfo;
+ private String[] dim;
+ private int dims;
+ private DimensionIntervalElement elem;
+ private FieldInterpolationElement fieldInterp;
+
+ public ScaleCoverageExpr(Node node, XmlQuery xq) throws WCPSException, InvalidCrsException
+ {
+ Node child;
+ String nodeName;
+
+ axisList = new ArrayList<DimensionIntervalElement>();
+
+ child = node.getFirstChild();
+ while (child != null) {
+ nodeName = child.getNodeName();
+
+ if (nodeName.equals("#text")) {
+ child = child.getNextSibling();
+ continue;
+ }
+
+ try {
+ System.err.println("Trying out an CoverageExprType group...");
+ coverageExprType = new CoverageExpr(child, xq);
+ coverageInfo = coverageExprType.getCoverageInfo();
+ child = child.getNextSibling();
+ continue;
+ } catch (WCPSException e) {
+ System.err.println("This was no CoverageExprType: " + nodeName);
+ }
+
+ try {
+ // Start a new axis and save it
+ elem = new DimensionIntervalElement(child, xq, coverageInfo);
+ axisList.add(elem);
+ child = elem.getNextNode();
+ continue;
+ } catch (WCPSException e) {
+ System.err.println("This was no Dimension Interval ELement: " + child.getNodeName());
+ }
+
+ try {
+ fieldInterp = new FieldInterpolationElement(child, xq);
+ child = fieldInterp.getNextNode();
+ continue;
+ }
+ catch (InvalidWcpsRequestException e2)
+ {
+ throw e2;
+ }
+ catch (WCPSException e)
+ {
+ System.err.println("This was no Field Interpolation Element: " + child.getNodeName());
+ }
+
+ // else unknown element
+ throw new WCPSException("Unknown node for ScaleCoverageExpr expression:" + child.getNodeName());
+ }
+
+ dims = coverageInfo.getNumDimensions();
+ dim = new String[dims];
+
+ for (int j = 0; j < dims; ++j) {
+ dim[j] = "*:*";
+ }
+
+
+ Iterator<DimensionIntervalElement> i = axisList.iterator();
+
+ System.out.println("Axis List count:" + axisList.size());
+ DimensionIntervalElement axis;
+ int axisId;
+ int axisLo, axisHi;
+
+ while (i.hasNext()) {
+ axis = i.next();
+ axisId = coverageInfo.getDomainIndexByName(axis.getAxisName());
+ System.out.println("Axis ID: " + axisId);
+ System.out.println("Axis name: " + axis.getAxisName());
+ System.out.print("Axis coords: ");
+
+ axisLo = Integer.parseInt(axis.getLowCoord());
+ axisHi = Integer.parseInt(axis.getHighCoord());
+ dim[axisId] = axisLo + ":" + axisHi;
+ coverageInfo.setCellDimension(
+ axisId,
+ new CellDomainElement(
+ BigInteger.valueOf(axisLo), BigInteger.valueOf(axisHi)));
+ }
+
+ }
+
+ public String toRasQL() {
+ String result = "scale( " + coverageExprType.toRasQL() + ", [";
+
+ for (int j = 0; j < dims; ++j) {
+ if (j > 0) {
+ result += ",";
+ }
+
+ result += dim[j];
+ }
+
+ result += "] )";
+ return result;
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return coverageInfo;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/SetMetadataCoverageExpr.java b/petascope/src/petascope/wcps/server/core/SetMetadataCoverageExpr.java
new file mode 100644
index 0000000..1c6bad3
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/SetMetadataCoverageExpr.java
@@ -0,0 +1,42 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+// TODO: Implement class SetMetadataCoverageExprType
+public class SetMetadataCoverageExpr implements IRasNode, ICoverageInfo {
+
+ public SetMetadataCoverageExpr(Node node, XmlQuery xq)
+ throws WCPSException {
+ throw new WCPSException("Method not implemented");
+ }
+
+ public String toRasQL() {
+ return "";
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return null;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/SliceCoverageExpr.java b/petascope/src/petascope/wcps/server/core/SliceCoverageExpr.java
new file mode 100644
index 0000000..6eeca36
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/SliceCoverageExpr.java
@@ -0,0 +1,131 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import org.w3c.dom.Node;
+
+public class SliceCoverageExpr implements IRasNode, ICoverageInfo {
+
+ private List<DimensionPointElement> axisList;
+ private CoverageExpr coverageExprType;
+ private CoverageInfo coverageInfo = null;
+ private String[] dim;
+ private DimensionPointElement elem;
+ private int dims;
+
+ public SliceCoverageExpr(Node node, XmlQuery xq) throws WCPSException, InvalidCrsException {
+ Node child = node.getFirstChild();
+ String nodeName;
+
+ axisList = new ArrayList<DimensionPointElement>();
+
+ while (child != null) {
+ nodeName = child.getNodeName();
+
+ if (nodeName.equals("#text")) {
+ child = child.getNextSibling();
+ continue;
+ }
+
+ try {
+ System.err.println("Trying out an CoverageExprType group...");
+ coverageExprType = new CoverageExpr(child, xq);
+ coverageInfo = coverageExprType.getCoverageInfo();
+ child = child.getNextSibling();
+ continue;
+ } catch (WCPSException e) {
+ System.err.println("This was no CoverageExprType: " + nodeName);
+ }
+
+ try {
+ // Start a new axis and save it
+ elem = new DimensionPointElement(child, xq);
+ axisList.add(elem);
+ child = elem.getNextNode();
+ continue;
+ } catch (WCPSException e) {
+ System.err.println("This was no Dimension Point ELement: " + child.getNodeName());
+ }
+
+ // else unknown element
+ throw new WCPSException("Unknown node for TrimCoverage expression:" + child.getNodeName());
+ }
+
+ dims = coverageInfo.getNumDimensions();
+ dim = new String[dims];
+
+ for (int j = 0; j < dims; ++j) {
+ dim[j] = "*:*";
+ }
+
+ Iterator<DimensionPointElement> i = axisList.iterator();
+ DimensionPointElement axis;
+ int axisId;
+ int slicingPosInt;
+ String slicingPosStr;
+
+ while (i.hasNext()) {
+ axis = i.next();
+ /* TODO: BUG: This searches the axis types list using name, not type */
+ axisId = coverageInfo.getDomainIndexByName(axis.getAxisName());
+ slicingPosStr = axis.getSlicingPosition();
+ dim[axisId] = slicingPosStr;
+ // Slicing position can be a constant number or a variable reference
+ try {
+ slicingPosInt = Integer.parseInt(slicingPosStr);
+ } catch (NumberFormatException e) {
+ slicingPosInt = 1;
+ }
+ coverageInfo.setCellDimension(
+ axisId,
+ new CellDomainElement(
+ BigInteger.valueOf(slicingPosInt), BigInteger.valueOf(slicingPosInt)));
+
+ }
+
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return coverageInfo;
+ }
+
+ public String toRasQL() {
+ String result = "(" + coverageExprType.toRasQL() + ") [";
+
+ for (int j = 0; j < dims; ++j) {
+ if (j > 0) {
+ result += ",";
+ }
+
+ result += dim[j];
+ }
+
+ result += "]";
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/StringScalarExpr.java b/petascope/src/petascope/wcps/server/core/StringScalarExpr.java
new file mode 100644
index 0000000..87fb23c
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/StringScalarExpr.java
@@ -0,0 +1,63 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+public class StringScalarExpr implements IRasNode {
+
+ private String op, string;
+ private CoverageExpr cov;
+
+ public StringScalarExpr(Node node, XmlQuery xq) throws WCPSException, InvalidCrsException {
+ while ((node != null) && (node.getNodeName().equals("#text"))) {
+ node = node.getNextSibling();
+ }
+
+ System.err.println("Parsing String Scalar expr : " + node.getNodeName());
+
+ if (node.getNodeName().equals("stringIdentifier")) {
+ Node child = node.getFirstChild();
+ cov = new CoverageExpr(child, xq);
+ op = "id";
+ } else if (node.getNodeName().equals("stringConstant")) {
+ op = "constant";
+ string = node.getNodeValue();
+ } else {
+ throw new WCPSException("Unknown String expr node: " + node.getNodeName());
+ }
+ }
+
+ public String toRasQL() {
+ String result = "";
+ if (op.equals("constant")) {
+ result = string;
+ }
+ if (op.equals("id")) {
+ result = cov.toRasQL();
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/SubsetOperationCoverageExpr.java b/petascope/src/petascope/wcps/server/core/SubsetOperationCoverageExpr.java
new file mode 100644
index 0000000..0b9d4fb
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/SubsetOperationCoverageExpr.java
@@ -0,0 +1,70 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+// TODO: Implement class SubsetOperation
+public class SubsetOperationCoverageExpr implements IRasNode, ICoverageInfo {
+
+ private IRasNode child;
+ private CoverageInfo info = null;
+
+ public SubsetOperationCoverageExpr(Node node, XmlQuery xq)
+ throws WCPSException, InvalidCrsException {
+
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ if (node == null) {
+ throw new WCPSException("SubsetOperationCoverageExpr parsing error!");
+ }
+
+ String nodeName = node.getNodeName();
+
+ System.err.println("SubsetOperationCoverageExpr: node " + nodeName);
+
+ if (nodeName.equals("trim")) {
+ child = new TrimCoverageExpr(node, xq);
+ info = ((TrimCoverageExpr) child).getCoverageInfo();
+ } else if (nodeName.equals("extend")) {
+ child = new ExtendCoverageExpr(node, xq);
+ info = ((ExtendCoverageExpr) child).getCoverageInfo();
+ } else if (nodeName.equals("slice")) {
+ child = new SliceCoverageExpr(node, xq);
+ info = ((SliceCoverageExpr) child).getCoverageInfo();
+ } else {
+ throw new WCPSException("Failed to match SubsetOperation: " + nodeName);
+ }
+ }
+
+ public String toRasQL() {
+ return child.toRasQL();
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return info;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/TrimCoverageExpr.java b/petascope/src/petascope/wcps/server/core/TrimCoverageExpr.java
new file mode 100644
index 0000000..68ab8a9
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/TrimCoverageExpr.java
@@ -0,0 +1,133 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+import java.math.BigInteger;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+public class TrimCoverageExpr implements IRasNode, ICoverageInfo {
+
+ private List<DimensionIntervalElement> axisList;
+ private CoverageExpr coverageExprType;
+ private CoverageInfo coverageInfo;
+ private String[] dim;
+ private int dims;
+ private DimensionIntervalElement elem;
+
+ public TrimCoverageExpr(Node node, XmlQuery xq) throws WCPSException, InvalidCrsException {
+ Node child, axisNode;
+ String nodeName;
+
+ axisList = new ArrayList<DimensionIntervalElement>();
+
+ child = node.getFirstChild();
+ while (child != null) {
+ nodeName = child.getNodeName();
+
+ if (nodeName.equals("#text")) {
+ child = child.getNextSibling();
+ continue;
+ }
+
+ try {
+ System.err.println("Trying out an CoverageExprType group...");
+ coverageExprType = new CoverageExpr(child, xq);
+ coverageInfo = coverageExprType.getCoverageInfo();
+ child = child.getNextSibling();
+ continue;
+ } catch (WCPSException e) {
+ System.err.println("This was no CoverageExprType: " + nodeName);
+ }
+
+ try {
+ // Start a new axis and save it
+ elem = new DimensionIntervalElement(child, xq, coverageInfo);
+ axisList.add(elem);
+ child = elem.getNextNode();
+ continue;
+ } catch (WCPSException e) {
+ System.err.println("This was no Dimension Interval ELement: " + child.getNodeName());
+ }
+
+ // else unknown element
+ throw new WCPSException("Unknown node for TrimCoverage expression:" + child.getNodeName());
+ }
+
+ dims = coverageInfo.getNumDimensions();
+ dim = new String[dims];
+
+ for (int j = 0; j < dims; ++j) {
+ dim[j] = "*:*";
+ }
+
+
+ Iterator<DimensionIntervalElement> i = axisList.iterator();
+
+ System.out.println("Axis List count:" + axisList.size());
+ DimensionIntervalElement axis;
+ int axisId;
+ int axisLo, axisHi;
+
+ while (i.hasNext()) {
+ axis = i.next();
+ axisId = coverageInfo.getDomainIndexByName(axis.getAxisName());
+ System.out.println("Axis ID: " + axisId);
+ System.out.println("Axis name: " + axis.getAxisName());
+ System.out.print("Axis coords: ");
+
+ axisLo = Integer.parseInt(axis.getLowCoord());
+ axisHi = Integer.parseInt(axis.getHighCoord());
+ dim[axisId] = axisLo + ":" + axisHi;
+ coverageInfo.setCellDimension(
+ axisId,
+ new CellDomainElement(
+ BigInteger.valueOf(axisLo), BigInteger.valueOf(axisHi)));
+ }
+
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return coverageInfo;
+ }
+
+ public String toRasQL() {
+ String result = coverageExprType.toRasQL() + "[";
+
+ for (int j = 0; j < dims; ++j) {
+ if (j > 0) {
+ result += ",";
+ }
+
+ result += dim[j];
+ }
+
+ result += "]";
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/UnaryOperationCoverageExpr.java b/petascope/src/petascope/wcps/server/core/UnaryOperationCoverageExpr.java
new file mode 100644
index 0000000..00b80ec
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/UnaryOperationCoverageExpr.java
@@ -0,0 +1,153 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+public class UnaryOperationCoverageExpr implements IRasNode, ICoverageInfo {
+
+ private CoverageExpr child;
+ private CoverageInfo info;
+ private String operation;
+ private String params;
+
+ public UnaryOperationCoverageExpr(Node node, XmlQuery xq)
+ throws WCPSException, InvalidCrsException {
+ String nodeName = node.getNodeName();
+
+ System.err.println("Trying to parse unary operation: " + nodeName);
+
+ if (nodeName.equals("unaryPlus")) {
+ operation = "+";
+ child = new CoverageExpr(node.getFirstChild(), xq);
+ } else if (nodeName.equals("unaryMinus")) {
+ operation = "-";
+ child = new CoverageExpr(node.getFirstChild(), xq);
+ } else if (nodeName.equals("sqrt") || nodeName.equals("abs")
+ || nodeName.equals("exp") || nodeName.equals("log") || nodeName.equals("ln")
+ || nodeName.equals("sin") || nodeName.equals("cos") || nodeName.equals("tan")
+ || nodeName.equals("sinh") || nodeName.equals("cosh")
+ || nodeName.equals("tanh") || nodeName.equals("arcsin")
+ || nodeName.equals("arccos") || nodeName.equals("arctan")
+ || nodeName.equals("not") || nodeName.equals("re") || nodeName.equals("im")) {
+ operation = nodeName;
+ child = new CoverageExpr(node.getFirstChild(), xq);
+ } else if (nodeName.equals("bit")) {
+ operation = "bit";
+ Node c = node.getFirstChild();
+
+ while (c != null) {
+ if (c.getNodeName().equals("#text")) {
+ c = c.getNextSibling();
+ continue;
+ }
+
+ if (c.getNodeName().equals("bitIndex")) {
+ try {
+ params = c.getFirstChild().getNodeValue();
+ int i = Integer.parseInt(params);
+ System.err.println("Found bitIndex = " + params);
+ } catch (NumberFormatException e) {
+ throw new WCPSException("Invalid Number as bitIndex: " + params);
+ }
+ } else {
+ child = new CoverageExpr(c, xq);
+ }
+
+ c = c.getNextSibling();
+ }
+ } else if (nodeName.equals("cast")) {
+ operation = "cast";
+ Node c = node.getFirstChild();
+
+ while (c != null) {
+ if (c.getNodeName().equals("#text")) {
+ c = c.getNextSibling();
+ continue;
+ }
+
+ if (c.getNodeName().equals("type")) {
+ RangeField typeNode = new RangeField(c, xq);
+ params = typeNode.toRasQL();
+ } else {
+ child = new CoverageExpr(c, xq);
+ }
+
+ c = c.getNextSibling();
+ }
+ } else if (nodeName.equals("fieldSelect")) {
+ operation = "select";
+ Node c = node.getFirstChild();
+
+ while (c != null) {
+ if (c.getNodeName().equals("#text")) {
+ c = c.getNextSibling();
+ continue;
+ }
+
+ if (c.getNodeName().equals("field")) {
+ FieldName nameNode = new FieldName(c.getFirstChild(), xq);
+ params = nameNode.toRasQL();
+ } else {
+ child = new CoverageExpr(c, xq);
+ }
+
+ c = c.getNextSibling();
+ }
+ } else {
+ throw new WCPSException("Unknown unary operation: " + nodeName);
+ }
+
+ info = new CoverageInfo(child.getCoverageInfo());
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return info;
+ }
+
+ public String toRasQL() {
+ if (operation.equals("sqrt") || operation.equals("abs") || operation.equals("exp")
+ || operation.equals("log") || operation.equals("ln") || operation.equals("sin")
+ || operation.equals("cos") || operation.equals("tan")
+ || operation.equals("sinh") || operation.equals("cosh")
+ || operation.equals("tanh") || operation.equals("arcsin")
+ || operation.equals("arccos") || operation.equals("arctan")
+ || operation.equals("not") || operation.equals("+") || operation.equals("-")) {
+ return operation + "(" + child.toRasQL() + ")";
+ } else if (operation.equals("cast")) {
+ // Use rasql's direct "type-casting" facility for constant scalar expressions
+ // For example, (char)1 does not work, but 1c is a valid expression.
+ if (child.isScalarExpr() && params.equals("char"))
+ return child.toRasQL() + "c";
+ else
+ return "(" + params + ")(" + child.toRasQL() + ")";
+ } else if (operation.equals("select")) {
+ return "(" + child.toRasQL() + ")." + params;
+ } else if (operation.equals("bit")) {
+ return "bit(" + child.toRasQL() + "," + params + ")";
+ }
+
+ return " error ";
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/VariableReference.java b/petascope/src/petascope/wcps/server/core/VariableReference.java
new file mode 100644
index 0000000..613d9e2
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/VariableReference.java
@@ -0,0 +1,56 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+public class VariableReference implements IRasNode {
+
+ private String name;
+ private String translatedName;
+
+ public VariableReference(Node node, XmlQuery xq) throws WCPSException {
+ System.err.println("Parsing variable reference: " + node.getNodeName());
+
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ if (node != null && node.getNodeName().equals("variableRef")) {
+ name = node.getTextContent();
+ translatedName = xq.getReferenceVariableName(name);
+ System.err.println("Variable " + name + " has been renamed into "
+ + translatedName);
+ } else {
+ throw new WCPSException("Could not find any variable reference !");
+ }
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String toRasQL() {
+ return translatedName;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/WCPS.java b/petascope/src/petascope/wcps/server/core/WCPS.java
new file mode 100644
index 0000000..34f7fb2
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/WCPS.java
@@ -0,0 +1,184 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.ResourceException;
+import petascope.wcps.server.exceptions.WCPSException;
+import petascope.wcps.server.exceptions.InvalidWcpsRequestException;
+import petascope.wcps.server.exceptions.InvalidMetadataException;
+import javax.xml.parsers.ParserConfigurationException;
+import org.w3c.dom.*;
+
+import org.xml.sax.*;
+import org.xml.sax.SAXException;
+
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+
+
+import java.util.List;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+/**
+ * This is the WCPS entry point. Processing a ProcessCoverage request happens in two stages.
+The first stage is the various pcPrepare functions, where XML is parsed, metadata is loaded,
+and the request is translated into an instance of a ProcessCoverageRequest. This data structure,
+for the time being, is just a list of rasdaman queries (RasQuery). The second stage is pcExecute,
+which executes a ProcessCoverageRequests and returns data.
+ */
+public class WCPS {
+
+ private static final String SCHEMA_PACKAGE_PROCESSCOVERAGE = "wcps.xml.processcoverage";
+ private IMetadataSource metadataSource;
+ private IDynamicMetadataSource dynamicMetadataSource;
+ private DocumentBuilder wcpsDocumentBuilder;
+
+ public WCPS(File pcSchema, IMetadataSource metadataSource) throws WCPSException {
+ try {
+ System.out.println("WCPS: Loading and parsing XML Schema ...");
+ DocumentBuilderFactory dbconfig = DocumentBuilderFactory.newInstance();
+
+ dbconfig.setValidating(false); // use XML schema not DTD
+ dbconfig.setIgnoringComments(true); // comments are not relevant
+ dbconfig.setIgnoringElementContentWhitespace(true); // remve the ignorable whitespace
+// Schema wcpsProcessCoverageSchema =
+// SchemaFactory.newInstance(
+// XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema(pcSchema);
+
+// dbconfig.setSchema(wcpsProcessCoverageSchema);
+
+ wcpsDocumentBuilder = dbconfig.newDocumentBuilder();
+ System.out.println("WCPS: Finished loading the schema !");
+ } catch (Exception e) {
+ throw new WCPSException(
+ "Error while loading the document builder interface!", e);
+ }
+
+ this.dynamicMetadataSource = new DynamicMetadataSource(metadataSource);
+ }
+
+ public WCPS(IMetadataSource metadataSource) throws ParserConfigurationException,
+ ResourceException, InvalidMetadataException {
+ this.dynamicMetadataSource = new DynamicMetadataSource(metadataSource);
+ wcpsDocumentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ }
+
+ public List<byte[]> pcExecute(String url, String database, ProcessCoveragesRequest pcRequest)
+ throws ResourceException {
+ throw new ResourceException("Mothod not implemented! pcExecute");
+
+ /*
+ * List<RasQuery> queries = pcRequest.getQueries();
+ * List<byte[]> results = new ArrayList<byte[]>( queries.size() );
+ * synchronized( this ) {
+ * Implementation impl = new RasImplementation( url );
+ * Database db = impl.newDatabase();
+ * try {
+ * db.open( database, Database.OPEN_READ_ONLY );
+ * }
+ * catch( ODMGException odmge ) {
+ * try {
+ * db.close();
+ * }
+ * catch (ODMGException e) {}
+ * throw new ResourceException( "Could not connect to rasdaman at " + url + ", database " +
+ * database, odmge );
+ * }
+ * Transaction tr = impl.newTransaction();
+ * tr.begin();
+ * Iterator<RasQuery> queryIterator = queries.iterator();
+ * while( queryIterator.hasNext() ) {
+ * String query = queryIterator.next().toString();
+ * OQLQuery q = impl.newOQLQuery();
+ * DBag resultSet;
+ * try {
+ * q.create( query );
+ * resultSet = (DBag) q.execute();
+ * if( resultSet != null ) {
+ * Iterator resultIterator = resultSet.iterator();
+ * while( resultIterator.hasNext() ) {
+ * RasGMArray result = (RasGMArray) resultIterator.next();
+ * results.add( result.getArray() );
+ * }
+ * }
+ * }
+ * catch (QueryException qe) {
+ * tr.commit();
+ * try {
+ * db.close();
+ * }
+ * catch (ODMGException odmge) {}
+ * throw new ResourceException ( "Could not evaluate rasdaman query: '" + query + "'", qe );
+ * }
+ * }
+ * tr.commit();
+ * try {
+ * db.close();
+ * }
+ * catch (ODMGException odmge) {}
+ * }
+ * return results;
+ */
+ }
+
+ public ProcessCoveragesRequest pcPrepare(String url, String database, File f)
+ throws WCPSException, InvalidWcpsRequestException, ResourceException, SAXException,
+ IOException, InvalidCrsException {
+ return pcPrepare(url, database, wcpsDocumentBuilder.parse(f));
+ }
+
+ public ProcessCoveragesRequest pcPrepare(String url, String database, InputStream is,
+ String systemId)
+ throws WCPSException, InvalidWcpsRequestException, ResourceException, SAXException,
+ IOException, InvalidCrsException {
+ return pcPrepare(url, database, wcpsDocumentBuilder.parse(is, systemId));
+ }
+
+ public ProcessCoveragesRequest pcPrepare(String url, String database, String uri)
+ throws WCPSException, InvalidWcpsRequestException, ResourceException, SAXException,
+ IOException, InvalidCrsException {
+ return pcPrepare(url, database, wcpsDocumentBuilder.parse(uri));
+ }
+
+ public ProcessCoveragesRequest pcPrepare(String url, String database, InputSource is)
+ throws WCPSException, InvalidWcpsRequestException, ResourceException, SAXException,
+ IOException, InvalidCrsException {
+ return pcPrepare(url, database, wcpsDocumentBuilder.parse(is));
+ }
+
+ public ProcessCoveragesRequest pcPrepare(String url, String database, InputStream is)
+ throws WCPSException, InvalidWcpsRequestException, ResourceException, SAXException,
+ IOException, InvalidCrsException {
+ return pcPrepare(url, database, wcpsDocumentBuilder.parse(is));
+ }
+
+ private ProcessCoveragesRequest pcPrepare(String url, String database, Document doc)
+ throws WCPSException, InvalidWcpsRequestException, ResourceException, SAXException, IOException, InvalidCrsException {
+ ProcessCoveragesRequest req = new ProcessCoveragesRequest(url, database, doc, dynamicMetadataSource, this);
+ return req;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/Wgs84Crs.java b/petascope/src/petascope/wcps/server/core/Wgs84Crs.java
new file mode 100644
index 0000000..e712ad6
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/Wgs84Crs.java
@@ -0,0 +1,123 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidMetadataException;
+
+/**
+ * Represents a WGS Coordinate Reference System (CRS) and its bounding box.
+ *
+ *
+ * @version 10.Sep 2009
+ * @author Andrei Aiordachioaie
+ */
+public class Wgs84Crs implements Cloneable {
+
+ private String name = "WGS84";
+ private Double low1, high1, low2, high2;
+ private Double offset1, offset2; // precomputed world-to-crs offsets
+
+ public Wgs84Crs(Double l1, Double h1, Double l2, Double h2, Double o1, Double o2)
+ throws InvalidMetadataException {
+ if ((l1 == null) || (h1 == null) || (l2 == null) || (h2 == null)) {
+ throw new InvalidMetadataException(
+ "Invalid WGS 84 bounding box: null element encountered.");
+ }
+ if ((o1 == null) || (o2 == null)) {
+ throw new InvalidMetadataException("Invalid WGS 84 offsets: null element encountered.");
+ }
+
+ low1 = l1;
+ low2 = l2;
+ high1 = h1;
+ high2 = h2;
+
+ offset1 = o1;
+ offset2 = o2;
+ }
+
+ public Wgs84Crs clone() {
+ try {
+ return new Wgs84Crs(new Double(getLow1()), new Double(getHigh1()),
+ new Double(getLow2()), new Double(getHigh2()),
+ new Double(getOffset1()), new Double(getOffset2()));
+ } catch (InvalidMetadataException e) {
+ return null;
+ }
+ }
+
+ public String toString() {
+ String d = "CRS '" + getName() + "' { Bounding Box [X(" + getLow1() + ", " + getHigh1() + "), "
+ + "Y(" + getLow2() + ", " + getHigh2() + ")], "
+ + "Offsets [X(" + getOffset1() + "), Y(" + getOffset2() + ")]}";
+ return d;
+ }
+
+ /**
+ * @return the low1
+ */
+ public Double getLow1() {
+ return low1;
+ }
+
+ /**
+ * @return the high1
+ */
+ public Double getHigh1() {
+ return high1;
+ }
+
+ /**
+ * @return the low2
+ */
+ public Double getLow2() {
+ return low2;
+ }
+
+ /**
+ * @return the high2
+ */
+ public Double getHigh2() {
+ return high2;
+ }
+
+ /**
+ * @return the offset1
+ */
+ public Double getOffset1() {
+ return offset1;
+ }
+
+ /**
+ * @return the offset2
+ */
+ public Double getOffset2() {
+ return offset2;
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/XmlQuery.java b/petascope/src/petascope/wcps/server/core/XmlQuery.java
new file mode 100644
index 0000000..ed1a304
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/XmlQuery.java
@@ -0,0 +1,236 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class XmlQuery implements IRasNode {
+
+ private String mime;
+ private ArrayList<CoverageIterator> iterators;
+ private BooleanScalarExpr where;
+ private IRasNode coverageExpr;
+ private IDynamicMetadataSource meta;
+ private ArrayList<CoverageIterator> dynamicIterators;
+ /* Variables used in the XML query are renamed. The renaming is explained below.
+ *
+ * Variables declared in the same expression (construct, const, condense)
+ will be collapsed into one multidimensional variable name. For
+ "construct img over $px x(1:10), $py y(1:10) values ... ", the variables could
+ be translated as: $px -> "iteratorA[0]", $py -> "iteratorA[1]".
+ * Variables declared in different expression will have different prefixes,
+ built from "varPrefix" + "varStart".
+ *
+
+ * Used in condenser, construct and constant coverage expressions. */
+ // VariableIndexCount stores the dimensionality of each renamed variable
+ private HashMap<String, Integer> varDimension;
+ // VariableNewName is used to translate the old var name into the multi-dim var name
+ private HashMap<String, String> variableTranslator;
+ private String varPrefix = "i_";
+ private char varSuffix = 'i';
+
+ public String getMimeType() {
+ return mime;
+ }
+
+ public XmlQuery(IDynamicMetadataSource source) {
+ super();
+ this.meta = source;
+ iterators = new ArrayList<CoverageIterator>();
+ dynamicIterators = new ArrayList<CoverageIterator>();
+ variableTranslator = new HashMap<String, String>();
+ varDimension = new HashMap<String, Integer>();
+ }
+
+ public XmlQuery(Node node) throws WCPSException, InvalidCrsException {
+ iterators = new ArrayList<CoverageIterator>();
+ dynamicIterators = new ArrayList<CoverageIterator>();
+ variableTranslator = new HashMap<String, String>();
+ varDimension = new HashMap<String, Integer>();
+ this.startParsing(node);
+ }
+
+ public void startParsing(Node node) throws WCPSException, InvalidCrsException {
+ System.err.println("Processing XML Request: " + node.getNodeName());
+
+ Node x = node.getFirstChild();
+
+
+ while (x != null) {
+ if (x.getNodeName().equals("#text")) {
+ x = x.getNextSibling();
+ continue;
+ }
+
+ System.err.println("The current node is: " + x.getNodeName());
+
+ if (x.getNodeName().equals("coverageIterator")) {
+ iterators.add(new CoverageIterator(x, this));
+ } else if (x.getNodeName().equals("where")) {
+ where = new BooleanScalarExpr(x.getFirstChild(), this);
+ } else if (x.getNodeName().equals("encode")) {
+ EncodeDataExpr encode;
+
+ encode = new EncodeDataExpr(x, this);
+ coverageExpr = encode;
+ mime = encode.getMime();
+ } else {
+ // It has to be a scalar Expr
+ coverageExpr = new ScalarExpr(x, this);
+ mime = "text/plain";
+ }
+
+ x = x.getNextSibling();
+ }
+ }
+
+ public Boolean isIteratorDefined(String iteratorName) {
+ Iterator<CoverageIterator> it = iterators.iterator();
+ while (it.hasNext()) {
+ CoverageIterator tmp = it.next();
+ if (iteratorName.equals(tmp.getIteratorName())) {
+ return true;
+ }
+ }
+
+ it = dynamicIterators.iterator();
+ while (it.hasNext()) {
+ CoverageIterator tmp = it.next();
+ if (iteratorName.equals(tmp.getIteratorName())) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /* Stores information about dynamically created iterators, as metadata.
+ * For example, from a Construct Coverage expression.
+ */
+ public void addDynamicCoverageIterator(CoverageIterator i) {
+ dynamicIterators.add(i);
+ }
+
+ public Iterator<String> getCoverages(String iteratorName) throws WCPSException {
+ for (int i = 0; i < iterators.size(); ++i) {
+ if (iterators.get(i).getIteratorName().equals(iteratorName)) {
+ return iterators.get(i).getCoverages();
+ }
+ }
+
+ for (int i = 0; i < dynamicIterators.size(); ++i) {
+ if (dynamicIterators.get(i).getIteratorName().equals(iteratorName)) {
+ return dynamicIterators.get(i).getCoverages();
+ }
+ }
+
+ throw new WCPSException("Iterator " + iteratorName + " not defined");
+ }
+
+ public boolean isDynamicCoverage(String coverageName) {
+ for (int i = 0; i < dynamicIterators.size(); ++i) {
+ Iterator<String> iterator =
+ ((CoverageIterator) dynamicIterators.get(i)).getCoverages();
+ while (iterator.hasNext()) {
+ if (iterator.next().equals(coverageName)) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ /** Creates a new (translated) variable name for an expression that
+ * has referenceable variables.
+ * @return String a new variable name assigned
+ */
+ public String registerNewExpressionWithVariables() {
+ String name = varPrefix + varSuffix;
+ varDimension.put(name, 0);
+ varSuffix++;
+ return name;
+ }
+
+ /** Remember a variable that can be referenced in the future. This function
+ * assigns it a index code, that should then be used to reference that variable
+ * in the RasQL query.
+ *
+ * If the variable is already referenced, then this function does nothing.
+ * @param name Variable name
+ */
+ public boolean addReferenceVariable(String name, String translatedName) {
+ if (varDimension.containsKey(translatedName) == false) {
+ return false;
+ }
+
+ Integer index = varDimension.get(translatedName);
+ Integer newIndex = index + 1;
+ varDimension.put(translatedName, newIndex);
+ variableTranslator.put(name, translatedName + "[" + index + "]");
+
+ return true;
+ }
+
+ /** Retrieve the translated name assigned to a specific reference (scalar) variable */
+ public String getReferenceVariableName(String name) throws WCPSException {
+ String newName = variableTranslator.get(name);
+ return newName;
+ }
+
+ public String toRasQL() {
+ String result = "select " + coverageExpr.toRasQL() + " from ";
+ Iterator<CoverageIterator> it = iterators.iterator();
+ boolean first = true;
+
+ while (it.hasNext()) {
+ if (first) {
+ first = false;
+ } else {
+ result += ", ";
+ }
+
+ result += it.next().toRasQL();
+ }
+
+ if (where != null) {
+ result += " where " + where.toRasQL();
+ }
+
+ return result;
+ }
+
+ public IDynamicMetadataSource getMetadataSource() {
+ return meta;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/exceptions/InvalidCrsException.java b/petascope/src/petascope/wcps/server/exceptions/InvalidCrsException.java
new file mode 100644
index 0000000..f1381ca
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/exceptions/InvalidCrsException.java
@@ -0,0 +1,29 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.exceptions;
+
+public class InvalidCrsException extends Exception {
+
+ public InvalidCrsException(String message) {
+ super(message);
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/exceptions/InvalidMetadataException.java b/petascope/src/petascope/wcps/server/exceptions/InvalidMetadataException.java
new file mode 100644
index 0000000..ac4d8d1
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/exceptions/InvalidMetadataException.java
@@ -0,0 +1,36 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.exceptions;
+
+/**
+ * Thrown when WCPS received a request, but could not evaluate it because the
+ * metadata for some coverage does not conform to the WCPS standard.
+ */
+public class InvalidMetadataException extends WCPSException {
+
+ private static final long serialVersionUID = 48924938L;
+
+ public InvalidMetadataException(String message) {
+ super(message, null);
+
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/exceptions/InvalidWcpsRequestException.java b/petascope/src/petascope/wcps/server/exceptions/InvalidWcpsRequestException.java
new file mode 100644
index 0000000..d4d3449
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/exceptions/InvalidWcpsRequestException.java
@@ -0,0 +1,38 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.exceptions;
+
+/**
+ * This exception is throws whenever a user submits a request that is not valid in some way.
+ */
+public class InvalidWcpsRequestException extends WCPSException {
+
+ private static final long serialVersionUID = 65492846L;
+
+ public InvalidWcpsRequestException(String message) {
+ super(message, null);
+ }
+
+ public InvalidWcpsRequestException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/exceptions/ResourceException.java b/petascope/src/petascope/wcps/server/exceptions/ResourceException.java
new file mode 100644
index 0000000..b7f7774
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/exceptions/ResourceException.java
@@ -0,0 +1,40 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.exceptions;
+
+/**
+ * This exception is thrown whenever some required resource is not available -
+ * a database connection, a file, etc.
+ */
+public class ResourceException extends WCPSException {
+
+ private static final long serialVersionUID = 45562458L;
+
+ public ResourceException(String message) {
+ super(message);
+ }
+
+ public ResourceException(String message, Throwable cause) {
+ super(message, cause);
+
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/exceptions/WCPSException.java b/petascope/src/petascope/wcps/server/exceptions/WCPSException.java
new file mode 100644
index 0000000..0a6779c
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/exceptions/WCPSException.java
@@ -0,0 +1,39 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.exceptions;
+
+/**
+ * This is the superclass of all WCPS exceptions.
+ */
+public class WCPSException extends Exception {
+
+ private static final long serialVersionUID = 113213254L;
+
+ public WCPSException(String message) {
+ super(message);
+ }
+
+ public WCPSException(String message, Throwable cause) {
+ super(message, cause);
+
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/servlet/WCPSServlet.java b/petascope/src/petascope/wcps/server/servlet/WCPSServlet.java
new file mode 100644
index 0000000..4a00969
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/servlet/WCPSServlet.java
@@ -0,0 +1,257 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.servlet;
+
+import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.fileupload.disk.DiskFileItemFactory;
+import org.apache.commons.fileupload.servlet.ServletFileUpload;
+
+
+//This is the servlet interface of WCPS. It mostly consists of sanity checks and initialization,
+//the meat is onyl a few lines. The WCPS class does the actual work.
+
+import petascope.wcps.server.core.DbMetadataSource;
+import petascope.wcps.server.core.ProcessCoveragesRequest;
+import petascope.wcps.server.core.WCPS;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+
+//Note an important limitation: this will only return the first result if several are available.
+//The reason is that WCPS currently has no standardized way to return multiple byte streams to
+//the user.
+public class WCPSServlet extends HttpServlet {
+
+ private Properties dbParams;
+ private DbMetadataSource metadataSource;
+ private String rasdamanDatabase;
+ private String rasdamanUrl;
+ private WCPS wcps;
+ // path to the default HTML response of the servlet
+ private String servletHtmlPath = "/templates/wcps-servlet.html";
+ // String containing the HTML code for the default response
+ private String defaultHtmlResponse;
+
+ public void init() throws ServletException {
+ try {
+ dbParams = new Properties();
+ System.out.println("WCPS: loading database properties");
+ dbParams.load(
+ new FileInputStream(
+ getServletContext().getRealPath("/settings.properties")));
+ rasdamanUrl = dbParams.getProperty("rasdaman_url");
+ rasdamanDatabase = dbParams.getProperty("rasdaman_database");
+
+ System.out.println("WCPS: initializing metadata database");
+ metadataSource =
+ new DbMetadataSource(dbParams.getProperty("metadata_driver"),
+ dbParams.getProperty("metadata_url"),
+ dbParams.getProperty("metadata_user"),
+ dbParams.getProperty("metadata_pass"), false);
+
+ System.out.println("WCPS: initializing WCPS core");
+ wcps = new WCPS(
+ new File(getServletContext().getRealPath("/xml/ogc/wcps/1.0.0/wcpsProcessCoverages.xsd")),
+ // new CachedMetadataSource(metadataSource)); // removed metadata caching (andrei)
+ metadataSource);
+
+ servletHtmlPath = getServletContext().getRealPath(servletHtmlPath);
+ defaultHtmlResponse = FileUtils.readFileToString(new File(servletHtmlPath));
+
+ System.out.println("WCPS: initialization complete");
+ } catch (Exception e) {
+ System.out.println("WCPS: initialization error");
+ System.out.println("WCPS: closing metadata database");
+
+ if (metadataSource != null) {
+ metadataSource.close();
+ }
+
+ System.out.println("WCPS: done with init error");
+ throw new ServletException("WCPS initialization error", e);
+ }
+
+ }
+
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ System.out.println("WCPS: invoked with GET");
+ printUsage(response);
+ }
+
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ System.out.println("WCPS: invoked with POST");
+ OutputStream webOut = null;
+
+ try {
+ String xmlRequest = null;
+
+ if (ServletFileUpload.isMultipartContent(request)) {
+ @SuppressWarnings("unchecked")
+ Iterator<FileItem> fileItems =
+ (Iterator<FileItem>) (new ServletFileUpload(
+ new DiskFileItemFactory())).parseRequest(
+ request).iterator();
+
+ if (!fileItems.hasNext()) {
+ throw new IOException(
+ "Multipart POST request contains no parts");
+ }
+
+ FileItem fileItem = fileItems.next();
+
+ if (fileItems.hasNext()) {
+ throw new IOException(
+ "Multipart POST request contains too many parts");
+ }
+
+ if (!fileItem.isFormField()
+ && fileItem.getContentType().equals("text/xml")) {
+ xmlRequest = fileItem.getString();
+ }
+
+ if (xmlRequest == null) {
+ System.out.println(
+ "WCPS: no XML file was uploaded within multipart POST request");
+ printUsage(response);
+ return;
+ }
+
+ System.out.println(
+ "WCPS: received XML via a multipart POST request");
+ } else {
+ String xml = request.getParameter("xml");
+ String query = request.getParameter("query");
+
+ if (xml != null) {
+ System.out.println("WCPS: received XML via a 'xml' parameter in a POST request");
+ xmlRequest = xml;
+ } else if (query != null) {
+ System.out.println("WCPS: received the following query via a 'query' "
+ + "parameter in a POST request:");
+ System.out.println(query);
+
+ xmlRequest = ProcessCoveragesRequest.abstractQueryToXmlQuery(query);
+ System.out.println("WCPS: transformed the abstract syntax query into an XML query!");
+ } else {
+ System.out.println("WCPS: no request was received");
+ printUsage(response);
+ return;
+ }
+ }
+
+ System.out.println("WCPS: received the following request:");
+ System.out.println(xmlRequest);
+
+ System.out.println("WCPS: preparing request");
+ ProcessCoveragesRequest processCoverageRequest =
+ wcps.pcPrepare(rasdamanUrl, rasdamanDatabase, IOUtils.toInputStream(xmlRequest));
+
+ String query = processCoverageRequest.getRasqlQuery();
+ String mime = processCoverageRequest.getMime();
+
+ System.out.println("[" + mime + "] " + query);
+
+ System.out.println("Resulting RasQL query: " + query);
+
+ System.out.println("WCPS: executing request");
+
+ List<byte[]> results = processCoverageRequest.execute();
+
+ System.out.println("WCPS: setting response mimetype to " + mime);
+ response.setContentType(mime);
+ System.out.println("WCPS: returning response");
+ webOut = response.getOutputStream();
+ webOut.write(results.get(0));
+ System.out.println("WCPS: done");
+ } catch (Exception e) {
+ printError(response, "Error: " + e.getMessage(), e);
+ } finally {
+ if (webOut != null) {
+ try {
+ webOut.close();
+ } catch (IOException e) {
+ }
+ }
+ }
+ }
+
+ public void destroy() {
+ super.destroy();
+
+ }
+
+ public String getServletInfo() {
+ return "Web Coverage Processing Service (Project PetaScope)";
+
+ }
+
+ private void printError(HttpServletResponse response, String message, Exception e)
+ throws IOException {
+ System.out.println("WCPS: error");
+ System.out.println("WCPS: setting response mimetype to text/html; charset=utf-8");
+ response.setContentType("text/html; charset=utf-8");
+ System.out.println("WCPS: returning the following error message");
+ e.printStackTrace(System.out);
+ System.out.println("WCPS: end of error message");
+ PrintWriter out = new PrintWriter(response.getOutputStream());
+
+ out.println(
+ "<html><head><title>Web Coverage Processing Service</title></head><body>");
+ out.println("<h1>An error has occured</h1>");
+ out.println("<p>" + message + "</p>");
+ out.println("<p>Stack trace:<br/><small>");
+ e.printStackTrace(out);
+ out.println("</small></p></body></html>");
+ out.close();
+ System.out.println("WCPS: done with error");
+ }
+
+ private void printUsage(HttpServletResponse response) throws IOException {
+ System.out.println("WCPS: setting response mimetype to text/html; charset=utf-8");
+ System.out.println("WCPS: returning usage message");
+ response.setContentType("text/html; charset=utf-8");
+ PrintWriter out = new PrintWriter(response.getOutputStream());
+
+ out.println(defaultHtmlResponse);
+
+ out.close();
+ System.out.println("WCPS: done nothing");
+
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/test/FullTestsOnline.java b/petascope/src/petascope/wcps/server/test/FullTestsOnline.java
new file mode 100644
index 0000000..2c2bdff
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/test/FullTestsOnline.java
@@ -0,0 +1,380 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.test;
+
+//~--- non-JDK imports --------------------------------------------------------
+import org.apache.commons.io.FileUtils;
+
+import petascope.wcps.server.cli.grammar;
+
+//~--- JDK imports ------------------------------------------------------------
+
+import java.io.BufferedReader;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import org.apache.commons.io.IOUtils;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * Runs all available testFiles against a deployed version of Petascope,
+ * available at some URL. In particular, here are the steps for each test:
+ * 1) Convert abstract syntax query to XML query
+ * 2) Convert XML query to a RasQL query
+ * 3) Send abstract syntax query to PetaScope WCPS
+ * 4) Send XML query to PetaScope WCPS
+ *
+ * Assumes that a testFiles succeeds if the server does not throw or display
+ * an error. Saves the intermediate results in a specified path.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class FullTestsOnline {
+
+ public static String PetascopeURL = "http://localhost:8080/PetaScope/earthlook";
+// public static String PetascopeURL = "http://localhost:8080/petascope/wcps/";
+// public static String PetascopeURL = "http://kahlua.eecs.jacobs-university.de:8080/petascope/earthlook";
+ // Tests are read from this folder
+ static String folder = "test/testcases-wcps/";
+ // How many testFiles we have to run
+ int numTests = 0;
+ // Files are written in this folder
+ static String outputFolder = "test/tmp/";
+ // How many successes?
+ int passCount = 0;
+ // message for testFiles
+ String[][] errors;
+ // success code
+ boolean[] ok;
+ // partial success codes
+ boolean[][] partialOk;
+ // queries
+ String[] queries;
+ String[] testNames;
+ // execution Times for XML queries
+ long[] xmlTimes;
+ // execution times for abstract sintax queries
+ long[] asTimes;
+
+ public FullTestsOnline() {
+ System.out.println("===========================");
+ System.out.println(" PetaScope Test Suite ");
+ System.out.println("===========================\n\n");
+ System.out.println("Testing URL: " + PetascopeURL);
+ System.out.println("Reading test files from: " + folder);
+ System.out.println("Writing output files to: " + outputFolder + "\n\n");
+
+ // Find out how many grammar testFiles we have to run
+ File dir = new File(folder);
+ TestFileFilter filter = new TestFileFilter();
+ testNames = dir.list(filter);
+ Arrays.sort(testNames);
+ numTests = testNames.length;
+// numTests = 1;
+
+ ok = new boolean[numTests];
+ partialOk = new boolean[5][numTests];
+ errors = new String[5][numTests];
+ queries = new String[numTests];
+ xmlTimes = new long[numTests];
+ asTimes = new long[numTests];
+ }
+
+ public void printResults() {
+ HashMap strMap = new HashMap<Boolean, String>();
+
+ strMap.put(true, "ok");
+ strMap.put(false, "failed");
+
+ System.out.println("\n \nRESULTS + EXECUTION TIMES\n");
+
+ for (int i = 0; i < numTests; i++) {
+ String tname = testNames[i];
+ tname = tname.substring(0, tname.length() - 5);
+
+ if (ok[i] == true) {
+ String time = (double) (asTimes[i] / 10) / 100 + " sec";
+ System.out.println("*** Test '" + tname + "' ok (" + time + ")");
+// System.out.println("\t" + queries[i]);
+ } else {
+ System.out.println("*** Test '" + tname + "' FAILED");
+ System.out.println("\t * Abstract Syntax -> Xml: " + strMap.get(partialOk[1][i]));
+ if (partialOk[1][i] == false) {
+ System.out.println("\t\t" + errors[1][i]);
+ }
+// System.out.println("\t * Xml -> RasQL: " + strMap.get(partialOk[2][i]));
+// if (partialOk[2][i] == false)
+// System.out.println("\t\t" + errors[2][i]);
+ System.out.println("\t * Running Abstract Syntax query: " + strMap.get(partialOk[3][i]));
+ if (partialOk[3][i] == false) {
+ System.out.println("\t\t" + errors[3][i]);
+ }
+ System.out.println("\t * Running XML query: " + strMap.get(partialOk[4][i]));
+ if (partialOk[4][i] == false) {
+ System.out.println("\t\t" + errors[4][i]);
+ }
+ }
+ }
+ System.out.println("\n\nRESULTS\n");
+ System.out.println("Tested PetaScope implementation from: " + PetascopeURL);
+ System.out.println("Tests succeeded: " + String.valueOf(passCount));
+ System.out.println("Tests failed: " + String.valueOf(numTests - passCount));
+
+ System.out.println("\nWARNING: a test is considered to have passed when the web server does not report"
+ + " any erorrs. A human has to inspect the semantics of the result. For this, the first three lines"
+ + " of the output from the web service are printed for each test. For example, if a query involves"
+ + " encoding a coverage in JPEG format, the first line needs to look like \"����JFIF��C\"");
+ }
+
+ public void runAllTests() {
+ String abstractQuery = "";
+ String xmlQuery = "";
+ String rasqlQuery = "";
+ String tname = "";
+ long start, end; // for measuring time
+
+ for (int i = 0; i < numTests; i++) {
+ ok[i] = false;
+ partialOk[1][i] = false;
+ partialOk[2][i] = true;
+ partialOk[3][i] = false;
+ partialOk[4][i] = false;
+ errors[1][i] = "";
+ errors[2][i] = "";
+ errors[3][i] = "";
+ errors[4][i] = "";
+
+ tname = testNames[i];
+ tname = tname.substring(0, tname.length() - 5);
+ File testFile = new File(folder + testNames[i]);
+ System.out.println("-------------------------------------------------");
+ System.out.println("\tTest '" + tname + "'...");
+ System.out.println("-------------------------------------------------");
+ // First of all: read file contents
+ try {
+ abstractQuery = FileUtils.readFileToString(testFile);
+ queries[i] = abstractQuery;
+ System.out.println("*** Query :\n" + abstractQuery);
+ } catch (IOException e) {
+ errors[1][i] = "Could not read file " + testFile.getName();
+
+ continue;
+ }
+ // Step 1: Convert abstract syntax query to XML query, and save files
+ try {
+ xmlQuery = grammar.convertAbstractQueryToXml(abstractQuery);
+ // Copy abstract syntax query to output folder
+ File abstractFile = new File(outputFolder + tname + ".test");
+
+ FileUtils.writeStringToFile(abstractFile, abstractQuery);
+ // Save XML query to a file in output folder
+ File xmlFile = new File(outputFolder + tname + ".xml");
+
+ FileUtils.writeStringToFile(xmlFile, xmlQuery);
+
+ partialOk[1][i] = true;
+ } catch (Exception e) {
+ errors[1][i] = e.getMessage();
+ }
+ // Step 2: Convert XML query to RasQL query, and save files
+// try
+// {
+// rasqlQuery = xml.convertXmlToRasql(xmlQuery);
+// // Save XML query to a file in output folder
+// File rasqlFile = new File(outputFolder + tname + ".rasql");
+// FileUtils.writeStringToFile(rasqlFile, rasqlQuery);
+//
+// partialOk[2][i] = true;
+// }
+// catch (Exception e)
+// {
+// errors[2][i] = e.getMessage();
+// }
+ // Step 3: Send abstract syntax query to PetaScope WCPS
+ try {
+ System.out.println("*** Results from abstract query :");
+ start = System.currentTimeMillis();
+ String err = runOneTest("query", abstractQuery, "GET");
+ end = System.currentTimeMillis();
+ asTimes[i] = end - start;
+
+ if (err == null) {
+ partialOk[3][i] = true;
+ } else {
+ errors[3][i] = err;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ // Step 4: Send XML query to PetaScope WCPS
+ try {
+ System.out.println("*** Results from XML query :");
+ start = System.currentTimeMillis();
+// String err = runOneTest("request", xmlQuery, "POST");
+ String err = runOneTest("", xmlQuery, "POST");
+ end = System.currentTimeMillis();
+ xmlTimes[i] = end - start;
+
+ if (err == null) {
+ partialOk[4][i] = true;
+ } else {
+ errors[4][i] = err;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ // Wrap up
+ ok[i] = partialOk[1][i] && partialOk[2][i] && partialOk[3][i] && partialOk[4][i];
+ if (ok[i] == true) {
+ passCount++;
+ }
+ }
+ }
+
+ /**
+ * Send an request to the WCPS server.
+ * Returns a message on error and null otherwise.
+ */
+ public String runOneTest(String param, String query, String method)
+ throws MalformedURLException, IOException {
+// System.out.println("--------------------");
+// System.out.println(query);
+// System.out.println("\t--------------------");
+
+ // connect to the servlet
+ URL servlet = new URL(PetascopeURL);
+ HttpURLConnection conn = (HttpURLConnection) servlet.openConnection();
+
+ // inform the connection that we will send output and accept input
+ conn.setDoInput(true);
+ conn.setDoOutput(true);
+
+ // Don't use a cached version of URL connection.
+ conn.setUseCaches(false);
+ conn.setDefaultUseCaches(false);
+
+ // Default method is GET
+ if (method.equals("POST")) {
+ conn.setRequestMethod(method);
+ }
+
+ // For POST: We send binary data
+ if (method.equals("POST")) {
+// conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
+// query = URLEncoder.encode(query, "UTF-8");
+ }
+
+ if (param.equals("") == false) {
+ param += "=";
+ }
+
+ String data = param + query;
+ DataOutputStream out = new DataOutputStream(conn.getOutputStream());
+
+ out.writeBytes(data);
+ out.flush();
+ out.close();
+
+ BufferedReader cgiOutput = new BufferedReader(new InputStreamReader(conn.getInputStream()));
+ String line1 = cgiOutput.readLine();
+ String line2 = cgiOutput.readLine();
+ String line3 = cgiOutput.readLine();
+
+ System.out.println("\t" + line1);
+ System.out.println("\t" + line2);
+ System.out.println("\t" + line3);
+
+ if ((line1 != null) && (line2 != null) && (line3 != null)) {
+ StringBuffer output = new StringBuffer(line1 + line2 + line3);
+ while (cgiOutput.ready()) {
+ output.append(cgiOutput.readLine());
+ }
+
+ // Try to parse error message
+ if (line1.startsWith("<")) {
+ DocumentBuilder builder = null;
+ try {
+ DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
+ domFactory.setNamespaceAware(true); // never forget this!
+ builder = domFactory.newDocumentBuilder();
+ Document doc = builder.parse(IOUtils.toInputStream(output.toString()));
+ Element rootElem = doc.getDocumentElement();
+ if (rootElem.getNodeName().endsWith("ExceptionReport")) {
+ return output.toString();
+ }
+ } catch (Exception e) {
+ }
+ }
+
+ }
+
+ return null;
+ }
+
+ /** Runs the full test suite on a deployed version of PetaScope.
+ * If command-line arguments are not provided, default values are used.
+ *
+ * @param args Can contain up to three parameters, in order: PetaScopeURL testFolder, outputFolder
+ */
+ public static void main(String args[]) {
+ if (args.length >= 1) {
+ FullTestsOnline.PetascopeURL = args[0];
+ }
+ if (args.length >= 2) {
+ FullTestsOnline.folder = args[1];
+ }
+ if (args.length == 3) {
+ FullTestsOnline.outputFolder = args[2];
+ }
+
+ FullTestsOnline tester = new FullTestsOnline();
+
+ tester.runAllTests();
+ tester.printResults();
+ }
+
+ /* Accept all files with extension TEST. */
+ private class TestFileFilter implements FilenameFilter {
+
+ @Override
+ public boolean accept(File dir, String name) {
+ if (name.endsWith("test")) {
+ return true;
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/test/GrammarTest.java b/petascope/src/petascope/wcps/server/test/GrammarTest.java
new file mode 100644
index 0000000..f85a259
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/test/GrammarTest.java
@@ -0,0 +1,123 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.test;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import org.apache.commons.io.FileUtils;
+import petascope.wcps.server.cli.grammar;
+
+/**
+ * Runs the available tests for the abstract syntax grammar, by calling the CLI.
+ * Assumes test passes if no error is thrown from the grammar CLI.
+ * @author Andrei Aiordachioaie
+ */
+public class GrammarTest {
+ // Put new test cases in this folder following the current naming scheme
+
+ String folder = "test/testcases-wcps_dollar/";
+ // How many tests we have to run
+ int numTests = 0;
+ // tests
+ File[] tests;
+ // queries
+ String[] queries;
+ // success code
+ boolean[] ok;
+ // message for tests
+ String[] errors;
+ // How many successes?
+ int passCount = 0;
+
+ public void printResults() {
+
+ for (int i = 0; i < numTests; i++) {
+ String tname = tests[i].getName();
+ tname = tname.substring(0, tname.length() - 5);
+ if (ok[i] == true) {
+ System.out.println("*** Test '" + tname + "' ok");
+// System.out.println("\t" + queries[i]);
+ } else {
+ System.out.println("*** Test '" + tname + "' FAILED");
+ System.out.println("\t" + queries[i]);
+ System.out.println("\t ERROR: " + errors[i]);
+ }
+ }
+ System.out.println("\n\nRESULTS\n");
+ System.out.println("Tests succeeded: " + String.valueOf(passCount));
+ System.out.println("Tests failed: " + String.valueOf(numTests - passCount));
+ }
+
+ public GrammarTest() {
+ // Find out how many tests we have to run
+ File dir = new File(folder);
+ System.out.println("Looking for tests in " + dir.getAbsolutePath() + "\n");
+ GrammarFileFilter filter = new GrammarFileFilter();
+ tests = dir.listFiles(filter);
+ numTests = tests.length;
+ ok = new boolean[numTests];
+ errors = new String[numTests];
+ queries = new String[numTests];
+ }
+
+ /* Accept all files with extension test. */
+ private class GrammarFileFilter implements FilenameFilter {
+
+ @Override
+ public boolean accept(File dir, String name) {
+ if (name.endsWith("test")) {
+ return true;
+ }
+ return false;
+ }
+ }
+
+ public void runAllTests() {
+ String query = "";
+ for (int i = 0; i < numTests; i++) {
+ ok[i] = false;
+ try {
+ query = FileUtils.readFileToString(tests[i]);
+ queries[i] = query;
+ } catch (IOException e) {
+ errors[i] = "Could not read file " + tests[i].getName();
+ continue;
+ }
+ try {
+ grammar.convertAbstractQueryToXml(query);
+ ok[i] = true;
+ } catch (Exception e) {
+ errors[i] = e.getMessage();
+ }
+ if (ok[i] == true) {
+ passCount++;
+ }
+ }
+ }
+
+ public static void main(String args[]) {
+ GrammarTest tester = new GrammarTest();
+ tester.runAllTests();
+ tester.printResults();
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/test/GrammarTestOnline.java b/petascope/src/petascope/wcps/server/test/GrammarTestOnline.java
new file mode 100644
index 0000000..6adf21b
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/test/GrammarTestOnline.java
@@ -0,0 +1,204 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.test;
+
+import java.io.BufferedReader;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLEncoder;
+import org.apache.commons.io.FileUtils;
+
+/** Runs the available Grammar tests against a deployed version of Petascope,
+ * available at some URL.
+ *
+ * Assumes that a tests succeeds if the server does not throw or display
+ * an error.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class GrammarTestOnline {
+ // Put new test cases in this folder
+// public final String PetascopeURL = "http://localhost:8080/PetaScope/WCPService";
+// public final String PetascopeURL = "http://localhost:8080/petascope/wcps/";
+
+ public final String PetascopeURL = "http://kahlua.eecs.jacobs-university.de:8080/petascope-new/wcps/";
+ String folder = "test/testcases-wcps/";
+ // How many tests we have to run
+ int numTests = 0;
+ // tests
+ File[] tests;
+ // queries
+ String[] queries;
+ // success code
+ boolean[] ok;
+ // message for tests
+ String[] errors;
+ // How many successes?
+ int passCount = 0;
+
+ public void printResults() {
+ System.out.println("\n \nRESULTS \n");
+
+ for (int i = 0; i < numTests; i++) {
+ String tname = tests[i].getName();
+ tname = tname.substring(0, tname.length() - 5);
+ if (ok[i] == true) {
+ System.out.println("*** Test '" + tname + "' ok");
+// System.out.println("\t" + queries[i]);
+ } else {
+ System.out.println("*** Test '" + tname + "' FAILED");
+ System.out.println("\t" + queries[i]);
+ System.out.println("\t ERROR: " + errors[i]);
+ }
+ }
+ System.out.println("\n\nRESULTS\n");
+ System.out.println("Tested PetaScope implementation from: " + PetascopeURL);
+ System.out.println("Tests succeeded: " + String.valueOf(passCount));
+ System.out.println("Tests failed: " + String.valueOf(numTests - passCount));
+ }
+
+ public GrammarTestOnline() {
+ // Find out how many tests we have to run
+ File dir = new File(folder);
+ System.out.println("Looking for tests in " + dir.getAbsolutePath() + "\n");
+ TestFileFilter filter = new TestFileFilter();
+ tests = dir.listFiles(filter);
+ numTests = tests.length;
+// numTests = 3;
+ ok = new boolean[numTests];
+ errors = new String[numTests];
+ queries = new String[numTests];
+ }
+
+ /* Accept all files with extension TEST. */
+ private class TestFileFilter implements FilenameFilter {
+
+ @Override
+ public boolean accept(File dir, String name) {
+ if (name.endsWith("test")) {
+ return true;
+ }
+ return false;
+ }
+ }
+
+ public void runAllTests() {
+ String query = "";
+ String tname = "";
+ for (int i = 0; i < numTests; i++) {
+ ok[i] = false;
+ tname = tests[i].getName();
+ tname = tname.substring(0, tname.length() - 5);
+ System.out.println("Running test '" + tname + "'...");
+ try {
+ query = FileUtils.readFileToString(tests[i]);
+ queries[i] = query;
+ } catch (IOException e) {
+ errors[i] = "Could not read file " + tests[i].getName();
+ continue;
+ }
+ try {
+ String err = runOneTest("query", query);
+ if (err == null) {
+ ok[i] = true;
+ } else {
+ errors[i] = err;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ if (ok[i] == true) {
+ passCount++;
+ }
+ }
+ }
+
+ /** Send an XML request to the WCPS server. Hopefully it will succeed.
+ * Returns a message on error or null otherwise.
+ **/
+ public String runOneTest(String param, String query)
+ throws MalformedURLException, IOException {
+
+// System.out.println("--------------------");
+// System.out.println(query);
+// System.out.println("\t--------------------");
+
+ // connect to the servlet
+ URL servlet = new URL(PetascopeURL);
+ HttpURLConnection conn = (HttpURLConnection) servlet.openConnection();
+
+ // inform the connection that we will send output and accept input
+ conn.setDoInput(true);
+ conn.setDoOutput(true);
+
+ // Don't use a cached version of URL connection.
+ conn.setUseCaches(false);
+ conn.setDefaultUseCaches(false);
+
+ // Send POST request
+ conn.setRequestMethod("POST");
+
+ // Specify the content type that we will send binary data
+ conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
+
+ String data = param + "=" + URLEncoder.encode(query);
+ DataOutputStream out = new DataOutputStream(conn.getOutputStream());
+ out.writeBytes(data);
+ out.flush();
+ out.close();
+
+ BufferedReader cgiOutput = new BufferedReader(
+ new InputStreamReader(conn.getInputStream()));
+ String line1 = cgiOutput.readLine();
+ String line2 = cgiOutput.readLine();
+ String line3 = cgiOutput.readLine();
+ System.out.println("\t" + line1);
+ System.out.println("\t" + line2);
+ System.out.println("\t" + line3);
+
+ if (line1 != null && line2 != null && line3 != null
+ && line2.equals("<h1>An error has occured</h1>")) {
+ while (cgiOutput.ready()) {
+ System.out.println("\t" + cgiOutput.readLine());
+ }
+// System.out.println("Error executing query: ");
+ String error = line3.substring(10, line3.length() - 4);
+// System.out.println("\t" + error);
+ return error;
+ } else {
+ return null;
+ }
+
+ }
+
+ public static void main(String args[]) {
+ GrammarTestOnline tester = new GrammarTestOnline();
+ tester.runAllTests();
+ tester.printResults();
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/test/XmlTestOnline.java b/petascope/src/petascope/wcps/server/test/XmlTestOnline.java
new file mode 100644
index 0000000..49aa958
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/test/XmlTestOnline.java
@@ -0,0 +1,204 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.test;
+
+import java.io.BufferedReader;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import org.apache.commons.io.FileUtils;
+
+/** Runs the available XML tests against a deployed version of Petascope,
+ * available at some URL.
+ *
+ * Assumes that a tests succeeds if the server does not throw or display
+ * an error.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class XmlTestOnline {
+ // Put new test cases in this folder
+
+ public final String PetascopeURL = "http://localhost:8080/PetaScope/interface";
+// public final String PetascopeURL = "http://localhost:8080/petascope/wcps/";
+// public final String PetascopeURL = "http://kahlua.eecs.jacobs-university.de:8080/petascope-new/wcps/";
+ String folder = "test/testcases-wcps/";
+ // How many tests we have to run
+ int numTests = 0;
+ // tests
+ File[] tests;
+ // queries
+ String[] queries;
+ // success code
+ boolean[] ok;
+ // message for tests
+ String[] errors;
+ // How many successes?
+ int passCount = 0;
+
+ public void printResults() {
+ System.out.println("\n \nRESULTS \n");
+
+ for (int i = 0; i < numTests; i++) {
+ String tname = tests[i].getName();
+ tname = tname.substring(0, tname.length() - 4);
+ if (ok[i] == true) {
+ System.out.println("*** Test '" + tname + "' ok");
+// System.out.println("\t" + queries[i]);
+ } else {
+ System.out.println("*** Test '" + tname + "' FAILED");
+// System.out.println("\t" + queries[i]);
+ System.out.println("\t ERROR: " + errors[i]);
+ }
+ }
+ System.out.println("\n\nRESULTS\n");
+ System.out.println("Tested PetaScope implementation from: " + PetascopeURL);
+ System.out.println("Tests succeeded: " + String.valueOf(passCount));
+ System.out.println("Tests failed: " + String.valueOf(numTests - passCount));
+ }
+
+ public XmlTestOnline() {
+ // Find out how many tests we have to run
+ File dir = new File(folder);
+ System.out.println("Looking for tests in " + dir.getAbsolutePath() + "\n");
+ XmlFileFilter filter = new XmlFileFilter();
+ tests = dir.listFiles(filter);
+ numTests = tests.length;
+// numTests = 1;
+ ok = new boolean[numTests];
+ errors = new String[numTests];
+ queries = new String[numTests];
+ }
+
+ /* Accept all files with extension XML. */
+ private class XmlFileFilter implements FilenameFilter {
+
+ @Override
+ public boolean accept(File dir, String name) {
+ if (name.endsWith("xml")) {
+ return true;
+ }
+ return false;
+ }
+ }
+
+ public void runAllTests() {
+ String query = "";
+ String tname = "";
+ for (int i = 0; i < numTests; i++) {
+ ok[i] = false;
+ tname = tests[i].getName();
+ tname = tname.substring(0, tname.length() - 4);
+
+ try {
+ query = FileUtils.readFileToString(tests[i]);
+ queries[i] = query;
+ } catch (IOException e) {
+ e.printStackTrace();
+ errors[i] = "Could not read file " + tests[i].getName();
+ continue;
+ }
+ System.out.println("Running test '" + tname + "'...");
+ try {
+ String err = runOneTest("request", query);
+ if (err == null) {
+ ok[i] = true;
+ } else {
+ errors[i] = err;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ if (ok[i] == true) {
+ passCount++;
+ }
+ }
+ }
+
+ /** Send an XML request to the WCPS server. Hopefully it will succeed.
+ * Returns a message on error or null otherwise.
+ **/
+ public String runOneTest(String param, String xml)
+ throws MalformedURLException, IOException {
+
+// System.out.println("--------------------");
+// System.out.println(xml);
+// System.out.println("\t--------------------");
+
+ // connect to the servlet
+ URL servlet = new URL(PetascopeURL);
+ HttpURLConnection conn = (HttpURLConnection) servlet.openConnection();
+
+ // inform the connection that we will send output and accept input
+ conn.setDoInput(true);
+ conn.setDoOutput(true);
+
+ // Don't use a cached version of URL connection.
+ conn.setUseCaches(false);
+ conn.setDefaultUseCaches(false);
+
+ // Send POST request
+ conn.setRequestMethod("POST");
+
+ // Specify the content type that we will send binary data
+ conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
+
+ String service = "service=WCPS&";
+ String data = service + param + "=" + xml;
+ DataOutputStream out = new DataOutputStream(conn.getOutputStream());
+ out.writeBytes(data);
+ out.flush();
+ out.close();
+
+
+ BufferedReader cgiOutput = new BufferedReader(
+ new InputStreamReader(conn.getInputStream()));
+ String line1 = cgiOutput.readLine();
+ String line2 = cgiOutput.readLine();
+ String line3 = cgiOutput.readLine();
+ System.out.println("\t" + line1);
+ System.out.println("\t" + line2);
+ System.out.println("\t" + line3);
+
+ if (line1 != null && line2 != null && line3 != null
+ && line2.equals("<h1>An error has occured</h1>")) {
+ System.out.println("Error executing query: ");
+ String error = line3.substring(10, line3.length() - 4);
+ System.out.println("\t" + error);
+ return error;
+ } else {
+ return null;
+ }
+
+ }
+
+ public static void main(String args[]) {
+ XmlTestOnline tester = new XmlTestOnline();
+ tester.runAllTests();
+ tester.printResults();
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/WcsServer.java b/petascope/src/petascope/wcs/server/WcsServer.java
new file mode 100644
index 0000000..1918950
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/WcsServer.java
@@ -0,0 +1,249 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server;
+
+//~--- non-JDK imports --------------------------------------------------------
+import javax.servlet.ServletException;
+import net.opengis.ows.v_1_0_0.ExceptionReport;
+import net.opengis.wcs.v_1_1_0.Capabilities;
+import net.opengis.wcs.v_1_1_0.CoverageDescriptions;
+import net.opengis.wcs.v_1_1_0.DescribeCoverage;
+import net.opengis.wcs.v_1_1_0.GetCapabilities;
+import net.opengis.wcs.v_1_1_0.GetCoverage;
+
+import petascope.wcps.server.core.DbMetadataSource;
+import petascope.wcps.server.core.WCPS;
+import petascope.wcps.server.exceptions.WCPSException;
+import petascope.wcs.server.exceptions.WCSException;
+import petascope.wcs.server.core.convertGetCoverage;
+import petascope.wcs.server.core.executeDescribeCoverage;
+import petascope.wcs.server.core.executeGetCapabilities;
+
+import petascope.ConfigManager;
+import petascope.PetascopeXmlNamespaceMapper;
+
+//~--- JDK imports ------------------------------------------------------------
+
+import java.io.StringReader;
+import java.io.StringWriter;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamWriter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import petascope.wcs.server.exceptions.InternalComponentException;
+import petascope.wcs.server.exceptions.XmlStructuresException;
+
+/**
+ * The Web Coverage Service (WcsServer)
+ * This class provides methods for each of the WCS operations:
+ * - GetCapabilities
+ * - DescribeCoverage
+ * - GetCoverage
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class WcsServer {
+
+ private static Logger LOG = LoggerFactory.getLogger(WcsServer.class);
+
+ /* Status variable */
+ private static Boolean ok;
+ private static Boolean printLog;
+ /* Globals */
+ private static Boolean printOutput;
+ private DbMetadataSource meta;
+
+ /**
+ * Public minimal constructor
+ * @param settingsPath path to the "settings.properties" file
+ */
+ public WcsServer(String settingsPath, DbMetadataSource source) throws ServletException {
+ ConfigManager.getInstance(settingsPath, null);
+ meta = source;
+ ok = true;
+ }
+
+ /**
+ * WcsServer GetCapabilities operation
+ */
+ public String GetCapabilities(String stringXml) throws WCSException {
+ String output = "Default output. ";
+
+ try {
+ // read the input XML
+ LOG.trace("Reading the input XML file ... ");
+ JAXBContext context = JAXBContext.newInstance("net.opengis.wcs.v_1_1_0");
+ Unmarshaller unmarshaller = context.createUnmarshaller();
+ Object xml = unmarshaller.unmarshal(new StringReader(stringXml));
+
+ // Find out which class to execute ...
+ LOG.trace("It is a " + xml.getClass().getSimpleName() + " request.");
+
+ LOG.trace("Compiling data into XML format for GetCapabilities ... ");
+ GetCapabilities input = (GetCapabilities) xml;
+ Capabilities cap = new executeGetCapabilities(input, meta).get();
+
+
+ // Write the output
+ LOG.trace("MArshalling with context: " + cap.getClass().getPackage().getName());
+ final StringWriter writer = new StringWriter();
+ try {
+ context = JAXBContext.newInstance(cap.getClass());
+ final XMLStreamWriter xmlStreamWriter = XMLOutputFactory.newInstance().createXMLStreamWriter(writer);
+
+ final Marshaller marshaller = context.createMarshaller();
+ marshaller.setProperty("com.sun.xml.bind.namespacePrefixMapper", new PetascopeXmlNamespaceMapper());
+ marshaller.setProperty("jaxb.formatted.output", true);
+ marshaller.setProperty("jaxb.schemaLocation", "http://www.opengis.net/wcs/1.1 http://schemas.opengis.net/wcs/1.1.0/wcsGetCapabilities.xsd "
+ + "http://www.opengis.net/wcs/1.1/ows http://schemas.opengis.net/wcs/1.1.0/owsGetCapabilities.xsd");
+
+ marshaller.marshal(cap, xmlStreamWriter);
+ } catch (final Exception e) {
+ throw new RuntimeException(e.getMessage(), e);
+ }
+ output = writer.toString();
+ LOG.trace("Done! User has the GetCapabilities result !");
+
+ } catch (javax.xml.bind.JAXBException ex) {
+ throw new XmlStructuresException("Could not marshall/unmarshall XML structures.", ex);
+ }
+
+ LOG.trace("---------------------OUTPUT--------------------------");
+ LOG.trace(output);
+ LOG.trace("-----------------------------------------------------");
+
+ return output;
+ }
+
+ /**
+ * WcsServer GetCoverage operation
+ */
+ public String GetCoverage(String stringXml, WCPS wcps) throws WCSException {
+ String output = "Default output. ";
+
+ try {
+ // read the input XML
+ LOG.trace("Reading the input XML file ... ");
+ JAXBContext context = JAXBContext.newInstance("net.opengis.wcs.v_1_1_0");
+ Unmarshaller unmarshaller = context.createUnmarshaller();
+ Object xml = unmarshaller.unmarshal(new StringReader(stringXml));
+
+ LOG.trace("It is a " + xml.getClass().getSimpleName() + " request.");
+
+ // Convert the WcsServer into WCPS
+ LOG.trace("Converting to WCPS request ... please wait");
+ GetCoverage wcs = (GetCoverage) xml;
+
+ output = new convertGetCoverage(wcs, meta).get();
+ LOG.trace("Done! User has his WCPS request !");
+ } catch (JAXBException ex) {
+ throw new XmlStructuresException("Could not marshall/unmarshall XML structures.", ex);
+ } catch (WCPSException e) {
+ throw new InternalComponentException(e.getMessage(), e);
+ }
+
+ LOG.trace("---------------------OUTPUT--------------------------");
+ LOG.trace(output);
+ LOG.trace("-----------------------------------------------------");
+
+ return output;
+ }
+
+ /**
+ * WcsServer DescribeCoverage operation
+ */
+ public String DescribeCoverage(String stringXml) throws WCSException {
+ String output = "Default output. ";
+
+ try {
+ // read the input XML
+ LOG.trace("Reading the input XML file ... ");
+ JAXBContext context = JAXBContext.newInstance("net.opengis.wcs.v_1_1_0");
+ Unmarshaller unmarshaller = context.createUnmarshaller();
+ Object xml = unmarshaller.unmarshal(new StringReader(stringXml));
+
+ LOG.trace("It is a " + xml.getClass().getSimpleName() + " request.");
+
+ LOG.trace("Querying the WCPS architecture for the details on this coverage ...");
+ DescribeCoverage input = (DescribeCoverage) xml;
+ CoverageDescriptions covs = new executeDescribeCoverage(input, meta).get();
+
+ // Write the output file
+ LOG.trace("Marshalling with context: " + covs.getClass().getPackage().getName());
+ final StringWriter writer = new StringWriter();
+ try {
+ context = JAXBContext.newInstance(covs.getClass());
+ final XMLStreamWriter xmlStreamWriter = XMLOutputFactory.newInstance().createXMLStreamWriter(writer);
+
+ final Marshaller marshaller = context.createMarshaller();
+ marshaller.setProperty("com.sun.xml.bind.namespacePrefixMapper", new PetascopeXmlNamespaceMapper());
+ marshaller.setProperty("jaxb.formatted.output", true);
+ marshaller.setProperty("jaxb.schemaLocation", "http://www.opengis.net/wcs/1.1 http://schemas.opengis.net/wcs/1.1.0/wcsDescribeCoverage.xsd "
+ + "http://www.opengis.net/wcs/1.1/ows http://schemas.opengis.net/wcs/1.1.0/owcsAll.xsd");
+
+ marshaller.marshal(covs, xmlStreamWriter);
+ } catch (final Exception e) {
+ throw new RuntimeException(e.getMessage(), e);
+ }
+ output = writer.toString();
+ LOG.trace("Done! User has the DescribeCoverage result !");
+ } catch (JAXBException ex) {
+ throw new XmlStructuresException("Could not marshall/unmarshall XML structures.", ex);
+ }
+
+ LOG.trace("---------------------OUTPUT--------------------------");
+ LOG.trace(output);
+ LOG.trace("-----------------------------------------------------");
+
+ return output;
+ }
+
+ private String exceptionReportToXml(ExceptionReport report) {
+ String output = null;
+
+ try {
+ javax.xml.bind.JAXBContext jaxbCtx = javax.xml.bind.JAXBContext.newInstance(
+ report.getClass().getPackage().getName());
+ javax.xml.bind.Marshaller marshaller = jaxbCtx.createMarshaller();
+
+ marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_ENCODING, "UTF-8");
+ marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+ marshaller.marshal(report, System.err);
+ StringWriter strWriter = new StringWriter();
+
+ marshaller.marshal(report, strWriter);
+ output = strWriter.toString();
+ ok = true;
+ LOG.trace("Done marshalling Error Report.");
+ } catch (Exception e2) {
+ LOG.error("Error marshalling Exception Report.");
+ LOG.error("Stack trace: " + e2);
+ }
+
+ return output;
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/cli/CLI.java b/petascope/src/petascope/wcs/server/cli/CLI.java
new file mode 100644
index 0000000..e6312d5
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/cli/CLI.java
@@ -0,0 +1,179 @@
+package petascope.wcs.server.cli;
+
+import petascope.wcs.server.core.executeGetCapabilities;
+import petascope.wcs.server.exceptions.WCSException;
+import petascope.wcs.server.core.convertGetCoverage;
+import petascope.wcs.server.core.executeDescribeCoverage;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.Properties;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.Unmarshaller;
+import net.opengis.ows.v_1_0_0.ExceptionReport;
+import net.opengis.wcs.v_1_1_0.Capabilities;
+import net.opengis.wcs.v_1_1_0.CoverageDescriptions;
+import net.opengis.wcs.v_1_1_0.DescribeCoverage;
+import net.opengis.wcs.v_1_1_0.GetCapabilities;
+import net.opengis.wcs.v_1_1_0.GetCoverage;
+//import wcs.server.core.ProcessCoverage;
+
+/**
+ * Command Line Interface class, for testing the WCS Server operation
+ * Converts an WCS XML input file into a WCPS XML input file.<br />
+ * Settings are read from the file "input-output.txt", in the current folder.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class CLI {
+
+ private static final String settingsFile = "input-output.txt";
+ private static String inputFile;
+ private static String outputFile;
+ private static String metadataSettingsFile;
+ private static Boolean ok;
+ private static Boolean printOutput;
+ private static Boolean printLog = true;
+
+ public static void log(String msg) {
+ if (printLog) {
+ System.out.println(msg);
+ }
+ }
+
+ public static boolean init() {
+ ok = true;
+ printOutput = true;
+
+ Properties set = new Properties();
+ try {
+ set.load(new FileInputStream(settingsFile));
+ } catch (IOException ex) {
+ ex.printStackTrace();
+ ok = false;
+ }
+
+ inputFile = set.getProperty("inputFile");
+ outputFile = set.getProperty("outputFile");
+ metadataSettingsFile = set.getProperty("metadataSettingsFile");
+ printOutput = Boolean.parseBoolean(set.getProperty("printOutputFile"));
+ printLog = Boolean.parseBoolean(set.getProperty("printLogMessages"));
+
+ return ok;
+ }
+
+ /**
+ * Converts a WCS XML input file into a WCPS XML input file
+ * @param args the command line arguments
+ */
+ public static void main(String[] args) {
+ if (!init()) {
+ return;
+ }
+ /*
+ try
+ {
+ // read the input XML
+ log(">>> Reading the input XML file ... ");
+ JAXBContext context = JAXBContext.newInstance("net.opengis.wcs.v_1_1_0");
+ Unmarshaller unmarshaller = context.createUnmarshaller() ;
+ Object xml = unmarshaller.unmarshal(new FileInputStream(inputFile));
+ // Find out which class to execute ...
+ log(">>> It is a " + xml.getClass().getSimpleName() + " request.");
+ if (xml instanceof GetCoverage)
+ {
+ //Convert the WCS into WCPS
+ log(">>> Converting to WCPS ... please wait");
+ GetCoverage wcs = (GetCoverage) xml;
+ ProcessCoverage wcps = new convertGetCoverage(wcs, metadataSettingsFile).get();
+ // Write the output WCPS request
+ try {
+ log(">>> Writing the WCPS XML request");
+ javax.xml.bind.JAXBContext jaxbCtx = javax.xml.bind.JAXBContext.newInstance(wcps.getClass().getPackage().getName());
+ javax.xml.bind.Marshaller marshaller = jaxbCtx.createMarshaller();
+ marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_ENCODING, "UTF-8"); //NOI18N
+ marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+ if (printOutput)
+ marshaller.marshal(wcps, System.out);
+ marshaller.marshal(wcps, new FileOutputStream(outputFile));
+ } catch (javax.xml.bind.JAXBException ex) {
+ // XXXTODO Handle exception
+ java.util.logging.Logger.getLogger("global").log(java.util.logging.Level.SEVERE, null, ex); //NOI18N
+ ex.printStackTrace();
+ }
+ }
+ else
+ if (xml instanceof GetCapabilities)
+ {
+ log(">>> Compiling data into XML format for GetCapabilities ... ");
+ GetCapabilities input = (GetCapabilities) xml;
+ Capabilities cap = new executeGetCapabilities(input, metadataSettingsFile).get();
+ // Write the output file (WCS)
+ try {
+ javax.xml.bind.JAXBContext jaxbCtx = javax.xml.bind.JAXBContext.newInstance(cap.getClass().getPackage().getName());
+ javax.xml.bind.Marshaller marshaller = jaxbCtx.createMarshaller();
+ marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_ENCODING, "UTF-8"); //NOI18N
+ marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+ if (printOutput)
+ marshaller.marshal(cap, System.out);
+ marshaller.marshal(cap, new FileOutputStream(outputFile));
+
+ } catch (javax.xml.bind.JAXBException ex) {
+ // XXXTODO Handle exception
+ java.util.logging.Logger.getLogger("global").log(java.util.logging.Level.SEVERE, null, ex); //NOI18N
+ ex.printStackTrace();
+ }
+ }
+ else
+ if (xml instanceof DescribeCoverage)
+ {
+ log(">>> Querying the WCPS architecture for the details on this coverage ...");
+ DescribeCoverage input = (DescribeCoverage) xml;
+ CoverageDescriptions output = new executeDescribeCoverage(input, metadataSettingsFile).get();
+ // Write the output file (WCS)
+ try {
+ javax.xml.bind.JAXBContext jaxbCtx = javax.xml.bind.JAXBContext.newInstance(output.getClass().getPackage().getName());
+ javax.xml.bind.Marshaller marshaller = jaxbCtx.createMarshaller();
+ marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_ENCODING, "UTF-8"); //NOI18N
+ marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+ if (printOutput)
+ marshaller.marshal(output, System.out);
+ marshaller.marshal(output, new FileOutputStream(outputFile));
+ } catch (javax.xml.bind.JAXBException ex) {
+ // XXXTODO Handle exception
+ java.util.logging.Logger.getLogger("global").log(java.util.logging.Level.SEVERE, null, ex); //NOI18N
+ ex.printStackTrace();
+ }
+ }
+ else
+ throw new Exception("ERROR ! Unrecognized request type " + xml.getClass().getSimpleName());
+ }
+ catch (WCSException e)
+ {
+ ExceptionReport report = e.getReport();
+ try {
+ javax.xml.bind.JAXBContext jaxbCtx = javax.xml.bind.JAXBContext.newInstance(report.getClass().getPackage().getName());
+ javax.xml.bind.Marshaller marshaller = jaxbCtx.createMarshaller();
+ marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_ENCODING, "UTF-8"); //NOI18N
+ marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+ if (printOutput)
+ marshaller.marshal(report, System.err);
+ marshaller.marshal(report, new FileOutputStream(outputFile));
+ } catch (javax.xml.bind.JAXBException ex) {
+ // XXXTODO Handle exception
+ java.util.logging.Logger.getLogger("global").log(java.util.logging.Level.SEVERE, null, ex); //NOI18N
+ ex.printStackTrace();
+ }
+ catch (Exception e2)
+ {
+ e2.printStackTrace();
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ log(">>> Done !");
+ */
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/core/TimeString.java b/petascope/src/petascope/wcs/server/core/TimeString.java
new file mode 100644
index 0000000..668614e
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/core/TimeString.java
@@ -0,0 +1,223 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.core;
+
+//~--- non-JDK imports --------------------------------------------------------
+import org.joda.time.DateTime;
+import org.joda.time.format.DateTimeFormat;
+import org.joda.time.format.DateTimeFormatter;
+
+import org.joda.time.format.ISODateTimeFormat;
+
+/**
+ * Represents a Time object, according to ISO 8601, and utility methods.
+ *
+ * @author Gulius Caesar
+ */
+public class TimeString {
+
+ private static DateTimeFormatter DTF = ISODateTimeFormat.dateTime();
+ private DateTime dateTime;
+ private long milliseconds;
+ private String strTime;
+
+ /* Default constructor */
+ public TimeString(String timeStr) throws IllegalArgumentException {
+ strTime = timeStr;
+ dateTime = parse(strTime);
+ milliseconds = parseMillis(strTime);
+ }
+
+ public DateTime getDateTime() {
+ return dateTime;
+ }
+
+ public long getMilliseconds() {
+ return milliseconds;
+ }
+
+ public long subtract(String newString) throws IllegalArgumentException {
+ long newD = parseMillis(newString);
+ long res = milliseconds - newD;
+
+ return res;
+ }
+
+ public double divide(String newString) throws IllegalArgumentException {
+ long newD = parseMillis(newString);
+ double result = milliseconds * new Double(1.0) / newD;
+
+ return result;
+ }
+
+ /** ******************** Static methods ***************** */
+
+ /*
+ * Subtraction Method, calculates the difference in milliseconds between two dates
+ */
+ public static long difference(String bigDate, String smallDate) throws IllegalArgumentException {
+ long smallD = parseMillis(smallDate);
+ long bigD = parseMillis(bigDate);
+ long result = bigD - smallD;
+
+ return result;
+ }
+
+ /**
+ * Division of one Date by the other.
+ */
+ public static double division(String IAmDivided, String IDivide) throws IllegalArgumentException {
+ long iad = parseMillis(IAmDivided);
+ long id = parseMillis(IDivide);
+ double result = iad * new Double(1.0) / id;
+
+ return result;
+ }
+
+ /*
+ * Division of a millisecond-Date-respresentation by a number.
+ */
+ public static double division(String InputDate, long Divisor) throws IllegalArgumentException {
+ long ID = parseMillis(InputDate);
+
+ double result = ID * new Double(1.0) / Divisor;
+
+ return result;
+
+ }
+
+ /**
+ * Date to millisecond parser. Accepts the standard ISO 8601 + shorter codes.
+ * @return long number of miliseconds
+ */
+ public static long parseMillis(String TString) throws IllegalArgumentException {
+ long Millis;
+ int NumberOfSymbols = TString.length();
+
+ switch (NumberOfSymbols) {
+ case 24:
+ DTF = ISODateTimeFormat.dateTime();
+ Millis = DTF.parseMillis(TString);
+
+ break;
+ case 22:
+ DTF = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss.SS");
+ Millis = DTF.parseMillis(TString);
+
+ break;
+ case 19:
+ DTF = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss");
+ Millis = DTF.parseMillis(TString);
+
+ break;
+ case 16:
+ DTF = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm");
+ Millis = DTF.parseMillis(TString);
+
+ break;
+ case 13:
+ DTF = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH");
+ Millis = DTF.parseMillis(TString);
+
+ break;
+ case 10:
+ DTF = DateTimeFormat.forPattern("yyyy-MM-dd");
+ Millis = DTF.parseMillis(TString);
+
+ break;
+ case 7:
+ DTF = DateTimeFormat.forPattern("yyyy-MM");
+ Millis = DTF.parseMillis(TString);
+
+ break;
+ case 4:
+ DTF = DateTimeFormat.forPattern("yyyy");
+ Millis = DTF.parseMillis(TString);
+
+ break;
+ default:
+ throw new IllegalArgumentException("Unknown DateTime format.");
+ }
+
+ return Millis;
+ }
+
+ /**
+ *
+ * @param TString string containing date
+ * @return joda DateTime corresponding to the input string
+ * @throws IllegalArgumentException
+ */
+ public static DateTime parse(String str) throws IllegalArgumentException {
+ DateTime date;
+ int NumberOfSymbols = str.length();
+
+ System.out.println("Parsing date '" + str + "', with length " + str.length());
+
+ switch (NumberOfSymbols) {
+ case 24:
+ DTF = ISODateTimeFormat.dateTime();
+ date = DTF.parseDateTime(str);
+
+ break;
+ case 22:
+ DTF = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss.SS");
+ date = DTF.parseDateTime(str);
+
+ break;
+ case 19:
+ DTF = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss");
+ date = DTF.parseDateTime(str);
+
+ break;
+ case 16:
+ DTF = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm");
+ date = DTF.parseDateTime(str);
+
+ break;
+ case 13:
+ DTF = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH");
+ date = DTF.parseDateTime(str);
+
+ break;
+ case 10:
+ DTF = DateTimeFormat.forPattern("yyyy-MM-dd");
+ date = DTF.parseDateTime(str);
+
+ break;
+ case 7:
+ DTF = DateTimeFormat.forPattern("yyyy-MM");
+ date = DTF.parseDateTime(str);
+
+ break;
+ case 4:
+ DTF = DateTimeFormat.forPattern("yyyy");
+ date = DTF.parseDateTime(str);
+
+ break;
+ default:
+ throw new IllegalArgumentException("Unknown DateTime format.");
+ }
+
+ return date;
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/core/convertGetCoverage.java b/petascope/src/petascope/wcs/server/core/convertGetCoverage.java
new file mode 100644
index 0000000..7d4a951
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/core/convertGetCoverage.java
@@ -0,0 +1,498 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.core;
+
+//~--- non-JDK imports --------------------------------------------------------
+import petascope.wcs.server.exceptions.WCSException;
+import net.opengis.gml.v_3_1_1.TimePositionType;
+import net.opengis.ows.v_1_0_0.BoundingBoxType;
+import net.opengis.wcs.v_1_1_0.DomainSubsetType;
+import net.opengis.wcs.v_1_1_0.GetCoverage;
+import net.opengis.wcs.v_1_1_0.GridCrsType;
+import net.opengis.wcs.v_1_1_0.RangeSubsetType;
+import net.opengis.wcs.v_1_1_0.TimePeriodType;
+
+import petascope.wcps.server.core.DbMetadataSource;
+import petascope.wcps.server.core.ProcessCoveragesRequest;
+import petascope.wcps.server.exceptions.WCPSException;
+import petascope.wcps.server.core.DomainElement;
+
+import petascope.ConfigManager;
+
+//~--- JDK imports ------------------------------------------------------------
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import org.antlr.runtime.RecognitionException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import petascope.wcps.server.core.Metadata;
+import petascope.wcs.server.exceptions.InvalidParameterValueException;
+import petascope.wcs.server.exceptions.InvalidTemporalMetadataException;
+import petascope.wcs.server.exceptions.MissingParameterValueException;
+import petascope.wcs.server.exceptions.NoApplicableCodeException;
+
+/**
+ * This class takes a WCS GetCoverage XML request and converts this request into
+ * a WCPS ProcessCoverages XML request. It is the user's responsibility to pass
+ * the WCPS request to a WCPS server in order to view to result.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class convertGetCoverage {
+
+ private static Logger LOG = LoggerFactory.getLogger(convertGetCoverage.class);
+ // Trimming
+ private boolean xAxisTrim = false;
+ private boolean yAxisTrim = false;
+ // Time Trimming
+ private boolean timeTrim = false;
+ // Time Slicing
+ private boolean timeSlice = false;
+
+ /* WCPS requests */
+ private String abstractRequest;
+ // Range Composition (field combination)
+ private boolean combineFields;
+
+ /* Value variables, used for building the WCPS abstract syntax query */
+ private String coverageName;
+ private List<String> fields;
+ private boolean finished;
+ // Output
+ private String format;
+
+ /* The Configuration Manager */
+ private DbMetadataSource meta;
+ private boolean store;
+ private String time1, time2;
+ private String timePos;
+ private GetCoverage wcs;
+ private long px0, px1, py0, py1; // Bounding box subsetting
+ private String crsName; // for bounding box
+ private String xmlRequest;
+ private Metadata covMeta;
+
+ /**
+ * Default constructor
+ * @param cov GetCoverage object, the input WCS request for retrieving a coverage
+ * @param path Path to the "settings.properties" file
+ */
+ public convertGetCoverage(GetCoverage cov, DbMetadataSource source)
+ throws WCSException, WCPSException {
+ /* Init Config Manager and global */
+ ConfigManager globals = ConfigManager.getInstance();
+ /* Setup objects */
+ wcs = cov;
+ finished = false;
+
+ meta = source;
+ }
+
+ /**
+ * * Retrieves the WCPS request object that is
+ * equivalent to the WCS request. If it is not yet converted, it will
+ * perform the conversion.
+ *
+ * @return a WCPS abstract syntax query as a string
+ * @throws wcs.server.core.WCSException
+ */
+ public String get() throws WCSException {
+ try {
+ if (!finished) {
+ process();
+ }
+
+ /* Convert the abstract syntax query to a ProcessCoveragesRequest */
+ LOG.debug("Converting WCPS abstract query '{}' to xml", abstractRequest);
+ xmlRequest = ProcessCoveragesRequest.abstractQueryToXmlQuery(abstractRequest);
+ LOG.debug("Resulting XML query is: \n{}", xmlRequest);
+ } catch (RecognitionException re) {
+ throw new NoApplicableCodeException("Internal error: Generated abstract syntax query was not valid.", re);
+ }
+
+ return xmlRequest;
+ }
+
+ /**
+ * Converts WCS node 1 (Coverage Identifier) to WCPS info
+ * @throws wcs_web_service.WCSException
+ */
+ private void readField1() throws WCSException {
+ coverageName = wcs.getIdentifier().getValue();
+ }
+
+ /**
+ * Converts WCS node 2 (Domain subsetting) to WCPS info
+ * @throws wcs_web_service.WCSException
+ */
+ private void readField2() throws WCSException {
+ if (!wcs.isSetDomainSubset()) {
+ throw new MissingParameterValueException("DomainSubset");
+ }
+ if (!wcs.getDomainSubset().isSetBoundingBox()) {
+ throw new MissingParameterValueException("BoundingBox");
+ }
+
+ DomainSubsetType domain = wcs.getDomainSubset();
+
+ // DomainSubset->BoundingBox
+ if (domain.isSetBoundingBox()) {
+ BoundingBoxType bbox = (BoundingBoxType) domain.getBoundingBox().getValue();
+
+ /* We only understand two CRSs: WGS84 and IMAGE_CRS */
+ /* TODO: Implement CRS transformations */
+ crsName = bbox.getCrs();
+ if (crsName != null) {
+ if (crsName.equals(DomainElement.IMAGE_CRS)) {
+ LOG.trace("CRS: NATIVE_IMAGE_CRS");
+ } else if (crsName.equals(DomainElement.WGS84_CRS)) {
+ LOG.trace("CRS: WGS84");
+ } else {
+ throw new InvalidParameterValueException("BoundingBox.crs. Explanation: "
+ + "CRS '" + crsName + "' not available on this server.");
+ }
+ } else {
+ LOG.debug("CRS: None specified for bounding box");
+ LOG.debug("CRS: Using default IMAGE_CRS");
+ crsName = DomainElement.IMAGE_CRS;
+ }
+
+ /* BBox declarations */
+ if (bbox.getLowerCorner().size() != 2) {
+ throw new InvalidParameterValueException("LowerCorner. Explanation: "
+ + "BoundingBox -> LowerCorner should have exactly two "
+ + "values, not " + bbox.getLowerCorner().size());
+ }
+ if (bbox.getUpperCorner().size() != 2) {
+ throw new InvalidParameterValueException("UpperCorner. Explanation: "
+ + "BoundingBox -> UpperCorner should have exactly two "
+ + "values, not " + bbox.getUpperCorner().size());
+ }
+
+ xAxisTrim = true;
+ int u2 = bbox.getLowerCorner().get(0).intValue();
+ int u3 = bbox.getUpperCorner().get(0).intValue();
+ LOG.trace("Added X-axis trimming ! (DomainSubset->BoundingBox): " + u2 + " ... "
+ + u3);
+
+ yAxisTrim = true;
+ int v2 = bbox.getLowerCorner().get(1).intValue();
+ int v3 = bbox.getUpperCorner().get(1).intValue();
+ LOG.trace("Added Y-axis trimming ! (DomainSubset->BoundingBox): " + v2 + " ... "
+ + v3);
+
+ /* Use bounding-box values as they are given */
+ px0 = u2;
+ py0 = v2;
+ px1 = u3;
+ py1 = v3;
+
+ if (crsName.equals(DomainElement.IMAGE_CRS) == false
+ && crsName.equals(DomainElement.WGS84_CRS) == false) {
+ throw new NoApplicableCodeException("Unknown CRS: " + crsName);
+ }
+ }
+
+ // DomainSubset->TemporalSubset
+ if (domain.isSetTemporalSubset()) {
+ // TemporalSubset is of type TimeSequenceType = choice(gml:TimePosition, wcs:TimePeriodType)
+ Object one = domain.getTemporalSubset().getTimePositionOrTimePeriod().get(0);
+
+ LOG.trace("Inside TemporalSubset there is " + one.getClass());
+ if (one instanceof net.opengis.gml.v_3_1_1.TimePositionType) {
+ // TemporalSubset = gml:TimePosition
+ // use WCPS:slice
+ timeSlice = true;
+
+ TimePositionType pos = (TimePositionType) one;
+
+
+ /* Default syntax is ISO 8601.
+ However, we also accept direct time-axis coordinates, as a fail-back solution. */
+ timePos = parseTimePosition(pos);
+ LOG.trace("Added time-axis slicing ! ( DomainSubset->TemporalSubset->gml:TimePositionType): position "
+ + timePos);
+ } else if (one instanceof net.opengis.wcs.v_1_1_0.TimePeriodType) {
+ // TemporalSubset = wcs:TimePeriodType
+ timeTrim = true;
+
+ TimePeriodType period = (TimePeriodType) one;
+
+ TimePositionType pos1 = period.getBeginPosition();
+ TimePositionType pos2 = period.getEndPosition();
+
+ /* Default syntax is ISO 8601.
+ However, we also accept direct time-axis coordinates, as a fail-back solution. */
+ time1 = parseTimePosition(pos1);
+ time2 = parseTimePosition(pos2);
+
+ LOG.trace("Added time-axis trimming ! ( DomainSubset->TemporalSubset->wcs:TimePeriodType): "
+ + time1 + " ... " + time2);
+ }
+ }
+ }
+
+ /**
+ * Converts WCS node 3 (Range subsetting) to WCPS info
+ */
+ private void readField3() throws WCSException {
+ if (wcs.isSetRangeSubset()) {
+ RangeSubsetType range = wcs.getRangeSubset();
+
+ combineFields = true;
+ fields = new ArrayList<String>();
+
+ Iterator<RangeSubsetType.FieldSubset> it = range.getFieldSubset().iterator();
+
+ while (it.hasNext()) {
+ RangeSubsetType.FieldSubset field = it.next();
+
+ fields.add(field.getIdentifier().getValue());
+ LOG.trace("RangeSubsetType->FieldSubset->Identifier is "
+ + field.getIdentifier().getValue());
+ LOG.trace("RangeSubsetType->FieldSubset->Interpolation is "
+ + field.getInterpolationType());
+ /* NOTE: We ignore interpolation instructions (optional) */
+ /* NOTE: We ignore axis subset lists (optional) */
+ }
+
+ }
+ }
+
+ /**
+ * Converts WCS node 4 (Output) to WCPS info
+ * @throws wcs_web_service.WCSException
+ */
+ private void readField4() throws WCSException {
+ if (!wcs.isSetOutput()) {
+ throw new MissingParameterValueException("Output");
+ }
+ LOG.trace("Format: " + wcs.getOutput().getFormat());
+
+ if (wcs.getOutput().isSetGridCRS()) {
+ GridCrsType crs = wcs.getOutput().getGridCRS();
+
+ throw new NoApplicableCodeException("Currently, the Output->GridCRS node is not supported !");
+ }
+
+ String wcsMimeFormat = wcs.getOutput().getFormat();
+
+ format = meta.mimetypeToFormat(wcsMimeFormat);
+ LOG.trace("New format: " + format);
+ if ((format == null) || format.equals("")) {
+ throw new InvalidParameterValueException("Output format");
+ }
+
+ LOG.trace("issetstore = " + wcs.getOutput().isSetStore());
+ LOG.trace("isstore = " + wcs.getOutput().isStore());
+ store = false;
+ if (wcs.getOutput().isSetStore() && wcs.getOutput().isStore()) {
+ store = true;
+ }
+
+ /* WCPS does not support "store=true" */
+ if (store) {
+ throw new InvalidParameterValueException("Output Store. Explanation: "
+ + "Cannot store result image on server.");
+ }
+ }
+
+ /**
+ * Performs the conversion of the WCS request into a WCPS abstract syntax request.
+ * @throws wcs_web_service.WCSException
+ */
+ @SuppressWarnings("static-access")
+ public void process() throws WCSException {
+ /** * Processing starts here ... with the nodes of the WCS * */
+ // Service Description
+ LOG.debug("WCS service: \"" + wcs.SERVICE + "\"");
+ LOG.debug("WCS version: \"" + wcs.VERSION + "\"");
+ if (!wcs.SERVICE.equalsIgnoreCase("WCS")) {
+ throw new InvalidParameterValueException("Service. Explanation: "
+ + "Only the WCS service is supported.");
+ }
+ if (!wcs.VERSION.equals("1.1.0")) {
+ throw new InvalidParameterValueException("Version. Explanation: "
+ + "Only WCS Version 1.1.0 is currently supported.");
+ }
+
+ // First of all, error checking: is the coverage offered by the server?
+ if (!wcs.isSetIdentifier()) {
+ throw new MissingParameterValueException("Identifier");
+ }
+ try {
+ if (!meta.existsCoverageName(wcs.getIdentifier().getValue())) {
+ throw new InvalidParameterValueException("Identifier. Explanation: "
+ + "Coverage " + wcs.getIdentifier().getValue()
+ + " is not served by this server.");
+ }
+ covMeta = meta.read(wcs.getIdentifier().getValue());
+ } catch (WCPSException e) {
+ throw new InvalidParameterValueException("Identifier. Explanation: "
+ + "Coverage " + wcs.getIdentifier().getValue()
+ + " is not served by this server.");
+ }
+
+
+ // Convert all the child nodes of WCS GetCoverage XML node
+ LOG.trace("*** Reading WCS node 1 ... ");
+ readField1();
+ LOG.trace("*** Reading WCS node 2 ...");
+ readField2();
+ LOG.trace("*** Reading WCS node 3 ...");
+ readField3();
+ LOG.trace("*** Reading WCS node 4 ...");
+ readField4();
+ LOG.trace("*** Assembling WCPS abstract syntax query ...");
+ assembleFinalWcpsQuery();
+
+ /* Done building WCPS abstract query. */
+ finished = true;
+ LOG.trace("Done Converting WCS GetCoverage into WCPS ProcessCoverage.");
+ }
+
+ /**
+ * Constructs the WCPS abstract syntax query from the information gathered
+ * by <code>readField*()</code> functions.
+ */
+ private void assembleFinalWcpsQuery() {
+ // Bind variable "c" to the coverage name
+ String forClause = "for c in (" + coverageName + ") ";
+ // Base processing is done on the coverage variable
+ String processing = "c";
+
+ if (xAxisTrim && yAxisTrim) {
+ // Bounding box subsetting
+ String xAxis = "x:\"" + crsName + "\" (" + px0 + ":" + px1 + ")";
+ String yAxis = "y:\"" + crsName + "\" (" + py0 + ":" + py1 + ")";
+ String tAxis = "t(" + time1 + ":" + time2 + ")";
+
+ if (timeTrim) {
+ processing = "trim( " + processing + ", {" + xAxis + ", " + yAxis + ", " + tAxis
+ + "} )";
+ } else {
+ processing = "trim( " + processing + ", {" + xAxis + ", " + yAxis + "} )";
+ }
+ }
+ if (timeSlice) {
+ // Time slicing
+ String tAxis = "t(" + timePos + ")";
+
+ processing = "slice( " + processing + ", {" + tAxis + "} )";
+ }
+ if (combineFields) {
+ // Only one field means we have a "field select" statement
+ if (fields.size() == 1) {
+ String field = fields.get(0);
+
+ processing = "(" + processing + ")." + field;
+ } else // Multiple fields translate into a "range constructor" statement
+ {
+ String newProc = "";
+ Iterator<String> it = fields.iterator();
+
+ while (it.hasNext()) {
+ String field = it.next();
+
+ if (newProc.length() > 0) {
+ newProc += "; ";
+ }
+ newProc += field + ":" + processing;
+ }
+ processing = "struct { " + newProc + " }";
+ }
+ }
+ // Set the output format
+ processing = "encode(" + processing + ", \"" + format + "\")";
+
+ // Build the final query
+ String returnClause = "return " + processing;
+
+ abstractRequest = forClause + returnClause;
+ }
+
+ /** Convert a time-position JAXB object into a numerical index we can use for the
+ * time subsetting.
+ * @param pos TimePositionType object
+ * @return String representation of integer time
+ * @throws WCSException if the contents of the time position is not an integer or an ISO8601 string
+ */
+ private String parseTimePosition(TimePositionType pos) throws WCSException {
+ String result;
+
+ LOG.trace("TimePosition has length " + pos.getValue().size());
+ if (pos.getValue().size() != 1) {
+ throw new InvalidParameterValueException("TimePosition. Explanation: "
+ + "The TimePosition element should have exactly one item, and not "
+ + pos.getValue().size());
+ }
+ String timeStr = pos.getValue().get(0);
+
+ LOG.debug("Parsing time position: " + timeStr);
+ try {
+ // ISO 8601 parsing
+ TimeString ts = new TimeString(timeStr);
+ LOG.debug("Found time position (ISO 8601): " + timeStr);
+ if (ts.subtract(covMeta.getTimePeriodBeginning()) < 0
+ || TimeString.difference(covMeta.getTimePeriodEnd(), timeStr) < 0) {
+ throw new InvalidParameterValueException("TimePosition: value " + timeStr
+ + " is outside this coverage's time range.");
+ }
+ String begin = covMeta.getTimePeriodBeginning();
+ if (begin == null) {
+ throw new InvalidTemporalMetadataException("Coverage '" + covMeta.getCoverageName()
+ + "' has no time axis beginning or end in table PS_Domain.");
+ }
+ long diff1 = ts.subtract(begin);
+ LOG.trace("Selected time span (ISO 8601, in ms) : " + diff1);
+ long diff2 = covMeta.getTimeSpan();
+ if (diff2 == -1) {
+ throw new InvalidTemporalMetadataException("Coverage '" + covMeta.getCoverageName()
+ + "' has no time axis beginning or end in table PS_Domain.");
+ }
+ LOG.trace("Coverage " + covMeta.getCoverageName() + " has time span (ISO 8601, in ms) : " + diff2);
+ LOG.trace("Coverage " + covMeta.getCoverageName() + " has time indexes span : " + covMeta.getTimeIndexesSpan());
+ Double dIndex = covMeta.getTimeIndexesSpan() * diff1 * new Double(1.0) / diff2;
+ if (dIndex == -1) {
+ throw new InvalidTemporalMetadataException("Coverage '" + covMeta.getCoverageName()
+ + "' has no time axis.");
+ }
+ LOG.trace("Computed time axis index: " + dIndex);
+ long timeIndex = dIndex.longValue();
+
+ result = String.valueOf(timeIndex);
+ } catch (IllegalArgumentException e) {
+ LOG.warn("Time position '" + timeStr + "' was not in ISO 8601 format. Trying to parse integer...");
+ try {
+ Integer tPos = Integer.parseInt(timeStr);
+ LOG.debug("Found time position in integer coordinates: " + tPos);
+ result = tPos.toString();
+ } catch (NumberFormatException e2) {
+ throw new InvalidParameterValueException("TimePosition: " + timeStr, e2);
+ }
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/core/executeDescribeCoverage.java b/petascope/src/petascope/wcs/server/core/executeDescribeCoverage.java
new file mode 100644
index 0000000..6df74a8
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/core/executeDescribeCoverage.java
@@ -0,0 +1,275 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.core;
+
+//~--- non-JDK imports --------------------------------------------------------
+import petascope.wcs.server.exceptions.WCSException;
+import net.opengis.ows.v_1_0_0.BoundingBoxType;
+import net.opengis.wcs.ows.v_1_1_0.DomainMetadataType;
+import net.opengis.wcs.ows.v_1_1_0.InterpolationMethodType;
+import net.opengis.wcs.ows.v_1_1_0.InterpolationMethods;
+import net.opengis.wcs.ows.v_1_1_0.UnNamedDomainType;
+import net.opengis.wcs.v_1_1_0.CoverageDescriptionType;
+import net.opengis.wcs.v_1_1_0.CoverageDescriptions;
+import net.opengis.wcs.v_1_1_0.CoverageDomainType;
+import net.opengis.wcs.v_1_1_0.DescribeCoverage;
+import net.opengis.wcs.v_1_1_0.FieldType;
+import net.opengis.wcs.v_1_1_0.RangeType;
+import net.opengis.wcs.v_1_1_0.SpatialDomainType;
+
+import petascope.wcps.server.core.*;
+
+//~--- JDK imports ------------------------------------------------------------
+
+import java.util.Iterator;
+
+import javax.xml.XMLConstants;
+import javax.xml.bind.JAXBElement;
+import javax.xml.namespace.QName;
+import net.opengis.ows.v_1_0_0.KeywordsType;
+import net.opengis.wcs.ows.v_1_1_0.AnyValue;
+import net.opengis.wcs.v_1_1_0.TimeSequenceType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import petascope.wcs.server.exceptions.InvalidParameterValueException;
+import petascope.wcs.server.exceptions.NoApplicableCodeException;
+
+/**
+ * This class takes a WCS DescribeCoverage XML request and executes request,
+ * building the corresponding XML respose.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class executeDescribeCoverage {
+
+ private static Logger LOG = LoggerFactory.getLogger(executeDescribeCoverage.class);
+ private boolean finished;
+ private DescribeCoverage input;
+ private DbMetadataSource meta;
+ private CoverageDescriptions output;
+
+ /**
+ * Default constructor
+ * @param cap DescribeCoverage object, a WCS (or WCPS) request
+ * @param metadataDbPath Path to the "dbparams.properties" file
+ */
+ public executeDescribeCoverage(DescribeCoverage cap, DbMetadataSource source)
+ throws WCSException {
+ input = cap;
+ output = new CoverageDescriptions();
+ finished = false;
+ meta = source;
+ }
+
+ /**
+ * Main method of this class. Retrieves the response to the DescribeCoverage
+ * request given to the constructor. If needed, it also calls <b>process()</b>
+ * @return a CoverageDescriptions object.
+ * @throws wcs_web_service.WCSException
+ */
+ public CoverageDescriptions get() throws WCSException {
+ if (finished == false) {
+ process();
+ }
+ if (finished == false) {
+ throw new NoApplicableCodeException("Could not execute the GetCapabilities request! "
+ + "Please see the other errors...");
+ }
+
+ return output;
+ }
+
+ /**
+ * Computes the response to the DescribeCoverage request given to the constructor.
+ */
+ public void process() throws WCSException {
+ String name;
+
+ for (int i = 0; i < input.getIdentifier().size(); i++) {
+ name = input.getIdentifier().get(i);
+ output.getCoverageDescription().add(getCoverageDescription(name));
+ }
+ finished = true;
+ }
+
+ /**
+ * Retrieve details for one coverage.
+ * @param name Name of the coverage
+ * @return CoverageDescriptionType object, that can just be plugged in the respose object
+ */
+ private CoverageDescriptionType getCoverageDescription(String name) throws WCSException {
+ LOG.trace("Building coverage description for coverage '" + name + "' ...");
+ CoverageDescriptionType desc = new CoverageDescriptionType();
+
+ // Error checking: is the coverage available?
+ if (meta.existsCoverageName(name) == false) {
+ throw new InvalidParameterValueException("Identifier. Explanation: Coverage "
+ + name + " is not served by this server !");
+ }
+
+ // Read all coverage metadata
+ Metadata cov = null;
+
+ try {
+ cov = meta.read(name);
+ } catch (Exception e) {
+ throw new NoApplicableCodeException("Metadata for coverage " + name + " is not valid.");
+ }
+
+ desc.setIdentifier(name);
+ desc.setTitle(cov.getTitle());
+ desc.setAbstract(cov.getAbstract());
+
+ KeywordsType keyword = new KeywordsType();
+ Iterator<String> keys = SDU.str2string(cov.getKeywords()).iterator();
+ while (keys.hasNext()) {
+ String k = keys.next();
+ keyword.getKeyword().add(k);
+ }
+ desc.getKeywords().add(keyword);
+
+ // Coverage Domain
+ CoverageDomainType domain = null;
+ Double lo1 = 0.0, lo2 = 0.0, hi1 = 0.0, hi2 = 0.0;
+
+ /* Default Bounding Box (uses IMAGE_CRS): use image size */
+ BoundingBoxType bbox = new BoundingBoxType();
+ CellDomainElement X = cov.getXCellDomain();
+ CellDomainElement Y = cov.getYCellDomain();
+ if (X != null && Y != null) {
+ lo1 = X.getLo().doubleValue();
+ hi1 = X.getHi().doubleValue();
+ lo2 = Y.getLo().doubleValue();
+ hi2 = Y.getHi().doubleValue();
+
+ bbox.setCrs(DomainElement.IMAGE_CRS);
+
+ bbox.getLowerCorner().add(lo1);
+ bbox.getLowerCorner().add(lo2);
+ bbox.getUpperCorner().add(hi1);
+ bbox.getUpperCorner().add(hi2);
+ } else {
+ throw new NoApplicableCodeException("Internal error: Could "
+ + "not find X and Y cell domain extents.");
+ }
+
+ /* Try to use WGS84 bounding box, if available */
+ Wgs84Crs crs = cov.getCrs();
+ BoundingBoxType bbox84 = new BoundingBoxType();
+ bbox84.setCrs(DomainElement.WGS84_CRS);
+ if (crs != null) {
+ lo1 = crs.getLow1().doubleValue();
+ hi1 = crs.getHigh1().doubleValue();
+ lo2 = crs.getLow2().doubleValue();
+ hi2 = crs.getHigh2().doubleValue();
+
+ bbox84.getLowerCorner().add(lo1);
+ bbox84.getLowerCorner().add(lo2);
+ bbox84.getUpperCorner().add(hi1);
+ bbox84.getUpperCorner().add(hi2);
+
+ bbox = bbox84;
+ }
+
+ domain = new CoverageDomainType();
+ SpatialDomainType spatial = new SpatialDomainType();
+ spatial.getBoundingBox().add(new JAXBElement<BoundingBoxType>(
+ new QName("http://www.opengis.net/ows", "BoundingBox", XMLConstants.DEFAULT_NS_PREFIX),
+ BoundingBoxType.class, bbox));
+ domain.setSpatialDomain(spatial);
+
+
+ /* Find a time-axis if exists */
+ CellDomainElement T = cov.getTCellDomain();
+ if (T != null) {
+ LOG.trace("Found time-axis for coverage: [" + T.getLo() + ", " + T.getHi() + "]");
+ TimeSequenceType temporal = new TimeSequenceType();
+ temporal.getTimePositionOrTimePeriod().add(T.getLo().intValue());
+ temporal.getTimePositionOrTimePeriod().add(T.getHi().intValue());
+ domain.setTemporalDomain(temporal);
+ }
+
+ desc.setDomain(domain);
+
+ // The coverage Range
+ RangeType wcsRange = new RangeType();
+ Iterator<RangeElement> rangeIt = cov.getRangeIterator();
+
+ while (rangeIt.hasNext()) {
+ RangeElement range = rangeIt.next();
+ FieldType field = new FieldType();
+
+ field.setIdentifier(range.getName());
+ UnNamedDomainType domtype = new UnNamedDomainType();
+ AnyValue anyVal = new AnyValue();
+ domtype.setAnyValue(anyVal);
+ DomainMetadataType dommeta = new DomainMetadataType();
+
+ dommeta.setValue(range.getType());
+ domtype.setDataType(dommeta);
+ field.setDefinition(domtype);
+
+ InterpolationMethods interp = new InterpolationMethods();
+
+ InterpolationMethodType meth = new InterpolationMethodType();
+
+ meth.setValue(cov.getInterpolationDefault());
+ meth.setNullResistance(cov.getNullResistanceDefault());
+ interp.setDefaultMethod(meth);
+
+ Iterator<InterpolationMethod> interpIt = cov.getInterpolationMethodIterator();
+
+ while (interpIt.hasNext()) {
+ InterpolationMethod wcpsInterp = interpIt.next();
+
+ meth = new InterpolationMethodType();
+ meth.setValue(wcpsInterp.getInterpolationType());
+ meth.setNullResistance(wcpsInterp.getNullResistance());
+ if ((wcpsInterp.getInterpolationType().equals(interp.getDefaultMethod().getValue()) == false) || (wcpsInterp.getNullResistance().equals(interp.getDefaultMethod().getNullResistance()) == false)) {
+ interp.getOtherMethod().add(meth);
+ }
+ }
+
+ field.setInterpolationMethods(interp);
+ wcsRange.getField().add(field);
+ }
+ desc.setRange(wcsRange);
+
+ // Supported formats for GetCoverage: known rasdaman encoders
+ String[] mimetypes = meta.getMimetypesList();
+
+ for (int i = 0; i < mimetypes.length; i++) {
+ String format = mimetypes[i];
+ desc.getSupportedFormat().add(format);
+ }
+
+ // Available CRSs for current coverage
+ desc.getSupportedCRS().add(DomainElement.IMAGE_CRS);
+ if (cov.getCrs() != null) {
+ desc.getSupportedCRS().add(DomainElement.WGS84_CRS);
+ }
+
+ LOG.trace("Done building the Coverage Description for coverage '" + name + "'.");
+
+ return desc;
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/core/executeGetCapabilities.java b/petascope/src/petascope/wcs/server/core/executeGetCapabilities.java
new file mode 100644
index 0000000..aaa84c0
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/core/executeGetCapabilities.java
@@ -0,0 +1,295 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.core;
+
+import petascope.wcs.server.exceptions.WCSException;
+import java.sql.SQLException;
+import java.util.Iterator;
+import javax.xml.bind.JAXBElement;
+import javax.xml.namespace.QName;
+import net.opengis.ows.v_1_0_0.CodeType;
+import net.opengis.ows.v_1_0_0.ContactType;
+import net.opengis.ows.v_1_0_0.OnlineResourceType;
+import net.opengis.ows.v_1_0_0.ResponsiblePartySubsetType;
+import net.opengis.ows.v_1_0_0.ServiceProvider;
+import net.opengis.wcs.ows.v_1_1_0.AllowedValues;
+import net.opengis.wcs.ows.v_1_1_0.DCP;
+import net.opengis.wcs.ows.v_1_1_0.DomainType;
+import net.opengis.wcs.ows.v_1_1_0.HTTP;
+import net.opengis.wcs.ows.v_1_1_0.Operation;
+import net.opengis.wcs.ows.v_1_1_0.OperationsMetadata;
+import net.opengis.wcs.ows.v_1_1_0.ServiceIdentification;
+import net.opengis.wcs.ows.v_1_1_0.ValueType;
+import net.opengis.wcs.v_1_1_0.Capabilities;
+import net.opengis.wcs.v_1_1_0.Contents;
+import net.opengis.wcs.v_1_1_0.CoverageSummaryType;
+import net.opengis.wcs.v_1_1_0.GetCapabilities;
+import petascope.wcps.server.core.DbMetadataSource;
+import petascope.wcps.server.core.Metadata;
+import petascope.wcps.server.exceptions.ResourceException;
+
+import javax.xml.XMLConstants;
+import net.opengis.ows.v_1_0_0.AddressType;
+import net.opengis.wcs.ows.v_1_1_0.RequestMethodType;
+import petascope.ConfigManager;
+import petascope.wcs.server.exceptions.InternalSqlException;
+import petascope.wcs.server.exceptions.InvalidParameterValueException;
+import petascope.wcs.server.exceptions.NoApplicableCodeException;
+
+/**
+ * This class takes a WCS GetCapabilities XML request and executes request,
+ * building the corresponding XML respose.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class executeGetCapabilities {
+
+ private GetCapabilities input;
+ private Capabilities output;
+ private boolean finished;
+ private DbMetadataSource meta;
+
+ /**
+ * Default constructor
+ * @param cap GetCapabilities object, a WCS (or WCPS) request
+ * @param metadataDbPath Path to the "dbparams.properties" file
+ */
+ public executeGetCapabilities(GetCapabilities cap, DbMetadataSource source) throws WCSException {
+ input = cap;
+ output = new Capabilities();
+ meta = source;
+ finished = false;
+ }
+
+ /**
+ * Main method of this class. Retrieves the response to the GetCapabilities
+ * request given to the constructor. If needed, it also calls <b>process()</b>
+ * @return a Capabilities object.
+ * @throws wcs_web_service.WCSException
+ */
+ public Capabilities get() throws WCSException {
+ if (finished == false) {
+ process();
+ }
+ if (finished == false) {
+ throw new NoApplicableCodeException("Could not execute the GetCapabilities request! "
+ + "Please see the other errors...");
+ }
+ return output;
+ }
+
+ /**
+ * Computes the response to the GetCapabilities request given to the constructor.
+ * @throws wcs_web_service.WCSException
+ */
+ public void process() throws WCSException {
+ if (!input.SERVICE.equalsIgnoreCase("WCS")) {
+ throw new InvalidParameterValueException("Service");
+ }
+
+ try {
+ buildField1(); // Service Identification
+ buildField2(); // Service Provider
+ buildField3(); // Operations Metadata
+ buildField4(); // Contents
+
+ finishBuild(); // Add the remaining required attributes
+ finished = true;
+ } catch (SQLException se) {
+ finished = false;
+ throw new InternalSqlException(se.getMessage(), se);
+ }
+
+ }
+
+ /**
+ * Builds the output node "Service Identification"
+ */
+ private void buildField1() {
+ ServiceIdentification ident = new ServiceIdentification();
+ ident.setTitle("PetaScope");
+ ident.setAbstract("PetaScope is a suite of OGC web-services comprising of "
+ + "WCS, WCS-T and WCPS. It has been developed at Jacobs University, and "
+ + "is mentained by the Jacobs University. Copyright Peter Baumann");
+ CodeType code = new CodeType();
+ code.setValue("WCS");
+ ident.setServiceType(code);
+ ident.getServiceTypeVersion().add("1.1.0");
+ ident.setFees("NONE");
+
+ output.setServiceIdentification(ident);
+ }
+
+ /**
+ * Builds the output node "Service Provider"
+ */
+ private void buildField2() {
+ ServiceProvider prov = new ServiceProvider();
+ prov.setProviderName("Jacobs University Bremen");
+ OnlineResourceType site = new OnlineResourceType();
+ site.setHref("http://www.petascope.org/");
+ prov.setProviderSite(site);
+ ResponsiblePartySubsetType resp = new ResponsiblePartySubsetType();
+ resp.setIndividualName("Prof. Dr. Peter Baumann");
+ CodeType role = new CodeType();
+ role.setValue("Project Leader");
+ resp.setRole(role);
+ ContactType contact = new ContactType();
+ AddressType addr = new AddressType();
+ addr.getElectronicMailAddress().add("p.baumann@jacobs-university.de");
+ addr.setCountry("Germany");
+ addr.setCity("Bremen");
+ addr.setPostalCode("28717");
+ contact.setAddress(addr);
+ resp.setContactInfo(contact);
+ prov.setServiceContact(resp);
+
+ output.setServiceProvider(prov);
+ }
+
+ /**
+ * Builds the output node "Operations Metadata"
+ * @throws java.sql.SQLException
+ */
+ private void buildField3() throws SQLException {
+ OperationsMetadata opmeta = new OperationsMetadata();
+
+ Operation op1 = new Operation();
+ op1.setName("GetCapabilities");
+ DomainType postE = new DomainType();
+ postE.setName("PostEncoding");
+ AllowedValues val1 = new AllowedValues();
+ ValueType valX = new ValueType();
+ valX.setValue("XML");
+ val1.getValueOrRange().add(valX);
+ postE.setAllowedValues(val1);
+ op1.getConstraint().add(postE);
+
+ DomainType store = new DomainType();
+ store.setName("store");
+ AllowedValues val2 = new AllowedValues();
+ ValueType v = new ValueType();
+ v.setValue("false");
+ val2.getValueOrRange().add(v);
+ store.setAllowedValues(val2);
+ op1.getParameter().add(store);
+ DCP dcp = new DCP();
+ HTTP http = new HTTP();
+ RequestMethodType post = new RequestMethodType();
+ post.setHref(ConfigManager.PETASCOPE_SERVLET_URL);
+ post.setType("simple");
+ http.getGetOrPost().add(new JAXBElement<RequestMethodType>(
+ new QName("http://www.opengis.net/wcs/1.1/ows", "Post",
+ XMLConstants.DEFAULT_NS_PREFIX), RequestMethodType.class, post));
+ dcp.setHTTP(http);
+ op1.getDCP().add(dcp);
+ DomainType paramOnlyXml = new DomainType();
+ paramOnlyXml.setName("Format");
+ AllowedValues vals = new AllowedValues();
+ ValueType val = new ValueType();
+ val.setValue("text/xml");
+ vals.getValueOrRange().add(val);
+ paramOnlyXml.setAllowedValues(vals);
+ op1.getParameter().add(paramOnlyXml);
+ opmeta.getOperation().add(op1);
+
+ Operation op2 = new Operation();
+ op2.setName("GetCoverage");
+ op2.getConstraint().add(postE); // POST Encoding accepts only XML
+ op2.getParameter().add(store); // Store parameter: not implemented
+ op2.getDCP().add(dcp); // HTTP request URL
+ op2.getConstraint().add(paramOnlyXml);
+ opmeta.getOperation().add(op2);
+
+ Operation op3 = new Operation();
+ op3.setName("DescribeCoverage");
+ op3.getConstraint().add(postE); // POST Encoding accepts only XML
+ op3.getParameter().add(store); // Store parameter: not implemented
+ op3.getDCP().add(dcp); // HTTP request URL
+ op3.getConstraint().add(paramOnlyXml);
+ opmeta.getOperation().add(op3);
+
+ Operation op4 = new Operation();
+ op4.setName("ProcessCoverages");
+ op4.getConstraint().add(postE); // POST Encoding accepts only XML
+ op4.getParameter().add(store); // Store parameter: not implemented
+ op4.getDCP().add(dcp); // HTTP request URL
+ op4.getConstraint().add(paramOnlyXml);
+ opmeta.getOperation().add(op4);
+
+ Operation op5 = new Operation();
+ op5.setName("Transaction");
+ op5.getConstraint().add(postE); // POST Encoding accepts only XML
+ op5.getParameter().add(store); // Store parameter: not implemented
+ op5.getDCP().add(dcp); // HTTP request URL
+ op5.getConstraint().add(paramOnlyXml);
+ opmeta.getOperation().add(op5);
+
+ output.setOperationsMetadata(opmeta);
+ }
+
+ /**
+ * Builds the output node "Contents"
+ * @throws java.sql.SQLException
+ */
+ private void buildField4() {
+ Contents cont = new Contents();
+ Iterator<String> coverages = null;
+
+ try {
+ coverages = meta.coverages().iterator();
+ } catch (ResourceException e) {
+ }
+ while (coverages.hasNext()) {
+ Metadata metadata = null;
+ try {
+ metadata = meta.read(coverages.next());
+ } catch (Exception e) {
+ }
+ String covName = metadata.getCoverageName();
+ CoverageSummaryType sum = new CoverageSummaryType();
+ sum.setAbstract(metadata.getAbstract());
+ sum.setTitle(metadata.getTitle());
+
+ // code holds the coverage value
+ CodeType code = new CodeType();
+ code.setValue(covName);
+ // code is encapsulated in JAXBElement "jelem"
+ JAXBElement<String> jelem =
+ new JAXBElement<String>(
+ new QName("http://www.opengis.net/wcs/1.1", "Identifier", XMLConstants.DEFAULT_NS_PREFIX),
+ String.class, covName);
+ // Insert "jelem" into this coveragesummary
+ sum.getRest().add(jelem);
+
+ // Add this CoverageSummary to the list of coverage summaries, to make up the Contents
+ cont.getCoverageSummary().add(sum);
+ }
+
+ output.setContents(cont);
+ }
+
+ private void finishBuild() {
+ /* WCS Standard Version ! */
+ output.setVersion("1.1.0");
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/ActionNotSupportedException.java b/petascope/src/petascope/wcs/server/exceptions/ActionNotSupportedException.java
new file mode 100644
index 0000000..70cb368
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/ActionNotSupportedException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class ActionNotSupportedException extends WCSException
+{
+ private final static String error = "ActionNotSupported";
+
+ public ActionNotSupportedException(String message)
+ {
+ super(error, message);
+ }
+
+ public ActionNotSupportedException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/BadResponseHandlerException.java b/petascope/src/petascope/wcs/server/exceptions/BadResponseHandlerException.java
new file mode 100644
index 0000000..118eda1
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/BadResponseHandlerException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class BadResponseHandlerException extends WCSException
+{
+ private static final String error = "BadResponseHandler";
+
+ public BadResponseHandlerException(String message)
+ {
+ super(error, message);
+ }
+
+ public BadResponseHandlerException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/InputOutputException.java b/petascope/src/petascope/wcs/server/exceptions/InputOutputException.java
new file mode 100644
index 0000000..610f1d6
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/InputOutputException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class InputOutputException extends WCSException
+{
+ private static final String error = "InputOutputError";
+
+ public InputOutputException(String message)
+ {
+ super(error, message);
+ }
+
+ public InputOutputException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/InternalComponentException.java b/petascope/src/petascope/wcs/server/exceptions/InternalComponentException.java
new file mode 100644
index 0000000..3680dae
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/InternalComponentException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class InternalComponentException extends WCSException
+{
+ private static final String error = "InternalComponentError";
+
+ public InternalComponentException(String message)
+ {
+ super(error, message);
+ }
+
+ public InternalComponentException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/InternalSqlException.java b/petascope/src/petascope/wcs/server/exceptions/InternalSqlException.java
new file mode 100644
index 0000000..1ae95ce
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/InternalSqlException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class InternalSqlException extends WCSException
+{
+ private static final String error = "InternalSQLError";
+
+ public InternalSqlException(String message)
+ {
+ super(error, message);
+ }
+
+ public InternalSqlException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/InvalidParameterValueException.java b/petascope/src/petascope/wcs/server/exceptions/InvalidParameterValueException.java
new file mode 100644
index 0000000..ae863c2
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/InvalidParameterValueException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class InvalidParameterValueException extends WCSException
+{
+ private static final String error = "InvalidParameterValue";
+
+ public InvalidParameterValueException(String message)
+ {
+ super(error, message);
+ }
+
+ public InvalidParameterValueException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/InvalidPropertyValueException.java b/petascope/src/petascope/wcs/server/exceptions/InvalidPropertyValueException.java
new file mode 100644
index 0000000..a324837
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/InvalidPropertyValueException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class InvalidPropertyValueException extends WCSException
+{
+ private static final String error = "InvalidParameterValue";
+
+ public InvalidPropertyValueException(String message)
+ {
+ super(error, message);
+ }
+
+ public InvalidPropertyValueException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/InvalidRequestException.java b/petascope/src/petascope/wcs/server/exceptions/InvalidRequestException.java
new file mode 100644
index 0000000..9c17239
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/InvalidRequestException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class InvalidRequestException extends WCSException
+{
+ private static final String error = "InvalidRequest";
+
+ public InvalidRequestException(String message)
+ {
+ super(error, message);
+ }
+
+ public InvalidRequestException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/InvalidServiceConfigurationException.java b/petascope/src/petascope/wcs/server/exceptions/InvalidServiceConfigurationException.java
new file mode 100644
index 0000000..41b2241
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/InvalidServiceConfigurationException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class InvalidServiceConfigurationException extends WCSException
+{
+ private final static String error = "ActionNotSupported";
+
+ public InvalidServiceConfigurationException(String message)
+ {
+ super(error, message);
+ }
+
+ public InvalidServiceConfigurationException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/InvalidTemporalMetadataException.java b/petascope/src/petascope/wcs/server/exceptions/InvalidTemporalMetadataException.java
new file mode 100644
index 0000000..d075084
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/InvalidTemporalMetadataException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class InvalidTemporalMetadataException extends WCSException
+{
+ private static final String error = "InvalidParameterValue";
+
+ public InvalidTemporalMetadataException(String message)
+ {
+ super(error, message);
+ }
+
+ public InvalidTemporalMetadataException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/MaliciousQueryException.java b/petascope/src/petascope/wcs/server/exceptions/MaliciousQueryException.java
new file mode 100644
index 0000000..22f7897
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/MaliciousQueryException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class MaliciousQueryException extends WCSException
+{
+ private static final String error = "InvalidParameterValue";
+
+ public MaliciousQueryException(String message)
+ {
+ super(error, message);
+ }
+
+ public MaliciousQueryException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/MissingParameterValueException.java b/petascope/src/petascope/wcs/server/exceptions/MissingParameterValueException.java
new file mode 100644
index 0000000..7ff6aa4
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/MissingParameterValueException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class MissingParameterValueException extends WCSException
+{
+ private static final String error = "InvalidParameterValue";
+
+ public MissingParameterValueException(String message)
+ {
+ super(error, message);
+ }
+
+ public MissingParameterValueException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/MultiBandImagesNotSupportedException.java b/petascope/src/petascope/wcs/server/exceptions/MultiBandImagesNotSupportedException.java
new file mode 100644
index 0000000..e0cff7a
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/MultiBandImagesNotSupportedException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class MultiBandImagesNotSupportedException extends WCSException
+{
+ private static final String error = "InvalidParameterValue";
+
+ public MultiBandImagesNotSupportedException(String message)
+ {
+ super(error, message);
+ }
+
+ public MultiBandImagesNotSupportedException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/NoApplicableCodeException.java b/petascope/src/petascope/wcs/server/exceptions/NoApplicableCodeException.java
new file mode 100644
index 0000000..0e23528
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/NoApplicableCodeException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class NoApplicableCodeException extends WCSException
+{
+ private static final String error = "InvalidParameterValue";
+
+ public NoApplicableCodeException(String message)
+ {
+ super(error, message);
+ }
+
+ public NoApplicableCodeException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/NodeParsingNotImplementedException.java b/petascope/src/petascope/wcs/server/exceptions/NodeParsingNotImplementedException.java
new file mode 100644
index 0000000..5cec9ce
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/NodeParsingNotImplementedException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class NodeParsingNotImplementedException extends WCSException
+{
+ private static final String error = "NodeParsingNotImplemented";
+
+ public NodeParsingNotImplementedException(String message)
+ {
+ super(error, message);
+ }
+
+ public NodeParsingNotImplementedException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/NotEnoughStorageException.java b/petascope/src/petascope/wcs/server/exceptions/NotEnoughStorageException.java
new file mode 100644
index 0000000..c3f8d25
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/NotEnoughStorageException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class NotEnoughStorageException extends WCSException
+{
+ private static final String error = "InvalidParameterValue";
+
+ public NotEnoughStorageException(String message)
+ {
+ super(error, message);
+ }
+
+ public NotEnoughStorageException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/RasdamanRequestFailedException.java b/petascope/src/petascope/wcs/server/exceptions/RasdamanRequestFailedException.java
new file mode 100644
index 0000000..9f42df1
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/RasdamanRequestFailedException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class RasdamanRequestFailedException extends WCSException
+{
+ private final static String error = "InvalidParameterValue";
+
+ public RasdamanRequestFailedException(String message)
+ {
+ super(error, message);
+ }
+
+ public RasdamanRequestFailedException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/RasdamanUnavailableException.java b/petascope/src/petascope/wcs/server/exceptions/RasdamanUnavailableException.java
new file mode 100644
index 0000000..6bbb3e3
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/RasdamanUnavailableException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class RasdamanUnavailableException extends WCSException
+{
+ private final static String error = "InvalidParameterValue";
+
+ public RasdamanUnavailableException(String message)
+ {
+ super(error, message);
+ }
+
+ public RasdamanUnavailableException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/ServletConnectionException.java b/petascope/src/petascope/wcs/server/exceptions/ServletConnectionException.java
new file mode 100644
index 0000000..05ec45b
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/ServletConnectionException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class ServletConnectionException extends WCSException
+{
+ private static final String error = "InvalidParameterValue";
+
+ public ServletConnectionException(String message)
+ {
+ super(error, message);
+ }
+
+ public ServletConnectionException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/UnsupportedCombinationException.java b/petascope/src/petascope/wcs/server/exceptions/UnsupportedCombinationException.java
new file mode 100644
index 0000000..934fb47
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/UnsupportedCombinationException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class UnsupportedCombinationException extends WCSException
+{
+ private final static String error = "UnsupportedCombination";
+
+ public UnsupportedCombinationException(String message)
+ {
+ super(error, message);
+ }
+
+ public UnsupportedCombinationException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/WCSException.java b/petascope/src/petascope/wcs/server/exceptions/WCSException.java
new file mode 100644
index 0000000..556cf03
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/WCSException.java
@@ -0,0 +1,148 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+
+
+package petascope.wcs.server.exceptions;
+
+//~--- non-JDK imports --------------------------------------------------------
+
+import net.opengis.ows.v_1_0_0.ExceptionReport;
+import net.opengis.ows.v_1_0_0.ExceptionType;
+
+//~--- JDK imports ------------------------------------------------------------
+
+import java.util.Arrays;
+import petascope.ConfigManager;
+
+/**
+ * Private Exception superclass for the WCS server.
+ * This class can return an error report, than can be marshalled into a
+ * WCS-standard compliant XML structure describing the error that has happened.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class WCSException extends Exception
+{
+// private static Logger LOG = LoggerFactory.getLogger(WCSException.class);
+
+ /*
+ private String[] errorCodes =
+ {
+ "MissingParameterValue", "InvalidParameterValue", "NoApplicableCode",
+ "UnsupportedCombination", "NotEnoughStorage",
+ "MaliciousQuery", "ActionNotSupported", "XmlStructuresError",
+ "BadResponseHandler", "MultiBandImagesNotSupported", "RasdamanUnavailable",
+ "ServletConnectionError", "XmlInputNotValid", "InvalidPropertyValue",
+ "InternalWcpsError", "InternalSqlError", "RasdamanRequestFailed",
+ "NodeParsingNotImplemented", "IOConnectionError", "InvalidTemporalMetadata",
+ "InvalidRequestString"
+ };
+ */
+ private ExceptionType item;
+ private ExceptionReport report;
+ private String errorCode;
+ private String errorDetail = "";
+
+ /**
+ * Default (minimal) constructor
+ * @param error Error Code
+ * @param detail Detailed message about the error
+ */
+ protected WCSException(String error, String detail)
+ {
+ super();
+ errorCode = error;
+ errorDetail = detail;
+
+ createReport();
+ }
+
+ /**
+ * Convenience Constructor
+ * @param error Error Code
+ * @param detail Detailed message about the error
+ * @param e The cause of the current exception.
+ */
+ protected WCSException(String error, String detail, Exception e)
+ {
+ super(e);
+ errorCode = error;
+ errorDetail = detail;
+ createReport();
+ }
+
+ private void createReport()
+ {
+ report = new ExceptionReport();
+ report.setLanguage(ConfigManager.WCST_LANGUAGE);
+ report.setVersion(ConfigManager.WCST_VERSION);
+
+ item = new ExceptionType();
+ item.setExceptionCode(errorCode);
+ item.setLocator(errorDetail);
+ report.getException().add(item);
+ }
+
+ /** Return the error code.
+ *
+ * @return
+ */
+ public String getErrorCode()
+ {
+ return errorCode;
+ }
+
+ /** Return the detailed error message.
+ *
+ * @return
+ */
+ public String getErrorDetail()
+ {
+ return errorDetail;
+ }
+
+ /**
+ * Retrieves a data structure that can be later marshalled into a XML
+ * "ExceptionReport" document.
+ * @return ExceptionReport object
+ */
+ public ExceptionReport getReport()
+ {
+ return report;
+ }
+
+ /**
+ * Adds text to this exception's detail message.
+ * @param msg
+ */
+ public void appendErrorDetail(String msg)
+ {
+ this.errorDetail += msg;
+ createReport();
+ }
+
+ @Override
+ public String getMessage()
+ {
+ return this.errorDetail;
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/WcsRuntimeException.java b/petascope/src/petascope/wcs/server/exceptions/WcsRuntimeException.java
new file mode 100644
index 0000000..f1dcde8
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/WcsRuntimeException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class WcsRuntimeException extends WCSException
+{
+ private static final String error = "RuntimeException";
+
+ public WcsRuntimeException(String message)
+ {
+ super(error, message);
+ }
+
+ public WcsRuntimeException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/XmlNotValidException.java b/petascope/src/petascope/wcs/server/exceptions/XmlNotValidException.java
new file mode 100644
index 0000000..e9ea6ea
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/XmlNotValidException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class XmlNotValidException extends WCSException
+{
+ private static final String error = "XmlDocumentNotValid";
+
+ public XmlNotValidException(String message)
+ {
+ super(error, message);
+ }
+
+ public XmlNotValidException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/XmlStructuresException.java b/petascope/src/petascope/wcs/server/exceptions/XmlStructuresException.java
new file mode 100644
index 0000000..66c244b
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/XmlStructuresException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class XmlStructuresException extends WCSException
+{
+ private static final String error = "XmlStructuresError";
+
+ public XmlStructuresException(String message)
+ {
+ super(error, message);
+ }
+
+ public XmlStructuresException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs2/schemas/Examples/requestDescribeCoverage.xml b/petascope/src/petascope/wcs2/schemas/Examples/requestDescribeCoverage.xml
new file mode 100644
index 0000000..c1224e7
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/Examples/requestDescribeCoverage.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wcs:DescribeCoverage xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xmlns:wcs='http://www.opengis.net/wcs/2.0'
+ xmlns:gml='http://www.opengis.net/gml/3.2'
+ xsi:schemaLocation='http://www.opengis.net/wcs/2.0 ../wcsAll.xsd'
+ service="WCS" version="2.0.0">
+ <wcs:id gml:id="rgb"/>
+</wcs:DescribeCoverage>
diff --git a/petascope/src/petascope/wcs2/schemas/Examples/requestGetCapabilities.xml b/petascope/src/petascope/wcs2/schemas/Examples/requestGetCapabilities.xml
new file mode 100644
index 0000000..b7966cb
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/Examples/requestGetCapabilities.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wcs:GetCapabilities xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xmlns:ows='http://www.opengis.net/ows/1.1'
+ xmlns:wcs='http://www.opengis.net/wcs/2.0'
+ xsi:schemaLocation='http://www.opengis.net/wcs/2.0 ../wcsAll.xsd'
+ service="WCS" version="2.0.0">
+ <ows:AcceptVersions>
+ <ows:Version>2.0.0</ows:Version>
+ </ows:AcceptVersions>
+</wcs:GetCapabilities>
diff --git a/petascope/src/petascope/wcs2/schemas/Examples/requestGetCoverage.xml b/petascope/src/petascope/wcs2/schemas/Examples/requestGetCoverage.xml
new file mode 100644
index 0000000..5195d36
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/Examples/requestGetCoverage.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wcs:GetCoverage xmlns:wcs="http://www.opengis.net/wcs/2.0"
+ xmlns:gml="http://www.opengis.net/gml/3.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.opengis.net/wcs/2.0 ../wcsAll.xsd"
+ service="WCS" version="2.0.0">
+ <wcs:id gml:id="rgb"/>
+ <wcs:trimDimension>
+ <wcs:dimension>x</wcs:dimension>
+ <wcs:trimLow>200</wcs:trimLow>
+ <wcs:trimHigh>299</wcs:trimHigh>
+ </wcs:trimDimension>
+ <wcs:trimDimension>
+ <wcs:dimension>y</wcs:dimension>
+ <wcs:trimLow>200</wcs:trimLow>
+ <wcs:trimHigh>300</wcs:trimHigh>
+ </wcs:trimDimension>
+</wcs:GetCoverage>
diff --git a/petascope/src/petascope/wcs2/schemas/Examples/responseDescribeCoverage.xml b/petascope/src/petascope/wcs2/schemas/Examples/responseDescribeCoverage.xml
new file mode 100644
index 0000000..544e62f
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/Examples/responseDescribeCoverage.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wcs:CoverageDescriptions xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xmlns:gmlwcs='http://www.opengis.net/wcs/2.0/gml'
+ xmlns:gml='http://www.opengis.net/gml/3.2'
+ xmlns:wcs='http://www.opengis.net/wcs/2.0'
+ xmlns='http://www.opengis.net/gml/3.2'
+ xsi:schemaLocation='http://www.opengis.net/wcs/2.0 ../wcsAll.xsd'>
+ <wcs:CoverageDescription gml:id="coverage1">
+ <domainSet>
+ <Grid dimension="2" gml:id="grid1">
+ <limits>
+ <GridEnvelope>
+ <!-- This is a 5-by-3 matrix -->
+ <low>1 1</low>
+ <high>5 3</high>
+ </GridEnvelope>
+ </limits>
+ <axisLabels>xAxis yAxis</axisLabels>
+ </Grid>
+ </domainSet>
+ <gmlwcs:rangeStructure>
+ <gmlwcs:RangeStructure gml:id="RangeStructure1">
+ <gmlwcs:rangeField >
+ <gmlwcs:RangeField gml:id="Band1" uom="W/cm^2">
+ <gml:name>band1</gml:name>
+ <gmlwcs:dataType>urn:ogc:def:dataType:OGC:1.1:unsignedByte</gmlwcs:dataType>
+ <gmlwcs:nilValueList>000 255</gmlwcs:nilValueList>
+ </gmlwcs:RangeField>
+ </gmlwcs:rangeField>
+ </gmlwcs:RangeStructure>
+ </gmlwcs:rangeStructure>
+ <wcs:ServiceParameters>
+ <wcs:supportedCrsList></wcs:supportedCrsList>
+ <wcs:supportedFormatList>application/xml</wcs:supportedFormatList>
+ </wcs:ServiceParameters>
+ </wcs:CoverageDescription>
+</wcs:CoverageDescriptions>
diff --git a/petascope/src/petascope/wcs2/schemas/Examples/responseGetCapabilities.xml b/petascope/src/petascope/wcs2/schemas/Examples/responseGetCapabilities.xml
new file mode 100644
index 0000000..c5485e9
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/Examples/responseGetCapabilities.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wcs:Capabilities xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xmlns:ows='http://www.opengis.net/ows/1.1'
+ xmlns:wcs='http://www.opengis.net/wcs/2.0'
+ xmlns:gml='http://www.opengis.net/gml/3.2'
+ xmlns='http://www.opengis.net/ows/1.1'
+ xmlns:xlink='http://www.w3.org/1999/xlink'
+ xsi:schemaLocation='http://www.opengis.net/wcs/2.0 ../wcsAll.xsd' version="2.0.0">
+ <ServiceIdentification>
+ <Title>petascope</Title>
+ <Abstract>WCS Server developed at jacobs University</Abstract>
+ <ServiceType>OGC WCS</ServiceType>
+ <ServiceTypeVersion>2.0.0</ServiceTypeVersion>
+ <Profile>urn:ogc:def:extension:OGC-WCS:2.0:protocol:post</Profile>
+ <Profile>urn:ogc:def:extension:OGC-WCS:2.0:coverageFormat:netcdf</Profile>
+ <Profile>urn:ogc:def:extension:OGC-WCS:2.0:serviceModel:wcps:1.0</Profile>
+ <Profile>urn:ogc:def:extension:OGC-WCS:2.0:serviceModel:wcst:1.0</Profile>
+ </ServiceIdentification>
+ <ServiceProvider>
+ <ProviderName>Jacobs University Bremen</ProviderName>
+ <ProviderSite xlink:href="http://www.jacobs-university.de/"/>
+ <ServiceContact>
+ <IndividualName>Mr. X</IndividualName>
+ <PositionName>Developer</PositionName>
+ <ContactInfo>
+ <Phone>
+ <Voice></Voice>
+ </Phone>
+ </ContactInfo>
+ </ServiceContact>
+ </ServiceProvider>
+ <OperationsMetadata>
+ <Operation name="GetCapabilities">
+ <DCP>
+ <HTTP>
+ <Get xlink:href="http://server:port/GetCapabilitiesURL"/>
+ </HTTP>
+ </DCP>
+ </Operation>
+ <Operation name="DescribeCoverage">
+ <DCP>
+ <HTTP>
+ <Get xlink:href="http://server:port/DescribeCoverageURL"/>
+ </HTTP>
+ </DCP>
+ </Operation>
+ <Operation name="GetCoverage">
+ <DCP>
+ <HTTP>
+ <Get xlink:href="http://server:port/GetCoverageURL"/>
+ </HTTP>
+ </DCP>
+ </Operation>
+ </OperationsMetadata>
+ <wcs:Contents>
+ <wcs:id gml:id="coverage1"/>
+ <wcs:id gml:id="coverage2"/>
+ <wcs:id gml:id="coverage3"/>
+ </wcs:Contents>
+</wcs:Capabilities>
diff --git a/petascope/src/petascope/wcs2/schemas/Examples/responseGetCoverage.xml b/petascope/src/petascope/wcs2/schemas/Examples/responseGetCoverage.xml
new file mode 100644
index 0000000..a4c6fd3
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/Examples/responseGetCoverage.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gmlwcs:GridCoverage xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xmlns:gml='http://www.opengis.net/gml/3.2'
+ xmlns='http://www.opengis.net/gml/3.2'
+ xmlns:gmlwcs='http://www.opengis.net/wcs/2.0/gml'
+ xsi:schemaLocation='http://www.opengis.net/wcs/2.0/gml ../gml/gmlwcsAll.xsd' gml:id="coverage1">
+ <domainSet>
+ <Grid dimension="2" gml:id="grid1">
+ <limits>
+ <GridEnvelope>
+ <!-- This is a 5-by-3 matrix -->
+ <low>1 1</low>
+ <high>5 3</high>
+ </GridEnvelope>
+ </limits>
+ <axisLabels>xAxis yAxis</axisLabels>
+ </Grid>
+ </domainSet>
+ <rangeSet>
+ <DataBlock>
+ <rangeParameters/>
+ <tupleList>
+ 1 2 3 4 5
+ 6 7 8 9 10
+ 11 12 13 14 15
+ </tupleList>
+ </DataBlock>
+ </rangeSet>
+ <gmlwcs:rangeStructure>
+ <gmlwcs:RangeStructure gml:id="RangeStructure1">
+ <gmlwcs:rangeField >
+ <gmlwcs:RangeField gml:id="Band1" uom="W/cm^2">
+ <gml:name>band1</gml:name>
+ <gmlwcs:dataType>urn:ogc:def:dataType:OGC:1.1:unsignedByte</gmlwcs:dataType>
+ <gmlwcs:nilValueList>000 255</gmlwcs:nilValueList>
+ </gmlwcs:RangeField>
+ </gmlwcs:rangeField>
+ </gmlwcs:RangeStructure>
+ </gmlwcs:rangeStructure>
+</gmlwcs:GridCoverage>
diff --git a/petascope/src/petascope/wcs2/schemas/Examples/wcsDescribeCoverage.xml b/petascope/src/petascope/wcs2/schemas/Examples/wcsDescribeCoverage.xml
new file mode 100644
index 0000000..047caed
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/Examples/wcsDescribeCoverage.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wcs:CoverageDescriptions xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xmlns:gmlwcs='http://www.opengis.net/wcs/2.0/gml'
+ xmlns:gml='http://www.opengis.net/gml/3.2'
+ xmlns:wcs='http://www.opengis.net/wcs/2.0'
+ xmlns='http://www.opengis.net/gml/3.2'
+ xsi:schemaLocation='http://www.opengis.net/wcs/2.0 http://localhost:8080/PetaScope/schemas/wcsAll.xsd'>
+ <wcs:CoverageDescription gml:id="rgb">
+ <domainSet>
+ <Grid dimension="2" gml:id="gridrgb">
+ <limits>
+ <GridEnvelope>
+ <low>0 0 </low>
+ <high>399 343 </high>
+
+ </GridEnvelope>
+ </limits>
+ <axisLabels>x y </axisLabels>
+ </Grid>
+ </domainSet>
+ <gmlwcs:rangeStructure>
+ <gmlwcs:RangeStructure gml:id="rangeStructure-rgb">
+ <gmlwcs:rangeField>
+
+ <gmlwcs:RangeField gml:id="range-1-red" uom="none">
+ <gml:name>red</gml:name>
+ <gmlwcs:dataType>urn:ogc:def:dataType:OGC:1.1:unsigned int</gmlwcs:dataType>
+ <gmlwcs:nilValueList></gmlwcs:nilValueList>
+ </gmlwcs:RangeField>
+ </gmlwcs:rangeField>
+ <gmlwcs:rangeField>
+ <gmlwcs:RangeField gml:id="range-1-green" uom="none">
+ <gml:name>green</gml:name>
+
+ <gmlwcs:dataType>urn:ogc:def:dataType:OGC:1.1:unsigned int</gmlwcs:dataType>
+ <gmlwcs:nilValueList></gmlwcs:nilValueList>
+ </gmlwcs:RangeField>
+ </gmlwcs:rangeField>
+ <gmlwcs:rangeField>
+ <gmlwcs:RangeField gml:id="range-1-blue" uom="none">
+ <gml:name>blue</gml:name>
+ <gmlwcs:dataType>urn:ogc:def:dataType:OGC:1.1:unsigned int</gmlwcs:dataType>
+
+ <gmlwcs:nilValueList></gmlwcs:nilValueList>
+ </gmlwcs:RangeField>
+ </gmlwcs:rangeField>
+
+ </gmlwcs:RangeStructure>
+ </gmlwcs:rangeStructure>
+ <wcs:ServiceParameters>
+ <wcs:supportedCrsList/>
+ <wcs:supportedFormatList>application/xml</wcs:supportedFormatList>
+
+ </wcs:ServiceParameters>
+ </wcs:CoverageDescription>
+
+</wcs:CoverageDescriptions>
diff --git a/petascope/src/petascope/wcs2/schemas/Examples/wcsGetCapabilities.xml b/petascope/src/petascope/wcs2/schemas/Examples/wcsGetCapabilities.xml
new file mode 100644
index 0000000..3d33e03
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/Examples/wcsGetCapabilities.xml
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wcs:Capabilities xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xmlns:ows='http://www.opengis.net/ows/1.1'
+ xmlns:wcs='http://www.opengis.net/wcs/2.0'
+ xmlns:gml='http://www.opengis.net/gml/3.2'
+ xmlns='http://www.opengis.net/ows/1.1'
+ xmlns:xlink='http://www.w3.org/1999/xlink'
+ xsi:schemaLocation='http://www.opengis.net/wcs/2.0 http://localhost:8080/PetaScope/schemas/wcsAll.xsd' version="2.0.0">
+ <ServiceIdentification>
+ <Title>WCS 2.0 Coverage Server @ Jacobs University</Title>
+ <Abstract>WCS 2.0 Server developed at jacobs University</Abstract>
+ <ServiceType>OGC WCS</ServiceType>
+ <ServiceTypeVersion>2.0.0</ServiceTypeVersion>
+ <Profile>urn:ogc:def:extension:OGC-WCS:2.0:protocol:post</Profile>
+
+ <Profile>urn:ogc:def:extension:OGC-WCS:2.0:serviceModel:wcps:1.0</Profile>
+ <Profile>urn:ogc:def:extension:OGC-WCS:2.0:serviceModel:wcst:1.0</Profile>
+ </ServiceIdentification>
+ <ServiceProvider>
+ <ProviderName>Jacobs University Bremen</ProviderName>
+ <ows:ProviderSite xlink:href="http://www.petascope.org/"/>
+ <ServiceContact>
+
+ <ows:IndividualName>Prof. Dr. Peter Baumann</ows:IndividualName>
+ <ows:ContactInfo>
+ <ows:Address>
+ <ows:City>Bremen</ows:City>
+ <ows:PostalCode>28717</ows:PostalCode>
+ <ows:Country>Germany</ows:Country>
+ <ows:ElectronicMailAddress>p.baumann@jacobs-university.de</ows:ElectronicMailAddress>
+
+ </ows:Address>
+ </ows:ContactInfo>
+ <ows:Role>Project Leader</ows:Role>
+ </ServiceContact>
+ </ServiceProvider>
+ <OperationsMetadata>
+ <Operation name="GetCapabilities">
+ <DCP>
+
+ <HTTP>
+ <Get xlink:href="http://localhost:8080/PetaScope/earthlook"/>
+ </HTTP>
+ </DCP>
+ <Parameter name="Format">
+ <AllowedValues>
+ <Value>text/xml</Value>
+ </AllowedValues>
+
+ </Parameter>
+ <Constraint name="PostEncoding">
+ <AllowedValues>
+ <Value>XML</Value>
+ </AllowedValues>
+ </Constraint>
+ </Operation>
+ <Operation name="DescribeCoverage">
+
+ <DCP>
+ <HTTP>
+ <Get xlink:href="http://localhost:8080/PetaScope/earthlook"/>
+ </HTTP>
+ </DCP>
+ <Parameter name="Format">
+ <AllowedValues>
+ <Value>text/xml</Value>
+
+ </AllowedValues>
+ </Parameter>
+ <Constraint name="PostEncoding">
+ <AllowedValues>
+ <Value>XML</Value>
+ </AllowedValues>
+ </Constraint>
+ </Operation>
+
+ <Operation name="GetCoverage">
+ <DCP>
+ <HTTP>
+ <Get xlink:href="http://localhost:8080/PetaScope/earthlook"/>
+ </HTTP>
+ </DCP>
+ <Parameter name="Format">
+ <AllowedValues>
+ <Value>text/xml</Value>
+
+ </AllowedValues>
+ </Parameter>
+ <Constraint name="PostEncoding">
+ <AllowedValues>
+ <Value>XML</Value>
+ </AllowedValues>
+ </Constraint>
+ </Operation>
+
+ </OperationsMetadata>
+ <wcs:Contents>
+ <wcs:id gml:id="NIR"/>
+ <wcs:id gml:id="Waha_SEGY"/>
+ <wcs:id gml:id="mr"/>
+ <wcs:id gml:id="climate_clouds"/>
+ <wcs:id gml:id="rgb"/>
+ <wcs:id gml:id="climate_earth"/>
+ <wcs:id gml:id="climate_temperature"/>
+ <wcs:id gml:id="Modis"/>
+ <wcs:id gml:id="TP"/>
+ <wcs:id gml:id="whatevereeeee"/>
+ <wcs:id gml:id="Boonsville_SEGY"/>
+ <wcs:id gml:id="mowglie"/>
+ <wcs:id gml:id="NN3_2"/>
+ <wcs:id gml:id="NN3_3"/>
+ <wcs:id gml:id="NN3_1"/>
+ <wcs:id gml:id="NN3_6"/>
+ <wcs:id gml:id="NN3_7"/>
+ <wcs:id gml:id="NN3_4"/>
+ <wcs:id gml:id="NN3_10"/>
+ <wcs:id gml:id="NN3_5"/>
+ <wcs:id gml:id="nrg"/>
+ <wcs:id gml:id="NN3_11"/>
+ <wcs:id gml:id="NN3_8"/>
+ <wcs:id gml:id="NN3_9"/>
+ </wcs:Contents>
+ <wcs:WcsServiceMetadata />
+
+</wcs:Capabilities>
diff --git a/petascope/src/petascope/wcs2/schemas/Examples/wcsGetCoverage.xml b/petascope/src/petascope/wcs2/schemas/Examples/wcsGetCoverage.xml
new file mode 100644
index 0000000..371a714
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/Examples/wcsGetCoverage.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gmlwcs:GridCoverage xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xmlns:gml='http://www.opengis.net/gml/3.2'
+ xmlns='http://www.opengis.net/gml/3.2'
+ xmlns:gmlwcs='http://www.opengis.net/wcs/2.0/gml'
+ xsi:schemaLocation='http://www.opengis.net/wcs/2.0/gml http://kahlua.eecs.jacobs-university.de:8080/petascope/schemas/gml/gmlwcsAll.xsd' gml:id="rgb0.2964005133273092">
+ <domainSet>
+ <Grid dimension="2" gml:id="grid-rgb">
+ <limits>
+ <GridEnvelope>
+ <low>200 200</low>
+ <high>219 209</high>
+ </GridEnvelope>
+
+ </limits>
+ <axisLabels>x y</axisLabels>
+ </Grid>
+ </domainSet>
+ <rangeSet>
+ <DataBlock>
+ <rangeParameters/>
+ <tupleList>
+
+ 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 242,27,103 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 242,27,103 204,0,88 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 204,0,88 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 242,27,103 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 204,0,88 242,27,103 242,27,103 242,27,10
+ </tupleList>
+ </DataBlock>
+ </rangeSet>
+ <gmlwcs:rangeStructure>
+ <gmlwcs:RangeStructure gml:id="rangeStructure-1">
+ <gmlwcs:rangeField>
+ <gmlwcs:RangeField gml:id="range-1-red">
+ <gml:name>red</gml:name>
+
+ <gmlwcs:dataType>urn:ogc:def:dataType:OGC:1.1:unsigned int</gmlwcs:dataType>
+ <gmlwcs:nilValueList>0</gmlwcs:nilValueList>
+ </gmlwcs:RangeField>
+ </gmlwcs:rangeField>
+ <gmlwcs:rangeField>
+ <gmlwcs:RangeField gml:id="range-1-green">
+ <gml:name>green</gml:name>
+ <gmlwcs:dataType>urn:ogc:def:dataType:OGC:1.1:unsigned int</gmlwcs:dataType>
+
+ <gmlwcs:nilValueList>0</gmlwcs:nilValueList>
+ </gmlwcs:RangeField>
+ </gmlwcs:rangeField>
+ <gmlwcs:rangeField>
+ <gmlwcs:RangeField gml:id="range-1-blue">
+ <gml:name>blue</gml:name>
+ <gmlwcs:dataType>urn:ogc:def:dataType:OGC:1.1:unsigned int</gmlwcs:dataType>
+ <gmlwcs:nilValueList>0</gmlwcs:nilValueList>
+
+ </gmlwcs:RangeField>
+ </gmlwcs:rangeField>
+
+ </gmlwcs:RangeStructure>
+ </gmlwcs:rangeStructure>
+</gmlwcs:GridCoverage>
diff --git a/petascope/src/petascope/wcs2/schemas/SchemaServlet.java b/petascope/src/petascope/wcs2/schemas/SchemaServlet.java
new file mode 100644
index 0000000..231d7a5
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/SchemaServlet.java
@@ -0,0 +1,96 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs2.schemas;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.PrintWriter;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.apache.commons.io.IOUtils;
+
+/** Servlet that handles GET requests for the WCS 2.0 schema files.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class SchemaServlet extends HttpServlet {
+
+ /**
+ * Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("application/xml;charset=UTF-8");
+ PrintWriter out = response.getWriter();
+ try {
+ String schemaFile = request.getPathInfo();
+ String pathPrefix = "/xml/ogc/wcs/2.0.0/";
+ File file = new File(getServletContext().getRealPath(pathPrefix + schemaFile));
+ String fileContents = IOUtils.toString(new FileReader(file));
+ out.write(fileContents);
+ } finally {
+ out.close();
+ }
+ }
+
+ /**
+ * Handles the HTTP <code>GET</code> method.
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Handles the HTTP <code>POST</code> method.
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }
+}
diff --git a/petascope/src/petascope/wcs2/schemas/gml/Examples/2dIdentityConversion.xml b/petascope/src/petascope/wcs2/schemas/gml/Examples/2dIdentityConversion.xml
new file mode 100644
index 0000000..994917e
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/gml/Examples/2dIdentityConversion.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Conversion xmlns="http://www.opengis.net/gml/3.2"
+ xmlns:gml="http://www.opengis.net/gml/3.2"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd"
+ gml:id="IdentityConversion2D">
+ <!-- Example for a 2-D CRS identity conversion as defined in the GML 3.2.1 Application Schema for WCS 2.0 -->
+ <!-- Last updated 2010-01-11 -->
+ <!-- =============================================== -->
+ <identifier codeSpace="urn:ogc:def:method:WCS-SWG:2.0:">IdentityConversion2D</identifier>
+ <name>Identity Conversion 2D</name>
+ <remarks>none provided </remarks>
+ <scope>not known</scope>
+ <method xlink:href="urn:ogc:def:method:WCS-SWG:2.0:IdentityMethod2D"/>
+</Conversion>
diff --git a/petascope/src/petascope/wcs2/schemas/gml/Examples/2dIdentityMethod.xml b/petascope/src/petascope/wcs2/schemas/gml/Examples/2dIdentityMethod.xml
new file mode 100644
index 0000000..949036f
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/gml/Examples/2dIdentityMethod.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<OperationMethod xmlns="http://www.opengis.net/gml/3.2"
+ xmlns:gml="http://www.opengis.net/gml/3.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd"
+ gml:id="IdentityMethod2D">
+ <!-- Example for a 2-D CRS identity transformation as defined in the GML 3.2.1 Application Schema for WCS 2.0 -->
+ <!-- Last updated 2010-01-11 -->
+ <!-- =============================================== -->
+ <identifier codeSpace="urn:ogc:def:method:WCS-SWG:2.0:">IdentityMethod2D</identifier>
+ <name>Identity Method 2D</name>
+ <remarks>Method for use by a Coordinate Conversion for the identity transformation of two coordinates </remarks>
+ <methodFormula>This coordinate converion shall be as specified by the equations:
+ BaseX = DerivedX
+ BaseY = DerivedY
+where
+ DerivedX, DerivedY are position coordinates in the derived 2D CRS
+ BaseX, BaseY are position coordinates in the 2D base CRS
+ </methodFormula>
+ <sourceDimensions>2</sourceDimensions>
+ <targetDimensions>2</targetDimensions>
+</OperationMethod>
diff --git a/petascope/src/petascope/wcs2/schemas/gml/Examples/exampleRangeStructure.xml b/petascope/src/petascope/wcs2/schemas/gml/Examples/exampleRangeStructure.xml
new file mode 100644
index 0000000..519a5a5
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/gml/Examples/exampleRangeStructure.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gmlwcs:rangeStructure
+ xmlns:gmlwcs="http://www.opengis.net/wcs/2.0/gml"
+ xmlns:gml="http://www.opengis.net/gml/3.2"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.opengis.net/wcs/2.0/gml ../gmlwcsAll.xsd">
+ <!-- Example for a coverage range structure as defined in the GML 3.2.1 Application Schema for WCS 2.0 -->
+ <!-- It models the red, green, and blue channel of a Landsat scene. Pixels are defined as unsigned 8-bit quantities where 0 and 255 denote null values. -->
+ <!-- Last updated 2010-01-11 -->
+ <!-- =============================================== -->
+ <gmlwcs:RangeStructure gml:id="RGB">
+ <gmlwcs:rangeField >
+ <gmlwcs:RangeField gml:id="Red" uom="W/cm^2">
+ <gml:name>red</gml:name>
+ <gmlwcs:dataType>UnsignedChar</gmlwcs:dataType>
+ <gmlwcs:nilValueList>000 255</gmlwcs:nilValueList>
+ </gmlwcs:RangeField>
+ </gmlwcs:rangeField>
+ <gmlwcs:rangeField >
+ <gmlwcs:RangeField gml:id="Green" uom="W/cm^2">
+ <gml:name>green</gml:name>
+ <gmlwcs:dataType>UnsignedChar</gmlwcs:dataType>
+ <gmlwcs:nilValueList>000 255</gmlwcs:nilValueList>
+ </gmlwcs:RangeField>
+ </gmlwcs:rangeField>
+ <gmlwcs:rangeField >
+ <gmlwcs:RangeField gml:id="Blue" uom="W/cm^2">
+ <gml:name>blue</gml:name>
+ <gmlwcs:dataType>UnsignedChar</gmlwcs:dataType>
+ <gmlwcs:nilValueList>000 255</gmlwcs:nilValueList>
+ </gmlwcs:RangeField>
+ </gmlwcs:rangeField>
+ </gmlwcs:RangeStructure>
+</gmlwcs:rangeStructure>
diff --git a/petascope/src/petascope/wcs2/schemas/gml/Examples/exampleRectifiedGridCoverage.xml b/petascope/src/petascope/wcs2/schemas/gml/Examples/exampleRectifiedGridCoverage.xml
new file mode 100644
index 0000000..9514ae7
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/gml/Examples/exampleRectifiedGridCoverage.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gmlwcs:RectifiedGridCoverage
+ xmlns:gmlwcs="http://www.opengis.net/wcs/2.0/gml"
+ xmlns:gml="http://www.opengis.net/gml/3.2"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.opengis.net/wcs/2.0/gml ../gmlwcsAll.xsd"
+ gml:id="Coverage1">
+ <!-- Example for a domain set for a rectified grid coverage as defined in the GML 3.2.1 Application Schema for WCS 2.0 -->
+ <!-- Last updated 2010-01-11 -->
+ <!-- =============================================== -->
+ <gml:domainSet>
+ <gml:RectifiedGrid gml:id="RectifiedGrid1" dimension="2" srsName="urn:ogc:def:crs:EPSG::4326">
+ <gml:limits>
+ <gml:GridEnvelope>
+ <gml:low>0 0</gml:low>
+ <gml:high>9999 9999</gml:high>
+ </gml:GridEnvelope>
+ </gml:limits>
+ <gml:axisLabels>column row</gml:axisLabels>
+ <gml:origin>
+ <gml:Point gml:id="Origin1" srsName="urn:ogc:def:crs:EPSG::4326">
+ <gml:pos>99.9 99.9</gml:pos>
+ </gml:Point>
+ </gml:origin>
+ <gml:offsetVector>1 0</gml:offsetVector>
+ <gml:offsetVector>0 1</gml:offsetVector>
+ </gml:RectifiedGrid>
+ </gml:domainSet>
+ <gml:rangeSet>
+ <gml:File>
+ <gml:rangeParameters xlink:href="TBDurl"/>
+ <gml:fileReference>TBDurlOfFile</gml:fileReference>
+ <gml:fileStructure>TBD</gml:fileStructure>
+ </gml:File>
+ </gml:rangeSet>
+ <gmlwcs:rangeStructure>
+ <gmlwcs:RangeStructure gml:id="RangeStructure1">
+ <gmlwcs:rangeField >
+ <gmlwcs:RangeField gml:id="White" uom="W/cm^2">
+ <gml:name>white</gml:name>
+ <gmlwcs:dataType>UnsignedChar</gmlwcs:dataType>
+ <gmlwcs:nilValueList>000 255</gmlwcs:nilValueList>
+ </gmlwcs:RangeField>
+ </gmlwcs:rangeField>
+ </gmlwcs:RangeStructure>
+ </gmlwcs:rangeStructure>
+ <gml:coverageFunction>
+ <gml:GridFunction>
+ <gml:sequenceRule axisOrder="+1 +2">Linear</gml:sequenceRule>
+ <gml:startPoint>0 0</gml:startPoint>
+ </gml:GridFunction>
+ </gml:coverageFunction>
+</gmlwcs:RectifiedGridCoverage>
+
diff --git a/petascope/src/petascope/wcs2/schemas/gml/Examples/exampleReferenceablGridCoverage.xml b/petascope/src/petascope/wcs2/schemas/gml/Examples/exampleReferenceablGridCoverage.xml
new file mode 100644
index 0000000..bc9de96
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/gml/Examples/exampleReferenceablGridCoverage.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gmlwcs:ReferenceableGridCoverage
+ xmlns:gmlwcs="http://www.opengis.net/wcs/2.0/gml"
+ xmlns:gml="http://www.opengis.net/gml/3.2"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.opengis.net/wcs/2.0/gml ../gmlwcsAll.xsd"
+ gml:id="Coverage1">
+ <!-- Example for a domain set for a rectified grid coverage containing a ReferencedGridByTransformation as defined in the GML 3.2.1 Application Schema for WCS 2.0 -->
+ <!-- Last updated 2010-01-11 -->
+ <!-- =============================================== -->
+ <gml:domainSet>
+ <gmlwcs:ReferencedGridByTransformation gml:id="ReferencedGrid1" dimension="2" srsName="InternalCRS1">
+ <gml:limits>
+ <gml:GridEnvelope>
+ <gml:low>0 0</gml:low>
+ <gml:high>9999 9999</gml:high>
+ </gml:GridEnvelope>
+ </gml:limits>
+ <gml:axisLabels>Column Row</gml:axisLabels>
+ <gmlwcs:gridCRS>
+ <gml:DerivedCRS gml:id="InternalCRS1">
+ <gml:identifier codeSpace="">InternalCRS1</gml:identifier>
+ <gml:scope>not known</gml:scope>
+ <gml:definedByConversion xlink:href="urn:ogc:coordinateOperation:WCS:2.0:IdentityConversion2D"/>
+ <gml:baseCRS xlink:href="urn:ogc:crs:OGC:1.0:Image:AAA999"/>
+ <gml:derivedCRSType codeSpace="">image</gml:derivedCRSType>
+ <gml:usesCS xlink:href="urn:ogc:def:cs:OGC:1.0:GridCS2d"/>
+ </gml:DerivedCRS>
+ </gmlwcs:gridCRS>
+ <gmlwcs:transformation xlink:href="TBDurl"/>
+ </gmlwcs:ReferencedGridByTransformation>
+ </gml:domainSet>
+ <gml:rangeSet>
+ <gml:File>
+ <gml:rangeParameters xlink:href="TBDurl"/>
+ <gml:fileReference>TBDurlOfFile</gml:fileReference>
+ <gml:fileStructure>TBD</gml:fileStructure>
+ </gml:File>
+ </gml:rangeSet>
+ <gmlwcs:rangeStructure>
+ <gmlwcs:RangeStructure gml:id="Panchromatic">
+ <gmlwcs:rangeField >
+ <gmlwcs:RangeField gml:id="White" uom="w/cm^2">
+ <gml:name>white</gml:name>
+ <gmlwcs:dataType>unsignedInteger</gmlwcs:dataType>
+ <gmlwcs:nilValueList>000 255</gmlwcs:nilValueList>
+ </gmlwcs:RangeField>
+ </gmlwcs:rangeField>
+ </gmlwcs:RangeStructure>
+ </gmlwcs:rangeStructure>
+ <gml:coverageFunction>
+ <gml:GridFunction>
+ <gml:sequenceRule axisOrder="+1 +2">Linear</gml:sequenceRule>
+ <gml:startPoint>0 0</gml:startPoint>
+ </gml:GridFunction>
+ </gml:coverageFunction>
+</gmlwcs:ReferenceableGridCoverage>
+
diff --git a/petascope/src/petascope/wcs2/schemas/gml/gmlwcsAll.xsd b/petascope/src/petascope/wcs2/schemas/gml/gmlwcsAll.xsd
new file mode 100644
index 0000000..ae0d949
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/gml/gmlwcsAll.xsd
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/wcs/2.0/gml"
+ xmlns:wcsgml="http://www.opengis.net/wcs/2.0/gml"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:gml="http://www.opengis.net/gml/3.2"
+ elementFormDefault="qualified" version="1.0.0">
+ <annotation>
+ <appinfo>gmlwcsAll.xsd</appinfo>
+ <documentation>This is the XML Schema for the GML 3.2.1 Application schema for WCS 2.0.
+ This XML Schema Document includes, directly and indirectly, all the XML Schema Documents defined by the GML 3.2.1 Application schema for WCS 2.0.
+ Last updated: 2010-jan-11
+ Copyright (c) 2010 Open Geospatial Consortium, Inc, All Rights Reserved.
+ To obtain additional rights of use, visit http://www.opengeospatial.org/legal/.
+ </documentation>
+ </annotation>
+ <!-- ========================================================= -->
+ <!-- Includes and imports -->
+ <!-- ========================================================= -->
+ <include schemaLocation="wcsCoverage.xsd"/>
+ <include schemaLocation="wcsGrids.xsd"/>
+</schema>
diff --git a/petascope/src/petascope/wcs2/schemas/gml/wcsCoverage.xsd b/petascope/src/petascope/wcs2/schemas/gml/wcsCoverage.xsd
new file mode 100644
index 0000000..5643a1d
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/gml/wcsCoverage.xsd
@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/wcs/2.0/gml"
+ xmlns:gmlwcs="http://www.opengis.net/wcs/2.0/gml"
+ xmlns:gml="http://www.opengis.net/gml/3.2"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified" version="1.0.0">
+ <annotation>
+ <appinfo source="urn:x-ogc:specification:wcs:gml-app-schema:schema-xsd:coverage:3.2.1">coverage.xsd</appinfo>
+ <documentation>Part of GML 3.2.1 Application schema for WCS 2.0.
+ Last updated: 2010-jan-11
+ Copyright (c) 2010 Open Geospatial Consortium, Inc. All Rights Reserved.
+ To obtain additional rights of use, visit http://www.opengeospatial.org/legal/.
+ </documentation>
+ </annotation>
+ <!-- ============================= -->
+ <!-- Includes and imports -->
+ <!-- ============================= -->
+ <import namespace="http://www.opengis.net/gml/3.2" schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd"/>
+ <!-- ============================= -->
+ <!-- Body of this schema -->
+ <!-- ============================= -->
+ <element name="AbstractCoverage" type="gmlwcs:CoverageType" abstract="true" substitutionGroup="gml:AbstractCoverage">
+ <annotation>
+ <documentation>Extends gml:AbstractCoverage as needed for WCS 2.0, by adding a rangeStructure property. </documentation>
+ </annotation>
+ </element>
+ <!-- ============================================================= -->
+ <complexType name="CoverageType">
+ <annotation>
+ <documentation>The gml:coverageFunction property is included here, because it is included in both discrete and continuous coverages. This permits coverages in the gmlwcs:AbstractCoverage substitutionGroup to be used for either discrete and continuous coverages, in preparation for expected future elimination of this distinction. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractCoverageType">
+ <sequence>
+ <element ref="gmlwcs:rangeStructure"/>
+ <element ref="gml:coverageFunction" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ============================================================= -->
+ <element name="GridCoverage" type="gmlwcs:CoverageType" substitutionGroup="gmlwcs:AbstractCoverage">
+ <annotation>
+ <documentation>A GridCoverage is a discrete point coverage in which the domain is a geometric grid of points.
+Note that this is the same as the MultiPointCoverage except that we have a gml:Grid to describe the domain.
+This simple grid coverage is not geometrically referenced to the earth, and hence no geometric positions are assignable to the points in the grid. Such geometric positioning is introduced in the RectifiedGridCoverage.
+Redefinition needed in order to benefit from the changes to the abstract ancestor AbstractCoverage.
+ </documentation>
+ <documentation>Since this GridCoverage uses the gmlwcs:CoverageType, it can be used for both discrete and continuous coverages. </documentation>
+ </annotation>
+ </element>
+ <!-- ============================================================= -->
+ <element name="RectifiedGridCoverage" type="gmlwcs:CoverageType" substitutionGroup="gmlwcs:AbstractCoverage">
+ <annotation>
+ <documentation>A RectifiedGridCoverage is a discrete point coverage based on a rectified grid. It is similar to the grid coverage except that the points of the grid are geometrically referenced. The rectified grid coverage has a domain that is a gml:RectifiedGrid geometry.
+ Redefinition needed in order to benefit from the changes to the abstract ancestor AbstractCoverage.
+ </documentation>
+ <documentation>Since this RectifiedGridCoverage uses the gmlwcs:CoverageType, it can be used for both discrete and continuous coverages. </documentation>
+ </annotation>
+ </element>
+ <!-- ============================================================= -->
+ <element name="ReferenceableGridCoverage" type="gmlwcs:CoverageType" substitutionGroup="gmlwcs:AbstractCoverage">
+ <annotation>
+ <documentation>A ReferenceableGridCoverage is an implementation of ISO 19123 CV_DiscreteGridPointCoverage for a CV_ReferenceableGrid domain. It is a coverage based on a referenceable grid and has a domain geometry that is in the substitution group of AbstractReferenceableGrid.</documentation>
+ <documentation>This equivalent of this element is being added to GML 3.2.1 by approved Change Request 07-112r3. </documentation>
+ <documentation>Since this ReferenceableGridCoverage uses the gmlwcs:CoverageType, it can be used for both discrete and continuous coverages. </documentation>
+ </annotation>
+ </element>
+ <!-- =============================================================
+ RangeStructure defines the structure of a coverage in WCS 2.0
+ ============================================================= -->
+ <element name="rangeStructure" type="gmlwcs:RangeStructurePropertyType">
+ <annotation>
+ <documentation>The rangeStructure property includes or references the RangeStructure, introduced for coverage definitions used by WCS 2.0. </documentation>
+ </annotation>
+ </element>
+ <!-- ============================================================= -->
+ <complexType name="RangeStructurePropertyType">
+ <sequence minOccurs="0">
+ <element ref="gmlwcs:RangeStructure"/>
+ </sequence>
+ <attributeGroup ref="gml:OwnershipAttributeGroup"/>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ============================================================= -->
+ <element name="RangeStructure" type="gmlwcs:RangeStructureType" substitutionGroup="gml:AbstractGML">
+ <annotation>
+ <documentation>The RangeStructure element describes the structure of a coverage's range, introduced for coverage definitions used by WCS 2.0. </documentation>
+ </annotation>
+ </element>
+ <!-- ============================================================= -->
+ <complexType name="RangeStructureType">
+ <complexContent>
+ <extension base="gml:AbstractGMLType">
+ <sequence>
+ <element ref="gmlwcs:rangeField" maxOccurs="unbounded"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ============================================================= -->
+ <element name="rangeField" type="gmlwcs:RangeFieldPropertyType">
+ <annotation>
+ <documentation>The RangeField property includes or references one RangeField element. </documentation>
+ </annotation>
+ </element>
+ <!-- ============================================================= -->
+ <complexType name="RangeFieldPropertyType">
+ <sequence minOccurs="0">
+ <element name="RangeField" type="gmlwcs:RangeFieldType"/>
+ </sequence>
+ <attributeGroup ref="gml:OwnershipAttributeGroup"/>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ============================================================= -->
+ <element name="RangeField" type="gmlwcs:RangeFieldType" substitutionGroup="gml:AbstractGML">
+ <annotation>
+ <documentation>The RangeField element describes the structure of one Field of a coverage's range. </documentation>
+ </annotation>
+ </element>
+ <!-- ============================================================= -->
+ <complexType name="RangeFieldType">
+ <complexContent>
+ <extension base="gml:AbstractGMLType">
+ <annotation>
+ <documentation>The gml:name should be used for the unique identifier of this RangeField. </documentation>
+ </annotation>
+ <sequence>
+ <element name="dataType" type="gmlwcs:DataType"/>
+ <element ref="gmlwcs:nilValueList"/>
+ </sequence>
+ <attribute name="uom" type="gml:UomIdentifier" use="optional">
+ <annotation>
+ <documentation>Identifier of the Unit of Measure applicable to values of this RangeField. </documentation>
+ </annotation>
+ </attribute>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ============================================================= -->
+ <complexType name="DataType">
+ <simpleContent>
+ <restriction base="gml:CodeType">
+ <attribute name="codeSpace" type="anyURI" use="optional" default="http://schemas.opengis.net/wcs/2.0/gml/wcsDataTypeIdentifiers.xml">
+ <annotation>
+ <documentation>This element will contain an URN that identifies the datatype of this field. The default gml:Dictionary of allowed values of this dataType is wcsDataTypeIdentifiers.xml. </documentation>
+ </annotation>
+ </attribute>
+ </restriction>
+ </simpleContent>
+ </complexType>
+ <!-- ============================================================= -->
+ <element name="nilValueList" type="gml:doubleList">
+ <annotation>
+ <documentation>List of the specific values of this RangeField that are used to designate non-valid values. </documentation>
+ </annotation>
+ </element>
+ <!-- ============================================================= -->
+</schema>
diff --git a/petascope/src/petascope/wcs2/schemas/gml/wcsDataTypeIdentifiers.xml b/petascope/src/petascope/wcs2/schemas/gml/wcsDataTypeIdentifiers.xml
new file mode 100644
index 0000000..bf10663
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/gml/wcsDataTypeIdentifiers.xml
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Dictionary xmlns="http://www.opengis.net/gml/3.2"
+ xmlns:gml="http://www.opengis.net/gml/3.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd"
+ gml:id="DataTypeIdentifiers">
+ <description>This dictionary specifies the standard values for dataType, specified in the WCS 2.0 GML 3.2.1 application schema. This dataType is for values of a RangeField. In addition, this dictionary specifies definition URNs in the "ogc" URN namespace for these values. This dictionary uses a currently unspecified simple dictionary profile of GML 3.2.1.
+ Definitions are compatible with XML Schema as of 28 October 2004 [http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/].
+ Identifiers do not have an associated unit of measure.
+ Last updated: 2010-jan-11
+ Copyright (c) 2010 Open Geospatial Consortium, Inc. All Rights Reserved.
+ To obtain additional rights of use, visit http://www.opengeospatial.org/legal/.
+ </description>
+ <identifier codeSpace="">DataTypeIdentifiers</identifier>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="boolean">
+ <description>Logical value; admissible values are "true" and "false" (in whatever case), as well as 0 (which shall represent "false") and 1 (which shall represent "true"). </description>
+ <identifier codeSpace="urn:ogc:def:dataType:OGC:1.1">boolean</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="integer">
+ <description>Positive or negative integer number without any limitation on maximum and minimum values. For expressing certain value range limitations the specialized types byte, shortInteger, int, and LongInteger are available. </description>
+ <identifier codeSpace="urn:ogc:def:dataType:OGC:1.1">long</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="unsignedInteger">
+ <description>Non-negative integer number without any limitation on minimum values. For expressing certain value range limitations the specialized types unsignedByte, unsignedShort, unsignedInt, and unsignedLong are available. </description>
+ <identifier codeSpace="urn:ogc:def:dataType:OGC:1.1">unsignedInteger</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="byte">
+ <description>Positive or negative integer number with values between -128 anf 127. </description>
+ <identifier codeSpace="urn:ogc:def:dataType:OGC:1.1">byte</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="unsignedByte">
+ <description>Non-negative integer number with values between 0 and 255. </description>
+ <identifier codeSpace="urn:ogc:def:dataType:OGC:1.1">unsignedByte</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="short">
+ <description>Positive or negative integer number with values between -32768 and 32767, which allows for a representation with 16 bits. </description>
+ <identifier codeSpace="urn:ogc:def:dataType:OGC:1.1">short</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="unsignedShort">
+ <description>Non-negative integer number with values between 0 and 65535, which allows for a representation with 16 bits. </description>
+ <identifier codeSpace="urn:ogc:def:dataType:OGC:1.1">unsignedShort</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="int">
+ <description>Positive or negative integer number with values between -2147483648 and 2147483647, which allows for a representation with 32 bits. </description>
+ <identifier codeSpace="urn:ogc:def:dataType:OGC:1.1">int</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="unsignedInt">
+ <description>Non-negative integer number with values between 0 and 4294967295, which allows for a representation with 32 bits. </description>
+ <identifier codeSpace="urn:ogc:def:dataType:OGC:1.1">unsignedInt</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="long">
+ <description>Positive or negative integer number with values between -9223372036854775808 and 9223372036854775807, which allows for a representation with 64 bits. </description>
+ <identifier codeSpace="urn:ogc:def:dataType:OGC:1.1">long</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="unsignedLong">
+ <description>Non-negative integer number with values between 0 and 18446744073709551616, which allows for a representation with 64 bits. </description>
+ <identifier codeSpace="urn:ogc:def:dataType:OGC:1.1">unsignedLong</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="float">
+ <description>Single-precision floating point number according to IEEE 754-1985. </description>
+ <identifier codeSpace="urn:ogc:def:dataType:OGC:1.1">double</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="double">
+ <description>Double-precision floating point number according to IEEE 754-1985. </description>
+ <identifier codeSpace="urn:ogc:def:dataType:OGC:1.1">double</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+</Dictionary>
+
diff --git a/petascope/src/petascope/wcs2/schemas/gml/wcsGrids.xsd b/petascope/src/petascope/wcs2/schemas/gml/wcsGrids.xsd
new file mode 100644
index 0000000..587e25d
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/gml/wcsGrids.xsd
@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/wcs/2.0/gml"
+ xmlns:gmlwcs="http://www.opengis.net/wcs/2.0/gml"
+ xmlns:gml="http://www.opengis.net/gml/3.2"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified" version="1.0.0" xml:lang="en">
+ <annotation>
+ <appinfo>wcsGrids.xsd</appinfo>
+ <documentation>This XML Schema Document encodes extensions to GML 3.2.1 for grids that are referenced by a Transformation, named "ReferencedGridByTransformation". This document also extends the alternatives allowed in gml:ParameterValueType as expected to be needed by such Transformations.
+ Last updated: 2010-jan-11
+ Copyright (c) 2010 Open Geospatial Consortium, Inc. All Rights Reserved.
+ To obtain additional rights of use, visit http://www.opengeospatial.org/legal/.
+ </documentation>
+ </annotation>
+ <!-- ============================================================== -->
+ <!-- Includes and imports -->
+ <!-- ============================================================== -->
+ <import namespace="http://www.opengis.net/gml/3.2" schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd"/>
+ <!-- ============================================================== -->
+ <!-- Elements and types -->
+ <!-- ============================================================== -->
+ <element name="AbstractReferenceableGrid" type="gmlwcs:AbstractReferenceableGridType" abstract="true" substitutionGroup="gml:Grid">
+ <annotation>
+ <documentation>AbstractReferenceableGrid is an encoding of CV_ReferenceableGrid in ISO 19123. AbstractReferenceableGrid is the head of a substitution group that may include multiple concrete implementations.
+
+A referenceable grid is a grid associated with a transformation that can be used to convert grid coordinate values to values of coordinates referenced to an external coordinate reference system [ISO 19123]. The transformation between grid coordinates and ‘external’ coordinates is usually non-affine, and may take different forms. It may be described analytically (e.g., through parametrised mathematical image rectification models); or it may provided in a table, for instance, relating the grid points to coordinates in the external coordinate reference system [ISO 19123, §8.2.1].
+
+The inherited attribute group gml:SRSReferenceGroup shall link the referenceable grid to the internal coordinate reference system of the grid.
+ </documentation>
+ <documentation>This element and its type are copied from approved Change Request 07-112r3, which adds them to GML 3.2.1. </documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="AbstractReferenceableGridType" abstract="true">
+ <complexContent>
+ <extension base="gml:GridType"/>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="referenceableGridProperty" type="gmlwcs:ReferenceableGridPropertyType">
+ <annotation>
+ <documentation>This element and its type are copied from approved Change Request 07-112r3, which adds them to GML 3.2.1. </documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="ReferenceableGridPropertyType">
+ <sequence>
+ <element ref="gmlwcs:AbstractReferenceableGrid"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ <attributeGroup ref="gml:OwnershipAttributeGroup"/>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="ReferencedGridByTransformation" type="gmlwcs:ReferencedGridByTransformationType" substitutionGroup="gmlwcs:AbstractReferenceableGrid">
+ <annotation>
+ <documentation>ReferencedGridByTransformation encodes one type of CV_ReferenceableGrid as defined in ISO 19123, using a gml:Transformation or gml:ConcatenatedOperation to specify the relationship between positions in the grid and corresponding positions in another CRS. This encoding also generalises CV_ReferenceableGrid to allow including more than one referencing Transformation. </documentation>
+ <documentation>This element and its type are copied from Change Request 09-091r1, which adds them to GML 3.2.1. </documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="ReferencedGridByTransformationType">
+ <complexContent>
+ <extension base="gmlwcs:AbstractReferenceableGridType">
+ <sequence>
+ <element ref="gmlwcs:gridCRS" minOccurs="0">
+ <annotation>
+ <documentation>The gridCRS is a composition association to the definition of the internal CRS for this extended gml:Grid. This definition shall be the one referenced by the gml:srsName attribute in the gml:GridType. This CRS definition shall be included here if its definition is needed by some data receivers and is not otherwise available using that gml:srsName value. </documentation>
+ </annotation>
+ </element>
+ <choice maxOccurs="unbounded">
+ <annotation>
+ <documentation>This choice encodes an unordered list of associations to coordinate Transformations or Concatenated Operations that each (geo)reference this ReferenceableGrid. Each of these Transformations or Concatenated Operations shall reference the internal CRS for this extended gml:Grid, as either its sourceCRS or targetCRS. This transformation association may be repeated when this ReferencedGridByTransformation is referenced to more than one other CRS, and/or is referenced to the same other CRS by multiple Transformation versions. </documentation>
+ </annotation>
+ <element name="transformation" type="gml:TransformationPropertyType"/>
+ <element name="concatenatedOperation" type="gml:ConcatenatedOperationPropertyType"/>
+ </choice>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="gridCRS" type="gmlwcs:GridCRSPropertyType">
+ <annotation>
+ <documentation>The gridCRS is a composition association to the definition of the internal CRS for this extended gml:Grid. This internal CRS may be a DerivedCRS, EngineeringCRS, ImageCRS, or CompoundCRS. However, proposed OGC Best Practices Paper 09-085r1 recommends that this internal CRS always be a DerivedCRS. </documentation>
+ <documentation>This element and its type are copied from Change Request 09-091r1, which adds them to GML 3.2.1. </documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="GridCRSPropertyType">
+ <sequence>
+ <element ref="gml:AbstractCRS"/>
+ </sequence>
+ </complexType>
+ <!-- =========================================================== -->
+ <!-- =========================================================== -->
+ <element name="ParameterValue" type="gmlwcs:ParameterValueType" substitutionGroup="gml:AbstractGeneralParameterValue">
+ <annotation>
+ <documentation>Extends gml:ParameterValue to also allow values that are a gml:Geometry or a gml:vector. </documentation>
+ <documentation>This element and its type are copied from Change Request 09-091r1, which adds them to GML 3.2.1. </documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="ParameterValueType">
+ <complexContent>
+ <extension base="gml:AbstractGeneralParameterValueType">
+ <sequence>
+ <choice>
+ <element ref="gml:value"/>
+ <element ref="gml:dmsAngleValue"/>
+ <element ref="gml:stringValue"/>
+ <element ref="gml:integerValue"/>
+ <element ref="gml:booleanValue"/>
+ <element ref="gml:valueList"/>
+ <element ref="gml:integerValueList"/>
+ <element ref="gml:valueFile"/>
+ <element ref="gmlwcs:geometryValue"/>
+ <element ref="gmlwcs:vectorValue"/>
+ </choice>
+ <element ref="gml:operationParameter"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="geometryValue" type="gml:GeometryPropertyType">
+ <annotation>
+ <documentation>A geometry used as a coordinate operation parameter value, which contains any type of geometry element, with a reference to its associated coordinate reference system. </documentation>
+ <documentation>This element and its type are copied from Change Request 09-091r1, which adds them to GML 3.2.1. </documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <element name="vectorValue" type="gml:VectorType">
+ <annotation>
+ <documentation>Vector value of a coordinate operation parameter. A vectorValue can represent a distance in a direction (when the magnitude of the vector is significant) or just a direction (when the magnitude of the vector is not considered significant). This vectorValue shall use the coordinate axes directions and units of the coordinate system in the referenced coordinate reference system. This coordinate reference system will often be the same as referenced by an associated geometryValue coordinate operation parameter. </documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <!-- =========================================================== -->
+ <element name="SimpleMultiPoint" type="gmlwcs:SimpleMultiPointType" substitutionGroup="gml:AbstractGeometricAggregate">
+ <annotation>
+ <documentation>gml:SimpleMultiPoint implements, and provides a simplified encoding for, ISO 19107 GM_MultiPoint (see ISO 19107:2003, 6.5.4). A gml:SimpleMultiPoint consists of a list of DirectPositions. </documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="SimpleMultiPointType">
+ <complexContent>
+ <extension base="gml:AbstractGeometricAggregateType">
+ <sequence>
+ <element name="positions" type="gml:DirectPositionListType"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+</schema>
diff --git a/petascope/src/petascope/wcs2/schemas/wcsAll.xsd b/petascope/src/petascope/wcs2/schemas/wcsAll.xsd
new file mode 100644
index 0000000..21f0e83
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/wcsAll.xsd
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/wcs/2.0"
+ xmlns:wcs="http://www.opengis.net/wcs/2.0"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified" version="2.0.0" xml:lang="en">
+ <annotation>
+ <appinfo>wcsAll.xsd</appinfo>
+ <documentation>This XML Schema Document includes, directly and indirectly, all the XML Schema Documents defined by the OGC Web Coverage Service (WCS).
+ Last updated: 2010-jan-11
+ Copyright (c) 2010 Open Geospatial Consortium, Inc, All Rights Reserved.
+ To obtain additional rights of use, visit http://www.opengeospatial.org/legal/.
+ </documentation>
+ </annotation>
+ <!-- ============================================================== -->
+ <!-- includes and imports -->
+ <!-- ============================================================== -->
+ <import namespace="http://www.opengis.net/wcs/2.0/gml" schemaLocation="gml/gmlwcsAll.xsd"/>
+ <include schemaLocation="wcsGetCoverage.xsd"/>
+ <include schemaLocation="wcsDescribeCoverage.xsd"/>
+ <include schemaLocation="wcsGetCapabilities.xsd"/>
+</schema>
diff --git a/petascope/src/petascope/wcs2/schemas/wcsCommon.xsd b/petascope/src/petascope/wcs2/schemas/wcsCommon.xsd
new file mode 100644
index 0000000..c1d5b33
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/wcsCommon.xsd
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/wcs/2.0"
+ xmlns:wcs="http://www.opengis.net/wcs/2.0"
+ xmlns:ows="http://www.opengis.net/ows/1.1"
+ xmlns:gml="http://www.opengis.net/gml/3.2"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified" version="2.0.0" xml:lang="en">
+ <annotation>
+ <appinfo>wcsContents.xsd</appinfo>
+ <appinfo>
+ <GMLProfileSchema>http://schemas.opengis.net/wcs/2.0/gml/gmlwcsAll.xsd</GMLProfileSchema>
+ </appinfo>
+ <documentation>This XML Schema Document encodes the elements and types that are shared by multiple WCS operations.
+ Last updated: 2010-jan-11
+ Copyright (c) 2010 Open Geospatial Consortium, Inc, All Rights Reserved.
+ To obtain additional rights of use, visit http://www.opengeospatial.org/legal/.
+ </documentation>
+ </annotation>
+ <!-- ============================================================== -->
+ <!-- includes and imports -->
+ <!-- ============================================================== -->
+ <import namespace="http://www.opengis.net/gml/3.2" schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd"/>
+ <import namespace="http://www.opengis.net/ows/1.1" schemaLocation="http://schemas.opengis.net/ows/1.1.0/owsAll.xsd"/>
+ <!-- ============================================================== -->
+ <!-- elements and types -->
+ <!-- ============================================================== -->
+ <complexType name="RequestBaseType">
+ <annotation>
+ <documentation>XML encoded WCS operation request base, for all operations except GetCapabilities. In this XML encoding, no "request" parameter is included, since the element name specifies the specific operation. </documentation>
+ </annotation>
+ <sequence/>
+ <attribute name="service" type="string" use="required" fixed="WCS">
+ <annotation>
+ <documentation>Service type identifier, where the value is the OWS type abbreviation. For WCS operation requests, the value is "WCS". </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="version" type="wcs:VersionStringType" use="required">
+ <annotation>
+ <documentation>Specification version for WCS version and operation. See Version parameter Subclause 7.3.1 of OWS Common for more information. </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ <simpleType name="VersionStringType">
+ <restriction base="string">
+ <pattern value="2\.0\.\d+"/>
+ </restriction>
+ </simpleType>
+ <!-- =========================================================== -->
+ <element name="id" type="wcs:CoverageIdType">
+ <annotation>
+ <documentation>This element is a wrapper for the gml:id attribute. Needed to allow lists of identifiers. </documentation>
+ </annotation>
+ </element>
+ <complexType name="CoverageIdType">
+ <attribute ref="gml:id"/>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="ServiceParameters" type="wcs:ServiceParametersType"/>
+ <complexType name="ServiceParametersType">
+ <sequence>
+ <element name="supportedCrsList" type="wcs:CrsListType"/>
+ <element name="supportedFormatList" type="wcs:FormatListType"/>
+ </sequence>
+ </complexType>
+
+ <simpleType name="CrsListType">
+ <list itemType="anyURI"/>
+ </simpleType>
+ <simpleType name="FormatListType">
+ <list itemType="ows:MimeType"/>
+ </simpleType>
+ <!-- =========================================================== -->
+ <element name="WcsServiceMetadata" type="wcs:ServiceMetadataType"/>
+ <complexType name="ServiceMetadataType">
+ <sequence>
+ <!-- nothing defined here, it is a container for potential additions done by extensions -->
+ </sequence>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="Contents" type="wcs:ContentsType"/>
+ <complexType name="ContentsType">
+ <sequence>
+ <element ref="wcs:id" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+</schema>
+
diff --git a/petascope/src/petascope/wcs2/schemas/wcsDescribeCoverage.xsd b/petascope/src/petascope/wcs2/schemas/wcsDescribeCoverage.xsd
new file mode 100644
index 0000000..c3c4ec3
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/wcsDescribeCoverage.xsd
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/wcs/2.0"
+ xmlns:wcs="http://www.opengis.net/wcs/2.0"
+ xmlns:gml="http://www.opengis.net/gml/3.2"
+ xmlns:gmlwcs="http://www.opengis.net/wcs/2.0/gml"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified" version="2.0.0" xml:lang="en">
+ <annotation>
+ <appinfo>wcsDescribeCoverage.xsd</appinfo>
+ <appinfo>
+ <GMLProfileSchema>http://schemas.opengis.net/wcs/2.0/gml/gmlwcsAll.xsd</GMLProfileSchema>
+ </appinfo>
+ <documentation>This XML Schema Document defines the DescribeCoverage operation request and response XML elements and types, used by the OGC Web Coverage Service (WCS).
+ Last updated: 2010-jan-11
+ Copyright (c) 2010 Open Geospatial Consortium, Inc, All Rights Reserved.
+ To obtain additional rights of use, visit http://www.opengeospatial.org/legal/.
+ </documentation>
+ </annotation>
+ <!-- ============================================================== -->
+ <!-- includes and imports -->
+ <!-- ============================================================== -->
+ <import namespace="http://www.opengis.net/gml/3.2" schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd"></import>
+ <import namespace="http://www.opengis.net/wcs/2.0/gml" schemaLocation="gml/gmlwcsAll.xsd"/>
+ <include schemaLocation="wcsCommon.xsd"/>
+ <!-- ============================================================== -->
+ <!-- elements and types -->
+ <!-- ============================================================== -->
+ <element name="DescribeCoverage" type="wcs:DescribeCoverageType">
+ <annotation>
+ <documentation>Request to a WCS to perform the DescribeCoverage operation. This operation allows a client to retrieve descriptions of one or more coverages. In this XML encoding, no "request" parameter is included, since the element name specifies the specific operation. </documentation>
+ </annotation>
+ </element>
+ <complexType name="DescribeCoverageType">
+ <complexContent>
+ <extension base="wcs:RequestBaseType">
+ <sequence>
+ <element ref="wcs:id" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Unordered list of identifiers of desired coverages. A client can obtain identifiers by a prior GetCapabilities request, or from a third-party source. </documentation>
+ </annotation>
+ </element>
+ </sequence>
+ <attribute name="request" type="string" fixed="DescribeCoverage"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="CoverageDescriptions" type="wcs:CoverageDescriptionsType">
+ <annotation>
+ <documentation>Response from a WCS DescribeCoverage operation, containing one or more coverage descriptions. </documentation>
+ </annotation>
+ </element>
+ <complexType name="CoverageDescriptionsType">
+ <sequence>
+ <element name="CoverageDescription" type="wcs:CoverageDescriptionType" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <!-- =========================================================== -->
+ <complexType name="CoverageDescriptionType">
+ <annotation>
+ <documentation>Full description of coverages available from a WCS server. This description shall include sufficient information to allow all valid GetCoverage operation requests to be prepared by a WCS client. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractFeatureType">
+ <sequence>
+ <element ref="gml:domainSet"/>
+ <element ref="gmlwcs:rangeStructure"/>
+ <element ref="wcs:ServiceParameters"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+</schema>
diff --git a/petascope/src/petascope/wcs2/schemas/wcsExtensions.xml b/petascope/src/petascope/wcs2/schemas/wcsExtensions.xml
new file mode 100644
index 0000000..eff982d
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/wcsExtensions.xml
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Dictionary
+ xmlns:wcs="http://www.opengis.net/wcs/2.0"
+ xmlns:gml="http://www.opengis.net/gml/3.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://www.opengis.net/gml/3.2"
+ xsi:schemaLocation="http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd"
+ gml:id="WcsExtensions">
+ <description>
+ This dictionary specifies URNs and identifiers for WCS 2.0 extensions, to be communicated as part of a WCS GetCapabilities response. The dictionary is situated in the "ogc" namespace and uses a currently unspecified simple dictionary profile of GML 3.2.1.
+
+ Last updated: 2010-jan-11
+ Copyright (c) 2010 Open Geospatial Consortium, Inc. All Rights Reserved.
+ To obtain additional rights of use, visit http://www.opengeospatial.org/legal/.
+ </description>
+ <identifier codeSpace="">WcsExtensions</identifier>
+ <!-- ===================================================== -->
+ <!-- data model extensions -->
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="wcs_dataModel_nilValues">
+ <description>WCS 2.0 extension defining handling of nil values in a coverage. </description>
+ <identifier codeSpace="urn:ogc:def:extension:OGC-WCS:2.0:dataModel:nilValues">1.0</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="wcs_dataModel_uncertainty">
+ <description>WCS 2.0 extension defining handling of uncertainty in a coverage. </description>
+ <identifier codeSpace="urn:ogc:def:extension:OGC-WCS:2.0:dataModel:uncertainty">1.0</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <!-- service model extensions -->
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="wcs_serviceModel_metadata">
+ <description>WCS 2.0 extension defining advanced service metadata concepts. </description>
+ <identifier codeSpace="urn:ogc:def:extension:OGC-WCS:2.0:serviceModel:metadata">1.0</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="wcs_serviceModel_scaling">
+ <description>WCS 2.0 extension defining scaling and interpolation of coverages. </description>
+ <identifier codeSpace="urn:ogc:def:extension:OGC-WCS:2.0:serviceModel:scaling">1.0</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="wcs_serviceModel_crs">
+ <description>WCS 2.0 extension defining coordinate reference system (CRS) handling within coverages. </description>
+ <identifier codeSpace="urn:ogc:def:extension:OGC-WCS:2.0:serviceModel:crs">1.0</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="wcs_serviceModel_wcst">
+ <description>WCS 2.0 extension defining transactional (ie, update) services. </description>
+ <identifier codeSpace="urn:ogc:def:extension:OGC-WCS:2.0:serviceModel:wcst">1.0</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="wcs_serviceModel_wcps">
+ <description>WCS 2.0 extension defining coverage processing services. </description>
+ <identifier codeSpace="urn:ogc:def:extension:OGC-WCS:2.0:serviceModel:wcps">1.0</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <!-- protocol binding extensions -->
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="wcs_protocol_get">
+ <description>WCS 2.0 extension defining the HTTP GET / KVP protocol encoding. </description>
+ <identifier codeSpace="urn:ogc:def:extension:OGC-WCS:2.0:protocol:get">1.0</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="wcs_protocol_post">
+ <description>WCS 2.0 extension defining the HTTP POST / XML protocol encoding. </description>
+ <identifier codeSpace="urn:ogc:def:extension:OGC-WCS:2.0:protocol:post">1.0</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="wcs_protocol_soap">
+ <description>WCS 2.0 extension defining the SOAP protocol encoding. </description>
+ <identifier codeSpace="urn:ogc:def:extension:OGC-WCS:2.0:protocol:soap">1.0</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <!-- coverage encoding format extensions -->
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="wcs_coverageFormat_gml">
+ <description>WCS 2.0 extension defining use of the GML coverage encoding format. </description>
+ <identifier codeSpace="urn:ogc:def:extension:OGC-WCS:2.0:coverageFormat:gml">1.0</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="wcs_coverageFormat_geotiff">
+ <description>WCS 2.0 extension defining use of the GeoTIFF coverage encoding format. </description>
+ <identifier codeSpace="urn:ogc:def:extension:OGC-WCS:2.0:coverageFormat:geotiff">1.0</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="wcs_coverageFormat_netcdf">
+ <description>WCS 2.0 extension defining use of the NetCDF coverage encoding format. </description>
+ <identifier codeSpace="urn:ogc:def:extension:OGC-WCS:2.0:coverageFormat:netcdf">1.0</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <!-- usability extensions -->
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="wcs_usability_multilinguality">
+ <description>WCS 2.0 extension defining multilingual access to a WCS. </description>
+ <identifier codeSpace="urn:ogc:def:extension:OGC-WCS:2.0:usability:multilinguality">1.0</identifier>
+ </Definition>
+ </dictionaryEntry>
+</Dictionary>
diff --git a/petascope/src/petascope/wcs2/schemas/wcsGetCapabilities.xsd b/petascope/src/petascope/wcs2/schemas/wcsGetCapabilities.xsd
new file mode 100644
index 0000000..9996063
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/wcsGetCapabilities.xsd
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/wcs/2.0"
+ xmlns:wcs="http://www.opengis.net/wcs/2.0"
+ xmlns:ows="http://www.opengis.net/ows/1.1"
+ xmlns:gml="http://www.opengis.net/gml/3.2"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified" version="2.0.0" xml:lang="en">
+ <annotation>
+ <appinfo>wcsGetCapabilities.xsd</appinfo>
+ <documentation>This XML Schema Document encodes the GetCapabilities operation request and response used by the OGC Web Coverage Service (WCS).
+ Last updated: 2010-jan-11
+ Copyright (c) 2010 Open Geospatial Consortium, Inc, All Rights Reserved.
+ To obtain additional rights of use, visit http://www.opengeospatial.org/legal/.
+ </documentation>
+ </annotation>
+ <!-- ============================================================== -->
+ <!-- includes and imports -->
+ <!-- ============================================================== -->
+ <import namespace="http://www.opengis.net/ows/1.1" schemaLocation="http://schemas.opengis.net/ows/1.1.0/owsAll.xsd"/>
+ <import namespace="http://www.opengis.net/gml/3.2" schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd"/>
+ <include schemaLocation="wcsCommon.xsd"/>
+ <!-- ============================================================== -->
+ <!-- elements and types -->
+ <!-- ============================================================== -->
+ <element name="GetCapabilities" type="wcs:GetCapabilitiesType">
+ <annotation>
+ <documentation>Request to a WCS server to perform the GetCapabilities operation. This operation allows a client to retrieve a Capabilities XML document providing metadata for the specific WCS server. In this XML encoding, no "request" parameter is included, since the element name specifies the specific operation. </documentation>
+ </annotation>
+ </element>
+ <complexType name="GetCapabilitiesType">
+ <complexContent>
+ <extension base="ows:GetCapabilitiesType">
+ <sequence/>
+ <attribute name="request" type="string" fixed="GetCapabilities"/>
+ <attribute name="service" type="ows:ServiceType" use="required" fixed="WCS"/>
+ <attribute name="version" type="wcs:VersionStringType" use="required"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="Capabilities" type="wcs:CapabilitiesType">
+ <annotation>
+ <documentation>XML encoded WCS GetCapabilities operation response. The Capabilities document provides clients with service metadata about a specific service instance, including metadata about the coverages served. If the server does not implement the updateSequence parameter, the server shall always return the Capabilities document, without the updateSequence parameter. When the server implements the updateSequence parameter and the GetCapabilities operation request included the updateSequence parameter with the current value, the server shall return this element with only the "version" and "updateSequence" attributes. Otherwise, all optional sections shall be included or not depending on the actual value of the Contents parameter in the GetCapabilities operation request. </documentation>
+ </annotation>
+ </element>
+ <complexType name="CapabilitiesType">
+ <complexContent>
+ <extension base="ows:CapabilitiesBaseType">
+ <sequence>
+ <element ref="wcs:Contents"/>
+ <element ref="wcs:WcsServiceMetadata" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+</schema>
diff --git a/petascope/src/petascope/wcs2/schemas/wcsGetCoverage.xsd b/petascope/src/petascope/wcs2/schemas/wcsGetCoverage.xsd
new file mode 100644
index 0000000..57ef8ed
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/wcsGetCoverage.xsd
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/wcs/2.0"
+ xmlns:wcs="http://www.opengis.net/wcs/2.0"
+ xmlns:gml="http://www.opengis.net/gml/3.2"
+ xmlns:gmlwcs="http://www.opengis.net/wcs/2.0/gml"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified" version="2.0.0" xml:lang="en">
+ <annotation>
+ <appinfo>wcsGetCoverage.xsd</appinfo>
+ <documentation>This XML Schema Document defines the GetCoverage operation request elements and types, for the OGC Web Coverage Service (WCS).
+ The GetCoverage request element is GetCoverage. The GetCoverage response element is a specialization of gmlwcs:AbstractCoverage.
+ Last updated: 2010-jan-11
+ Copyright (c) 2007 Open Geospatial Consortium, Inc. All Rights Reserved.
+ To obtain additional rights of use, visit http://www.opengeospatial.org/legal/.
+ </documentation>
+ </annotation>
+ <!-- ============================================================== -->
+ <!-- includes and imports -->
+ <!-- ============================================================== -->
+ <import namespace="http://www.opengis.net/wcs/2.0/gml" schemaLocation="gml/gmlwcsAll.xsd"/>
+ <include schemaLocation="wcsCommon.xsd"/>
+ <!-- ============================================================== -->
+ <!-- elements and types -->
+ <!-- ============================================================== -->
+ <element name="GetCoverage" type="wcs:GetCoverageType">
+ <annotation>
+ <documentation>Request to a WCS to perform the GetCoverage operation. This operation allows a client to retrieve a subset of one coverage. </documentation>
+ </annotation>
+ </element>
+ <complexType name="GetCoverageType">
+ <complexContent>
+ <extension base="wcs:RequestBaseType">
+ <sequence>
+ <element ref="wcs:id">
+ <annotation>
+ <documentation>Identifier of the coverage that this GetCoverage operation request shall draw from. </documentation>
+ </annotation>
+ </element>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element name="trimDimension" type="wcs:DimensionTrimType"/>
+ <element name="sliceDimension" type="wcs:DimensionSliceType"/>
+ </choice>
+ </sequence>
+ <attribute name="request" type="string" fixed="GetCoverage"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ======================================================= -->
+ <!-- Domain subset types and elements -->
+ <!-- ======================================================= -->
+ <complexType name="DimensionSubsetType" abstract="true">
+ <annotation>
+ <documentation>Definition of the desired subset of the domain of the coverage. This is either a Trim operation, or a Slice operation.</documentation>
+ </annotation>
+ <sequence>
+ <element name="dimension" type="NCName"/>
+ </sequence>
+ </complexType>
+ <!-- ======================================================= -->
+ <complexType name="DimensionTrimType">
+ <annotation>
+ <documentation>Describes the trimming of a coverage's domain axis, between two values.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="wcs:DimensionSubsetType">
+ <sequence>
+ <element name="trimLow" type="double" minOccurs="0"/>
+ <element name="trimHigh" type="double" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ======================================================= -->
+ <complexType name="DimensionSliceType">
+ <annotation>
+ <documentation>Describes the slicing of a coverage's domain axis at a particular point.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="wcs:DimensionSubsetType">
+ <sequence>
+ <element name="slicePoint" type="double"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ======================================================= -->
+</schema>
+
diff --git a/petascope/src/petascope/wcs2/server/Wcs2Server.java b/petascope/src/petascope/wcs2/server/Wcs2Server.java
new file mode 100644
index 0000000..f7d11eb
--- /dev/null
+++ b/petascope/src/petascope/wcs2/server/Wcs2Server.java
@@ -0,0 +1,119 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs2.server;
+
+//~--- non-JDK imports --------------------------------------------------------
+import javax.servlet.ServletException;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import petascope.ConfigManager;
+
+import petascope.wcps.server.core.DbMetadataSource;
+
+import petascope.wcs.server.exceptions.WCSException;
+
+import petascope.wcs2.server.ops.DescribeCoverage;
+import petascope.wcs2.server.ops.GetCapabilities;
+import petascope.wcs2.server.ops.GetCoverage;
+
+//~--- JDK imports ------------------------------------------------------------
+/**
+ * The Web Coverage Service (WcsServer)
+ * This class provides methods for each of the WCS operations:
+ * - GetCapabilities
+ * - DescribeCoverage
+ * - GetCoverage
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class Wcs2Server {
+
+ private static Logger LOG = LoggerFactory.getLogger(Wcs2Server.class);
+
+ /* The Operations to delegate to */
+ private GetCapabilities capa;
+ private DescribeCoverage desc;
+ private GetCoverage getcov;
+
+ /* Globals */
+ private DbMetadataSource meta;
+
+ /**
+ * constructor
+ * @param settingsPath path to the "settings.properties" file
+ */
+ public Wcs2Server(String settingsPath, DbMetadataSource source) throws ServletException {
+ ConfigManager.getInstance(settingsPath, null);
+ meta = source;
+
+ try {
+ capa = new GetCapabilities(meta);
+ desc = new DescribeCoverage(meta);
+ getcov = new GetCoverage(meta);
+ } catch (Exception e) {
+ LOG.error("Could not init WCS 2.0");
+
+ throw new RuntimeException("Could not initialize WCS 2.0", e);
+ }
+ }
+
+ /**
+ * WcsServer GetCapabilities operation
+ */
+ public String GetCapabilities(String stringXml) throws WCSException {
+ LOG.trace("Received input:\n{}", stringXml);
+ LOG.info("Executing operation GetCapabilities...");
+ String result = capa.execute(stringXml);
+
+ LOG.info("GetCapabilities finished");
+
+ return result;
+ }
+
+ /**
+ * WcsServer DescribeCoverage operation
+ */
+ public String DescribeCoverage(String stringXml) throws WCSException {
+ LOG.trace("Received input:\n{}", stringXml);
+ LOG.info("Executing operation DescribeCoverage...");
+ String result = desc.execute(stringXml);
+
+ LOG.info("DescribeCoverage finished");
+
+ return result;
+ }
+
+ /**
+ * WcsServer GetCoverage operation
+ */
+ public String GetCoverage(String stringXml) throws WCSException {
+ LOG.trace("Received input:\n{}", stringXml);
+ LOG.info("Executing operation GetCoverage...");
+ String result = getcov.execute(stringXml);
+
+ LOG.info("GetCoverage finished");
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcs2/server/ops/DescribeCoverage.java b/petascope/src/petascope/wcs2/server/ops/DescribeCoverage.java
new file mode 100644
index 0000000..d292ad7
--- /dev/null
+++ b/petascope/src/petascope/wcs2/server/ops/DescribeCoverage.java
@@ -0,0 +1,203 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs2.server.ops;
+
+//~--- non-JDK imports --------------------------------------------------------
+import java.util.HashSet;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import petascope.ConfigManager;
+
+import petascope.wcps.server.core.CellDomainElement;
+import petascope.wcps.server.core.DbMetadataSource;
+import petascope.wcps.server.core.DomainElement;
+import petascope.wcps.server.core.Metadata;
+import petascope.wcps.server.core.RangeElement;
+
+import petascope.wcs.server.exceptions.WCSException;
+
+//~--- JDK imports ------------------------------------------------------------
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import petascope.wcps.server.core.SDU;
+import petascope.wcs.server.exceptions.InvalidParameterValueException;
+import petascope.wcs.server.exceptions.InvalidServiceConfigurationException;
+import petascope.wcs.server.exceptions.NoApplicableCodeException;
+
+/**
+ * Describe Coverage operation for WCS 2.0
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class DescribeCoverage implements WcsOperation {
+
+ public static String DATATYPE_URN_PREFIX = "urn:ogc:def:dataType:OGC:1.1:";
+ private static Logger LOG = LoggerFactory.getLogger(DescribeCoverage.class);
+ /* Template XMLs for response types */
+ private String DescribeCoverageResponse;
+ /* Other useful stuff */
+ private String coverageDescriptionTemplate;
+ private String listOfFormats;
+ private String low, high, axisLabels;
+ private DbMetadataSource meta;
+ private String rangeComponentTemplate;
+ private String rangeComponents, gridDimension, gridId;
+
+ public DescribeCoverage(DbMetadataSource metadata) throws InvalidServiceConfigurationException {
+ meta = metadata;
+
+ DescribeCoverageResponse = ConfigManager.WCS2_DESCRIBE_COVERAGE_TEMPLATE;
+ if (DescribeCoverageResponse == null) {
+ throw new InvalidServiceConfigurationException("Could not find template file.");
+ }
+ listOfFormats = "application/xml";
+
+ /* Find the CoverageDescription template string */
+ String starttag = "<wcs:CoverageDescription ", endtag = "</wcs:CoverageDescription>";
+ int start = DescribeCoverageResponse.indexOf(starttag);
+ int end = DescribeCoverageResponse.indexOf(endtag);
+
+ coverageDescriptionTemplate = DescribeCoverageResponse.substring(start, end + endtag.length());
+ String newResponse = DescribeCoverageResponse.substring(0, start - 1) + DescribeCoverageResponse.substring(end + endtag.length());
+
+ DescribeCoverageResponse = newResponse;
+
+ /* Find the RangeComponent template string */
+ starttag = "<gmlwcs:rangeField";
+ endtag = "</gmlwcs:rangeField>";
+ start = coverageDescriptionTemplate.indexOf(starttag);
+ end = coverageDescriptionTemplate.indexOf(endtag);
+ rangeComponentTemplate = coverageDescriptionTemplate.substring(start, end + endtag.length());
+ String newTemplate = coverageDescriptionTemplate.substring(0, start - 1) + coverageDescriptionTemplate.substring(end + endtag.length());
+
+ coverageDescriptionTemplate = newTemplate;
+ }
+
+ @Override
+ public String execute(String stringXml) throws WCSException {
+ String output;
+ String desc = "";
+
+ String listOfCoverageDescriptions = "";
+ int start, end;
+
+ start = stringXml.indexOf("gml:id=\"");
+ while (start != -1) {
+ end = stringXml.substring(start + 8).indexOf("\"");
+ String coverageId = stringXml.substring(start + 8, start + 8 + end);
+
+ stringXml = stringXml.substring(start + 8 + end + 1);
+ start = stringXml.indexOf("gml:id=\"");
+
+ // Describe "coverageId"
+ if (meta.existsCoverageName(coverageId)) {
+ Metadata cov = null;
+
+ // Read in coverage metadata
+ try {
+ cov = meta.read(coverageId);
+ } catch (Exception e) {
+ e.printStackTrace();
+
+ throw new NoApplicableCodeException("Metadata for coverage '" + coverageId + "' is not valid.");
+ }
+
+ // Analyze the grid components and their values
+ Iterator<DomainElement> it = cov.getDomainIterator();
+ Iterator<CellDomainElement> it2 = cov.getCellDomainIterator();
+
+ low = "";
+ high = "";
+ axisLabels = "";
+ while (it.hasNext() && it2.hasNext()) {
+ DomainElement dom = it.next();
+ CellDomainElement cell = it2.next();
+
+ axisLabels += dom.getName() + " ";
+ low += cell.getLo() + " ";
+ high += cell.getHi() + " ";
+ }
+
+ // Build the range components data structure
+ Iterator<RangeElement> it3 = cov.getRangeIterator();
+ Iterator<String> nilIterator = cov.getNullSetIterator();
+
+
+ rangeComponents = "";
+ int i = -1;
+ while (it3.hasNext()) {
+ String component = rangeComponentTemplate;
+ RangeElement range = it3.next();
+ i++;
+ String rangeId = "range-" + cov.getCoverageId() + "-" + range.getName();
+
+ component = component.replaceAll("\\{rangeFieldId\\}", rangeId);
+ component = component.replaceAll("\\{fieldName\\}", range.getName());
+ component = component.replaceAll("\\{datatype\\}", DATATYPE_URN_PREFIX + range.getType());
+
+ // Compute the null values for this range field
+ Set<String> nullVals = new HashSet<String>();
+ Iterator<String> it4 = cov.getNullSetIterator();
+ while (it4.hasNext()) {
+ List<String> nilVal = SDU.str2string(it4.next());
+ nullVals.add(nilVal.get(i));
+ }
+ StringBuffer nullValsString = new StringBuffer();
+ it4 = nullVals.iterator();
+ while (it4.hasNext()) {
+ nullValsString.append(" " + it4.next());
+ }
+ component = component.replaceAll("\\{nilValues\\}", nullValsString.toString().substring(1));
+
+ // And add this range field to the range structure
+ rangeComponents += component;
+ }
+
+ desc = coverageDescriptionTemplate.replaceAll("\\{coverageId\\}", coverageId);
+ gridId = "grid" + coverageId;
+ desc = desc.replaceAll("\\{gridId\\}", gridId);
+ gridDimension = String.valueOf(cov.getDimension());
+ desc = desc.replaceAll("\\{gridDimension\\}", gridDimension);
+ desc = desc.replaceAll("\\{low\\}", low);
+ desc = desc.replaceAll("\\{high\\}", high);
+ desc = desc.replaceAll("\\{axisLabels\\}", axisLabels);
+ desc = desc.replaceAll("\\{rangeFields\\}", rangeComponents);
+ desc = desc.replaceAll("\\{rangeStructureId\\}", "rangeStructure-" + coverageId);
+ desc = desc.replaceAll("\\{supportedFormats\\}", listOfFormats);
+
+ listOfCoverageDescriptions += desc;
+ } else {
+ throw new InvalidParameterValueException("gml:id");
+ }
+ }
+
+ output = DescribeCoverageResponse.replaceAll("\\{listOfCoverageDescriptions\\}",
+ listOfCoverageDescriptions);
+
+ output = output.replaceAll("\\{wcsSchemaUrl\\}", ConfigManager.WCS2_SCHEMA_URL);
+
+ return output;
+ }
+}
diff --git a/petascope/src/petascope/wcs2/server/ops/GetCapabilities.java b/petascope/src/petascope/wcs2/server/ops/GetCapabilities.java
new file mode 100644
index 0000000..b1d58d5
--- /dev/null
+++ b/petascope/src/petascope/wcs2/server/ops/GetCapabilities.java
@@ -0,0 +1,84 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs2.server.ops;
+
+//~--- non-JDK imports --------------------------------------------------------
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import petascope.ConfigManager;
+
+import petascope.wcps.server.core.DbMetadataSource;
+import petascope.wcps.server.exceptions.ResourceException;
+
+//~--- JDK imports ------------------------------------------------------------
+
+import java.util.Iterator;
+import petascope.wcs.server.exceptions.InvalidServiceConfigurationException;
+
+/**
+ * GetCapabilities operation for The Web Coverage Service 2.0
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class GetCapabilities implements WcsOperation {
+
+ private static Logger LOG = LoggerFactory.getLogger(GetCapabilities.class);
+ /* Template XMLs for response types */
+ private String GetCapabilitiesResponse;
+ private DbMetadataSource meta;
+ /* Other useful vars */
+ private String xmlListOfCoverages;
+
+ public GetCapabilities(DbMetadataSource metadata) throws InvalidServiceConfigurationException {
+ meta = metadata;
+
+ GetCapabilitiesResponse = ConfigManager.WCS2_GET_CAPABILITIES_TEMPLATE;
+ if (GetCapabilitiesResponse == null) {
+ throw new InvalidServiceConfigurationException("Could not find template file.");
+ }
+ }
+
+ @Override
+ public String execute(String input) {
+ String output;
+
+ // Create the output by replacing placeholders
+ output = GetCapabilitiesResponse.replaceAll("\\{URL\\}",
+ ConfigManager.PETASCOPE_SERVLET_URL);
+ Iterator<String> it;
+
+ try {
+ it = meta.coverages().iterator();
+ xmlListOfCoverages = "";
+ while (it.hasNext()) {
+ xmlListOfCoverages += "<wcs:id gml:id=\"" + it.next() + "\"/>";
+ }
+ } catch (ResourceException ex) {
+ ex.printStackTrace();
+ }
+ output = output.replaceAll("\\{Coverages\\}", xmlListOfCoverages);
+ output = output.replaceAll("\\{wcsSchemaUrl\\}", ConfigManager.WCS2_SCHEMA_URL);
+
+ return output;
+ }
+}
diff --git a/petascope/src/petascope/wcs2/server/ops/GetCoverage.java b/petascope/src/petascope/wcs2/server/ops/GetCoverage.java
new file mode 100644
index 0000000..788beec
--- /dev/null
+++ b/petascope/src/petascope/wcs2/server/ops/GetCoverage.java
@@ -0,0 +1,528 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs2.server.ops;
+
+//~--- non-JDK imports --------------------------------------------------------
+import org.apache.commons.io.IOUtils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import org.xml.sax.SAXException;
+
+import petascope.ConfigManager;
+
+import petascope.wcps.server.core.DbMetadataSource;
+import petascope.wcps.server.core.Metadata;
+
+import petascope.wcs.server.exceptions.WCSException;
+
+//~--- JDK imports ------------------------------------------------------------
+
+import java.io.IOException;
+
+import java.math.BigInteger;
+import java.util.HashSet;
+import java.util.Iterator;
+
+import java.util.List;
+import java.util.Set;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+import org.odmg.DBag;
+import org.odmg.Database;
+import org.odmg.Implementation;
+import org.odmg.ODMGException;
+import org.odmg.OQLQuery;
+import org.odmg.QueryException;
+import org.odmg.Transaction;
+import rasj.RasGMArray;
+import rasj.RasImplementation;
+import petascope.wcps.server.core.CellDomainElement;
+import petascope.wcps.server.core.DomainElement;
+import petascope.wcps.server.core.RangeElement;
+import petascope.wcps.server.core.SDU;
+import petascope.wcs.server.exceptions.InputOutputException;
+import petascope.wcs.server.exceptions.InternalComponentException;
+import petascope.wcs.server.exceptions.InvalidParameterValueException;
+import petascope.wcs.server.exceptions.InvalidServiceConfigurationException;
+import petascope.wcs.server.exceptions.NoApplicableCodeException;
+import petascope.wcs.server.exceptions.WcsRuntimeException;
+import petascope.wcs.server.exceptions.XmlNotValidException;
+import petascope.wcs2.server.templates.WcsNamespaceContext;
+
+/**
+ * Get Coverage operation for WCS 2.0
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class GetCoverage implements WcsOperation {
+
+ private static Logger LOG = LoggerFactory.getLogger(GetCoverage.class);
+ private DocumentBuilder builder = null;
+ private XPathFactory xpathFactory = XPathFactory.newInstance();
+ /* Template XMLs for response types */
+ private String GetCoverageResponse;
+ private String rangeComponentTemplate;
+ /* Xml request */
+ private Document doc;
+ /* for Metadata */
+ private DbMetadataSource meta;
+ /* The new coverage domain */
+ private String lowPoint, highPoint, newAxesLabels;
+
+ public GetCoverage(DbMetadataSource metadata) throws WCSException {
+ meta = metadata;
+ GetCoverageResponse = ConfigManager.WCS2_GET_COVERAGE_TEMPLATE;
+ if (GetCoverageResponse == null) {
+ throw new InvalidServiceConfigurationException("Could not find template file.");
+ }
+
+ /* Find the RangeField template string */
+ String starttag = "<gmlwcs:rangeField", endtag = "</gmlwcs:rangeField>";
+ int start = GetCoverageResponse.indexOf(starttag);
+ int end = GetCoverageResponse.indexOf(endtag);
+ rangeComponentTemplate = GetCoverageResponse.substring(start, end + endtag.length());
+ String newTemplate = GetCoverageResponse.substring(0, start - 1) + GetCoverageResponse.substring(end + endtag.length());
+ GetCoverageResponse = newTemplate;
+
+ /* init XML parser */
+ DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
+ domFactory.setNamespaceAware(true); // never forget this!
+ try {
+ builder = domFactory.newDocumentBuilder();
+ } catch (Exception e) {
+ throw new NoApplicableCodeException("Error initializing XML parser", e);
+ }
+ }
+
+ @Override
+ public String execute(String stringXml) throws WCSException {
+ String output;
+ Metadata cov;
+
+ try {
+ doc = builder.parse(IOUtils.toInputStream(stringXml));
+ cov = readCoverageMetadata();
+ } catch (SAXException e) {
+ throw new XmlNotValidException("Could not parse input request.", e);
+ } catch (IOException e) {
+ throw new InputOutputException("Could not read input request", e);
+ } catch (XPathExpressionException e) {
+ throw new InternalComponentException("Invalid XPath expression", e);
+ }
+
+ // Analyze input and build trim/slice info structures
+ String subsetting = computeRequestSubsettingLimits(cov);
+ String coverageName = cov.getCoverageName();
+
+ // Evaluate all bands and then perform string processing to get coverage data
+ String coverageData = buildCoverageData(cov, subsetting);
+
+ // Build response xml document
+ output = buildOutputXml(coverageData, cov);
+
+ return output;
+ }
+
+ private NodeList evalXPathList(String query, Object context) throws WCSException {
+ try {
+ LOG.debug("Evaluating XPath: {}", query);
+ XPath xpath = xpathFactory.newXPath();
+
+ xpath.setNamespaceContext(new WcsNamespaceContext());
+ NodeList result = (NodeList) xpath.evaluate(query, context, XPathConstants.NODESET);
+
+ for (int i = 0; i < result.getLength(); i++) {
+ LOG.trace("Result {}: {}", i, result.item(i).getNodeValue());
+ }
+
+ return (NodeList) result;
+ } catch (XPathExpressionException e) {
+ LOG.error("Could not execute XPath expression '{}'", query);
+
+ throw new WcsRuntimeException("Could not execute XPath expression", e);
+ }
+ }
+
+ private String getCoverageName(Document doc) throws WCSException {
+ NodeList nodes = evalXPathList("//wcs:id/@gml:id", doc);
+
+ if (nodes.getLength() != 1) {
+ LOG.error("Could not retrieve coverage name from XML document.");
+
+ return null;
+ }
+
+ return nodes.item(0).getNodeValue();
+ }
+
+ private Metadata readCoverageMetadata() throws WCSException, XPathExpressionException {
+ String coverageId = getCoverageName(doc);
+
+ if (meta.existsCoverageName(coverageId)) {
+ try {
+ Metadata cov = meta.read(coverageId);
+
+ return cov;
+ } catch (Exception e) {
+ e.printStackTrace();
+
+ throw new NoApplicableCodeException("Metadata for coverage '"
+ + coverageId + "' is not valid.");
+ }
+ } else {
+ throw new InvalidParameterValueException("gml:id");
+ }
+ }
+
+ /** Computes the domain of the new coverage, and returns a string that can be
+ * used to do subsetting on the original coverage. Also computes the low, high
+ * and the axis labels for the new coverage.
+ *
+ * @param coverage
+ * @return
+ * @throws WCSException
+ */
+ private String computeRequestSubsettingLimits(Metadata coverage) throws WCSException {
+ int dims = coverage.getDimension(), i = 0;
+ String[] limits = new String[dims];
+ BigInteger[] high = new BigInteger[dims];
+ BigInteger[] low = new BigInteger[dims];
+ String[] axesLabels = new String[dims];
+ boolean[] sliced = new boolean[dims];
+ boolean[] trimmed = new boolean[dims];
+
+ Iterator<CellDomainElement> it = coverage.getCellDomainIterator();
+ Iterator<DomainElement> it2 = coverage.getDomainIterator();
+ i = 0;
+ while (it.hasNext() && it2.hasNext()) {
+ CellDomainElement cell = it.next();
+ DomainElement dom = it2.next();
+ LOG.trace(cell.toString());
+ LOG.trace(dom.toString());
+ high[i] = cell.getHi();
+ low[i] = cell.getLo();
+ axesLabels[i] = dom.getName();
+ limits[i] = low[i] + ":" + high[i];
+ sliced[i] = false;
+ trimmed[i] = false;
+ i++;
+ }
+
+ NodeList list = null;
+ int axisIndex;
+ String axis, root;
+ NodeList trims, slices;
+
+ trims = evalXPathList("//wcs:trimDimension", doc);
+ for (i = 0; i < trims.getLength(); i++) {
+ Node trim = trims.item(i);
+
+ list = evalXPathList("wcs:dimension/text()", trim);
+ axis = list.item(0).getNodeValue();
+ axisIndex = coverage.getDomainIndexByName(axis);
+ if (axisIndex == -1) {
+ throw new InvalidParameterValueException("dimension. Explanation: Unknown axis: " + axis);
+ }
+ if (trimmed[axisIndex] || sliced[axisIndex]) {
+ throw new NoApplicableCodeException("Already performed one subsetting operation on axis: " + axis);
+ }
+
+ list = evalXPathList("wcs:trimLow/text()", trim);
+ if (list.getLength() > 0) {
+ try {
+ long val = Long.parseLong(list.item(0).getNodeValue());
+ low[axisIndex] = BigInteger.valueOf(val);
+ } catch (NumberFormatException e) {
+ throw new InvalidParameterValueException("trimLow. Explanation: invalid integer number: " + list.item(0).getNodeValue());
+ }
+ }
+ list = evalXPathList("wcs:trimHigh/text()", trim);
+ if (list.getLength() > 0) {
+ try {
+ long val = Long.parseLong(list.item(0).getNodeValue());
+ high[axisIndex] = BigInteger.valueOf(val);
+ } catch (NumberFormatException e) {
+ throw new InvalidParameterValueException("trimHigh. Explanation: invalid integer number: " + list.item(0).getNodeValue());
+ }
+ }
+
+ trimmed[axisIndex] = true;
+ limits[axisIndex] = low[axisIndex] + ":" + high[axisIndex];
+ LOG.debug("New limits for axis {}: {}", axis, limits[axisIndex]);
+ }
+
+ slices = evalXPathList("//wcs:sliceDimension", doc);
+ for (i = 0; i < slices.getLength(); i++) {
+ Node slice = slices.item(i);
+
+ list = evalXPathList("wcs:dimension/text()", slice);
+ axis = list.item(0).getNodeValue();
+ axisIndex = coverage.getDomainIndexByName(axis);
+ if (axisIndex == -1) {
+ throw new InvalidParameterValueException("dimension. Explanation: Unknown axis name: " + axis);
+ }
+ if (trimmed[axisIndex] || sliced[axisIndex]) {
+ throw new NoApplicableCodeException("Already performed one subsetting operation on axis: " + axis);
+ }
+
+ list = evalXPathList("wcs:slicePoint/text()", slice);
+ if (list.getLength() > 0) {
+ try {
+ long point = Long.parseLong(list.item(0).getNodeValue());
+ low[axisIndex] = BigInteger.valueOf(point);
+ } catch (NumberFormatException e) {
+ throw new InvalidParameterValueException("slicePoint. Explanation: invalid integer number: " + list.item(0).getNodeValue());
+ }
+ high[axisIndex] = low[axisIndex];
+ limits[axisIndex] = list.item(0).getNodeValue();
+ }
+
+ sliced[axisIndex] = true;
+ LOG.debug("New limits for axis {}: {}", axis, limits[axisIndex]);
+ }
+
+ // Compute the lowest, highest point and the labels
+ lowPoint = "";
+ highPoint = "";
+ newAxesLabels = "";
+ int first = 0;
+ for (i = 0; i < dims; i++) {
+ if (sliced[i] == false) {
+ if (first == 0) {
+ lowPoint = low[i].toString();
+ highPoint = high[i].toString();
+ newAxesLabels = axesLabels[i];
+ first++;
+ } else {
+ lowPoint += " " + low[i];
+ highPoint += " " + high[i];
+ newAxesLabels += " " + axesLabels[i];
+ }
+ }
+ }
+
+ // Concatenate all limits into a single string
+ String result = limits[0];
+
+ for (i = 1; i < dims; i++) {
+ result += ", " + limits[i];
+ }
+
+ return result;
+ }
+
+ public String executeRasqlQuery(String query) throws WCSException {
+ byte[] result = null;
+
+ Implementation impl = new RasImplementation(ConfigManager.RASDAMAN_URL);
+ Database db = impl.newDatabase();
+
+ try {
+ db.open(ConfigManager.RASDAMAN_DATABASE, Database.OPEN_READ_ONLY);
+ } catch (ODMGException odmge) {
+ try {
+ db.close();
+ } catch (ODMGException e) {
+ }
+
+ throw new InternalComponentException("Could not connect to rasdaman server at " + ConfigManager.RASDAMAN_URL + ", database " + ConfigManager.RASDAMAN_DATABASE, odmge);
+ }
+
+ Transaction tr = impl.newTransaction();
+
+ tr.begin();
+ OQLQuery q = impl.newOQLQuery();
+ DBag resultSet;
+
+ try {
+ q.create(query);
+ resultSet = (DBag) q.execute();
+
+ if (resultSet != null) {
+ Iterator resultIterator = resultSet.iterator();
+
+ if (resultIterator.hasNext()) {
+ Object current = resultIterator.next();
+
+ try {
+ RasGMArray resultArray = (RasGMArray) current;
+ result = resultArray.getArray();
+ } catch (ClassCastException e) {
+ LOG.error("result=" + current.toString());
+ result = current.toString().getBytes();
+ }
+ }
+ }
+ } catch (QueryException qe) {
+ tr.commit();
+
+ try {
+ db.close();
+ } catch (ODMGException odmge) {
+ }
+
+ throw new InternalComponentException("Could not evaluate rasdaman query: '" + query + "'. Cause: " + qe.getMessage(), qe);
+ }
+
+ tr.commit();
+
+ try {
+ db.close();
+ } catch (ODMGException odmge) {
+ }
+
+ return new String(result);
+ }
+
+ /** Creates a string with the contents of the GetCoverage response XML */
+ private String buildOutputXml(String coverageData, Metadata coverage) {
+ String xml = GetCoverageResponse;
+ xml = xml.replaceAll("\\{coverageId\\}", coverage.getCoverageName() + Math.random());
+ xml = xml.replaceAll("\\{gridDimension\\}", String.valueOf(coverage.getDimension()));
+ xml = xml.replaceAll("\\{gridId\\}", "grid-" + coverage.getCoverageName());
+ // low
+ xml = xml.replaceAll("\\{low\\}", lowPoint);
+ // high
+ xml = xml.replaceAll("\\{high\\}", highPoint);
+ // axisLabels
+ xml = xml.replaceAll("\\{axisLabels\\}", newAxesLabels);
+ // coverageData
+ xml = xml.replaceAll("\\{coverageData\\}", coverageData);
+
+
+
+ // Build the range structure
+ Iterator<RangeElement> it3 = coverage.getRangeIterator();
+ int i = -1;
+ String rangeComponents = "";
+ while (it3.hasNext()) {
+ String component = rangeComponentTemplate;
+ RangeElement range = it3.next();
+ i++;
+ String rangeId = "range-" + coverage.getCoverageId() + "-" + range.getName();
+ LOG.trace(range.toString());
+
+ component = component.replaceAll("\\{rangeFieldId\\}", rangeId);
+ component = component.replaceAll("\\{fieldName\\}", range.getName());
+ component = component.replaceAll("\\{datatype\\}", DescribeCoverage.DATATYPE_URN_PREFIX + range.getType());
+
+ // Compute the null values for this range field
+ Set<String> nullVals = new HashSet<String>();
+ Iterator<String> it = coverage.getNullSetIterator();
+ while (it.hasNext()) {
+ List<String> nilVal = SDU.str2string(it.next());
+ nullVals.add(nilVal.get(i));
+ }
+ StringBuffer nullValsString = new StringBuffer();
+ it = nullVals.iterator();
+ while (it.hasNext()) {
+ nullValsString.append(" " + it.next());
+ }
+ component = component.replaceAll("\\{nilValues\\}", nullValsString.toString().substring(1));
+
+ // And add this range field to the range structure
+ rangeComponents += component;
+ }
+
+ xml = xml.replaceAll("\\{rangeFields\\}", rangeComponents);
+ xml = xml.replaceAll("\\{rangeStructureId\\}", "rangeStructure-" + coverage.getCoverageId());
+
+ xml = xml.replaceAll("\\{wcsSchemaUrl\\}", ConfigManager.WCS2_SCHEMA_URL);
+
+ return xml;
+ }
+
+ /**
+ * Retrieve the coverage data for a multi-band coverage,
+ * with particular subsetting parameters.
+ * @param coverage metadata for the coverage we want
+ * @param subsetting subsetting string, to be used in the RasQL query
+ * @return a string of space-separated values, where various bands of one
+ * pixel are comma-separated. For example, the string "1,2 3,4 5,6" can
+ * be the coverage data of a 1-by-3 coverage, with two bands
+ */
+ private String buildCoverageData(Metadata coverage, String subsetting) throws WCSException {
+ String coverageName = coverage.getCoverageName();
+ Iterator<RangeElement> it = coverage.getRangeIterator();
+ int bandcount = 0;
+ while (it.hasNext()) {
+ it.next();
+ bandcount++;
+ }
+ LOG.debug("Coverage {} has {} bands", coverageName, bandcount);
+ String[][] pixels = new String[bandcount][];
+ String currentBand = "";
+ /* For all bands of the coverage, execute a rasql query */
+ for (int band = 0; band < bandcount; band++) {
+ LOG.trace("Processing band {}", band);
+ // Construct rasql query
+ currentBand = "." + band;
+ // If this is a one-band image, then band-subsetting would result in an error
+ if (bandcount == 1) {
+ currentBand = "";
+ }
+ String rasqlQuery = "select csv(cov[" + subsetting + "]" + currentBand + ") "
+ + "from " + coverageName + " as cov";
+
+ // Execute RasQl query => coverage data
+ LOG.trace("Executing query {}", rasqlQuery);
+ String output = executeRasqlQuery(rasqlQuery);
+
+ // Remove the curly braces from the rasql output
+ LOG.trace("Removing curly braces...");
+ output = output.replaceAll("\\{", "");
+ output = output.replaceAll("\\}", "");
+
+ // Tokenize the input to get the pixel values of the current band
+ LOG.trace("Splitting values with comma...");
+ pixels[band] = output.split(",");
+
+ LOG.trace("Done processing band {}.", band);
+ }
+
+ /* Combine all bands into one single string */
+ int pixelcount = pixels[0].length;
+ StringBuilder data = new StringBuilder(pixelcount * bandcount);
+ LOG.debug("Going to combine {} pixels with {} bands...", pixelcount, bandcount);
+ for (int pix = 0; pix < pixelcount; pix++) {
+ if (pixelcount > 20 && pix % (pixelcount / 20) == 0) {
+ LOG.debug("Processing Pixel {} of " + pixelcount + " - {}%", pix, pix * 100 / (pixelcount - 1));
+ }
+ for (int b = 0; b < bandcount - 1; b++) {
+ data.append(pixels[b][pix] + ",");
+ }
+ data.append(pixels[bandcount - 1][pix]);
+ data.append(" ");
+ }
+ return data.substring(0, data.length() - 2);
+ }
+}
diff --git a/petascope/src/petascope/wcs2/server/ops/WcsOperation.java b/petascope/src/petascope/wcs2/server/ops/WcsOperation.java
new file mode 100644
index 0000000..527b80a
--- /dev/null
+++ b/petascope/src/petascope/wcs2/server/ops/WcsOperation.java
@@ -0,0 +1,35 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs2.server.ops;
+
+//~--- non-JDK imports --------------------------------------------------------
+import petascope.wcs.server.exceptions.WCSException;
+
+/**
+ * Interface for all WCS Operations.
+ * @author Andrei Aiordachioaie
+ */
+public interface WcsOperation {
+
+ /** Execute the operation */
+ public String execute(String input) throws WCSException;
+}
diff --git a/petascope/src/petascope/wcs2/server/templates/DescribeCoverageTemplate.xml b/petascope/src/petascope/wcs2/server/templates/DescribeCoverageTemplate.xml
new file mode 100644
index 0000000..c431723
--- /dev/null
+++ b/petascope/src/petascope/wcs2/server/templates/DescribeCoverageTemplate.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wcs:CoverageDescriptions xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xmlns:gmlwcs='http://www.opengis.net/wcs/2.0/gml'
+ xmlns:gml='http://www.opengis.net/gml/3.2'
+ xmlns:wcs='http://www.opengis.net/wcs/2.0'
+ xmlns='http://www.opengis.net/gml/3.2'
+ xsi:schemaLocation='http://www.opengis.net/wcs/2.0 {wcsSchemaUrl}/wcsAll.xsd'>
+ {listOfCoverageDescriptions}
+ <wcs:CoverageDescription gml:id="{coverageId}">
+ <domainSet>
+ <Grid dimension="{gridDimension}" gml:id="{gridId}">
+ <limits>
+ <GridEnvelope>
+ <low>{low}</low>
+ <high>{high}</high>
+ </GridEnvelope>
+ </limits>
+ <axisLabels>{axisLabels}</axisLabels>
+ </Grid>
+ </domainSet>
+ <gmlwcs:rangeStructure>
+ <gmlwcs:RangeStructure gml:id="{rangeStructureId}">
+ {rangeFields}
+ <gmlwcs:rangeField>
+ <gmlwcs:RangeField gml:id="{rangeFieldId}">
+ <gml:name>{fieldName}</gml:name>
+ <gmlwcs:dataType>{datatype}</gmlwcs:dataType>
+ <gmlwcs:nilValueList>{nilValues}</gmlwcs:nilValueList>
+ </gmlwcs:RangeField>
+ </gmlwcs:rangeField>
+ </gmlwcs:RangeStructure>
+ </gmlwcs:rangeStructure>
+ <wcs:ServiceParameters>
+ <wcs:supportedCrsList/>
+ <wcs:supportedFormatList>{supportedFormats}</wcs:supportedFormatList>
+ </wcs:ServiceParameters>
+ </wcs:CoverageDescription>
+</wcs:CoverageDescriptions>
diff --git a/petascope/src/petascope/wcs2/server/templates/GetCapabilitiesTemplate.xml b/petascope/src/petascope/wcs2/server/templates/GetCapabilitiesTemplate.xml
new file mode 100644
index 0000000..86631bf
--- /dev/null
+++ b/petascope/src/petascope/wcs2/server/templates/GetCapabilitiesTemplate.xml
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wcs:Capabilities xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xmlns:ows='http://www.opengis.net/ows/1.1'
+ xmlns:wcs='http://www.opengis.net/wcs/2.0'
+ xmlns:gml='http://www.opengis.net/gml/3.2'
+ xmlns='http://www.opengis.net/ows/1.1'
+ xmlns:xlink='http://www.w3.org/1999/xlink'
+ xsi:schemaLocation='http://www.opengis.net/wcs/2.0 {wcsSchemaUrl}/wcsAll.xsd' version="2.0.0">
+ <ServiceIdentification>
+ <Title>WCS 2.0 Coverage Server @ Jacobs University</Title>
+ <Abstract>WCS 2.0 Server developed at jacobs University</Abstract>
+ <ServiceType>OGC WCS</ServiceType>
+ <ServiceTypeVersion>2.0.0</ServiceTypeVersion>
+ <Profile>urn:ogc:def:extension:OGC-WCS:2.0:protocol:post</Profile>
+ <Profile>urn:ogc:def:extension:OGC-WCS:2.0:serviceModel:wcps:1.0</Profile>
+ <Profile>urn:ogc:def:extension:OGC-WCS:2.0:serviceModel:wcst:1.0</Profile>
+ </ServiceIdentification>
+ <ServiceProvider>
+ <ProviderName>Jacobs University Bremen</ProviderName>
+ <ows:ProviderSite xlink:href="http://www.petascope.org/"/>
+ <ServiceContact>
+ <ows:IndividualName>Prof. Dr. Peter Baumann</ows:IndividualName>
+ <ows:ContactInfo>
+ <ows:Address>
+ <ows:City>Bremen</ows:City>
+ <ows:PostalCode>28717</ows:PostalCode>
+ <ows:Country>Germany</ows:Country>
+ <ows:ElectronicMailAddress>p.baumann@jacobs-university.de</ows:ElectronicMailAddress>
+ </ows:Address>
+ </ows:ContactInfo>
+ <ows:Role>Project Leader</ows:Role>
+ </ServiceContact>
+ </ServiceProvider>
+ <OperationsMetadata>
+ <Operation name="GetCapabilities">
+ <DCP>
+ <HTTP>
+ <Get xlink:href="{URL}"/>
+ </HTTP>
+ </DCP>
+ <Parameter name="Format">
+ <AllowedValues>
+ <Value>text/xml</Value>
+ </AllowedValues>
+ </Parameter>
+ <Constraint name="PostEncoding">
+ <AllowedValues>
+ <Value>XML</Value>
+ </AllowedValues>
+ </Constraint>
+ </Operation>
+ <Operation name="DescribeCoverage">
+ <DCP>
+ <HTTP>
+ <Get xlink:href="{URL}"/>
+ </HTTP>
+ </DCP>
+ <Parameter name="Format">
+ <AllowedValues>
+ <Value>text/xml</Value>
+ </AllowedValues>
+ </Parameter>
+ <Constraint name="PostEncoding">
+ <AllowedValues>
+ <Value>XML</Value>
+ </AllowedValues>
+ </Constraint>
+ </Operation>
+ <Operation name="GetCoverage">
+ <DCP>
+ <HTTP>
+ <Get xlink:href="{URL}"/>
+ </HTTP>
+ </DCP>
+ <Parameter name="Format">
+ <AllowedValues>
+ <Value>text/xml</Value>
+ </AllowedValues>
+ </Parameter>
+ <Constraint name="PostEncoding">
+ <AllowedValues>
+ <Value>XML</Value>
+ </AllowedValues>
+ </Constraint>
+ </Operation>
+ </OperationsMetadata>
+ <wcs:Contents>
+ {Coverages}
+ </wcs:Contents>
+ <wcs:WcsServiceMetadata />
+
+</wcs:Capabilities>
diff --git a/petascope/src/petascope/wcs2/server/templates/GetCoverageTemplate.xml b/petascope/src/petascope/wcs2/server/templates/GetCoverageTemplate.xml
new file mode 100644
index 0000000..9b76cc9
--- /dev/null
+++ b/petascope/src/petascope/wcs2/server/templates/GetCoverageTemplate.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gmlwcs:GridCoverage xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xmlns:gml='http://www.opengis.net/gml/3.2'
+ xmlns='http://www.opengis.net/gml/3.2'
+ xmlns:gmlwcs='http://www.opengis.net/wcs/2.0/gml'
+ xsi:schemaLocation='http://www.opengis.net/wcs/2.0/gml {wcsSchemaUrl}/gml/gmlwcsAll.xsd' gml:id="{coverageId}">
+ <domainSet>
+ <Grid dimension="{gridDimension}" gml:id="{gridId}">
+ <limits>
+ <GridEnvelope>
+ <low>{low}</low>
+ <high>{high}</high>
+ </GridEnvelope>
+ </limits>
+ <axisLabels>{axisLabels}</axisLabels>
+ </Grid>
+ </domainSet>
+ <rangeSet>
+ <DataBlock>
+ <rangeParameters/>
+ <tupleList>
+ {coverageData}
+ </tupleList>
+ </DataBlock>
+ </rangeSet>
+ <gmlwcs:rangeStructure>
+ <gmlwcs:RangeStructure gml:id="{rangeStructureId}">
+ {rangeFields}
+ <gmlwcs:rangeField>
+ <gmlwcs:RangeField gml:id="{rangeFieldId}">
+ <gml:name>{fieldName}</gml:name>
+ <gmlwcs:dataType>{datatype}</gmlwcs:dataType>
+ <gmlwcs:nilValueList>{nilValues}</gmlwcs:nilValueList>
+ </gmlwcs:RangeField>
+ </gmlwcs:rangeField>
+ </gmlwcs:RangeStructure>
+ </gmlwcs:rangeStructure>
+</gmlwcs:GridCoverage>
diff --git a/petascope/src/petascope/wcs2/server/templates/WcsNamespaceContext.java b/petascope/src/petascope/wcs2/server/templates/WcsNamespaceContext.java
new file mode 100644
index 0000000..a021851
--- /dev/null
+++ b/petascope/src/petascope/wcs2/server/templates/WcsNamespaceContext.java
@@ -0,0 +1,58 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs2.server.templates;
+
+import java.util.Iterator;
+import javax.xml.XMLConstants;
+import javax.xml.namespace.NamespaceContext;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class WcsNamespaceContext implements NamespaceContext {
+
+ @Override
+ public String getNamespaceURI(String prefix) {
+ if (prefix == null) {
+ throw new NullPointerException("Null prefix");
+ } else if ("wcs".equals(prefix)) {
+ return "http://www.opengis.net/wcs/2.0";
+ } else if ("gml".equals(prefix)) {
+ return "http://www.opengis.net/gml/3.2";
+ }
+
+ return XMLConstants.NULL_NS_URI;
+ }
+
+ // This method isn't necessary for XPath processing.
+ @Override
+ public String getPrefix(String uri) {
+ throw new UnsupportedOperationException();
+ }
+
+ // This method isn't necessary for XPath processing either.
+ @Override
+ public Iterator getPrefixes(String uri) {
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/petascope/src/petascope/wcst/server/WcstServer.java b/petascope/src/petascope/wcst/server/WcstServer.java
new file mode 100644
index 0000000..0440d9c
--- /dev/null
+++ b/petascope/src/petascope/wcst/server/WcstServer.java
@@ -0,0 +1,249 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcst.server;
+
+//~--- non-JDK imports --------------------------------------------------------
+import petascope.ConfigManager;
+import net.opengis.ows.v_1_0_0.ExceptionReport;
+
+import petascope.wcst.transaction.ServiceFirewall;
+import petascope.wcst.transaction.executeAsyncTransaction;
+import petascope.wcst.transaction.executeTransaction;
+import wcst.transaction.schema.AcknowledgementType;
+import wcst.transaction.schema.TransactionResponseType;
+import wcst.transaction.schema.TransactionType;
+
+//~--- JDK imports ------------------------------------------------------------
+
+import java.io.StringReader;
+import java.io.StringWriter;
+
+import java.util.Date;
+import java.util.GregorianCalendar;
+
+import javax.xml.XMLConstants;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.datatype.DatatypeConfigurationException;
+import javax.xml.datatype.DatatypeFactory;
+import javax.xml.datatype.XMLGregorianCalendar;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamWriter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import petascope.PetascopeXmlNamespaceMapper;
+import petascope.wcps.server.core.DbMetadataSource;
+import petascope.wcs.server.exceptions.InvalidPropertyValueException;
+import petascope.wcs.server.exceptions.MaliciousQueryException;
+import petascope.wcs.server.exceptions.WCSException;
+import petascope.wcs.server.exceptions.XmlStructuresException;
+
+/**
+ * The Web Coverage Service, with the Transactional extension (WcstServer)
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class WcstServer {
+
+ private static Logger LOG = LoggerFactory.getLogger(WcstServer.class);
+ private static Boolean finished;
+ private boolean synchronous = true;
+ private String responseHandler;
+ private DbMetadataSource meta;
+
+ /**
+ * Public minimal constructor
+ */
+ public WcstServer(DbMetadataSource source) throws WCSException {
+ finished = false;
+ meta = source;
+
+ /* Check user settings */
+ String cfg = ConfigManager.WCST_DEFAULT_DATATYPE;
+ if (source.getDataTypes().contains(cfg) == false) {
+ throw new InvalidPropertyValueException("The following setting is not a valid datatype: " + cfg);
+ }
+ cfg = ConfigManager.WCST_DEFAULT_INTERPOLATION;
+ if (source.getInterpolationTypes().contains(cfg) == false) {
+ throw new InvalidPropertyValueException("The following setting is not a valid interpolation method: " + cfg);
+ }
+ cfg = ConfigManager.WCST_DEFAULT_NULL_RESISTANCE;
+ if (source.getNullResistances().contains(cfg) == false) {
+ throw new InvalidPropertyValueException("The following setting is not a valid null resistance: " + cfg);
+ }
+ }
+
+ /**
+ * Web service operation
+ */
+ public String Transaction(String stringXml) {
+ // Actual contents of these two strings do not matter
+ String output = "Default output. ";
+ String errmsg = "No error. ";
+
+ finished = false;
+ try {
+ try {
+ // Check if Firewall allows the query
+ if (ServiceFirewall.reject(stringXml)) {
+ throw new MaliciousQueryException("WCS-T Service Firewall "
+ + "refused to run possibly malitious query.");
+ }
+
+ // read the input XML
+ LOG.debug("Reading the input XML file ... ");
+ JAXBContext context = JAXBContext.newInstance(
+ TransactionType.class.getPackage().getName());
+ Unmarshaller unmarshaller = context.createUnmarshaller();
+ Object xml = unmarshaller.unmarshal(new StringReader(stringXml));
+
+ if (xml instanceof JAXBElement) {
+ xml = ((JAXBElement) xml).getValue();
+ }
+
+ TransactionType input = (TransactionType) xml;
+
+ /**
+ * We can work in both asynchronous and synchronous mode.
+ *
+ * If we are in async mode, we generate an acknowledgement that
+ * we have received the Transaction request. Next, when we finish processing,
+ * we send the output (as a String) to the specified responseHandler.
+ *
+ * In synchronous mode, we just do the processing and output
+ * the result.
+ */
+ if (input.getResponseHandler() == null) {
+ synchronous = true;
+ responseHandler = null;
+ } else {
+ synchronous = false;
+ responseHandler = input.getResponseHandler();
+ }
+
+ executeTransaction exec = new executeTransaction(input, meta);
+
+ /** Synchronous operation */
+ if (synchronous == true) {
+ TransactionResponseType response = exec.get();
+ JAXBElement jaxbOutput =
+ new JAXBElement(
+ new QName("http://www.opengis.net/wcs/1.1/wcst",
+ "TransactionResponse", XMLConstants.DEFAULT_NS_PREFIX),
+ TransactionResponseType.class, response);
+
+ // Write the output xml to a string
+ LOG.debug("Marshalling with context: " + response.getClass().getPackage().getName());
+ final StringWriter writer = new StringWriter();
+ try {
+ context = JAXBContext.newInstance(response.getClass());
+ final XMLStreamWriter xmlStreamWriter = XMLOutputFactory.newInstance().createXMLStreamWriter(writer);
+
+ final Marshaller marshaller = context.createMarshaller();
+ marshaller.setProperty("com.sun.xml.bind.namespacePrefixMapper", new PetascopeXmlNamespaceMapper());
+ marshaller.setProperty("jaxb.formatted.output", true);
+ marshaller.setProperty("jaxb.schemaLocation", "http://www.opengis.net/wcs/1.1/wcst http://schemas.opengis.net/wcst/ "
+ + "http://www.opengis.net/ows/1.1 http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd");
+ marshaller.marshal(jaxbOutput, xmlStreamWriter);
+ } catch (final Exception e) {
+ throw new RuntimeException(e.getMessage(), e);
+ }
+ output = writer.toString();
+ LOG.debug("Done! User has the TransactionResponse result !");
+ } else /** Asynchronous operation */
+ {
+ /* (1) Create acknowledgement that we received the request */
+ AcknowledgementType ack = new AcknowledgementType();
+ GregorianCalendar c = new GregorianCalendar();
+
+ c.setTime(new Date());
+ XMLGregorianCalendar date2 = DatatypeFactory.newInstance().newXMLGregorianCalendar(c);
+
+ ack.setTimeStamp(date2);
+ ack.setOperationRequest(input);
+ ack.setRequestId(exec.generateRequestId());
+ JAXBElement jaxbOutput = new JAXBElement(new QName("", "Acknowledgement"),
+ TransactionResponseType.class, ack);
+
+ /* (2) Write the acknowledgement to a string */
+ JAXBContext jaxbCtx = JAXBContext.newInstance(
+ ack.getClass().getPackage().getName());
+ Marshaller marshaller = jaxbCtx.createMarshaller();
+
+ marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
+ marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+ StringWriter strWriter = new StringWriter();
+
+ marshaller.marshal(jaxbOutput, strWriter);
+ output = strWriter.toString();
+ LOG.debug("Created the acknowledgement of the request !");
+ LOG.debug("Now starting to asynchronously execute the transaction...");
+
+ /* (3) Start asynchronous processing */
+ executeAsyncTransaction execAsync = new executeAsyncTransaction(exec,
+ responseHandler);
+
+ execAsync.start();
+ }
+ finished = true;
+
+ } catch (JAXBException e) {
+ throw new XmlStructuresException("Could not marshall/unmarshall XML structures.", e);
+ } catch (DatatypeConfigurationException e) {
+ throw new XmlStructuresException("Could not build request acknowledgement. ", e);
+ }
+ } catch (WCSException e) {
+ LOG.info("Caught WCST Exception");
+ ExceptionReport report = e.getReport();
+
+ try {
+ JAXBContext jaxbCtx = JAXBContext.newInstance(
+ report.getClass().getPackage().getName());
+ Marshaller marshaller = jaxbCtx.createMarshaller();
+
+ marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
+ marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+ StringWriter strWriter = new StringWriter();
+
+ marshaller.marshal(report, strWriter);
+ output = strWriter.toString();
+ finished = true;
+ LOG.error("WCS-T Exception: " + e.getErrorCode() + ", with message '"
+ + e.getErrorDetail() + "'");
+ LOG.debug("Done with the Error Report !");
+ } catch (JAXBException e2) {
+ errmsg = e2.getMessage();
+ LOG.error("Could not build XML error report. Stack trace: " + e2);
+ }
+ }
+
+ if (finished == false) {
+ output = errmsg;
+ }
+
+ return output;
+ }
+}
diff --git a/petascope/src/petascope/wcst/server/servlet/wcstServlet.java b/petascope/src/petascope/wcst/server/servlet/wcstServlet.java
new file mode 100644
index 0000000..51f11d3
--- /dev/null
+++ b/petascope/src/petascope/wcst/server/servlet/wcstServlet.java
@@ -0,0 +1,161 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcst.server.servlet;
+
+//~--- non-JDK imports --------------------------------------------------------
+import petascope.wcst.server.*;
+import petascope.ConfigManager;
+import org.apache.commons.io.FileUtils;
+
+//~--- JDK imports ------------------------------------------------------------
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import petascope.wcps.server.core.DbMetadataSource;
+import petascope.wcs.server.exceptions.WCSException;
+
+/** Servlet interface for the WCS-Transactional server.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class wcstServlet extends HttpServlet {
+
+ private String defaultHtmlResponse;
+ private String relativeServletHtmlPath = "/templates/wcst-servlet.html";
+ private String servletHtmlPath;
+ private String relativeSettingsPath = "/settings.properties";
+ private WcstServer server;
+ private DbMetadataSource metadataSource;
+
+ @Override
+ public void init() throws ServletException {
+ // Initialize the configuration manager. Now all classes can read the settings.
+ String settingsPath = getServletContext().getRealPath(relativeSettingsPath);
+ ConfigManager config = ConfigManager.getInstance(settingsPath, getServletContext().getRealPath("/"));
+
+ try {
+ metadataSource = new DbMetadataSource(
+ ConfigManager.METADATA_DRIVER, ConfigManager.METADATA_URL,
+ ConfigManager.METADATA_USER, ConfigManager.METADATA_PASS, false);
+ } catch (Exception e) {
+ throw new ServletException("Metadata Database Error.", e);
+ }
+
+ // Initialize the WCS-T server with proper metadata
+ try {
+ server = new WcstServer(metadataSource);
+ } catch (WCSException e) {
+ throw new ServletException(e);
+ }
+
+ // Load the servlet HTML response
+ servletHtmlPath = getServletContext().getRealPath(relativeServletHtmlPath);
+ try {
+ defaultHtmlResponse = FileUtils.readFileToString(new File(servletHtmlPath));
+ } catch (IOException e) {
+ throw new ServletException(e);
+ }
+ }
+
+ /**
+ * Handles the HTTP <code>GET</code> method.
+ * @param request wcstServlet request
+ * @param response wcstServlet response
+ * @throws ServletException if a wcstServlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
+ System.out.println("WCS-T: invoked with GET");
+ printUsage(response);
+ }
+
+ /**
+ * Handles the HTTP <code>POST</code> method.
+ * @param request wcstServlet request
+ * @param response wcstServlet response
+ * @throws ServletException if a wcstServlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+ // Select the operation
+ int op = -1;
+
+ if (request.getParameter("TransactionXML") != null) {
+ op = 4;
+ }
+
+ // Convert the WCS request into a WCPS request
+ try {
+ // initialize WebService operation arguments here
+ String inputXml, outputXml;
+ PrintWriter out;
+
+ switch (op) {
+ case 4:
+ inputXml = request.getParameter("TransactionXML");
+ outputXml = server.Transaction(inputXml);
+ out = new PrintWriter(response.getOutputStream());
+ out.write(outputXml);
+ out.flush();
+
+ break;
+ default:
+ throw new Exception("No valid operation specified !");
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+
+ throw new ServletException("WCS-T servlet error !", e);
+ }
+ }
+
+ /**
+ * Returns a short description of the wcstServlet.
+ * @return a String containing wcstServlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "WCS-T Extension. Petascope version " + ConfigManager.PETASCOPE_VERSION;
+ }
+
+ private void printUsage(HttpServletResponse response) throws IOException {
+ System.out.println("WCS-T: returning usage message");
+ response.setContentType("text/html; charset=utf-8");
+ PrintWriter out = new PrintWriter(response.getOutputStream());
+
+ out.println(defaultHtmlResponse);
+
+ out.close();
+ System.out.println("WCS-T: done nothing");
+
+ }
+}
diff --git a/petascope/src/petascope/wcst/transaction/ServiceFirewall.java b/petascope/src/petascope/wcst/transaction/ServiceFirewall.java
new file mode 100644
index 0000000..28f6dc0
--- /dev/null
+++ b/petascope/src/petascope/wcst/transaction/ServiceFirewall.java
@@ -0,0 +1,52 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcst.transaction;
+
+/** Firewall class for WCS-T. It's job is to detect malitious queries and reject them.
+ * Currently, it only checks that queries do not occur too often.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class ServiceFirewall {
+
+ private static long lastQueryTime = 0;
+ /* Queries should not occur more often than this period (in seconds) */
+ private static final double MIN_QUERY_PERIOD = 10;
+
+ /** Do we reject a certain query through the firewall?
+ *
+ * @param query Query string
+ * @return boolean
+ */
+ public static boolean reject(String query) {
+ boolean result = true;
+
+ /* Check query period */
+ long currentTime = System.currentTimeMillis();
+ if (((currentTime - lastQueryTime) / 1000) >= MIN_QUERY_PERIOD) {
+ result = false;
+ }
+ lastQueryTime = currentTime;
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcst/transaction/executeAsyncTransaction.java b/petascope/src/petascope/wcst/transaction/executeAsyncTransaction.java
new file mode 100644
index 0000000..804c9bb
--- /dev/null
+++ b/petascope/src/petascope/wcst/transaction/executeAsyncTransaction.java
@@ -0,0 +1,162 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcst.transaction;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLEncoder;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.namespace.QName;
+import net.opengis.ows.v_1_0_0.ExceptionReport;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import petascope.wcs.server.exceptions.BadResponseHandlerException;
+import petascope.wcs.server.exceptions.InputOutputException;
+import petascope.wcs.server.exceptions.WCSException;
+import petascope.wcs.server.exceptions.XmlStructuresException;
+import wcst.transaction.schema.TransactionResponseType;
+
+/**
+ * This class processes asynchronously an WCS Transaction request.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class executeAsyncTransaction extends Thread {
+
+ private static Logger LOG = LoggerFactory.getLogger(executeAsyncTransaction.class);
+ private String responseHandler;
+ private executeTransaction exec;
+
+ /**
+ * Default constructor.
+ * @param exec a synchroneous executeTransaction object
+ * @param responseHandler destination URL that should receive the processed output
+ */
+ public executeAsyncTransaction(executeTransaction exec, String responseHandler) {
+ this.responseHandler = responseHandler;
+ this.exec = exec;
+ }
+
+ /** Run the current thread. */
+ public void run() {
+ LOG.info("Started async thread...");
+ String outString = null;
+ try // only for WCSException
+ {
+ try {
+ /* (1) Do the actual processing of the Transaction */
+ LOG.debug("Starting async execution ...");
+ TransactionResponseType output = exec.get();
+ JAXBElement jaxbOutput = new JAXBElement(new QName("", "TransactionResponse"), TransactionResponseType.class, output);
+
+ /* (2) Marshall the output XML into a String */
+ LOG.debug("Marshalling transaction response into a string ...");
+ JAXBContext jaxbCtx = JAXBContext.newInstance(output.getClass().getPackage().getName());
+ Marshaller marshaller = jaxbCtx.createMarshaller();
+ marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8"); //NOI18N
+ marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+ StringWriter strWriter = new StringWriter();
+
+ marshaller.marshal(jaxbOutput, strWriter);
+ outString = strWriter.toString();
+
+ /* (3) Send the output to the destination response handler */
+ sendPostRequest(outString, responseHandler);
+ } catch (MalformedURLException ex) {
+ LOG.error("Stack trace: " + ex);
+ throw new BadResponseHandlerException("Response Handler URL is malformed.");
+ } catch (IOException ex) {
+ LOG.error("Stack trace: " + ex);
+ throw new InputOutputException("Could not send asynchronous response to URL: " + responseHandler);
+ } catch (JAXBException ex) {
+ LOG.error("Stack trace: " + ex);
+ throw new XmlStructuresException("Could not marshall the XML to a string !");
+ }
+ } catch (WCSException e) {
+ LOG.error("Caught WCS Exception: " + e);
+ ExceptionReport report = e.getReport();
+ try {
+ /* Build the error report */
+ JAXBContext jaxbCtx = JAXBContext.newInstance(report.getClass().getPackage().getName());
+ Marshaller marshaller = jaxbCtx.createMarshaller();
+ marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
+ marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+ StringWriter strWriter = new StringWriter();
+ marshaller.marshal(report, strWriter);
+ outString = strWriter.toString();
+ LOG.trace("Done with the Error Report !");
+
+ /* Send the error report to the responseHandler */
+ sendPostRequest(outString, responseHandler);
+ } catch (JAXBException e2) {
+ LOG.error("Stack trace: " + e2);
+ } catch (IOException e2) {
+ LOG.error("Stack trace: " + e2);
+ }
+ }
+ }
+
+ /** Send string data to a URL end-point. Use this function to send the output
+ *
+ * @param content
+ * @param destinationUrl
+ * @throws MalformedURLException
+ * @throws IOException
+ */
+ private void sendPostRequest(String content, String destinationUrl) throws MalformedURLException, IOException {
+ LOG.debug("sendPostRequest() ... to URL: " + destinationUrl);
+
+ // connect to the destination
+ URL servlet = new URL(destinationUrl);
+ HttpURLConnection conn = (HttpURLConnection) servlet.openConnection();
+
+ // inform the connection that we will send output and will not accept input
+ conn.setDoInput(false);
+ conn.setDoOutput(true);
+
+ // Don't use a cached version of URL connection.
+ conn.setUseCaches(false);
+ conn.setDefaultUseCaches(false);
+
+ // Send POST request
+ conn.setRequestMethod("POST");
+
+ // Specify the content type that we will send binary data
+ conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
+
+ String data = "xml=" + URLEncoder.encode(content);
+ DataOutputStream out = new DataOutputStream(conn.getOutputStream());
+
+ out.writeBytes(data);
+ out.flush();
+ out.close();
+
+ LOG.debug("Sent request to URL.");
+ }
+}
diff --git a/petascope/src/petascope/wcst/transaction/executeTransaction.java b/petascope/src/petascope/wcst/transaction/executeTransaction.java
new file mode 100644
index 0000000..ed02780
--- /dev/null
+++ b/petascope/src/petascope/wcst/transaction/executeTransaction.java
@@ -0,0 +1,1152 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcst.transaction;
+
+//~--- non-JDK imports --------------------------------------------------------
+import java.sql.SQLException;
+import net.opengis.ows.v_1_0_0.BoundingBoxType;
+import net.opengis.wcs.ows.v_1_1_0.InterpolationMethodType;
+import net.opengis.wcs.v_1_1_0.CoverageDescriptionType;
+import net.opengis.wcs.v_1_1_0.CoverageDescriptions;
+import net.opengis.wcs.v_1_1_0.CoverageSummaryType;
+import net.opengis.wcs.v_1_1_0.FieldType;
+import net.opengis.wcs.v_1_1_0.RangeType;
+
+import org.apache.commons.io.IOUtils;
+
+import petascope.wcps.server.core.SDU;
+
+//~--- JDK imports ------------------------------------------------------------
+
+import java.awt.image.BufferedImage;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.StringReader;
+
+import java.math.BigInteger;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+
+import java.security.InvalidParameterException;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Random;
+import java.util.Set;
+import java.util.UUID;
+
+import javax.imageio.ImageIO;
+
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.Unmarshaller;
+import net.opengis.wcs.ows.v_1_1_0.InterpolationMethods;
+import org.odmg.ODMGException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import petascope.wcps.server.core.DbMetadataSource;
+import petascope.wcps.server.core.Metadata;
+import petascope.wcs.server.exceptions.WCSException;
+import petascope.ConfigManager;
+import petascope.wcps.server.core.CellDomainElement;
+import petascope.wcps.server.core.DomainElement;
+import petascope.wcps.server.core.InterpolationMethod;
+import petascope.wcps.server.exceptions.InvalidMetadataException;
+import petascope.wcps.server.exceptions.InvalidWcpsRequestException;
+import petascope.wcps.server.core.RangeElement;
+import petascope.wcps.server.exceptions.ResourceException;
+import petascope.wcs.server.exceptions.ActionNotSupportedException;
+import petascope.wcs.server.exceptions.InputOutputException;
+import petascope.wcs.server.exceptions.InternalComponentException;
+import petascope.wcs.server.exceptions.InternalSqlException;
+import petascope.wcs.server.exceptions.InvalidParameterValueException;
+import petascope.wcs.server.exceptions.InvalidRequestException;
+import petascope.wcs.server.exceptions.MissingParameterValueException;
+import petascope.wcs.server.exceptions.MultiBandImagesNotSupportedException;
+import petascope.wcs.server.exceptions.NoApplicableCodeException;
+import petascope.wcs.server.exceptions.NodeParsingNotImplementedException;
+import petascope.wcs.server.exceptions.XmlNotValidException;
+import petascope.wcs.server.exceptions.XmlStructuresException;
+import wcst.transaction.schema.CodeType;
+import wcst.transaction.schema.CoverageType;
+import wcst.transaction.schema.KeywordsType;
+import wcst.transaction.schema.LanguageStringType;
+import wcst.transaction.schema.ManifestType;
+import wcst.transaction.schema.ReferenceType;
+import wcst.transaction.schema.TransactionResponseType;
+import wcst.transaction.schema.TransactionType;
+import petascope.wcst.transaction.tools.RasdamanUtils;
+
+/**
+ * This class takes a WCS-T Transaction XML request and executes the request,
+ * building the corresponding XML respose. Use this class for synchronous processing.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class executeTransaction {
+
+ private static Logger LOG = LoggerFactory.getLogger(executeTransaction.class);
+// private static boolean printLog = true;
+ private boolean finished;
+ private TransactionType input;
+ protected TransactionResponseType output;
+ private RasdamanUtils rasUtils;
+ private String requestId;
+ private DbMetadataSource metaDb;
+ private HashSet<String> newCoverages;
+
+ /**
+ * Default constructor. Initialize internal variables.
+ * @param tr Transaction object, a WCS-T request
+ * @param metadataDbPath Path to the "dbparams.properties" file
+ */
+ public executeTransaction(TransactionType tr, DbMetadataSource source) throws WCSException {
+ input = tr;
+ output = new TransactionResponseType();
+ finished = false;
+ metaDb = source;
+ newCoverages = new HashSet<String>();
+
+ String server = ConfigManager.RASDAMAN_URL;
+ String db = ConfigManager.RASDAMAN_DATABASE;
+
+ rasUtils = new RasdamanUtils(server, db);
+ rasUtils.init();
+
+ // In case no-one will ever call this method and we need it
+ generateRequestId();
+ }
+
+ /**
+ * Generate a new Request ID string, and return it. If the transaction request
+ * does not include a request ID, the last generated string will be used.
+ * @return String Request ID
+ */
+ public String generateRequestId() {
+ requestId = String.valueOf(UUID.randomUUID());
+ return requestId;
+ }
+
+ /**
+ * Main method of this class: Computes the response to the TransactionResponse
+ * request given to the constructor. If needed, it also calls <b>process()</b>
+ * @return a TransactionResponse object.
+ * @throws WCSException
+ */
+ public TransactionResponseType get() throws WCSException {
+ try {
+ if (finished == false) {
+ metaDb.ensureConnection();
+ process();
+ }
+ } catch (SQLException e) {
+ throw new InternalSqlException("Could not ensure connection to database is valid", e);
+ }
+ if (finished == false) {
+ throw new NoApplicableCodeException("Could not execute the Transaction request! "
+ + "Please see the other errors...");
+ }
+
+ return output;
+ }
+
+ /**
+ * Computes the response to the Transaction request given to the constructor.
+ */
+ public void process() throws WCSException {
+ if (!input.getService().equalsIgnoreCase("WCS")) {
+ throw new InvalidParameterValueException("Service. Explanation: Service must be \"WCS\" !");
+ }
+ if (!input.getVersion().equalsIgnoreCase("1.1")) {
+ throw new InvalidParameterValueException("Service. Explanation: Service Version must be \"1.1\" !");
+ }
+
+ // Set the output request ID
+ String reqID = input.getRequestId();
+ if (reqID == null) {
+ reqID = "Request_" + requestId;
+ generateRequestId();
+ }
+ output.setRequestId(reqID);
+
+ // All actions succeed or fail as one group.
+ try {
+ ManifestType covs = input.getInputCoverages();
+ List l = covs.getReferenceGroup();
+
+ for (int i = 0; i < l.size(); i++) {
+ // This object is the XML element "InputCoverages"
+ Object obj = ((JAXBElement) l.get(i)).getValue();
+ CoverageType cov = (CoverageType) obj;
+
+ // Each action adds something to the output XML document
+ processInputCoverageNode(cov);
+ }
+
+ finished = true;
+
+ /* Commit rasdaman changes */
+ try {
+ LOG.debug("Commit rasdaman changes ...");
+ rasUtils.commitAndClose();
+ LOG.debug("Rasdaman coverages saved successfully !");
+ } catch (ODMGException e) {
+ throw new InternalComponentException("Could not commit Rasdaman changes !", e);
+ }
+
+ /* Commit metadata changes */
+ try {
+ LOG.debug("Commit metadata changes ...");
+ metaDb.commitAndClose();
+ LOG.debug("Metadata has been saved !");
+ } catch (SQLException e) {
+ throw new InternalSqlException("Could not commit metadata changes", e);
+ }
+ } catch (WCSException e) {
+ // One action failed, therefore all actions have failed
+
+ /* Abort metadata changes */
+ finished = false;
+ try {
+ LOG.debug("Rolling back metadata database changes ...");
+ metaDb.abortAndClose();
+ LOG.debug("Metadata rollback completed!");
+ } catch (SQLException ex) {
+ LOG.error("Could not rollback metadata changes.");
+ e.appendErrorDetail(" Could not rollback metadata changes!");
+ }
+
+ /* Abort rasdaman changes */
+ try {
+ LOG.debug("Aborting rasdaman changes ...");
+ rasUtils.abortAndClose();
+ LOG.debug("Rasdaman changes aborted !");
+ } catch (ODMGException ex) {
+ LOG.error("Could not abort rasdaman changes.");
+ e.appendErrorDetail(" Could not rollback rasdaman changes!");
+ }
+
+ throw e;
+ }
+ }
+
+ /**
+ * Delete a coverage from the Rasdaman server.
+ * @param identifier Name of coverage
+ * @throws Exception
+ */
+ private void deleteCoverageFromRasdaman(String identifier) throws Exception {
+ try {
+ LOG.trace("Deleting coverage from Rasdaman ...");
+ rasUtils.deleteCollection(identifier);
+ LOG.trace("Rasdaman Collection '" + identifier + "' is now deleted !");
+ } catch (ODMGException e) {
+ LOG.error("Failed to delete rasdaman collection " + identifier);
+ throw new InternalComponentException("Failed to delete collection from Rasdaman !", e);
+ }
+ }
+
+ /**
+ * Insert pixel data for a coverage into RasDaMan DB system
+ *
+ * @param identifier Identifier of the coverage
+ * @param href The location of the pixels for the new image
+ */
+ private void insertImageIntoRasdaman(String identifier, BufferedImage img)
+ throws WCSException {
+ LOG.trace("Inserting image into Rasdaman raster server...");
+ try {
+ rasUtils.insertGrayImageAsArray(identifier, img);
+ LOG.debug("Inserted image into Rasdaman !");
+ } catch (ODMGException e) {
+ LOG.error("Could not insert image into Rasdaman !");
+ throw new InternalComponentException("Could not insert image into Rasdaman.", e);
+ }
+ }
+
+ /** Load a BufferedImage from a ReferenceType object.
+ *
+ * @param pixels Reference object
+ * @return available image
+ * @throws WCSException
+ */
+ private BufferedImage loadPixelsReference(ReferenceType pixels) throws WCSException {
+ URL url = null;
+ BufferedImage img = null;
+
+ try {
+ url = new URL(pixels.getHref());
+ } catch (MalformedURLException e) {
+ LOG.error("URL " + url.toString() + " is not valid.");
+ throw new InvalidParameterValueException("Reference pixels. "
+ + "Explanation: URL " + url.toString() + " is not valid.");
+ }
+
+ try {
+ img = ImageIO.read(url);
+ if (img == null) {
+ throw new IOException("Empty stream while reading image.");
+ }
+ } catch (IOException e) {
+ LOG.error(e.getMessage());
+ throw new InputOutputException("Reference Pixels. Explanation: "
+ + "Could not read image from URL '" + url, e);
+ }
+
+ return img;
+ }
+
+ /**
+ * Load a Coverage Description XML object from a Reference
+ *
+ * @param identifier Name of coverage
+ * @param desc Reference to a CoverageDescriptions xml
+ * @return coverage description
+ * @throws WCSException
+ */
+ private CoverageDescriptionType loadDescriptionReference(String identifier,
+ ReferenceType desc) throws WCSException {
+ URL url = null;
+ String xmlString = null;
+ CoverageDescriptions descs = null;
+ CoverageDescriptionType desc0 = null;
+
+ // Load the URL
+ try {
+ url = new URL(desc.getHref());
+ } catch (MalformedURLException e) {
+ LOG.error("URL " + url.toString() + " is not valid !");
+ throw new InvalidParameterValueException("Reference pixels. Explanation: "
+ + "URL " + url.toString() + " is not valid.");
+ }
+
+ // Read the contents of the URL
+ try {
+ URLConnection conn = url.openConnection();
+ BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
+
+ xmlString = IOUtils.toString(in);
+ } catch (IOException ex) {
+ throw new InputOutputException("Description Reference. Explanation: error loading the "
+ + "coverage description from URL " + url.toString(), ex);
+ }
+
+ // Unmarshall the XML string into a Java Object
+ try {
+ JAXBContext jaxbCtx = JAXBContext.newInstance(CoverageDescriptions.class.getPackage().getName());
+ Unmarshaller unmarshaller = jaxbCtx.createUnmarshaller();
+ Object obj = unmarshaller.unmarshal(new StringReader(xmlString));
+
+ if (obj instanceof JAXBElement) {
+ descs = (CoverageDescriptions) ((JAXBElement) obj).getValue();
+ } else if (obj instanceof CoverageDescriptions) {
+ descs = (CoverageDescriptions) obj;
+ } else {
+ LOG.error("Coverage description metadata is not a valid xml document.");
+ throw new XmlNotValidException("Coverage "
+ + "description metadata is not a valid xml document.");
+ }
+
+ } catch (javax.xml.bind.JAXBException ex) {
+ throw new XmlStructuresException("Could not marshall/unmarshall XML structures.", ex);
+ }
+
+ // Filter by coverage name
+ desc0 = null;
+ Iterator<CoverageDescriptionType> i = descs.getCoverageDescription().iterator();
+
+ while (i.hasNext()) {
+ CoverageDescriptionType d = i.next();
+
+ if (d.getIdentifier().equals(identifier)) {
+ desc0 = d;
+ break;
+ }
+ }
+
+ if (desc0 == null) {
+ throw new InvalidRequestException("Could not find a CoverageDescription for coverage: " + identifier);
+ }
+
+ return desc0;
+ }
+
+ private CoverageSummaryType loadSummaryReference(ReferenceType pixels) throws WCSException {
+ URL url = null;
+ String xmlString = null;
+ CoverageSummaryType xml = null;
+
+ try {
+ url = new URL(pixels.getHref());
+ } catch (MalformedURLException e) {
+ throw new InvalidParameterValueException("Reference summary. Explanation: URL is not valid.", e);
+ }
+
+ // Read the contents of the URL
+ try {
+ URLConnection conn = url.openConnection();
+ BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
+
+ xmlString = IOUtils.toString(in);
+ } catch (IOException ex) {
+ throw new InputOutputException("Summary Reference. Explanation: "
+ + "Error loading the " + "coverage summary from URL " + url.toString(), ex);
+ }
+
+ // Unmarshall the XML string into a Java Object
+ try {
+ JAXBContext jaxbCtx = JAXBContext.newInstance(CoverageSummaryType.class.getPackage().getName());
+ Unmarshaller unmarshaller = jaxbCtx.createUnmarshaller();
+ Object obj = unmarshaller.unmarshal(new StringReader(xmlString));
+
+ if (obj instanceof JAXBElement) {
+ xml = (CoverageSummaryType) ((JAXBElement) obj).getValue();
+ } else if (obj instanceof CoverageSummaryType) {
+ xml = (CoverageSummaryType) obj;
+ } else {
+ throw new XmlNotValidException("Coverage Summary metadata is not a valid xml document.");
+ }
+ } catch (javax.xml.bind.JAXBException ex) {
+ throw new XmlStructuresException("Could not marshall/unmarshall XML structures.", ex);
+ }
+
+ return xml;
+ }
+
+ /**
+ * Updates the coverage metadata: textual descriptions. The title and the abstract
+ * could be specified in multiple languages, but we only store english.
+ *
+ * @param meta Metadata object to be modified
+ * @param summary summary object, that contains title, abstract and coverage keywords
+ * @return modified metadata object
+ */
+ private Metadata updateMetadataWithSummary(Metadata meta,
+ CoverageSummaryType summary) throws WCSException {
+ LOG.debug("Updating metadata with values from Coverage Summary...");
+
+ String title = null, abstr = null, keywords = null;
+
+ title = summary.getTitle();
+ abstr = summary.getAbstract();
+ List<net.opengis.ows.v_1_0_0.KeywordsType> keywordL = summary.getKeywords();
+ List<String> kList = new ArrayList<String>();
+ Iterator i = keywordL.iterator();
+
+ while (i.hasNext()) {
+ KeywordsType keywordInMultipleLangs = (KeywordsType) i.next();
+ String keyword = filterAcceptedLanguage(keywordInMultipleLangs.getKeyword());
+
+ kList.add(keyword);
+ }
+ keywords = SDU.string2str(kList);
+
+ meta.setTitle(title);
+ meta.setKeywords(keywords);
+ meta.setAbstract(abstr);
+
+ return meta.clone();
+ }
+
+ /**
+ * Retrieve only the string in the accepted language from a multiple-language list
+ *
+ * @param list List of strings in several languages
+ * @return String in the accepted language, or null if none is found
+ */
+ private String filterAcceptedLanguage(List<LanguageStringType> list) {
+ String result = null;
+ Iterator i = list.iterator();
+
+ while (i.hasNext()) {
+ LanguageStringType a = (LanguageStringType) i.next();
+
+ if (a.getLang().equals(ConfigManager.WCST_LANGUAGE)) {
+ result = a.getValue();
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Partially updates a Rasdaman coverage with pixels from pixHref. Info about
+ * the bounding box is available from descHref.
+ *
+ * @param identifier ID of the coverage to be updates
+ * @param pixHref URL for the pixels data
+ * @param descHref URL for the metadata
+ */
+ private void insertSomePixelsIntoRasdaman(String identifier, String pixHref, String descHref) {
+ // TODO: Implement !
+ LOG.error("Partial update is not yet implemented");
+ throw new UnsupportedOperationException("Partial Rasdaman update is not yet implemented.");
+ }
+
+ /**
+ * Inserts default metadata values for the given coverage.
+ *
+ * @param identifier ID of the coverage
+ * @param img The image, fetched from external reference
+ * @throws WCSException on error
+ */
+ private Metadata createNewCoverageMetadata(String identifier, BufferedImage img)
+ throws InvalidMetadataException {
+ Metadata m = null;
+ LOG.debug("Creating metadata with default values...");
+
+ // TODO: When we accept multi-band images, update nullDefault
+ String nullDefault = "0";
+
+ // Cell domains
+ BigInteger lowX = new BigInteger("0");
+ BigInteger highX = new BigInteger(String.valueOf(img.getHeight() - 1));
+ BigInteger lowY = new BigInteger("0");
+ BigInteger highY = new BigInteger(String.valueOf(img.getWidth() - 1));
+ CellDomainElement cellX = new CellDomainElement(lowX, highX);
+ CellDomainElement cellY = new CellDomainElement(lowY, highY);
+ List<CellDomainElement> cellList = new ArrayList<CellDomainElement>(2);
+ cellList.add(cellX);
+ cellList.add(cellY);
+
+ // Domains
+ Set<String> crsSet = new HashSet<String>(1);
+ crsSet.add(DomainElement.IMAGE_CRS);
+ String str1 = null, str2 = null;
+ /* Since we currently do not use the Domain sizes, we can set them to 0 and 1 */
+ DomainElement domX = new DomainElement("x", "x", 0.0, 1.0, str1, str2, crsSet, metaDb.getAxisNames());
+ DomainElement domY = new DomainElement("y", "y", 0.0, 1.0, str1, str2, crsSet, metaDb.getAxisNames());
+ List<DomainElement> domList = new ArrayList<DomainElement>(2);
+ domList.add(domX);
+ domList.add(domY);
+
+ // Ranges
+ /* TODO: When multiple-field images are supported, update ranges */
+ RangeElement range = new RangeElement("intensity", ConfigManager.WCST_DEFAULT_DATATYPE);
+ List<RangeElement> rList = new ArrayList<RangeElement>(1);
+ rList.add(range);
+
+ // Interpolation methods: only the default
+ String interpMeth = ConfigManager.WCST_DEFAULT_INTERPOLATION;
+ String nullRes = ConfigManager.WCST_DEFAULT_NULL_RESISTANCE;
+ InterpolationMethod interp = new InterpolationMethod(interpMeth, nullRes);
+ Set<InterpolationMethod> interpList = new HashSet<InterpolationMethod>(1);
+ interpList.add(interp);
+
+ // Null sets
+ /* TODO: update for multi-band images */
+ String nullVal = "0";
+ Set<String> nullSet = new HashSet<String>(1);
+ nullSet.add(nullVal);
+
+ // Descriptions
+ String abstr = null;
+ String title = "Coverage " + identifier;
+ String keywords = null;
+
+
+ m =
+ new Metadata(cellList, rList, nullSet, nullDefault, interpList,
+ interp, identifier, domList, null, title, abstr, keywords);
+
+ LOG.debug("Done creating default metadata");
+ return m;
+ }
+
+ /**
+ * Processes one <Coverage> node from the input XML
+ *
+ * @param elem the JAXB node equivalent to the <Coverage> node
+ */
+ private void processInputCoverageNode(CoverageType elem) throws WCSException {
+ if (elem.getAction() == null) {
+ throw new InvalidParameterValueException("Action. Explanation: "
+ + "Every <Coverage> node must contain an <Action> child node.");
+ }
+
+ String action = elem.getAction().getValue();
+ String identifier = null;
+ List references = null;
+
+ if (elem.getIdentifier() == null) {
+ throw new InvalidParameterException("Identifier");
+ }
+
+ identifier = elem.getIdentifier().getValue();
+ references = elem.getAbstractReferenceBase();
+
+ if (action.equalsIgnoreCase("Add")) {
+ actionAddCoverage(identifier, references);
+ } else if (action.equalsIgnoreCase("UpdateMetadata")) {
+ actionUpdateMetadata(identifier, references);
+ } else if (action.equalsIgnoreCase("Delete")) {
+ actionDeleteCoverage(identifier, references);
+ } else if (action.equalsIgnoreCase("UpdateAll")) {
+ actionUpdateAll(identifier, references);
+ } else if (action.equalsIgnoreCase("UpdateDataPart")) {
+ throw new ActionNotSupportedException("Action \"UpdateDataPart\" is not supported yet.");
+ /* TODO: UpdateDataPart is not yet functional. The Rasdaman server
+ * returns with an unexpected internal error (code: 10000) when
+ * a partial update query is sent. */
+// actionUpdateDataPart(identifier, references);
+ }
+ }
+
+ /**
+ * Performs the action "UpdateAll", as part of the Transaction operation
+ *
+ * @param identifier Name of coverage to update
+ * @param references List of references with data for update
+ */
+ private void actionUpdateAll(String identifier, List references) throws WCSException {
+ LOG.trace("Executing action Update All ...");
+ actionUpdateDataPart(identifier, references);
+ actionUpdateMetadata(identifier, references);
+ LOG.trace("Finished action Update All!");
+ }
+
+ /**
+ * Updates the Metadata DB with the information contained in the CoverageDescriptions XML object
+ *
+ * @param identifier ID of the coverage
+ * @param desc object that contains the coverage description.
+ */
+ private Metadata updateMetadataWithDescription(Metadata meta, CoverageDescriptionType desc) throws WCSException {
+ LOG.debug("Updating metadata with values from CoverageDescription...");
+
+ /* (B) Table ps_descriptions: Update coverage title, abstract, keywords */
+ String title = desc.getTitle();
+ String abstr = desc.getAbstract();
+ String keywords = desc.getKeywords().toString();
+
+ meta.setAbstract(abstr);
+ meta.setKeywords(keywords);
+ meta.setTitle(title);
+
+ /* (C) Table ps_range: Update field name, types, and interpolation methods */
+
+ if (desc.getRange() != null) {
+ Set<InterpolationMethod> interpSet = new HashSet<InterpolationMethod>();
+ RangeType range = desc.getRange();
+ List<FieldType> fields = range.getField();
+ try {
+ LOG.debug("Updating range information...");
+ Iterator<FieldType> i = fields.iterator();
+ ArrayList<RangeElement> rangeList = new ArrayList<RangeElement>();
+
+ while (i.hasNext()) {
+ FieldType field = i.next();
+
+ String name = field.getIdentifier();
+ String datatype = field.getDefinition().getDataType().getValue();
+ RangeElement fieldRange = new RangeElement(name, datatype);
+ rangeList.add(fieldRange);
+
+ InterpolationMethods methods = field.getInterpolationMethods();
+ String interpType = methods.getDefaultMethod().getValue();
+ String nullResist = methods.getDefaultMethod().getNullResistance();
+ InterpolationMethod interp = new InterpolationMethod(interpType, nullResist);
+ interpSet.add(interp);
+
+ Iterator<InterpolationMethodType> it = methods.getOtherMethod().iterator();
+ while (it.hasNext()) {
+ InterpolationMethodType imt = it.next();
+ String type = imt.getValue();
+ String resis = imt.getNullResistance();
+ interp = new InterpolationMethod(type, resis);
+ interpSet.add(interp);
+ }
+ }
+ meta.setRange(rangeList);
+ } catch (InvalidMetadataException e) {
+ throw new InternalComponentException("Invalid metadata.", e);
+ }
+ meta.setInterpolationSet(interpSet);
+ }
+
+ /* (D) Table ps_coverage: Update default interpolation method and null resistance */
+
+ /*
+ * We store interpolation methods at coverage level, not field level.
+ * So we only look at the interpolation method list of the first field,
+ * and use it on the whole coverage
+ */
+ if (desc.isSetRange()) {
+ try {
+ LOG.debug("Updating default interpolation method...");
+ InterpolationMethodType def1 = desc.getRange().getField().get(0).getInterpolationMethods().getDefaultMethod();
+ String method = def1.getValue();
+ String resist = def1.getNullResistance();
+
+ InterpolationMethod meth = new InterpolationMethod(method, resist);
+ meta.setDefaultInterpolation(meth);
+ } catch (InvalidMetadataException e) {
+ throw new InternalComponentException("Invalid metadata.", e);
+ }
+ }
+
+ /* (E) Table ps_celldomain: Update cell domain of the coverage. */
+ /* NOTE: Only works for 2-D (x/y) or 3-D (x/y/t) coverages */
+
+ if (desc.isSetDomain()) {
+ LOG.debug("Updating spatial bounding box of coverage ...");
+ try {
+ List<JAXBElement<? extends BoundingBoxType>> list =
+ desc.getDomain().getSpatialDomain().getBoundingBox();
+ if (list.size() == 1) {
+ BoundingBoxType bbox = (BoundingBoxType) list.get(0).getValue();
+ if (bbox.getCrs() == null || bbox.getCrs().equals(DomainElement.IMAGE_CRS)) {
+ meta = updateImageCrsBoundingBox(meta, bbox);
+ } else {
+ throw new InvalidParameterValueException("crs. Explanation: Unknown CRS " + bbox.getCrs());
+ }
+ } else {
+ Iterator i = list.iterator();
+ while (i.hasNext()) {
+ BoundingBoxType bbox = (BoundingBoxType) i.next();
+ if (bbox.getCrs().equals(DomainElement.IMAGE_CRS)) {
+ meta = updateImageCrsBoundingBox(meta, bbox);
+ }
+ // TODO: Implement WGS84 update
+ // if (bbox.getCrs().equals(DomainElement.WGS84_CRS))
+ // updateWgs84CrsBoundingBox(meta, bbox);
+ }
+ }
+ } catch (InvalidMetadataException e) {
+ throw new InternalComponentException("Invalid metadata.", e);
+ }
+ }
+
+ if (desc.getDomain().isSetTemporalDomain()) {
+ LOG.debug("Updating temporal bounding box of coverage ...");
+ /*
+ try
+ {
+ List<Object> list =
+ desc.getDomain().getTemporalDomain().getTimePositionOrTimePeriod();
+ if (list.size() == 1)
+ {
+ Object obj = list.get(0);
+ if (obj instanceof TimePeriodType)
+ {
+ TimePeriodType period = (TimePeriodType) obj;
+ TimePositionType start = period.getBeginPosition();
+ TimePositionType end = period.getEndPosition();
+ }
+ }
+ else
+ {
+ throw new WCSException("InvalidParameterValue", "TemporalDomain",
+ "Exactly one time-period should be present in the " +
+ "Temporal Domain of coverage: " + meta.getCoverageName());
+ }
+ }
+ catch (InvalidMetadataException e)
+ {
+ throw new WCSException("InvalidParameterValue", "Unknown, please look at the root cause exception.", e);
+ }
+ */
+ LOG.error("This server did not implement the parsing of 'TimePeriod' nodes.");
+ throw new NodeParsingNotImplementedException("This server did not implement the parsing of 'TimePeriod' nodes.");
+ }
+
+ /* (F) Table ps_crss: Update supported CRS */
+ // TODO later ... we don't support CRSs as of yet
+
+ return meta;
+ }
+
+ /**
+ * Performs the action "UpdateDataPart", as part of the Transaction operation
+ *
+ * @param identifier
+ * @param references
+ */
+ private void actionUpdateDataPart(String identifier, List references) throws WCSException {
+ LOG.trace("Executing action UpdateDataPart ...");
+
+ // Error checking
+ // Only change the metadata for an existing coverage
+ Metadata m = null;
+ try {
+ m = metaDb.read(identifier);
+ } catch (ResourceException e) {
+ throw new InternalComponentException("Invalid metadata for coverage: " + identifier, e);
+ } catch (InvalidWcpsRequestException e) {
+ throw new InternalComponentException("Could not read metadata for coverage: " + identifier, e);
+ }
+
+ // Obtain the references
+ ReferenceType pixels, desc;
+
+ pixels = getPixelsRef(references);
+ desc = getDescriptionRef(references);
+
+ // References check. We are updating a coverage values, mandatory are: pixels, description
+ if (pixels == null) {
+ throw new MissingParameterValueException("Reference role='" + getUrnCode("pixels") + "'");
+ }
+ if (desc == null) {
+ throw new MissingParameterValueException("Reference role='" + getUrnCode("description") + "'");
+ }
+
+ // (2) Do the actual processing
+ try {
+ insertSomePixelsIntoRasdaman(identifier, pixels.getHref(), desc.getHref());
+ } catch (Exception e) {
+ throw new NoApplicableCodeException(e.getMessage(), e);
+ }
+ }
+
+ /**
+ * Performs the action "UpdateMetadata", as part of the Transaction operation
+ *
+ * @param identifier
+ * @param references
+ * @throws wcs.server.core.WCSException
+ */
+ private void actionUpdateMetadata(String identifier, List references) throws WCSException {
+ LOG.trace("Executing action Update Metadata...");
+
+ // Only change the metadata for an existing coverage
+ Metadata m = null;
+ try {
+ m = metaDb.read(identifier);
+ } catch (Exception e) {
+ throw new InternalComponentException("Invalid metadata for coverage: " + identifier, e);
+ }
+
+ // Obtain the references
+ ReferenceType descRef, summRef;
+
+ descRef = getDescriptionRef(references);
+ summRef = getSummaryRef(references);
+
+ // References check. We are updating metadata, mandatory is only the description
+ if (descRef == null) {
+ throw new MissingParameterValueException("Reference role='" + getUrnCode("description") + "'");
+ }
+
+ LOG.trace("Loading reference: coverage description ...");
+ CoverageDescriptionType desc = loadDescriptionReference(identifier, descRef);
+
+ CoverageSummaryType summ = null;
+
+ if (summRef != null) {
+ LOG.trace("Loading reference: coverage summary ...");
+ summ = loadSummaryReference(summRef);
+ }
+
+ LOG.trace("Done loading references !");
+
+ // (2) Do the actual processing
+ try {
+ Metadata oldMeta = m;
+ Metadata newMeta = updateMetadataWithDescription(oldMeta, desc);
+ if (summ != null) {
+ Metadata tempMeta = newMeta;
+ newMeta = updateMetadataWithSummary(newMeta, summ);
+ }
+
+ metaDb.updateCoverageMetadata(m, false);
+ } catch (Exception e) {
+ throw new NoApplicableCodeException("Error while updating metadata.", e);
+ }
+
+ LOG.trace("Finished action Update Metadata !");
+ }
+
+ /**
+ * Performs the action "Add", as part of the Transaction operation
+ *
+ * @param identifier
+ * @param references
+ * @throws wcs.server.core.WCSException
+ */
+ private void actionAddCoverage(String identifier, List references) throws WCSException {
+ LOG.trace("Executing action AddCoverage ...");
+
+ // Obtain the references
+ ReferenceType pixelsRef, descRef, summRef;
+
+ pixelsRef = getPixelsRef(references);
+ descRef = getDescriptionRef(references);
+ summRef = getSummaryRef(references);
+
+ // References check. We are adding a coverage, mandatory are: pixels, description
+ if (pixelsRef == null) {
+ throw new MissingParameterValueException("Reference role='" + getUrnCode("pixels") + "'");
+ }
+ if (descRef == null) {
+ throw new MissingParameterValueException("Reference role='" + getUrnCode("description") + "'");
+ }
+
+ LOG.trace("Loading reference: coverage pixels ...");
+ BufferedImage img = loadPixelsReference(pixelsRef);
+
+ LOG.trace("Loading reference: coverage description ...");
+ CoverageDescriptionType desc = loadDescriptionReference(identifier, descRef);
+
+ CoverageSummaryType summ = null;
+
+ if (summRef != null) {
+ LOG.trace("Loading reference: coverage summary ...");
+ summ = loadSummaryReference(summRef);
+ }
+
+ LOG.trace("Done loading references !");
+
+ /**
+ * (1) Check coverage name
+ */
+ boolean changeId = false;
+
+ if (newCoverages.contains(identifier)) {
+ throw new InvalidParameterValueException("Identifier: You cannot use the same identifier twice.");
+ }
+
+ if (metaDb.existsCoverageName(identifier)) {
+ changeId = true;
+ LOG.warn("Changing coverage identifier since coverage '" + identifier + "' already exists !");
+ }
+
+ // Generate new coverage name ?
+ while (changeId) {
+ identifier = "coverage_" + Integer.toString((new Random()).nextInt());
+ changeId = metaDb.existsCoverageName(identifier);
+ }
+
+ /**
+ * (2) Do the actual processing. Stores the image in rasdaman.
+ */
+ try {
+ /* Currently we only support one-band (gray-scale) images. */
+ if (img.getColorModel().getNumComponents() != 1) {
+ throw new MultiBandImagesNotSupportedException(
+ "This server currently only supports one-band images (grayscale). "
+ + "This coverage has " + img.getColorModel().getNumComponents() + " bands.");
+ }
+ insertImageIntoRasdaman(identifier, img);
+ } catch (Exception e) {
+ throw new InternalComponentException("Error while inserting image in rasdaman.", e);
+ }
+
+ /**
+ * (3) Build the metadata object and store it in the db.
+ */
+ try {
+ Metadata m = createNewCoverageMetadata(identifier, img);
+ m = updateMetadataWithDescription(m, desc);
+ /* Top level descriptions overwrite other metadata sources */
+ if (summ != null) {
+ m = updateMetadataWithSummary(m, summ);
+ }
+
+ metaDb.insertNewCoverageMetadata(m, false);
+ } catch (InvalidMetadataException e) {
+ throw new InternalComponentException("Metadata to be inserted is invalid.", e);
+ } catch (ResourceException e) {
+ throw new InternalComponentException("Could not insert metadata into database.", e);
+ }
+
+ /**
+ * (4) Indicate success: Add this ID to the output XML document
+ */
+ CodeType id = new CodeType();
+ id.setValue(identifier);
+ output.getIdentifier().add(id);
+ LOG.trace("Finished action Add !");
+ }
+
+ /**
+ * Performs the action "Delete", as part of the Transaction operation
+ *
+ * @param identifier
+ * @param references
+ * @throws wcs.server.core.WCSException
+ */
+ private void actionDeleteCoverage(String identifier, List references) throws WCSException {
+ LOG.trace("Executing action Delete Coverage ...");
+
+ if (metaDb.existsCoverageName(identifier) == false) {
+ throw new InvalidParameterValueException("Identifier");
+ }
+
+ // (2) Do the actual processing
+ try {
+ Metadata m = metaDb.read(identifier);
+ deleteCoverageFromRasdaman(identifier);
+ metaDb.delete(m, false);
+ } catch (Exception e) {
+ throw new NoApplicableCodeException("Error while deleting coverage.", e);
+ }
+
+ // Indicate success: Add this ID to the output XML document
+ CodeType id = new CodeType();
+
+ id.setValue(identifier);
+ output.getIdentifier().add(id);
+
+ LOG.trace("Finished action Delete !");
+ }
+
+ /**
+ * Retrieve the full URN code of a string
+ *
+ * @param key Internal representation of a URN code
+ * @return the URN code
+ */
+ private String getUrnCode(String key) throws WCSException {
+ if (key.equalsIgnoreCase("pixels")) {
+ return "urn:ogc:def:role:WCS:1.1:Pixels";
+ }
+ if (key.equalsIgnoreCase("description")) {
+ return "urn:ogc:def:role:WCS:1.1:CoverageDescription";
+ }
+ if (key.equalsIgnoreCase("summary")) {
+ return "urn:ogc:def:role:WCS:1.1:CoverageSummary";
+ }
+ if (key.equalsIgnoreCase("transform")) {
+ return "urn:ogc:def:role:WCS:1.1:GeoreferencingTransformation";
+ }
+ if (key.equalsIgnoreCase("other")) {
+ return "urn:ogc:def:role:WCS:1.1:OtherSource";
+ }
+
+ throw new InternalComponentException("Unknown URN key '" + key + "'");
+ }
+
+ /**
+ * Get the Pixels Reference
+ *
+ * @param references List of References
+ * @return the Pixels Reference
+ */
+ private ReferenceType getPixelsRef(List references) throws WCSException {
+ ReferenceType result = searchReferenceList("pixels", references);
+
+ return result;
+ }
+
+ /**
+ * Get the Coverage Description Reference
+ *
+ * @param references List of References
+ * @return the Coverage Description Reference
+ */
+ private ReferenceType getDescriptionRef(List references) throws WCSException {
+ ReferenceType result = searchReferenceList("description", references);
+
+ return result;
+ }
+
+ /**
+ * Get the Coverage Summary Reference
+ *
+ * @param references List of References
+ * @return the Coverage Summary Reference
+ */
+ private ReferenceType getSummaryRef(List references) throws WCSException {
+ ReferenceType result = searchReferenceList("summary", references);
+
+ return result;
+ }
+
+ /**
+ * Get the Georeferencing Transform Reference
+ *
+ * @param references List of References
+ * @return the Georeferencing Transform Reference
+ */
+ private ReferenceType getTransformRef(List references) throws WCSException {
+ ReferenceType result = searchReferenceList("transform", references);
+
+ return result;
+ }
+
+ /**
+ * Get the "Other" Reference
+ *
+ * @param references List of References
+ * @return the "Other" Reference
+ */
+ private ReferenceType getOtherRef(List references) throws WCSException {
+ ReferenceType result = searchReferenceList("other", references);
+
+ return result;
+ }
+
+ /**
+ * Search a references list for a particular term
+ * @param key internal name of reference
+ * @param references List of references
+ * @return a Reference object
+ */
+ private ReferenceType searchReferenceList(String key, List references) throws WCSException {
+ String urn = getUrnCode(key);
+ Iterator i = references.iterator();
+
+ while (i.hasNext()) {
+ Object obj = i.next();
+ JAXBElement jelem = (JAXBElement) obj;
+ ReferenceType ref = (ReferenceType) jelem.getValue();
+ String role = ref.getRole();
+
+ if (role.equalsIgnoreCase(urn)) {
+ return ref;
+ }
+ }
+
+ return null;
+ }
+
+ private Metadata updateImageCrsBoundingBox(Metadata meta, BoundingBoxType bbox) throws WCSException, InvalidMetadataException {
+ List<Double> lower = bbox.getLowerCorner();
+ List<Double> upper = bbox.getUpperCorner();
+
+ if (lower.size() != 2) {
+ throw new InvalidParameterException("LowerCorner. Explanation: Should contain only two numbers.");
+ }
+ if (upper.size() != 2) {
+ throw new InvalidParameterException("UpperCorder. Explanation: Should contain only two numbers.");
+ }
+ long loX = lower.get(0).longValue();
+ long loY = lower.get(1).longValue();
+ long hiX = upper.get(0).longValue();
+ long hiY = upper.get(1).longValue();
+
+ CellDomainElement cellX = new CellDomainElement(BigInteger.valueOf(loX), BigInteger.valueOf(hiX));
+ CellDomainElement cellY = new CellDomainElement(BigInteger.valueOf(loY), BigInteger.valueOf(hiY));
+
+ List<CellDomainElement> list = new ArrayList<CellDomainElement>();
+ list.add(cellX);
+ list.add(cellY);
+
+ meta.setCellDomain(list);
+ return meta.clone();
+ }
+}
diff --git a/petascope/src/petascope/wcst/transaction/tools/RasdamanUtils.java b/petascope/src/petascope/wcst/transaction/tools/RasdamanUtils.java
new file mode 100644
index 0000000..53ba581
--- /dev/null
+++ b/petascope/src/petascope/wcst/transaction/tools/RasdamanUtils.java
@@ -0,0 +1,472 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcst.transaction.tools;
+
+//~--- non-JDK imports --------------------------------------------------------
+import org.odmg.DBag;
+import org.odmg.Database;
+import org.odmg.Implementation;
+import org.odmg.ODMGException;
+import org.odmg.OQLQuery;
+import org.odmg.Transaction;
+
+import rasj.RasGMArray;
+import rasj.RasImplementation;
+import rasj.RasMInterval;
+import rasj.RasResultIsNoIntervalException;
+
+import petascope.wcs.server.exceptions.WCSException;
+
+//~--- JDK imports ------------------------------------------------------------
+
+import java.awt.Graphics;
+import java.awt.image.BufferedImage;
+import java.awt.image.DataBuffer;
+
+import java.io.ByteArrayInputStream;
+
+import java.util.Iterator;
+import org.odmg.QueryException;
+import petascope.wcs.server.exceptions.InternalComponentException;
+
+/**
+ * Utility class for doing various tasks that involve the Rasdaman server.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class RasdamanUtils {
+
+ Implementation myApp = null;
+ Database myDb = null;
+ Transaction myTa = null;
+ private String base;
+ private String server;
+
+ /**
+ * Simple constructor
+ *
+ * @param s server string
+ * @param b database name
+ */
+ public RasdamanUtils(String s, String b) {
+ this.server = s;
+ this.base = b;
+ }
+
+ public void log(String msg) {
+ System.err.flush();
+ System.out.println("Rasdaman Utils: " + msg);
+ System.out.flush();
+ }
+
+ /**
+ * Opens a new connection to the Rasdaman server, and starts a new transaction.
+ * @throws WCSException on connection error
+ */
+ public void init() throws WCSException {
+ try {
+ if (myApp == null) {
+ myApp = new RasImplementation(server);
+ }
+ if (myDb == null) {
+ myDb = myApp.newDatabase();
+ log("Opening database...");
+ myDb.open(base, Database.OPEN_READ_WRITE);
+ }
+ if (myTa == null) {
+ log("Beginning new transaction ...");
+ myTa = myApp.newTransaction();
+ myTa.begin();
+ }
+ } catch (ODMGException e) {
+ throw new InternalComponentException("Could not connect to the Rasdaman server !", e);
+ }
+ }
+
+ public void commitAndClose() throws ODMGException {
+ if (myTa != null) {
+ log("Commiting transaction ...");
+ myTa.commit();
+ myTa = null;
+ }
+ if (myDb != null) {
+ log("Closing database...");
+ myDb.close();
+ myDb = null;
+ }
+ log("Finished !");
+ }
+
+ public void abortAndClose() throws ODMGException {
+ if (myTa != null) {
+ log("Aborting transaction...");
+ myTa.abort();
+ myTa = null;
+ }
+ if (myDb != null) {
+ log("Closing database...");
+ myDb.close();
+ myDb = null;
+ }
+ log("Finished !");
+ }
+
+ public BufferedImage loadCoverage(String name) throws Exception {
+ init();
+
+ log("Running Load Coverage " + name + " query!");
+ OQLQuery myQu = myApp.newOQLQuery();
+
+ myQu.create("select jpeg(" + name + ") from " + name);
+ DBag resultSet = (DBag) myQu.execute();
+
+ if (resultSet != null) {
+ log("Query successful !");
+ Iterator iter = resultSet.iterator();
+
+ if (iter.hasNext()) {
+ RasGMArray result = (RasGMArray) iter.next();
+ byte[] ba = result.getArray();
+ ByteArrayInputStream bas = new ByteArrayInputStream(ba);
+ com.sun.image.codec.jpeg.JPEGImageDecoder decoder = com.sun.image.codec.jpeg.JPEGCodec.createJPEGDecoder(bas);
+ BufferedImage bufImg = null;
+
+ try {
+ bufImg = decoder.decodeAsBufferedImage();
+ } catch (Exception e) {
+ System.err.println("Error decoding the image !!!");
+ }
+
+ commitAndClose();
+
+ return bufImg;
+ }
+ }
+
+ abortAndClose();
+
+ return null;
+ }
+
+ public RasGMArray createMDD() throws RasResultIsNoIntervalException {
+ // create 2-D MDD with cell length 1, i.e., type “byte”:
+ RasGMArray myMDD = new RasGMArray(new RasMInterval("[1:400,1:400]"), 1);
+ // byte container for array data, matching in size:
+ byte[] mydata = new byte[160000];
+
+ // initialize array as grid of gray and black stripes:
+ for (int y = 0; y < 400; y++) {
+ for (int x = 0; x < 400; x++) {
+ mydata[y * 399 + x] = (byte) ((y % 4) > 1
+ ? 80
+ : 0);
+ }
+ }
+ // now insert byte array into MDD object
+ // (sets only the pointer, no copying takes place!):
+ myMDD.setArray(mydata);
+
+ return myMDD;
+ }
+
+ public void insertGrayImageAsArray(String name) throws ODMGException {
+ try {
+ init();
+
+ log("Creating grey image ...");
+ RasGMArray myMDD = createMDD();
+ // set up query object for collection creation:
+ OQLQuery myQu = myApp.newOQLQuery();
+
+ myQu.create("create collection " + name + " GreySet");
+ // set the object type name (used for server type checking):
+ myMDD.setObjectTypeName("GreyImage");
+ // finally, execute “create collection” statement:
+ log("Creating collection '" + name + "'");
+ myQu.execute();
+ // now create the insert statement:
+ myQu.create("insert into " + name + " values $1");
+ // let the server generate a new OID for the object to be
+ // inserted, and remember this OID locally:
+ String myNewOID = myApp.getObjectId(myMDD);
+
+ // bind the MDD value which substitutes formal parameter $1:
+ myQu.bind(myMDD);
+ // …and ship the complete statement to the server:
+ log("Inserting data into the collection");
+ myQu.execute();
+ log("Done !");
+
+ commitAndClose();
+ } catch (Exception e) {
+ e.printStackTrace();
+ abortAndClose();
+ }
+ }
+
+ public void updateGrayImageWithArray(String name, BufferedImage img, int x1, int y1, int x2,
+ int y2) {
+ try {
+ log("Building query for updating gray image ...");
+ RasGMArray myMDD = createMddFromImage(img);
+
+ myMDD.setObjectTypeName("GreyImage");
+ // set up query object for collection creation:
+ OQLQuery myQu = myApp.newOQLQuery();
+ // Where to insert new image
+ String interval = String.valueOf(x1) + ":" + String.valueOf(x2) + ","
+ + String.valueOf(y1) + ":" + String.valueOf(y2);
+ // Size of new image
+ String interval2 = String.valueOf(0) + ":" + String.valueOf(x2 - x1) + ","
+ + String.valueOf(0) + ":" + String.valueOf(y2 - y1);
+
+ myQu.create("update " + name + " AS c SET c[" + interval + "] "
+ + "assign maaray x in [" + interval2 + "] values $1");
+ // let the server generate a new OID for the object to be
+ // inserted, and remember this OID locally:
+ String myNewOID = myApp.getObjectId(myMDD);
+
+ // bind the MDD value which substitutes formal parameter $1:
+ myQu.bind(myMDD);
+ // …and ship the complete statement to the server:
+ log("Updating image ...");
+ myQu.execute();
+ log("Done !");
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void insertGrayImageAsArray(String name, BufferedImage img) throws ODMGException, InternalComponentException {
+ log("Creating grey image ...");
+ RasGMArray myMDD = createMddFromImage(img);
+ // set up query object for collection creation:
+ OQLQuery myQu = myApp.newOQLQuery();
+
+ myQu.create("create collection " + name + " GreySet");
+ // set the object type name (used for server type checking):
+ myMDD.setObjectTypeName("GreyImage");
+ // finally, execute “create collection” statement:
+ log("Creating collection '" + name + "'");
+ myQu.execute();
+ // now create the insert statement:
+ myQu.create("insert into " + name + " values $1");
+ // let the server generate a new OID for the object to be
+ // inserted, and remember this OID locally:
+ String myNewOID = myApp.getObjectId(myMDD);
+
+ // bind the MDD value which substitutes formal parameter $1:
+ myQu.bind(myMDD);
+ // …and ship the complete statement to the server:
+ log("Inserting data into the collection");
+ myQu.execute();
+ log("Done !");
+ }
+
+ public void insertColorImageAsArray(String name, BufferedImage img) throws ODMGException {
+ try {
+ log("Creating grey image ...");
+ RasGMArray myMDD = createMddFromImage(img);
+ // set up query object for collection creation:
+ OQLQuery myQu = myApp.newOQLQuery();
+
+ myQu.create("create collection " + name + " RGBSet");
+ // set the object type name (used for server type checking):
+ myMDD.setObjectTypeName("RGBImage");
+ // finally, execute “create collection” statement:
+ log("Creating collection '" + name + "'");
+ myQu.execute();
+ // now create the insert statement:
+ myQu.create("insert into " + name + " values $1");
+ // let the server generate a new OID for the object to be
+ // inserted, and remember this OID locally:
+ String myNewOID = myApp.getObjectId(myMDD);
+
+ // bind the MDD value which substitutes formal parameter $1:
+ myQu.bind(myMDD);
+ // …and ship the complete statement to the server:
+ log("Inserting data into the collection");
+ myQu.execute();
+ log("Done !");
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void insertImageAsJpeg(String name, byte[] img, int maxX, int maxY) throws ODMGException {
+ try {
+ init();
+
+ log("Creating image from bytes ...");
+ RasGMArray myMDD = createRasArrayFromBytes(img, maxX, maxY);
+ // set up query object for collection creation:
+ OQLQuery myQu = myApp.newOQLQuery();
+
+ myQu.create("create collection " + name + " GreySet");
+ // set the object type name (used for server type checking):
+ myMDD.setObjectTypeName("GreyImage");
+ // finally, execute “create collection” statement:
+ log("Creating collection '" + name + "'");
+ myQu.execute();
+ // now create the insert statement:
+ myQu.create("insert into " + name + " values inv_jpeg($1)");
+ // let the server generate a new OID for the object to be
+ // inserted, and remember this OID locally:
+ String myNewOID = myApp.getObjectId(myMDD);
+
+ // bind the MDD value which substitutes formal parameter $1:
+ myQu.bind(myMDD);
+ // …and ship the complete statement to the server:
+ log("Inserting data into the collection");
+ myQu.execute();
+ log("Done !");
+
+ commitAndClose();
+ } catch (Exception e) {
+ System.out.flush();
+ e.printStackTrace();
+ System.err.flush();
+ abortAndClose();
+ }
+ }
+
+ private RasGMArray createRasArrayFromBytes(byte[] bytes, int maxX, int maxY)
+ throws RasResultIsNoIntervalException {
+ // create 2-D MDD with cell length 1, i.e., type “byte”:
+ String strX = String.valueOf(maxX), strY = String.valueOf(maxY);
+ String interval = "[1:" + strX + "],1:" + strY + "]";
+ // FIXME: maybe change cell type?
+ int cellType = 1;
+
+ // create the RasGMArray object
+ RasGMArray myMDD = new RasGMArray(new RasMInterval(interval), cellType);
+
+ myMDD.setArray(bytes);
+
+ return myMDD;
+ }
+
+ public void deleteCollection(String name)
+ throws ODMGException, ODMGException, ODMGException, Exception {
+ try {
+// init();
+
+ log("Creating query...");
+ // set up query object for collection creation:
+ OQLQuery myQu = myApp.newOQLQuery();
+
+ myQu.create("drop collection " + name);
+ // finally, execute “create collection” statement:
+ log("Executing deletion query...");
+ myQu.execute();
+ // now create the insert statement:
+ log("Query finished !");
+
+// commitAndClose();
+ } catch (Exception e) {
+ e.printStackTrace();
+
+ throw e;
+// abortAndClose();
+ }
+ }
+
+ public void printAllCollections() throws ODMGException {
+ String query = "select r from RAS_COLLECTIONNAMES as r";
+
+// init();
+
+ log("Querying for all available collections ...");
+ OQLQuery myQu = myApp.newOQLQuery();
+
+ myQu.create(query);
+
+ DBag resultSet = (DBag) myQu.execute();
+
+ if (resultSet != null) {
+ Iterator iter = resultSet.iterator();
+
+ while (iter.hasNext()) {
+ RasGMArray result = (RasGMArray) iter.next();
+ byte[] ba = result.getArray();
+ String name = new String(ba);
+
+ if (name.endsWith("\u0000")) {
+ name = name.substring(0, name.length() - (new String("\u0000")).length());
+ }
+
+ System.out.println("* " + name);
+ }
+ }
+
+// commitAndClose();
+ }
+
+ public RasGMArray createMddFromImage(BufferedImage img) throws InternalComponentException {
+ String interval = null;
+ try {
+ int cols = img.getWidth();
+ int rows = img.getHeight();
+ // create 2-D MDD with cell length 1, i.e., type “byte”:
+ interval = "[1:" + cols + ",1:" + rows + "]";
+ int cellType = 1;
+
+ // create the RasGMArray object
+ RasGMArray myMDD = new RasGMArray(new RasMInterval(interval), cellType);
+ DataBuffer db = img.getData().getDataBuffer();
+ byte[] bytes = new byte[cols * rows];
+
+
+ System.out.println("Processing image with size: " + interval);
+ System.out.println("Created vector with size: " + cols * rows);
+ System.out.println("Processing data with size: " + db.getSize());
+ int i = 0;
+
+ /*
+ * Java image data-types store an image as a 1-D array, reading the
+ * image row-wise. Rasdaman stores the image column-wise. So we need to
+ * convert between the two representations.
+ */
+ for (int c = 0; c < cols; c++) {
+ for (int r = 0; r < rows; r++) {
+ bytes[i++] = (byte) db.getElem(r * cols + c);
+ }
+ }
+ myMDD.setArray(bytes);
+
+ return myMDD;
+ } catch (RasResultIsNoIntervalException e) {
+ throw new InternalComponentException("Illegal Interval String: " + interval, e);
+ }
+ }
+
+ public BufferedImage convertImageToGray(BufferedImage img) {
+ BufferedImage image = new BufferedImage(img.getWidth(), img.getHeight(),
+ BufferedImage.TYPE_BYTE_GRAY);
+ Graphics g = image.getGraphics();
+
+ g.drawImage(img, 0, 0, null);
+ g.dispose();
+
+ return image;
+ }
+}
diff --git a/petascope/src/petascope/wcst/transaction/tools/TestRasdamanUtils.java b/petascope/src/petascope/wcst/transaction/tools/TestRasdamanUtils.java
new file mode 100644
index 0000000..54c00eb
--- /dev/null
+++ b/petascope/src/petascope/wcst/transaction/tools/TestRasdamanUtils.java
@@ -0,0 +1,202 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcst.transaction.tools;
+
+//~--- non-JDK imports --------------------------------------------------------
+import java.awt.Graphics;
+import java.awt.Panel;
+import org.odmg.*;
+
+import rasj.*;
+
+//~--- JDK imports ------------------------------------------------------------
+
+import java.awt.image.BufferedImage;
+
+import java.io.IOException;
+
+import java.net.URL;
+
+import javax.imageio.ImageIO;
+
+import javax.swing.JFrame;
+
+/** Test class for various Rasdaman tasks. Comment/uncomment the lines in the
+ * main() function and see what happens.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class TestRasdamanUtils {
+
+ private static RasdamanUtils myUtils;
+
+ public static void main(String[] args) throws ODMGException, RasResultIsNoIntervalException, IOException, Exception {
+// myUtils = new RasdamanUtils("http://kahlua.eecs.jacobs-university.de" + ":7001", "RASBASE");
+ myUtils = new RasdamanUtils("http://localhost" + ":7001", "RASBASE");
+
+ myUtils.init();
+
+ /* Try to comment/uncomment lines below ... */
+// myUtils.insertGrayImageAsArray("andreiTest1");
+// myUtils.loadCoverage("mr");
+// myUtils.printAllCollections();
+// testLoadRasdaman("andreiTest1");
+// testLoadRasdaman("andreiFlickrColor");
+// insertImageFromInternet("andreiFlickr1", "http://farm4.static.flickr.com/3347/3500129555_137c537e75_m.jpg");
+ myUtils.deleteCollection("andreiFlickrColor");
+// myUtils.commitAndClose();
+// myUtils.deleteCollection("flickr1");
+
+// updateImageFromInternet("andreiFlickr1", "http://localhost/peta/car.jpeg");
+
+// insertImageFromInternet("andreiFlickrColor", "http://localhost/peta/flickr1.jpg");
+
+// try
+// {
+// myUtils.deleteCollection("andreiFlickrColor");
+// myUtils.commitAndClose();
+// }
+// catch (Exception e)
+// {
+// e.printStackTrace();
+// myUtils.abortAndClose();
+// }
+
+// System.err.println("---------------------");
+// insertImageFromInternet("andreiWedding1", "http://farm3.static.flickr.com/2483/3758629356_d551cd5e6e.jpg");
+// System.err.println("---------------------");
+// testLoadRasdaman("andreiWedding1");
+
+ /* Stop commenting/uncommenting lines here */
+
+ try {
+ myUtils.commitAndClose();
+ } catch (Exception e) {
+ e.printStackTrace();
+ myUtils.abortAndClose();
+ }
+
+// understandColorImage("http://localhost/peta/flickr1.jpg");
+ }
+
+ private static void insertImageFromInternet(String identifier, String href) {
+ try {
+ // Step 1: fetch the image from Internet
+ URL url = new URL(href);
+ BufferedImage img0 = ImageIO.read(url);
+ BufferedImage img = myUtils.convertImageToGray(img0);
+
+ // Display image for check
+ displayImage(identifier, img);
+
+ // Step 2: Insert image into rasdaman
+ myUtils.insertGrayImageAsArray(identifier, img);
+// myUtils.insertColorImageAsArray(identifier, img);
+ } catch (Exception e) {
+ System.err.println("Error: " + e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+ private static void updateImageFromInternet(String identifier, String href) {
+ try {
+ // Step 1: fetch the image from Internet
+ URL url = new URL(href);
+ BufferedImage img0 = ImageIO.read(url);
+ BufferedImage img = myUtils.convertImageToGray(img0);
+
+ // Display image for check
+ displayImage(identifier, img);
+
+ // Step 2: Update image into rasdaman
+ myUtils.updateGrayImageWithArray(identifier, img, 0, 0, img.getWidth(), img.getHeight());
+ } catch (Exception e) {
+ System.err.println("Error: " + e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+ private static void testLoadRasdaman(String identifier) {
+ try {
+ BufferedImage img = myUtils.loadCoverage(identifier);
+
+ if (img == null) {
+ throw new Exception("Did not receive image from MyRasUtils !");
+ }
+ displayImage(identifier, img);
+ } catch (Exception e) {
+ System.err.println("Error !");
+ e.printStackTrace();
+ }
+ }
+
+ public static void displayImage(String name, BufferedImage img) {
+ JFrame f = new JFrame("Image " + name);
+
+ f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ f.getContentPane().add(new ShowImage(img));
+ f.setSize(img.getWidth() + 50, img.getHeight() + 50);
+ f.setVisible(true);
+ }
+
+ private static void understandColorImage(String href) {
+ String identifier = "image1";
+ try {
+ // Step 1: fetch the image from Internet
+ URL url = new URL(href);
+ BufferedImage img0 = ImageIO.read(url);
+ BufferedImage img = myUtils.convertImageToGray(img0);
+
+ // Display image for check
+ displayImage(identifier, img);
+
+ // Step 2: Insert image into rasdaman
+ System.out.println(img); // gray-image
+ System.out.println(img0); // color image
+ } catch (Exception e) {
+ System.err.println("Error: " + e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Panel to display loaded image
+ *
+ *
+ * @version 09.Jul 2009
+ * @author Andrei Aiordachioaie
+ */
+ public static class ShowImage extends Panel {
+
+ BufferedImage image;
+
+ public ShowImage(BufferedImage img) {
+ this.image = img;
+ }
+
+ public void paint(Graphics g) {
+ if (image != null) {
+ g.drawImage(image, 0, 0, null);
+ }
+ }
+ }
+}
diff --git a/petascope/src/petascope/wps/server/WpsServer.java b/petascope/src/petascope/wps/server/WpsServer.java
new file mode 100644
index 0000000..ccfb8ca
--- /dev/null
+++ b/petascope/src/petascope/wps/server/WpsServer.java
@@ -0,0 +1,126 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wps.server;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.net.URI;
+import java.net.URISyntaxException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.antlr.runtime.RecognitionException;
+import org.apache.commons.io.IOUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import petascope.wcps.server.core.ProcessCoveragesRequest;
+import petascope.wcs.server.exceptions.InputOutputException;
+
+/**
+ *
+ * @author Michael Owonibi
+ */
+public class WpsServer {
+
+ private static Logger LOG = LoggerFactory.getLogger(WpsServer.class);
+ public String request = null;
+
+ public WpsServer(HttpServletResponse httpResponse, HttpServletRequest httpRequest) throws URISyntaxException, IOException, InputOutputException, RecognitionException {
+
+ if ((httpRequest.getParameter("Request") != null) && httpRequest.getParameter("Request").equalsIgnoreCase("GetCapabilities")) {
+ GetCapabilities(httpResponse);
+ }
+
+ if ((((httpRequest.getParameter("version") != null) && httpRequest.getParameter("version").equalsIgnoreCase("1.0.0")) || ((httpRequest.getParameter("Version") != null) && httpRequest.getParameter("Version").equalsIgnoreCase("1.0.0")))) {
+
+ if ((httpRequest.getParameter("Request") != null) && httpRequest.getParameter("Request").equalsIgnoreCase("DescribeProcess") && (httpRequest.getParameter("identifier") != null) && httpRequest.getParameter("identifier").equalsIgnoreCase("ProcessCoverages")) {
+ DescribeProcess(httpResponse);
+ } else if ((httpRequest.getParameter("Request") != null) && httpRequest.getParameter("Request").equalsIgnoreCase("Execute") && (httpRequest.getParameter("identifier") != null) && httpRequest.getParameter("identifier").equalsIgnoreCase("ProcessCoverages")) {
+
+ String wpsRequest = httpRequest.getParameter("DataInputs");
+ wpsRequest = wpsRequest.substring(1, (wpsRequest.length() - 1));
+ int pos = -1;
+ pos = wpsRequest.indexOf("=");
+ if (wpsRequest.substring(0, pos).equalsIgnoreCase("WcpsAbstractSyntax")) {
+ wpsRequest = wpsRequest.substring(pos + 1, wpsRequest.length());
+
+ wpsRequest = ProcessCoveragesRequest.abstractQueryToXmlQuery(wpsRequest);
+ System.out.println("WPS request is :" + wpsRequest);
+ request = wpsRequest;
+ }
+ }
+ }
+ }
+
+ public void GetCapabilities(HttpServletResponse httpResponse) throws URISyntaxException, IOException, InputOutputException {
+ URI GetCapabilitiesURI = this.getClass().getResource("../templates/GetCapabilities.xml").toURI();
+ String GetCapabilitiesResponse = loadFile(GetCapabilitiesURI);
+ LOG.info("Executing operation GetCapabilities...");
+ System.out.println("GetCapabilities Response is " + GetCapabilitiesResponse);
+ PrintWriter out;
+ try {
+ out = httpResponse.getWriter();
+ httpResponse.setContentType("text/xml; charset=utf-8");
+ out.write(GetCapabilitiesResponse);
+ out.flush();
+ out.close();
+ } catch (IOException e) {
+ throw new InputOutputException(e.getMessage(), e);
+ }
+ }
+
+ public void DescribeProcess(HttpServletResponse httpResponse) throws URISyntaxException, IOException, InputOutputException {
+ URI DesribeProcessURI = this.getClass().getResource("../templates/DescribeProcess.xml").toURI();
+ String DescribeProcessResponse = loadFile(DesribeProcessURI);
+ LOG.info("Executing operation DescribeProcess...");
+ System.out.println("DescribeProcess Document is " + DescribeProcessResponse);
+ PrintWriter out;
+ try {
+ out = httpResponse.getWriter();
+ httpResponse.setContentType("text/xml; charset=utf-8");
+ out.write(DescribeProcessResponse);
+ out.flush();
+ out.close();
+ } catch (IOException e) {
+ throw new InputOutputException(e.getMessage(), e);
+ }
+ }
+
+ private String loadFile(URI fileUri) throws IOException {
+ InputStream is = null;
+ String contents = null;
+ try {
+ LOG.debug("Loading file: " + fileUri);
+ File f = new File(fileUri);
+ is = new FileInputStream(f);
+ contents = IOUtils.toString(is);
+ } finally {
+ try {
+ is.close();
+ } catch (IOException ex) {
+ }
+ }
+ return contents;
+ }
+}
diff --git a/petascope/src/petascope/wps/templates/DescribeProcess.xml b/petascope/src/petascope/wps/templates/DescribeProcess.xml
new file mode 100644
index 0000000..ff61fab
--- /dev/null
+++ b/petascope/src/petascope/wps/templates/DescribeProcess.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wps:ProcessDescriptions xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" service="WPS" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsDescribeProcess_response.xsd">
+ <ProcessDescription wps:processVersion="1"
+ storeSupported="true" statusSupported="false">
+ <ows:Identifier>ProcessCoverages</ows:Identifier>
+ <ows:Title>ProcessCoverages Request</ows:Title>
+ <ows:Abstract> ProcessCoverages is a WPS process that provides a means of specifying server-side extraction and analysis of coverages containing sensor,image, and statistics data
+ </ows:Abstract>
+ <ows:Metadata xlink:title="coverage"/>
+ <ows:Metadata xlink:title="coverage processing"/>
+ <ows:Metadata xlink:title="WCS"/>
+ <wps:Profile>
+ urn:ogc:wps:1.0.0:ProcessCoverages
+ </wps:Profile>
+ <DataInputs>
+ <Input minOccurs="1" maxOccurs="1">
+ <ows:Identifier>
+ AbstractWcpsQuery
+ </ows:Identifier>
+ <ows:Title>
+ WCPS ProcessCoverages Request
+ </ows:Title>
+ <ows:Abstract> WCPS query</ows:Abstract>
+ <LiteralData>
+ <ows:DataType ows:reference=
+ "http://www.w3.org/TR/xmlschema2/#string">
+ string
+ </ows:DataType>
+ <ows:AnyValue/>
+ </LiteralData>
+ </Input>
+ </DataInputs>
+ <ProcessOutputs>
+ <Output>
+ <ows:Identifier>
+ ProcessCoveragesResultList
+ </ows:Identifier>
+ <ows:Title>WCPS Query</ows:Title>
+ <ows:Abstract>WCPS Query</ows:Abstract>
+ <ComplexOutput>
+ <Default>
+ <Format>
+ <MimeType>image/tiff</MimeType>
+ <Encoding>base64</Encoding>
+ </Format>
+ </Default>
+ <Supported>
+ <Format>
+ <MimeType>image/tiff</MimeType>
+ <Encoding>base64</Encoding>
+ </Format>
+ <Format>
+ <MimeType>image/netcdf</MimeType>
+ <Encoding>base64</Encoding>
+ </Format>
+ <Format>
+ <MimeType>image/hdf4.0</MimeType>
+ <Encoding>base64</Encoding>
+ </Format>
+ <Format>
+ <MimeType>image/png</MimeType>
+ <Encoding>base64</Encoding>
+ </Format>
+ <Format>
+ <MimeType>image/nitf</MimeType>
+ <Encoding>base64</Encoding>
+ </Format>
+ <Format>
+ <MimeType>text/plain</MimeType>
+ <Encoding>UTF-8</Encoding>
+ </Format>
+ </Supported>
+ </ComplexOutput>
+ </Output>
+ </ProcessOutputs>
+ </ProcessDescription>
+</wps:ProcessDescriptions>
diff --git a/petascope/src/petascope/wps/templates/GetCapabilities.xml b/petascope/src/petascope/wps/templates/GetCapabilities.xml
new file mode 100644
index 0000000..27a9ac7
--- /dev/null
+++ b/petascope/src/petascope/wps/templates/GetCapabilities.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wps:Capabilities service="WPS" version="1.0.0" xml:lang="en-US" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 ../wpsGetCapabilities_response.xsd" updateSequence="1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <ows:ServiceIdentification>
+ <ows:Title> Coverage Processing in WPS</ows:Title>
+ <ows:Abstract>Coverage Processing using WPS</ows:Abstract>
+ <ows:Keywords>
+ <ows:Keyword>WCPS</ows:Keyword>
+ <ows:Keyword>ProcessCoverages</ows:Keyword>
+ </ows:Keywords>
+ <ows:ServiceType>WPS</ows:ServiceType>
+ <ows:ServiceTypeVersion>1.0.0</ows:ServiceTypeVersion>
+ </ows:ServiceIdentification>
+ <ows:ServiceProvider>
+ <ows:ProviderName>Jacobs University</ows:ProviderName>
+<ows:ProviderSite xlink:href="http://www.jacobs-university.de"/>
+ </ows:ServiceProvider>
+
+ <ows:OperationsMetadata>
+ <ows:Operation name="GetCapabilities">
+ <ows:DCP>
+ <ows:HTTP>
+ <ows:Get xlink:href="http://kahlua.eecs.jacobs-university.de:8080/PetaScope/earthlook"/>
+ </ows:HTTP>
+ </ows:DCP>
+ </ows:Operation>
+ <ows:Operation name="DescribeProcess">
+ <ows:DCP>
+ <ows:HTTP>
+ <ows:Get xlink:href="http://kahlua.eecs.jacobs-university.de:8080/PetaScope/earthlook"/>
+
+ </ows:HTTP>
+ </ows:DCP>
+ </ows:Operation>
+ <ows:Operation name="Execute">
+ <ows:DCP>
+ <ows:HTTP>
+ <ows:Get xlink:href="http://kahlua.eecs.jacobs-university.de:8080/PetaScope/earthlook"/>
+ <ows:Post xlink:href="http://kahlua.eecs.jacobs-university.de:8080/PetaScope/earthlook"/>
+ </ows:HTTP>
+ </ows:DCP>
+ </ows:Operation>
+ </ows:OperationsMetadata>
+
+
+ <wps:ProcessOfferings>
+ <wps:Process wps:processVersion="1.0.0">
+ <ows:Identifier>ProcessCoverages</ows:Identifier>
+ <ows:Title>WCPS Coverage Processing</ows:Title>
+<ows:Abstract>Expression for Server-side Coverage Processing</ows:Abstract>
+ </wps:Process>
+ </wps:ProcessOfferings>
+
+ <wps:Languages>
+ <wps:Default>
+ <ows:Language>en-US</ows:Language>
+ </wps:Default>
+ <wps:Supported>
+ <ows:Language>en-US</ows:Language>
+ </wps:Supported>
+ </wps:Languages>
+
+
+
+</wps:Capabilities>
+