From 05dbf9ef8ddfbe45682fae09c42dec1da21a270e Mon Sep 17 00:00:00 2001 From: Janet Gainer-Dewar Date: Thu, 6 Oct 2022 14:44:50 -0400 Subject: [PATCH 01/13] Update Scala to 2.13.9 --- CHANGELOG.md | 5 +++++ project/Settings.scala | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 351adccf651..1e44012027c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,11 @@ supported. All DRS inputs to a task are now localized in a single PAPI action, which should improve speed and resolve failures observed when attempting to localize a large number of DRS files. +### Security Patching + +Updates to dependencies to fix security vulnerabilities. + + ## 84 Release Notes ### CromIAM enabled user checks diff --git a/project/Settings.scala b/project/Settings.scala index 951b1fc8fe6..797d7917dd9 100644 --- a/project/Settings.scala +++ b/project/Settings.scala @@ -70,7 +70,7 @@ object Settings { assembly / assemblyMergeStrategy := customMergeStrategy.value, ) - val Scala2_13Version = "2.13.8" + val Scala2_13Version = "2.13.9" private val ScalaVersion: String = Scala2_13Version private val sharedSettings: Seq[Setting[_]] = cromwellVersionWithGit ++ publishingSettings ++ List( From 7db52981c3038935c6c40cbe142129e4f7356357 Mon Sep 17 00:00:00 2001 From: Janet Gainer-Dewar Date: Fri, 7 Oct 2022 14:29:21 -0400 Subject: [PATCH 02/13] Try updating sbt-scoverage --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index dd6a98e1b9b..ddc7377de2c 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,5 +1,5 @@ addSbtPlugin("se.marcuslonnberg" % "sbt-docker" % "1.9.0") addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.1.1") addSbtPlugin("com.github.sbt" % "sbt-git" % "2.0.0") -addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.9.3") +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.1") addDependencyTreePlugin From 982da1b078a52e0a83bebe09778e9417e0e32ead Mon Sep 17 00:00:00 2001 From: Janet Gainer-Dewar Date: Fri, 7 Oct 2022 15:25:22 -0400 Subject: [PATCH 03/13] Does this version exist anywhere we can see? --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index ddc7377de2c..61738c218f8 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,5 +1,5 @@ addSbtPlugin("se.marcuslonnberg" % "sbt-docker" % "1.9.0") addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.1.1") addSbtPlugin("com.github.sbt" % "sbt-git" % "2.0.0") -addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.1") +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.5") addDependencyTreePlugin From 399713e851a54e670e364e96028a3333dcba00f1 Mon Sep 17 00:00:00 2001 From: Janet Gainer-Dewar Date: Fri, 7 Oct 2022 16:03:08 -0400 Subject: [PATCH 04/13] This version actually exists --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 61738c218f8..34bccb47a0a 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,5 +1,5 @@ addSbtPlugin("se.marcuslonnberg" % "sbt-docker" % "1.9.0") addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.1.1") addSbtPlugin("com.github.sbt" % "sbt-git" % "2.0.0") -addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.5") +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.4") addDependencyTreePlugin From e80f6490ecd2f826c820da551d446eda0dcfc1dc Mon Sep 17 00:00:00 2001 From: Janet Gainer-Dewar Date: Tue, 11 Oct 2022 14:32:13 -0400 Subject: [PATCH 05/13] Update library version to remove conflict --- project/Dependencies.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 50c76893e80..13f0334aa53 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -89,7 +89,7 @@ object Dependencies { private val postgresV = "42.3.3" private val pprintV = "0.7.3" private val rdf4jV = "3.7.1" - private val refinedV = "0.9.29" + private val refinedV = "0.10.1" private val rhinoV = "1.7.14" private val scalaCollectionCompatV = "2.5.0" From 4b858ae16d01b9a35bad8b8842a73b451393fc25 Mon Sep 17 00:00:00 2001 From: Janet Gainer-Dewar Date: Tue, 11 Oct 2022 14:32:21 -0400 Subject: [PATCH 06/13] Codegen version --- codegen_java/build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codegen_java/build.sbt b/codegen_java/build.sbt index 2ba35a693c3..0ad461a66b8 100644 --- a/codegen_java/build.sbt +++ b/codegen_java/build.sbt @@ -6,7 +6,7 @@ lazy val root = (project in file(".")). Seq(organization := "org.broadinstitute.cromwell", name := "cromwell-client", version := createVersion("0.1"), - scalaVersion := "2.13.8", + scalaVersion := "2.13.9", scalacOptions ++= Seq("-feature"), compile / javacOptions ++= Seq("-Xlint:deprecation"), Compile / packageDoc / publishArtifact := false, From 2650e21f1b4fc10f71d5fd54ae7590b535a2ab2e Mon Sep 17 00:00:00 2001 From: Janet Gainer-Dewar Date: Thu, 13 Oct 2022 12:10:51 -0400 Subject: [PATCH 07/13] Fix fun new 2.13.9 compiler errors --- .../standard/StandardCachingActorHelper.scala | 2 +- .../RootWorkflowFileHashCacheActor.scala | 2 +- .../centaur/reporting/BigQueryReporter.scala | 2 +- .../main/scala/common/util/TerminalUtil.scala | 4 ++-- .../collections/EnhancedCollectionsSpec.scala | 6 +++--- .../cromwell/core/io/IoClientHelperSpec.scala | 4 ++-- .../cromwell/core/retry/BackoffSpec.scala | 2 +- .../callcaching/FetchCachedResultsActor.scala | 2 +- .../job/EngineJobExecutionActor.scala | 2 +- .../ValidatingCachingConfigSpec.scala | 2 +- ...ectiveTsvInstrumentationServiceActor.scala | 2 +- .../impl/MetadataDatabaseAccessSpec.scala | 2 +- .../PipelinesApiJobCachingActorHelper.scala | 2 +- ...inesApiAsyncBackendJobExecutionActor.scala | 4 ++-- .../v2alpha1/api/DeserializationSpec.scala | 6 +++--- ...inesApiAsyncBackendJobExecutionActor.scala | 4 ++-- .../v2beta/api/DeserializationSpec.scala | 6 +++--- .../scala/wdl/draft2/model/AstTools.scala | 4 ++-- .../scala/wom/types/WomFileTypeSpec.scala | 2 +- .../test/scala/wom/types/WomTypeSpec.scala | 21 ++++++++++--------- 20 files changed, 41 insertions(+), 40 deletions(-) diff --git a/backend/src/main/scala/cromwell/backend/standard/StandardCachingActorHelper.scala b/backend/src/main/scala/cromwell/backend/standard/StandardCachingActorHelper.scala index dd4254c8439..a64c6a5439c 100644 --- a/backend/src/main/scala/cromwell/backend/standard/StandardCachingActorHelper.scala +++ b/backend/src/main/scala/cromwell/backend/standard/StandardCachingActorHelper.scala @@ -78,7 +78,7 @@ trait StandardCachingActorHelper extends JobCachingActorHelper { val fileMetadata = jobPaths.metadataPaths - runtimeAttributesMetadata ++ fileMetadata ++ nonStandardMetadata + nonStandardMetadata ++ runtimeAttributesMetadata ++ fileMetadata } /** diff --git a/backend/src/main/scala/cromwell/backend/standard/callcaching/RootWorkflowFileHashCacheActor.scala b/backend/src/main/scala/cromwell/backend/standard/callcaching/RootWorkflowFileHashCacheActor.scala index e33625741b3..c3d1452660e 100644 --- a/backend/src/main/scala/cromwell/backend/standard/callcaching/RootWorkflowFileHashCacheActor.scala +++ b/backend/src/main/scala/cromwell/backend/standard/callcaching/RootWorkflowFileHashCacheActor.scala @@ -48,7 +48,7 @@ class RootWorkflowFileHashCacheActor private[callcaching](override val ioActor: // hash to become available. cache.put(key, FileHashValueRequested(requesters = requester :: requesters)) case FileHashSuccess(value) => - sender() ! Tuple2(hashCommand.fileHashContext, IoSuccess(requester.ioCommand, value)) + sender() ! Tuple2[Any, Any](hashCommand.fileHashContext, IoSuccess(requester.ioCommand, value)) case FileHashFailure(error) => sender() ! Tuple2(hashCommand.fileHashContext, IoFailure(requester.ioCommand, new IOException(error))) } diff --git a/centaur/src/it/scala/centaur/reporting/BigQueryReporter.scala b/centaur/src/it/scala/centaur/reporting/BigQueryReporter.scala index 16463742632..9a88a9ac109 100644 --- a/centaur/src/it/scala/centaur/reporting/BigQueryReporter.scala +++ b/centaur/src/it/scala/centaur/reporting/BigQueryReporter.scala @@ -189,7 +189,7 @@ class BigQueryReporter(override val params: ErrorReporterParams) extends ErrorRe } private def toJobKeyValueRow(jobKeyValueEntry: JobKeyValueEntry): RowToInsert = { - RowToInsert of Map( + RowToInsert of Map[String, Any]( "call_fully_qualified_name" -> jobKeyValueEntry.callFullyQualifiedName, "job_attempt" -> jobKeyValueEntry.jobAttempt, "job_index" -> jobKeyValueEntry.jobIndex, diff --git a/common/src/main/scala/common/util/TerminalUtil.scala b/common/src/main/scala/common/util/TerminalUtil.scala index dab7fb9ce17..cb7c980aecb 100644 --- a/common/src/main/scala/common/util/TerminalUtil.scala +++ b/common/src/main/scala/common/util/TerminalUtil.scala @@ -6,10 +6,10 @@ object TerminalUtil { def maxWidth(lengths: Seq[Seq[Int]], column: Int) = lengths.map { length => length(column) }.max val widths = (rows :+ header).map { row => row.map { s => s.length } } val maxWidths = widths.head.indices.map { column => maxWidth(widths, column) } - val tableHeader = header.indices.map { i => header(i).padTo(maxWidths(i), " ").mkString("") }.mkString("|") + val tableHeader = header.indices.map { i => header(i).padTo(maxWidths(i), ' ').mkString("") }.mkString("|") val tableDivider = header.indices.map { i => "-" * maxWidths(i) }.mkString("|") val tableRows = rows.map { row => - val mdRow = row.indices.map { i => row(i).padTo(maxWidths(i), " ").mkString("") }.mkString("|") + val mdRow = row.indices.map { i => row(i).padTo(maxWidths(i), ' ').mkString("") }.mkString("|") s"|$mdRow|" } s"|$tableHeader|\n|$tableDivider|\n${tableRows.mkString("\n")}\n" diff --git a/common/src/test/scala/common/collections/EnhancedCollectionsSpec.scala b/common/src/test/scala/common/collections/EnhancedCollectionsSpec.scala index 12dba2e15d9..d2e0a38878c 100644 --- a/common/src/test/scala/common/collections/EnhancedCollectionsSpec.scala +++ b/common/src/test/scala/common/collections/EnhancedCollectionsSpec.scala @@ -11,7 +11,7 @@ class EnhancedCollectionsSpec extends AsyncFlatSpec with Matchers { behavior of "EnhancedCollections" it should "filter a List by type and return a List" in { - val objectList = List("hello", 3, None, "world") + val objectList = List[Any]("hello", 3, None, "world") val stringList = objectList.filterByType[String] stringList should be(List("hello", "world")) @@ -28,14 +28,14 @@ class EnhancedCollectionsSpec extends AsyncFlatSpec with Matchers { } it should "filter a Set by type and return a Set" in { - val objectSet = Set("hello", 3, None, "world") + val objectSet = Set[Any]("hello", 3, None, "world") val intSet: Set[Int] = objectSet.filterByType[Int] intSet should be(Set(3)) } it should "find the first Int in a List" in { - val objectSet = List("hello", 3, None, 4, "world") + val objectSet = List[Any]("hello", 3, None, 4, "world") objectSet.firstByType[Int] should be(Some(3)) } diff --git a/core/src/test/scala/cromwell/core/io/IoClientHelperSpec.scala b/core/src/test/scala/cromwell/core/io/IoClientHelperSpec.scala index f77df6fa011..06132ba152b 100644 --- a/core/src/test/scala/cromwell/core/io/IoClientHelperSpec.scala +++ b/core/src/test/scala/cromwell/core/io/IoClientHelperSpec.scala @@ -27,7 +27,7 @@ class IoClientHelperSpec extends TestKitSuite with AnyFlatSpecLike with Matchers val testActor = TestActorRef(new IoClientHelperTestActor(ioActorProbe.ref, delegateProbe.ref, backoff, noResponseTimeout)) val command = DefaultIoSizeCommand(mock[Path]) - val response = IoSuccess(command, 5) + val response = IoSuccess(command, 5L) // Send the command testActor.underlyingActor.sendMessage(command) @@ -58,7 +58,7 @@ class IoClientHelperSpec extends TestKitSuite with AnyFlatSpecLike with Matchers val commandContext = "context" val command = DefaultIoSizeCommand(mock[Path]) - val response = IoSuccess(command, 5) + val response = IoSuccess(command, 5L) // Send the command testActor.underlyingActor.sendMessageWithContext(commandContext, command) diff --git a/core/src/test/scala/cromwell/core/retry/BackoffSpec.scala b/core/src/test/scala/cromwell/core/retry/BackoffSpec.scala index 58fa597dc03..c6a008feb02 100644 --- a/core/src/test/scala/cromwell/core/retry/BackoffSpec.scala +++ b/core/src/test/scala/cromwell/core/retry/BackoffSpec.scala @@ -54,7 +54,7 @@ class BackoffSpec extends AnyFlatSpec with CromwellTimeoutSpec with Matchers { it should "parse config" in { val config = ConfigFactory.parseMap( - Map( + Map[String, Any]( "min" -> "5 seconds", "max" -> "30 seconds", "multiplier" -> 6D, diff --git a/engine/src/main/scala/cromwell/engine/workflow/lifecycle/execution/callcaching/FetchCachedResultsActor.scala b/engine/src/main/scala/cromwell/engine/workflow/lifecycle/execution/callcaching/FetchCachedResultsActor.scala index 0eef565caf2..89745e6523d 100644 --- a/engine/src/main/scala/cromwell/engine/workflow/lifecycle/execution/callcaching/FetchCachedResultsActor.scala +++ b/engine/src/main/scala/cromwell/engine/workflow/lifecycle/execution/callcaching/FetchCachedResultsActor.scala @@ -37,7 +37,7 @@ class FetchCachedResultsActor(cacheResultId: CallCachingEntryId, replyTo: ActorR val sourceCacheDetails = Seq(result.callCachingEntry.workflowExecutionUuid, result.callCachingEntry.callFullyQualifiedName, - result.callCachingEntry.jobIndex).mkString(":") + result.callCachingEntry.jobIndex.toString).mkString(":") CachedOutputLookupSucceeded(simpletons, jobDetritusFiles.toMap, result.callCachingEntry.returnCode, diff --git a/engine/src/main/scala/cromwell/engine/workflow/lifecycle/execution/job/EngineJobExecutionActor.scala b/engine/src/main/scala/cromwell/engine/workflow/lifecycle/execution/job/EngineJobExecutionActor.scala index 3bbdb5eb1f2..4423de202cc 100644 --- a/engine/src/main/scala/cromwell/engine/workflow/lifecycle/execution/job/EngineJobExecutionActor.scala +++ b/engine/src/main/scala/cromwell/engine/workflow/lifecycle/execution/job/EngineJobExecutionActor.scala @@ -753,7 +753,7 @@ class EngineJobExecutionActor(replyTo: ActorRef, private def logCacheHitSuccessAndNotifyMetadata(data: ResponsePendingData): Unit = { - val metadataMap = Map(callCachingHitResultMetadataKey -> true) ++ data.ejeaCacheHit.flatMap(_.details).map(details => callCachingReadResultMetadataKey -> s"Cache Hit: $details").toMap + val metadataMap = Map[String, Any](callCachingHitResultMetadataKey -> true) ++ data.ejeaCacheHit.flatMap(_.details).map(details => callCachingReadResultMetadataKey -> s"Cache Hit: $details").toMap writeToMetadata(metadataMap) diff --git a/engine/src/test/scala/cromwell/engine/workflow/lifecycle/ValidatingCachingConfigSpec.scala b/engine/src/test/scala/cromwell/engine/workflow/lifecycle/ValidatingCachingConfigSpec.scala index 40b628a700d..095721569e7 100644 --- a/engine/src/test/scala/cromwell/engine/workflow/lifecycle/ValidatingCachingConfigSpec.scala +++ b/engine/src/test/scala/cromwell/engine/workflow/lifecycle/ValidatingCachingConfigSpec.scala @@ -11,7 +11,7 @@ import scala.util.{Failure, Success, Try} class ValidatingCachingConfigSpec extends AnyFlatSpec with CromwellTimeoutSpec with Matchers with TableDrivenPropertyChecks { it should "run config tests" in { - val cases = Table( + val cases = Table[String, Any]( ("config" , "exceptionMessage" ), ("enabled = not-a-boolean", "String: 1: enabled has type STRING rather than BOOLEAN" ), ("enabled = true" , true ), diff --git a/services/src/main/scala/cromwell/services/instrumentation/impl/selectivetsv/SelectiveTsvInstrumentationServiceActor.scala b/services/src/main/scala/cromwell/services/instrumentation/impl/selectivetsv/SelectiveTsvInstrumentationServiceActor.scala index fd1864d45f0..4df3f966db6 100644 --- a/services/src/main/scala/cromwell/services/instrumentation/impl/selectivetsv/SelectiveTsvInstrumentationServiceActor.scala +++ b/services/src/main/scala/cromwell/services/instrumentation/impl/selectivetsv/SelectiveTsvInstrumentationServiceActor.scala @@ -143,7 +143,7 @@ object SelectiveTsvInstrumentationServiceActor { val header = (List("timestamp") ++ interestingFields).mkString("\t") val rows = stateHistory.map { case (timestamp, fieldMap) => - (Vector(timestamp.toString) ++ interestingFields.map(f => fieldMap.getOrElse(f, 0))).mkString("\t") + (Vector(timestamp.toString) ++ interestingFields.map(f => fieldMap.getOrElse(f, 0).toString)).mkString("\t") } Vector(header) ++ rows } diff --git a/services/src/test/scala/cromwell/services/metadata/impl/MetadataDatabaseAccessSpec.scala b/services/src/test/scala/cromwell/services/metadata/impl/MetadataDatabaseAccessSpec.scala index 8e6029140e9..2a812419775 100644 --- a/services/src/test/scala/cromwell/services/metadata/impl/MetadataDatabaseAccessSpec.scala +++ b/services/src/test/scala/cromwell/services/metadata/impl/MetadataDatabaseAccessSpec.scala @@ -287,7 +287,7 @@ class MetadataDatabaseAccessSpec extends AnyFlatSpec with CromwellTimeoutSpec wi } // Filter by workflow id within random Ids _ <- dataAccess.queryWorkflowSummaries(WorkflowQueryParameters( - (randomIds :+ workflow1Id).map(id => WorkflowQueryKey.Id.name -> id.toString))) map { case (response, _) => + (randomIds :+ workflow1Id.toString).map(id => WorkflowQueryKey.Id.name -> id))) map { case (response, _) => val resultsById = response.results groupBy { _.name } diff --git a/supportedBackends/google/pipelines/common/src/main/scala/cromwell/backend/google/pipelines/common/PipelinesApiJobCachingActorHelper.scala b/supportedBackends/google/pipelines/common/src/main/scala/cromwell/backend/google/pipelines/common/PipelinesApiJobCachingActorHelper.scala index 2e6682c2e69..353e33a5019 100644 --- a/supportedBackends/google/pipelines/common/src/main/scala/cromwell/backend/google/pipelines/common/PipelinesApiJobCachingActorHelper.scala +++ b/supportedBackends/google/pipelines/common/src/main/scala/cromwell/backend/google/pipelines/common/PipelinesApiJobCachingActorHelper.scala @@ -75,7 +75,7 @@ trait PipelinesApiJobCachingActorHelper extends StandardCachingActorHelper { .get(WorkflowOptionKeys.GoogleProject) .getOrElse(jesAttributes.project) - Map( + Map[String, Any]( PipelinesApiMetadataKeys.GoogleProject -> googleProject, PipelinesApiMetadataKeys.ExecutionBucket -> initializationData.workflowPaths.executionRootString, PipelinesApiMetadataKeys.EndpointUrl -> jesAttributes.endpointUrl, diff --git a/supportedBackends/google/pipelines/v2alpha1/src/main/scala/cromwell/backend/google/pipelines/v2alpha1/PipelinesApiAsyncBackendJobExecutionActor.scala b/supportedBackends/google/pipelines/v2alpha1/src/main/scala/cromwell/backend/google/pipelines/v2alpha1/PipelinesApiAsyncBackendJobExecutionActor.scala index a0f899a26ff..2da04c65e92 100644 --- a/supportedBackends/google/pipelines/v2alpha1/src/main/scala/cromwell/backend/google/pipelines/v2alpha1/PipelinesApiAsyncBackendJobExecutionActor.scala +++ b/supportedBackends/google/pipelines/v2alpha1/src/main/scala/cromwell/backend/google/pipelines/v2alpha1/PipelinesApiAsyncBackendJobExecutionActor.scala @@ -141,9 +141,9 @@ class PipelinesApiAsyncBackendJobExecutionActor(standardParams: StandardAsyncExe } val optional = Option(output) collectFirst { case o: PipelinesApiFileOutput if o.secondary || o.optional => "optional" } getOrElse "required" - val contentType = output.contentType.getOrElse("") + val contentType = output.contentType.map(_.toString).getOrElse("") - List(kind, output.cloudPath, output.containerPath, optional, contentType) + List(kind, output.cloudPath.toString, output.containerPath.toString, optional, contentType) } mkString("\"", "\"\n| \"", "\"") val parallelCompositeUploadThreshold = jobDescriptor.workflowDescriptor.workflowOptions.getOrElse( diff --git a/supportedBackends/google/pipelines/v2alpha1/src/test/scala/cromwell/backend/google/pipelines/v2alpha1/api/DeserializationSpec.scala b/supportedBackends/google/pipelines/v2alpha1/src/test/scala/cromwell/backend/google/pipelines/v2alpha1/api/DeserializationSpec.scala index 1c936e76317..7f10580b700 100644 --- a/supportedBackends/google/pipelines/v2alpha1/src/test/scala/cromwell/backend/google/pipelines/v2alpha1/api/DeserializationSpec.scala +++ b/supportedBackends/google/pipelines/v2alpha1/src/test/scala/cromwell/backend/google/pipelines/v2alpha1/api/DeserializationSpec.scala @@ -82,9 +82,9 @@ class DeserializationSpec extends AnyFlatSpec with CromwellTimeoutSpec with Matc "commands" -> List[String]("echo", "hello").asJava ).asJava ).asJava, - "resources" -> Map( + "resources" -> Map[String, Object]( "projectId" -> "project", - "virtualMachine" -> Map( + "virtualMachine" -> Map[String, Any]( "machineType" -> "custom-1-1024", "preemptible" -> false ).asJava @@ -117,7 +117,7 @@ class DeserializationSpec extends AnyFlatSpec with CromwellTimeoutSpec with Matc "commands" -> List[String]("echo", "hello").asJava ).asJava ).asJava, - "resources" -> Map( + "resources" -> Map[String, Object]( "projectId" -> "project", "virtualMachine" -> Map( "machineType" -> "custom-1-1024", diff --git a/supportedBackends/google/pipelines/v2beta/src/main/scala/cromwell/backend/google/pipelines/v2beta/PipelinesApiAsyncBackendJobExecutionActor.scala b/supportedBackends/google/pipelines/v2beta/src/main/scala/cromwell/backend/google/pipelines/v2beta/PipelinesApiAsyncBackendJobExecutionActor.scala index aa49c385ba6..fb6c8d425f7 100644 --- a/supportedBackends/google/pipelines/v2beta/src/main/scala/cromwell/backend/google/pipelines/v2beta/PipelinesApiAsyncBackendJobExecutionActor.scala +++ b/supportedBackends/google/pipelines/v2beta/src/main/scala/cromwell/backend/google/pipelines/v2beta/PipelinesApiAsyncBackendJobExecutionActor.scala @@ -146,9 +146,9 @@ class PipelinesApiAsyncBackendJobExecutionActor(standardParams: StandardAsyncExe } val optional = Option(output) collectFirst { case o: PipelinesApiFileOutput if o.secondary || o.optional => "optional" } getOrElse "required" - val contentType = output.contentType.getOrElse("") + val contentType = output.contentType.map(_.toString).getOrElse("") - List(kind, output.cloudPath, output.containerPath, optional, contentType) + List(kind, output.cloudPath.toString, output.containerPath.toString, optional, contentType) } mkString("\"", "\"\n| \"", "\"") val parallelCompositeUploadThreshold = jobDescriptor.workflowDescriptor.workflowOptions.getOrElse( diff --git a/supportedBackends/google/pipelines/v2beta/src/test/scala/cromwell/backend/google/pipelines/v2beta/api/DeserializationSpec.scala b/supportedBackends/google/pipelines/v2beta/src/test/scala/cromwell/backend/google/pipelines/v2beta/api/DeserializationSpec.scala index 37020b0b0d6..6afd75adbd6 100644 --- a/supportedBackends/google/pipelines/v2beta/src/test/scala/cromwell/backend/google/pipelines/v2beta/api/DeserializationSpec.scala +++ b/supportedBackends/google/pipelines/v2beta/src/test/scala/cromwell/backend/google/pipelines/v2beta/api/DeserializationSpec.scala @@ -81,9 +81,9 @@ class DeserializationSpec extends AnyFlatSpec with CromwellTimeoutSpec with Matc "commands" -> List[String]("echo", "hello").asJava ).asJava ).asJava, - "resources" -> Map( + "resources" -> Map[String, Object]( "projectId" -> "project", - "virtualMachine" -> Map( + "virtualMachine" -> Map[String, Any]( "machineType" -> "custom-1-1024", "preemptible" -> false ).asJava @@ -115,7 +115,7 @@ class DeserializationSpec extends AnyFlatSpec with CromwellTimeoutSpec with Matc "commands" -> List[String]("echo", "hello").asJava ).asJava ).asJava, - "resources" -> Map( + "resources" -> Map[String, Object]( "projectId" -> "project", "virtualMachine" -> Map( "machineType" -> "custom-1-1024", diff --git a/wdl/model/draft2/src/main/scala/wdl/draft2/model/AstTools.scala b/wdl/model/draft2/src/main/scala/wdl/draft2/model/AstTools.scala index c1f3c18242b..24194807f17 100644 --- a/wdl/model/draft2/src/main/scala/wdl/draft2/model/AstTools.scala +++ b/wdl/model/draft2/src/main/scala/wdl/draft2/model/AstTools.scala @@ -196,7 +196,7 @@ object AstTools { val pairType = womType.asInstanceOf[WomPairType] WomPair(subElements.head.womValue(pairType.leftType, wdlSyntaxErrorFormatter), subElements(1).womValue(pairType.rightType, wdlSyntaxErrorFormatter)) } else { - throw new SyntaxError(s"Could not convert AST to a $womType (${Option(astNode).getOrElse("No AST").toString})") + throw new SyntaxError(s"Could not convert AST to a $womType (${Option(astNode).map(_.toString).getOrElse("No AST")})") } } @@ -224,7 +224,7 @@ object AstTools { case a: Ast if a.getName == "TupleLiteral" => astTupleToValue(a) case a: Ast if a.getName == "MapLiteral" && womType.isInstanceOf[WomMapType] => astToMap(a) case a: Ast if a.getName == "ObjectLiteral" && womType == WomObjectType => astToObject(a) - case _ => throw new SyntaxError(s"Could not convert AST to a $womType (${Option(astNode).getOrElse("No AST").toString})") + case _ => throw new SyntaxError(s"Could not convert AST to a $womType (${Option(astNode).map(_.toString).getOrElse("No AST")})") } } } diff --git a/wom/src/test/scala/wom/types/WomFileTypeSpec.scala b/wom/src/test/scala/wom/types/WomFileTypeSpec.scala index 217c15964cc..c4a90fadb07 100644 --- a/wom/src/test/scala/wom/types/WomFileTypeSpec.scala +++ b/wom/src/test/scala/wom/types/WomFileTypeSpec.scala @@ -65,7 +65,7 @@ class WomFileTypeSpec extends AnyFlatSpec with CromwellTimeoutSpec with Matchers } } - lazy val failedCoercionTests = Table( + lazy val failedCoercionTests = Table[String, WomType, Any, String]( ("description", "womFileType", "value", "expected"), ("a double to a dir", WomUnlistedDirectoryType, 6.28318, diff --git a/wom/src/test/scala/wom/types/WomTypeSpec.scala b/wom/src/test/scala/wom/types/WomTypeSpec.scala index 01c5030806d..4d3c7befeb5 100644 --- a/wom/src/test/scala/wom/types/WomTypeSpec.scala +++ b/wom/src/test/scala/wom/types/WomTypeSpec.scala @@ -10,6 +10,7 @@ import wom.values._ import scala.runtime.ScalaRunTime import scala.util.Random +import scala.util.matching.Regex class WomTypeSpec extends AnyFlatSpec with CromwellTimeoutSpec with Matchers { @@ -32,7 +33,7 @@ class WomTypeSpec extends AnyFlatSpec with CromwellTimeoutSpec with Matchers { WomSingleFileType.stableName shouldEqual "File" } - val rawValuesCoercedToType = Table( + val rawValuesCoercedToType = Table[Any, WomType, Any, Regex]( ( "Raw Value", "WomType", @@ -43,33 +44,33 @@ class WomTypeSpec extends AnyFlatSpec with CromwellTimeoutSpec with Matchers { WomString("hello"), WomIntegerType, classOf[NumberFormatException], - "For input string: \"hello\"" + "For input string: \"hello\"".r ), ( WomInteger(0), WomBooleanType, classOf[IllegalArgumentException], - """No coercion defined from wom value\(s\) '0' of type 'Int' to 'Boolean'.""" + """No coercion defined from wom value\(s\) '0' of type 'Int' to 'Boolean'.""".r ), ( 0, WomBooleanType, classOf[IllegalArgumentException], - "No coercion defined from '0' of type 'java.lang.Integer' to 'Boolean'." + "No coercion defined from '0' of type 'java.lang.Integer' to 'Boolean'.".r ), ( Array(0, 1, 2, 3, 4), WomBooleanType, classOf[IllegalArgumentException], - """No coercion defined from 'Array\(0, 1, 2\)' of type 'int\[\]' to 'Boolean'.""" + """No coercion defined from 'Array\(0, 1, 2\)' of type 'int\[\]' to 'Boolean'.""".r ), ( new AnyRef {}, WomBooleanType, classOf[IllegalArgumentException], - "No coercion defined from" + + ("No coercion defined from" + """ 'wom.types.WomTypeSpec\$\$anon\$(.*)@.*' of type""" + - """ 'wom.types.WomTypeSpec\$\$anon\$\1' to 'Boolean'.""" + """ 'wom.types.WomTypeSpec\$\$anon\$\1' to 'Boolean'.""").r ), ( WomArray(WomArrayType(WomOptionalType(WomIntegerType)), Seq( @@ -81,19 +82,19 @@ class WomTypeSpec extends AnyFlatSpec with CromwellTimeoutSpec with Matchers { ), WomOptionalType(WomMaybeEmptyArrayType(WomIntegerType)), classOf[IllegalArgumentException], - """No coercion defined from wom value\(s\) '\[0, 1, 2\]' of type 'Array\[Int\?\]' to 'Array\[Int\]\?'.""" + """No coercion defined from wom value\(s\) '\[0, 1, 2\]' of type 'Array\[Int\?\]' to 'Array\[Int\]\?'.""".r ), ( WomArray(WomArrayType(WomOptionalType(WomIntegerType)), Seq(WomOptionalValue.none(WomIntegerType))), WomOptionalType(WomMaybeEmptyArrayType(WomIntegerType)), classOf[IllegalArgumentException], - """No coercion defined from wom value\(s\) '\[null\]' of type 'Array\[Int\?\]' to 'Array\[Int\]\?'.""" + """No coercion defined from wom value\(s\) '\[null\]' of type 'Array\[Int\?\]' to 'Array\[Int\]\?'.""".r ), ( WomOptionalValue.none(WomArrayType(WomIntegerType)), WomMaybeEmptyArrayType(WomOptionalType(WomIntegerType)), classOf[IllegalArgumentException], - """No coercion defined from wom value\(s\) 'null' of type 'Array\[Int\]\?' to 'Array\[Int\?\]'.""" + """No coercion defined from wom value\(s\) 'null' of type 'Array\[Int\]\?' to 'Array\[Int\?\]'.""".r ) ) From ce20bdcbe0171cff5aa26bc2eb308075c83ddf40 Mon Sep 17 00:00:00 2001 From: Janet Gainer-Dewar Date: Thu, 13 Oct 2022 12:11:01 -0400 Subject: [PATCH 08/13] Resolve warnings --- .../java/wdl/draft2/parser/WdlParser.java | 226 +++++++------- .../java/wdl/biscayne/parser/WdlParser.java | 276 +++++++++--------- .../java/wdl/draft3/parser/WdlParser.java | 272 ++++++++--------- 3 files changed, 387 insertions(+), 387 deletions(-) diff --git a/wdl/model/draft2/src/main/java/wdl/draft2/parser/WdlParser.java b/wdl/model/draft2/src/main/java/wdl/draft2/parser/WdlParser.java index 70301d6691b..03ded4131f6 100644 --- a/wdl/model/draft2/src/main/java/wdl/draft2/parser/WdlParser.java +++ b/wdl/model/draft2/src/main/java/wdl/draft2/parser/WdlParser.java @@ -500,7 +500,7 @@ public static class WdlTerminalMap implements TerminalMap { id_to_term = new HashMap(); str_to_term = new HashMap(); for( WdlTerminalIdentifier terminal : terminals ) { - Integer id = new Integer(terminal.id()); + Integer id = terminal.id(); String str = terminal.string(); id_to_term.put(id, terminal); str_to_term.put(str, terminal); @@ -2199,118 +2199,118 @@ public enum WdlTerminalIdentifier implements TerminalIdentifier { } static { Map map = new HashMap(); - map.put(new Integer(0), "$_gen0 = list($import)"); - map.put(new Integer(1), "$_gen1 = list($workflow_or_task_or_decl)"); - map.put(new Integer(39), "$_gen10 = list($wf_body_element)"); - map.put(new Integer(49), "$_gen11 = $alias"); - map.put(new Integer(50), "$_gen11 = :_empty"); - map.put(new Integer(51), "$_gen12 = $call_body"); - map.put(new Integer(52), "$_gen12 = :_empty"); - map.put(new Integer(54), "$_gen13 = list($call_input)"); - map.put(new Integer(56), "$_gen14 = list($mapping, :comma)"); - map.put(new Integer(60), "$_gen15 = list($wf_output)"); - map.put(new Integer(65), "$_gen16 = $wf_output_wildcard"); - map.put(new Integer(66), "$_gen16 = :_empty"); - map.put(new Integer(75), "$_gen17 = list($type_e, :comma)"); - map.put(new Integer(96), "$_gen18 = list($e, :comma)"); - map.put(new Integer(100), "$_gen19 = list($object_kv, :comma)"); - map.put(new Integer(6), "$_gen2 = $import_namespace"); - map.put(new Integer(7), "$_gen2 = :_empty"); - map.put(new Integer(103), "$_gen20 = list($map_kv, :comma)"); - map.put(new Integer(10), "$_gen3 = list($declaration)"); - map.put(new Integer(11), "$_gen4 = list($sections)"); - map.put(new Integer(18), "$_gen5 = list($command_part)"); - map.put(new Integer(22), "$_gen6 = list($cmd_param_kv)"); - map.put(new Integer(25), "$_gen7 = list($output_kv)"); - map.put(new Integer(31), "$_gen8 = list($kv)"); - map.put(new Integer(34), "$_gen9 = $setter"); - map.put(new Integer(35), "$_gen9 = :_empty"); - map.put(new Integer(59), "$alias = :as :identifier -> $1"); - map.put(new Integer(53), "$call = :call :fqn $_gen11 $_gen12 -> Call( task=$1, alias=$2, body=$3 )"); - map.put(new Integer(55), "$call_body = :lbrace $_gen3 $_gen13 :rbrace -> CallBody( declarations=$1, io=$2 )"); - map.put(new Integer(57), "$call_input = :input :colon $_gen14 -> Inputs( map=$2 )"); - map.put(new Integer(23), "$cmd_param = :cmd_param_start $_gen6 $e :cmd_param_end -> CommandParameter( attributes=$1, expr=$2 )"); - map.put(new Integer(24), "$cmd_param_kv = :cmd_attr_hint :identifier :equal $e -> CommandParameterAttr( key=$1, value=$3 )"); - map.put(new Integer(19), "$command = :raw_command :raw_cmd_start $_gen5 :raw_cmd_end -> RawCommand( parts=$2 )"); - map.put(new Integer(21), "$command_part = $cmd_param"); - map.put(new Integer(20), "$command_part = :cmd_part"); - map.put(new Integer(36), "$declaration = $type_e :identifier $_gen9 -> Declaration( type=$0, name=$1, expression=$2 )"); - map.put(new Integer(2), "$document = $_gen0 $_gen1 -> Namespace( imports=$0, body=$1 )"); - map.put(new Integer(90), "$e = $e :asterisk $e -> Multiply( lhs=$0, rhs=$2 )"); - map.put(new Integer(89), "$e = $e :dash $e -> Subtract( lhs=$0, rhs=$2 )"); - map.put(new Integer(81), "$e = $e :double_ampersand $e -> LogicalAnd( lhs=$0, rhs=$2 )"); - map.put(new Integer(82), "$e = $e :double_equal $e -> Equals( lhs=$0, rhs=$2 )"); - map.put(new Integer(80), "$e = $e :double_pipe $e -> LogicalOr( lhs=$0, rhs=$2 )"); - map.put(new Integer(86), "$e = $e :gt $e -> GreaterThan( lhs=$0, rhs=$2 )"); - map.put(new Integer(87), "$e = $e :gteq $e -> GreaterThanOrEqual( lhs=$0, rhs=$2 )"); - map.put(new Integer(84), "$e = $e :lt $e -> LessThan( lhs=$0, rhs=$2 )"); - map.put(new Integer(85), "$e = $e :lteq $e -> LessThanOrEqual( lhs=$0, rhs=$2 )"); - map.put(new Integer(83), "$e = $e :not_equal $e -> NotEquals( lhs=$0, rhs=$2 )"); - map.put(new Integer(92), "$e = $e :percent $e -> Remainder( lhs=$0, rhs=$2 )"); - map.put(new Integer(88), "$e = $e :plus $e -> Add( lhs=$0, rhs=$2 )"); - map.put(new Integer(91), "$e = $e :slash $e -> Divide( lhs=$0, rhs=$2 )"); - map.put(new Integer(109), "$e = :boolean"); - map.put(new Integer(95), "$e = :dash $e -> UnaryNegation( expression=$1 )"); - map.put(new Integer(111), "$e = :float"); - map.put(new Integer(108), "$e = :identifier"); - map.put(new Integer(99), "$e = :identifier <=> :dot :identifier -> MemberAccess( lhs=$0, rhs=$2 )"); - map.put(new Integer(97), "$e = :identifier <=> :lparen $_gen18 :rparen -> FunctionCall( name=$0, params=$2 )"); - map.put(new Integer(98), "$e = :identifier <=> :lsquare $e :rsquare -> ArrayOrMapLookup( lhs=$0, rhs=$2 )"); - map.put(new Integer(106), "$e = :if $e :then $e :else $e -> TernaryIf( cond=$1, iftrue=$3, iffalse=$5 )"); - map.put(new Integer(110), "$e = :integer"); - map.put(new Integer(104), "$e = :lbrace $_gen20 :rbrace -> MapLiteral( map=$1 )"); - map.put(new Integer(105), "$e = :lparen $_gen18 :rparen -> TupleLiteral( values=$1 )"); - map.put(new Integer(102), "$e = :lsquare $_gen18 :rsquare -> ArrayLiteral( values=$1 )"); - map.put(new Integer(93), "$e = :not $e -> LogicalNot( expression=$1 )"); - map.put(new Integer(101), "$e = :object :lbrace $_gen19 :rbrace -> ObjectLiteral( map=$2 )"); - map.put(new Integer(94), "$e = :plus $e -> UnaryPlus( expression=$1 )"); - map.put(new Integer(107), "$e = :string"); - map.put(new Integer(72), "$if_stmt = :if :lparen $e :rparen :lbrace $_gen10 :rbrace -> If( expression=$2, body=$5 )"); - map.put(new Integer(8), "$import = :import :string $_gen2 -> Import( uri=$1, namespace=$2 )"); - map.put(new Integer(9), "$import_namespace = :as :identifier -> $1"); - map.put(new Integer(33), "$kv = :identifier :colon $e -> RuntimeAttribute( key=$0, value=$2 )"); - map.put(new Integer(32), "$map = :lbrace $_gen8 :rbrace -> $1"); - map.put(new Integer(38), "$map_kv = $e :colon $e -> MapLiteralKv( key=$0, value=$2 )"); - map.put(new Integer(58), "$mapping = :identifier :equal $e -> IOMapping( key=$0, value=$2 )"); - map.put(new Integer(30), "$meta = :meta $map -> Meta( map=$1 )"); - map.put(new Integer(74), "$object_kv = :identifier :colon $e -> ObjectKV( key=$0, value=$2 )"); - map.put(new Integer(27), "$output_kv = $type_e :identifier :equal $e -> Output( type=$0, name=$1, expression=$3 )"); - map.put(new Integer(26), "$outputs = :output :lbrace $_gen7 :rbrace -> Outputs( attributes=$2 )"); - map.put(new Integer(29), "$parameter_meta = :parameter_meta $map -> ParameterMeta( map=$1 )"); - map.put(new Integer(28), "$runtime = :runtime $map -> Runtime( map=$1 )"); - map.put(new Integer(73), "$scatter = :scatter :lparen :identifier :in $e :rparen :lbrace $_gen10 :rbrace -> Scatter( item=$2, collection=$4, body=$7 )"); - map.put(new Integer(13), "$sections = $command"); - map.put(new Integer(17), "$sections = $meta"); - map.put(new Integer(14), "$sections = $outputs"); - map.put(new Integer(16), "$sections = $parameter_meta"); - map.put(new Integer(15), "$sections = $runtime"); - map.put(new Integer(37), "$setter = :equal $e -> $1"); - map.put(new Integer(12), "$task = :task :identifier :lbrace $_gen3 $_gen4 :rbrace -> Task( name=$1, declarations=$3, sections=$4 )"); - map.put(new Integer(79), "$type_e = :type"); - map.put(new Integer(76), "$type_e = :type <=> :lsquare $_gen17 :rsquare -> Type( name=$0, subtype=$2 )"); - map.put(new Integer(78), "$type_e = :type <=> :plus -> NonEmptyType( innerType=$0 )"); - map.put(new Integer(77), "$type_e = :type <=> :qmark -> OptionalType( innerType=$0 )"); - map.put(new Integer(41), "$wf_body_element = $call"); - map.put(new Integer(42), "$wf_body_element = $declaration"); - map.put(new Integer(44), "$wf_body_element = $if_stmt"); - map.put(new Integer(45), "$wf_body_element = $scatter"); - map.put(new Integer(48), "$wf_body_element = $wf_meta"); - map.put(new Integer(46), "$wf_body_element = $wf_outputs"); - map.put(new Integer(47), "$wf_body_element = $wf_parameter_meta"); - map.put(new Integer(43), "$wf_body_element = $while_loop"); - map.put(new Integer(70), "$wf_meta = :meta $map -> Meta( map=$1 )"); - map.put(new Integer(62), "$wf_output = $wf_output_declaration_syntax"); - map.put(new Integer(63), "$wf_output = $wf_output_wildcard_syntax"); - map.put(new Integer(64), "$wf_output_declaration_syntax = $type_e :identifier :equal $e -> WorkflowOutputDeclaration( type=$0, name=$1, expression=$3 )"); - map.put(new Integer(68), "$wf_output_wildcard = :dot :asterisk -> $1"); - map.put(new Integer(67), "$wf_output_wildcard_syntax = :fqn $_gen16 -> WorkflowOutputWildcard( fqn=$0, wildcard=$1 )"); - map.put(new Integer(61), "$wf_outputs = :output :lbrace $_gen15 :rbrace -> WorkflowOutputs( outputs=$2 )"); - map.put(new Integer(69), "$wf_parameter_meta = :parameter_meta $map -> ParameterMeta( map=$1 )"); - map.put(new Integer(71), "$while_loop = :while :lparen $e :rparen :lbrace $_gen10 :rbrace -> WhileLoop( expression=$2, body=$5 )"); - map.put(new Integer(40), "$workflow = :workflow :identifier :lbrace $_gen10 :rbrace -> Workflow( name=$1, body=$3 )"); - map.put(new Integer(5), "$workflow_or_task_or_decl = $declaration"); - map.put(new Integer(4), "$workflow_or_task_or_decl = $task"); - map.put(new Integer(3), "$workflow_or_task_or_decl = $workflow"); + map.put(0, "$_gen0 = list($import)"); + map.put(1, "$_gen1 = list($workflow_or_task_or_decl)"); + map.put(39, "$_gen10 = list($wf_body_element)"); + map.put(49, "$_gen11 = $alias"); + map.put(50, "$_gen11 = :_empty"); + map.put(51, "$_gen12 = $call_body"); + map.put(52, "$_gen12 = :_empty"); + map.put(54, "$_gen13 = list($call_input)"); + map.put(56, "$_gen14 = list($mapping, :comma)"); + map.put(60, "$_gen15 = list($wf_output)"); + map.put(65, "$_gen16 = $wf_output_wildcard"); + map.put(66, "$_gen16 = :_empty"); + map.put(75, "$_gen17 = list($type_e, :comma)"); + map.put(96, "$_gen18 = list($e, :comma)"); + map.put(100, "$_gen19 = list($object_kv, :comma)"); + map.put(6, "$_gen2 = $import_namespace"); + map.put(7, "$_gen2 = :_empty"); + map.put(103, "$_gen20 = list($map_kv, :comma)"); + map.put(10, "$_gen3 = list($declaration)"); + map.put(11, "$_gen4 = list($sections)"); + map.put(18, "$_gen5 = list($command_part)"); + map.put(22, "$_gen6 = list($cmd_param_kv)"); + map.put(25, "$_gen7 = list($output_kv)"); + map.put(31, "$_gen8 = list($kv)"); + map.put(34, "$_gen9 = $setter"); + map.put(35, "$_gen9 = :_empty"); + map.put(59, "$alias = :as :identifier -> $1"); + map.put(53, "$call = :call :fqn $_gen11 $_gen12 -> Call( task=$1, alias=$2, body=$3 )"); + map.put(55, "$call_body = :lbrace $_gen3 $_gen13 :rbrace -> CallBody( declarations=$1, io=$2 )"); + map.put(57, "$call_input = :input :colon $_gen14 -> Inputs( map=$2 )"); + map.put(23, "$cmd_param = :cmd_param_start $_gen6 $e :cmd_param_end -> CommandParameter( attributes=$1, expr=$2 )"); + map.put(24, "$cmd_param_kv = :cmd_attr_hint :identifier :equal $e -> CommandParameterAttr( key=$1, value=$3 )"); + map.put(19, "$command = :raw_command :raw_cmd_start $_gen5 :raw_cmd_end -> RawCommand( parts=$2 )"); + map.put(21, "$command_part = $cmd_param"); + map.put(20, "$command_part = :cmd_part"); + map.put(36, "$declaration = $type_e :identifier $_gen9 -> Declaration( type=$0, name=$1, expression=$2 )"); + map.put(2, "$document = $_gen0 $_gen1 -> Namespace( imports=$0, body=$1 )"); + map.put(90, "$e = $e :asterisk $e -> Multiply( lhs=$0, rhs=$2 )"); + map.put(89, "$e = $e :dash $e -> Subtract( lhs=$0, rhs=$2 )"); + map.put(81, "$e = $e :double_ampersand $e -> LogicalAnd( lhs=$0, rhs=$2 )"); + map.put(82, "$e = $e :double_equal $e -> Equals( lhs=$0, rhs=$2 )"); + map.put(80, "$e = $e :double_pipe $e -> LogicalOr( lhs=$0, rhs=$2 )"); + map.put(86, "$e = $e :gt $e -> GreaterThan( lhs=$0, rhs=$2 )"); + map.put(87, "$e = $e :gteq $e -> GreaterThanOrEqual( lhs=$0, rhs=$2 )"); + map.put(84, "$e = $e :lt $e -> LessThan( lhs=$0, rhs=$2 )"); + map.put(85, "$e = $e :lteq $e -> LessThanOrEqual( lhs=$0, rhs=$2 )"); + map.put(83, "$e = $e :not_equal $e -> NotEquals( lhs=$0, rhs=$2 )"); + map.put(92, "$e = $e :percent $e -> Remainder( lhs=$0, rhs=$2 )"); + map.put(88, "$e = $e :plus $e -> Add( lhs=$0, rhs=$2 )"); + map.put(91, "$e = $e :slash $e -> Divide( lhs=$0, rhs=$2 )"); + map.put(109, "$e = :boolean"); + map.put(95, "$e = :dash $e -> UnaryNegation( expression=$1 )"); + map.put(111, "$e = :float"); + map.put(108, "$e = :identifier"); + map.put(99, "$e = :identifier <=> :dot :identifier -> MemberAccess( lhs=$0, rhs=$2 )"); + map.put(97, "$e = :identifier <=> :lparen $_gen18 :rparen -> FunctionCall( name=$0, params=$2 )"); + map.put(98, "$e = :identifier <=> :lsquare $e :rsquare -> ArrayOrMapLookup( lhs=$0, rhs=$2 )"); + map.put(106, "$e = :if $e :then $e :else $e -> TernaryIf( cond=$1, iftrue=$3, iffalse=$5 )"); + map.put(110, "$e = :integer"); + map.put(104, "$e = :lbrace $_gen20 :rbrace -> MapLiteral( map=$1 )"); + map.put(105, "$e = :lparen $_gen18 :rparen -> TupleLiteral( values=$1 )"); + map.put(102, "$e = :lsquare $_gen18 :rsquare -> ArrayLiteral( values=$1 )"); + map.put(93, "$e = :not $e -> LogicalNot( expression=$1 )"); + map.put(101, "$e = :object :lbrace $_gen19 :rbrace -> ObjectLiteral( map=$2 )"); + map.put(94, "$e = :plus $e -> UnaryPlus( expression=$1 )"); + map.put(107, "$e = :string"); + map.put(72, "$if_stmt = :if :lparen $e :rparen :lbrace $_gen10 :rbrace -> If( expression=$2, body=$5 )"); + map.put(8, "$import = :import :string $_gen2 -> Import( uri=$1, namespace=$2 )"); + map.put(9, "$import_namespace = :as :identifier -> $1"); + map.put(33, "$kv = :identifier :colon $e -> RuntimeAttribute( key=$0, value=$2 )"); + map.put(32, "$map = :lbrace $_gen8 :rbrace -> $1"); + map.put(38, "$map_kv = $e :colon $e -> MapLiteralKv( key=$0, value=$2 )"); + map.put(58, "$mapping = :identifier :equal $e -> IOMapping( key=$0, value=$2 )"); + map.put(30, "$meta = :meta $map -> Meta( map=$1 )"); + map.put(74, "$object_kv = :identifier :colon $e -> ObjectKV( key=$0, value=$2 )"); + map.put(27, "$output_kv = $type_e :identifier :equal $e -> Output( type=$0, name=$1, expression=$3 )"); + map.put(26, "$outputs = :output :lbrace $_gen7 :rbrace -> Outputs( attributes=$2 )"); + map.put(29, "$parameter_meta = :parameter_meta $map -> ParameterMeta( map=$1 )"); + map.put(28, "$runtime = :runtime $map -> Runtime( map=$1 )"); + map.put(73, "$scatter = :scatter :lparen :identifier :in $e :rparen :lbrace $_gen10 :rbrace -> Scatter( item=$2, collection=$4, body=$7 )"); + map.put(13, "$sections = $command"); + map.put(17, "$sections = $meta"); + map.put(14, "$sections = $outputs"); + map.put(16, "$sections = $parameter_meta"); + map.put(15, "$sections = $runtime"); + map.put(37, "$setter = :equal $e -> $1"); + map.put(12, "$task = :task :identifier :lbrace $_gen3 $_gen4 :rbrace -> Task( name=$1, declarations=$3, sections=$4 )"); + map.put(79, "$type_e = :type"); + map.put(76, "$type_e = :type <=> :lsquare $_gen17 :rsquare -> Type( name=$0, subtype=$2 )"); + map.put(78, "$type_e = :type <=> :plus -> NonEmptyType( innerType=$0 )"); + map.put(77, "$type_e = :type <=> :qmark -> OptionalType( innerType=$0 )"); + map.put(41, "$wf_body_element = $call"); + map.put(42, "$wf_body_element = $declaration"); + map.put(44, "$wf_body_element = $if_stmt"); + map.put(45, "$wf_body_element = $scatter"); + map.put(48, "$wf_body_element = $wf_meta"); + map.put(46, "$wf_body_element = $wf_outputs"); + map.put(47, "$wf_body_element = $wf_parameter_meta"); + map.put(43, "$wf_body_element = $while_loop"); + map.put(70, "$wf_meta = :meta $map -> Meta( map=$1 )"); + map.put(62, "$wf_output = $wf_output_declaration_syntax"); + map.put(63, "$wf_output = $wf_output_wildcard_syntax"); + map.put(64, "$wf_output_declaration_syntax = $type_e :identifier :equal $e -> WorkflowOutputDeclaration( type=$0, name=$1, expression=$3 )"); + map.put(68, "$wf_output_wildcard = :dot :asterisk -> $1"); + map.put(67, "$wf_output_wildcard_syntax = :fqn $_gen16 -> WorkflowOutputWildcard( fqn=$0, wildcard=$1 )"); + map.put(61, "$wf_outputs = :output :lbrace $_gen15 :rbrace -> WorkflowOutputs( outputs=$2 )"); + map.put(69, "$wf_parameter_meta = :parameter_meta $map -> ParameterMeta( map=$1 )"); + map.put(71, "$while_loop = :while :lparen $e :rparen :lbrace $_gen10 :rbrace -> WhileLoop( expression=$2, body=$5 )"); + map.put(40, "$workflow = :workflow :identifier :lbrace $_gen10 :rbrace -> Workflow( name=$1, body=$3 )"); + map.put(5, "$workflow_or_task_or_decl = $declaration"); + map.put(4, "$workflow_or_task_or_decl = $task"); + map.put(3, "$workflow_or_task_or_decl = $workflow"); rules = Collections.unmodifiableMap(map); } public static boolean is_terminal(int id) { diff --git a/wdl/transforms/biscayne/src/main/java/wdl/biscayne/parser/WdlParser.java b/wdl/transforms/biscayne/src/main/java/wdl/biscayne/parser/WdlParser.java index b1274ba6237..62d64e1d409 100644 --- a/wdl/transforms/biscayne/src/main/java/wdl/biscayne/parser/WdlParser.java +++ b/wdl/transforms/biscayne/src/main/java/wdl/biscayne/parser/WdlParser.java @@ -500,7 +500,7 @@ public static class WdlTerminalMap implements TerminalMap { id_to_term = new HashMap(); str_to_term = new HashMap(); for( WdlTerminalIdentifier terminal : terminals ) { - Integer id = new Integer(terminal.id()); + Integer id = terminal.id(); String str = terminal.string(); id_to_term.put(id, terminal); str_to_term.put(str, terminal); @@ -2623,143 +2623,143 @@ public enum WdlTerminalIdentifier implements TerminalIdentifier { } static { Map map = new HashMap(); - map.put(new Integer(0), "$_gen0 = list($import)"); - map.put(new Integer(1), "$_gen1 = list($file_body_element)"); - map.put(new Integer(40), "$_gen10 = list($input_declaration)"); - map.put(new Integer(43), "$_gen11 = list($kv)"); - map.put(new Integer(48), "$_gen12 = list($meta_kv)"); - map.put(new Integer(51), "$_gen13 = $setter"); - map.put(new Integer(52), "$_gen13 = :_empty"); - map.put(new Integer(57), "$_gen14 = list($output_kv)"); - map.put(new Integer(60), "$_gen15 = list($wf_body_element)"); - map.put(new Integer(70), "$_gen16 = $alias"); - map.put(new Integer(71), "$_gen16 = :_empty"); - map.put(new Integer(72), "$_gen17 = list($call_after)"); - map.put(new Integer(73), "$_gen18 = $call_brace_block"); - map.put(new Integer(74), "$_gen18 = :_empty"); - map.put(new Integer(76), "$_gen19 = $call_body"); - map.put(new Integer(77), "$_gen19 = :_empty"); - map.put(new Integer(7), "$_gen2 = list($struct_declaration)"); - map.put(new Integer(79), "$_gen20 = list($input_kv, :comma)"); - map.put(new Integer(94), "$_gen21 = list($meta_value, :comma)"); - map.put(new Integer(96), "$_gen22 = list($meta_kv, :comma)"); - map.put(new Integer(98), "$_gen23 = list($type_e, :comma)"); - map.put(new Integer(120), "$_gen24 = list($e, :comma)"); - map.put(new Integer(124), "$_gen25 = list($object_kv, :comma)"); - map.put(new Integer(127), "$_gen26 = list($map_kv, :comma)"); - map.put(new Integer(10), "$_gen3 = list($static_string_piece)"); - map.put(new Integer(12), "$_gen4 = list($string_piece)"); - map.put(new Integer(18), "$_gen5 = $import_namespace"); - map.put(new Integer(19), "$_gen5 = :_empty"); - map.put(new Integer(20), "$_gen6 = list($import_alias)"); - map.put(new Integer(24), "$_gen7 = list($task_sections)"); - map.put(new Integer(33), "$_gen8 = list($command_part)"); - map.put(new Integer(37), "$_gen9 = list($expression_placeholder_kv)"); - map.put(new Integer(81), "$alias = :as :identifier -> $1"); - map.put(new Integer(75), "$call = :call :fqn $_gen16 $_gen17 $_gen18 -> Call( task=$1, alias=$2, after=$3, body=$4 )"); - map.put(new Integer(82), "$call_after = :after :identifier -> $1"); - map.put(new Integer(80), "$call_body = :input :colon $_gen20 -> CallBody( inputs=$2 )"); - map.put(new Integer(78), "$call_brace_block = :lbrace $_gen19 :rbrace -> $1"); - map.put(new Integer(34), "$command = :raw_command :raw_cmd_start $_gen8 :raw_cmd_end -> RawCommand( parts=$2 )"); - map.put(new Integer(36), "$command_part = $expression_placeholder"); - map.put(new Integer(35), "$command_part = :cmd_part"); - map.put(new Integer(54), "$declaration = $type_e :identifier $setter -> Declaration( type=$0, name=$1, expression=$2 )"); - map.put(new Integer(2), "$document = $version $_gen0 $_gen1 -> Draft3File( version=$0, imports=$1, body=$2 )"); - map.put(new Integer(114), "$e = $e :asterisk $e -> Multiply( lhs=$0, rhs=$2 )"); - map.put(new Integer(113), "$e = $e :dash $e -> Subtract( lhs=$0, rhs=$2 )"); - map.put(new Integer(105), "$e = $e :double_ampersand $e -> LogicalAnd( lhs=$0, rhs=$2 )"); - map.put(new Integer(106), "$e = $e :double_equal $e -> Equals( lhs=$0, rhs=$2 )"); - map.put(new Integer(104), "$e = $e :double_pipe $e -> LogicalOr( lhs=$0, rhs=$2 )"); - map.put(new Integer(110), "$e = $e :gt $e -> GreaterThan( lhs=$0, rhs=$2 )"); - map.put(new Integer(111), "$e = $e :gteq $e -> GreaterThanOrEqual( lhs=$0, rhs=$2 )"); - map.put(new Integer(108), "$e = $e :lt $e -> LessThan( lhs=$0, rhs=$2 )"); - map.put(new Integer(109), "$e = $e :lteq $e -> LessThanOrEqual( lhs=$0, rhs=$2 )"); - map.put(new Integer(107), "$e = $e :not_equal $e -> NotEquals( lhs=$0, rhs=$2 )"); - map.put(new Integer(116), "$e = $e :percent $e -> Remainder( lhs=$0, rhs=$2 )"); - map.put(new Integer(112), "$e = $e :plus $e -> Add( lhs=$0, rhs=$2 )"); - map.put(new Integer(115), "$e = $e :slash $e -> Divide( lhs=$0, rhs=$2 )"); - map.put(new Integer(123), "$e = $e <=> :dot :identifier -> MemberAccess( value=$0, member=$2 )"); - map.put(new Integer(122), "$e = $e <=> :lsquare $e :rsquare -> ArrayOrMapLookup( lhs=$0, rhs=$2 )"); - map.put(new Integer(131), "$e = $string_literal"); - map.put(new Integer(133), "$e = :boolean"); - map.put(new Integer(119), "$e = :dash $e -> UnaryNegation( expression=$1 )"); - map.put(new Integer(135), "$e = :float"); - map.put(new Integer(132), "$e = :identifier"); - map.put(new Integer(121), "$e = :identifier <=> :lparen $_gen24 :rparen -> FunctionCall( name=$0, params=$2 )"); - map.put(new Integer(130), "$e = :if $e :then $e :else $e -> TernaryIf( cond=$1, iftrue=$3, iffalse=$5 )"); - map.put(new Integer(134), "$e = :integer"); - map.put(new Integer(128), "$e = :lbrace $_gen26 :rbrace -> MapLiteral( map=$1 )"); - map.put(new Integer(129), "$e = :lparen $_gen24 :rparen -> TupleLiteral( values=$1 )"); - map.put(new Integer(126), "$e = :lsquare $_gen24 :rsquare -> ArrayLiteral( values=$1 )"); - map.put(new Integer(136), "$e = :none"); - map.put(new Integer(117), "$e = :not $e -> LogicalNot( expression=$1 )"); - map.put(new Integer(125), "$e = :object :lbrace $_gen25 :rbrace -> ObjectLiteral( map=$2 )"); - map.put(new Integer(118), "$e = :plus $e -> UnaryPlus( expression=$1 )"); - map.put(new Integer(38), "$expression_placeholder = :expression_placeholder_start $_gen9 $e :expression_placeholder_end -> ExpressionPlaceholder( attributes=$1, expr=$2 )"); - map.put(new Integer(39), "$expression_placeholder_kv = :cmd_attr_hint :identifier :equal $e -> ExpressionPlaceholderAttr( key=$1, value=$3 )"); - map.put(new Integer(5), "$file_body_element = $struct"); - map.put(new Integer(4), "$file_body_element = $task"); - map.put(new Integer(3), "$file_body_element = $workflow"); - map.put(new Integer(85), "$if_stmt = :if :lparen $e :rparen :lbrace $_gen15 :rbrace -> If( expression=$2, body=$5 )"); - map.put(new Integer(21), "$import = :import $static_string $_gen5 $_gen6 -> Import( uri=$1, namespace=$2, aliases=$3 )"); - map.put(new Integer(23), "$import_alias = :alias :identifier :as :identifier -> ImportAlias( old_name=$1, new_name=$3 )"); - map.put(new Integer(22), "$import_namespace = :as :identifier -> $1"); - map.put(new Integer(53), "$input_declaration = $type_e :identifier $_gen13 -> InputDeclaration( type=$0, name=$1, expression=$2 )"); - map.put(new Integer(88), "$input_kv = :identifier :equal $e -> ObjectKV( key=$0, value=$2 )"); - map.put(new Integer(41), "$inputs = :input :lbrace $_gen10 :rbrace -> Inputs( inputs=$2 )"); - map.put(new Integer(45), "$kv = :identifier :colon $e -> RuntimeAttribute( key=$0, value=$2 )"); - map.put(new Integer(56), "$map_kv = $e :colon $e -> MapLiteralKv( key=$0, value=$2 )"); - map.put(new Integer(46), "$meta = :meta $meta_map -> Meta( map=$1 )"); - map.put(new Integer(50), "$meta_kv = :identifier :colon $meta_value -> MetaKvPair( key=$0, value=$2 )"); - map.put(new Integer(49), "$meta_map = :lbrace $_gen12 :rbrace -> $1"); - map.put(new Integer(89), "$meta_value = $static_string"); - map.put(new Integer(90), "$meta_value = :boolean"); - map.put(new Integer(92), "$meta_value = :float"); - map.put(new Integer(91), "$meta_value = :integer"); - map.put(new Integer(97), "$meta_value = :lbrace $_gen22 :rbrace -> MetaObject( map=$1 )"); - map.put(new Integer(95), "$meta_value = :lsquare $_gen21 :rsquare -> MetaArray( values=$1 )"); - map.put(new Integer(93), "$meta_value = :null"); - map.put(new Integer(87), "$object_kv = :identifier :colon $e -> ObjectKV( key=$0, value=$2 )"); - map.put(new Integer(59), "$output_kv = $type_e :identifier :equal $e -> Output( type=$0, name=$1, expression=$3 )"); - map.put(new Integer(58), "$outputs = :output :lbrace $_gen14 :rbrace -> Outputs( outputs=$2 )"); - map.put(new Integer(47), "$parameter_meta = :parameter_meta $meta_map -> ParameterMeta( map=$1 )"); - map.put(new Integer(44), "$rt_map = :lbrace $_gen11 :rbrace -> $1"); - map.put(new Integer(42), "$runtime = :runtime $rt_map -> Runtime( map=$1 )"); - map.put(new Integer(86), "$scatter = :scatter :lparen :identifier :in $e :rparen :lbrace $_gen15 :rbrace -> Scatter( item=$2, collection=$4, body=$7 )"); - map.put(new Integer(55), "$setter = :equal $e -> $1"); - map.put(new Integer(11), "$static_string = :quote $_gen3 :quote -> StaticString( value=$1 )"); - map.put(new Integer(15), "$static_string_piece = :escape"); - map.put(new Integer(14), "$static_string_piece = :string"); - map.put(new Integer(13), "$string_literal = :quote $_gen4 :quote -> StringLiteral( pieces=$1 )"); - map.put(new Integer(17), "$string_piece = $expression_placeholder"); - map.put(new Integer(16), "$string_piece = $static_string_piece"); - map.put(new Integer(8), "$struct = :struct :identifier :lbrace $_gen2 :rbrace -> Struct( name=$1, entries=$3 )"); - map.put(new Integer(9), "$struct_declaration = $type_e :identifier -> StructEntry( type=$0, name=$1 )"); - map.put(new Integer(25), "$task = :task :identifier :lbrace $_gen7 :rbrace -> Task( name=$1, sections=$3 )"); - map.put(new Integer(26), "$task_sections = $command"); - map.put(new Integer(32), "$task_sections = $declaration"); - map.put(new Integer(27), "$task_sections = $inputs"); - map.put(new Integer(31), "$task_sections = $meta"); - map.put(new Integer(28), "$task_sections = $outputs"); - map.put(new Integer(30), "$task_sections = $parameter_meta"); - map.put(new Integer(29), "$task_sections = $runtime"); - map.put(new Integer(103), "$type_e = :identifier"); - map.put(new Integer(102), "$type_e = :type"); - map.put(new Integer(99), "$type_e = :type <=> :lsquare $_gen23 :rsquare -> Type( name=$0, subtype=$2 )"); - map.put(new Integer(101), "$type_e = :type <=> :plus -> NonEmptyType( innerType=$0 )"); - map.put(new Integer(100), "$type_e = :type <=> :qmark -> OptionalType( innerType=$0 )"); - map.put(new Integer(6), "$version = :version :version_name -> VersionDeclaration( v=$1 )"); - map.put(new Integer(62), "$wf_body_element = $call"); - map.put(new Integer(63), "$wf_body_element = $declaration"); - map.put(new Integer(64), "$wf_body_element = $if_stmt"); - map.put(new Integer(66), "$wf_body_element = $inputs"); - map.put(new Integer(67), "$wf_body_element = $outputs"); - map.put(new Integer(65), "$wf_body_element = $scatter"); - map.put(new Integer(69), "$wf_body_element = $wf_meta"); - map.put(new Integer(68), "$wf_body_element = $wf_parameter_meta"); - map.put(new Integer(84), "$wf_meta = :meta $meta_map -> Meta( map=$1 )"); - map.put(new Integer(83), "$wf_parameter_meta = :parameter_meta $meta_map -> ParameterMeta( map=$1 )"); - map.put(new Integer(61), "$workflow = :workflow :identifier :lbrace $_gen15 :rbrace -> Workflow( name=$1, body=$3 )"); + map.put(0, "$_gen0 = list($import)"); + map.put(1, "$_gen1 = list($file_body_element)"); + map.put(40, "$_gen10 = list($input_declaration)"); + map.put(43, "$_gen11 = list($kv)"); + map.put(48, "$_gen12 = list($meta_kv)"); + map.put(51, "$_gen13 = $setter"); + map.put(52, "$_gen13 = :_empty"); + map.put(57, "$_gen14 = list($output_kv)"); + map.put(60, "$_gen15 = list($wf_body_element)"); + map.put(70, "$_gen16 = $alias"); + map.put(71, "$_gen16 = :_empty"); + map.put(72, "$_gen17 = list($call_after)"); + map.put(73, "$_gen18 = $call_brace_block"); + map.put(74, "$_gen18 = :_empty"); + map.put(76, "$_gen19 = $call_body"); + map.put(77, "$_gen19 = :_empty"); + map.put(7, "$_gen2 = list($struct_declaration)"); + map.put(79, "$_gen20 = list($input_kv, :comma)"); + map.put(94, "$_gen21 = list($meta_value, :comma)"); + map.put(96, "$_gen22 = list($meta_kv, :comma)"); + map.put(98, "$_gen23 = list($type_e, :comma)"); + map.put(120, "$_gen24 = list($e, :comma)"); + map.put(124, "$_gen25 = list($object_kv, :comma)"); + map.put(127, "$_gen26 = list($map_kv, :comma)"); + map.put(10, "$_gen3 = list($static_string_piece)"); + map.put(12, "$_gen4 = list($string_piece)"); + map.put(18, "$_gen5 = $import_namespace"); + map.put(19, "$_gen5 = :_empty"); + map.put(20, "$_gen6 = list($import_alias)"); + map.put(24, "$_gen7 = list($task_sections)"); + map.put(33, "$_gen8 = list($command_part)"); + map.put(37, "$_gen9 = list($expression_placeholder_kv)"); + map.put(81, "$alias = :as :identifier -> $1"); + map.put(75, "$call = :call :fqn $_gen16 $_gen17 $_gen18 -> Call( task=$1, alias=$2, after=$3, body=$4 )"); + map.put(82, "$call_after = :after :identifier -> $1"); + map.put(80, "$call_body = :input :colon $_gen20 -> CallBody( inputs=$2 )"); + map.put(78, "$call_brace_block = :lbrace $_gen19 :rbrace -> $1"); + map.put(34, "$command = :raw_command :raw_cmd_start $_gen8 :raw_cmd_end -> RawCommand( parts=$2 )"); + map.put(36, "$command_part = $expression_placeholder"); + map.put(35, "$command_part = :cmd_part"); + map.put(54, "$declaration = $type_e :identifier $setter -> Declaration( type=$0, name=$1, expression=$2 )"); + map.put(2, "$document = $version $_gen0 $_gen1 -> Draft3File( version=$0, imports=$1, body=$2 )"); + map.put(114, "$e = $e :asterisk $e -> Multiply( lhs=$0, rhs=$2 )"); + map.put(113, "$e = $e :dash $e -> Subtract( lhs=$0, rhs=$2 )"); + map.put(105, "$e = $e :double_ampersand $e -> LogicalAnd( lhs=$0, rhs=$2 )"); + map.put(106, "$e = $e :double_equal $e -> Equals( lhs=$0, rhs=$2 )"); + map.put(104, "$e = $e :double_pipe $e -> LogicalOr( lhs=$0, rhs=$2 )"); + map.put(110, "$e = $e :gt $e -> GreaterThan( lhs=$0, rhs=$2 )"); + map.put(111, "$e = $e :gteq $e -> GreaterThanOrEqual( lhs=$0, rhs=$2 )"); + map.put(108, "$e = $e :lt $e -> LessThan( lhs=$0, rhs=$2 )"); + map.put(109, "$e = $e :lteq $e -> LessThanOrEqual( lhs=$0, rhs=$2 )"); + map.put(107, "$e = $e :not_equal $e -> NotEquals( lhs=$0, rhs=$2 )"); + map.put(116, "$e = $e :percent $e -> Remainder( lhs=$0, rhs=$2 )"); + map.put(112, "$e = $e :plus $e -> Add( lhs=$0, rhs=$2 )"); + map.put(115, "$e = $e :slash $e -> Divide( lhs=$0, rhs=$2 )"); + map.put(123, "$e = $e <=> :dot :identifier -> MemberAccess( value=$0, member=$2 )"); + map.put(122, "$e = $e <=> :lsquare $e :rsquare -> ArrayOrMapLookup( lhs=$0, rhs=$2 )"); + map.put(131, "$e = $string_literal"); + map.put(133, "$e = :boolean"); + map.put(119, "$e = :dash $e -> UnaryNegation( expression=$1 )"); + map.put(135, "$e = :float"); + map.put(132, "$e = :identifier"); + map.put(121, "$e = :identifier <=> :lparen $_gen24 :rparen -> FunctionCall( name=$0, params=$2 )"); + map.put(130, "$e = :if $e :then $e :else $e -> TernaryIf( cond=$1, iftrue=$3, iffalse=$5 )"); + map.put(134, "$e = :integer"); + map.put(128, "$e = :lbrace $_gen26 :rbrace -> MapLiteral( map=$1 )"); + map.put(129, "$e = :lparen $_gen24 :rparen -> TupleLiteral( values=$1 )"); + map.put(126, "$e = :lsquare $_gen24 :rsquare -> ArrayLiteral( values=$1 )"); + map.put(136, "$e = :none"); + map.put(117, "$e = :not $e -> LogicalNot( expression=$1 )"); + map.put(125, "$e = :object :lbrace $_gen25 :rbrace -> ObjectLiteral( map=$2 )"); + map.put(118, "$e = :plus $e -> UnaryPlus( expression=$1 )"); + map.put(38, "$expression_placeholder = :expression_placeholder_start $_gen9 $e :expression_placeholder_end -> ExpressionPlaceholder( attributes=$1, expr=$2 )"); + map.put(39, "$expression_placeholder_kv = :cmd_attr_hint :identifier :equal $e -> ExpressionPlaceholderAttr( key=$1, value=$3 )"); + map.put(5, "$file_body_element = $struct"); + map.put(4, "$file_body_element = $task"); + map.put(3, "$file_body_element = $workflow"); + map.put(85, "$if_stmt = :if :lparen $e :rparen :lbrace $_gen15 :rbrace -> If( expression=$2, body=$5 )"); + map.put(21, "$import = :import $static_string $_gen5 $_gen6 -> Import( uri=$1, namespace=$2, aliases=$3 )"); + map.put(23, "$import_alias = :alias :identifier :as :identifier -> ImportAlias( old_name=$1, new_name=$3 )"); + map.put(22, "$import_namespace = :as :identifier -> $1"); + map.put(53, "$input_declaration = $type_e :identifier $_gen13 -> InputDeclaration( type=$0, name=$1, expression=$2 )"); + map.put(88, "$input_kv = :identifier :equal $e -> ObjectKV( key=$0, value=$2 )"); + map.put(41, "$inputs = :input :lbrace $_gen10 :rbrace -> Inputs( inputs=$2 )"); + map.put(45, "$kv = :identifier :colon $e -> RuntimeAttribute( key=$0, value=$2 )"); + map.put(56, "$map_kv = $e :colon $e -> MapLiteralKv( key=$0, value=$2 )"); + map.put(46, "$meta = :meta $meta_map -> Meta( map=$1 )"); + map.put(50, "$meta_kv = :identifier :colon $meta_value -> MetaKvPair( key=$0, value=$2 )"); + map.put(49, "$meta_map = :lbrace $_gen12 :rbrace -> $1"); + map.put(89, "$meta_value = $static_string"); + map.put(90, "$meta_value = :boolean"); + map.put(92, "$meta_value = :float"); + map.put(91, "$meta_value = :integer"); + map.put(97, "$meta_value = :lbrace $_gen22 :rbrace -> MetaObject( map=$1 )"); + map.put(95, "$meta_value = :lsquare $_gen21 :rsquare -> MetaArray( values=$1 )"); + map.put(93, "$meta_value = :null"); + map.put(87, "$object_kv = :identifier :colon $e -> ObjectKV( key=$0, value=$2 )"); + map.put(59, "$output_kv = $type_e :identifier :equal $e -> Output( type=$0, name=$1, expression=$3 )"); + map.put(58, "$outputs = :output :lbrace $_gen14 :rbrace -> Outputs( outputs=$2 )"); + map.put(47, "$parameter_meta = :parameter_meta $meta_map -> ParameterMeta( map=$1 )"); + map.put(44, "$rt_map = :lbrace $_gen11 :rbrace -> $1"); + map.put(42, "$runtime = :runtime $rt_map -> Runtime( map=$1 )"); + map.put(86, "$scatter = :scatter :lparen :identifier :in $e :rparen :lbrace $_gen15 :rbrace -> Scatter( item=$2, collection=$4, body=$7 )"); + map.put(55, "$setter = :equal $e -> $1"); + map.put(11, "$static_string = :quote $_gen3 :quote -> StaticString( value=$1 )"); + map.put(15, "$static_string_piece = :escape"); + map.put(14, "$static_string_piece = :string"); + map.put(13, "$string_literal = :quote $_gen4 :quote -> StringLiteral( pieces=$1 )"); + map.put(17, "$string_piece = $expression_placeholder"); + map.put(16, "$string_piece = $static_string_piece"); + map.put(8, "$struct = :struct :identifier :lbrace $_gen2 :rbrace -> Struct( name=$1, entries=$3 )"); + map.put(9, "$struct_declaration = $type_e :identifier -> StructEntry( type=$0, name=$1 )"); + map.put(25, "$task = :task :identifier :lbrace $_gen7 :rbrace -> Task( name=$1, sections=$3 )"); + map.put(26, "$task_sections = $command"); + map.put(32, "$task_sections = $declaration"); + map.put(27, "$task_sections = $inputs"); + map.put(31, "$task_sections = $meta"); + map.put(28, "$task_sections = $outputs"); + map.put(30, "$task_sections = $parameter_meta"); + map.put(29, "$task_sections = $runtime"); + map.put(103, "$type_e = :identifier"); + map.put(102, "$type_e = :type"); + map.put(99, "$type_e = :type <=> :lsquare $_gen23 :rsquare -> Type( name=$0, subtype=$2 )"); + map.put(101, "$type_e = :type <=> :plus -> NonEmptyType( innerType=$0 )"); + map.put(100, "$type_e = :type <=> :qmark -> OptionalType( innerType=$0 )"); + map.put(6, "$version = :version :version_name -> VersionDeclaration( v=$1 )"); + map.put(62, "$wf_body_element = $call"); + map.put(63, "$wf_body_element = $declaration"); + map.put(64, "$wf_body_element = $if_stmt"); + map.put(66, "$wf_body_element = $inputs"); + map.put(67, "$wf_body_element = $outputs"); + map.put(65, "$wf_body_element = $scatter"); + map.put(69, "$wf_body_element = $wf_meta"); + map.put(68, "$wf_body_element = $wf_parameter_meta"); + map.put(84, "$wf_meta = :meta $meta_map -> Meta( map=$1 )"); + map.put(83, "$wf_parameter_meta = :parameter_meta $meta_map -> ParameterMeta( map=$1 )"); + map.put(61, "$workflow = :workflow :identifier :lbrace $_gen15 :rbrace -> Workflow( name=$1, body=$3 )"); rules = Collections.unmodifiableMap(map); } public static boolean is_terminal(int id) { diff --git a/wdl/transforms/draft3/src/main/java/wdl/draft3/parser/WdlParser.java b/wdl/transforms/draft3/src/main/java/wdl/draft3/parser/WdlParser.java index cbde065cf16..7f18c3d4cf9 100644 --- a/wdl/transforms/draft3/src/main/java/wdl/draft3/parser/WdlParser.java +++ b/wdl/transforms/draft3/src/main/java/wdl/draft3/parser/WdlParser.java @@ -500,7 +500,7 @@ public static class WdlTerminalMap implements TerminalMap { id_to_term = new HashMap(); str_to_term = new HashMap(); for( WdlTerminalIdentifier terminal : terminals ) { - Integer id = new Integer(terminal.id()); + Integer id = terminal.id(); String str = terminal.string(); id_to_term.put(id, terminal); str_to_term.put(str, terminal); @@ -2566,141 +2566,141 @@ public enum WdlTerminalIdentifier implements TerminalIdentifier { } static { Map map = new HashMap(); - map.put(new Integer(0), "$_gen0 = list($import)"); - map.put(new Integer(1), "$_gen1 = list($file_body_element)"); - map.put(new Integer(39), "$_gen10 = list($input_declaration)"); - map.put(new Integer(42), "$_gen11 = list($kv)"); - map.put(new Integer(47), "$_gen12 = list($meta_kv)"); - map.put(new Integer(50), "$_gen13 = $setter"); - map.put(new Integer(51), "$_gen13 = :_empty"); - map.put(new Integer(56), "$_gen14 = list($output_kv)"); - map.put(new Integer(59), "$_gen15 = list($wf_body_element)"); - map.put(new Integer(70), "$_gen16 = $alias"); - map.put(new Integer(71), "$_gen16 = :_empty"); - map.put(new Integer(72), "$_gen17 = $call_brace_block"); - map.put(new Integer(73), "$_gen17 = :_empty"); - map.put(new Integer(75), "$_gen18 = $call_body"); - map.put(new Integer(76), "$_gen18 = :_empty"); - map.put(new Integer(78), "$_gen19 = list($input_kv, :comma)"); - map.put(new Integer(7), "$_gen2 = list($struct_declaration)"); - map.put(new Integer(93), "$_gen20 = list($meta_value, :comma)"); - map.put(new Integer(95), "$_gen21 = list($meta_kv, :comma)"); - map.put(new Integer(97), "$_gen22 = list($type_e, :comma)"); - map.put(new Integer(119), "$_gen23 = list($e, :comma)"); - map.put(new Integer(123), "$_gen24 = list($object_kv, :comma)"); - map.put(new Integer(126), "$_gen25 = list($map_kv, :comma)"); - map.put(new Integer(11), "$_gen3 = :_empty"); - map.put(new Integer(10), "$_gen3 = :string"); - map.put(new Integer(13), "$_gen4 = list($string_piece)"); - map.put(new Integer(17), "$_gen5 = $import_namespace"); - map.put(new Integer(18), "$_gen5 = :_empty"); - map.put(new Integer(19), "$_gen6 = list($import_alias)"); - map.put(new Integer(23), "$_gen7 = list($task_sections)"); - map.put(new Integer(32), "$_gen8 = list($command_part)"); - map.put(new Integer(36), "$_gen9 = list($expression_placeholder_kv)"); - map.put(new Integer(80), "$alias = :as :identifier -> $1"); - map.put(new Integer(74), "$call = :call :fqn $_gen16 $_gen17 -> Call( task=$1, alias=$2, body=$3 )"); - map.put(new Integer(79), "$call_body = :input :colon $_gen19 -> CallBody( inputs=$2 )"); - map.put(new Integer(77), "$call_brace_block = :lbrace $_gen18 :rbrace -> $1"); - map.put(new Integer(33), "$command = :raw_command :raw_cmd_start $_gen8 :raw_cmd_end -> RawCommand( parts=$2 )"); - map.put(new Integer(35), "$command_part = $expression_placeholder"); - map.put(new Integer(34), "$command_part = :cmd_part"); - map.put(new Integer(53), "$declaration = $type_e :identifier $setter -> Declaration( type=$0, name=$1, expression=$2 )"); - map.put(new Integer(2), "$document = $version $_gen0 $_gen1 -> Draft3File( version=$0, imports=$1, body=$2 )"); - map.put(new Integer(113), "$e = $e :asterisk $e -> Multiply( lhs=$0, rhs=$2 )"); - map.put(new Integer(112), "$e = $e :dash $e -> Subtract( lhs=$0, rhs=$2 )"); - map.put(new Integer(104), "$e = $e :double_ampersand $e -> LogicalAnd( lhs=$0, rhs=$2 )"); - map.put(new Integer(105), "$e = $e :double_equal $e -> Equals( lhs=$0, rhs=$2 )"); - map.put(new Integer(103), "$e = $e :double_pipe $e -> LogicalOr( lhs=$0, rhs=$2 )"); - map.put(new Integer(109), "$e = $e :gt $e -> GreaterThan( lhs=$0, rhs=$2 )"); - map.put(new Integer(110), "$e = $e :gteq $e -> GreaterThanOrEqual( lhs=$0, rhs=$2 )"); - map.put(new Integer(107), "$e = $e :lt $e -> LessThan( lhs=$0, rhs=$2 )"); - map.put(new Integer(108), "$e = $e :lteq $e -> LessThanOrEqual( lhs=$0, rhs=$2 )"); - map.put(new Integer(106), "$e = $e :not_equal $e -> NotEquals( lhs=$0, rhs=$2 )"); - map.put(new Integer(115), "$e = $e :percent $e -> Remainder( lhs=$0, rhs=$2 )"); - map.put(new Integer(111), "$e = $e :plus $e -> Add( lhs=$0, rhs=$2 )"); - map.put(new Integer(114), "$e = $e :slash $e -> Divide( lhs=$0, rhs=$2 )"); - map.put(new Integer(122), "$e = $e <=> :dot :identifier -> MemberAccess( value=$0, member=$2 )"); - map.put(new Integer(121), "$e = $e <=> :lsquare $e :rsquare -> ArrayOrMapLookup( lhs=$0, rhs=$2 )"); - map.put(new Integer(130), "$e = $string_literal"); - map.put(new Integer(132), "$e = :boolean"); - map.put(new Integer(118), "$e = :dash $e -> UnaryNegation( expression=$1 )"); - map.put(new Integer(134), "$e = :float"); - map.put(new Integer(131), "$e = :identifier"); - map.put(new Integer(120), "$e = :identifier <=> :lparen $_gen23 :rparen -> FunctionCall( name=$0, params=$2 )"); - map.put(new Integer(129), "$e = :if $e :then $e :else $e -> TernaryIf( cond=$1, iftrue=$3, iffalse=$5 )"); - map.put(new Integer(133), "$e = :integer"); - map.put(new Integer(127), "$e = :lbrace $_gen25 :rbrace -> MapLiteral( map=$1 )"); - map.put(new Integer(128), "$e = :lparen $_gen23 :rparen -> TupleLiteral( values=$1 )"); - map.put(new Integer(125), "$e = :lsquare $_gen23 :rsquare -> ArrayLiteral( values=$1 )"); - map.put(new Integer(116), "$e = :not $e -> LogicalNot( expression=$1 )"); - map.put(new Integer(124), "$e = :object :lbrace $_gen24 :rbrace -> ObjectLiteral( map=$2 )"); - map.put(new Integer(117), "$e = :plus $e -> UnaryPlus( expression=$1 )"); - map.put(new Integer(37), "$expression_placeholder = :expression_placeholder_start $_gen9 $e :expression_placeholder_end -> ExpressionPlaceholder( attributes=$1, expr=$2 )"); - map.put(new Integer(38), "$expression_placeholder_kv = :cmd_attr_hint :identifier :equal $e -> ExpressionPlaceholderAttr( key=$1, value=$3 )"); - map.put(new Integer(5), "$file_body_element = $struct"); - map.put(new Integer(4), "$file_body_element = $task"); - map.put(new Integer(3), "$file_body_element = $workflow"); - map.put(new Integer(84), "$if_stmt = :if :lparen $e :rparen :lbrace $_gen15 :rbrace -> If( expression=$2, body=$5 )"); - map.put(new Integer(20), "$import = :import $static_string $_gen5 $_gen6 -> Import( uri=$1, namespace=$2, aliases=$3 )"); - map.put(new Integer(22), "$import_alias = :alias :identifier :as :identifier -> ImportAlias( old_name=$1, new_name=$3 )"); - map.put(new Integer(21), "$import_namespace = :as :identifier -> $1"); - map.put(new Integer(52), "$input_declaration = $type_e :identifier $_gen13 -> InputDeclaration( type=$0, name=$1, expression=$2 )"); - map.put(new Integer(87), "$input_kv = :identifier :equal $e -> ObjectKV( key=$0, value=$2 )"); - map.put(new Integer(40), "$inputs = :input :lbrace $_gen10 :rbrace -> Inputs( inputs=$2 )"); - map.put(new Integer(44), "$kv = :identifier :colon $e -> RuntimeAttribute( key=$0, value=$2 )"); - map.put(new Integer(55), "$map_kv = $e :colon $e -> MapLiteralKv( key=$0, value=$2 )"); - map.put(new Integer(45), "$meta = :meta $meta_map -> Meta( map=$1 )"); - map.put(new Integer(49), "$meta_kv = :identifier :colon $meta_value -> MetaKvPair( key=$0, value=$2 )"); - map.put(new Integer(48), "$meta_map = :lbrace $_gen12 :rbrace -> $1"); - map.put(new Integer(88), "$meta_value = $static_string"); - map.put(new Integer(89), "$meta_value = :boolean"); - map.put(new Integer(91), "$meta_value = :float"); - map.put(new Integer(90), "$meta_value = :integer"); - map.put(new Integer(96), "$meta_value = :lbrace $_gen21 :rbrace -> MetaObject( map=$1 )"); - map.put(new Integer(94), "$meta_value = :lsquare $_gen20 :rsquare -> MetaArray( values=$1 )"); - map.put(new Integer(92), "$meta_value = :null"); - map.put(new Integer(86), "$object_kv = :identifier :colon $e -> ObjectKV( key=$0, value=$2 )"); - map.put(new Integer(58), "$output_kv = $type_e :identifier :equal $e -> Output( type=$0, name=$1, expression=$3 )"); - map.put(new Integer(57), "$outputs = :output :lbrace $_gen14 :rbrace -> Outputs( outputs=$2 )"); - map.put(new Integer(46), "$parameter_meta = :parameter_meta $meta_map -> ParameterMeta( map=$1 )"); - map.put(new Integer(43), "$rt_map = :lbrace $_gen11 :rbrace -> $1"); - map.put(new Integer(41), "$runtime = :runtime $rt_map -> Runtime( map=$1 )"); - map.put(new Integer(85), "$scatter = :scatter :lparen :identifier :in $e :rparen :lbrace $_gen15 :rbrace -> Scatter( item=$2, collection=$4, body=$7 )"); - map.put(new Integer(54), "$setter = :equal $e -> $1"); - map.put(new Integer(12), "$static_string = :quote $_gen3 :quote -> StaticString( value=$1 )"); - map.put(new Integer(14), "$string_literal = :quote $_gen4 :quote -> StringLiteral( pieces=$1 )"); - map.put(new Integer(16), "$string_piece = $expression_placeholder"); - map.put(new Integer(15), "$string_piece = :string"); - map.put(new Integer(8), "$struct = :struct :identifier :lbrace $_gen2 :rbrace -> Struct( name=$1, entries=$3 )"); - map.put(new Integer(9), "$struct_declaration = $type_e :identifier -> StructEntry( type=$0, name=$1 )"); - map.put(new Integer(24), "$task = :task :identifier :lbrace $_gen7 :rbrace -> Task( name=$1, sections=$3 )"); - map.put(new Integer(25), "$task_sections = $command"); - map.put(new Integer(31), "$task_sections = $declaration"); - map.put(new Integer(26), "$task_sections = $inputs"); - map.put(new Integer(30), "$task_sections = $meta"); - map.put(new Integer(27), "$task_sections = $outputs"); - map.put(new Integer(29), "$task_sections = $parameter_meta"); - map.put(new Integer(28), "$task_sections = $runtime"); - map.put(new Integer(102), "$type_e = :identifier"); - map.put(new Integer(101), "$type_e = :type"); - map.put(new Integer(98), "$type_e = :type <=> :lsquare $_gen22 :rsquare -> Type( name=$0, subtype=$2 )"); - map.put(new Integer(100), "$type_e = :type <=> :plus -> NonEmptyType( innerType=$0 )"); - map.put(new Integer(99), "$type_e = :type <=> :qmark -> OptionalType( innerType=$0 )"); - map.put(new Integer(6), "$version = :version :version_name -> VersionDeclaration( v=$1 )"); - map.put(new Integer(61), "$wf_body_element = $call"); - map.put(new Integer(62), "$wf_body_element = $declaration"); - map.put(new Integer(64), "$wf_body_element = $if_stmt"); - map.put(new Integer(66), "$wf_body_element = $inputs"); - map.put(new Integer(67), "$wf_body_element = $outputs"); - map.put(new Integer(65), "$wf_body_element = $scatter"); - map.put(new Integer(69), "$wf_body_element = $wf_meta"); - map.put(new Integer(68), "$wf_body_element = $wf_parameter_meta"); - map.put(new Integer(63), "$wf_body_element = $while_loop"); - map.put(new Integer(82), "$wf_meta = :meta $meta_map -> Meta( map=$1 )"); - map.put(new Integer(81), "$wf_parameter_meta = :parameter_meta $meta_map -> ParameterMeta( map=$1 )"); - map.put(new Integer(83), "$while_loop = :while :lparen $e :rparen :lbrace $_gen15 :rbrace -> WhileLoop( expression=$2, body=$5 )"); - map.put(new Integer(60), "$workflow = :workflow :identifier :lbrace $_gen15 :rbrace -> Workflow( name=$1, body=$3 )"); + map.put(0, "$_gen0 = list($import)"); + map.put(1, "$_gen1 = list($file_body_element)"); + map.put(39, "$_gen10 = list($input_declaration)"); + map.put(42, "$_gen11 = list($kv)"); + map.put(47, "$_gen12 = list($meta_kv)"); + map.put(50, "$_gen13 = $setter"); + map.put(51, "$_gen13 = :_empty"); + map.put(56, "$_gen14 = list($output_kv)"); + map.put(59, "$_gen15 = list($wf_body_element)"); + map.put(70, "$_gen16 = $alias"); + map.put(71, "$_gen16 = :_empty"); + map.put(72, "$_gen17 = $call_brace_block"); + map.put(73, "$_gen17 = :_empty"); + map.put(75, "$_gen18 = $call_body"); + map.put(76, "$_gen18 = :_empty"); + map.put(78, "$_gen19 = list($input_kv, :comma)"); + map.put(7, "$_gen2 = list($struct_declaration)"); + map.put(93, "$_gen20 = list($meta_value, :comma)"); + map.put(95, "$_gen21 = list($meta_kv, :comma)"); + map.put(97, "$_gen22 = list($type_e, :comma)"); + map.put(119, "$_gen23 = list($e, :comma)"); + map.put(123, "$_gen24 = list($object_kv, :comma)"); + map.put(126, "$_gen25 = list($map_kv, :comma)"); + map.put(11, "$_gen3 = :_empty"); + map.put(10, "$_gen3 = :string"); + map.put(13, "$_gen4 = list($string_piece)"); + map.put(17, "$_gen5 = $import_namespace"); + map.put(18, "$_gen5 = :_empty"); + map.put(19, "$_gen6 = list($import_alias)"); + map.put(23, "$_gen7 = list($task_sections)"); + map.put(32, "$_gen8 = list($command_part)"); + map.put(36, "$_gen9 = list($expression_placeholder_kv)"); + map.put(80, "$alias = :as :identifier -> $1"); + map.put(74, "$call = :call :fqn $_gen16 $_gen17 -> Call( task=$1, alias=$2, body=$3 )"); + map.put(79, "$call_body = :input :colon $_gen19 -> CallBody( inputs=$2 )"); + map.put(77, "$call_brace_block = :lbrace $_gen18 :rbrace -> $1"); + map.put(33, "$command = :raw_command :raw_cmd_start $_gen8 :raw_cmd_end -> RawCommand( parts=$2 )"); + map.put(35, "$command_part = $expression_placeholder"); + map.put(34, "$command_part = :cmd_part"); + map.put(53, "$declaration = $type_e :identifier $setter -> Declaration( type=$0, name=$1, expression=$2 )"); + map.put(2, "$document = $version $_gen0 $_gen1 -> Draft3File( version=$0, imports=$1, body=$2 )"); + map.put(113, "$e = $e :asterisk $e -> Multiply( lhs=$0, rhs=$2 )"); + map.put(112, "$e = $e :dash $e -> Subtract( lhs=$0, rhs=$2 )"); + map.put(104, "$e = $e :double_ampersand $e -> LogicalAnd( lhs=$0, rhs=$2 )"); + map.put(105, "$e = $e :double_equal $e -> Equals( lhs=$0, rhs=$2 )"); + map.put(103, "$e = $e :double_pipe $e -> LogicalOr( lhs=$0, rhs=$2 )"); + map.put(109, "$e = $e :gt $e -> GreaterThan( lhs=$0, rhs=$2 )"); + map.put(110, "$e = $e :gteq $e -> GreaterThanOrEqual( lhs=$0, rhs=$2 )"); + map.put(107, "$e = $e :lt $e -> LessThan( lhs=$0, rhs=$2 )"); + map.put(108, "$e = $e :lteq $e -> LessThanOrEqual( lhs=$0, rhs=$2 )"); + map.put(106, "$e = $e :not_equal $e -> NotEquals( lhs=$0, rhs=$2 )"); + map.put(115, "$e = $e :percent $e -> Remainder( lhs=$0, rhs=$2 )"); + map.put(111, "$e = $e :plus $e -> Add( lhs=$0, rhs=$2 )"); + map.put(114, "$e = $e :slash $e -> Divide( lhs=$0, rhs=$2 )"); + map.put(122, "$e = $e <=> :dot :identifier -> MemberAccess( value=$0, member=$2 )"); + map.put(121, "$e = $e <=> :lsquare $e :rsquare -> ArrayOrMapLookup( lhs=$0, rhs=$2 )"); + map.put(130, "$e = $string_literal"); + map.put(132, "$e = :boolean"); + map.put(118, "$e = :dash $e -> UnaryNegation( expression=$1 )"); + map.put(134, "$e = :float"); + map.put(131, "$e = :identifier"); + map.put(120, "$e = :identifier <=> :lparen $_gen23 :rparen -> FunctionCall( name=$0, params=$2 )"); + map.put(129, "$e = :if $e :then $e :else $e -> TernaryIf( cond=$1, iftrue=$3, iffalse=$5 )"); + map.put(133, "$e = :integer"); + map.put(127, "$e = :lbrace $_gen25 :rbrace -> MapLiteral( map=$1 )"); + map.put(128, "$e = :lparen $_gen23 :rparen -> TupleLiteral( values=$1 )"); + map.put(125, "$e = :lsquare $_gen23 :rsquare -> ArrayLiteral( values=$1 )"); + map.put(116, "$e = :not $e -> LogicalNot( expression=$1 )"); + map.put(124, "$e = :object :lbrace $_gen24 :rbrace -> ObjectLiteral( map=$2 )"); + map.put(117, "$e = :plus $e -> UnaryPlus( expression=$1 )"); + map.put(37, "$expression_placeholder = :expression_placeholder_start $_gen9 $e :expression_placeholder_end -> ExpressionPlaceholder( attributes=$1, expr=$2 )"); + map.put(38, "$expression_placeholder_kv = :cmd_attr_hint :identifier :equal $e -> ExpressionPlaceholderAttr( key=$1, value=$3 )"); + map.put(5, "$file_body_element = $struct"); + map.put(4, "$file_body_element = $task"); + map.put(3, "$file_body_element = $workflow"); + map.put(84, "$if_stmt = :if :lparen $e :rparen :lbrace $_gen15 :rbrace -> If( expression=$2, body=$5 )"); + map.put(20, "$import = :import $static_string $_gen5 $_gen6 -> Import( uri=$1, namespace=$2, aliases=$3 )"); + map.put(22, "$import_alias = :alias :identifier :as :identifier -> ImportAlias( old_name=$1, new_name=$3 )"); + map.put(21, "$import_namespace = :as :identifier -> $1"); + map.put(52, "$input_declaration = $type_e :identifier $_gen13 -> InputDeclaration( type=$0, name=$1, expression=$2 )"); + map.put(87, "$input_kv = :identifier :equal $e -> ObjectKV( key=$0, value=$2 )"); + map.put(40, "$inputs = :input :lbrace $_gen10 :rbrace -> Inputs( inputs=$2 )"); + map.put(44, "$kv = :identifier :colon $e -> RuntimeAttribute( key=$0, value=$2 )"); + map.put(55, "$map_kv = $e :colon $e -> MapLiteralKv( key=$0, value=$2 )"); + map.put(45, "$meta = :meta $meta_map -> Meta( map=$1 )"); + map.put(49, "$meta_kv = :identifier :colon $meta_value -> MetaKvPair( key=$0, value=$2 )"); + map.put(48, "$meta_map = :lbrace $_gen12 :rbrace -> $1"); + map.put(88, "$meta_value = $static_string"); + map.put(89, "$meta_value = :boolean"); + map.put(91, "$meta_value = :float"); + map.put(90, "$meta_value = :integer"); + map.put(96, "$meta_value = :lbrace $_gen21 :rbrace -> MetaObject( map=$1 )"); + map.put(94, "$meta_value = :lsquare $_gen20 :rsquare -> MetaArray( values=$1 )"); + map.put(92, "$meta_value = :null"); + map.put(86, "$object_kv = :identifier :colon $e -> ObjectKV( key=$0, value=$2 )"); + map.put(58, "$output_kv = $type_e :identifier :equal $e -> Output( type=$0, name=$1, expression=$3 )"); + map.put(57, "$outputs = :output :lbrace $_gen14 :rbrace -> Outputs( outputs=$2 )"); + map.put(46, "$parameter_meta = :parameter_meta $meta_map -> ParameterMeta( map=$1 )"); + map.put(43, "$rt_map = :lbrace $_gen11 :rbrace -> $1"); + map.put(41, "$runtime = :runtime $rt_map -> Runtime( map=$1 )"); + map.put(85, "$scatter = :scatter :lparen :identifier :in $e :rparen :lbrace $_gen15 :rbrace -> Scatter( item=$2, collection=$4, body=$7 )"); + map.put(54, "$setter = :equal $e -> $1"); + map.put(12, "$static_string = :quote $_gen3 :quote -> StaticString( value=$1 )"); + map.put(14, "$string_literal = :quote $_gen4 :quote -> StringLiteral( pieces=$1 )"); + map.put(16, "$string_piece = $expression_placeholder"); + map.put(15, "$string_piece = :string"); + map.put(8, "$struct = :struct :identifier :lbrace $_gen2 :rbrace -> Struct( name=$1, entries=$3 )"); + map.put(9, "$struct_declaration = $type_e :identifier -> StructEntry( type=$0, name=$1 )"); + map.put(24, "$task = :task :identifier :lbrace $_gen7 :rbrace -> Task( name=$1, sections=$3 )"); + map.put(25, "$task_sections = $command"); + map.put(31, "$task_sections = $declaration"); + map.put(26, "$task_sections = $inputs"); + map.put(30, "$task_sections = $meta"); + map.put(27, "$task_sections = $outputs"); + map.put(29, "$task_sections = $parameter_meta"); + map.put(28, "$task_sections = $runtime"); + map.put(102, "$type_e = :identifier"); + map.put(101, "$type_e = :type"); + map.put(98, "$type_e = :type <=> :lsquare $_gen22 :rsquare -> Type( name=$0, subtype=$2 )"); + map.put(100, "$type_e = :type <=> :plus -> NonEmptyType( innerType=$0 )"); + map.put(99, "$type_e = :type <=> :qmark -> OptionalType( innerType=$0 )"); + map.put(6, "$version = :version :version_name -> VersionDeclaration( v=$1 )"); + map.put(61, "$wf_body_element = $call"); + map.put(62, "$wf_body_element = $declaration"); + map.put(64, "$wf_body_element = $if_stmt"); + map.put(66, "$wf_body_element = $inputs"); + map.put(67, "$wf_body_element = $outputs"); + map.put(65, "$wf_body_element = $scatter"); + map.put(69, "$wf_body_element = $wf_meta"); + map.put(68, "$wf_body_element = $wf_parameter_meta"); + map.put(63, "$wf_body_element = $while_loop"); + map.put(82, "$wf_meta = :meta $meta_map -> Meta( map=$1 )"); + map.put(81, "$wf_parameter_meta = :parameter_meta $meta_map -> ParameterMeta( map=$1 )"); + map.put(83, "$while_loop = :while :lparen $e :rparen :lbrace $_gen15 :rbrace -> WhileLoop( expression=$2, body=$5 )"); + map.put(60, "$workflow = :workflow :identifier :lbrace $_gen15 :rbrace -> Workflow( name=$1, body=$3 )"); rules = Collections.unmodifiableMap(map); } public static boolean is_terminal(int id) { From 06532e97f36da02e8c1d672932a03c13789b4276 Mon Sep 17 00:00:00 2001 From: Adam Nichols Date: Thu, 13 Oct 2022 17:46:31 -0400 Subject: [PATCH 09/13] Newest Scala? --- project/Settings.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/Settings.scala b/project/Settings.scala index 797d7917dd9..bbd61e00e09 100644 --- a/project/Settings.scala +++ b/project/Settings.scala @@ -70,7 +70,7 @@ object Settings { assembly / assemblyMergeStrategy := customMergeStrategy.value, ) - val Scala2_13Version = "2.13.9" + val Scala2_13Version = "2.13.10" private val ScalaVersion: String = Scala2_13Version private val sharedSettings: Seq[Setting[_]] = cromwellVersionWithGit ++ publishingSettings ++ List( From 1925ec5d4ba7c6dd9efc16e8e78fe7e98f05e952 Mon Sep 17 00:00:00 2001 From: Adam Nichols Date: Thu, 13 Oct 2022 18:03:24 -0400 Subject: [PATCH 10/13] I guess not --- project/Settings.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/Settings.scala b/project/Settings.scala index bbd61e00e09..797d7917dd9 100644 --- a/project/Settings.scala +++ b/project/Settings.scala @@ -70,7 +70,7 @@ object Settings { assembly / assemblyMergeStrategy := customMergeStrategy.value, ) - val Scala2_13Version = "2.13.10" + val Scala2_13Version = "2.13.9" private val ScalaVersion: String = Scala2_13Version private val sharedSettings: Seq[Setting[_]] = cromwellVersionWithGit ++ publishingSettings ++ List( From d65f21609e26646c80c85ba4c9ce09ae5b652c67 Mon Sep 17 00:00:00 2001 From: Janet Gainer-Dewar Date: Fri, 14 Oct 2022 15:43:36 -0400 Subject: [PATCH 11/13] Does this please Travis? --- project/Dependencies.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 13f0334aa53..10dba1c3f7d 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -480,7 +480,8 @@ object Dependencies { val coreDependencies: List[ModuleID] = List( "com.google.auth" % "google-auth-library-oauth2-http" % googleOauth2V, "com.chuusai" %% "shapeless" % shapelessV, - "com.storm-enroute" %% "scalameter" % scalameterV % Test, + "com.storm-enroute" %% "scalameter" % scalameterV % Test + exclude("org.scala-lang.modules", "scala-xml_2.13"), "com.github.scopt" %% "scopt" % scoptV, ) ++ akkaStreamDependencies ++ configDependencies ++ catsDependencies ++ circeDependencies ++ googleApiClientDependencies ++ statsDDependencies ++ betterFilesDependencies ++ @@ -509,7 +510,8 @@ object Dependencies { "com.storm-enroute" %% "scalameter" % scalameterV exclude("com.fasterxml.jackson.core", "jackson-databind") exclude("com.fasterxml.jackson.module", "jackson-module-scala") - exclude("org.scala-tools.testing", "test-interface"), + exclude("org.scala-tools.testing", "test-interface") + exclude("org.scala-lang.modules", "scala-xml_2.13"), "com.fasterxml.jackson.core" % "jackson-databind" % jacksonV, "io.github.andrebeat" %% "scala-pool" % scalaPoolV ) ++ swaggerUiDependencies ++ akkaHttpDependencies ++ akkaHttpCirceIntegrationDependency ++ circeDependencies ++ From 8ae8c00634a105ad34cc33599afccd20cb532e71 Mon Sep 17 00:00:00 2001 From: Janet Gainer-Dewar Date: Fri, 14 Oct 2022 16:01:04 -0400 Subject: [PATCH 12/13] force ci From 1e22a2a4d5564de25b75123ae435fc35f2965106 Mon Sep 17 00:00:00 2001 From: Janet Gainer-Dewar Date: Sat, 15 Oct 2022 13:37:33 -0400 Subject: [PATCH 13/13] Back out changes to generated code --- .../java/wdl/draft2/parser/WdlParser.java | 226 +++++++------- .../java/wdl/biscayne/parser/WdlParser.java | 276 +++++++++--------- .../java/wdl/draft3/parser/WdlParser.java | 272 ++++++++--------- 3 files changed, 387 insertions(+), 387 deletions(-) diff --git a/wdl/model/draft2/src/main/java/wdl/draft2/parser/WdlParser.java b/wdl/model/draft2/src/main/java/wdl/draft2/parser/WdlParser.java index 03ded4131f6..70301d6691b 100644 --- a/wdl/model/draft2/src/main/java/wdl/draft2/parser/WdlParser.java +++ b/wdl/model/draft2/src/main/java/wdl/draft2/parser/WdlParser.java @@ -500,7 +500,7 @@ public static class WdlTerminalMap implements TerminalMap { id_to_term = new HashMap(); str_to_term = new HashMap(); for( WdlTerminalIdentifier terminal : terminals ) { - Integer id = terminal.id(); + Integer id = new Integer(terminal.id()); String str = terminal.string(); id_to_term.put(id, terminal); str_to_term.put(str, terminal); @@ -2199,118 +2199,118 @@ public enum WdlTerminalIdentifier implements TerminalIdentifier { } static { Map map = new HashMap(); - map.put(0, "$_gen0 = list($import)"); - map.put(1, "$_gen1 = list($workflow_or_task_or_decl)"); - map.put(39, "$_gen10 = list($wf_body_element)"); - map.put(49, "$_gen11 = $alias"); - map.put(50, "$_gen11 = :_empty"); - map.put(51, "$_gen12 = $call_body"); - map.put(52, "$_gen12 = :_empty"); - map.put(54, "$_gen13 = list($call_input)"); - map.put(56, "$_gen14 = list($mapping, :comma)"); - map.put(60, "$_gen15 = list($wf_output)"); - map.put(65, "$_gen16 = $wf_output_wildcard"); - map.put(66, "$_gen16 = :_empty"); - map.put(75, "$_gen17 = list($type_e, :comma)"); - map.put(96, "$_gen18 = list($e, :comma)"); - map.put(100, "$_gen19 = list($object_kv, :comma)"); - map.put(6, "$_gen2 = $import_namespace"); - map.put(7, "$_gen2 = :_empty"); - map.put(103, "$_gen20 = list($map_kv, :comma)"); - map.put(10, "$_gen3 = list($declaration)"); - map.put(11, "$_gen4 = list($sections)"); - map.put(18, "$_gen5 = list($command_part)"); - map.put(22, "$_gen6 = list($cmd_param_kv)"); - map.put(25, "$_gen7 = list($output_kv)"); - map.put(31, "$_gen8 = list($kv)"); - map.put(34, "$_gen9 = $setter"); - map.put(35, "$_gen9 = :_empty"); - map.put(59, "$alias = :as :identifier -> $1"); - map.put(53, "$call = :call :fqn $_gen11 $_gen12 -> Call( task=$1, alias=$2, body=$3 )"); - map.put(55, "$call_body = :lbrace $_gen3 $_gen13 :rbrace -> CallBody( declarations=$1, io=$2 )"); - map.put(57, "$call_input = :input :colon $_gen14 -> Inputs( map=$2 )"); - map.put(23, "$cmd_param = :cmd_param_start $_gen6 $e :cmd_param_end -> CommandParameter( attributes=$1, expr=$2 )"); - map.put(24, "$cmd_param_kv = :cmd_attr_hint :identifier :equal $e -> CommandParameterAttr( key=$1, value=$3 )"); - map.put(19, "$command = :raw_command :raw_cmd_start $_gen5 :raw_cmd_end -> RawCommand( parts=$2 )"); - map.put(21, "$command_part = $cmd_param"); - map.put(20, "$command_part = :cmd_part"); - map.put(36, "$declaration = $type_e :identifier $_gen9 -> Declaration( type=$0, name=$1, expression=$2 )"); - map.put(2, "$document = $_gen0 $_gen1 -> Namespace( imports=$0, body=$1 )"); - map.put(90, "$e = $e :asterisk $e -> Multiply( lhs=$0, rhs=$2 )"); - map.put(89, "$e = $e :dash $e -> Subtract( lhs=$0, rhs=$2 )"); - map.put(81, "$e = $e :double_ampersand $e -> LogicalAnd( lhs=$0, rhs=$2 )"); - map.put(82, "$e = $e :double_equal $e -> Equals( lhs=$0, rhs=$2 )"); - map.put(80, "$e = $e :double_pipe $e -> LogicalOr( lhs=$0, rhs=$2 )"); - map.put(86, "$e = $e :gt $e -> GreaterThan( lhs=$0, rhs=$2 )"); - map.put(87, "$e = $e :gteq $e -> GreaterThanOrEqual( lhs=$0, rhs=$2 )"); - map.put(84, "$e = $e :lt $e -> LessThan( lhs=$0, rhs=$2 )"); - map.put(85, "$e = $e :lteq $e -> LessThanOrEqual( lhs=$0, rhs=$2 )"); - map.put(83, "$e = $e :not_equal $e -> NotEquals( lhs=$0, rhs=$2 )"); - map.put(92, "$e = $e :percent $e -> Remainder( lhs=$0, rhs=$2 )"); - map.put(88, "$e = $e :plus $e -> Add( lhs=$0, rhs=$2 )"); - map.put(91, "$e = $e :slash $e -> Divide( lhs=$0, rhs=$2 )"); - map.put(109, "$e = :boolean"); - map.put(95, "$e = :dash $e -> UnaryNegation( expression=$1 )"); - map.put(111, "$e = :float"); - map.put(108, "$e = :identifier"); - map.put(99, "$e = :identifier <=> :dot :identifier -> MemberAccess( lhs=$0, rhs=$2 )"); - map.put(97, "$e = :identifier <=> :lparen $_gen18 :rparen -> FunctionCall( name=$0, params=$2 )"); - map.put(98, "$e = :identifier <=> :lsquare $e :rsquare -> ArrayOrMapLookup( lhs=$0, rhs=$2 )"); - map.put(106, "$e = :if $e :then $e :else $e -> TernaryIf( cond=$1, iftrue=$3, iffalse=$5 )"); - map.put(110, "$e = :integer"); - map.put(104, "$e = :lbrace $_gen20 :rbrace -> MapLiteral( map=$1 )"); - map.put(105, "$e = :lparen $_gen18 :rparen -> TupleLiteral( values=$1 )"); - map.put(102, "$e = :lsquare $_gen18 :rsquare -> ArrayLiteral( values=$1 )"); - map.put(93, "$e = :not $e -> LogicalNot( expression=$1 )"); - map.put(101, "$e = :object :lbrace $_gen19 :rbrace -> ObjectLiteral( map=$2 )"); - map.put(94, "$e = :plus $e -> UnaryPlus( expression=$1 )"); - map.put(107, "$e = :string"); - map.put(72, "$if_stmt = :if :lparen $e :rparen :lbrace $_gen10 :rbrace -> If( expression=$2, body=$5 )"); - map.put(8, "$import = :import :string $_gen2 -> Import( uri=$1, namespace=$2 )"); - map.put(9, "$import_namespace = :as :identifier -> $1"); - map.put(33, "$kv = :identifier :colon $e -> RuntimeAttribute( key=$0, value=$2 )"); - map.put(32, "$map = :lbrace $_gen8 :rbrace -> $1"); - map.put(38, "$map_kv = $e :colon $e -> MapLiteralKv( key=$0, value=$2 )"); - map.put(58, "$mapping = :identifier :equal $e -> IOMapping( key=$0, value=$2 )"); - map.put(30, "$meta = :meta $map -> Meta( map=$1 )"); - map.put(74, "$object_kv = :identifier :colon $e -> ObjectKV( key=$0, value=$2 )"); - map.put(27, "$output_kv = $type_e :identifier :equal $e -> Output( type=$0, name=$1, expression=$3 )"); - map.put(26, "$outputs = :output :lbrace $_gen7 :rbrace -> Outputs( attributes=$2 )"); - map.put(29, "$parameter_meta = :parameter_meta $map -> ParameterMeta( map=$1 )"); - map.put(28, "$runtime = :runtime $map -> Runtime( map=$1 )"); - map.put(73, "$scatter = :scatter :lparen :identifier :in $e :rparen :lbrace $_gen10 :rbrace -> Scatter( item=$2, collection=$4, body=$7 )"); - map.put(13, "$sections = $command"); - map.put(17, "$sections = $meta"); - map.put(14, "$sections = $outputs"); - map.put(16, "$sections = $parameter_meta"); - map.put(15, "$sections = $runtime"); - map.put(37, "$setter = :equal $e -> $1"); - map.put(12, "$task = :task :identifier :lbrace $_gen3 $_gen4 :rbrace -> Task( name=$1, declarations=$3, sections=$4 )"); - map.put(79, "$type_e = :type"); - map.put(76, "$type_e = :type <=> :lsquare $_gen17 :rsquare -> Type( name=$0, subtype=$2 )"); - map.put(78, "$type_e = :type <=> :plus -> NonEmptyType( innerType=$0 )"); - map.put(77, "$type_e = :type <=> :qmark -> OptionalType( innerType=$0 )"); - map.put(41, "$wf_body_element = $call"); - map.put(42, "$wf_body_element = $declaration"); - map.put(44, "$wf_body_element = $if_stmt"); - map.put(45, "$wf_body_element = $scatter"); - map.put(48, "$wf_body_element = $wf_meta"); - map.put(46, "$wf_body_element = $wf_outputs"); - map.put(47, "$wf_body_element = $wf_parameter_meta"); - map.put(43, "$wf_body_element = $while_loop"); - map.put(70, "$wf_meta = :meta $map -> Meta( map=$1 )"); - map.put(62, "$wf_output = $wf_output_declaration_syntax"); - map.put(63, "$wf_output = $wf_output_wildcard_syntax"); - map.put(64, "$wf_output_declaration_syntax = $type_e :identifier :equal $e -> WorkflowOutputDeclaration( type=$0, name=$1, expression=$3 )"); - map.put(68, "$wf_output_wildcard = :dot :asterisk -> $1"); - map.put(67, "$wf_output_wildcard_syntax = :fqn $_gen16 -> WorkflowOutputWildcard( fqn=$0, wildcard=$1 )"); - map.put(61, "$wf_outputs = :output :lbrace $_gen15 :rbrace -> WorkflowOutputs( outputs=$2 )"); - map.put(69, "$wf_parameter_meta = :parameter_meta $map -> ParameterMeta( map=$1 )"); - map.put(71, "$while_loop = :while :lparen $e :rparen :lbrace $_gen10 :rbrace -> WhileLoop( expression=$2, body=$5 )"); - map.put(40, "$workflow = :workflow :identifier :lbrace $_gen10 :rbrace -> Workflow( name=$1, body=$3 )"); - map.put(5, "$workflow_or_task_or_decl = $declaration"); - map.put(4, "$workflow_or_task_or_decl = $task"); - map.put(3, "$workflow_or_task_or_decl = $workflow"); + map.put(new Integer(0), "$_gen0 = list($import)"); + map.put(new Integer(1), "$_gen1 = list($workflow_or_task_or_decl)"); + map.put(new Integer(39), "$_gen10 = list($wf_body_element)"); + map.put(new Integer(49), "$_gen11 = $alias"); + map.put(new Integer(50), "$_gen11 = :_empty"); + map.put(new Integer(51), "$_gen12 = $call_body"); + map.put(new Integer(52), "$_gen12 = :_empty"); + map.put(new Integer(54), "$_gen13 = list($call_input)"); + map.put(new Integer(56), "$_gen14 = list($mapping, :comma)"); + map.put(new Integer(60), "$_gen15 = list($wf_output)"); + map.put(new Integer(65), "$_gen16 = $wf_output_wildcard"); + map.put(new Integer(66), "$_gen16 = :_empty"); + map.put(new Integer(75), "$_gen17 = list($type_e, :comma)"); + map.put(new Integer(96), "$_gen18 = list($e, :comma)"); + map.put(new Integer(100), "$_gen19 = list($object_kv, :comma)"); + map.put(new Integer(6), "$_gen2 = $import_namespace"); + map.put(new Integer(7), "$_gen2 = :_empty"); + map.put(new Integer(103), "$_gen20 = list($map_kv, :comma)"); + map.put(new Integer(10), "$_gen3 = list($declaration)"); + map.put(new Integer(11), "$_gen4 = list($sections)"); + map.put(new Integer(18), "$_gen5 = list($command_part)"); + map.put(new Integer(22), "$_gen6 = list($cmd_param_kv)"); + map.put(new Integer(25), "$_gen7 = list($output_kv)"); + map.put(new Integer(31), "$_gen8 = list($kv)"); + map.put(new Integer(34), "$_gen9 = $setter"); + map.put(new Integer(35), "$_gen9 = :_empty"); + map.put(new Integer(59), "$alias = :as :identifier -> $1"); + map.put(new Integer(53), "$call = :call :fqn $_gen11 $_gen12 -> Call( task=$1, alias=$2, body=$3 )"); + map.put(new Integer(55), "$call_body = :lbrace $_gen3 $_gen13 :rbrace -> CallBody( declarations=$1, io=$2 )"); + map.put(new Integer(57), "$call_input = :input :colon $_gen14 -> Inputs( map=$2 )"); + map.put(new Integer(23), "$cmd_param = :cmd_param_start $_gen6 $e :cmd_param_end -> CommandParameter( attributes=$1, expr=$2 )"); + map.put(new Integer(24), "$cmd_param_kv = :cmd_attr_hint :identifier :equal $e -> CommandParameterAttr( key=$1, value=$3 )"); + map.put(new Integer(19), "$command = :raw_command :raw_cmd_start $_gen5 :raw_cmd_end -> RawCommand( parts=$2 )"); + map.put(new Integer(21), "$command_part = $cmd_param"); + map.put(new Integer(20), "$command_part = :cmd_part"); + map.put(new Integer(36), "$declaration = $type_e :identifier $_gen9 -> Declaration( type=$0, name=$1, expression=$2 )"); + map.put(new Integer(2), "$document = $_gen0 $_gen1 -> Namespace( imports=$0, body=$1 )"); + map.put(new Integer(90), "$e = $e :asterisk $e -> Multiply( lhs=$0, rhs=$2 )"); + map.put(new Integer(89), "$e = $e :dash $e -> Subtract( lhs=$0, rhs=$2 )"); + map.put(new Integer(81), "$e = $e :double_ampersand $e -> LogicalAnd( lhs=$0, rhs=$2 )"); + map.put(new Integer(82), "$e = $e :double_equal $e -> Equals( lhs=$0, rhs=$2 )"); + map.put(new Integer(80), "$e = $e :double_pipe $e -> LogicalOr( lhs=$0, rhs=$2 )"); + map.put(new Integer(86), "$e = $e :gt $e -> GreaterThan( lhs=$0, rhs=$2 )"); + map.put(new Integer(87), "$e = $e :gteq $e -> GreaterThanOrEqual( lhs=$0, rhs=$2 )"); + map.put(new Integer(84), "$e = $e :lt $e -> LessThan( lhs=$0, rhs=$2 )"); + map.put(new Integer(85), "$e = $e :lteq $e -> LessThanOrEqual( lhs=$0, rhs=$2 )"); + map.put(new Integer(83), "$e = $e :not_equal $e -> NotEquals( lhs=$0, rhs=$2 )"); + map.put(new Integer(92), "$e = $e :percent $e -> Remainder( lhs=$0, rhs=$2 )"); + map.put(new Integer(88), "$e = $e :plus $e -> Add( lhs=$0, rhs=$2 )"); + map.put(new Integer(91), "$e = $e :slash $e -> Divide( lhs=$0, rhs=$2 )"); + map.put(new Integer(109), "$e = :boolean"); + map.put(new Integer(95), "$e = :dash $e -> UnaryNegation( expression=$1 )"); + map.put(new Integer(111), "$e = :float"); + map.put(new Integer(108), "$e = :identifier"); + map.put(new Integer(99), "$e = :identifier <=> :dot :identifier -> MemberAccess( lhs=$0, rhs=$2 )"); + map.put(new Integer(97), "$e = :identifier <=> :lparen $_gen18 :rparen -> FunctionCall( name=$0, params=$2 )"); + map.put(new Integer(98), "$e = :identifier <=> :lsquare $e :rsquare -> ArrayOrMapLookup( lhs=$0, rhs=$2 )"); + map.put(new Integer(106), "$e = :if $e :then $e :else $e -> TernaryIf( cond=$1, iftrue=$3, iffalse=$5 )"); + map.put(new Integer(110), "$e = :integer"); + map.put(new Integer(104), "$e = :lbrace $_gen20 :rbrace -> MapLiteral( map=$1 )"); + map.put(new Integer(105), "$e = :lparen $_gen18 :rparen -> TupleLiteral( values=$1 )"); + map.put(new Integer(102), "$e = :lsquare $_gen18 :rsquare -> ArrayLiteral( values=$1 )"); + map.put(new Integer(93), "$e = :not $e -> LogicalNot( expression=$1 )"); + map.put(new Integer(101), "$e = :object :lbrace $_gen19 :rbrace -> ObjectLiteral( map=$2 )"); + map.put(new Integer(94), "$e = :plus $e -> UnaryPlus( expression=$1 )"); + map.put(new Integer(107), "$e = :string"); + map.put(new Integer(72), "$if_stmt = :if :lparen $e :rparen :lbrace $_gen10 :rbrace -> If( expression=$2, body=$5 )"); + map.put(new Integer(8), "$import = :import :string $_gen2 -> Import( uri=$1, namespace=$2 )"); + map.put(new Integer(9), "$import_namespace = :as :identifier -> $1"); + map.put(new Integer(33), "$kv = :identifier :colon $e -> RuntimeAttribute( key=$0, value=$2 )"); + map.put(new Integer(32), "$map = :lbrace $_gen8 :rbrace -> $1"); + map.put(new Integer(38), "$map_kv = $e :colon $e -> MapLiteralKv( key=$0, value=$2 )"); + map.put(new Integer(58), "$mapping = :identifier :equal $e -> IOMapping( key=$0, value=$2 )"); + map.put(new Integer(30), "$meta = :meta $map -> Meta( map=$1 )"); + map.put(new Integer(74), "$object_kv = :identifier :colon $e -> ObjectKV( key=$0, value=$2 )"); + map.put(new Integer(27), "$output_kv = $type_e :identifier :equal $e -> Output( type=$0, name=$1, expression=$3 )"); + map.put(new Integer(26), "$outputs = :output :lbrace $_gen7 :rbrace -> Outputs( attributes=$2 )"); + map.put(new Integer(29), "$parameter_meta = :parameter_meta $map -> ParameterMeta( map=$1 )"); + map.put(new Integer(28), "$runtime = :runtime $map -> Runtime( map=$1 )"); + map.put(new Integer(73), "$scatter = :scatter :lparen :identifier :in $e :rparen :lbrace $_gen10 :rbrace -> Scatter( item=$2, collection=$4, body=$7 )"); + map.put(new Integer(13), "$sections = $command"); + map.put(new Integer(17), "$sections = $meta"); + map.put(new Integer(14), "$sections = $outputs"); + map.put(new Integer(16), "$sections = $parameter_meta"); + map.put(new Integer(15), "$sections = $runtime"); + map.put(new Integer(37), "$setter = :equal $e -> $1"); + map.put(new Integer(12), "$task = :task :identifier :lbrace $_gen3 $_gen4 :rbrace -> Task( name=$1, declarations=$3, sections=$4 )"); + map.put(new Integer(79), "$type_e = :type"); + map.put(new Integer(76), "$type_e = :type <=> :lsquare $_gen17 :rsquare -> Type( name=$0, subtype=$2 )"); + map.put(new Integer(78), "$type_e = :type <=> :plus -> NonEmptyType( innerType=$0 )"); + map.put(new Integer(77), "$type_e = :type <=> :qmark -> OptionalType( innerType=$0 )"); + map.put(new Integer(41), "$wf_body_element = $call"); + map.put(new Integer(42), "$wf_body_element = $declaration"); + map.put(new Integer(44), "$wf_body_element = $if_stmt"); + map.put(new Integer(45), "$wf_body_element = $scatter"); + map.put(new Integer(48), "$wf_body_element = $wf_meta"); + map.put(new Integer(46), "$wf_body_element = $wf_outputs"); + map.put(new Integer(47), "$wf_body_element = $wf_parameter_meta"); + map.put(new Integer(43), "$wf_body_element = $while_loop"); + map.put(new Integer(70), "$wf_meta = :meta $map -> Meta( map=$1 )"); + map.put(new Integer(62), "$wf_output = $wf_output_declaration_syntax"); + map.put(new Integer(63), "$wf_output = $wf_output_wildcard_syntax"); + map.put(new Integer(64), "$wf_output_declaration_syntax = $type_e :identifier :equal $e -> WorkflowOutputDeclaration( type=$0, name=$1, expression=$3 )"); + map.put(new Integer(68), "$wf_output_wildcard = :dot :asterisk -> $1"); + map.put(new Integer(67), "$wf_output_wildcard_syntax = :fqn $_gen16 -> WorkflowOutputWildcard( fqn=$0, wildcard=$1 )"); + map.put(new Integer(61), "$wf_outputs = :output :lbrace $_gen15 :rbrace -> WorkflowOutputs( outputs=$2 )"); + map.put(new Integer(69), "$wf_parameter_meta = :parameter_meta $map -> ParameterMeta( map=$1 )"); + map.put(new Integer(71), "$while_loop = :while :lparen $e :rparen :lbrace $_gen10 :rbrace -> WhileLoop( expression=$2, body=$5 )"); + map.put(new Integer(40), "$workflow = :workflow :identifier :lbrace $_gen10 :rbrace -> Workflow( name=$1, body=$3 )"); + map.put(new Integer(5), "$workflow_or_task_or_decl = $declaration"); + map.put(new Integer(4), "$workflow_or_task_or_decl = $task"); + map.put(new Integer(3), "$workflow_or_task_or_decl = $workflow"); rules = Collections.unmodifiableMap(map); } public static boolean is_terminal(int id) { diff --git a/wdl/transforms/biscayne/src/main/java/wdl/biscayne/parser/WdlParser.java b/wdl/transforms/biscayne/src/main/java/wdl/biscayne/parser/WdlParser.java index 62d64e1d409..b1274ba6237 100644 --- a/wdl/transforms/biscayne/src/main/java/wdl/biscayne/parser/WdlParser.java +++ b/wdl/transforms/biscayne/src/main/java/wdl/biscayne/parser/WdlParser.java @@ -500,7 +500,7 @@ public static class WdlTerminalMap implements TerminalMap { id_to_term = new HashMap(); str_to_term = new HashMap(); for( WdlTerminalIdentifier terminal : terminals ) { - Integer id = terminal.id(); + Integer id = new Integer(terminal.id()); String str = terminal.string(); id_to_term.put(id, terminal); str_to_term.put(str, terminal); @@ -2623,143 +2623,143 @@ public enum WdlTerminalIdentifier implements TerminalIdentifier { } static { Map map = new HashMap(); - map.put(0, "$_gen0 = list($import)"); - map.put(1, "$_gen1 = list($file_body_element)"); - map.put(40, "$_gen10 = list($input_declaration)"); - map.put(43, "$_gen11 = list($kv)"); - map.put(48, "$_gen12 = list($meta_kv)"); - map.put(51, "$_gen13 = $setter"); - map.put(52, "$_gen13 = :_empty"); - map.put(57, "$_gen14 = list($output_kv)"); - map.put(60, "$_gen15 = list($wf_body_element)"); - map.put(70, "$_gen16 = $alias"); - map.put(71, "$_gen16 = :_empty"); - map.put(72, "$_gen17 = list($call_after)"); - map.put(73, "$_gen18 = $call_brace_block"); - map.put(74, "$_gen18 = :_empty"); - map.put(76, "$_gen19 = $call_body"); - map.put(77, "$_gen19 = :_empty"); - map.put(7, "$_gen2 = list($struct_declaration)"); - map.put(79, "$_gen20 = list($input_kv, :comma)"); - map.put(94, "$_gen21 = list($meta_value, :comma)"); - map.put(96, "$_gen22 = list($meta_kv, :comma)"); - map.put(98, "$_gen23 = list($type_e, :comma)"); - map.put(120, "$_gen24 = list($e, :comma)"); - map.put(124, "$_gen25 = list($object_kv, :comma)"); - map.put(127, "$_gen26 = list($map_kv, :comma)"); - map.put(10, "$_gen3 = list($static_string_piece)"); - map.put(12, "$_gen4 = list($string_piece)"); - map.put(18, "$_gen5 = $import_namespace"); - map.put(19, "$_gen5 = :_empty"); - map.put(20, "$_gen6 = list($import_alias)"); - map.put(24, "$_gen7 = list($task_sections)"); - map.put(33, "$_gen8 = list($command_part)"); - map.put(37, "$_gen9 = list($expression_placeholder_kv)"); - map.put(81, "$alias = :as :identifier -> $1"); - map.put(75, "$call = :call :fqn $_gen16 $_gen17 $_gen18 -> Call( task=$1, alias=$2, after=$3, body=$4 )"); - map.put(82, "$call_after = :after :identifier -> $1"); - map.put(80, "$call_body = :input :colon $_gen20 -> CallBody( inputs=$2 )"); - map.put(78, "$call_brace_block = :lbrace $_gen19 :rbrace -> $1"); - map.put(34, "$command = :raw_command :raw_cmd_start $_gen8 :raw_cmd_end -> RawCommand( parts=$2 )"); - map.put(36, "$command_part = $expression_placeholder"); - map.put(35, "$command_part = :cmd_part"); - map.put(54, "$declaration = $type_e :identifier $setter -> Declaration( type=$0, name=$1, expression=$2 )"); - map.put(2, "$document = $version $_gen0 $_gen1 -> Draft3File( version=$0, imports=$1, body=$2 )"); - map.put(114, "$e = $e :asterisk $e -> Multiply( lhs=$0, rhs=$2 )"); - map.put(113, "$e = $e :dash $e -> Subtract( lhs=$0, rhs=$2 )"); - map.put(105, "$e = $e :double_ampersand $e -> LogicalAnd( lhs=$0, rhs=$2 )"); - map.put(106, "$e = $e :double_equal $e -> Equals( lhs=$0, rhs=$2 )"); - map.put(104, "$e = $e :double_pipe $e -> LogicalOr( lhs=$0, rhs=$2 )"); - map.put(110, "$e = $e :gt $e -> GreaterThan( lhs=$0, rhs=$2 )"); - map.put(111, "$e = $e :gteq $e -> GreaterThanOrEqual( lhs=$0, rhs=$2 )"); - map.put(108, "$e = $e :lt $e -> LessThan( lhs=$0, rhs=$2 )"); - map.put(109, "$e = $e :lteq $e -> LessThanOrEqual( lhs=$0, rhs=$2 )"); - map.put(107, "$e = $e :not_equal $e -> NotEquals( lhs=$0, rhs=$2 )"); - map.put(116, "$e = $e :percent $e -> Remainder( lhs=$0, rhs=$2 )"); - map.put(112, "$e = $e :plus $e -> Add( lhs=$0, rhs=$2 )"); - map.put(115, "$e = $e :slash $e -> Divide( lhs=$0, rhs=$2 )"); - map.put(123, "$e = $e <=> :dot :identifier -> MemberAccess( value=$0, member=$2 )"); - map.put(122, "$e = $e <=> :lsquare $e :rsquare -> ArrayOrMapLookup( lhs=$0, rhs=$2 )"); - map.put(131, "$e = $string_literal"); - map.put(133, "$e = :boolean"); - map.put(119, "$e = :dash $e -> UnaryNegation( expression=$1 )"); - map.put(135, "$e = :float"); - map.put(132, "$e = :identifier"); - map.put(121, "$e = :identifier <=> :lparen $_gen24 :rparen -> FunctionCall( name=$0, params=$2 )"); - map.put(130, "$e = :if $e :then $e :else $e -> TernaryIf( cond=$1, iftrue=$3, iffalse=$5 )"); - map.put(134, "$e = :integer"); - map.put(128, "$e = :lbrace $_gen26 :rbrace -> MapLiteral( map=$1 )"); - map.put(129, "$e = :lparen $_gen24 :rparen -> TupleLiteral( values=$1 )"); - map.put(126, "$e = :lsquare $_gen24 :rsquare -> ArrayLiteral( values=$1 )"); - map.put(136, "$e = :none"); - map.put(117, "$e = :not $e -> LogicalNot( expression=$1 )"); - map.put(125, "$e = :object :lbrace $_gen25 :rbrace -> ObjectLiteral( map=$2 )"); - map.put(118, "$e = :plus $e -> UnaryPlus( expression=$1 )"); - map.put(38, "$expression_placeholder = :expression_placeholder_start $_gen9 $e :expression_placeholder_end -> ExpressionPlaceholder( attributes=$1, expr=$2 )"); - map.put(39, "$expression_placeholder_kv = :cmd_attr_hint :identifier :equal $e -> ExpressionPlaceholderAttr( key=$1, value=$3 )"); - map.put(5, "$file_body_element = $struct"); - map.put(4, "$file_body_element = $task"); - map.put(3, "$file_body_element = $workflow"); - map.put(85, "$if_stmt = :if :lparen $e :rparen :lbrace $_gen15 :rbrace -> If( expression=$2, body=$5 )"); - map.put(21, "$import = :import $static_string $_gen5 $_gen6 -> Import( uri=$1, namespace=$2, aliases=$3 )"); - map.put(23, "$import_alias = :alias :identifier :as :identifier -> ImportAlias( old_name=$1, new_name=$3 )"); - map.put(22, "$import_namespace = :as :identifier -> $1"); - map.put(53, "$input_declaration = $type_e :identifier $_gen13 -> InputDeclaration( type=$0, name=$1, expression=$2 )"); - map.put(88, "$input_kv = :identifier :equal $e -> ObjectKV( key=$0, value=$2 )"); - map.put(41, "$inputs = :input :lbrace $_gen10 :rbrace -> Inputs( inputs=$2 )"); - map.put(45, "$kv = :identifier :colon $e -> RuntimeAttribute( key=$0, value=$2 )"); - map.put(56, "$map_kv = $e :colon $e -> MapLiteralKv( key=$0, value=$2 )"); - map.put(46, "$meta = :meta $meta_map -> Meta( map=$1 )"); - map.put(50, "$meta_kv = :identifier :colon $meta_value -> MetaKvPair( key=$0, value=$2 )"); - map.put(49, "$meta_map = :lbrace $_gen12 :rbrace -> $1"); - map.put(89, "$meta_value = $static_string"); - map.put(90, "$meta_value = :boolean"); - map.put(92, "$meta_value = :float"); - map.put(91, "$meta_value = :integer"); - map.put(97, "$meta_value = :lbrace $_gen22 :rbrace -> MetaObject( map=$1 )"); - map.put(95, "$meta_value = :lsquare $_gen21 :rsquare -> MetaArray( values=$1 )"); - map.put(93, "$meta_value = :null"); - map.put(87, "$object_kv = :identifier :colon $e -> ObjectKV( key=$0, value=$2 )"); - map.put(59, "$output_kv = $type_e :identifier :equal $e -> Output( type=$0, name=$1, expression=$3 )"); - map.put(58, "$outputs = :output :lbrace $_gen14 :rbrace -> Outputs( outputs=$2 )"); - map.put(47, "$parameter_meta = :parameter_meta $meta_map -> ParameterMeta( map=$1 )"); - map.put(44, "$rt_map = :lbrace $_gen11 :rbrace -> $1"); - map.put(42, "$runtime = :runtime $rt_map -> Runtime( map=$1 )"); - map.put(86, "$scatter = :scatter :lparen :identifier :in $e :rparen :lbrace $_gen15 :rbrace -> Scatter( item=$2, collection=$4, body=$7 )"); - map.put(55, "$setter = :equal $e -> $1"); - map.put(11, "$static_string = :quote $_gen3 :quote -> StaticString( value=$1 )"); - map.put(15, "$static_string_piece = :escape"); - map.put(14, "$static_string_piece = :string"); - map.put(13, "$string_literal = :quote $_gen4 :quote -> StringLiteral( pieces=$1 )"); - map.put(17, "$string_piece = $expression_placeholder"); - map.put(16, "$string_piece = $static_string_piece"); - map.put(8, "$struct = :struct :identifier :lbrace $_gen2 :rbrace -> Struct( name=$1, entries=$3 )"); - map.put(9, "$struct_declaration = $type_e :identifier -> StructEntry( type=$0, name=$1 )"); - map.put(25, "$task = :task :identifier :lbrace $_gen7 :rbrace -> Task( name=$1, sections=$3 )"); - map.put(26, "$task_sections = $command"); - map.put(32, "$task_sections = $declaration"); - map.put(27, "$task_sections = $inputs"); - map.put(31, "$task_sections = $meta"); - map.put(28, "$task_sections = $outputs"); - map.put(30, "$task_sections = $parameter_meta"); - map.put(29, "$task_sections = $runtime"); - map.put(103, "$type_e = :identifier"); - map.put(102, "$type_e = :type"); - map.put(99, "$type_e = :type <=> :lsquare $_gen23 :rsquare -> Type( name=$0, subtype=$2 )"); - map.put(101, "$type_e = :type <=> :plus -> NonEmptyType( innerType=$0 )"); - map.put(100, "$type_e = :type <=> :qmark -> OptionalType( innerType=$0 )"); - map.put(6, "$version = :version :version_name -> VersionDeclaration( v=$1 )"); - map.put(62, "$wf_body_element = $call"); - map.put(63, "$wf_body_element = $declaration"); - map.put(64, "$wf_body_element = $if_stmt"); - map.put(66, "$wf_body_element = $inputs"); - map.put(67, "$wf_body_element = $outputs"); - map.put(65, "$wf_body_element = $scatter"); - map.put(69, "$wf_body_element = $wf_meta"); - map.put(68, "$wf_body_element = $wf_parameter_meta"); - map.put(84, "$wf_meta = :meta $meta_map -> Meta( map=$1 )"); - map.put(83, "$wf_parameter_meta = :parameter_meta $meta_map -> ParameterMeta( map=$1 )"); - map.put(61, "$workflow = :workflow :identifier :lbrace $_gen15 :rbrace -> Workflow( name=$1, body=$3 )"); + map.put(new Integer(0), "$_gen0 = list($import)"); + map.put(new Integer(1), "$_gen1 = list($file_body_element)"); + map.put(new Integer(40), "$_gen10 = list($input_declaration)"); + map.put(new Integer(43), "$_gen11 = list($kv)"); + map.put(new Integer(48), "$_gen12 = list($meta_kv)"); + map.put(new Integer(51), "$_gen13 = $setter"); + map.put(new Integer(52), "$_gen13 = :_empty"); + map.put(new Integer(57), "$_gen14 = list($output_kv)"); + map.put(new Integer(60), "$_gen15 = list($wf_body_element)"); + map.put(new Integer(70), "$_gen16 = $alias"); + map.put(new Integer(71), "$_gen16 = :_empty"); + map.put(new Integer(72), "$_gen17 = list($call_after)"); + map.put(new Integer(73), "$_gen18 = $call_brace_block"); + map.put(new Integer(74), "$_gen18 = :_empty"); + map.put(new Integer(76), "$_gen19 = $call_body"); + map.put(new Integer(77), "$_gen19 = :_empty"); + map.put(new Integer(7), "$_gen2 = list($struct_declaration)"); + map.put(new Integer(79), "$_gen20 = list($input_kv, :comma)"); + map.put(new Integer(94), "$_gen21 = list($meta_value, :comma)"); + map.put(new Integer(96), "$_gen22 = list($meta_kv, :comma)"); + map.put(new Integer(98), "$_gen23 = list($type_e, :comma)"); + map.put(new Integer(120), "$_gen24 = list($e, :comma)"); + map.put(new Integer(124), "$_gen25 = list($object_kv, :comma)"); + map.put(new Integer(127), "$_gen26 = list($map_kv, :comma)"); + map.put(new Integer(10), "$_gen3 = list($static_string_piece)"); + map.put(new Integer(12), "$_gen4 = list($string_piece)"); + map.put(new Integer(18), "$_gen5 = $import_namespace"); + map.put(new Integer(19), "$_gen5 = :_empty"); + map.put(new Integer(20), "$_gen6 = list($import_alias)"); + map.put(new Integer(24), "$_gen7 = list($task_sections)"); + map.put(new Integer(33), "$_gen8 = list($command_part)"); + map.put(new Integer(37), "$_gen9 = list($expression_placeholder_kv)"); + map.put(new Integer(81), "$alias = :as :identifier -> $1"); + map.put(new Integer(75), "$call = :call :fqn $_gen16 $_gen17 $_gen18 -> Call( task=$1, alias=$2, after=$3, body=$4 )"); + map.put(new Integer(82), "$call_after = :after :identifier -> $1"); + map.put(new Integer(80), "$call_body = :input :colon $_gen20 -> CallBody( inputs=$2 )"); + map.put(new Integer(78), "$call_brace_block = :lbrace $_gen19 :rbrace -> $1"); + map.put(new Integer(34), "$command = :raw_command :raw_cmd_start $_gen8 :raw_cmd_end -> RawCommand( parts=$2 )"); + map.put(new Integer(36), "$command_part = $expression_placeholder"); + map.put(new Integer(35), "$command_part = :cmd_part"); + map.put(new Integer(54), "$declaration = $type_e :identifier $setter -> Declaration( type=$0, name=$1, expression=$2 )"); + map.put(new Integer(2), "$document = $version $_gen0 $_gen1 -> Draft3File( version=$0, imports=$1, body=$2 )"); + map.put(new Integer(114), "$e = $e :asterisk $e -> Multiply( lhs=$0, rhs=$2 )"); + map.put(new Integer(113), "$e = $e :dash $e -> Subtract( lhs=$0, rhs=$2 )"); + map.put(new Integer(105), "$e = $e :double_ampersand $e -> LogicalAnd( lhs=$0, rhs=$2 )"); + map.put(new Integer(106), "$e = $e :double_equal $e -> Equals( lhs=$0, rhs=$2 )"); + map.put(new Integer(104), "$e = $e :double_pipe $e -> LogicalOr( lhs=$0, rhs=$2 )"); + map.put(new Integer(110), "$e = $e :gt $e -> GreaterThan( lhs=$0, rhs=$2 )"); + map.put(new Integer(111), "$e = $e :gteq $e -> GreaterThanOrEqual( lhs=$0, rhs=$2 )"); + map.put(new Integer(108), "$e = $e :lt $e -> LessThan( lhs=$0, rhs=$2 )"); + map.put(new Integer(109), "$e = $e :lteq $e -> LessThanOrEqual( lhs=$0, rhs=$2 )"); + map.put(new Integer(107), "$e = $e :not_equal $e -> NotEquals( lhs=$0, rhs=$2 )"); + map.put(new Integer(116), "$e = $e :percent $e -> Remainder( lhs=$0, rhs=$2 )"); + map.put(new Integer(112), "$e = $e :plus $e -> Add( lhs=$0, rhs=$2 )"); + map.put(new Integer(115), "$e = $e :slash $e -> Divide( lhs=$0, rhs=$2 )"); + map.put(new Integer(123), "$e = $e <=> :dot :identifier -> MemberAccess( value=$0, member=$2 )"); + map.put(new Integer(122), "$e = $e <=> :lsquare $e :rsquare -> ArrayOrMapLookup( lhs=$0, rhs=$2 )"); + map.put(new Integer(131), "$e = $string_literal"); + map.put(new Integer(133), "$e = :boolean"); + map.put(new Integer(119), "$e = :dash $e -> UnaryNegation( expression=$1 )"); + map.put(new Integer(135), "$e = :float"); + map.put(new Integer(132), "$e = :identifier"); + map.put(new Integer(121), "$e = :identifier <=> :lparen $_gen24 :rparen -> FunctionCall( name=$0, params=$2 )"); + map.put(new Integer(130), "$e = :if $e :then $e :else $e -> TernaryIf( cond=$1, iftrue=$3, iffalse=$5 )"); + map.put(new Integer(134), "$e = :integer"); + map.put(new Integer(128), "$e = :lbrace $_gen26 :rbrace -> MapLiteral( map=$1 )"); + map.put(new Integer(129), "$e = :lparen $_gen24 :rparen -> TupleLiteral( values=$1 )"); + map.put(new Integer(126), "$e = :lsquare $_gen24 :rsquare -> ArrayLiteral( values=$1 )"); + map.put(new Integer(136), "$e = :none"); + map.put(new Integer(117), "$e = :not $e -> LogicalNot( expression=$1 )"); + map.put(new Integer(125), "$e = :object :lbrace $_gen25 :rbrace -> ObjectLiteral( map=$2 )"); + map.put(new Integer(118), "$e = :plus $e -> UnaryPlus( expression=$1 )"); + map.put(new Integer(38), "$expression_placeholder = :expression_placeholder_start $_gen9 $e :expression_placeholder_end -> ExpressionPlaceholder( attributes=$1, expr=$2 )"); + map.put(new Integer(39), "$expression_placeholder_kv = :cmd_attr_hint :identifier :equal $e -> ExpressionPlaceholderAttr( key=$1, value=$3 )"); + map.put(new Integer(5), "$file_body_element = $struct"); + map.put(new Integer(4), "$file_body_element = $task"); + map.put(new Integer(3), "$file_body_element = $workflow"); + map.put(new Integer(85), "$if_stmt = :if :lparen $e :rparen :lbrace $_gen15 :rbrace -> If( expression=$2, body=$5 )"); + map.put(new Integer(21), "$import = :import $static_string $_gen5 $_gen6 -> Import( uri=$1, namespace=$2, aliases=$3 )"); + map.put(new Integer(23), "$import_alias = :alias :identifier :as :identifier -> ImportAlias( old_name=$1, new_name=$3 )"); + map.put(new Integer(22), "$import_namespace = :as :identifier -> $1"); + map.put(new Integer(53), "$input_declaration = $type_e :identifier $_gen13 -> InputDeclaration( type=$0, name=$1, expression=$2 )"); + map.put(new Integer(88), "$input_kv = :identifier :equal $e -> ObjectKV( key=$0, value=$2 )"); + map.put(new Integer(41), "$inputs = :input :lbrace $_gen10 :rbrace -> Inputs( inputs=$2 )"); + map.put(new Integer(45), "$kv = :identifier :colon $e -> RuntimeAttribute( key=$0, value=$2 )"); + map.put(new Integer(56), "$map_kv = $e :colon $e -> MapLiteralKv( key=$0, value=$2 )"); + map.put(new Integer(46), "$meta = :meta $meta_map -> Meta( map=$1 )"); + map.put(new Integer(50), "$meta_kv = :identifier :colon $meta_value -> MetaKvPair( key=$0, value=$2 )"); + map.put(new Integer(49), "$meta_map = :lbrace $_gen12 :rbrace -> $1"); + map.put(new Integer(89), "$meta_value = $static_string"); + map.put(new Integer(90), "$meta_value = :boolean"); + map.put(new Integer(92), "$meta_value = :float"); + map.put(new Integer(91), "$meta_value = :integer"); + map.put(new Integer(97), "$meta_value = :lbrace $_gen22 :rbrace -> MetaObject( map=$1 )"); + map.put(new Integer(95), "$meta_value = :lsquare $_gen21 :rsquare -> MetaArray( values=$1 )"); + map.put(new Integer(93), "$meta_value = :null"); + map.put(new Integer(87), "$object_kv = :identifier :colon $e -> ObjectKV( key=$0, value=$2 )"); + map.put(new Integer(59), "$output_kv = $type_e :identifier :equal $e -> Output( type=$0, name=$1, expression=$3 )"); + map.put(new Integer(58), "$outputs = :output :lbrace $_gen14 :rbrace -> Outputs( outputs=$2 )"); + map.put(new Integer(47), "$parameter_meta = :parameter_meta $meta_map -> ParameterMeta( map=$1 )"); + map.put(new Integer(44), "$rt_map = :lbrace $_gen11 :rbrace -> $1"); + map.put(new Integer(42), "$runtime = :runtime $rt_map -> Runtime( map=$1 )"); + map.put(new Integer(86), "$scatter = :scatter :lparen :identifier :in $e :rparen :lbrace $_gen15 :rbrace -> Scatter( item=$2, collection=$4, body=$7 )"); + map.put(new Integer(55), "$setter = :equal $e -> $1"); + map.put(new Integer(11), "$static_string = :quote $_gen3 :quote -> StaticString( value=$1 )"); + map.put(new Integer(15), "$static_string_piece = :escape"); + map.put(new Integer(14), "$static_string_piece = :string"); + map.put(new Integer(13), "$string_literal = :quote $_gen4 :quote -> StringLiteral( pieces=$1 )"); + map.put(new Integer(17), "$string_piece = $expression_placeholder"); + map.put(new Integer(16), "$string_piece = $static_string_piece"); + map.put(new Integer(8), "$struct = :struct :identifier :lbrace $_gen2 :rbrace -> Struct( name=$1, entries=$3 )"); + map.put(new Integer(9), "$struct_declaration = $type_e :identifier -> StructEntry( type=$0, name=$1 )"); + map.put(new Integer(25), "$task = :task :identifier :lbrace $_gen7 :rbrace -> Task( name=$1, sections=$3 )"); + map.put(new Integer(26), "$task_sections = $command"); + map.put(new Integer(32), "$task_sections = $declaration"); + map.put(new Integer(27), "$task_sections = $inputs"); + map.put(new Integer(31), "$task_sections = $meta"); + map.put(new Integer(28), "$task_sections = $outputs"); + map.put(new Integer(30), "$task_sections = $parameter_meta"); + map.put(new Integer(29), "$task_sections = $runtime"); + map.put(new Integer(103), "$type_e = :identifier"); + map.put(new Integer(102), "$type_e = :type"); + map.put(new Integer(99), "$type_e = :type <=> :lsquare $_gen23 :rsquare -> Type( name=$0, subtype=$2 )"); + map.put(new Integer(101), "$type_e = :type <=> :plus -> NonEmptyType( innerType=$0 )"); + map.put(new Integer(100), "$type_e = :type <=> :qmark -> OptionalType( innerType=$0 )"); + map.put(new Integer(6), "$version = :version :version_name -> VersionDeclaration( v=$1 )"); + map.put(new Integer(62), "$wf_body_element = $call"); + map.put(new Integer(63), "$wf_body_element = $declaration"); + map.put(new Integer(64), "$wf_body_element = $if_stmt"); + map.put(new Integer(66), "$wf_body_element = $inputs"); + map.put(new Integer(67), "$wf_body_element = $outputs"); + map.put(new Integer(65), "$wf_body_element = $scatter"); + map.put(new Integer(69), "$wf_body_element = $wf_meta"); + map.put(new Integer(68), "$wf_body_element = $wf_parameter_meta"); + map.put(new Integer(84), "$wf_meta = :meta $meta_map -> Meta( map=$1 )"); + map.put(new Integer(83), "$wf_parameter_meta = :parameter_meta $meta_map -> ParameterMeta( map=$1 )"); + map.put(new Integer(61), "$workflow = :workflow :identifier :lbrace $_gen15 :rbrace -> Workflow( name=$1, body=$3 )"); rules = Collections.unmodifiableMap(map); } public static boolean is_terminal(int id) { diff --git a/wdl/transforms/draft3/src/main/java/wdl/draft3/parser/WdlParser.java b/wdl/transforms/draft3/src/main/java/wdl/draft3/parser/WdlParser.java index 7f18c3d4cf9..cbde065cf16 100644 --- a/wdl/transforms/draft3/src/main/java/wdl/draft3/parser/WdlParser.java +++ b/wdl/transforms/draft3/src/main/java/wdl/draft3/parser/WdlParser.java @@ -500,7 +500,7 @@ public static class WdlTerminalMap implements TerminalMap { id_to_term = new HashMap(); str_to_term = new HashMap(); for( WdlTerminalIdentifier terminal : terminals ) { - Integer id = terminal.id(); + Integer id = new Integer(terminal.id()); String str = terminal.string(); id_to_term.put(id, terminal); str_to_term.put(str, terminal); @@ -2566,141 +2566,141 @@ public enum WdlTerminalIdentifier implements TerminalIdentifier { } static { Map map = new HashMap(); - map.put(0, "$_gen0 = list($import)"); - map.put(1, "$_gen1 = list($file_body_element)"); - map.put(39, "$_gen10 = list($input_declaration)"); - map.put(42, "$_gen11 = list($kv)"); - map.put(47, "$_gen12 = list($meta_kv)"); - map.put(50, "$_gen13 = $setter"); - map.put(51, "$_gen13 = :_empty"); - map.put(56, "$_gen14 = list($output_kv)"); - map.put(59, "$_gen15 = list($wf_body_element)"); - map.put(70, "$_gen16 = $alias"); - map.put(71, "$_gen16 = :_empty"); - map.put(72, "$_gen17 = $call_brace_block"); - map.put(73, "$_gen17 = :_empty"); - map.put(75, "$_gen18 = $call_body"); - map.put(76, "$_gen18 = :_empty"); - map.put(78, "$_gen19 = list($input_kv, :comma)"); - map.put(7, "$_gen2 = list($struct_declaration)"); - map.put(93, "$_gen20 = list($meta_value, :comma)"); - map.put(95, "$_gen21 = list($meta_kv, :comma)"); - map.put(97, "$_gen22 = list($type_e, :comma)"); - map.put(119, "$_gen23 = list($e, :comma)"); - map.put(123, "$_gen24 = list($object_kv, :comma)"); - map.put(126, "$_gen25 = list($map_kv, :comma)"); - map.put(11, "$_gen3 = :_empty"); - map.put(10, "$_gen3 = :string"); - map.put(13, "$_gen4 = list($string_piece)"); - map.put(17, "$_gen5 = $import_namespace"); - map.put(18, "$_gen5 = :_empty"); - map.put(19, "$_gen6 = list($import_alias)"); - map.put(23, "$_gen7 = list($task_sections)"); - map.put(32, "$_gen8 = list($command_part)"); - map.put(36, "$_gen9 = list($expression_placeholder_kv)"); - map.put(80, "$alias = :as :identifier -> $1"); - map.put(74, "$call = :call :fqn $_gen16 $_gen17 -> Call( task=$1, alias=$2, body=$3 )"); - map.put(79, "$call_body = :input :colon $_gen19 -> CallBody( inputs=$2 )"); - map.put(77, "$call_brace_block = :lbrace $_gen18 :rbrace -> $1"); - map.put(33, "$command = :raw_command :raw_cmd_start $_gen8 :raw_cmd_end -> RawCommand( parts=$2 )"); - map.put(35, "$command_part = $expression_placeholder"); - map.put(34, "$command_part = :cmd_part"); - map.put(53, "$declaration = $type_e :identifier $setter -> Declaration( type=$0, name=$1, expression=$2 )"); - map.put(2, "$document = $version $_gen0 $_gen1 -> Draft3File( version=$0, imports=$1, body=$2 )"); - map.put(113, "$e = $e :asterisk $e -> Multiply( lhs=$0, rhs=$2 )"); - map.put(112, "$e = $e :dash $e -> Subtract( lhs=$0, rhs=$2 )"); - map.put(104, "$e = $e :double_ampersand $e -> LogicalAnd( lhs=$0, rhs=$2 )"); - map.put(105, "$e = $e :double_equal $e -> Equals( lhs=$0, rhs=$2 )"); - map.put(103, "$e = $e :double_pipe $e -> LogicalOr( lhs=$0, rhs=$2 )"); - map.put(109, "$e = $e :gt $e -> GreaterThan( lhs=$0, rhs=$2 )"); - map.put(110, "$e = $e :gteq $e -> GreaterThanOrEqual( lhs=$0, rhs=$2 )"); - map.put(107, "$e = $e :lt $e -> LessThan( lhs=$0, rhs=$2 )"); - map.put(108, "$e = $e :lteq $e -> LessThanOrEqual( lhs=$0, rhs=$2 )"); - map.put(106, "$e = $e :not_equal $e -> NotEquals( lhs=$0, rhs=$2 )"); - map.put(115, "$e = $e :percent $e -> Remainder( lhs=$0, rhs=$2 )"); - map.put(111, "$e = $e :plus $e -> Add( lhs=$0, rhs=$2 )"); - map.put(114, "$e = $e :slash $e -> Divide( lhs=$0, rhs=$2 )"); - map.put(122, "$e = $e <=> :dot :identifier -> MemberAccess( value=$0, member=$2 )"); - map.put(121, "$e = $e <=> :lsquare $e :rsquare -> ArrayOrMapLookup( lhs=$0, rhs=$2 )"); - map.put(130, "$e = $string_literal"); - map.put(132, "$e = :boolean"); - map.put(118, "$e = :dash $e -> UnaryNegation( expression=$1 )"); - map.put(134, "$e = :float"); - map.put(131, "$e = :identifier"); - map.put(120, "$e = :identifier <=> :lparen $_gen23 :rparen -> FunctionCall( name=$0, params=$2 )"); - map.put(129, "$e = :if $e :then $e :else $e -> TernaryIf( cond=$1, iftrue=$3, iffalse=$5 )"); - map.put(133, "$e = :integer"); - map.put(127, "$e = :lbrace $_gen25 :rbrace -> MapLiteral( map=$1 )"); - map.put(128, "$e = :lparen $_gen23 :rparen -> TupleLiteral( values=$1 )"); - map.put(125, "$e = :lsquare $_gen23 :rsquare -> ArrayLiteral( values=$1 )"); - map.put(116, "$e = :not $e -> LogicalNot( expression=$1 )"); - map.put(124, "$e = :object :lbrace $_gen24 :rbrace -> ObjectLiteral( map=$2 )"); - map.put(117, "$e = :plus $e -> UnaryPlus( expression=$1 )"); - map.put(37, "$expression_placeholder = :expression_placeholder_start $_gen9 $e :expression_placeholder_end -> ExpressionPlaceholder( attributes=$1, expr=$2 )"); - map.put(38, "$expression_placeholder_kv = :cmd_attr_hint :identifier :equal $e -> ExpressionPlaceholderAttr( key=$1, value=$3 )"); - map.put(5, "$file_body_element = $struct"); - map.put(4, "$file_body_element = $task"); - map.put(3, "$file_body_element = $workflow"); - map.put(84, "$if_stmt = :if :lparen $e :rparen :lbrace $_gen15 :rbrace -> If( expression=$2, body=$5 )"); - map.put(20, "$import = :import $static_string $_gen5 $_gen6 -> Import( uri=$1, namespace=$2, aliases=$3 )"); - map.put(22, "$import_alias = :alias :identifier :as :identifier -> ImportAlias( old_name=$1, new_name=$3 )"); - map.put(21, "$import_namespace = :as :identifier -> $1"); - map.put(52, "$input_declaration = $type_e :identifier $_gen13 -> InputDeclaration( type=$0, name=$1, expression=$2 )"); - map.put(87, "$input_kv = :identifier :equal $e -> ObjectKV( key=$0, value=$2 )"); - map.put(40, "$inputs = :input :lbrace $_gen10 :rbrace -> Inputs( inputs=$2 )"); - map.put(44, "$kv = :identifier :colon $e -> RuntimeAttribute( key=$0, value=$2 )"); - map.put(55, "$map_kv = $e :colon $e -> MapLiteralKv( key=$0, value=$2 )"); - map.put(45, "$meta = :meta $meta_map -> Meta( map=$1 )"); - map.put(49, "$meta_kv = :identifier :colon $meta_value -> MetaKvPair( key=$0, value=$2 )"); - map.put(48, "$meta_map = :lbrace $_gen12 :rbrace -> $1"); - map.put(88, "$meta_value = $static_string"); - map.put(89, "$meta_value = :boolean"); - map.put(91, "$meta_value = :float"); - map.put(90, "$meta_value = :integer"); - map.put(96, "$meta_value = :lbrace $_gen21 :rbrace -> MetaObject( map=$1 )"); - map.put(94, "$meta_value = :lsquare $_gen20 :rsquare -> MetaArray( values=$1 )"); - map.put(92, "$meta_value = :null"); - map.put(86, "$object_kv = :identifier :colon $e -> ObjectKV( key=$0, value=$2 )"); - map.put(58, "$output_kv = $type_e :identifier :equal $e -> Output( type=$0, name=$1, expression=$3 )"); - map.put(57, "$outputs = :output :lbrace $_gen14 :rbrace -> Outputs( outputs=$2 )"); - map.put(46, "$parameter_meta = :parameter_meta $meta_map -> ParameterMeta( map=$1 )"); - map.put(43, "$rt_map = :lbrace $_gen11 :rbrace -> $1"); - map.put(41, "$runtime = :runtime $rt_map -> Runtime( map=$1 )"); - map.put(85, "$scatter = :scatter :lparen :identifier :in $e :rparen :lbrace $_gen15 :rbrace -> Scatter( item=$2, collection=$4, body=$7 )"); - map.put(54, "$setter = :equal $e -> $1"); - map.put(12, "$static_string = :quote $_gen3 :quote -> StaticString( value=$1 )"); - map.put(14, "$string_literal = :quote $_gen4 :quote -> StringLiteral( pieces=$1 )"); - map.put(16, "$string_piece = $expression_placeholder"); - map.put(15, "$string_piece = :string"); - map.put(8, "$struct = :struct :identifier :lbrace $_gen2 :rbrace -> Struct( name=$1, entries=$3 )"); - map.put(9, "$struct_declaration = $type_e :identifier -> StructEntry( type=$0, name=$1 )"); - map.put(24, "$task = :task :identifier :lbrace $_gen7 :rbrace -> Task( name=$1, sections=$3 )"); - map.put(25, "$task_sections = $command"); - map.put(31, "$task_sections = $declaration"); - map.put(26, "$task_sections = $inputs"); - map.put(30, "$task_sections = $meta"); - map.put(27, "$task_sections = $outputs"); - map.put(29, "$task_sections = $parameter_meta"); - map.put(28, "$task_sections = $runtime"); - map.put(102, "$type_e = :identifier"); - map.put(101, "$type_e = :type"); - map.put(98, "$type_e = :type <=> :lsquare $_gen22 :rsquare -> Type( name=$0, subtype=$2 )"); - map.put(100, "$type_e = :type <=> :plus -> NonEmptyType( innerType=$0 )"); - map.put(99, "$type_e = :type <=> :qmark -> OptionalType( innerType=$0 )"); - map.put(6, "$version = :version :version_name -> VersionDeclaration( v=$1 )"); - map.put(61, "$wf_body_element = $call"); - map.put(62, "$wf_body_element = $declaration"); - map.put(64, "$wf_body_element = $if_stmt"); - map.put(66, "$wf_body_element = $inputs"); - map.put(67, "$wf_body_element = $outputs"); - map.put(65, "$wf_body_element = $scatter"); - map.put(69, "$wf_body_element = $wf_meta"); - map.put(68, "$wf_body_element = $wf_parameter_meta"); - map.put(63, "$wf_body_element = $while_loop"); - map.put(82, "$wf_meta = :meta $meta_map -> Meta( map=$1 )"); - map.put(81, "$wf_parameter_meta = :parameter_meta $meta_map -> ParameterMeta( map=$1 )"); - map.put(83, "$while_loop = :while :lparen $e :rparen :lbrace $_gen15 :rbrace -> WhileLoop( expression=$2, body=$5 )"); - map.put(60, "$workflow = :workflow :identifier :lbrace $_gen15 :rbrace -> Workflow( name=$1, body=$3 )"); + map.put(new Integer(0), "$_gen0 = list($import)"); + map.put(new Integer(1), "$_gen1 = list($file_body_element)"); + map.put(new Integer(39), "$_gen10 = list($input_declaration)"); + map.put(new Integer(42), "$_gen11 = list($kv)"); + map.put(new Integer(47), "$_gen12 = list($meta_kv)"); + map.put(new Integer(50), "$_gen13 = $setter"); + map.put(new Integer(51), "$_gen13 = :_empty"); + map.put(new Integer(56), "$_gen14 = list($output_kv)"); + map.put(new Integer(59), "$_gen15 = list($wf_body_element)"); + map.put(new Integer(70), "$_gen16 = $alias"); + map.put(new Integer(71), "$_gen16 = :_empty"); + map.put(new Integer(72), "$_gen17 = $call_brace_block"); + map.put(new Integer(73), "$_gen17 = :_empty"); + map.put(new Integer(75), "$_gen18 = $call_body"); + map.put(new Integer(76), "$_gen18 = :_empty"); + map.put(new Integer(78), "$_gen19 = list($input_kv, :comma)"); + map.put(new Integer(7), "$_gen2 = list($struct_declaration)"); + map.put(new Integer(93), "$_gen20 = list($meta_value, :comma)"); + map.put(new Integer(95), "$_gen21 = list($meta_kv, :comma)"); + map.put(new Integer(97), "$_gen22 = list($type_e, :comma)"); + map.put(new Integer(119), "$_gen23 = list($e, :comma)"); + map.put(new Integer(123), "$_gen24 = list($object_kv, :comma)"); + map.put(new Integer(126), "$_gen25 = list($map_kv, :comma)"); + map.put(new Integer(11), "$_gen3 = :_empty"); + map.put(new Integer(10), "$_gen3 = :string"); + map.put(new Integer(13), "$_gen4 = list($string_piece)"); + map.put(new Integer(17), "$_gen5 = $import_namespace"); + map.put(new Integer(18), "$_gen5 = :_empty"); + map.put(new Integer(19), "$_gen6 = list($import_alias)"); + map.put(new Integer(23), "$_gen7 = list($task_sections)"); + map.put(new Integer(32), "$_gen8 = list($command_part)"); + map.put(new Integer(36), "$_gen9 = list($expression_placeholder_kv)"); + map.put(new Integer(80), "$alias = :as :identifier -> $1"); + map.put(new Integer(74), "$call = :call :fqn $_gen16 $_gen17 -> Call( task=$1, alias=$2, body=$3 )"); + map.put(new Integer(79), "$call_body = :input :colon $_gen19 -> CallBody( inputs=$2 )"); + map.put(new Integer(77), "$call_brace_block = :lbrace $_gen18 :rbrace -> $1"); + map.put(new Integer(33), "$command = :raw_command :raw_cmd_start $_gen8 :raw_cmd_end -> RawCommand( parts=$2 )"); + map.put(new Integer(35), "$command_part = $expression_placeholder"); + map.put(new Integer(34), "$command_part = :cmd_part"); + map.put(new Integer(53), "$declaration = $type_e :identifier $setter -> Declaration( type=$0, name=$1, expression=$2 )"); + map.put(new Integer(2), "$document = $version $_gen0 $_gen1 -> Draft3File( version=$0, imports=$1, body=$2 )"); + map.put(new Integer(113), "$e = $e :asterisk $e -> Multiply( lhs=$0, rhs=$2 )"); + map.put(new Integer(112), "$e = $e :dash $e -> Subtract( lhs=$0, rhs=$2 )"); + map.put(new Integer(104), "$e = $e :double_ampersand $e -> LogicalAnd( lhs=$0, rhs=$2 )"); + map.put(new Integer(105), "$e = $e :double_equal $e -> Equals( lhs=$0, rhs=$2 )"); + map.put(new Integer(103), "$e = $e :double_pipe $e -> LogicalOr( lhs=$0, rhs=$2 )"); + map.put(new Integer(109), "$e = $e :gt $e -> GreaterThan( lhs=$0, rhs=$2 )"); + map.put(new Integer(110), "$e = $e :gteq $e -> GreaterThanOrEqual( lhs=$0, rhs=$2 )"); + map.put(new Integer(107), "$e = $e :lt $e -> LessThan( lhs=$0, rhs=$2 )"); + map.put(new Integer(108), "$e = $e :lteq $e -> LessThanOrEqual( lhs=$0, rhs=$2 )"); + map.put(new Integer(106), "$e = $e :not_equal $e -> NotEquals( lhs=$0, rhs=$2 )"); + map.put(new Integer(115), "$e = $e :percent $e -> Remainder( lhs=$0, rhs=$2 )"); + map.put(new Integer(111), "$e = $e :plus $e -> Add( lhs=$0, rhs=$2 )"); + map.put(new Integer(114), "$e = $e :slash $e -> Divide( lhs=$0, rhs=$2 )"); + map.put(new Integer(122), "$e = $e <=> :dot :identifier -> MemberAccess( value=$0, member=$2 )"); + map.put(new Integer(121), "$e = $e <=> :lsquare $e :rsquare -> ArrayOrMapLookup( lhs=$0, rhs=$2 )"); + map.put(new Integer(130), "$e = $string_literal"); + map.put(new Integer(132), "$e = :boolean"); + map.put(new Integer(118), "$e = :dash $e -> UnaryNegation( expression=$1 )"); + map.put(new Integer(134), "$e = :float"); + map.put(new Integer(131), "$e = :identifier"); + map.put(new Integer(120), "$e = :identifier <=> :lparen $_gen23 :rparen -> FunctionCall( name=$0, params=$2 )"); + map.put(new Integer(129), "$e = :if $e :then $e :else $e -> TernaryIf( cond=$1, iftrue=$3, iffalse=$5 )"); + map.put(new Integer(133), "$e = :integer"); + map.put(new Integer(127), "$e = :lbrace $_gen25 :rbrace -> MapLiteral( map=$1 )"); + map.put(new Integer(128), "$e = :lparen $_gen23 :rparen -> TupleLiteral( values=$1 )"); + map.put(new Integer(125), "$e = :lsquare $_gen23 :rsquare -> ArrayLiteral( values=$1 )"); + map.put(new Integer(116), "$e = :not $e -> LogicalNot( expression=$1 )"); + map.put(new Integer(124), "$e = :object :lbrace $_gen24 :rbrace -> ObjectLiteral( map=$2 )"); + map.put(new Integer(117), "$e = :plus $e -> UnaryPlus( expression=$1 )"); + map.put(new Integer(37), "$expression_placeholder = :expression_placeholder_start $_gen9 $e :expression_placeholder_end -> ExpressionPlaceholder( attributes=$1, expr=$2 )"); + map.put(new Integer(38), "$expression_placeholder_kv = :cmd_attr_hint :identifier :equal $e -> ExpressionPlaceholderAttr( key=$1, value=$3 )"); + map.put(new Integer(5), "$file_body_element = $struct"); + map.put(new Integer(4), "$file_body_element = $task"); + map.put(new Integer(3), "$file_body_element = $workflow"); + map.put(new Integer(84), "$if_stmt = :if :lparen $e :rparen :lbrace $_gen15 :rbrace -> If( expression=$2, body=$5 )"); + map.put(new Integer(20), "$import = :import $static_string $_gen5 $_gen6 -> Import( uri=$1, namespace=$2, aliases=$3 )"); + map.put(new Integer(22), "$import_alias = :alias :identifier :as :identifier -> ImportAlias( old_name=$1, new_name=$3 )"); + map.put(new Integer(21), "$import_namespace = :as :identifier -> $1"); + map.put(new Integer(52), "$input_declaration = $type_e :identifier $_gen13 -> InputDeclaration( type=$0, name=$1, expression=$2 )"); + map.put(new Integer(87), "$input_kv = :identifier :equal $e -> ObjectKV( key=$0, value=$2 )"); + map.put(new Integer(40), "$inputs = :input :lbrace $_gen10 :rbrace -> Inputs( inputs=$2 )"); + map.put(new Integer(44), "$kv = :identifier :colon $e -> RuntimeAttribute( key=$0, value=$2 )"); + map.put(new Integer(55), "$map_kv = $e :colon $e -> MapLiteralKv( key=$0, value=$2 )"); + map.put(new Integer(45), "$meta = :meta $meta_map -> Meta( map=$1 )"); + map.put(new Integer(49), "$meta_kv = :identifier :colon $meta_value -> MetaKvPair( key=$0, value=$2 )"); + map.put(new Integer(48), "$meta_map = :lbrace $_gen12 :rbrace -> $1"); + map.put(new Integer(88), "$meta_value = $static_string"); + map.put(new Integer(89), "$meta_value = :boolean"); + map.put(new Integer(91), "$meta_value = :float"); + map.put(new Integer(90), "$meta_value = :integer"); + map.put(new Integer(96), "$meta_value = :lbrace $_gen21 :rbrace -> MetaObject( map=$1 )"); + map.put(new Integer(94), "$meta_value = :lsquare $_gen20 :rsquare -> MetaArray( values=$1 )"); + map.put(new Integer(92), "$meta_value = :null"); + map.put(new Integer(86), "$object_kv = :identifier :colon $e -> ObjectKV( key=$0, value=$2 )"); + map.put(new Integer(58), "$output_kv = $type_e :identifier :equal $e -> Output( type=$0, name=$1, expression=$3 )"); + map.put(new Integer(57), "$outputs = :output :lbrace $_gen14 :rbrace -> Outputs( outputs=$2 )"); + map.put(new Integer(46), "$parameter_meta = :parameter_meta $meta_map -> ParameterMeta( map=$1 )"); + map.put(new Integer(43), "$rt_map = :lbrace $_gen11 :rbrace -> $1"); + map.put(new Integer(41), "$runtime = :runtime $rt_map -> Runtime( map=$1 )"); + map.put(new Integer(85), "$scatter = :scatter :lparen :identifier :in $e :rparen :lbrace $_gen15 :rbrace -> Scatter( item=$2, collection=$4, body=$7 )"); + map.put(new Integer(54), "$setter = :equal $e -> $1"); + map.put(new Integer(12), "$static_string = :quote $_gen3 :quote -> StaticString( value=$1 )"); + map.put(new Integer(14), "$string_literal = :quote $_gen4 :quote -> StringLiteral( pieces=$1 )"); + map.put(new Integer(16), "$string_piece = $expression_placeholder"); + map.put(new Integer(15), "$string_piece = :string"); + map.put(new Integer(8), "$struct = :struct :identifier :lbrace $_gen2 :rbrace -> Struct( name=$1, entries=$3 )"); + map.put(new Integer(9), "$struct_declaration = $type_e :identifier -> StructEntry( type=$0, name=$1 )"); + map.put(new Integer(24), "$task = :task :identifier :lbrace $_gen7 :rbrace -> Task( name=$1, sections=$3 )"); + map.put(new Integer(25), "$task_sections = $command"); + map.put(new Integer(31), "$task_sections = $declaration"); + map.put(new Integer(26), "$task_sections = $inputs"); + map.put(new Integer(30), "$task_sections = $meta"); + map.put(new Integer(27), "$task_sections = $outputs"); + map.put(new Integer(29), "$task_sections = $parameter_meta"); + map.put(new Integer(28), "$task_sections = $runtime"); + map.put(new Integer(102), "$type_e = :identifier"); + map.put(new Integer(101), "$type_e = :type"); + map.put(new Integer(98), "$type_e = :type <=> :lsquare $_gen22 :rsquare -> Type( name=$0, subtype=$2 )"); + map.put(new Integer(100), "$type_e = :type <=> :plus -> NonEmptyType( innerType=$0 )"); + map.put(new Integer(99), "$type_e = :type <=> :qmark -> OptionalType( innerType=$0 )"); + map.put(new Integer(6), "$version = :version :version_name -> VersionDeclaration( v=$1 )"); + map.put(new Integer(61), "$wf_body_element = $call"); + map.put(new Integer(62), "$wf_body_element = $declaration"); + map.put(new Integer(64), "$wf_body_element = $if_stmt"); + map.put(new Integer(66), "$wf_body_element = $inputs"); + map.put(new Integer(67), "$wf_body_element = $outputs"); + map.put(new Integer(65), "$wf_body_element = $scatter"); + map.put(new Integer(69), "$wf_body_element = $wf_meta"); + map.put(new Integer(68), "$wf_body_element = $wf_parameter_meta"); + map.put(new Integer(63), "$wf_body_element = $while_loop"); + map.put(new Integer(82), "$wf_meta = :meta $meta_map -> Meta( map=$1 )"); + map.put(new Integer(81), "$wf_parameter_meta = :parameter_meta $meta_map -> ParameterMeta( map=$1 )"); + map.put(new Integer(83), "$while_loop = :while :lparen $e :rparen :lbrace $_gen15 :rbrace -> WhileLoop( expression=$2, body=$5 )"); + map.put(new Integer(60), "$workflow = :workflow :identifier :lbrace $_gen15 :rbrace -> Workflow( name=$1, body=$3 )"); rules = Collections.unmodifiableMap(map); } public static boolean is_terminal(int id) {